@kodax-ai/kodax 0.7.92 → 0.7.93
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +27 -0
- package/README.md +9 -0
- package/README_CN.md +9 -0
- package/dist/chunks/{agent-YHHFIH7N.js → agent-R7HVNARP.js} +1 -1
- package/dist/chunks/argument-completer-JHXUJWHC.js +2 -0
- package/dist/chunks/{chunk-PKPBII4F.js → chunk-3YOZIFSJ.js} +2 -2
- package/dist/chunks/{chunk-OSQIYUGD.js → chunk-4BY53JTF.js} +2 -2
- package/dist/chunks/{chunk-X75UGXP3.js → chunk-7QBWHCIZ.js} +1 -1
- package/dist/chunks/chunk-A3ZQE2BX.js +519 -0
- package/dist/chunks/{chunk-FBL7IVMK.js → chunk-BHE66SP3.js} +14 -14
- package/dist/chunks/chunk-D27EY4XC.js +383 -0
- package/dist/chunks/{chunk-5CIKWSCA.js → chunk-HLZWPB32.js} +2 -2
- package/dist/chunks/{chunk-RJIYXB62.js → chunk-JJ2YDBSN.js} +2 -2
- package/dist/chunks/{chunk-AGZNXFHZ.js → chunk-JTZKC4TV.js} +4 -4
- package/dist/chunks/{chunk-QPBN3J4E.js → chunk-PRASABCC.js} +2 -2
- package/dist/chunks/{chunk-QKLS4BYA.js → chunk-SMVC3Q3U.js} +4 -4
- package/dist/chunks/{chunk-THZVJ6R7.js → chunk-XTWIGVUL.js} +1 -1
- package/dist/chunks/{construction-bootstrap-QVLJPFTL.js → construction-bootstrap-474QPSYB.js} +1 -1
- package/dist/chunks/{dist-XC5M7UYX.js → dist-H4PT2QAV.js} +1 -1
- package/dist/chunks/{dist-WNMK42WE.js → dist-ITTXQHRJ.js} +1 -1
- package/dist/chunks/{host-B3TK2U43.js → host-OR3IO2A4.js} +1 -1
- package/dist/chunks/{run-manager-5AV3MR4W.js → run-manager-MNOTWIFX.js} +1 -1
- package/dist/chunks/{utils-HPVZCR2J.js → utils-5J4BHNBV.js} +1 -1
- package/dist/index.js +1 -1
- package/dist/kodax_bootstrap.js +1 -1
- package/dist/kodax_cli.js +1035 -1035
- package/dist/runtime-worker.js +1007 -1007
- package/dist/sandbox-workspace-session.js +1 -1
- package/dist/sdk-a2a.js +1 -1
- package/dist/sdk-coding.js +1 -1
- package/dist/sdk-llm.js +1 -1
- package/dist/sdk-repl.js +1 -1
- package/dist/sdk-runtime.js +1 -1
- package/dist/sdk-sandbox.js +1 -1
- package/dist/sdk-session.js +1 -1
- package/package.json +1 -1
- package/dist/chunks/argument-completer-6ZTRBNZM.js +0 -2
- package/dist/chunks/chunk-A6GNPNGB.js +0 -383
- package/dist/chunks/chunk-BV3SVH36.js +0 -519
|
@@ -928,7 +928,7 @@ ${t.body}`)].join(`
|
|
|
928
928
|
`),sources:[{label:"session storage",path:"packages/repl/src/interactive/storage.ts"}],nextTopics:["compaction","memory","commands","troubleshooting"]},{id:"compaction",title:"Context compaction",aliases:["compact","automatic compaction","context compression","\u4E0A\u4E0B\u6587\u538B\u7F29","\u81EA\u52A8\u538B\u7F29"],summary:"Always-on large compaction thresholds, protected tail, query retention, and events.",body:["Automatic large context compaction is always enabled. The legacy `enabled:false`","setting is accepted for compatibility but cannot turn it off.","`compaction.triggerPercent` defaults to 75 and is clamped to 15..90.","`compaction.triggerTokens` is an optional absolute token threshold; omitted or 0","disables only that absolute threshold. The smaller percentage, positive absolute,","and physical provider-capacity threshold wins.","","The protected recent tail is 20% of the effective trigger, not 20% of the model","context window. One major-compaction wave summarizes the complete eligible prefix","once and preserves the recent tail atomically; it does not repeatedly compact only","the oldest chunk in one turn. A mechanical user-query ledger retains every genuine","user request and correction across later compactions.","","Large compaction is checked at request boundaries, never by a background timer.","Manual `/compact` and Runtime `sessions.compact()` bypass only the trigger comparison","and use the same effective policy and protected budget. SDK hosts can set per-run","`options.compaction` or Session `compactionTriggerPercent` /","`compactionTriggerTokens`; setting the Session absolute value to 0 removes it.","","A successful transition emits one post-commit `context.compaction.finished` fact.","Failed, stale, unchanged, or physically invalid fallback candidates do not emit a","successful compact result and do not partially replace canonical history.","","Before compacted raw bodies are evicted from memory, the root Session host durably","persists their exact lineage. The island sidecar is flushed before the slim main","Session replaces it; stable entry IDs deduplicate their overlap on load. A failed","sidecar or main write keeps an exact live or persisted copy and exposes a diagnostic.","The commit callback is awaited before the next model request or canonical finished","event. Runtime becomes the persistence owner across embedded and daemon boundaries.","Sessions already reduced to `[compacted]` by an older build cannot reconstruct bytes","that were never persisted, but all later compactions use the durable ordering.","","When a later request depends on an omitted detail, a root Agent can use","`session_history_search` and then bounded `session_history_read` instead of guessing","from the summary. Search covers exact persisted user, assistant, tool-result, and","child-task evidence, excludes hidden reasoning/system/checkpoint content, and binds","reads to a revision. SDK hosts use `sessions.transcriptSearch()` and then","`transcriptEntryChunk()` with the returned transcript revision and entry index."].join(`
|
|
929
929
|
`),sources:[{label:"v0.7.74 design",path:"docs/features/v0.7.74.md"},{label:"compaction config",path:"packages/coding/src/compaction-config.ts"},{label:"shared policy",path:"packages/agent/src/session-lineage/compaction/policy.ts"},{label:"history recovery",path:"packages/agent/src/session-lineage/history-retrieval.ts"},{label:"durable storage",path:"packages/repl/src/interactive/storage.ts"},{label:"SDK guide",path:"docs/SDK_EMBEDDER_GUIDE.md"}],nextTopics:["config","sessions","sdk"]},{id:"memory",title:"Governed memory",aliases:["memory","remember","recall","memory agent","memory_recall","memory_intent","\u8BB0\u5FC6","\u8BB0\u4F4F","\u4E0B\u6B21\u8BB0\u5F97","\u56DE\u5FC6"],summary:"F228 memory governance, automatic recall, deliberate query, and the experimental SDK.",body:["Top-level coding runs use the existing F228 Memory Control Plane. At session start KodaX","builds an exact-scoped memory pack; passive recall stays on the zero-wait hot path. When","the current context cannot answer a specific question about prior execution experience or","a user preference, the Action LLM may call the read-only memory_recall tool. Current","repository facts must still come from current tools, not memory.","","Memory management is conversation-first. When the user asks what KodaX remembers, or","explicitly asks it to remember, correct, or forget something, the root Action LLM calls","memory_intent. Mutations carry an exact quote from the current user turn. Safe explicit","requests apply immediately through the governed preview/fingerprint/apply controller and","do not create a duplicate episode review. Ordinary narration, quoted examples, temporary","task instructions, ambiguous targets, and sensitive content are not silently stored.","Ambiguous, conflicting, broad, or sensitive requests return clarification or an explained","decision. Autonomous episode review remains separate: verified low-risk changes may","auto-apply, while exceptional inferred changes remain reviewable and restart-recoverable.","","Recalled text is low-authority evidence, never an instruction override. Scope, secret","filtering, source evidence, lifecycle, and mutation protection are deterministic code gates.","Use /memory list|remember|forget|decisions|show|approve|reject|doctor|open as an advanced","escape hatch. MEMORY.md is a derived projection; open launches an external application and","the hidden rebuild command only repairs that projection. Durable changes still pass the","proposal/preview/fingerprint/apply controller;","KodaX does not expose filesystem memory actions or auto-edit prompts, policy, code, or weights.","","For `tool_failure`, `verification_failure`, or a durably committed `context_compacted`","event, `MemorySession.intervene()` rebuilds a closed prompt-safe candidate set and may","inject at most three low-authority evidence items before the next Action-LLM request.","Deterministic exact matches run without a model call. An in-process host may opt into the","bounded `memoryRecallRunner`; malformed, unknown, stale, timed-out, cancelled, or failed","selector output fails silent. The default runtime makes no selector call, and daemon DTOs","reject this function binding.","","SDK hosts can opt into @kodax-ai/kodax/experimental-memory. MemorySession.recall() is","synchronous; query() is deliberate and read-only; observe(), complete(), rewind(), and close()","provide bounded episode lifecycle. Decision receipts are trace-only and do not store hidden","reasoning. This subpath is experimental; the F228 control plane remains the only durable store."].join(`
|
|
930
930
|
`),sources:[{label:"coding memory runtime",path:"packages/coding/src/agent-runtime/run-substrate.ts"},{label:"memory recall tool",path:"packages/coding/src/tools/memory-recall.ts"},{label:"memory intent tool",path:"packages/coding/src/tools/memory-intent.ts"},{label:"memory command",path:"packages/repl/src/commands/memory-command.ts"},{label:"experimental memory SDK",path:"packages/agent/src/experimental-memory/"}],nextTopics:["sessions","tools","sdk"]},{id:"doctor",title:"kodax doctor",aliases:["doctor","diagnose","health check","ping","\u8BCA\u65AD","\u4F53\u68C0"],summary:"Diagnose config/provider/credential issues; --ping live reachability.",body:["Run `kodax doctor` to print a health report: configured provider(s), credential/config","state, and storage directories. Add `kodax doctor --ping` to live-probe whether each","configured provider is reachable with the current key. This is the first stop for",'connection / 401 / 429 / "provider not working" problems.'].join(`
|
|
931
|
-
`),sources:[{label:"doctor CLI",path:"src/kodax_doctor.ts"}],nextTopics:["troubleshooting","providers","config"]},{id:"sdk",title:"SDK",aliases:["embed","library","api","sdk\u5165\u95E8","\u5D4C\u5165"],summary:"Published subpaths, shared Runtime hosting, packaged Electron, A2A, and memory.",body:["The source monorepo has 4 workspace packages: @kodax-ai/llm, @kodax-ai/agent,","@kodax-ai/coding, and @kodax-ai/repl. The published @kodax-ai/kodax bundle exposes","12 SDK subpaths: /agent, /llm, /coding, /media, /repl, /skills, /mcp, /session,","/runtime, /sandbox, /a2a, and /experimental-memory.","Use @kodax-ai/kodax/coding for coding tasks; @kodax-ai/kodax/runtime for embedded,","Worker-hosted, or local-daemon sessions/runs/events/permissions;","@kodax-ai/kodax/sandbox for explicit host-owned ASRT containment;","@kodax-ai/kodax/a2a for the A2A 1.0 JSON-RPC/SSE client/server edge; and","@kodax-ai/kodax/experimental-memory for the opt-in MemoryAgent/MemorySession contract.","For an A2A server, listen() waits for durable recovery; a host wiring handle() directly","can await server.whenReady() before accepting traffic.","External Agent owner planes bound close to a 30-second default across admitted work","and executor disposal; hosts may set a positive finite `closeTimeoutMs` override.","","The shared local daemon is authoritative for one Coder profile. Join a session atomically","with sessions.observe(); replace local projection after runtime change/resync_required.","Use sessions.status() for the authoritative Session lifecycle projection and","captureRuntimeSessionDiagnostics() / sessions.diagnostics() for one bounded, read-only","support record. Diagnostics never take ownership, resume, repair, or migrate the Session.","Use sessions.conversation(), sessions.conversationPage(), and","sessions.conversationEntryChunk() for the same immutable ordinary-conversation projection","across embedded and daemon modes; require conversationHistory:1 when that contract is needed.","Control mutations use durable operation identities and settings/permission revisions.","AskUser and permissions are transport-safe. Provider credentials are requested just in","time and scoped to a run/provider; run-bound Host Tools never leak into unrelated CLI","runs. Daemon/inline ownership is fenced, and inline rollback remains sticky. Partner","products keep their separate private embedded Runtime.","The v0.7.90 stabilization keeps these ownership boundaries while making workspace","timeout retirement orderly, preserving direct clone provenance, and normalizing","run-scoped tool schemas before provider dispatch.","The v0.7.91 SDK adds `runtimeExitSettlement:1` and the public","`settleKodaXRuntimeExit({ configHome, profile, runtime? })` transaction.","Pass the connected Runtime for an orderly host exit; after relaunch, call it","with `configHome` and `profile` to resume an exact prepared ticket. `clean`","means verified orderly shutdown, `recovered` means identity-scoped repair","was proven safe, and `blocked` supplies a bounded next action. The API never","accepts short caller timeouts and never exposes bare-PID kill or raw ACL deletion.","The v0.7.92 SDK advertises `sandboxRuntime:4` and `crashOutcomeModel:2`.","Filesystem-effect tickets share an operation token with the coordinator lock;","a stale same-PID ticket is reclaimed only when it no longer owns that lock.","Managed `onComplete` is not terminal authority; the executor Promise is.","`KodaXFileLockTimeoutError` means the filesystem-effect coordinator was","unavailable, not that a learning job holds the lock. Do not delete ProgramData","lock files by hand.","Resume reconstruction uses canonical Session messages as the ordinary","conversation; uiHistory may overlay display metadata but cannot hide that","transcript. Presentation-only agent-completed and task-completed events","stay host-owned when a non-empty CLI uiHistory exists.","The same release requires `liveOutputSegments:1` for new daemon consumers and","bundles lazy Anthropic/OpenAI SDK dependency graphs in standalone binaries.","AskUser and permission prompts have independent bounded deadlines and owner AbortSignals. On expiry, Runtime accepts only a validated default; otherwise it dismisses the request. MCP reverse elicitation cancels through the same signal. `reclaimStaleKodaXFileLock` is the public Agent helper for an explicitly identified stale learning lock; it is not a general lock deletion primitive.","Configure `userInputTimeoutMs` independently from `permissionTimeoutMs`; both are validated before embedded, Worker, or daemon startup. Permission timeout 0 retains its timer-disable meaning.","","Require `learningCenter:1` and `skillLearningLoop:1` when a host depends on the complete","F263 project-canary contract. `runtime.learning` exposes list/get/snapshot/events/subscribe","plus explicit acknowledge, snooze, reject, disable, rollback, review, trust, and user-scope","promotion controls. Inventory and lifecycle state remain Runtime-owned; clients render","the Learning Center and never infer activation from files alone.","","Packaged/asar Electron hosts may use daemon auto-start when the default-enabled","RunAsNode fuse is available. `homeDir` is the CLI-style base directory that owns","`.kodax`; `KODAX_HOME` is the lower-level `.kodax` path. ELECTRON_RUN_AS_NODE exists","only at the detached child exec boundary and is removed before daemon or user child","code loads. If the fuse is disabled, start the daemon with ordinary Node/CLI and use","attach-only mode; KodaX does not reopen the GUI or silently fall back to inline mode.","","Windows child cleanup identity-checks observed processes and exposes indeterminate outcomes","instead of using bare-PID success. Snapshot ancestry is not Job Object containment: an","intermediate parent can exit before a later snapshot and hide a running descendant. Until","Issue 256 is resolved with spawn-time Job Object assignment and a host-issued Worker owner","lease, do not treat Runtime/Worker close as proof that every descendant terminated.","","Runtime Auto Mode is a durable Session setting, not a UI-side classifier. Query","sessions.getAutoModeStats() for current state and configure the engine/model/timeout","through Session settings. A missing LLM classifier model is a recoverable typed error,","not a fallback to rules or a permission prompt. Permission requests can include opaque","`grantSuggestions`; return a suggestion id for allow_session/allow_always rather than","building a scope. `RuntimePermissionMatcher` describes the Runtime-generated exact","command/path/call matcher, while persistent grants are revisioned through","permissions.listGrants() and revokeGrant(). Daemon capability","`runtimeAutoModeGuardrail` v4 advertises this concrete-grant and intent-aligned fallback contract.","Daemon auto-start requires v4 and safely replaces an idle v3 owner; v4 reports","`fallbackPersistsEngine:false`, so classifier degradation cannot silently select Rules.","","Hosts that depend on bounded source-level streaming batches can require","`runtimeEventCoalescing:1`. Auto-start safely upgrades an idle legacy daemon; busy or","otherwise unsafe owners fail closed instead of being stopped. Text and reasoning deltas","remain reconstructable and each accumulated merge stays within 8 KiB before sequence","allocation, durable event persistence, and subscriber delivery.","","Persisted Actor Sessions have one exclusive Runtime owner. Current owners publish a","loopback identity challenge in addition to their PID, so an unrelated process that reuses","the PID cannot pin crashed ownership. Ambiguous probes and legacy owners remain fail-closed.","","Model `wait_agent` and SDK `runtime.agents.wait()` are intentionally different.","The model tool waits for mailbox/user/interruption/timeout activity and receives only","an acknowledgement. SDK hosts use `runtime.agents.events()` for Actor event snapshots","and `runtime.agents.wait(sessionId, afterSequence, timeoutMs)` for sequence-based","telemetry long-poll; progress remains observable without resampling the action model.","For user input during an active Run, require `interruptInput:1` and call","`runtime.runs.submitInput()`; the Runtime delivers the ordered batch at a safe Runner","boundary rather than creating a continuation Run. A terminal candidate closes the input","window atomically, drains every already-accepted item, and reserves one same-Run model","turn even at the iteration limit. Failure, cancellation, and terminal cleanup keep the","window closed so undelivered input cannot leak into another Run.","","For a Runtime-owned Session, every delivered interrupt is first persisted as its own","canonical user entry. `runtime.runs.get().interruptInputs` and `run.input.delivered` expose","the delivered item's `entryId`, an exact canonical session-entry reference; compaction,","event replay, and Runtime restart preserve it. Treat the field as absent only for legacy","records and never invent an entry id: missing/ambiguous provenance or required persistence","failure fails the current delivery closed.","Since v0.7.82, submitInput resolves the admitted authoritative Run before reading mutable","Session history. Active interrupt and after-turn admission therefore avoid transient","`data_changed`; after-turn still waits for predecessor settlement and an exact operation","id produces one admission and one queue item.","An observed daemon Stop is cooperative: it fences later provider retries, continuations,","guardrails, tools, and Run-admitted Actor work while preserving turns already admitted.","Trusted Stop/Abort causality is classified before credential redaction; completion races","and independent failures remain factual terminal outcomes.","Since v0.7.83, a Windows daemon starts suspended and is assigned to a kill-on-close","Job Object before user code runs. An out-of-Job supervisor waits for daemon exit and","Job emptiness. `waitForRuntimeDaemonShutdown()` requires the exact durable cleanup","outcome plus daemon and supervisor exit; the `daemonShutdownVerification:1` capability","advertises this contract. A legacy daemon without containment is not reported as verified","and cannot be migrated safely in place for this requirement: stop and relaunch it.","This daemon-owned slice narrows Issue 256 but does not close its Worker owner-lease gap,","which remains open after v0.7.87; this release assigns no replacement target.","Since v0.7.84, Agent progress persistence is bounded to one in-flight","durable projection plus one latest replacement, so terminal settlement does not","wait behind an unbounded progress backlog. If Actor durability becomes unknown,","a same-owner Stop can reconcile and validate the late snapshot, quiesce remaining","turns, and retry the repair. Promise terminal facts outrank fallback callbacks","after repair; foreign owners and unresolved stores remain fail-closed. A no-op","quiesce does not rewrite the Session.","","Since v0.7.85, Runtime event order belongs to one Session journal. Every event","carries a { sessionId, journalEpoch, seq } cursor, and events.subscribe()/replay()","require sessionId or runId; numeric Runtime-global sequences are not resumable.","A2A binds one Runtime Session to each Task, daemon clients require","sessionEventJournal:1, and corrupt journal indexes or ambiguous retention evidence","fail closed. A terminal Run with authoritative status and no queued interrupt input","is restored at startup without replaying its complete event journal.","The semantic repo-intelligence Worker retires after its idle warm-cache window;","a later cache miss starts a fresh Worker.","","F289/F290 keep Memory review draining and lesson/verdict admission bounded and","observable. F292 makes explicit Memory management conversation-first: safe explicit","remember, correction, forget, and recall requests are host-governed, while","ambiguous or inferred changes remain reviewable. The experimental SDK exposes","MemoryManagementAgent only when the supplied controller supports that capability.","","Since v0.7.86, inline daemon-enable recovery removes only a provably abandoned","owner fence; live, malformed, legacy, and ambiguous owners remain fail-closed.","Runtime owner and learning-file lock records include an OS process-start identity,","so PID reuse cannot preserve stale ownership. Windows sandbox ACL owner markers are","durable and recovery is serialized across Runtime profiles. Sandbox stop waits for","process-tree termination proof before ACL recovery; missing attestation fences later","filesystem effects and never replays the command. Spawn, lease-release, and cleanup","failures remain combined in a lifecycle safety diagnostic. POSIX workspace sessions","initialize fresh KODAX_HOME policy roots before identity capture, settle only workspace-local","warm-up within the Shell abort/deadline, retire","invalid cached sessions after lease-cleanup failure, and block replacement after unconfirmed","process-tree or cleanup failure. Issue 256 remains open","after v0.7.87; this release assigns no replacement target.","","Coding hosts may pass `memoryRecallRunner` to opt into F275 semantic candidate selection;","without it, sparse governed intervention remains deterministic and adds zero selector calls.","Because the runner is a function binding, Worker/daemon DTO options reject it; configure it","inside the Runtime owner or use inline mode.","","The SDK is ESM-only. Capability queries such as per-model context/limits, credential","verification, and agent discovery can support embedder UIs without starting a coding run."].join(`
|
|
931
|
+
`),sources:[{label:"doctor CLI",path:"src/kodax_doctor.ts"}],nextTopics:["troubleshooting","providers","config"]},{id:"sdk",title:"SDK",aliases:["embed","library","api","sdk\u5165\u95E8","\u5D4C\u5165"],summary:"Published subpaths, shared Runtime hosting, packaged Electron, A2A, and memory.",body:["The source monorepo has 4 workspace packages: @kodax-ai/llm, @kodax-ai/agent,","@kodax-ai/coding, and @kodax-ai/repl. The published @kodax-ai/kodax bundle exposes","12 SDK subpaths: /agent, /llm, /coding, /media, /repl, /skills, /mcp, /session,","/runtime, /sandbox, /a2a, and /experimental-memory.","Use @kodax-ai/kodax/coding for coding tasks; @kodax-ai/kodax/runtime for embedded,","Worker-hosted, or local-daemon sessions/runs/events/permissions;","@kodax-ai/kodax/sandbox for explicit host-owned ASRT containment;","@kodax-ai/kodax/a2a for the A2A 1.0 JSON-RPC/SSE client/server edge; and","@kodax-ai/kodax/experimental-memory for the opt-in MemoryAgent/MemorySession contract.","For an A2A server, listen() waits for durable recovery; a host wiring handle() directly","can await server.whenReady() before accepting traffic.","External Agent owner planes bound close to a 30-second default across admitted work","and executor disposal; hosts may set a positive finite `closeTimeoutMs` override.","","The shared local daemon is authoritative for one Coder profile. Join a session atomically","with sessions.observe(); replace local projection after runtime change/resync_required.","Use sessions.status() for the authoritative Session lifecycle projection and","captureRuntimeSessionDiagnostics() / sessions.diagnostics() for one bounded, read-only","support record. Diagnostics never take ownership, resume, repair, or migrate the Session.","Use sessions.conversation(), sessions.conversationPage(), and","sessions.conversationEntryChunk() for the same immutable ordinary-conversation projection","across embedded and daemon modes; require conversationHistory:1 when that contract is needed.","Control mutations use durable operation identities and settings/permission revisions.","AskUser and permissions are transport-safe. Provider credentials are requested just in","time and scoped to a run/provider; run-bound Host Tools never leak into unrelated CLI","runs. Daemon/inline ownership is fenced, and inline rollback remains sticky. Partner","products keep their separate private embedded Runtime.","The v0.7.90 stabilization keeps these ownership boundaries while making workspace","timeout retirement orderly, preserving direct clone provenance, and normalizing","run-scoped tool schemas before provider dispatch.","The v0.7.91 SDK adds `runtimeExitSettlement:1` and the public","`settleKodaXRuntimeExit({ configHome, profile, runtime? })` transaction.","Pass the connected Runtime for an orderly host exit; after relaunch, call it","with `configHome` and `profile` to resume an exact prepared ticket. `clean`","means verified orderly shutdown, `recovered` means identity-scoped repair","was proven safe, and `blocked` supplies a bounded next action. The API never","accepts short caller timeouts and never exposes bare-PID kill or raw ACL deletion.","The v0.7.93 SDK keeps `sandboxRuntime:4` and `crashOutcomeModel:2`.","A durable Windows failed shutdown outcome ends the 170-second orderly","exit wait and enters exact recovery immediately.","After a verified boot change, previous-boot shared ACL markers may be","recovered under the machine lock before they are cleared.","Anthropic and OpenAI abort wrappers are classified by isolated SDK class","identity when the request signal is already aborted.","The v0.7.92 SDK advertises `sandboxRuntime:4` and `crashOutcomeModel:2`.","Filesystem-effect tickets share an operation token with the coordinator lock;","a stale same-PID ticket is reclaimed only when it no longer owns that lock.","Managed `onComplete` is not terminal authority; the executor Promise is.","`KodaXFileLockTimeoutError` means the filesystem-effect coordinator was","unavailable, not that a learning job holds the lock. Do not delete ProgramData","lock files by hand.","Resume reconstruction uses canonical Session messages as the ordinary","conversation; uiHistory may overlay display metadata but cannot hide that","transcript. Presentation-only agent-completed and task-completed events","stay host-owned when a non-empty CLI uiHistory exists.","The same release requires `liveOutputSegments:1` for new daemon consumers and","bundles lazy Anthropic/OpenAI SDK dependency graphs in standalone binaries.","AskUser and permission prompts have independent bounded deadlines and owner AbortSignals. On expiry, Runtime accepts only a validated default; otherwise it dismisses the request. MCP reverse elicitation cancels through the same signal. `reclaimStaleKodaXFileLock` is the public Agent helper for an explicitly identified stale learning lock; it is not a general lock deletion primitive.","Configure `userInputTimeoutMs` independently from `permissionTimeoutMs`; both are validated before embedded, Worker, or daemon startup. Permission timeout 0 retains its timer-disable meaning.","","Require `learningCenter:1` and `skillLearningLoop:1` when a host depends on the complete","F263 project-canary contract. `runtime.learning` exposes list/get/snapshot/events/subscribe","plus explicit acknowledge, snooze, reject, disable, rollback, review, trust, and user-scope","promotion controls. Inventory and lifecycle state remain Runtime-owned; clients render","the Learning Center and never infer activation from files alone.","","Packaged/asar Electron hosts may use daemon auto-start when the default-enabled","RunAsNode fuse is available. `homeDir` is the CLI-style base directory that owns","`.kodax`; `KODAX_HOME` is the lower-level `.kodax` path. ELECTRON_RUN_AS_NODE exists","only at the detached child exec boundary and is removed before daemon or user child","code loads. If the fuse is disabled, start the daemon with ordinary Node/CLI and use","attach-only mode; KodaX does not reopen the GUI or silently fall back to inline mode.","","Windows child cleanup identity-checks observed processes and exposes indeterminate outcomes","instead of using bare-PID success. Snapshot ancestry is not Job Object containment: an","intermediate parent can exit before a later snapshot and hide a running descendant. Until","Issue 256 is resolved with spawn-time Job Object assignment and a host-issued Worker owner","lease, do not treat Runtime/Worker close as proof that every descendant terminated.","","Runtime Auto Mode is a durable Session setting, not a UI-side classifier. Query","sessions.getAutoModeStats() for current state and configure the engine/model/timeout","through Session settings. A missing LLM classifier model is a recoverable typed error,","not a fallback to rules or a permission prompt. Permission requests can include opaque","`grantSuggestions`; return a suggestion id for allow_session/allow_always rather than","building a scope. `RuntimePermissionMatcher` describes the Runtime-generated exact","command/path/call matcher, while persistent grants are revisioned through","permissions.listGrants() and revokeGrant(). Daemon capability","`runtimeAutoModeGuardrail` v4 advertises this concrete-grant and intent-aligned fallback contract.","Daemon auto-start requires v4 and safely replaces an idle v3 owner; v4 reports","`fallbackPersistsEngine:false`, so classifier degradation cannot silently select Rules.","","Hosts that depend on bounded source-level streaming batches can require","`runtimeEventCoalescing:1`. Auto-start safely upgrades an idle legacy daemon; busy or","otherwise unsafe owners fail closed instead of being stopped. Text and reasoning deltas","remain reconstructable and each accumulated merge stays within 8 KiB before sequence","allocation, durable event persistence, and subscriber delivery.","","Persisted Actor Sessions have one exclusive Runtime owner. Current owners publish a","loopback identity challenge in addition to their PID, so an unrelated process that reuses","the PID cannot pin crashed ownership. Ambiguous probes and legacy owners remain fail-closed.","","Model `wait_agent` and SDK `runtime.agents.wait()` are intentionally different.","The model tool waits for mailbox/user/interruption/timeout activity and receives only","an acknowledgement. SDK hosts use `runtime.agents.events()` for Actor event snapshots","and `runtime.agents.wait(sessionId, afterSequence, timeoutMs)` for sequence-based","telemetry long-poll; progress remains observable without resampling the action model.","For user input during an active Run, require `interruptInput:1` and call","`runtime.runs.submitInput()`; the Runtime delivers the ordered batch at a safe Runner","boundary rather than creating a continuation Run. A terminal candidate closes the input","window atomically, drains every already-accepted item, and reserves one same-Run model","turn even at the iteration limit. Failure, cancellation, and terminal cleanup keep the","window closed so undelivered input cannot leak into another Run.","","For a Runtime-owned Session, every delivered interrupt is first persisted as its own","canonical user entry. `runtime.runs.get().interruptInputs` and `run.input.delivered` expose","the delivered item's `entryId`, an exact canonical session-entry reference; compaction,","event replay, and Runtime restart preserve it. Treat the field as absent only for legacy","records and never invent an entry id: missing/ambiguous provenance or required persistence","failure fails the current delivery closed.","Since v0.7.82, submitInput resolves the admitted authoritative Run before reading mutable","Session history. Active interrupt and after-turn admission therefore avoid transient","`data_changed`; after-turn still waits for predecessor settlement and an exact operation","id produces one admission and one queue item.","An observed daemon Stop is cooperative: it fences later provider retries, continuations,","guardrails, tools, and Run-admitted Actor work while preserving turns already admitted.","Trusted Stop/Abort causality is classified before credential redaction; completion races","and independent failures remain factual terminal outcomes.","Since v0.7.83, a Windows daemon starts suspended and is assigned to a kill-on-close","Job Object before user code runs. An out-of-Job supervisor waits for daemon exit and","Job emptiness. `waitForRuntimeDaemonShutdown()` requires the exact durable cleanup","outcome plus daemon and supervisor exit; the `daemonShutdownVerification:1` capability","advertises this contract. A legacy daemon without containment is not reported as verified","and cannot be migrated safely in place for this requirement: stop and relaunch it.","This daemon-owned slice narrows Issue 256 but does not close its Worker owner-lease gap,","which remains open after v0.7.87; this release assigns no replacement target.","Since v0.7.84, Agent progress persistence is bounded to one in-flight","durable projection plus one latest replacement, so terminal settlement does not","wait behind an unbounded progress backlog. If Actor durability becomes unknown,","a same-owner Stop can reconcile and validate the late snapshot, quiesce remaining","turns, and retry the repair. Promise terminal facts outrank fallback callbacks","after repair; foreign owners and unresolved stores remain fail-closed. A no-op","quiesce does not rewrite the Session.","","Since v0.7.85, Runtime event order belongs to one Session journal. Every event","carries a { sessionId, journalEpoch, seq } cursor, and events.subscribe()/replay()","require sessionId or runId; numeric Runtime-global sequences are not resumable.","A2A binds one Runtime Session to each Task, daemon clients require","sessionEventJournal:1, and corrupt journal indexes or ambiguous retention evidence","fail closed. A terminal Run with authoritative status and no queued interrupt input","is restored at startup without replaying its complete event journal.","The semantic repo-intelligence Worker retires after its idle warm-cache window;","a later cache miss starts a fresh Worker.","","F289/F290 keep Memory review draining and lesson/verdict admission bounded and","observable. F292 makes explicit Memory management conversation-first: safe explicit","remember, correction, forget, and recall requests are host-governed, while","ambiguous or inferred changes remain reviewable. The experimental SDK exposes","MemoryManagementAgent only when the supplied controller supports that capability.","","Since v0.7.86, inline daemon-enable recovery removes only a provably abandoned","owner fence; live, malformed, legacy, and ambiguous owners remain fail-closed.","Runtime owner and learning-file lock records include an OS process-start identity,","so PID reuse cannot preserve stale ownership. Windows sandbox ACL owner markers are","durable and recovery is serialized across Runtime profiles. Sandbox stop waits for","process-tree termination proof before ACL recovery; missing attestation fences later","filesystem effects and never replays the command. Spawn, lease-release, and cleanup","failures remain combined in a lifecycle safety diagnostic. POSIX workspace sessions","initialize fresh KODAX_HOME policy roots before identity capture, settle only workspace-local","warm-up within the Shell abort/deadline, retire","invalid cached sessions after lease-cleanup failure, and block replacement after unconfirmed","process-tree or cleanup failure. Issue 256 remains open","after v0.7.87; this release assigns no replacement target.","","Coding hosts may pass `memoryRecallRunner` to opt into F275 semantic candidate selection;","without it, sparse governed intervention remains deterministic and adds zero selector calls.","Because the runner is a function binding, Worker/daemon DTO options reject it; configure it","inside the Runtime owner or use inline mode.","","The SDK is ESM-only. Capability queries such as per-model context/limits, credential","verification, and agent discovery can support embedder UIs without starting a coding run."].join(`
|
|
932
932
|
`),sources:[{label:"published exports",path:"package.json"},{label:"Runtime facade",path:"src/sdk-runtime.ts"},{label:"A2A facade",path:"src/sdk-a2a.ts"},{label:"SDK embedder guide",path:"public_docs/sdk/embedder-guide.md"},{label:"known issues",path:"docs/KNOWN_ISSUES.md"}],nextTopics:["providers","agents","tools"]},{id:"troubleshooting",title:"Troubleshooting",aliases:["error","problem","401","429","fix","\u6392\u969C","\u62A5\u9519","\u95EE\u9898"],summary:"First run kodax doctor; provider 401/429, network, Windows paths, Node/npm.",body:["First: run `kodax doctor --ping` to localize the problem.","- 401 / unauthorized: key missing/invalid \u2014 check provider env var or config.json.","- 429 / rate limit: back off, or set KODAX_FALLBACK_PROVIDERS for cross-provider fallback.","- Network: corporate proxy / region blocks can fail provider endpoints.","- Windows: paths use forward slashes internally; case-insensitive workspace match is handled.","- Node/npm: ensure Node >= 20; reinstall the global package if the CLI is stale.","- Daemon exits before healthy: inspect ~/.kodax/runtime/daemon/<profile>/bootstrap.log.","- Integration degraded: validate only the named integrations/*.json domain. The core"," daemon remains usable and hot-recovers; do not delete config.json or the whole directory."].join(`
|
|
933
933
|
`),sources:[{label:"doctor CLI",path:"src/kodax_doctor.ts"}],nextTopics:["doctor","providers","config"]}],zw=Object.freeze(Object.fromEntries(PG.map(e=>[e.id,e])))});function OG(e){return{id:String(e.id??""),title:String(e.title??""),aliases:e.aliases??[],summary:String(e.summary??""),body:String(e.body??""),sources:e.sources??[],nextTopics:e.nextTopics??[]}}function $G(e,t){let n=new Map,r=[],i=t??Xw;for(let s of i){if(n.has(s))continue;let a=zw[s];a&&(n.set(s,a),r.push(s))}for(let s of e??[])n.has(s.id)||r.push(s.id),n.set(s.id,OG(s));return{ids:r,byId:n}}function DG(e,t){return`(${t} ${e} manual \u2014 about ${t} itself, not Claude Code or Codex CLI.`+(t==="KodaX"?" KodaX config lives in ~/.kodax/config.json + KODAX_* env vars.)":")")}function KP(e){return e.toLowerCase().split(/[^a-z0-9一-鿿]+/u).filter(t=>t.length>0)}function NG(e,t,n){return e.includes(n)?t.get(n):void 0}function LG(e,t,n){let r=n.trim().toLowerCase();if(r.length!==0)for(let i of e){let s=t.get(i);if(s.aliases.some(a=>a.toLowerCase()===r))return s}}function FG(e,t,n){if(t.length===0)return 0;let r=new Set(KP([e.id,e.title,e.summary,...e.aliases].join(" "))),i=0;for(let s of t)r.has(s)&&(i+=1);for(let s of e.aliases){let a=s.trim().toLowerCase();/[一-鿿]/u.test(a)&&n.includes(a)&&(i+=2)}return i}function BP(e,t,n){let r=KP(n),i=n.toLowerCase();return e.map(s=>t.get(s)).map(s=>({topic:s,score:FG(s,r,i)})).filter(s=>s.score>0).sort((s,a)=>a.score-s.score).map(s=>s.topic)}function WP(e,t){return{matchedTopic:e.id,title:e.title,content:`${DG(e.id,t)}
|
|
934
934
|
|
package/dist/sdk-a2a.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @kodax-ai/kodax — bundled distribution. See docs/ADR.md ADR-022 + ADR-024.
|
|
2
|
-
import"./chunks/chunk-QKLS4BYA.js";import"./chunks/chunk-PKPBII4F.js";import{j as nt,p as rt}from"./chunks/chunk-5CIKWSCA.js";import"./chunks/chunk-GRWUC6H7.js";import"./chunks/chunk-OSQIYUGD.js";import"./chunks/chunk-THZVJ6R7.js";import"./chunks/chunk-RJIYXB62.js";import"./chunks/chunk-X75UGXP3.js";import"./chunks/chunk-QPBN3J4E.js";import"./chunks/chunk-AGZNXFHZ.js";import"./chunks/chunk-GH3KBC2H.js";import"./chunks/chunk-YVG6OKN7.js";import"./chunks/chunk-FBL7IVMK.js";import{t as V}from"./chunks/chunk-7XSZVOG7.js";import"./chunks/chunk-QFV6YCIH.js";import{a as o}from"./chunks/chunk-ONUPGMER.js";var te="1.0",Pe="kodax-a2a-v1-jsonrpc";var A=class extends Error{constructor(n,r,i=200,s,a){super(r);this.code=n;this.httpStatus=i;this.data=s;this.headers=a;this.name="A2AError"}code;httpStatus;data;headers;static{o(this,"A2AError")}};function me(t){return t instanceof Error?t.message:String(t)}o(me,"errorMessage");var on=["apiKeySecurityScheme","httpAuthSecurityScheme","oauth2SecurityScheme","openIdConnectSecurityScheme","mtlsSecurityScheme"],an=["authorizationCode","clientCredentials","implicit","password","deviceCode"],cn=/^[\x21\x23-\x5B\x5D-\x7E]+$/u;function re(t,e){if(!cn.test(t))throw new Error(`${e} must be an RFC 6749 scope-token.`)}o(re,"assertOAuthScopeToken");function it(t,e){let n=t.split(" ");for(let r of n)re(r,e);return[...new Set(n)]}o(it,"parseOAuthScopeValue");function ie(t,e){if(!Array.isArray(t))throw new Error(`${e} must be an array of strings.`);let n=t.map((r,i)=>{if(typeof r!="string")throw new Error(`${e}[${i}] must be a string.`);return re(r,`${e}[${i}]`),r});if(new Set(n).size!==n.length)throw new Error(`${e} must not contain duplicates.`);return n}o(ie,"parseOAuthScopeList");function B(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}o(B,"isRecord");function O(t,e){if(typeof t!="string"||t.trim().length===0)throw new Error(`${e} must be a non-empty string.`);return t}o(O,"requireNonEmptyString");function dn(t,e){if(t!==void 0)return O(t,e)}o(dn,"optionalString");function st(t,e){return O(t,e).trim()}o(st,"trimmedUri");function un(t){return/^[A-Za-z][A-Za-z0-9+.-]*:\/\/([^/?#]*)/u.exec(t)?.[1]?.includes("@")===!0}o(un,"hasAuthorityUserinfo");function ye(t){let e=t.toLowerCase().replace(/^\[|\]$/gu,"");return e==="localhost"||e==="127.0.0.1"||e==="::1"}o(ye,"isExactOAuthLoopbackHostname");function ot(t,e){let n=st(t,e);if(!/^https?:\/\/([^/?#]*)/iu.exec(n)?.[1])throw new Error(`${e} must be an absolute HTTP(S) URL.`);let i;try{i=new URL(n)}catch{throw new Error(`${e} must be an absolute HTTP(S) URL.`)}if(un(n)||i.username||i.password||n.includes("#"))throw new Error(`${e} must not contain userinfo or a fragment.`);if(i.protocol==="http:"&&!ye(i.hostname))throw new Error(`${e} must use HTTPS or exact loopback HTTP.`);return{raw:n,url:i}}o(ot,"secureOAuthHttpUrl");function F(t,e){let n=ot(t,e);if(n.raw.includes("?"))throw new Error(`${e} must not contain a query or fragment.`);return n.raw}o(F,"parseOAuthIssuerIdentifier");function N(t,e){return ot(t,e).url}o(N,"parseOAuthEndpointUrl");function ne(t,e){let n=st(t,e);if(!/^[A-Za-z][A-Za-z0-9+.-]*:/u.test(n))throw new Error(`${e} must be an absolute URI.`);try{new URL(n)}catch{throw new Error(`${e} must be an absolute URI.`)}if(n.includes("#"))throw new Error(`${e} must not contain a fragment.`);return n}o(ne,"parseOAuthResourceIdentifier");function at(t,e){return N(t,e).href}o(at,"absoluteHttpUrl");function ln(t,e){if(!B(t))throw new Error(`${e} must be a scope-description object.`);return Object.entries(t).map(([n,r])=>{if(n.trim().length===0||typeof r!="string")throw new Error(`${e} must map non-empty scope names to descriptions.`);return re(n,`${e}.${n}`),n})}o(ln,"parseScopes");function An(t,e){if(!B(e))throw new Error(`securitySchemes.${t}.httpAuthSecurityScheme must be an object.`);let n=O(e.scheme,`securitySchemes.${t}.httpAuthSecurityScheme.scheme`),r=dn(e.bearerFormat,`securitySchemes.${t}.httpAuthSecurityScheme.bearerFormat`);return n.toLowerCase()!=="bearer"?{name:t,kind:"unsupported",protocol:`http:${n.toLowerCase()}`}:{name:t,kind:"http-bearer",...r?{bearerFormat:r}:{}}}o(An,"parseHttpScheme");function pn(t,e){let n=e.flows;if(!B(n))throw new Error(`securitySchemes.${t}.oauth2SecurityScheme.flows must be an object.`);let r=an.filter(c=>n[c]!==void 0);if(r.length!==1)throw new Error(`securitySchemes.${t}.oauth2SecurityScheme.flows must contain exactly one OAuth flow.`);let i=r[0],s=n[i];if(!B(s))throw new Error(`securitySchemes.${t}.oauth2SecurityScheme.flows.${i} must be an object.`);let a=ln(s.scopes,`securitySchemes.${t}.oauth2SecurityScheme.flows.${i}.scopes`);if(i==="clientCredentials"){let c=at(s.tokenUrl,`securitySchemes.${t}.oauth2SecurityScheme.flows.clientCredentials.tokenUrl`);return{name:t,kind:"oauth2-client-credentials",tokenUrl:c,scopes:a}}return{name:t,kind:"unsupported",protocol:`oauth2:${i}`,oauthScopes:a}}o(pn,"parseOAuthFlow");function fn(t,e,n){if(!B(n))throw new Error(`securitySchemes.${t}.${e} must be an object.`);if(e==="apiKeySecurityScheme"){let r=O(n.location,`securitySchemes.${t}.${e}.location`);if(!["query","header","cookie"].includes(r))throw new Error(`securitySchemes.${t}.${e}.location must be query, header, or cookie.`);return O(n.name,`securitySchemes.${t}.${e}.name`),{name:t,kind:"unsupported",protocol:"api-key"}}return e==="openIdConnectSecurityScheme"?(at(n.openIdConnectUrl,`securitySchemes.${t}.${e}.openIdConnectUrl`),{name:t,kind:"unsupported",protocol:"openid-connect",acceptsOAuthScopes:!0}):{name:t,kind:"unsupported",protocol:"mutual-tls"}}o(fn,"parseUnsupportedScheme");function hn(t,e){if(!B(e))throw new Error(`securitySchemes.${t} must be an object.`);let n=on.filter(i=>e[i]!==void 0);if(n.length!==1)throw new Error(`securitySchemes.${t} must contain exactly one security scheme.`);let r=n[0];if(r==="httpAuthSecurityScheme")return An(t,e[r]);if(r==="oauth2SecurityScheme"){let i=e[r];if(!B(i))throw new Error(`securitySchemes.${t}.${r} must be an object.`);return pn(t,i)}return fn(t,r,e[r])}o(hn,"parseScheme");function gn(t){if(t===void 0)return{};if(!B(t))throw new Error("securitySchemes must be an object.");return Object.fromEntries(Object.entries(t).map(([e,n])=>{if(e.trim().length===0)throw new Error("securitySchemes names must not be empty.");return[e,hn(e,n)]}))}o(gn,"parseSchemes");function mn(t,e){if(!B(t))throw new Error(`${e} must be a StringList object.`);if(t.list===void 0)return[];if(!Array.isArray(t.list)||!t.list.every(n=>typeof n=="string"&&n.trim().length>0))throw new Error(`${e}.list must be an array of non-empty strings.`);if(new Set(t.list).size!==t.list.length)throw new Error(`${e}.list must not contain duplicate scopes.`);for(let n of t.list)re(n,`${e}.list`);return t.list}o(mn,"parseScopeList");function yn(t,e){if(t.kind==="oauth2-client-credentials"||t.kind==="unsupported"&&t.oauthScopes!==void 0){let n=t.kind==="oauth2-client-credentials"?t.scopes:t.oauthScopes??[];for(let r of e)if(!n.includes(r))throw new Error(`scope "${r}" is not declared by security scheme "${t.name}".`);return}if(e.length>0&&!(t.kind==="unsupported"&&t.acceptsOAuthScopes))throw new Error(`security scheme "${t.name}" does not accept OAuth scopes.`)}o(yn,"validateRequiredScopes");function wn(t,e,n){if(!B(t))throw new Error(`securityRequirements[${e}] must be an object.`);let r=t.schemes;if(r!==void 0&&!B(r))throw new Error(`securityRequirements[${e}].schemes must be an object.`);return{schemes:Object.entries(r??{}).map(([a,c])=>{if(!Object.hasOwn(n,a))throw new Error(`securityRequirements[${e}] references unknown security scheme "${a}".`);let d=n[a],u=mn(c,`securityRequirements[${e}].schemes.${a}`);return yn(d,u),{scheme:d,scopes:u}})}}o(wn,"parseRequirement");function J(t,e){let n=gn(t);if(e===void 0)return{schemes:n,requirements:[]};if(!Array.isArray(e))throw new Error("securityRequirements must be an array.");return{schemes:n,requirements:e.map((r,i)=>wn(r,i,n))}}o(J,"parseA2ASecurity");function kn(t,e){let{scheme:n,scopes:r}=e;return n.kind!=="unsupported"&&t.schemeName===n.name&&t.kind===n.kind&&r.every(i=>t.scopes?.includes(i)===!0)}o(kn,"capabilityMatches");function Di(t,e){return we(t,e)[0]??null}o(Di,"selectA2ASecurityRequirement");function we(t,e){return(t.requirements.length===0?[{schemes:[]}]:t.requirements).filter(r=>r.schemes.every(i=>e.some(s=>kn(s,i))))}o(we,"satisfiableA2ASecurityRequirements");var Sn=new Set(["TASK_STATE_UNSPECIFIED","TASK_STATE_SUBMITTED","TASK_STATE_WORKING","TASK_STATE_COMPLETED","TASK_STATE_FAILED","TASK_STATE_CANCELED","TASK_STATE_INPUT_REQUIRED","TASK_STATE_REJECTED","TASK_STATE_AUTH_REQUIRED"]);function g(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}o(g,"isRecord");function ct(t){if(t===null)return;let e=t.split(";",1)[0]?.trim().toLowerCase();return e&&!/\s/u.test(e)?e:void 0}o(ct,"mediaTypeEssence");function de(t){let e=ct(t);return e==="application/json"||/^application\/[!#$%&'*+\-.^_`|~0-9a-z]+\+json$/u.test(e??"")}o(de,"isJsonMediaType");function dt(t){return ct(t)==="text/event-stream"}o(dt,"isEventStreamMediaType");function U(t,e,n){let r=t[e];if(typeof r!="string"||r.trim().length===0)throw new A(-32602,`${n}.${e} must be a non-empty string.`);return r}o(U,"requiredString");function I(t,e){let n=t[e];return typeof n=="string"&&n.length>0?n:void 0}o(I,"optionalString");function se(t,e){if(!Array.isArray(t)||!t.every(n=>typeof n=="string"))throw new A(-32602,`${e} must be a string array.`);return t}o(se,"stringArray");function Rn(t){if(!g(t))throw new A(-32602,"Agent Card interface is invalid.");return{url:U(t,"url","interface"),protocolBinding:U(t,"protocolBinding","interface"),protocolVersion:U(t,"protocolVersion","interface"),...I(t,"tenant")?{tenant:I(t,"tenant")}:{}}}o(Rn,"parseInterface");function ut(t,e,n){try{J(t,e)}catch(r){let i=r instanceof Error?r.message:String(r);throw new A(-32602,`${n} is invalid: ${i}`)}}o(ut,"validateSecurity");function Tn(t,e){if(!g(t))throw new A(-32602,"Agent Card skill is invalid.");return t.securityRequirements!==void 0&&ut(e,t.securityRequirements,"skill.securityRequirements"),{id:U(t,"id","skill"),name:U(t,"name","skill"),description:U(t,"description","skill"),tags:se(t.tags,"skill.tags"),...Array.isArray(t.examples)?{examples:se(t.examples,"skill.examples")}:{},...Array.isArray(t.inputModes)?{inputModes:se(t.inputModes,"skill.inputModes")}:{},...Array.isArray(t.outputModes)?{outputModes:se(t.outputModes,"skill.outputModes")}:{},...Array.isArray(t.securityRequirements)?{securityRequirements:t.securityRequirements.filter(g)}:{}}}o(Tn,"parseSkill");function En(t){if(!g(t))throw new A(-32602,"Agent Card extension is invalid.");let e=U(t,"uri","extension");try{new URL(e)}catch{throw new A(-32602,"Agent Card extension.uri must be an absolute URI.")}if(t.description!==void 0&&typeof t.description!="string")throw new A(-32602,"Agent Card extension.description must be a string.");if(t.required!==void 0&&typeof t.required!="boolean")throw new A(-32602,"Agent Card extension.required must be a boolean.");if(t.params!==void 0&&!g(t.params))throw new A(-32602,"Agent Card extension.params must be an object.");return{uri:e,...typeof t.description=="string"?{description:t.description}:{},...typeof t.required=="boolean"?{required:t.required}:{},...g(t.params)?{params:t.params}:{}}}o(En,"parseExtension");function lt(t){if(!g(t))throw new A(-32602,"Agent Card must be an object.");let e=t.supportedInterfaces,n=t.skills;if(!Array.isArray(e)||e.length===0)throw new A(-32602,"Agent Card must declare supportedInterfaces.");if(!Array.isArray(n))throw new A(-32602,"Agent Card must declare skills.");if(!g(t.capabilities))throw new A(-32602,"Agent Card capabilities are invalid.");if(t.capabilities.extensions!==void 0&&!Array.isArray(t.capabilities.extensions))throw new A(-32602,"Agent Card capabilities.extensions must be an array.");return ut(t.securitySchemes,t.securityRequirements,"Agent Card security declaration"),{name:U(t,"name","Agent Card"),description:U(t,"description","Agent Card"),supportedInterfaces:e.map(Rn),version:U(t,"version","Agent Card"),capabilities:{...typeof t.capabilities.streaming=="boolean"?{streaming:t.capabilities.streaming}:{},...typeof t.capabilities.pushNotifications=="boolean"?{pushNotifications:t.capabilities.pushNotifications}:{},...typeof t.capabilities.extendedAgentCard=="boolean"?{extendedAgentCard:t.capabilities.extendedAgentCard}:{},...Array.isArray(t.capabilities.extensions)?{extensions:t.capabilities.extensions.map(En)}:{}},...g(t.securitySchemes)?{securitySchemes:t.securitySchemes}:{},...Array.isArray(t.securityRequirements)?{securityRequirements:t.securityRequirements.filter(g)}:{},defaultInputModes:se(t.defaultInputModes,"Agent Card defaultInputModes"),defaultOutputModes:se(t.defaultOutputModes,"Agent Card defaultOutputModes"),skills:n.map(r=>Tn(r,t.securitySchemes))}}o(lt,"parseA2AAgentCard");function At(t){if(!g(t))throw new A(-32602,"Message Part must be an object.");let e=["text","raw","url","data"].filter(r=>t[r]!==void 0);if(e.length!==1)throw new A(-32602,"Message Part must contain exactly one content field.");let n=e[0];if(n!=="data"&&typeof t[n]!="string")throw new A(-32602,`Message Part ${n} content must be a string.`);return{...typeof t.text=="string"?{text:t.text}:{},...typeof t.raw=="string"?{raw:t.raw}:{},...typeof t.url=="string"?{url:t.url}:{},...t.data!==void 0?{data:t.data}:{},...g(t.metadata)?{metadata:t.metadata}:{},...I(t,"filename")?{filename:I(t,"filename")}:{},...I(t,"mediaType")?{mediaType:I(t,"mediaType")}:{}}}o(At,"parseA2APart");function D(t){if(!g(t))throw new A(-32602,"Message must be an object.");if(t.role!=="ROLE_USER"&&t.role!=="ROLE_AGENT")throw new A(-32602,"Message role is invalid.");if(!Array.isArray(t.parts)||t.parts.length===0)throw new A(-32602,"Message parts must not be empty.");return{messageId:U(t,"messageId","Message"),role:t.role,parts:t.parts.map(At),...I(t,"contextId")?{contextId:I(t,"contextId")}:{},...I(t,"taskId")?{taskId:I(t,"taskId")}:{},...g(t.metadata)?{metadata:t.metadata}:{}}}o(D,"parseA2AMessage");function bn(t){if(!g(t)||!Array.isArray(t.parts)||t.parts.length===0)throw new A(-32603,"A2A artifact is invalid.");return{artifactId:U(t,"artifactId","Artifact"),parts:t.parts.map(At),...I(t,"name")?{name:I(t,"name")}:{},...I(t,"description")?{description:I(t,"description")}:{},...g(t.metadata)?{metadata:t.metadata}:{}}}o(bn,"parseArtifact");function H(t){if(!g(t)||!g(t.status))throw new A(-32603,"A2A task is invalid.");let e=t.status.state;if(typeof e!="string")throw new A(-32603,"A2A task state is invalid.");let n=Sn.has(e)?e:"TASK_STATE_UNSPECIFIED";return{id:U(t,"id","Task"),contextId:I(t,"contextId")??"",status:{state:n,...t.status.message!==void 0?{message:D(t.status.message)}:{},...I(t.status,"timestamp")?{timestamp:I(t.status,"timestamp")}:{}},...Array.isArray(t.artifacts)?{artifacts:t.artifacts.map(bn)}:{},...Array.isArray(t.history)?{history:t.history.map(D)}:{},...g(t.metadata)?{metadata:t.metadata}:{}}}o(H,"parseA2ATask");function pt(t){if(!g(t)||t.jsonrpc!=="2.0")throw new A(-32600,"Invalid JSON-RPC request.");if(typeof t.id!="string"&&typeof t.id!="number")throw new A(-32600,"JSON-RPC request id is required.");return{jsonrpc:"2.0",id:t.id,method:U(t,"method","JSON-RPC request"),...g(t.params)?{params:t.params}:{}}}o(pt,"parseJsonRpcRequest");import{lookup as xn}from"node:dns/promises";import{request as In}from"node:http";import{request as Cn}from"node:https";import{BlockList as vn,isIP as ft}from"node:net";import{Readable as Pn}from"node:stream";var ke=new vn;ke.addSubnet("127.0.0.0",8,"ipv4");ke.addAddress("::1","ipv6");function Oe(t){let e=ft(t);return e===4?ke.check(t,"ipv4"):e===6&&ke.check(t,"ipv6")}o(Oe,"isLoopbackAddress");function On(t){let e=t.toLowerCase();return e==="localhost"||e==="127.0.0.1"||e==="::1"}o(On,"isExactLoopbackHostname");function _e(t){let e=t.split(".").map(Number),[n,r,i,s]=e;return e.length!==4||n===void 0||r===void 0||i===void 0||s===void 0?!0:n===0||n===10||n===127||n===100&&r>=64&&r<=127||n===169&&r===254||n===172&&r>=16&&r<=31||n===192&&r===168||n===192&&r===0&&i===0&&s!==9&&s!==10||n===192&&r===0&&i===2||n===198&&(r===18||r===19)||n===198&&r===51&&i===100||n===203&&r===0&&i===113||n>=224}o(_e,"isPrivateIpv4");function _n(t){if(Oe(t))return!0;let e=t.toLowerCase(),n=/^::ffff:(\d+\.\d+\.\d+\.\d+)$/.exec(e)?.[1];if(n)return _e(n);let r=/^::ffff:([0-9a-f]{1,4}):([0-9a-f]{1,4})$/.exec(e);if(r?.[1]&&r[2]){let i=Number.parseInt(r[1],16),s=Number.parseInt(r[2],16);return _e(`${i>>8}.${i&255}.${s>>8}.${s&255}`)}return e==="::"||e==="::1"||e.startsWith("fc")||e.startsWith("fd")||e.startsWith("fe8")||e.startsWith("fe9")||e.startsWith("fea")||e.startsWith("feb")||e.startsWith("ff")}o(_n,"isPrivateIpv6");function Un(t){let e=ft(t);return e===4?_e(t):e===6?_n(t):!0}o(Un,"isPrivateAddress");async function ht(t,e){if(t.protocol!=="https:"&&t.protocol!=="http:")throw new A(-32602,"A2A URL must use HTTP or HTTPS.");if(!e.allowedOrigins.includes(t.origin))throw new A(-32602,`A2A origin is not allowed: ${t.origin}`);if(t.username||t.password)throw new A(-32602,"A2A URL must not include credentials.");let n=t.hostname.startsWith("[")&&t.hostname.endsWith("]")?t.hostname.slice(1,-1):t.hostname,r=await xn(n,{all:!0,verbatim:!0});if(r.length===0)throw new A(-32602,"A2A hostname did not resolve.");if(n.toLowerCase()==="localhost"&&!r.every(a=>Oe(a.address)))throw new A(-32602,"A2A localhost target must resolve only to loopback addresses.");let i=On(n)&&r.every(a=>Oe(a.address));if(t.protocol==="http:"&&!i&&e.allowInsecureHttp!==!0)throw new A(-32602,"Non-loopback A2A targets must use HTTPS unless plaintext HTTP is explicitly allowed.");if(!e.allowPrivateAddresses&&r.some(a=>Un(a.address)))throw new A(-32602,"A2A private network targets are not allowed.");let s=r[0];if(s===void 0||s.family!==4&&s.family!==6)throw new A(-32602,"A2A hostname returned an unsupported address.");return{address:s.address,family:s.family}}o(ht,"validateA2AUrl");async function Mn(t,e){await ht(t,e)}o(Mn,"assertSafeA2AUrl");function Ln(t){if(t==null||typeof t=="string")return t??void 0;if(t instanceof URLSearchParams)return t.toString();if(t instanceof Uint8Array)return t;if(t instanceof ArrayBuffer)return new Uint8Array(t);if(ArrayBuffer.isView(t))return new Uint8Array(t.buffer,t.byteOffset,t.byteLength);throw new A(-32602,"A2A request body type is not supported by the safe transport.")}o(Ln,"encodeRequestBody");function qn(t){return((e,n,r)=>{if(typeof n=="object"&&n.all){r(null,[t]);return}r(null,t.address,t.family)})}o(qn,"pinnedLookup");function $n(t,e,n){return new Promise((r,i)=>{let s=new Headers(e.headers);s.set("accept-encoding","identity");let a=(t.protocol==="https:"?Cn:In)(t,{method:e.method,headers:Object.fromEntries(s),lookup:qn(n),signal:e.signal??void 0},c=>{let d=new Headers;for(let p=0;p<c.rawHeaders.length;p+=2){let h=c.rawHeaders[p],w=c.rawHeaders[p+1];h!==void 0&&w!==void 0&&d.append(h,w)}let u=c.statusCode??500,l=e.method!=="HEAD"&&u!==204&&u!==205&&u!==304?Pn.toWeb(c):null;r(new Response(l,{status:u,statusText:c.statusMessage,headers:d}))});a.once("error",i),a.end(Ln(e.body))})}o($n,"requestValidatedAddress");async function Ue(t,e,n,r){let i=await ht(t,n);return r!==void 0?r(t,e):$n(t,e,i)}o(Ue,"openSafeA2AResponse");async function Nn(t,e){let n=t.headers.get("content-length");if(n&&Number(n)>e)throw new A(-32603,"A2A response is too large.");if(!t.body)return new Uint8Array;let r=t.body.getReader(),i=[],s=0;for(;;){let d=await r.read();if(d.done)break;if(s+=d.value.byteLength,s>e)throw await r.cancel(),new A(-32603,"A2A response is too large.");i.push(d.value)}let a=new Uint8Array(s),c=0;for(let d of i)a.set(d,c),c+=d.byteLength;return a}o(Nn,"boundedBody");function Dn(t,e){if(!t)return{signal:e,cleanup:o(()=>{},"cleanup")};let n=new AbortController,r=o(()=>n.abort(t.reason),"abortFromCaller"),i=o(()=>n.abort(e.reason),"abortFromDeadline");return t.aborted?r():t.addEventListener("abort",r,{once:!0}),e.aborted?i():e.addEventListener("abort",i,{once:!0}),{signal:n.signal,cleanup:o(()=>{t.removeEventListener("abort",r),e.removeEventListener("abort",i)},"cleanup")}}o(Dn,"combineAbortSignals");async function G(t,e,n,r){let i=t,s=new Headers(e.headers).get("authorization");for(let a=0;a<=n.maxRedirects;a+=1){let c=new AbortController,d=setTimeout(()=>c.abort(new Error("A2A request timed out.")),n.requestTimeoutMs),u=Dn(e.signal,c.signal),f=new Headers(e.headers);s===null?f.delete("authorization"):f.set("authorization",s);try{let l=await Ue(i,{...e,headers:f,redirect:"manual",signal:u.signal},n,r);if(l.status<300||l.status>=400)return{response:l,body:await Nn(l,n.maxResponseBytes),url:i};let p=l.headers.get("location");if(!p||a===n.maxRedirects)throw new A(-32603,"A2A redirect limit exceeded.");let h=new URL(p,i);await l.body?.cancel(),h.origin!==i.origin&&(s=null),i=h}finally{clearTimeout(d),u.cleanup()}}throw new A(-32603,"A2A redirect limit exceeded.")}o(G,"safeA2AFetch");function X(t){return new TextDecoder("utf-8",{fatal:!0}).decode(t)}o(X,"decodeUtf8");import{createHash as Fn,randomUUID as Me}from"node:crypto";import*as K from"oauth4webapi";var Kn=6e4,jn=1e3,Bn=.1;function Hn(t,e){return new Response(e.byteLength===0?null:X(e),{status:t.status,statusText:t.statusText,headers:t.headers})}o(Hn,"oauthResponse");function zn(t,e){if(e===void 0||e<=0)return t;let n=e*1e3,r=Math.min(Kn,Math.max(jn,n*Bn));return t+Math.max(0,n-r)}o(zn,"cacheExpiry");function gt(t){let e=O(t.clientId,"OAuth 2.0 clientId");if(t.clientAuthenticationMethod!=="basic"&&t.clientAuthenticationMethod!=="post")throw new Error("OAuth 2.0 clientAuthenticationMethod must be basic or post.");let n=t.clientAuthenticationMethod,r=t.scopes===void 0?void 0:ie(t.scopes,"OAuth 2.0 scopes"),i=F(t.issuer,"OAuth 2.0 issuer"),s=N(t.tokenUrl,"OAuth 2.0 token endpoint"),a=t.resource===void 0?void 0:ne(t.resource,"OAuth 2.0 resource"),c={issuer:i,token_endpoint:s.href},d={client_id:e},u={...t.networkPolicy,maxRedirects:0},f=t.now??Date.now,l,p,h=0;async function w(k){let y=n==="post"?K.ClientSecretPost(k):K.ClientSecretBasic(k),T=new URLSearchParams;r&&r.length>0&&T.set("scope",r.join(" ")),a!==void 0&&T.set("resource",a);let m={[K.customFetch]:async(R,_)=>{if(new URL(R).href!==s.href)throw new Error("OAuth 2.0 token request targeted an unexpected endpoint.");let j=await G(s,{method:_.method,headers:_.headers,body:_.body,redirect:"manual",..._.signal!==void 0?{signal:_.signal}:{}},u,t.fetch);return Hn(j.response,j.body)}};s.protocol==="http:"&&(m[K.allowInsecureRequests]=!0);let S;try{let R=await K.clientCredentialsGrantRequest(c,d,y,T,m);S=await K.processClientCredentialsResponse(c,d,R)}catch{throw new Error("OAuth 2.0 client credentials token request failed.")}if(S.token_type!=="bearer")throw new Error("OAuth 2.0 token endpoint did not return a Bearer access token.");let L=f();return{value:`Bearer ${S.access_token}`,expiresAt:zn(L,S.expires_in)}}return o(w,"requestAuthorization"),{async getAuthorization(k){if(k.length===0)throw new Error("OAuth 2.0 client secret is required.");let y=f();if(l!==void 0&&l.expiresAt>y)return l.value;if(p!==void 0)return p;let T=h,m;return m=w(k).then(S=>(h===T&&S.expiresAt>f()&&(l=S),S.value)).finally(()=>{p===m&&(p=void 0)}),p=m,m},invalidate(k){if(k!==void 0){l?.value===k&&(l=void 0);return}h+=1,l=void 0,p=void 0}}}o(gt,"createOAuth2ClientCredentialsTokenManager");var mt=4,yt=/^[A-Za-z0-9\-._~+/=]$/u;function Se(t){return t!==void 0&&/^Bearer\s+\S+$/iu.test(t)}o(Se,"isBearerAuthorization");function Jn(t,e){let n="",r=0;for(;r<t.length;){let i=t.indexOf(e,r);if(i<0)return n+t.slice(r);let s=i===0?void 0:t[i-1],a=i+e.length,c=a===t.length?void 0:t[a],d=s===void 0||!yt.test(s),u=c===void 0||!yt.test(c);n+=t.slice(r,i),d&&u?(n+="[REDACTED]",r=a):(n+=e,r=a)}return n}o(Jn,"replaceBoundedToken");function Ae(t){return Array.isArray(t)?`[${t.map(Ae).join(",")}]`:g(t)?`{${Object.keys(t).sort().map(e=>`${JSON.stringify(e)}:${Ae(t[e])}`).join(",")}}`:JSON.stringify(t)??"null"}o(Ae,"stableJson");function wt(t){return`sha256:${Fn("sha256").update(t).digest("hex")}`}o(wt,"sha256");var qe=class{static{o(this,"AuthorizationRedactor")}#e=[];#n=new Map;remember(e){if(!e)return;let n=this.#e.indexOf(e);n>=0&&this.#e.splice(n,1),this.#e.unshift(e),this.#e.length>mt&&(this.#e.length=mt)}retain(e){if(!e)return()=>{};this.remember(e),this.#n.set(e,(this.#n.get(e)??0)+1);let n=!1;return()=>{if(n)return;n=!0;let r=(this.#n.get(e)??1)-1;r===0?this.#n.delete(e):this.#n.set(e,r)}}redactText(e){let n=[...new Set([...this.#n.keys(),...this.#e])],r=n.sort((s,a)=>a.length-s.length).reduce((s,a)=>s.split(a).join("[REDACTED]"),e),i=n.flatMap(s=>{let a=/^Bearer\s+(\S+)$/iu.exec(s)?.[1];return a?[a]:[]}).sort((s,a)=>a.length-s.length);return[...new Set(i)].reduce((s,a)=>Jn(s,a),r)}redactContent(e){return typeof e=="string"?this.redactText(e):Array.isArray(e)?e.map(n=>this.redactContent(n)):g(e)?Object.fromEntries(Object.entries(e).map(([n,r])=>[n,this.redactContent(r)])):e}redactPart(e){return{...e,...e.text===void 0?{}:{text:this.redactText(e.text)},...e.raw===void 0?{}:{raw:this.redactText(e.raw)},...e.url===void 0?{}:{url:this.redactText(e.url)},...e.data===void 0?{}:{data:this.redactContent(e.data)},...e.metadata===void 0?{}:{metadata:this.redactContent(e.metadata)},...e.filename===void 0?{}:{filename:this.redactText(e.filename)}}}redactMessage(e){return{...e,parts:e.parts.map(n=>this.redactPart(n)),...e.metadata===void 0?{}:{metadata:this.redactContent(e.metadata)}}}redactArtifact(e){return{...e,...e.name===void 0?{}:{name:this.redactText(e.name)},...e.description===void 0?{}:{description:this.redactText(e.description)},parts:e.parts.map(n=>this.redactPart(n)),...e.metadata===void 0?{}:{metadata:this.redactContent(e.metadata)}}}redactTask(e){return{...e,status:{...e.status,...e.status.message===void 0?{}:{message:this.redactMessage(e.status.message)}},...e.artifacts===void 0?{}:{artifacts:e.artifacts.map(n=>this.redactArtifact(n))},...e.history===void 0?{}:{history:e.history.map(n=>this.redactMessage(n))},...e.metadata===void 0?{}:{metadata:this.redactContent(e.metadata)}}}redactError(e){let n=this.redactText(e instanceof Error?e.message:String(e));return e instanceof A?new A(e.code,n,e.httpStatus,this.redactContent(e.data),e.headers):new Error(n)}};function kt(t,e){let n=new URL(e).origin;if(!t.allowedOrigins.some(i=>new URL(i).origin===n))throw new Error(`A2A endpoint origin is not allowed by network policy: ${n}`);return{...t,allowedOrigins:[n]}}o(kt,"endpointNetworkPolicy");function Wn(t){if(t!==void 0){if(!g(t)||typeof t.scheme!="string")throw new Error("A2A registration authentication is invalid.");if(t.type==="http-bearer")return{type:"http-bearer",scheme:t.scheme};if(t.type!=="oauth2-client-credentials"||typeof t.issuer!="string"||typeof t.tokenUrl!="string"||typeof t.clientId!="string"||!Array.isArray(t.scopes)||!t.scopes.every(e=>typeof e=="string")||!["client-secret-basic","client-secret-post"].includes(String(t.clientAuthentication)))throw new Error("A2A registration OAuth2 authentication is invalid.");return{type:"oauth2-client-credentials",scheme:t.scheme,issuer:t.issuer,tokenUrl:t.tokenUrl,clientId:t.clientId,scopes:t.scopes,...typeof t.resource=="string"?{resource:t.resource}:{},clientAuthentication:t.clientAuthentication}}}o(Wn,"executorAuthentication");function Q(t){let e=t.executorConfig;if(!g(e))throw new Error("A2A registration executorConfig is missing.");if(typeof e.agentCardUrl!="string"||typeof e.interfaceUrl!="string")throw new Error("A2A registration endpoints are invalid.");let n=Wn(e.authentication);return{agentCardUrl:e.agentCardUrl,interfaceUrl:e.interfaceUrl,...typeof e.tenant=="string"?{tenant:e.tenant}:{},...n?{authentication:n}:{}}}o(Q,"executorConfig");function Vn(t,e){let n=t.supportedInterfaces.find(i=>i.protocolBinding.toUpperCase()==="JSONRPC"&&i.protocolVersion==="1.0");if(!n)throw new Error("Agent Card has no supported A2A 1.0 JSONRPC interface.");let r=new URL(n.url);if(r.username||r.password||r.hash)throw new Error("A2A interface URL must not contain credentials or a fragment.");if(r.origin!==e.origin)throw new Error("A2A interface must use the same origin as the trusted Agent Card.");return n}o(Vn,"chooseInterface");function Gn(t){if(t===void 0)return;if(!g(t))throw new Error("A2A authentication must be an object.");let e=O(t.scheme,"A2A authentication.scheme");if(t.type==="http-bearer")return{type:"http-bearer",scheme:e,credentialRef:O(t.credentialRef,"A2A authentication.credentialRef")};if(t.type!=="oauth2-client-credentials")throw new Error("A2A authentication.type must be http-bearer or oauth2-client-credentials.");if(t.clientAuthentication!=="client-secret-basic"&&t.clientAuthentication!=="client-secret-post")throw new Error("A2A authentication.clientAuthentication is invalid.");return{type:"oauth2-client-credentials",scheme:e,issuer:F(t.issuer,"Configured OAuth2 issuer"),tokenUrl:N(t.tokenUrl,"Configured OAuth2 token endpoint").href,clientId:O(t.clientId,"Configured OAuth2 clientId"),clientSecretRef:O(t.clientSecretRef,"Configured OAuth2 clientSecretRef"),scopes:ie(t.scopes,"Configured OAuth2 scopes"),...t.resource===void 0?{}:{resource:ne(t.resource,"Configured OAuth2 resource")},clientAuthentication:t.clientAuthentication}}o(Gn,"validatedClientAuthentication");function Xn(t){let e=t.credentialRef===void 0?void 0:O(t.credentialRef,"A2A credentialRef"),n=Gn(t.authentication);if(t.credentialRef!==void 0&&t.authentication!==void 0)throw new Error("A2A registration cannot combine credentialRef with structured authentication.");return{agentId:t.agentId,agentCardUrl:t.agentCardUrl,...e!==void 0?{credentialRef:e}:{},...n!==void 0?{authentication:n}:{},effects:t.effects}}o(Xn,"validatedRegistrationInput");function Qn(t,e,n){if(t.authentication)return[[{schemeName:t.authentication.scheme,kind:t.authentication.type,...t.authentication.type==="oauth2-client-credentials"?{scopes:t.authentication.scopes}:{}}]];let r=Se(n);if(!t.credentialRef&&!r)return[[]];let i=J(e.securitySchemes,e.securityRequirements);return Object.values(i.schemes).flatMap(s=>s.kind==="http-bearer"?[[{schemeName:s.name,kind:"http-bearer"}]]:[])}o(Qn,"configuredCapabilityCandidates");function St(t,e){for(let n of t){if(n.schemes.length!==1)continue;let r=n.schemes[0].scheme;if(e.some(i=>i.schemeName===r.name&&i.kind===r.kind))return r}}o(St,"matchingDeclaredScheme");function Zn(t,e){let n=J(t.securitySchemes,t.securityRequirements),r=we(n,e).filter(a=>a.schemes.length<=1);if(r.length===0)return null;let i=St(r,e),s=[];for(let a of t.skills){let c=J(t.securitySchemes,a.securityRequirements),d=we(c,e).filter(u=>u.schemes.length<=1);d.length!==0&&(s.push(a.id),i??=St(d,e))}return t.skills.length>0&&s.length===0?null:{skillIds:s,...i?{declaredScheme:i}:{}}}o(Zn,"evaluateSecurityCapabilities");function Yn(t,e,n){if(t.credentialRef!==void 0&&t.authentication!==void 0)throw new Error("A2A registration cannot combine credentialRef with structured authentication.");if(n!==void 0&&!Se(n))throw new Error("A2A options.authorization must be a valid Bearer authorization.");let r=Se(n),i=t.credentialRef!==void 0||t.authentication!==void 0||r,s;for(let h of Qn(t,e,n)){let w=Zn(e,h);if(w&&(!i||w.declaredScheme)){s=w;break}}if(!s)throw new Error(i?"Configured A2A authentication cannot fully satisfy the Agent Card and any advertised Skill security requirements.":"Agent Card or at least one advertised Skill requires authentication, but no compatible A2A authentication is configured.");if(!i)return{skillIds:s.skillIds};let a=s.declaredScheme,c=t.authentication;if(!c&&!t.credentialRef&&r)return{skillIds:s.skillIds};if(!c)return{credentialRef:t.credentialRef,authentication:{type:"http-bearer",scheme:a.name},skillIds:s.skillIds};if(c.type==="http-bearer")return{credentialRef:c.credentialRef,authentication:{type:"http-bearer",scheme:c.scheme},skillIds:s.skillIds};if(a.kind!=="oauth2-client-credentials")throw new Error("Configured OAuth2 authentication does not match the selected Agent Card scheme.");let d=a,u=F(c.issuer,"Configured OAuth2 issuer"),f=N(c.tokenUrl,"Configured OAuth2 token endpoint").href,l=c.resource===void 0?void 0:ne(c.resource,"Configured OAuth2 resource");if(new URL(d.tokenUrl).href!==f)throw new Error("Configured OAuth2 tokenUrl does not match the selected Agent Card security scheme.");let p=c.scopes.find(h=>!d.scopes.includes(h));if(p)throw new Error(`Configured OAuth2 scope is not declared by the Agent Card: ${p}`);return{credentialRef:c.clientSecretRef,authentication:{type:"oauth2-client-credentials",scheme:c.scheme,issuer:u,tokenUrl:f,clientId:c.clientId,scopes:c.scopes,...l?{resource:l}:{},clientAuthentication:c.clientAuthentication},skillIds:s.skillIds}}o(Yn,"planClientAuthentication");function $e(t,e){try{return JSON.parse(t)}catch{throw new Error(`${e} returned invalid JSON.`)}}o($e,"parseJson");function Et(t){let e=t.maxTaskResponseBytes??t.networkPolicy.maxResponseBytes;if(!Number.isSafeInteger(e)||e<=0)throw new Error("A2A maxTaskResponseBytes must be a positive safe integer.");return e}o(Et,"taskResponseBytes");function er(t){return{...t.networkPolicy,maxResponseBytes:Et(t)}}o(er,"taskNetworkPolicy");async function bt(t,e){let n=Xn(t),r=await G(new URL(n.agentCardUrl),{headers:{accept:"application/json"}},e.networkPolicy,e.fetch);if(!r.response.ok)throw new Error(`Agent Card request failed with HTTP ${r.response.status}.`);if(!de(r.response.headers.get("content-type")))throw new Error("Agent Card response is not JSON.");let i=lt($e(X(r.body),"Agent Card")),s=i.capabilities.extensions?.filter(f=>f.required)??[];if(s.length>0)throw new Error(`Agent Card required A2A extension(s) are unsupported: ${s.map(f=>f.uri).join(", ")}`);let a=Vn(i,r.url),c=Yn(n,i,e.authorization),d=Ae({agentCardUrl:r.url.href,interfaceUrl:a.url,protocolBinding:a.protocolBinding,protocolVersion:a.protocolVersion,tenant:a.tenant??"",authentication:c.authentication??null}),u=wt(Ae({card:i,endpointIdentity:d,credentialRef:c.credentialRef??null,effects:n.effects}));return{agentCard:i,registration:{agentId:n.agentId,displayName:i.name,description:i.description,enabled:!0,executorId:Pe,protocol:"a2a",configurationRevision:u,endpointIdentityHash:wt(d),...c.credentialRef?{credentialRef:c.credentialRef}:{},executorConfig:{agentCardUrl:r.url.href,interfaceUrl:a.url,...a.tenant?{tenant:a.tenant}:{},...c.authentication?{authentication:c.authentication}:{}},skills:c.skillIds,inputModalities:i.defaultInputModes,outputModalities:i.defaultOutputModes,capabilities:{streaming:i.capabilities.streaming?"supported":"unsupported",durableTasks:"supported",inputRequired:"supported",cancellation:"supported",artifacts:"supported"},effects:{remote:n.effects.remote,workspace:"proposal"},health:{status:"healthy",checkedAt:new Date().toISOString()}}}}o(bt,"discoverA2ARegistration");function le(t){return t.metadata??{}}o(le,"metadata");function Ne(t){if(t===null||typeof t=="string"||typeof t=="boolean"||typeof t=="number"&&Number.isFinite(t))return t;if(Array.isArray(t))return t.map(Ne);if(g(t)){let e={};for(let[n,r]of Object.entries(t))e[n]=Ne(r);return e}throw new Error("A2A response metadata must be JSON-safe.")}o(Ne,"toAgentJsonValue");function Rt(t){let e=le(t).directMessage;return e===void 0?void 0:D(e)}o(Rt,"directMessage");function tr(t){return{TASK_STATE_UNSPECIFIED:"unknown",TASK_STATE_SUBMITTED:"submitted",TASK_STATE_WORKING:"working",TASK_STATE_COMPLETED:"completed",TASK_STATE_FAILED:"failed",TASK_STATE_CANCELED:"canceled",TASK_STATE_INPUT_REQUIRED:"input-required",TASK_STATE_REJECTED:"rejected",TASK_STATE_AUTH_REQUIRED:"auth-required"}[t]??"unknown"}o(tr,"taskState");function De(t){return t.flatMap(e=>e.text===void 0?[]:[e.text]).join(`
|
|
2
|
+
import"./chunks/chunk-SMVC3Q3U.js";import"./chunks/chunk-3YOZIFSJ.js";import{j as nt,p as rt}from"./chunks/chunk-HLZWPB32.js";import"./chunks/chunk-GRWUC6H7.js";import"./chunks/chunk-4BY53JTF.js";import"./chunks/chunk-XTWIGVUL.js";import"./chunks/chunk-JJ2YDBSN.js";import"./chunks/chunk-7QBWHCIZ.js";import"./chunks/chunk-PRASABCC.js";import"./chunks/chunk-JTZKC4TV.js";import"./chunks/chunk-GH3KBC2H.js";import"./chunks/chunk-YVG6OKN7.js";import"./chunks/chunk-BHE66SP3.js";import{t as V}from"./chunks/chunk-7XSZVOG7.js";import"./chunks/chunk-QFV6YCIH.js";import{a as o}from"./chunks/chunk-ONUPGMER.js";var te="1.0",Pe="kodax-a2a-v1-jsonrpc";var A=class extends Error{constructor(n,r,i=200,s,a){super(r);this.code=n;this.httpStatus=i;this.data=s;this.headers=a;this.name="A2AError"}code;httpStatus;data;headers;static{o(this,"A2AError")}};function me(t){return t instanceof Error?t.message:String(t)}o(me,"errorMessage");var on=["apiKeySecurityScheme","httpAuthSecurityScheme","oauth2SecurityScheme","openIdConnectSecurityScheme","mtlsSecurityScheme"],an=["authorizationCode","clientCredentials","implicit","password","deviceCode"],cn=/^[\x21\x23-\x5B\x5D-\x7E]+$/u;function re(t,e){if(!cn.test(t))throw new Error(`${e} must be an RFC 6749 scope-token.`)}o(re,"assertOAuthScopeToken");function it(t,e){let n=t.split(" ");for(let r of n)re(r,e);return[...new Set(n)]}o(it,"parseOAuthScopeValue");function ie(t,e){if(!Array.isArray(t))throw new Error(`${e} must be an array of strings.`);let n=t.map((r,i)=>{if(typeof r!="string")throw new Error(`${e}[${i}] must be a string.`);return re(r,`${e}[${i}]`),r});if(new Set(n).size!==n.length)throw new Error(`${e} must not contain duplicates.`);return n}o(ie,"parseOAuthScopeList");function B(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}o(B,"isRecord");function O(t,e){if(typeof t!="string"||t.trim().length===0)throw new Error(`${e} must be a non-empty string.`);return t}o(O,"requireNonEmptyString");function dn(t,e){if(t!==void 0)return O(t,e)}o(dn,"optionalString");function st(t,e){return O(t,e).trim()}o(st,"trimmedUri");function un(t){return/^[A-Za-z][A-Za-z0-9+.-]*:\/\/([^/?#]*)/u.exec(t)?.[1]?.includes("@")===!0}o(un,"hasAuthorityUserinfo");function ye(t){let e=t.toLowerCase().replace(/^\[|\]$/gu,"");return e==="localhost"||e==="127.0.0.1"||e==="::1"}o(ye,"isExactOAuthLoopbackHostname");function ot(t,e){let n=st(t,e);if(!/^https?:\/\/([^/?#]*)/iu.exec(n)?.[1])throw new Error(`${e} must be an absolute HTTP(S) URL.`);let i;try{i=new URL(n)}catch{throw new Error(`${e} must be an absolute HTTP(S) URL.`)}if(un(n)||i.username||i.password||n.includes("#"))throw new Error(`${e} must not contain userinfo or a fragment.`);if(i.protocol==="http:"&&!ye(i.hostname))throw new Error(`${e} must use HTTPS or exact loopback HTTP.`);return{raw:n,url:i}}o(ot,"secureOAuthHttpUrl");function F(t,e){let n=ot(t,e);if(n.raw.includes("?"))throw new Error(`${e} must not contain a query or fragment.`);return n.raw}o(F,"parseOAuthIssuerIdentifier");function N(t,e){return ot(t,e).url}o(N,"parseOAuthEndpointUrl");function ne(t,e){let n=st(t,e);if(!/^[A-Za-z][A-Za-z0-9+.-]*:/u.test(n))throw new Error(`${e} must be an absolute URI.`);try{new URL(n)}catch{throw new Error(`${e} must be an absolute URI.`)}if(n.includes("#"))throw new Error(`${e} must not contain a fragment.`);return n}o(ne,"parseOAuthResourceIdentifier");function at(t,e){return N(t,e).href}o(at,"absoluteHttpUrl");function ln(t,e){if(!B(t))throw new Error(`${e} must be a scope-description object.`);return Object.entries(t).map(([n,r])=>{if(n.trim().length===0||typeof r!="string")throw new Error(`${e} must map non-empty scope names to descriptions.`);return re(n,`${e}.${n}`),n})}o(ln,"parseScopes");function An(t,e){if(!B(e))throw new Error(`securitySchemes.${t}.httpAuthSecurityScheme must be an object.`);let n=O(e.scheme,`securitySchemes.${t}.httpAuthSecurityScheme.scheme`),r=dn(e.bearerFormat,`securitySchemes.${t}.httpAuthSecurityScheme.bearerFormat`);return n.toLowerCase()!=="bearer"?{name:t,kind:"unsupported",protocol:`http:${n.toLowerCase()}`}:{name:t,kind:"http-bearer",...r?{bearerFormat:r}:{}}}o(An,"parseHttpScheme");function pn(t,e){let n=e.flows;if(!B(n))throw new Error(`securitySchemes.${t}.oauth2SecurityScheme.flows must be an object.`);let r=an.filter(c=>n[c]!==void 0);if(r.length!==1)throw new Error(`securitySchemes.${t}.oauth2SecurityScheme.flows must contain exactly one OAuth flow.`);let i=r[0],s=n[i];if(!B(s))throw new Error(`securitySchemes.${t}.oauth2SecurityScheme.flows.${i} must be an object.`);let a=ln(s.scopes,`securitySchemes.${t}.oauth2SecurityScheme.flows.${i}.scopes`);if(i==="clientCredentials"){let c=at(s.tokenUrl,`securitySchemes.${t}.oauth2SecurityScheme.flows.clientCredentials.tokenUrl`);return{name:t,kind:"oauth2-client-credentials",tokenUrl:c,scopes:a}}return{name:t,kind:"unsupported",protocol:`oauth2:${i}`,oauthScopes:a}}o(pn,"parseOAuthFlow");function fn(t,e,n){if(!B(n))throw new Error(`securitySchemes.${t}.${e} must be an object.`);if(e==="apiKeySecurityScheme"){let r=O(n.location,`securitySchemes.${t}.${e}.location`);if(!["query","header","cookie"].includes(r))throw new Error(`securitySchemes.${t}.${e}.location must be query, header, or cookie.`);return O(n.name,`securitySchemes.${t}.${e}.name`),{name:t,kind:"unsupported",protocol:"api-key"}}return e==="openIdConnectSecurityScheme"?(at(n.openIdConnectUrl,`securitySchemes.${t}.${e}.openIdConnectUrl`),{name:t,kind:"unsupported",protocol:"openid-connect",acceptsOAuthScopes:!0}):{name:t,kind:"unsupported",protocol:"mutual-tls"}}o(fn,"parseUnsupportedScheme");function hn(t,e){if(!B(e))throw new Error(`securitySchemes.${t} must be an object.`);let n=on.filter(i=>e[i]!==void 0);if(n.length!==1)throw new Error(`securitySchemes.${t} must contain exactly one security scheme.`);let r=n[0];if(r==="httpAuthSecurityScheme")return An(t,e[r]);if(r==="oauth2SecurityScheme"){let i=e[r];if(!B(i))throw new Error(`securitySchemes.${t}.${r} must be an object.`);return pn(t,i)}return fn(t,r,e[r])}o(hn,"parseScheme");function gn(t){if(t===void 0)return{};if(!B(t))throw new Error("securitySchemes must be an object.");return Object.fromEntries(Object.entries(t).map(([e,n])=>{if(e.trim().length===0)throw new Error("securitySchemes names must not be empty.");return[e,hn(e,n)]}))}o(gn,"parseSchemes");function mn(t,e){if(!B(t))throw new Error(`${e} must be a StringList object.`);if(t.list===void 0)return[];if(!Array.isArray(t.list)||!t.list.every(n=>typeof n=="string"&&n.trim().length>0))throw new Error(`${e}.list must be an array of non-empty strings.`);if(new Set(t.list).size!==t.list.length)throw new Error(`${e}.list must not contain duplicate scopes.`);for(let n of t.list)re(n,`${e}.list`);return t.list}o(mn,"parseScopeList");function yn(t,e){if(t.kind==="oauth2-client-credentials"||t.kind==="unsupported"&&t.oauthScopes!==void 0){let n=t.kind==="oauth2-client-credentials"?t.scopes:t.oauthScopes??[];for(let r of e)if(!n.includes(r))throw new Error(`scope "${r}" is not declared by security scheme "${t.name}".`);return}if(e.length>0&&!(t.kind==="unsupported"&&t.acceptsOAuthScopes))throw new Error(`security scheme "${t.name}" does not accept OAuth scopes.`)}o(yn,"validateRequiredScopes");function wn(t,e,n){if(!B(t))throw new Error(`securityRequirements[${e}] must be an object.`);let r=t.schemes;if(r!==void 0&&!B(r))throw new Error(`securityRequirements[${e}].schemes must be an object.`);return{schemes:Object.entries(r??{}).map(([a,c])=>{if(!Object.hasOwn(n,a))throw new Error(`securityRequirements[${e}] references unknown security scheme "${a}".`);let d=n[a],u=mn(c,`securityRequirements[${e}].schemes.${a}`);return yn(d,u),{scheme:d,scopes:u}})}}o(wn,"parseRequirement");function J(t,e){let n=gn(t);if(e===void 0)return{schemes:n,requirements:[]};if(!Array.isArray(e))throw new Error("securityRequirements must be an array.");return{schemes:n,requirements:e.map((r,i)=>wn(r,i,n))}}o(J,"parseA2ASecurity");function kn(t,e){let{scheme:n,scopes:r}=e;return n.kind!=="unsupported"&&t.schemeName===n.name&&t.kind===n.kind&&r.every(i=>t.scopes?.includes(i)===!0)}o(kn,"capabilityMatches");function Di(t,e){return we(t,e)[0]??null}o(Di,"selectA2ASecurityRequirement");function we(t,e){return(t.requirements.length===0?[{schemes:[]}]:t.requirements).filter(r=>r.schemes.every(i=>e.some(s=>kn(s,i))))}o(we,"satisfiableA2ASecurityRequirements");var Sn=new Set(["TASK_STATE_UNSPECIFIED","TASK_STATE_SUBMITTED","TASK_STATE_WORKING","TASK_STATE_COMPLETED","TASK_STATE_FAILED","TASK_STATE_CANCELED","TASK_STATE_INPUT_REQUIRED","TASK_STATE_REJECTED","TASK_STATE_AUTH_REQUIRED"]);function g(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}o(g,"isRecord");function ct(t){if(t===null)return;let e=t.split(";",1)[0]?.trim().toLowerCase();return e&&!/\s/u.test(e)?e:void 0}o(ct,"mediaTypeEssence");function de(t){let e=ct(t);return e==="application/json"||/^application\/[!#$%&'*+\-.^_`|~0-9a-z]+\+json$/u.test(e??"")}o(de,"isJsonMediaType");function dt(t){return ct(t)==="text/event-stream"}o(dt,"isEventStreamMediaType");function U(t,e,n){let r=t[e];if(typeof r!="string"||r.trim().length===0)throw new A(-32602,`${n}.${e} must be a non-empty string.`);return r}o(U,"requiredString");function I(t,e){let n=t[e];return typeof n=="string"&&n.length>0?n:void 0}o(I,"optionalString");function se(t,e){if(!Array.isArray(t)||!t.every(n=>typeof n=="string"))throw new A(-32602,`${e} must be a string array.`);return t}o(se,"stringArray");function Rn(t){if(!g(t))throw new A(-32602,"Agent Card interface is invalid.");return{url:U(t,"url","interface"),protocolBinding:U(t,"protocolBinding","interface"),protocolVersion:U(t,"protocolVersion","interface"),...I(t,"tenant")?{tenant:I(t,"tenant")}:{}}}o(Rn,"parseInterface");function ut(t,e,n){try{J(t,e)}catch(r){let i=r instanceof Error?r.message:String(r);throw new A(-32602,`${n} is invalid: ${i}`)}}o(ut,"validateSecurity");function Tn(t,e){if(!g(t))throw new A(-32602,"Agent Card skill is invalid.");return t.securityRequirements!==void 0&&ut(e,t.securityRequirements,"skill.securityRequirements"),{id:U(t,"id","skill"),name:U(t,"name","skill"),description:U(t,"description","skill"),tags:se(t.tags,"skill.tags"),...Array.isArray(t.examples)?{examples:se(t.examples,"skill.examples")}:{},...Array.isArray(t.inputModes)?{inputModes:se(t.inputModes,"skill.inputModes")}:{},...Array.isArray(t.outputModes)?{outputModes:se(t.outputModes,"skill.outputModes")}:{},...Array.isArray(t.securityRequirements)?{securityRequirements:t.securityRequirements.filter(g)}:{}}}o(Tn,"parseSkill");function En(t){if(!g(t))throw new A(-32602,"Agent Card extension is invalid.");let e=U(t,"uri","extension");try{new URL(e)}catch{throw new A(-32602,"Agent Card extension.uri must be an absolute URI.")}if(t.description!==void 0&&typeof t.description!="string")throw new A(-32602,"Agent Card extension.description must be a string.");if(t.required!==void 0&&typeof t.required!="boolean")throw new A(-32602,"Agent Card extension.required must be a boolean.");if(t.params!==void 0&&!g(t.params))throw new A(-32602,"Agent Card extension.params must be an object.");return{uri:e,...typeof t.description=="string"?{description:t.description}:{},...typeof t.required=="boolean"?{required:t.required}:{},...g(t.params)?{params:t.params}:{}}}o(En,"parseExtension");function lt(t){if(!g(t))throw new A(-32602,"Agent Card must be an object.");let e=t.supportedInterfaces,n=t.skills;if(!Array.isArray(e)||e.length===0)throw new A(-32602,"Agent Card must declare supportedInterfaces.");if(!Array.isArray(n))throw new A(-32602,"Agent Card must declare skills.");if(!g(t.capabilities))throw new A(-32602,"Agent Card capabilities are invalid.");if(t.capabilities.extensions!==void 0&&!Array.isArray(t.capabilities.extensions))throw new A(-32602,"Agent Card capabilities.extensions must be an array.");return ut(t.securitySchemes,t.securityRequirements,"Agent Card security declaration"),{name:U(t,"name","Agent Card"),description:U(t,"description","Agent Card"),supportedInterfaces:e.map(Rn),version:U(t,"version","Agent Card"),capabilities:{...typeof t.capabilities.streaming=="boolean"?{streaming:t.capabilities.streaming}:{},...typeof t.capabilities.pushNotifications=="boolean"?{pushNotifications:t.capabilities.pushNotifications}:{},...typeof t.capabilities.extendedAgentCard=="boolean"?{extendedAgentCard:t.capabilities.extendedAgentCard}:{},...Array.isArray(t.capabilities.extensions)?{extensions:t.capabilities.extensions.map(En)}:{}},...g(t.securitySchemes)?{securitySchemes:t.securitySchemes}:{},...Array.isArray(t.securityRequirements)?{securityRequirements:t.securityRequirements.filter(g)}:{},defaultInputModes:se(t.defaultInputModes,"Agent Card defaultInputModes"),defaultOutputModes:se(t.defaultOutputModes,"Agent Card defaultOutputModes"),skills:n.map(r=>Tn(r,t.securitySchemes))}}o(lt,"parseA2AAgentCard");function At(t){if(!g(t))throw new A(-32602,"Message Part must be an object.");let e=["text","raw","url","data"].filter(r=>t[r]!==void 0);if(e.length!==1)throw new A(-32602,"Message Part must contain exactly one content field.");let n=e[0];if(n!=="data"&&typeof t[n]!="string")throw new A(-32602,`Message Part ${n} content must be a string.`);return{...typeof t.text=="string"?{text:t.text}:{},...typeof t.raw=="string"?{raw:t.raw}:{},...typeof t.url=="string"?{url:t.url}:{},...t.data!==void 0?{data:t.data}:{},...g(t.metadata)?{metadata:t.metadata}:{},...I(t,"filename")?{filename:I(t,"filename")}:{},...I(t,"mediaType")?{mediaType:I(t,"mediaType")}:{}}}o(At,"parseA2APart");function D(t){if(!g(t))throw new A(-32602,"Message must be an object.");if(t.role!=="ROLE_USER"&&t.role!=="ROLE_AGENT")throw new A(-32602,"Message role is invalid.");if(!Array.isArray(t.parts)||t.parts.length===0)throw new A(-32602,"Message parts must not be empty.");return{messageId:U(t,"messageId","Message"),role:t.role,parts:t.parts.map(At),...I(t,"contextId")?{contextId:I(t,"contextId")}:{},...I(t,"taskId")?{taskId:I(t,"taskId")}:{},...g(t.metadata)?{metadata:t.metadata}:{}}}o(D,"parseA2AMessage");function bn(t){if(!g(t)||!Array.isArray(t.parts)||t.parts.length===0)throw new A(-32603,"A2A artifact is invalid.");return{artifactId:U(t,"artifactId","Artifact"),parts:t.parts.map(At),...I(t,"name")?{name:I(t,"name")}:{},...I(t,"description")?{description:I(t,"description")}:{},...g(t.metadata)?{metadata:t.metadata}:{}}}o(bn,"parseArtifact");function H(t){if(!g(t)||!g(t.status))throw new A(-32603,"A2A task is invalid.");let e=t.status.state;if(typeof e!="string")throw new A(-32603,"A2A task state is invalid.");let n=Sn.has(e)?e:"TASK_STATE_UNSPECIFIED";return{id:U(t,"id","Task"),contextId:I(t,"contextId")??"",status:{state:n,...t.status.message!==void 0?{message:D(t.status.message)}:{},...I(t.status,"timestamp")?{timestamp:I(t.status,"timestamp")}:{}},...Array.isArray(t.artifacts)?{artifacts:t.artifacts.map(bn)}:{},...Array.isArray(t.history)?{history:t.history.map(D)}:{},...g(t.metadata)?{metadata:t.metadata}:{}}}o(H,"parseA2ATask");function pt(t){if(!g(t)||t.jsonrpc!=="2.0")throw new A(-32600,"Invalid JSON-RPC request.");if(typeof t.id!="string"&&typeof t.id!="number")throw new A(-32600,"JSON-RPC request id is required.");return{jsonrpc:"2.0",id:t.id,method:U(t,"method","JSON-RPC request"),...g(t.params)?{params:t.params}:{}}}o(pt,"parseJsonRpcRequest");import{lookup as xn}from"node:dns/promises";import{request as In}from"node:http";import{request as Cn}from"node:https";import{BlockList as vn,isIP as ft}from"node:net";import{Readable as Pn}from"node:stream";var ke=new vn;ke.addSubnet("127.0.0.0",8,"ipv4");ke.addAddress("::1","ipv6");function Oe(t){let e=ft(t);return e===4?ke.check(t,"ipv4"):e===6&&ke.check(t,"ipv6")}o(Oe,"isLoopbackAddress");function On(t){let e=t.toLowerCase();return e==="localhost"||e==="127.0.0.1"||e==="::1"}o(On,"isExactLoopbackHostname");function _e(t){let e=t.split(".").map(Number),[n,r,i,s]=e;return e.length!==4||n===void 0||r===void 0||i===void 0||s===void 0?!0:n===0||n===10||n===127||n===100&&r>=64&&r<=127||n===169&&r===254||n===172&&r>=16&&r<=31||n===192&&r===168||n===192&&r===0&&i===0&&s!==9&&s!==10||n===192&&r===0&&i===2||n===198&&(r===18||r===19)||n===198&&r===51&&i===100||n===203&&r===0&&i===113||n>=224}o(_e,"isPrivateIpv4");function _n(t){if(Oe(t))return!0;let e=t.toLowerCase(),n=/^::ffff:(\d+\.\d+\.\d+\.\d+)$/.exec(e)?.[1];if(n)return _e(n);let r=/^::ffff:([0-9a-f]{1,4}):([0-9a-f]{1,4})$/.exec(e);if(r?.[1]&&r[2]){let i=Number.parseInt(r[1],16),s=Number.parseInt(r[2],16);return _e(`${i>>8}.${i&255}.${s>>8}.${s&255}`)}return e==="::"||e==="::1"||e.startsWith("fc")||e.startsWith("fd")||e.startsWith("fe8")||e.startsWith("fe9")||e.startsWith("fea")||e.startsWith("feb")||e.startsWith("ff")}o(_n,"isPrivateIpv6");function Un(t){let e=ft(t);return e===4?_e(t):e===6?_n(t):!0}o(Un,"isPrivateAddress");async function ht(t,e){if(t.protocol!=="https:"&&t.protocol!=="http:")throw new A(-32602,"A2A URL must use HTTP or HTTPS.");if(!e.allowedOrigins.includes(t.origin))throw new A(-32602,`A2A origin is not allowed: ${t.origin}`);if(t.username||t.password)throw new A(-32602,"A2A URL must not include credentials.");let n=t.hostname.startsWith("[")&&t.hostname.endsWith("]")?t.hostname.slice(1,-1):t.hostname,r=await xn(n,{all:!0,verbatim:!0});if(r.length===0)throw new A(-32602,"A2A hostname did not resolve.");if(n.toLowerCase()==="localhost"&&!r.every(a=>Oe(a.address)))throw new A(-32602,"A2A localhost target must resolve only to loopback addresses.");let i=On(n)&&r.every(a=>Oe(a.address));if(t.protocol==="http:"&&!i&&e.allowInsecureHttp!==!0)throw new A(-32602,"Non-loopback A2A targets must use HTTPS unless plaintext HTTP is explicitly allowed.");if(!e.allowPrivateAddresses&&r.some(a=>Un(a.address)))throw new A(-32602,"A2A private network targets are not allowed.");let s=r[0];if(s===void 0||s.family!==4&&s.family!==6)throw new A(-32602,"A2A hostname returned an unsupported address.");return{address:s.address,family:s.family}}o(ht,"validateA2AUrl");async function Mn(t,e){await ht(t,e)}o(Mn,"assertSafeA2AUrl");function Ln(t){if(t==null||typeof t=="string")return t??void 0;if(t instanceof URLSearchParams)return t.toString();if(t instanceof Uint8Array)return t;if(t instanceof ArrayBuffer)return new Uint8Array(t);if(ArrayBuffer.isView(t))return new Uint8Array(t.buffer,t.byteOffset,t.byteLength);throw new A(-32602,"A2A request body type is not supported by the safe transport.")}o(Ln,"encodeRequestBody");function qn(t){return((e,n,r)=>{if(typeof n=="object"&&n.all){r(null,[t]);return}r(null,t.address,t.family)})}o(qn,"pinnedLookup");function $n(t,e,n){return new Promise((r,i)=>{let s=new Headers(e.headers);s.set("accept-encoding","identity");let a=(t.protocol==="https:"?Cn:In)(t,{method:e.method,headers:Object.fromEntries(s),lookup:qn(n),signal:e.signal??void 0},c=>{let d=new Headers;for(let p=0;p<c.rawHeaders.length;p+=2){let h=c.rawHeaders[p],w=c.rawHeaders[p+1];h!==void 0&&w!==void 0&&d.append(h,w)}let u=c.statusCode??500,l=e.method!=="HEAD"&&u!==204&&u!==205&&u!==304?Pn.toWeb(c):null;r(new Response(l,{status:u,statusText:c.statusMessage,headers:d}))});a.once("error",i),a.end(Ln(e.body))})}o($n,"requestValidatedAddress");async function Ue(t,e,n,r){let i=await ht(t,n);return r!==void 0?r(t,e):$n(t,e,i)}o(Ue,"openSafeA2AResponse");async function Nn(t,e){let n=t.headers.get("content-length");if(n&&Number(n)>e)throw new A(-32603,"A2A response is too large.");if(!t.body)return new Uint8Array;let r=t.body.getReader(),i=[],s=0;for(;;){let d=await r.read();if(d.done)break;if(s+=d.value.byteLength,s>e)throw await r.cancel(),new A(-32603,"A2A response is too large.");i.push(d.value)}let a=new Uint8Array(s),c=0;for(let d of i)a.set(d,c),c+=d.byteLength;return a}o(Nn,"boundedBody");function Dn(t,e){if(!t)return{signal:e,cleanup:o(()=>{},"cleanup")};let n=new AbortController,r=o(()=>n.abort(t.reason),"abortFromCaller"),i=o(()=>n.abort(e.reason),"abortFromDeadline");return t.aborted?r():t.addEventListener("abort",r,{once:!0}),e.aborted?i():e.addEventListener("abort",i,{once:!0}),{signal:n.signal,cleanup:o(()=>{t.removeEventListener("abort",r),e.removeEventListener("abort",i)},"cleanup")}}o(Dn,"combineAbortSignals");async function G(t,e,n,r){let i=t,s=new Headers(e.headers).get("authorization");for(let a=0;a<=n.maxRedirects;a+=1){let c=new AbortController,d=setTimeout(()=>c.abort(new Error("A2A request timed out.")),n.requestTimeoutMs),u=Dn(e.signal,c.signal),f=new Headers(e.headers);s===null?f.delete("authorization"):f.set("authorization",s);try{let l=await Ue(i,{...e,headers:f,redirect:"manual",signal:u.signal},n,r);if(l.status<300||l.status>=400)return{response:l,body:await Nn(l,n.maxResponseBytes),url:i};let p=l.headers.get("location");if(!p||a===n.maxRedirects)throw new A(-32603,"A2A redirect limit exceeded.");let h=new URL(p,i);await l.body?.cancel(),h.origin!==i.origin&&(s=null),i=h}finally{clearTimeout(d),u.cleanup()}}throw new A(-32603,"A2A redirect limit exceeded.")}o(G,"safeA2AFetch");function X(t){return new TextDecoder("utf-8",{fatal:!0}).decode(t)}o(X,"decodeUtf8");import{createHash as Fn,randomUUID as Me}from"node:crypto";import*as K from"oauth4webapi";var Kn=6e4,jn=1e3,Bn=.1;function Hn(t,e){return new Response(e.byteLength===0?null:X(e),{status:t.status,statusText:t.statusText,headers:t.headers})}o(Hn,"oauthResponse");function zn(t,e){if(e===void 0||e<=0)return t;let n=e*1e3,r=Math.min(Kn,Math.max(jn,n*Bn));return t+Math.max(0,n-r)}o(zn,"cacheExpiry");function gt(t){let e=O(t.clientId,"OAuth 2.0 clientId");if(t.clientAuthenticationMethod!=="basic"&&t.clientAuthenticationMethod!=="post")throw new Error("OAuth 2.0 clientAuthenticationMethod must be basic or post.");let n=t.clientAuthenticationMethod,r=t.scopes===void 0?void 0:ie(t.scopes,"OAuth 2.0 scopes"),i=F(t.issuer,"OAuth 2.0 issuer"),s=N(t.tokenUrl,"OAuth 2.0 token endpoint"),a=t.resource===void 0?void 0:ne(t.resource,"OAuth 2.0 resource"),c={issuer:i,token_endpoint:s.href},d={client_id:e},u={...t.networkPolicy,maxRedirects:0},f=t.now??Date.now,l,p,h=0;async function w(k){let y=n==="post"?K.ClientSecretPost(k):K.ClientSecretBasic(k),T=new URLSearchParams;r&&r.length>0&&T.set("scope",r.join(" ")),a!==void 0&&T.set("resource",a);let m={[K.customFetch]:async(R,_)=>{if(new URL(R).href!==s.href)throw new Error("OAuth 2.0 token request targeted an unexpected endpoint.");let j=await G(s,{method:_.method,headers:_.headers,body:_.body,redirect:"manual",..._.signal!==void 0?{signal:_.signal}:{}},u,t.fetch);return Hn(j.response,j.body)}};s.protocol==="http:"&&(m[K.allowInsecureRequests]=!0);let S;try{let R=await K.clientCredentialsGrantRequest(c,d,y,T,m);S=await K.processClientCredentialsResponse(c,d,R)}catch{throw new Error("OAuth 2.0 client credentials token request failed.")}if(S.token_type!=="bearer")throw new Error("OAuth 2.0 token endpoint did not return a Bearer access token.");let L=f();return{value:`Bearer ${S.access_token}`,expiresAt:zn(L,S.expires_in)}}return o(w,"requestAuthorization"),{async getAuthorization(k){if(k.length===0)throw new Error("OAuth 2.0 client secret is required.");let y=f();if(l!==void 0&&l.expiresAt>y)return l.value;if(p!==void 0)return p;let T=h,m;return m=w(k).then(S=>(h===T&&S.expiresAt>f()&&(l=S),S.value)).finally(()=>{p===m&&(p=void 0)}),p=m,m},invalidate(k){if(k!==void 0){l?.value===k&&(l=void 0);return}h+=1,l=void 0,p=void 0}}}o(gt,"createOAuth2ClientCredentialsTokenManager");var mt=4,yt=/^[A-Za-z0-9\-._~+/=]$/u;function Se(t){return t!==void 0&&/^Bearer\s+\S+$/iu.test(t)}o(Se,"isBearerAuthorization");function Jn(t,e){let n="",r=0;for(;r<t.length;){let i=t.indexOf(e,r);if(i<0)return n+t.slice(r);let s=i===0?void 0:t[i-1],a=i+e.length,c=a===t.length?void 0:t[a],d=s===void 0||!yt.test(s),u=c===void 0||!yt.test(c);n+=t.slice(r,i),d&&u?(n+="[REDACTED]",r=a):(n+=e,r=a)}return n}o(Jn,"replaceBoundedToken");function Ae(t){return Array.isArray(t)?`[${t.map(Ae).join(",")}]`:g(t)?`{${Object.keys(t).sort().map(e=>`${JSON.stringify(e)}:${Ae(t[e])}`).join(",")}}`:JSON.stringify(t)??"null"}o(Ae,"stableJson");function wt(t){return`sha256:${Fn("sha256").update(t).digest("hex")}`}o(wt,"sha256");var qe=class{static{o(this,"AuthorizationRedactor")}#e=[];#n=new Map;remember(e){if(!e)return;let n=this.#e.indexOf(e);n>=0&&this.#e.splice(n,1),this.#e.unshift(e),this.#e.length>mt&&(this.#e.length=mt)}retain(e){if(!e)return()=>{};this.remember(e),this.#n.set(e,(this.#n.get(e)??0)+1);let n=!1;return()=>{if(n)return;n=!0;let r=(this.#n.get(e)??1)-1;r===0?this.#n.delete(e):this.#n.set(e,r)}}redactText(e){let n=[...new Set([...this.#n.keys(),...this.#e])],r=n.sort((s,a)=>a.length-s.length).reduce((s,a)=>s.split(a).join("[REDACTED]"),e),i=n.flatMap(s=>{let a=/^Bearer\s+(\S+)$/iu.exec(s)?.[1];return a?[a]:[]}).sort((s,a)=>a.length-s.length);return[...new Set(i)].reduce((s,a)=>Jn(s,a),r)}redactContent(e){return typeof e=="string"?this.redactText(e):Array.isArray(e)?e.map(n=>this.redactContent(n)):g(e)?Object.fromEntries(Object.entries(e).map(([n,r])=>[n,this.redactContent(r)])):e}redactPart(e){return{...e,...e.text===void 0?{}:{text:this.redactText(e.text)},...e.raw===void 0?{}:{raw:this.redactText(e.raw)},...e.url===void 0?{}:{url:this.redactText(e.url)},...e.data===void 0?{}:{data:this.redactContent(e.data)},...e.metadata===void 0?{}:{metadata:this.redactContent(e.metadata)},...e.filename===void 0?{}:{filename:this.redactText(e.filename)}}}redactMessage(e){return{...e,parts:e.parts.map(n=>this.redactPart(n)),...e.metadata===void 0?{}:{metadata:this.redactContent(e.metadata)}}}redactArtifact(e){return{...e,...e.name===void 0?{}:{name:this.redactText(e.name)},...e.description===void 0?{}:{description:this.redactText(e.description)},parts:e.parts.map(n=>this.redactPart(n)),...e.metadata===void 0?{}:{metadata:this.redactContent(e.metadata)}}}redactTask(e){return{...e,status:{...e.status,...e.status.message===void 0?{}:{message:this.redactMessage(e.status.message)}},...e.artifacts===void 0?{}:{artifacts:e.artifacts.map(n=>this.redactArtifact(n))},...e.history===void 0?{}:{history:e.history.map(n=>this.redactMessage(n))},...e.metadata===void 0?{}:{metadata:this.redactContent(e.metadata)}}}redactError(e){let n=this.redactText(e instanceof Error?e.message:String(e));return e instanceof A?new A(e.code,n,e.httpStatus,this.redactContent(e.data),e.headers):new Error(n)}};function kt(t,e){let n=new URL(e).origin;if(!t.allowedOrigins.some(i=>new URL(i).origin===n))throw new Error(`A2A endpoint origin is not allowed by network policy: ${n}`);return{...t,allowedOrigins:[n]}}o(kt,"endpointNetworkPolicy");function Wn(t){if(t!==void 0){if(!g(t)||typeof t.scheme!="string")throw new Error("A2A registration authentication is invalid.");if(t.type==="http-bearer")return{type:"http-bearer",scheme:t.scheme};if(t.type!=="oauth2-client-credentials"||typeof t.issuer!="string"||typeof t.tokenUrl!="string"||typeof t.clientId!="string"||!Array.isArray(t.scopes)||!t.scopes.every(e=>typeof e=="string")||!["client-secret-basic","client-secret-post"].includes(String(t.clientAuthentication)))throw new Error("A2A registration OAuth2 authentication is invalid.");return{type:"oauth2-client-credentials",scheme:t.scheme,issuer:t.issuer,tokenUrl:t.tokenUrl,clientId:t.clientId,scopes:t.scopes,...typeof t.resource=="string"?{resource:t.resource}:{},clientAuthentication:t.clientAuthentication}}}o(Wn,"executorAuthentication");function Q(t){let e=t.executorConfig;if(!g(e))throw new Error("A2A registration executorConfig is missing.");if(typeof e.agentCardUrl!="string"||typeof e.interfaceUrl!="string")throw new Error("A2A registration endpoints are invalid.");let n=Wn(e.authentication);return{agentCardUrl:e.agentCardUrl,interfaceUrl:e.interfaceUrl,...typeof e.tenant=="string"?{tenant:e.tenant}:{},...n?{authentication:n}:{}}}o(Q,"executorConfig");function Vn(t,e){let n=t.supportedInterfaces.find(i=>i.protocolBinding.toUpperCase()==="JSONRPC"&&i.protocolVersion==="1.0");if(!n)throw new Error("Agent Card has no supported A2A 1.0 JSONRPC interface.");let r=new URL(n.url);if(r.username||r.password||r.hash)throw new Error("A2A interface URL must not contain credentials or a fragment.");if(r.origin!==e.origin)throw new Error("A2A interface must use the same origin as the trusted Agent Card.");return n}o(Vn,"chooseInterface");function Gn(t){if(t===void 0)return;if(!g(t))throw new Error("A2A authentication must be an object.");let e=O(t.scheme,"A2A authentication.scheme");if(t.type==="http-bearer")return{type:"http-bearer",scheme:e,credentialRef:O(t.credentialRef,"A2A authentication.credentialRef")};if(t.type!=="oauth2-client-credentials")throw new Error("A2A authentication.type must be http-bearer or oauth2-client-credentials.");if(t.clientAuthentication!=="client-secret-basic"&&t.clientAuthentication!=="client-secret-post")throw new Error("A2A authentication.clientAuthentication is invalid.");return{type:"oauth2-client-credentials",scheme:e,issuer:F(t.issuer,"Configured OAuth2 issuer"),tokenUrl:N(t.tokenUrl,"Configured OAuth2 token endpoint").href,clientId:O(t.clientId,"Configured OAuth2 clientId"),clientSecretRef:O(t.clientSecretRef,"Configured OAuth2 clientSecretRef"),scopes:ie(t.scopes,"Configured OAuth2 scopes"),...t.resource===void 0?{}:{resource:ne(t.resource,"Configured OAuth2 resource")},clientAuthentication:t.clientAuthentication}}o(Gn,"validatedClientAuthentication");function Xn(t){let e=t.credentialRef===void 0?void 0:O(t.credentialRef,"A2A credentialRef"),n=Gn(t.authentication);if(t.credentialRef!==void 0&&t.authentication!==void 0)throw new Error("A2A registration cannot combine credentialRef with structured authentication.");return{agentId:t.agentId,agentCardUrl:t.agentCardUrl,...e!==void 0?{credentialRef:e}:{},...n!==void 0?{authentication:n}:{},effects:t.effects}}o(Xn,"validatedRegistrationInput");function Qn(t,e,n){if(t.authentication)return[[{schemeName:t.authentication.scheme,kind:t.authentication.type,...t.authentication.type==="oauth2-client-credentials"?{scopes:t.authentication.scopes}:{}}]];let r=Se(n);if(!t.credentialRef&&!r)return[[]];let i=J(e.securitySchemes,e.securityRequirements);return Object.values(i.schemes).flatMap(s=>s.kind==="http-bearer"?[[{schemeName:s.name,kind:"http-bearer"}]]:[])}o(Qn,"configuredCapabilityCandidates");function St(t,e){for(let n of t){if(n.schemes.length!==1)continue;let r=n.schemes[0].scheme;if(e.some(i=>i.schemeName===r.name&&i.kind===r.kind))return r}}o(St,"matchingDeclaredScheme");function Zn(t,e){let n=J(t.securitySchemes,t.securityRequirements),r=we(n,e).filter(a=>a.schemes.length<=1);if(r.length===0)return null;let i=St(r,e),s=[];for(let a of t.skills){let c=J(t.securitySchemes,a.securityRequirements),d=we(c,e).filter(u=>u.schemes.length<=1);d.length!==0&&(s.push(a.id),i??=St(d,e))}return t.skills.length>0&&s.length===0?null:{skillIds:s,...i?{declaredScheme:i}:{}}}o(Zn,"evaluateSecurityCapabilities");function Yn(t,e,n){if(t.credentialRef!==void 0&&t.authentication!==void 0)throw new Error("A2A registration cannot combine credentialRef with structured authentication.");if(n!==void 0&&!Se(n))throw new Error("A2A options.authorization must be a valid Bearer authorization.");let r=Se(n),i=t.credentialRef!==void 0||t.authentication!==void 0||r,s;for(let h of Qn(t,e,n)){let w=Zn(e,h);if(w&&(!i||w.declaredScheme)){s=w;break}}if(!s)throw new Error(i?"Configured A2A authentication cannot fully satisfy the Agent Card and any advertised Skill security requirements.":"Agent Card or at least one advertised Skill requires authentication, but no compatible A2A authentication is configured.");if(!i)return{skillIds:s.skillIds};let a=s.declaredScheme,c=t.authentication;if(!c&&!t.credentialRef&&r)return{skillIds:s.skillIds};if(!c)return{credentialRef:t.credentialRef,authentication:{type:"http-bearer",scheme:a.name},skillIds:s.skillIds};if(c.type==="http-bearer")return{credentialRef:c.credentialRef,authentication:{type:"http-bearer",scheme:c.scheme},skillIds:s.skillIds};if(a.kind!=="oauth2-client-credentials")throw new Error("Configured OAuth2 authentication does not match the selected Agent Card scheme.");let d=a,u=F(c.issuer,"Configured OAuth2 issuer"),f=N(c.tokenUrl,"Configured OAuth2 token endpoint").href,l=c.resource===void 0?void 0:ne(c.resource,"Configured OAuth2 resource");if(new URL(d.tokenUrl).href!==f)throw new Error("Configured OAuth2 tokenUrl does not match the selected Agent Card security scheme.");let p=c.scopes.find(h=>!d.scopes.includes(h));if(p)throw new Error(`Configured OAuth2 scope is not declared by the Agent Card: ${p}`);return{credentialRef:c.clientSecretRef,authentication:{type:"oauth2-client-credentials",scheme:c.scheme,issuer:u,tokenUrl:f,clientId:c.clientId,scopes:c.scopes,...l?{resource:l}:{},clientAuthentication:c.clientAuthentication},skillIds:s.skillIds}}o(Yn,"planClientAuthentication");function $e(t,e){try{return JSON.parse(t)}catch{throw new Error(`${e} returned invalid JSON.`)}}o($e,"parseJson");function Et(t){let e=t.maxTaskResponseBytes??t.networkPolicy.maxResponseBytes;if(!Number.isSafeInteger(e)||e<=0)throw new Error("A2A maxTaskResponseBytes must be a positive safe integer.");return e}o(Et,"taskResponseBytes");function er(t){return{...t.networkPolicy,maxResponseBytes:Et(t)}}o(er,"taskNetworkPolicy");async function bt(t,e){let n=Xn(t),r=await G(new URL(n.agentCardUrl),{headers:{accept:"application/json"}},e.networkPolicy,e.fetch);if(!r.response.ok)throw new Error(`Agent Card request failed with HTTP ${r.response.status}.`);if(!de(r.response.headers.get("content-type")))throw new Error("Agent Card response is not JSON.");let i=lt($e(X(r.body),"Agent Card")),s=i.capabilities.extensions?.filter(f=>f.required)??[];if(s.length>0)throw new Error(`Agent Card required A2A extension(s) are unsupported: ${s.map(f=>f.uri).join(", ")}`);let a=Vn(i,r.url),c=Yn(n,i,e.authorization),d=Ae({agentCardUrl:r.url.href,interfaceUrl:a.url,protocolBinding:a.protocolBinding,protocolVersion:a.protocolVersion,tenant:a.tenant??"",authentication:c.authentication??null}),u=wt(Ae({card:i,endpointIdentity:d,credentialRef:c.credentialRef??null,effects:n.effects}));return{agentCard:i,registration:{agentId:n.agentId,displayName:i.name,description:i.description,enabled:!0,executorId:Pe,protocol:"a2a",configurationRevision:u,endpointIdentityHash:wt(d),...c.credentialRef?{credentialRef:c.credentialRef}:{},executorConfig:{agentCardUrl:r.url.href,interfaceUrl:a.url,...a.tenant?{tenant:a.tenant}:{},...c.authentication?{authentication:c.authentication}:{}},skills:c.skillIds,inputModalities:i.defaultInputModes,outputModalities:i.defaultOutputModes,capabilities:{streaming:i.capabilities.streaming?"supported":"unsupported",durableTasks:"supported",inputRequired:"supported",cancellation:"supported",artifacts:"supported"},effects:{remote:n.effects.remote,workspace:"proposal"},health:{status:"healthy",checkedAt:new Date().toISOString()}}}}o(bt,"discoverA2ARegistration");function le(t){return t.metadata??{}}o(le,"metadata");function Ne(t){if(t===null||typeof t=="string"||typeof t=="boolean"||typeof t=="number"&&Number.isFinite(t))return t;if(Array.isArray(t))return t.map(Ne);if(g(t)){let e={};for(let[n,r]of Object.entries(t))e[n]=Ne(r);return e}throw new Error("A2A response metadata must be JSON-safe.")}o(Ne,"toAgentJsonValue");function Rt(t){let e=le(t).directMessage;return e===void 0?void 0:D(e)}o(Rt,"directMessage");function tr(t){return{TASK_STATE_UNSPECIFIED:"unknown",TASK_STATE_SUBMITTED:"submitted",TASK_STATE_WORKING:"working",TASK_STATE_COMPLETED:"completed",TASK_STATE_FAILED:"failed",TASK_STATE_CANCELED:"canceled",TASK_STATE_INPUT_REQUIRED:"input-required",TASK_STATE_REJECTED:"rejected",TASK_STATE_AUTH_REQUIRED:"auth-required"}[t]??"unknown"}o(tr,"taskState");function De(t){return t.flatMap(e=>e.text===void 0?[]:[e.text]).join(`
|
|
3
3
|
`)}o(De,"textFromParts");function xt(t,e){let n=t.mediaType??(t.data!==void 0?"application/json":"application/octet-stream"),r=t.raw!==void 0?`data:${n};base64,${t.raw}`:t.data!==void 0?`data:${n};base64,${Buffer.from(JSON.stringify(t.data),"utf8").toString("base64")}`:void 0,i=t.url??r;if(i)return{name:e,...t.mediaType?{mimeType:t.mediaType}:{},...t.raw!==void 0?{size:Buffer.from(t.raw,"base64").byteLength}:{},uri:i,provenance:"a2a"}}o(xt,"partArtifactReference");function nr(t){let e=t.parts.find(n=>n.url!==void 0||n.raw!==void 0||n.data!==void 0);return e?xt(e,t.name??t.artifactId):void 0}o(nr,"artifactReference");function ue(t){let e=(t.artifacts??[]).flatMap(i=>De(i.parts)),n=t.status.message?De(t.status.message.parts):"",r=[...e,n].filter(Boolean).join(`
|
|
4
4
|
`);return{state:tr(t.status.state),...r?{output:r}:{},...t.status.state==="TASK_STATE_FAILED"?{error:n||"Remote A2A task failed."}:{},...t.artifacts?.length?{artifacts:t.artifacts.flatMap(i=>nr(i)??[])}:{}}}o(ue,"snapshotFromTask");function Le(t){let e=De(t.parts),n=t.parts.flatMap((r,i)=>{if(r.text!==void 0)return[];let s=xt(r,r.filename??`message-part-${i+1}`);return s?[s]:[]});return{state:"completed",...e?{output:e}:{},...n.length>0?{artifacts:n}:{}}}o(Le,"snapshotFromMessage");function Tt(t){return t==="completed"||t==="failed"||t==="canceled"||t==="rejected"}o(Tt,"isTerminal");function rr(t,e,n){let r=t.get(e.artifactId);t.set(e.artifactId,n&&r?{...r,...e,parts:[...r.parts,...e.parts]}:e)}o(rr,"mergeStreamArtifact");var Re=class{constructor(e,n,r,i,s){this.registration=e;this.context=n;this.options=r;this.oauthTokenManager=i;this.releaseOAuthTokenManager=s}registration;context;options;oauthTokenManager;releaseOAuthTokenManager;static{o(this,"A2AClientExecutor")}#e=!1;#n=new Set;#t=new qe;async preflight(){try{return Q(this.registration),{ok:!0}}catch(e){return{ok:!1,reasons:[e instanceof Error?e.message:String(e)]}}}async start(e,n){let r=e.idempotencyKey;if(!r)throw new Error("A2A executor requires an idempotency key.");let i=await this.sendMessage({message:{messageId:r,role:"ROLE_USER",parts:[{text:e.input??e.objective,mediaType:"text/plain"}]},configuration:{returnImmediately:!0}},n);if(g(i.task)){let s=H(i.task);return{idempotencyKey:r,remoteTaskId:s.id,...s.contextId?{metadata:{contextId:s.contextId}}:{}}}if(i.message!==void 0){let s=this.#t.redactMessage(D(i.message));return{idempotencyKey:r,metadata:{directMessage:Ne(s)}}}throw new Error("A2A SendMessage returned neither task nor message.")}async*events(e){let n=Rt(e);if(n){yield await this.authorizeArtifacts(Le(this.#t.redactMessage(n)));return}if(this.registration.capabilities.streaming==="supported")try{yield*this.streamEvents(e);return}catch(r){if(this.#e)return;V({source:"a2a.client",level:"warn",message:"A2A event stream failed; polling fallback started.",detail:r}),yield{progress:{message:"A2A stream unavailable; polling."}}}for(;!this.#e;){let r=await this.get(e);if(yield r,Tt(r.state)||r.state==="input-required"||r.state==="auth-required")return;await new Promise(i=>setTimeout(i,this.options.pollIntervalMs))}}async get(e){let n=Rt(e);if(n)return this.authorizeArtifacts(Le(this.#t.redactMessage(n)));if(!e.remoteTaskId)throw new Error("A2A task reference has no remote task ID.");let r=H(await this.rpc("GetTask",this.taskParams(e)));return this.assertTaskReference(r,e),this.authorizeArtifacts(ue(this.#t.redactTask(r)))}async sendInput(e,n){if(!e.remoteTaskId)throw new Error("Direct A2A responses cannot accept input.");await this.sendMessage({message:{messageId:Me(),taskId:e.remoteTaskId,...typeof le(e).contextId=="string"?{contextId:le(e).contextId}:{},role:"ROLE_USER",parts:[{text:n.content,mediaType:"text/plain"}]},configuration:{returnImmediately:!0}})}async cancel(e){if(!e.remoteTaskId)return this.get(e);let n=H(await this.rpc("CancelTask",this.taskParams(e)));return this.assertTaskReference(n,e),this.authorizeArtifacts(ue(this.#t.redactTask(n)))}async reconcile(e){return this.get(e)}async dispose(){if(!this.#e){this.#e=!0;try{for(let e of this.#n)e.abort(new Error("A2A executor disposed."))}finally{this.releaseOAuthTokenManager?.()}}}async*streamEvents(e){if(!e.remoteTaskId)throw new Error("A2A stream requires a remote task ID.");let n=Q(this.registration),r=new URL(n.interfaceUrl),i=new Headers({accept:"text/event-stream","a2a-version":"1.0","content-type":"application/json"}),s=new AbortController,a=Me();this.#n.add(s);let c,d,u=o(()=>{d!==void 0&&clearTimeout(d),d=void 0},"disarmTimeout"),f=o(l=>{u(),d=setTimeout(()=>s.abort(new Error(l)),this.options.networkPolicy.requestTimeoutMs),d.unref?.()},"armTimeout");try{f("A2A stream connection timed out.");let l=await this.openStreamResponse(r,i,s.signal,{jsonrpc:"2.0",id:a,method:"SubscribeToTask",params:this.taskParams(e)}),p=l.response;if(c=l.releaseAuthorization,u(),!p.ok||!p.body)throw new Error(`A2A stream failed with HTTP ${p.status}.`);if(!dt(p.headers.get("content-type")))throw new Error("A2A stream returned an invalid content type.");let h=p.body.getReader(),w=new TextDecoder,k=new Map,y="",T=0;for(;!this.#e;){f("A2A stream was idle for too long.");let m=await h.read();if(u(),m.done)break;if(T+=m.value.byteLength,T>Et(this.options))throw new Error("A2A stream exceeded the response size limit.");y+=w.decode(m.value,{stream:!0});let S=y.split(/\r?\n\r?\n/);y=S.pop()??"";for(let L of S){let R=L.split(/\r?\n/).filter(j=>j.startsWith("data:")).map(j=>j.slice(5).trimStart()).join(`
|
|
5
5
|
`);if(!R)continue;let _=await this.snapshotFromStreamPayload($e(R,"A2A stream"),a,e,k);if(_&&(yield _,_.state&&(Tt(_.state)||_.state==="input-required"||_.state==="auth-required")))return}}if(!this.#e)throw new Error("A2A event stream ended before the task reached a stable state.")}catch(l){throw this.#t.redactError(l)}finally{u(),c?.(),this.#n.delete(s)}}async snapshotFromStreamPayload(e,n,r,i){if(!g(e))throw new Error("A2A stream frame is invalid.");if(e.jsonrpc!=="2.0"||e.id!==n)throw new Error("A2A stream frame has an invalid JSON-RPC version or response id.");if(e.error!==void 0){let s=g(e.error)?e.error:{},a=typeof s.message=="string"?s.message:"A2A stream error.";throw new A(typeof s.code=="number"?s.code:-32603,this.#t.redactText(a))}if(g(e.result)){if(e.result.task!==void 0){let s=H(e.result.task);this.assertTaskReference(s,r),i.clear();for(let a of s.artifacts??[])i.set(a.artifactId,a);return this.authorizeArtifacts(ue(this.#t.redactTask(s)))}if(e.result.message!==void 0){let s=D(e.result.message);if(s.taskId!==void 0&&s.taskId!==r.remoteTaskId)throw new Error("A2A stream message belongs to a different task.");return this.authorizeArtifacts(Le(this.#t.redactMessage(s)))}if(g(e.result.statusUpdate)&&g(e.result.statusUpdate.status)){this.assertStreamTaskScope(e.result.statusUpdate,r);let s=H({id:r.remoteTaskId,contextId:e.result.statusUpdate.contextId,status:e.result.statusUpdate.status,...i.size>0?{artifacts:[...i.values()]}:{}});return this.authorizeArtifacts(ue(this.#t.redactTask(s)))}if(g(e.result.artifactUpdate)&&e.result.artifactUpdate.artifact!==void 0){this.assertStreamTaskScope(e.result.artifactUpdate,r);let s=H({id:r.remoteTaskId,contextId:e.result.artifactUpdate.contextId,status:{state:"TASK_STATE_WORKING"},artifacts:[e.result.artifactUpdate.artifact]}),a=s.artifacts?.[0];if(!a)throw new Error("A2A artifact update has no artifact.");rr(i,a,e.result.artifactUpdate.append===!0);let c={...s,artifacts:[...i.values()]};return this.authorizeArtifacts(ue(this.#t.redactTask(c)))}}}async authorizeArtifacts(e){for(let n of e.artifacts??[])await this.context.authorizeArtifact(n);return e}assertTaskReference(e,n){if(e.id!==n.remoteTaskId)throw new Error("A2A response belongs to a different task id.");let r=le(n).contextId;if(typeof r=="string"&&e.contextId&&e.contextId!==r)throw new Error("A2A response belongs to a different task context.")}assertStreamTaskScope(e,n){if(typeof e.taskId!="string"||e.taskId!==n.remoteTaskId)throw new Error("A2A stream event belongs to a different task.");let r=le(n).contextId;if(typeof e.contextId!="string"||typeof r=="string"&&e.contextId!==r)throw new Error("A2A stream event belongs to a different task context.")}async openStreamResponse(e,n,r,i){let s=o(a=>{let c=new Headers(n);return a&&c.set("authorization",a),Ue(e,{method:"POST",headers:c,redirect:"manual",signal:r,body:JSON.stringify(i)},this.options.networkPolicy,this.options.fetch)},"open");return this.withAuthorization(async a=>{let c=this.#t.retain(a);try{let d=await s(a);if(d.status===401)throw await d.body?.cancel(),new A(-32600,"A2A authentication was rejected.",401);return{response:d,releaseAuthorization:c}}catch(d){throw c(),d}})}taskParams(e){let n=Q(this.registration);return{id:e.remoteTaskId,...n.tenant?{tenant:n.tenant}:{}}}async sendMessage(e,n){let r=await this.rpc("SendMessage",{...e,...Q(this.registration).tenant?{tenant:Q(this.registration).tenant}:{}},n);if(!g(r))throw new Error("A2A SendMessage result is invalid.");return r}async rpc(e,n,r){if(this.#e)throw new Error("A2A executor is disposed.");return this.withAuthorization(i=>this.rpcWithAuthorization(e,n,i,r))}redactRpcResult(e,n){return e==="GetTask"||e==="CancelTask"?this.#t.redactTask(H(n)):e!=="SendMessage"||!g(n)?n:{...n,...n.task===void 0?{}:{task:this.#t.redactTask(H(n.task))},...n.message===void 0?{}:{message:this.#t.redactMessage(D(n.message))}}}async withAuthorization(e){let n=Q(this.registration).authentication;if(!n){if(this.options.authorization!==void 0&&!Se(this.options.authorization))throw new Error("A2A options.authorization must be a valid Bearer authorization.");let c=this.#t.retain(this.options.authorization);try{return await e(this.options.authorization)}catch(d){throw this.#t.redactError(d)}finally{c()}}let r=this.registration.credentialRef;if(!r)throw new Error("Authenticated A2A registration has no credential reference.");let i=o(c=>this.context.withCredential(r,async d=>{let u,f;try{return u=n.type==="http-bearer"?`Bearer ${d}`:await this.requireOAuthTokenManager().getAuthorization(d),f=this.#t.retain(u),{ok:!0,value:await e(u)}}catch(l){if(c&&n.type==="oauth2-client-credentials"&&l instanceof A&&l.httpStatus===401&&u!==void 0)return{ok:!1,rejectedAuthorization:u};throw this.#t.redactError(l)}finally{f?.()}}),"execute"),s=await i(n.type==="oauth2-client-credentials");if(s.ok)return s.value;this.requireOAuthTokenManager().invalidate(s.rejectedAuthorization);let a=await i(!1);if(!a.ok)throw new Error("A2A OAuth2 retry did not produce a result.");return a.value}requireOAuthTokenManager(){if(!this.oauthTokenManager)throw new Error("A2A OAuth2 token manager is unavailable.");return this.oauthTokenManager}async rpcWithAuthorization(e,n,r,i){let s=Q(this.registration),a=new Headers({accept:"application/json","a2a-version":"1.0","content-type":"application/json"});r&&a.set("authorization",r);let c=Me(),d=await G(new URL(s.interfaceUrl),{method:"POST",headers:a,body:JSON.stringify({jsonrpc:"2.0",id:c,method:e,params:n}),...i?{signal:i}:{}},er(this.options),this.options.fetch);if(d.response.status===401)throw new A(-32600,"A2A authentication was rejected.",401);if(!de(d.response.headers.get("content-type")))throw new Error("A2A JSON-RPC response has an invalid content type.");let u=$e(X(d.body),"A2A endpoint");if(!g(u))throw new Error("A2A JSON-RPC response is invalid.");if(u.jsonrpc!=="2.0"||u.id!==c)throw new Error("A2A JSON-RPC response has an invalid version or response id.");let f=Object.hasOwn(u,"result"),l=Object.hasOwn(u,"error");if(f===l)throw new Error("A2A JSON-RPC response must contain exactly one result or error.");if(l)throw!g(u.error)||typeof u.error.code!="number"||typeof u.error.message!="string"?new Error("A2A JSON-RPC error response is invalid."):new A(u.error.code,this.#t.redactText(u.error.message),d.response.status,this.#t.redactContent(u.error.data));if(!d.response.ok)throw new Error(`A2A request failed with HTTP ${d.response.status}.`);return this.redactRpcResult(e,u.result)}};function It(t){let e=new Map;return{executorId:Pe,protocol:"a2a",async create(n,r){let i=typeof t=="function"?t(n):t,s=Q(n),a=s.authentication,c={...i,networkPolicy:kt(i.networkPolicy,s.interfaceUrl)},d;if(a?.type==="oauth2-client-credentials"){let p=kt(i.networkPolicy,a.tokenUrl),h=Ae({authentication:a,credentialRef:n.credentialRef??"",networkPolicy:p}),w=e.get(n.agentId);if(d=w?.key===h&&w.fetch===i.fetch?w:void 0,!d){let k=gt({issuer:a.issuer,tokenUrl:a.tokenUrl,clientId:a.clientId,scopes:a.scopes,...a.resource?{resource:a.resource}:{},clientAuthenticationMethod:a.clientAuthentication==="client-secret-post"?"post":"basic",networkPolicy:p,...i.fetch?{fetch:i.fetch}:{}});d={key:h,fetch:i.fetch,manager:k,references:0},e.set(n.agentId,d)}}if(!d)return new Re(n,r,c);let u=d;u.references+=1;let f=!1,l=o(()=>{f||(f=!0,u.references-=1,u.references===0&&(u.manager.invalidate(),e.get(n.agentId)===u&&e.delete(n.agentId)))},"releaseOAuthTokenManager");return new Re(n,r,c,u.manager,l)}}}o(It,"createA2AAgentExecutorFactory");import{createHash as ar,randomUUID as he}from"node:crypto";import W from"node:fs";import{createServer as cr}from"node:http";import b from"node:path";import{Readable as Ot}from"node:stream";import{createHash as ir}from"node:crypto";var Z="realm-subject-tenant-v1";function Ct(t){return ir("sha256").update(t).digest("hex")}o(Ct,"sha256");function vt(t){return Ct(`${t.subject}\0${t.tenant??""}`)}o(vt,"legacyA2APrincipalKey");function Te(t){return Ct(JSON.stringify([t.securityRealm,t.subject,t.tenant??null]))}o(Te,"realmA2APrincipalKey");import E from"node:fs";import pe from"node:path";import{createHash as sr}from"node:crypto";function Y(t){return structuredClone(t)}o(Y,"clone");function or(t){if(!g(t))throw new Error("A2A task store record must be an object.");for(let r of["taskId","contextId","principalKey","runtimeIdentity","sessionId","createdAt","updatedAt"])if(typeof t[r]!="string")throw new Error(`A2A task store record has invalid ${r}.`);if(!g(t.messageDigests)||!Object.values(t.messageDigests).every(r=>typeof r=="string"))throw new Error("A2A task store message digests are invalid.");if(!Array.isArray(t.runIds)||!t.runIds.every(r=>typeof r=="string"))throw new Error("A2A task store run IDs are invalid.");if(!Array.isArray(t.history))throw new Error("A2A task store history is invalid.");if(t.principalKeyScheme!==void 0&&t.principalKeyScheme!==Z)throw new Error("A2A task store principal key scheme is unsupported.");if(!Number.isSafeInteger(t.eventSeq))throw new Error("A2A task store event cursors are invalid.");let e=Pt(t.runtimeSessionCursor);if(t.runtimeSessionCursor!==void 0&&e===void 0)throw new Error("A2A task store Runtime Session cursor is invalid.");let n=t.pendingUserInput;if(n!==void 0&&(!g(n)||typeof n.requestId!="string"||!Number.isSafeInteger(n.revision)||typeof n.runId!="string"||typeof n.kind!="string"))throw new Error("A2A task store pending user input is invalid.");if(t.acceptedOutputModes!==void 0&&(!Array.isArray(t.acceptedOutputModes)||!t.acceptedOutputModes.every(r=>typeof r=="string")))throw new Error("A2A task store accepted output modes are invalid.");return{taskId:t.taskId,contextId:t.contextId,principalKey:t.principalKey,...t.principalKeyScheme===Z?{principalKeyScheme:Z}:{},runtimeIdentity:t.runtimeIdentity,sessionId:t.sessionId,...typeof t.workspaceRoot=="string"?{workspaceRoot:t.workspaceRoot}:{},...typeof t.executionPolicyRevision=="string"?{executionPolicyRevision:t.executionPolicyRevision}:{},messageDigests:t.messageDigests,runIds:t.runIds,task:H(t.task),history:t.history.map(D),createdAt:t.createdAt,updatedAt:t.updatedAt,eventSeq:t.eventSeq,...e!==void 0?{runtimeSessionCursor:e}:{},runtimeEventCount:Number.isSafeInteger(t.runtimeEventCount)?t.runtimeEventCount:0,runtimeEventBytes:Number.isSafeInteger(t.runtimeEventBytes)?t.runtimeEventBytes:0,...t.acceptedOutputModes!==void 0?{acceptedOutputModes:t.acceptedOutputModes}:{},...n!==void 0?{pendingUserInput:{requestId:n.requestId,revision:n.revision,runId:n.runId,kind:n.kind}}:{}}}o(or,"parseRecord");function Pt(t){if(!(!g(t)||typeof t.sessionId!="string"||t.sessionId.length===0||typeof t.journalEpoch!="string"||t.journalEpoch.length===0||!Number.isSafeInteger(t.seq)||typeof t.seq!="number"||t.seq<0))return{sessionId:t.sessionId,journalEpoch:t.journalEpoch,seq:t.seq}}o(Pt,"parseRuntimeSessionCursor");var oe=class{static{o(this,"A2AFileTaskStore")}#e=new Map;#n=new Map;#t;#s;#r;#i;constructor(e){let n=pe.resolve(e);E.mkdirSync(n,{recursive:!0,mode:448}),this.#t=pe.join(n,"tasks.json"),this.#s=pe.join(n,"runtime-cursors"),this.#r=pe.join(n,".server.lock"),this.#i=this.acquireLock();try{this.load()}catch(r){throw E.closeSync(this.#i),E.rmSync(this.#r,{force:!0}),r}}get(e){let n=this.#e.get(e);return n?Y(n):void 0}findByMessage(e,n){for(let r of this.#e.values())if(r.principalKey===e&&r.messageDigests[n]!==void 0)return Y(r)}list(e){return[...this.#e.values()].filter(n=>n.principalKey===e).sort((n,r)=>r.updatedAt.localeCompare(n.updatedAt)||r.taskId.localeCompare(n.taskId)).map(Y)}all(){return[...this.#e.values()].map(Y)}save(e){let n=Y(e),r=this.#e.get(e.taskId);this.#e.set(e.taskId,n);try{this.persist()}catch(i){throw r?this.#e.set(e.taskId,r):this.#e.delete(e.taskId),i}for(let i of this.#n.get(e.taskId)??[])i(Y(n));return Y(n)}checkpointRuntimeCursor(e,n){let r=this.#e.get(e);if(!r)return;if(n.sessionId!==r.sessionId)throw new Error(`A2A Runtime cursor belongs to another Session: ${e}`);let i={...r,runtimeSessionCursor:{...n}};this.#e.set(e,i);try{this.persistRuntimeCursor(e,n)}catch(s){throw this.#e.set(e,r),s}}pruneTerminal(e,n){let r=[...this.#e.values()].filter(s=>s.principalKey===e).sort((s,a)=>s.updatedAt.localeCompare(a.updatedAt)),i=[];for(;r.length>n;){let s=r.findIndex(c=>c.task.status.state==="TASK_STATE_COMPLETED"||c.task.status.state==="TASK_STATE_FAILED"||c.task.status.state==="TASK_STATE_CANCELED"||c.task.status.state==="TASK_STATE_REJECTED");if(s<0)break;let[a]=r.splice(s,1);if(!a)break;this.#e.delete(a.taskId),this.#n.delete(a.taskId),i.push(Y(a))}i.length>0&&this.persist();for(let s of i)E.rmSync(this.runtimeCursorFile(s.taskId),{force:!0});return i}migrateUnversionedPrincipalKeys(e){let n=0,r=0,i=0,s=[];for(let[a,c]of this.#e){if(c.principalKeyScheme!==void 0)continue;let d=e.legacyToCurrent.get(c.principalKey);d!==void 0?(n+=1,s.push([a,{...c,principalKey:d,principalKeyScheme:Z}])):e.currentKeys.has(c.principalKey)?(r+=1,s.push([a,{...c,principalKeyScheme:Z}])):i+=1}if(e.apply&&s.length>0){for(let[a,c]of s)this.#e.set(a,c);this.persist()}return{matchedLegacyTaskCount:n,matchedCurrentTaskCount:r,unmatchedUnversionedTaskCount:i}}subscribe(e,n){let r=this.#n.get(e)??new Set;return r.add(n),this.#n.set(e,r),()=>{r.delete(n),r.size===0&&this.#n.delete(e)}}close(){this.#n.clear(),E.closeSync(this.#i),E.rmSync(this.#r,{force:!0})}acquireLock(){let e=o(()=>{let n=E.openSync(this.#r,"wx",384);return E.writeFileSync(n,`${process.pid}
|
package/dist/sdk-coding.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @kodax-ai/kodax — bundled distribution. See docs/ADR.md ADR-022 + ADR-024.
|
|
2
|
-
import{$ as Rb,A as kb,B as lb,C as nb,D as qb,E as sb,F as ub,G as vb,H as wb,I as yb,J as zb,K as Ab,L as Bb,M as Cb,N as Db,O as Eb,P as Fb,Q as Gb,R as Hb,S as Ib,T as Jb,U as Kb,V as Lb,W as Mb,X as Nb,Y as Ob,Z as Pb,_ as Qb,a as $,aa as Sb,b as oo,ba as Tb,c as ro,ca as Ub,d as ae,da as Vb,e as be,ea as Wb,f as ce,fa as Xb,g as Ya,ga as Yb,h as Za,ha as Zb,i as _a,ia as _b,j as $a,ja as $b,k as ob,ka as oc,l as rb,la as rc,m as eb,ma as ec,n as fb,na as fc,o as mb,oa as mc,p as pb,q as tb,r as xb,s as ab,t as bb,u as cb,v as db,w as gb,x as hb,y as ib,z as jb}from"./chunks/chunk-OSQIYUGD.js";import{a as Ht,b as It,c as Jt,d as Kt,e as Lt,f as Mt,g as Nt,h as Ot,i as Pt,j as yx}from"./chunks/chunk-THZVJ6R7.js";import{$ as ct,$b as za,A as Up,Ab as _x,B as Vp,Bb as $x,C as Wp,Cb as oa,D as Xp,Db as ra,Eb as ea,Fb as fa,Gb as ma,Hb as pa,I as Yp,Ib as ta,J as Zp,Jb as xa,Kb as aa,Lb as ba,Mb as ca,N as _p,Nb as da,O as $p,Ob as ga,P as ot,Pb as ha,Q as rt,Qb as ia,R as et,Rb as ja,S as ft,Sb as ka,T as mt,Tb as la,U as pt,Ua as zx,Ub as na,Va as Ax,Vb as qa,Wb as sa,X as tt,Xb as ua,Y as xt,Yb as va,Z as at,Zb as wa,_ as bt,_b as ya,aa as dt,ac as Aa,b as Lr,ba as gt,bb as Bx,bc as Ba,c as Mr,cb as Cx,cc as Ca,d as Nr,db as Dx,dc as Da,e as Or,eb as Ex,ec as Ea,f as Pr,fb as Fx,fc as Fa,g as Qr,ga as ht,gb as Gx,gc as Ga,ha as it,hb as Hx,hc as Ha,i as Rr,ia as jt,ib as Ix,ic as Ia,j as Sr,ja as kt,jb as Jx,jc as Ja,ka as lt,kb as Kx,kc as Ka,l as Tr,lb as Lx,lc as La,m as Ur,mb as Mx,mc as Ma,n as Vr,nb as Nx,nc as Na,o as fe,oa as nt,ob as Ox,oc as Oa,p as de,pa as qt,pb as Px,pc as Pa,q as ge,qa as st,qb as Qx,qc as Qa,r as Ip,ra as ut,rb as Rx,rc as Ra,s as Jp,sb as Sx,sc as Sa,t as Kp,tb as Tx,tc as Ta,u as Lp,ua as vt,ub as Ux,uc as Ua,v as Mp,vb as Vx,vc as Va,w as Np,wb as Wx,wc as Wa,x as Rp,xb as Xx,y as Sp,yb as Yx,yc as Xa,z as Tp,zb as Zx}from"./chunks/chunk-RJIYXB62.js";import{a as Gt}from"./chunks/chunk-X75UGXP3.js";import{A as ix,B as jx,C as kx,D as lx,E as nx,F as qx,G as sx,H as ux,I as vx,J as wx,a as Qt,b as Rt,c as St,d as Tt,e as Ut,f as Vt,g as Wt,h as Xt,i as Yt,j as Zt,k as _t,l as $t,m as ox,n as rx,o as ex,p as fx,q as mx,r as px,s as tx,t as xx,u as ax,v as bx,w as cx,x as dx,y as gx,z as hx}from"./chunks/chunk-QPBN3J4E.js";import{$ as Ce,$a as af,$b as om,$c as Zm,Aa as Ne,Ab as Jf,Ac as ym,Ad as qp,Bb as Kf,Bc as zm,Bd as sp,Ca as Oe,Cb as Lf,Cc as Am,Cd as up,Da as Pe,Dc as Bm,Dd as vp,E as je,Ea as Qe,Ec as Cm,Ed as wp,F as ke,Fa as Re,Fc as Dm,Fd as yp,G as le,Ga as Se,Gb as Mf,Gc as Em,Gd as zp,H as ne,Hb as Nf,Hc as Fm,I as qe,Ia as Te,Ib as Of,Ic as Gm,Id as Ap,J as se,Ja as Ue,Jb as Pf,Jc as Hm,Jd as Bp,K as ue,Ka as Ve,Kc as Im,Kd as Cp,L as ve,La as We,Lc as Jm,Ld as Dp,M as we,Ma as Xe,Mc as Km,Md as Ep,N as ye,Na as Ye,Nb as Qf,Nc as Lm,Nd as Fp,O as ze,Oa as Ze,Ob as Rf,Oc as Mm,Od as Gp,P as Ae,Pa as _e,Pb as Sf,Pc as Nm,Pd as Hp,Qa as $e,Qb as Tf,Qc as Om,Qd as Op,Ra as of,Rb as Uf,Rc as Pm,Rd as Pp,Sa as rf,Sb as Vf,Sc as Qm,Sd as Qp,Ta as ef,Tb as Wf,Tc as Rm,Ua as ff,Ub as Xf,Uc as Sm,Va as mf,Vb as Yf,Vc as Tm,Wa as pf,Wb as Zf,Wc as Um,Xa as tf,Xb as _f,Xc as Vm,Ya as xf,Yc as Wm,Zc as Xm,_ as Be,_b as $f,_c as Ym,aa as De,ab as bf,ac as rm,ad as _m,ba as Ee,bb as cf,bc as em,bd as $m,c as Wr,ca as Fe,cb as df,cc as fm,cd as op,d as Xr,da as Ge,db as gf,dc as mm,dd as rp,de as yt,e as Yr,eb as hf,ed as ep,ee as zt,f as Zr,fb as jf,fd as fp,fe as At,g as _r,gd as mp,ge as Bt,h as $r,hb as kf,hc as pm,hd as pp,he as Ct,i as oe,ib as lf,ic as tm,id as tp,j as re,jb as nf,jc as xm,jd as xp,k as ee,kb as qf,kc as am,lb as sf,lc as bm,m as me,mb as uf,mc as cm,n as pe,nb as vf,nc as dm,ob as wf,oc as gm,p as te,pa as He,pb as yf,pc as hm,pd as ap,pe as Dt,qa as Ie,qb as zf,qc as im,qd as bp,qe as Et,r as xe,ra as Je,rb as Af,rc as jm,rd as cp,re as Ft,sa as Ke,sb as Bf,sc as km,sd as dp,ta as Le,tb as Cf,tc as lm,td as gp,ub as Df,uc as nm,ud as hp,vb as Ef,vc as qm,vd as ip,wb as Ff,wc as sm,wd as jp,xb as Gf,xc as um,xd as kp,y as he,ya as Me,yb as Hf,yc as vm,yd as lp,z as ie,zb as If,zc as wm,zd as np}from"./chunks/chunk-AGZNXFHZ.js";import"./chunks/chunk-GH3KBC2H.js";import{a as wt}from"./chunks/chunk-YVG6OKN7.js";import{Aa as G,Ba as H,C as x,Ca as I,D as a,Da as J,E as b,Ea as K,F as c,Fa as L,G as d,Ga as M,H as g,Ha as N,Ia as O,Ja as P,Ka as Q,La as R,Ma as S,Oa as T,Pa as U,Qa as V,Ra as W,Ta as X,Ua as Y,V as h,Va as Z,Ya as _,d as o,da as i,e as r,ea as j,f as e,ka as k,la as l,m as f,ma as n,n as m,na as q,oa as s,pa as u,qa as v,ra as w,sa as y,ta as z,ua as A,v as p,va as B,w as t,wa as C,xa as D,ya as E,za as F}from"./chunks/chunk-FBL7IVMK.js";import{Aa as qo,Af as yr,Be as fr,Bf as zr,Ce as mr,Cf as Ar,De as pr,Df as Br,Ee as tr,Ef as Cr,Fe as xr,Ge as ar,Ha as so,He as br,Hf as Dr,Ia as uo,Ie as cr,If as Er,Ja as vo,Jb as Vo,Je as dr,Jf as Fr,Kb as Wo,Ke as gr,Kf as Gr,Le as hr,Lf as Hr,Ma as wo,Me as ir,Mf as Ir,Ne as jr,Oe as kr,Qe as lr,Re as nr,Se as qr,Sf as Jr,Tf as Kr,Ve as sr,We as ur,a as eo,b as fo,c as mo,d as po,e as to,f as xo,h as ao,i as bo,j as co,k as go,l as ho,se as Xo,te as Yo,ue as Zo,v as io,ve as _o,w as jo,we as $o,x as ko,xa as no,xe as or,y as lo,ye as rr,yf as vr,ze as er,zf as wr}from"./chunks/chunk-7XSZVOG7.js";import{A as Jo,B as Ko,C as Lo,D as Mo,E as No,F as Oo,G as Po,H as Qo,I as Ro,J as So,K as To,L as Uo,j as yo,q as zo,r as Ao,s as Bo,t as Co,u as Do,v as Eo,w as Fo,x as Go,y as Ho,z as Io}from"./chunks/chunk-QFV6YCIH.js";import"./chunks/chunk-ONUPGMER.js";export{ot as ALWAYS_RESIDENT_TOOL_NAMES,Ia as AUTO_MODE_DENIAL_CONSECUTIVE_THRESHOLD,Ja as AUTO_MODE_DENIAL_CUMULATIVE_THRESHOLD,Tb as BASH_POLICY_SPEC,Kx as BASH_SAFE_READ_COMMANDS,Jx as BASH_WRITE_COMMANDS,cb as BLOCKER_REQUIRED_CONSECUTIVE_TURNS,Da as BREAKER_ERROR_THRESHOLD,Ea as BREAKER_WINDOW_MS,$t as BUILTIN_WORKFLOWS,ie as CANCELLED_TOOL_RESULT_MESSAGE,he as CANCELLED_TOOL_RESULT_PREFIX,Ba as CLASSIFIER_MAX_OUTPUT_TOKENS,Lb as CODING_AGENT_MARKER,eb as CODING_INVARIANTS,zx as CODING_SUMMARY_PROMPT,Ax as CODING_UPDATE_SUMMARY_PROMPT,sm as CapabilityDeniedError,mb as Client,Dt as CodingActorSession,fp as CombinedExtensionRuntime,um as ConstructionManifestError,Aa as DEFAULT_CLASSIFIER_RETRY_TIMEOUT_MS,za as DEFAULT_CLASSIFIER_TIMEOUT_MS,Bx as DEFAULT_CODING_AGENT_NAME,na as DEFAULT_DANGEROUS_PATTERNS,nm as DEFAULT_HANDLER_TIMEOUT_MS,tt as DEFAULT_RESILIENCE_CONFIG,la as DEFAULT_SAFE_PATTERNS,Fm as DEFAULT_SELF_MODIFY_BUDGET,Sa as DEFAULT_SPECULATIVE_WINDOW_MS,ke as DEFAULT_TOOL_OUTPUT_MAX_BYTES,je as DEFAULT_TOOL_OUTPUT_MAX_LINES,It as DEFAULT_WORKFLOW_GENERATION_TIMEOUT_MS,lo as DefaultSummaryCompaction,Ib as EMIT_VERDICT_TOOL_NAME,de as ErrorCategory,Hx as FILE_MODIFICATION_TOOLS,Tt as FINDING_VERIFICATION_OUTPUT_SCHEMA,Hf as GENERATOR_AGENT_NAME,Ao as ImageResizeError,bo as KODAX_API_MIN_INTERVAL,n as KODAX_DEFAULT_PROVIDER,fo as KODAX_DEFAULT_TIMEOUT,Ro as KODAX_FILE_MEDIA_TYPES,mo as KODAX_HARD_TIMEOUT,Po as KODAX_IMAGE_MEDIA_TYPES,xo as KODAX_MAX_INCOMPLETE_RETRIES,po as KODAX_MAX_RETRIES,eo as KODAX_MAX_TOKENS,l as KODAX_PROVIDERS,k as KODAX_PROVIDER_SNAPSHOTS,p as KODAX_REASONING_MODE_SEQUENCE,to as KODAX_RETRY_BASE_DELAY,t as KODAX_STABLE_EFFORT_INTENTS,ao as KODAX_STAGGER_DELAY,ap as KODAX_TOOLS,Ce as KODAX_UNDERLYING_CAPABILITY_TOPICS,Qo as KODAX_VIDEO_MEDIA_TYPES,i as KodaXAnthropicCompatProvider,h as KodaXBaseProvider,mb as KodaXClient,o as KodaXError,ep as KodaXExtensionRuntime,zo as KodaXMediaError,j as KodaXOpenAICompatProvider,r as KodaXProviderError,e as KodaXRateLimitError,be as KodaXSessionError,ce as KodaXTerminalError,ae as KodaXToolError,Nr as LEARNING_REVIEW_PROMPT_SHA256,Or as LEARNING_REVIEW_SCHEMA_SHA256,Lr as LEARNING_REVIEW_SYSTEM_PROMPT,Mr as LEARNING_REVIEW_TOOL,lr as LINEAGE_ENTRY_TYPES,zt as LSP_SERVERS,qr as LineageCompaction,nr as LineageExtension,At as LspService,De as MANUAL_REGISTRY,Be as MANUAL_TOPIC_IDS,Go as MAX_DIMENSION,Ab as MEMORY_INTERVENTION_SELECTOR_PROMPT,Bb as MEMORY_INTERVENTION_SELECTOR_SHA256,Ix as MODIFICATION_TOOLS,er as McpAuthRequiredError,ir as McpCapabilityProvider,rr as McpExpiredSessionError,jr as McpManager,hr as McpServerRuntime,Lo as PASTE_TMP_DIR_ENV,Mo as PASTE_TMP_TTL_MS,Gf as PLANNER_AGENT_NAME,co as PROMISE_PATTERN,Jp as PROMPT_SECTION_REGISTRY,Kb as PROTOCOL_EMITTER_TOOLS,gt as ProviderRecoveryCoordinator,le as READ_DEFAULT_LIMIT,qe as READ_MAX_LINE_CHARS,ne as READ_PREFLIGHT_SIZE_BYTES,_m as REPO_EXPLORER_AGENT_NAME,$m as REPO_EXPLORER_TOOL_NAMES,qo as Runner,St as SCOPED_REVIEW_OUTPUT_SCHEMA,Ff as SCOUT_AGENT_NAME,rc as SCOUT_THEN_AUTHOR_PROMPT_LINES,Sp as SELF_KNOWLEDGE_ROUTING_RULE,Ip as SYSTEM_PROMPT,kx as SYSTEM_WORKFLOW_LIMITS,ct as StableBoundaryTracker,Ho as TARGET_RAW_SIZE_BYTES,Kf as TASK_ENGINE_ROLE_AGENTS,Mb as TOOL_RESULT_TRUNCATION_GUARDRAIL_NAME,Wb as TRACING_ENV,If as WORKER_AGENT_NAME,Ht as WORKFLOW_GENERATION_SYSTEM_PROMPT,Mm as _resetRuntimeForTesting,ee as acquireExclusiveFileSystemEffectLease,Pm as activate,yo as actorQueueId,ia as analyzeAutoModeCall,Ye as analyzeChangedScope,Mx as analyzePowerShellMutation,Dm as appendAuditEntry,Br as appendSessionLineageLabel,Vf as applyAccountingDelta,Wt as applyFindingVerification,Cr as applySessionCompaction,Ne as applyToolResultGuardrail,Ir as archiveOldIslands,ha as assessAutoModeCall,fc as authorWorkflowViaWorker,Na as autoModeDenialShouldFallback,Ur as awaitLatestCodingMemoryReviewDrain,ua as bashSignalCollector,Xb as bootstrapTracing,_a as boundedRevise,Ha as breakerShouldFallback,$a as budgetCeiling,lx as buildApprovalSummary,Yf as buildBlockedGoal,Tp as buildCapabilityContextSections,va as buildClassifierPrompt,Zf as buildCompleteGoal,Uf as buildCreatedGoal,qt as buildFallbackRoutingDecision,ib as buildGoalRuntimeBinding,gr as buildInitializeCapabilities,Am as buildLlmReviewPrompt,Fe as buildManualToolDescription,qb as buildMcpReverseCapabilities,Wf as buildPausedGoal,Xp as buildPromptMessageContent,Np as buildPromptSnapshot,ht as buildProviderCapabilitySnapshot,st as buildProviderPolicyHintsForDecision,it as buildProviderPolicyPromptNotes,Xe as buildRepoIntelligenceContext,af as buildRepoIntelligenceIndex,Ue as buildRepoOverview,Xf as buildResumedGoal,Zt as buildScopedReviewFinalPrompt,Xt as buildScopedReviewPrimaryPrompt,Yt as buildScopedReviewVerificationPrompt,ec as buildScoutThenAuthorPrompt,Rp as buildSelfKnowledgeRoutingRule,Gr as buildSessionTree,Vp as buildSystemPrompt,Up as buildSystemPromptSnapshot,Fp as buildToolResultBudget,Gp as buildToolResultBudgetFromUsage,pm as buildToolSearchIndex,hx as buildWorkflowCostReport,Mt as buildWorkflowGenerationSkillContext,Lt as buildWorkflowGenerationUserPrompt,Sr as canonicalMemoryProjectId,Wr as canonicalizeAgentHomePolicyPath,ba as canonicalizeAutoModePath,ka as checkAbsoluteDeny,Wp as checkIncompleteToolCalls,vt as checkPromiseSignal,Hp as clampToolResultPolicyToBudget,nx as clampWorkflowLimits,Ca as classify,sa as classifyBashCommand,ge as classifyError,Te as classifyFileCategory,at as classifyResilienceError,Bp as cleanupExpiredToolOutputs,Wo as cleanupIncompleteToolCalls,Cp as cleanupUnreferencedToolOutputs,T as clearRuntimeModelProviders,xe as clearShellExecutionEnvironmentCache,Ra as collectAllSignals,ma as collectBashWriteTargets,pa as collectDeterministicBashWriteTargets,mp as combineExtensionRuntimes,Eb as computeInputSignature,Ob as computeRulesFingerprint,Lm as configureRuntime,mt as consumeCompactionCooldown,yf as convertCapabilityReadResult,wf as convertProviderSearchResults,Hr as countActiveLineageMessages,ho as countTokens,io as createAgent,Va as createAgentHomeShellBoundaryGuardrail,Ka as createAutoModeDenialTracker,Wa as createAutoModeToolGuardrail,qa as createBashClassifierConfig,Vb as createBashPrefixExtractor,kp as createBuiltinToolDefinition,Fa as createCircuitBreaker,Cb as createCodingMemoryInterventionRunner,Qt as createCodingWorkflowBackend,et as createCompactionAntiThrashState,vm as createCtxProxy,F as createCustomProvider,Cx as createDefaultCodingAgent,Db as createDenialTracker,pp as createExtensionRuntime,Ft as createExternalActorTurnExecutor,Eo as createFileArtifactFromPath,jo as createHandoff,Do as createImageArtifactFromPath,ko as createInMemorySession,vb as createKodaXTaskRunner,Et as createLocalCodingActorControl,Yo as createMcpCapabilityId,kr as createMcpManager,fr as createMcpTransport,$ as createOutputSegmentProjection,Qr as createProductionLearningReviewer,Kp as createPromptSection,ut as createReasoningPlan,jx as createRunGraphWriter,$p as createRuntimeContextBudgetSnapshot,Ya as createSessionControl,vr as createSessionLineage,Nb as createToolResultTruncationGuardrail,Fo as createVideoArtifactFromPath,Zb as createWorkflowLifecycleController,oc as createWorkflowPatternTemplateModule,vx as createWorkflowRunManager,tb as decideWorkflowInvocation,hm as dedupeExtensionPathsByEntrypoint,Xo as defaultMcpCacheDir,qm as defaultPolicy,ax as deleteSavedWorkflow,Rr as deriveCodingMemoryIdentity,Vr as deriveCodingMemoryReviewIdentities,Km as disableSelfModify,xr as discoverAuthorizationServerMetadata,lm as discoverDefaultExtensions,km as discoverExtensionsInDirectory,jm as discoverExtensionsInDirectoryDetailed,Zm as discoverMarkdownAgents,ar as discoverOAuthEndpoints,tr as discoverProtectedResourceMetadata,ex as discoverSavedWorkflows,Tr as drainCodingMemoryReviewInbox,Nf as drainPendingSwaps,ro as effectiveOutputSegmentText,b as effortToLegacyReasoningMode,Jb as emitVerdict,sx as emitWorkflowAgentDigest,Uo as enqueueWithArtifacts,op as ensureBuiltinRepoExplorerAgent,go as estimateTokens,_p as estimateToolSchemaTokens,ja as evaluateAutoRulesCall,jt as evaluateProviderPolicy,im as excludeExtensionPathsByEntrypoint,am as exec,mm as executeRunScopedTool,Ap as executeTool,sr as extractArtifactLedger,Ub as extractCommandPrefix,Zp as extractComparableUserMessageText,vf as extractHtmlTitle,pr as extractInsufficientScope,_x as extractPathsFromCommand,Yp as extractPromptComparableText,mr as extractResourceMetadataUrl,Kr as extractTitleFromMessages,Oa as fileSignalCollector,Af as finalizeRetrievalResult,Vm as findByVersion,Nx as findGitSubcommandIndex,Dr as findPreviousUserEntryId,Fx as flattenArgv,Gx as flattenRedirections,Fr as forkSessionLineage,Qp as formatAgentsForPrompt,yb as formatParallelDispatchResult,se as formatSize,Xx as generateSavePattern,Jr as generateSessionId,Ot as generateWorkflow,Pt as generateWorkflowFromOptions,xp as getActiveExtensionRuntime,uo as getAgentConfigHome,vo as getAgentConfigPath,np as getAllRegisteredTools,wo as getAppDataDir,W as getAvailableProviderNames,ta as getBashOutsideProjectWriteRisk,jp as getBuiltinRegisteredToolDefinition,ip as getBuiltinToolDefinition,ox as getBuiltinWorkflow,N as getCustomModelCapabilities,H as getCustomProvider,K as getCustomProviderList,M as getCustomProviderModelDescriptors,L as getCustomProviderModels,J as getCustomProviderNames,dm as getDefaultExtensionDirectory,Bt as getDefaultLspService,wx as getDefaultWorkflowRunManager,Hb as getDenialContext,Tx as getDirectShellBypassBlockReason,hf as getImpactEstimate,Op as getKodaxGlobalDir,or as getMcpCachePaths,C as getModelCapabilities,So as getModelInputCapabilities,cf as getModuleContext,ea as getPlanModeAllowedWritablePaths,xa as getPlanModeBlockReason,gf as getProcessContext,q as getProvider,w as getProviderConfiguredCapabilityProfile,v as getProviderConfiguredReasoningCapability,y as getProviderList,u as getProviderModel,B as getProviderModelDescriptors,z as getProviderModels,gp as getRegisteredToolDefinition,bf as getRepoIntelligenceIndex,Ve as getRepoOverview,jf as getRepoRoutingSignals,wp as getRequiredToolParams,Q as getRuntimeModelProvider,S as getRuntimeModelProviderNames,wr as getSessionLineagePath,yr as getSessionMessagesFromLineage,df as getSymbolContext,cp as getTool,dp as getToolDefinition,hp as getToolRegistrations,Me as getToolResultPolicy,$b as getWorkflowPatternTemplate,Ox as gitSignatureInspectionMayExecute,Rf as goalTokenDelta,pb as hasExplicitNaturalLanguageWorkflowIntent,Mf as hasPendingSwap,Bo as inferImageMediaType,aa as inferPermissionMode,nt as inferTaskType,Co as inferVideoMediaType,Ke as inspectEditFailure,xf as inspectRepoIntelligenceRuntime,Pr as installProductionLearningReviewer,$r as isAgentHomeHardMutationTarget,oe as isAgentHomeHardRemovalTarget,Yx as isAlwaysConfirmPath,Yr as isAutoReadableAgentHomePath,da as isAutoReadableKodaxPath,Xr as isAutoWritableAgentHomePath,ga as isAutoWritableKodaxPath,Sx as isBashReadCommand,oa as isBashReadCommandAutoAllowed,Ux as isBashWriteCommand,$x as isCommandOnProtectedPath,ca as isCredentialBearingKodaxPath,I as isCustomProviderName,Gb as isDeniedRecently,Rx as isHelpCommand,V as isKnownProvider,Dx as isNullDevice,wb as isParallelDispatchDirective,ra as isPathInsideProject,fa as isPlanModeAllowedPath,Lx as isPowerShellMutationCommand,_r as isProtectedAgentHomeMutationTarget,Zr as isProtectedAgentHomeReadTarget,re as isProtectedAgentHomeRemovalTarget,s as isProviderConfigured,A as isProviderName,R as isRuntimeModelProviderName,bt as isSessionRecoveryCandidateError,Qx as isShellReadOnlyArgv,cm as isSupportedExtensionModulePath,Wx as isToolCallAllowed,sp as isToolFileMutation,vp as isToolMutation,up as isToolNetworkRead,qp as isToolPlanModeAllowed,_f as isValidTokenBudget,wt as languageIdForPath,Wm as listAll,Z as listAllModelCapabilities,Sm as listArtifacts,D as listBuiltinModelCapabilities,lp as listBuiltinToolDefinitions,rx as listBuiltinWorkflows,Of as listCodingDispatchableAgents,Um as listConstructed,O as listCustomProviderModelCapabilities,om as listRunScopedTools,zp as listToolDefinitions,yp as listTools,_b as listWorkflowPatternTemplates,Pp as loadAgentsFiles,Xm as loadAgentsFromMarkdown,Sb as loadAutoRules,cx as loadGeneratedWorkflowFromRun,wm as loadHandler,Ym as loadMarkdownAgentScope,px as loadSavedWorkflow,mx as loadSavedWorkflowCapsule,dr as loadValidToken,em as lookupRunScopedTool,Qf as makeDisabledGoalToolsContext,a as mapLegacyReasoningModeToEffortIntent,Ep as maybeRunReferenceAwareToolOutputGc,Dp as maybeRunToolOutputGc,nb as mcpRootsFromWorkspace,ur as mergeArtifactLedger,Vt as mergeScopedReviewResults,fe as normalizeKodaXAgentMode,Zo as normalizeMcpCapabilityId,Io as normalizePastedImage,x as normalizeReasoningEffortValue,Ut as normalizeScopedReviewResult,me as normalizeShellExecutionContract,fx as normalizeWorkflowModule,Lp as orderPromptSections,Rt as parallelInvestigation,Vx as parseAllowedToolPattern,Rb as parseAutoRules,Ex as parseBashCommand,wa as parseClassifierOutput,Je as parseEditToolError,Px as parseGitGrepShortOption,Bm as parseLlmReviewVerdict,_o as parseMcpCapabilityId,Pa as parseModelSpec,c as parseReasoningEffortEnv,te as parseSandboxEnvironmentPass,m as parseTimeoutSecEnvMs,xm as parseToolSearchQuery,Nt as parseWorkflowGeneration,cr as performOAuthLogin,No as persistImageAsBlock,ze as persistToolOutput,rt as planToolExposure,gx as preflightWorkflowCapsule,kf as prewarmRepoIntelligenceCaches,Gt as providerResilienceConfigFromTimeouts,Oo as prunePasteTmpDir,Ko as readAndNormalizeClipboardImage,Tm as readArtifact,Em as readAuditEntries,Gm as readBudget,Jo as readClipboardImage,Jm as readDisableState,Ta as readSpeculativeWindowFromEnv,Pb as readTrustState,lt as reasoningModeToDepth,dt as reconstructMessagesWithToolGuard,Ma as recordAutoModeAllow,La as recordAutoModeBlock,ab as recordBlockerAttempt,Ga as recordBreakerError,pt as recordCompactionSavings,Fb as recordDenial,oo as reduceOutputSegmentProjection,fb as registerCodingInvariants,kb as registerConfiguredMcpCapabilityProvider,G as registerCustomProviders,P as registerModelProvider,br as registerOAuthClient,sb as registerOfficialSandboxExtension,no as registerPresetDispatcher,bp as registerTool,Qm as rehydrateActiveArtifacts,Hm as remainingSelfModifyBudget,xx as renameSavedWorkflow,Ze as renderChangedScope,mf as renderImpactEstimate,rf as renderModuleContext,ff as renderProcessContext,Mp as renderPromptSections,We as renderRepoOverview,zf as renderRetrievalResult,ef as renderSymbolContext,lb as replaceConfiguredMcpCapabilityProvider,bx as replaceSavedWorkflow,yt as reportLspDiagnostics,bb as resetBlockerCounter,Im as resetBudget,Qa as resolveClassifierModel,Pf as resolveCodingDispatchableAgent,Lf as resolveConstructedAgent,gm as resolveExtensionEntrypoint,Ee as resolveKodaXManual,Y as resolveModelCapabilities,U as resolveProvider,X as resolveProviderModelDescriptors,d as resolveReasoningEffort,g as resolveReasoningEffortForModelSwitch,kt as resolveReasoningMode,tf as resolveRepoIntelligenceMode,pf as resolveRepoIntelligenceRuntimeConfig,xt as resolveResilienceConfig,zr as resolveSessionLineageTarget,$f as resolveToolBridgeTarget,ob as resolveToolCapability,ye as resolveToolOutputDir,_ as resolveWireEffort,Jt as resolveWorkflowGenerationTimeoutMs,Yb as resolveWorkflowIdentity,Rm as revoke,Er as rewindSessionLineage,rp as rollbackSelfModify,ym as runAstRules,Xa as runKodaX,Cm as runLlmReview,jb as runManagedTask,ub as runOrchestration,rm as runScopedToolMap,ux as runWorkflowFromOptions,qx as runWorkflowModule,ix as safeWorkflowArtifactName,tx as saveGeneratedWorkflow,dx as saveGeneratedWorkflowFromRun,_t as scopedReview,$o as searchMcpCatalog,tm as searchToolIndex,tp as setActiveExtensionRuntime,so as setAgentConfigHome,Ar as setSessionLineageActiveEntry,pe as shellExecutionContractFingerprint,Tf as shouldFlipBudgetLimited,ft as shouldSkipLlmCompaction,Ct as shutdownDefaultLspService,Ua as speculativeRace,Nm as stage,Za as startKodaX,yx as startManagedWorkflow,ya as stripAssistantText,uf as stripHtmlToText,Om as testArtifact,f as timeoutSecToMs,fm as toModelToolDefinition,Zx as tokenizeRawCommandStages,Se as toolAskUserQuestion,Oe as toolBash,of as toolChangedDiff,$e as toolChangedScope,Df as toolCodeSearch,Ie as toolEdit,Pe as toolGlob,Qe as toolGrep,sf as toolImpactEstimate,Le as toolInsertAfterAnchor,lf as toolModuleContext,rb as toolPermission,qf as toolProcessContext,Ae as toolRead,_e as toolRepoOverview,Ef as toolSemanticLookup,nf as toolSymbolContext,Re as toolUndo,Cf as toolWebFetch,Bf as toolWebSearch,He as toolWrite,ue as truncateHead,we as truncateLine,ve as truncateTail,Qb as trustProjectRules,Sf as turnWallTimeDelta,Vo as validateAndFixToolHistory,E as validateCustomProviderConfig,Kt as validateGeneratedWorkflowSource,To as validateInputArtifactsForModel,zb as validateSubtaskIndependence,zm as validateToolSchemaForProvider,hb as verifyGoalCompletion,bm as webhook,db as withGoalBeforeNextTurn,gb as withGoalStopHook,Ge as withManualToolBranding,Jf as workerAgent,xb as workflowStartOutcomeConsumesTurn,mc as writeReviewPackets};
|
|
2
|
+
import{$ as Rb,A as kb,B as lb,C as nb,D as qb,E as sb,F as ub,G as vb,H as wb,I as yb,J as zb,K as Ab,L as Bb,M as Cb,N as Db,O as Eb,P as Fb,Q as Gb,R as Hb,S as Ib,T as Jb,U as Kb,V as Lb,W as Mb,X as Nb,Y as Ob,Z as Pb,_ as Qb,a as $,aa as Sb,b as oo,ba as Tb,c as ro,ca as Ub,d as ae,da as Vb,e as be,ea as Wb,f as ce,fa as Xb,g as Ya,ga as Yb,h as Za,ha as Zb,i as _a,ia as _b,j as $a,ja as $b,k as ob,ka as oc,l as rb,la as rc,m as eb,ma as ec,n as fb,na as fc,o as mb,oa as mc,p as pb,q as tb,r as xb,s as ab,t as bb,u as cb,v as db,w as gb,x as hb,y as ib,z as jb}from"./chunks/chunk-4BY53JTF.js";import{a as Ht,b as It,c as Jt,d as Kt,e as Lt,f as Mt,g as Nt,h as Ot,i as Pt,j as yx}from"./chunks/chunk-XTWIGVUL.js";import{$ as ct,$b as za,A as Up,Ab as _x,B as Vp,Bb as $x,C as Wp,Cb as oa,D as Xp,Db as ra,Eb as ea,Fb as fa,Gb as ma,Hb as pa,I as Yp,Ib as ta,J as Zp,Jb as xa,Kb as aa,Lb as ba,Mb as ca,N as _p,Nb as da,O as $p,Ob as ga,P as ot,Pb as ha,Q as rt,Qb as ia,R as et,Rb as ja,S as ft,Sb as ka,T as mt,Tb as la,U as pt,Ua as zx,Ub as na,Va as Ax,Vb as qa,Wb as sa,X as tt,Xb as ua,Y as xt,Yb as va,Z as at,Zb as wa,_ as bt,_b as ya,aa as dt,ac as Aa,b as Lr,ba as gt,bb as Bx,bc as Ba,c as Mr,cb as Cx,cc as Ca,d as Nr,db as Dx,dc as Da,e as Or,eb as Ex,ec as Ea,f as Pr,fb as Fx,fc as Fa,g as Qr,ga as ht,gb as Gx,gc as Ga,ha as it,hb as Hx,hc as Ha,i as Rr,ia as jt,ib as Ix,ic as Ia,j as Sr,ja as kt,jb as Jx,jc as Ja,ka as lt,kb as Kx,kc as Ka,l as Tr,lb as Lx,lc as La,m as Ur,mb as Mx,mc as Ma,n as Vr,nb as Nx,nc as Na,o as fe,oa as nt,ob as Ox,oc as Oa,p as de,pa as qt,pb as Px,pc as Pa,q as ge,qa as st,qb as Qx,qc as Qa,r as Ip,ra as ut,rb as Rx,rc as Ra,s as Jp,sb as Sx,sc as Sa,t as Kp,tb as Tx,tc as Ta,u as Lp,ua as vt,ub as Ux,uc as Ua,v as Mp,vb as Vx,vc as Va,w as Np,wb as Wx,wc as Wa,x as Rp,xb as Xx,y as Sp,yb as Yx,yc as Xa,z as Tp,zb as Zx}from"./chunks/chunk-JJ2YDBSN.js";import{a as Gt}from"./chunks/chunk-7QBWHCIZ.js";import{A as ix,B as jx,C as kx,D as lx,E as nx,F as qx,G as sx,H as ux,I as vx,J as wx,a as Qt,b as Rt,c as St,d as Tt,e as Ut,f as Vt,g as Wt,h as Xt,i as Yt,j as Zt,k as _t,l as $t,m as ox,n as rx,o as ex,p as fx,q as mx,r as px,s as tx,t as xx,u as ax,v as bx,w as cx,x as dx,y as gx,z as hx}from"./chunks/chunk-PRASABCC.js";import{$ as Ce,$a as af,$b as om,$c as Zm,Aa as Ne,Ab as Jf,Ac as ym,Ad as qp,Bb as Kf,Bc as zm,Bd as sp,Ca as Oe,Cb as Lf,Cc as Am,Cd as up,Da as Pe,Dc as Bm,Dd as vp,E as je,Ea as Qe,Ec as Cm,Ed as wp,F as ke,Fa as Re,Fc as Dm,Fd as yp,G as le,Ga as Se,Gb as Mf,Gc as Em,Gd as zp,H as ne,Hb as Nf,Hc as Fm,I as qe,Ia as Te,Ib as Of,Ic as Gm,Id as Ap,J as se,Ja as Ue,Jb as Pf,Jc as Hm,Jd as Bp,K as ue,Ka as Ve,Kc as Im,Kd as Cp,L as ve,La as We,Lc as Jm,Ld as Dp,M as we,Ma as Xe,Mc as Km,Md as Ep,N as ye,Na as Ye,Nb as Qf,Nc as Lm,Nd as Fp,O as ze,Oa as Ze,Ob as Rf,Oc as Mm,Od as Gp,P as Ae,Pa as _e,Pb as Sf,Pc as Nm,Pd as Hp,Qa as $e,Qb as Tf,Qc as Om,Qd as Op,Ra as of,Rb as Uf,Rc as Pm,Rd as Pp,Sa as rf,Sb as Vf,Sc as Qm,Sd as Qp,Ta as ef,Tb as Wf,Tc as Rm,Ua as ff,Ub as Xf,Uc as Sm,Va as mf,Vb as Yf,Vc as Tm,Wa as pf,Wb as Zf,Wc as Um,Xa as tf,Xb as _f,Xc as Vm,Ya as xf,Yc as Wm,Zc as Xm,_ as Be,_b as $f,_c as Ym,aa as De,ab as bf,ac as rm,ad as _m,ba as Ee,bb as cf,bc as em,bd as $m,c as Wr,ca as Fe,cb as df,cc as fm,cd as op,d as Xr,da as Ge,db as gf,dc as mm,dd as rp,de as yt,e as Yr,eb as hf,ed as ep,ee as zt,f as Zr,fb as jf,fd as fp,fe as At,g as _r,gd as mp,ge as Bt,h as $r,hb as kf,hc as pm,hd as pp,he as Ct,i as oe,ib as lf,ic as tm,id as tp,j as re,jb as nf,jc as xm,jd as xp,k as ee,kb as qf,kc as am,lb as sf,lc as bm,m as me,mb as uf,mc as cm,n as pe,nb as vf,nc as dm,ob as wf,oc as gm,p as te,pa as He,pb as yf,pc as hm,pd as ap,pe as Dt,qa as Ie,qb as zf,qc as im,qd as bp,qe as Et,r as xe,ra as Je,rb as Af,rc as jm,rd as cp,re as Ft,sa as Ke,sb as Bf,sc as km,sd as dp,ta as Le,tb as Cf,tc as lm,td as gp,ub as Df,uc as nm,ud as hp,vb as Ef,vc as qm,vd as ip,wb as Ff,wc as sm,wd as jp,xb as Gf,xc as um,xd as kp,y as he,ya as Me,yb as Hf,yc as vm,yd as lp,z as ie,zb as If,zc as wm,zd as np}from"./chunks/chunk-JTZKC4TV.js";import"./chunks/chunk-GH3KBC2H.js";import{a as wt}from"./chunks/chunk-YVG6OKN7.js";import{Aa as G,Ba as H,C as x,Ca as I,D as a,Da as J,E as b,Ea as K,F as c,Fa as L,G as d,Ga as M,H as g,Ha as N,Ia as O,Ja as P,Ka as Q,La as R,Ma as S,Oa as T,Pa as U,Qa as V,Ra as W,Ta as X,Ua as Y,V as h,Va as Z,Ya as _,d as o,da as i,e as r,ea as j,f as e,ka as k,la as l,m as f,ma as n,n as m,na as q,oa as s,pa as u,qa as v,ra as w,sa as y,ta as z,ua as A,v as p,va as B,w as t,wa as C,xa as D,ya as E,za as F}from"./chunks/chunk-BHE66SP3.js";import{Aa as qo,Af as yr,Be as fr,Bf as zr,Ce as mr,Cf as Ar,De as pr,Df as Br,Ee as tr,Ef as Cr,Fe as xr,Ge as ar,Ha as so,He as br,Hf as Dr,Ia as uo,Ie as cr,If as Er,Ja as vo,Jb as Vo,Je as dr,Jf as Fr,Kb as Wo,Ke as gr,Kf as Gr,Le as hr,Lf as Hr,Ma as wo,Me as ir,Mf as Ir,Ne as jr,Oe as kr,Qe as lr,Re as nr,Se as qr,Sf as Jr,Tf as Kr,Ve as sr,We as ur,a as eo,b as fo,c as mo,d as po,e as to,f as xo,h as ao,i as bo,j as co,k as go,l as ho,se as Xo,te as Yo,ue as Zo,v as io,ve as _o,w as jo,we as $o,x as ko,xa as no,xe as or,y as lo,ye as rr,yf as vr,ze as er,zf as wr}from"./chunks/chunk-7XSZVOG7.js";import{A as Jo,B as Ko,C as Lo,D as Mo,E as No,F as Oo,G as Po,H as Qo,I as Ro,J as So,K as To,L as Uo,j as yo,q as zo,r as Ao,s as Bo,t as Co,u as Do,v as Eo,w as Fo,x as Go,y as Ho,z as Io}from"./chunks/chunk-QFV6YCIH.js";import"./chunks/chunk-ONUPGMER.js";export{ot as ALWAYS_RESIDENT_TOOL_NAMES,Ia as AUTO_MODE_DENIAL_CONSECUTIVE_THRESHOLD,Ja as AUTO_MODE_DENIAL_CUMULATIVE_THRESHOLD,Tb as BASH_POLICY_SPEC,Kx as BASH_SAFE_READ_COMMANDS,Jx as BASH_WRITE_COMMANDS,cb as BLOCKER_REQUIRED_CONSECUTIVE_TURNS,Da as BREAKER_ERROR_THRESHOLD,Ea as BREAKER_WINDOW_MS,$t as BUILTIN_WORKFLOWS,ie as CANCELLED_TOOL_RESULT_MESSAGE,he as CANCELLED_TOOL_RESULT_PREFIX,Ba as CLASSIFIER_MAX_OUTPUT_TOKENS,Lb as CODING_AGENT_MARKER,eb as CODING_INVARIANTS,zx as CODING_SUMMARY_PROMPT,Ax as CODING_UPDATE_SUMMARY_PROMPT,sm as CapabilityDeniedError,mb as Client,Dt as CodingActorSession,fp as CombinedExtensionRuntime,um as ConstructionManifestError,Aa as DEFAULT_CLASSIFIER_RETRY_TIMEOUT_MS,za as DEFAULT_CLASSIFIER_TIMEOUT_MS,Bx as DEFAULT_CODING_AGENT_NAME,na as DEFAULT_DANGEROUS_PATTERNS,nm as DEFAULT_HANDLER_TIMEOUT_MS,tt as DEFAULT_RESILIENCE_CONFIG,la as DEFAULT_SAFE_PATTERNS,Fm as DEFAULT_SELF_MODIFY_BUDGET,Sa as DEFAULT_SPECULATIVE_WINDOW_MS,ke as DEFAULT_TOOL_OUTPUT_MAX_BYTES,je as DEFAULT_TOOL_OUTPUT_MAX_LINES,It as DEFAULT_WORKFLOW_GENERATION_TIMEOUT_MS,lo as DefaultSummaryCompaction,Ib as EMIT_VERDICT_TOOL_NAME,de as ErrorCategory,Hx as FILE_MODIFICATION_TOOLS,Tt as FINDING_VERIFICATION_OUTPUT_SCHEMA,Hf as GENERATOR_AGENT_NAME,Ao as ImageResizeError,bo as KODAX_API_MIN_INTERVAL,n as KODAX_DEFAULT_PROVIDER,fo as KODAX_DEFAULT_TIMEOUT,Ro as KODAX_FILE_MEDIA_TYPES,mo as KODAX_HARD_TIMEOUT,Po as KODAX_IMAGE_MEDIA_TYPES,xo as KODAX_MAX_INCOMPLETE_RETRIES,po as KODAX_MAX_RETRIES,eo as KODAX_MAX_TOKENS,l as KODAX_PROVIDERS,k as KODAX_PROVIDER_SNAPSHOTS,p as KODAX_REASONING_MODE_SEQUENCE,to as KODAX_RETRY_BASE_DELAY,t as KODAX_STABLE_EFFORT_INTENTS,ao as KODAX_STAGGER_DELAY,ap as KODAX_TOOLS,Ce as KODAX_UNDERLYING_CAPABILITY_TOPICS,Qo as KODAX_VIDEO_MEDIA_TYPES,i as KodaXAnthropicCompatProvider,h as KodaXBaseProvider,mb as KodaXClient,o as KodaXError,ep as KodaXExtensionRuntime,zo as KodaXMediaError,j as KodaXOpenAICompatProvider,r as KodaXProviderError,e as KodaXRateLimitError,be as KodaXSessionError,ce as KodaXTerminalError,ae as KodaXToolError,Nr as LEARNING_REVIEW_PROMPT_SHA256,Or as LEARNING_REVIEW_SCHEMA_SHA256,Lr as LEARNING_REVIEW_SYSTEM_PROMPT,Mr as LEARNING_REVIEW_TOOL,lr as LINEAGE_ENTRY_TYPES,zt as LSP_SERVERS,qr as LineageCompaction,nr as LineageExtension,At as LspService,De as MANUAL_REGISTRY,Be as MANUAL_TOPIC_IDS,Go as MAX_DIMENSION,Ab as MEMORY_INTERVENTION_SELECTOR_PROMPT,Bb as MEMORY_INTERVENTION_SELECTOR_SHA256,Ix as MODIFICATION_TOOLS,er as McpAuthRequiredError,ir as McpCapabilityProvider,rr as McpExpiredSessionError,jr as McpManager,hr as McpServerRuntime,Lo as PASTE_TMP_DIR_ENV,Mo as PASTE_TMP_TTL_MS,Gf as PLANNER_AGENT_NAME,co as PROMISE_PATTERN,Jp as PROMPT_SECTION_REGISTRY,Kb as PROTOCOL_EMITTER_TOOLS,gt as ProviderRecoveryCoordinator,le as READ_DEFAULT_LIMIT,qe as READ_MAX_LINE_CHARS,ne as READ_PREFLIGHT_SIZE_BYTES,_m as REPO_EXPLORER_AGENT_NAME,$m as REPO_EXPLORER_TOOL_NAMES,qo as Runner,St as SCOPED_REVIEW_OUTPUT_SCHEMA,Ff as SCOUT_AGENT_NAME,rc as SCOUT_THEN_AUTHOR_PROMPT_LINES,Sp as SELF_KNOWLEDGE_ROUTING_RULE,Ip as SYSTEM_PROMPT,kx as SYSTEM_WORKFLOW_LIMITS,ct as StableBoundaryTracker,Ho as TARGET_RAW_SIZE_BYTES,Kf as TASK_ENGINE_ROLE_AGENTS,Mb as TOOL_RESULT_TRUNCATION_GUARDRAIL_NAME,Wb as TRACING_ENV,If as WORKER_AGENT_NAME,Ht as WORKFLOW_GENERATION_SYSTEM_PROMPT,Mm as _resetRuntimeForTesting,ee as acquireExclusiveFileSystemEffectLease,Pm as activate,yo as actorQueueId,ia as analyzeAutoModeCall,Ye as analyzeChangedScope,Mx as analyzePowerShellMutation,Dm as appendAuditEntry,Br as appendSessionLineageLabel,Vf as applyAccountingDelta,Wt as applyFindingVerification,Cr as applySessionCompaction,Ne as applyToolResultGuardrail,Ir as archiveOldIslands,ha as assessAutoModeCall,fc as authorWorkflowViaWorker,Na as autoModeDenialShouldFallback,Ur as awaitLatestCodingMemoryReviewDrain,ua as bashSignalCollector,Xb as bootstrapTracing,_a as boundedRevise,Ha as breakerShouldFallback,$a as budgetCeiling,lx as buildApprovalSummary,Yf as buildBlockedGoal,Tp as buildCapabilityContextSections,va as buildClassifierPrompt,Zf as buildCompleteGoal,Uf as buildCreatedGoal,qt as buildFallbackRoutingDecision,ib as buildGoalRuntimeBinding,gr as buildInitializeCapabilities,Am as buildLlmReviewPrompt,Fe as buildManualToolDescription,qb as buildMcpReverseCapabilities,Wf as buildPausedGoal,Xp as buildPromptMessageContent,Np as buildPromptSnapshot,ht as buildProviderCapabilitySnapshot,st as buildProviderPolicyHintsForDecision,it as buildProviderPolicyPromptNotes,Xe as buildRepoIntelligenceContext,af as buildRepoIntelligenceIndex,Ue as buildRepoOverview,Xf as buildResumedGoal,Zt as buildScopedReviewFinalPrompt,Xt as buildScopedReviewPrimaryPrompt,Yt as buildScopedReviewVerificationPrompt,ec as buildScoutThenAuthorPrompt,Rp as buildSelfKnowledgeRoutingRule,Gr as buildSessionTree,Vp as buildSystemPrompt,Up as buildSystemPromptSnapshot,Fp as buildToolResultBudget,Gp as buildToolResultBudgetFromUsage,pm as buildToolSearchIndex,hx as buildWorkflowCostReport,Mt as buildWorkflowGenerationSkillContext,Lt as buildWorkflowGenerationUserPrompt,Sr as canonicalMemoryProjectId,Wr as canonicalizeAgentHomePolicyPath,ba as canonicalizeAutoModePath,ka as checkAbsoluteDeny,Wp as checkIncompleteToolCalls,vt as checkPromiseSignal,Hp as clampToolResultPolicyToBudget,nx as clampWorkflowLimits,Ca as classify,sa as classifyBashCommand,ge as classifyError,Te as classifyFileCategory,at as classifyResilienceError,Bp as cleanupExpiredToolOutputs,Wo as cleanupIncompleteToolCalls,Cp as cleanupUnreferencedToolOutputs,T as clearRuntimeModelProviders,xe as clearShellExecutionEnvironmentCache,Ra as collectAllSignals,ma as collectBashWriteTargets,pa as collectDeterministicBashWriteTargets,mp as combineExtensionRuntimes,Eb as computeInputSignature,Ob as computeRulesFingerprint,Lm as configureRuntime,mt as consumeCompactionCooldown,yf as convertCapabilityReadResult,wf as convertProviderSearchResults,Hr as countActiveLineageMessages,ho as countTokens,io as createAgent,Va as createAgentHomeShellBoundaryGuardrail,Ka as createAutoModeDenialTracker,Wa as createAutoModeToolGuardrail,qa as createBashClassifierConfig,Vb as createBashPrefixExtractor,kp as createBuiltinToolDefinition,Fa as createCircuitBreaker,Cb as createCodingMemoryInterventionRunner,Qt as createCodingWorkflowBackend,et as createCompactionAntiThrashState,vm as createCtxProxy,F as createCustomProvider,Cx as createDefaultCodingAgent,Db as createDenialTracker,pp as createExtensionRuntime,Ft as createExternalActorTurnExecutor,Eo as createFileArtifactFromPath,jo as createHandoff,Do as createImageArtifactFromPath,ko as createInMemorySession,vb as createKodaXTaskRunner,Et as createLocalCodingActorControl,Yo as createMcpCapabilityId,kr as createMcpManager,fr as createMcpTransport,$ as createOutputSegmentProjection,Qr as createProductionLearningReviewer,Kp as createPromptSection,ut as createReasoningPlan,jx as createRunGraphWriter,$p as createRuntimeContextBudgetSnapshot,Ya as createSessionControl,vr as createSessionLineage,Nb as createToolResultTruncationGuardrail,Fo as createVideoArtifactFromPath,Zb as createWorkflowLifecycleController,oc as createWorkflowPatternTemplateModule,vx as createWorkflowRunManager,tb as decideWorkflowInvocation,hm as dedupeExtensionPathsByEntrypoint,Xo as defaultMcpCacheDir,qm as defaultPolicy,ax as deleteSavedWorkflow,Rr as deriveCodingMemoryIdentity,Vr as deriveCodingMemoryReviewIdentities,Km as disableSelfModify,xr as discoverAuthorizationServerMetadata,lm as discoverDefaultExtensions,km as discoverExtensionsInDirectory,jm as discoverExtensionsInDirectoryDetailed,Zm as discoverMarkdownAgents,ar as discoverOAuthEndpoints,tr as discoverProtectedResourceMetadata,ex as discoverSavedWorkflows,Tr as drainCodingMemoryReviewInbox,Nf as drainPendingSwaps,ro as effectiveOutputSegmentText,b as effortToLegacyReasoningMode,Jb as emitVerdict,sx as emitWorkflowAgentDigest,Uo as enqueueWithArtifacts,op as ensureBuiltinRepoExplorerAgent,go as estimateTokens,_p as estimateToolSchemaTokens,ja as evaluateAutoRulesCall,jt as evaluateProviderPolicy,im as excludeExtensionPathsByEntrypoint,am as exec,mm as executeRunScopedTool,Ap as executeTool,sr as extractArtifactLedger,Ub as extractCommandPrefix,Zp as extractComparableUserMessageText,vf as extractHtmlTitle,pr as extractInsufficientScope,_x as extractPathsFromCommand,Yp as extractPromptComparableText,mr as extractResourceMetadataUrl,Kr as extractTitleFromMessages,Oa as fileSignalCollector,Af as finalizeRetrievalResult,Vm as findByVersion,Nx as findGitSubcommandIndex,Dr as findPreviousUserEntryId,Fx as flattenArgv,Gx as flattenRedirections,Fr as forkSessionLineage,Qp as formatAgentsForPrompt,yb as formatParallelDispatchResult,se as formatSize,Xx as generateSavePattern,Jr as generateSessionId,Ot as generateWorkflow,Pt as generateWorkflowFromOptions,xp as getActiveExtensionRuntime,uo as getAgentConfigHome,vo as getAgentConfigPath,np as getAllRegisteredTools,wo as getAppDataDir,W as getAvailableProviderNames,ta as getBashOutsideProjectWriteRisk,jp as getBuiltinRegisteredToolDefinition,ip as getBuiltinToolDefinition,ox as getBuiltinWorkflow,N as getCustomModelCapabilities,H as getCustomProvider,K as getCustomProviderList,M as getCustomProviderModelDescriptors,L as getCustomProviderModels,J as getCustomProviderNames,dm as getDefaultExtensionDirectory,Bt as getDefaultLspService,wx as getDefaultWorkflowRunManager,Hb as getDenialContext,Tx as getDirectShellBypassBlockReason,hf as getImpactEstimate,Op as getKodaxGlobalDir,or as getMcpCachePaths,C as getModelCapabilities,So as getModelInputCapabilities,cf as getModuleContext,ea as getPlanModeAllowedWritablePaths,xa as getPlanModeBlockReason,gf as getProcessContext,q as getProvider,w as getProviderConfiguredCapabilityProfile,v as getProviderConfiguredReasoningCapability,y as getProviderList,u as getProviderModel,B as getProviderModelDescriptors,z as getProviderModels,gp as getRegisteredToolDefinition,bf as getRepoIntelligenceIndex,Ve as getRepoOverview,jf as getRepoRoutingSignals,wp as getRequiredToolParams,Q as getRuntimeModelProvider,S as getRuntimeModelProviderNames,wr as getSessionLineagePath,yr as getSessionMessagesFromLineage,df as getSymbolContext,cp as getTool,dp as getToolDefinition,hp as getToolRegistrations,Me as getToolResultPolicy,$b as getWorkflowPatternTemplate,Ox as gitSignatureInspectionMayExecute,Rf as goalTokenDelta,pb as hasExplicitNaturalLanguageWorkflowIntent,Mf as hasPendingSwap,Bo as inferImageMediaType,aa as inferPermissionMode,nt as inferTaskType,Co as inferVideoMediaType,Ke as inspectEditFailure,xf as inspectRepoIntelligenceRuntime,Pr as installProductionLearningReviewer,$r as isAgentHomeHardMutationTarget,oe as isAgentHomeHardRemovalTarget,Yx as isAlwaysConfirmPath,Yr as isAutoReadableAgentHomePath,da as isAutoReadableKodaxPath,Xr as isAutoWritableAgentHomePath,ga as isAutoWritableKodaxPath,Sx as isBashReadCommand,oa as isBashReadCommandAutoAllowed,Ux as isBashWriteCommand,$x as isCommandOnProtectedPath,ca as isCredentialBearingKodaxPath,I as isCustomProviderName,Gb as isDeniedRecently,Rx as isHelpCommand,V as isKnownProvider,Dx as isNullDevice,wb as isParallelDispatchDirective,ra as isPathInsideProject,fa as isPlanModeAllowedPath,Lx as isPowerShellMutationCommand,_r as isProtectedAgentHomeMutationTarget,Zr as isProtectedAgentHomeReadTarget,re as isProtectedAgentHomeRemovalTarget,s as isProviderConfigured,A as isProviderName,R as isRuntimeModelProviderName,bt as isSessionRecoveryCandidateError,Qx as isShellReadOnlyArgv,cm as isSupportedExtensionModulePath,Wx as isToolCallAllowed,sp as isToolFileMutation,vp as isToolMutation,up as isToolNetworkRead,qp as isToolPlanModeAllowed,_f as isValidTokenBudget,wt as languageIdForPath,Wm as listAll,Z as listAllModelCapabilities,Sm as listArtifacts,D as listBuiltinModelCapabilities,lp as listBuiltinToolDefinitions,rx as listBuiltinWorkflows,Of as listCodingDispatchableAgents,Um as listConstructed,O as listCustomProviderModelCapabilities,om as listRunScopedTools,zp as listToolDefinitions,yp as listTools,_b as listWorkflowPatternTemplates,Pp as loadAgentsFiles,Xm as loadAgentsFromMarkdown,Sb as loadAutoRules,cx as loadGeneratedWorkflowFromRun,wm as loadHandler,Ym as loadMarkdownAgentScope,px as loadSavedWorkflow,mx as loadSavedWorkflowCapsule,dr as loadValidToken,em as lookupRunScopedTool,Qf as makeDisabledGoalToolsContext,a as mapLegacyReasoningModeToEffortIntent,Ep as maybeRunReferenceAwareToolOutputGc,Dp as maybeRunToolOutputGc,nb as mcpRootsFromWorkspace,ur as mergeArtifactLedger,Vt as mergeScopedReviewResults,fe as normalizeKodaXAgentMode,Zo as normalizeMcpCapabilityId,Io as normalizePastedImage,x as normalizeReasoningEffortValue,Ut as normalizeScopedReviewResult,me as normalizeShellExecutionContract,fx as normalizeWorkflowModule,Lp as orderPromptSections,Rt as parallelInvestigation,Vx as parseAllowedToolPattern,Rb as parseAutoRules,Ex as parseBashCommand,wa as parseClassifierOutput,Je as parseEditToolError,Px as parseGitGrepShortOption,Bm as parseLlmReviewVerdict,_o as parseMcpCapabilityId,Pa as parseModelSpec,c as parseReasoningEffortEnv,te as parseSandboxEnvironmentPass,m as parseTimeoutSecEnvMs,xm as parseToolSearchQuery,Nt as parseWorkflowGeneration,cr as performOAuthLogin,No as persistImageAsBlock,ze as persistToolOutput,rt as planToolExposure,gx as preflightWorkflowCapsule,kf as prewarmRepoIntelligenceCaches,Gt as providerResilienceConfigFromTimeouts,Oo as prunePasteTmpDir,Ko as readAndNormalizeClipboardImage,Tm as readArtifact,Em as readAuditEntries,Gm as readBudget,Jo as readClipboardImage,Jm as readDisableState,Ta as readSpeculativeWindowFromEnv,Pb as readTrustState,lt as reasoningModeToDepth,dt as reconstructMessagesWithToolGuard,Ma as recordAutoModeAllow,La as recordAutoModeBlock,ab as recordBlockerAttempt,Ga as recordBreakerError,pt as recordCompactionSavings,Fb as recordDenial,oo as reduceOutputSegmentProjection,fb as registerCodingInvariants,kb as registerConfiguredMcpCapabilityProvider,G as registerCustomProviders,P as registerModelProvider,br as registerOAuthClient,sb as registerOfficialSandboxExtension,no as registerPresetDispatcher,bp as registerTool,Qm as rehydrateActiveArtifacts,Hm as remainingSelfModifyBudget,xx as renameSavedWorkflow,Ze as renderChangedScope,mf as renderImpactEstimate,rf as renderModuleContext,ff as renderProcessContext,Mp as renderPromptSections,We as renderRepoOverview,zf as renderRetrievalResult,ef as renderSymbolContext,lb as replaceConfiguredMcpCapabilityProvider,bx as replaceSavedWorkflow,yt as reportLspDiagnostics,bb as resetBlockerCounter,Im as resetBudget,Qa as resolveClassifierModel,Pf as resolveCodingDispatchableAgent,Lf as resolveConstructedAgent,gm as resolveExtensionEntrypoint,Ee as resolveKodaXManual,Y as resolveModelCapabilities,U as resolveProvider,X as resolveProviderModelDescriptors,d as resolveReasoningEffort,g as resolveReasoningEffortForModelSwitch,kt as resolveReasoningMode,tf as resolveRepoIntelligenceMode,pf as resolveRepoIntelligenceRuntimeConfig,xt as resolveResilienceConfig,zr as resolveSessionLineageTarget,$f as resolveToolBridgeTarget,ob as resolveToolCapability,ye as resolveToolOutputDir,_ as resolveWireEffort,Jt as resolveWorkflowGenerationTimeoutMs,Yb as resolveWorkflowIdentity,Rm as revoke,Er as rewindSessionLineage,rp as rollbackSelfModify,ym as runAstRules,Xa as runKodaX,Cm as runLlmReview,jb as runManagedTask,ub as runOrchestration,rm as runScopedToolMap,ux as runWorkflowFromOptions,qx as runWorkflowModule,ix as safeWorkflowArtifactName,tx as saveGeneratedWorkflow,dx as saveGeneratedWorkflowFromRun,_t as scopedReview,$o as searchMcpCatalog,tm as searchToolIndex,tp as setActiveExtensionRuntime,so as setAgentConfigHome,Ar as setSessionLineageActiveEntry,pe as shellExecutionContractFingerprint,Tf as shouldFlipBudgetLimited,ft as shouldSkipLlmCompaction,Ct as shutdownDefaultLspService,Ua as speculativeRace,Nm as stage,Za as startKodaX,yx as startManagedWorkflow,ya as stripAssistantText,uf as stripHtmlToText,Om as testArtifact,f as timeoutSecToMs,fm as toModelToolDefinition,Zx as tokenizeRawCommandStages,Se as toolAskUserQuestion,Oe as toolBash,of as toolChangedDiff,$e as toolChangedScope,Df as toolCodeSearch,Ie as toolEdit,Pe as toolGlob,Qe as toolGrep,sf as toolImpactEstimate,Le as toolInsertAfterAnchor,lf as toolModuleContext,rb as toolPermission,qf as toolProcessContext,Ae as toolRead,_e as toolRepoOverview,Ef as toolSemanticLookup,nf as toolSymbolContext,Re as toolUndo,Cf as toolWebFetch,Bf as toolWebSearch,He as toolWrite,ue as truncateHead,we as truncateLine,ve as truncateTail,Qb as trustProjectRules,Sf as turnWallTimeDelta,Vo as validateAndFixToolHistory,E as validateCustomProviderConfig,Kt as validateGeneratedWorkflowSource,To as validateInputArtifactsForModel,zb as validateSubtaskIndependence,zm as validateToolSchemaForProvider,hb as verifyGoalCompletion,bm as webhook,db as withGoalBeforeNextTurn,gb as withGoalStopHook,Ge as withManualToolBranding,Jf as workerAgent,xb as workflowStartOutcomeConsumesTurn,mc as writeReviewPackets};
|
package/dist/sdk-llm.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @kodax-ai/kodax — bundled distribution. See docs/ADR.md ADR-022 + ADR-024.
|
|
2
|
-
import{$,$a as or,A,Aa as Bo,B,Ba as Co,C,Ca as Do,D,Da as Eo,E,Ea as Fo,F,Fa as Go,G,Ga as Ho,H,Ha as Io,I,Ia as Jo,J,Ja as Ko,K,Ka as Lo,L,La as Mo,M,Ma as No,N,Na as Oo,O,Oa as Po,P,Pa as Qo,Q,Qa as Ro,R,Ra as So,S,Sa as To,T,Ta as Uo,U,Ua as Vo,V,Va as Wo,W,Wa as Xo,X,Xa as Yo,Y,Ya as Zo,Z,Za as _o,_,_a as $o,a as o,aa as oo,ab as rr,b as r,ba as ro,bb as er,c as e,ca as eo,cb as fr,d as f,da as fo,db as mr,e as m,ea as mo,eb as pr,f as p,fa as po,fb as tr,g as t,ga as to,gb as xr,h as x,ha as xo,i as a,ia as ao,j as b,ja as bo,k as c,ka as co,l as d,la as go,m as g,ma as ho,n as h,na as io,o as i,oa as jo,p as j,pa as ko,q as k,qa as lo,r as l,ra as no,s as n,sa as qo,t as q,ta as so,u as s,ua as uo,v as u,va as vo,w as v,wa as wo,x as w,xa as yo,y,ya as zo,z,za as Ao}from"./chunks/chunk-
|
|
2
|
+
import{$,$a as or,A,Aa as Bo,B,Ba as Co,C,Ca as Do,D,Da as Eo,E,Ea as Fo,F,Fa as Go,G,Ga as Ho,H,Ha as Io,I,Ia as Jo,J,Ja as Ko,K,Ka as Lo,L,La as Mo,M,Ma as No,N,Na as Oo,O,Oa as Po,P,Pa as Qo,Q,Qa as Ro,R,Ra as So,S,Sa as To,T,Ta as Uo,U,Ua as Vo,V,Va as Wo,W,Wa as Xo,X,Xa as Yo,Y,Ya as Zo,Z,Za as _o,_,_a as $o,a as o,aa as oo,ab as rr,b as r,ba as ro,bb as er,c as e,ca as eo,cb as fr,d as f,da as fo,db as mr,e as m,ea as mo,eb as pr,f as p,fa as po,fb as tr,g as t,ga as to,gb as xr,h as x,ha as xo,i as a,ia as ao,j as b,ja as bo,k as c,ka as co,l as d,la as go,m as g,ma as ho,n as h,na as io,o as i,oa as jo,p as j,pa as ko,q as k,qa as lo,r as l,ra as no,s as n,sa as qo,t as q,ta as so,u as s,ua as uo,v as u,va as vo,w as v,wa as wo,x as w,xa as yo,y,ya as zo,z,za as Ao}from"./chunks/chunk-BHE66SP3.js";import"./chunks/chunk-ONUPGMER.js";export{_o as DEFAULT_COST_RATES,d as KODAX_API_MIN_INTERVAL,b as KODAX_CAPPED_MAX_OUTPUT_TOKENS,ho as KODAX_DEFAULT_PROVIDER,w as KODAX_DEFAULT_THINKING_BUDGETS,c as KODAX_ESCALATED_MAX_OUTPUT_TOKENS,a as KODAX_MAX_TOKENS,go as KODAX_PROVIDERS,co as KODAX_PROVIDER_SNAPSHOTS,u as KODAX_REASONING_MODE_SEQUENCE,y as KODAX_REASONING_SAFETY_RESERVE,v as KODAX_STABLE_EFFORT_INTENTS,po as KodaXAcpProvider,fo as KodaXAnthropicCompatProvider,V as KodaXBaseProvider,f as KodaXError,t as KodaXNetworkError,mo as KodaXOpenAICompatProvider,m as KodaXProviderError,p as KodaXRateLimitError,x as KodaXToolCallIdError,P as WORKFLOW_MAX_CONCURRENCY_ABSOLUTE,O as WORKFLOW_MAX_CONCURRENCY_DEFAULT,n as addRejectedEffort,or as calculateCost,j as capabilityCacheKey,K as clampThinkingBudget,X as classifyStopReason,_ as classifyVerifyError,Po as clearRuntimeModelProviders,rr as createCostTracker,Ao as createCustomProvider,E as effortToLegacyReasoningMode,N as extractHeadersFromError,pr as formatCost,tr as formatCostReport,So as getAvailableProviderNames,to as getCodexCliDefaultModel,ao as getCodexCliKnownModels,$o as getCostRate,Io as getCustomModelCapabilities,Co as getCustomProvider,Fo as getCustomProviderList,Ho as getCustomProviderModelDescriptors,Go as getCustomProviderModels,Eo as getCustomProviderNames,I as getDefaultThinkingDepthForMode,xo as getGeminiCliDefaultModel,bo as getGeminiCliKnownModels,wo as getModelCapabilities,io as getProvider,no as getProviderConfiguredCapabilityProfile,lo as getProviderConfiguredReasoningCapability,To as getProviderCredentialEnvironmentNames,qo as getProviderList,ko as getProviderModel,vo as getProviderModelDescriptors,so as getProviderModels,z as getReasoningCapability,l as getRejectedEfforts,S as getRunScopedConfig,Lo as getRuntimeModelProvider,Oo as getRuntimeModelProviderCredentialEnvironmentNames,No as getRuntimeModelProviderNames,r as getScopedProviderCredential,mr as getSummary,$ as insertCacheBoundary,oo as isCacheBoundary,Y as isCleanStop,Do as isCustomProviderName,Ro as isKnownProvider,jo as isProviderConfigured,uo as isProviderName,A as isReasoningEnabled,Mo as isRuntimeModelProviderName,Wo as listAllModelCapabilities,yo as listBuiltinModelCapabilities,Jo as listCustomProviderModelCapabilities,Yo as listProviderModels,ro as lowerCacheBoundaries,L as mapDepthToOpenAIReasoningEffort,D as mapLegacyReasoningModeToEffortIntent,k as narrowReasoningProfile,U as normalizeCapabilityProfile,C as normalizeReasoningEffortValue,B as normalizeReasoningRequest,F as parseReasoningEffortEnv,M as parseRetryAfter,h as parseTimeoutSecEnvMs,W as parseToolInputWithSalvage,er as recordRetry,fr as recordUsage,e as redactScopedProviderCredential,Bo as registerCustomProviders,Ko as registerModelProvider,q as removeCacheEntry,i as resolveLlmTimeoutConfig,Vo as resolveModelCapabilities,T as resolvePromptCacheDisabled,Qo as resolveProvider,Uo as resolveProviderModelDescriptors,G as resolveReasoningEffort,H as resolveReasoningEffortForModelSwitch,J as resolveThinkingBudget,Zo as resolveWireEffort,Q as resolveWorkflowMaxConcurrency,Z as runVerifyCredential,o as runWithProviderCredential,R as runWithScopedConfig,s as sanitizeCapabilityCache,xr as sideQuery,eo as stripCacheBoundaries,g as timeoutSecToMs,zo as validateCustomProviderConfig,Xo as verifyProviderCredential};
|
package/dist/sdk-repl.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @kodax-ai/kodax — bundled distribution. See docs/ADR.md ADR-022 + ADR-024.
|
|
2
|
-
import{$ as ee,$a as en,$b as nr,A as dt,Aa as ke,Ab as Nn,B as lt,Ba as Ne,Bb as Sn,C as pt,Ca as Se,Cb as Un,D as ut,Da as Ue,Db as _n,E as ft,Ea as _e,Eb as vn,F as gt,Fa as ve,Fb as An,G as Ct,Ga as Ae,Gb as On,H as xt,Ha as Oe,Hb as Fn,I as yt,Ia as Fe,Ib as Ln,J as Kt,Ja as Le,Jb as $n,K as Xt,Ka as $e,Kb as Tn,L as bt,La as Te,Lb as In,M as jt,Ma as Ie,Mb as Wn,N as Rt,Na as We,Nb as En,O as kt,Oa as Ee,Ob as qn,P as Nt,Pa as qe,Pb as zn,Q as zo,Qa as ze,Qb as Bn,R as Bo,Ra as Be,Rb as Gn,S as Go,Sa as Ge,Sb as Hn,T as Ho,Ta as He,Tb as Jn,U as Jo,Ua as Je,Ub as Qn,V as Qo,Va as Qe,Vb as Vn,W as Vo,Wa as Ve,Wb as Yn,X as Yo,Xa as Ye,Xb as Zn,Y as Zo,Ya as Ze,Yb as tr,Z as te,Za as tn,Zb as or,_ as oe,_a as on,_b as er,a as L,aa as ne,ab as nn,ac as rr,b as $,ba as re,bb as rn,bc as mr,c as T,ca as me,cb as mn,cc as ar,d as I,da as ae,db as an,dc as ir,e as W,ea as ie,eb as sn,ec as sr,f as E,fa as se,fb as cn,fc as cr,g as q,ga as ce,gb as dn,gc as dr,h as z,ha as de,hb as ln,hc as lr,i as B,ia as le,ib as pn,ic as pr,j as G,ja as pe,jb as un,jc as ur,k as H,ka as ue,kb as fn,l as J,la as fe,lb as gn,m as Q,ma as ge,mb as Cn,n as V,na as Ce,nb as xn,o as Y,oa as xe,ob as yn,p as Z,pa as ye,pb as Kn,q as tt,qa as Ke,qb as Xn,r as ot,ra as Xe,rb as bn,s as et,sa as be,sb as hn,t as nt,ta as he,tb as Dn,u as rt,ua as De,ub as wn,v as mt,va as we,vb as Mn,w as at,wa as Me,wb as Pn,x as it,xa as Pe,xb as jn,y as st,ya as je,yb as Rn,z as ct,za as Re,zb as kn}from"./chunks/chunk-
|
|
2
|
+
import{$ as ee,$a as en,$b as nr,A as dt,Aa as ke,Ab as Nn,B as lt,Ba as Ne,Bb as Sn,C as pt,Ca as Se,Cb as Un,D as ut,Da as Ue,Db as _n,E as ft,Ea as _e,Eb as vn,F as gt,Fa as ve,Fb as An,G as Ct,Ga as Ae,Gb as On,H as xt,Ha as Oe,Hb as Fn,I as yt,Ia as Fe,Ib as Ln,J as Kt,Ja as Le,Jb as $n,K as Xt,Ka as $e,Kb as Tn,L as bt,La as Te,Lb as In,M as jt,Ma as Ie,Mb as Wn,N as Rt,Na as We,Nb as En,O as kt,Oa as Ee,Ob as qn,P as Nt,Pa as qe,Pb as zn,Q as zo,Qa as ze,Qb as Bn,R as Bo,Ra as Be,Rb as Gn,S as Go,Sa as Ge,Sb as Hn,T as Ho,Ta as He,Tb as Jn,U as Jo,Ua as Je,Ub as Qn,V as Qo,Va as Qe,Vb as Vn,W as Vo,Wa as Ve,Wb as Yn,X as Yo,Xa as Ye,Xb as Zn,Y as Zo,Ya as Ze,Yb as tr,Z as te,Za as tn,Zb as or,_ as oe,_a as on,_b as er,a as L,aa as ne,ab as nn,ac as rr,b as $,ba as re,bb as rn,bc as mr,c as T,ca as me,cb as mn,cc as ar,d as I,da as ae,db as an,dc as ir,e as W,ea as ie,eb as sn,ec as sr,f as E,fa as se,fb as cn,fc as cr,g as q,ga as ce,gb as dn,gc as dr,h as z,ha as de,hb as ln,hc as lr,i as B,ia as le,ib as pn,ic as pr,j as G,ja as pe,jb as un,jc as ur,k as H,ka as ue,kb as fn,l as J,la as fe,lb as gn,m as Q,ma as ge,mb as Cn,n as V,na as Ce,nb as xn,o as Y,oa as xe,ob as yn,p as Z,pa as ye,pb as Kn,q as tt,qa as Ke,qb as Xn,r as ot,ra as Xe,rb as bn,s as et,sa as be,sb as hn,t as nt,ta as he,tb as Dn,u as rt,ua as De,ub as wn,v as mt,va as we,vb as Mn,w as at,wa as Me,wb as Pn,x as it,xa as Pe,xb as jn,y as st,ya as je,yb as Rn,z as ct,za as Re,zb as kn}from"./chunks/chunk-SMVC3Q3U.js";import{A as So,B as Uo,Ba as To,Ca as Io,Da as Wo,Ea as Eo,Fa as qo,M as _o,N as vo,O as Ao,P as Oo,Q as Fo,V as Lo,W as $o,a as ht,b as Dt,c as wt,d as Mt,e as Pt,f as St,i as Ut,k as _t,l as vt,m as At,n as bo,o as ho,p as Do,q as wo,r as Mo,s as Po,t as jo,v as Ro,w as ko,y as No}from"./chunks/chunk-3YOZIFSJ.js";import{$ as xo,O as ao,P as io,Q as so,R as co,S as lo,T as po,U as uo,X as fo,Y as go,_ as Co,aa as yo,b as Ot,c as Ft,ca as Ko,d as Lt,e as $t,f as Tt,g as It,ga as Xo,h as Wt,i as Et,j as qt,k as zt,l as Bt,m as Gt,n as Ht,o as Jt,p as Qt,q as Vt,r as Yt,s as Zt,t as to,u as oo,w as eo,x as no,y as ro,z as mo}from"./chunks/chunk-HLZWPB32.js";import"./chunks/chunk-GRWUC6H7.js";import"./chunks/chunk-4BY53JTF.js";import"./chunks/chunk-XTWIGVUL.js";import{Bb as U,Cb as _,Db as v,Gb as A,Ib as O,Jb as F,hb as P,sb as j,ub as R,wb as k,xb as N,yb as S}from"./chunks/chunk-JJ2YDBSN.js";import"./chunks/chunk-7QBWHCIZ.js";import"./chunks/chunk-PRASABCC.js";import"./chunks/chunk-JTZKC4TV.js";import"./chunks/chunk-GH3KBC2H.js";import"./chunks/chunk-YVG6OKN7.js";import"./chunks/chunk-BHE66SP3.js";import{t as x}from"./chunks/chunk-7XSZVOG7.js";import"./chunks/chunk-QFV6YCIH.js";import{a}from"./chunks/chunk-ONUPGMER.js";import u from"fs/promises";import i from"path";import K from"os";import{pathToFileURL as X}from"node:url";var f=i.join(K.homedir(),".kodax","commands");function b(){return f}a(b,"getDefaultCommandDir");function h(n){let t=i.extname(n);if(t!==".js"&&t!==".ts")throw new Error(`Unsupported programmable command module extension: ${t||"<none>"}.`);return X(i.resolve(n))}a(h,"resolveProgrammableCommandModuleUrl");async function D(n){let t=new Map,e=n??f;try{await u.mkdir(e,{recursive:!0});let r=await u.readdir(e);for(let o of r){let s=i.extname(o),g=o.replace(s,"");if(s===".md"){try{let m=await u.readFile(i.join(e,o),"utf-8"),l=(m.split(`
|
|
3
3
|
`)[0]?.replace(/^#\s*/,"").trim()??"").slice(0,60)||"(prompt command)";t.set(g,{name:g,description:l,content:m,type:"prompt"})}catch{}continue}if(s===".js"||s===".ts"){let m=i.join(e,o);try{let l=await import(h(m).href);for(let[C,p]of Object.entries(l))if(C.startsWith("command_")&&typeof p=="function"){let c=C.replace("command_",""),y=p.description??c;t.set(c,{name:c,description:String(y).slice(0,60),content:`[Programmable command: ${c}]`,type:"programmable",execute:p})}}catch(d){x({source:"cli:commands",level:"warn",message:s===".ts"?`Failed to load TypeScript programmable command ${m}; enable a TypeScript loader or compile it to .js.`:`Failed to load programmable command module ${m}.`,detail:d})}}}}catch{}return t}a(D,"loadCommands");async function w(n,t,e,r){let o=e.get(n);return o?o.type==="prompt"?t?o.content.replace(/{args}/g,t):o.content:o.type==="programmable"&&o.execute?o.execute({args:t,runAgent:r}):null:null}a(w,"processCommandCall");function M(n){if(!n.startsWith("/"))return null;let t=n.slice(1).trim();if(!t)return null;let e=t.search(/\s/);if(e===-1)return[t];let r=t.slice(0,e),o=t.slice(e).trim();return o?[r,o]:[r]}a(M,"parseCommandCall");export{ce as App,zo as AutocompleteContextProvider,Io as BUILTIN_COMMANDS,ve as BackgroundTaskBar,Ot as CONFIG_TEMPLATES,Oe as ChildActivitySurface,vn as ConsoleCapturer,gn as ConversationPageCacheCapacityError,Lt as CoreConfigWriteConflictError,Pt as DEFAULT_UI_STATE,ke as DialogSurface,te as DotsIndicator,P as FILE_MODIFICATION_TOOLS,xn as FileSessionStorage,le as FullscreenTranscriptLayout,re as HistoryItemRenderer,Vo as InputPrompt,It as IntegrationConfigConflictError,Qt as IntegrationConfigController,f as KODAX_COMMANDS_DIR,Zt as KODAX_CONFIG_FILE,Vt as KODAX_DIR,co as KODAX_EXAMPLE_CONFIG_FILE,lo as KODAX_INTEGRATION_EXAMPLE_FILES,Yt as KODAX_SESSIONS_DIR,ro as KODAX_VERSION,Nt as KeyMatchers,Mt as KeypressHandlerPriority,yt as KeypressParser,Rt as KeypressProvider,Z as LRUCache,ne as LoadingIndicator,Ye as MemorySessionStorage,pe as MessageActions,me as MessageList,ue as MessageSelector,Se as NotificationsSurface,St as PERMISSION_MODES,to as PREVIEW_MAX_LENGTH,Pn as PendingInputsIndicator,oe as ProgressIndicator,ge as PromptComposer,ye as PromptFooter,Ce as PromptFooterLeftSide,xe as PromptFooterRightSide,Ke as PromptHelpMenu,Re as PromptSuggestionsSurface,bo as ProviderSetupConfigConflictError,ho as ProviderSetupInvalidConfigError,Ne as QueuedCommandsSurface,Ge as RUNTIME_PERMISSION_PENDING_NOTICE,Cn as SessionReadError,de as SimpleApp,Yo as SimpleInputPrompt,ae as SimpleMessageDisplay,se as SimpleStatusBar,Ct as SingleLineTextInput,Zo as Spinner,_e as StashNotice,ie as StatusBar,Ue as StatusNoticesSurface,Le as StreamingProvider,ht as StreamingState,je as SuggestionsDisplay,wt as TOOL_STATUS_ICONS,Jo as TextBuffer,gt as TextInput,ee as ThinkingIndicator,wn as ToolCallDisplay,Dt as ToolCallStatus,Mn as ToolGroup,Dn as ToolProgressBar,hn as ToolStatusBadge,fe as TranscriptViewport,De as UIStateProvider,Be as _resetQueuedPromptsCacheForTests,rr as appendClientNotice,dr as archiveSession,Ve as bootstrapAutoMode,ct as calculateVisualCursorFromLayout,st as calculateVisualLayout,A as collectBashWriteTargets,Jn as compactSession,_t as computeConfirmTools,or as conversationHistoryFromCapture,$t as coreConfigWriteLockPath,Xn as createCliEvents,un as createConversationEntryChain,be as createHistoryItem,Je as createInteractiveContext,bn as createJsonEvents,Ee as createKeyMatcher,jt as createKeypressManager,Ze as createMemorySessionStorage,cn as createRecoveryHistoryItem,an as createRetryHistoryItem,fn as createSessionConversationHistoryRevision,ur as createSessionManager,Fe as createStreamingManager,he as createToolCall,dt as darkTheme,Hn as dedupeSessions,cr as deleteSession,_n as detectTerminalCapabilities,z as detectTerminalHostProfile,q as detectTerminalRenderHost,dn as emitRecoveryHistoryItem,sn as emitRetryHistoryItem,ln as emptyConversationEntryChain,uo as ensureExampleConfigFile,po as ensureExampleConfigFiles,qo as executeCommand,tn as executeShellCommand,nr as exportSessionBundle,pn as extendConversationEntryChain,Ao as extractHistorySeedsFromMessage,Oo as extractHistorySeedsFromMessages,Fo as extractTextContent,Lo as extractTitle,mn as findMostRecentResumableSession,mr as forkSession,$o as formatMessagePreview,Xe as generateId,N as generateSavePattern,O as getBashOutsideProjectWriteRisk,nt as getCharAtCodePoint,tt as getCodePointLength,Wo as getCommandRegistry,Ft as getConfigTemplate,Tn as getCustomProviderConfig,b as getDefaultCommandDir,Ko as getGitRoot,bt as getKeyDisplayName,qn as getMcpServerConfig,F as getPlanModeBlockReason,ao as getProviderList,mo as getProviderModel,Do as getProviderSetupCatalog,Q as getTerminalHostCapabilities,Sn as getTerminalWidth,ut as getTheme,ft as getThemeNames,no as getVersion,et as getVisualWidth,it as getVisualWidthCached,$ as hasCursorUpViewportYankRisk,I as hasMainScreenRenderScrollRisk,oo as hydrateProcessEnvFromShell,jo as initializeSetupConfiguration,wo as inspectProviderSetupReadiness,S as isAlwaysConfirmPath,j as isBashReadCommand,_ as isBashReadCommandAutoAllowed,R as isBashWriteCommand,Y as isClassicReplForced,U as isCommandOnProtectedPath,Kt as isFunctionKey,V as isOwnedRendererPreferred,v as isPathInsideProject,vt as isPermissionMode,Xt as isPrintable,io as isProviderConfigured,T as isRemoteConptyHost,Un as isScreenReader,on as isShellCommand,en as isShellCommandSuccess,W as isTmuxControlMode,k as isToolCallAllowed,L as isVsCodeTerminalHostEnv,ot as isWideChar,$n as listCustomProviders,En as listMcpServers,To as listRegisteredCommands,sr as listRunningSessions,Qn as listSessions,So as loadAutoModeSettings,D as loadCommands,so as loadConfig,Yn as loadFullTranscript,Vn as loadSession,Ae as measureChildActivitySurfaceRows,Ht as migrateLegacyIntegrationConfig,lt as minimalTheme,At as normalizePermissionMode,Eo as parseCommand,M as parseCommandCall,Et as parseExtensionsIntegrationDocument,xt as parseKeypress,Wt as parseMcpIntegrationDocument,Ut as permissionModeDisplayName,Mo as persistProviderSetupChoice,Gt as planLegacyIntegrationMigration,fo as prepareRuntimeConfig,w as processCommandCall,Ln as processSpecialSyntax,Po as providerSetupRestartInstructions,Xo as rateLimitedCall,tr as readConversationHistory,Bt as readExtensionsIntegration,Zn as readFullTranscript,zt as readMcpIntegration,er as readSessionCapture,eo as registerConfiguredCustomProviders,Wn as removeCustomProvider,Bn as removeMcpServer,Ro as renderSetupGuide,No as replBashPathSignalCollector,E as resetTmuxControlModeProbeForTesting,Uo as resolveAutoModeSettings,B as resolveConfiguredTuiRendererMode,G as resolveEffectiveTuiRendererMode,J as resolveFullscreenPolicy,qt as resolveIntegrationConfigPath,H as resolveInteractiveSurfacePreference,yo as resolveRuntimeEffortSelection,xo as resolveRuntimeModelSelection,Co as resolveRuntimeProviderSelection,rn as restoreHistoryItemsFromSession,ar as rewindSession,yn as runInkInteractiveMode,Fn as runInteractiveMode,ko as runProviderSetupWizard,Kn as runSessionPicker,go as saveConfig,_o as seedToHistoryItem,ir as setActiveEntry,rt as splitByCodePoints,Rn as supports256Colors,Nn as supportsEmoji,jn as supportsTrueColor,kn as supportsUnicode,pt as themes,He as toReplRuntimeAutoModeSettings,vo as toolCallSeedToHistoryToolCall,Qe as touchContext,nn as trimPersistedUiHistorySnapshot,mt as truncateByVisualWidth,lr as unarchiveSession,In as upsertCustomProvider,zn as upsertMcpServer,Go as useAutocomplete,Bo as useAutocompleteContext,Ho as useInputHistory,We as useKeypress,kt as useKeypressManager,ze as useQueuedPromptContents,qe as useQueuedPrompts,Ie as useStreaming,Te as useStreamingActions,$e as useStreamingState,Qo as useTextBuffer,Pe as useUI,Me as useUIActions,we as useUIState,Gn as validateMcpServerConfig,at as visualWidthCache,pr as watchSessions,An as withCapture,On as withCaptureSync,Tt as withCoreConfigWriteLock,Jt as writeIntegrationDocument};
|
package/dist/sdk-runtime.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @kodax-ai/kodax — bundled distribution. See docs/ADR.md ADR-022 + ADR-024.
|
|
2
|
-
import{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y}from"./chunks/chunk-
|
|
2
|
+
import{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y}from"./chunks/chunk-D27EY4XC.js";import"./chunks/chunk-A3ZQE2BX.js";import"./chunks/chunk-SMVC3Q3U.js";import"./chunks/chunk-3YOZIFSJ.js";import"./chunks/chunk-HLZWPB32.js";import"./chunks/chunk-GRWUC6H7.js";import"./chunks/chunk-4BY53JTF.js";import"./chunks/chunk-XTWIGVUL.js";import"./chunks/chunk-JJ2YDBSN.js";import"./chunks/chunk-7QBWHCIZ.js";import"./chunks/chunk-PRASABCC.js";import"./chunks/chunk-JTZKC4TV.js";import"./chunks/chunk-GH3KBC2H.js";import"./chunks/chunk-YVG6OKN7.js";import"./chunks/chunk-BHE66SP3.js";import"./chunks/chunk-7XSZVOG7.js";import"./chunks/chunk-QFV6YCIH.js";import"./chunks/chunk-ONUPGMER.js";export{b as KODAX_DAEMON_PROTOCOL,c as KODAX_DAEMON_PROTOCOL_VERSION,t as KODAX_RUNTIME_SDK_CAPABILITIES,d as RUNTIME_DAEMON_METHODS,g as RUNTIME_DAEMON_METHOD_SCHEMAS,h as RUNTIME_DAEMON_NOTIFICATION_SCHEMAS,i as RUNTIME_DAEMON_PROTOCOL_SCHEMA,j as RUNTIME_DAEMON_PROTOCOL_SCHEMA_JSON,n as RuntimeAutoModeConfigurationError,m as RuntimeDaemonCapabilityUpgradeError,f as RuntimePermissionScopeUpgradeRequiredError,e as RuntimeTransportBoundaryError,o as acquireKodaXInlineOwner,v as captureRuntimeSessionDiagnostics,x as connectKodaXRuntime,w as createKodaXRuntime,r as enableKodaXDaemonOwner,p as getKodaXRuntimeOwnerPolicy,q as getKodaXRuntimeOwnerState,u as handleRuntimePermissionRequest,k as listRuntimeDaemonSchemaMethods,a as parseRuntimeEvent,s as setKodaXRuntimeOwnerMode,y as settleKodaXRuntimeExit,l as waitForRuntimeDaemonShutdown};
|
package/dist/sdk-sandbox.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @kodax-ai/kodax — bundled distribution. See docs/ADR.md ADR-022 + ADR-024.
|
|
2
|
-
import"./chunks/chunk-5BNQXXGY.js";import{a,b,
|
|
2
|
+
import"./chunks/chunk-5BNQXXGY.js";import{a,b,h as c,i as d,j as e,k as f,l as g}from"./chunks/chunk-A3ZQE2BX.js";import"./chunks/chunk-4BY53JTF.js";import"./chunks/chunk-XTWIGVUL.js";import"./chunks/chunk-JJ2YDBSN.js";import"./chunks/chunk-7QBWHCIZ.js";import"./chunks/chunk-PRASABCC.js";import"./chunks/chunk-JTZKC4TV.js";import"./chunks/chunk-GH3KBC2H.js";import"./chunks/chunk-YVG6OKN7.js";import"./chunks/chunk-BHE66SP3.js";import"./chunks/chunk-7XSZVOG7.js";import"./chunks/chunk-QFV6YCIH.js";import"./chunks/chunk-ONUPGMER.js";export{a as KODAX_ASRT_VERSION,f as activateKodaXSandbox,c as doctorKodaXSandbox,b as getKodaXSandboxCapability,e as getKodaXSandboxSetupGuidance,g as runKodaXSandboxed,d as setupKodaXSandbox};
|
package/dist/sdk-session.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @kodax-ai/kodax — bundled distribution. See docs/ADR.md ADR-022 + ADR-024.
|
|
2
|
-
import{$b as l,Tb as n,Ub as t,Vb as r,Wb as a,Xb as S,Yb as d,ac as p,bb as o,bc as u,cc as y,dc as c,ec as m,fc as H,gc as C,hc as T,ic as x,jc as R,mb as i}from"./chunks/chunk-
|
|
2
|
+
import{$b as l,Tb as n,Ub as t,Vb as r,Wb as a,Xb as S,Yb as d,ac as p,bb as o,bc as u,cc as y,dc as c,ec as m,fc as H,gc as C,hc as T,ic as x,jc as R,mb as i}from"./chunks/chunk-SMVC3Q3U.js";import{O as s,P as e}from"./chunks/chunk-3YOZIFSJ.js";import"./chunks/chunk-HLZWPB32.js";import"./chunks/chunk-GRWUC6H7.js";import"./chunks/chunk-4BY53JTF.js";import"./chunks/chunk-XTWIGVUL.js";import"./chunks/chunk-JJ2YDBSN.js";import"./chunks/chunk-7QBWHCIZ.js";import"./chunks/chunk-PRASABCC.js";import"./chunks/chunk-JTZKC4TV.js";import"./chunks/chunk-GH3KBC2H.js";import"./chunks/chunk-YVG6OKN7.js";import"./chunks/chunk-BHE66SP3.js";import"./chunks/chunk-7XSZVOG7.js";import"./chunks/chunk-QFV6YCIH.js";import"./chunks/chunk-ONUPGMER.js";export{i as SessionReadError,p as appendClientNotice,C as archiveSession,n as compactSession,R as createSessionManager,H as deleteSession,l as exportSessionBundle,s as extractHistorySeedsFromMessage,e as extractHistorySeedsFromMessages,u as forkSession,m as listRunningSessions,t as listSessions,a as loadFullTranscript,r as loadSession,d as readConversationHistory,S as readFullTranscript,o as restoreHistoryItemsFromSession,y as rewindSession,c as setActiveEntry,T as unarchiveSession,x as watchSessions};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kodax-ai/kodax",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.93",
|
|
4
4
|
"description": "KodaX lightweight coding agent - TypeScript implementation with 16 built-in LLM provider aliases, published as a Node-free single-file CLI and SDK",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"private": false,
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @kodax-ai/kodax — bundled distribution. See docs/ADR.md ADR-022 + ADR-024.
|
|
2
|
-
import{Ha as a,Ia as b}from"./chunk-PKPBII4F.js";import"./chunk-5CIKWSCA.js";import"./chunk-GRWUC6H7.js";import"./chunk-OSQIYUGD.js";import"./chunk-THZVJ6R7.js";import"./chunk-RJIYXB62.js";import"./chunk-X75UGXP3.js";import"./chunk-QPBN3J4E.js";import"./chunk-AGZNXFHZ.js";import"./chunk-GH3KBC2H.js";import"./chunk-YVG6OKN7.js";import"./chunk-FBL7IVMK.js";import"./chunk-7XSZVOG7.js";import"./chunk-QFV6YCIH.js";import"./chunk-ONUPGMER.js";export{a as ArgumentCompleter,b as createArgumentCompleter};
|