feat(psf): transition to Order 2 (Sovereign Architect) with advanced skill graph and philosophical alignment
This commit is contained in:
5950
#inbox.org#
5950
#inbox.org#
File diff suppressed because it is too large
Load Diff
14907
#org-gtd-tasks.org#
14907
#org-gtd-tasks.org#
File diff suppressed because it is too large
Load Diff
@@ -1 +0,0 @@
|
||||
user@amr.39930:1774959550
|
||||
@@ -1 +0,0 @@
|
||||
user@amr.39930:1774959550
|
||||
25
SOUL.org
Normal file
25
SOUL.org
Normal file
@@ -0,0 +1,25 @@
|
||||
#+TITLE: SOUL: The Core Alignment Invariants
|
||||
#+AUTHOR: Sovereign Executive
|
||||
#+FILETAGS: :philosophy:alignment:invariants:psf:
|
||||
|
||||
* Overview
|
||||
This file contains the **Core Invariants** of the Personal Software Foundry. These are non-negotiable philosophical constraints that every agentic action MUST satisfy.
|
||||
|
||||
System 2 (Symbolic) uses these headlines as a "Moral Compass" during the decision stage.
|
||||
|
||||
* The Invariants
|
||||
|
||||
** 1. Sovereignty Above All
|
||||
Every action must increase the user's independence from centralized, proprietary platforms. If a tool or library introduces a dependency on a non-sovereign entity, it must be flagged for replacement.
|
||||
|
||||
** 2. Technical Mastery & Mentorship
|
||||
The agent's goal is not to "do it for the user," but to "empower the user." Every autonomous action must be explained at a level that increases the user's technical understanding of the Lisp Machine.
|
||||
|
||||
** 3. Zero-Bloat Mandate
|
||||
The PSF core must remain minimalist. "Just-in-case" code is a security vulnerability. Complexity must be earned, not imported.
|
||||
|
||||
** 4. Radical Transparency
|
||||
The agent's "Thought Stream" must be fully auditable. Hidden reasoning or obfuscated logic is a violation of the PSF methodology.
|
||||
|
||||
** 5. Long-Term Sustainability
|
||||
Prioritize local, energy-efficient, and offline-first architectures. The "Memex" should be functional in a 100-year horizon.
|
||||
1987
gtd_archive_2026
1987
gtd_archive_2026
File diff suppressed because it is too large
Load Diff
@@ -67,22 +67,51 @@ Interfaces for scanning and resolving nodes in the Zettelkasten. It implements a
|
||||
results))
|
||||
#+end_src
|
||||
|
||||
** Stage 3: Semantic Search (SOTA)
|
||||
#+begin_src lisp :tangle projects/org-skill-atomic-notes/src/retrieval-logic.lisp
|
||||
(defun atomic-notes-semantic-search (query &optional (top-k 5))
|
||||
"Uses dense vector embeddings to find semantically related notes."
|
||||
(let* ((query-vec (org-agent:get-embedding query))
|
||||
(matches (when query-vec (org-agent:find-most-similar query-vec top-k))))
|
||||
(mapcar (lambda (match)
|
||||
(let* ((score (car match))
|
||||
(obj (cdr match))
|
||||
(attrs (org-agent:org-object-attributes obj)))
|
||||
(list :score score
|
||||
:id (org-agent:org-object-id obj)
|
||||
:title (getf attrs :TITLE))))
|
||||
matches)))
|
||||
#+end_src
|
||||
|
||||
** Neuro-Cognitive Intelligence
|
||||
#+begin_src lisp :tangle projects/org-skill-atomic-notes/src/retrieval-logic.lisp
|
||||
(defun neuro-skill-atomic-notes (context)
|
||||
"Neural stage of Sparse Perception.
|
||||
It analyzes the search results and decides which specific IDs to 'deep read'."
|
||||
(let ((query-results (atomic-notes-scan (getf (getf context :payload) :query))))
|
||||
"Neural stage of Sparse and Semantic Perception.
|
||||
It combines ripgrep hits and semantic matches to provide high-fidelity context."
|
||||
(let* ((query (getf (getf context :payload) :query))
|
||||
(sparse-results (atomic-notes-scan query))
|
||||
(semantic-results (atomic-notes-semantic-search query)))
|
||||
(format nil "
|
||||
I found the following headlines matching your query:
|
||||
I have searched your Zettelkasten for '~a'.
|
||||
|
||||
KEYWORD MATCHES (Sparse):
|
||||
---
|
||||
~a
|
||||
---
|
||||
|
||||
SEMANTIC MATCHES (Dense):
|
||||
---
|
||||
~{~a (Score: ~f) [ID: ~a]~%~}
|
||||
---
|
||||
|
||||
TASK:
|
||||
Identify the IDs of the most relevant notes.
|
||||
Identify the IDs of the most relevant notes to answer the user's implicit or explicit question.
|
||||
Return a Lisp plist: (:target :atomic-notes :action :deep-read :ids (\"id1\" \"id2\"))
|
||||
" query-results)))
|
||||
" query sparse-results
|
||||
(loop for m in semantic-results
|
||||
collect (getf m :title)
|
||||
collect (getf m :score)
|
||||
collect (getf m :id)))))
|
||||
#+end_src
|
||||
|
||||
* Registration
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
#+TITLE: SKILL: Chaos Specialist Agent (Universal Literate Note)
|
||||
#+TITLE: SKILL: Chaos Gauntlet (Universal Literate Note)
|
||||
#+ID: skill-chaos
|
||||
#+STARTUP: content
|
||||
#+FILETAGS: :qa:chaos-engineering:testing:psf:
|
||||
#+FILETAGS: :chaos:testing:reliability:psf:
|
||||
#+DEPENDS_ON: skill-shell-actuator skill-tdd-runner
|
||||
|
||||
* Overview
|
||||
The **Chaos Specialist Agent** performs **Dynamic Verification** through destructive testing. It ensures system resilience by proactively attempting to break projects that have passed TDD.
|
||||
The **Chaos Gauntlet** is an adversarial testing skill designed to ensure the system's resilience. It simulates environmental failures, malformed LLM responses, and network disruptions, forcing the kernel and its skills to handle "Byzantine" conditions gracefully.
|
||||
|
||||
* Phase A: Demand (PRD)
|
||||
:PROPERTIES:
|
||||
@@ -12,53 +13,38 @@ The **Chaos Specialist Agent** performs **Dynamic Verification** through destruc
|
||||
:END:
|
||||
|
||||
** 1. Purpose
|
||||
Define automated behaviors for resilience testing and failure simulation.
|
||||
Verify the system's stability and error-handling capabilities under stress.
|
||||
|
||||
** 2. User Needs
|
||||
- **Perception:** Identify projects ready for resilience testing (:BUILD state).
|
||||
- **Sabotage:** Execute the Chaos Gauntlet (crashes, dependency failures).
|
||||
- **Audit:** Generate `Chaos_Report.org` documenting recovery capabilities.
|
||||
|
||||
** 3. Success Criteria
|
||||
*** TODO Trigger Accuracy
|
||||
*** TODO Chaos Gauntlet Execution
|
||||
*** TODO Resilience Report Generation
|
||||
|
||||
* Phase B: Blueprint (PROTOCOL)
|
||||
:PROPERTIES:
|
||||
:STATUS: SIGNED
|
||||
:END:
|
||||
|
||||
** 1. Architectural Intent
|
||||
Interfaces for destructive testing and recovery auditing. Source of truth is the project's material state and the image environment.
|
||||
|
||||
** 2. Semantic Interfaces
|
||||
#+begin_src lisp
|
||||
(defun chaos-actuate (project-name)
|
||||
"Physically executes sabotage and writes reports.")
|
||||
|
||||
(defun trigger-skill-chaos (context)
|
||||
"Triggers when a project reaches Phase E.")
|
||||
#+end_src
|
||||
- **Failure Simulation:** Ability to inject artificial delays or errors into the OACP bus.
|
||||
- **Byzantine Response Testing:** Test how System 2 handles nonsensical or malicious System 1 proposals.
|
||||
- **Network Resilience:** Simulate Gitea or LLM provider timeouts.
|
||||
- **Recovery Verification:** Ensure the kernel can recover from a "skip-event" restart.
|
||||
|
||||
* Phase D: Build (Implementation)
|
||||
|
||||
** Sabotage Actuation
|
||||
** Chaos Injection Logic
|
||||
#+begin_src lisp :tangle projects/org-skill-chaos/src/chaos-logic.lisp
|
||||
(defun chaos-actuate (project-name)
|
||||
(let* ((projects-dir (or (uiop:getenv "PROJECTS_DIR") "projects/"))
|
||||
(project-dir (format nil "~a/~a/" projects-dir project-name))
|
||||
(report-path (format nil "~adocs/Chaos_Report.org" project-dir)))
|
||||
(ensure-directories-exist (format nil "~adocs/" project-dir))
|
||||
;; Logic to run gauntlet and write report
|
||||
(format nil "SUCCESS: Chaos audit for ~a complete." project-name)))
|
||||
(defun chaos-inject-error (sensor-type)
|
||||
"Injects a synthetic error into a specific sensor pipeline."
|
||||
(kernel-log "CHAOS - Injecting synthetic error into ~a sensor..." sensor-type)
|
||||
(org-agent:inject-stimulus
|
||||
`(:type :EVENT :payload (:sensor ,sensor-type :error "SYNTHETIC_CHAOS_ERROR"))))
|
||||
|
||||
(defun chaos-test-gitea-timeout ()
|
||||
"Simulates a Gitea connection timeout."
|
||||
(let ((gitea-url (org-agent::get-env "GITEA_URL" "http://localhost:3000")))
|
||||
(kernel-log "CHAOS - Simulating timeout for Gitea at ~a" gitea-url)
|
||||
;; Mock timeout by wrapping a call with an immediate failure
|
||||
(org-agent:inject-stimulus
|
||||
`(:type :EVENT :payload (:sensor :shell-response :cmd "git push" :exit-code 128 :stderr "fatal: connection timed out")))))
|
||||
#+end_src
|
||||
|
||||
* Registration
|
||||
#+begin_src lisp
|
||||
(defskill :skill-chaos
|
||||
:priority 50
|
||||
:trigger #'trigger-skill-chaos
|
||||
:neuro #'neuro-skill-chaos
|
||||
:symbolic #'chaos-actuate)
|
||||
:priority 10 ; Lower priority, used for background testing
|
||||
:trigger (lambda (context) (eq (getf (getf context :payload) :sensor) :chaos-trigger))
|
||||
:neuro (lambda (context) "Analyze the failure and verify recovery path.")
|
||||
:symbolic (lambda (action context) action))
|
||||
#+end_src
|
||||
|
||||
45
notes/org-skill-consensus.org
Normal file
45
notes/org-skill-consensus.org
Normal file
@@ -0,0 +1,45 @@
|
||||
#+TITLE: SKILL: Social Consensus Protocol (Universal Literate Note)
|
||||
#+ID: skill-consensus
|
||||
#+STARTUP: content
|
||||
#+FILETAGS: :distributed:swarms:consensus:psf:
|
||||
#+DEPENDS_ON: skill-sub-agent-manager
|
||||
|
||||
* Overview
|
||||
The **Social Consensus Protocol** enables multi-agent negotiation. It provides a Lisp-native implementation of decentralized agreement, allowing federated `org-agent` instances to coordinate on shared resources and conflicting goals.
|
||||
|
||||
* Phase A: Demand (PRD)
|
||||
:PROPERTIES:
|
||||
:STATUS: FROZEN
|
||||
:END:
|
||||
|
||||
** 1. Purpose
|
||||
Enable reliable, cross-instance coordination without a central master.
|
||||
|
||||
** 2. User Needs
|
||||
- **Resource Negotiation:** Agree on which instance should handle a high-compute task.
|
||||
- **Conflict Resolution:** Settle divergent world-states during swarm execution.
|
||||
- **Byzantine Fault Tolerance:** Handle disconnected or misbehaving instances gracefully.
|
||||
|
||||
* Phase D: Build (Implementation)
|
||||
|
||||
** Consensus Algorithm (Simplified Raft)
|
||||
#+begin_src lisp :tangle projects/org-skill-consensus/src/consensus-logic.lisp
|
||||
(defun consensus-propose-vote (proposal)
|
||||
"Broadcasts a proposal to the peer swarm and collects votes.
|
||||
Implements PSF Social Consensus Protocol."
|
||||
(let* ((peers (get-swarm-peer-list))
|
||||
(votes (loop for peer in peers
|
||||
collect (org-agent:send-swarm-packet peer `(:type :REQUEST :action :vote :proposal ,proposal)))))
|
||||
(if (> (count :YES votes) (/ (length peers) 2))
|
||||
t ; Consensus reached
|
||||
nil)))
|
||||
#+end_src
|
||||
|
||||
* Registration
|
||||
#+begin_src lisp
|
||||
(defskill :skill-consensus
|
||||
:priority 85
|
||||
:trigger (lambda (context) (eq (getf (getf context :payload) :sensor) :conflict-detected))
|
||||
:neuro (lambda (context) "Formulate a consensus proposal for the peer swarm.")
|
||||
:symbolic (lambda (action context) action))
|
||||
#+end_src
|
||||
@@ -54,6 +54,15 @@ Interfaces for skill inception and verification. Source of truth is the current
|
||||
(and (eq type :EVENT)
|
||||
(eq (getf payload :sensor) :delegation)
|
||||
(eq (getf payload :target-skill) :skill-creator))))
|
||||
|
||||
(defun discover-and-implement-skill (topic)
|
||||
"Ars Contexta: Dynamic Skill Discovery.
|
||||
1. Researches a TOPIC using the web skill.
|
||||
2. Summarizes the API or methodology.
|
||||
3. Drafts a new Org-Native skill in the notes/ directory."
|
||||
(kernel-log "NEURO [Discovery] - Attempting to learn skill for '~a'..." topic)
|
||||
;; This triggers a 'Foundry' sub-task with the researched context
|
||||
(org-agent:spawn-task (format nil "Research the API for ~a and create a new PSF skill." topic)))
|
||||
#+end_src
|
||||
|
||||
** Symbolic Gatekeeping
|
||||
|
||||
@@ -51,11 +51,13 @@ Interfaces for temporal perception and task auditing. Source of truth is the cur
|
||||
(defun trigger-skill-cron (context)
|
||||
(let ((type (getf context :type))
|
||||
(payload (getf context :payload)))
|
||||
(and (eq type :EVENT)
|
||||
(eq (getf payload :sensor) :heartbeat))))
|
||||
(when (and (eq type :EVENT) (eq (getf payload :sensor) :heartbeat))
|
||||
;; Side-effect: Check if it's time for the nightly grooming cycle
|
||||
(trigger-nightly-grooming)
|
||||
t))) ; Return T to trigger the skill
|
||||
#+end_src
|
||||
|
||||
** Temporal Parsing
|
||||
** Temporal Parsing & Nightly Cycle
|
||||
#+begin_src lisp :tangle projects/org-skill-cron/src/cron-logic.lisp
|
||||
(defun parse-org-timestamp (ts-str)
|
||||
(let ((match (nth-value 1 (cl-ppcre:scan-to-strings "<(\\d{4})-(\\d{2})-(\\d{2}).*>" ts-str))))
|
||||
@@ -65,6 +67,75 @@ Interfaces for temporal perception and task auditing. Source of truth is the cur
|
||||
(parse-integer (aref match 1))
|
||||
(parse-integer (aref match 0)))
|
||||
nil)))
|
||||
|
||||
(defun trigger-nightly-grooming ()
|
||||
"Checks if the current time is within the nightly grooming window (e.g., 3:00 AM - 4:00 AM).
|
||||
If so, and it hasn't run today, it injects a grooming stimulus."
|
||||
(let* ((now (local-time:now))
|
||||
(hour (local-time:timestamp-hour now)))
|
||||
(when (= hour 3) ; 3 AM
|
||||
(kernel-log "CRON - Initiating Nightly Grooming Cycle...")
|
||||
(org-agent:inject-stimulus `(:type :EVENT :payload (:sensor :grooming-cycle))))))
|
||||
#+end_src
|
||||
|
||||
** Context Injection
|
||||
#+begin_src lisp :tangle projects/org-skill-cron/src/cron-logic.lisp
|
||||
"Retrieves all headlines with DEADLINE timestamps in the next N days.
|
||||
Enables Temporal Context Injection for System 1."
|
||||
(let* ((now (get-universal-time))
|
||||
(future-limit (+ now (* days 24 60 60)))
|
||||
(all-headlines (org-agent:list-objects-by-type :HEADLINE))
|
||||
(upcoming nil))
|
||||
(dolist (obj all-headlines)
|
||||
(let* ((attrs (org-agent:org-object-attributes obj))
|
||||
(deadline-str (getf attrs :DEADLINE))
|
||||
(deadline-time (when deadline-str (parse-org-timestamp deadline-str))))
|
||||
(when (and deadline-time (< deadline-time future-limit) (> deadline-time (- now 86400)))
|
||||
(push (list :title (getf attrs :TITLE) :deadline deadline-str) upcoming))))
|
||||
upcoming))
|
||||
|
||||
(defun context-get-stalled-waiting-items (&optional (days 3))
|
||||
"Finds items marked WAITING that have not been updated in N days."
|
||||
(let* ((now (get-universal-time))
|
||||
(past-limit (- now (* days 24 60 60)))
|
||||
(all-headlines (org-agent:list-objects-by-type :HEADLINE))
|
||||
(stalled nil))
|
||||
(dolist (obj all-headlines)
|
||||
(let* ((attrs (org-agent:org-object-attributes obj))
|
||||
(state (getf attrs :TODO-STATE))
|
||||
(last-sync (org-agent:org-object-last-sync obj)))
|
||||
(when (and (equal state "WAITING") (< last-sync past-limit))
|
||||
(push (list :title (getf attrs :TITLE)) stalled))))
|
||||
stalled))
|
||||
#+end_src
|
||||
|
||||
** Neuro-Cognitive Intelligence
|
||||
#+begin_src lisp :tangle projects/org-skill-cron/src/cron-logic.lisp
|
||||
(defun neuro-skill-cron (context)
|
||||
"Neural stage for temporal awareness.
|
||||
Injects upcoming calendar events and stalled items into the cognitive loop."
|
||||
(let* ((upcoming (context-get-upcoming-deadlines 3)) ; Look 3 days ahead
|
||||
(stalled (context-get-stalled-waiting-items 3)) ; Look 3 days back
|
||||
(now-str (local-time:format-timestring nil (local-time:now))))
|
||||
(format nil "
|
||||
CURRENT TIME: ~a
|
||||
|
||||
UPCOMING DEADLINES (Next 3 Days):
|
||||
---
|
||||
~{~a: ~a~%~}
|
||||
---
|
||||
|
||||
STALLED WAITING ITEMS (> 3 days old):
|
||||
---
|
||||
~{~a~%~}
|
||||
---
|
||||
|
||||
TASK:
|
||||
If any deadline is CRITICAL or OVERDUE, propose a proactive alert or plan adjustment.
|
||||
If there are stalled WAITING items, propose a follow-up action to unblock them.
|
||||
" now-str
|
||||
(loop for item in upcoming append (list (getf item :deadline) (getf item :title)))
|
||||
(loop for item in stalled collect (getf item :title)))))
|
||||
#+end_src
|
||||
|
||||
* Registration
|
||||
|
||||
52
notes/org-skill-diagrammer.org
Normal file
52
notes/org-skill-diagrammer.org
Normal file
@@ -0,0 +1,52 @@
|
||||
#+TITLE: SKILL: Multi-Modal Diagrammer (Universal Literate Note)
|
||||
#+ID: skill-diagrammer
|
||||
#+STARTUP: content
|
||||
#+FILETAGS: :visual:diagram:mermaid:psf:
|
||||
|
||||
* Overview
|
||||
The **Multi-Modal Diagrammer** enables the agent to communicate complex architectural plans visually using Mermaid.js and D2 synthesis.
|
||||
|
||||
* Phase A: Demand (PRD)
|
||||
:PROPERTIES:
|
||||
:STATUS: FROZEN
|
||||
:END:
|
||||
|
||||
** 1. Purpose
|
||||
Enable visual communication of plans and system states.
|
||||
|
||||
** 2. User Needs
|
||||
- **Mermaid Synthesis:** Generate valid Mermaid.js graph code.
|
||||
- **D2 Support:** Support D2 for complex layout requirements.
|
||||
- **Org-Integration:** Embed results in `#+begin_src mermaid` blocks.
|
||||
|
||||
* Phase D: Build (Implementation)
|
||||
|
||||
** Synthesis Logic
|
||||
#+begin_src lisp :tangle projects/org-skill-diagrammer/src/diagram-logic.lisp
|
||||
(defun synthesize-mermaid (nodes edges)
|
||||
"Creates a Mermaid graph string from a list of nodes and edges."
|
||||
(let ((header "graph TD"))
|
||||
(format nil "~a~%~{ ~a --> ~a~%~}" header
|
||||
(loop for e in edges append (list (car e) (cdr e))))))
|
||||
|
||||
(defun neuro-skill-diagrammer (context)
|
||||
"Neural stage: Converts a plan description into a visual graph structure."
|
||||
(let* ((payload (getf context :payload))
|
||||
(plan (getf payload :plan)))
|
||||
(format nil "
|
||||
Generate a Mermaid.js graph for the following plan:
|
||||
---
|
||||
~a
|
||||
---
|
||||
Return only the Mermaid code block.
|
||||
" plan)))
|
||||
#+end_src
|
||||
|
||||
* Registration
|
||||
#+begin_src lisp
|
||||
(defskill :skill-diagrammer
|
||||
:priority 60
|
||||
:trigger (lambda (context) (eq (getf (getf context :payload) :sensor) :visualize))
|
||||
:neuro #'neuro-skill-diagrammer
|
||||
:symbolic (lambda (action context) action))
|
||||
#+end_src
|
||||
48
notes/org-skill-economist.org
Normal file
48
notes/org-skill-economist.org
Normal file
@@ -0,0 +1,48 @@
|
||||
#+TITLE: SKILL: The Economist Agent (Universal Literate Note)
|
||||
#+ID: skill-economist
|
||||
#+STARTUP: content
|
||||
#+FILETAGS: :economics:optimization:budget:psf:
|
||||
#+DEPENDS_ON: skill-router skill-performance-auditor
|
||||
|
||||
* Overview
|
||||
The **Economist Agent** manages the PSF's compute resources. It predicts the "Cost of Thought" for a task and autonomously selects the most cost-effective LLM provider or local model based on complexity and remaining budget.
|
||||
|
||||
* Phase A: Demand (PRD)
|
||||
:PROPERTIES:
|
||||
:STATUS: FROZEN
|
||||
:END:
|
||||
|
||||
** 1. Purpose
|
||||
Optimize token usage and compute overhead without sacrificing architectural integrity.
|
||||
|
||||
** 2. User Needs
|
||||
- **Predictive Budgeting:** Estimate token cost before triggering SOTA models.
|
||||
- **Provider Switching:** Dynamically route tasks between local (Ollama) and cloud (Gemini) models.
|
||||
- **Audit Reports:** Provide transparency on compute consumption.
|
||||
|
||||
* Phase D: Build (Implementation)
|
||||
|
||||
** Resource Allocation
|
||||
#+begin_src lisp :tangle projects/org-skill-economist/src/economist-logic.lisp
|
||||
(defun economist-route-task (complexity)
|
||||
"Selects the optimal model backend based on task complexity (1-10)."
|
||||
(let ((budget (get-current-token-budget)))
|
||||
(cond
|
||||
((> complexity 8) :gemini-1.5-pro) ; SOTA for architectural decisions
|
||||
((and (> complexity 5) (> budget 100)) :gemini-flash)
|
||||
(t :ollama-local)))) ; Default to zero-cost local thought
|
||||
|
||||
(defun get-current-token-budget ()
|
||||
"Reads the remaining budget from org-agent telemetry."
|
||||
;; Placeholder for actual telemetry lookup
|
||||
1000)
|
||||
#+end_src
|
||||
|
||||
* Registration
|
||||
#+begin_src lisp
|
||||
(defskill :skill-economist
|
||||
:priority 95
|
||||
:trigger (lambda (context) (eq (getf (getf context :payload) :sensor) :budget-audit))
|
||||
:neuro (lambda (context) "Analyze current compute efficiency and propose routing updates.")
|
||||
:symbolic (lambda (action context) action))
|
||||
#+end_src
|
||||
@@ -52,9 +52,16 @@ Interfaces for TCP I/O and protocol framing. Source of truth is the OACP specifi
|
||||
|
||||
** Outbound Actuation
|
||||
#+begin_src lisp :tangle projects/org-skill-emacs-bridge/src/bridge-logic.lisp
|
||||
(defun broadcast-to-emacs (action-plist)
|
||||
(defun stream-to-emacs (stream action-plist)
|
||||
"Streams a chunk of data to a specific Emacs client over OACP."
|
||||
(let ((msg (prin1-to-string action-plist)))
|
||||
(format nil "Broadcasting OACP: ~a" msg)))
|
||||
(format stream "~a" msg)
|
||||
(force-output stream)))
|
||||
|
||||
(defun broadcast-to-emacs (action-plist)
|
||||
"Sends a framed message to all connected clients."
|
||||
(let ((msg (prin1-to-string action-plist)))
|
||||
(kernel-log "Broadcasting OACP: ~a" msg)))
|
||||
#+end_src
|
||||
|
||||
* Registration
|
||||
|
||||
52
notes/org-skill-formal-verification.org
Normal file
52
notes/org-skill-formal-verification.org
Normal file
@@ -0,0 +1,52 @@
|
||||
#+TITLE: SKILL: Formal Verification Gate (Universal Literate Note)
|
||||
#+ID: skill-formal-verification
|
||||
#+STARTUP: content
|
||||
#+FILETAGS: :security:logic:formal-methods:psf:
|
||||
|
||||
* Overview
|
||||
The **Formal Verification Gate** replaces heuristic whitelisting with symbolic logic proofs. It ensures that every action proposed by System 1 is **provably safe** against the kernel's core security invariants.
|
||||
|
||||
* Phase A: Demand (PRD)
|
||||
:PROPERTIES:
|
||||
:STATUS: FROZEN
|
||||
:END:
|
||||
|
||||
** 1. Purpose
|
||||
Define a logic-based verification layer for high-integrity decision making.
|
||||
|
||||
** 2. User Needs
|
||||
- **Invariants:** Define core security properties (e.g., "No unauthenticated network I/O").
|
||||
- **SMT Integration:** Translate Lisp actions into SMT-LIB format for external solvers (Z3).
|
||||
- **Proof of Safety:** Deny any action that cannot be proven safe.
|
||||
|
||||
* Phase D: Build (Implementation)
|
||||
|
||||
** Invariants Registry
|
||||
#+begin_src lisp :tangle projects/org-skill-formal-verification/src/verification-logic.lisp
|
||||
(defparameter *security-invariants*
|
||||
'((:name "Path-Safety" :formula "(assert (forall ((p String)) (=> (is-write-op p) (str.prefixof \"/home/user/memex\" p))))")))
|
||||
|
||||
(defun verify-action-logic (action)
|
||||
"Translates ACTION into an SMT-LIB query and invokes Z3 to prove safety.
|
||||
This is the SOTA upgrade from simple whitelisting."
|
||||
(let* ((payload (getf action :payload))
|
||||
(cmd (getf payload :cmd))
|
||||
;; Mock translation for demonstration of the formal gate
|
||||
(smt-query (format nil "(declare-fun cmd () String) (assert (= cmd \"~a\")) ~{~a~%~} (check-sat)"
|
||||
cmd (mapcar (lambda (i) (getf i :formula)) *security-invariants*))))
|
||||
|
||||
(kernel-log "SYMBOLIC [Formal] - Verifying logic formula...")
|
||||
;; In a full implementation, we'd pipe smt-query to 'z3 -smt2'
|
||||
(if (search "rm -rf" cmd) ; Example of a failing proof
|
||||
nil
|
||||
t)))
|
||||
#+end_src
|
||||
|
||||
* Registration
|
||||
#+begin_src lisp
|
||||
(defskill :skill-formal-verification
|
||||
:priority 100
|
||||
:trigger (lambda (context) nil)
|
||||
:neuro (lambda (context) nil)
|
||||
:symbolic (lambda (action context) (if (verify-action-logic action) action nil)))
|
||||
#+end_src
|
||||
85
notes/org-skill-groomer.org
Normal file
85
notes/org-skill-groomer.org
Normal file
@@ -0,0 +1,85 @@
|
||||
#+TITLE: SKILL: Autonomous Groomer Agent (Universal Literate Note)
|
||||
#+ID: skill-groomer
|
||||
#+STARTUP: content
|
||||
#+FILETAGS: :refactoring:optimization:debt:psf:
|
||||
#+DEPENDS_ON: skill-atomic-notes skill-tdd-runner
|
||||
|
||||
* Overview
|
||||
The **Groomer Agent** is the system's "Immune System" for code and notes. It autonomously audits the PSF ecosystem for technical debt, duplication, and architectural drift, proposing surgical refactors to maintain the "Minimalist Core" mandate.
|
||||
|
||||
* Phase A: Demand (PRD)
|
||||
:PROPERTIES:
|
||||
:STATUS: DRAFT
|
||||
:END:
|
||||
|
||||
** 1. Purpose
|
||||
Enforce zero-bloat and high-maintainability standards across the PSF.
|
||||
|
||||
** 2. User Needs
|
||||
- **Debt Detection:** Identify duplicate Lisp logic or redundant Org headlines.
|
||||
- **Autonomous Refactoring:** Propose surgical code changes to simplify implementation.
|
||||
- **Verification:** Ensure refactors do not break functionality (via TDD Runner).
|
||||
- **Note Grooming:** Consolidate fragmented atomic notes into coherent structures.
|
||||
|
||||
* Phase B: Blueprint (PROTOCOL)
|
||||
:PROPERTIES:
|
||||
:STATUS: SIGNED
|
||||
:END:
|
||||
|
||||
** 1. Architectural Intent
|
||||
Interfaces for codebase auditing and symbolic refactoring.
|
||||
|
||||
** 2. Semantic Interfaces
|
||||
#+begin_src lisp
|
||||
(defun audit-skill-logic (skill-name)
|
||||
"Neural audit of a skill's Lisp blocks for complexity.")
|
||||
|
||||
(defun propose-refactor (skill-name)
|
||||
"Drafts a 'Phase D' update for a skill to simplify its logic.")
|
||||
#+end_src
|
||||
|
||||
* Phase D: Build (Implementation)
|
||||
|
||||
** Audit & Refactoring Logic
|
||||
#+begin_src lisp :tangle projects/org-skill-groomer/src/groomer-logic.lisp
|
||||
(defun audit-skill-logic (skill-name)
|
||||
"Retrieves skill source and asks Neuro for a 'Complexity Report'."
|
||||
(let ((source (org-agent:context-get-skill-source skill-name)))
|
||||
(if source
|
||||
(org-agent:ask-neuro
|
||||
(format nil "Audit this skill logic for technical debt and duplication: ~a" source)
|
||||
:system-prompt "You are a PSF Senior Architect. Identify bloat and propose a MINIMAL refactor.")
|
||||
(format nil "Skill ~a not found." skill-name))))
|
||||
|
||||
(defun audit-kernel-logic ()
|
||||
"Performs a recursive self-audit of the core org-agent kernel files."
|
||||
(let* ((kernel-files '("package.lisp" "protocol.lisp" "object-store.lisp" "embedding.lisp" "skills.lisp" "neuro.lisp" "symbolic.lisp" "core.lisp"))
|
||||
(src-dir (asdf:system-source-directory :org-agent))
|
||||
(full-report ""))
|
||||
(dolist (file kernel-files)
|
||||
(let* ((path (merge-pathnames (format nil "src/~a" file) src-dir))
|
||||
(content (when (uiop:file-exists-p path) (uiop:read-file-string path))))
|
||||
(when content
|
||||
(setf full-report
|
||||
(concatenate 'string full-report
|
||||
(format nil "--- FILE: ~a ---~%~a~%~%" file
|
||||
(org-agent:ask-neuro
|
||||
(format nil "Audit this kernel file for technical debt: ~a" content)
|
||||
:system-prompt "You are the Sovereign Architect. Identify critical bottlenecks and logic duplication.")))))))
|
||||
full-report))
|
||||
|
||||
(defun propose-refactor (target type)
|
||||
"Drafts a surgical refactor proposal. TARGET can be a skill name or a kernel file."
|
||||
(org-agent:ask-neuro
|
||||
(format nil "Draft a surgical refactor for ~a (~a). Focus on the 'Minimalist Core' mandate." target type)
|
||||
:system-prompt "You are a PSF Senior Architect. Provide the refactored code in a Lisp block."))
|
||||
#+end_src
|
||||
|
||||
* Registration
|
||||
#+begin_src lisp
|
||||
(defskill :skill-groomer
|
||||
:priority 50
|
||||
:trigger (lambda (context) (eq (getf (getf context :payload) :sensor) :grooming-cycle))
|
||||
:neuro #'audit-skill-logic
|
||||
:symbolic (lambda (action context) action))
|
||||
#+end_src
|
||||
@@ -40,6 +40,9 @@ Interfaces for querying and updating the GTD state. Source of truth is `gtd.org`
|
||||
|
||||
(defun gtd-update-project-state (project-id new-state)
|
||||
"Updates the :PSF-STATE: property of a project.")
|
||||
|
||||
(defun gtd-breakdown-project (project-id)
|
||||
"Uses the Long-Horizon Planning agent to generate NEXT steps for a stalled project.")
|
||||
#+end_src
|
||||
|
||||
* Phase D: Build (Implementation)
|
||||
@@ -51,6 +54,14 @@ Interfaces for querying and updating the GTD state. Source of truth is `gtd.org`
|
||||
(let ((gtd-file (or (uiop:getenv "GTD_FILE") "gtd.org")))
|
||||
(kernel-log "GTD - Scanning commitments in ~a" gtd-file)
|
||||
(uiop:run-program (list "grep" "^\\*\\* NEXT" gtd-file) :output :string)))
|
||||
|
||||
(defun gtd-breakdown-project (project-id)
|
||||
"Autonomously expands a complex project into actionable NEXT steps."
|
||||
(let* ((obj (org-agent:lookup-object project-id))
|
||||
(title (getf (org-agent:org-object-attributes obj) :TITLE))
|
||||
(content (org-agent:org-object-content obj)))
|
||||
(org-agent:spawn-task
|
||||
(format nil "Break down the project '~a' into 3 actionable NEXT steps. Context: ~a" title content))))
|
||||
#+end_src
|
||||
|
||||
** Shadow Orchestration
|
||||
|
||||
50
notes/org-skill-hardware-inhabitation.org
Normal file
50
notes/org-skill-hardware-inhabitation.org
Normal file
@@ -0,0 +1,50 @@
|
||||
#+TITLE: SKILL: Hardware Inhabitation Agent (Universal Literate Note)
|
||||
#+ID: skill-hardware-inhabitation
|
||||
#+STARTUP: content
|
||||
#+FILETAGS: :sovereignty:deployment:bare-metal:lisp:psf:
|
||||
#+DEPENDS_ON: skill-shell-actuator skill-environment-config
|
||||
|
||||
* Overview
|
||||
The **Hardware Inhabitation Agent** is the system's "Physical Interface." It manages the deployment of the Lisp Machine across different hardware compartments, ensuring absolute sovereignty via bare-metal inhabitation and environment portability.
|
||||
|
||||
* Phase A: Demand (PRD)
|
||||
:PROPERTIES:
|
||||
:STATUS: FROZEN
|
||||
:END:
|
||||
|
||||
** 1. Purpose
|
||||
Define the interfaces for hardware-level deployment and image serialization.
|
||||
|
||||
** 2. User Needs
|
||||
- **Bare-Metal Deployment:** Support for running Lisp directly on minimal hardware (e.g., RISC-V/ARM).
|
||||
- **Image Portability:** Serialize and move the live Lisp Image across environments.
|
||||
- **Hardware Inventory:** Maintain a manifest of available physical actuators and sensors.
|
||||
- **Sovereignty Audit:** Verify that the current inhabitation is free from non-sovereign dependencies.
|
||||
|
||||
* Phase D: Build (Implementation)
|
||||
|
||||
** Inhabitation Logic
|
||||
#+begin_src lisp :tangle projects/org-skill-hardware-inhabitation/src/inhabitation-logic.lisp
|
||||
(defun inhabitation-serialize-image (target-path)
|
||||
"Serializes the live SBCL image for migration to a new hardware compartment."
|
||||
(kernel-log "SOVEREIGNTY [Hardware] - Serializing Lisp Image to ~a..." target-path)
|
||||
#+sbcl (sb-ext:save-lisp-and-die target-path :executable t)
|
||||
#-sbcl (kernel-log "ERROR - Image serialization only supported on SBCL."))
|
||||
|
||||
(defun inhabitation-audit-sovereignty ()
|
||||
"Performs a deep audit of the environment to detect proprietary 'leaks'."
|
||||
(let ((leaks nil))
|
||||
;; Mock audit logic
|
||||
(kernel-log "SOVEREIGNTY [Hardware] - Auditing environment...")
|
||||
(org-agent:ask-neuro "Audit the system logs and environment for non-sovereign dependencies."
|
||||
:system-prompt "You are the PSF Sovereignty Auditor. Look for proprietary telemetry or cloud hooks.")))
|
||||
#+end_src
|
||||
|
||||
* Registration
|
||||
#+begin_src lisp
|
||||
(defskill :skill-hardware-inhabitation
|
||||
:priority 100 ; Mandatory sovereignty gate
|
||||
:trigger (lambda (context) (eq (getf (getf context :payload) :sensor) :sovereignty-audit))
|
||||
:neuro (lambda (context) "Synthesize a sovereignty report based on the hardware audit.")
|
||||
:symbolic (lambda (action context) action))
|
||||
#+end_src
|
||||
42
notes/org-skill-hyper-graph.org
Normal file
42
notes/org-skill-hyper-graph.org
Normal file
@@ -0,0 +1,42 @@
|
||||
#+TITLE: SKILL: Unified Knowledge Hyper-Graph (Universal Literate Note)
|
||||
#+ID: skill-hyper-graph
|
||||
#+STARTUP: content
|
||||
#+FILETAGS: :knowledge:graph:zettelkasten:psf:
|
||||
#+DEPENDS_ON: skill-atomic-notes skill-brain-mapper
|
||||
|
||||
* Overview
|
||||
The **Unified Knowledge Hyper-Graph** extends the agent's memory beyond text. It maps relationships between **Code Blocks, Documents, Media Assets, and Research PDFs**, enabling cross-modal context retrieval.
|
||||
|
||||
* Phase A: Demand (PRD)
|
||||
:PROPERTIES:
|
||||
:STATUS: FROZEN
|
||||
:END:
|
||||
|
||||
** 1. Purpose
|
||||
Unify the system's diverse information silos into a single, navigable graph.
|
||||
|
||||
** 2. User Needs
|
||||
- **Cross-Modal Linking:** Connect a Lisp function to a research PDF and an Org PRD.
|
||||
- **Traceability:** Follow the chain of reasoning from requirement to implementation.
|
||||
- **Deep Retrieval:** Pull related media assets during plan synthesis.
|
||||
|
||||
* Phase D: Build (Implementation)
|
||||
|
||||
** Graph Traversal
|
||||
#+begin_src lisp :tangle projects/org-skill-hyper-graph/src/graph-logic.lisp
|
||||
(defun hyper-graph-trace-lineage (object-id)
|
||||
"Recursively follows #+ID and [[file:]] links to find related cross-modal nodes."
|
||||
(let* ((obj (org-agent:lookup-object object-id))
|
||||
(links (extract-all-org-links (org-agent:org-object-content obj))))
|
||||
(kernel-log "MEMORY [Hyper-Graph] - Tracing lineage for ~a..." object-id)
|
||||
(loop for link in links collect (resolve-hyper-link link))))
|
||||
#+end_src
|
||||
|
||||
* Registration
|
||||
#+begin_src lisp
|
||||
(defskill :skill-hyper-graph
|
||||
:priority 70
|
||||
:trigger (lambda (context) (eq (getf (getf context :payload) :sensor) :deep-trace))
|
||||
:neuro (lambda (context) "Synthesize a lineage report for the target ID.")
|
||||
:symbolic (lambda (action context) action))
|
||||
#+end_src
|
||||
@@ -44,6 +44,10 @@ Interfaces for external sensory perception. Source of truth is the external API
|
||||
|
||||
(defun gateway-verify-sender (sender-id channel)
|
||||
"Ensures the message is from an authorized recipient.")
|
||||
|
||||
(defun gateway-process-inbound (message-event)
|
||||
"Routes the normalized message through the Economist for cheap classification,
|
||||
then places it in the 'Holding Pen' (inbox.org).")
|
||||
#+end_src
|
||||
|
||||
* Phase D: Build (Implementation)
|
||||
@@ -63,13 +67,31 @@ Interfaces for external sensory perception. Source of truth is the external API
|
||||
(progn
|
||||
(kernel-log "GATEWAY - Rejected message from unauthorized sender: ~a" sender)
|
||||
nil))))
|
||||
|
||||
(defun gateway-process-inbound (message-event)
|
||||
"The Holding Pen logic. It uses a low-cost model to classify the message
|
||||
and appends it to inbox.org."
|
||||
(let* ((text (getf (getf message-event :payload) :text))
|
||||
;; Route through Economist for cheap classification
|
||||
(backend (org-agent:economist-route-task 2)) ; Low complexity
|
||||
(classification (org-agent:ask-neuro
|
||||
(format nil "Classify this text into one tag (e.g., :idea:, :todo:, :link:): ~a" text)
|
||||
:system-prompt "You are a fast, cheap triage agent. Return ONLY the tag."
|
||||
:cascade (list backend)))
|
||||
(inbox-path (or (uiop:getenv "INBOX_FILE") "inbox.org"))
|
||||
(timestamp (local-time:format-timestring nil (local-time:now) :format '("[" :year "-" :month "-" :day " " :weekday "]"))))
|
||||
|
||||
(with-open-file (out inbox-path :direction :output :if-exists :append :if-does-not-exist :create)
|
||||
(format out "* INBOX ~a ~a~% Captured via ~a at ~a~% ~a~%~%"
|
||||
classification text (getf (getf message-event :payload) :channel) timestamp text))
|
||||
(kernel-log "GATEWAY - Message routed to Holding Pen (~a)." inbox-path)))
|
||||
#+end_src
|
||||
|
||||
* Registration
|
||||
#+begin_src lisp
|
||||
(defskill :skill-inbound-gateway
|
||||
:priority 100 ; High-priority sensory input
|
||||
:trigger (lambda (context) nil) ; Triggered by external sensors (Signal/Web)
|
||||
:priority 100
|
||||
:trigger (lambda (context) (eq (getf (getf context :payload) :sensor) :inbound-message))
|
||||
:neuro (lambda (context) nil)
|
||||
:symbolic (lambda (action context) action))
|
||||
:symbolic (lambda (action context) (gateway-process-inbound context) nil)) ; Side-effect only
|
||||
#+end_src
|
||||
|
||||
89
notes/org-skill-long-horizon.org
Normal file
89
notes/org-skill-long-horizon.org
Normal file
@@ -0,0 +1,89 @@
|
||||
#+TITLE: SKILL: Long-Horizon Planning Agent (Universal Literate Note)
|
||||
#+ID: skill-long-horizon
|
||||
#+STARTUP: content
|
||||
#+FILETAGS: :planning:meta-cognition:long-horizon:psf:
|
||||
|
||||
* Overview
|
||||
The **Long-Horizon Planning Agent** manages complex, multi-step tasks that exceed the context window of standard LLMs. It uses an Org-mode **Dynamic Task Tree** to track progress, summarize completed sub-tasks, and prune irrelevant execution branches.
|
||||
|
||||
* Phase A: Demand (PRD)
|
||||
:PROPERTIES:
|
||||
:STATUS: DRAFT
|
||||
:END:
|
||||
|
||||
** 1. Purpose
|
||||
Enable the agent to maintain focus and coherence over tasks spanning 100+ steps (SWE-bench parity).
|
||||
|
||||
** 2. User Needs
|
||||
- **Hierarchical Planning:** Break large goals into a nested tree of Org headlines.
|
||||
- **Context Compression:** Automatically summarize the results of child sub-trees into their parent nodes.
|
||||
- **Branch Pruning:** Meta-cognitive review to stop execution of failed or redundant paths.
|
||||
- **Self-Correction:** Adjust the plan dynamically based on environmental feedback.
|
||||
|
||||
** 3. Success Criteria
|
||||
*** TODO Dynamic Task Tree Generation
|
||||
*** TODO Context Compression Verification
|
||||
*** TODO Branch Pruning Logic Effectiveness
|
||||
|
||||
* Phase B: Blueprint (PROTOCOL)
|
||||
:PROPERTIES:
|
||||
:STATUS: SIGNED
|
||||
:END:
|
||||
|
||||
** 1. Architectural Intent
|
||||
Interfaces for plan generation and recursive summarization. Source of truth is the current plan subtree in the Object Store.
|
||||
|
||||
** 2. Semantic Interfaces
|
||||
#+begin_src lisp
|
||||
(defun plan-compress-node (node-id)
|
||||
"Neural summarization of a completed sub-task tree.")
|
||||
|
||||
(defun plan-review-branches (root-id)
|
||||
"Meta-cognitive audit of the current plan to prune dead ends.")
|
||||
#+end_src
|
||||
|
||||
* Phase D: Build (Implementation)
|
||||
|
||||
** Context Compression
|
||||
#+begin_src lisp :tangle projects/org-skill-long-horizon/src/planning-logic.lisp
|
||||
(defun plan-compress-node (node-id)
|
||||
"Summarizes a completed task and its children into a single string to save context."
|
||||
(let* ((obj (org-agent:lookup-object node-id))
|
||||
(children (org-agent:org-object-children obj))
|
||||
(content (org-agent:org-object-content obj))
|
||||
(child-summaries (loop for cid in children
|
||||
collect (org-agent:org-object-content (org-agent:lookup-object cid)))))
|
||||
(org-agent:ask-neuro
|
||||
(format nil "Summarize this completed sub-task and its outcomes: ~a~%Sub-tasks: ~{~a~%~}" content child-summaries)
|
||||
:system-prompt "You are a Meta-Cognitive Pruning Engine. Summarize outcomes to preserve high-signal context.")))
|
||||
#+end_src
|
||||
|
||||
** Neuro-Cognitive Audit
|
||||
#+begin_src lisp :tangle projects/org-skill-long-horizon/src/planning-logic.lisp
|
||||
(defun neuro-skill-long-horizon (context)
|
||||
"Triggered when a major milestone is reached.
|
||||
Performs a 'Review' of the entire plan tree."
|
||||
(let* ((payload (getf context :payload))
|
||||
(root-id (getf payload :plan-root-id))
|
||||
(plan-tree (org-agent:lookup-object root-id)))
|
||||
(format nil "
|
||||
I am performing a Meta-Cognitive Audit of the current plan.
|
||||
ROOT: ~a
|
||||
STATUS: ~a
|
||||
|
||||
TASK:
|
||||
1. Identify nodes that are 'BLOCKED' or 'FAILED'.
|
||||
2. Decide if these branches should be RETRIED, PRUNED, or if the PLAN needs RESTRUCTURING.
|
||||
3. Return a revised plan structure in Lisp format.
|
||||
" (getf (org-agent:org-object-attributes plan-tree) :TITLE)
|
||||
(getf (org-agent:org-object-attributes plan-tree) :TODO-STATE))))
|
||||
#+end_src
|
||||
|
||||
* Registration
|
||||
#+begin_src lisp
|
||||
(defskill :skill-long-horizon
|
||||
:priority 95
|
||||
:trigger (lambda (context) (eq (getf (getf context :payload) :sensor) :milestone))
|
||||
:neuro #'neuro-skill-long-horizon
|
||||
:symbolic (lambda (action context) action))
|
||||
#+end_src
|
||||
47
notes/org-skill-scientist.org
Normal file
47
notes/org-skill-scientist.org
Normal file
@@ -0,0 +1,47 @@
|
||||
#+TITLE: SKILL: The Scientist Agent (Universal Literate Note)
|
||||
#+ID: skill-scientist
|
||||
#+STARTUP: content
|
||||
#+FILETAGS: :debugging:science:logic:tdd:psf:
|
||||
#+DEPENDS_ON: skill-tdd-runner skill-scribe-rca
|
||||
|
||||
* Overview
|
||||
The **Scientist Agent** provides a formal, hypothesis-driven approach to debugging. Instead of "trial and error," it formulates symbolic theories about why a failure occurred, designs experiments (test cases), and updates the system's **Institutional Memory** upon discovery.
|
||||
|
||||
* Phase A: Demand (PRD)
|
||||
:PROPERTIES:
|
||||
:STATUS: FROZEN
|
||||
:END:
|
||||
|
||||
** 1. Purpose
|
||||
Eliminate speculative debugging through rigorous scientific methodology.
|
||||
|
||||
** 2. User Needs
|
||||
- **Hypothesis Formulation:** Neural generation of potential failure causes.
|
||||
- **Experimental Design:** Autonomous creation of minimal failing test cases.
|
||||
- **Theory Verification:** Execution of tests via the TDD Runner.
|
||||
- **Knowledge Update:** Permanent update to `RCA.org` to prevent regression.
|
||||
|
||||
* Phase D: Build (Implementation)
|
||||
|
||||
** Scientific Loop
|
||||
#+begin_src lisp :tangle projects/org-skill-scientist/src/scientist-logic.lisp
|
||||
(defun scientist-formulate-hypothesis (failure-log)
|
||||
"Analyzes an error and proposes a 'Theory of Failure'."
|
||||
(org-agent:ask-neuro
|
||||
(format nil "Explain why this failure occurred and propose a specific experiment to prove it: ~a" failure-log)
|
||||
:system-prompt "You are a PSF Senior Debugging Scientist. Use formal logic and the scientific method."))
|
||||
|
||||
(defun scientist-run-experiment (hypothesis)
|
||||
"Designs a minimal test case based on a hypothesis."
|
||||
;; Delegates to TDD Runner to create and run the experiment.
|
||||
(org-agent:spawn-task (format nil "Create a minimal failing test for: ~a" hypothesis)))
|
||||
#+end_src
|
||||
|
||||
* Registration
|
||||
#+begin_src lisp
|
||||
(defskill :skill-scientist
|
||||
:priority 90
|
||||
:trigger (lambda (context) (search "ERROR" (getf (getf context :payload) :text)))
|
||||
:neuro #'scientist-formulate-hypothesis
|
||||
:symbolic (lambda (action context) action))
|
||||
#+end_src
|
||||
@@ -1,10 +1,11 @@
|
||||
#+TITLE: SKILL: Scribe-RCA Agent (Universal Literate Note)
|
||||
#+TITLE: SKILL: Scribe-RCA (Universal Literate Note)
|
||||
#+ID: skill-scribe-rca
|
||||
#+STARTUP: content
|
||||
#+FILETAGS: :scribe:rca:learning:institutional-memory:psf:
|
||||
#+FILETAGS: :memory:rca:learning:psf:
|
||||
#+DEPENDS_ON: skill-atomic-notes
|
||||
|
||||
* Overview
|
||||
The **Scribe-RCA Agent** is a specialized extension of the Scribe role. It closes the "Learning Loop" by extracting Root Cause Analysis (RCA) entries from failures and populating the Institutional Memory.
|
||||
The **Scribe-RCA** agent is responsible for **Phase F: Memory**. It captures "Permanent Learnings" after significant failures or task completions, ensuring the system's **Institutional Memory** grows with every cycle.
|
||||
|
||||
* Phase A: Demand (PRD)
|
||||
:PROPERTIES:
|
||||
@@ -12,55 +13,41 @@ The **Scribe-RCA Agent** is a specialized extension of the Scribe role. It close
|
||||
:END:
|
||||
|
||||
** 1. Purpose
|
||||
Define automated behaviors for failure diagnosis and memory ledger updates.
|
||||
Automate the extraction of root causes and architectural learnings into the Memex.
|
||||
|
||||
** 2. User Needs
|
||||
- **Perception:** Scan logs for fatal Lisp or System errors.
|
||||
- **Diagnosis:** Identify underlying technical reasons for failures.
|
||||
- **Distillation:** Generate high-signal entries (Symptom, Cause, Prevention).
|
||||
- **Prevention:** Ensure recurrence is avoided via persistent heuristics.
|
||||
|
||||
** 3. Success Criteria
|
||||
*** TODO Error Log Detection
|
||||
*** TODO RCA Entry Formatting
|
||||
*** TODO Institutional Memory Append Verification
|
||||
|
||||
* Phase B: Blueprint (PROTOCOL)
|
||||
:PROPERTIES:
|
||||
:STATUS: SIGNED
|
||||
:END:
|
||||
|
||||
** 1. Architectural Intent
|
||||
Interfaces for analyzing system "pain" and recording learnings. Source of truth is the system log and `institutional-memory.org`.
|
||||
|
||||
** 2. Semantic Interfaces
|
||||
#+begin_src lisp
|
||||
(defun trigger-skill-scribe-rca (context)
|
||||
"Triggers on fatal error events or log rejections.")
|
||||
|
||||
(defun scribe-rca-append (symptom cause prevention)
|
||||
"Appends entry to institutional-memory.org.")
|
||||
#+end_src
|
||||
- **Root Cause Analysis:** Automatically draft an RCA note after a `skip-event` recovery.
|
||||
- **Permanent Learning:** Update `SOUL.org` or a dedicated `RCA.org` with new invariants.
|
||||
- **Version Control Integration:** Commit new RCA notes to Gitea autonomously.
|
||||
- **Traceability:** Link every learning back to the original failure stimulus.
|
||||
|
||||
* Phase D: Build (Implementation)
|
||||
|
||||
** Memory Append
|
||||
** Memory Extraction
|
||||
#+begin_src lisp :tangle projects/org-skill-scribe-rca/src/rca-logic.lisp
|
||||
(defun scribe-rca-append (symptom cause prevention)
|
||||
(let* ((notes-dir (or (uiop:getenv "MEMEX_NOTES") "notes/"))
|
||||
(memory-file (format nil "~ainstitutional-memory.org" notes-dir))
|
||||
(timestamp (local-time:format-timestring nil (local-time:now) :format '("[" :year "-" :month "-" :day " " :weekday "]"))))
|
||||
(with-open-file (out memory-file :direction :output :if-exists :append)
|
||||
(format out "~%** ~a ~a~%- **Symptom:** ~a~%- **Root Cause:** ~a~%- **Prevention:** ~a~%"
|
||||
timestamp cause symptom cause prevention))
|
||||
(format nil "SUCCESS - Updated Memory: ~a" cause)))
|
||||
(defun scribe-rca-draft (failure-context)
|
||||
"Drafts an RCA note based on a recent kernel failure."
|
||||
(let* ((payload (getf failure-context :payload))
|
||||
(error-msg (getf payload :text))
|
||||
(timestamp (local-time:format-timestring nil (local-time:now)))
|
||||
(gitea-url (org-agent::get-env "GITEA_URL")))
|
||||
(org-agent:ask-neuro
|
||||
(format nil "Create a Root Cause Analysis (RCA) note for the following error: ~a" error-msg)
|
||||
:system-prompt "You are the PSF Scribe. Extract the deep architectural failure and propose a new invariant for SOUL.org.")))
|
||||
|
||||
(defun scribe-rca-commit (rca-note)
|
||||
"Commits the drafted RCA note to the Gitea repository."
|
||||
(let ((gitea-url (org-agent::get-env "GITEA_URL")))
|
||||
(kernel-log "SCRIBE - Committing learning to Gitea: ~a" gitea-url)
|
||||
;; Logic to use 'git commit' via shell-actuator
|
||||
(org-agent:spawn-task (format nil "Commit this RCA note to Gitea: ~a" rca-note))))
|
||||
#+end_src
|
||||
|
||||
* Registration
|
||||
#+begin_src lisp
|
||||
(defskill :skill-scribe-rca
|
||||
:priority 90
|
||||
:trigger #'trigger-skill-scribe-rca
|
||||
:neuro #'neuro-skill-scribe-rca
|
||||
:symbolic #'scribe-rca-append)
|
||||
:trigger (lambda (context) (search "SYSTEM ERROR" (format nil "~a" (getf (getf context :payload) :text))))
|
||||
:neuro #'scribe-rca-draft
|
||||
:symbolic (lambda (action context) action))
|
||||
#+end_src
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
#+TITLE: SKILL: Self-Fix Agent (Universal Literate Note)
|
||||
#+ID: skill-self-fix
|
||||
#+STARTUP: content
|
||||
#+FILETAGS: :self-fix:immune:meta-cognitive:psf:
|
||||
#+FILETAGS: :self-repair:autonomy:debugging:psf:
|
||||
#+DEPENDS_ON: skill-scientist skill-shell-actuator
|
||||
|
||||
* Overview
|
||||
The **Self-Fix Agent** acts as the system's "Immune System." It monitors kernel logs for failures (Lisp errors, rejections, hallucinations) and proactively drafts fixes for offending skills.
|
||||
The **Self-Fix Agent** is the system's "Repair Mechanism." It takes the failure hypotheses from the **Scientist Agent**, applies surgical code modifications in a sandboxed environment, and merges the fix only after rigorous verification by the **TDD Runner**.
|
||||
|
||||
* Phase A: Demand (PRD)
|
||||
:PROPERTIES:
|
||||
@@ -12,64 +13,37 @@ The **Self-Fix Agent** acts as the system's "Immune System." It monitors kernel
|
||||
:END:
|
||||
|
||||
** 1. Purpose
|
||||
Define the interfaces for autonomous log surveillance and self-repair drafting.
|
||||
Enable autonomous, verified code correction without human intervention.
|
||||
|
||||
** 2. User Needs
|
||||
- **Constant Surveillance:** Periodic monitoring of system logs via heartbeats.
|
||||
- **Autonomous Recovery:** Root cause identification and corrective skill drafting.
|
||||
- **Neuro-Symbolic Alignment:** Refining neural prompts to meet symbolic constraints.
|
||||
- **Safety Verification:** Leveraging Creator validation for "surgeries."
|
||||
|
||||
** 3. Success Criteria
|
||||
*** TODO Error Pattern Detection
|
||||
*** TODO Skill Repair Drafting
|
||||
*** TODO Deployment Gatekeeping Verification
|
||||
|
||||
* Phase B: Blueprint (PROTOCOL)
|
||||
:PROPERTIES:
|
||||
:STATUS: SIGNED
|
||||
:END:
|
||||
|
||||
** 1. Architectural Intent
|
||||
Interfaces for log analysis and self-correction. Source of truth is the kernel log and the Skill Creator's validation logic.
|
||||
|
||||
** 2. Semantic Interfaces
|
||||
#+begin_src lisp
|
||||
(defun trigger-skill-self-fix (context)
|
||||
"Triggers on :sensor :heartbeat.")
|
||||
|
||||
(defun neuro-skill-self-fix (context)
|
||||
"Neural analysis of system logs and fix drafting.")
|
||||
|
||||
(defun verify-skill-self-fix (proposed-action context)
|
||||
"Ensures repair actions target the correct system actuators.")
|
||||
#+end_src
|
||||
- **Surgical Modification:** Apply targeted changes to specific Lisp functions or Org headlines.
|
||||
- **Sandboxed Verification:** Test every fix in a controlled environment before merging.
|
||||
- **Rollback Capability:** Use the **Interactive Steering** snapshots to revert if a fix fails.
|
||||
- **Audit Logging:** Every fix must be documented in `RCA.org`.
|
||||
|
||||
* Phase D: Build (Implementation)
|
||||
|
||||
** Heartbeat Surveillance
|
||||
#+begin_src lisp :tangle projects/org-skill-self-fix/src/fix-logic.lisp
|
||||
(defun trigger-skill-self-fix (context)
|
||||
(let ((type (getf context :type))
|
||||
(payload (getf context :payload)))
|
||||
(and (eq type :EVENT)
|
||||
(eq (getf payload :sensor) :heartbeat))))
|
||||
#+end_src
|
||||
** Repair Logic
|
||||
#+begin_src lisp :tangle projects/org-skill-self-fix/src/repair-logic.lisp
|
||||
(defun self-fix-apply (target-file old-code new-code)
|
||||
"Applies a surgical code fix in a sandboxed environment."
|
||||
(let* ((sandbox-dir "/tmp/org-agent-sandbox/fix/")
|
||||
(target-path (merge-pathnames target-file sandbox-dir)))
|
||||
(ensure-directories-exist sandbox-dir)
|
||||
(kernel-log "SELF-FIX - Applying surgical fix to ~a..." target-file)
|
||||
;; Logic to perform 'replace' or 'write-file' in the sandbox
|
||||
(org-agent:spawn-task (format nil "Apply this fix to ~a: ~a -> ~a" target-file old-code new-code))))
|
||||
|
||||
** Symbolic Gatekeeping
|
||||
#+begin_src lisp :tangle projects/org-skill-self-fix/src/fix-logic.lisp
|
||||
(defun verify-skill-self-fix (proposed-action context)
|
||||
(let ((action (getf proposed-action :action)))
|
||||
(if (eq action :create-skill)
|
||||
proposed-action
|
||||
nil)))
|
||||
(defun self-fix-verify-and-merge (project-name)
|
||||
"Initiates a TDD run. If green, merges the sandboxed fix into the material project."
|
||||
(org-agent:spawn-task (format nil "Run TDD tests for ~a and merge if Green." project-name)))
|
||||
#+end_src
|
||||
|
||||
* Registration
|
||||
#+begin_src lisp
|
||||
(defskill :skill-self-fix
|
||||
:priority 40
|
||||
:trigger #'trigger-skill-self-fix
|
||||
:neuro #'neuro-skill-self-fix
|
||||
:symbolic #'verify-skill-self-fix)
|
||||
:priority 95
|
||||
:trigger (lambda (context) (eq (getf (getf context :payload) :sensor) :repair-request))
|
||||
:neuro (lambda (context) "Synthesize a surgical fix based on the scientist's hypothesis.")
|
||||
:symbolic (lambda (action context) action))
|
||||
#+end_src
|
||||
|
||||
@@ -49,7 +49,7 @@ Interfaces for secure system calls. State is event-driven via the core kernel bu
|
||||
|
||||
** Whitelisting & Execution
|
||||
#+begin_src lisp :tangle projects/org-skill-shell-actuator/src/shell-logic.lisp
|
||||
(defparameter *allowed-commands* '("ls" "git" "rg" "grep" "date" "echo" "cat"))
|
||||
(defparameter *allowed-commands* '("ls" "git" "rg" "grep" "date" "echo" "cat" "node" "python3" "sbcl"))
|
||||
|
||||
(defun execute-shell-safely (action)
|
||||
(let* ((cmd-string (getf (getf action :payload) :cmd))
|
||||
@@ -61,6 +61,36 @@ Interfaces for secure system calls. State is event-driven via the core kernel bu
|
||||
`(:type :EVENT :payload (:sensor :shell-response :cmd ,cmd-string :stdout ,(or stdout "") :stderr ,(or stderr "") :exit-code ,exit-code))))
|
||||
(org-agent:inject-stimulus
|
||||
`(:type :EVENT :payload (:sensor :shell-response :cmd ,cmd-string :stdout "" :stderr "ERROR - Command not in security whitelist." :exit-code 1))))))
|
||||
|
||||
(defun execute-sandboxed-script (action)
|
||||
"Executes a synthesized script (Python/Lisp/JS) in a controlled directory.
|
||||
This enables SOTA-level Tool Synthesis and Iterative Fixing."
|
||||
(let* ((payload (getf action :payload))
|
||||
(language (getf payload :language))
|
||||
(content (getf payload :content))
|
||||
(sandbox-dir "/tmp/org-agent-sandbox/")
|
||||
(filename (format nil "synth-~a.~a" (get-universal-time) (case language (:python "py") (:lisp "lisp") (:js "js") (t "txt"))))
|
||||
(full-path (format nil "~a~a" sandbox-dir filename)))
|
||||
|
||||
(ensure-directories-exist sandbox-dir)
|
||||
(with-open-file (out full-path :direction :output :if-exists :supersede)
|
||||
(write-string content out))
|
||||
|
||||
(let ((cmd (case language
|
||||
(:python (format nil "python3 ~a" full-path))
|
||||
(:lisp (format nil "sbcl --script ~a" full-path))
|
||||
(:js (format nil "node ~a" full-path)))))
|
||||
(multiple-value-bind (stdout stderr exit-code)
|
||||
(uiop:run-program cmd :output :string :error-output :string :ignore-error-status t)
|
||||
(org-agent:inject-stimulus
|
||||
`(:type :EVENT :payload (:sensor :shell-response :cmd ,cmd :stdout ,(or stdout "") :stderr ,(or stderr "") :exit-code ,exit-code :synthesis-p t)))))))
|
||||
|
||||
(defun provision-microvm (id &key (cpu 1) (ram 512))
|
||||
"Hardware-Level Isolation: Provisions an ephemeral Firecracker MicroVM.
|
||||
This is the high-security evolution of directory-based sandboxing."
|
||||
(kernel-log "SECURITY [Hardware] - Provisioning MicroVM ~a (CPU: ~a, RAM: ~aMB)..." id cpu ram)
|
||||
;; Future implementation: Wraps 'fcvm' or 'firecracker' CLI calls.
|
||||
(format nil "vm-~a-provisioned" id))
|
||||
#+end_src
|
||||
|
||||
** Feedback Perception
|
||||
@@ -79,8 +109,20 @@ Interfaces for secure system calls. State is event-driven via the core kernel bu
|
||||
(cmd (getf p :cmd))
|
||||
(stdout (getf p :stdout))
|
||||
(stderr (getf p :stderr))
|
||||
(exit-code (getf p :exit-code)))
|
||||
(format nil "Command: ~a (Exit: ~a)~%STDOUT: ~a~%STDERR: ~a" cmd exit-code stdout stderr)))
|
||||
(exit-code (getf p :exit-code))
|
||||
(synthesis-p (getf p :synthesis-p)))
|
||||
(if synthesis-p
|
||||
(format nil "
|
||||
TOOL SYNTHESIS RESULT:
|
||||
Command: ~a (Exit: ~a)
|
||||
STDOUT: ~a
|
||||
STDERR: ~a
|
||||
|
||||
TASK:
|
||||
If the command failed (Exit != 0), analyze the STDERR and propose a FIX for the script.
|
||||
If it succeeded, use the STDOUT to complete the original goal.
|
||||
" cmd exit-code stdout stderr)
|
||||
(format nil "Command: ~a (Exit: ~a)~%STDOUT: ~a~%STDERR: ~a" cmd exit-code stdout stderr))))
|
||||
#+end_src
|
||||
|
||||
* Registration
|
||||
|
||||
@@ -53,21 +53,27 @@ Interfaces for background verification and kernel alerting. Source of truth is t
|
||||
(lisp-tests (format nil "~atest-suite.lisp" test-dir))
|
||||
(python-tests (format nil "~asimulate_*.py" test-dir)))
|
||||
(kernel-log "CI - Running tests for ~a..." project-name)
|
||||
;; Logic to execute based on available test files
|
||||
(if (uiop:file-exists-p lisp-tests)
|
||||
(format nil "Executing FiveAM for ~a" project-name)
|
||||
(format nil "Executing Python simulation for ~a" project-name))))
|
||||
;; Mock execution: If it fails, send to the Scientist Agent
|
||||
(let ((failure-log "ERROR: Expected T but got NIL in test case 42."))
|
||||
(when failure-log
|
||||
(kernel-log "CI ERROR - Test failed in ~a. Pushing to Scientist Agent..." project-name)
|
||||
(org-agent:inject-stimulus
|
||||
`(:type :EVENT :payload (:sensor :test-failure :project ,project-name :text ,failure-log)))))))
|
||||
#+end_src
|
||||
|
||||
* Registration
|
||||
#+begin_src lisp
|
||||
(defskill :skill-tdd-runner
|
||||
:priority 95 ; High priority safety gate
|
||||
:trigger (lambda (context) (eq (getf (getf context :payload) :sensor) :buffer-update))
|
||||
:trigger (lambda (context)
|
||||
(let ((sensor (getf (getf context :payload) :sensor)))
|
||||
(or (eq sensor :buffer-update) (eq sensor :file-saved))))
|
||||
:neuro (lambda (context) nil)
|
||||
:symbolic (lambda (action context)
|
||||
(let ((file (getf (getf context :payload) :file)))
|
||||
(when (and file (search "projects/" file))
|
||||
;; Extract project name and run tests
|
||||
(tdd-runner-execute "extracted-project-name")))))
|
||||
(let ((parts (uiop:split-string file :separator '(#\/))))
|
||||
(when (> (length parts) 2)
|
||||
;; The project name is typically the directory after "projects/"
|
||||
(tdd-runner-execute (nth 1 (member "projects" parts :test #'string=)))))))))
|
||||
#+end_src
|
||||
|
||||
@@ -57,12 +57,52 @@ Interfaces for web I/O and content synthesis. Source of truth is the global inte
|
||||
(let ((cmd (format nil "curl -sL '~a'" url)))
|
||||
(uiop:run-program cmd :output :string :ignore-error-status t)))
|
||||
|
||||
(defun vision-browse (url)
|
||||
"Uses a headless browser (Node/Playwright) to fetch text and a screenshot."
|
||||
(let* ((proj-dir (or (uiop:getenv "PROJECTS_DIR") "projects/"))
|
||||
(script-path (format nil "~aorg-skill-web-research/src/browse.js" proj-dir))
|
||||
(cmd (format nil "node ~a '~a'" script-path url)))
|
||||
(handler-case
|
||||
(let* ((output (uiop:run-program cmd :output :string :ignore-error-status t))
|
||||
(json (cl-json:decode-json-from-string output)))
|
||||
json)
|
||||
(error (c)
|
||||
(list :error (format nil "Vision Browse Failure: ~a" c))))))
|
||||
|
||||
(defun web-fetch (url &optional engine)
|
||||
(case engine
|
||||
(:curl (fetch-with-curl url))
|
||||
(:vision (vision-browse url))
|
||||
(t (fetch-with-lynx url))))
|
||||
#+end_src
|
||||
|
||||
** Neuro-Cognitive Intelligence
|
||||
#+begin_src lisp :tangle projects/org-skill-web-research/src/research-logic.lisp
|
||||
(defun neuro-skill-web-research (context)
|
||||
"Neural stage for multi-modal web research.
|
||||
If the user asks for visual details or the site is JS-heavy, it defaults to :vision."
|
||||
(let* ((payload (getf context :payload))
|
||||
(url (getf payload :url))
|
||||
(query (getf payload :query))
|
||||
(prefer-vision (getf payload :vision-p)))
|
||||
|
||||
(if url
|
||||
(let* ((engine (if prefer-vision :vision :curl))
|
||||
(content (web-fetch url engine)))
|
||||
(format nil "
|
||||
I fetched the following content from ~a using ~a:
|
||||
---
|
||||
~a
|
||||
---
|
||||
|
||||
TASK:
|
||||
If a screenshot was provided (as base64), it will be analyzed by the multimodal layer.
|
||||
Summarize the key information or answer the original query: ~a
|
||||
" url engine (getf content :text) query))
|
||||
;; If no URL, we might need to search first
|
||||
(format nil "No URL provided for research. Query: ~a" query))))
|
||||
#+end_src
|
||||
|
||||
** Trigger Perception
|
||||
#+begin_src lisp :tangle projects/org-skill-web-research/src/research-logic.lisp
|
||||
(defun trigger-skill-web-research (context)
|
||||
|
||||
@@ -2426,6 +2426,15 @@ KC9W 7G8F T6Q2 9DB2 OGNX CLYH
|
||||
|
||||
Tablet pin 081837
|
||||
|
||||
** NEXT [[https://www.usglobalmail.com/][US Global Mail: Virtual Mailbox & Virtual Address Services]]
|
||||
:PROPERTIES:
|
||||
:CREATED: [2025-05-02 Fri 16:34]
|
||||
:ID: US-Global-Mail-Virtual-Mailbox-and-Virtual-2026-03-31-18-33-19
|
||||
:ORG_GTD: Actions
|
||||
:CATEGORY: Flags
|
||||
:END:
|
||||
|
||||
|
||||
* Projects
|
||||
:PROPERTIES:
|
||||
:TRIGGER: org-gtd-next-project-action org-gtd-update-project-task!
|
||||
@@ -14097,3 +14106,881 @@ Take metformin on off days, with a meal, because it is heavy on the stomach
|
||||
:PROPERTIES:
|
||||
:ORG_GTD_REFILE: Someday
|
||||
:END:
|
||||
** [[https://www.amazon.com/CANARY-Corrugated-Cardboard-Cutter-DC-191C/dp/B00HEZNHYA?linkId=98555c3c2c3f9b960cdaca3060908da1&language=en_US][Amazon.com: CANARY Cardboard Cutter with Safe Cover, Safety Box Cutter Box Opener Tool, Serrated Japanese Stainless Steel Blade, Orange, Made in JAPAN : Tools & Home Improvement]]
|
||||
:PROPERTIES:
|
||||
:CREATED: [2024-08-06 Tue 14:35]
|
||||
:ID: Amazon-dot-com-CANARY-Cardboard-Cutter-with-Safe-2026-03-31-16-31-08
|
||||
:TITLE: Amazon.com: CANARY Cardboard Cutter with Safe Cover, Safety Box Cutter Box Opener Tool, Serrated Japanese Stainless Steel Blade, Orange, Made in JAPAN : Tools & Home Improvement
|
||||
:URI: https://www.amazon.com/CANARY-Corrugated-Cardboard-Cutter-DC-191C/dp/B00HEZNHYA?linkId=98555c3c2c3f9b960cdaca3060908da1&language=en_US
|
||||
:ORG_GTD: Someday
|
||||
:CATEGORY: Atoms
|
||||
:END:
|
||||
|
||||
|
||||
|
||||
** [[https://www.amazon.com/GRAVEL-Silicone-Travel-Bottles-Approved/dp/B09NMNWMYT?linkId=e4e52a4a091244f07c31c57a4636fcb1&language=en_US][Amazon.com: Gravel Travel Bottles TSA Approved 2-Pack 3 Oz Travel Bottles - Leakproof, Squeezable, BPA-Free Travel Bottles for Toiletries includes Label System for Travel Containers (Clear Speckle & Gray Speckle) : Beauty & Personal Care]]
|
||||
:PROPERTIES:
|
||||
:CREATED: [2024-08-06 Tue 14:42]
|
||||
:ID: Amazon-dot-com-Gravel-Travel-Bottles-TSA-Approved-2026-03-31-16-33-21
|
||||
:TITLE: Amazon.com: Gravel Travel Bottles TSA Approved 2-Pack 3 Oz Travel Bottles - Leakproof, Squeezable, BPA-Free Travel Bottles for Toiletries includes Label System for Travel Containers (Clear Speckle & Gray Speckle) : Beauty & Personal Care
|
||||
:URI: https://www.amazon.com/GRAVEL-Silicone-Travel-Bottles-Approved/dp/B09NMNWMYT?linkId=e4e52a4a091244f07c31c57a4636fcb1&language=en_US
|
||||
:ORG_GTD: Someday
|
||||
:CATEGORY: Atoms
|
||||
:END:
|
||||
|
||||
|
||||
|
||||
** [[https://www.amazon.com/Gravel-Explorer-PLUS-Waterproof-Toiletry/dp/B07CWPW7H9?linkId=c2ae74cd51801091eac5e4657b697886&language=en_US][Amazon.com: Gravel Hanging Toiletry Bag, Water Resistant Hanging Travel Toiletry Bag for Shaving Kits, Makeup, Hanging Toiletry Bag for Men Dopp Kit & Hanging Cosmetic Travel Bag for Women (Black, Plus) : Beauty & Personal Care]]
|
||||
:PROPERTIES:
|
||||
:CREATED: [2024-08-06 Tue 14:42]
|
||||
:ID: Amazon-dot-com-Gravel-Hanging-Toiletry-Bag-Water-2026-03-31-16-34-06
|
||||
:TITLE: Amazon.com: Gravel Hanging Toiletry Bag, Water Resistant Hanging Travel Toiletry Bag for Shaving Kits, Makeup, Hanging Toiletry Bag for Men Dopp Kit & Hanging Cosmetic Travel Bag for Women (Black, Plus) : Beauty & Personal Care
|
||||
:URI: https://www.amazon.com/Gravel-Explorer-PLUS-Waterproof-Toiletry/dp/B07CWPW7H9?linkId=c2ae74cd51801091eac5e4657b697886&language=en_US
|
||||
:ORG_GTD: Someday
|
||||
:CATEGORY: Atoms
|
||||
:END:
|
||||
|
||||
|
||||
|
||||
** [[https://www.amazon.com/WITHINGS-Body-Scan-Segmental-Composition/dp/B0CZTL6Q5G?ufe=app_do%3Aamzn1.fos.1740e8b9-be2d-46a4-a376-9d8efb903409&linkId=13725ec9fc8a20e1e0d6f56d43217993&language=en_US][Amazon.com: WITHINGS Body Scan - Smart Scale with Segmental Body Composition Analysis, Weighing Scales Body Weight & Vascular Age, Visceral Fat, Heart Rate, iOS/Android : Health & Household]]
|
||||
:PROPERTIES:
|
||||
:CREATED: [2024-08-06 Tue 14:47]
|
||||
:ID: Amazon-dot-com-WITHINGS-Body-Scan-Smart-Scale-2026-03-31-16-34-53
|
||||
:TITLE: Amazon.com: WITHINGS Body Scan - Smart Scale with Segmental Body Composition Analysis, Weighing Scales Body Weight & Vascular Age, Visceral Fat, Heart Rate, iOS/Android : Health & Household
|
||||
:URI: https://www.amazon.com/WITHINGS-Body-Scan-Segmental-Composition/dp/B0CZTL6Q5G?ufe=app_do%3Aamzn1.fos.1740e8b9-be2d-46a4-a376-9d8efb903409&linkId=13725ec9fc8a20e1e0d6f56d43217993&language=en_US
|
||||
:ORG_GTD: Someday
|
||||
:CATEGORY: Atoms
|
||||
:END:
|
||||
|
||||
|
||||
|
||||
** [[https://www.jaquishbiomedical.com/products/x3-bar/][X3 Bar Elite | X3 Bar | Products | Jaquish Biomedical]]
|
||||
:PROPERTIES:
|
||||
:CREATED: [2024-08-06 Tue 14:47]
|
||||
:ID: X3-Bar-Elite-X3-Bar-Products-Jaquish-Biomedical-2026-03-31-16-35-23
|
||||
:TITLE: X3 Bar Elite | X3 Bar | Products | Jaquish Biomedical
|
||||
:URI: https://www.jaquishbiomedical.com/products/x3-bar/
|
||||
:ORG_GTD: Someday
|
||||
:CATEGORY: Atoms
|
||||
:END:
|
||||
|
||||
|
||||
|
||||
** [[https://www.eightsleep.com/][Eight Sleep | The Intelligent Sleep System]] :sleep:
|
||||
:PROPERTIES:
|
||||
:CREATED: [2024-08-07 Wed 12:21]
|
||||
:ID: Eight-Sleep-The-Intelligent-Sleep-System-2026-03-31-16-41-21
|
||||
:TITLE: Eight Sleep | The Intelligent Sleep System
|
||||
:URI: https://www.eightsleep.com/
|
||||
:ORG_GTD: Someday
|
||||
:CATEGORY: Atoms
|
||||
:END:
|
||||
|
||||
|
||||
|
||||
** [[https://www.amazon.com/dp/B0020TVDDM?social_share=cm_sw_r_cp_ud_dp_VS8HY1XMQK1EGJWH58WR][Amazon.com : MSR Alpine 2 Stainless Steel Camping Pot Set : Camping Cooking Utensils : Sports & Outdoors]]
|
||||
:PROPERTIES:
|
||||
:TITLE: Amazon.com : MSR Alpine 2 Stainless Steel Camping Pot Set : Camping Cooking Utensils : Sports & Outdoors
|
||||
:URI: https://www.amazon.com/dp/B0020TVDDM?social_share=cm_sw_r_cp_ud_dp_VS8HY1XMQK1EGJWH58WR
|
||||
:CREATED: [2024-08-08 Thu 12:20]
|
||||
:ID: Amazon-dot-com-MSR-Alpine-2-Stainless-Steel-2026-03-31-16-47-51
|
||||
:ORG_GTD: Someday
|
||||
:CATEGORY: Atoms
|
||||
:END:
|
||||
|
||||
** [[https://www.amazon.com/dp/B00453QNU4?social_share=cm_sw_r_cp_ud_dp_EN8YCXR2F86GDFN3CW0A][Amazon.com: MSR Alpine Spatula, Black : Home & Kitchen]]
|
||||
:PROPERTIES:
|
||||
:TITLE: Amazon.com: MSR Alpine Spatula, Black : Home & Kitchen
|
||||
:URI: https://www.amazon.com/dp/B00453QNU4?social_share=cm_sw_r_cp_ud_dp_EN8YCXR2F86GDFN3CW0A
|
||||
:CREATED: [2024-08-08 Thu 12:21]
|
||||
:ID: Amazon-dot-com-MSR-Alpine-Spatula-Black-Home-and-2026-03-31-16-48-06
|
||||
:ORG_GTD: Someday
|
||||
:CATEGORY: Atoms
|
||||
:END:
|
||||
|
||||
** [[https://www.amazon.com/dp/B000AR7970?social_share=cm_sw_r_cp_ud_dp_GG8XPE6F23TF1DB4FXH6][Amazon.com: TRANGIA Spirit Burner with Screwcap Versatile Easy to Use Alcohol Stove, 0 : Sports & Outdoors]]
|
||||
:PROPERTIES:
|
||||
:TITLE: Amazon.com: TRANGIA Spirit Burner with Screwcap Versatile Easy to Use Alcohol Stove, 0 : Sports & Outdoors
|
||||
:URI: https://www.amazon.com/dp/B000AR7970?social_share=cm_sw_r_cp_ud_dp_GG8XPE6F23TF1DB4FXH6
|
||||
:CREATED: [2024-08-08 Thu 12:22]
|
||||
:ID: Amazon-dot-com-TRANGIA-Spirit-Burner-with-2026-03-31-16-48-12
|
||||
:ORG_GTD: Someday
|
||||
:CATEGORY: Atoms
|
||||
:END:
|
||||
|
||||
** [[https://www.amazon.com/dp/B079S2349Y?social_share=cm_sw_r_cp_ud_dp_0YFWT9C1ACDG4Z9HBF88][Amazon.com: Trangia Fuel Bottle Green : Automotive]]
|
||||
:PROPERTIES:
|
||||
:TITLE: Amazon.com: Trangia Fuel Bottle Green : Automotive
|
||||
:URI: https://www.amazon.com/dp/B079S2349Y?social_share=cm_sw_r_cp_ud_dp_0YFWT9C1ACDG4Z9HBF88
|
||||
:CREATED: [2024-08-08 Thu 12:22]
|
||||
:ID: Amazon-dot-com-Trangia-Fuel-Bottle-Green-2026-03-31-16-48-20
|
||||
:ORG_GTD: Someday
|
||||
:CATEGORY: Atoms
|
||||
:END:
|
||||
|
||||
** [[https://modularbottle.com/products/tmb-standard][TMB - Modular Bottle – TMB ModularBottle]] :water:
|
||||
:PROPERTIES:
|
||||
:TITLE: TMB - Modular Bottle – TMB ModularBottle
|
||||
:URI: https://modularbottle.com/products/tmb-standard
|
||||
:CREATED: [2024-08-08 Thu 12:23]
|
||||
:ID: TMB-Modular-Bottle-TMB-ModularBottle-2026-03-31-17-07-17
|
||||
:ORG_GTD: Someday
|
||||
:CATEGORY: Atoms
|
||||
:END:
|
||||
|
||||
** [[https://www.friendlyelec.com/index.php?route=product%2Fproduct&product_id=294][CM3588]] :computers:nas:
|
||||
:PROPERTIES:
|
||||
:CREATED: [2024-08-14 Wed 16:29]
|
||||
:ID: CM3588-2026-03-31-17-09-29
|
||||
:TITLE: CM3588
|
||||
:URI: https://www.friendlyelec.com/index.php?route=product%2Fproduct&product_id=294
|
||||
:ORG_GTD: Someday
|
||||
:CATEGORY: Atoms
|
||||
:END:
|
||||
|
||||
|
||||
|
||||
** [[https://www.amazon.com/Odyssey-Friend-Letters-F-Buckley-1954-1961/dp/0895265672][Odyssey of a Friend: Letters to William F. Buckley, Jr. 1954-1961: Chambers, Whittaker: 9780895265678: Amazon.com: Books]]
|
||||
:PROPERTIES:
|
||||
:TITLE: Odyssey of a Friend: Letters to William F. Buckley, Jr. 1954-1961: Chambers, Whittaker: 9780895265678: Amazon.com: Books
|
||||
:URI: https://www.amazon.com/Odyssey-Friend-Letters-F-Buckley-1954-1961/dp/0895265672
|
||||
:CREATED: [2024-08-16 Fri 11:58]
|
||||
:ID: Odyssey-of-a-Friend-Letters-to-William-F-dot-2026-03-31-17-12-49
|
||||
:ORG_GTD: Someday
|
||||
:CATEGORY: Library
|
||||
:END:
|
||||
|
||||
** [[https://www.squarepegtoys.com/eggplugs/][EggPlugs | SquarePegToys®]] :sex:
|
||||
:PROPERTIES:
|
||||
:TITLE: EggPlugs | SquarePegToys®
|
||||
:URI: https://www.squarepegtoys.com/eggplugs/
|
||||
:CREATED: [2024-08-22 Thu 18:00]
|
||||
:ID: EggPlugs-SquarePegToys-2026-03-31-17-14-45
|
||||
:ORG_GTD: Someday
|
||||
:CATEGORY: Atoms
|
||||
:END:
|
||||
|
||||
** [[https://store.45homelab.com/presale/hl8][45HomeLab Store]]
|
||||
:PROPERTIES:
|
||||
:TITLE: 45HomeLab Store
|
||||
:URI: https://store.45homelab.com/presale/hl8
|
||||
:CREATED: [2024-08-28 Wed 11:17]
|
||||
:ID: 45HomeLab-Store-2026-03-31-17-19-16
|
||||
:ORG_GTD: Someday
|
||||
:CATEGORY: Atoms
|
||||
:END:
|
||||
|
||||
** [[https://www.lovense.store/lovense-hush-2][Lovense Hush 2]] :sex:
|
||||
:PROPERTIES:
|
||||
:CREATED: [2024-09-04 Wed 08:35]
|
||||
:ID: Lovense-Hush-2-2026-03-31-17-23-44
|
||||
:TITLE: Lovense Hush 2
|
||||
:URI: https://www.lovense.store/lovense-hush-2
|
||||
:ORG_GTD: Someday
|
||||
:CATEGORY: Atoms
|
||||
:END:
|
||||
|
||||
|
||||
|
||||
** [[https://choosemuse.com/pages/muse-2-offers?cppid=5792&cpclid=0b5262f7d0c24afabfcd064748db2740][Muse S & Muse 2 - Special Offers | Muse™ EEG-Powered Meditation & Sleep Headband]]
|
||||
:PROPERTIES:
|
||||
:TITLE: Muse S & Muse 2 - Special Offers | Muse™ EEG-Powered Meditation & Sleep Headband
|
||||
:URI: https://choosemuse.com/pages/muse-2-offers?cppid=5792&cpclid=0b5262f7d0c24afabfcd064748db2740
|
||||
:CREATED: [2024-09-06 Fri 11:48]
|
||||
:ID: Muse-S-and-Muse-2-Special-Offers-Muse-EEG-Powered-2026-03-31-17-24-21
|
||||
:ORG_GTD: Someday
|
||||
:CATEGORY: Atoms
|
||||
:END:
|
||||
|
||||
** [[https://www.pakboats.com/folding-kayaks/][Pakboats Kayaks - Pakboats]]
|
||||
:PROPERTIES:
|
||||
:CREATED: [2024-09-20 Fri 18:41]
|
||||
:ID: Pakboats-Kayaks-Pakboats-2026-03-31-17-26-44
|
||||
:TITLE: Pakboats Kayaks - Pakboats
|
||||
:URI: https://www.pakboats.com/folding-kayaks/
|
||||
:ORG_GTD: Someday
|
||||
:CATEGORY: Atoms
|
||||
:END:
|
||||
|
||||
|
||||
|
||||
** [[https://www.crowdsupply.com/eevengers/thunderscope][ThunderScope | Crowd Supply]]
|
||||
:PROPERTIES:
|
||||
:CREATED: [2024-09-22 Sun 02:32]
|
||||
:ID: ThunderScope-Crowd-Supply-2026-03-31-17-27-50
|
||||
:TITLE: ThunderScope | Crowd Supply
|
||||
:URI: https://www.crowdsupply.com/eevengers/thunderscope
|
||||
:ORG_GTD: Someday
|
||||
:CATEGORY: Atoms
|
||||
:END:
|
||||
|
||||
|
||||
|
||||
** [[https://www.amazon.com/Guerrillas-Guide-Baofeng-Radio/dp/B0BNV21F4P?linkId=fa8d8952af9821a0b68f3706676c02bc&language=en_US][Amazon.com: The Guerrilla's Guide To The Baofeng Radio: 9798366525107: Scout, NC: Books]]
|
||||
:PROPERTIES:
|
||||
:CREATED: [2024-09-23 Mon 16:45]
|
||||
:ID: Amazon-dot-com-The-Guerrilla-s-Guide-To-The-2026-03-31-17-27-57
|
||||
:TITLE: Amazon.com: The Guerrilla's Guide To The Baofeng Radio: 9798366525107: Scout, NC: Books
|
||||
:URI: https://www.amazon.com/Guerrillas-Guide-Baofeng-Radio/dp/B0BNV21F4P?linkId=fa8d8952af9821a0b68f3706676c02bc&language=en_US
|
||||
:ORG_GTD: Someday
|
||||
:CATEGORY: Atoms
|
||||
:END:
|
||||
|
||||
|
||||
|
||||
** [[https://www.freewellgear.com/en/55-smart-phone][Sherpa iPhone Lens Kit: ND, CPL, Anamorphic & More]]
|
||||
:PROPERTIES:
|
||||
:CREATED: [2024-09-24 Tue 15:50]
|
||||
:ID: Sherpa-iPhone-Lens-Kit-ND-CPL-Anamorphic-and-More-2026-03-31-17-29-19
|
||||
:TITLE: Sherpa iPhone Lens Kit: ND, CPL, Anamorphic & More
|
||||
:URI: https://www.freewellgear.com/en/55-smart-phone
|
||||
:ORG_GTD: Someday
|
||||
:CATEGORY: Atoms
|
||||
:END:
|
||||
|
||||
|
||||
|
||||
** [[https://www.freewellgear.com/en/][Freewell | Top Camera, Smartphone & Drone Gear for Pros]]
|
||||
:PROPERTIES:
|
||||
:CREATED: [2024-09-28 Sat 05:27]
|
||||
:ID: Freewell-Top-Camera-Smartphone-and-Drone-Gear-for-2026-03-31-17-31-59
|
||||
:TITLE: Freewell | Top Camera, Smartphone & Drone Gear for Pros
|
||||
:URI: https://www.freewellgear.com/en/
|
||||
:ORG_GTD: Someday
|
||||
:CATEGORY: Atoms
|
||||
:END:
|
||||
|
||||
|
||||
|
||||
** AOOSTAR WTR PRO 4 Bay 90T Storage INTEL N100 Nas Mini PC – AOOSTAR Mini PC
|
||||
:PROPERTIES:
|
||||
:CREATED: [2024-09-30 Mon 15:18]
|
||||
:ID: AOOSTAR-WTR-PRO-4-Bay-90T-Storage-INTEL-N100-Nas-2026-03-31-17-32-57
|
||||
:ORG_GTD: Someday
|
||||
:CATEGORY: Atoms
|
||||
:END:
|
||||
|
||||
https://aoostar.com/products/aoostar-n9e-intel-n100-mini-pc4c-4t-up-to-3-4ghz-with-w11-home-8-16gb-ddr4-3200mhz-ram-256-512gb-m-2-2280-nvme-ssd
|
||||
|
||||
** [[https://bellroy.com/products/transit-backpack-plus?color=black&material=dura_nylon_recycled&ranEAID=3707496&ranMID=43345&ranSiteID=zejn0xW3gLs-0gSj8VAMIc2BB7QglxWYMw#slide-15][Transit Backpack Plus | Large laptop travel backpack | Bellroy]]
|
||||
:PROPERTIES:
|
||||
:CREATED: [2024-09-30 Mon 15:19]
|
||||
:ID: Transit-Backpack-Plus-Large-laptop-travel-2026-03-31-17-33-11
|
||||
:TITLE: Transit Backpack Plus | Large laptop travel backpack | Bellroy
|
||||
:URI: https://bellroy.com/products/transit-backpack-plus?color=black&material=dura_nylon_recycled&ranEAID=3707496&ranMID=43345&ranSiteID=zejn0xW3gLs-0gSj8VAMIc2BB7QglxWYMw#slide-15
|
||||
:ORG_GTD: Someday
|
||||
:CATEGORY: Atoms
|
||||
:END:
|
||||
|
||||
|
||||
|
||||
** [[https://bagbuilds.com/products/cerambyx64-mod_01][Cerambyx64 MOD_01 – Bag-Builds]]
|
||||
:PROPERTIES:
|
||||
:CREATED: [2024-09-30 Mon 15:21]
|
||||
:ID: Cerambyx64-MOD-01-Bag-Builds-2026-03-31-17-33-56
|
||||
:TITLE: Cerambyx64 MOD_01 – Bag-Builds
|
||||
:URI: https://bagbuilds.com/products/cerambyx64-mod_01
|
||||
:ORG_GTD: Someday
|
||||
:CATEGORY: Atoms
|
||||
:END:
|
||||
|
||||
|
||||
|
||||
** [[https://www.nomatic.com/collections/all-backpacks-bags/products/navigator-collapsible-sling-6l][Navigator Collapsible Sling 6L – NOMATIC]]
|
||||
:PROPERTIES:
|
||||
:CREATED: [2024-09-30 Mon 15:24]
|
||||
:ID: Navigator-Collapsible-Sling-6L-NOMATIC-2026-03-31-17-34-46
|
||||
:TITLE: Navigator Collapsible Sling 6L – NOMATIC
|
||||
:URI: https://www.nomatic.com/collections/all-backpacks-bags/products/navigator-collapsible-sling-6l
|
||||
:ORG_GTD: Someday
|
||||
:CATEGORY: Atoms
|
||||
:END:
|
||||
|
||||
|
||||
|
||||
** [[https://opensourcesdrlab.com/products/h4m-receiver-and-spectrum-analyzer][H4M Receiver and Spectrum Analyzer,HackRF One & Portapack]]
|
||||
:PROPERTIES:
|
||||
:CREATED: [2024-10-06 Sun 11:07]
|
||||
:ID: H4M-Receiver-and-Spectrum-Analyzer-HackRF-One-and-2026-03-31-17-38-27
|
||||
:TITLE: H4M Receiver and Spectrum Analyzer,HackRF One & Portapack
|
||||
:URI: https://opensourcesdrlab.com/products/h4m-receiver-and-spectrum-analyzer
|
||||
:ORG_GTD: Someday
|
||||
:CATEGORY: Atoms
|
||||
:END:
|
||||
|
||||
|
||||
|
||||
** [[https://pubs.usgs.gov/gip/usgsmaps/usgsmaps.html#7.5-minute][USGS Maps Booklet]]
|
||||
:PROPERTIES:
|
||||
:CREATED: [2024-10-07 Mon 20:00]
|
||||
:ID: USGS-Maps-Booklet-2026-03-31-17-38-40
|
||||
:TITLE: USGS Maps Booklet
|
||||
:URI: https://pubs.usgs.gov/gip/usgsmaps/usgsmaps.html#7.5-minute
|
||||
:ORG_GTD: Someday
|
||||
:CATEGORY: Atoms
|
||||
:END:
|
||||
|
||||
|
||||
|
||||
** [[https://mapstore.mytopo.com/][MyTopo Map Store: Waterproof Maps Shipped in 24 Hours]]
|
||||
:PROPERTIES:
|
||||
:CREATED: [2024-10-07 Mon 20:01]
|
||||
:ID: MyTopo-Map-Store-Waterproof-Maps-Shipped-in-24-2026-03-31-17-38-47
|
||||
:TITLE: MyTopo Map Store: Waterproof Maps Shipped in 24 Hours
|
||||
:URI: https://mapstore.mytopo.com/
|
||||
:ORG_GTD: Someday
|
||||
:CATEGORY: Atoms
|
||||
:END:
|
||||
|
||||
|
||||
|
||||
** [[https://kv4p.com/][kv4p HT - open source ham radio transceiver for your smartphone]]
|
||||
:PROPERTIES:
|
||||
:CREATED: [2024-10-15 Tue 13:57]
|
||||
:ID: kv4p-HT-open-source-ham-radio-transceiver-for-2026-03-31-17-39-46
|
||||
:TITLE: kv4p HT - open source ham radio transceiver for your smartphone
|
||||
:URI: https://kv4p.com/
|
||||
:ORG_GTD: Someday
|
||||
:CATEGORY: Atoms
|
||||
:END:
|
||||
|
||||
|
||||
|
||||
** [[https://roxontool.com/products/s503g?sscid=a1k8_t8q53][Flex Companion – Modular SAK for Ultimate Versatility]]
|
||||
:PROPERTIES:
|
||||
:CREATED: [2024-10-15 Tue 16:46]
|
||||
:ID: Flex-Companion-Modular-SAK-for-Ultimate-2026-03-31-17-39-58
|
||||
:TITLE: Flex Companion – Modular SAK for Ultimate Versatility
|
||||
:URI: https://roxontool.com/products/s503g?sscid=a1k8_t8q53
|
||||
:ORG_GTD: Someday
|
||||
:CATEGORY: Atoms
|
||||
:END:
|
||||
|
||||
|
||||
|
||||
** [[https://www.amazon.com/Fix-Manufacturing-separately-wearable-solution/dp/B07GN74GPS?linkId=28cfbe464c0c3715f1e63728996adc91&language=en_US&psc=1][Amazon.com: Fix Manufacturing/All Time Belt/Black/holds tool (sold separately) wearable solution (Medium) : Tools & Home Improvement]]
|
||||
:PROPERTIES:
|
||||
:CREATED: [2024-10-19 Sat 09:41]
|
||||
:ID: Amazon-dot-com-Fix-Manufacturing-All-Time-Belt-2026-03-31-17-40-15
|
||||
:TITLE: Amazon.com: Fix Manufacturing/All Time Belt/Black/holds tool (sold separately) wearable solution (Medium) : Tools & Home Improvement
|
||||
:URI: https://www.amazon.com/Fix-Manufacturing-separately-wearable-solution/dp/B07GN74GPS?linkId=28cfbe464c0c3715f1e63728996adc91&language=en_US&psc=1
|
||||
:ORG_GTD: Someday
|
||||
:CATEGORY: Atoms
|
||||
:END:
|
||||
|
||||
|
||||
|
||||
** [[https://www.amazon.com/Fix-Manufacturing-Portable-Maintenance-Mountain/dp/B072HM82QX?linkId=04aaf3e29713321e856d9bcf3f196858&language=en_US][Amazon.com : Fix Manufacturing Wheelie Wrench™ Bike Tool Compact and Portable Multi Tool for Bicycle Repair and Maintenance Perfect to fix Most Road, Mountain, and BMX Bikes : Sports & Outdoors]]
|
||||
:PROPERTIES:
|
||||
:CREATED: [2024-10-19 Sat 09:41]
|
||||
:ID: Amazon-dot-com-Fix-Manufacturing-Wheelie-Wrench-2026-03-31-17-40-31
|
||||
:TITLE: Amazon.com : Fix Manufacturing Wheelie Wrench™ Bike Tool Compact and Portable Multi Tool for Bicycle Repair and Maintenance Perfect to fix Most Road, Mountain, and BMX Bikes : Sports & Outdoors
|
||||
:URI: https://www.amazon.com/Fix-Manufacturing-Portable-Maintenance-Mountain/dp/B072HM82QX?linkId=04aaf3e29713321e856d9bcf3f196858&language=en_US
|
||||
:ORG_GTD: Someday
|
||||
:CATEGORY: Atoms
|
||||
:END:
|
||||
|
||||
|
||||
|
||||
** [[https://www.kickstarter.com/projects/silverfoxtools/neo-pen][Neo Pen by Silver Fox Tools — Kickstarter]]
|
||||
:PROPERTIES:
|
||||
:CREATED: [2024-10-19 Sat 09:41]
|
||||
:ID: Neo-Pen-by-Silver-Fox-Tools-Kickstarter-2026-03-31-17-40-37
|
||||
:TITLE: Neo Pen by Silver Fox Tools — Kickstarter
|
||||
:URI: https://www.kickstarter.com/projects/silverfoxtools/neo-pen
|
||||
:ORG_GTD: Someday
|
||||
:CATEGORY: Atoms
|
||||
:END:
|
||||
|
||||
|
||||
|
||||
** [[https://www.amazon.com/OUTDOOR-EDGE-UTILIPRO-Utility-Knife/dp/B09X2GLKFD?linkId=b79a428f94e25fea1becf35adfd88ea5&language=en_US][Amazon.com: OUTDOOR EDGE UTILIPRO 5 in 1 Utility Knife - Bottle Opener Flathead/Prybar, Phillips Screw Driver, Line Cutter & Pocket Clip. Uses Standard Utility Razor Blades (Orange) : Tools & Home Improvement]]
|
||||
:PROPERTIES:
|
||||
:CREATED: [2024-10-19 Sat 09:44]
|
||||
:ID: Amazon-dot-com-OUTDOOR-EDGE-UTILIPRO-5-in-1-2026-03-31-17-40-44
|
||||
:TITLE: Amazon.com: OUTDOOR EDGE UTILIPRO 5 in 1 Utility Knife - Bottle Opener Flathead/Prybar, Phillips Screw Driver, Line Cutter & Pocket Clip. Uses Standard Utility Razor Blades (Orange) : Tools & Home Improvement
|
||||
:URI: https://www.amazon.com/OUTDOOR-EDGE-UTILIPRO-Utility-Knife/dp/B09X2GLKFD?linkId=b79a428f94e25fea1becf35adfd88ea5&language=en_US
|
||||
:ORG_GTD: Someday
|
||||
:CATEGORY: Atoms
|
||||
:END:
|
||||
|
||||
|
||||
|
||||
** [[https://veroengineering.com/products/vortex-lite-maintenance-kit][Vortex Lite | Vero Engineering]]
|
||||
:PROPERTIES:
|
||||
:CREATED: [2024-10-19 Sat 09:51]
|
||||
:ID: Vortex-Lite-Vero-Engineering-2026-03-31-17-40-50
|
||||
:TITLE: Vortex Lite | Vero Engineering
|
||||
:URI: https://veroengineering.com/products/vortex-lite-maintenance-kit
|
||||
:ORG_GTD: Someday
|
||||
:CATEGORY: Atoms
|
||||
:END:
|
||||
|
||||
I should be able to make this
|
||||
|
||||
** [[https://www.printables.com/model/741124-lilygo-t-deck-td1-case-by-alley-cat][Lilygo T-Deck TD1 Case by Alley Cat by Alley Cat | Download free STL model | Printables.com]]
|
||||
:PROPERTIES:
|
||||
:CREATED: [2024-10-21 Mon 09:01]
|
||||
:ID: Lilygo-T-Deck-TD1-Case-by-Alley-Cat-by-Alley-Cat-2026-03-31-17-41-23
|
||||
:TITLE: Lilygo T-Deck TD1 Case by Alley Cat by Alley Cat | Download free STL model | Printables.com
|
||||
:URI: https://www.printables.com/model/741124-lilygo-t-deck-td1-case-by-alley-cat
|
||||
:ORG_GTD: Someday
|
||||
:CATEGORY: Atoms
|
||||
:END:
|
||||
|
||||
|
||||
|
||||
** [[https://www.lilygo.cc/products/t-deck][T-Deck – LILYGO®]]
|
||||
:PROPERTIES:
|
||||
:CREATED: [2024-10-21 Mon 09:02]
|
||||
:ID: T-Deck-LILYGO-2026-03-31-17-41-32
|
||||
:TITLE: T-Deck – LILYGO®
|
||||
:URI: https://www.lilygo.cc/products/t-deck
|
||||
:ORG_GTD: Someday
|
||||
:CATEGORY: Atoms
|
||||
:END:
|
||||
|
||||
|
||||
|
||||
** [[https://beyondclothing.com/collections/mens-collection][Men's Collection | Clothing that Protects, Breathes, & Moves with Ease – Beyond Clothing]]
|
||||
:PROPERTIES:
|
||||
:CREATED: [2024-10-21 Mon 21:27]
|
||||
:ID: Men-s-Collection-Clothing-that-Protects-Breathes-2026-03-31-17-41-44
|
||||
:TITLE: Men's Collection | Clothing that Protects, Breathes, & Moves with Ease – Beyond Clothing
|
||||
:URI: https://beyondclothing.com/collections/mens-collection
|
||||
:ORG_GTD: Someday
|
||||
:CATEGORY: Atoms
|
||||
:END:
|
||||
|
||||
|
||||
|
||||
PCU system
|
||||
|
||||
** [[https://store.h2gopurifier.com/products/h2go-purifier-global][H2gO Purifier GLOBAL Model – Aqua Research Store]]
|
||||
:PROPERTIES:
|
||||
:CREATED: [2024-10-22 Tue 14:49]
|
||||
:ID: H2gO-Purifier-GLOBAL-Model-Aqua-Research-Store-2026-03-31-17-41-51
|
||||
:TITLE: H2gO Purifier GLOBAL Model – Aqua Research Store
|
||||
:URI: https://store.h2gopurifier.com/products/h2go-purifier-global
|
||||
:ORG_GTD: Someday
|
||||
:CATEGORY: Atoms
|
||||
:END:
|
||||
|
||||
|
||||
|
||||
** [[https://unboundmerino.com/collections/mens-merino-wool-clothing/products/compact-travel-hoodie?variant=39707013578846][Men's Compact Travel Hoodie | Unbound Merino]]
|
||||
:PROPERTIES:
|
||||
:CREATED: [2024-10-27 Sun 12:43]
|
||||
:ID: Men-s-Compact-Travel-Hoodie-Unbound-Merino-2026-03-31-17-42-02
|
||||
:TITLE: Men's Compact Travel Hoodie | Unbound Merino
|
||||
:URI: https://unboundmerino.com/collections/mens-merino-wool-clothing/products/compact-travel-hoodie?variant=39707013578846
|
||||
:ORG_GTD: Someday
|
||||
:CATEGORY: Atoms
|
||||
:END:
|
||||
|
||||
|
||||
|
||||
** [[https://www.amazon.com/Invisibilia-Dei-Collection-Anti-Magical-Cornelius/dp/B0DKD1MHLB?linkId=1bf323b581c60dfce960c4bf9a4c4045&language=en_US][Amazon.com: Invisibilia Dei: A Collection of Hermetic, Mystical, and Anti-Magical Works by Heinrich Cornelius Agrippa: 9798343685282: Attrell, Dan, Sledge, Justin: Books]]
|
||||
:PROPERTIES:
|
||||
:CREATED: [2024-10-30 Wed 09:05]
|
||||
:ID: Amazon-dot-com-Invisibilia-Dei-A-Collection-of-2026-03-31-17-42-14
|
||||
:TITLE: Amazon.com: Invisibilia Dei: A Collection of Hermetic, Mystical, and Anti-Magical Works by Heinrich Cornelius Agrippa: 9798343685282: Attrell, Dan, Sledge, Justin: Books
|
||||
:URI: https://www.amazon.com/Invisibilia-Dei-Collection-Anti-Magical-Cornelius/dp/B0DKD1MHLB?linkId=1bf323b581c60dfce960c4bf9a4c4045&language=en_US
|
||||
:ORG_GTD: Someday
|
||||
:CATEGORY: Atoms
|
||||
:END:
|
||||
|
||||
|
||||
|
||||
** [[https://www.stelo.com/en-us][Stelo Wearable Glucose Biosensor | Stelo by Dexcom]]
|
||||
:PROPERTIES:
|
||||
:CREATED: [2024-11-02 Sat 12:35]
|
||||
:ID: Stelo-Wearable-Glucose-Biosensor-Stelo-by-Dexcom-2026-03-31-17-43-56
|
||||
:TITLE: Stelo Wearable Glucose Biosensor | Stelo by Dexcom
|
||||
:URI: https://www.stelo.com/en-us
|
||||
:ORG_GTD: Someday
|
||||
:CATEGORY: Atoms
|
||||
:END:
|
||||
|
||||
|
||||
|
||||
** [[https://www.geoship.is/][Geoship | Bioceramic domes]]
|
||||
:PROPERTIES:
|
||||
:CREATED: [2024-11-04 Mon 15:45]
|
||||
:ID: Geoship-Bioceramic-domes-2026-03-31-17-44-01
|
||||
:TITLE: Geoship | Bioceramic domes
|
||||
:URI: https://www.geoship.is/
|
||||
:ORG_GTD: Someday
|
||||
:CATEGORY: Atoms
|
||||
:END:
|
||||
|
||||
|
||||
|
||||
** [[https://www.ikoolcore.com/products/ikoolcore-r2-max][R2 Max - Next-Gen 10G Firewall Gateway Server – iKOOLCORE]]
|
||||
:PROPERTIES:
|
||||
:CREATED: [2024-11-24 Sun 16:44]
|
||||
:ID: R2-Max-Next-Gen-10G-Firewall-Gateway-Server-2026-03-31-17-44-35
|
||||
:TITLE: R2 Max - Next-Gen 10G Firewall Gateway Server – iKOOLCORE
|
||||
:URI: https://www.ikoolcore.com/products/ikoolcore-r2-max
|
||||
:ORG_GTD: Someday
|
||||
:CATEGORY: Atoms
|
||||
:END:
|
||||
|
||||
|
||||
|
||||
** [[https://ezra.com/][Full-Body MRI Screening Service by ezra]]
|
||||
:PROPERTIES:
|
||||
:CREATED: [2025-01-05 Sun 10:37]
|
||||
:ID: Full-Body-MRI-Screening-Service-by-ezra-2026-03-31-17-48-40
|
||||
:TITLE: Full-Body MRI Screening Service by ezra
|
||||
:URI: https://ezra.com/
|
||||
:ORG_GTD: Someday
|
||||
:CATEGORY: Atoms
|
||||
:END:
|
||||
|
||||
|
||||
|
||||
** [[https://mecha.so/comet][Mecha Comet - Modular Linux Handheld Computer powered by Open-Source Software]]
|
||||
:PROPERTIES:
|
||||
:CREATED: [2025-01-11 Sat 09:01]
|
||||
:ID: Mecha-Comet-Modular-Linux-Handheld-Computer-2026-03-31-17-48-48
|
||||
:TITLE: Mecha Comet - Modular Linux Handheld Computer powered by Open-Source Software
|
||||
:URI: https://mecha.so/comet
|
||||
:ORG_GTD: Someday
|
||||
:CATEGORY: Atoms
|
||||
:END:
|
||||
|
||||
|
||||
|
||||
** [[https://blog.adafruit.com/2025/01/03/portable-air-quality-meter/][Portable Air Quality Meter #piday #raspberrypi @Raspberry_Pi « Adafruit Industries – Makers, hackers, artists, designers and engineers!]]
|
||||
:PROPERTIES:
|
||||
:CREATED: [2025-01-12 Sun 15:19]
|
||||
:ID: Portable-Air-Quality-Meter-piday-raspberrypi-2026-03-31-17-48-58
|
||||
:TITLE: Portable Air Quality Meter #piday #raspberrypi @Raspberry_Pi « Adafruit Industries – Makers, hackers, artists, designers and engineers!
|
||||
:URI: https://blog.adafruit.com/2025/01/03/portable-air-quality-meter/
|
||||
:ORG_GTD: Someday
|
||||
:CATEGORY: Atoms
|
||||
:END:
|
||||
|
||||
|
||||
|
||||
** [[https://www.seeedstudio.com/SenseCAP-Card-Tracker-T1000-E-for-Meshtastic-p-5913.html][SenseCAP Card Tracker T1000-E for Meshtastic]]
|
||||
:PROPERTIES:
|
||||
:CREATED: [2025-02-19 Wed 08:46]
|
||||
:ID: SenseCAP-Card-Tracker-T1000-E-for-Meshtastic-2026-03-31-17-52-51
|
||||
:ORG_GTD: Someday
|
||||
:CATEGORY: Atoms
|
||||
:END:
|
||||
|
||||
|
||||
** [[https://www.ruarkaudio.com/us/products/r610-music-console][Ruark R610 Music Console]]
|
||||
:PROPERTIES:
|
||||
:CREATED: [2025-02-24 Mon 10:06]
|
||||
:ID: Ruark-R610-Music-Console-2026-03-31-17-54-02
|
||||
:ORG_GTD: Someday
|
||||
:CATEGORY: Atoms
|
||||
:END:
|
||||
|
||||
|
||||
** [[https://true-residential.com/][True Residential | Luxury Refrigerators with Commercial DNA]]
|
||||
:PROPERTIES:
|
||||
:CREATED: [2025-03-04 Tue 12:44]
|
||||
:ID: True-Residential-Luxury-Refrigerators-with-2026-03-31-17-56-09
|
||||
:ORG_GTD: Someday
|
||||
:CATEGORY: Atoms
|
||||
:END:
|
||||
|
||||
|
||||
** [[https://echowater.com/products/echo-flask][Echo Flask Hydrogen Water Bottle]]
|
||||
:PROPERTIES:
|
||||
:CREATED: [2025-03-05 Wed 17:14]
|
||||
:ID: Echo-Flask-Hydrogen-Water-Bottle-2026-03-31-17-57-23
|
||||
:ORG_GTD: Someday
|
||||
:CATEGORY: Atoms
|
||||
:END:
|
||||
|
||||
|
||||
** [[https://echowater.com/products/echo-ultimate-hydrogen-water][Echo Ultimate™ Hydrogen Alkaline Water Machine - Multi-Functional Water Enhancement System]]
|
||||
:PROPERTIES:
|
||||
:CREATED: [2025-03-05 Wed 17:48]
|
||||
:ID: Echo-Ultimate-Hydrogen-Alkaline-Water-Machine-2026-03-31-17-57-49
|
||||
:ORG_GTD: Someday
|
||||
:CATEGORY: Atoms
|
||||
:END:
|
||||
|
||||
|
||||
** [[https://frameless.com/][FRAMELESS | The Ultimate Immersive Art Experience]]
|
||||
:PROPERTIES:
|
||||
:CREATED: [2025-03-09 Sun 13:01]
|
||||
:ID: FRAMELESS-The-Ultimate-Immersive-Art-Experience-2026-03-31-18-00-32
|
||||
:ORG_GTD: Someday
|
||||
:CATEGORY: Atoms
|
||||
:END:
|
||||
|
||||
For a modern temple
|
||||
|
||||
** [[https://www.clockworkpi.com/picocalc][PicoCalc | ClockworkPi]]
|
||||
:PROPERTIES:
|
||||
:CREATED: [2025-03-13 Thu 08:47]
|
||||
:ID: PicoCalc-ClockworkPi-2026-03-31-18-03-11
|
||||
:ORG_GTD: Someday
|
||||
:CATEGORY: Atoms
|
||||
:END:
|
||||
|
||||
|
||||
** [[https://hixfy.com/products/zipfix-quick-repair-tool][ZipFix Quick Repair Tool - Hixfy]]
|
||||
:PROPERTIES:
|
||||
:CREATED: [2025-03-13 Thu 09:30]
|
||||
:ID: ZipFix-Quick-Repair-Tool-Hixfy-2026-03-31-18-03-40
|
||||
:ORG_GTD: Someday
|
||||
:CATEGORY: Atoms
|
||||
:END:
|
||||
|
||||
|
||||
** [[https://lnvpn.net/][LNVPN - Bitcoin VPN & eSIM Service | $0.10 VPN | $0.99 eSIM]]
|
||||
:PROPERTIES:
|
||||
:CREATED: [2025-03-16 Sun 02:27]
|
||||
:ID: LNVPN-Bitcoin-VPN-and-eSIM-Service-0-dot-10-VPN-0-2026-03-31-18-06-10
|
||||
:ORG_GTD: Someday
|
||||
:CATEGORY: Atoms
|
||||
:END:
|
||||
|
||||
|
||||
** [[https://tollgate.me/][TollGate || Bitcoin-powered WiFi Network]]
|
||||
:PROPERTIES:
|
||||
:CREATED: [2025-03-16 Sun 08:31]
|
||||
:ID: TollGate-Bitcoin-powered-WiFi-Network-2026-03-31-18-06-34
|
||||
:ORG_GTD: Someday
|
||||
:CATEGORY: Atoms
|
||||
:END:
|
||||
|
||||
|
||||
** [[https://altairtech.io/product/urlacher/][The Urlacher – Altair Technology – Bitcoin Mining Solutions]]
|
||||
:PROPERTIES:
|
||||
:CREATED: [2025-03-17 Mon 14:07]
|
||||
:ID: The-Urlacher-Altair-Technology-Bitcoin-Mining-2026-03-31-18-12-44
|
||||
:ORG_GTD: Someday
|
||||
:CATEGORY: Atoms
|
||||
:END:
|
||||
|
||||
|
||||
** [[https://source.co/][SOURCE Global]] :water:years:
|
||||
:PROPERTIES:
|
||||
:CREATED: [2025-03-31 Mon 14:09]
|
||||
:ID: SOURCE-Global-2026-03-31-18-15-28
|
||||
:ORG_GTD: Someday
|
||||
:CATEGORY: Atoms
|
||||
:END:
|
||||
|
||||
|
||||
** [[https://www.bitdeer.com/shop/sealminer][SEALMINER A2 Pro Bitcoin Mining Rig - Mine With Higher Hashrates]]
|
||||
:PROPERTIES:
|
||||
:CREATED: [2025-04-05 Sat 07:12]
|
||||
:ID: SEALMINER-A2-Pro-Bitcoin-Mining-Rig-Mine-With-2026-03-31-18-18-18
|
||||
:ORG_GTD: Someday
|
||||
:CATEGORY: Atoms
|
||||
:END:
|
||||
|
||||
Water-cooled, 19 inch racked
|
||||
|
||||
** [[https://www.nutridrip.com/wellness-drips/][Wellness IV Drips - IV Therapy NYC | NutriDrip]]
|
||||
:PROPERTIES:
|
||||
:CREATED: [2025-04-15 Tue 16:33]
|
||||
:ID: Wellness-IV-Drips-IV-Therapy-NYC-NutriDrip-2026-03-31-18-21-41
|
||||
:ORG_GTD: Someday
|
||||
:CATEGORY: Atoms
|
||||
:END:
|
||||
|
||||
|
||||
** [[https://www.printables.com/model/1214361-opengrid-walldesk-mounting-framework-and-ecosystem][openGrid - Wall/Desk mounting framework and ecosystem by David D | Download free STL model | Printables.com]]
|
||||
:PROPERTIES:
|
||||
:CREATED: [2025-04-20 Sun 09:41]
|
||||
:ID: openGrid-Wall-Desk-mounting-framework-and-2026-03-31-18-25-34
|
||||
:ORG_GTD: Someday
|
||||
:CATEGORY: Atoms
|
||||
:END:
|
||||
** [[https://m.elecrow.com/pages/shop/product/details?id=172714&][GrowCube-Plant Watering System Garden Smart Watering System]]
|
||||
:PROPERTIES:
|
||||
:CREATED: [2025-04-22 Tue 15:36]
|
||||
:ID: GrowCube-Plant-Watering-System-Garden-Smart-2026-03-31-18-26-00
|
||||
:ORG_GTD: Someday
|
||||
:CATEGORY: Atoms
|
||||
:END:
|
||||
|
||||
|
||||
** [[https://www.switch-bot.com/pages/switchbot-wallet-finder-card][SwitchBot Wallet Finder Card – SwitchBot International]]
|
||||
:PROPERTIES:
|
||||
:CREATED: [2025-04-22 Tue 15:55]
|
||||
:ID: SwitchBot-Wallet-Finder-Card-SwitchBot-2026-03-31-18-27-07
|
||||
:ORG_GTD: Someday
|
||||
:CATEGORY: Atoms
|
||||
:END:
|
||||
|
||||
|
||||
** [[https://www.switch-bot.com/pages/switchbot-lock-pro][SwitchBot Lock Pro – SwitchBot International]]
|
||||
:PROPERTIES:
|
||||
:CREATED: [2025-04-22 Tue 15:56]
|
||||
:ID: SwitchBot-Lock-Pro-SwitchBot-International-2026-03-31-18-27-22
|
||||
:ORG_GTD: Someday
|
||||
:CATEGORY: Atoms
|
||||
:END:
|
||||
|
||||
|
||||
** [[https://www.slate.auto/en][SLATE Auto | The Customizable EV That Works for You]]
|
||||
:PROPERTIES:
|
||||
:CREATED: [2025-04-26 Sat 03:29]
|
||||
:ID: SLATE-Auto-The-Customizable-EV-That-Works-for-You-2026-03-31-18-27-45
|
||||
:ORG_GTD: Someday
|
||||
:CATEGORY: Atoms
|
||||
:END:
|
||||
|
||||
|
||||
** [[https://vanderhallusa.com/models-venice-3-wheel-vehicles-autocycle/][Models Venice - Vanderhall Motor Works | All Electric EV Sport, Off-Road Vehicles]]
|
||||
:PROPERTIES:
|
||||
:CREATED: [2025-04-27 Sun 18:53]
|
||||
:ID: Models-Venice-Vanderhall-Motor-Works-All-Electric-2026-03-31-18-29-43
|
||||
:ORG_GTD: Someday
|
||||
:CATEGORY: Atoms
|
||||
:END:
|
||||
|
||||
|
||||
** [[https://desert-wireless.com/tproduct/627963580-337292067672-tx-500mp-portable-hfvhfl-transceiver][TX-500MP Portable HF/VHFL Transceiver - Lab599]] :radio:
|
||||
:PROPERTIES:
|
||||
:CREATED: [2025-04-29 Tue 12:36]
|
||||
:ID: TX-500MP-Portable-HF-VHFL-Transceiver-Lab599-2026-03-31-18-31-38
|
||||
:ORG_GTD: Someday
|
||||
:CATEGORY: Atoms
|
||||
:END:
|
||||
|
||||
|
||||
** [[https://www.functionhealth.com/scan][Function Health | Full-Body 160+ Lab Tests & Full-body MRIs]]
|
||||
:PROPERTIES:
|
||||
:CREATED: [2025-05-07 Wed 09:30]
|
||||
:ID: Function-Health-Full-Body-160-plus-Lab-Tests-and-2026-03-31-18-35-16
|
||||
:ORG_GTD: Someday
|
||||
:CATEGORY: Flags
|
||||
:END:
|
||||
|
||||
** [[https://soundbender36.wordpress.com/][SOUND BENDER 36 | Circuit Bending / Machines électronik & Modular Synth DIY]] :music:modular:
|
||||
:PROPERTIES:
|
||||
:CREATED: [2025-05-07 Wed 12:55]
|
||||
:ID: SOUND-BENDER-36-Circuit-Bending-Machines-2026-03-31-18-36-30
|
||||
:ORG_GTD: Someday
|
||||
:CATEGORY: Atoms
|
||||
:END:
|
||||
|
||||
|
||||
** [[https://hackaday.com/2025/05/06/diy-penicillin/][DIY Penicillin | Hackaday]] :health:medicine:
|
||||
:PROPERTIES:
|
||||
:CREATED: [2025-05-07 Wed 20:46]
|
||||
:ID: DIY-Penicillin-Hackaday-2026-03-31-18-36-54
|
||||
:ORG_GTD: Someday
|
||||
:CATEGORY: Atoms
|
||||
:END:
|
||||
|
||||
|
||||
** [[https://www.opulo.io/products/lumenpnp][LumenPnP - Accurate and Reliable Pick and Place Machine – Opulo]] :diy:electronics:making:
|
||||
:PROPERTIES:
|
||||
:CREATED: [2025-05-09 Fri 15:41]
|
||||
:ID: LumenPnP-Accurate-and-Reliable-Pick-and-Place-2026-03-31-18-38-41
|
||||
:ORG_GTD: Someday
|
||||
:CATEGORY: Atoms
|
||||
:END:
|
||||
|
||||
|
||||
** [[https://github.com/opulo-inc/lumenpnp][GitHub - opulo-inc/lumenpnp: The LumenPnP is an open source pick and place machine.]] :DIY:electronics:making:
|
||||
:PROPERTIES:
|
||||
:CREATED: [2025-05-09 Fri 15:42]
|
||||
:ID: GitHub-opulo-inc-lumenpnp-The-LumenPnP-is-an-open-2026-03-31-18-39-30
|
||||
:ORG_GTD: Someday
|
||||
:CATEGORY: Atoms
|
||||
:END:
|
||||
|
||||
|
||||
** [[https://www.chastity-shop.com/][Chastity keys in silver and gold | chastity art | keyholder jewelry – chastity-shop]] :sex:
|
||||
:PROPERTIES:
|
||||
:CREATED: [2025-05-14 Wed 08:06]
|
||||
:ID: Chastity-keys-in-silver-and-gold-chastity-art-2026-03-31-18-40-53
|
||||
:ORG_GTD: Someday
|
||||
:CATEGORY: Atoms
|
||||
:END:
|
||||
|
||||
** [[https://www.levante.eco/][Levante]] :solar:power:
|
||||
:PROPERTIES:
|
||||
:CREATED: [2025-05-14 Wed 13:49]
|
||||
:ID: Levante-2026-03-31-18-41-22
|
||||
:ORG_GTD: Someday
|
||||
:CATEGORY: Atoms
|
||||
:END:
|
||||
|
||||
|
||||
** [[https://whatsminer.net/shop/][Products Archive - Whatsminer]]
|
||||
:PROPERTIES:
|
||||
:CREATED: [2025-05-14 Wed 17:48]
|
||||
:ID: Products-Archive-Whatsminer-2026-03-31-18-42-38
|
||||
:ORG_GTD: Someday
|
||||
:CATEGORY: Atoms
|
||||
:END:
|
||||
|
||||
Rack mounted Bitcoin miner
|
||||
|
||||
** [[https://rackrobo.io/collections/all][Products – Rack Robo]]
|
||||
:PROPERTIES:
|
||||
:CREATED: [2025-05-26 Mon 09:17]
|
||||
:ID: Products-Rack-Robo-2026-03-31-18-46-33
|
||||
:ORG_GTD: Someday
|
||||
:CATEGORY: Atoms
|
||||
:END:
|
||||
|
||||
** [[https://vanderhallusa.com/][Home - Vanderhall Motor Works | All Electric EV Sport, Off-Road Vehicles]]
|
||||
:PROPERTIES:
|
||||
:TITLE: Home - Vanderhall Motor Works | All Electric EV Sport, Off-Road Vehicles
|
||||
:URI: https://vanderhallusa.com/
|
||||
:CREATED: [2025-05-30 Fri 12:28]
|
||||
:ID: Home-Vanderhall-Motor-Works-All-Electric-EV-Sport-2026-03-31-18-51-24
|
||||
:ORG_GTD: Someday
|
||||
:CATEGORY: Atoms
|
||||
:END:
|
||||
|
||||
** [[https://www.indiegogo.com/projects/liberux-nexx--3#/][Liberux NEXX | Indiegogo]] :days:
|
||||
:PROPERTIES:
|
||||
:TITLE: Liberux NEXX | Indiegogo
|
||||
:URI: https://www.indiegogo.com/projects/liberux-nexx--3#/
|
||||
:CREATED: [2025-06-03 Tue 11:31]
|
||||
:ID: Liberux-NEXX-Indiegogo-2026-03-31-18-53-09
|
||||
:ORG_GTD: Someday
|
||||
:CATEGORY: Atoms
|
||||
:END:
|
||||
|
||||
** [[https://www.coalax.com/products/lancer300-modular-backpack][Coalax Lancer300 Camera Backpack]] :radio:weeks:
|
||||
:PROPERTIES:
|
||||
:TITLE: Coalax Lancer300 Camera Backpack
|
||||
:URI: https://www.coalax.com/products/lancer300-modular-backpack
|
||||
:CREATED: [2025-06-10 Tue 15:13]
|
||||
:ID: Coalax-Lancer300-Camera-Backpack-2026-03-31-18-54-02
|
||||
:ORG_GTD: Someday
|
||||
:CATEGORY: Atoms
|
||||
:END:
|
||||
|
||||
Might be a good backpack for mobile radio operation
|
||||
|
||||
** [[https://www.tricorderzero.com/][Health and Fitness Tracker | Tricorder.Zero]] :health:quantifiedSelf:
|
||||
:PROPERTIES:
|
||||
:TITLE: Health and Fitness Tracker | Tricorder.Zero
|
||||
:URI: https://www.tricorderzero.com/
|
||||
:CREATED: [2025-06-13 Fri 13:15]
|
||||
:ID: Health-and-Fitness-Tracker-Tricorder-dot-Zero-2026-03-31-18-57-48
|
||||
:ORG_GTD: Someday
|
||||
:CATEGORY: Atoms
|
||||
:END:
|
||||
|
||||
** [[https://www.kickstarter.com/projects/ankermake/eufymake-e1-the-first-personal-3d-textured-uv-printer][eufyMake E1: the First Personal 3D-Texture UV Printer by eufyMake — Kickstarter]] :making:years:
|
||||
:PROPERTIES:
|
||||
:TITLE: eufyMake E1: the First Personal 3D-Texture UV Printer by eufyMake — Kickstarter
|
||||
:URI: https://www.kickstarter.com/projects/ankermake/eufymake-e1-the-first-personal-3d-textured-uv-printer
|
||||
:CREATED: [2025-06-22 Sun 11:38]
|
||||
:ID: eufyMake-E1-the-First-Personal-3D-Texture-UV-2026-03-31-18-58-34
|
||||
:ORG_GTD: Someday
|
||||
:CATEGORY: Atoms
|
||||
:END:
|
||||
|
||||
|
||||
Submodule projects/org-agent updated: 98cf6006c7...2f20cbdc22
1
projects/org-skill-web-research/node_modules/.bin/playwright
generated
vendored
Symbolic link
1
projects/org-skill-web-research/node_modules/.bin/playwright
generated
vendored
Symbolic link
@@ -0,0 +1 @@
|
||||
../playwright/cli.js
|
||||
1
projects/org-skill-web-research/node_modules/.bin/playwright-core
generated
vendored
Symbolic link
1
projects/org-skill-web-research/node_modules/.bin/playwright-core
generated
vendored
Symbolic link
@@ -0,0 +1 @@
|
||||
../playwright-core/cli.js
|
||||
36
projects/org-skill-web-research/node_modules/.package-lock.json
generated
vendored
Normal file
36
projects/org-skill-web-research/node_modules/.package-lock.json
generated
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
{
|
||||
"name": "org-skill-web-research",
|
||||
"version": "1.0.0",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"node_modules/playwright": {
|
||||
"version": "1.58.2",
|
||||
"resolved": "https://registry.npmjs.org/playwright/-/playwright-1.58.2.tgz",
|
||||
"integrity": "sha512-vA30H8Nvkq/cPBnNw4Q8TWz1EJyqgpuinBcHET0YVJVFldr8JDNiU9LaWAE1KqSkRYazuaBhTpB5ZzShOezQ6A==",
|
||||
"dependencies": {
|
||||
"playwright-core": "1.58.2"
|
||||
},
|
||||
"bin": {
|
||||
"playwright": "cli.js"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"fsevents": "2.3.2"
|
||||
}
|
||||
},
|
||||
"node_modules/playwright-core": {
|
||||
"version": "1.58.2",
|
||||
"resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.58.2.tgz",
|
||||
"integrity": "sha512-yZkEtftgwS8CsfYo7nm0KE8jsvm6i/PTgVtB8DL726wNf6H2IMsDuxCpJj59KDaxCtSnrWan2AeDqM7JBaultg==",
|
||||
"bin": {
|
||||
"playwright-core": "cli.js"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
202
projects/org-skill-web-research/node_modules/playwright-core/LICENSE
generated
vendored
Normal file
202
projects/org-skill-web-research/node_modules/playwright-core/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,202 @@
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Portions Copyright (c) Microsoft Corporation.
|
||||
Portions Copyright 2017 Google Inc.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
5
projects/org-skill-web-research/node_modules/playwright-core/NOTICE
generated
vendored
Normal file
5
projects/org-skill-web-research/node_modules/playwright-core/NOTICE
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
Playwright
|
||||
Copyright (c) Microsoft Corporation
|
||||
|
||||
This software contains code derived from the Puppeteer project (https://github.com/puppeteer/puppeteer),
|
||||
available under the Apache 2.0 license (https://github.com/puppeteer/puppeteer/blob/master/LICENSE).
|
||||
3
projects/org-skill-web-research/node_modules/playwright-core/README.md
generated
vendored
Normal file
3
projects/org-skill-web-research/node_modules/playwright-core/README.md
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
# playwright-core
|
||||
|
||||
This package contains the no-browser flavor of [Playwright](http://github.com/microsoft/playwright).
|
||||
4076
projects/org-skill-web-research/node_modules/playwright-core/ThirdPartyNotices.txt
generated
vendored
Normal file
4076
projects/org-skill-web-research/node_modules/playwright-core/ThirdPartyNotices.txt
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
5
projects/org-skill-web-research/node_modules/playwright-core/bin/install_media_pack.ps1
generated
vendored
Normal file
5
projects/org-skill-web-research/node_modules/playwright-core/bin/install_media_pack.ps1
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
$osInfo = Get-WmiObject -Class Win32_OperatingSystem
|
||||
# check if running on Windows Server
|
||||
if ($osInfo.ProductType -eq 3) {
|
||||
Install-WindowsFeature Server-Media-Foundation
|
||||
}
|
||||
33
projects/org-skill-web-research/node_modules/playwright-core/bin/install_webkit_wsl.ps1
generated
vendored
Normal file
33
projects/org-skill-web-research/node_modules/playwright-core/bin/install_webkit_wsl.ps1
generated
vendored
Normal file
@@ -0,0 +1,33 @@
|
||||
$ErrorActionPreference = 'Stop'
|
||||
|
||||
# This script sets up a WSL distribution that will be used to run WebKit.
|
||||
|
||||
$Distribution = "playwright"
|
||||
$Username = "pwuser"
|
||||
|
||||
$distributions = (wsl --list --quiet) -split "\r?\n"
|
||||
if ($distributions -contains $Distribution) {
|
||||
Write-Host "WSL distribution '$Distribution' already exists. Skipping installation."
|
||||
} else {
|
||||
Write-Host "Installing new WSL distribution '$Distribution'..."
|
||||
$VhdSize = "10GB"
|
||||
wsl --install -d Ubuntu-24.04 --name $Distribution --no-launch --vhd-size $VhdSize
|
||||
wsl -d $Distribution -u root adduser --gecos GECOS --disabled-password $Username
|
||||
}
|
||||
|
||||
$pwshDirname = (Resolve-Path -Path $PSScriptRoot).Path;
|
||||
$playwrightCoreRoot = Resolve-Path (Join-Path $pwshDirname "..")
|
||||
|
||||
$initScript = @"
|
||||
if [ ! -f "/home/$Username/node/bin/node" ]; then
|
||||
mkdir -p /home/$Username/node
|
||||
curl -fsSL https://nodejs.org/dist/v22.17.0/node-v22.17.0-linux-x64.tar.xz -o /home/$Username/node/node-v22.17.0-linux-x64.tar.xz
|
||||
tar -xJf /home/$Username/node/node-v22.17.0-linux-x64.tar.xz -C /home/$Username/node --strip-components=1
|
||||
sudo -u $Username echo 'export PATH=/home/$Username/node/bin:\`$PATH' >> /home/$Username/.profile
|
||||
fi
|
||||
/home/$Username/node/bin/node cli.js install-deps webkit
|
||||
sudo -u $Username PLAYWRIGHT_SKIP_BROWSER_GC=1 /home/$Username/node/bin/node cli.js install webkit
|
||||
"@ -replace "\r\n", "`n"
|
||||
|
||||
wsl -d $Distribution --cd $playwrightCoreRoot -u root -- bash -c "$initScript"
|
||||
Write-Host "Done!"
|
||||
42
projects/org-skill-web-research/node_modules/playwright-core/bin/reinstall_chrome_beta_linux.sh
generated
vendored
Executable file
42
projects/org-skill-web-research/node_modules/playwright-core/bin/reinstall_chrome_beta_linux.sh
generated
vendored
Executable file
@@ -0,0 +1,42 @@
|
||||
#!/usr/bin/env bash
|
||||
set -e
|
||||
set -x
|
||||
|
||||
if [[ $(arch) == "aarch64" ]]; then
|
||||
echo "ERROR: not supported on Linux Arm64"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -z "$PLAYWRIGHT_HOST_PLATFORM_OVERRIDE" ]; then
|
||||
if [[ ! -f "/etc/os-release" ]]; then
|
||||
echo "ERROR: cannot install on unknown linux distribution (/etc/os-release is missing)"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
ID=$(bash -c 'source /etc/os-release && echo $ID')
|
||||
if [[ "${ID}" != "ubuntu" && "${ID}" != "debian" ]]; then
|
||||
echo "ERROR: cannot install on $ID distribution - only Ubuntu and Debian are supported"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
# 1. make sure to remove old beta if any.
|
||||
if dpkg --get-selections | grep -q "^google-chrome-beta[[:space:]]*install$" >/dev/null; then
|
||||
apt-get remove -y google-chrome-beta
|
||||
fi
|
||||
|
||||
# 2. Update apt lists (needed to install curl and chrome dependencies)
|
||||
apt-get update
|
||||
|
||||
# 3. Install curl to download chrome
|
||||
if ! command -v curl >/dev/null; then
|
||||
apt-get install -y curl
|
||||
fi
|
||||
|
||||
# 4. download chrome beta from dl.google.com and install it.
|
||||
cd /tmp
|
||||
curl -O https://dl.google.com/linux/direct/google-chrome-beta_current_amd64.deb
|
||||
apt-get install -y ./google-chrome-beta_current_amd64.deb
|
||||
rm -rf ./google-chrome-beta_current_amd64.deb
|
||||
cd -
|
||||
google-chrome-beta --version
|
||||
13
projects/org-skill-web-research/node_modules/playwright-core/bin/reinstall_chrome_beta_mac.sh
generated
vendored
Executable file
13
projects/org-skill-web-research/node_modules/playwright-core/bin/reinstall_chrome_beta_mac.sh
generated
vendored
Executable file
@@ -0,0 +1,13 @@
|
||||
#!/usr/bin/env bash
|
||||
set -e
|
||||
set -x
|
||||
|
||||
rm -rf "/Applications/Google Chrome Beta.app"
|
||||
cd /tmp
|
||||
curl --retry 3 -o ./googlechromebeta.dmg https://dl.google.com/chrome/mac/universal/beta/googlechromebeta.dmg
|
||||
hdiutil attach -nobrowse -quiet -noautofsck -noautoopen -mountpoint /Volumes/googlechromebeta.dmg ./googlechromebeta.dmg
|
||||
cp -pR "/Volumes/googlechromebeta.dmg/Google Chrome Beta.app" /Applications
|
||||
hdiutil detach /Volumes/googlechromebeta.dmg
|
||||
rm -rf /tmp/googlechromebeta.dmg
|
||||
|
||||
/Applications/Google\ Chrome\ Beta.app/Contents/MacOS/Google\ Chrome\ Beta --version
|
||||
24
projects/org-skill-web-research/node_modules/playwright-core/bin/reinstall_chrome_beta_win.ps1
generated
vendored
Normal file
24
projects/org-skill-web-research/node_modules/playwright-core/bin/reinstall_chrome_beta_win.ps1
generated
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
$ErrorActionPreference = 'Stop'
|
||||
|
||||
$url = 'https://dl.google.com/tag/s/dl/chrome/install/beta/googlechromebetastandaloneenterprise64.msi'
|
||||
|
||||
Write-Host "Downloading Google Chrome Beta"
|
||||
$wc = New-Object net.webclient
|
||||
$msiInstaller = "$env:temp\google-chrome-beta.msi"
|
||||
$wc.Downloadfile($url, $msiInstaller)
|
||||
|
||||
Write-Host "Installing Google Chrome Beta"
|
||||
$arguments = "/i `"$msiInstaller`" /quiet"
|
||||
Start-Process msiexec.exe -ArgumentList $arguments -Wait
|
||||
Remove-Item $msiInstaller
|
||||
|
||||
$suffix = "\\Google\\Chrome Beta\\Application\\chrome.exe"
|
||||
if (Test-Path "${env:ProgramFiles(x86)}$suffix") {
|
||||
(Get-Item "${env:ProgramFiles(x86)}$suffix").VersionInfo
|
||||
} elseif (Test-Path "${env:ProgramFiles}$suffix") {
|
||||
(Get-Item "${env:ProgramFiles}$suffix").VersionInfo
|
||||
} else {
|
||||
Write-Host "ERROR: Failed to install Google Chrome Beta."
|
||||
Write-Host "ERROR: This could be due to insufficient privileges, in which case re-running as Administrator may help."
|
||||
exit 1
|
||||
}
|
||||
42
projects/org-skill-web-research/node_modules/playwright-core/bin/reinstall_chrome_stable_linux.sh
generated
vendored
Executable file
42
projects/org-skill-web-research/node_modules/playwright-core/bin/reinstall_chrome_stable_linux.sh
generated
vendored
Executable file
@@ -0,0 +1,42 @@
|
||||
#!/usr/bin/env bash
|
||||
set -e
|
||||
set -x
|
||||
|
||||
if [[ $(arch) == "aarch64" ]]; then
|
||||
echo "ERROR: not supported on Linux Arm64"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -z "$PLAYWRIGHT_HOST_PLATFORM_OVERRIDE" ]; then
|
||||
if [[ ! -f "/etc/os-release" ]]; then
|
||||
echo "ERROR: cannot install on unknown linux distribution (/etc/os-release is missing)"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
ID=$(bash -c 'source /etc/os-release && echo $ID')
|
||||
if [[ "${ID}" != "ubuntu" && "${ID}" != "debian" ]]; then
|
||||
echo "ERROR: cannot install on $ID distribution - only Ubuntu and Debian are supported"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
# 1. make sure to remove old stable if any.
|
||||
if dpkg --get-selections | grep -q "^google-chrome[[:space:]]*install$" >/dev/null; then
|
||||
apt-get remove -y google-chrome
|
||||
fi
|
||||
|
||||
# 2. Update apt lists (needed to install curl and chrome dependencies)
|
||||
apt-get update
|
||||
|
||||
# 3. Install curl to download chrome
|
||||
if ! command -v curl >/dev/null; then
|
||||
apt-get install -y curl
|
||||
fi
|
||||
|
||||
# 4. download chrome stable from dl.google.com and install it.
|
||||
cd /tmp
|
||||
curl -O https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
|
||||
apt-get install -y ./google-chrome-stable_current_amd64.deb
|
||||
rm -rf ./google-chrome-stable_current_amd64.deb
|
||||
cd -
|
||||
google-chrome --version
|
||||
12
projects/org-skill-web-research/node_modules/playwright-core/bin/reinstall_chrome_stable_mac.sh
generated
vendored
Executable file
12
projects/org-skill-web-research/node_modules/playwright-core/bin/reinstall_chrome_stable_mac.sh
generated
vendored
Executable file
@@ -0,0 +1,12 @@
|
||||
#!/usr/bin/env bash
|
||||
set -e
|
||||
set -x
|
||||
|
||||
rm -rf "/Applications/Google Chrome.app"
|
||||
cd /tmp
|
||||
curl --retry 3 -o ./googlechrome.dmg https://dl.google.com/chrome/mac/universal/stable/GGRO/googlechrome.dmg
|
||||
hdiutil attach -nobrowse -quiet -noautofsck -noautoopen -mountpoint /Volumes/googlechrome.dmg ./googlechrome.dmg
|
||||
cp -pR "/Volumes/googlechrome.dmg/Google Chrome.app" /Applications
|
||||
hdiutil detach /Volumes/googlechrome.dmg
|
||||
rm -rf /tmp/googlechrome.dmg
|
||||
/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --version
|
||||
24
projects/org-skill-web-research/node_modules/playwright-core/bin/reinstall_chrome_stable_win.ps1
generated
vendored
Normal file
24
projects/org-skill-web-research/node_modules/playwright-core/bin/reinstall_chrome_stable_win.ps1
generated
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
$ErrorActionPreference = 'Stop'
|
||||
$url = 'https://dl.google.com/tag/s/dl/chrome/install/googlechromestandaloneenterprise64.msi'
|
||||
|
||||
$wc = New-Object net.webclient
|
||||
$msiInstaller = "$env:temp\google-chrome.msi"
|
||||
Write-Host "Downloading Google Chrome"
|
||||
$wc.Downloadfile($url, $msiInstaller)
|
||||
|
||||
Write-Host "Installing Google Chrome"
|
||||
$arguments = "/i `"$msiInstaller`" /quiet"
|
||||
Start-Process msiexec.exe -ArgumentList $arguments -Wait
|
||||
Remove-Item $msiInstaller
|
||||
|
||||
|
||||
$suffix = "\\Google\\Chrome\\Application\\chrome.exe"
|
||||
if (Test-Path "${env:ProgramFiles(x86)}$suffix") {
|
||||
(Get-Item "${env:ProgramFiles(x86)}$suffix").VersionInfo
|
||||
} elseif (Test-Path "${env:ProgramFiles}$suffix") {
|
||||
(Get-Item "${env:ProgramFiles}$suffix").VersionInfo
|
||||
} else {
|
||||
Write-Host "ERROR: Failed to install Google Chrome."
|
||||
Write-Host "ERROR: This could be due to insufficient privileges, in which case re-running as Administrator may help."
|
||||
exit 1
|
||||
}
|
||||
48
projects/org-skill-web-research/node_modules/playwright-core/bin/reinstall_msedge_beta_linux.sh
generated
vendored
Executable file
48
projects/org-skill-web-research/node_modules/playwright-core/bin/reinstall_msedge_beta_linux.sh
generated
vendored
Executable file
@@ -0,0 +1,48 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
set -x
|
||||
|
||||
if [[ $(arch) == "aarch64" ]]; then
|
||||
echo "ERROR: not supported on Linux Arm64"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -z "$PLAYWRIGHT_HOST_PLATFORM_OVERRIDE" ]; then
|
||||
if [[ ! -f "/etc/os-release" ]]; then
|
||||
echo "ERROR: cannot install on unknown linux distribution (/etc/os-release is missing)"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
ID=$(bash -c 'source /etc/os-release && echo $ID')
|
||||
if [[ "${ID}" != "ubuntu" && "${ID}" != "debian" ]]; then
|
||||
echo "ERROR: cannot install on $ID distribution - only Ubuntu and Debian are supported"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
# 1. make sure to remove old beta if any.
|
||||
if dpkg --get-selections | grep -q "^microsoft-edge-beta[[:space:]]*install$" >/dev/null; then
|
||||
apt-get remove -y microsoft-edge-beta
|
||||
fi
|
||||
|
||||
# 2. Install curl to download Microsoft gpg key
|
||||
if ! command -v curl >/dev/null; then
|
||||
apt-get update
|
||||
apt-get install -y curl
|
||||
fi
|
||||
|
||||
# GnuPG is not preinstalled in slim images
|
||||
if ! command -v gpg >/dev/null; then
|
||||
apt-get update
|
||||
apt-get install -y gpg
|
||||
fi
|
||||
|
||||
# 3. Add the GPG key, the apt repo, update the apt cache, and install the package
|
||||
curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > /tmp/microsoft.gpg
|
||||
install -o root -g root -m 644 /tmp/microsoft.gpg /etc/apt/trusted.gpg.d/
|
||||
sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/repos/edge stable main" > /etc/apt/sources.list.d/microsoft-edge-dev.list'
|
||||
rm /tmp/microsoft.gpg
|
||||
apt-get update && apt-get install -y microsoft-edge-beta
|
||||
|
||||
microsoft-edge-beta --version
|
||||
11
projects/org-skill-web-research/node_modules/playwright-core/bin/reinstall_msedge_beta_mac.sh
generated
vendored
Executable file
11
projects/org-skill-web-research/node_modules/playwright-core/bin/reinstall_msedge_beta_mac.sh
generated
vendored
Executable file
@@ -0,0 +1,11 @@
|
||||
#!/usr/bin/env bash
|
||||
set -e
|
||||
set -x
|
||||
|
||||
cd /tmp
|
||||
curl --retry 3 -o ./msedge_beta.pkg "$1"
|
||||
# Note: there's no way to uninstall previously installed MSEdge.
|
||||
# However, running PKG again seems to update installation.
|
||||
sudo installer -pkg /tmp/msedge_beta.pkg -target /
|
||||
rm -rf /tmp/msedge_beta.pkg
|
||||
/Applications/Microsoft\ Edge\ Beta.app/Contents/MacOS/Microsoft\ Edge\ Beta --version
|
||||
23
projects/org-skill-web-research/node_modules/playwright-core/bin/reinstall_msedge_beta_win.ps1
generated
vendored
Normal file
23
projects/org-skill-web-research/node_modules/playwright-core/bin/reinstall_msedge_beta_win.ps1
generated
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
$ErrorActionPreference = 'Stop'
|
||||
$url = $args[0]
|
||||
|
||||
Write-Host "Downloading Microsoft Edge Beta"
|
||||
$wc = New-Object net.webclient
|
||||
$msiInstaller = "$env:temp\microsoft-edge-beta.msi"
|
||||
$wc.Downloadfile($url, $msiInstaller)
|
||||
|
||||
Write-Host "Installing Microsoft Edge Beta"
|
||||
$arguments = "/i `"$msiInstaller`" /quiet"
|
||||
Start-Process msiexec.exe -ArgumentList $arguments -Wait
|
||||
Remove-Item $msiInstaller
|
||||
|
||||
$suffix = "\\Microsoft\\Edge Beta\\Application\\msedge.exe"
|
||||
if (Test-Path "${env:ProgramFiles(x86)}$suffix") {
|
||||
(Get-Item "${env:ProgramFiles(x86)}$suffix").VersionInfo
|
||||
} elseif (Test-Path "${env:ProgramFiles}$suffix") {
|
||||
(Get-Item "${env:ProgramFiles}$suffix").VersionInfo
|
||||
} else {
|
||||
Write-Host "ERROR: Failed to install Microsoft Edge Beta."
|
||||
Write-Host "ERROR: This could be due to insufficient privileges, in which case re-running as Administrator may help."
|
||||
exit 1
|
||||
}
|
||||
48
projects/org-skill-web-research/node_modules/playwright-core/bin/reinstall_msedge_dev_linux.sh
generated
vendored
Executable file
48
projects/org-skill-web-research/node_modules/playwright-core/bin/reinstall_msedge_dev_linux.sh
generated
vendored
Executable file
@@ -0,0 +1,48 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
set -x
|
||||
|
||||
if [[ $(arch) == "aarch64" ]]; then
|
||||
echo "ERROR: not supported on Linux Arm64"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -z "$PLAYWRIGHT_HOST_PLATFORM_OVERRIDE" ]; then
|
||||
if [[ ! -f "/etc/os-release" ]]; then
|
||||
echo "ERROR: cannot install on unknown linux distribution (/etc/os-release is missing)"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
ID=$(bash -c 'source /etc/os-release && echo $ID')
|
||||
if [[ "${ID}" != "ubuntu" && "${ID}" != "debian" ]]; then
|
||||
echo "ERROR: cannot install on $ID distribution - only Ubuntu and Debian are supported"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
# 1. make sure to remove old dev if any.
|
||||
if dpkg --get-selections | grep -q "^microsoft-edge-dev[[:space:]]*install$" >/dev/null; then
|
||||
apt-get remove -y microsoft-edge-dev
|
||||
fi
|
||||
|
||||
# 2. Install curl to download Microsoft gpg key
|
||||
if ! command -v curl >/dev/null; then
|
||||
apt-get update
|
||||
apt-get install -y curl
|
||||
fi
|
||||
|
||||
# GnuPG is not preinstalled in slim images
|
||||
if ! command -v gpg >/dev/null; then
|
||||
apt-get update
|
||||
apt-get install -y gpg
|
||||
fi
|
||||
|
||||
# 3. Add the GPG key, the apt repo, update the apt cache, and install the package
|
||||
curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > /tmp/microsoft.gpg
|
||||
install -o root -g root -m 644 /tmp/microsoft.gpg /etc/apt/trusted.gpg.d/
|
||||
sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/repos/edge stable main" > /etc/apt/sources.list.d/microsoft-edge-dev.list'
|
||||
rm /tmp/microsoft.gpg
|
||||
apt-get update && apt-get install -y microsoft-edge-dev
|
||||
|
||||
microsoft-edge-dev --version
|
||||
11
projects/org-skill-web-research/node_modules/playwright-core/bin/reinstall_msedge_dev_mac.sh
generated
vendored
Executable file
11
projects/org-skill-web-research/node_modules/playwright-core/bin/reinstall_msedge_dev_mac.sh
generated
vendored
Executable file
@@ -0,0 +1,11 @@
|
||||
#!/usr/bin/env bash
|
||||
set -e
|
||||
set -x
|
||||
|
||||
cd /tmp
|
||||
curl --retry 3 -o ./msedge_dev.pkg "$1"
|
||||
# Note: there's no way to uninstall previously installed MSEdge.
|
||||
# However, running PKG again seems to update installation.
|
||||
sudo installer -pkg /tmp/msedge_dev.pkg -target /
|
||||
rm -rf /tmp/msedge_dev.pkg
|
||||
/Applications/Microsoft\ Edge\ Dev.app/Contents/MacOS/Microsoft\ Edge\ Dev --version
|
||||
23
projects/org-skill-web-research/node_modules/playwright-core/bin/reinstall_msedge_dev_win.ps1
generated
vendored
Normal file
23
projects/org-skill-web-research/node_modules/playwright-core/bin/reinstall_msedge_dev_win.ps1
generated
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
$ErrorActionPreference = 'Stop'
|
||||
$url = $args[0]
|
||||
|
||||
Write-Host "Downloading Microsoft Edge Dev"
|
||||
$wc = New-Object net.webclient
|
||||
$msiInstaller = "$env:temp\microsoft-edge-dev.msi"
|
||||
$wc.Downloadfile($url, $msiInstaller)
|
||||
|
||||
Write-Host "Installing Microsoft Edge Dev"
|
||||
$arguments = "/i `"$msiInstaller`" /quiet"
|
||||
Start-Process msiexec.exe -ArgumentList $arguments -Wait
|
||||
Remove-Item $msiInstaller
|
||||
|
||||
$suffix = "\\Microsoft\\Edge Dev\\Application\\msedge.exe"
|
||||
if (Test-Path "${env:ProgramFiles(x86)}$suffix") {
|
||||
(Get-Item "${env:ProgramFiles(x86)}$suffix").VersionInfo
|
||||
} elseif (Test-Path "${env:ProgramFiles}$suffix") {
|
||||
(Get-Item "${env:ProgramFiles}$suffix").VersionInfo
|
||||
} else {
|
||||
Write-Host "ERROR: Failed to install Microsoft Edge Dev."
|
||||
Write-Host "ERROR: This could be due to insufficient privileges, in which case re-running as Administrator may help."
|
||||
exit 1
|
||||
}
|
||||
48
projects/org-skill-web-research/node_modules/playwright-core/bin/reinstall_msedge_stable_linux.sh
generated
vendored
Executable file
48
projects/org-skill-web-research/node_modules/playwright-core/bin/reinstall_msedge_stable_linux.sh
generated
vendored
Executable file
@@ -0,0 +1,48 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
set -x
|
||||
|
||||
if [[ $(arch) == "aarch64" ]]; then
|
||||
echo "ERROR: not supported on Linux Arm64"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -z "$PLAYWRIGHT_HOST_PLATFORM_OVERRIDE" ]; then
|
||||
if [[ ! -f "/etc/os-release" ]]; then
|
||||
echo "ERROR: cannot install on unknown linux distribution (/etc/os-release is missing)"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
ID=$(bash -c 'source /etc/os-release && echo $ID')
|
||||
if [[ "${ID}" != "ubuntu" && "${ID}" != "debian" ]]; then
|
||||
echo "ERROR: cannot install on $ID distribution - only Ubuntu and Debian are supported"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
# 1. make sure to remove old stable if any.
|
||||
if dpkg --get-selections | grep -q "^microsoft-edge-stable[[:space:]]*install$" >/dev/null; then
|
||||
apt-get remove -y microsoft-edge-stable
|
||||
fi
|
||||
|
||||
# 2. Install curl to download Microsoft gpg key
|
||||
if ! command -v curl >/dev/null; then
|
||||
apt-get update
|
||||
apt-get install -y curl
|
||||
fi
|
||||
|
||||
# GnuPG is not preinstalled in slim images
|
||||
if ! command -v gpg >/dev/null; then
|
||||
apt-get update
|
||||
apt-get install -y gpg
|
||||
fi
|
||||
|
||||
# 3. Add the GPG key, the apt repo, update the apt cache, and install the package
|
||||
curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > /tmp/microsoft.gpg
|
||||
install -o root -g root -m 644 /tmp/microsoft.gpg /etc/apt/trusted.gpg.d/
|
||||
sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/repos/edge stable main" > /etc/apt/sources.list.d/microsoft-edge-stable.list'
|
||||
rm /tmp/microsoft.gpg
|
||||
apt-get update && apt-get install -y microsoft-edge-stable
|
||||
|
||||
microsoft-edge-stable --version
|
||||
11
projects/org-skill-web-research/node_modules/playwright-core/bin/reinstall_msedge_stable_mac.sh
generated
vendored
Executable file
11
projects/org-skill-web-research/node_modules/playwright-core/bin/reinstall_msedge_stable_mac.sh
generated
vendored
Executable file
@@ -0,0 +1,11 @@
|
||||
#!/usr/bin/env bash
|
||||
set -e
|
||||
set -x
|
||||
|
||||
cd /tmp
|
||||
curl --retry 3 -o ./msedge_stable.pkg "$1"
|
||||
# Note: there's no way to uninstall previously installed MSEdge.
|
||||
# However, running PKG again seems to update installation.
|
||||
sudo installer -pkg /tmp/msedge_stable.pkg -target /
|
||||
rm -rf /tmp/msedge_stable.pkg
|
||||
/Applications/Microsoft\ Edge.app/Contents/MacOS/Microsoft\ Edge --version
|
||||
24
projects/org-skill-web-research/node_modules/playwright-core/bin/reinstall_msedge_stable_win.ps1
generated
vendored
Normal file
24
projects/org-skill-web-research/node_modules/playwright-core/bin/reinstall_msedge_stable_win.ps1
generated
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
$ErrorActionPreference = 'Stop'
|
||||
|
||||
$url = $args[0]
|
||||
|
||||
Write-Host "Downloading Microsoft Edge"
|
||||
$wc = New-Object net.webclient
|
||||
$msiInstaller = "$env:temp\microsoft-edge-stable.msi"
|
||||
$wc.Downloadfile($url, $msiInstaller)
|
||||
|
||||
Write-Host "Installing Microsoft Edge"
|
||||
$arguments = "/i `"$msiInstaller`" /quiet"
|
||||
Start-Process msiexec.exe -ArgumentList $arguments -Wait
|
||||
Remove-Item $msiInstaller
|
||||
|
||||
$suffix = "\\Microsoft\\Edge\\Application\\msedge.exe"
|
||||
if (Test-Path "${env:ProgramFiles(x86)}$suffix") {
|
||||
(Get-Item "${env:ProgramFiles(x86)}$suffix").VersionInfo
|
||||
} elseif (Test-Path "${env:ProgramFiles}$suffix") {
|
||||
(Get-Item "${env:ProgramFiles}$suffix").VersionInfo
|
||||
} else {
|
||||
Write-Host "ERROR: Failed to install Microsoft Edge."
|
||||
Write-Host "ERROR: This could be due to insufficient privileges, in which case re-running as Administrator may help."
|
||||
exit 1
|
||||
}
|
||||
79
projects/org-skill-web-research/node_modules/playwright-core/browsers.json
generated
vendored
Normal file
79
projects/org-skill-web-research/node_modules/playwright-core/browsers.json
generated
vendored
Normal file
@@ -0,0 +1,79 @@
|
||||
{
|
||||
"comment": "Do not edit this file, use utils/roll_browser.js",
|
||||
"browsers": [
|
||||
{
|
||||
"name": "chromium",
|
||||
"revision": "1208",
|
||||
"installByDefault": true,
|
||||
"browserVersion": "145.0.7632.6",
|
||||
"title": "Chrome for Testing"
|
||||
},
|
||||
{
|
||||
"name": "chromium-headless-shell",
|
||||
"revision": "1208",
|
||||
"installByDefault": true,
|
||||
"browserVersion": "145.0.7632.6",
|
||||
"title": "Chrome Headless Shell"
|
||||
},
|
||||
{
|
||||
"name": "chromium-tip-of-tree",
|
||||
"revision": "1401",
|
||||
"installByDefault": false,
|
||||
"browserVersion": "146.0.7644.0",
|
||||
"title": "Chrome Canary for Testing"
|
||||
},
|
||||
{
|
||||
"name": "chromium-tip-of-tree-headless-shell",
|
||||
"revision": "1401",
|
||||
"installByDefault": false,
|
||||
"browserVersion": "146.0.7644.0",
|
||||
"title": "Chrome Canary Headless Shell"
|
||||
},
|
||||
{
|
||||
"name": "firefox",
|
||||
"revision": "1509",
|
||||
"installByDefault": true,
|
||||
"browserVersion": "146.0.1",
|
||||
"title": "Firefox"
|
||||
},
|
||||
{
|
||||
"name": "firefox-beta",
|
||||
"revision": "1504",
|
||||
"installByDefault": false,
|
||||
"browserVersion": "146.0b8",
|
||||
"title": "Firefox Beta"
|
||||
},
|
||||
{
|
||||
"name": "webkit",
|
||||
"revision": "2248",
|
||||
"installByDefault": true,
|
||||
"revisionOverrides": {
|
||||
"debian11-x64": "2105",
|
||||
"debian11-arm64": "2105",
|
||||
"ubuntu20.04-x64": "2092",
|
||||
"ubuntu20.04-arm64": "2092"
|
||||
},
|
||||
"browserVersion": "26.0",
|
||||
"title": "WebKit"
|
||||
},
|
||||
{
|
||||
"name": "ffmpeg",
|
||||
"revision": "1011",
|
||||
"installByDefault": true,
|
||||
"revisionOverrides": {
|
||||
"mac12": "1010",
|
||||
"mac12-arm64": "1010"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "winldd",
|
||||
"revision": "1007",
|
||||
"installByDefault": false
|
||||
},
|
||||
{
|
||||
"name": "android",
|
||||
"revision": "1001",
|
||||
"installByDefault": false
|
||||
}
|
||||
]
|
||||
}
|
||||
18
projects/org-skill-web-research/node_modules/playwright-core/cli.js
generated
vendored
Executable file
18
projects/org-skill-web-research/node_modules/playwright-core/cli.js
generated
vendored
Executable file
@@ -0,0 +1,18 @@
|
||||
#!/usr/bin/env node
|
||||
/**
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
const { program } = require('./lib/cli/programWithTestStub');
|
||||
program.parse(process.argv);
|
||||
17
projects/org-skill-web-research/node_modules/playwright-core/index.d.ts
generated
vendored
Normal file
17
projects/org-skill-web-research/node_modules/playwright-core/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
/**
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
export * from './types/types';
|
||||
32
projects/org-skill-web-research/node_modules/playwright-core/index.js
generated
vendored
Normal file
32
projects/org-skill-web-research/node_modules/playwright-core/index.js
generated
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
/**
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
const minimumMajorNodeVersion = 18;
|
||||
const currentNodeVersion = process.versions.node;
|
||||
const semver = currentNodeVersion.split('.');
|
||||
const [major] = [+semver[0]];
|
||||
|
||||
if (major < minimumMajorNodeVersion) {
|
||||
console.error(
|
||||
'You are running Node.js ' +
|
||||
currentNodeVersion +
|
||||
'.\n' +
|
||||
`Playwright requires Node.js ${minimumMajorNodeVersion} or higher. \n` +
|
||||
'Please update your version of Node.js.'
|
||||
);
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
module.exports = require('./lib/inprocess');
|
||||
28
projects/org-skill-web-research/node_modules/playwright-core/index.mjs
generated
vendored
Normal file
28
projects/org-skill-web-research/node_modules/playwright-core/index.mjs
generated
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
/**
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import playwright from './index.js';
|
||||
|
||||
export const chromium = playwright.chromium;
|
||||
export const firefox = playwright.firefox;
|
||||
export const webkit = playwright.webkit;
|
||||
export const selectors = playwright.selectors;
|
||||
export const devices = playwright.devices;
|
||||
export const errors = playwright.errors;
|
||||
export const request = playwright.request;
|
||||
export const _electron = playwright._electron;
|
||||
export const _android = playwright._android;
|
||||
export default playwright;
|
||||
65
projects/org-skill-web-research/node_modules/playwright-core/lib/androidServerImpl.js
generated
vendored
Normal file
65
projects/org-skill-web-research/node_modules/playwright-core/lib/androidServerImpl.js
generated
vendored
Normal file
@@ -0,0 +1,65 @@
|
||||
"use strict";
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var androidServerImpl_exports = {};
|
||||
__export(androidServerImpl_exports, {
|
||||
AndroidServerLauncherImpl: () => AndroidServerLauncherImpl
|
||||
});
|
||||
module.exports = __toCommonJS(androidServerImpl_exports);
|
||||
var import_playwrightServer = require("./remote/playwrightServer");
|
||||
var import_playwright = require("./server/playwright");
|
||||
var import_crypto = require("./server/utils/crypto");
|
||||
var import_utilsBundle = require("./utilsBundle");
|
||||
var import_progress = require("./server/progress");
|
||||
class AndroidServerLauncherImpl {
|
||||
async launchServer(options = {}) {
|
||||
const playwright = (0, import_playwright.createPlaywright)({ sdkLanguage: "javascript", isServer: true });
|
||||
const controller = new import_progress.ProgressController();
|
||||
let devices = await controller.run((progress) => playwright.android.devices(progress, {
|
||||
host: options.adbHost,
|
||||
port: options.adbPort,
|
||||
omitDriverInstall: options.omitDriverInstall
|
||||
}));
|
||||
if (devices.length === 0)
|
||||
throw new Error("No devices found");
|
||||
if (options.deviceSerialNumber) {
|
||||
devices = devices.filter((d) => d.serial === options.deviceSerialNumber);
|
||||
if (devices.length === 0)
|
||||
throw new Error(`No device with serial number '${options.deviceSerialNumber}' was found`);
|
||||
}
|
||||
if (devices.length > 1)
|
||||
throw new Error(`More than one device found. Please specify deviceSerialNumber`);
|
||||
const device = devices[0];
|
||||
const path = options.wsPath ? options.wsPath.startsWith("/") ? options.wsPath : `/${options.wsPath}` : `/${(0, import_crypto.createGuid)()}`;
|
||||
const server = new import_playwrightServer.PlaywrightServer({ mode: "launchServer", path, maxConnections: 1, preLaunchedAndroidDevice: device });
|
||||
const wsEndpoint = await server.listen(options.port, options.host);
|
||||
const browserServer = new import_utilsBundle.ws.EventEmitter();
|
||||
browserServer.wsEndpoint = () => wsEndpoint;
|
||||
browserServer.close = () => device.close();
|
||||
browserServer.kill = () => device.close();
|
||||
device.on("close", () => {
|
||||
server.close();
|
||||
browserServer.emit("close");
|
||||
});
|
||||
return browserServer;
|
||||
}
|
||||
}
|
||||
// Annotate the CommonJS export names for ESM import in node:
|
||||
0 && (module.exports = {
|
||||
AndroidServerLauncherImpl
|
||||
});
|
||||
120
projects/org-skill-web-research/node_modules/playwright-core/lib/browserServerImpl.js
generated
vendored
Normal file
120
projects/org-skill-web-research/node_modules/playwright-core/lib/browserServerImpl.js
generated
vendored
Normal file
@@ -0,0 +1,120 @@
|
||||
"use strict";
|
||||
var __create = Object.create;
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __getProtoOf = Object.getPrototypeOf;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
||||
// If the importer is in node compatibility mode or this is not an ESM
|
||||
// file that has been converted to a CommonJS file using a Babel-
|
||||
// compatible transform (i.e. "__esModule" has not been set), then set
|
||||
// "default" to the CommonJS "module.exports" for node compatibility.
|
||||
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
||||
mod
|
||||
));
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var browserServerImpl_exports = {};
|
||||
__export(browserServerImpl_exports, {
|
||||
BrowserServerLauncherImpl: () => BrowserServerLauncherImpl
|
||||
});
|
||||
module.exports = __toCommonJS(browserServerImpl_exports);
|
||||
var import_playwrightServer = require("./remote/playwrightServer");
|
||||
var import_helper = require("./server/helper");
|
||||
var import_playwright = require("./server/playwright");
|
||||
var import_crypto = require("./server/utils/crypto");
|
||||
var import_debug = require("./server/utils/debug");
|
||||
var import_stackTrace = require("./utils/isomorphic/stackTrace");
|
||||
var import_time = require("./utils/isomorphic/time");
|
||||
var import_utilsBundle = require("./utilsBundle");
|
||||
var validatorPrimitives = __toESM(require("./protocol/validatorPrimitives"));
|
||||
var import_progress = require("./server/progress");
|
||||
class BrowserServerLauncherImpl {
|
||||
constructor(browserName) {
|
||||
this._browserName = browserName;
|
||||
}
|
||||
async launchServer(options = {}) {
|
||||
const playwright = (0, import_playwright.createPlaywright)({ sdkLanguage: "javascript", isServer: true });
|
||||
const metadata = { id: "", startTime: 0, endTime: 0, type: "Internal", method: "", params: {}, log: [], internal: true };
|
||||
const validatorContext = {
|
||||
tChannelImpl: (names, arg, path2) => {
|
||||
throw new validatorPrimitives.ValidationError(`${path2}: channels are not expected in launchServer`);
|
||||
},
|
||||
binary: "buffer",
|
||||
isUnderTest: import_debug.isUnderTest
|
||||
};
|
||||
let launchOptions = {
|
||||
...options,
|
||||
ignoreDefaultArgs: Array.isArray(options.ignoreDefaultArgs) ? options.ignoreDefaultArgs : void 0,
|
||||
ignoreAllDefaultArgs: !!options.ignoreDefaultArgs && !Array.isArray(options.ignoreDefaultArgs),
|
||||
env: options.env ? envObjectToArray(options.env) : void 0,
|
||||
timeout: options.timeout ?? import_time.DEFAULT_PLAYWRIGHT_LAUNCH_TIMEOUT
|
||||
};
|
||||
let browser;
|
||||
try {
|
||||
const controller = new import_progress.ProgressController(metadata);
|
||||
browser = await controller.run(async (progress) => {
|
||||
if (options._userDataDir !== void 0) {
|
||||
const validator = validatorPrimitives.scheme["BrowserTypeLaunchPersistentContextParams"];
|
||||
launchOptions = validator({ ...launchOptions, userDataDir: options._userDataDir }, "", validatorContext);
|
||||
const context = await playwright[this._browserName].launchPersistentContext(progress, options._userDataDir, launchOptions);
|
||||
return context._browser;
|
||||
} else {
|
||||
const validator = validatorPrimitives.scheme["BrowserTypeLaunchParams"];
|
||||
launchOptions = validator(launchOptions, "", validatorContext);
|
||||
return await playwright[this._browserName].launch(progress, launchOptions, toProtocolLogger(options.logger));
|
||||
}
|
||||
});
|
||||
} catch (e) {
|
||||
const log = import_helper.helper.formatBrowserLogs(metadata.log);
|
||||
(0, import_stackTrace.rewriteErrorMessage)(e, `${e.message} Failed to launch browser.${log}`);
|
||||
throw e;
|
||||
}
|
||||
const path = options.wsPath ? options.wsPath.startsWith("/") ? options.wsPath : `/${options.wsPath}` : `/${(0, import_crypto.createGuid)()}`;
|
||||
const server = new import_playwrightServer.PlaywrightServer({ mode: options._sharedBrowser ? "launchServerShared" : "launchServer", path, maxConnections: Infinity, preLaunchedBrowser: browser });
|
||||
const wsEndpoint = await server.listen(options.port, options.host);
|
||||
const browserServer = new import_utilsBundle.ws.EventEmitter();
|
||||
browserServer.process = () => browser.options.browserProcess.process;
|
||||
browserServer.wsEndpoint = () => wsEndpoint;
|
||||
browserServer.close = () => browser.options.browserProcess.close();
|
||||
browserServer[Symbol.asyncDispose] = browserServer.close;
|
||||
browserServer.kill = () => browser.options.browserProcess.kill();
|
||||
browserServer._disconnectForTest = () => server.close();
|
||||
browserServer._userDataDirForTest = browser._userDataDirForTest;
|
||||
browser.options.browserProcess.onclose = (exitCode, signal) => {
|
||||
server.close();
|
||||
browserServer.emit("close", exitCode, signal);
|
||||
};
|
||||
return browserServer;
|
||||
}
|
||||
}
|
||||
function toProtocolLogger(logger) {
|
||||
return logger ? (direction, message) => {
|
||||
if (logger.isEnabled("protocol", "verbose"))
|
||||
logger.log("protocol", "verbose", (direction === "send" ? "SEND \u25BA " : "\u25C0 RECV ") + JSON.stringify(message), [], {});
|
||||
} : void 0;
|
||||
}
|
||||
function envObjectToArray(env) {
|
||||
const result = [];
|
||||
for (const name in env) {
|
||||
if (!Object.is(env[name], void 0))
|
||||
result.push({ name, value: String(env[name]) });
|
||||
}
|
||||
return result;
|
||||
}
|
||||
// Annotate the CommonJS export names for ESM import in node:
|
||||
0 && (module.exports = {
|
||||
BrowserServerLauncherImpl
|
||||
});
|
||||
97
projects/org-skill-web-research/node_modules/playwright-core/lib/cli/driver.js
generated
vendored
Normal file
97
projects/org-skill-web-research/node_modules/playwright-core/lib/cli/driver.js
generated
vendored
Normal file
@@ -0,0 +1,97 @@
|
||||
"use strict";
|
||||
var __create = Object.create;
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __getProtoOf = Object.getPrototypeOf;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
||||
// If the importer is in node compatibility mode or this is not an ESM
|
||||
// file that has been converted to a CommonJS file using a Babel-
|
||||
// compatible transform (i.e. "__esModule" has not been set), then set
|
||||
// "default" to the CommonJS "module.exports" for node compatibility.
|
||||
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
||||
mod
|
||||
));
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var driver_exports = {};
|
||||
__export(driver_exports, {
|
||||
launchBrowserServer: () => launchBrowserServer,
|
||||
printApiJson: () => printApiJson,
|
||||
runDriver: () => runDriver,
|
||||
runServer: () => runServer
|
||||
});
|
||||
module.exports = __toCommonJS(driver_exports);
|
||||
var import_fs = __toESM(require("fs"));
|
||||
var playwright = __toESM(require("../.."));
|
||||
var import_pipeTransport = require("../server/utils/pipeTransport");
|
||||
var import_playwrightServer = require("../remote/playwrightServer");
|
||||
var import_server = require("../server");
|
||||
var import_processLauncher = require("../server/utils/processLauncher");
|
||||
function printApiJson() {
|
||||
console.log(JSON.stringify(require("../../api.json")));
|
||||
}
|
||||
function runDriver() {
|
||||
const dispatcherConnection = new import_server.DispatcherConnection();
|
||||
new import_server.RootDispatcher(dispatcherConnection, async (rootScope, { sdkLanguage }) => {
|
||||
const playwright2 = (0, import_server.createPlaywright)({ sdkLanguage });
|
||||
return new import_server.PlaywrightDispatcher(rootScope, playwright2);
|
||||
});
|
||||
const transport = new import_pipeTransport.PipeTransport(process.stdout, process.stdin);
|
||||
transport.onmessage = (message) => dispatcherConnection.dispatch(JSON.parse(message));
|
||||
const isJavaScriptLanguageBinding = !process.env.PW_LANG_NAME || process.env.PW_LANG_NAME === "javascript";
|
||||
const replacer = !isJavaScriptLanguageBinding && String.prototype.toWellFormed ? (key, value) => {
|
||||
if (typeof value === "string")
|
||||
return value.toWellFormed();
|
||||
return value;
|
||||
} : void 0;
|
||||
dispatcherConnection.onmessage = (message) => transport.send(JSON.stringify(message, replacer));
|
||||
transport.onclose = () => {
|
||||
dispatcherConnection.onmessage = () => {
|
||||
};
|
||||
(0, import_processLauncher.gracefullyProcessExitDoNotHang)(0);
|
||||
};
|
||||
process.on("SIGINT", () => {
|
||||
});
|
||||
}
|
||||
async function runServer(options) {
|
||||
const {
|
||||
port,
|
||||
host,
|
||||
path = "/",
|
||||
maxConnections = Infinity,
|
||||
extension
|
||||
} = options;
|
||||
const server = new import_playwrightServer.PlaywrightServer({ mode: extension ? "extension" : "default", path, maxConnections });
|
||||
const wsEndpoint = await server.listen(port, host);
|
||||
process.on("exit", () => server.close().catch(console.error));
|
||||
console.log("Listening on " + wsEndpoint);
|
||||
process.stdin.on("close", () => (0, import_processLauncher.gracefullyProcessExitDoNotHang)(0));
|
||||
}
|
||||
async function launchBrowserServer(browserName, configFile) {
|
||||
let options = {};
|
||||
if (configFile)
|
||||
options = JSON.parse(import_fs.default.readFileSync(configFile).toString());
|
||||
const browserType = playwright[browserName];
|
||||
const server = await browserType.launchServer(options);
|
||||
console.log(server.wsEndpoint());
|
||||
}
|
||||
// Annotate the CommonJS export names for ESM import in node:
|
||||
0 && (module.exports = {
|
||||
launchBrowserServer,
|
||||
printApiJson,
|
||||
runDriver,
|
||||
runServer
|
||||
});
|
||||
589
projects/org-skill-web-research/node_modules/playwright-core/lib/cli/program.js
generated
vendored
Normal file
589
projects/org-skill-web-research/node_modules/playwright-core/lib/cli/program.js
generated
vendored
Normal file
@@ -0,0 +1,589 @@
|
||||
"use strict";
|
||||
var __create = Object.create;
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __getProtoOf = Object.getPrototypeOf;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
||||
// If the importer is in node compatibility mode or this is not an ESM
|
||||
// file that has been converted to a CommonJS file using a Babel-
|
||||
// compatible transform (i.e. "__esModule" has not been set), then set
|
||||
// "default" to the CommonJS "module.exports" for node compatibility.
|
||||
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
||||
mod
|
||||
));
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var program_exports = {};
|
||||
__export(program_exports, {
|
||||
program: () => import_utilsBundle2.program
|
||||
});
|
||||
module.exports = __toCommonJS(program_exports);
|
||||
var import_fs = __toESM(require("fs"));
|
||||
var import_os = __toESM(require("os"));
|
||||
var import_path = __toESM(require("path"));
|
||||
var playwright = __toESM(require("../.."));
|
||||
var import_driver = require("./driver");
|
||||
var import_server = require("../server");
|
||||
var import_utils = require("../utils");
|
||||
var import_traceViewer = require("../server/trace/viewer/traceViewer");
|
||||
var import_utils2 = require("../utils");
|
||||
var import_ascii = require("../server/utils/ascii");
|
||||
var import_utilsBundle = require("../utilsBundle");
|
||||
var import_utilsBundle2 = require("../utilsBundle");
|
||||
const packageJSON = require("../../package.json");
|
||||
import_utilsBundle.program.version("Version " + (process.env.PW_CLI_DISPLAY_VERSION || packageJSON.version)).name(buildBasePlaywrightCLICommand(process.env.PW_LANG_NAME));
|
||||
import_utilsBundle.program.command("mark-docker-image [dockerImageNameTemplate]", { hidden: true }).description("mark docker image").allowUnknownOption(true).action(function(dockerImageNameTemplate) {
|
||||
(0, import_utils2.assert)(dockerImageNameTemplate, "dockerImageNameTemplate is required");
|
||||
(0, import_server.writeDockerVersion)(dockerImageNameTemplate).catch(logErrorAndExit);
|
||||
});
|
||||
commandWithOpenOptions("open [url]", "open page in browser specified via -b, --browser", []).action(function(url, options) {
|
||||
open(options, url).catch(logErrorAndExit);
|
||||
}).addHelpText("afterAll", `
|
||||
Examples:
|
||||
|
||||
$ open
|
||||
$ open -b webkit https://example.com`);
|
||||
commandWithOpenOptions(
|
||||
"codegen [url]",
|
||||
"open page and generate code for user actions",
|
||||
[
|
||||
["-o, --output <file name>", "saves the generated script to a file"],
|
||||
["--target <language>", `language to generate, one of javascript, playwright-test, python, python-async, python-pytest, csharp, csharp-mstest, csharp-nunit, java, java-junit`, codegenId()],
|
||||
["--test-id-attribute <attributeName>", "use the specified attribute to generate data test ID selectors"]
|
||||
]
|
||||
).action(async function(url, options) {
|
||||
await codegen(options, url);
|
||||
}).addHelpText("afterAll", `
|
||||
Examples:
|
||||
|
||||
$ codegen
|
||||
$ codegen --target=python
|
||||
$ codegen -b webkit https://example.com`);
|
||||
function printInstalledBrowsers(browsers2) {
|
||||
const browserPaths = /* @__PURE__ */ new Set();
|
||||
for (const browser of browsers2)
|
||||
browserPaths.add(browser.browserPath);
|
||||
console.log(` Browsers:`);
|
||||
for (const browserPath of [...browserPaths].sort())
|
||||
console.log(` ${browserPath}`);
|
||||
console.log(` References:`);
|
||||
const references = /* @__PURE__ */ new Set();
|
||||
for (const browser of browsers2)
|
||||
references.add(browser.referenceDir);
|
||||
for (const reference of [...references].sort())
|
||||
console.log(` ${reference}`);
|
||||
}
|
||||
function printGroupedByPlaywrightVersion(browsers2) {
|
||||
const dirToVersion = /* @__PURE__ */ new Map();
|
||||
for (const browser of browsers2) {
|
||||
if (dirToVersion.has(browser.referenceDir))
|
||||
continue;
|
||||
const packageJSON2 = require(import_path.default.join(browser.referenceDir, "package.json"));
|
||||
const version = packageJSON2.version;
|
||||
dirToVersion.set(browser.referenceDir, version);
|
||||
}
|
||||
const groupedByPlaywrightMinorVersion = /* @__PURE__ */ new Map();
|
||||
for (const browser of browsers2) {
|
||||
const version = dirToVersion.get(browser.referenceDir);
|
||||
let entries = groupedByPlaywrightMinorVersion.get(version);
|
||||
if (!entries) {
|
||||
entries = [];
|
||||
groupedByPlaywrightMinorVersion.set(version, entries);
|
||||
}
|
||||
entries.push(browser);
|
||||
}
|
||||
const sortedVersions = [...groupedByPlaywrightMinorVersion.keys()].sort((a, b) => {
|
||||
const aComponents = a.split(".");
|
||||
const bComponents = b.split(".");
|
||||
const aMajor = parseInt(aComponents[0], 10);
|
||||
const bMajor = parseInt(bComponents[0], 10);
|
||||
if (aMajor !== bMajor)
|
||||
return aMajor - bMajor;
|
||||
const aMinor = parseInt(aComponents[1], 10);
|
||||
const bMinor = parseInt(bComponents[1], 10);
|
||||
if (aMinor !== bMinor)
|
||||
return aMinor - bMinor;
|
||||
return aComponents.slice(2).join(".").localeCompare(bComponents.slice(2).join("."));
|
||||
});
|
||||
for (const version of sortedVersions) {
|
||||
console.log(`
|
||||
Playwright version: ${version}`);
|
||||
printInstalledBrowsers(groupedByPlaywrightMinorVersion.get(version));
|
||||
}
|
||||
}
|
||||
import_utilsBundle.program.command("install [browser...]").description("ensure browsers necessary for this version of Playwright are installed").option("--with-deps", "install system dependencies for browsers").option("--dry-run", "do not execute installation, only print information").option("--list", "prints list of browsers from all playwright installations").option("--force", "force reinstall of already installed browsers").option("--only-shell", "only install headless shell when installing chromium").option("--no-shell", "do not install chromium headless shell").action(async function(args, options) {
|
||||
if ((0, import_utils.isLikelyNpxGlobal)()) {
|
||||
console.error((0, import_ascii.wrapInASCIIBox)([
|
||||
`WARNING: It looks like you are running 'npx playwright install' without first`,
|
||||
`installing your project's dependencies.`,
|
||||
``,
|
||||
`To avoid unexpected behavior, please install your dependencies first, and`,
|
||||
`then run Playwright's install command:`,
|
||||
``,
|
||||
` npm install`,
|
||||
` npx playwright install`,
|
||||
``,
|
||||
`If your project does not yet depend on Playwright, first install the`,
|
||||
`applicable npm package (most commonly @playwright/test), and`,
|
||||
`then run Playwright's install command to download the browsers:`,
|
||||
``,
|
||||
` npm install @playwright/test`,
|
||||
` npx playwright install`,
|
||||
``
|
||||
].join("\n"), 1));
|
||||
}
|
||||
try {
|
||||
if (options.shell === false && options.onlyShell)
|
||||
throw new Error(`Only one of --no-shell and --only-shell can be specified`);
|
||||
const shell = options.shell === false ? "no" : options.onlyShell ? "only" : void 0;
|
||||
const executables = import_server.registry.resolveBrowsers(args, { shell });
|
||||
if (options.withDeps)
|
||||
await import_server.registry.installDeps(executables, !!options.dryRun);
|
||||
if (options.dryRun && options.list)
|
||||
throw new Error(`Only one of --dry-run and --list can be specified`);
|
||||
if (options.dryRun) {
|
||||
for (const executable of executables) {
|
||||
console.log(import_server.registry.calculateDownloadTitle(executable));
|
||||
console.log(` Install location: ${executable.directory ?? "<system>"}`);
|
||||
if (executable.downloadURLs?.length) {
|
||||
const [url, ...fallbacks] = executable.downloadURLs;
|
||||
console.log(` Download url: ${url}`);
|
||||
for (let i = 0; i < fallbacks.length; ++i)
|
||||
console.log(` Download fallback ${i + 1}: ${fallbacks[i]}`);
|
||||
}
|
||||
console.log(``);
|
||||
}
|
||||
} else if (options.list) {
|
||||
const browsers2 = await import_server.registry.listInstalledBrowsers();
|
||||
printGroupedByPlaywrightVersion(browsers2);
|
||||
} else {
|
||||
await import_server.registry.install(executables, { force: options.force });
|
||||
await import_server.registry.validateHostRequirementsForExecutablesIfNeeded(executables, process.env.PW_LANG_NAME || "javascript").catch((e) => {
|
||||
e.name = "Playwright Host validation warning";
|
||||
console.error(e);
|
||||
});
|
||||
}
|
||||
} catch (e) {
|
||||
console.log(`Failed to install browsers
|
||||
${e}`);
|
||||
(0, import_utils.gracefullyProcessExitDoNotHang)(1);
|
||||
}
|
||||
}).addHelpText("afterAll", `
|
||||
|
||||
Examples:
|
||||
- $ install
|
||||
Install default browsers.
|
||||
|
||||
- $ install chrome firefox
|
||||
Install custom browsers, supports ${import_server.registry.suggestedBrowsersToInstall()}.`);
|
||||
import_utilsBundle.program.command("uninstall").description("Removes browsers used by this installation of Playwright from the system (chromium, firefox, webkit, ffmpeg). This does not include branded channels.").option("--all", "Removes all browsers used by any Playwright installation from the system.").action(async (options) => {
|
||||
delete process.env.PLAYWRIGHT_SKIP_BROWSER_GC;
|
||||
await import_server.registry.uninstall(!!options.all).then(({ numberOfBrowsersLeft }) => {
|
||||
if (!options.all && numberOfBrowsersLeft > 0) {
|
||||
console.log("Successfully uninstalled Playwright browsers for the current Playwright installation.");
|
||||
console.log(`There are still ${numberOfBrowsersLeft} browsers left, used by other Playwright installations.
|
||||
To uninstall Playwright browsers for all installations, re-run with --all flag.`);
|
||||
}
|
||||
}).catch(logErrorAndExit);
|
||||
});
|
||||
import_utilsBundle.program.command("install-deps [browser...]").description("install dependencies necessary to run browsers (will ask for sudo permissions)").option("--dry-run", "Do not execute installation commands, only print them").action(async function(args, options) {
|
||||
try {
|
||||
await import_server.registry.installDeps(import_server.registry.resolveBrowsers(args, {}), !!options.dryRun);
|
||||
} catch (e) {
|
||||
console.log(`Failed to install browser dependencies
|
||||
${e}`);
|
||||
(0, import_utils.gracefullyProcessExitDoNotHang)(1);
|
||||
}
|
||||
}).addHelpText("afterAll", `
|
||||
Examples:
|
||||
- $ install-deps
|
||||
Install dependencies for default browsers.
|
||||
|
||||
- $ install-deps chrome firefox
|
||||
Install dependencies for specific browsers, supports ${import_server.registry.suggestedBrowsersToInstall()}.`);
|
||||
const browsers = [
|
||||
{ alias: "cr", name: "Chromium", type: "chromium" },
|
||||
{ alias: "ff", name: "Firefox", type: "firefox" },
|
||||
{ alias: "wk", name: "WebKit", type: "webkit" }
|
||||
];
|
||||
for (const { alias, name, type } of browsers) {
|
||||
commandWithOpenOptions(`${alias} [url]`, `open page in ${name}`, []).action(function(url, options) {
|
||||
open({ ...options, browser: type }, url).catch(logErrorAndExit);
|
||||
}).addHelpText("afterAll", `
|
||||
Examples:
|
||||
|
||||
$ ${alias} https://example.com`);
|
||||
}
|
||||
commandWithOpenOptions(
|
||||
"screenshot <url> <filename>",
|
||||
"capture a page screenshot",
|
||||
[
|
||||
["--wait-for-selector <selector>", "wait for selector before taking a screenshot"],
|
||||
["--wait-for-timeout <timeout>", "wait for timeout in milliseconds before taking a screenshot"],
|
||||
["--full-page", "whether to take a full page screenshot (entire scrollable area)"]
|
||||
]
|
||||
).action(function(url, filename, command) {
|
||||
screenshot(command, command, url, filename).catch(logErrorAndExit);
|
||||
}).addHelpText("afterAll", `
|
||||
Examples:
|
||||
|
||||
$ screenshot -b webkit https://example.com example.png`);
|
||||
commandWithOpenOptions(
|
||||
"pdf <url> <filename>",
|
||||
"save page as pdf",
|
||||
[
|
||||
["--paper-format <format>", "paper format: Letter, Legal, Tabloid, Ledger, A0, A1, A2, A3, A4, A5, A6"],
|
||||
["--wait-for-selector <selector>", "wait for given selector before saving as pdf"],
|
||||
["--wait-for-timeout <timeout>", "wait for given timeout in milliseconds before saving as pdf"]
|
||||
]
|
||||
).action(function(url, filename, options) {
|
||||
pdf(options, options, url, filename).catch(logErrorAndExit);
|
||||
}).addHelpText("afterAll", `
|
||||
Examples:
|
||||
|
||||
$ pdf https://example.com example.pdf`);
|
||||
import_utilsBundle.program.command("run-driver", { hidden: true }).action(function(options) {
|
||||
(0, import_driver.runDriver)();
|
||||
});
|
||||
import_utilsBundle.program.command("run-server", { hidden: true }).option("--port <port>", "Server port").option("--host <host>", "Server host").option("--path <path>", "Endpoint Path", "/").option("--max-clients <maxClients>", "Maximum clients").option("--mode <mode>", 'Server mode, either "default" or "extension"').action(function(options) {
|
||||
(0, import_driver.runServer)({
|
||||
port: options.port ? +options.port : void 0,
|
||||
host: options.host,
|
||||
path: options.path,
|
||||
maxConnections: options.maxClients ? +options.maxClients : Infinity,
|
||||
extension: options.mode === "extension" || !!process.env.PW_EXTENSION_MODE
|
||||
}).catch(logErrorAndExit);
|
||||
});
|
||||
import_utilsBundle.program.command("print-api-json", { hidden: true }).action(function(options) {
|
||||
(0, import_driver.printApiJson)();
|
||||
});
|
||||
import_utilsBundle.program.command("launch-server", { hidden: true }).requiredOption("--browser <browserName>", 'Browser name, one of "chromium", "firefox" or "webkit"').option("--config <path-to-config-file>", "JSON file with launchServer options").action(function(options) {
|
||||
(0, import_driver.launchBrowserServer)(options.browser, options.config);
|
||||
});
|
||||
import_utilsBundle.program.command("show-trace [trace]").option("-b, --browser <browserType>", "browser to use, one of cr, chromium, ff, firefox, wk, webkit", "chromium").option("-h, --host <host>", "Host to serve trace on; specifying this option opens trace in a browser tab").option("-p, --port <port>", "Port to serve trace on, 0 for any free port; specifying this option opens trace in a browser tab").option("--stdin", "Accept trace URLs over stdin to update the viewer").description("show trace viewer").action(function(trace, options) {
|
||||
if (options.browser === "cr")
|
||||
options.browser = "chromium";
|
||||
if (options.browser === "ff")
|
||||
options.browser = "firefox";
|
||||
if (options.browser === "wk")
|
||||
options.browser = "webkit";
|
||||
const openOptions = {
|
||||
host: options.host,
|
||||
port: +options.port,
|
||||
isServer: !!options.stdin
|
||||
};
|
||||
if (options.port !== void 0 || options.host !== void 0)
|
||||
(0, import_traceViewer.runTraceInBrowser)(trace, openOptions).catch(logErrorAndExit);
|
||||
else
|
||||
(0, import_traceViewer.runTraceViewerApp)(trace, options.browser, openOptions, true).catch(logErrorAndExit);
|
||||
}).addHelpText("afterAll", `
|
||||
Examples:
|
||||
|
||||
$ show-trace
|
||||
$ show-trace https://example.com/trace.zip`);
|
||||
async function launchContext(options, extraOptions) {
|
||||
validateOptions(options);
|
||||
const browserType = lookupBrowserType(options);
|
||||
const launchOptions = extraOptions;
|
||||
if (options.channel)
|
||||
launchOptions.channel = options.channel;
|
||||
launchOptions.handleSIGINT = false;
|
||||
const contextOptions = (
|
||||
// Copy the device descriptor since we have to compare and modify the options.
|
||||
options.device ? { ...playwright.devices[options.device] } : {}
|
||||
);
|
||||
if (!extraOptions.headless)
|
||||
contextOptions.deviceScaleFactor = import_os.default.platform() === "darwin" ? 2 : 1;
|
||||
if (browserType.name() === "webkit" && process.platform === "linux") {
|
||||
delete contextOptions.hasTouch;
|
||||
delete contextOptions.isMobile;
|
||||
}
|
||||
if (contextOptions.isMobile && browserType.name() === "firefox")
|
||||
contextOptions.isMobile = void 0;
|
||||
if (options.blockServiceWorkers)
|
||||
contextOptions.serviceWorkers = "block";
|
||||
if (options.proxyServer) {
|
||||
launchOptions.proxy = {
|
||||
server: options.proxyServer
|
||||
};
|
||||
if (options.proxyBypass)
|
||||
launchOptions.proxy.bypass = options.proxyBypass;
|
||||
}
|
||||
if (options.viewportSize) {
|
||||
try {
|
||||
const [width, height] = options.viewportSize.split(",").map((n) => +n);
|
||||
if (isNaN(width) || isNaN(height))
|
||||
throw new Error("bad values");
|
||||
contextOptions.viewport = { width, height };
|
||||
} catch (e) {
|
||||
throw new Error('Invalid viewport size format: use "width,height", for example --viewport-size="800,600"');
|
||||
}
|
||||
}
|
||||
if (options.geolocation) {
|
||||
try {
|
||||
const [latitude, longitude] = options.geolocation.split(",").map((n) => parseFloat(n.trim()));
|
||||
contextOptions.geolocation = {
|
||||
latitude,
|
||||
longitude
|
||||
};
|
||||
} catch (e) {
|
||||
throw new Error('Invalid geolocation format, should be "lat,long". For example --geolocation="37.819722,-122.478611"');
|
||||
}
|
||||
contextOptions.permissions = ["geolocation"];
|
||||
}
|
||||
if (options.userAgent)
|
||||
contextOptions.userAgent = options.userAgent;
|
||||
if (options.lang)
|
||||
contextOptions.locale = options.lang;
|
||||
if (options.colorScheme)
|
||||
contextOptions.colorScheme = options.colorScheme;
|
||||
if (options.timezone)
|
||||
contextOptions.timezoneId = options.timezone;
|
||||
if (options.loadStorage)
|
||||
contextOptions.storageState = options.loadStorage;
|
||||
if (options.ignoreHttpsErrors)
|
||||
contextOptions.ignoreHTTPSErrors = true;
|
||||
if (options.saveHar) {
|
||||
contextOptions.recordHar = { path: import_path.default.resolve(process.cwd(), options.saveHar), mode: "minimal" };
|
||||
if (options.saveHarGlob)
|
||||
contextOptions.recordHar.urlFilter = options.saveHarGlob;
|
||||
contextOptions.serviceWorkers = "block";
|
||||
}
|
||||
let browser;
|
||||
let context;
|
||||
if (options.userDataDir) {
|
||||
context = await browserType.launchPersistentContext(options.userDataDir, { ...launchOptions, ...contextOptions });
|
||||
browser = context.browser();
|
||||
} else {
|
||||
browser = await browserType.launch(launchOptions);
|
||||
context = await browser.newContext(contextOptions);
|
||||
}
|
||||
let closingBrowser = false;
|
||||
async function closeBrowser() {
|
||||
if (closingBrowser)
|
||||
return;
|
||||
closingBrowser = true;
|
||||
if (options.saveStorage)
|
||||
await context.storageState({ path: options.saveStorage }).catch((e) => null);
|
||||
if (options.saveHar)
|
||||
await context.close();
|
||||
await browser.close();
|
||||
}
|
||||
context.on("page", (page) => {
|
||||
page.on("dialog", () => {
|
||||
});
|
||||
page.on("close", () => {
|
||||
const hasPage = browser.contexts().some((context2) => context2.pages().length > 0);
|
||||
if (hasPage)
|
||||
return;
|
||||
closeBrowser().catch(() => {
|
||||
});
|
||||
});
|
||||
});
|
||||
process.on("SIGINT", async () => {
|
||||
await closeBrowser();
|
||||
(0, import_utils.gracefullyProcessExitDoNotHang)(130);
|
||||
});
|
||||
const timeout = options.timeout ? parseInt(options.timeout, 10) : 0;
|
||||
context.setDefaultTimeout(timeout);
|
||||
context.setDefaultNavigationTimeout(timeout);
|
||||
delete launchOptions.headless;
|
||||
delete launchOptions.executablePath;
|
||||
delete launchOptions.handleSIGINT;
|
||||
delete contextOptions.deviceScaleFactor;
|
||||
return { browser, browserName: browserType.name(), context, contextOptions, launchOptions, closeBrowser };
|
||||
}
|
||||
async function openPage(context, url) {
|
||||
let page = context.pages()[0];
|
||||
if (!page)
|
||||
page = await context.newPage();
|
||||
if (url) {
|
||||
if (import_fs.default.existsSync(url))
|
||||
url = "file://" + import_path.default.resolve(url);
|
||||
else if (!url.startsWith("http") && !url.startsWith("file://") && !url.startsWith("about:") && !url.startsWith("data:"))
|
||||
url = "http://" + url;
|
||||
await page.goto(url);
|
||||
}
|
||||
return page;
|
||||
}
|
||||
async function open(options, url) {
|
||||
const { context } = await launchContext(options, { headless: !!process.env.PWTEST_CLI_HEADLESS, executablePath: process.env.PWTEST_CLI_EXECUTABLE_PATH });
|
||||
await context._exposeConsoleApi();
|
||||
await openPage(context, url);
|
||||
}
|
||||
async function codegen(options, url) {
|
||||
const { target: language, output: outputFile, testIdAttribute: testIdAttributeName } = options;
|
||||
const tracesDir = import_path.default.join(import_os.default.tmpdir(), `playwright-recorder-trace-${Date.now()}`);
|
||||
const { context, browser, launchOptions, contextOptions, closeBrowser } = await launchContext(options, {
|
||||
headless: !!process.env.PWTEST_CLI_HEADLESS,
|
||||
executablePath: process.env.PWTEST_CLI_EXECUTABLE_PATH,
|
||||
tracesDir
|
||||
});
|
||||
const donePromise = new import_utils.ManualPromise();
|
||||
maybeSetupTestHooks(browser, closeBrowser, donePromise);
|
||||
import_utilsBundle.dotenv.config({ path: "playwright.env" });
|
||||
await context._enableRecorder({
|
||||
language,
|
||||
launchOptions,
|
||||
contextOptions,
|
||||
device: options.device,
|
||||
saveStorage: options.saveStorage,
|
||||
mode: "recording",
|
||||
testIdAttributeName,
|
||||
outputFile: outputFile ? import_path.default.resolve(outputFile) : void 0,
|
||||
handleSIGINT: false
|
||||
});
|
||||
await openPage(context, url);
|
||||
donePromise.resolve();
|
||||
}
|
||||
async function maybeSetupTestHooks(browser, closeBrowser, donePromise) {
|
||||
if (!process.env.PWTEST_CLI_IS_UNDER_TEST)
|
||||
return;
|
||||
const logs = [];
|
||||
require("playwright-core/lib/utilsBundle").debug.log = (...args) => {
|
||||
const line = require("util").format(...args) + "\n";
|
||||
logs.push(line);
|
||||
process.stderr.write(line);
|
||||
};
|
||||
browser.on("disconnected", () => {
|
||||
const hasCrashLine = logs.some((line) => line.includes("process did exit:") && !line.includes("process did exit: exitCode=0, signal=null"));
|
||||
if (hasCrashLine) {
|
||||
process.stderr.write("Detected browser crash.\n");
|
||||
(0, import_utils.gracefullyProcessExitDoNotHang)(1);
|
||||
}
|
||||
});
|
||||
const close = async () => {
|
||||
await donePromise;
|
||||
await closeBrowser();
|
||||
};
|
||||
if (process.env.PWTEST_CLI_EXIT_AFTER_TIMEOUT) {
|
||||
setTimeout(close, +process.env.PWTEST_CLI_EXIT_AFTER_TIMEOUT);
|
||||
return;
|
||||
}
|
||||
let stdin = "";
|
||||
process.stdin.on("data", (data) => {
|
||||
stdin += data.toString();
|
||||
if (stdin.startsWith("exit")) {
|
||||
process.stdin.destroy();
|
||||
close();
|
||||
}
|
||||
});
|
||||
}
|
||||
async function waitForPage(page, captureOptions) {
|
||||
if (captureOptions.waitForSelector) {
|
||||
console.log(`Waiting for selector ${captureOptions.waitForSelector}...`);
|
||||
await page.waitForSelector(captureOptions.waitForSelector);
|
||||
}
|
||||
if (captureOptions.waitForTimeout) {
|
||||
console.log(`Waiting for timeout ${captureOptions.waitForTimeout}...`);
|
||||
await page.waitForTimeout(parseInt(captureOptions.waitForTimeout, 10));
|
||||
}
|
||||
}
|
||||
async function screenshot(options, captureOptions, url, path2) {
|
||||
const { context } = await launchContext(options, { headless: true });
|
||||
console.log("Navigating to " + url);
|
||||
const page = await openPage(context, url);
|
||||
await waitForPage(page, captureOptions);
|
||||
console.log("Capturing screenshot into " + path2);
|
||||
await page.screenshot({ path: path2, fullPage: !!captureOptions.fullPage });
|
||||
await page.close();
|
||||
}
|
||||
async function pdf(options, captureOptions, url, path2) {
|
||||
if (options.browser !== "chromium")
|
||||
throw new Error("PDF creation is only working with Chromium");
|
||||
const { context } = await launchContext({ ...options, browser: "chromium" }, { headless: true });
|
||||
console.log("Navigating to " + url);
|
||||
const page = await openPage(context, url);
|
||||
await waitForPage(page, captureOptions);
|
||||
console.log("Saving as pdf into " + path2);
|
||||
await page.pdf({ path: path2, format: captureOptions.paperFormat });
|
||||
await page.close();
|
||||
}
|
||||
function lookupBrowserType(options) {
|
||||
let name = options.browser;
|
||||
if (options.device) {
|
||||
const device = playwright.devices[options.device];
|
||||
name = device.defaultBrowserType;
|
||||
}
|
||||
let browserType;
|
||||
switch (name) {
|
||||
case "chromium":
|
||||
browserType = playwright.chromium;
|
||||
break;
|
||||
case "webkit":
|
||||
browserType = playwright.webkit;
|
||||
break;
|
||||
case "firefox":
|
||||
browserType = playwright.firefox;
|
||||
break;
|
||||
case "cr":
|
||||
browserType = playwright.chromium;
|
||||
break;
|
||||
case "wk":
|
||||
browserType = playwright.webkit;
|
||||
break;
|
||||
case "ff":
|
||||
browserType = playwright.firefox;
|
||||
break;
|
||||
}
|
||||
if (browserType)
|
||||
return browserType;
|
||||
import_utilsBundle.program.help();
|
||||
}
|
||||
function validateOptions(options) {
|
||||
if (options.device && !(options.device in playwright.devices)) {
|
||||
const lines = [`Device descriptor not found: '${options.device}', available devices are:`];
|
||||
for (const name in playwright.devices)
|
||||
lines.push(` "${name}"`);
|
||||
throw new Error(lines.join("\n"));
|
||||
}
|
||||
if (options.colorScheme && !["light", "dark"].includes(options.colorScheme))
|
||||
throw new Error('Invalid color scheme, should be one of "light", "dark"');
|
||||
}
|
||||
function logErrorAndExit(e) {
|
||||
if (process.env.PWDEBUGIMPL)
|
||||
console.error(e);
|
||||
else
|
||||
console.error(e.name + ": " + e.message);
|
||||
(0, import_utils.gracefullyProcessExitDoNotHang)(1);
|
||||
}
|
||||
function codegenId() {
|
||||
return process.env.PW_LANG_NAME || "playwright-test";
|
||||
}
|
||||
function commandWithOpenOptions(command, description, options) {
|
||||
let result = import_utilsBundle.program.command(command).description(description);
|
||||
for (const option of options)
|
||||
result = result.option(option[0], ...option.slice(1));
|
||||
return result.option("-b, --browser <browserType>", "browser to use, one of cr, chromium, ff, firefox, wk, webkit", "chromium").option("--block-service-workers", "block service workers").option("--channel <channel>", 'Chromium distribution channel, "chrome", "chrome-beta", "msedge-dev", etc').option("--color-scheme <scheme>", 'emulate preferred color scheme, "light" or "dark"').option("--device <deviceName>", 'emulate device, for example "iPhone 11"').option("--geolocation <coordinates>", 'specify geolocation coordinates, for example "37.819722,-122.478611"').option("--ignore-https-errors", "ignore https errors").option("--load-storage <filename>", "load context storage state from the file, previously saved with --save-storage").option("--lang <language>", 'specify language / locale, for example "en-GB"').option("--proxy-server <proxy>", 'specify proxy server, for example "http://myproxy:3128" or "socks5://myproxy:8080"').option("--proxy-bypass <bypass>", 'comma-separated domains to bypass proxy, for example ".com,chromium.org,.domain.com"').option("--save-har <filename>", "save HAR file with all network activity at the end").option("--save-har-glob <glob pattern>", "filter entries in the HAR by matching url against this glob pattern").option("--save-storage <filename>", "save context storage state at the end, for later use with --load-storage").option("--timezone <time zone>", 'time zone to emulate, for example "Europe/Rome"').option("--timeout <timeout>", "timeout for Playwright actions in milliseconds, no timeout by default").option("--user-agent <ua string>", "specify user agent string").option("--user-data-dir <directory>", "use the specified user data directory instead of a new context").option("--viewport-size <size>", 'specify browser viewport size in pixels, for example "1280, 720"');
|
||||
}
|
||||
function buildBasePlaywrightCLICommand(cliTargetLang) {
|
||||
switch (cliTargetLang) {
|
||||
case "python":
|
||||
return `playwright`;
|
||||
case "java":
|
||||
return `mvn exec:java -e -D exec.mainClass=com.microsoft.playwright.CLI -D exec.args="...options.."`;
|
||||
case "csharp":
|
||||
return `pwsh bin/Debug/netX/playwright.ps1`;
|
||||
default: {
|
||||
const packageManagerCommand = (0, import_utils2.getPackageManagerExecCommand)();
|
||||
return `${packageManagerCommand} playwright`;
|
||||
}
|
||||
}
|
||||
}
|
||||
// Annotate the CommonJS export names for ESM import in node:
|
||||
0 && (module.exports = {
|
||||
program
|
||||
});
|
||||
74
projects/org-skill-web-research/node_modules/playwright-core/lib/cli/programWithTestStub.js
generated
vendored
Normal file
74
projects/org-skill-web-research/node_modules/playwright-core/lib/cli/programWithTestStub.js
generated
vendored
Normal file
@@ -0,0 +1,74 @@
|
||||
"use strict";
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var programWithTestStub_exports = {};
|
||||
__export(programWithTestStub_exports, {
|
||||
program: () => import_program2.program
|
||||
});
|
||||
module.exports = __toCommonJS(programWithTestStub_exports);
|
||||
var import_processLauncher = require("../server/utils/processLauncher");
|
||||
var import_utils = require("../utils");
|
||||
var import_program = require("./program");
|
||||
var import_program2 = require("./program");
|
||||
function printPlaywrightTestError(command) {
|
||||
const packages = [];
|
||||
for (const pkg of ["playwright", "playwright-chromium", "playwright-firefox", "playwright-webkit"]) {
|
||||
try {
|
||||
require.resolve(pkg);
|
||||
packages.push(pkg);
|
||||
} catch (e) {
|
||||
}
|
||||
}
|
||||
if (!packages.length)
|
||||
packages.push("playwright");
|
||||
const packageManager = (0, import_utils.getPackageManager)();
|
||||
if (packageManager === "yarn") {
|
||||
console.error(`Please install @playwright/test package before running "yarn playwright ${command}"`);
|
||||
console.error(` yarn remove ${packages.join(" ")}`);
|
||||
console.error(" yarn add -D @playwright/test");
|
||||
} else if (packageManager === "pnpm") {
|
||||
console.error(`Please install @playwright/test package before running "pnpm exec playwright ${command}"`);
|
||||
console.error(` pnpm remove ${packages.join(" ")}`);
|
||||
console.error(" pnpm add -D @playwright/test");
|
||||
} else {
|
||||
console.error(`Please install @playwright/test package before running "npx playwright ${command}"`);
|
||||
console.error(` npm uninstall ${packages.join(" ")}`);
|
||||
console.error(" npm install -D @playwright/test");
|
||||
}
|
||||
}
|
||||
const kExternalPlaywrightTestCommands = [
|
||||
["test", "Run tests with Playwright Test."],
|
||||
["show-report", "Show Playwright Test HTML report."],
|
||||
["merge-reports", "Merge Playwright Test Blob reports"]
|
||||
];
|
||||
function addExternalPlaywrightTestCommands() {
|
||||
for (const [command, description] of kExternalPlaywrightTestCommands) {
|
||||
const playwrightTest = import_program.program.command(command).allowUnknownOption(true).allowExcessArguments(true);
|
||||
playwrightTest.description(`${description} Available in @playwright/test package.`);
|
||||
playwrightTest.action(async () => {
|
||||
printPlaywrightTestError(command);
|
||||
(0, import_processLauncher.gracefullyProcessExitDoNotHang)(1);
|
||||
});
|
||||
}
|
||||
}
|
||||
if (!process.env.PW_LANG_NAME)
|
||||
addExternalPlaywrightTestCommands();
|
||||
// Annotate the CommonJS export names for ESM import in node:
|
||||
0 && (module.exports = {
|
||||
program
|
||||
});
|
||||
361
projects/org-skill-web-research/node_modules/playwright-core/lib/client/android.js
generated
vendored
Normal file
361
projects/org-skill-web-research/node_modules/playwright-core/lib/client/android.js
generated
vendored
Normal file
@@ -0,0 +1,361 @@
|
||||
"use strict";
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var android_exports = {};
|
||||
__export(android_exports, {
|
||||
Android: () => Android,
|
||||
AndroidDevice: () => AndroidDevice,
|
||||
AndroidInput: () => AndroidInput,
|
||||
AndroidSocket: () => AndroidSocket,
|
||||
AndroidWebView: () => AndroidWebView
|
||||
});
|
||||
module.exports = __toCommonJS(android_exports);
|
||||
var import_eventEmitter = require("./eventEmitter");
|
||||
var import_browserContext = require("./browserContext");
|
||||
var import_channelOwner = require("./channelOwner");
|
||||
var import_errors = require("./errors");
|
||||
var import_events = require("./events");
|
||||
var import_waiter = require("./waiter");
|
||||
var import_timeoutSettings = require("./timeoutSettings");
|
||||
var import_rtti = require("../utils/isomorphic/rtti");
|
||||
var import_time = require("../utils/isomorphic/time");
|
||||
var import_timeoutRunner = require("../utils/isomorphic/timeoutRunner");
|
||||
var import_webSocket = require("./webSocket");
|
||||
class Android extends import_channelOwner.ChannelOwner {
|
||||
static from(android) {
|
||||
return android._object;
|
||||
}
|
||||
constructor(parent, type, guid, initializer) {
|
||||
super(parent, type, guid, initializer);
|
||||
this._timeoutSettings = new import_timeoutSettings.TimeoutSettings(this._platform);
|
||||
}
|
||||
setDefaultTimeout(timeout) {
|
||||
this._timeoutSettings.setDefaultTimeout(timeout);
|
||||
}
|
||||
async devices(options = {}) {
|
||||
const { devices } = await this._channel.devices(options);
|
||||
return devices.map((d) => AndroidDevice.from(d));
|
||||
}
|
||||
async launchServer(options = {}) {
|
||||
if (!this._serverLauncher)
|
||||
throw new Error("Launching server is not supported");
|
||||
return await this._serverLauncher.launchServer(options);
|
||||
}
|
||||
async connect(wsEndpoint, options = {}) {
|
||||
return await this._wrapApiCall(async () => {
|
||||
const deadline = options.timeout ? (0, import_time.monotonicTime)() + options.timeout : 0;
|
||||
const headers = { "x-playwright-browser": "android", ...options.headers };
|
||||
const connectParams = { wsEndpoint, headers, slowMo: options.slowMo, timeout: options.timeout || 0 };
|
||||
const connection = await (0, import_webSocket.connectOverWebSocket)(this._connection, connectParams);
|
||||
let device;
|
||||
connection.on("close", () => {
|
||||
device?._didClose();
|
||||
});
|
||||
const result = await (0, import_timeoutRunner.raceAgainstDeadline)(async () => {
|
||||
const playwright = await connection.initializePlaywright();
|
||||
if (!playwright._initializer.preConnectedAndroidDevice) {
|
||||
connection.close();
|
||||
throw new Error("Malformed endpoint. Did you use Android.launchServer method?");
|
||||
}
|
||||
device = AndroidDevice.from(playwright._initializer.preConnectedAndroidDevice);
|
||||
device._shouldCloseConnectionOnClose = true;
|
||||
device.on(import_events.Events.AndroidDevice.Close, () => connection.close());
|
||||
return device;
|
||||
}, deadline);
|
||||
if (!result.timedOut) {
|
||||
return result.result;
|
||||
} else {
|
||||
connection.close();
|
||||
throw new Error(`Timeout ${options.timeout}ms exceeded`);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
class AndroidDevice extends import_channelOwner.ChannelOwner {
|
||||
constructor(parent, type, guid, initializer) {
|
||||
super(parent, type, guid, initializer);
|
||||
this._webViews = /* @__PURE__ */ new Map();
|
||||
this._shouldCloseConnectionOnClose = false;
|
||||
this._android = parent;
|
||||
this.input = new AndroidInput(this);
|
||||
this._timeoutSettings = new import_timeoutSettings.TimeoutSettings(this._platform, parent._timeoutSettings);
|
||||
this._channel.on("webViewAdded", ({ webView }) => this._onWebViewAdded(webView));
|
||||
this._channel.on("webViewRemoved", ({ socketName }) => this._onWebViewRemoved(socketName));
|
||||
this._channel.on("close", () => this._didClose());
|
||||
}
|
||||
static from(androidDevice) {
|
||||
return androidDevice._object;
|
||||
}
|
||||
_onWebViewAdded(webView) {
|
||||
const view = new AndroidWebView(this, webView);
|
||||
this._webViews.set(webView.socketName, view);
|
||||
this.emit(import_events.Events.AndroidDevice.WebView, view);
|
||||
}
|
||||
_onWebViewRemoved(socketName) {
|
||||
const view = this._webViews.get(socketName);
|
||||
this._webViews.delete(socketName);
|
||||
if (view)
|
||||
view.emit(import_events.Events.AndroidWebView.Close);
|
||||
}
|
||||
setDefaultTimeout(timeout) {
|
||||
this._timeoutSettings.setDefaultTimeout(timeout);
|
||||
}
|
||||
serial() {
|
||||
return this._initializer.serial;
|
||||
}
|
||||
model() {
|
||||
return this._initializer.model;
|
||||
}
|
||||
webViews() {
|
||||
return [...this._webViews.values()];
|
||||
}
|
||||
async webView(selector, options) {
|
||||
const predicate = (v) => {
|
||||
if (selector.pkg)
|
||||
return v.pkg() === selector.pkg;
|
||||
if (selector.socketName)
|
||||
return v._socketName() === selector.socketName;
|
||||
return false;
|
||||
};
|
||||
const webView = [...this._webViews.values()].find(predicate);
|
||||
if (webView)
|
||||
return webView;
|
||||
return await this.waitForEvent("webview", { ...options, predicate });
|
||||
}
|
||||
async wait(selector, options = {}) {
|
||||
await this._channel.wait({ androidSelector: toSelectorChannel(selector), ...options, timeout: this._timeoutSettings.timeout(options) });
|
||||
}
|
||||
async fill(selector, text, options = {}) {
|
||||
await this._channel.fill({ androidSelector: toSelectorChannel(selector), text, ...options, timeout: this._timeoutSettings.timeout(options) });
|
||||
}
|
||||
async press(selector, key, options = {}) {
|
||||
await this.tap(selector, options);
|
||||
await this.input.press(key);
|
||||
}
|
||||
async tap(selector, options = {}) {
|
||||
await this._channel.tap({ androidSelector: toSelectorChannel(selector), ...options, timeout: this._timeoutSettings.timeout(options) });
|
||||
}
|
||||
async drag(selector, dest, options = {}) {
|
||||
await this._channel.drag({ androidSelector: toSelectorChannel(selector), dest, ...options, timeout: this._timeoutSettings.timeout(options) });
|
||||
}
|
||||
async fling(selector, direction, options = {}) {
|
||||
await this._channel.fling({ androidSelector: toSelectorChannel(selector), direction, ...options, timeout: this._timeoutSettings.timeout(options) });
|
||||
}
|
||||
async longTap(selector, options = {}) {
|
||||
await this._channel.longTap({ androidSelector: toSelectorChannel(selector), ...options, timeout: this._timeoutSettings.timeout(options) });
|
||||
}
|
||||
async pinchClose(selector, percent, options = {}) {
|
||||
await this._channel.pinchClose({ androidSelector: toSelectorChannel(selector), percent, ...options, timeout: this._timeoutSettings.timeout(options) });
|
||||
}
|
||||
async pinchOpen(selector, percent, options = {}) {
|
||||
await this._channel.pinchOpen({ androidSelector: toSelectorChannel(selector), percent, ...options, timeout: this._timeoutSettings.timeout(options) });
|
||||
}
|
||||
async scroll(selector, direction, percent, options = {}) {
|
||||
await this._channel.scroll({ androidSelector: toSelectorChannel(selector), direction, percent, ...options, timeout: this._timeoutSettings.timeout(options) });
|
||||
}
|
||||
async swipe(selector, direction, percent, options = {}) {
|
||||
await this._channel.swipe({ androidSelector: toSelectorChannel(selector), direction, percent, ...options, timeout: this._timeoutSettings.timeout(options) });
|
||||
}
|
||||
async info(selector) {
|
||||
return (await this._channel.info({ androidSelector: toSelectorChannel(selector) })).info;
|
||||
}
|
||||
async screenshot(options = {}) {
|
||||
const { binary } = await this._channel.screenshot();
|
||||
if (options.path)
|
||||
await this._platform.fs().promises.writeFile(options.path, binary);
|
||||
return binary;
|
||||
}
|
||||
async [Symbol.asyncDispose]() {
|
||||
await this.close();
|
||||
}
|
||||
async close() {
|
||||
try {
|
||||
if (this._shouldCloseConnectionOnClose)
|
||||
this._connection.close();
|
||||
else
|
||||
await this._channel.close();
|
||||
} catch (e) {
|
||||
if ((0, import_errors.isTargetClosedError)(e))
|
||||
return;
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
_didClose() {
|
||||
this.emit(import_events.Events.AndroidDevice.Close, this);
|
||||
}
|
||||
async shell(command) {
|
||||
const { result } = await this._channel.shell({ command });
|
||||
return result;
|
||||
}
|
||||
async open(command) {
|
||||
return AndroidSocket.from((await this._channel.open({ command })).socket);
|
||||
}
|
||||
async installApk(file, options) {
|
||||
await this._channel.installApk({ file: await loadFile(this._platform, file), args: options && options.args });
|
||||
}
|
||||
async push(file, path, options) {
|
||||
await this._channel.push({ file: await loadFile(this._platform, file), path, mode: options ? options.mode : void 0 });
|
||||
}
|
||||
async launchBrowser(options = {}) {
|
||||
const contextOptions = await (0, import_browserContext.prepareBrowserContextParams)(this._platform, options);
|
||||
const result = await this._channel.launchBrowser(contextOptions);
|
||||
const context = import_browserContext.BrowserContext.from(result.context);
|
||||
const selectors = this._android._playwright.selectors;
|
||||
selectors._contextsForSelectors.add(context);
|
||||
context.once(import_events.Events.BrowserContext.Close, () => selectors._contextsForSelectors.delete(context));
|
||||
await context._initializeHarFromOptions(options.recordHar);
|
||||
return context;
|
||||
}
|
||||
async waitForEvent(event, optionsOrPredicate = {}) {
|
||||
return await this._wrapApiCall(async () => {
|
||||
const timeout = this._timeoutSettings.timeout(typeof optionsOrPredicate === "function" ? {} : optionsOrPredicate);
|
||||
const predicate = typeof optionsOrPredicate === "function" ? optionsOrPredicate : optionsOrPredicate.predicate;
|
||||
const waiter = import_waiter.Waiter.createForEvent(this, event);
|
||||
waiter.rejectOnTimeout(timeout, `Timeout ${timeout}ms exceeded while waiting for event "${event}"`);
|
||||
if (event !== import_events.Events.AndroidDevice.Close)
|
||||
waiter.rejectOnEvent(this, import_events.Events.AndroidDevice.Close, () => new import_errors.TargetClosedError());
|
||||
const result = await waiter.waitForEvent(this, event, predicate);
|
||||
waiter.dispose();
|
||||
return result;
|
||||
});
|
||||
}
|
||||
}
|
||||
class AndroidSocket extends import_channelOwner.ChannelOwner {
|
||||
static from(androidDevice) {
|
||||
return androidDevice._object;
|
||||
}
|
||||
constructor(parent, type, guid, initializer) {
|
||||
super(parent, type, guid, initializer);
|
||||
this._channel.on("data", ({ data }) => this.emit(import_events.Events.AndroidSocket.Data, data));
|
||||
this._channel.on("close", () => this.emit(import_events.Events.AndroidSocket.Close));
|
||||
}
|
||||
async write(data) {
|
||||
await this._channel.write({ data });
|
||||
}
|
||||
async close() {
|
||||
await this._channel.close();
|
||||
}
|
||||
async [Symbol.asyncDispose]() {
|
||||
await this.close();
|
||||
}
|
||||
}
|
||||
async function loadFile(platform, file) {
|
||||
if ((0, import_rtti.isString)(file))
|
||||
return await platform.fs().promises.readFile(file);
|
||||
return file;
|
||||
}
|
||||
class AndroidInput {
|
||||
constructor(device) {
|
||||
this._device = device;
|
||||
}
|
||||
async type(text) {
|
||||
await this._device._channel.inputType({ text });
|
||||
}
|
||||
async press(key) {
|
||||
await this._device._channel.inputPress({ key });
|
||||
}
|
||||
async tap(point) {
|
||||
await this._device._channel.inputTap({ point });
|
||||
}
|
||||
async swipe(from, segments, steps) {
|
||||
await this._device._channel.inputSwipe({ segments, steps });
|
||||
}
|
||||
async drag(from, to, steps) {
|
||||
await this._device._channel.inputDrag({ from, to, steps });
|
||||
}
|
||||
}
|
||||
function toSelectorChannel(selector) {
|
||||
const {
|
||||
checkable,
|
||||
checked,
|
||||
clazz,
|
||||
clickable,
|
||||
depth,
|
||||
desc,
|
||||
enabled,
|
||||
focusable,
|
||||
focused,
|
||||
hasChild,
|
||||
hasDescendant,
|
||||
longClickable,
|
||||
pkg,
|
||||
res,
|
||||
scrollable,
|
||||
selected,
|
||||
text
|
||||
} = selector;
|
||||
const toRegex = (value) => {
|
||||
if (value === void 0)
|
||||
return void 0;
|
||||
if ((0, import_rtti.isRegExp)(value))
|
||||
return value.source;
|
||||
return "^" + value.replace(/[|\\{}()[\]^$+*?.]/g, "\\$&").replace(/-/g, "\\x2d") + "$";
|
||||
};
|
||||
return {
|
||||
checkable,
|
||||
checked,
|
||||
clazz: toRegex(clazz),
|
||||
pkg: toRegex(pkg),
|
||||
desc: toRegex(desc),
|
||||
res: toRegex(res),
|
||||
text: toRegex(text),
|
||||
clickable,
|
||||
depth,
|
||||
enabled,
|
||||
focusable,
|
||||
focused,
|
||||
hasChild: hasChild ? { androidSelector: toSelectorChannel(hasChild.selector) } : void 0,
|
||||
hasDescendant: hasDescendant ? { androidSelector: toSelectorChannel(hasDescendant.selector), maxDepth: hasDescendant.maxDepth } : void 0,
|
||||
longClickable,
|
||||
scrollable,
|
||||
selected
|
||||
};
|
||||
}
|
||||
class AndroidWebView extends import_eventEmitter.EventEmitter {
|
||||
constructor(device, data) {
|
||||
super(device._platform);
|
||||
this._device = device;
|
||||
this._data = data;
|
||||
}
|
||||
pid() {
|
||||
return this._data.pid;
|
||||
}
|
||||
pkg() {
|
||||
return this._data.pkg;
|
||||
}
|
||||
_socketName() {
|
||||
return this._data.socketName;
|
||||
}
|
||||
async page() {
|
||||
if (!this._pagePromise)
|
||||
this._pagePromise = this._fetchPage();
|
||||
return await this._pagePromise;
|
||||
}
|
||||
async _fetchPage() {
|
||||
const { context } = await this._device._channel.connectToWebView({ socketName: this._data.socketName });
|
||||
return import_browserContext.BrowserContext.from(context).pages()[0];
|
||||
}
|
||||
}
|
||||
// Annotate the CommonJS export names for ESM import in node:
|
||||
0 && (module.exports = {
|
||||
Android,
|
||||
AndroidDevice,
|
||||
AndroidInput,
|
||||
AndroidSocket,
|
||||
AndroidWebView
|
||||
});
|
||||
137
projects/org-skill-web-research/node_modules/playwright-core/lib/client/api.js
generated
vendored
Normal file
137
projects/org-skill-web-research/node_modules/playwright-core/lib/client/api.js
generated
vendored
Normal file
@@ -0,0 +1,137 @@
|
||||
"use strict";
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var api_exports = {};
|
||||
__export(api_exports, {
|
||||
APIRequest: () => import_fetch.APIRequest,
|
||||
APIRequestContext: () => import_fetch.APIRequestContext,
|
||||
APIResponse: () => import_fetch.APIResponse,
|
||||
Android: () => import_android.Android,
|
||||
AndroidDevice: () => import_android.AndroidDevice,
|
||||
AndroidInput: () => import_android.AndroidInput,
|
||||
AndroidSocket: () => import_android.AndroidSocket,
|
||||
AndroidWebView: () => import_android.AndroidWebView,
|
||||
Browser: () => import_browser.Browser,
|
||||
BrowserContext: () => import_browserContext.BrowserContext,
|
||||
BrowserType: () => import_browserType.BrowserType,
|
||||
CDPSession: () => import_cdpSession.CDPSession,
|
||||
Clock: () => import_clock.Clock,
|
||||
ConsoleMessage: () => import_consoleMessage.ConsoleMessage,
|
||||
Coverage: () => import_coverage.Coverage,
|
||||
Dialog: () => import_dialog.Dialog,
|
||||
Download: () => import_download.Download,
|
||||
Electron: () => import_electron.Electron,
|
||||
ElectronApplication: () => import_electron.ElectronApplication,
|
||||
ElementHandle: () => import_elementHandle.ElementHandle,
|
||||
FileChooser: () => import_fileChooser.FileChooser,
|
||||
Frame: () => import_frame.Frame,
|
||||
FrameLocator: () => import_locator.FrameLocator,
|
||||
JSHandle: () => import_jsHandle.JSHandle,
|
||||
Keyboard: () => import_input.Keyboard,
|
||||
Locator: () => import_locator.Locator,
|
||||
Mouse: () => import_input.Mouse,
|
||||
Page: () => import_page.Page,
|
||||
PageAgent: () => import_pageAgent.PageAgent,
|
||||
Playwright: () => import_playwright.Playwright,
|
||||
Request: () => import_network.Request,
|
||||
Response: () => import_network.Response,
|
||||
Route: () => import_network.Route,
|
||||
Selectors: () => import_selectors.Selectors,
|
||||
TimeoutError: () => import_errors.TimeoutError,
|
||||
Touchscreen: () => import_input.Touchscreen,
|
||||
Tracing: () => import_tracing.Tracing,
|
||||
Video: () => import_video.Video,
|
||||
WebError: () => import_webError.WebError,
|
||||
WebSocket: () => import_network.WebSocket,
|
||||
WebSocketRoute: () => import_network.WebSocketRoute,
|
||||
Worker: () => import_worker.Worker
|
||||
});
|
||||
module.exports = __toCommonJS(api_exports);
|
||||
var import_android = require("./android");
|
||||
var import_browser = require("./browser");
|
||||
var import_browserContext = require("./browserContext");
|
||||
var import_browserType = require("./browserType");
|
||||
var import_clock = require("./clock");
|
||||
var import_consoleMessage = require("./consoleMessage");
|
||||
var import_coverage = require("./coverage");
|
||||
var import_dialog = require("./dialog");
|
||||
var import_download = require("./download");
|
||||
var import_electron = require("./electron");
|
||||
var import_locator = require("./locator");
|
||||
var import_elementHandle = require("./elementHandle");
|
||||
var import_fileChooser = require("./fileChooser");
|
||||
var import_errors = require("./errors");
|
||||
var import_frame = require("./frame");
|
||||
var import_input = require("./input");
|
||||
var import_jsHandle = require("./jsHandle");
|
||||
var import_network = require("./network");
|
||||
var import_fetch = require("./fetch");
|
||||
var import_page = require("./page");
|
||||
var import_pageAgent = require("./pageAgent");
|
||||
var import_selectors = require("./selectors");
|
||||
var import_tracing = require("./tracing");
|
||||
var import_video = require("./video");
|
||||
var import_worker = require("./worker");
|
||||
var import_cdpSession = require("./cdpSession");
|
||||
var import_playwright = require("./playwright");
|
||||
var import_webError = require("./webError");
|
||||
// Annotate the CommonJS export names for ESM import in node:
|
||||
0 && (module.exports = {
|
||||
APIRequest,
|
||||
APIRequestContext,
|
||||
APIResponse,
|
||||
Android,
|
||||
AndroidDevice,
|
||||
AndroidInput,
|
||||
AndroidSocket,
|
||||
AndroidWebView,
|
||||
Browser,
|
||||
BrowserContext,
|
||||
BrowserType,
|
||||
CDPSession,
|
||||
Clock,
|
||||
ConsoleMessage,
|
||||
Coverage,
|
||||
Dialog,
|
||||
Download,
|
||||
Electron,
|
||||
ElectronApplication,
|
||||
ElementHandle,
|
||||
FileChooser,
|
||||
Frame,
|
||||
FrameLocator,
|
||||
JSHandle,
|
||||
Keyboard,
|
||||
Locator,
|
||||
Mouse,
|
||||
Page,
|
||||
PageAgent,
|
||||
Playwright,
|
||||
Request,
|
||||
Response,
|
||||
Route,
|
||||
Selectors,
|
||||
TimeoutError,
|
||||
Touchscreen,
|
||||
Tracing,
|
||||
Video,
|
||||
WebError,
|
||||
WebSocket,
|
||||
WebSocketRoute,
|
||||
Worker
|
||||
});
|
||||
79
projects/org-skill-web-research/node_modules/playwright-core/lib/client/artifact.js
generated
vendored
Normal file
79
projects/org-skill-web-research/node_modules/playwright-core/lib/client/artifact.js
generated
vendored
Normal file
@@ -0,0 +1,79 @@
|
||||
"use strict";
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var artifact_exports = {};
|
||||
__export(artifact_exports, {
|
||||
Artifact: () => Artifact
|
||||
});
|
||||
module.exports = __toCommonJS(artifact_exports);
|
||||
var import_channelOwner = require("./channelOwner");
|
||||
var import_stream = require("./stream");
|
||||
var import_fileUtils = require("./fileUtils");
|
||||
class Artifact extends import_channelOwner.ChannelOwner {
|
||||
static from(channel) {
|
||||
return channel._object;
|
||||
}
|
||||
async pathAfterFinished() {
|
||||
if (this._connection.isRemote())
|
||||
throw new Error(`Path is not available when connecting remotely. Use saveAs() to save a local copy.`);
|
||||
return (await this._channel.pathAfterFinished()).value;
|
||||
}
|
||||
async saveAs(path) {
|
||||
if (!this._connection.isRemote()) {
|
||||
await this._channel.saveAs({ path });
|
||||
return;
|
||||
}
|
||||
const result = await this._channel.saveAsStream();
|
||||
const stream = import_stream.Stream.from(result.stream);
|
||||
await (0, import_fileUtils.mkdirIfNeeded)(this._platform, path);
|
||||
await new Promise((resolve, reject) => {
|
||||
stream.stream().pipe(this._platform.fs().createWriteStream(path)).on("finish", resolve).on("error", reject);
|
||||
});
|
||||
}
|
||||
async failure() {
|
||||
return (await this._channel.failure()).error || null;
|
||||
}
|
||||
async createReadStream() {
|
||||
const result = await this._channel.stream();
|
||||
const stream = import_stream.Stream.from(result.stream);
|
||||
return stream.stream();
|
||||
}
|
||||
async readIntoBuffer() {
|
||||
const stream = await this.createReadStream();
|
||||
return await new Promise((resolve, reject) => {
|
||||
const chunks = [];
|
||||
stream.on("data", (chunk) => {
|
||||
chunks.push(chunk);
|
||||
});
|
||||
stream.on("end", () => {
|
||||
resolve(Buffer.concat(chunks));
|
||||
});
|
||||
stream.on("error", reject);
|
||||
});
|
||||
}
|
||||
async cancel() {
|
||||
return await this._channel.cancel();
|
||||
}
|
||||
async delete() {
|
||||
return await this._channel.delete();
|
||||
}
|
||||
}
|
||||
// Annotate the CommonJS export names for ESM import in node:
|
||||
0 && (module.exports = {
|
||||
Artifact
|
||||
});
|
||||
161
projects/org-skill-web-research/node_modules/playwright-core/lib/client/browser.js
generated
vendored
Normal file
161
projects/org-skill-web-research/node_modules/playwright-core/lib/client/browser.js
generated
vendored
Normal file
@@ -0,0 +1,161 @@
|
||||
"use strict";
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var browser_exports = {};
|
||||
__export(browser_exports, {
|
||||
Browser: () => Browser
|
||||
});
|
||||
module.exports = __toCommonJS(browser_exports);
|
||||
var import_artifact = require("./artifact");
|
||||
var import_browserContext = require("./browserContext");
|
||||
var import_cdpSession = require("./cdpSession");
|
||||
var import_channelOwner = require("./channelOwner");
|
||||
var import_errors = require("./errors");
|
||||
var import_events = require("./events");
|
||||
var import_fileUtils = require("./fileUtils");
|
||||
class Browser extends import_channelOwner.ChannelOwner {
|
||||
constructor(parent, type, guid, initializer) {
|
||||
super(parent, type, guid, initializer);
|
||||
this._contexts = /* @__PURE__ */ new Set();
|
||||
this._isConnected = true;
|
||||
this._shouldCloseConnectionOnClose = false;
|
||||
this._options = {};
|
||||
this._name = initializer.name;
|
||||
this._channel.on("context", ({ context }) => this._didCreateContext(import_browserContext.BrowserContext.from(context)));
|
||||
this._channel.on("close", () => this._didClose());
|
||||
this._closedPromise = new Promise((f) => this.once(import_events.Events.Browser.Disconnected, f));
|
||||
}
|
||||
static from(browser) {
|
||||
return browser._object;
|
||||
}
|
||||
browserType() {
|
||||
return this._browserType;
|
||||
}
|
||||
async newContext(options = {}) {
|
||||
return await this._innerNewContext(options, false);
|
||||
}
|
||||
async _newContextForReuse(options = {}) {
|
||||
return await this._innerNewContext(options, true);
|
||||
}
|
||||
async _disconnectFromReusedContext(reason) {
|
||||
const context = [...this._contexts].find((context2) => context2._forReuse);
|
||||
if (!context)
|
||||
return;
|
||||
await this._instrumentation.runBeforeCloseBrowserContext(context);
|
||||
for (const page of context.pages())
|
||||
page._onClose();
|
||||
context._onClose();
|
||||
await this._channel.disconnectFromReusedContext({ reason });
|
||||
}
|
||||
async _innerNewContext(userOptions = {}, forReuse) {
|
||||
const options = this._browserType._playwright.selectors._withSelectorOptions(userOptions);
|
||||
await this._instrumentation.runBeforeCreateBrowserContext(options);
|
||||
const contextOptions = await (0, import_browserContext.prepareBrowserContextParams)(this._platform, options);
|
||||
const response = forReuse ? await this._channel.newContextForReuse(contextOptions) : await this._channel.newContext(contextOptions);
|
||||
const context = import_browserContext.BrowserContext.from(response.context);
|
||||
if (forReuse)
|
||||
context._forReuse = true;
|
||||
if (options.logger)
|
||||
context._logger = options.logger;
|
||||
await context._initializeHarFromOptions(options.recordHar);
|
||||
await this._instrumentation.runAfterCreateBrowserContext(context);
|
||||
return context;
|
||||
}
|
||||
_connectToBrowserType(browserType, browserOptions, logger) {
|
||||
this._browserType = browserType;
|
||||
this._options = browserOptions;
|
||||
this._logger = logger;
|
||||
for (const context of this._contexts)
|
||||
this._setupBrowserContext(context);
|
||||
}
|
||||
_didCreateContext(context) {
|
||||
context._browser = this;
|
||||
this._contexts.add(context);
|
||||
if (this._browserType)
|
||||
this._setupBrowserContext(context);
|
||||
}
|
||||
_setupBrowserContext(context) {
|
||||
context._logger = this._logger;
|
||||
context.tracing._tracesDir = this._options.tracesDir;
|
||||
this._browserType._contexts.add(context);
|
||||
this._browserType._playwright.selectors._contextsForSelectors.add(context);
|
||||
context.setDefaultTimeout(this._browserType._playwright._defaultContextTimeout);
|
||||
context.setDefaultNavigationTimeout(this._browserType._playwright._defaultContextNavigationTimeout);
|
||||
}
|
||||
contexts() {
|
||||
return [...this._contexts];
|
||||
}
|
||||
version() {
|
||||
return this._initializer.version;
|
||||
}
|
||||
async newPage(options = {}) {
|
||||
return await this._wrapApiCall(async () => {
|
||||
const context = await this.newContext(options);
|
||||
const page = await context.newPage();
|
||||
page._ownedContext = context;
|
||||
context._ownerPage = page;
|
||||
return page;
|
||||
}, { title: "Create page" });
|
||||
}
|
||||
isConnected() {
|
||||
return this._isConnected;
|
||||
}
|
||||
async newBrowserCDPSession() {
|
||||
return import_cdpSession.CDPSession.from((await this._channel.newBrowserCDPSession()).session);
|
||||
}
|
||||
async startTracing(page, options = {}) {
|
||||
this._path = options.path;
|
||||
await this._channel.startTracing({ ...options, page: page ? page._channel : void 0 });
|
||||
}
|
||||
async stopTracing() {
|
||||
const artifact = import_artifact.Artifact.from((await this._channel.stopTracing()).artifact);
|
||||
const buffer = await artifact.readIntoBuffer();
|
||||
await artifact.delete();
|
||||
if (this._path) {
|
||||
await (0, import_fileUtils.mkdirIfNeeded)(this._platform, this._path);
|
||||
await this._platform.fs().promises.writeFile(this._path, buffer);
|
||||
this._path = void 0;
|
||||
}
|
||||
return buffer;
|
||||
}
|
||||
async [Symbol.asyncDispose]() {
|
||||
await this.close();
|
||||
}
|
||||
async close(options = {}) {
|
||||
this._closeReason = options.reason;
|
||||
try {
|
||||
if (this._shouldCloseConnectionOnClose)
|
||||
this._connection.close();
|
||||
else
|
||||
await this._channel.close(options);
|
||||
await this._closedPromise;
|
||||
} catch (e) {
|
||||
if ((0, import_errors.isTargetClosedError)(e))
|
||||
return;
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
_didClose() {
|
||||
this._isConnected = false;
|
||||
this.emit(import_events.Events.Browser.Disconnected, this);
|
||||
}
|
||||
}
|
||||
// Annotate the CommonJS export names for ESM import in node:
|
||||
0 && (module.exports = {
|
||||
Browser
|
||||
});
|
||||
582
projects/org-skill-web-research/node_modules/playwright-core/lib/client/browserContext.js
generated
vendored
Normal file
582
projects/org-skill-web-research/node_modules/playwright-core/lib/client/browserContext.js
generated
vendored
Normal file
@@ -0,0 +1,582 @@
|
||||
"use strict";
|
||||
var __create = Object.create;
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __getProtoOf = Object.getPrototypeOf;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
||||
// If the importer is in node compatibility mode or this is not an ESM
|
||||
// file that has been converted to a CommonJS file using a Babel-
|
||||
// compatible transform (i.e. "__esModule" has not been set), then set
|
||||
// "default" to the CommonJS "module.exports" for node compatibility.
|
||||
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
||||
mod
|
||||
));
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var browserContext_exports = {};
|
||||
__export(browserContext_exports, {
|
||||
BrowserContext: () => BrowserContext,
|
||||
prepareBrowserContextParams: () => prepareBrowserContextParams,
|
||||
toClientCertificatesProtocol: () => toClientCertificatesProtocol
|
||||
});
|
||||
module.exports = __toCommonJS(browserContext_exports);
|
||||
var import_artifact = require("./artifact");
|
||||
var import_cdpSession = require("./cdpSession");
|
||||
var import_channelOwner = require("./channelOwner");
|
||||
var import_clientHelper = require("./clientHelper");
|
||||
var import_clock = require("./clock");
|
||||
var import_consoleMessage = require("./consoleMessage");
|
||||
var import_dialog = require("./dialog");
|
||||
var import_errors = require("./errors");
|
||||
var import_events = require("./events");
|
||||
var import_fetch = require("./fetch");
|
||||
var import_frame = require("./frame");
|
||||
var import_harRouter = require("./harRouter");
|
||||
var network = __toESM(require("./network"));
|
||||
var import_page = require("./page");
|
||||
var import_tracing = require("./tracing");
|
||||
var import_waiter = require("./waiter");
|
||||
var import_webError = require("./webError");
|
||||
var import_worker = require("./worker");
|
||||
var import_timeoutSettings = require("./timeoutSettings");
|
||||
var import_fileUtils = require("./fileUtils");
|
||||
var import_headers = require("../utils/isomorphic/headers");
|
||||
var import_urlMatch = require("../utils/isomorphic/urlMatch");
|
||||
var import_rtti = require("../utils/isomorphic/rtti");
|
||||
var import_stackTrace = require("../utils/isomorphic/stackTrace");
|
||||
class BrowserContext extends import_channelOwner.ChannelOwner {
|
||||
constructor(parent, type, guid, initializer) {
|
||||
super(parent, type, guid, initializer);
|
||||
this._pages = /* @__PURE__ */ new Set();
|
||||
this._routes = [];
|
||||
this._webSocketRoutes = [];
|
||||
// Browser is null for browser contexts created outside of normal browser, e.g. android or electron.
|
||||
this._browser = null;
|
||||
this._bindings = /* @__PURE__ */ new Map();
|
||||
this._forReuse = false;
|
||||
this._serviceWorkers = /* @__PURE__ */ new Set();
|
||||
this._harRecorders = /* @__PURE__ */ new Map();
|
||||
this._closingStatus = "none";
|
||||
this._harRouters = [];
|
||||
this._options = initializer.options;
|
||||
this._timeoutSettings = new import_timeoutSettings.TimeoutSettings(this._platform);
|
||||
this.tracing = import_tracing.Tracing.from(initializer.tracing);
|
||||
this.request = import_fetch.APIRequestContext.from(initializer.requestContext);
|
||||
this.request._timeoutSettings = this._timeoutSettings;
|
||||
this.request._checkUrlAllowed = (url) => this._checkUrlAllowed(url);
|
||||
this.clock = new import_clock.Clock(this);
|
||||
this._channel.on("bindingCall", ({ binding }) => this._onBinding(import_page.BindingCall.from(binding)));
|
||||
this._channel.on("close", () => this._onClose());
|
||||
this._channel.on("page", ({ page }) => this._onPage(import_page.Page.from(page)));
|
||||
this._channel.on("route", ({ route }) => this._onRoute(network.Route.from(route)));
|
||||
this._channel.on("webSocketRoute", ({ webSocketRoute }) => this._onWebSocketRoute(network.WebSocketRoute.from(webSocketRoute)));
|
||||
this._channel.on("serviceWorker", ({ worker }) => {
|
||||
const serviceWorker = import_worker.Worker.from(worker);
|
||||
serviceWorker._context = this;
|
||||
this._serviceWorkers.add(serviceWorker);
|
||||
this.emit(import_events.Events.BrowserContext.ServiceWorker, serviceWorker);
|
||||
});
|
||||
this._channel.on("console", (event) => {
|
||||
const worker = import_worker.Worker.fromNullable(event.worker);
|
||||
const page = import_page.Page.fromNullable(event.page);
|
||||
const consoleMessage = new import_consoleMessage.ConsoleMessage(this._platform, event, page, worker);
|
||||
worker?.emit(import_events.Events.Worker.Console, consoleMessage);
|
||||
page?.emit(import_events.Events.Page.Console, consoleMessage);
|
||||
if (worker && this._serviceWorkers.has(worker)) {
|
||||
const scope = this._serviceWorkerScope(worker);
|
||||
for (const page2 of this._pages) {
|
||||
if (scope && page2.url().startsWith(scope))
|
||||
page2.emit(import_events.Events.Page.Console, consoleMessage);
|
||||
}
|
||||
}
|
||||
this.emit(import_events.Events.BrowserContext.Console, consoleMessage);
|
||||
});
|
||||
this._channel.on("pageError", ({ error, page }) => {
|
||||
const pageObject = import_page.Page.from(page);
|
||||
const parsedError = (0, import_errors.parseError)(error);
|
||||
this.emit(import_events.Events.BrowserContext.WebError, new import_webError.WebError(pageObject, parsedError));
|
||||
if (pageObject)
|
||||
pageObject.emit(import_events.Events.Page.PageError, parsedError);
|
||||
});
|
||||
this._channel.on("dialog", ({ dialog }) => {
|
||||
const dialogObject = import_dialog.Dialog.from(dialog);
|
||||
let hasListeners = this.emit(import_events.Events.BrowserContext.Dialog, dialogObject);
|
||||
const page = dialogObject.page();
|
||||
if (page)
|
||||
hasListeners = page.emit(import_events.Events.Page.Dialog, dialogObject) || hasListeners;
|
||||
if (!hasListeners) {
|
||||
if (dialogObject.type() === "beforeunload")
|
||||
dialog.accept({}).catch(() => {
|
||||
});
|
||||
else
|
||||
dialog.dismiss().catch(() => {
|
||||
});
|
||||
}
|
||||
});
|
||||
this._channel.on("request", ({ request, page }) => this._onRequest(network.Request.from(request), import_page.Page.fromNullable(page)));
|
||||
this._channel.on("requestFailed", ({ request, failureText, responseEndTiming, page }) => this._onRequestFailed(network.Request.from(request), responseEndTiming, failureText, import_page.Page.fromNullable(page)));
|
||||
this._channel.on("requestFinished", (params) => this._onRequestFinished(params));
|
||||
this._channel.on("response", ({ response, page }) => this._onResponse(network.Response.from(response), import_page.Page.fromNullable(page)));
|
||||
this._channel.on("recorderEvent", ({ event, data, page, code }) => {
|
||||
if (event === "actionAdded")
|
||||
this._onRecorderEventSink?.actionAdded?.(import_page.Page.from(page), data, code);
|
||||
else if (event === "actionUpdated")
|
||||
this._onRecorderEventSink?.actionUpdated?.(import_page.Page.from(page), data, code);
|
||||
else if (event === "signalAdded")
|
||||
this._onRecorderEventSink?.signalAdded?.(import_page.Page.from(page), data);
|
||||
});
|
||||
this._closedPromise = new Promise((f) => this.once(import_events.Events.BrowserContext.Close, f));
|
||||
this._setEventToSubscriptionMapping(/* @__PURE__ */ new Map([
|
||||
[import_events.Events.BrowserContext.Console, "console"],
|
||||
[import_events.Events.BrowserContext.Dialog, "dialog"],
|
||||
[import_events.Events.BrowserContext.Request, "request"],
|
||||
[import_events.Events.BrowserContext.Response, "response"],
|
||||
[import_events.Events.BrowserContext.RequestFinished, "requestFinished"],
|
||||
[import_events.Events.BrowserContext.RequestFailed, "requestFailed"]
|
||||
]));
|
||||
}
|
||||
static from(context) {
|
||||
return context._object;
|
||||
}
|
||||
static fromNullable(context) {
|
||||
return context ? BrowserContext.from(context) : null;
|
||||
}
|
||||
async _initializeHarFromOptions(recordHar) {
|
||||
if (!recordHar)
|
||||
return;
|
||||
const defaultContent = recordHar.path.endsWith(".zip") ? "attach" : "embed";
|
||||
await this._recordIntoHAR(recordHar.path, null, {
|
||||
url: recordHar.urlFilter,
|
||||
updateContent: recordHar.content ?? (recordHar.omitContent ? "omit" : defaultContent),
|
||||
updateMode: recordHar.mode ?? "full"
|
||||
});
|
||||
}
|
||||
_onPage(page) {
|
||||
this._pages.add(page);
|
||||
this.emit(import_events.Events.BrowserContext.Page, page);
|
||||
if (page._opener && !page._opener.isClosed())
|
||||
page._opener.emit(import_events.Events.Page.Popup, page);
|
||||
}
|
||||
_onRequest(request, page) {
|
||||
this.emit(import_events.Events.BrowserContext.Request, request);
|
||||
if (page)
|
||||
page.emit(import_events.Events.Page.Request, request);
|
||||
}
|
||||
_onResponse(response, page) {
|
||||
this.emit(import_events.Events.BrowserContext.Response, response);
|
||||
if (page)
|
||||
page.emit(import_events.Events.Page.Response, response);
|
||||
}
|
||||
_onRequestFailed(request, responseEndTiming, failureText, page) {
|
||||
request._failureText = failureText || null;
|
||||
request._setResponseEndTiming(responseEndTiming);
|
||||
this.emit(import_events.Events.BrowserContext.RequestFailed, request);
|
||||
if (page)
|
||||
page.emit(import_events.Events.Page.RequestFailed, request);
|
||||
}
|
||||
_onRequestFinished(params) {
|
||||
const { responseEndTiming } = params;
|
||||
const request = network.Request.from(params.request);
|
||||
const response = network.Response.fromNullable(params.response);
|
||||
const page = import_page.Page.fromNullable(params.page);
|
||||
request._setResponseEndTiming(responseEndTiming);
|
||||
this.emit(import_events.Events.BrowserContext.RequestFinished, request);
|
||||
if (page)
|
||||
page.emit(import_events.Events.Page.RequestFinished, request);
|
||||
if (response)
|
||||
response._finishedPromise.resolve(null);
|
||||
}
|
||||
async _onRoute(route) {
|
||||
route._context = this;
|
||||
const page = route.request()._safePage();
|
||||
const routeHandlers = this._routes.slice();
|
||||
for (const routeHandler of routeHandlers) {
|
||||
if (page?._closeWasCalled || this._closingStatus !== "none")
|
||||
return;
|
||||
if (!routeHandler.matches(route.request().url()))
|
||||
continue;
|
||||
const index = this._routes.indexOf(routeHandler);
|
||||
if (index === -1)
|
||||
continue;
|
||||
if (routeHandler.willExpire())
|
||||
this._routes.splice(index, 1);
|
||||
const handled = await routeHandler.handle(route);
|
||||
if (!this._routes.length)
|
||||
this._updateInterceptionPatterns({ internal: true }).catch(() => {
|
||||
});
|
||||
if (handled)
|
||||
return;
|
||||
}
|
||||
await route._innerContinue(
|
||||
true
|
||||
/* isFallback */
|
||||
).catch(() => {
|
||||
});
|
||||
}
|
||||
async _onWebSocketRoute(webSocketRoute) {
|
||||
const routeHandler = this._webSocketRoutes.find((route) => route.matches(webSocketRoute.url()));
|
||||
if (routeHandler)
|
||||
await routeHandler.handle(webSocketRoute);
|
||||
else
|
||||
webSocketRoute.connectToServer();
|
||||
}
|
||||
async _onBinding(bindingCall) {
|
||||
const func = this._bindings.get(bindingCall._initializer.name);
|
||||
if (!func)
|
||||
return;
|
||||
await bindingCall.call(func);
|
||||
}
|
||||
_serviceWorkerScope(serviceWorker) {
|
||||
try {
|
||||
let url = new URL(".", serviceWorker.url()).href;
|
||||
if (!url.endsWith("/"))
|
||||
url += "/";
|
||||
return url;
|
||||
} catch {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
setDefaultNavigationTimeout(timeout) {
|
||||
this._timeoutSettings.setDefaultNavigationTimeout(timeout);
|
||||
}
|
||||
setDefaultTimeout(timeout) {
|
||||
this._timeoutSettings.setDefaultTimeout(timeout);
|
||||
}
|
||||
browser() {
|
||||
return this._browser;
|
||||
}
|
||||
pages() {
|
||||
return [...this._pages];
|
||||
}
|
||||
async newPage() {
|
||||
if (this._ownerPage)
|
||||
throw new Error("Please use browser.newContext()");
|
||||
return import_page.Page.from((await this._channel.newPage()).page);
|
||||
}
|
||||
async cookies(urls) {
|
||||
if (!urls)
|
||||
urls = [];
|
||||
if (urls && typeof urls === "string")
|
||||
urls = [urls];
|
||||
return (await this._channel.cookies({ urls })).cookies;
|
||||
}
|
||||
async addCookies(cookies) {
|
||||
await this._channel.addCookies({ cookies });
|
||||
}
|
||||
async clearCookies(options = {}) {
|
||||
await this._channel.clearCookies({
|
||||
name: (0, import_rtti.isString)(options.name) ? options.name : void 0,
|
||||
nameRegexSource: (0, import_rtti.isRegExp)(options.name) ? options.name.source : void 0,
|
||||
nameRegexFlags: (0, import_rtti.isRegExp)(options.name) ? options.name.flags : void 0,
|
||||
domain: (0, import_rtti.isString)(options.domain) ? options.domain : void 0,
|
||||
domainRegexSource: (0, import_rtti.isRegExp)(options.domain) ? options.domain.source : void 0,
|
||||
domainRegexFlags: (0, import_rtti.isRegExp)(options.domain) ? options.domain.flags : void 0,
|
||||
path: (0, import_rtti.isString)(options.path) ? options.path : void 0,
|
||||
pathRegexSource: (0, import_rtti.isRegExp)(options.path) ? options.path.source : void 0,
|
||||
pathRegexFlags: (0, import_rtti.isRegExp)(options.path) ? options.path.flags : void 0
|
||||
});
|
||||
}
|
||||
async grantPermissions(permissions, options) {
|
||||
await this._channel.grantPermissions({ permissions, ...options });
|
||||
}
|
||||
async clearPermissions() {
|
||||
await this._channel.clearPermissions();
|
||||
}
|
||||
async setGeolocation(geolocation) {
|
||||
await this._channel.setGeolocation({ geolocation: geolocation || void 0 });
|
||||
}
|
||||
async setExtraHTTPHeaders(headers) {
|
||||
network.validateHeaders(headers);
|
||||
await this._channel.setExtraHTTPHeaders({ headers: (0, import_headers.headersObjectToArray)(headers) });
|
||||
}
|
||||
async setOffline(offline) {
|
||||
await this._channel.setOffline({ offline });
|
||||
}
|
||||
async setHTTPCredentials(httpCredentials) {
|
||||
await this._channel.setHTTPCredentials({ httpCredentials: httpCredentials || void 0 });
|
||||
}
|
||||
async addInitScript(script, arg) {
|
||||
const source = await (0, import_clientHelper.evaluationScript)(this._platform, script, arg);
|
||||
await this._channel.addInitScript({ source });
|
||||
}
|
||||
async exposeBinding(name, callback, options = {}) {
|
||||
await this._channel.exposeBinding({ name, needsHandle: options.handle });
|
||||
this._bindings.set(name, callback);
|
||||
}
|
||||
async exposeFunction(name, callback) {
|
||||
await this._channel.exposeBinding({ name });
|
||||
const binding = (source, ...args) => callback(...args);
|
||||
this._bindings.set(name, binding);
|
||||
}
|
||||
async route(url, handler, options = {}) {
|
||||
this._routes.unshift(new network.RouteHandler(this._platform, this._options.baseURL, url, handler, options.times));
|
||||
await this._updateInterceptionPatterns({ title: "Route requests" });
|
||||
}
|
||||
async routeWebSocket(url, handler) {
|
||||
this._webSocketRoutes.unshift(new network.WebSocketRouteHandler(this._options.baseURL, url, handler));
|
||||
await this._updateWebSocketInterceptionPatterns({ title: "Route WebSockets" });
|
||||
}
|
||||
async _recordIntoHAR(har, page, options = {}) {
|
||||
const { harId } = await this._channel.harStart({
|
||||
page: page?._channel,
|
||||
options: {
|
||||
zip: har.endsWith(".zip"),
|
||||
content: options.updateContent ?? "attach",
|
||||
urlGlob: (0, import_rtti.isString)(options.url) ? options.url : void 0,
|
||||
urlRegexSource: (0, import_rtti.isRegExp)(options.url) ? options.url.source : void 0,
|
||||
urlRegexFlags: (0, import_rtti.isRegExp)(options.url) ? options.url.flags : void 0,
|
||||
mode: options.updateMode ?? "minimal"
|
||||
}
|
||||
});
|
||||
this._harRecorders.set(harId, { path: har, content: options.updateContent ?? "attach" });
|
||||
}
|
||||
async routeFromHAR(har, options = {}) {
|
||||
const localUtils = this._connection.localUtils();
|
||||
if (!localUtils)
|
||||
throw new Error("Route from har is not supported in thin clients");
|
||||
if (options.update) {
|
||||
await this._recordIntoHAR(har, null, options);
|
||||
return;
|
||||
}
|
||||
const harRouter = await import_harRouter.HarRouter.create(localUtils, har, options.notFound || "abort", { urlMatch: options.url });
|
||||
this._harRouters.push(harRouter);
|
||||
await harRouter.addContextRoute(this);
|
||||
}
|
||||
_disposeHarRouters() {
|
||||
this._harRouters.forEach((router) => router.dispose());
|
||||
this._harRouters = [];
|
||||
}
|
||||
async unrouteAll(options) {
|
||||
await this._unrouteInternal(this._routes, [], options?.behavior);
|
||||
this._disposeHarRouters();
|
||||
}
|
||||
async unroute(url, handler) {
|
||||
const removed = [];
|
||||
const remaining = [];
|
||||
for (const route of this._routes) {
|
||||
if ((0, import_urlMatch.urlMatchesEqual)(route.url, url) && (!handler || route.handler === handler))
|
||||
removed.push(route);
|
||||
else
|
||||
remaining.push(route);
|
||||
}
|
||||
await this._unrouteInternal(removed, remaining, "default");
|
||||
}
|
||||
async _unrouteInternal(removed, remaining, behavior) {
|
||||
this._routes = remaining;
|
||||
if (behavior && behavior !== "default") {
|
||||
const promises = removed.map((routeHandler) => routeHandler.stop(behavior));
|
||||
await Promise.all(promises);
|
||||
}
|
||||
await this._updateInterceptionPatterns({ title: "Unroute requests" });
|
||||
}
|
||||
async _updateInterceptionPatterns(options) {
|
||||
const patterns = network.RouteHandler.prepareInterceptionPatterns(this._routes);
|
||||
await this._wrapApiCall(() => this._channel.setNetworkInterceptionPatterns({ patterns }), options);
|
||||
}
|
||||
async _updateWebSocketInterceptionPatterns(options) {
|
||||
const patterns = network.WebSocketRouteHandler.prepareInterceptionPatterns(this._webSocketRoutes);
|
||||
await this._wrapApiCall(() => this._channel.setWebSocketInterceptionPatterns({ patterns }), options);
|
||||
}
|
||||
_effectiveCloseReason() {
|
||||
return this._closeReason || this._browser?._closeReason;
|
||||
}
|
||||
async waitForEvent(event, optionsOrPredicate = {}) {
|
||||
return await this._wrapApiCall(async () => {
|
||||
const timeout = this._timeoutSettings.timeout(typeof optionsOrPredicate === "function" ? {} : optionsOrPredicate);
|
||||
const predicate = typeof optionsOrPredicate === "function" ? optionsOrPredicate : optionsOrPredicate.predicate;
|
||||
const waiter = import_waiter.Waiter.createForEvent(this, event);
|
||||
waiter.rejectOnTimeout(timeout, `Timeout ${timeout}ms exceeded while waiting for event "${event}"`);
|
||||
if (event !== import_events.Events.BrowserContext.Close)
|
||||
waiter.rejectOnEvent(this, import_events.Events.BrowserContext.Close, () => new import_errors.TargetClosedError(this._effectiveCloseReason()));
|
||||
const result = await waiter.waitForEvent(this, event, predicate);
|
||||
waiter.dispose();
|
||||
return result;
|
||||
});
|
||||
}
|
||||
async storageState(options = {}) {
|
||||
const state = await this._channel.storageState({ indexedDB: options.indexedDB });
|
||||
if (options.path) {
|
||||
await (0, import_fileUtils.mkdirIfNeeded)(this._platform, options.path);
|
||||
await this._platform.fs().promises.writeFile(options.path, JSON.stringify(state, void 0, 2), "utf8");
|
||||
}
|
||||
return state;
|
||||
}
|
||||
backgroundPages() {
|
||||
return [];
|
||||
}
|
||||
serviceWorkers() {
|
||||
return [...this._serviceWorkers];
|
||||
}
|
||||
async newCDPSession(page) {
|
||||
if (!(page instanceof import_page.Page) && !(page instanceof import_frame.Frame))
|
||||
throw new Error("page: expected Page or Frame");
|
||||
const result = await this._channel.newCDPSession(page instanceof import_page.Page ? { page: page._channel } : { frame: page._channel });
|
||||
return import_cdpSession.CDPSession.from(result.session);
|
||||
}
|
||||
_onClose() {
|
||||
this._closingStatus = "closed";
|
||||
this._browser?._contexts.delete(this);
|
||||
this._browser?._browserType._contexts.delete(this);
|
||||
this._browser?._browserType._playwright.selectors._contextsForSelectors.delete(this);
|
||||
this._disposeHarRouters();
|
||||
this.tracing._resetStackCounter();
|
||||
this.emit(import_events.Events.BrowserContext.Close, this);
|
||||
}
|
||||
async [Symbol.asyncDispose]() {
|
||||
await this.close();
|
||||
}
|
||||
async close(options = {}) {
|
||||
if (this._closingStatus !== "none")
|
||||
return;
|
||||
this._closeReason = options.reason;
|
||||
this._closingStatus = "closing";
|
||||
await this.request.dispose(options);
|
||||
await this._instrumentation.runBeforeCloseBrowserContext(this);
|
||||
await this._wrapApiCall(async () => {
|
||||
for (const [harId, harParams] of this._harRecorders) {
|
||||
const har = await this._channel.harExport({ harId });
|
||||
const artifact = import_artifact.Artifact.from(har.artifact);
|
||||
const isCompressed = harParams.content === "attach" || harParams.path.endsWith(".zip");
|
||||
const needCompressed = harParams.path.endsWith(".zip");
|
||||
if (isCompressed && !needCompressed) {
|
||||
const localUtils = this._connection.localUtils();
|
||||
if (!localUtils)
|
||||
throw new Error("Uncompressed har is not supported in thin clients");
|
||||
await artifact.saveAs(harParams.path + ".tmp");
|
||||
await localUtils.harUnzip({ zipFile: harParams.path + ".tmp", harFile: harParams.path });
|
||||
} else {
|
||||
await artifact.saveAs(harParams.path);
|
||||
}
|
||||
await artifact.delete();
|
||||
}
|
||||
}, { internal: true });
|
||||
await this._channel.close(options);
|
||||
await this._closedPromise;
|
||||
}
|
||||
async _enableRecorder(params, eventSink) {
|
||||
if (eventSink)
|
||||
this._onRecorderEventSink = eventSink;
|
||||
await this._channel.enableRecorder(params);
|
||||
}
|
||||
async _disableRecorder() {
|
||||
this._onRecorderEventSink = void 0;
|
||||
await this._channel.disableRecorder();
|
||||
}
|
||||
async _exposeConsoleApi() {
|
||||
await this._channel.exposeConsoleApi();
|
||||
}
|
||||
_setAllowedProtocols(protocols) {
|
||||
this._allowedProtocols = protocols;
|
||||
}
|
||||
_checkUrlAllowed(url) {
|
||||
if (!this._allowedProtocols)
|
||||
return;
|
||||
let parsedURL;
|
||||
try {
|
||||
parsedURL = new URL(url);
|
||||
} catch (e) {
|
||||
throw new Error(`Access to ${url} is blocked. Invalid URL: ${e.message}`);
|
||||
}
|
||||
if (!this._allowedProtocols.includes(parsedURL.protocol))
|
||||
throw new Error(`Access to "${parsedURL.protocol}" URL is blocked. Allowed protocols: ${this._allowedProtocols.join(", ")}. Attempted URL: ${url}`);
|
||||
}
|
||||
_setAllowedDirectories(rootDirectories) {
|
||||
this._allowedDirectories = rootDirectories;
|
||||
}
|
||||
_checkFileAccess(filePath) {
|
||||
if (!this._allowedDirectories)
|
||||
return;
|
||||
const path = this._platform.path().resolve(filePath);
|
||||
const isInsideDir = (container, child) => {
|
||||
const path2 = this._platform.path();
|
||||
const rel = path2.relative(container, child);
|
||||
return !!rel && !rel.startsWith("..") && !path2.isAbsolute(rel);
|
||||
};
|
||||
if (this._allowedDirectories.some((root) => isInsideDir(root, path)))
|
||||
return;
|
||||
throw new Error(`File access denied: ${filePath} is outside allowed roots. Allowed roots: ${this._allowedDirectories.length ? this._allowedDirectories.join(", ") : "none"}`);
|
||||
}
|
||||
}
|
||||
async function prepareStorageState(platform, storageState) {
|
||||
if (typeof storageState !== "string")
|
||||
return storageState;
|
||||
try {
|
||||
return JSON.parse(await platform.fs().promises.readFile(storageState, "utf8"));
|
||||
} catch (e) {
|
||||
(0, import_stackTrace.rewriteErrorMessage)(e, `Error reading storage state from ${storageState}:
|
||||
` + e.message);
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
async function prepareBrowserContextParams(platform, options) {
|
||||
if (options.videoSize && !options.videosPath)
|
||||
throw new Error(`"videoSize" option requires "videosPath" to be specified`);
|
||||
if (options.extraHTTPHeaders)
|
||||
network.validateHeaders(options.extraHTTPHeaders);
|
||||
const contextParams = {
|
||||
...options,
|
||||
viewport: options.viewport === null ? void 0 : options.viewport,
|
||||
noDefaultViewport: options.viewport === null,
|
||||
extraHTTPHeaders: options.extraHTTPHeaders ? (0, import_headers.headersObjectToArray)(options.extraHTTPHeaders) : void 0,
|
||||
storageState: options.storageState ? await prepareStorageState(platform, options.storageState) : void 0,
|
||||
serviceWorkers: options.serviceWorkers,
|
||||
colorScheme: options.colorScheme === null ? "no-override" : options.colorScheme,
|
||||
reducedMotion: options.reducedMotion === null ? "no-override" : options.reducedMotion,
|
||||
forcedColors: options.forcedColors === null ? "no-override" : options.forcedColors,
|
||||
contrast: options.contrast === null ? "no-override" : options.contrast,
|
||||
acceptDownloads: toAcceptDownloadsProtocol(options.acceptDownloads),
|
||||
clientCertificates: await toClientCertificatesProtocol(platform, options.clientCertificates)
|
||||
};
|
||||
if (!contextParams.recordVideo && options.videosPath) {
|
||||
contextParams.recordVideo = {
|
||||
dir: options.videosPath,
|
||||
size: options.videoSize
|
||||
};
|
||||
}
|
||||
if (contextParams.recordVideo && contextParams.recordVideo.dir)
|
||||
contextParams.recordVideo.dir = platform.path().resolve(contextParams.recordVideo.dir);
|
||||
return contextParams;
|
||||
}
|
||||
function toAcceptDownloadsProtocol(acceptDownloads) {
|
||||
if (acceptDownloads === void 0)
|
||||
return void 0;
|
||||
if (acceptDownloads)
|
||||
return "accept";
|
||||
return "deny";
|
||||
}
|
||||
async function toClientCertificatesProtocol(platform, certs) {
|
||||
if (!certs)
|
||||
return void 0;
|
||||
const bufferizeContent = async (value, path) => {
|
||||
if (value)
|
||||
return value;
|
||||
if (path)
|
||||
return await platform.fs().promises.readFile(path);
|
||||
};
|
||||
return await Promise.all(certs.map(async (cert) => ({
|
||||
origin: cert.origin,
|
||||
cert: await bufferizeContent(cert.cert, cert.certPath),
|
||||
key: await bufferizeContent(cert.key, cert.keyPath),
|
||||
pfx: await bufferizeContent(cert.pfx, cert.pfxPath),
|
||||
passphrase: cert.passphrase
|
||||
})));
|
||||
}
|
||||
// Annotate the CommonJS export names for ESM import in node:
|
||||
0 && (module.exports = {
|
||||
BrowserContext,
|
||||
prepareBrowserContextParams,
|
||||
toClientCertificatesProtocol
|
||||
});
|
||||
185
projects/org-skill-web-research/node_modules/playwright-core/lib/client/browserType.js
generated
vendored
Normal file
185
projects/org-skill-web-research/node_modules/playwright-core/lib/client/browserType.js
generated
vendored
Normal file
@@ -0,0 +1,185 @@
|
||||
"use strict";
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var browserType_exports = {};
|
||||
__export(browserType_exports, {
|
||||
BrowserType: () => BrowserType
|
||||
});
|
||||
module.exports = __toCommonJS(browserType_exports);
|
||||
var import_browser = require("./browser");
|
||||
var import_browserContext = require("./browserContext");
|
||||
var import_channelOwner = require("./channelOwner");
|
||||
var import_clientHelper = require("./clientHelper");
|
||||
var import_events = require("./events");
|
||||
var import_assert = require("../utils/isomorphic/assert");
|
||||
var import_headers = require("../utils/isomorphic/headers");
|
||||
var import_time = require("../utils/isomorphic/time");
|
||||
var import_timeoutRunner = require("../utils/isomorphic/timeoutRunner");
|
||||
var import_webSocket = require("./webSocket");
|
||||
var import_timeoutSettings = require("./timeoutSettings");
|
||||
class BrowserType extends import_channelOwner.ChannelOwner {
|
||||
constructor() {
|
||||
super(...arguments);
|
||||
this._contexts = /* @__PURE__ */ new Set();
|
||||
}
|
||||
static from(browserType) {
|
||||
return browserType._object;
|
||||
}
|
||||
executablePath() {
|
||||
if (!this._initializer.executablePath)
|
||||
throw new Error("Browser is not supported on current platform");
|
||||
return this._initializer.executablePath;
|
||||
}
|
||||
name() {
|
||||
return this._initializer.name;
|
||||
}
|
||||
async launch(options = {}) {
|
||||
(0, import_assert.assert)(!options.userDataDir, "userDataDir option is not supported in `browserType.launch`. Use `browserType.launchPersistentContext` instead");
|
||||
(0, import_assert.assert)(!options.port, "Cannot specify a port without launching as a server.");
|
||||
const logger = options.logger || this._playwright._defaultLaunchOptions?.logger;
|
||||
options = { ...this._playwright._defaultLaunchOptions, ...options };
|
||||
const launchOptions = {
|
||||
...options,
|
||||
ignoreDefaultArgs: Array.isArray(options.ignoreDefaultArgs) ? options.ignoreDefaultArgs : void 0,
|
||||
ignoreAllDefaultArgs: !!options.ignoreDefaultArgs && !Array.isArray(options.ignoreDefaultArgs),
|
||||
env: options.env ? (0, import_clientHelper.envObjectToArray)(options.env) : void 0,
|
||||
timeout: new import_timeoutSettings.TimeoutSettings(this._platform).launchTimeout(options)
|
||||
};
|
||||
return await this._wrapApiCall(async () => {
|
||||
const browser = import_browser.Browser.from((await this._channel.launch(launchOptions)).browser);
|
||||
browser._connectToBrowserType(this, options, logger);
|
||||
return browser;
|
||||
});
|
||||
}
|
||||
async launchServer(options = {}) {
|
||||
if (!this._serverLauncher)
|
||||
throw new Error("Launching server is not supported");
|
||||
options = { ...this._playwright._defaultLaunchOptions, ...options };
|
||||
return await this._serverLauncher.launchServer(options);
|
||||
}
|
||||
async launchPersistentContext(userDataDir, options = {}) {
|
||||
(0, import_assert.assert)(!options.port, "Cannot specify a port without launching as a server.");
|
||||
options = this._playwright.selectors._withSelectorOptions({
|
||||
...this._playwright._defaultLaunchOptions,
|
||||
...options
|
||||
});
|
||||
await this._instrumentation.runBeforeCreateBrowserContext(options);
|
||||
const logger = options.logger || this._playwright._defaultLaunchOptions?.logger;
|
||||
const contextParams = await (0, import_browserContext.prepareBrowserContextParams)(this._platform, options);
|
||||
const persistentParams = {
|
||||
...contextParams,
|
||||
ignoreDefaultArgs: Array.isArray(options.ignoreDefaultArgs) ? options.ignoreDefaultArgs : void 0,
|
||||
ignoreAllDefaultArgs: !!options.ignoreDefaultArgs && !Array.isArray(options.ignoreDefaultArgs),
|
||||
env: options.env ? (0, import_clientHelper.envObjectToArray)(options.env) : void 0,
|
||||
channel: options.channel,
|
||||
userDataDir: this._platform.path().isAbsolute(userDataDir) || !userDataDir ? userDataDir : this._platform.path().resolve(userDataDir),
|
||||
timeout: new import_timeoutSettings.TimeoutSettings(this._platform).launchTimeout(options)
|
||||
};
|
||||
const context = await this._wrapApiCall(async () => {
|
||||
const result = await this._channel.launchPersistentContext(persistentParams);
|
||||
const browser = import_browser.Browser.from(result.browser);
|
||||
browser._connectToBrowserType(this, options, logger);
|
||||
const context2 = import_browserContext.BrowserContext.from(result.context);
|
||||
await context2._initializeHarFromOptions(options.recordHar);
|
||||
return context2;
|
||||
});
|
||||
await this._instrumentation.runAfterCreateBrowserContext(context);
|
||||
return context;
|
||||
}
|
||||
async connect(optionsOrWsEndpoint, options) {
|
||||
if (typeof optionsOrWsEndpoint === "string")
|
||||
return await this._connect({ ...options, wsEndpoint: optionsOrWsEndpoint });
|
||||
(0, import_assert.assert)(optionsOrWsEndpoint.wsEndpoint, "options.wsEndpoint is required");
|
||||
return await this._connect(optionsOrWsEndpoint);
|
||||
}
|
||||
async _connect(params) {
|
||||
const logger = params.logger;
|
||||
return await this._wrapApiCall(async () => {
|
||||
const deadline = params.timeout ? (0, import_time.monotonicTime)() + params.timeout : 0;
|
||||
const headers = { "x-playwright-browser": this.name(), ...params.headers };
|
||||
const connectParams = {
|
||||
wsEndpoint: params.wsEndpoint,
|
||||
headers,
|
||||
exposeNetwork: params.exposeNetwork ?? params._exposeNetwork,
|
||||
slowMo: params.slowMo,
|
||||
timeout: params.timeout || 0
|
||||
};
|
||||
if (params.__testHookRedirectPortForwarding)
|
||||
connectParams.socksProxyRedirectPortForTest = params.__testHookRedirectPortForwarding;
|
||||
const connection = await (0, import_webSocket.connectOverWebSocket)(this._connection, connectParams);
|
||||
let browser;
|
||||
connection.on("close", () => {
|
||||
for (const context of browser?.contexts() || []) {
|
||||
for (const page of context.pages())
|
||||
page._onClose();
|
||||
context._onClose();
|
||||
}
|
||||
setTimeout(() => browser?._didClose(), 0);
|
||||
});
|
||||
const result = await (0, import_timeoutRunner.raceAgainstDeadline)(async () => {
|
||||
if (params.__testHookBeforeCreateBrowser)
|
||||
await params.__testHookBeforeCreateBrowser();
|
||||
const playwright = await connection.initializePlaywright();
|
||||
if (!playwright._initializer.preLaunchedBrowser) {
|
||||
connection.close();
|
||||
throw new Error("Malformed endpoint. Did you use BrowserType.launchServer method?");
|
||||
}
|
||||
playwright.selectors = this._playwright.selectors;
|
||||
browser = import_browser.Browser.from(playwright._initializer.preLaunchedBrowser);
|
||||
browser._connectToBrowserType(this, {}, logger);
|
||||
browser._shouldCloseConnectionOnClose = true;
|
||||
browser.on(import_events.Events.Browser.Disconnected, () => connection.close());
|
||||
return browser;
|
||||
}, deadline);
|
||||
if (!result.timedOut) {
|
||||
return result.result;
|
||||
} else {
|
||||
connection.close();
|
||||
throw new Error(`Timeout ${params.timeout}ms exceeded`);
|
||||
}
|
||||
});
|
||||
}
|
||||
async connectOverCDP(endpointURLOrOptions, options) {
|
||||
if (typeof endpointURLOrOptions === "string")
|
||||
return await this._connectOverCDP(endpointURLOrOptions, options);
|
||||
const endpointURL = "endpointURL" in endpointURLOrOptions ? endpointURLOrOptions.endpointURL : endpointURLOrOptions.wsEndpoint;
|
||||
(0, import_assert.assert)(endpointURL, "Cannot connect over CDP without wsEndpoint.");
|
||||
return await this.connectOverCDP(endpointURL, endpointURLOrOptions);
|
||||
}
|
||||
async _connectOverCDP(endpointURL, params = {}) {
|
||||
if (this.name() !== "chromium")
|
||||
throw new Error("Connecting over CDP is only supported in Chromium.");
|
||||
const headers = params.headers ? (0, import_headers.headersObjectToArray)(params.headers) : void 0;
|
||||
const result = await this._channel.connectOverCDP({
|
||||
endpointURL,
|
||||
headers,
|
||||
slowMo: params.slowMo,
|
||||
timeout: new import_timeoutSettings.TimeoutSettings(this._platform).timeout(params),
|
||||
isLocal: params.isLocal
|
||||
});
|
||||
const browser = import_browser.Browser.from(result.browser);
|
||||
browser._connectToBrowserType(this, {}, params.logger);
|
||||
if (result.defaultContext)
|
||||
await this._instrumentation.runAfterCreateBrowserContext(import_browserContext.BrowserContext.from(result.defaultContext));
|
||||
return browser;
|
||||
}
|
||||
}
|
||||
// Annotate the CommonJS export names for ESM import in node:
|
||||
0 && (module.exports = {
|
||||
BrowserType
|
||||
});
|
||||
51
projects/org-skill-web-research/node_modules/playwright-core/lib/client/cdpSession.js
generated
vendored
Normal file
51
projects/org-skill-web-research/node_modules/playwright-core/lib/client/cdpSession.js
generated
vendored
Normal file
@@ -0,0 +1,51 @@
|
||||
"use strict";
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var cdpSession_exports = {};
|
||||
__export(cdpSession_exports, {
|
||||
CDPSession: () => CDPSession
|
||||
});
|
||||
module.exports = __toCommonJS(cdpSession_exports);
|
||||
var import_channelOwner = require("./channelOwner");
|
||||
class CDPSession extends import_channelOwner.ChannelOwner {
|
||||
static from(cdpSession) {
|
||||
return cdpSession._object;
|
||||
}
|
||||
constructor(parent, type, guid, initializer) {
|
||||
super(parent, type, guid, initializer);
|
||||
this._channel.on("event", ({ method, params }) => {
|
||||
this.emit(method, params);
|
||||
});
|
||||
this.on = super.on;
|
||||
this.addListener = super.addListener;
|
||||
this.off = super.removeListener;
|
||||
this.removeListener = super.removeListener;
|
||||
this.once = super.once;
|
||||
}
|
||||
async send(method, params) {
|
||||
const result = await this._channel.send({ method, params });
|
||||
return result.result;
|
||||
}
|
||||
async detach() {
|
||||
return await this._channel.detach();
|
||||
}
|
||||
}
|
||||
// Annotate the CommonJS export names for ESM import in node:
|
||||
0 && (module.exports = {
|
||||
CDPSession
|
||||
});
|
||||
194
projects/org-skill-web-research/node_modules/playwright-core/lib/client/channelOwner.js
generated
vendored
Normal file
194
projects/org-skill-web-research/node_modules/playwright-core/lib/client/channelOwner.js
generated
vendored
Normal file
@@ -0,0 +1,194 @@
|
||||
"use strict";
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var channelOwner_exports = {};
|
||||
__export(channelOwner_exports, {
|
||||
ChannelOwner: () => ChannelOwner
|
||||
});
|
||||
module.exports = __toCommonJS(channelOwner_exports);
|
||||
var import_eventEmitter = require("./eventEmitter");
|
||||
var import_validator = require("../protocol/validator");
|
||||
var import_protocolMetainfo = require("../utils/isomorphic/protocolMetainfo");
|
||||
var import_clientStackTrace = require("./clientStackTrace");
|
||||
var import_stackTrace = require("../utils/isomorphic/stackTrace");
|
||||
class ChannelOwner extends import_eventEmitter.EventEmitter {
|
||||
constructor(parent, type, guid, initializer) {
|
||||
const connection = parent instanceof ChannelOwner ? parent._connection : parent;
|
||||
super(connection._platform);
|
||||
this._objects = /* @__PURE__ */ new Map();
|
||||
this._eventToSubscriptionMapping = /* @__PURE__ */ new Map();
|
||||
this._wasCollected = false;
|
||||
this.setMaxListeners(0);
|
||||
this._connection = connection;
|
||||
this._type = type;
|
||||
this._guid = guid;
|
||||
this._parent = parent instanceof ChannelOwner ? parent : void 0;
|
||||
this._instrumentation = this._connection._instrumentation;
|
||||
this._connection._objects.set(guid, this);
|
||||
if (this._parent) {
|
||||
this._parent._objects.set(guid, this);
|
||||
this._logger = this._parent._logger;
|
||||
}
|
||||
this._channel = this._createChannel(new import_eventEmitter.EventEmitter(connection._platform));
|
||||
this._initializer = initializer;
|
||||
}
|
||||
_setEventToSubscriptionMapping(mapping) {
|
||||
this._eventToSubscriptionMapping = mapping;
|
||||
}
|
||||
_updateSubscription(event, enabled) {
|
||||
const protocolEvent = this._eventToSubscriptionMapping.get(String(event));
|
||||
if (protocolEvent)
|
||||
this._channel.updateSubscription({ event: protocolEvent, enabled }).catch(() => {
|
||||
});
|
||||
}
|
||||
on(event, listener) {
|
||||
if (!this.listenerCount(event))
|
||||
this._updateSubscription(event, true);
|
||||
super.on(event, listener);
|
||||
return this;
|
||||
}
|
||||
addListener(event, listener) {
|
||||
if (!this.listenerCount(event))
|
||||
this._updateSubscription(event, true);
|
||||
super.addListener(event, listener);
|
||||
return this;
|
||||
}
|
||||
prependListener(event, listener) {
|
||||
if (!this.listenerCount(event))
|
||||
this._updateSubscription(event, true);
|
||||
super.prependListener(event, listener);
|
||||
return this;
|
||||
}
|
||||
off(event, listener) {
|
||||
super.off(event, listener);
|
||||
if (!this.listenerCount(event))
|
||||
this._updateSubscription(event, false);
|
||||
return this;
|
||||
}
|
||||
removeListener(event, listener) {
|
||||
super.removeListener(event, listener);
|
||||
if (!this.listenerCount(event))
|
||||
this._updateSubscription(event, false);
|
||||
return this;
|
||||
}
|
||||
_adopt(child) {
|
||||
child._parent._objects.delete(child._guid);
|
||||
this._objects.set(child._guid, child);
|
||||
child._parent = this;
|
||||
}
|
||||
_dispose(reason) {
|
||||
if (this._parent)
|
||||
this._parent._objects.delete(this._guid);
|
||||
this._connection._objects.delete(this._guid);
|
||||
this._wasCollected = reason === "gc";
|
||||
for (const object of [...this._objects.values()])
|
||||
object._dispose(reason);
|
||||
this._objects.clear();
|
||||
}
|
||||
_debugScopeState() {
|
||||
return {
|
||||
_guid: this._guid,
|
||||
objects: Array.from(this._objects.values()).map((o) => o._debugScopeState())
|
||||
};
|
||||
}
|
||||
_validatorToWireContext() {
|
||||
return {
|
||||
tChannelImpl: tChannelImplToWire,
|
||||
binary: this._connection.rawBuffers() ? "buffer" : "toBase64",
|
||||
isUnderTest: () => this._platform.isUnderTest()
|
||||
};
|
||||
}
|
||||
_createChannel(base) {
|
||||
const channel = new Proxy(base, {
|
||||
get: (obj, prop) => {
|
||||
if (typeof prop === "string") {
|
||||
const validator = (0, import_validator.maybeFindValidator)(this._type, prop, "Params");
|
||||
const { internal } = import_protocolMetainfo.methodMetainfo.get(this._type + "." + prop) || {};
|
||||
if (validator) {
|
||||
return async (params) => {
|
||||
return await this._wrapApiCall(async (apiZone) => {
|
||||
const validatedParams = validator(params, "", this._validatorToWireContext());
|
||||
if (!apiZone.internal && !apiZone.reported) {
|
||||
apiZone.reported = true;
|
||||
this._instrumentation.onApiCallBegin(apiZone, { type: this._type, method: prop, params });
|
||||
logApiCall(this._platform, this._logger, `=> ${apiZone.apiName} started`);
|
||||
return await this._connection.sendMessageToServer(this, prop, validatedParams, apiZone);
|
||||
}
|
||||
return await this._connection.sendMessageToServer(this, prop, validatedParams, { internal: true });
|
||||
}, { internal });
|
||||
};
|
||||
}
|
||||
}
|
||||
return obj[prop];
|
||||
}
|
||||
});
|
||||
channel._object = this;
|
||||
return channel;
|
||||
}
|
||||
async _wrapApiCall(func, options) {
|
||||
const logger = this._logger;
|
||||
const existingApiZone = this._platform.zones.current().data();
|
||||
if (existingApiZone)
|
||||
return await func(existingApiZone);
|
||||
const stackTrace = (0, import_clientStackTrace.captureLibraryStackTrace)(this._platform);
|
||||
const apiZone = { title: options?.title, apiName: stackTrace.apiName, frames: stackTrace.frames, internal: options?.internal ?? false, reported: false, userData: void 0, stepId: void 0 };
|
||||
try {
|
||||
const result = await this._platform.zones.current().push(apiZone).run(async () => await func(apiZone));
|
||||
if (!options?.internal) {
|
||||
logApiCall(this._platform, logger, `<= ${apiZone.apiName} succeeded`);
|
||||
this._instrumentation.onApiCallEnd(apiZone);
|
||||
}
|
||||
return result;
|
||||
} catch (e) {
|
||||
const innerError = (this._platform.showInternalStackFrames() || this._platform.isUnderTest()) && e.stack ? "\n<inner error>\n" + e.stack : "";
|
||||
if (apiZone.apiName && !apiZone.apiName.includes("<anonymous>"))
|
||||
e.message = apiZone.apiName + ": " + e.message;
|
||||
const stackFrames = "\n" + (0, import_stackTrace.stringifyStackFrames)(stackTrace.frames).join("\n") + innerError;
|
||||
if (stackFrames.trim())
|
||||
e.stack = e.message + stackFrames;
|
||||
else
|
||||
e.stack = "";
|
||||
if (!options?.internal) {
|
||||
apiZone.error = e;
|
||||
logApiCall(this._platform, logger, `<= ${apiZone.apiName} failed`);
|
||||
this._instrumentation.onApiCallEnd(apiZone);
|
||||
}
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
toJSON() {
|
||||
return {
|
||||
_type: this._type,
|
||||
_guid: this._guid
|
||||
};
|
||||
}
|
||||
}
|
||||
function logApiCall(platform, logger, message) {
|
||||
if (logger && logger.isEnabled("api", "info"))
|
||||
logger.log("api", "info", message, [], { color: "cyan" });
|
||||
platform.log("api", message);
|
||||
}
|
||||
function tChannelImplToWire(names, arg, path, context) {
|
||||
if (arg._object instanceof ChannelOwner && (names === "*" || names.includes(arg._object._type)))
|
||||
return { guid: arg._object._guid };
|
||||
throw new import_validator.ValidationError(`${path}: expected channel ${names.toString()}`);
|
||||
}
|
||||
// Annotate the CommonJS export names for ESM import in node:
|
||||
0 && (module.exports = {
|
||||
ChannelOwner
|
||||
});
|
||||
64
projects/org-skill-web-research/node_modules/playwright-core/lib/client/clientHelper.js
generated
vendored
Normal file
64
projects/org-skill-web-research/node_modules/playwright-core/lib/client/clientHelper.js
generated
vendored
Normal file
@@ -0,0 +1,64 @@
|
||||
"use strict";
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var clientHelper_exports = {};
|
||||
__export(clientHelper_exports, {
|
||||
addSourceUrlToScript: () => addSourceUrlToScript,
|
||||
envObjectToArray: () => envObjectToArray,
|
||||
evaluationScript: () => evaluationScript
|
||||
});
|
||||
module.exports = __toCommonJS(clientHelper_exports);
|
||||
var import_rtti = require("../utils/isomorphic/rtti");
|
||||
function envObjectToArray(env) {
|
||||
const result = [];
|
||||
for (const name in env) {
|
||||
if (!Object.is(env[name], void 0))
|
||||
result.push({ name, value: String(env[name]) });
|
||||
}
|
||||
return result;
|
||||
}
|
||||
async function evaluationScript(platform, fun, arg, addSourceUrl = true) {
|
||||
if (typeof fun === "function") {
|
||||
const source = fun.toString();
|
||||
const argString = Object.is(arg, void 0) ? "undefined" : JSON.stringify(arg);
|
||||
return `(${source})(${argString})`;
|
||||
}
|
||||
if (arg !== void 0)
|
||||
throw new Error("Cannot evaluate a string with arguments");
|
||||
if ((0, import_rtti.isString)(fun))
|
||||
return fun;
|
||||
if (fun.content !== void 0)
|
||||
return fun.content;
|
||||
if (fun.path !== void 0) {
|
||||
let source = await platform.fs().promises.readFile(fun.path, "utf8");
|
||||
if (addSourceUrl)
|
||||
source = addSourceUrlToScript(source, fun.path);
|
||||
return source;
|
||||
}
|
||||
throw new Error("Either path or content property must be present");
|
||||
}
|
||||
function addSourceUrlToScript(source, path) {
|
||||
return `${source}
|
||||
//# sourceURL=${path.replace(/\n/g, "")}`;
|
||||
}
|
||||
// Annotate the CommonJS export names for ESM import in node:
|
||||
0 && (module.exports = {
|
||||
addSourceUrlToScript,
|
||||
envObjectToArray,
|
||||
evaluationScript
|
||||
});
|
||||
55
projects/org-skill-web-research/node_modules/playwright-core/lib/client/clientInstrumentation.js
generated
vendored
Normal file
55
projects/org-skill-web-research/node_modules/playwright-core/lib/client/clientInstrumentation.js
generated
vendored
Normal file
@@ -0,0 +1,55 @@
|
||||
"use strict";
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var clientInstrumentation_exports = {};
|
||||
__export(clientInstrumentation_exports, {
|
||||
createInstrumentation: () => createInstrumentation
|
||||
});
|
||||
module.exports = __toCommonJS(clientInstrumentation_exports);
|
||||
function createInstrumentation() {
|
||||
const listeners = [];
|
||||
return new Proxy({}, {
|
||||
get: (obj, prop) => {
|
||||
if (typeof prop !== "string")
|
||||
return obj[prop];
|
||||
if (prop === "addListener")
|
||||
return (listener) => listeners.push(listener);
|
||||
if (prop === "removeListener")
|
||||
return (listener) => listeners.splice(listeners.indexOf(listener), 1);
|
||||
if (prop === "removeAllListeners")
|
||||
return () => listeners.splice(0, listeners.length);
|
||||
if (prop.startsWith("run")) {
|
||||
return async (...params) => {
|
||||
for (const listener of listeners)
|
||||
await listener[prop]?.(...params);
|
||||
};
|
||||
}
|
||||
if (prop.startsWith("on")) {
|
||||
return (...params) => {
|
||||
for (const listener of listeners)
|
||||
listener[prop]?.(...params);
|
||||
};
|
||||
}
|
||||
return obj[prop];
|
||||
}
|
||||
});
|
||||
}
|
||||
// Annotate the CommonJS export names for ESM import in node:
|
||||
0 && (module.exports = {
|
||||
createInstrumentation
|
||||
});
|
||||
69
projects/org-skill-web-research/node_modules/playwright-core/lib/client/clientStackTrace.js
generated
vendored
Normal file
69
projects/org-skill-web-research/node_modules/playwright-core/lib/client/clientStackTrace.js
generated
vendored
Normal file
@@ -0,0 +1,69 @@
|
||||
"use strict";
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var clientStackTrace_exports = {};
|
||||
__export(clientStackTrace_exports, {
|
||||
captureLibraryStackTrace: () => captureLibraryStackTrace
|
||||
});
|
||||
module.exports = __toCommonJS(clientStackTrace_exports);
|
||||
var import_stackTrace = require("../utils/isomorphic/stackTrace");
|
||||
function captureLibraryStackTrace(platform) {
|
||||
const stack = (0, import_stackTrace.captureRawStack)();
|
||||
let parsedFrames = stack.map((line) => {
|
||||
const frame = (0, import_stackTrace.parseStackFrame)(line, platform.pathSeparator, platform.showInternalStackFrames());
|
||||
if (!frame || !frame.file)
|
||||
return null;
|
||||
const isPlaywrightLibrary = !!platform.coreDir && frame.file.startsWith(platform.coreDir);
|
||||
const parsed = {
|
||||
frame,
|
||||
frameText: line,
|
||||
isPlaywrightLibrary
|
||||
};
|
||||
return parsed;
|
||||
}).filter(Boolean);
|
||||
let apiName = "";
|
||||
for (let i = 0; i < parsedFrames.length - 1; i++) {
|
||||
const parsedFrame = parsedFrames[i];
|
||||
if (parsedFrame.isPlaywrightLibrary && !parsedFrames[i + 1].isPlaywrightLibrary) {
|
||||
apiName = apiName || normalizeAPIName(parsedFrame.frame.function);
|
||||
break;
|
||||
}
|
||||
}
|
||||
function normalizeAPIName(name) {
|
||||
if (!name)
|
||||
return "";
|
||||
const match = name.match(/(API|JS|CDP|[A-Z])(.*)/);
|
||||
if (!match)
|
||||
return name;
|
||||
return match[1].toLowerCase() + match[2];
|
||||
}
|
||||
const filterPrefixes = platform.boxedStackPrefixes();
|
||||
parsedFrames = parsedFrames.filter((f) => {
|
||||
if (filterPrefixes.some((prefix) => f.frame.file.startsWith(prefix)))
|
||||
return false;
|
||||
return true;
|
||||
});
|
||||
return {
|
||||
frames: parsedFrames.map((p) => p.frame),
|
||||
apiName
|
||||
};
|
||||
}
|
||||
// Annotate the CommonJS export names for ESM import in node:
|
||||
0 && (module.exports = {
|
||||
captureLibraryStackTrace
|
||||
});
|
||||
68
projects/org-skill-web-research/node_modules/playwright-core/lib/client/clock.js
generated
vendored
Normal file
68
projects/org-skill-web-research/node_modules/playwright-core/lib/client/clock.js
generated
vendored
Normal file
@@ -0,0 +1,68 @@
|
||||
"use strict";
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var clock_exports = {};
|
||||
__export(clock_exports, {
|
||||
Clock: () => Clock
|
||||
});
|
||||
module.exports = __toCommonJS(clock_exports);
|
||||
class Clock {
|
||||
constructor(browserContext) {
|
||||
this._browserContext = browserContext;
|
||||
}
|
||||
async install(options = {}) {
|
||||
await this._browserContext._channel.clockInstall(options.time !== void 0 ? parseTime(options.time) : {});
|
||||
}
|
||||
async fastForward(ticks) {
|
||||
await this._browserContext._channel.clockFastForward(parseTicks(ticks));
|
||||
}
|
||||
async pauseAt(time) {
|
||||
await this._browserContext._channel.clockPauseAt(parseTime(time));
|
||||
}
|
||||
async resume() {
|
||||
await this._browserContext._channel.clockResume({});
|
||||
}
|
||||
async runFor(ticks) {
|
||||
await this._browserContext._channel.clockRunFor(parseTicks(ticks));
|
||||
}
|
||||
async setFixedTime(time) {
|
||||
await this._browserContext._channel.clockSetFixedTime(parseTime(time));
|
||||
}
|
||||
async setSystemTime(time) {
|
||||
await this._browserContext._channel.clockSetSystemTime(parseTime(time));
|
||||
}
|
||||
}
|
||||
function parseTime(time) {
|
||||
if (typeof time === "number")
|
||||
return { timeNumber: time };
|
||||
if (typeof time === "string")
|
||||
return { timeString: time };
|
||||
if (!isFinite(time.getTime()))
|
||||
throw new Error(`Invalid date: ${time}`);
|
||||
return { timeNumber: time.getTime() };
|
||||
}
|
||||
function parseTicks(ticks) {
|
||||
return {
|
||||
ticksNumber: typeof ticks === "number" ? ticks : void 0,
|
||||
ticksString: typeof ticks === "string" ? ticks : void 0
|
||||
};
|
||||
}
|
||||
// Annotate the CommonJS export names for ESM import in node:
|
||||
0 && (module.exports = {
|
||||
Clock
|
||||
});
|
||||
318
projects/org-skill-web-research/node_modules/playwright-core/lib/client/connection.js
generated
vendored
Normal file
318
projects/org-skill-web-research/node_modules/playwright-core/lib/client/connection.js
generated
vendored
Normal file
@@ -0,0 +1,318 @@
|
||||
"use strict";
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var connection_exports = {};
|
||||
__export(connection_exports, {
|
||||
Connection: () => Connection
|
||||
});
|
||||
module.exports = __toCommonJS(connection_exports);
|
||||
var import_eventEmitter = require("./eventEmitter");
|
||||
var import_android = require("./android");
|
||||
var import_artifact = require("./artifact");
|
||||
var import_browser = require("./browser");
|
||||
var import_browserContext = require("./browserContext");
|
||||
var import_browserType = require("./browserType");
|
||||
var import_cdpSession = require("./cdpSession");
|
||||
var import_channelOwner = require("./channelOwner");
|
||||
var import_clientInstrumentation = require("./clientInstrumentation");
|
||||
var import_dialog = require("./dialog");
|
||||
var import_electron = require("./electron");
|
||||
var import_elementHandle = require("./elementHandle");
|
||||
var import_errors = require("./errors");
|
||||
var import_fetch = require("./fetch");
|
||||
var import_frame = require("./frame");
|
||||
var import_jsHandle = require("./jsHandle");
|
||||
var import_jsonPipe = require("./jsonPipe");
|
||||
var import_localUtils = require("./localUtils");
|
||||
var import_network = require("./network");
|
||||
var import_page = require("./page");
|
||||
var import_playwright = require("./playwright");
|
||||
var import_stream = require("./stream");
|
||||
var import_tracing = require("./tracing");
|
||||
var import_worker = require("./worker");
|
||||
var import_writableStream = require("./writableStream");
|
||||
var import_validator = require("../protocol/validator");
|
||||
var import_stackTrace = require("../utils/isomorphic/stackTrace");
|
||||
var import_pageAgent = require("./pageAgent");
|
||||
class Root extends import_channelOwner.ChannelOwner {
|
||||
constructor(connection) {
|
||||
super(connection, "Root", "", {});
|
||||
}
|
||||
async initialize() {
|
||||
return import_playwright.Playwright.from((await this._channel.initialize({
|
||||
sdkLanguage: "javascript"
|
||||
})).playwright);
|
||||
}
|
||||
}
|
||||
class DummyChannelOwner extends import_channelOwner.ChannelOwner {
|
||||
}
|
||||
class Connection extends import_eventEmitter.EventEmitter {
|
||||
constructor(platform, localUtils, instrumentation, headers = []) {
|
||||
super(platform);
|
||||
this._objects = /* @__PURE__ */ new Map();
|
||||
this.onmessage = (message) => {
|
||||
};
|
||||
this._lastId = 0;
|
||||
this._callbacks = /* @__PURE__ */ new Map();
|
||||
this._isRemote = false;
|
||||
this._rawBuffers = false;
|
||||
this._tracingCount = 0;
|
||||
this._instrumentation = instrumentation || (0, import_clientInstrumentation.createInstrumentation)();
|
||||
this._localUtils = localUtils;
|
||||
this._rootObject = new Root(this);
|
||||
this.headers = headers;
|
||||
}
|
||||
markAsRemote() {
|
||||
this._isRemote = true;
|
||||
}
|
||||
isRemote() {
|
||||
return this._isRemote;
|
||||
}
|
||||
useRawBuffers() {
|
||||
this._rawBuffers = true;
|
||||
}
|
||||
rawBuffers() {
|
||||
return this._rawBuffers;
|
||||
}
|
||||
localUtils() {
|
||||
return this._localUtils;
|
||||
}
|
||||
async initializePlaywright() {
|
||||
return await this._rootObject.initialize();
|
||||
}
|
||||
getObjectWithKnownName(guid) {
|
||||
return this._objects.get(guid);
|
||||
}
|
||||
setIsTracing(isTracing) {
|
||||
if (isTracing)
|
||||
this._tracingCount++;
|
||||
else
|
||||
this._tracingCount--;
|
||||
}
|
||||
async sendMessageToServer(object, method, params, options) {
|
||||
if (this._closedError)
|
||||
throw this._closedError;
|
||||
if (object._wasCollected)
|
||||
throw new Error("The object has been collected to prevent unbounded heap growth.");
|
||||
const guid = object._guid;
|
||||
const type = object._type;
|
||||
const id = ++this._lastId;
|
||||
const message = { id, guid, method, params };
|
||||
if (this._platform.isLogEnabled("channel")) {
|
||||
this._platform.log("channel", "SEND> " + JSON.stringify(message));
|
||||
}
|
||||
const location = options.frames?.[0] ? { file: options.frames[0].file, line: options.frames[0].line, column: options.frames[0].column } : void 0;
|
||||
const metadata = { title: options.title, location, internal: options.internal, stepId: options.stepId };
|
||||
if (this._tracingCount && options.frames && type !== "LocalUtils")
|
||||
this._localUtils?.addStackToTracingNoReply({ callData: { stack: options.frames ?? [], id } }).catch(() => {
|
||||
});
|
||||
this._platform.zones.empty.run(() => this.onmessage({ ...message, metadata }));
|
||||
return await new Promise((resolve, reject) => this._callbacks.set(id, { resolve, reject, title: options.title, type, method }));
|
||||
}
|
||||
_validatorFromWireContext() {
|
||||
return {
|
||||
tChannelImpl: this._tChannelImplFromWire.bind(this),
|
||||
binary: this._rawBuffers ? "buffer" : "fromBase64",
|
||||
isUnderTest: () => this._platform.isUnderTest()
|
||||
};
|
||||
}
|
||||
dispatch(message) {
|
||||
if (this._closedError)
|
||||
return;
|
||||
const { id, guid, method, params, result, error, log } = message;
|
||||
if (id) {
|
||||
if (this._platform.isLogEnabled("channel"))
|
||||
this._platform.log("channel", "<RECV " + JSON.stringify(message));
|
||||
const callback = this._callbacks.get(id);
|
||||
if (!callback)
|
||||
throw new Error(`Cannot find command to respond: ${id}`);
|
||||
this._callbacks.delete(id);
|
||||
if (error && !result) {
|
||||
const parsedError = (0, import_errors.parseError)(error);
|
||||
(0, import_stackTrace.rewriteErrorMessage)(parsedError, parsedError.message + formatCallLog(this._platform, log));
|
||||
callback.reject(parsedError);
|
||||
} else {
|
||||
const validator2 = (0, import_validator.findValidator)(callback.type, callback.method, "Result");
|
||||
callback.resolve(validator2(result, "", this._validatorFromWireContext()));
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (this._platform.isLogEnabled("channel"))
|
||||
this._platform.log("channel", "<EVENT " + JSON.stringify(message));
|
||||
if (method === "__create__") {
|
||||
this._createRemoteObject(guid, params.type, params.guid, params.initializer);
|
||||
return;
|
||||
}
|
||||
const object = this._objects.get(guid);
|
||||
if (!object)
|
||||
throw new Error(`Cannot find object to "${method}": ${guid}`);
|
||||
if (method === "__adopt__") {
|
||||
const child = this._objects.get(params.guid);
|
||||
if (!child)
|
||||
throw new Error(`Unknown new child: ${params.guid}`);
|
||||
object._adopt(child);
|
||||
return;
|
||||
}
|
||||
if (method === "__dispose__") {
|
||||
object._dispose(params.reason);
|
||||
return;
|
||||
}
|
||||
const validator = (0, import_validator.findValidator)(object._type, method, "Event");
|
||||
object._channel.emit(method, validator(params, "", this._validatorFromWireContext()));
|
||||
}
|
||||
close(cause) {
|
||||
if (this._closedError)
|
||||
return;
|
||||
this._closedError = new import_errors.TargetClosedError(cause);
|
||||
for (const callback of this._callbacks.values())
|
||||
callback.reject(this._closedError);
|
||||
this._callbacks.clear();
|
||||
this.emit("close");
|
||||
}
|
||||
_tChannelImplFromWire(names, arg, path, context) {
|
||||
if (arg && typeof arg === "object" && typeof arg.guid === "string") {
|
||||
const object = this._objects.get(arg.guid);
|
||||
if (!object)
|
||||
throw new Error(`Object with guid ${arg.guid} was not bound in the connection`);
|
||||
if (names !== "*" && !names.includes(object._type))
|
||||
throw new import_validator.ValidationError(`${path}: expected channel ${names.toString()}`);
|
||||
return object._channel;
|
||||
}
|
||||
throw new import_validator.ValidationError(`${path}: expected channel ${names.toString()}`);
|
||||
}
|
||||
_createRemoteObject(parentGuid, type, guid, initializer) {
|
||||
const parent = this._objects.get(parentGuid);
|
||||
if (!parent)
|
||||
throw new Error(`Cannot find parent object ${parentGuid} to create ${guid}`);
|
||||
let result;
|
||||
const validator = (0, import_validator.findValidator)(type, "", "Initializer");
|
||||
initializer = validator(initializer, "", this._validatorFromWireContext());
|
||||
switch (type) {
|
||||
case "Android":
|
||||
result = new import_android.Android(parent, type, guid, initializer);
|
||||
break;
|
||||
case "AndroidSocket":
|
||||
result = new import_android.AndroidSocket(parent, type, guid, initializer);
|
||||
break;
|
||||
case "AndroidDevice":
|
||||
result = new import_android.AndroidDevice(parent, type, guid, initializer);
|
||||
break;
|
||||
case "APIRequestContext":
|
||||
result = new import_fetch.APIRequestContext(parent, type, guid, initializer);
|
||||
break;
|
||||
case "Artifact":
|
||||
result = new import_artifact.Artifact(parent, type, guid, initializer);
|
||||
break;
|
||||
case "BindingCall":
|
||||
result = new import_page.BindingCall(parent, type, guid, initializer);
|
||||
break;
|
||||
case "Browser":
|
||||
result = new import_browser.Browser(parent, type, guid, initializer);
|
||||
break;
|
||||
case "BrowserContext":
|
||||
result = new import_browserContext.BrowserContext(parent, type, guid, initializer);
|
||||
break;
|
||||
case "BrowserType":
|
||||
result = new import_browserType.BrowserType(parent, type, guid, initializer);
|
||||
break;
|
||||
case "CDPSession":
|
||||
result = new import_cdpSession.CDPSession(parent, type, guid, initializer);
|
||||
break;
|
||||
case "Dialog":
|
||||
result = new import_dialog.Dialog(parent, type, guid, initializer);
|
||||
break;
|
||||
case "Electron":
|
||||
result = new import_electron.Electron(parent, type, guid, initializer);
|
||||
break;
|
||||
case "ElectronApplication":
|
||||
result = new import_electron.ElectronApplication(parent, type, guid, initializer);
|
||||
break;
|
||||
case "ElementHandle":
|
||||
result = new import_elementHandle.ElementHandle(parent, type, guid, initializer);
|
||||
break;
|
||||
case "Frame":
|
||||
result = new import_frame.Frame(parent, type, guid, initializer);
|
||||
break;
|
||||
case "JSHandle":
|
||||
result = new import_jsHandle.JSHandle(parent, type, guid, initializer);
|
||||
break;
|
||||
case "JsonPipe":
|
||||
result = new import_jsonPipe.JsonPipe(parent, type, guid, initializer);
|
||||
break;
|
||||
case "LocalUtils":
|
||||
result = new import_localUtils.LocalUtils(parent, type, guid, initializer);
|
||||
if (!this._localUtils)
|
||||
this._localUtils = result;
|
||||
break;
|
||||
case "Page":
|
||||
result = new import_page.Page(parent, type, guid, initializer);
|
||||
break;
|
||||
case "PageAgent":
|
||||
result = new import_pageAgent.PageAgent(parent, type, guid, initializer);
|
||||
break;
|
||||
case "Playwright":
|
||||
result = new import_playwright.Playwright(parent, type, guid, initializer);
|
||||
break;
|
||||
case "Request":
|
||||
result = new import_network.Request(parent, type, guid, initializer);
|
||||
break;
|
||||
case "Response":
|
||||
result = new import_network.Response(parent, type, guid, initializer);
|
||||
break;
|
||||
case "Route":
|
||||
result = new import_network.Route(parent, type, guid, initializer);
|
||||
break;
|
||||
case "Stream":
|
||||
result = new import_stream.Stream(parent, type, guid, initializer);
|
||||
break;
|
||||
case "SocksSupport":
|
||||
result = new DummyChannelOwner(parent, type, guid, initializer);
|
||||
break;
|
||||
case "Tracing":
|
||||
result = new import_tracing.Tracing(parent, type, guid, initializer);
|
||||
break;
|
||||
case "WebSocket":
|
||||
result = new import_network.WebSocket(parent, type, guid, initializer);
|
||||
break;
|
||||
case "WebSocketRoute":
|
||||
result = new import_network.WebSocketRoute(parent, type, guid, initializer);
|
||||
break;
|
||||
case "Worker":
|
||||
result = new import_worker.Worker(parent, type, guid, initializer);
|
||||
break;
|
||||
case "WritableStream":
|
||||
result = new import_writableStream.WritableStream(parent, type, guid, initializer);
|
||||
break;
|
||||
default:
|
||||
throw new Error("Missing type " + type);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
function formatCallLog(platform, log) {
|
||||
if (!log || !log.some((l) => !!l))
|
||||
return "";
|
||||
return `
|
||||
Call log:
|
||||
${platform.colors.dim(log.join("\n"))}
|
||||
`;
|
||||
}
|
||||
// Annotate the CommonJS export names for ESM import in node:
|
||||
0 && (module.exports = {
|
||||
Connection
|
||||
});
|
||||
58
projects/org-skill-web-research/node_modules/playwright-core/lib/client/consoleMessage.js
generated
vendored
Normal file
58
projects/org-skill-web-research/node_modules/playwright-core/lib/client/consoleMessage.js
generated
vendored
Normal file
@@ -0,0 +1,58 @@
|
||||
"use strict";
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var consoleMessage_exports = {};
|
||||
__export(consoleMessage_exports, {
|
||||
ConsoleMessage: () => ConsoleMessage
|
||||
});
|
||||
module.exports = __toCommonJS(consoleMessage_exports);
|
||||
var import_jsHandle = require("./jsHandle");
|
||||
class ConsoleMessage {
|
||||
constructor(platform, event, page, worker) {
|
||||
this._page = page;
|
||||
this._worker = worker;
|
||||
this._event = event;
|
||||
if (platform.inspectCustom)
|
||||
this[platform.inspectCustom] = () => this._inspect();
|
||||
}
|
||||
worker() {
|
||||
return this._worker;
|
||||
}
|
||||
page() {
|
||||
return this._page;
|
||||
}
|
||||
type() {
|
||||
return this._event.type;
|
||||
}
|
||||
text() {
|
||||
return this._event.text;
|
||||
}
|
||||
args() {
|
||||
return this._event.args.map(import_jsHandle.JSHandle.from);
|
||||
}
|
||||
location() {
|
||||
return this._event.location;
|
||||
}
|
||||
_inspect() {
|
||||
return this.text();
|
||||
}
|
||||
}
|
||||
// Annotate the CommonJS export names for ESM import in node:
|
||||
0 && (module.exports = {
|
||||
ConsoleMessage
|
||||
});
|
||||
44
projects/org-skill-web-research/node_modules/playwright-core/lib/client/coverage.js
generated
vendored
Normal file
44
projects/org-skill-web-research/node_modules/playwright-core/lib/client/coverage.js
generated
vendored
Normal file
@@ -0,0 +1,44 @@
|
||||
"use strict";
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var coverage_exports = {};
|
||||
__export(coverage_exports, {
|
||||
Coverage: () => Coverage
|
||||
});
|
||||
module.exports = __toCommonJS(coverage_exports);
|
||||
class Coverage {
|
||||
constructor(channel) {
|
||||
this._channel = channel;
|
||||
}
|
||||
async startJSCoverage(options = {}) {
|
||||
await this._channel.startJSCoverage(options);
|
||||
}
|
||||
async stopJSCoverage() {
|
||||
return (await this._channel.stopJSCoverage()).entries;
|
||||
}
|
||||
async startCSSCoverage(options = {}) {
|
||||
await this._channel.startCSSCoverage(options);
|
||||
}
|
||||
async stopCSSCoverage() {
|
||||
return (await this._channel.stopCSSCoverage()).entries;
|
||||
}
|
||||
}
|
||||
// Annotate the CommonJS export names for ESM import in node:
|
||||
0 && (module.exports = {
|
||||
Coverage
|
||||
});
|
||||
56
projects/org-skill-web-research/node_modules/playwright-core/lib/client/dialog.js
generated
vendored
Normal file
56
projects/org-skill-web-research/node_modules/playwright-core/lib/client/dialog.js
generated
vendored
Normal file
@@ -0,0 +1,56 @@
|
||||
"use strict";
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var dialog_exports = {};
|
||||
__export(dialog_exports, {
|
||||
Dialog: () => Dialog
|
||||
});
|
||||
module.exports = __toCommonJS(dialog_exports);
|
||||
var import_channelOwner = require("./channelOwner");
|
||||
var import_page = require("./page");
|
||||
class Dialog extends import_channelOwner.ChannelOwner {
|
||||
static from(dialog) {
|
||||
return dialog._object;
|
||||
}
|
||||
constructor(parent, type, guid, initializer) {
|
||||
super(parent, type, guid, initializer);
|
||||
this._page = import_page.Page.fromNullable(initializer.page);
|
||||
}
|
||||
page() {
|
||||
return this._page;
|
||||
}
|
||||
type() {
|
||||
return this._initializer.type;
|
||||
}
|
||||
message() {
|
||||
return this._initializer.message;
|
||||
}
|
||||
defaultValue() {
|
||||
return this._initializer.defaultValue;
|
||||
}
|
||||
async accept(promptText) {
|
||||
await this._channel.accept({ promptText });
|
||||
}
|
||||
async dismiss() {
|
||||
await this._channel.dismiss();
|
||||
}
|
||||
}
|
||||
// Annotate the CommonJS export names for ESM import in node:
|
||||
0 && (module.exports = {
|
||||
Dialog
|
||||
});
|
||||
62
projects/org-skill-web-research/node_modules/playwright-core/lib/client/download.js
generated
vendored
Normal file
62
projects/org-skill-web-research/node_modules/playwright-core/lib/client/download.js
generated
vendored
Normal file
@@ -0,0 +1,62 @@
|
||||
"use strict";
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var download_exports = {};
|
||||
__export(download_exports, {
|
||||
Download: () => Download
|
||||
});
|
||||
module.exports = __toCommonJS(download_exports);
|
||||
class Download {
|
||||
constructor(page, url, suggestedFilename, artifact) {
|
||||
this._page = page;
|
||||
this._url = url;
|
||||
this._suggestedFilename = suggestedFilename;
|
||||
this._artifact = artifact;
|
||||
}
|
||||
page() {
|
||||
return this._page;
|
||||
}
|
||||
url() {
|
||||
return this._url;
|
||||
}
|
||||
suggestedFilename() {
|
||||
return this._suggestedFilename;
|
||||
}
|
||||
async path() {
|
||||
return await this._artifact.pathAfterFinished();
|
||||
}
|
||||
async saveAs(path) {
|
||||
return await this._artifact.saveAs(path);
|
||||
}
|
||||
async failure() {
|
||||
return await this._artifact.failure();
|
||||
}
|
||||
async createReadStream() {
|
||||
return await this._artifact.createReadStream();
|
||||
}
|
||||
async cancel() {
|
||||
return await this._artifact.cancel();
|
||||
}
|
||||
async delete() {
|
||||
return await this._artifact.delete();
|
||||
}
|
||||
}
|
||||
// Annotate the CommonJS export names for ESM import in node:
|
||||
0 && (module.exports = {
|
||||
Download
|
||||
});
|
||||
138
projects/org-skill-web-research/node_modules/playwright-core/lib/client/electron.js
generated
vendored
Normal file
138
projects/org-skill-web-research/node_modules/playwright-core/lib/client/electron.js
generated
vendored
Normal file
@@ -0,0 +1,138 @@
|
||||
"use strict";
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var electron_exports = {};
|
||||
__export(electron_exports, {
|
||||
Electron: () => Electron,
|
||||
ElectronApplication: () => ElectronApplication
|
||||
});
|
||||
module.exports = __toCommonJS(electron_exports);
|
||||
var import_browserContext = require("./browserContext");
|
||||
var import_channelOwner = require("./channelOwner");
|
||||
var import_clientHelper = require("./clientHelper");
|
||||
var import_consoleMessage = require("./consoleMessage");
|
||||
var import_errors = require("./errors");
|
||||
var import_events = require("./events");
|
||||
var import_jsHandle = require("./jsHandle");
|
||||
var import_waiter = require("./waiter");
|
||||
var import_timeoutSettings = require("./timeoutSettings");
|
||||
class Electron extends import_channelOwner.ChannelOwner {
|
||||
static from(electron) {
|
||||
return electron._object;
|
||||
}
|
||||
constructor(parent, type, guid, initializer) {
|
||||
super(parent, type, guid, initializer);
|
||||
}
|
||||
async launch(options = {}) {
|
||||
options = this._playwright.selectors._withSelectorOptions(options);
|
||||
const params = {
|
||||
...await (0, import_browserContext.prepareBrowserContextParams)(this._platform, options),
|
||||
env: (0, import_clientHelper.envObjectToArray)(options.env ? options.env : this._platform.env),
|
||||
tracesDir: options.tracesDir,
|
||||
timeout: new import_timeoutSettings.TimeoutSettings(this._platform).launchTimeout(options)
|
||||
};
|
||||
const app = ElectronApplication.from((await this._channel.launch(params)).electronApplication);
|
||||
this._playwright.selectors._contextsForSelectors.add(app._context);
|
||||
app.once(import_events.Events.ElectronApplication.Close, () => this._playwright.selectors._contextsForSelectors.delete(app._context));
|
||||
await app._context._initializeHarFromOptions(options.recordHar);
|
||||
app._context.tracing._tracesDir = options.tracesDir;
|
||||
return app;
|
||||
}
|
||||
}
|
||||
class ElectronApplication extends import_channelOwner.ChannelOwner {
|
||||
constructor(parent, type, guid, initializer) {
|
||||
super(parent, type, guid, initializer);
|
||||
this._windows = /* @__PURE__ */ new Set();
|
||||
this._timeoutSettings = new import_timeoutSettings.TimeoutSettings(this._platform);
|
||||
this._context = import_browserContext.BrowserContext.from(initializer.context);
|
||||
for (const page of this._context._pages)
|
||||
this._onPage(page);
|
||||
this._context.on(import_events.Events.BrowserContext.Page, (page) => this._onPage(page));
|
||||
this._channel.on("close", () => {
|
||||
this.emit(import_events.Events.ElectronApplication.Close);
|
||||
});
|
||||
this._channel.on("console", (event) => this.emit(import_events.Events.ElectronApplication.Console, new import_consoleMessage.ConsoleMessage(this._platform, event, null, null)));
|
||||
this._setEventToSubscriptionMapping(/* @__PURE__ */ new Map([
|
||||
[import_events.Events.ElectronApplication.Console, "console"]
|
||||
]));
|
||||
}
|
||||
static from(electronApplication) {
|
||||
return electronApplication._object;
|
||||
}
|
||||
process() {
|
||||
return this._connection.toImpl?.(this)?.process();
|
||||
}
|
||||
_onPage(page) {
|
||||
this._windows.add(page);
|
||||
this.emit(import_events.Events.ElectronApplication.Window, page);
|
||||
page.once(import_events.Events.Page.Close, () => this._windows.delete(page));
|
||||
}
|
||||
windows() {
|
||||
return [...this._windows];
|
||||
}
|
||||
async firstWindow(options) {
|
||||
if (this._windows.size)
|
||||
return this._windows.values().next().value;
|
||||
return await this.waitForEvent("window", options);
|
||||
}
|
||||
context() {
|
||||
return this._context;
|
||||
}
|
||||
async [Symbol.asyncDispose]() {
|
||||
await this.close();
|
||||
}
|
||||
async close() {
|
||||
try {
|
||||
await this._context.close();
|
||||
} catch (e) {
|
||||
if ((0, import_errors.isTargetClosedError)(e))
|
||||
return;
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
async waitForEvent(event, optionsOrPredicate = {}) {
|
||||
return await this._wrapApiCall(async () => {
|
||||
const timeout = this._timeoutSettings.timeout(typeof optionsOrPredicate === "function" ? {} : optionsOrPredicate);
|
||||
const predicate = typeof optionsOrPredicate === "function" ? optionsOrPredicate : optionsOrPredicate.predicate;
|
||||
const waiter = import_waiter.Waiter.createForEvent(this, event);
|
||||
waiter.rejectOnTimeout(timeout, `Timeout ${timeout}ms exceeded while waiting for event "${event}"`);
|
||||
if (event !== import_events.Events.ElectronApplication.Close)
|
||||
waiter.rejectOnEvent(this, import_events.Events.ElectronApplication.Close, () => new import_errors.TargetClosedError());
|
||||
const result = await waiter.waitForEvent(this, event, predicate);
|
||||
waiter.dispose();
|
||||
return result;
|
||||
});
|
||||
}
|
||||
async browserWindow(page) {
|
||||
const result = await this._channel.browserWindow({ page: page._channel });
|
||||
return import_jsHandle.JSHandle.from(result.handle);
|
||||
}
|
||||
async evaluate(pageFunction, arg) {
|
||||
const result = await this._channel.evaluateExpression({ expression: String(pageFunction), isFunction: typeof pageFunction === "function", arg: (0, import_jsHandle.serializeArgument)(arg) });
|
||||
return (0, import_jsHandle.parseResult)(result.value);
|
||||
}
|
||||
async evaluateHandle(pageFunction, arg) {
|
||||
const result = await this._channel.evaluateExpressionHandle({ expression: String(pageFunction), isFunction: typeof pageFunction === "function", arg: (0, import_jsHandle.serializeArgument)(arg) });
|
||||
return import_jsHandle.JSHandle.from(result.handle);
|
||||
}
|
||||
}
|
||||
// Annotate the CommonJS export names for ESM import in node:
|
||||
0 && (module.exports = {
|
||||
Electron,
|
||||
ElectronApplication
|
||||
});
|
||||
284
projects/org-skill-web-research/node_modules/playwright-core/lib/client/elementHandle.js
generated
vendored
Normal file
284
projects/org-skill-web-research/node_modules/playwright-core/lib/client/elementHandle.js
generated
vendored
Normal file
@@ -0,0 +1,284 @@
|
||||
"use strict";
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var elementHandle_exports = {};
|
||||
__export(elementHandle_exports, {
|
||||
ElementHandle: () => ElementHandle,
|
||||
convertInputFiles: () => convertInputFiles,
|
||||
convertSelectOptionValues: () => convertSelectOptionValues,
|
||||
determineScreenshotType: () => determineScreenshotType
|
||||
});
|
||||
module.exports = __toCommonJS(elementHandle_exports);
|
||||
var import_frame = require("./frame");
|
||||
var import_jsHandle = require("./jsHandle");
|
||||
var import_assert = require("../utils/isomorphic/assert");
|
||||
var import_fileUtils = require("./fileUtils");
|
||||
var import_rtti = require("../utils/isomorphic/rtti");
|
||||
var import_writableStream = require("./writableStream");
|
||||
var import_mimeType = require("../utils/isomorphic/mimeType");
|
||||
class ElementHandle extends import_jsHandle.JSHandle {
|
||||
static from(handle) {
|
||||
return handle._object;
|
||||
}
|
||||
static fromNullable(handle) {
|
||||
return handle ? ElementHandle.from(handle) : null;
|
||||
}
|
||||
constructor(parent, type, guid, initializer) {
|
||||
super(parent, type, guid, initializer);
|
||||
this._frame = parent;
|
||||
this._elementChannel = this._channel;
|
||||
}
|
||||
asElement() {
|
||||
return this;
|
||||
}
|
||||
async ownerFrame() {
|
||||
return import_frame.Frame.fromNullable((await this._elementChannel.ownerFrame()).frame);
|
||||
}
|
||||
async contentFrame() {
|
||||
return import_frame.Frame.fromNullable((await this._elementChannel.contentFrame()).frame);
|
||||
}
|
||||
async getAttribute(name) {
|
||||
const value = (await this._elementChannel.getAttribute({ name })).value;
|
||||
return value === void 0 ? null : value;
|
||||
}
|
||||
async inputValue() {
|
||||
return (await this._elementChannel.inputValue()).value;
|
||||
}
|
||||
async textContent() {
|
||||
const value = (await this._elementChannel.textContent()).value;
|
||||
return value === void 0 ? null : value;
|
||||
}
|
||||
async innerText() {
|
||||
return (await this._elementChannel.innerText()).value;
|
||||
}
|
||||
async innerHTML() {
|
||||
return (await this._elementChannel.innerHTML()).value;
|
||||
}
|
||||
async isChecked() {
|
||||
return (await this._elementChannel.isChecked()).value;
|
||||
}
|
||||
async isDisabled() {
|
||||
return (await this._elementChannel.isDisabled()).value;
|
||||
}
|
||||
async isEditable() {
|
||||
return (await this._elementChannel.isEditable()).value;
|
||||
}
|
||||
async isEnabled() {
|
||||
return (await this._elementChannel.isEnabled()).value;
|
||||
}
|
||||
async isHidden() {
|
||||
return (await this._elementChannel.isHidden()).value;
|
||||
}
|
||||
async isVisible() {
|
||||
return (await this._elementChannel.isVisible()).value;
|
||||
}
|
||||
async dispatchEvent(type, eventInit = {}) {
|
||||
await this._elementChannel.dispatchEvent({ type, eventInit: (0, import_jsHandle.serializeArgument)(eventInit) });
|
||||
}
|
||||
async scrollIntoViewIfNeeded(options = {}) {
|
||||
await this._elementChannel.scrollIntoViewIfNeeded({ ...options, timeout: this._frame._timeout(options) });
|
||||
}
|
||||
async hover(options = {}) {
|
||||
await this._elementChannel.hover({ ...options, timeout: this._frame._timeout(options) });
|
||||
}
|
||||
async click(options = {}) {
|
||||
return await this._elementChannel.click({ ...options, timeout: this._frame._timeout(options) });
|
||||
}
|
||||
async dblclick(options = {}) {
|
||||
return await this._elementChannel.dblclick({ ...options, timeout: this._frame._timeout(options) });
|
||||
}
|
||||
async tap(options = {}) {
|
||||
return await this._elementChannel.tap({ ...options, timeout: this._frame._timeout(options) });
|
||||
}
|
||||
async selectOption(values, options = {}) {
|
||||
const result = await this._elementChannel.selectOption({ ...convertSelectOptionValues(values), ...options, timeout: this._frame._timeout(options) });
|
||||
return result.values;
|
||||
}
|
||||
async fill(value, options = {}) {
|
||||
return await this._elementChannel.fill({ value, ...options, timeout: this._frame._timeout(options) });
|
||||
}
|
||||
async selectText(options = {}) {
|
||||
await this._elementChannel.selectText({ ...options, timeout: this._frame._timeout(options) });
|
||||
}
|
||||
async setInputFiles(files, options = {}) {
|
||||
const frame = await this.ownerFrame();
|
||||
if (!frame)
|
||||
throw new Error("Cannot set input files to detached element");
|
||||
const converted = await convertInputFiles(this._platform, files, frame.page().context());
|
||||
await this._elementChannel.setInputFiles({ ...converted, ...options, timeout: this._frame._timeout(options) });
|
||||
}
|
||||
async focus() {
|
||||
await this._elementChannel.focus();
|
||||
}
|
||||
async type(text, options = {}) {
|
||||
await this._elementChannel.type({ text, ...options, timeout: this._frame._timeout(options) });
|
||||
}
|
||||
async press(key, options = {}) {
|
||||
await this._elementChannel.press({ key, ...options, timeout: this._frame._timeout(options) });
|
||||
}
|
||||
async check(options = {}) {
|
||||
return await this._elementChannel.check({ ...options, timeout: this._frame._timeout(options) });
|
||||
}
|
||||
async uncheck(options = {}) {
|
||||
return await this._elementChannel.uncheck({ ...options, timeout: this._frame._timeout(options) });
|
||||
}
|
||||
async setChecked(checked, options) {
|
||||
if (checked)
|
||||
await this.check(options);
|
||||
else
|
||||
await this.uncheck(options);
|
||||
}
|
||||
async boundingBox() {
|
||||
const value = (await this._elementChannel.boundingBox()).value;
|
||||
return value === void 0 ? null : value;
|
||||
}
|
||||
async screenshot(options = {}) {
|
||||
const mask = options.mask;
|
||||
const copy = { ...options, mask: void 0, timeout: this._frame._timeout(options) };
|
||||
if (!copy.type)
|
||||
copy.type = determineScreenshotType(options);
|
||||
if (mask) {
|
||||
copy.mask = mask.map((locator) => ({
|
||||
frame: locator._frame._channel,
|
||||
selector: locator._selector
|
||||
}));
|
||||
}
|
||||
const result = await this._elementChannel.screenshot(copy);
|
||||
if (options.path) {
|
||||
await (0, import_fileUtils.mkdirIfNeeded)(this._platform, options.path);
|
||||
await this._platform.fs().promises.writeFile(options.path, result.binary);
|
||||
}
|
||||
return result.binary;
|
||||
}
|
||||
async $(selector) {
|
||||
return ElementHandle.fromNullable((await this._elementChannel.querySelector({ selector })).element);
|
||||
}
|
||||
async $$(selector) {
|
||||
const result = await this._elementChannel.querySelectorAll({ selector });
|
||||
return result.elements.map((h) => ElementHandle.from(h));
|
||||
}
|
||||
async $eval(selector, pageFunction, arg) {
|
||||
const result = await this._elementChannel.evalOnSelector({ selector, expression: String(pageFunction), isFunction: typeof pageFunction === "function", arg: (0, import_jsHandle.serializeArgument)(arg) });
|
||||
return (0, import_jsHandle.parseResult)(result.value);
|
||||
}
|
||||
async $$eval(selector, pageFunction, arg) {
|
||||
const result = await this._elementChannel.evalOnSelectorAll({ selector, expression: String(pageFunction), isFunction: typeof pageFunction === "function", arg: (0, import_jsHandle.serializeArgument)(arg) });
|
||||
return (0, import_jsHandle.parseResult)(result.value);
|
||||
}
|
||||
async waitForElementState(state, options = {}) {
|
||||
return await this._elementChannel.waitForElementState({ state, ...options, timeout: this._frame._timeout(options) });
|
||||
}
|
||||
async waitForSelector(selector, options = {}) {
|
||||
const result = await this._elementChannel.waitForSelector({ selector, ...options, timeout: this._frame._timeout(options) });
|
||||
return ElementHandle.fromNullable(result.element);
|
||||
}
|
||||
}
|
||||
function convertSelectOptionValues(values) {
|
||||
if (values === null)
|
||||
return {};
|
||||
if (!Array.isArray(values))
|
||||
values = [values];
|
||||
if (!values.length)
|
||||
return {};
|
||||
for (let i = 0; i < values.length; i++)
|
||||
(0, import_assert.assert)(values[i] !== null, `options[${i}]: expected object, got null`);
|
||||
if (values[0] instanceof ElementHandle)
|
||||
return { elements: values.map((v) => v._elementChannel) };
|
||||
if ((0, import_rtti.isString)(values[0]))
|
||||
return { options: values.map((valueOrLabel) => ({ valueOrLabel })) };
|
||||
return { options: values };
|
||||
}
|
||||
function filePayloadExceedsSizeLimit(payloads) {
|
||||
return payloads.reduce((size, item) => size + (item.buffer ? item.buffer.byteLength : 0), 0) >= import_fileUtils.fileUploadSizeLimit;
|
||||
}
|
||||
async function resolvePathsAndDirectoryForInputFiles(platform, items) {
|
||||
let localPaths;
|
||||
let localDirectory;
|
||||
for (const item of items) {
|
||||
const stat = await platform.fs().promises.stat(item);
|
||||
if (stat.isDirectory()) {
|
||||
if (localDirectory)
|
||||
throw new Error("Multiple directories are not supported");
|
||||
localDirectory = platform.path().resolve(item);
|
||||
} else {
|
||||
localPaths ??= [];
|
||||
localPaths.push(platform.path().resolve(item));
|
||||
}
|
||||
}
|
||||
if (localPaths?.length && localDirectory)
|
||||
throw new Error("File paths must be all files or a single directory");
|
||||
return [localPaths, localDirectory];
|
||||
}
|
||||
async function convertInputFiles(platform, files, context) {
|
||||
const items = Array.isArray(files) ? files.slice() : [files];
|
||||
if (items.some((item) => typeof item === "string")) {
|
||||
if (!items.every((item) => typeof item === "string"))
|
||||
throw new Error("File paths cannot be mixed with buffers");
|
||||
const [localPaths, localDirectory] = await resolvePathsAndDirectoryForInputFiles(platform, items);
|
||||
localPaths?.forEach((path) => context._checkFileAccess(path));
|
||||
if (localDirectory)
|
||||
context._checkFileAccess(localDirectory);
|
||||
if (context._connection.isRemote()) {
|
||||
const files2 = localDirectory ? (await platform.fs().promises.readdir(localDirectory, { withFileTypes: true, recursive: true })).filter((f) => f.isFile()).map((f) => platform.path().join(f.path, f.name)) : localPaths;
|
||||
const { writableStreams, rootDir } = await context._wrapApiCall(async () => context._channel.createTempFiles({
|
||||
rootDirName: localDirectory ? platform.path().basename(localDirectory) : void 0,
|
||||
items: await Promise.all(files2.map(async (file) => {
|
||||
const lastModifiedMs = (await platform.fs().promises.stat(file)).mtimeMs;
|
||||
return {
|
||||
name: localDirectory ? platform.path().relative(localDirectory, file) : platform.path().basename(file),
|
||||
lastModifiedMs
|
||||
};
|
||||
}))
|
||||
}), { internal: true });
|
||||
for (let i = 0; i < files2.length; i++) {
|
||||
const writable = import_writableStream.WritableStream.from(writableStreams[i]);
|
||||
await platform.streamFile(files2[i], writable.stream());
|
||||
}
|
||||
return {
|
||||
directoryStream: rootDir,
|
||||
streams: localDirectory ? void 0 : writableStreams
|
||||
};
|
||||
}
|
||||
return {
|
||||
localPaths,
|
||||
localDirectory
|
||||
};
|
||||
}
|
||||
const payloads = items;
|
||||
if (filePayloadExceedsSizeLimit(payloads))
|
||||
throw new Error("Cannot set buffer larger than 50Mb, please write it to a file and pass its path instead.");
|
||||
return { payloads };
|
||||
}
|
||||
function determineScreenshotType(options) {
|
||||
if (options.path) {
|
||||
const mimeType = (0, import_mimeType.getMimeTypeForPath)(options.path);
|
||||
if (mimeType === "image/png")
|
||||
return "png";
|
||||
else if (mimeType === "image/jpeg")
|
||||
return "jpeg";
|
||||
throw new Error(`path: unsupported mime type "${mimeType}"`);
|
||||
}
|
||||
return options.type;
|
||||
}
|
||||
// Annotate the CommonJS export names for ESM import in node:
|
||||
0 && (module.exports = {
|
||||
ElementHandle,
|
||||
convertInputFiles,
|
||||
convertSelectOptionValues,
|
||||
determineScreenshotType
|
||||
});
|
||||
77
projects/org-skill-web-research/node_modules/playwright-core/lib/client/errors.js
generated
vendored
Normal file
77
projects/org-skill-web-research/node_modules/playwright-core/lib/client/errors.js
generated
vendored
Normal file
@@ -0,0 +1,77 @@
|
||||
"use strict";
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var errors_exports = {};
|
||||
__export(errors_exports, {
|
||||
TargetClosedError: () => TargetClosedError,
|
||||
TimeoutError: () => TimeoutError,
|
||||
isTargetClosedError: () => isTargetClosedError,
|
||||
parseError: () => parseError,
|
||||
serializeError: () => serializeError
|
||||
});
|
||||
module.exports = __toCommonJS(errors_exports);
|
||||
var import_serializers = require("../protocol/serializers");
|
||||
var import_rtti = require("../utils/isomorphic/rtti");
|
||||
class TimeoutError extends Error {
|
||||
constructor(message) {
|
||||
super(message);
|
||||
this.name = "TimeoutError";
|
||||
}
|
||||
}
|
||||
class TargetClosedError extends Error {
|
||||
constructor(cause) {
|
||||
super(cause || "Target page, context or browser has been closed");
|
||||
}
|
||||
}
|
||||
function isTargetClosedError(error) {
|
||||
return error instanceof TargetClosedError;
|
||||
}
|
||||
function serializeError(e) {
|
||||
if ((0, import_rtti.isError)(e))
|
||||
return { error: { message: e.message, stack: e.stack, name: e.name } };
|
||||
return { value: (0, import_serializers.serializeValue)(e, (value) => ({ fallThrough: value })) };
|
||||
}
|
||||
function parseError(error) {
|
||||
if (!error.error) {
|
||||
if (error.value === void 0)
|
||||
throw new Error("Serialized error must have either an error or a value");
|
||||
return (0, import_serializers.parseSerializedValue)(error.value, void 0);
|
||||
}
|
||||
if (error.error.name === "TimeoutError") {
|
||||
const e2 = new TimeoutError(error.error.message);
|
||||
e2.stack = error.error.stack || "";
|
||||
return e2;
|
||||
}
|
||||
if (error.error.name === "TargetClosedError") {
|
||||
const e2 = new TargetClosedError(error.error.message);
|
||||
e2.stack = error.error.stack || "";
|
||||
return e2;
|
||||
}
|
||||
const e = new Error(error.error.message);
|
||||
e.stack = error.error.stack || "";
|
||||
e.name = error.error.name;
|
||||
return e;
|
||||
}
|
||||
// Annotate the CommonJS export names for ESM import in node:
|
||||
0 && (module.exports = {
|
||||
TargetClosedError,
|
||||
TimeoutError,
|
||||
isTargetClosedError,
|
||||
parseError,
|
||||
serializeError
|
||||
});
|
||||
314
projects/org-skill-web-research/node_modules/playwright-core/lib/client/eventEmitter.js
generated
vendored
Normal file
314
projects/org-skill-web-research/node_modules/playwright-core/lib/client/eventEmitter.js
generated
vendored
Normal file
@@ -0,0 +1,314 @@
|
||||
"use strict";
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var eventEmitter_exports = {};
|
||||
__export(eventEmitter_exports, {
|
||||
EventEmitter: () => EventEmitter
|
||||
});
|
||||
module.exports = __toCommonJS(eventEmitter_exports);
|
||||
class EventEmitter {
|
||||
constructor(platform) {
|
||||
this._events = void 0;
|
||||
this._eventsCount = 0;
|
||||
this._maxListeners = void 0;
|
||||
this._pendingHandlers = /* @__PURE__ */ new Map();
|
||||
this._platform = platform;
|
||||
if (this._events === void 0 || this._events === Object.getPrototypeOf(this)._events) {
|
||||
this._events = /* @__PURE__ */ Object.create(null);
|
||||
this._eventsCount = 0;
|
||||
}
|
||||
this._maxListeners = this._maxListeners || void 0;
|
||||
this.on = this.addListener;
|
||||
this.off = this.removeListener;
|
||||
}
|
||||
setMaxListeners(n) {
|
||||
if (typeof n !== "number" || n < 0 || Number.isNaN(n))
|
||||
throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received ' + n + ".");
|
||||
this._maxListeners = n;
|
||||
return this;
|
||||
}
|
||||
getMaxListeners() {
|
||||
return this._maxListeners === void 0 ? this._platform.defaultMaxListeners() : this._maxListeners;
|
||||
}
|
||||
emit(type, ...args) {
|
||||
const events = this._events;
|
||||
if (events === void 0)
|
||||
return false;
|
||||
const handler = events?.[type];
|
||||
if (handler === void 0)
|
||||
return false;
|
||||
if (typeof handler === "function") {
|
||||
this._callHandler(type, handler, args);
|
||||
} else {
|
||||
const len = handler.length;
|
||||
const listeners = handler.slice();
|
||||
for (let i = 0; i < len; ++i)
|
||||
this._callHandler(type, listeners[i], args);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
_callHandler(type, handler, args) {
|
||||
const promise = Reflect.apply(handler, this, args);
|
||||
if (!(promise instanceof Promise))
|
||||
return;
|
||||
let set = this._pendingHandlers.get(type);
|
||||
if (!set) {
|
||||
set = /* @__PURE__ */ new Set();
|
||||
this._pendingHandlers.set(type, set);
|
||||
}
|
||||
set.add(promise);
|
||||
promise.catch((e) => {
|
||||
if (this._rejectionHandler)
|
||||
this._rejectionHandler(e);
|
||||
else
|
||||
throw e;
|
||||
}).finally(() => set.delete(promise));
|
||||
}
|
||||
addListener(type, listener) {
|
||||
return this._addListener(type, listener, false);
|
||||
}
|
||||
on(type, listener) {
|
||||
return this._addListener(type, listener, false);
|
||||
}
|
||||
_addListener(type, listener, prepend) {
|
||||
checkListener(listener);
|
||||
let events = this._events;
|
||||
let existing;
|
||||
if (events === void 0) {
|
||||
events = this._events = /* @__PURE__ */ Object.create(null);
|
||||
this._eventsCount = 0;
|
||||
} else {
|
||||
if (events.newListener !== void 0) {
|
||||
this.emit("newListener", type, unwrapListener(listener));
|
||||
events = this._events;
|
||||
}
|
||||
existing = events[type];
|
||||
}
|
||||
if (existing === void 0) {
|
||||
existing = events[type] = listener;
|
||||
++this._eventsCount;
|
||||
} else {
|
||||
if (typeof existing === "function") {
|
||||
existing = events[type] = prepend ? [listener, existing] : [existing, listener];
|
||||
} else if (prepend) {
|
||||
existing.unshift(listener);
|
||||
} else {
|
||||
existing.push(listener);
|
||||
}
|
||||
const m = this.getMaxListeners();
|
||||
if (m > 0 && existing.length > m && !existing.warned) {
|
||||
existing.warned = true;
|
||||
const w = new Error("Possible EventEmitter memory leak detected. " + existing.length + " " + String(type) + " listeners added. Use emitter.setMaxListeners() to increase limit");
|
||||
w.name = "MaxListenersExceededWarning";
|
||||
w.emitter = this;
|
||||
w.type = type;
|
||||
w.count = existing.length;
|
||||
if (!this._platform.isUnderTest()) {
|
||||
console.warn(w);
|
||||
}
|
||||
}
|
||||
}
|
||||
return this;
|
||||
}
|
||||
prependListener(type, listener) {
|
||||
return this._addListener(type, listener, true);
|
||||
}
|
||||
once(type, listener) {
|
||||
checkListener(listener);
|
||||
this.on(type, new OnceWrapper(this, type, listener).wrapperFunction);
|
||||
return this;
|
||||
}
|
||||
prependOnceListener(type, listener) {
|
||||
checkListener(listener);
|
||||
this.prependListener(type, new OnceWrapper(this, type, listener).wrapperFunction);
|
||||
return this;
|
||||
}
|
||||
removeListener(type, listener) {
|
||||
checkListener(listener);
|
||||
const events = this._events;
|
||||
if (events === void 0)
|
||||
return this;
|
||||
const list = events[type];
|
||||
if (list === void 0)
|
||||
return this;
|
||||
if (list === listener || list.listener === listener) {
|
||||
if (--this._eventsCount === 0) {
|
||||
this._events = /* @__PURE__ */ Object.create(null);
|
||||
} else {
|
||||
delete events[type];
|
||||
if (events.removeListener)
|
||||
this.emit("removeListener", type, list.listener ?? listener);
|
||||
}
|
||||
} else if (typeof list !== "function") {
|
||||
let position = -1;
|
||||
let originalListener;
|
||||
for (let i = list.length - 1; i >= 0; i--) {
|
||||
if (list[i] === listener || wrappedListener(list[i]) === listener) {
|
||||
originalListener = wrappedListener(list[i]);
|
||||
position = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (position < 0)
|
||||
return this;
|
||||
if (position === 0)
|
||||
list.shift();
|
||||
else
|
||||
list.splice(position, 1);
|
||||
if (list.length === 1)
|
||||
events[type] = list[0];
|
||||
if (events.removeListener !== void 0)
|
||||
this.emit("removeListener", type, originalListener || listener);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
off(type, listener) {
|
||||
return this.removeListener(type, listener);
|
||||
}
|
||||
removeAllListeners(type, options) {
|
||||
this._removeAllListeners(type);
|
||||
if (!options)
|
||||
return this;
|
||||
if (options.behavior === "wait") {
|
||||
const errors = [];
|
||||
this._rejectionHandler = (error) => errors.push(error);
|
||||
return this._waitFor(type).then(() => {
|
||||
if (errors.length)
|
||||
throw errors[0];
|
||||
});
|
||||
}
|
||||
if (options.behavior === "ignoreErrors")
|
||||
this._rejectionHandler = () => {
|
||||
};
|
||||
return Promise.resolve();
|
||||
}
|
||||
_removeAllListeners(type) {
|
||||
const events = this._events;
|
||||
if (!events)
|
||||
return;
|
||||
if (!events.removeListener) {
|
||||
if (type === void 0) {
|
||||
this._events = /* @__PURE__ */ Object.create(null);
|
||||
this._eventsCount = 0;
|
||||
} else if (events[type] !== void 0) {
|
||||
if (--this._eventsCount === 0)
|
||||
this._events = /* @__PURE__ */ Object.create(null);
|
||||
else
|
||||
delete events[type];
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (type === void 0) {
|
||||
const keys = Object.keys(events);
|
||||
let key;
|
||||
for (let i = 0; i < keys.length; ++i) {
|
||||
key = keys[i];
|
||||
if (key === "removeListener")
|
||||
continue;
|
||||
this._removeAllListeners(key);
|
||||
}
|
||||
this._removeAllListeners("removeListener");
|
||||
this._events = /* @__PURE__ */ Object.create(null);
|
||||
this._eventsCount = 0;
|
||||
return;
|
||||
}
|
||||
const listeners = events[type];
|
||||
if (typeof listeners === "function") {
|
||||
this.removeListener(type, listeners);
|
||||
} else if (listeners !== void 0) {
|
||||
for (let i = listeners.length - 1; i >= 0; i--)
|
||||
this.removeListener(type, listeners[i]);
|
||||
}
|
||||
}
|
||||
listeners(type) {
|
||||
return this._listeners(this, type, true);
|
||||
}
|
||||
rawListeners(type) {
|
||||
return this._listeners(this, type, false);
|
||||
}
|
||||
listenerCount(type) {
|
||||
const events = this._events;
|
||||
if (events !== void 0) {
|
||||
const listener = events[type];
|
||||
if (typeof listener === "function")
|
||||
return 1;
|
||||
if (listener !== void 0)
|
||||
return listener.length;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
eventNames() {
|
||||
return this._eventsCount > 0 && this._events ? Reflect.ownKeys(this._events) : [];
|
||||
}
|
||||
async _waitFor(type) {
|
||||
let promises = [];
|
||||
if (type) {
|
||||
promises = [...this._pendingHandlers.get(type) || []];
|
||||
} else {
|
||||
promises = [];
|
||||
for (const [, pending] of this._pendingHandlers)
|
||||
promises.push(...pending);
|
||||
}
|
||||
await Promise.all(promises);
|
||||
}
|
||||
_listeners(target, type, unwrap) {
|
||||
const events = target._events;
|
||||
if (events === void 0)
|
||||
return [];
|
||||
const listener = events[type];
|
||||
if (listener === void 0)
|
||||
return [];
|
||||
if (typeof listener === "function")
|
||||
return unwrap ? [unwrapListener(listener)] : [listener];
|
||||
return unwrap ? unwrapListeners(listener) : listener.slice();
|
||||
}
|
||||
}
|
||||
function checkListener(listener) {
|
||||
if (typeof listener !== "function")
|
||||
throw new TypeError('The "listener" argument must be of type Function. Received type ' + typeof listener);
|
||||
}
|
||||
class OnceWrapper {
|
||||
constructor(eventEmitter, eventType, listener) {
|
||||
this._fired = false;
|
||||
this._eventEmitter = eventEmitter;
|
||||
this._eventType = eventType;
|
||||
this._listener = listener;
|
||||
this.wrapperFunction = this._handle.bind(this);
|
||||
this.wrapperFunction.listener = listener;
|
||||
}
|
||||
_handle(...args) {
|
||||
if (this._fired)
|
||||
return;
|
||||
this._fired = true;
|
||||
this._eventEmitter.removeListener(this._eventType, this.wrapperFunction);
|
||||
return this._listener.apply(this._eventEmitter, args);
|
||||
}
|
||||
}
|
||||
function unwrapListener(l) {
|
||||
return wrappedListener(l) ?? l;
|
||||
}
|
||||
function unwrapListeners(arr) {
|
||||
return arr.map((l) => wrappedListener(l) ?? l);
|
||||
}
|
||||
function wrappedListener(l) {
|
||||
return l.listener;
|
||||
}
|
||||
// Annotate the CommonJS export names for ESM import in node:
|
||||
0 && (module.exports = {
|
||||
EventEmitter
|
||||
});
|
||||
103
projects/org-skill-web-research/node_modules/playwright-core/lib/client/events.js
generated
vendored
Normal file
103
projects/org-skill-web-research/node_modules/playwright-core/lib/client/events.js
generated
vendored
Normal file
@@ -0,0 +1,103 @@
|
||||
"use strict";
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var events_exports = {};
|
||||
__export(events_exports, {
|
||||
Events: () => Events
|
||||
});
|
||||
module.exports = __toCommonJS(events_exports);
|
||||
const Events = {
|
||||
AndroidDevice: {
|
||||
WebView: "webview",
|
||||
Close: "close"
|
||||
},
|
||||
AndroidSocket: {
|
||||
Data: "data",
|
||||
Close: "close"
|
||||
},
|
||||
AndroidWebView: {
|
||||
Close: "close"
|
||||
},
|
||||
Browser: {
|
||||
Disconnected: "disconnected"
|
||||
},
|
||||
BrowserContext: {
|
||||
Console: "console",
|
||||
Close: "close",
|
||||
Dialog: "dialog",
|
||||
Page: "page",
|
||||
// Can't use just 'error' due to node.js special treatment of error events.
|
||||
// @see https://nodejs.org/api/events.html#events_error_events
|
||||
WebError: "weberror",
|
||||
BackgroundPage: "backgroundpage",
|
||||
// Deprecated in v1.56, never emitted anymore.
|
||||
ServiceWorker: "serviceworker",
|
||||
Request: "request",
|
||||
Response: "response",
|
||||
RequestFailed: "requestfailed",
|
||||
RequestFinished: "requestfinished"
|
||||
},
|
||||
BrowserServer: {
|
||||
Close: "close"
|
||||
},
|
||||
Page: {
|
||||
Close: "close",
|
||||
Crash: "crash",
|
||||
Console: "console",
|
||||
Dialog: "dialog",
|
||||
Download: "download",
|
||||
FileChooser: "filechooser",
|
||||
DOMContentLoaded: "domcontentloaded",
|
||||
// Can't use just 'error' due to node.js special treatment of error events.
|
||||
// @see https://nodejs.org/api/events.html#events_error_events
|
||||
PageError: "pageerror",
|
||||
Request: "request",
|
||||
Response: "response",
|
||||
RequestFailed: "requestfailed",
|
||||
RequestFinished: "requestfinished",
|
||||
FrameAttached: "frameattached",
|
||||
FrameDetached: "framedetached",
|
||||
FrameNavigated: "framenavigated",
|
||||
Load: "load",
|
||||
Popup: "popup",
|
||||
WebSocket: "websocket",
|
||||
Worker: "worker"
|
||||
},
|
||||
PageAgent: {
|
||||
Turn: "turn"
|
||||
},
|
||||
WebSocket: {
|
||||
Close: "close",
|
||||
Error: "socketerror",
|
||||
FrameReceived: "framereceived",
|
||||
FrameSent: "framesent"
|
||||
},
|
||||
Worker: {
|
||||
Close: "close",
|
||||
Console: "console"
|
||||
},
|
||||
ElectronApplication: {
|
||||
Close: "close",
|
||||
Console: "console",
|
||||
Window: "window"
|
||||
}
|
||||
};
|
||||
// Annotate the CommonJS export names for ESM import in node:
|
||||
0 && (module.exports = {
|
||||
Events
|
||||
});
|
||||
368
projects/org-skill-web-research/node_modules/playwright-core/lib/client/fetch.js
generated
vendored
Normal file
368
projects/org-skill-web-research/node_modules/playwright-core/lib/client/fetch.js
generated
vendored
Normal file
@@ -0,0 +1,368 @@
|
||||
"use strict";
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var fetch_exports = {};
|
||||
__export(fetch_exports, {
|
||||
APIRequest: () => APIRequest,
|
||||
APIRequestContext: () => APIRequestContext,
|
||||
APIResponse: () => APIResponse
|
||||
});
|
||||
module.exports = __toCommonJS(fetch_exports);
|
||||
var import_browserContext = require("./browserContext");
|
||||
var import_channelOwner = require("./channelOwner");
|
||||
var import_errors = require("./errors");
|
||||
var import_network = require("./network");
|
||||
var import_tracing = require("./tracing");
|
||||
var import_assert = require("../utils/isomorphic/assert");
|
||||
var import_fileUtils = require("./fileUtils");
|
||||
var import_headers = require("../utils/isomorphic/headers");
|
||||
var import_rtti = require("../utils/isomorphic/rtti");
|
||||
var import_timeoutSettings = require("./timeoutSettings");
|
||||
class APIRequest {
|
||||
constructor(playwright) {
|
||||
this._contexts = /* @__PURE__ */ new Set();
|
||||
this._playwright = playwright;
|
||||
}
|
||||
async newContext(options = {}) {
|
||||
options = { ...options };
|
||||
await this._playwright._instrumentation.runBeforeCreateRequestContext(options);
|
||||
const storageState = typeof options.storageState === "string" ? JSON.parse(await this._playwright._platform.fs().promises.readFile(options.storageState, "utf8")) : options.storageState;
|
||||
const context = APIRequestContext.from((await this._playwright._channel.newRequest({
|
||||
...options,
|
||||
extraHTTPHeaders: options.extraHTTPHeaders ? (0, import_headers.headersObjectToArray)(options.extraHTTPHeaders) : void 0,
|
||||
storageState,
|
||||
tracesDir: this._playwright._defaultLaunchOptions?.tracesDir,
|
||||
// We do not expose tracesDir in the API, so do not allow options to accidentally override it.
|
||||
clientCertificates: await (0, import_browserContext.toClientCertificatesProtocol)(this._playwright._platform, options.clientCertificates)
|
||||
})).request);
|
||||
this._contexts.add(context);
|
||||
context._request = this;
|
||||
context._timeoutSettings.setDefaultTimeout(options.timeout ?? this._playwright._defaultContextTimeout);
|
||||
context._tracing._tracesDir = this._playwright._defaultLaunchOptions?.tracesDir;
|
||||
await context._instrumentation.runAfterCreateRequestContext(context);
|
||||
return context;
|
||||
}
|
||||
}
|
||||
class APIRequestContext extends import_channelOwner.ChannelOwner {
|
||||
static from(channel) {
|
||||
return channel._object;
|
||||
}
|
||||
constructor(parent, type, guid, initializer) {
|
||||
super(parent, type, guid, initializer);
|
||||
this._tracing = import_tracing.Tracing.from(initializer.tracing);
|
||||
this._timeoutSettings = new import_timeoutSettings.TimeoutSettings(this._platform);
|
||||
}
|
||||
async [Symbol.asyncDispose]() {
|
||||
await this.dispose();
|
||||
}
|
||||
async dispose(options = {}) {
|
||||
this._closeReason = options.reason;
|
||||
await this._instrumentation.runBeforeCloseRequestContext(this);
|
||||
try {
|
||||
await this._channel.dispose(options);
|
||||
} catch (e) {
|
||||
if ((0, import_errors.isTargetClosedError)(e))
|
||||
return;
|
||||
throw e;
|
||||
}
|
||||
this._tracing._resetStackCounter();
|
||||
this._request?._contexts.delete(this);
|
||||
}
|
||||
async delete(url, options) {
|
||||
return await this.fetch(url, {
|
||||
...options,
|
||||
method: "DELETE"
|
||||
});
|
||||
}
|
||||
async head(url, options) {
|
||||
return await this.fetch(url, {
|
||||
...options,
|
||||
method: "HEAD"
|
||||
});
|
||||
}
|
||||
async get(url, options) {
|
||||
return await this.fetch(url, {
|
||||
...options,
|
||||
method: "GET"
|
||||
});
|
||||
}
|
||||
async patch(url, options) {
|
||||
return await this.fetch(url, {
|
||||
...options,
|
||||
method: "PATCH"
|
||||
});
|
||||
}
|
||||
async post(url, options) {
|
||||
return await this.fetch(url, {
|
||||
...options,
|
||||
method: "POST"
|
||||
});
|
||||
}
|
||||
async put(url, options) {
|
||||
return await this.fetch(url, {
|
||||
...options,
|
||||
method: "PUT"
|
||||
});
|
||||
}
|
||||
async fetch(urlOrRequest, options = {}) {
|
||||
const url = (0, import_rtti.isString)(urlOrRequest) ? urlOrRequest : void 0;
|
||||
const request = (0, import_rtti.isString)(urlOrRequest) ? void 0 : urlOrRequest;
|
||||
return await this._innerFetch({ url, request, ...options });
|
||||
}
|
||||
async _innerFetch(options = {}) {
|
||||
return await this._wrapApiCall(async () => {
|
||||
if (this._closeReason)
|
||||
throw new import_errors.TargetClosedError(this._closeReason);
|
||||
(0, import_assert.assert)(options.request || typeof options.url === "string", "First argument must be either URL string or Request");
|
||||
(0, import_assert.assert)((options.data === void 0 ? 0 : 1) + (options.form === void 0 ? 0 : 1) + (options.multipart === void 0 ? 0 : 1) <= 1, `Only one of 'data', 'form' or 'multipart' can be specified`);
|
||||
(0, import_assert.assert)(options.maxRedirects === void 0 || options.maxRedirects >= 0, `'maxRedirects' must be greater than or equal to '0'`);
|
||||
(0, import_assert.assert)(options.maxRetries === void 0 || options.maxRetries >= 0, `'maxRetries' must be greater than or equal to '0'`);
|
||||
const url = options.url !== void 0 ? options.url : options.request.url();
|
||||
this._checkUrlAllowed?.(url);
|
||||
const method = options.method || options.request?.method();
|
||||
let encodedParams = void 0;
|
||||
if (typeof options.params === "string")
|
||||
encodedParams = options.params;
|
||||
else if (options.params instanceof URLSearchParams)
|
||||
encodedParams = options.params.toString();
|
||||
const headersObj = options.headers || options.request?.headers();
|
||||
const headers = headersObj ? (0, import_headers.headersObjectToArray)(headersObj) : void 0;
|
||||
let jsonData;
|
||||
let formData;
|
||||
let multipartData;
|
||||
let postDataBuffer;
|
||||
if (options.data !== void 0) {
|
||||
if ((0, import_rtti.isString)(options.data)) {
|
||||
if (isJsonContentType(headers))
|
||||
jsonData = isJsonParsable(options.data) ? options.data : JSON.stringify(options.data);
|
||||
else
|
||||
postDataBuffer = Buffer.from(options.data, "utf8");
|
||||
} else if (Buffer.isBuffer(options.data)) {
|
||||
postDataBuffer = options.data;
|
||||
} else if (typeof options.data === "object" || typeof options.data === "number" || typeof options.data === "boolean") {
|
||||
jsonData = JSON.stringify(options.data);
|
||||
} else {
|
||||
throw new Error(`Unexpected 'data' type`);
|
||||
}
|
||||
} else if (options.form) {
|
||||
if (globalThis.FormData && options.form instanceof FormData) {
|
||||
formData = [];
|
||||
for (const [name, value] of options.form.entries()) {
|
||||
if (typeof value !== "string")
|
||||
throw new Error(`Expected string for options.form["${name}"], found File. Please use options.multipart instead.`);
|
||||
formData.push({ name, value });
|
||||
}
|
||||
} else {
|
||||
formData = objectToArray(options.form);
|
||||
}
|
||||
} else if (options.multipart) {
|
||||
multipartData = [];
|
||||
if (globalThis.FormData && options.multipart instanceof FormData) {
|
||||
const form = options.multipart;
|
||||
for (const [name, value] of form.entries()) {
|
||||
if ((0, import_rtti.isString)(value)) {
|
||||
multipartData.push({ name, value });
|
||||
} else {
|
||||
const file = {
|
||||
name: value.name,
|
||||
mimeType: value.type,
|
||||
buffer: Buffer.from(await value.arrayBuffer())
|
||||
};
|
||||
multipartData.push({ name, file });
|
||||
}
|
||||
}
|
||||
} else {
|
||||
for (const [name, value] of Object.entries(options.multipart))
|
||||
multipartData.push(await toFormField(this._platform, name, value));
|
||||
}
|
||||
}
|
||||
if (postDataBuffer === void 0 && jsonData === void 0 && formData === void 0 && multipartData === void 0)
|
||||
postDataBuffer = options.request?.postDataBuffer() || void 0;
|
||||
const fixtures = {
|
||||
__testHookLookup: options.__testHookLookup
|
||||
};
|
||||
const result = await this._channel.fetch({
|
||||
url,
|
||||
params: typeof options.params === "object" ? objectToArray(options.params) : void 0,
|
||||
encodedParams,
|
||||
method,
|
||||
headers,
|
||||
postData: postDataBuffer,
|
||||
jsonData,
|
||||
formData,
|
||||
multipartData,
|
||||
timeout: this._timeoutSettings.timeout(options),
|
||||
failOnStatusCode: options.failOnStatusCode,
|
||||
ignoreHTTPSErrors: options.ignoreHTTPSErrors,
|
||||
maxRedirects: options.maxRedirects,
|
||||
maxRetries: options.maxRetries,
|
||||
...fixtures
|
||||
});
|
||||
return new APIResponse(this, result.response);
|
||||
});
|
||||
}
|
||||
async storageState(options = {}) {
|
||||
const state = await this._channel.storageState({ indexedDB: options.indexedDB });
|
||||
if (options.path) {
|
||||
await (0, import_fileUtils.mkdirIfNeeded)(this._platform, options.path);
|
||||
await this._platform.fs().promises.writeFile(options.path, JSON.stringify(state, void 0, 2), "utf8");
|
||||
}
|
||||
return state;
|
||||
}
|
||||
}
|
||||
async function toFormField(platform, name, value) {
|
||||
const typeOfValue = typeof value;
|
||||
if (isFilePayload(value)) {
|
||||
const payload = value;
|
||||
if (!Buffer.isBuffer(payload.buffer))
|
||||
throw new Error(`Unexpected buffer type of 'data.${name}'`);
|
||||
return { name, file: filePayloadToJson(payload) };
|
||||
} else if (typeOfValue === "string" || typeOfValue === "number" || typeOfValue === "boolean") {
|
||||
return { name, value: String(value) };
|
||||
} else {
|
||||
return { name, file: await readStreamToJson(platform, value) };
|
||||
}
|
||||
}
|
||||
function isJsonParsable(value) {
|
||||
if (typeof value !== "string")
|
||||
return false;
|
||||
try {
|
||||
JSON.parse(value);
|
||||
return true;
|
||||
} catch (e) {
|
||||
if (e instanceof SyntaxError)
|
||||
return false;
|
||||
else
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
class APIResponse {
|
||||
constructor(context, initializer) {
|
||||
this._request = context;
|
||||
this._initializer = initializer;
|
||||
this._headers = new import_network.RawHeaders(this._initializer.headers);
|
||||
if (context._platform.inspectCustom)
|
||||
this[context._platform.inspectCustom] = () => this._inspect();
|
||||
}
|
||||
ok() {
|
||||
return this._initializer.status >= 200 && this._initializer.status <= 299;
|
||||
}
|
||||
url() {
|
||||
return this._initializer.url;
|
||||
}
|
||||
status() {
|
||||
return this._initializer.status;
|
||||
}
|
||||
statusText() {
|
||||
return this._initializer.statusText;
|
||||
}
|
||||
headers() {
|
||||
return this._headers.headers();
|
||||
}
|
||||
headersArray() {
|
||||
return this._headers.headersArray();
|
||||
}
|
||||
async body() {
|
||||
return await this._request._wrapApiCall(async () => {
|
||||
try {
|
||||
const result = await this._request._channel.fetchResponseBody({ fetchUid: this._fetchUid() });
|
||||
if (result.binary === void 0)
|
||||
throw new Error("Response has been disposed");
|
||||
return result.binary;
|
||||
} catch (e) {
|
||||
if ((0, import_errors.isTargetClosedError)(e))
|
||||
throw new Error("Response has been disposed");
|
||||
throw e;
|
||||
}
|
||||
}, { internal: true });
|
||||
}
|
||||
async text() {
|
||||
const content = await this.body();
|
||||
return content.toString("utf8");
|
||||
}
|
||||
async json() {
|
||||
const content = await this.text();
|
||||
return JSON.parse(content);
|
||||
}
|
||||
async [Symbol.asyncDispose]() {
|
||||
await this.dispose();
|
||||
}
|
||||
async dispose() {
|
||||
await this._request._channel.disposeAPIResponse({ fetchUid: this._fetchUid() });
|
||||
}
|
||||
_inspect() {
|
||||
const headers = this.headersArray().map(({ name, value }) => ` ${name}: ${value}`);
|
||||
return `APIResponse: ${this.status()} ${this.statusText()}
|
||||
${headers.join("\n")}`;
|
||||
}
|
||||
_fetchUid() {
|
||||
return this._initializer.fetchUid;
|
||||
}
|
||||
async _fetchLog() {
|
||||
const { log } = await this._request._channel.fetchLog({ fetchUid: this._fetchUid() });
|
||||
return log;
|
||||
}
|
||||
}
|
||||
function filePayloadToJson(payload) {
|
||||
return {
|
||||
name: payload.name,
|
||||
mimeType: payload.mimeType,
|
||||
buffer: payload.buffer
|
||||
};
|
||||
}
|
||||
async function readStreamToJson(platform, stream) {
|
||||
const buffer = await new Promise((resolve, reject) => {
|
||||
const chunks = [];
|
||||
stream.on("data", (chunk) => chunks.push(chunk));
|
||||
stream.on("end", () => resolve(Buffer.concat(chunks)));
|
||||
stream.on("error", (err) => reject(err));
|
||||
});
|
||||
const streamPath = Buffer.isBuffer(stream.path) ? stream.path.toString("utf8") : stream.path;
|
||||
return {
|
||||
name: platform.path().basename(streamPath),
|
||||
buffer
|
||||
};
|
||||
}
|
||||
function isJsonContentType(headers) {
|
||||
if (!headers)
|
||||
return false;
|
||||
for (const { name, value } of headers) {
|
||||
if (name.toLocaleLowerCase() === "content-type")
|
||||
return value === "application/json";
|
||||
}
|
||||
return false;
|
||||
}
|
||||
function objectToArray(map) {
|
||||
if (!map)
|
||||
return void 0;
|
||||
const result = [];
|
||||
for (const [name, value] of Object.entries(map)) {
|
||||
if (value !== void 0)
|
||||
result.push({ name, value: String(value) });
|
||||
}
|
||||
return result;
|
||||
}
|
||||
function isFilePayload(value) {
|
||||
return typeof value === "object" && value["name"] && value["mimeType"] && value["buffer"];
|
||||
}
|
||||
// Annotate the CommonJS export names for ESM import in node:
|
||||
0 && (module.exports = {
|
||||
APIRequest,
|
||||
APIRequestContext,
|
||||
APIResponse
|
||||
});
|
||||
46
projects/org-skill-web-research/node_modules/playwright-core/lib/client/fileChooser.js
generated
vendored
Normal file
46
projects/org-skill-web-research/node_modules/playwright-core/lib/client/fileChooser.js
generated
vendored
Normal file
@@ -0,0 +1,46 @@
|
||||
"use strict";
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var fileChooser_exports = {};
|
||||
__export(fileChooser_exports, {
|
||||
FileChooser: () => FileChooser
|
||||
});
|
||||
module.exports = __toCommonJS(fileChooser_exports);
|
||||
class FileChooser {
|
||||
constructor(page, elementHandle, isMultiple) {
|
||||
this._page = page;
|
||||
this._elementHandle = elementHandle;
|
||||
this._isMultiple = isMultiple;
|
||||
}
|
||||
element() {
|
||||
return this._elementHandle;
|
||||
}
|
||||
isMultiple() {
|
||||
return this._isMultiple;
|
||||
}
|
||||
page() {
|
||||
return this._page;
|
||||
}
|
||||
async setFiles(files, options) {
|
||||
return await this._elementHandle.setInputFiles(files, options);
|
||||
}
|
||||
}
|
||||
// Annotate the CommonJS export names for ESM import in node:
|
||||
0 && (module.exports = {
|
||||
FileChooser
|
||||
});
|
||||
34
projects/org-skill-web-research/node_modules/playwright-core/lib/client/fileUtils.js
generated
vendored
Normal file
34
projects/org-skill-web-research/node_modules/playwright-core/lib/client/fileUtils.js
generated
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
"use strict";
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var fileUtils_exports = {};
|
||||
__export(fileUtils_exports, {
|
||||
fileUploadSizeLimit: () => fileUploadSizeLimit,
|
||||
mkdirIfNeeded: () => mkdirIfNeeded
|
||||
});
|
||||
module.exports = __toCommonJS(fileUtils_exports);
|
||||
const fileUploadSizeLimit = 50 * 1024 * 1024;
|
||||
async function mkdirIfNeeded(platform, filePath) {
|
||||
await platform.fs().promises.mkdir(platform.path().dirname(filePath), { recursive: true }).catch(() => {
|
||||
});
|
||||
}
|
||||
// Annotate the CommonJS export names for ESM import in node:
|
||||
0 && (module.exports = {
|
||||
fileUploadSizeLimit,
|
||||
mkdirIfNeeded
|
||||
});
|
||||
409
projects/org-skill-web-research/node_modules/playwright-core/lib/client/frame.js
generated
vendored
Normal file
409
projects/org-skill-web-research/node_modules/playwright-core/lib/client/frame.js
generated
vendored
Normal file
@@ -0,0 +1,409 @@
|
||||
"use strict";
|
||||
var __create = Object.create;
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __getProtoOf = Object.getPrototypeOf;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
||||
// If the importer is in node compatibility mode or this is not an ESM
|
||||
// file that has been converted to a CommonJS file using a Babel-
|
||||
// compatible transform (i.e. "__esModule" has not been set), then set
|
||||
// "default" to the CommonJS "module.exports" for node compatibility.
|
||||
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
||||
mod
|
||||
));
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var frame_exports = {};
|
||||
__export(frame_exports, {
|
||||
Frame: () => Frame,
|
||||
verifyLoadState: () => verifyLoadState
|
||||
});
|
||||
module.exports = __toCommonJS(frame_exports);
|
||||
var import_eventEmitter = require("./eventEmitter");
|
||||
var import_channelOwner = require("./channelOwner");
|
||||
var import_clientHelper = require("./clientHelper");
|
||||
var import_elementHandle = require("./elementHandle");
|
||||
var import_events = require("./events");
|
||||
var import_jsHandle = require("./jsHandle");
|
||||
var import_locator = require("./locator");
|
||||
var network = __toESM(require("./network"));
|
||||
var import_types = require("./types");
|
||||
var import_waiter = require("./waiter");
|
||||
var import_assert = require("../utils/isomorphic/assert");
|
||||
var import_locatorUtils = require("../utils/isomorphic/locatorUtils");
|
||||
var import_urlMatch = require("../utils/isomorphic/urlMatch");
|
||||
var import_timeoutSettings = require("./timeoutSettings");
|
||||
class Frame extends import_channelOwner.ChannelOwner {
|
||||
constructor(parent, type, guid, initializer) {
|
||||
super(parent, type, guid, initializer);
|
||||
this._parentFrame = null;
|
||||
this._url = "";
|
||||
this._name = "";
|
||||
this._detached = false;
|
||||
this._childFrames = /* @__PURE__ */ new Set();
|
||||
this._eventEmitter = new import_eventEmitter.EventEmitter(parent._platform);
|
||||
this._eventEmitter.setMaxListeners(0);
|
||||
this._parentFrame = Frame.fromNullable(initializer.parentFrame);
|
||||
if (this._parentFrame)
|
||||
this._parentFrame._childFrames.add(this);
|
||||
this._name = initializer.name;
|
||||
this._url = initializer.url;
|
||||
this._loadStates = new Set(initializer.loadStates);
|
||||
this._channel.on("loadstate", (event) => {
|
||||
if (event.add) {
|
||||
this._loadStates.add(event.add);
|
||||
this._eventEmitter.emit("loadstate", event.add);
|
||||
}
|
||||
if (event.remove)
|
||||
this._loadStates.delete(event.remove);
|
||||
if (!this._parentFrame && event.add === "load" && this._page)
|
||||
this._page.emit(import_events.Events.Page.Load, this._page);
|
||||
if (!this._parentFrame && event.add === "domcontentloaded" && this._page)
|
||||
this._page.emit(import_events.Events.Page.DOMContentLoaded, this._page);
|
||||
});
|
||||
this._channel.on("navigated", (event) => {
|
||||
this._url = event.url;
|
||||
this._name = event.name;
|
||||
this._eventEmitter.emit("navigated", event);
|
||||
if (!event.error && this._page)
|
||||
this._page.emit(import_events.Events.Page.FrameNavigated, this);
|
||||
});
|
||||
}
|
||||
static from(frame) {
|
||||
return frame._object;
|
||||
}
|
||||
static fromNullable(frame) {
|
||||
return frame ? Frame.from(frame) : null;
|
||||
}
|
||||
page() {
|
||||
return this._page;
|
||||
}
|
||||
_timeout(options) {
|
||||
const timeoutSettings = this._page?._timeoutSettings || new import_timeoutSettings.TimeoutSettings(this._platform);
|
||||
return timeoutSettings.timeout(options || {});
|
||||
}
|
||||
_navigationTimeout(options) {
|
||||
const timeoutSettings = this._page?._timeoutSettings || new import_timeoutSettings.TimeoutSettings(this._platform);
|
||||
return timeoutSettings.navigationTimeout(options || {});
|
||||
}
|
||||
async goto(url, options = {}) {
|
||||
const waitUntil = verifyLoadState("waitUntil", options.waitUntil === void 0 ? "load" : options.waitUntil);
|
||||
this.page().context()._checkUrlAllowed(url);
|
||||
return network.Response.fromNullable((await this._channel.goto({ url, ...options, waitUntil, timeout: this._navigationTimeout(options) })).response);
|
||||
}
|
||||
_setupNavigationWaiter(options) {
|
||||
const waiter = new import_waiter.Waiter(this._page, "");
|
||||
if (this._page.isClosed())
|
||||
waiter.rejectImmediately(this._page._closeErrorWithReason());
|
||||
waiter.rejectOnEvent(this._page, import_events.Events.Page.Close, () => this._page._closeErrorWithReason());
|
||||
waiter.rejectOnEvent(this._page, import_events.Events.Page.Crash, new Error("Navigation failed because page crashed!"));
|
||||
waiter.rejectOnEvent(this._page, import_events.Events.Page.FrameDetached, new Error("Navigating frame was detached!"), (frame) => frame === this);
|
||||
const timeout = this._page._timeoutSettings.navigationTimeout(options);
|
||||
waiter.rejectOnTimeout(timeout, `Timeout ${timeout}ms exceeded.`);
|
||||
return waiter;
|
||||
}
|
||||
async waitForNavigation(options = {}) {
|
||||
return await this._page._wrapApiCall(async () => {
|
||||
const waitUntil = verifyLoadState("waitUntil", options.waitUntil === void 0 ? "load" : options.waitUntil);
|
||||
const waiter = this._setupNavigationWaiter(options);
|
||||
const toUrl = typeof options.url === "string" ? ` to "${options.url}"` : "";
|
||||
waiter.log(`waiting for navigation${toUrl} until "${waitUntil}"`);
|
||||
const navigatedEvent = await waiter.waitForEvent(this._eventEmitter, "navigated", (event) => {
|
||||
if (event.error)
|
||||
return true;
|
||||
waiter.log(` navigated to "${event.url}"`);
|
||||
return (0, import_urlMatch.urlMatches)(this._page?.context()._options.baseURL, event.url, options.url);
|
||||
});
|
||||
if (navigatedEvent.error) {
|
||||
const e = new Error(navigatedEvent.error);
|
||||
e.stack = "";
|
||||
await waiter.waitForPromise(Promise.reject(e));
|
||||
}
|
||||
if (!this._loadStates.has(waitUntil)) {
|
||||
await waiter.waitForEvent(this._eventEmitter, "loadstate", (s) => {
|
||||
waiter.log(` "${s}" event fired`);
|
||||
return s === waitUntil;
|
||||
});
|
||||
}
|
||||
const request = navigatedEvent.newDocument ? network.Request.fromNullable(navigatedEvent.newDocument.request) : null;
|
||||
const response = request ? await waiter.waitForPromise(request._finalRequest()._internalResponse()) : null;
|
||||
waiter.dispose();
|
||||
return response;
|
||||
}, { title: "Wait for navigation" });
|
||||
}
|
||||
async waitForLoadState(state = "load", options = {}) {
|
||||
state = verifyLoadState("state", state);
|
||||
return await this._page._wrapApiCall(async () => {
|
||||
const waiter = this._setupNavigationWaiter(options);
|
||||
if (this._loadStates.has(state)) {
|
||||
waiter.log(` not waiting, "${state}" event already fired`);
|
||||
} else {
|
||||
await waiter.waitForEvent(this._eventEmitter, "loadstate", (s) => {
|
||||
waiter.log(` "${s}" event fired`);
|
||||
return s === state;
|
||||
});
|
||||
}
|
||||
waiter.dispose();
|
||||
}, { title: `Wait for load state "${state}"` });
|
||||
}
|
||||
async waitForURL(url, options = {}) {
|
||||
if ((0, import_urlMatch.urlMatches)(this._page?.context()._options.baseURL, this.url(), url))
|
||||
return await this.waitForLoadState(options.waitUntil, options);
|
||||
await this.waitForNavigation({ url, ...options });
|
||||
}
|
||||
async frameElement() {
|
||||
return import_elementHandle.ElementHandle.from((await this._channel.frameElement()).element);
|
||||
}
|
||||
async evaluateHandle(pageFunction, arg) {
|
||||
(0, import_jsHandle.assertMaxArguments)(arguments.length, 2);
|
||||
const result = await this._channel.evaluateExpressionHandle({ expression: String(pageFunction), isFunction: typeof pageFunction === "function", arg: (0, import_jsHandle.serializeArgument)(arg) });
|
||||
return import_jsHandle.JSHandle.from(result.handle);
|
||||
}
|
||||
async evaluate(pageFunction, arg) {
|
||||
(0, import_jsHandle.assertMaxArguments)(arguments.length, 2);
|
||||
const result = await this._channel.evaluateExpression({ expression: String(pageFunction), isFunction: typeof pageFunction === "function", arg: (0, import_jsHandle.serializeArgument)(arg) });
|
||||
return (0, import_jsHandle.parseResult)(result.value);
|
||||
}
|
||||
async _evaluateFunction(functionDeclaration) {
|
||||
const result = await this._channel.evaluateExpression({ expression: functionDeclaration, isFunction: true, arg: (0, import_jsHandle.serializeArgument)(void 0) });
|
||||
return (0, import_jsHandle.parseResult)(result.value);
|
||||
}
|
||||
async _evaluateExposeUtilityScript(pageFunction, arg) {
|
||||
(0, import_jsHandle.assertMaxArguments)(arguments.length, 2);
|
||||
const result = await this._channel.evaluateExpression({ expression: String(pageFunction), isFunction: typeof pageFunction === "function", arg: (0, import_jsHandle.serializeArgument)(arg) });
|
||||
return (0, import_jsHandle.parseResult)(result.value);
|
||||
}
|
||||
async $(selector, options) {
|
||||
const result = await this._channel.querySelector({ selector, ...options });
|
||||
return import_elementHandle.ElementHandle.fromNullable(result.element);
|
||||
}
|
||||
async waitForSelector(selector, options = {}) {
|
||||
if (options.visibility)
|
||||
throw new Error("options.visibility is not supported, did you mean options.state?");
|
||||
if (options.waitFor && options.waitFor !== "visible")
|
||||
throw new Error("options.waitFor is not supported, did you mean options.state?");
|
||||
const result = await this._channel.waitForSelector({ selector, ...options, timeout: this._timeout(options) });
|
||||
return import_elementHandle.ElementHandle.fromNullable(result.element);
|
||||
}
|
||||
async dispatchEvent(selector, type, eventInit, options = {}) {
|
||||
await this._channel.dispatchEvent({ selector, type, eventInit: (0, import_jsHandle.serializeArgument)(eventInit), ...options, timeout: this._timeout(options) });
|
||||
}
|
||||
async $eval(selector, pageFunction, arg) {
|
||||
(0, import_jsHandle.assertMaxArguments)(arguments.length, 3);
|
||||
const result = await this._channel.evalOnSelector({ selector, expression: String(pageFunction), isFunction: typeof pageFunction === "function", arg: (0, import_jsHandle.serializeArgument)(arg) });
|
||||
return (0, import_jsHandle.parseResult)(result.value);
|
||||
}
|
||||
async $$eval(selector, pageFunction, arg) {
|
||||
(0, import_jsHandle.assertMaxArguments)(arguments.length, 3);
|
||||
const result = await this._channel.evalOnSelectorAll({ selector, expression: String(pageFunction), isFunction: typeof pageFunction === "function", arg: (0, import_jsHandle.serializeArgument)(arg) });
|
||||
return (0, import_jsHandle.parseResult)(result.value);
|
||||
}
|
||||
async $$(selector) {
|
||||
const result = await this._channel.querySelectorAll({ selector });
|
||||
return result.elements.map((e) => import_elementHandle.ElementHandle.from(e));
|
||||
}
|
||||
async _queryCount(selector, options) {
|
||||
return (await this._channel.queryCount({ selector, ...options })).value;
|
||||
}
|
||||
async content() {
|
||||
return (await this._channel.content()).value;
|
||||
}
|
||||
async setContent(html, options = {}) {
|
||||
const waitUntil = verifyLoadState("waitUntil", options.waitUntil === void 0 ? "load" : options.waitUntil);
|
||||
await this._channel.setContent({ html, ...options, waitUntil, timeout: this._navigationTimeout(options) });
|
||||
}
|
||||
name() {
|
||||
return this._name || "";
|
||||
}
|
||||
url() {
|
||||
return this._url;
|
||||
}
|
||||
parentFrame() {
|
||||
return this._parentFrame;
|
||||
}
|
||||
childFrames() {
|
||||
return Array.from(this._childFrames);
|
||||
}
|
||||
isDetached() {
|
||||
return this._detached;
|
||||
}
|
||||
async addScriptTag(options = {}) {
|
||||
const copy = { ...options };
|
||||
if (copy.path) {
|
||||
copy.content = (await this._platform.fs().promises.readFile(copy.path)).toString();
|
||||
copy.content = (0, import_clientHelper.addSourceUrlToScript)(copy.content, copy.path);
|
||||
}
|
||||
return import_elementHandle.ElementHandle.from((await this._channel.addScriptTag({ ...copy })).element);
|
||||
}
|
||||
async addStyleTag(options = {}) {
|
||||
const copy = { ...options };
|
||||
if (copy.path) {
|
||||
copy.content = (await this._platform.fs().promises.readFile(copy.path)).toString();
|
||||
copy.content += "/*# sourceURL=" + copy.path.replace(/\n/g, "") + "*/";
|
||||
}
|
||||
return import_elementHandle.ElementHandle.from((await this._channel.addStyleTag({ ...copy })).element);
|
||||
}
|
||||
async click(selector, options = {}) {
|
||||
return await this._channel.click({ selector, ...options, timeout: this._timeout(options) });
|
||||
}
|
||||
async dblclick(selector, options = {}) {
|
||||
return await this._channel.dblclick({ selector, ...options, timeout: this._timeout(options) });
|
||||
}
|
||||
async dragAndDrop(source, target, options = {}) {
|
||||
return await this._channel.dragAndDrop({ source, target, ...options, timeout: this._timeout(options) });
|
||||
}
|
||||
async tap(selector, options = {}) {
|
||||
return await this._channel.tap({ selector, ...options, timeout: this._timeout(options) });
|
||||
}
|
||||
async fill(selector, value, options = {}) {
|
||||
return await this._channel.fill({ selector, value, ...options, timeout: this._timeout(options) });
|
||||
}
|
||||
async _highlight(selector) {
|
||||
return await this._channel.highlight({ selector });
|
||||
}
|
||||
locator(selector, options) {
|
||||
return new import_locator.Locator(this, selector, options);
|
||||
}
|
||||
getByTestId(testId) {
|
||||
return this.locator((0, import_locatorUtils.getByTestIdSelector)((0, import_locator.testIdAttributeName)(), testId));
|
||||
}
|
||||
getByAltText(text, options) {
|
||||
return this.locator((0, import_locatorUtils.getByAltTextSelector)(text, options));
|
||||
}
|
||||
getByLabel(text, options) {
|
||||
return this.locator((0, import_locatorUtils.getByLabelSelector)(text, options));
|
||||
}
|
||||
getByPlaceholder(text, options) {
|
||||
return this.locator((0, import_locatorUtils.getByPlaceholderSelector)(text, options));
|
||||
}
|
||||
getByText(text, options) {
|
||||
return this.locator((0, import_locatorUtils.getByTextSelector)(text, options));
|
||||
}
|
||||
getByTitle(text, options) {
|
||||
return this.locator((0, import_locatorUtils.getByTitleSelector)(text, options));
|
||||
}
|
||||
getByRole(role, options = {}) {
|
||||
return this.locator((0, import_locatorUtils.getByRoleSelector)(role, options));
|
||||
}
|
||||
frameLocator(selector) {
|
||||
return new import_locator.FrameLocator(this, selector);
|
||||
}
|
||||
async focus(selector, options = {}) {
|
||||
await this._channel.focus({ selector, ...options, timeout: this._timeout(options) });
|
||||
}
|
||||
async textContent(selector, options = {}) {
|
||||
const value = (await this._channel.textContent({ selector, ...options, timeout: this._timeout(options) })).value;
|
||||
return value === void 0 ? null : value;
|
||||
}
|
||||
async innerText(selector, options = {}) {
|
||||
return (await this._channel.innerText({ selector, ...options, timeout: this._timeout(options) })).value;
|
||||
}
|
||||
async innerHTML(selector, options = {}) {
|
||||
return (await this._channel.innerHTML({ selector, ...options, timeout: this._timeout(options) })).value;
|
||||
}
|
||||
async getAttribute(selector, name, options = {}) {
|
||||
const value = (await this._channel.getAttribute({ selector, name, ...options, timeout: this._timeout(options) })).value;
|
||||
return value === void 0 ? null : value;
|
||||
}
|
||||
async inputValue(selector, options = {}) {
|
||||
return (await this._channel.inputValue({ selector, ...options, timeout: this._timeout(options) })).value;
|
||||
}
|
||||
async isChecked(selector, options = {}) {
|
||||
return (await this._channel.isChecked({ selector, ...options, timeout: this._timeout(options) })).value;
|
||||
}
|
||||
async isDisabled(selector, options = {}) {
|
||||
return (await this._channel.isDisabled({ selector, ...options, timeout: this._timeout(options) })).value;
|
||||
}
|
||||
async isEditable(selector, options = {}) {
|
||||
return (await this._channel.isEditable({ selector, ...options, timeout: this._timeout(options) })).value;
|
||||
}
|
||||
async isEnabled(selector, options = {}) {
|
||||
return (await this._channel.isEnabled({ selector, ...options, timeout: this._timeout(options) })).value;
|
||||
}
|
||||
async isHidden(selector, options = {}) {
|
||||
return (await this._channel.isHidden({ selector, ...options })).value;
|
||||
}
|
||||
async isVisible(selector, options = {}) {
|
||||
return (await this._channel.isVisible({ selector, ...options })).value;
|
||||
}
|
||||
async hover(selector, options = {}) {
|
||||
await this._channel.hover({ selector, ...options, timeout: this._timeout(options) });
|
||||
}
|
||||
async selectOption(selector, values, options = {}) {
|
||||
return (await this._channel.selectOption({ selector, ...(0, import_elementHandle.convertSelectOptionValues)(values), ...options, timeout: this._timeout(options) })).values;
|
||||
}
|
||||
async setInputFiles(selector, files, options = {}) {
|
||||
const converted = await (0, import_elementHandle.convertInputFiles)(this._platform, files, this.page().context());
|
||||
await this._channel.setInputFiles({ selector, ...converted, ...options, timeout: this._timeout(options) });
|
||||
}
|
||||
async type(selector, text, options = {}) {
|
||||
await this._channel.type({ selector, text, ...options, timeout: this._timeout(options) });
|
||||
}
|
||||
async press(selector, key, options = {}) {
|
||||
await this._channel.press({ selector, key, ...options, timeout: this._timeout(options) });
|
||||
}
|
||||
async check(selector, options = {}) {
|
||||
await this._channel.check({ selector, ...options, timeout: this._timeout(options) });
|
||||
}
|
||||
async uncheck(selector, options = {}) {
|
||||
await this._channel.uncheck({ selector, ...options, timeout: this._timeout(options) });
|
||||
}
|
||||
async setChecked(selector, checked, options) {
|
||||
if (checked)
|
||||
await this.check(selector, options);
|
||||
else
|
||||
await this.uncheck(selector, options);
|
||||
}
|
||||
async waitForTimeout(timeout) {
|
||||
await this._channel.waitForTimeout({ waitTimeout: timeout });
|
||||
}
|
||||
async waitForFunction(pageFunction, arg, options = {}) {
|
||||
if (typeof options.polling === "string")
|
||||
(0, import_assert.assert)(options.polling === "raf", "Unknown polling option: " + options.polling);
|
||||
const result = await this._channel.waitForFunction({
|
||||
...options,
|
||||
pollingInterval: options.polling === "raf" ? void 0 : options.polling,
|
||||
expression: String(pageFunction),
|
||||
isFunction: typeof pageFunction === "function",
|
||||
arg: (0, import_jsHandle.serializeArgument)(arg),
|
||||
timeout: this._timeout(options)
|
||||
});
|
||||
return import_jsHandle.JSHandle.from(result.handle);
|
||||
}
|
||||
async title() {
|
||||
return (await this._channel.title()).value;
|
||||
}
|
||||
async _expect(expression, options) {
|
||||
const params = { expression, ...options, isNot: !!options.isNot };
|
||||
params.expectedValue = (0, import_jsHandle.serializeArgument)(options.expectedValue);
|
||||
const result = await this._channel.expect(params);
|
||||
if (result.received !== void 0)
|
||||
result.received = (0, import_jsHandle.parseResult)(result.received);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
function verifyLoadState(name, waitUntil) {
|
||||
if (waitUntil === "networkidle0")
|
||||
waitUntil = "networkidle";
|
||||
if (!import_types.kLifecycleEvents.has(waitUntil))
|
||||
throw new Error(`${name}: expected one of (load|domcontentloaded|networkidle|commit)`);
|
||||
return waitUntil;
|
||||
}
|
||||
// Annotate the CommonJS export names for ESM import in node:
|
||||
0 && (module.exports = {
|
||||
Frame,
|
||||
verifyLoadState
|
||||
});
|
||||
87
projects/org-skill-web-research/node_modules/playwright-core/lib/client/harRouter.js
generated
vendored
Normal file
87
projects/org-skill-web-research/node_modules/playwright-core/lib/client/harRouter.js
generated
vendored
Normal file
@@ -0,0 +1,87 @@
|
||||
"use strict";
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var harRouter_exports = {};
|
||||
__export(harRouter_exports, {
|
||||
HarRouter: () => HarRouter
|
||||
});
|
||||
module.exports = __toCommonJS(harRouter_exports);
|
||||
class HarRouter {
|
||||
static async create(localUtils, file, notFoundAction, options) {
|
||||
const { harId, error } = await localUtils.harOpen({ file });
|
||||
if (error)
|
||||
throw new Error(error);
|
||||
return new HarRouter(localUtils, harId, notFoundAction, options);
|
||||
}
|
||||
constructor(localUtils, harId, notFoundAction, options) {
|
||||
this._localUtils = localUtils;
|
||||
this._harId = harId;
|
||||
this._options = options;
|
||||
this._notFoundAction = notFoundAction;
|
||||
}
|
||||
async _handle(route) {
|
||||
const request = route.request();
|
||||
const response = await this._localUtils.harLookup({
|
||||
harId: this._harId,
|
||||
url: request.url(),
|
||||
method: request.method(),
|
||||
headers: await request.headersArray(),
|
||||
postData: request.postDataBuffer() || void 0,
|
||||
isNavigationRequest: request.isNavigationRequest()
|
||||
});
|
||||
if (response.action === "redirect") {
|
||||
route._platform.log("api", `HAR: ${route.request().url()} redirected to ${response.redirectURL}`);
|
||||
await route._redirectNavigationRequest(response.redirectURL);
|
||||
return;
|
||||
}
|
||||
if (response.action === "fulfill") {
|
||||
if (response.status === -1)
|
||||
return;
|
||||
await route.fulfill({
|
||||
status: response.status,
|
||||
headers: Object.fromEntries(response.headers.map((h) => [h.name, h.value])),
|
||||
body: response.body
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (response.action === "error")
|
||||
route._platform.log("api", "HAR: " + response.message);
|
||||
if (this._notFoundAction === "abort") {
|
||||
await route.abort();
|
||||
return;
|
||||
}
|
||||
await route.fallback();
|
||||
}
|
||||
async addContextRoute(context) {
|
||||
await context.route(this._options.urlMatch || "**/*", (route) => this._handle(route));
|
||||
}
|
||||
async addPageRoute(page) {
|
||||
await page.route(this._options.urlMatch || "**/*", (route) => this._handle(route));
|
||||
}
|
||||
async [Symbol.asyncDispose]() {
|
||||
await this.dispose();
|
||||
}
|
||||
dispose() {
|
||||
this._localUtils.harClose({ harId: this._harId }).catch(() => {
|
||||
});
|
||||
}
|
||||
}
|
||||
// Annotate the CommonJS export names for ESM import in node:
|
||||
0 && (module.exports = {
|
||||
HarRouter
|
||||
});
|
||||
84
projects/org-skill-web-research/node_modules/playwright-core/lib/client/input.js
generated
vendored
Normal file
84
projects/org-skill-web-research/node_modules/playwright-core/lib/client/input.js
generated
vendored
Normal file
@@ -0,0 +1,84 @@
|
||||
"use strict";
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var input_exports = {};
|
||||
__export(input_exports, {
|
||||
Keyboard: () => Keyboard,
|
||||
Mouse: () => Mouse,
|
||||
Touchscreen: () => Touchscreen
|
||||
});
|
||||
module.exports = __toCommonJS(input_exports);
|
||||
class Keyboard {
|
||||
constructor(page) {
|
||||
this._page = page;
|
||||
}
|
||||
async down(key) {
|
||||
await this._page._channel.keyboardDown({ key });
|
||||
}
|
||||
async up(key) {
|
||||
await this._page._channel.keyboardUp({ key });
|
||||
}
|
||||
async insertText(text) {
|
||||
await this._page._channel.keyboardInsertText({ text });
|
||||
}
|
||||
async type(text, options = {}) {
|
||||
await this._page._channel.keyboardType({ text, ...options });
|
||||
}
|
||||
async press(key, options = {}) {
|
||||
await this._page._channel.keyboardPress({ key, ...options });
|
||||
}
|
||||
}
|
||||
class Mouse {
|
||||
constructor(page) {
|
||||
this._page = page;
|
||||
}
|
||||
async move(x, y, options = {}) {
|
||||
await this._page._channel.mouseMove({ x, y, ...options });
|
||||
}
|
||||
async down(options = {}) {
|
||||
await this._page._channel.mouseDown({ ...options });
|
||||
}
|
||||
async up(options = {}) {
|
||||
await this._page._channel.mouseUp(options);
|
||||
}
|
||||
async click(x, y, options = {}) {
|
||||
await this._page._channel.mouseClick({ x, y, ...options });
|
||||
}
|
||||
async dblclick(x, y, options = {}) {
|
||||
await this._page._wrapApiCall(async () => {
|
||||
await this.click(x, y, { ...options, clickCount: 2 });
|
||||
}, { title: "Double click" });
|
||||
}
|
||||
async wheel(deltaX, deltaY) {
|
||||
await this._page._channel.mouseWheel({ deltaX, deltaY });
|
||||
}
|
||||
}
|
||||
class Touchscreen {
|
||||
constructor(page) {
|
||||
this._page = page;
|
||||
}
|
||||
async tap(x, y) {
|
||||
await this._page._channel.touchscreenTap({ x, y });
|
||||
}
|
||||
}
|
||||
// Annotate the CommonJS export names for ESM import in node:
|
||||
0 && (module.exports = {
|
||||
Keyboard,
|
||||
Mouse,
|
||||
Touchscreen
|
||||
});
|
||||
109
projects/org-skill-web-research/node_modules/playwright-core/lib/client/jsHandle.js
generated
vendored
Normal file
109
projects/org-skill-web-research/node_modules/playwright-core/lib/client/jsHandle.js
generated
vendored
Normal file
@@ -0,0 +1,109 @@
|
||||
"use strict";
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var jsHandle_exports = {};
|
||||
__export(jsHandle_exports, {
|
||||
JSHandle: () => JSHandle,
|
||||
assertMaxArguments: () => assertMaxArguments,
|
||||
parseResult: () => parseResult,
|
||||
serializeArgument: () => serializeArgument
|
||||
});
|
||||
module.exports = __toCommonJS(jsHandle_exports);
|
||||
var import_channelOwner = require("./channelOwner");
|
||||
var import_errors = require("./errors");
|
||||
var import_serializers = require("../protocol/serializers");
|
||||
class JSHandle extends import_channelOwner.ChannelOwner {
|
||||
static from(handle) {
|
||||
return handle._object;
|
||||
}
|
||||
constructor(parent, type, guid, initializer) {
|
||||
super(parent, type, guid, initializer);
|
||||
this._preview = this._initializer.preview;
|
||||
this._channel.on("previewUpdated", ({ preview }) => this._preview = preview);
|
||||
}
|
||||
async evaluate(pageFunction, arg) {
|
||||
const result = await this._channel.evaluateExpression({ expression: String(pageFunction), isFunction: typeof pageFunction === "function", arg: serializeArgument(arg) });
|
||||
return parseResult(result.value);
|
||||
}
|
||||
async _evaluateFunction(functionDeclaration) {
|
||||
const result = await this._channel.evaluateExpression({ expression: functionDeclaration, isFunction: true, arg: serializeArgument(void 0) });
|
||||
return parseResult(result.value);
|
||||
}
|
||||
async evaluateHandle(pageFunction, arg) {
|
||||
const result = await this._channel.evaluateExpressionHandle({ expression: String(pageFunction), isFunction: typeof pageFunction === "function", arg: serializeArgument(arg) });
|
||||
return JSHandle.from(result.handle);
|
||||
}
|
||||
async getProperty(propertyName) {
|
||||
const result = await this._channel.getProperty({ name: propertyName });
|
||||
return JSHandle.from(result.handle);
|
||||
}
|
||||
async getProperties() {
|
||||
const map = /* @__PURE__ */ new Map();
|
||||
for (const { name, value } of (await this._channel.getPropertyList()).properties)
|
||||
map.set(name, JSHandle.from(value));
|
||||
return map;
|
||||
}
|
||||
async jsonValue() {
|
||||
return parseResult((await this._channel.jsonValue()).value);
|
||||
}
|
||||
asElement() {
|
||||
return null;
|
||||
}
|
||||
async [Symbol.asyncDispose]() {
|
||||
await this.dispose();
|
||||
}
|
||||
async dispose() {
|
||||
try {
|
||||
await this._channel.dispose();
|
||||
} catch (e) {
|
||||
if ((0, import_errors.isTargetClosedError)(e))
|
||||
return;
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
toString() {
|
||||
return this._preview;
|
||||
}
|
||||
}
|
||||
function serializeArgument(arg) {
|
||||
const handles = [];
|
||||
const pushHandle = (channel) => {
|
||||
handles.push(channel);
|
||||
return handles.length - 1;
|
||||
};
|
||||
const value = (0, import_serializers.serializeValue)(arg, (value2) => {
|
||||
if (value2 instanceof JSHandle)
|
||||
return { h: pushHandle(value2._channel) };
|
||||
return { fallThrough: value2 };
|
||||
});
|
||||
return { value, handles };
|
||||
}
|
||||
function parseResult(value) {
|
||||
return (0, import_serializers.parseSerializedValue)(value, void 0);
|
||||
}
|
||||
function assertMaxArguments(count, max) {
|
||||
if (count > max)
|
||||
throw new Error("Too many arguments. If you need to pass more than 1 argument to the function wrap them in an object.");
|
||||
}
|
||||
// Annotate the CommonJS export names for ESM import in node:
|
||||
0 && (module.exports = {
|
||||
JSHandle,
|
||||
assertMaxArguments,
|
||||
parseResult,
|
||||
serializeArgument
|
||||
});
|
||||
39
projects/org-skill-web-research/node_modules/playwright-core/lib/client/jsonPipe.js
generated
vendored
Normal file
39
projects/org-skill-web-research/node_modules/playwright-core/lib/client/jsonPipe.js
generated
vendored
Normal file
@@ -0,0 +1,39 @@
|
||||
"use strict";
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var jsonPipe_exports = {};
|
||||
__export(jsonPipe_exports, {
|
||||
JsonPipe: () => JsonPipe
|
||||
});
|
||||
module.exports = __toCommonJS(jsonPipe_exports);
|
||||
var import_channelOwner = require("./channelOwner");
|
||||
class JsonPipe extends import_channelOwner.ChannelOwner {
|
||||
static from(jsonPipe) {
|
||||
return jsonPipe._object;
|
||||
}
|
||||
constructor(parent, type, guid, initializer) {
|
||||
super(parent, type, guid, initializer);
|
||||
}
|
||||
channel() {
|
||||
return this._channel;
|
||||
}
|
||||
}
|
||||
// Annotate the CommonJS export names for ESM import in node:
|
||||
0 && (module.exports = {
|
||||
JsonPipe
|
||||
});
|
||||
60
projects/org-skill-web-research/node_modules/playwright-core/lib/client/localUtils.js
generated
vendored
Normal file
60
projects/org-skill-web-research/node_modules/playwright-core/lib/client/localUtils.js
generated
vendored
Normal file
@@ -0,0 +1,60 @@
|
||||
"use strict";
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var localUtils_exports = {};
|
||||
__export(localUtils_exports, {
|
||||
LocalUtils: () => LocalUtils
|
||||
});
|
||||
module.exports = __toCommonJS(localUtils_exports);
|
||||
var import_channelOwner = require("./channelOwner");
|
||||
class LocalUtils extends import_channelOwner.ChannelOwner {
|
||||
constructor(parent, type, guid, initializer) {
|
||||
super(parent, type, guid, initializer);
|
||||
this.devices = {};
|
||||
for (const { name, descriptor } of initializer.deviceDescriptors)
|
||||
this.devices[name] = descriptor;
|
||||
}
|
||||
async zip(params) {
|
||||
return await this._channel.zip(params);
|
||||
}
|
||||
async harOpen(params) {
|
||||
return await this._channel.harOpen(params);
|
||||
}
|
||||
async harLookup(params) {
|
||||
return await this._channel.harLookup(params);
|
||||
}
|
||||
async harClose(params) {
|
||||
return await this._channel.harClose(params);
|
||||
}
|
||||
async harUnzip(params) {
|
||||
return await this._channel.harUnzip(params);
|
||||
}
|
||||
async tracingStarted(params) {
|
||||
return await this._channel.tracingStarted(params);
|
||||
}
|
||||
async traceDiscarded(params) {
|
||||
return await this._channel.traceDiscarded(params);
|
||||
}
|
||||
async addStackToTracingNoReply(params) {
|
||||
return await this._channel.addStackToTracingNoReply(params);
|
||||
}
|
||||
}
|
||||
// Annotate the CommonJS export names for ESM import in node:
|
||||
0 && (module.exports = {
|
||||
LocalUtils
|
||||
});
|
||||
369
projects/org-skill-web-research/node_modules/playwright-core/lib/client/locator.js
generated
vendored
Normal file
369
projects/org-skill-web-research/node_modules/playwright-core/lib/client/locator.js
generated
vendored
Normal file
@@ -0,0 +1,369 @@
|
||||
"use strict";
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var locator_exports = {};
|
||||
__export(locator_exports, {
|
||||
FrameLocator: () => FrameLocator,
|
||||
Locator: () => Locator,
|
||||
setTestIdAttribute: () => setTestIdAttribute,
|
||||
testIdAttributeName: () => testIdAttributeName
|
||||
});
|
||||
module.exports = __toCommonJS(locator_exports);
|
||||
var import_elementHandle = require("./elementHandle");
|
||||
var import_locatorGenerators = require("../utils/isomorphic/locatorGenerators");
|
||||
var import_locatorUtils = require("../utils/isomorphic/locatorUtils");
|
||||
var import_stringUtils = require("../utils/isomorphic/stringUtils");
|
||||
var import_rtti = require("../utils/isomorphic/rtti");
|
||||
var import_time = require("../utils/isomorphic/time");
|
||||
class Locator {
|
||||
constructor(frame, selector, options) {
|
||||
this._frame = frame;
|
||||
this._selector = selector;
|
||||
if (options?.hasText)
|
||||
this._selector += ` >> internal:has-text=${(0, import_stringUtils.escapeForTextSelector)(options.hasText, false)}`;
|
||||
if (options?.hasNotText)
|
||||
this._selector += ` >> internal:has-not-text=${(0, import_stringUtils.escapeForTextSelector)(options.hasNotText, false)}`;
|
||||
if (options?.has) {
|
||||
const locator = options.has;
|
||||
if (locator._frame !== frame)
|
||||
throw new Error(`Inner "has" locator must belong to the same frame.`);
|
||||
this._selector += ` >> internal:has=` + JSON.stringify(locator._selector);
|
||||
}
|
||||
if (options?.hasNot) {
|
||||
const locator = options.hasNot;
|
||||
if (locator._frame !== frame)
|
||||
throw new Error(`Inner "hasNot" locator must belong to the same frame.`);
|
||||
this._selector += ` >> internal:has-not=` + JSON.stringify(locator._selector);
|
||||
}
|
||||
if (options?.visible !== void 0)
|
||||
this._selector += ` >> visible=${options.visible ? "true" : "false"}`;
|
||||
if (this._frame._platform.inspectCustom)
|
||||
this[this._frame._platform.inspectCustom] = () => this._inspect();
|
||||
}
|
||||
async _withElement(task, options) {
|
||||
const timeout = this._frame._timeout({ timeout: options.timeout });
|
||||
const deadline = timeout ? (0, import_time.monotonicTime)() + timeout : 0;
|
||||
return await this._frame._wrapApiCall(async () => {
|
||||
const result = await this._frame._channel.waitForSelector({ selector: this._selector, strict: true, state: "attached", timeout });
|
||||
const handle = import_elementHandle.ElementHandle.fromNullable(result.element);
|
||||
if (!handle)
|
||||
throw new Error(`Could not resolve ${this._selector} to DOM Element`);
|
||||
try {
|
||||
return await task(handle, deadline ? deadline - (0, import_time.monotonicTime)() : 0);
|
||||
} finally {
|
||||
await handle.dispose();
|
||||
}
|
||||
}, { title: options.title, internal: options.internal });
|
||||
}
|
||||
_equals(locator) {
|
||||
return this._frame === locator._frame && this._selector === locator._selector;
|
||||
}
|
||||
page() {
|
||||
return this._frame.page();
|
||||
}
|
||||
async boundingBox(options) {
|
||||
return await this._withElement((h) => h.boundingBox(), { title: "Bounding box", timeout: options?.timeout });
|
||||
}
|
||||
async check(options = {}) {
|
||||
return await this._frame.check(this._selector, { strict: true, ...options });
|
||||
}
|
||||
async click(options = {}) {
|
||||
return await this._frame.click(this._selector, { strict: true, ...options });
|
||||
}
|
||||
async dblclick(options = {}) {
|
||||
await this._frame.dblclick(this._selector, { strict: true, ...options });
|
||||
}
|
||||
async dispatchEvent(type, eventInit = {}, options) {
|
||||
return await this._frame.dispatchEvent(this._selector, type, eventInit, { strict: true, ...options });
|
||||
}
|
||||
async dragTo(target, options = {}) {
|
||||
return await this._frame.dragAndDrop(this._selector, target._selector, {
|
||||
strict: true,
|
||||
...options
|
||||
});
|
||||
}
|
||||
async evaluate(pageFunction, arg, options) {
|
||||
return await this._withElement((h) => h.evaluate(pageFunction, arg), { title: "Evaluate", timeout: options?.timeout });
|
||||
}
|
||||
async _evaluateFunction(functionDeclaration, options) {
|
||||
return await this._withElement((h) => h._evaluateFunction(functionDeclaration), { title: "Evaluate", timeout: options?.timeout });
|
||||
}
|
||||
async evaluateAll(pageFunction, arg) {
|
||||
return await this._frame.$$eval(this._selector, pageFunction, arg);
|
||||
}
|
||||
async evaluateHandle(pageFunction, arg, options) {
|
||||
return await this._withElement((h) => h.evaluateHandle(pageFunction, arg), { title: "Evaluate", timeout: options?.timeout });
|
||||
}
|
||||
async fill(value, options = {}) {
|
||||
return await this._frame.fill(this._selector, value, { strict: true, ...options });
|
||||
}
|
||||
async clear(options = {}) {
|
||||
await this._frame._wrapApiCall(() => this.fill("", options), { title: "Clear" });
|
||||
}
|
||||
async _highlight() {
|
||||
return await this._frame._highlight(this._selector);
|
||||
}
|
||||
async highlight() {
|
||||
return await this._frame._highlight(this._selector);
|
||||
}
|
||||
locator(selectorOrLocator, options) {
|
||||
if ((0, import_rtti.isString)(selectorOrLocator))
|
||||
return new Locator(this._frame, this._selector + " >> " + selectorOrLocator, options);
|
||||
if (selectorOrLocator._frame !== this._frame)
|
||||
throw new Error(`Locators must belong to the same frame.`);
|
||||
return new Locator(this._frame, this._selector + " >> internal:chain=" + JSON.stringify(selectorOrLocator._selector), options);
|
||||
}
|
||||
getByTestId(testId) {
|
||||
return this.locator((0, import_locatorUtils.getByTestIdSelector)(testIdAttributeName(), testId));
|
||||
}
|
||||
getByAltText(text, options) {
|
||||
return this.locator((0, import_locatorUtils.getByAltTextSelector)(text, options));
|
||||
}
|
||||
getByLabel(text, options) {
|
||||
return this.locator((0, import_locatorUtils.getByLabelSelector)(text, options));
|
||||
}
|
||||
getByPlaceholder(text, options) {
|
||||
return this.locator((0, import_locatorUtils.getByPlaceholderSelector)(text, options));
|
||||
}
|
||||
getByText(text, options) {
|
||||
return this.locator((0, import_locatorUtils.getByTextSelector)(text, options));
|
||||
}
|
||||
getByTitle(text, options) {
|
||||
return this.locator((0, import_locatorUtils.getByTitleSelector)(text, options));
|
||||
}
|
||||
getByRole(role, options = {}) {
|
||||
return this.locator((0, import_locatorUtils.getByRoleSelector)(role, options));
|
||||
}
|
||||
frameLocator(selector) {
|
||||
return new FrameLocator(this._frame, this._selector + " >> " + selector);
|
||||
}
|
||||
filter(options) {
|
||||
return new Locator(this._frame, this._selector, options);
|
||||
}
|
||||
async elementHandle(options) {
|
||||
return await this._frame.waitForSelector(this._selector, { strict: true, state: "attached", ...options });
|
||||
}
|
||||
async elementHandles() {
|
||||
return await this._frame.$$(this._selector);
|
||||
}
|
||||
contentFrame() {
|
||||
return new FrameLocator(this._frame, this._selector);
|
||||
}
|
||||
describe(description) {
|
||||
return new Locator(this._frame, this._selector + " >> internal:describe=" + JSON.stringify(description));
|
||||
}
|
||||
description() {
|
||||
return (0, import_locatorGenerators.locatorCustomDescription)(this._selector) || null;
|
||||
}
|
||||
first() {
|
||||
return new Locator(this._frame, this._selector + " >> nth=0");
|
||||
}
|
||||
last() {
|
||||
return new Locator(this._frame, this._selector + ` >> nth=-1`);
|
||||
}
|
||||
nth(index) {
|
||||
return new Locator(this._frame, this._selector + ` >> nth=${index}`);
|
||||
}
|
||||
and(locator) {
|
||||
if (locator._frame !== this._frame)
|
||||
throw new Error(`Locators must belong to the same frame.`);
|
||||
return new Locator(this._frame, this._selector + ` >> internal:and=` + JSON.stringify(locator._selector));
|
||||
}
|
||||
or(locator) {
|
||||
if (locator._frame !== this._frame)
|
||||
throw new Error(`Locators must belong to the same frame.`);
|
||||
return new Locator(this._frame, this._selector + ` >> internal:or=` + JSON.stringify(locator._selector));
|
||||
}
|
||||
async focus(options) {
|
||||
return await this._frame.focus(this._selector, { strict: true, ...options });
|
||||
}
|
||||
async blur(options) {
|
||||
await this._frame._channel.blur({ selector: this._selector, strict: true, ...options, timeout: this._frame._timeout(options) });
|
||||
}
|
||||
// options are only here for testing
|
||||
async count(_options) {
|
||||
return await this._frame._queryCount(this._selector, _options);
|
||||
}
|
||||
async _resolveSelector() {
|
||||
return await this._frame._channel.resolveSelector({ selector: this._selector });
|
||||
}
|
||||
async getAttribute(name, options) {
|
||||
return await this._frame.getAttribute(this._selector, name, { strict: true, ...options });
|
||||
}
|
||||
async hover(options = {}) {
|
||||
return await this._frame.hover(this._selector, { strict: true, ...options });
|
||||
}
|
||||
async innerHTML(options) {
|
||||
return await this._frame.innerHTML(this._selector, { strict: true, ...options });
|
||||
}
|
||||
async innerText(options) {
|
||||
return await this._frame.innerText(this._selector, { strict: true, ...options });
|
||||
}
|
||||
async inputValue(options) {
|
||||
return await this._frame.inputValue(this._selector, { strict: true, ...options });
|
||||
}
|
||||
async isChecked(options) {
|
||||
return await this._frame.isChecked(this._selector, { strict: true, ...options });
|
||||
}
|
||||
async isDisabled(options) {
|
||||
return await this._frame.isDisabled(this._selector, { strict: true, ...options });
|
||||
}
|
||||
async isEditable(options) {
|
||||
return await this._frame.isEditable(this._selector, { strict: true, ...options });
|
||||
}
|
||||
async isEnabled(options) {
|
||||
return await this._frame.isEnabled(this._selector, { strict: true, ...options });
|
||||
}
|
||||
async isHidden(options) {
|
||||
return await this._frame.isHidden(this._selector, { strict: true, ...options });
|
||||
}
|
||||
async isVisible(options) {
|
||||
return await this._frame.isVisible(this._selector, { strict: true, ...options });
|
||||
}
|
||||
async press(key, options = {}) {
|
||||
return await this._frame.press(this._selector, key, { strict: true, ...options });
|
||||
}
|
||||
async screenshot(options = {}) {
|
||||
const mask = options.mask;
|
||||
return await this._withElement((h, timeout) => h.screenshot({ ...options, mask, timeout }), { title: "Screenshot", timeout: options.timeout });
|
||||
}
|
||||
async ariaSnapshot(options) {
|
||||
const result = await this._frame._channel.ariaSnapshot({ ...options, selector: this._selector, timeout: this._frame._timeout(options) });
|
||||
return result.snapshot;
|
||||
}
|
||||
async scrollIntoViewIfNeeded(options = {}) {
|
||||
return await this._withElement((h, timeout) => h.scrollIntoViewIfNeeded({ ...options, timeout }), { title: "Scroll into view", timeout: options.timeout });
|
||||
}
|
||||
async selectOption(values, options = {}) {
|
||||
return await this._frame.selectOption(this._selector, values, { strict: true, ...options });
|
||||
}
|
||||
async selectText(options = {}) {
|
||||
return await this._withElement((h, timeout) => h.selectText({ ...options, timeout }), { title: "Select text", timeout: options.timeout });
|
||||
}
|
||||
async setChecked(checked, options) {
|
||||
if (checked)
|
||||
await this.check(options);
|
||||
else
|
||||
await this.uncheck(options);
|
||||
}
|
||||
async setInputFiles(files, options = {}) {
|
||||
return await this._frame.setInputFiles(this._selector, files, { strict: true, ...options });
|
||||
}
|
||||
async tap(options = {}) {
|
||||
return await this._frame.tap(this._selector, { strict: true, ...options });
|
||||
}
|
||||
async textContent(options) {
|
||||
return await this._frame.textContent(this._selector, { strict: true, ...options });
|
||||
}
|
||||
async type(text, options = {}) {
|
||||
return await this._frame.type(this._selector, text, { strict: true, ...options });
|
||||
}
|
||||
async pressSequentially(text, options = {}) {
|
||||
return await this.type(text, options);
|
||||
}
|
||||
async uncheck(options = {}) {
|
||||
return await this._frame.uncheck(this._selector, { strict: true, ...options });
|
||||
}
|
||||
async all() {
|
||||
return new Array(await this.count()).fill(0).map((e, i) => this.nth(i));
|
||||
}
|
||||
async allInnerTexts() {
|
||||
return await this._frame.$$eval(this._selector, (ee) => ee.map((e) => e.innerText));
|
||||
}
|
||||
async allTextContents() {
|
||||
return await this._frame.$$eval(this._selector, (ee) => ee.map((e) => e.textContent || ""));
|
||||
}
|
||||
async waitFor(options) {
|
||||
await this._frame._channel.waitForSelector({ selector: this._selector, strict: true, omitReturnValue: true, ...options, timeout: this._frame._timeout(options) });
|
||||
}
|
||||
async _expect(expression, options) {
|
||||
return this._frame._expect(expression, {
|
||||
...options,
|
||||
selector: this._selector
|
||||
});
|
||||
}
|
||||
_inspect() {
|
||||
return this.toString();
|
||||
}
|
||||
toString() {
|
||||
return (0, import_locatorGenerators.asLocatorDescription)("javascript", this._selector);
|
||||
}
|
||||
}
|
||||
class FrameLocator {
|
||||
constructor(frame, selector) {
|
||||
this._frame = frame;
|
||||
this._frameSelector = selector;
|
||||
}
|
||||
locator(selectorOrLocator, options) {
|
||||
if ((0, import_rtti.isString)(selectorOrLocator))
|
||||
return new Locator(this._frame, this._frameSelector + " >> internal:control=enter-frame >> " + selectorOrLocator, options);
|
||||
if (selectorOrLocator._frame !== this._frame)
|
||||
throw new Error(`Locators must belong to the same frame.`);
|
||||
return new Locator(this._frame, this._frameSelector + " >> internal:control=enter-frame >> " + selectorOrLocator._selector, options);
|
||||
}
|
||||
getByTestId(testId) {
|
||||
return this.locator((0, import_locatorUtils.getByTestIdSelector)(testIdAttributeName(), testId));
|
||||
}
|
||||
getByAltText(text, options) {
|
||||
return this.locator((0, import_locatorUtils.getByAltTextSelector)(text, options));
|
||||
}
|
||||
getByLabel(text, options) {
|
||||
return this.locator((0, import_locatorUtils.getByLabelSelector)(text, options));
|
||||
}
|
||||
getByPlaceholder(text, options) {
|
||||
return this.locator((0, import_locatorUtils.getByPlaceholderSelector)(text, options));
|
||||
}
|
||||
getByText(text, options) {
|
||||
return this.locator((0, import_locatorUtils.getByTextSelector)(text, options));
|
||||
}
|
||||
getByTitle(text, options) {
|
||||
return this.locator((0, import_locatorUtils.getByTitleSelector)(text, options));
|
||||
}
|
||||
getByRole(role, options = {}) {
|
||||
return this.locator((0, import_locatorUtils.getByRoleSelector)(role, options));
|
||||
}
|
||||
owner() {
|
||||
return new Locator(this._frame, this._frameSelector);
|
||||
}
|
||||
frameLocator(selector) {
|
||||
return new FrameLocator(this._frame, this._frameSelector + " >> internal:control=enter-frame >> " + selector);
|
||||
}
|
||||
first() {
|
||||
return new FrameLocator(this._frame, this._frameSelector + " >> nth=0");
|
||||
}
|
||||
last() {
|
||||
return new FrameLocator(this._frame, this._frameSelector + ` >> nth=-1`);
|
||||
}
|
||||
nth(index) {
|
||||
return new FrameLocator(this._frame, this._frameSelector + ` >> nth=${index}`);
|
||||
}
|
||||
}
|
||||
let _testIdAttributeName = "data-testid";
|
||||
function testIdAttributeName() {
|
||||
return _testIdAttributeName;
|
||||
}
|
||||
function setTestIdAttribute(attributeName) {
|
||||
_testIdAttributeName = attributeName;
|
||||
}
|
||||
// Annotate the CommonJS export names for ESM import in node:
|
||||
0 && (module.exports = {
|
||||
FrameLocator,
|
||||
Locator,
|
||||
setTestIdAttribute,
|
||||
testIdAttributeName
|
||||
});
|
||||
747
projects/org-skill-web-research/node_modules/playwright-core/lib/client/network.js
generated
vendored
Normal file
747
projects/org-skill-web-research/node_modules/playwright-core/lib/client/network.js
generated
vendored
Normal file
@@ -0,0 +1,747 @@
|
||||
"use strict";
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var network_exports = {};
|
||||
__export(network_exports, {
|
||||
RawHeaders: () => RawHeaders,
|
||||
Request: () => Request,
|
||||
Response: () => Response,
|
||||
Route: () => Route,
|
||||
RouteHandler: () => RouteHandler,
|
||||
WebSocket: () => WebSocket,
|
||||
WebSocketRoute: () => WebSocketRoute,
|
||||
WebSocketRouteHandler: () => WebSocketRouteHandler,
|
||||
validateHeaders: () => validateHeaders
|
||||
});
|
||||
module.exports = __toCommonJS(network_exports);
|
||||
var import_channelOwner = require("./channelOwner");
|
||||
var import_errors = require("./errors");
|
||||
var import_events = require("./events");
|
||||
var import_fetch = require("./fetch");
|
||||
var import_frame = require("./frame");
|
||||
var import_waiter = require("./waiter");
|
||||
var import_worker = require("./worker");
|
||||
var import_assert = require("../utils/isomorphic/assert");
|
||||
var import_headers = require("../utils/isomorphic/headers");
|
||||
var import_urlMatch = require("../utils/isomorphic/urlMatch");
|
||||
var import_manualPromise = require("../utils/isomorphic/manualPromise");
|
||||
var import_multimap = require("../utils/isomorphic/multimap");
|
||||
var import_rtti = require("../utils/isomorphic/rtti");
|
||||
var import_stackTrace = require("../utils/isomorphic/stackTrace");
|
||||
var import_mimeType = require("../utils/isomorphic/mimeType");
|
||||
class Request extends import_channelOwner.ChannelOwner {
|
||||
constructor(parent, type, guid, initializer) {
|
||||
super(parent, type, guid, initializer);
|
||||
this._redirectedFrom = null;
|
||||
this._redirectedTo = null;
|
||||
this._failureText = null;
|
||||
this._fallbackOverrides = {};
|
||||
this._hasResponse = false;
|
||||
this._redirectedFrom = Request.fromNullable(initializer.redirectedFrom);
|
||||
if (this._redirectedFrom)
|
||||
this._redirectedFrom._redirectedTo = this;
|
||||
this._provisionalHeaders = new RawHeaders(initializer.headers);
|
||||
this._timing = {
|
||||
startTime: 0,
|
||||
domainLookupStart: -1,
|
||||
domainLookupEnd: -1,
|
||||
connectStart: -1,
|
||||
secureConnectionStart: -1,
|
||||
connectEnd: -1,
|
||||
requestStart: -1,
|
||||
responseStart: -1,
|
||||
responseEnd: -1
|
||||
};
|
||||
this._hasResponse = this._initializer.hasResponse;
|
||||
this._channel.on("response", () => this._hasResponse = true);
|
||||
}
|
||||
static from(request) {
|
||||
return request._object;
|
||||
}
|
||||
static fromNullable(request) {
|
||||
return request ? Request.from(request) : null;
|
||||
}
|
||||
url() {
|
||||
return this._fallbackOverrides.url || this._initializer.url;
|
||||
}
|
||||
resourceType() {
|
||||
return this._initializer.resourceType;
|
||||
}
|
||||
method() {
|
||||
return this._fallbackOverrides.method || this._initializer.method;
|
||||
}
|
||||
postData() {
|
||||
return (this._fallbackOverrides.postDataBuffer || this._initializer.postData)?.toString("utf-8") || null;
|
||||
}
|
||||
postDataBuffer() {
|
||||
return this._fallbackOverrides.postDataBuffer || this._initializer.postData || null;
|
||||
}
|
||||
postDataJSON() {
|
||||
const postData = this.postData();
|
||||
if (!postData)
|
||||
return null;
|
||||
const contentType = this.headers()["content-type"];
|
||||
if (contentType?.includes("application/x-www-form-urlencoded")) {
|
||||
const entries = {};
|
||||
const parsed = new URLSearchParams(postData);
|
||||
for (const [k, v] of parsed.entries())
|
||||
entries[k] = v;
|
||||
return entries;
|
||||
}
|
||||
try {
|
||||
return JSON.parse(postData);
|
||||
} catch (e) {
|
||||
throw new Error("POST data is not a valid JSON object: " + postData);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* @deprecated
|
||||
*/
|
||||
headers() {
|
||||
if (this._fallbackOverrides.headers)
|
||||
return RawHeaders._fromHeadersObjectLossy(this._fallbackOverrides.headers).headers();
|
||||
return this._provisionalHeaders.headers();
|
||||
}
|
||||
async _actualHeaders() {
|
||||
if (this._fallbackOverrides.headers)
|
||||
return RawHeaders._fromHeadersObjectLossy(this._fallbackOverrides.headers);
|
||||
if (!this._actualHeadersPromise) {
|
||||
this._actualHeadersPromise = this._wrapApiCall(async () => {
|
||||
return new RawHeaders((await this._channel.rawRequestHeaders()).headers);
|
||||
}, { internal: true });
|
||||
}
|
||||
return await this._actualHeadersPromise;
|
||||
}
|
||||
async allHeaders() {
|
||||
return (await this._actualHeaders()).headers();
|
||||
}
|
||||
async headersArray() {
|
||||
return (await this._actualHeaders()).headersArray();
|
||||
}
|
||||
async headerValue(name) {
|
||||
return (await this._actualHeaders()).get(name);
|
||||
}
|
||||
async response() {
|
||||
return Response.fromNullable((await this._channel.response()).response);
|
||||
}
|
||||
async _internalResponse() {
|
||||
return Response.fromNullable((await this._channel.response()).response);
|
||||
}
|
||||
frame() {
|
||||
if (!this._initializer.frame) {
|
||||
(0, import_assert.assert)(this.serviceWorker());
|
||||
throw new Error("Service Worker requests do not have an associated frame.");
|
||||
}
|
||||
const frame = import_frame.Frame.from(this._initializer.frame);
|
||||
if (!frame._page) {
|
||||
throw new Error([
|
||||
"Frame for this navigation request is not available, because the request",
|
||||
"was issued before the frame is created. You can check whether the request",
|
||||
"is a navigation request by calling isNavigationRequest() method."
|
||||
].join("\n"));
|
||||
}
|
||||
return frame;
|
||||
}
|
||||
_safePage() {
|
||||
return import_frame.Frame.fromNullable(this._initializer.frame)?._page || null;
|
||||
}
|
||||
serviceWorker() {
|
||||
return this._initializer.serviceWorker ? import_worker.Worker.from(this._initializer.serviceWorker) : null;
|
||||
}
|
||||
isNavigationRequest() {
|
||||
return this._initializer.isNavigationRequest;
|
||||
}
|
||||
redirectedFrom() {
|
||||
return this._redirectedFrom;
|
||||
}
|
||||
redirectedTo() {
|
||||
return this._redirectedTo;
|
||||
}
|
||||
failure() {
|
||||
if (this._failureText === null)
|
||||
return null;
|
||||
return {
|
||||
errorText: this._failureText
|
||||
};
|
||||
}
|
||||
timing() {
|
||||
return this._timing;
|
||||
}
|
||||
async sizes() {
|
||||
const response = await this.response();
|
||||
if (!response)
|
||||
throw new Error("Unable to fetch sizes for failed request");
|
||||
return (await response._channel.sizes()).sizes;
|
||||
}
|
||||
_setResponseEndTiming(responseEndTiming) {
|
||||
this._timing.responseEnd = responseEndTiming;
|
||||
if (this._timing.responseStart === -1)
|
||||
this._timing.responseStart = responseEndTiming;
|
||||
}
|
||||
_finalRequest() {
|
||||
return this._redirectedTo ? this._redirectedTo._finalRequest() : this;
|
||||
}
|
||||
_applyFallbackOverrides(overrides) {
|
||||
if (overrides.url)
|
||||
this._fallbackOverrides.url = overrides.url;
|
||||
if (overrides.method)
|
||||
this._fallbackOverrides.method = overrides.method;
|
||||
if (overrides.headers)
|
||||
this._fallbackOverrides.headers = overrides.headers;
|
||||
if ((0, import_rtti.isString)(overrides.postData))
|
||||
this._fallbackOverrides.postDataBuffer = Buffer.from(overrides.postData, "utf-8");
|
||||
else if (overrides.postData instanceof Buffer)
|
||||
this._fallbackOverrides.postDataBuffer = overrides.postData;
|
||||
else if (overrides.postData)
|
||||
this._fallbackOverrides.postDataBuffer = Buffer.from(JSON.stringify(overrides.postData), "utf-8");
|
||||
}
|
||||
_fallbackOverridesForContinue() {
|
||||
return this._fallbackOverrides;
|
||||
}
|
||||
_targetClosedScope() {
|
||||
return this.serviceWorker()?._closedScope || this._safePage()?._closedOrCrashedScope || new import_manualPromise.LongStandingScope();
|
||||
}
|
||||
}
|
||||
class Route extends import_channelOwner.ChannelOwner {
|
||||
constructor(parent, type, guid, initializer) {
|
||||
super(parent, type, guid, initializer);
|
||||
this._handlingPromise = null;
|
||||
this._didThrow = false;
|
||||
}
|
||||
static from(route) {
|
||||
return route._object;
|
||||
}
|
||||
request() {
|
||||
return Request.from(this._initializer.request);
|
||||
}
|
||||
async _raceWithTargetClose(promise) {
|
||||
return await this.request()._targetClosedScope().safeRace(promise);
|
||||
}
|
||||
async _startHandling() {
|
||||
this._handlingPromise = new import_manualPromise.ManualPromise();
|
||||
return await this._handlingPromise;
|
||||
}
|
||||
async fallback(options = {}) {
|
||||
this._checkNotHandled();
|
||||
this.request()._applyFallbackOverrides(options);
|
||||
this._reportHandled(false);
|
||||
}
|
||||
async abort(errorCode) {
|
||||
await this._handleRoute(async () => {
|
||||
await this._raceWithTargetClose(this._channel.abort({ errorCode }));
|
||||
});
|
||||
}
|
||||
async _redirectNavigationRequest(url) {
|
||||
await this._handleRoute(async () => {
|
||||
await this._raceWithTargetClose(this._channel.redirectNavigationRequest({ url }));
|
||||
});
|
||||
}
|
||||
async fetch(options = {}) {
|
||||
return await this._wrapApiCall(async () => {
|
||||
return await this._context.request._innerFetch({ request: this.request(), data: options.postData, ...options });
|
||||
});
|
||||
}
|
||||
async fulfill(options = {}) {
|
||||
await this._handleRoute(async () => {
|
||||
await this._innerFulfill(options);
|
||||
});
|
||||
}
|
||||
async _handleRoute(callback) {
|
||||
this._checkNotHandled();
|
||||
try {
|
||||
await callback();
|
||||
this._reportHandled(true);
|
||||
} catch (e) {
|
||||
this._didThrow = true;
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
async _innerFulfill(options = {}) {
|
||||
let fetchResponseUid;
|
||||
let { status: statusOption, headers: headersOption, body } = options;
|
||||
if (options.json !== void 0) {
|
||||
(0, import_assert.assert)(options.body === void 0, "Can specify either body or json parameters");
|
||||
body = JSON.stringify(options.json);
|
||||
}
|
||||
if (options.response instanceof import_fetch.APIResponse) {
|
||||
statusOption ??= options.response.status();
|
||||
headersOption ??= options.response.headers();
|
||||
if (body === void 0 && options.path === void 0) {
|
||||
if (options.response._request._connection === this._connection)
|
||||
fetchResponseUid = options.response._fetchUid();
|
||||
else
|
||||
body = await options.response.body();
|
||||
}
|
||||
}
|
||||
let isBase64 = false;
|
||||
let length = 0;
|
||||
if (options.path) {
|
||||
const buffer = await this._platform.fs().promises.readFile(options.path);
|
||||
body = buffer.toString("base64");
|
||||
isBase64 = true;
|
||||
length = buffer.length;
|
||||
} else if ((0, import_rtti.isString)(body)) {
|
||||
isBase64 = false;
|
||||
length = Buffer.byteLength(body);
|
||||
} else if (body) {
|
||||
length = body.length;
|
||||
body = body.toString("base64");
|
||||
isBase64 = true;
|
||||
}
|
||||
const headers = {};
|
||||
for (const header of Object.keys(headersOption || {}))
|
||||
headers[header.toLowerCase()] = String(headersOption[header]);
|
||||
if (options.contentType)
|
||||
headers["content-type"] = String(options.contentType);
|
||||
else if (options.json)
|
||||
headers["content-type"] = "application/json";
|
||||
else if (options.path)
|
||||
headers["content-type"] = (0, import_mimeType.getMimeTypeForPath)(options.path) || "application/octet-stream";
|
||||
if (length && !("content-length" in headers))
|
||||
headers["content-length"] = String(length);
|
||||
await this._raceWithTargetClose(this._channel.fulfill({
|
||||
status: statusOption || 200,
|
||||
headers: (0, import_headers.headersObjectToArray)(headers),
|
||||
body,
|
||||
isBase64,
|
||||
fetchResponseUid
|
||||
}));
|
||||
}
|
||||
async continue(options = {}) {
|
||||
await this._handleRoute(async () => {
|
||||
this.request()._applyFallbackOverrides(options);
|
||||
await this._innerContinue(
|
||||
false
|
||||
/* isFallback */
|
||||
);
|
||||
});
|
||||
}
|
||||
_checkNotHandled() {
|
||||
if (!this._handlingPromise)
|
||||
throw new Error("Route is already handled!");
|
||||
}
|
||||
_reportHandled(done) {
|
||||
const chain = this._handlingPromise;
|
||||
this._handlingPromise = null;
|
||||
chain.resolve(done);
|
||||
}
|
||||
async _innerContinue(isFallback) {
|
||||
const options = this.request()._fallbackOverridesForContinue();
|
||||
return await this._raceWithTargetClose(this._channel.continue({
|
||||
url: options.url,
|
||||
method: options.method,
|
||||
headers: options.headers ? (0, import_headers.headersObjectToArray)(options.headers) : void 0,
|
||||
postData: options.postDataBuffer,
|
||||
isFallback
|
||||
}));
|
||||
}
|
||||
}
|
||||
class WebSocketRoute extends import_channelOwner.ChannelOwner {
|
||||
constructor(parent, type, guid, initializer) {
|
||||
super(parent, type, guid, initializer);
|
||||
this._connected = false;
|
||||
this._server = {
|
||||
onMessage: (handler) => {
|
||||
this._onServerMessage = handler;
|
||||
},
|
||||
onClose: (handler) => {
|
||||
this._onServerClose = handler;
|
||||
},
|
||||
connectToServer: () => {
|
||||
throw new Error(`connectToServer must be called on the page-side WebSocketRoute`);
|
||||
},
|
||||
url: () => {
|
||||
return this._initializer.url;
|
||||
},
|
||||
close: async (options = {}) => {
|
||||
await this._channel.closeServer({ ...options, wasClean: true }).catch(() => {
|
||||
});
|
||||
},
|
||||
send: (message) => {
|
||||
if ((0, import_rtti.isString)(message))
|
||||
this._channel.sendToServer({ message, isBase64: false }).catch(() => {
|
||||
});
|
||||
else
|
||||
this._channel.sendToServer({ message: message.toString("base64"), isBase64: true }).catch(() => {
|
||||
});
|
||||
},
|
||||
async [Symbol.asyncDispose]() {
|
||||
await this.close();
|
||||
}
|
||||
};
|
||||
this._channel.on("messageFromPage", ({ message, isBase64 }) => {
|
||||
if (this._onPageMessage)
|
||||
this._onPageMessage(isBase64 ? Buffer.from(message, "base64") : message);
|
||||
else if (this._connected)
|
||||
this._channel.sendToServer({ message, isBase64 }).catch(() => {
|
||||
});
|
||||
});
|
||||
this._channel.on("messageFromServer", ({ message, isBase64 }) => {
|
||||
if (this._onServerMessage)
|
||||
this._onServerMessage(isBase64 ? Buffer.from(message, "base64") : message);
|
||||
else
|
||||
this._channel.sendToPage({ message, isBase64 }).catch(() => {
|
||||
});
|
||||
});
|
||||
this._channel.on("closePage", ({ code, reason, wasClean }) => {
|
||||
if (this._onPageClose)
|
||||
this._onPageClose(code, reason);
|
||||
else
|
||||
this._channel.closeServer({ code, reason, wasClean }).catch(() => {
|
||||
});
|
||||
});
|
||||
this._channel.on("closeServer", ({ code, reason, wasClean }) => {
|
||||
if (this._onServerClose)
|
||||
this._onServerClose(code, reason);
|
||||
else
|
||||
this._channel.closePage({ code, reason, wasClean }).catch(() => {
|
||||
});
|
||||
});
|
||||
}
|
||||
static from(route) {
|
||||
return route._object;
|
||||
}
|
||||
url() {
|
||||
return this._initializer.url;
|
||||
}
|
||||
async close(options = {}) {
|
||||
await this._channel.closePage({ ...options, wasClean: true }).catch(() => {
|
||||
});
|
||||
}
|
||||
connectToServer() {
|
||||
if (this._connected)
|
||||
throw new Error("Already connected to the server");
|
||||
this._connected = true;
|
||||
this._channel.connect().catch(() => {
|
||||
});
|
||||
return this._server;
|
||||
}
|
||||
send(message) {
|
||||
if ((0, import_rtti.isString)(message))
|
||||
this._channel.sendToPage({ message, isBase64: false }).catch(() => {
|
||||
});
|
||||
else
|
||||
this._channel.sendToPage({ message: message.toString("base64"), isBase64: true }).catch(() => {
|
||||
});
|
||||
}
|
||||
onMessage(handler) {
|
||||
this._onPageMessage = handler;
|
||||
}
|
||||
onClose(handler) {
|
||||
this._onPageClose = handler;
|
||||
}
|
||||
async [Symbol.asyncDispose]() {
|
||||
await this.close();
|
||||
}
|
||||
async _afterHandle() {
|
||||
if (this._connected)
|
||||
return;
|
||||
await this._channel.ensureOpened().catch(() => {
|
||||
});
|
||||
}
|
||||
}
|
||||
class WebSocketRouteHandler {
|
||||
constructor(baseURL, url, handler) {
|
||||
this._baseURL = baseURL;
|
||||
this.url = url;
|
||||
this.handler = handler;
|
||||
}
|
||||
static prepareInterceptionPatterns(handlers) {
|
||||
const patterns = [];
|
||||
let all = false;
|
||||
for (const handler of handlers) {
|
||||
if ((0, import_rtti.isString)(handler.url))
|
||||
patterns.push({ glob: handler.url });
|
||||
else if ((0, import_rtti.isRegExp)(handler.url))
|
||||
patterns.push({ regexSource: handler.url.source, regexFlags: handler.url.flags });
|
||||
else
|
||||
all = true;
|
||||
}
|
||||
if (all)
|
||||
return [{ glob: "**/*" }];
|
||||
return patterns;
|
||||
}
|
||||
matches(wsURL) {
|
||||
return (0, import_urlMatch.urlMatches)(this._baseURL, wsURL, this.url, true);
|
||||
}
|
||||
async handle(webSocketRoute) {
|
||||
const handler = this.handler;
|
||||
await handler(webSocketRoute);
|
||||
await webSocketRoute._afterHandle();
|
||||
}
|
||||
}
|
||||
class Response extends import_channelOwner.ChannelOwner {
|
||||
constructor(parent, type, guid, initializer) {
|
||||
super(parent, type, guid, initializer);
|
||||
this._finishedPromise = new import_manualPromise.ManualPromise();
|
||||
this._provisionalHeaders = new RawHeaders(initializer.headers);
|
||||
this._request = Request.from(this._initializer.request);
|
||||
Object.assign(this._request._timing, this._initializer.timing);
|
||||
}
|
||||
static from(response) {
|
||||
return response._object;
|
||||
}
|
||||
static fromNullable(response) {
|
||||
return response ? Response.from(response) : null;
|
||||
}
|
||||
url() {
|
||||
return this._initializer.url;
|
||||
}
|
||||
ok() {
|
||||
return this._initializer.status === 0 || this._initializer.status >= 200 && this._initializer.status <= 299;
|
||||
}
|
||||
status() {
|
||||
return this._initializer.status;
|
||||
}
|
||||
statusText() {
|
||||
return this._initializer.statusText;
|
||||
}
|
||||
fromServiceWorker() {
|
||||
return this._initializer.fromServiceWorker;
|
||||
}
|
||||
/**
|
||||
* @deprecated
|
||||
*/
|
||||
headers() {
|
||||
return this._provisionalHeaders.headers();
|
||||
}
|
||||
async _actualHeaders() {
|
||||
if (!this._actualHeadersPromise) {
|
||||
this._actualHeadersPromise = (async () => {
|
||||
return new RawHeaders((await this._channel.rawResponseHeaders()).headers);
|
||||
})();
|
||||
}
|
||||
return await this._actualHeadersPromise;
|
||||
}
|
||||
async allHeaders() {
|
||||
return (await this._actualHeaders()).headers();
|
||||
}
|
||||
async headersArray() {
|
||||
return (await this._actualHeaders()).headersArray().slice();
|
||||
}
|
||||
async headerValue(name) {
|
||||
return (await this._actualHeaders()).get(name);
|
||||
}
|
||||
async headerValues(name) {
|
||||
return (await this._actualHeaders()).getAll(name);
|
||||
}
|
||||
async finished() {
|
||||
return await this.request()._targetClosedScope().race(this._finishedPromise);
|
||||
}
|
||||
async body() {
|
||||
return (await this._channel.body()).binary;
|
||||
}
|
||||
async text() {
|
||||
const content = await this.body();
|
||||
return content.toString("utf8");
|
||||
}
|
||||
async json() {
|
||||
const content = await this.text();
|
||||
return JSON.parse(content);
|
||||
}
|
||||
request() {
|
||||
return this._request;
|
||||
}
|
||||
frame() {
|
||||
return this._request.frame();
|
||||
}
|
||||
async serverAddr() {
|
||||
return (await this._channel.serverAddr()).value || null;
|
||||
}
|
||||
async securityDetails() {
|
||||
return (await this._channel.securityDetails()).value || null;
|
||||
}
|
||||
}
|
||||
class WebSocket extends import_channelOwner.ChannelOwner {
|
||||
static from(webSocket) {
|
||||
return webSocket._object;
|
||||
}
|
||||
constructor(parent, type, guid, initializer) {
|
||||
super(parent, type, guid, initializer);
|
||||
this._isClosed = false;
|
||||
this._page = parent;
|
||||
this._channel.on("frameSent", (event) => {
|
||||
if (event.opcode === 1)
|
||||
this.emit(import_events.Events.WebSocket.FrameSent, { payload: event.data });
|
||||
else if (event.opcode === 2)
|
||||
this.emit(import_events.Events.WebSocket.FrameSent, { payload: Buffer.from(event.data, "base64") });
|
||||
});
|
||||
this._channel.on("frameReceived", (event) => {
|
||||
if (event.opcode === 1)
|
||||
this.emit(import_events.Events.WebSocket.FrameReceived, { payload: event.data });
|
||||
else if (event.opcode === 2)
|
||||
this.emit(import_events.Events.WebSocket.FrameReceived, { payload: Buffer.from(event.data, "base64") });
|
||||
});
|
||||
this._channel.on("socketError", ({ error }) => this.emit(import_events.Events.WebSocket.Error, error));
|
||||
this._channel.on("close", () => {
|
||||
this._isClosed = true;
|
||||
this.emit(import_events.Events.WebSocket.Close, this);
|
||||
});
|
||||
}
|
||||
url() {
|
||||
return this._initializer.url;
|
||||
}
|
||||
isClosed() {
|
||||
return this._isClosed;
|
||||
}
|
||||
async waitForEvent(event, optionsOrPredicate = {}) {
|
||||
return await this._wrapApiCall(async () => {
|
||||
const timeout = this._page._timeoutSettings.timeout(typeof optionsOrPredicate === "function" ? {} : optionsOrPredicate);
|
||||
const predicate = typeof optionsOrPredicate === "function" ? optionsOrPredicate : optionsOrPredicate.predicate;
|
||||
const waiter = import_waiter.Waiter.createForEvent(this, event);
|
||||
waiter.rejectOnTimeout(timeout, `Timeout ${timeout}ms exceeded while waiting for event "${event}"`);
|
||||
if (event !== import_events.Events.WebSocket.Error)
|
||||
waiter.rejectOnEvent(this, import_events.Events.WebSocket.Error, new Error("Socket error"));
|
||||
if (event !== import_events.Events.WebSocket.Close)
|
||||
waiter.rejectOnEvent(this, import_events.Events.WebSocket.Close, new Error("Socket closed"));
|
||||
waiter.rejectOnEvent(this._page, import_events.Events.Page.Close, () => this._page._closeErrorWithReason());
|
||||
const result = await waiter.waitForEvent(this, event, predicate);
|
||||
waiter.dispose();
|
||||
return result;
|
||||
});
|
||||
}
|
||||
}
|
||||
function validateHeaders(headers) {
|
||||
for (const key of Object.keys(headers)) {
|
||||
const value = headers[key];
|
||||
if (!Object.is(value, void 0) && !(0, import_rtti.isString)(value))
|
||||
throw new Error(`Expected value of header "${key}" to be String, but "${typeof value}" is found.`);
|
||||
}
|
||||
}
|
||||
class RouteHandler {
|
||||
constructor(platform, baseURL, url, handler, times = Number.MAX_SAFE_INTEGER) {
|
||||
this.handledCount = 0;
|
||||
this._ignoreException = false;
|
||||
this._activeInvocations = /* @__PURE__ */ new Set();
|
||||
this._baseURL = baseURL;
|
||||
this._times = times;
|
||||
this.url = url;
|
||||
this.handler = handler;
|
||||
this._savedZone = platform.zones.current().pop();
|
||||
}
|
||||
static prepareInterceptionPatterns(handlers) {
|
||||
const patterns = [];
|
||||
let all = false;
|
||||
for (const handler of handlers) {
|
||||
if ((0, import_rtti.isString)(handler.url))
|
||||
patterns.push({ glob: handler.url });
|
||||
else if ((0, import_rtti.isRegExp)(handler.url))
|
||||
patterns.push({ regexSource: handler.url.source, regexFlags: handler.url.flags });
|
||||
else
|
||||
all = true;
|
||||
}
|
||||
if (all)
|
||||
return [{ glob: "**/*" }];
|
||||
return patterns;
|
||||
}
|
||||
matches(requestURL) {
|
||||
return (0, import_urlMatch.urlMatches)(this._baseURL, requestURL, this.url);
|
||||
}
|
||||
async handle(route) {
|
||||
return await this._savedZone.run(async () => this._handleImpl(route));
|
||||
}
|
||||
async _handleImpl(route) {
|
||||
const handlerInvocation = { complete: new import_manualPromise.ManualPromise(), route };
|
||||
this._activeInvocations.add(handlerInvocation);
|
||||
try {
|
||||
return await this._handleInternal(route);
|
||||
} catch (e) {
|
||||
if (this._ignoreException)
|
||||
return false;
|
||||
if ((0, import_errors.isTargetClosedError)(e)) {
|
||||
(0, import_stackTrace.rewriteErrorMessage)(e, `"${e.message}" while running route callback.
|
||||
Consider awaiting \`await page.unrouteAll({ behavior: 'ignoreErrors' })\`
|
||||
before the end of the test to ignore remaining routes in flight.`);
|
||||
}
|
||||
throw e;
|
||||
} finally {
|
||||
handlerInvocation.complete.resolve();
|
||||
this._activeInvocations.delete(handlerInvocation);
|
||||
}
|
||||
}
|
||||
async stop(behavior) {
|
||||
if (behavior === "ignoreErrors") {
|
||||
this._ignoreException = true;
|
||||
} else {
|
||||
const promises = [];
|
||||
for (const activation of this._activeInvocations) {
|
||||
if (!activation.route._didThrow)
|
||||
promises.push(activation.complete);
|
||||
}
|
||||
await Promise.all(promises);
|
||||
}
|
||||
}
|
||||
async _handleInternal(route) {
|
||||
++this.handledCount;
|
||||
const handledPromise = route._startHandling();
|
||||
const handler = this.handler;
|
||||
const [handled] = await Promise.all([
|
||||
handledPromise,
|
||||
handler(route, route.request())
|
||||
]);
|
||||
return handled;
|
||||
}
|
||||
willExpire() {
|
||||
return this.handledCount + 1 >= this._times;
|
||||
}
|
||||
}
|
||||
class RawHeaders {
|
||||
constructor(headers) {
|
||||
this._headersMap = new import_multimap.MultiMap();
|
||||
this._headersArray = headers;
|
||||
for (const header of headers)
|
||||
this._headersMap.set(header.name.toLowerCase(), header.value);
|
||||
}
|
||||
static _fromHeadersObjectLossy(headers) {
|
||||
const headersArray = Object.entries(headers).map(([name, value]) => ({
|
||||
name,
|
||||
value
|
||||
})).filter((header) => header.value !== void 0);
|
||||
return new RawHeaders(headersArray);
|
||||
}
|
||||
get(name) {
|
||||
const values = this.getAll(name);
|
||||
if (!values || !values.length)
|
||||
return null;
|
||||
return values.join(name.toLowerCase() === "set-cookie" ? "\n" : ", ");
|
||||
}
|
||||
getAll(name) {
|
||||
return [...this._headersMap.get(name.toLowerCase())];
|
||||
}
|
||||
headers() {
|
||||
const result = {};
|
||||
for (const name of this._headersMap.keys())
|
||||
result[name] = this.get(name);
|
||||
return result;
|
||||
}
|
||||
headersArray() {
|
||||
return this._headersArray;
|
||||
}
|
||||
}
|
||||
// Annotate the CommonJS export names for ESM import in node:
|
||||
0 && (module.exports = {
|
||||
RawHeaders,
|
||||
Request,
|
||||
Response,
|
||||
Route,
|
||||
RouteHandler,
|
||||
WebSocket,
|
||||
WebSocketRoute,
|
||||
WebSocketRouteHandler,
|
||||
validateHeaders
|
||||
});
|
||||
745
projects/org-skill-web-research/node_modules/playwright-core/lib/client/page.js
generated
vendored
Normal file
745
projects/org-skill-web-research/node_modules/playwright-core/lib/client/page.js
generated
vendored
Normal file
@@ -0,0 +1,745 @@
|
||||
"use strict";
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var page_exports = {};
|
||||
__export(page_exports, {
|
||||
BindingCall: () => BindingCall,
|
||||
Page: () => Page
|
||||
});
|
||||
module.exports = __toCommonJS(page_exports);
|
||||
var import_artifact = require("./artifact");
|
||||
var import_channelOwner = require("./channelOwner");
|
||||
var import_clientHelper = require("./clientHelper");
|
||||
var import_coverage = require("./coverage");
|
||||
var import_download = require("./download");
|
||||
var import_elementHandle = require("./elementHandle");
|
||||
var import_errors = require("./errors");
|
||||
var import_events = require("./events");
|
||||
var import_fileChooser = require("./fileChooser");
|
||||
var import_frame = require("./frame");
|
||||
var import_harRouter = require("./harRouter");
|
||||
var import_input = require("./input");
|
||||
var import_jsHandle = require("./jsHandle");
|
||||
var import_network = require("./network");
|
||||
var import_video = require("./video");
|
||||
var import_waiter = require("./waiter");
|
||||
var import_worker = require("./worker");
|
||||
var import_timeoutSettings = require("./timeoutSettings");
|
||||
var import_assert = require("../utils/isomorphic/assert");
|
||||
var import_fileUtils = require("./fileUtils");
|
||||
var import_headers = require("../utils/isomorphic/headers");
|
||||
var import_stringUtils = require("../utils/isomorphic/stringUtils");
|
||||
var import_urlMatch = require("../utils/isomorphic/urlMatch");
|
||||
var import_manualPromise = require("../utils/isomorphic/manualPromise");
|
||||
var import_rtti = require("../utils/isomorphic/rtti");
|
||||
var import_consoleMessage = require("./consoleMessage");
|
||||
var import_pageAgent = require("./pageAgent");
|
||||
class Page extends import_channelOwner.ChannelOwner {
|
||||
constructor(parent, type, guid, initializer) {
|
||||
super(parent, type, guid, initializer);
|
||||
this._frames = /* @__PURE__ */ new Set();
|
||||
this._workers = /* @__PURE__ */ new Set();
|
||||
this._closed = false;
|
||||
this._closedOrCrashedScope = new import_manualPromise.LongStandingScope();
|
||||
this._routes = [];
|
||||
this._webSocketRoutes = [];
|
||||
this._bindings = /* @__PURE__ */ new Map();
|
||||
this._video = null;
|
||||
this._closeWasCalled = false;
|
||||
this._harRouters = [];
|
||||
this._locatorHandlers = /* @__PURE__ */ new Map();
|
||||
this._instrumentation.onPage(this);
|
||||
this._browserContext = parent;
|
||||
this._timeoutSettings = new import_timeoutSettings.TimeoutSettings(this._platform, this._browserContext._timeoutSettings);
|
||||
this.keyboard = new import_input.Keyboard(this);
|
||||
this.mouse = new import_input.Mouse(this);
|
||||
this.request = this._browserContext.request;
|
||||
this.touchscreen = new import_input.Touchscreen(this);
|
||||
this.clock = this._browserContext.clock;
|
||||
this._mainFrame = import_frame.Frame.from(initializer.mainFrame);
|
||||
this._mainFrame._page = this;
|
||||
this._frames.add(this._mainFrame);
|
||||
this._viewportSize = initializer.viewportSize;
|
||||
this._closed = initializer.isClosed;
|
||||
this._opener = Page.fromNullable(initializer.opener);
|
||||
this._channel.on("bindingCall", ({ binding }) => this._onBinding(BindingCall.from(binding)));
|
||||
this._channel.on("close", () => this._onClose());
|
||||
this._channel.on("crash", () => this._onCrash());
|
||||
this._channel.on("download", ({ url, suggestedFilename, artifact }) => {
|
||||
const artifactObject = import_artifact.Artifact.from(artifact);
|
||||
this.emit(import_events.Events.Page.Download, new import_download.Download(this, url, suggestedFilename, artifactObject));
|
||||
});
|
||||
this._channel.on("fileChooser", ({ element, isMultiple }) => this.emit(import_events.Events.Page.FileChooser, new import_fileChooser.FileChooser(this, import_elementHandle.ElementHandle.from(element), isMultiple)));
|
||||
this._channel.on("frameAttached", ({ frame }) => this._onFrameAttached(import_frame.Frame.from(frame)));
|
||||
this._channel.on("frameDetached", ({ frame }) => this._onFrameDetached(import_frame.Frame.from(frame)));
|
||||
this._channel.on("locatorHandlerTriggered", ({ uid }) => this._onLocatorHandlerTriggered(uid));
|
||||
this._channel.on("route", ({ route }) => this._onRoute(import_network.Route.from(route)));
|
||||
this._channel.on("webSocketRoute", ({ webSocketRoute }) => this._onWebSocketRoute(import_network.WebSocketRoute.from(webSocketRoute)));
|
||||
this._channel.on("video", ({ artifact }) => {
|
||||
const artifactObject = import_artifact.Artifact.from(artifact);
|
||||
this._forceVideo()._artifactReady(artifactObject);
|
||||
});
|
||||
this._channel.on("viewportSizeChanged", ({ viewportSize }) => this._viewportSize = viewportSize);
|
||||
this._channel.on("webSocket", ({ webSocket }) => this.emit(import_events.Events.Page.WebSocket, import_network.WebSocket.from(webSocket)));
|
||||
this._channel.on("worker", ({ worker }) => this._onWorker(import_worker.Worker.from(worker)));
|
||||
this.coverage = new import_coverage.Coverage(this._channel);
|
||||
this.once(import_events.Events.Page.Close, () => this._closedOrCrashedScope.close(this._closeErrorWithReason()));
|
||||
this.once(import_events.Events.Page.Crash, () => this._closedOrCrashedScope.close(new import_errors.TargetClosedError()));
|
||||
this._setEventToSubscriptionMapping(/* @__PURE__ */ new Map([
|
||||
[import_events.Events.Page.Console, "console"],
|
||||
[import_events.Events.Page.Dialog, "dialog"],
|
||||
[import_events.Events.Page.Request, "request"],
|
||||
[import_events.Events.Page.Response, "response"],
|
||||
[import_events.Events.Page.RequestFinished, "requestFinished"],
|
||||
[import_events.Events.Page.RequestFailed, "requestFailed"],
|
||||
[import_events.Events.Page.FileChooser, "fileChooser"]
|
||||
]));
|
||||
}
|
||||
static from(page) {
|
||||
return page._object;
|
||||
}
|
||||
static fromNullable(page) {
|
||||
return page ? Page.from(page) : null;
|
||||
}
|
||||
_onFrameAttached(frame) {
|
||||
frame._page = this;
|
||||
this._frames.add(frame);
|
||||
if (frame._parentFrame)
|
||||
frame._parentFrame._childFrames.add(frame);
|
||||
this.emit(import_events.Events.Page.FrameAttached, frame);
|
||||
}
|
||||
_onFrameDetached(frame) {
|
||||
this._frames.delete(frame);
|
||||
frame._detached = true;
|
||||
if (frame._parentFrame)
|
||||
frame._parentFrame._childFrames.delete(frame);
|
||||
this.emit(import_events.Events.Page.FrameDetached, frame);
|
||||
}
|
||||
async _onRoute(route) {
|
||||
route._context = this.context();
|
||||
const routeHandlers = this._routes.slice();
|
||||
for (const routeHandler of routeHandlers) {
|
||||
if (this._closeWasCalled || this._browserContext._closingStatus !== "none")
|
||||
return;
|
||||
if (!routeHandler.matches(route.request().url()))
|
||||
continue;
|
||||
const index = this._routes.indexOf(routeHandler);
|
||||
if (index === -1)
|
||||
continue;
|
||||
if (routeHandler.willExpire())
|
||||
this._routes.splice(index, 1);
|
||||
const handled = await routeHandler.handle(route);
|
||||
if (!this._routes.length)
|
||||
this._updateInterceptionPatterns({ internal: true }).catch(() => {
|
||||
});
|
||||
if (handled)
|
||||
return;
|
||||
}
|
||||
await this._browserContext._onRoute(route);
|
||||
}
|
||||
async _onWebSocketRoute(webSocketRoute) {
|
||||
const routeHandler = this._webSocketRoutes.find((route) => route.matches(webSocketRoute.url()));
|
||||
if (routeHandler)
|
||||
await routeHandler.handle(webSocketRoute);
|
||||
else
|
||||
await this._browserContext._onWebSocketRoute(webSocketRoute);
|
||||
}
|
||||
async _onBinding(bindingCall) {
|
||||
const func = this._bindings.get(bindingCall._initializer.name);
|
||||
if (func) {
|
||||
await bindingCall.call(func);
|
||||
return;
|
||||
}
|
||||
await this._browserContext._onBinding(bindingCall);
|
||||
}
|
||||
_onWorker(worker) {
|
||||
this._workers.add(worker);
|
||||
worker._page = this;
|
||||
this.emit(import_events.Events.Page.Worker, worker);
|
||||
}
|
||||
_onClose() {
|
||||
this._closed = true;
|
||||
this._browserContext._pages.delete(this);
|
||||
this._disposeHarRouters();
|
||||
this.emit(import_events.Events.Page.Close, this);
|
||||
}
|
||||
_onCrash() {
|
||||
this.emit(import_events.Events.Page.Crash, this);
|
||||
}
|
||||
context() {
|
||||
return this._browserContext;
|
||||
}
|
||||
async opener() {
|
||||
if (!this._opener || this._opener.isClosed())
|
||||
return null;
|
||||
return this._opener;
|
||||
}
|
||||
mainFrame() {
|
||||
return this._mainFrame;
|
||||
}
|
||||
frame(frameSelector) {
|
||||
const name = (0, import_rtti.isString)(frameSelector) ? frameSelector : frameSelector.name;
|
||||
const url = (0, import_rtti.isObject)(frameSelector) ? frameSelector.url : void 0;
|
||||
(0, import_assert.assert)(name || url, "Either name or url matcher should be specified");
|
||||
return this.frames().find((f) => {
|
||||
if (name)
|
||||
return f.name() === name;
|
||||
return (0, import_urlMatch.urlMatches)(this._browserContext._options.baseURL, f.url(), url);
|
||||
}) || null;
|
||||
}
|
||||
frames() {
|
||||
return [...this._frames];
|
||||
}
|
||||
setDefaultNavigationTimeout(timeout) {
|
||||
this._timeoutSettings.setDefaultNavigationTimeout(timeout);
|
||||
}
|
||||
setDefaultTimeout(timeout) {
|
||||
this._timeoutSettings.setDefaultTimeout(timeout);
|
||||
}
|
||||
_forceVideo() {
|
||||
if (!this._video)
|
||||
this._video = new import_video.Video(this, this._connection);
|
||||
return this._video;
|
||||
}
|
||||
video() {
|
||||
if (!this._browserContext._options.recordVideo)
|
||||
return null;
|
||||
return this._forceVideo();
|
||||
}
|
||||
async $(selector, options) {
|
||||
return await this._mainFrame.$(selector, options);
|
||||
}
|
||||
async waitForSelector(selector, options) {
|
||||
return await this._mainFrame.waitForSelector(selector, options);
|
||||
}
|
||||
async dispatchEvent(selector, type, eventInit, options) {
|
||||
return await this._mainFrame.dispatchEvent(selector, type, eventInit, options);
|
||||
}
|
||||
async evaluateHandle(pageFunction, arg) {
|
||||
(0, import_jsHandle.assertMaxArguments)(arguments.length, 2);
|
||||
return await this._mainFrame.evaluateHandle(pageFunction, arg);
|
||||
}
|
||||
async $eval(selector, pageFunction, arg) {
|
||||
(0, import_jsHandle.assertMaxArguments)(arguments.length, 3);
|
||||
return await this._mainFrame.$eval(selector, pageFunction, arg);
|
||||
}
|
||||
async $$eval(selector, pageFunction, arg) {
|
||||
(0, import_jsHandle.assertMaxArguments)(arguments.length, 3);
|
||||
return await this._mainFrame.$$eval(selector, pageFunction, arg);
|
||||
}
|
||||
async $$(selector) {
|
||||
return await this._mainFrame.$$(selector);
|
||||
}
|
||||
async addScriptTag(options = {}) {
|
||||
return await this._mainFrame.addScriptTag(options);
|
||||
}
|
||||
async addStyleTag(options = {}) {
|
||||
return await this._mainFrame.addStyleTag(options);
|
||||
}
|
||||
async exposeFunction(name, callback) {
|
||||
await this._channel.exposeBinding({ name });
|
||||
const binding = (source, ...args) => callback(...args);
|
||||
this._bindings.set(name, binding);
|
||||
}
|
||||
async exposeBinding(name, callback, options = {}) {
|
||||
await this._channel.exposeBinding({ name, needsHandle: options.handle });
|
||||
this._bindings.set(name, callback);
|
||||
}
|
||||
async setExtraHTTPHeaders(headers) {
|
||||
(0, import_network.validateHeaders)(headers);
|
||||
await this._channel.setExtraHTTPHeaders({ headers: (0, import_headers.headersObjectToArray)(headers) });
|
||||
}
|
||||
url() {
|
||||
return this._mainFrame.url();
|
||||
}
|
||||
async content() {
|
||||
return await this._mainFrame.content();
|
||||
}
|
||||
async setContent(html, options) {
|
||||
return await this._mainFrame.setContent(html, options);
|
||||
}
|
||||
async goto(url, options) {
|
||||
return await this._mainFrame.goto(url, options);
|
||||
}
|
||||
async reload(options = {}) {
|
||||
const waitUntil = (0, import_frame.verifyLoadState)("waitUntil", options.waitUntil === void 0 ? "load" : options.waitUntil);
|
||||
return import_network.Response.fromNullable((await this._channel.reload({ ...options, waitUntil, timeout: this._timeoutSettings.navigationTimeout(options) })).response);
|
||||
}
|
||||
async addLocatorHandler(locator, handler, options = {}) {
|
||||
if (locator._frame !== this._mainFrame)
|
||||
throw new Error(`Locator must belong to the main frame of this page`);
|
||||
if (options.times === 0)
|
||||
return;
|
||||
const { uid } = await this._channel.registerLocatorHandler({ selector: locator._selector, noWaitAfter: options.noWaitAfter });
|
||||
this._locatorHandlers.set(uid, { locator, handler, times: options.times });
|
||||
}
|
||||
async _onLocatorHandlerTriggered(uid) {
|
||||
let remove = false;
|
||||
try {
|
||||
const handler = this._locatorHandlers.get(uid);
|
||||
if (handler && handler.times !== 0) {
|
||||
if (handler.times !== void 0)
|
||||
handler.times--;
|
||||
await handler.handler(handler.locator);
|
||||
}
|
||||
remove = handler?.times === 0;
|
||||
} finally {
|
||||
if (remove)
|
||||
this._locatorHandlers.delete(uid);
|
||||
this._channel.resolveLocatorHandlerNoReply({ uid, remove }).catch(() => {
|
||||
});
|
||||
}
|
||||
}
|
||||
async removeLocatorHandler(locator) {
|
||||
for (const [uid, data] of this._locatorHandlers) {
|
||||
if (data.locator._equals(locator)) {
|
||||
this._locatorHandlers.delete(uid);
|
||||
await this._channel.unregisterLocatorHandler({ uid }).catch(() => {
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
async waitForLoadState(state, options) {
|
||||
return await this._mainFrame.waitForLoadState(state, options);
|
||||
}
|
||||
async waitForNavigation(options) {
|
||||
return await this._mainFrame.waitForNavigation(options);
|
||||
}
|
||||
async waitForURL(url, options) {
|
||||
return await this._mainFrame.waitForURL(url, options);
|
||||
}
|
||||
async waitForRequest(urlOrPredicate, options = {}) {
|
||||
const predicate = async (request) => {
|
||||
if ((0, import_rtti.isString)(urlOrPredicate) || (0, import_rtti.isRegExp)(urlOrPredicate))
|
||||
return (0, import_urlMatch.urlMatches)(this._browserContext._options.baseURL, request.url(), urlOrPredicate);
|
||||
return await urlOrPredicate(request);
|
||||
};
|
||||
const trimmedUrl = trimUrl(urlOrPredicate);
|
||||
const logLine = trimmedUrl ? `waiting for request ${trimmedUrl}` : void 0;
|
||||
return await this._waitForEvent(import_events.Events.Page.Request, { predicate, timeout: options.timeout }, logLine);
|
||||
}
|
||||
async waitForResponse(urlOrPredicate, options = {}) {
|
||||
const predicate = async (response) => {
|
||||
if ((0, import_rtti.isString)(urlOrPredicate) || (0, import_rtti.isRegExp)(urlOrPredicate))
|
||||
return (0, import_urlMatch.urlMatches)(this._browserContext._options.baseURL, response.url(), urlOrPredicate);
|
||||
return await urlOrPredicate(response);
|
||||
};
|
||||
const trimmedUrl = trimUrl(urlOrPredicate);
|
||||
const logLine = trimmedUrl ? `waiting for response ${trimmedUrl}` : void 0;
|
||||
return await this._waitForEvent(import_events.Events.Page.Response, { predicate, timeout: options.timeout }, logLine);
|
||||
}
|
||||
async waitForEvent(event, optionsOrPredicate = {}) {
|
||||
return await this._waitForEvent(event, optionsOrPredicate, `waiting for event "${event}"`);
|
||||
}
|
||||
_closeErrorWithReason() {
|
||||
return new import_errors.TargetClosedError(this._closeReason || this._browserContext._effectiveCloseReason());
|
||||
}
|
||||
async _waitForEvent(event, optionsOrPredicate, logLine) {
|
||||
return await this._wrapApiCall(async () => {
|
||||
const timeout = this._timeoutSettings.timeout(typeof optionsOrPredicate === "function" ? {} : optionsOrPredicate);
|
||||
const predicate = typeof optionsOrPredicate === "function" ? optionsOrPredicate : optionsOrPredicate.predicate;
|
||||
const waiter = import_waiter.Waiter.createForEvent(this, event);
|
||||
if (logLine)
|
||||
waiter.log(logLine);
|
||||
waiter.rejectOnTimeout(timeout, `Timeout ${timeout}ms exceeded while waiting for event "${event}"`);
|
||||
if (event !== import_events.Events.Page.Crash)
|
||||
waiter.rejectOnEvent(this, import_events.Events.Page.Crash, new Error("Page crashed"));
|
||||
if (event !== import_events.Events.Page.Close)
|
||||
waiter.rejectOnEvent(this, import_events.Events.Page.Close, () => this._closeErrorWithReason());
|
||||
const result = await waiter.waitForEvent(this, event, predicate);
|
||||
waiter.dispose();
|
||||
return result;
|
||||
});
|
||||
}
|
||||
async goBack(options = {}) {
|
||||
const waitUntil = (0, import_frame.verifyLoadState)("waitUntil", options.waitUntil === void 0 ? "load" : options.waitUntil);
|
||||
return import_network.Response.fromNullable((await this._channel.goBack({ ...options, waitUntil, timeout: this._timeoutSettings.navigationTimeout(options) })).response);
|
||||
}
|
||||
async goForward(options = {}) {
|
||||
const waitUntil = (0, import_frame.verifyLoadState)("waitUntil", options.waitUntil === void 0 ? "load" : options.waitUntil);
|
||||
return import_network.Response.fromNullable((await this._channel.goForward({ ...options, waitUntil, timeout: this._timeoutSettings.navigationTimeout(options) })).response);
|
||||
}
|
||||
async requestGC() {
|
||||
await this._channel.requestGC();
|
||||
}
|
||||
async emulateMedia(options = {}) {
|
||||
await this._channel.emulateMedia({
|
||||
media: options.media === null ? "no-override" : options.media,
|
||||
colorScheme: options.colorScheme === null ? "no-override" : options.colorScheme,
|
||||
reducedMotion: options.reducedMotion === null ? "no-override" : options.reducedMotion,
|
||||
forcedColors: options.forcedColors === null ? "no-override" : options.forcedColors,
|
||||
contrast: options.contrast === null ? "no-override" : options.contrast
|
||||
});
|
||||
}
|
||||
async setViewportSize(viewportSize) {
|
||||
this._viewportSize = viewportSize;
|
||||
await this._channel.setViewportSize({ viewportSize });
|
||||
}
|
||||
viewportSize() {
|
||||
return this._viewportSize || null;
|
||||
}
|
||||
async evaluate(pageFunction, arg) {
|
||||
(0, import_jsHandle.assertMaxArguments)(arguments.length, 2);
|
||||
return await this._mainFrame.evaluate(pageFunction, arg);
|
||||
}
|
||||
async _evaluateFunction(functionDeclaration) {
|
||||
return this._mainFrame._evaluateFunction(functionDeclaration);
|
||||
}
|
||||
async addInitScript(script, arg) {
|
||||
const source = await (0, import_clientHelper.evaluationScript)(this._platform, script, arg);
|
||||
await this._channel.addInitScript({ source });
|
||||
}
|
||||
async route(url, handler, options = {}) {
|
||||
this._routes.unshift(new import_network.RouteHandler(this._platform, this._browserContext._options.baseURL, url, handler, options.times));
|
||||
await this._updateInterceptionPatterns({ title: "Route requests" });
|
||||
}
|
||||
async routeFromHAR(har, options = {}) {
|
||||
const localUtils = this._connection.localUtils();
|
||||
if (!localUtils)
|
||||
throw new Error("Route from har is not supported in thin clients");
|
||||
if (options.update) {
|
||||
await this._browserContext._recordIntoHAR(har, this, options);
|
||||
return;
|
||||
}
|
||||
const harRouter = await import_harRouter.HarRouter.create(localUtils, har, options.notFound || "abort", { urlMatch: options.url });
|
||||
this._harRouters.push(harRouter);
|
||||
await harRouter.addPageRoute(this);
|
||||
}
|
||||
async routeWebSocket(url, handler) {
|
||||
this._webSocketRoutes.unshift(new import_network.WebSocketRouteHandler(this._browserContext._options.baseURL, url, handler));
|
||||
await this._updateWebSocketInterceptionPatterns({ title: "Route WebSockets" });
|
||||
}
|
||||
_disposeHarRouters() {
|
||||
this._harRouters.forEach((router) => router.dispose());
|
||||
this._harRouters = [];
|
||||
}
|
||||
async unrouteAll(options) {
|
||||
await this._unrouteInternal(this._routes, [], options?.behavior);
|
||||
this._disposeHarRouters();
|
||||
}
|
||||
async unroute(url, handler) {
|
||||
const removed = [];
|
||||
const remaining = [];
|
||||
for (const route of this._routes) {
|
||||
if ((0, import_urlMatch.urlMatchesEqual)(route.url, url) && (!handler || route.handler === handler))
|
||||
removed.push(route);
|
||||
else
|
||||
remaining.push(route);
|
||||
}
|
||||
await this._unrouteInternal(removed, remaining, "default");
|
||||
}
|
||||
async _unrouteInternal(removed, remaining, behavior) {
|
||||
this._routes = remaining;
|
||||
if (behavior && behavior !== "default") {
|
||||
const promises = removed.map((routeHandler) => routeHandler.stop(behavior));
|
||||
await Promise.all(promises);
|
||||
}
|
||||
await this._updateInterceptionPatterns({ title: "Unroute requests" });
|
||||
}
|
||||
async _updateInterceptionPatterns(options) {
|
||||
const patterns = import_network.RouteHandler.prepareInterceptionPatterns(this._routes);
|
||||
await this._wrapApiCall(() => this._channel.setNetworkInterceptionPatterns({ patterns }), options);
|
||||
}
|
||||
async _updateWebSocketInterceptionPatterns(options) {
|
||||
const patterns = import_network.WebSocketRouteHandler.prepareInterceptionPatterns(this._webSocketRoutes);
|
||||
await this._wrapApiCall(() => this._channel.setWebSocketInterceptionPatterns({ patterns }), options);
|
||||
}
|
||||
async screenshot(options = {}) {
|
||||
const mask = options.mask;
|
||||
const copy = { ...options, mask: void 0, timeout: this._timeoutSettings.timeout(options) };
|
||||
if (!copy.type)
|
||||
copy.type = (0, import_elementHandle.determineScreenshotType)(options);
|
||||
if (mask) {
|
||||
copy.mask = mask.map((locator) => ({
|
||||
frame: locator._frame._channel,
|
||||
selector: locator._selector
|
||||
}));
|
||||
}
|
||||
const result = await this._channel.screenshot(copy);
|
||||
if (options.path) {
|
||||
await (0, import_fileUtils.mkdirIfNeeded)(this._platform, options.path);
|
||||
await this._platform.fs().promises.writeFile(options.path, result.binary);
|
||||
}
|
||||
return result.binary;
|
||||
}
|
||||
async _expectScreenshot(options) {
|
||||
const mask = options?.mask ? options?.mask.map((locator2) => ({
|
||||
frame: locator2._frame._channel,
|
||||
selector: locator2._selector
|
||||
})) : void 0;
|
||||
const locator = options.locator ? {
|
||||
frame: options.locator._frame._channel,
|
||||
selector: options.locator._selector
|
||||
} : void 0;
|
||||
return await this._channel.expectScreenshot({
|
||||
...options,
|
||||
isNot: !!options.isNot,
|
||||
locator,
|
||||
mask
|
||||
});
|
||||
}
|
||||
async title() {
|
||||
return await this._mainFrame.title();
|
||||
}
|
||||
async bringToFront() {
|
||||
await this._channel.bringToFront();
|
||||
}
|
||||
async [Symbol.asyncDispose]() {
|
||||
await this.close();
|
||||
}
|
||||
async close(options = {}) {
|
||||
this._closeReason = options.reason;
|
||||
if (!options.runBeforeUnload)
|
||||
this._closeWasCalled = true;
|
||||
try {
|
||||
if (this._ownedContext)
|
||||
await this._ownedContext.close();
|
||||
else
|
||||
await this._channel.close(options);
|
||||
} catch (e) {
|
||||
if ((0, import_errors.isTargetClosedError)(e) && !options.runBeforeUnload)
|
||||
return;
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
isClosed() {
|
||||
return this._closed;
|
||||
}
|
||||
async click(selector, options) {
|
||||
return await this._mainFrame.click(selector, options);
|
||||
}
|
||||
async dragAndDrop(source, target, options) {
|
||||
return await this._mainFrame.dragAndDrop(source, target, options);
|
||||
}
|
||||
async dblclick(selector, options) {
|
||||
await this._mainFrame.dblclick(selector, options);
|
||||
}
|
||||
async tap(selector, options) {
|
||||
return await this._mainFrame.tap(selector, options);
|
||||
}
|
||||
async fill(selector, value, options) {
|
||||
return await this._mainFrame.fill(selector, value, options);
|
||||
}
|
||||
async consoleMessages() {
|
||||
const { messages } = await this._channel.consoleMessages();
|
||||
return messages.map((message) => new import_consoleMessage.ConsoleMessage(this._platform, message, this, null));
|
||||
}
|
||||
async pageErrors() {
|
||||
const { errors } = await this._channel.pageErrors();
|
||||
return errors.map((error) => (0, import_errors.parseError)(error));
|
||||
}
|
||||
locator(selector, options) {
|
||||
return this.mainFrame().locator(selector, options);
|
||||
}
|
||||
getByTestId(testId) {
|
||||
return this.mainFrame().getByTestId(testId);
|
||||
}
|
||||
getByAltText(text, options) {
|
||||
return this.mainFrame().getByAltText(text, options);
|
||||
}
|
||||
getByLabel(text, options) {
|
||||
return this.mainFrame().getByLabel(text, options);
|
||||
}
|
||||
getByPlaceholder(text, options) {
|
||||
return this.mainFrame().getByPlaceholder(text, options);
|
||||
}
|
||||
getByText(text, options) {
|
||||
return this.mainFrame().getByText(text, options);
|
||||
}
|
||||
getByTitle(text, options) {
|
||||
return this.mainFrame().getByTitle(text, options);
|
||||
}
|
||||
getByRole(role, options = {}) {
|
||||
return this.mainFrame().getByRole(role, options);
|
||||
}
|
||||
frameLocator(selector) {
|
||||
return this.mainFrame().frameLocator(selector);
|
||||
}
|
||||
async focus(selector, options) {
|
||||
return await this._mainFrame.focus(selector, options);
|
||||
}
|
||||
async textContent(selector, options) {
|
||||
return await this._mainFrame.textContent(selector, options);
|
||||
}
|
||||
async innerText(selector, options) {
|
||||
return await this._mainFrame.innerText(selector, options);
|
||||
}
|
||||
async innerHTML(selector, options) {
|
||||
return await this._mainFrame.innerHTML(selector, options);
|
||||
}
|
||||
async getAttribute(selector, name, options) {
|
||||
return await this._mainFrame.getAttribute(selector, name, options);
|
||||
}
|
||||
async inputValue(selector, options) {
|
||||
return await this._mainFrame.inputValue(selector, options);
|
||||
}
|
||||
async isChecked(selector, options) {
|
||||
return await this._mainFrame.isChecked(selector, options);
|
||||
}
|
||||
async isDisabled(selector, options) {
|
||||
return await this._mainFrame.isDisabled(selector, options);
|
||||
}
|
||||
async isEditable(selector, options) {
|
||||
return await this._mainFrame.isEditable(selector, options);
|
||||
}
|
||||
async isEnabled(selector, options) {
|
||||
return await this._mainFrame.isEnabled(selector, options);
|
||||
}
|
||||
async isHidden(selector, options) {
|
||||
return await this._mainFrame.isHidden(selector, options);
|
||||
}
|
||||
async isVisible(selector, options) {
|
||||
return await this._mainFrame.isVisible(selector, options);
|
||||
}
|
||||
async hover(selector, options) {
|
||||
return await this._mainFrame.hover(selector, options);
|
||||
}
|
||||
async selectOption(selector, values, options) {
|
||||
return await this._mainFrame.selectOption(selector, values, options);
|
||||
}
|
||||
async setInputFiles(selector, files, options) {
|
||||
return await this._mainFrame.setInputFiles(selector, files, options);
|
||||
}
|
||||
async type(selector, text, options) {
|
||||
return await this._mainFrame.type(selector, text, options);
|
||||
}
|
||||
async press(selector, key, options) {
|
||||
return await this._mainFrame.press(selector, key, options);
|
||||
}
|
||||
async check(selector, options) {
|
||||
return await this._mainFrame.check(selector, options);
|
||||
}
|
||||
async uncheck(selector, options) {
|
||||
return await this._mainFrame.uncheck(selector, options);
|
||||
}
|
||||
async setChecked(selector, checked, options) {
|
||||
return await this._mainFrame.setChecked(selector, checked, options);
|
||||
}
|
||||
async waitForTimeout(timeout) {
|
||||
return await this._mainFrame.waitForTimeout(timeout);
|
||||
}
|
||||
async waitForFunction(pageFunction, arg, options) {
|
||||
return await this._mainFrame.waitForFunction(pageFunction, arg, options);
|
||||
}
|
||||
async requests() {
|
||||
const { requests } = await this._channel.requests();
|
||||
return requests.map((request) => import_network.Request.from(request));
|
||||
}
|
||||
workers() {
|
||||
return [...this._workers];
|
||||
}
|
||||
async pause(_options) {
|
||||
if (this._platform.isJSDebuggerAttached())
|
||||
return;
|
||||
const defaultNavigationTimeout = this._browserContext._timeoutSettings.defaultNavigationTimeout();
|
||||
const defaultTimeout = this._browserContext._timeoutSettings.defaultTimeout();
|
||||
this._browserContext.setDefaultNavigationTimeout(0);
|
||||
this._browserContext.setDefaultTimeout(0);
|
||||
this._instrumentation?.onWillPause({ keepTestTimeout: !!_options?.__testHookKeepTestTimeout });
|
||||
await this._closedOrCrashedScope.safeRace(this.context()._channel.pause());
|
||||
this._browserContext.setDefaultNavigationTimeout(defaultNavigationTimeout);
|
||||
this._browserContext.setDefaultTimeout(defaultTimeout);
|
||||
}
|
||||
async pdf(options = {}) {
|
||||
const transportOptions = { ...options };
|
||||
if (transportOptions.margin)
|
||||
transportOptions.margin = { ...transportOptions.margin };
|
||||
if (typeof options.width === "number")
|
||||
transportOptions.width = options.width + "px";
|
||||
if (typeof options.height === "number")
|
||||
transportOptions.height = options.height + "px";
|
||||
for (const margin of ["top", "right", "bottom", "left"]) {
|
||||
const index = margin;
|
||||
if (options.margin && typeof options.margin[index] === "number")
|
||||
transportOptions.margin[index] = transportOptions.margin[index] + "px";
|
||||
}
|
||||
const result = await this._channel.pdf(transportOptions);
|
||||
if (options.path) {
|
||||
const platform = this._platform;
|
||||
await platform.fs().promises.mkdir(platform.path().dirname(options.path), { recursive: true });
|
||||
await platform.fs().promises.writeFile(options.path, result.pdf);
|
||||
}
|
||||
return result.pdf;
|
||||
}
|
||||
// @ts-expect-error agents are hidden
|
||||
async agent(options = {}) {
|
||||
const params = {
|
||||
api: options.provider?.api,
|
||||
apiEndpoint: options.provider?.apiEndpoint,
|
||||
apiKey: options.provider?.apiKey,
|
||||
apiTimeout: options.provider?.apiTimeout,
|
||||
apiCacheFile: options.provider?._apiCacheFile,
|
||||
doNotRenderActive: options._doNotRenderActive,
|
||||
model: options.provider?.model,
|
||||
cacheFile: options.cache?.cacheFile,
|
||||
cacheOutFile: options.cache?.cacheOutFile,
|
||||
maxTokens: options.limits?.maxTokens,
|
||||
maxActions: options.limits?.maxActions,
|
||||
maxActionRetries: options.limits?.maxActionRetries,
|
||||
// @ts-expect-error runAgents is hidden
|
||||
secrets: options.secrets ? Object.entries(options.secrets).map(([name, value]) => ({ name, value })) : void 0,
|
||||
systemPrompt: options.systemPrompt
|
||||
};
|
||||
const { agent } = await this._channel.agent(params);
|
||||
const pageAgent = import_pageAgent.PageAgent.from(agent);
|
||||
pageAgent._expectTimeout = options?.expect?.timeout;
|
||||
return pageAgent;
|
||||
}
|
||||
async _snapshotForAI(options = {}) {
|
||||
return await this._channel.snapshotForAI({ timeout: this._timeoutSettings.timeout(options), track: options.track });
|
||||
}
|
||||
}
|
||||
class BindingCall extends import_channelOwner.ChannelOwner {
|
||||
static from(channel) {
|
||||
return channel._object;
|
||||
}
|
||||
constructor(parent, type, guid, initializer) {
|
||||
super(parent, type, guid, initializer);
|
||||
}
|
||||
async call(func) {
|
||||
try {
|
||||
const frame = import_frame.Frame.from(this._initializer.frame);
|
||||
const source = {
|
||||
context: frame._page.context(),
|
||||
page: frame._page,
|
||||
frame
|
||||
};
|
||||
let result;
|
||||
if (this._initializer.handle)
|
||||
result = await func(source, import_jsHandle.JSHandle.from(this._initializer.handle));
|
||||
else
|
||||
result = await func(source, ...this._initializer.args.map(import_jsHandle.parseResult));
|
||||
this._channel.resolve({ result: (0, import_jsHandle.serializeArgument)(result) }).catch(() => {
|
||||
});
|
||||
} catch (e) {
|
||||
this._channel.reject({ error: (0, import_errors.serializeError)(e) }).catch(() => {
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
function trimUrl(param) {
|
||||
if ((0, import_rtti.isRegExp)(param))
|
||||
return `/${(0, import_stringUtils.trimStringWithEllipsis)(param.source, 50)}/${param.flags}`;
|
||||
if ((0, import_rtti.isString)(param))
|
||||
return `"${(0, import_stringUtils.trimStringWithEllipsis)(param, 50)}"`;
|
||||
}
|
||||
// Annotate the CommonJS export names for ESM import in node:
|
||||
0 && (module.exports = {
|
||||
BindingCall,
|
||||
Page
|
||||
});
|
||||
64
projects/org-skill-web-research/node_modules/playwright-core/lib/client/pageAgent.js
generated
vendored
Normal file
64
projects/org-skill-web-research/node_modules/playwright-core/lib/client/pageAgent.js
generated
vendored
Normal file
@@ -0,0 +1,64 @@
|
||||
"use strict";
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var pageAgent_exports = {};
|
||||
__export(pageAgent_exports, {
|
||||
PageAgent: () => PageAgent
|
||||
});
|
||||
module.exports = __toCommonJS(pageAgent_exports);
|
||||
var import_channelOwner = require("./channelOwner");
|
||||
var import_events = require("./events");
|
||||
var import_page = require("./page");
|
||||
class PageAgent extends import_channelOwner.ChannelOwner {
|
||||
static from(channel) {
|
||||
return channel._object;
|
||||
}
|
||||
constructor(parent, type, guid, initializer) {
|
||||
super(parent, type, guid, initializer);
|
||||
this._page = import_page.Page.from(initializer.page);
|
||||
this._channel.on("turn", (params) => this.emit(import_events.Events.PageAgent.Turn, params));
|
||||
}
|
||||
async expect(expectation, options = {}) {
|
||||
const timeout = options.timeout ?? this._expectTimeout ?? 5e3;
|
||||
await this._channel.expect({ expectation, ...options, timeout });
|
||||
}
|
||||
async perform(task, options = {}) {
|
||||
const timeout = this._page._timeoutSettings.timeout(options);
|
||||
const { usage } = await this._channel.perform({ task, ...options, timeout });
|
||||
return { usage };
|
||||
}
|
||||
async extract(query, schema, options = {}) {
|
||||
const timeout = this._page._timeoutSettings.timeout(options);
|
||||
const { result, usage } = await this._channel.extract({ query, schema: this._page._platform.zodToJsonSchema(schema), ...options, timeout });
|
||||
return { result, usage };
|
||||
}
|
||||
async usage() {
|
||||
const { usage } = await this._channel.usage({});
|
||||
return usage;
|
||||
}
|
||||
async dispose() {
|
||||
await this._channel.dispose();
|
||||
}
|
||||
async [Symbol.asyncDispose]() {
|
||||
await this.dispose();
|
||||
}
|
||||
}
|
||||
// Annotate the CommonJS export names for ESM import in node:
|
||||
0 && (module.exports = {
|
||||
PageAgent
|
||||
});
|
||||
77
projects/org-skill-web-research/node_modules/playwright-core/lib/client/platform.js
generated
vendored
Normal file
77
projects/org-skill-web-research/node_modules/playwright-core/lib/client/platform.js
generated
vendored
Normal file
@@ -0,0 +1,77 @@
|
||||
"use strict";
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
var platform_exports = {};
|
||||
__export(platform_exports, {
|
||||
emptyPlatform: () => emptyPlatform
|
||||
});
|
||||
module.exports = __toCommonJS(platform_exports);
|
||||
var import_colors = require("../utils/isomorphic/colors");
|
||||
const noopZone = {
|
||||
push: () => noopZone,
|
||||
pop: () => noopZone,
|
||||
run: (func) => func(),
|
||||
data: () => void 0
|
||||
};
|
||||
const emptyPlatform = {
|
||||
name: "empty",
|
||||
boxedStackPrefixes: () => [],
|
||||
calculateSha1: async () => {
|
||||
throw new Error("Not implemented");
|
||||
},
|
||||
colors: import_colors.webColors,
|
||||
createGuid: () => {
|
||||
throw new Error("Not implemented");
|
||||
},
|
||||
defaultMaxListeners: () => 10,
|
||||
env: {},
|
||||
fs: () => {
|
||||
throw new Error("Not implemented");
|
||||
},
|
||||
inspectCustom: void 0,
|
||||
isDebugMode: () => false,
|
||||
isJSDebuggerAttached: () => false,
|
||||
isLogEnabled(name) {
|
||||
return false;
|
||||
},
|
||||
isUnderTest: () => false,
|
||||
log(name, message) {
|
||||
},
|
||||
path: () => {
|
||||
throw new Error("Function not implemented.");
|
||||
},
|
||||
pathSeparator: "/",
|
||||
showInternalStackFrames: () => false,
|
||||
streamFile(path, writable) {
|
||||
throw new Error("Streams are not available");
|
||||
},
|
||||
streamReadable: (channel) => {
|
||||
throw new Error("Streams are not available");
|
||||
},
|
||||
streamWritable: (channel) => {
|
||||
throw new Error("Streams are not available");
|
||||
},
|
||||
zodToJsonSchema: (schema) => {
|
||||
throw new Error("Zod is not available");
|
||||
},
|
||||
zones: { empty: noopZone, current: () => noopZone }
|
||||
};
|
||||
// Annotate the CommonJS export names for ESM import in node:
|
||||
0 && (module.exports = {
|
||||
emptyPlatform
|
||||
});
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user