stitchkit 0.126.0 → 0.127.0
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 +1636 -0
- package/README.md +12 -4
- package/dist/agent-executor/acp/scenarios.d.ts +4 -0
- package/dist/agent-executor/acp/scenarios.d.ts.map +1 -0
- package/dist/agent-executor/acp/v1-connect.d.ts +89 -0
- package/dist/agent-executor/acp/v1-connect.d.ts.map +1 -0
- package/dist/agent-executor/acp/v1-driver.d.ts +31 -0
- package/dist/agent-executor/acp/v1-driver.d.ts.map +1 -0
- package/dist/agent-executor/acp/v1-map.d.ts +41 -0
- package/dist/agent-executor/acp/v1-map.d.ts.map +1 -0
- package/dist/agent-executor/acp/v1-protocol.d.ts +270 -0
- package/dist/agent-executor/acp/v1-protocol.d.ts.map +1 -0
- package/dist/agent-executor/acp/v1-session.d.ts +22 -0
- package/dist/agent-executor/acp/v1-session.d.ts.map +1 -0
- package/dist/agent-executor/acp/v1-turn.d.ts +25 -0
- package/dist/agent-executor/acp/v1-turn.d.ts.map +1 -0
- package/dist/agent-executor/claude/classify.d.ts +54 -0
- package/dist/agent-executor/claude/classify.d.ts.map +1 -0
- package/dist/agent-executor/claude/cli-driver.d.ts +27 -0
- package/dist/agent-executor/claude/cli-driver.d.ts.map +1 -0
- package/dist/agent-executor/claude/limits.d.ts +8 -0
- package/dist/agent-executor/claude/limits.d.ts.map +1 -0
- package/dist/agent-executor/claude/protocol.d.ts +188 -0
- package/dist/agent-executor/claude/protocol.d.ts.map +1 -0
- package/dist/agent-executor/claude/scenarios.d.ts +4 -0
- package/dist/agent-executor/claude/scenarios.d.ts.map +1 -0
- package/dist/agent-executor/claude/session.d.ts +22 -0
- package/dist/agent-executor/claude/session.d.ts.map +1 -0
- package/dist/agent-executor/claude/transcript.d.ts +33 -0
- package/dist/agent-executor/claude/transcript.d.ts.map +1 -0
- package/dist/agent-executor/claude-sdk/driver.d.ts +31 -0
- package/dist/agent-executor/claude-sdk/driver.d.ts.map +1 -0
- package/dist/agent-executor/claude-sdk/session.d.ts +10 -0
- package/dist/agent-executor/claude-sdk/session.d.ts.map +1 -0
- package/dist/agent-executor/codex/classify.d.ts +28 -0
- package/dist/agent-executor/codex/classify.d.ts.map +1 -0
- package/dist/agent-executor/codex/driver.d.ts +23 -0
- package/dist/agent-executor/codex/driver.d.ts.map +1 -0
- package/dist/agent-executor/codex/limits.d.ts +4 -0
- package/dist/agent-executor/codex/limits.d.ts.map +1 -0
- package/dist/agent-executor/codex/protocol.d.ts +152 -0
- package/dist/agent-executor/codex/protocol.d.ts.map +1 -0
- package/dist/agent-executor/codex/scenarios.d.ts +4 -0
- package/dist/agent-executor/codex/scenarios.d.ts.map +1 -0
- package/dist/agent-executor/codex/session.d.ts +41 -0
- package/dist/agent-executor/codex/session.d.ts.map +1 -0
- package/dist/agent-executor/contract.d.ts +454 -0
- package/dist/agent-executor/contract.d.ts.map +1 -0
- package/dist/agent-executor/dispatch.d.ts +41 -0
- package/dist/agent-executor/dispatch.d.ts.map +1 -0
- package/dist/agent-executor/engine-process.d.ts +45 -0
- package/dist/agent-executor/engine-process.d.ts.map +1 -0
- package/dist/agent-executor/engine-requests.d.ts +63 -0
- package/dist/agent-executor/engine-requests.d.ts.map +1 -0
- package/dist/agent-executor/engine.d.ts +64 -0
- package/dist/agent-executor/engine.d.ts.map +1 -0
- package/dist/agent-executor/executor-contract.d.ts +387 -0
- package/dist/agent-executor/executor-contract.d.ts.map +1 -0
- package/dist/agent-executor/executor-machine.d.ts +50 -0
- package/dist/agent-executor/executor-machine.d.ts.map +1 -0
- package/dist/agent-executor/hello.d.ts +235 -0
- package/dist/agent-executor/hello.d.ts.map +1 -0
- package/dist/agent-executor/json-rpc-peer.d.ts +48 -0
- package/dist/agent-executor/json-rpc-peer.d.ts.map +1 -0
- package/dist/agent-executor/leases.d.ts +159 -0
- package/dist/agent-executor/leases.d.ts.map +1 -0
- package/dist/agent-executor/plan-limits.d.ts +25 -0
- package/dist/agent-executor/plan-limits.d.ts.map +1 -0
- package/dist/agent-executor/profile.d.ts +52 -0
- package/dist/agent-executor/profile.d.ts.map +1 -0
- package/dist/agent-executor/projection.d.ts +14 -0
- package/dist/agent-executor/projection.d.ts.map +1 -0
- package/dist/agent-executor/session-primitives.d.ts +72 -0
- package/dist/agent-executor/session-primitives.d.ts.map +1 -0
- package/dist/agent-executor/testing/conformance.d.ts +55 -0
- package/dist/agent-executor/testing/conformance.d.ts.map +1 -0
- package/dist/agent-executor/testing/fake-claude-engine.d.ts +18 -0
- package/dist/agent-executor/testing/fake-claude-engine.d.ts.map +1 -0
- package/dist/agent-executor/testing/fake-engine.d.ts +52 -0
- package/dist/agent-executor/testing/fake-engine.d.ts.map +1 -0
- package/dist/agent-executor/turn-phases.d.ts +10 -0
- package/dist/agent-executor/turn-phases.d.ts.map +1 -0
- package/dist/agent-executor/vocabulary.d.ts +353 -0
- package/dist/agent-executor/vocabulary.d.ts.map +1 -0
- package/dist/agent-parts/parts.d.ts +160 -0
- package/dist/agent-parts/parts.d.ts.map +1 -0
- package/dist/agent-runtime/agent-tool.d.ts +1 -1
- package/dist/agent-runtime/agent-tool.d.ts.map +1 -1
- package/dist/agent-runtime/archive-projection.d.ts +5 -0
- package/dist/agent-runtime/archive-projection.d.ts.map +1 -1
- package/dist/agent-runtime/branch-contract.d.ts +59 -2
- package/dist/agent-runtime/branch-contract.d.ts.map +1 -1
- package/dist/agent-runtime/branch-events.d.ts +7 -0
- package/dist/agent-runtime/branch-events.d.ts.map +1 -1
- package/dist/agent-runtime/branch-identities.d.ts +40 -6
- package/dist/agent-runtime/branch-identities.d.ts.map +1 -1
- package/dist/agent-runtime/branch-messages.d.ts +11 -29
- package/dist/agent-runtime/branch-messages.d.ts.map +1 -1
- package/dist/agent-runtime/branch-observations.d.ts +138 -28
- package/dist/agent-runtime/branch-observations.d.ts.map +1 -1
- package/dist/agent-runtime/branch-provider.d.ts +32 -51
- package/dist/agent-runtime/branch-provider.d.ts.map +1 -1
- package/dist/agent-runtime/branch-refusal.d.ts +60 -0
- package/dist/agent-runtime/branch-refusal.d.ts.map +1 -0
- package/dist/agent-runtime/branch-runtime-tools.d.ts +14 -0
- package/dist/agent-runtime/branch-runtime-tools.d.ts.map +1 -0
- package/dist/agent-runtime/branch-source.d.ts +7 -2
- package/dist/agent-runtime/branch-source.d.ts.map +1 -1
- package/dist/agent-runtime/branch-transitions.d.ts.map +1 -1
- package/dist/agent-runtime/browser-control-contract.d.ts +2 -2
- package/dist/agent-runtime/browser-controller.d.ts.map +1 -1
- package/dist/agent-runtime/child-blocking.d.ts +17 -6
- package/dist/agent-runtime/child-blocking.d.ts.map +1 -1
- package/dist/agent-runtime/child-budget-policy.d.ts +4 -9
- package/dist/agent-runtime/child-budget-policy.d.ts.map +1 -1
- package/dist/agent-runtime/child-tools.d.ts +19 -8
- package/dist/agent-runtime/child-tools.d.ts.map +1 -1
- package/dist/agent-runtime/children-contract.d.ts +84 -3
- package/dist/agent-runtime/children-contract.d.ts.map +1 -1
- package/dist/agent-runtime/children-control.d.ts +23 -2
- package/dist/agent-runtime/children-control.d.ts.map +1 -1
- package/dist/agent-runtime/children-spawn.d.ts +9 -0
- package/dist/agent-runtime/children-spawn.d.ts.map +1 -1
- package/dist/agent-runtime/children-state.d.ts +121 -19
- package/dist/agent-runtime/children-state.d.ts.map +1 -1
- package/dist/agent-runtime/children-usage.d.ts +10 -1
- package/dist/agent-runtime/children-usage.d.ts.map +1 -1
- package/dist/agent-runtime/children.d.ts +3 -3
- package/dist/agent-runtime/children.d.ts.map +1 -1
- package/dist/agent-runtime/{sandbox-coding.d.ts → coding-sandbox.d.ts} +2 -9
- package/dist/agent-runtime/coding-sandbox.d.ts.map +1 -0
- package/dist/agent-runtime/coding-shell-process.d.ts +2 -0
- package/dist/agent-runtime/coding-shell-process.d.ts.map +1 -1
- package/dist/agent-runtime/coding-tool-contract.d.ts +32 -1
- package/dist/agent-runtime/coding-tool-contract.d.ts.map +1 -1
- package/dist/agent-runtime/coding-tool-shell.d.ts.map +1 -1
- package/dist/agent-runtime/coding-tools.d.ts.map +1 -1
- package/dist/agent-runtime/compaction.d.ts.map +1 -1
- package/dist/agent-runtime/companion-host.d.ts +38 -0
- package/dist/agent-runtime/companion-host.d.ts.map +1 -0
- package/dist/agent-runtime/context-issue.d.ts +5 -0
- package/dist/agent-runtime/context-issue.d.ts.map +1 -0
- package/dist/agent-runtime/control-schema.d.ts +2 -2
- package/dist/agent-runtime/control-schema.d.ts.map +1 -1
- package/dist/agent-runtime/conversations.d.ts.map +1 -1
- package/dist/agent-runtime/coordinator.d.ts.map +1 -1
- package/dist/agent-runtime/deferred-tool-types.d.ts +17 -5
- package/dist/agent-runtime/deferred-tool-types.d.ts.map +1 -1
- package/dist/agent-runtime/deferred-tools-internal.d.ts +2 -0
- package/dist/agent-runtime/deferred-tools-internal.d.ts.map +1 -1
- package/dist/agent-runtime/deferred-tools.d.ts.map +1 -1
- package/dist/agent-runtime/event-durability.d.ts +8 -0
- package/dist/agent-runtime/event-durability.d.ts.map +1 -0
- package/dist/agent-runtime/event-schema.d.ts +13 -5
- package/dist/agent-runtime/event-schema.d.ts.map +1 -1
- package/dist/agent-runtime/event-search-postgres.d.ts +38 -0
- package/dist/agent-runtime/event-search-postgres.d.ts.map +1 -0
- package/dist/agent-runtime/event-search-terms.d.ts +37 -0
- package/dist/agent-runtime/event-search-terms.d.ts.map +1 -0
- package/dist/agent-runtime/event-search-tools.d.ts +64 -4
- package/dist/agent-runtime/event-search-tools.d.ts.map +1 -1
- package/dist/agent-runtime/event-search.d.ts +16 -3
- package/dist/agent-runtime/event-search.d.ts.map +1 -1
- package/dist/agent-runtime/fault-bench.d.ts.map +1 -1
- package/dist/agent-runtime/harness-control.d.ts +8 -0
- package/dist/agent-runtime/harness-control.d.ts.map +1 -1
- package/dist/agent-runtime/harness-realtime.d.ts +0 -2
- package/dist/agent-runtime/harness-realtime.d.ts.map +1 -1
- package/dist/agent-runtime/invocation-read.d.ts.map +1 -1
- package/dist/agent-runtime/invocation-schema.d.ts +23 -0
- package/dist/agent-runtime/invocation-schema.d.ts.map +1 -1
- package/dist/agent-runtime/invocation-spend.d.ts +9 -0
- package/dist/agent-runtime/invocation-spend.d.ts.map +1 -0
- package/dist/agent-runtime/invocations.d.ts.map +1 -1
- package/dist/agent-runtime/managed-tools.d.ts +2 -2
- package/dist/agent-runtime/managed-tools.d.ts.map +1 -1
- package/dist/agent-runtime/observability.d.ts +42 -4
- package/dist/agent-runtime/observability.d.ts.map +1 -1
- package/dist/agent-runtime/openrouter-admission.d.ts +81 -0
- package/dist/agent-runtime/openrouter-admission.d.ts.map +1 -0
- package/dist/agent-runtime/openrouter-catalog.d.ts +83 -0
- package/dist/agent-runtime/openrouter-catalog.d.ts.map +1 -0
- package/dist/agent-runtime/openrouter-models.d.ts +66 -0
- package/dist/agent-runtime/openrouter-models.d.ts.map +1 -0
- package/dist/agent-runtime/openrouter-options.d.ts +106 -0
- package/dist/agent-runtime/openrouter-options.d.ts.map +1 -0
- package/dist/agent-runtime/openrouter-route.d.ts +50 -0
- package/dist/agent-runtime/openrouter-route.d.ts.map +1 -0
- package/dist/agent-runtime/openrouter-spend.d.ts +24 -0
- package/dist/agent-runtime/openrouter-spend.d.ts.map +1 -0
- package/dist/agent-runtime/openrouter.d.ts +23 -2
- package/dist/agent-runtime/openrouter.d.ts.map +1 -1
- package/dist/agent-runtime/owned-provider-stream.d.ts.map +1 -1
- package/dist/agent-runtime/postgres-schema.d.ts +34 -0
- package/dist/agent-runtime/postgres-schema.d.ts.map +1 -0
- package/dist/agent-runtime/postgres-transactions.d.ts +54 -0
- package/dist/agent-runtime/postgres-transactions.d.ts.map +1 -0
- package/dist/agent-runtime/postgres.d.ts +72 -0
- package/dist/agent-runtime/postgres.d.ts.map +1 -0
- package/dist/agent-runtime/projections.d.ts +57 -17
- package/dist/agent-runtime/projections.d.ts.map +1 -1
- package/dist/agent-runtime/provider-journal.d.ts +57 -0
- package/dist/agent-runtime/provider-journal.d.ts.map +1 -1
- package/dist/agent-runtime/purge.d.ts.map +1 -1
- package/dist/agent-runtime/retry-policy.d.ts +6 -0
- package/dist/agent-runtime/retry-policy.d.ts.map +1 -1
- package/dist/agent-runtime/run-acquisition.d.ts.map +1 -1
- package/dist/agent-runtime/run-execution-state.d.ts +26 -2
- package/dist/agent-runtime/run-execution-state.d.ts.map +1 -1
- package/dist/agent-runtime/run-execution.d.ts.map +1 -1
- package/dist/agent-runtime/run-failure.d.ts.map +1 -1
- package/dist/agent-runtime/run-model-attempts.d.ts.map +1 -1
- package/dist/agent-runtime/run-provider-ledger.d.ts +2 -0
- package/dist/agent-runtime/run-provider-ledger.d.ts.map +1 -1
- package/dist/agent-runtime/run-step-barriers.d.ts +72 -0
- package/dist/agent-runtime/run-step-barriers.d.ts.map +1 -0
- package/dist/agent-runtime/run-step-spend.d.ts +319 -0
- package/dist/agent-runtime/run-step-spend.d.ts.map +1 -0
- package/dist/agent-runtime/run-stream-parts.d.ts +2 -0
- package/dist/agent-runtime/run-stream-parts.d.ts.map +1 -1
- package/dist/agent-runtime/{tool-progress.d.ts → run-tool-progress.d.ts} +1 -1
- package/dist/agent-runtime/run-tool-progress.d.ts.map +1 -0
- package/dist/agent-runtime/run-turn-preparation.d.ts +3 -1
- package/dist/agent-runtime/run-turn-preparation.d.ts.map +1 -1
- package/dist/agent-runtime/runtime-admission-gate.d.ts +0 -14
- package/dist/agent-runtime/runtime-admission-gate.d.ts.map +1 -1
- package/dist/agent-runtime/runtime-internals.d.ts +6 -0
- package/dist/agent-runtime/runtime-internals.d.ts.map +1 -1
- package/dist/agent-runtime/runtime-state.d.ts.map +1 -1
- package/dist/agent-runtime/runtime.d.ts +31 -2
- package/dist/agent-runtime/runtime.d.ts.map +1 -1
- package/dist/agent-runtime/sandbox-binding.d.ts +10 -0
- package/dist/agent-runtime/sandbox-binding.d.ts.map +1 -0
- package/dist/agent-runtime/sandbox-bubblewrap-storage.d.ts.map +1 -1
- package/dist/agent-runtime/sandbox-contract.d.ts +1 -1
- package/dist/agent-runtime/sandbox-contract.d.ts.map +1 -1
- package/dist/agent-runtime/sandbox.d.ts +5 -0
- package/dist/agent-runtime/sandbox.d.ts.map +1 -1
- package/dist/agent-runtime/schedule-contract.d.ts +3 -2
- package/dist/agent-runtime/schedule-contract.d.ts.map +1 -1
- package/dist/agent-runtime/schedule-dispatch.d.ts +3 -2
- package/dist/agent-runtime/schedule-dispatch.d.ts.map +1 -1
- package/dist/agent-runtime/schedule-records.d.ts +6 -6
- package/dist/agent-runtime/schedule-records.d.ts.map +1 -1
- package/dist/agent-runtime/schedule-tools.d.ts +19 -8
- package/dist/agent-runtime/schedule-tools.d.ts.map +1 -1
- package/dist/agent-runtime/schedules.d.ts +13 -3
- package/dist/agent-runtime/schedules.d.ts.map +1 -1
- package/dist/agent-runtime/schemas-message.d.ts +118 -0
- package/dist/agent-runtime/schemas-message.d.ts.map +1 -0
- package/dist/agent-runtime/schemas-provider.d.ts +8 -0
- package/dist/agent-runtime/schemas-provider.d.ts.map +1 -0
- package/dist/agent-runtime/schemas-records.d.ts +5 -0
- package/dist/agent-runtime/schemas-records.d.ts.map +1 -0
- package/dist/agent-runtime/schemas-run.d.ts +487 -0
- package/dist/agent-runtime/schemas-run.d.ts.map +1 -0
- package/dist/agent-runtime/schemas-usage.d.ts +129 -0
- package/dist/agent-runtime/schemas-usage.d.ts.map +1 -0
- package/dist/agent-runtime/schemas.d.ts +11 -886
- package/dist/agent-runtime/schemas.d.ts.map +1 -1
- package/dist/agent-runtime/spill.d.ts +9 -7
- package/dist/agent-runtime/spill.d.ts.map +1 -1
- package/dist/agent-runtime/sql-events.d.ts +6 -0
- package/dist/agent-runtime/sql-events.d.ts.map +1 -0
- package/dist/agent-runtime/sql-history.d.ts +8 -0
- package/dist/agent-runtime/sql-history.d.ts.map +1 -0
- package/dist/agent-runtime/sql-ledger.d.ts +5 -0
- package/dist/agent-runtime/sql-ledger.d.ts.map +1 -0
- package/dist/agent-runtime/sql-purge.d.ts +13 -0
- package/dist/agent-runtime/sql-purge.d.ts.map +1 -0
- package/dist/agent-runtime/sql-reads.d.ts +16 -0
- package/dist/agent-runtime/sql-reads.d.ts.map +1 -0
- package/dist/agent-runtime/{sqlite-rows.d.ts → sql-rows.d.ts} +24 -10
- package/dist/agent-runtime/sql-rows.d.ts.map +1 -0
- package/dist/agent-runtime/sql-session.d.ts +71 -0
- package/dist/agent-runtime/sql-session.d.ts.map +1 -0
- package/dist/agent-runtime/sqlite-bun.d.ts +1 -1
- package/dist/agent-runtime/sqlite-bun.d.ts.map +1 -1
- package/dist/agent-runtime/sqlite-node.d.ts +1 -1
- package/dist/agent-runtime/sqlite-node.d.ts.map +1 -1
- package/dist/agent-runtime/sqlite-purge.d.ts +2 -3
- package/dist/agent-runtime/sqlite-purge.d.ts.map +1 -1
- package/dist/agent-runtime/sqlite-schema.d.ts +1 -1
- package/dist/agent-runtime/sqlite-schema.d.ts.map +1 -1
- package/dist/agent-runtime/sqlite-transactions.d.ts +10 -6
- package/dist/agent-runtime/sqlite-transactions.d.ts.map +1 -1
- package/dist/agent-runtime/sqlite.d.ts +10 -29
- package/dist/agent-runtime/sqlite.d.ts.map +1 -1
- package/dist/agent-runtime/state-tools.d.ts +8 -4
- package/dist/agent-runtime/state-tools.d.ts.map +1 -1
- package/dist/agent-runtime/store-archive.d.ts.map +1 -1
- package/dist/agent-runtime/store-branch.d.ts +6 -1
- package/dist/agent-runtime/store-branch.d.ts.map +1 -1
- package/dist/agent-runtime/store-capabilities.d.ts +42 -0
- package/dist/agent-runtime/store-capabilities.d.ts.map +1 -0
- package/dist/agent-runtime/store-conformance-branch.d.ts +5 -2
- package/dist/agent-runtime/store-conformance-branch.d.ts.map +1 -1
- package/dist/agent-runtime/store-conformance-capabilities.d.ts +6 -0
- package/dist/agent-runtime/store-conformance-capabilities.d.ts.map +1 -0
- package/dist/agent-runtime/store-conformance-event-once.d.ts +12 -0
- package/dist/agent-runtime/store-conformance-event-once.d.ts.map +1 -0
- package/dist/agent-runtime/store-conformance-lifecycle.d.ts +20 -20
- package/dist/agent-runtime/store-conformance-seed.d.ts +8 -0
- package/dist/agent-runtime/store-conformance-seed.d.ts.map +1 -0
- package/dist/agent-runtime/store-conformance.d.ts +31 -8
- package/dist/agent-runtime/store-conformance.d.ts.map +1 -1
- package/dist/agent-runtime/store-create.d.ts +1 -1
- package/dist/agent-runtime/store-create.d.ts.map +1 -1
- package/dist/agent-runtime/store-driver-contract.d.ts +15 -8
- package/dist/agent-runtime/store-driver-contract.d.ts.map +1 -1
- package/dist/agent-runtime/store-event-once.d.ts.map +1 -1
- package/dist/agent-runtime/store-events.d.ts +114 -0
- package/dist/agent-runtime/store-events.d.ts.map +1 -1
- package/dist/agent-runtime/store-memory-archive.d.ts +2 -0
- package/dist/agent-runtime/store-memory-archive.d.ts.map +1 -1
- package/dist/agent-runtime/store-memory.d.ts +2 -2
- package/dist/agent-runtime/store-memory.d.ts.map +1 -1
- package/dist/agent-runtime/store-mutate.d.ts.map +1 -1
- package/dist/agent-runtime/store-reduce-shared.d.ts +2 -1
- package/dist/agent-runtime/store-reduce-shared.d.ts.map +1 -1
- package/dist/agent-runtime/store-reducer.d.ts.map +1 -1
- package/dist/agent-runtime/store-replay.d.ts.map +1 -1
- package/dist/agent-runtime/store.d.ts +15 -2
- package/dist/agent-runtime/store.d.ts.map +1 -1
- package/dist/agent-runtime/terminal-commit.d.ts +10 -10
- package/dist/application/admission-run.d.ts.map +1 -1
- package/dist/application/admission.d.ts.map +1 -1
- package/dist/application/change-subscription.d.ts.map +1 -1
- package/dist/application/decisions.d.ts.map +1 -1
- package/dist/application/diagnostic-journal-lock-format.d.ts +9 -0
- package/dist/application/diagnostic-journal-lock-format.d.ts.map +1 -0
- package/dist/application/diagnostic-journal-manager.d.ts.map +1 -1
- package/dist/application/directory-inbox-delivery.d.ts.map +1 -1
- package/dist/application/grammy-update-admission.d.ts.map +1 -1
- package/dist/application/health.d.ts.map +1 -1
- package/dist/application/kernel-admission.d.ts.map +1 -1
- package/dist/application/kernel-contract.d.ts.map +1 -1
- package/dist/application/kernel-restart.d.ts.map +1 -1
- package/dist/application/kernel-rollback.d.ts.map +1 -1
- package/dist/application/kernel-shutdown.d.ts.map +1 -1
- package/dist/application/kernel-state.d.ts.map +1 -1
- package/dist/application/notification-outbox-state.d.ts.map +1 -1
- package/dist/application/notification-outbox.d.ts +1 -1
- package/dist/application/notification-outbox.d.ts.map +1 -1
- package/dist/application/revision-signal.d.ts.map +1 -1
- package/dist/application/schedule-run.d.ts.map +1 -1
- package/dist/application/schedule.d.ts.map +1 -1
- package/dist/application/sqlite-migrations.d.ts +104 -0
- package/dist/application/sqlite-migrations.d.ts.map +1 -0
- package/dist/application/watch-hub-core.d.ts.map +1 -1
- package/dist/browser/bridge-errors.d.ts +24 -0
- package/dist/browser/bridge-errors.d.ts.map +1 -0
- package/dist/browser/bridge-fetch.d.ts +30 -0
- package/dist/browser/bridge-fetch.d.ts.map +1 -0
- package/dist/browser/bridge-inbound.d.ts +28 -0
- package/dist/browser/bridge-inbound.d.ts.map +1 -0
- package/dist/browser/cancellation.d.ts +10 -2
- package/dist/browser/cancellation.d.ts.map +1 -1
- package/dist/browser/chunked-upload.d.ts +1 -1
- package/dist/browser/chunked-upload.d.ts.map +1 -1
- package/dist/browser/client-call-arguments.d.ts +31 -0
- package/dist/browser/client-call-arguments.d.ts.map +1 -0
- package/dist/browser/client-executors.d.ts +6 -0
- package/dist/browser/client-executors.d.ts.map +1 -1
- package/dist/browser/client.d.ts +9 -0
- package/dist/browser/client.d.ts.map +1 -1
- package/dist/browser/http.d.ts +17 -2
- package/dist/browser/http.d.ts.map +1 -1
- package/dist/browser/realtime-client.d.ts +0 -5
- package/dist/browser/realtime-client.d.ts.map +1 -1
- package/dist/browser/session-credentials-storage.d.ts +48 -0
- package/dist/browser/session-credentials-storage.d.ts.map +1 -0
- package/dist/browser/session-credentials.d.ts +26 -5
- package/dist/browser/session-credentials.d.ts.map +1 -1
- package/dist/browser/session-refresh-policy.d.ts +124 -0
- package/dist/browser/session-refresh-policy.d.ts.map +1 -0
- package/dist/browser/session-refresh-timer.d.ts +30 -0
- package/dist/browser/session-refresh-timer.d.ts.map +1 -0
- package/dist/browser/session.d.ts.map +1 -1
- package/dist/browser/socket-io-connection.d.ts.map +1 -1
- package/dist/browser/socket-io-explicit-peer.d.ts +0 -1
- package/dist/browser/socket-io-explicit-peer.d.ts.map +1 -1
- package/dist/browser/stream.d.ts +1 -1
- package/dist/browser/stream.d.ts.map +1 -1
- package/dist/browser/upload-progress.d.ts +3 -0
- package/dist/browser/upload-progress.d.ts.map +1 -1
- package/dist/contract/bridge-envelope.d.ts +155 -0
- package/dist/contract/bridge-envelope.d.ts.map +1 -0
- package/dist/contract/define-validation.d.ts +2 -0
- package/dist/contract/define-validation.d.ts.map +1 -1
- package/dist/contract/define.d.ts +3 -0
- package/dist/contract/define.d.ts.map +1 -1
- package/dist/contract/errors.d.ts +4 -4
- package/dist/contract/errors.d.ts.map +1 -1
- package/dist/contract/normalize.d.ts +3 -1
- package/dist/contract/normalize.d.ts.map +1 -1
- package/dist/contract/operation-effect.d.ts +29 -0
- package/dist/contract/operation-effect.d.ts.map +1 -0
- package/dist/contract/runtime-context.d.ts +2 -0
- package/dist/contract/runtime-context.d.ts.map +1 -1
- package/dist/contract/tool-options.d.ts +7 -0
- package/dist/contract/tool-options.d.ts.map +1 -1
- package/dist/declaration/command.d.ts +26 -0
- package/dist/declaration/command.d.ts.map +1 -0
- package/dist/declaration/declaration.d.ts +4 -22
- package/dist/declaration/declaration.d.ts.map +1 -1
- package/dist/declaration/machine-names.d.ts +11 -0
- package/dist/declaration/machine-names.d.ts.map +1 -0
- package/dist/durability/effect.d.ts.map +1 -1
- package/dist/durability/engine.d.ts.map +1 -1
- package/dist/durability/events.d.ts +5 -8
- package/dist/durability/events.d.ts.map +1 -1
- package/dist/durability/parks.d.ts +0 -5
- package/dist/durability/parks.d.ts.map +1 -1
- package/dist/durability/scheduler.d.ts +5 -0
- package/dist/durability/scheduler.d.ts.map +1 -1
- package/dist/entrypoints/agent-executor/acp.d.ts +4 -0
- package/dist/entrypoints/agent-executor/acp.d.ts.map +1 -0
- package/dist/entrypoints/agent-executor/acp.js +910 -0
- package/dist/entrypoints/agent-executor/claude-sdk.d.ts +2 -0
- package/dist/entrypoints/agent-executor/claude-sdk.d.ts.map +1 -0
- package/dist/entrypoints/agent-executor/claude-sdk.js +309 -0
- package/dist/entrypoints/agent-executor/claude.d.ts +5 -0
- package/dist/entrypoints/agent-executor/claude.d.ts.map +1 -0
- package/dist/entrypoints/agent-executor/claude.js +403 -0
- package/dist/entrypoints/agent-executor/codex.d.ts +4 -0
- package/dist/entrypoints/agent-executor/codex.d.ts.map +1 -0
- package/dist/entrypoints/agent-executor/codex.js +798 -0
- package/dist/entrypoints/agent-executor/testing.d.ts +4 -0
- package/dist/entrypoints/agent-executor/testing.d.ts.map +1 -0
- package/dist/entrypoints/agent-executor/testing.js +375 -0
- package/dist/entrypoints/agent-executor.d.ts +15 -0
- package/dist/entrypoints/agent-executor.d.ts.map +1 -0
- package/dist/entrypoints/agent-executor.js +455 -0
- package/dist/entrypoints/agent-runtime/browser.d.ts +1 -0
- package/dist/entrypoints/agent-runtime/browser.d.ts.map +1 -1
- package/dist/entrypoints/agent-runtime/browser.js +60 -30
- package/dist/entrypoints/agent-runtime/coding-tools.js +9 -12
- package/dist/entrypoints/agent-runtime/harness.js +35 -22
- package/dist/entrypoints/agent-runtime/openrouter.d.ts +6 -0
- package/dist/entrypoints/agent-runtime/openrouter.d.ts.map +1 -1
- package/dist/entrypoints/agent-runtime/openrouter.js +675 -45
- package/dist/entrypoints/agent-runtime/postgres.d.ts +4 -0
- package/dist/entrypoints/agent-runtime/postgres.d.ts.map +1 -0
- package/dist/entrypoints/agent-runtime/postgres.js +330 -0
- package/dist/entrypoints/agent-runtime/realtime.js +46 -49
- package/dist/entrypoints/agent-runtime/sandbox.d.ts +3 -1
- package/dist/entrypoints/agent-runtime/sandbox.d.ts.map +1 -1
- package/dist/entrypoints/agent-runtime/sandbox.js +74 -67
- package/dist/entrypoints/agent-runtime/sqlite/bun.js +18 -18
- package/dist/entrypoints/agent-runtime/sqlite/node.js +18 -18
- package/dist/entrypoints/agent-runtime/testing.d.ts +1 -1
- package/dist/entrypoints/agent-runtime/testing.d.ts.map +1 -1
- package/dist/entrypoints/agent-runtime/testing.js +394 -95
- package/dist/entrypoints/agent-runtime.d.ts +21 -13
- package/dist/entrypoints/agent-runtime.d.ts.map +1 -1
- package/dist/entrypoints/agent-runtime.js +1280 -1086
- package/dist/entrypoints/application/diagnostic-journal.js +16 -11
- package/dist/entrypoints/application/directory-inbox.js +20 -14
- package/dist/entrypoints/application/grammy.js +11 -8
- package/dist/entrypoints/application/opentelemetry.js +3 -3
- package/dist/entrypoints/application.d.ts +4 -2
- package/dist/entrypoints/application.d.ts.map +1 -1
- package/dist/entrypoints/application.js +409 -108
- package/dist/entrypoints/bin/upgrade-cli.d.ts +0 -12
- package/dist/entrypoints/bin/upgrade-cli.d.ts.map +1 -1
- package/dist/entrypoints/bin/upgrade-cli.js +11 -7
- package/dist/entrypoints/cli/publish.js +10 -9
- package/dist/entrypoints/cli.d.ts +10 -3
- package/dist/entrypoints/cli.d.ts.map +1 -1
- package/dist/entrypoints/cli.js +91 -29
- package/dist/entrypoints/contract.d.ts +2 -1
- package/dist/entrypoints/contract.d.ts.map +1 -1
- package/dist/entrypoints/contract.js +13 -7
- package/dist/entrypoints/declaration.d.ts +2 -0
- package/dist/entrypoints/declaration.d.ts.map +1 -1
- package/dist/entrypoints/declaration.js +55 -44
- package/dist/entrypoints/files/packaging.js +8 -5
- package/dist/entrypoints/files.d.ts +5 -0
- package/dist/entrypoints/files.d.ts.map +1 -1
- package/dist/entrypoints/files.js +236 -47
- package/dist/entrypoints/geo.js +9 -4
- package/dist/entrypoints/google.js +14 -13
- package/dist/entrypoints/handler.d.ts +12 -0
- package/dist/entrypoints/handler.d.ts.map +1 -0
- package/dist/entrypoints/handler.js +350 -0
- package/dist/entrypoints/http.d.ts +4 -0
- package/dist/entrypoints/http.d.ts.map +1 -1
- package/dist/entrypoints/http.js +411 -5
- package/dist/entrypoints/index.d.ts +2 -0
- package/dist/entrypoints/index.d.ts.map +1 -1
- package/dist/entrypoints/index.js +664 -91
- package/dist/entrypoints/live.js +22 -12
- package/dist/entrypoints/node.d.ts +2 -1
- package/dist/entrypoints/node.d.ts.map +1 -1
- package/dist/entrypoints/node.js +34 -25
- package/dist/entrypoints/observability.d.ts +2 -0
- package/dist/entrypoints/observability.d.ts.map +1 -1
- package/dist/entrypoints/observability.js +205 -131
- package/dist/entrypoints/primitives.js +152 -14
- package/dist/entrypoints/process/owner-loss.js +2 -2
- package/dist/entrypoints/process.js +18 -92
- package/dist/entrypoints/react.js +6 -5
- package/dist/entrypoints/realtime.d.ts +1 -0
- package/dist/entrypoints/realtime.d.ts.map +1 -1
- package/dist/entrypoints/realtime.js +6 -3
- package/dist/entrypoints/release.js +4 -0
- package/dist/entrypoints/remote.js +7 -6
- package/dist/entrypoints/server.d.ts +3 -1
- package/dist/entrypoints/server.d.ts.map +1 -1
- package/dist/entrypoints/server.js +295 -194
- package/dist/entrypoints/service-host/macos.d.ts +16 -0
- package/dist/entrypoints/service-host/macos.d.ts.map +1 -0
- package/dist/entrypoints/service-host/macos.js +1998 -0
- package/dist/entrypoints/service-host.d.ts +23 -0
- package/dist/entrypoints/service-host.d.ts.map +1 -0
- package/dist/entrypoints/service-host.js +2544 -0
- package/dist/entrypoints/spend/testing.d.ts +2 -0
- package/dist/entrypoints/spend/testing.d.ts.map +1 -0
- package/dist/entrypoints/spend/testing.js +442 -0
- package/dist/entrypoints/spend.d.ts +8 -0
- package/dist/entrypoints/spend.d.ts.map +1 -0
- package/dist/entrypoints/spend.js +593 -0
- package/dist/entrypoints/sync/postgres.d.ts +12 -0
- package/dist/entrypoints/sync/postgres.d.ts.map +1 -0
- package/dist/entrypoints/sync/postgres.js +737 -0
- package/dist/entrypoints/sync.d.ts +12 -0
- package/dist/entrypoints/sync.d.ts.map +1 -0
- package/dist/entrypoints/sync.js +782 -0
- package/dist/entrypoints/telegram/grammy.js +5 -5
- package/dist/entrypoints/telegram/html.d.ts +2 -0
- package/dist/entrypoints/telegram/html.d.ts.map +1 -1
- package/dist/entrypoints/telegram/html.js +839 -2
- package/dist/entrypoints/telegram/screens.js +13 -15
- package/dist/entrypoints/telegram.d.ts +1 -1
- package/dist/entrypoints/telegram.d.ts.map +1 -1
- package/dist/entrypoints/telegram.js +286 -76
- package/dist/entrypoints/testing.js +33 -41
- package/dist/entrypoints/tools/agent.js +12 -9
- package/dist/entrypoints/tools/connections.js +664 -63
- package/dist/entrypoints/tools/contract.d.ts +2 -2
- package/dist/entrypoints/tools/contract.js +4 -1
- package/dist/entrypoints/tools/invoker.js +9 -7
- package/dist/entrypoints/tools/mcp.js +16 -13
- package/dist/entrypoints/tools/toolkit.js +21 -18
- package/dist/entrypoints/tools.d.ts +3 -1
- package/dist/entrypoints/tools.d.ts.map +1 -1
- package/dist/entrypoints/tools.js +105 -92
- package/dist/entrypoints/tracking/contract.js +2 -1
- package/dist/entrypoints/tracking/performance.js +4 -0
- package/dist/entrypoints/tracking.js +6 -1
- package/dist/entrypoints/voice.js +3 -3
- package/dist/entrypoints/xlsx.js +1 -1
- package/dist/files/boundary.d.ts.map +1 -1
- package/dist/files/chunk-spool.d.ts +27 -0
- package/dist/files/chunk-spool.d.ts.map +1 -1
- package/dist/files/directory-appearance.d.ts +44 -0
- package/dist/files/directory-appearance.d.ts.map +1 -0
- package/dist/files/file-io.d.ts.map +1 -1
- package/dist/files/file-stamp.d.ts +35 -0
- package/dist/files/file-stamp.d.ts.map +1 -0
- package/dist/files/json-file-reading.d.ts +37 -0
- package/dist/files/json-file-reading.d.ts.map +1 -0
- package/dist/files/native-packaging.d.ts.map +1 -1
- package/dist/files/polled-json.d.ts +121 -0
- package/dist/files/polled-json.d.ts.map +1 -0
- package/dist/files/regular-file.d.ts +125 -0
- package/dist/files/regular-file.d.ts.map +1 -0
- package/dist/geo/index.d.ts +2 -1
- package/dist/geo/index.d.ts.map +1 -1
- package/dist/geo/resolver.d.ts.map +1 -1
- package/dist/geo/types.d.ts +0 -1
- package/dist/geo/types.d.ts.map +1 -1
- package/dist/google/google.d.ts +6 -0
- package/dist/google/google.d.ts.map +1 -1
- package/dist/{index-w0eqdhyd.js → index-09f7w2qq.js} +6 -1
- package/dist/index-0djnptn8.js +501 -0
- package/dist/index-0hdm5sx6.js +1457 -0
- package/dist/{index-t05a2ry4.js → index-0p0s5hrj.js} +8 -14
- package/dist/{index-1c945ten.js → index-0r15pkjq.js} +1 -1
- package/dist/{index-v1swr26p.js → index-0tyt97nk.js} +2 -2
- package/dist/{index-332d0m9g.js → index-0x4mnwg5.js} +4 -0
- package/dist/index-118aebbg.js +48 -0
- package/dist/index-1q0n6zek.js +184 -0
- package/dist/index-27hck3z2.js +307 -0
- package/dist/index-2rf33y2h.js +77 -0
- package/dist/index-360j58vb.js +63 -0
- package/dist/{index-tt30h7mr.js → index-39n02e0q.js} +1 -1
- package/dist/index-3agqmmrg.js +42 -0
- package/dist/{index-n6hvd1r2.js → index-3b31z0pc.js} +22 -15
- package/dist/index-3djgv3ch.js +472 -0
- package/dist/{index-mfntvj58.js → index-3dq8466w.js} +1 -1
- package/dist/index-3gwp8ez6.js +200 -0
- package/dist/{index-x2d51zay.js → index-3ypvpkwr.js} +309 -345
- package/dist/index-4gk6k3zc.js +248 -0
- package/dist/index-4qvyhn23.js +40 -0
- package/dist/index-4s2w4g37.js +647 -0
- package/dist/index-4ynw5ktx.js +78 -0
- package/dist/index-5awtbyns.js +19 -0
- package/dist/{index-kxff9e9w.js → index-5e0zsbf7.js} +5 -4
- package/dist/{index-nz06qw5a.js → index-5jyjb4s0.js} +1 -1
- package/dist/{index-7zksb1ty.js → index-5ptwb6ka.js} +1 -1
- package/dist/{index-w3nv6kr8.js → index-5q0qpw3v.js} +54 -9
- package/dist/{index-mm89hd8v.js → index-5t4fpdct.js} +1 -1
- package/dist/{index-0v9xb8pz.js → index-5y7j383h.js} +5 -5
- package/dist/index-5zwac8ft.js +221 -0
- package/dist/{index-v62cpkx3.js → index-6g85s734.js} +1 -1
- package/dist/{index-sqc6ezrb.js → index-6kec3b14.js} +17 -4
- package/dist/{index-kqnd6a85.js → index-7416mhyh.js} +1 -1
- package/dist/{index-m0wsfmrc.js → index-7csn6pva.js} +37 -24
- package/dist/{index-dqpesdck.js → index-7grgs8cx.js} +25 -5
- package/dist/{index-jjvr9f15.js → index-7kfcb576.js} +129 -39
- package/dist/{index-cvjddnvd.js → index-7xp05h20.js} +19 -10
- package/dist/{index-48acz7z0.js → index-83n766x4.js} +91 -50
- package/dist/{index-ss67fxhj.js → index-877e9y8r.js} +7 -7
- package/dist/{index-aw6kx2e6.js → index-8gmmdz7k.js} +1 -1
- package/dist/{index-wt6rw7rf.js → index-8xr2eq99.js} +29 -21
- package/dist/{index-rz3z13e9.js → index-97q9kykw.js} +1 -1
- package/dist/index-97rp94ff.js +8 -0
- package/dist/{index-0w0hxp7n.js → index-9pv126eh.js} +3 -9
- package/dist/{index-x2rvpbtj.js → index-9wh98cpa.js} +110 -16
- package/dist/{index-egg0yp2j.js → index-9xr44d2g.js} +86 -210
- package/dist/{index-b2sey031.js → index-9y0afd5f.js} +24 -23
- package/dist/index-a725ayvz.js +405 -0
- package/dist/{index-nmaqxdx7.js → index-ac5rj3d4.js} +203 -90
- package/dist/{index-wqzw3qg9.js → index-agy5fqgf.js} +32 -13
- package/dist/index-ajmtxsky.js +193 -0
- package/dist/{index-ndjzbt2v.js → index-akf0xkrm.js} +4 -3
- package/dist/index-akfgymyr.js +8 -0
- package/dist/index-apv5xfef.js +13 -0
- package/dist/index-ax3wns1a.js +93 -0
- package/dist/{index-ft2wvst5.js → index-bbzvrq66.js} +1603 -342
- package/dist/index-bh4pmtr9.js +317 -0
- package/dist/{index-fa53vygr.js → index-bmaz3jzy.js} +3 -3
- package/dist/{index-8kzct1d6.js → index-bn2baakz.js} +143 -143
- package/dist/{index-m8ddk770.js → index-brhhaygm.js} +1 -1
- package/dist/index-caywx1c0.js +199 -0
- package/dist/index-cbhxhma2.js +90 -0
- package/dist/index-cfnmvcq8.js +11 -0
- package/dist/index-cv9b7fz2.js +42 -0
- package/dist/index-d4svrknj.js +156 -0
- package/dist/{index-a3z56mtn.js → index-d96c1n1q.js} +5 -3
- package/dist/{index-3ymcmpa9.js → index-dvd1qdwa.js} +33 -163
- package/dist/{index-v7rbjatr.js → index-dwa6pskj.js} +1837 -1151
- package/dist/{index-ne4j9998.js → index-e06z0tkb.js} +123 -94
- package/dist/{index-99nnsz39.js → index-en8e5zsj.js} +15 -135
- package/dist/index-fcw255hd.js +929 -0
- package/dist/{index-20hn8pbh.js → index-fmzg39a8.js} +1 -1
- package/dist/{index-fvd6pvw3.js → index-g1q7fwn9.js} +2 -2
- package/dist/index-g56ht6qf.js +98 -0
- package/dist/{index-f56ct5gb.js → index-gj1rjf78.js} +4 -3
- package/dist/{index-g6a3na27.js → index-gnjgkecx.js} +7 -3
- package/dist/index-hy4653g4.js +345 -0
- package/dist/index-j13gzgdv.js +403 -0
- package/dist/{index-pa9bhefy.js → index-j516jaaz.js} +37 -11
- package/dist/{index-t8jz0e20.js → index-j903yhp4.js} +30 -38
- package/dist/{index-9ypczvpj.js → index-jb4m241t.js} +2 -0
- package/dist/index-jrka9029.js +177 -0
- package/dist/{index-cjzaj7ev.js → index-jxtg307y.js} +23 -21
- package/dist/index-kmbpej2y.js +1152 -0
- package/dist/{index-bz9cmnqq.js → index-kt6dh1n6.js} +4 -4
- package/dist/index-ky3ardqn.js +80 -0
- package/dist/index-kyejf658.js +14 -0
- package/dist/{index-zyc64nbh.js → index-kynwa08q.js} +52 -47
- package/dist/index-kzavdze2.js +15 -0
- package/dist/{index-m200b8hs.js → index-mbd92r1w.js} +5 -3
- package/dist/index-mxt0wfjy.js +58 -0
- package/dist/{index-9cxxfkhb.js → index-n20tybgk.js} +14 -9
- package/dist/index-nbv44x0x.js +250 -0
- package/dist/index-ngwf1s3c.js +51 -0
- package/dist/{index-zfncctjp.js → index-nk0cy9g1.js} +5 -4
- package/dist/index-p1m9djt6.js +108 -0
- package/dist/{index-hs76yzt7.js → index-paff5y0r.js} +17 -11
- package/dist/{index-qaet40b2.js → index-prf6ayhf.js} +5 -7
- package/dist/{index-hkxgennw.js → index-ps3djm8d.js} +7 -1
- package/dist/{index-1v3k5zgx.js → index-qnzhmk2s.js} +528 -1129
- package/dist/{index-3bzk2645.js → index-r9kq5ark.js} +1 -1
- package/dist/{index-hkw233vx.js → index-rbd2rq3z.js} +2 -2
- package/dist/{index-r0xr7y4m.js → index-rhb33thr.js} +138 -33
- package/dist/{index-kffm4r8w.js → index-rj32hkkp.js} +2 -2
- package/dist/index-rptj3qnc.js +96 -0
- package/dist/{index-hqsbtvta.js → index-rpyn7geq.js} +11 -3
- package/dist/{index-m9hb9wnk.js → index-sfzfd2m2.js} +2 -2
- package/dist/{index-sqkttz7z.js → index-sv5svtq7.js} +1 -1
- package/dist/{index-srs8hj9c.js → index-sx3g49y2.js} +5 -1
- package/dist/{index-9mjrnqxs.js → index-t1a2jrg7.js} +21 -91
- package/dist/{index-a6w6mwda.js → index-tazm4dxf.js} +1 -1
- package/dist/{index-b51tzcgh.js → index-tf70nm22.js} +2 -2
- package/dist/index-ttexdtjj.js +28 -0
- package/dist/{index-103dp7fz.js → index-v37b2cd6.js} +1956 -3151
- package/dist/{index-0ndz5r8z.js → index-v59pxmf1.js} +17 -9
- package/dist/{index-rfkh44ss.js → index-vgytj9wp.js} +1 -1
- package/dist/{index-tnnmekgb.js → index-wa6h4tz6.js} +3 -3
- package/dist/{index-4efxzrht.js → index-wavv538x.js} +211 -196
- package/dist/{index-1szhrfsf.js → index-wbnpa8z6.js} +7 -5
- package/dist/index-werjqesf.js +43 -0
- package/dist/{index-7qyv50r4.js → index-wv8dqy7q.js} +2 -2
- package/dist/index-wz392jyz.js +10 -0
- package/dist/{index-1d7s7da0.js → index-x6sp5vpa.js} +36 -5
- package/dist/{index-bqzgaj57.js → index-x90w78yz.js} +183 -61
- package/dist/index-xgae0bn7.js +37 -0
- package/dist/index-xmr47znh.js +160 -0
- package/dist/{index-ftk3838x.js → index-xq4s9mka.js} +7 -2
- package/dist/{index-ww3gss55.js → index-xrgn784x.js} +1 -1
- package/dist/{index-fpwbskp2.js → index-xtby8rj3.js} +1 -1
- package/dist/index-xtkw9866.js +107 -0
- package/dist/{index-btjwc7xr.js → index-xypxnzhp.js} +15 -14
- package/dist/{index-yex7eg1v.js → index-y7sy1xdp.js} +6 -2
- package/dist/index-z4k0hqp9.js +476 -0
- package/dist/{index-a7ebd769.js → index-zwgwyvdt.js} +3 -3
- package/dist/internal/abort-error.d.ts +9 -0
- package/dist/internal/abort-error.d.ts.map +1 -0
- package/dist/internal/abort-race.d.ts +47 -4
- package/dist/internal/abort-race.d.ts.map +1 -1
- package/dist/internal/atomic-file.d.ts +19 -0
- package/dist/internal/atomic-file.d.ts.map +1 -1
- package/dist/internal/backoff.d.ts.map +1 -1
- package/dist/internal/bounded-body.d.ts +37 -1
- package/dist/internal/bounded-body.d.ts.map +1 -1
- package/dist/internal/bounded-file-read.d.ts +31 -15
- package/dist/internal/bounded-file-read.d.ts.map +1 -1
- package/dist/internal/bun-command.d.ts +11 -0
- package/dist/internal/bun-command.d.ts.map +1 -1
- package/dist/internal/channel.d.ts.map +1 -1
- package/dist/internal/darwin-binding-error.d.ts.map +1 -1
- package/dist/internal/darwin-binding.d.ts +10 -0
- package/dist/internal/darwin-binding.d.ts.map +1 -1
- package/dist/internal/deadline.d.ts +22 -2
- package/dist/internal/deadline.d.ts.map +1 -1
- package/dist/internal/exclusive-lock-owner.d.ts +20 -1
- package/dist/internal/exclusive-lock-owner.d.ts.map +1 -1
- package/dist/internal/exclusive-lock-read.d.ts +2 -0
- package/dist/internal/exclusive-lock-read.d.ts.map +1 -1
- package/dist/internal/exclusive-lock.d.ts +26 -0
- package/dist/internal/exclusive-lock.d.ts.map +1 -1
- package/dist/internal/file-observation.d.ts +49 -0
- package/dist/internal/file-observation.d.ts.map +1 -1
- package/dist/internal/json-response.d.ts +10 -0
- package/dist/internal/json-response.d.ts.map +1 -0
- package/dist/internal/open-descriptors.d.ts +5 -0
- package/dist/internal/open-descriptors.d.ts.map +1 -1
- package/dist/internal/optional-peer.d.ts.map +1 -1
- package/dist/internal/pinned-http.d.ts.map +1 -1
- package/dist/internal/positive-integer.d.ts +14 -6
- package/dist/internal/positive-integer.d.ts.map +1 -1
- package/dist/internal/postgres-query.d.ts +16 -0
- package/dist/internal/postgres-query.d.ts.map +1 -0
- package/dist/internal/process-identity.d.ts +21 -1
- package/dist/internal/process-identity.d.ts.map +1 -1
- package/dist/internal/process-instance.d.ts +6 -0
- package/dist/internal/process-instance.d.ts.map +1 -1
- package/dist/internal/request.d.ts +4 -0
- package/dist/internal/request.d.ts.map +1 -1
- package/dist/internal/secret-equal.d.ts +11 -0
- package/dist/internal/secret-equal.d.ts.map +1 -0
- package/dist/internal/secure-fetch.d.ts.map +1 -1
- package/dist/internal/sqlite.d.ts +8 -0
- package/dist/internal/sqlite.d.ts.map +1 -1
- package/dist/internal/timers.d.ts +20 -0
- package/dist/internal/timers.d.ts.map +1 -1
- package/dist/internal/typed.d.ts +11 -0
- package/dist/internal/typed.d.ts.map +1 -1
- package/dist/internal/unix-client-error.d.ts +21 -0
- package/dist/internal/unix-client-error.d.ts.map +1 -0
- package/dist/internal/unix-socket-lock.d.ts +23 -0
- package/dist/internal/unix-socket-lock.d.ts.map +1 -0
- package/dist/internal/unix-socket.d.ts +60 -0
- package/dist/internal/unix-socket.d.ts.map +1 -1
- package/dist/internal/upgrade-affects.d.ts +3 -3
- package/dist/internal/upgrade-affects.d.ts.map +1 -1
- package/dist/internal/upgrade-plan.d.ts.map +1 -1
- package/dist/json-schema/dialect.d.ts +0 -6
- package/dist/json-schema/dialect.d.ts.map +1 -1
- package/dist/json-schema/keywords.d.ts +116 -0
- package/dist/json-schema/keywords.d.ts.map +1 -0
- package/dist/json-schema/string-format.d.ts.map +1 -1
- package/dist/live/events.d.ts.map +1 -1
- package/dist/live/watch-client.d.ts.map +1 -1
- package/dist/observability/bounded-logger.d.ts +3 -0
- package/dist/observability/bounded-logger.d.ts.map +1 -1
- package/dist/observability/bounded-sink.d.ts.map +1 -1
- package/dist/observability/context.d.ts +12 -2
- package/dist/observability/context.d.ts.map +1 -1
- package/dist/observability/event-loop-delay.d.ts +62 -0
- package/dist/observability/event-loop-delay.d.ts.map +1 -0
- package/dist/observability/json-logger.d.ts.map +1 -1
- package/dist/observability/log-repeat.d.ts +44 -0
- package/dist/observability/log-repeat.d.ts.map +1 -0
- package/dist/observability/spool-core.d.ts +95 -0
- package/dist/observability/spool-core.d.ts.map +1 -0
- package/dist/observability/spool-file.d.ts +46 -0
- package/dist/observability/spool-file.d.ts.map +1 -0
- package/dist/observability/spool.d.ts +14 -8
- package/dist/observability/spool.d.ts.map +1 -1
- package/dist/observability/trace.d.ts.map +1 -1
- package/dist/observability/work.d.ts.map +1 -1
- package/dist/primitives/index.d.ts +1 -0
- package/dist/primitives/index.d.ts.map +1 -1
- package/dist/primitives/order-key.d.ts +37 -0
- package/dist/primitives/order-key.d.ts.map +1 -0
- package/dist/process/bun-child.d.ts.map +1 -1
- package/dist/process/command-owner.d.ts.map +1 -1
- package/dist/process/contract.d.ts +4 -3
- package/dist/process/contract.d.ts.map +1 -1
- package/dist/process/group-presence.d.ts.map +1 -1
- package/dist/process/group.d.ts +5 -1
- package/dist/process/group.d.ts.map +1 -1
- package/dist/process/launch.d.ts +5 -3
- package/dist/process/launch.d.ts.map +1 -1
- package/dist/process/owner-loss-guard.d.ts.map +1 -1
- package/dist/react/cache-bridge.d.ts.map +1 -1
- package/dist/release/watcher.d.ts.map +1 -1
- package/dist/server/bridge-host.d.ts +51 -0
- package/dist/server/bridge-host.d.ts.map +1 -0
- package/dist/server/bun.d.ts +4 -4
- package/dist/server/bun.d.ts.map +1 -1
- package/dist/server/context-contribution.d.ts.map +1 -1
- package/dist/server/contract-method.d.ts.map +1 -1
- package/dist/server/create.d.ts +1 -0
- package/dist/server/create.d.ts.map +1 -1
- package/dist/server/endpoint-dispatch.d.ts.map +1 -1
- package/dist/server/endpoint-response.d.ts.map +1 -1
- package/dist/server/error-dispatch.d.ts +2 -0
- package/dist/server/error-dispatch.d.ts.map +1 -1
- package/dist/server/error-hook.d.ts +2 -0
- package/dist/server/error-hook.d.ts.map +1 -1
- package/dist/server/handler-state.d.ts +13 -2
- package/dist/server/handler-state.d.ts.map +1 -1
- package/dist/server/implement.d.ts +1 -0
- package/dist/server/implement.d.ts.map +1 -1
- package/dist/server/local-host.d.ts +47 -0
- package/dist/server/local-host.d.ts.map +1 -0
- package/dist/server/logger.d.ts +20 -3
- package/dist/server/logger.d.ts.map +1 -1
- package/dist/server/logging.d.ts +2 -1
- package/dist/server/logging.d.ts.map +1 -1
- package/dist/server/middleware/cors.d.ts +1 -0
- package/dist/server/middleware/cors.d.ts.map +1 -1
- package/dist/server/middleware/signed-link.d.ts +42 -0
- package/dist/server/middleware/signed-link.d.ts.map +1 -0
- package/dist/server/multipart-reader.d.ts +3 -1
- package/dist/server/multipart-reader.d.ts.map +1 -1
- package/dist/server/multipart.d.ts.map +1 -1
- package/dist/server/oauth/cimd.d.ts.map +1 -1
- package/dist/server/oauth/endpoints.d.ts.map +1 -1
- package/dist/server/openapi.d.ts.map +1 -1
- package/dist/server/protocol-outcome.d.ts +17 -0
- package/dist/server/protocol-outcome.d.ts.map +1 -0
- package/dist/server/raw.d.ts.map +1 -1
- package/dist/server/request-completion.d.ts +3 -1
- package/dist/server/request-completion.d.ts.map +1 -1
- package/dist/server/shutdown.d.ts.map +1 -1
- package/dist/server/socket-io-config.d.ts +1 -1
- package/dist/server/socket-io-config.d.ts.map +1 -1
- package/dist/server/streaming-route.d.ts.map +1 -1
- package/dist/server/types.d.ts +13 -10
- package/dist/server/types.d.ts.map +1 -1
- package/dist/server/unix-client-body.d.ts +4 -1
- package/dist/server/unix-client-body.d.ts.map +1 -1
- package/dist/server/unix-client-bun.d.ts.map +1 -1
- package/dist/server/unix-client.d.ts +1 -1
- package/dist/server/unix-client.d.ts.map +1 -1
- package/dist/service-host/artifact-activation.d.ts +58 -0
- package/dist/service-host/artifact-activation.d.ts.map +1 -0
- package/dist/service-host/artifact-manifest.d.ts +68 -0
- package/dist/service-host/artifact-manifest.d.ts.map +1 -0
- package/dist/service-host/artifact.d.ts +43 -0
- package/dist/service-host/artifact.d.ts.map +1 -0
- package/dist/service-host/config-reloader-contract.d.ts +66 -0
- package/dist/service-host/config-reloader-contract.d.ts.map +1 -0
- package/dist/service-host/config-reloader-helpers.d.ts +32 -0
- package/dist/service-host/config-reloader-helpers.d.ts.map +1 -0
- package/dist/service-host/config-reloader-source.d.ts +47 -0
- package/dist/service-host/config-reloader-source.d.ts.map +1 -0
- package/dist/service-host/config-reloader.d.ts +6 -0
- package/dist/service-host/config-reloader.d.ts.map +1 -0
- package/dist/service-host/host-adapter.d.ts +72 -0
- package/dist/service-host/host-adapter.d.ts.map +1 -0
- package/dist/service-host/identity-unix-socket.d.ts +101 -0
- package/dist/service-host/identity-unix-socket.d.ts.map +1 -0
- package/dist/service-host/identity.d.ts +117 -0
- package/dist/service-host/identity.d.ts.map +1 -0
- package/dist/service-host/launchd-plist.d.ts +77 -0
- package/dist/service-host/launchd-plist.d.ts.map +1 -0
- package/dist/service-host/launchd-render.d.ts +91 -0
- package/dist/service-host/launchd-render.d.ts.map +1 -0
- package/dist/service-host/launchd.d.ts +82 -0
- package/dist/service-host/launchd.d.ts.map +1 -0
- package/dist/service-host/macos/bundle-plist.d.ts +50 -0
- package/dist/service-host/macos/bundle-plist.d.ts.map +1 -0
- package/dist/service-host/macos/bundle.d.ts +66 -0
- package/dist/service-host/macos/bundle.d.ts.map +1 -0
- package/dist/service-host/macos/codesign.d.ts +95 -0
- package/dist/service-host/macos/codesign.d.ts.map +1 -0
- package/dist/service-host/macos/icon.d.ts +93 -0
- package/dist/service-host/macos/icon.d.ts.map +1 -0
- package/dist/service-host/macos/launch-services.d.ts +88 -0
- package/dist/service-host/macos/launch-services.d.ts.map +1 -0
- package/dist/service-host/macos/launcher.d.ts +59 -0
- package/dist/service-host/macos/launcher.d.ts.map +1 -0
- package/dist/service-host/macos/responsibility.d.ts +90 -0
- package/dist/service-host/macos/responsibility.d.ts.map +1 -0
- package/dist/service-host/macos/runner.d.ts +69 -0
- package/dist/service-host/macos/runner.d.ts.map +1 -0
- package/dist/service-host/plist-xml.d.ts +48 -0
- package/dist/service-host/plist-xml.d.ts.map +1 -0
- package/dist/service-host/process-evidence.d.ts +17 -0
- package/dist/service-host/process-evidence.d.ts.map +1 -0
- package/dist/service-host/systemd-inspect.d.ts +126 -0
- package/dist/service-host/systemd-inspect.d.ts.map +1 -0
- package/dist/service-host/systemd-links.d.ts +23 -0
- package/dist/service-host/systemd-links.d.ts.map +1 -0
- package/dist/service-host/systemd-render.d.ts +93 -0
- package/dist/service-host/systemd-render.d.ts.map +1 -0
- package/dist/service-host/systemd.d.ts +50 -0
- package/dist/service-host/systemd.d.ts.map +1 -0
- package/dist/spend/attribution.d.ts +17 -0
- package/dist/spend/attribution.d.ts.map +1 -0
- package/dist/spend/coverage-guard.d.ts +60 -0
- package/dist/spend/coverage-guard.d.ts.map +1 -0
- package/dist/spend/coverage-lexer.d.ts +20 -0
- package/dist/spend/coverage-lexer.d.ts.map +1 -0
- package/dist/spend/facts.d.ts +23 -0
- package/dist/spend/facts.d.ts.map +1 -0
- package/dist/spend/gateway-stream.d.ts +25 -0
- package/dist/spend/gateway-stream.d.ts.map +1 -0
- package/dist/spend/gateway.d.ts +64 -0
- package/dist/spend/gateway.d.ts.map +1 -0
- package/dist/spend/receipt-merge.d.ts +13 -0
- package/dist/spend/receipt-merge.d.ts.map +1 -0
- package/dist/spend/receipt-spool.d.ts +35 -0
- package/dist/spend/receipt-spool.d.ts.map +1 -0
- package/dist/spend/reconcile.d.ts +45 -0
- package/dist/spend/reconcile.d.ts.map +1 -0
- package/dist/spend/schemas.d.ts +249 -0
- package/dist/spend/schemas.d.ts.map +1 -0
- package/dist/sync/outbox.d.ts +131 -0
- package/dist/sync/outbox.d.ts.map +1 -0
- package/dist/sync/overlay.d.ts +59 -0
- package/dist/sync/overlay.d.ts.map +1 -0
- package/dist/sync/protocol.d.ts +132 -0
- package/dist/sync/protocol.d.ts.map +1 -0
- package/dist/sync/server-store-check.d.ts +10 -0
- package/dist/sync/server-store-check.d.ts.map +1 -0
- package/dist/sync/server-store-memory.d.ts +14 -0
- package/dist/sync/server-store-memory.d.ts.map +1 -0
- package/dist/sync/server-store-postgres.d.ts +25 -0
- package/dist/sync/server-store-postgres.d.ts.map +1 -0
- package/dist/sync/server-store.d.ts +139 -0
- package/dist/sync/server-store.d.ts.map +1 -0
- package/dist/sync/session-machine.d.ts +79 -0
- package/dist/sync/session-machine.d.ts.map +1 -0
- package/dist/sync/session-snapshot.d.ts +19 -0
- package/dist/sync/session-snapshot.d.ts.map +1 -0
- package/dist/sync/session-steps.d.ts +15 -0
- package/dist/sync/session-steps.d.ts.map +1 -0
- package/dist/sync/session.d.ts +142 -0
- package/dist/sync/session.d.ts.map +1 -0
- package/dist/sync/tombstones.d.ts +53 -0
- package/dist/sync/tombstones.d.ts.map +1 -0
- package/dist/telegram/bot-api.d.ts.map +1 -1
- package/dist/telegram/broadcast-failure.d.ts.map +1 -1
- package/dist/telegram/budget-transformer.d.ts.map +1 -1
- package/dist/telegram/crypto.d.ts +2 -10
- package/dist/telegram/crypto.d.ts.map +1 -1
- package/dist/telegram/html/markdown-inline.d.ts +19 -0
- package/dist/telegram/html/markdown-inline.d.ts.map +1 -0
- package/dist/telegram/html/markdown-lines.d.ts +51 -0
- package/dist/telegram/html/markdown-lines.d.ts.map +1 -0
- package/dist/telegram/html/markdown-split.d.ts +49 -0
- package/dist/telegram/html/markdown-split.d.ts.map +1 -0
- package/dist/telegram/html/markdown.d.ts +14 -0
- package/dist/telegram/html/markdown.d.ts.map +1 -0
- package/dist/telegram/html/nodes.d.ts +26 -4
- package/dist/telegram/html/nodes.d.ts.map +1 -1
- package/dist/telegram/html/parse.d.ts.map +1 -1
- package/dist/telegram/html/render.d.ts.map +1 -1
- package/dist/telegram/init-data.d.ts.map +1 -1
- package/dist/telegram/local-files.d.ts.map +1 -1
- package/dist/telegram/operator-channel.d.ts +15 -2
- package/dist/telegram/operator-channel.d.ts.map +1 -1
- package/dist/telegram/outbound-budget.d.ts.map +1 -1
- package/dist/telegram/outbound-cost.d.ts +9 -1
- package/dist/telegram/outbound-cost.d.ts.map +1 -1
- package/dist/telegram/outbound-queue.d.ts +2 -1
- package/dist/telegram/outbound-queue.d.ts.map +1 -1
- package/dist/telegram/screens/outcome.d.ts.map +1 -1
- package/dist/telegram/send-failure.d.ts.map +1 -1
- package/dist/telegram/transport-connect.d.ts.map +1 -1
- package/dist/telegram/transport.d.ts.map +1 -1
- package/dist/telegram/update-intake.d.ts.map +1 -1
- package/dist/telegram/update-store-postgres.d.ts +2 -2
- package/dist/telegram/update-store-postgres.d.ts.map +1 -1
- package/dist/telegram/webhook.d.ts.map +1 -1
- package/dist/testing/managed-resource-conformance.d.ts.map +1 -1
- package/dist/testing/surface-conformance.d.ts.map +1 -1
- package/dist/testing/surface-manifest.d.ts +2 -0
- package/dist/testing/surface-manifest.d.ts.map +1 -1
- package/dist/tools/access.d.ts +34 -0
- package/dist/tools/access.d.ts.map +1 -0
- package/dist/tools/agent.d.ts +14 -6
- package/dist/tools/agent.d.ts.map +1 -1
- package/dist/tools/cli/args-classify.d.ts +154 -0
- package/dist/tools/cli/args-classify.d.ts.map +1 -0
- package/dist/tools/cli/args-fields.d.ts +14 -7
- package/dist/tools/cli/args-fields.d.ts.map +1 -1
- package/dist/tools/cli/args-json.d.ts +1 -1
- package/dist/tools/cli/args-json.d.ts.map +1 -1
- package/dist/tools/cli/args-route.d.ts +4 -48
- package/dist/tools/cli/args-route.d.ts.map +1 -1
- package/dist/tools/cli/args-scan.d.ts +70 -0
- package/dist/tools/cli/args-scan.d.ts.map +1 -0
- package/dist/tools/cli/args-tokens.d.ts +2 -1
- package/dist/tools/cli/args-tokens.d.ts.map +1 -1
- package/dist/tools/cli/args.d.ts +31 -19
- package/dist/tools/cli/args.d.ts.map +1 -1
- package/dist/tools/cli/checkpoint.d.ts.map +1 -1
- package/dist/tools/cli/command-shape.d.ts +5 -0
- package/dist/tools/cli/command-shape.d.ts.map +1 -1
- package/dist/tools/cli/command.d.ts +57 -2
- package/dist/tools/cli/command.d.ts.map +1 -1
- package/dist/tools/cli/config.d.ts +15 -58
- package/dist/tools/cli/config.d.ts.map +1 -1
- package/dist/tools/cli/create-cli.d.ts +7 -3
- package/dist/tools/cli/create-cli.d.ts.map +1 -1
- package/dist/tools/cli/format.d.ts.map +1 -1
- package/dist/tools/cli/help.d.ts.map +1 -1
- package/dist/tools/cli/invoke.d.ts +70 -20
- package/dist/tools/cli/invoke.d.ts.map +1 -1
- package/dist/tools/cli/io.d.ts.map +1 -1
- package/dist/tools/cli/managed-surface.d.ts.map +1 -1
- package/dist/tools/cli/notices.d.ts.map +1 -1
- package/dist/tools/cli/policy.d.ts +66 -10
- package/dist/tools/cli/policy.d.ts.map +1 -1
- package/dist/tools/cli/prepare.d.ts +5 -4
- package/dist/tools/cli/prepare.d.ts.map +1 -1
- package/dist/tools/cli/run-managed.d.ts.map +1 -1
- package/dist/tools/cli/run-native.d.ts.map +1 -1
- package/dist/tools/cli/run-stream.d.ts.map +1 -1
- package/dist/tools/cli/runner.d.ts +28 -0
- package/dist/tools/cli/runner.d.ts.map +1 -0
- package/dist/tools/cli/session.d.ts +12 -6
- package/dist/tools/cli/session.d.ts.map +1 -1
- package/dist/tools/cli/stream-surface.d.ts.map +1 -1
- package/dist/tools/cli/stream.d.ts.map +1 -1
- package/dist/tools/cli/unavailable.d.ts +2 -0
- package/dist/tools/cli/unavailable.d.ts.map +1 -1
- package/dist/tools/cli/unix-outcome.d.ts +8 -0
- package/dist/tools/cli/unix-outcome.d.ts.map +1 -0
- package/dist/tools/cli/update.d.ts.map +1 -1
- package/dist/tools/cli/view-columns.d.ts +18 -0
- package/dist/tools/cli/view-columns.d.ts.map +1 -0
- package/dist/tools/cli/view.d.ts.map +1 -1
- package/dist/tools/connections/define.d.ts.map +1 -1
- package/dist/tools/connections/foreign-schema-join.d.ts +28 -0
- package/dist/tools/connections/foreign-schema-join.d.ts.map +1 -0
- package/dist/tools/connections/foreign-schema.d.ts +9 -0
- package/dist/tools/connections/foreign-schema.d.ts.map +1 -0
- package/dist/tools/connections/limits.d.ts +1 -1
- package/dist/tools/connections/limits.d.ts.map +1 -1
- package/dist/tools/connections/mcp-client.d.ts.map +1 -1
- package/dist/tools/connections/mcp.d.ts.map +1 -1
- package/dist/tools/connections/openapi.d.ts.map +1 -1
- package/dist/tools/connections/runtime.d.ts +18 -6
- package/dist/tools/connections/runtime.d.ts.map +1 -1
- package/dist/tools/connections/sse-session.d.ts.map +1 -1
- package/dist/tools/connections/types.d.ts +12 -2
- package/dist/tools/connections/types.d.ts.map +1 -1
- package/dist/tools/execute.d.ts.map +1 -1
- package/dist/tools/internal/expose.d.ts +6 -0
- package/dist/tools/internal/expose.d.ts.map +1 -0
- package/dist/tools/internal/json-projection.d.ts +17 -0
- package/dist/tools/internal/json-projection.d.ts.map +1 -0
- package/dist/tools/internal/surface-projector.d.ts +18 -4
- package/dist/tools/internal/surface-projector.d.ts.map +1 -1
- package/dist/tools/invoker.d.ts +9 -2
- package/dist/tools/invoker.d.ts.map +1 -1
- package/dist/tools/lifecycle.d.ts +8 -2
- package/dist/tools/lifecycle.d.ts.map +1 -1
- package/dist/tools/list-names.d.ts +1 -1
- package/dist/tools/list-names.d.ts.map +1 -1
- package/dist/tools/manifest.d.ts +2 -0
- package/dist/tools/manifest.d.ts.map +1 -1
- package/dist/tools/mcp/handler.d.ts.map +1 -1
- package/dist/tools/mcp/mount.d.ts +26 -14
- package/dist/tools/mcp/mount.d.ts.map +1 -1
- package/dist/tools/mcp/prepare.d.ts +2 -0
- package/dist/tools/mcp/prepare.d.ts.map +1 -1
- package/dist/tools/mcp/register.d.ts.map +1 -1
- package/dist/tools/mcp/runtime-tools.d.ts +1 -1
- package/dist/tools/mcp/runtime-tools.d.ts.map +1 -1
- package/dist/tools/mcp/stdio.d.ts.map +1 -1
- package/dist/tools/mount.d.ts +7 -2
- package/dist/tools/mount.d.ts.map +1 -1
- package/dist/tools/native-definition.d.ts +1 -1
- package/dist/tools/native-definition.d.ts.map +1 -1
- package/dist/tools/operations/async-operation-runtime-tools.d.ts +2 -2
- package/dist/tools/operations/async-operation-runtime-tools.d.ts.map +1 -1
- package/dist/tools/operations/async-operation-runtime-types.d.ts +1 -1
- package/dist/tools/operations/async-operation-runtime-types.d.ts.map +1 -1
- package/dist/tools/operations/define-wait-tool.d.ts.map +1 -1
- package/dist/tools/operations/mount-wait.d.ts.map +1 -1
- package/dist/tools/operations/wait-core.d.ts.map +1 -1
- package/dist/tools/read-operation.d.ts +6 -4
- package/dist/tools/read-operation.d.ts.map +1 -1
- package/dist/tools/registry.d.ts.map +1 -1
- package/dist/tools/runtime-tool-declaration.d.ts +4 -1
- package/dist/tools/runtime-tool-declaration.d.ts.map +1 -1
- package/dist/tools/runtime-tool.d.ts +6 -1
- package/dist/tools/runtime-tool.d.ts.map +1 -1
- package/dist/tools/schema/coerce.d.ts.map +1 -1
- package/dist/tools/schema/inline-references.d.ts +7 -0
- package/dist/tools/schema/inline-references.d.ts.map +1 -0
- package/dist/tools/schema/json-schema-origin.d.ts +1 -1
- package/dist/tools/schema/json-schema-origin.d.ts.map +1 -1
- package/dist/tools/schema/presentation.d.ts +6 -0
- package/dist/tools/schema/presentation.d.ts.map +1 -1
- package/dist/tools/schema/schema.d.ts +2 -0
- package/dist/tools/schema/schema.d.ts.map +1 -1
- package/dist/tools/schema/untyped-properties.d.ts.map +1 -1
- package/dist/tools/surface.d.ts.map +1 -1
- package/dist/tools/toolkit.d.ts +6 -3
- package/dist/tools/toolkit.d.ts.map +1 -1
- package/dist/tools/transfer/define-download-tool.d.ts.map +1 -1
- package/dist/tools/transfer/define-upload-tool.d.ts.map +1 -1
- package/dist/tools/transfer/define-view-file-tool.d.ts +2 -1
- package/dist/tools/transfer/define-view-file-tool.d.ts.map +1 -1
- package/dist/tools/transfer/mount-download.d.ts.map +1 -1
- package/dist/tools/transfer/view-file-contract.d.ts +2 -2
- package/dist/tools/transfer/view-file.d.ts +1 -2
- package/dist/tools/transfer/view-file.d.ts.map +1 -1
- package/dist/tracking/client.d.ts +0 -13
- package/dist/tracking/client.d.ts.map +1 -1
- package/dist/tracking/delivery.d.ts.map +1 -1
- package/dist/tracking/performance/collector.d.ts.map +1 -1
- package/llms/agent-executor-acp.txt +51 -0
- package/llms/agent-executor-claude-sdk.txt +31 -0
- package/llms/agent-executor-claude.txt +29 -0
- package/llms/agent-executor-codex.txt +25 -0
- package/llms/agent-executor-testing.txt +26 -0
- package/llms/agent-executor.txt +40 -0
- package/llms/agent-runtime-harness.txt +68 -5
- package/llms/agent-runtime-openrouter.txt +8 -2
- package/llms/agent-runtime-postgres.txt +30 -0
- package/llms/agent-runtime-react.txt +1 -1
- package/llms/agent-runtime-realtime.txt +1 -1
- package/llms/agent-runtime-sandbox.txt +5 -2
- package/llms/agent-runtime-sqlite-bun.txt +2 -2
- package/llms/agent-runtime-sqlite-node.txt +2 -2
- package/llms/agent-runtime-testing.txt +2 -1
- package/llms/agent-runtime.2.txt +450 -501
- package/llms/agent-runtime.3.txt +229 -267
- package/llms/agent-runtime.4.txt +23 -242
- package/llms/agent-runtime.5.txt +1 -1
- package/llms/agent-runtime.txt +551 -2
- package/llms/application-diagnostic-journal.txt +2 -0
- package/llms/application.2.txt +3 -0
- package/llms/application.3.txt +21 -4
- package/llms/application.txt +4 -1
- package/llms/cli.2.txt +259 -99
- package/llms/cli.3.txt +90 -0
- package/llms/cli.txt +95 -184
- package/llms/contract.txt +7 -6
- package/llms/declaration.txt +1 -1
- package/llms/files.txt +11 -0
- package/llms/handler.txt +25 -0
- package/llms/http.txt +18 -1
- package/llms/node.txt +3 -2
- package/llms/observability.2.txt +105 -0
- package/llms/observability.txt +14 -90
- package/llms/primitives.txt +27 -0
- package/llms/process.2.txt +2 -2
- package/llms/process.txt +10 -9
- package/llms/realtime.txt +11 -0
- package/llms/server.2.txt +355 -0
- package/llms/server.4.txt +45 -6
- package/llms/server.5.txt +6 -1
- package/llms/server.txt +143 -256
- package/llms/service-host-macos.txt +53 -0
- package/llms/service-host.txt +69 -0
- package/llms/spend-testing.txt +21 -0
- package/llms/spend.txt +173 -0
- package/llms/stitchkit.2.txt +368 -42
- package/llms/stitchkit.3.txt +164 -13
- package/llms/stitchkit.txt +95 -417
- package/llms/sync-postgres.txt +31 -0
- package/llms/sync.txt +396 -0
- package/llms/telegram-html.txt +4 -1
- package/llms/telegram.2.txt +4 -4
- package/llms/telegram.txt +105 -14
- package/llms/testing.txt +4 -3
- package/llms/tools-connections.txt +4 -4
- package/llms/tools.2.txt +78 -17
- package/llms/tools.3.txt +12 -8
- package/llms/tools.txt +85 -78
- package/llms/upgrading-0.127.0.txt +1059 -0
- package/llms/upgrading.txt +1 -0
- package/llms-full.txt +3557 -531
- package/llms.txt +43 -27
- package/native/darwin-arm64.node +0 -0
- package/native/darwin-x64.node +0 -0
- package/native-assets.json +4 -4
- package/package.json +67 -9
- package/dist/agent-runtime/sandbox-coding.d.ts.map +0 -1
- package/dist/agent-runtime/sqlite-events.d.ts +0 -5
- package/dist/agent-runtime/sqlite-events.d.ts.map +0 -1
- package/dist/agent-runtime/sqlite-history.d.ts +0 -7
- package/dist/agent-runtime/sqlite-history.d.ts.map +0 -1
- package/dist/agent-runtime/sqlite-ledger.d.ts +0 -7
- package/dist/agent-runtime/sqlite-ledger.d.ts.map +0 -1
- package/dist/agent-runtime/sqlite-reads.d.ts +0 -14
- package/dist/agent-runtime/sqlite-reads.d.ts.map +0 -1
- package/dist/agent-runtime/sqlite-rows.d.ts.map +0 -1
- package/dist/agent-runtime/tool-progress.d.ts.map +0 -1
- package/dist/entrypoints/application/schemas.d.ts +0 -15
- package/dist/entrypoints/application/schemas.d.ts.map +0 -1
- package/dist/entrypoints/application/schemas.js +0 -27
- package/dist/index-0s4xebbg.js +0 -8
- package/dist/index-57ppvpw0.js +0 -1150
- package/dist/index-5dmk54h9.js +0 -256
- package/dist/index-7cn66qdk.js +0 -92
- package/dist/index-8x0q6yfb.js +0 -247
- package/dist/index-a5qr2rj6.js +0 -26
- package/dist/index-b0kddvzw.js +0 -35
- package/dist/index-drcjjhy1.js +0 -40
- package/dist/index-eemvahkc.js +0 -21
- package/dist/index-gfk7nrht.js +0 -0
- package/dist/index-jp2qd9jb.js +0 -108
- package/dist/index-nx6eazt0.js +0 -160
- package/dist/index-wxadzdb7.js +0 -55
- package/dist/internal/until-aborted.d.ts +0 -9
- package/dist/internal/until-aborted.d.ts.map +0 -1
- package/dist/server/unix-client-error.d.ts +0 -9
- package/dist/server/unix-client-error.d.ts.map +0 -1
- package/llms/application-schemas.txt +0 -42
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
2
|
checkTelegramHtml2
|
|
3
|
-
} from "../../index-
|
|
3
|
+
} from "../../index-97q9kykw.js";
|
|
4
4
|
import {
|
|
5
5
|
TELEGRAM_TEXT_LIMIT2,
|
|
6
6
|
TELEGRAM_CAPTION_LIMIT2,
|
|
7
|
+
TELEGRAM_CODE_LANGUAGE_PATTERN,
|
|
8
|
+
safeTelegramLinkHref,
|
|
9
|
+
mayOpenInside,
|
|
10
|
+
textOf,
|
|
11
|
+
normalizeTelegramHtmlNodes,
|
|
7
12
|
parseTelegramHtml2,
|
|
8
13
|
escapeTelegramHtml2,
|
|
9
14
|
renderTelegramHtml2,
|
|
@@ -11,16 +16,848 @@ import {
|
|
|
11
16
|
telegramHtmlText2,
|
|
12
17
|
splitTelegramHtml2,
|
|
13
18
|
truncateTelegramHtml2
|
|
14
|
-
} from "../../index-
|
|
19
|
+
} from "../../index-ac5rj3d4.js";
|
|
20
|
+
// src/telegram/html/markdown-inline.ts
|
|
21
|
+
var MAX_INLINE_DEPTH = 32;
|
|
22
|
+
var MAX_LINK_PARENS = 32;
|
|
23
|
+
var ENTITY_AT = /&(?:(amp|lt|gt|quot)|#(\d{1,7})|#[xX]([0-9a-fA-F]{1,6}));/y;
|
|
24
|
+
var ENTITY_ALL = /&(?:(amp|lt|gt|quot)|#(\d{1,7})|#[xX]([0-9a-fA-F]{1,6}));/g;
|
|
25
|
+
var NAMED = { amp: "&", lt: "<", gt: ">", quot: '"' };
|
|
26
|
+
var WORD_END = /[\p{L}\p{N}_]$/u;
|
|
27
|
+
var WORD_START = /^[\p{L}\p{N}_]/u;
|
|
28
|
+
var ASCII_PUNCT = /^[!-/:-@[-`{-~]$/;
|
|
29
|
+
var ANGLE_URL = /<((?:\\.|[^<>\\])*)>/y;
|
|
30
|
+
var LINK_TAIL = /[ \t]*(?:(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*')[ \t]*)?\)/y;
|
|
31
|
+
var MARKER_MAP = {
|
|
32
|
+
"*": ["***", "**", "*"],
|
|
33
|
+
_: ["___", "__", "_"],
|
|
34
|
+
"~": ["~~"],
|
|
35
|
+
"|": ["||"]
|
|
36
|
+
};
|
|
37
|
+
var textNode = (text) => ({ kind: "text", text });
|
|
38
|
+
var isSpace = (c) => c === " " || c === "\t" || c === `
|
|
39
|
+
` || c === "\r";
|
|
40
|
+
function tagsFor(m) {
|
|
41
|
+
if (m.length === 3)
|
|
42
|
+
return ["b", "i"];
|
|
43
|
+
if (m === "~~")
|
|
44
|
+
return ["s"];
|
|
45
|
+
if (m === "||")
|
|
46
|
+
return ["tg-spoiler"];
|
|
47
|
+
return m.length === 2 ? ["b"] : ["i"];
|
|
48
|
+
}
|
|
49
|
+
function decodeEntity(n, dec, hex) {
|
|
50
|
+
if (n !== undefined)
|
|
51
|
+
return NAMED[n];
|
|
52
|
+
const c = Number.parseInt(dec ?? hex ?? "", dec === undefined ? 16 : 10);
|
|
53
|
+
const ok = c >= 32 ? c <= 55295 || c >= 57344 && c <= 65533 || c >= 65536 && c <= 1114111 : c === 9 || c === 10 || c === 13;
|
|
54
|
+
return ok ? String.fromCodePoint(c) : undefined;
|
|
55
|
+
}
|
|
56
|
+
var decodeEntities = (text) => text.replace(ENTITY_ALL, (raw, n, d, h) => decodeEntity(n, d, h) ?? raw);
|
|
57
|
+
function runBegin(text, at, char) {
|
|
58
|
+
let start = at;
|
|
59
|
+
while (start > 0 && text[start - 1] === char)
|
|
60
|
+
start -= 1;
|
|
61
|
+
return start;
|
|
62
|
+
}
|
|
63
|
+
function runEnd(text, at, char) {
|
|
64
|
+
let end = at;
|
|
65
|
+
while (text[end] === char)
|
|
66
|
+
end += 1;
|
|
67
|
+
return end;
|
|
68
|
+
}
|
|
69
|
+
function countRun(text, start, char) {
|
|
70
|
+
let end = start;
|
|
71
|
+
while (text[end] === char)
|
|
72
|
+
end += 1;
|
|
73
|
+
return end - start;
|
|
74
|
+
}
|
|
75
|
+
function tagAt(text, at, tag) {
|
|
76
|
+
for (let k = 0;k < tag.length; k += 1) {
|
|
77
|
+
if ((text[at + k] ?? "").toLowerCase() !== tag[k])
|
|
78
|
+
return false;
|
|
79
|
+
}
|
|
80
|
+
return true;
|
|
81
|
+
}
|
|
82
|
+
function codeSpanClose(index, from, ticks) {
|
|
83
|
+
const starts = index.runs.get(ticks);
|
|
84
|
+
if (starts === undefined)
|
|
85
|
+
return -1;
|
|
86
|
+
let low = 0;
|
|
87
|
+
let high = starts.length;
|
|
88
|
+
while (low < high) {
|
|
89
|
+
const mid = low + high >> 1;
|
|
90
|
+
if ((starts[mid] ?? 0) < from)
|
|
91
|
+
low = mid + 1;
|
|
92
|
+
else
|
|
93
|
+
high = mid;
|
|
94
|
+
}
|
|
95
|
+
return starts[low] ?? -1;
|
|
96
|
+
}
|
|
97
|
+
function skipEscapedOrCode(index, i) {
|
|
98
|
+
const { text } = index;
|
|
99
|
+
if (text[i] === "\\" && i + 1 < text.length)
|
|
100
|
+
return i + 2;
|
|
101
|
+
if (text[i] !== "`")
|
|
102
|
+
return i;
|
|
103
|
+
const ticks = countRun(text, i, "`");
|
|
104
|
+
const close = codeSpanClose(index, i + ticks, ticks);
|
|
105
|
+
return close === -1 ? i + ticks : close + ticks;
|
|
106
|
+
}
|
|
107
|
+
function indexInline(text) {
|
|
108
|
+
const runs = new Map;
|
|
109
|
+
for (let i = text.indexOf("`");i !== -1; ) {
|
|
110
|
+
const run = countRun(text, i, "`");
|
|
111
|
+
const list = runs.get(run);
|
|
112
|
+
if (list === undefined)
|
|
113
|
+
runs.set(run, [i]);
|
|
114
|
+
else
|
|
115
|
+
list.push(i);
|
|
116
|
+
i = text.indexOf("`", i + run);
|
|
117
|
+
}
|
|
118
|
+
const underlineClose = new Map;
|
|
119
|
+
const bracketClose = new Map;
|
|
120
|
+
const index = { text, runs, underlineClose, bracketClose };
|
|
121
|
+
const underlines = [];
|
|
122
|
+
const brackets = [];
|
|
123
|
+
for (let i = 0;i < text.length; ) {
|
|
124
|
+
const next = skipEscapedOrCode(index, i);
|
|
125
|
+
if (next !== i) {
|
|
126
|
+
i = next;
|
|
127
|
+
continue;
|
|
128
|
+
}
|
|
129
|
+
if (tagAt(text, i, "<u>")) {
|
|
130
|
+
underlines.push(i);
|
|
131
|
+
i += 3;
|
|
132
|
+
continue;
|
|
133
|
+
}
|
|
134
|
+
if (tagAt(text, i, "</u>")) {
|
|
135
|
+
const open = underlines.pop();
|
|
136
|
+
if (open !== undefined)
|
|
137
|
+
underlineClose.set(open, i);
|
|
138
|
+
i += 4;
|
|
139
|
+
continue;
|
|
140
|
+
}
|
|
141
|
+
if (text[i] === "[")
|
|
142
|
+
brackets.push(i);
|
|
143
|
+
else if (text[i] === "]") {
|
|
144
|
+
const open = brackets.pop();
|
|
145
|
+
if (open !== undefined)
|
|
146
|
+
bracketClose.set(open, i);
|
|
147
|
+
}
|
|
148
|
+
i += 1;
|
|
149
|
+
}
|
|
150
|
+
return index;
|
|
151
|
+
}
|
|
152
|
+
function parseLinkAt(index, start) {
|
|
153
|
+
const { text } = index;
|
|
154
|
+
const close = index.bracketClose.get(start);
|
|
155
|
+
if (close === undefined || text[close + 1] !== "(")
|
|
156
|
+
return;
|
|
157
|
+
const label = text.slice(start + 1, close);
|
|
158
|
+
let p = close + 2;
|
|
159
|
+
while (text[p] === " " || text[p] === "\t")
|
|
160
|
+
p += 1;
|
|
161
|
+
let rawUrl = "";
|
|
162
|
+
ANGLE_URL.lastIndex = p;
|
|
163
|
+
const angle = ANGLE_URL.exec(text);
|
|
164
|
+
if (angle !== null) {
|
|
165
|
+
rawUrl = (angle[1] ?? "").replace(/\\([!-/:-@[-`{-~])/g, "$1");
|
|
166
|
+
p = ANGLE_URL.lastIndex;
|
|
167
|
+
} else {
|
|
168
|
+
let parens = 0;
|
|
169
|
+
for (;p < text.length; p += 1) {
|
|
170
|
+
const ch = text[p] ?? "";
|
|
171
|
+
if (ch === "\\" && ASCII_PUNCT.test(text[p + 1] ?? "")) {
|
|
172
|
+
rawUrl += text[p + 1] ?? "";
|
|
173
|
+
p += 1;
|
|
174
|
+
continue;
|
|
175
|
+
}
|
|
176
|
+
if (ch === "(") {
|
|
177
|
+
parens += 1;
|
|
178
|
+
if (parens > MAX_LINK_PARENS)
|
|
179
|
+
return;
|
|
180
|
+
} else if (ch === ")") {
|
|
181
|
+
if (parens === 0)
|
|
182
|
+
return { label, rawUrl, end: p + 1 };
|
|
183
|
+
parens -= 1;
|
|
184
|
+
} else if (ch === " " || ch === "\t")
|
|
185
|
+
break;
|
|
186
|
+
rawUrl += ch;
|
|
187
|
+
}
|
|
188
|
+
if (parens !== 0)
|
|
189
|
+
return;
|
|
190
|
+
}
|
|
191
|
+
LINK_TAIL.lastIndex = p;
|
|
192
|
+
return LINK_TAIL.exec(text) === null ? undefined : { label, rawUrl, end: LINK_TAIL.lastIndex };
|
|
193
|
+
}
|
|
194
|
+
function findDelimiterClose(index, start, marker) {
|
|
195
|
+
const { text } = index;
|
|
196
|
+
const char = marker[0] ?? "";
|
|
197
|
+
const len = marker.length;
|
|
198
|
+
const canClose = (pos) => {
|
|
199
|
+
if (pos <= start || isSpace(text[pos - 1]))
|
|
200
|
+
return false;
|
|
201
|
+
const after = runEnd(text, pos + len, char);
|
|
202
|
+
return !WORD_START.test(text.slice(after, after + 2));
|
|
203
|
+
};
|
|
204
|
+
let inDouble = false;
|
|
205
|
+
let singles = 0;
|
|
206
|
+
for (let i = start;i < text.length; ) {
|
|
207
|
+
const next = skipEscapedOrCode(index, i);
|
|
208
|
+
if (next !== i)
|
|
209
|
+
i = next;
|
|
210
|
+
else if (text[i] !== char)
|
|
211
|
+
i += 1;
|
|
212
|
+
else {
|
|
213
|
+
const run = countRun(text, i, char);
|
|
214
|
+
if (len === 1) {
|
|
215
|
+
if (run === 2)
|
|
216
|
+
inDouble = !inDouble;
|
|
217
|
+
else if (run === 3 && inDouble) {
|
|
218
|
+
inDouble = false;
|
|
219
|
+
if (canClose(i + 2))
|
|
220
|
+
return i + 2;
|
|
221
|
+
} else if (run === 1 && canClose(i))
|
|
222
|
+
return i;
|
|
223
|
+
} else {
|
|
224
|
+
if (run === 1)
|
|
225
|
+
singles += 1;
|
|
226
|
+
const pos = len === 2 && run === 3 && singles % 2 === 1 ? i + 1 : i;
|
|
227
|
+
if (run >= len && canClose(pos))
|
|
228
|
+
return pos;
|
|
229
|
+
}
|
|
230
|
+
i += run;
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
return -1;
|
|
234
|
+
}
|
|
235
|
+
var wrapStyle = (tag, children, anc) => children.length === 0 ? [] : anc.includes(tag) || !mayOpenInside(tag, anc) ? [...children] : [{ kind: "element", tag, children }];
|
|
236
|
+
function append(target, nodes) {
|
|
237
|
+
for (const node of nodes)
|
|
238
|
+
target.push(node);
|
|
239
|
+
}
|
|
240
|
+
function parseInline(text, anc, depth = 0) {
|
|
241
|
+
if (text === "")
|
|
242
|
+
return [];
|
|
243
|
+
if (depth >= MAX_INLINE_DEPTH)
|
|
244
|
+
return [textNode(decodeEntities(text))];
|
|
245
|
+
const index = indexInline(text);
|
|
246
|
+
const nodes = [];
|
|
247
|
+
let pending = "";
|
|
248
|
+
const emit = (more) => {
|
|
249
|
+
if (pending !== "")
|
|
250
|
+
nodes.push(textNode(pending));
|
|
251
|
+
pending = "";
|
|
252
|
+
append(nodes, more);
|
|
253
|
+
};
|
|
254
|
+
const noCloser = new Set;
|
|
255
|
+
let run = { char: "", start: -1, end: -1 };
|
|
256
|
+
const runOf = (at, char) => {
|
|
257
|
+
if (run.char !== char || at >= run.end || at < run.start)
|
|
258
|
+
run = { char, start: runBegin(text, at, char), end: runEnd(text, at, char) };
|
|
259
|
+
return run.start;
|
|
260
|
+
};
|
|
261
|
+
outer:
|
|
262
|
+
for (let i = 0;i < text.length; ) {
|
|
263
|
+
const ch = text[i] ?? "";
|
|
264
|
+
if (ch === "\\" && ASCII_PUNCT.test(text[i + 1] ?? "")) {
|
|
265
|
+
pending += text[i + 1] ?? "";
|
|
266
|
+
i += 2;
|
|
267
|
+
continue;
|
|
268
|
+
}
|
|
269
|
+
if (ch === "`") {
|
|
270
|
+
const ticks = countRun(text, i, "`");
|
|
271
|
+
const close = codeSpanClose(index, i + ticks, ticks);
|
|
272
|
+
if (close === -1) {
|
|
273
|
+
pending += text.slice(i, i + ticks);
|
|
274
|
+
i += ticks;
|
|
275
|
+
} else {
|
|
276
|
+
const raw = text.slice(i + ticks, close).replace(/\n/g, " ");
|
|
277
|
+
const padded = raw.length > 2 && raw[0] === " " && raw.at(-1) === " ";
|
|
278
|
+
const code = padded && /[^ ]/.test(raw) ? raw.slice(1, -1) : raw;
|
|
279
|
+
if (mayOpenInside("code", anc)) {
|
|
280
|
+
emit([{ kind: "element", tag: "code", children: [textNode(code)] }]);
|
|
281
|
+
} else
|
|
282
|
+
pending += code;
|
|
283
|
+
i = close + ticks;
|
|
284
|
+
}
|
|
285
|
+
continue;
|
|
286
|
+
}
|
|
287
|
+
if (ch === "&") {
|
|
288
|
+
ENTITY_AT.lastIndex = i;
|
|
289
|
+
const m = ENTITY_AT.exec(text);
|
|
290
|
+
const decoded = m ? decodeEntity(m[1], m[2], m[3]) : undefined;
|
|
291
|
+
pending += decoded ?? "&";
|
|
292
|
+
i = decoded !== undefined ? ENTITY_AT.lastIndex : i + 1;
|
|
293
|
+
continue;
|
|
294
|
+
}
|
|
295
|
+
const underline = ch === "<" ? index.underlineClose.get(i) : undefined;
|
|
296
|
+
if (underline !== undefined) {
|
|
297
|
+
const next = anc.includes("u") ? anc : [...anc, "u"];
|
|
298
|
+
emit(wrapStyle("u", parseInline(text.slice(i + 3, underline), next, depth + 1), anc));
|
|
299
|
+
i = underline + 4;
|
|
300
|
+
continue;
|
|
301
|
+
}
|
|
302
|
+
if (ch === "!" && text[i + 1] === "[" || ch === "[") {
|
|
303
|
+
const link = parseLinkAt(index, ch === "!" ? i + 1 : i);
|
|
304
|
+
if (link !== undefined) {
|
|
305
|
+
const href = link.rawUrl.includes('"') ? undefined : safeTelegramLinkHref(decodeEntities(link.rawUrl));
|
|
306
|
+
if (href === undefined) {
|
|
307
|
+
pending += decodeEntities(text.slice(i, link.end));
|
|
308
|
+
} else if (mayOpenInside("a", anc)) {
|
|
309
|
+
const children = parseInline(link.label, [...anc, "a"], depth + 1);
|
|
310
|
+
if (children.length > 0)
|
|
311
|
+
emit([{ kind: "element", tag: "a", href, children }]);
|
|
312
|
+
} else
|
|
313
|
+
emit(parseInline(link.label, anc, depth + 1));
|
|
314
|
+
i = link.end;
|
|
315
|
+
continue;
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
for (const marker of MARKER_MAP[ch] ?? []) {
|
|
319
|
+
const openEnd = i + marker.length;
|
|
320
|
+
if (!text.startsWith(marker, i) || noCloser.has(marker))
|
|
321
|
+
continue;
|
|
322
|
+
const runStart = runOf(i, ch);
|
|
323
|
+
if (WORD_END.test(text.slice(Math.max(0, runStart - 2), runStart)))
|
|
324
|
+
continue;
|
|
325
|
+
if (openEnd >= text.length || isSpace(text[openEnd]))
|
|
326
|
+
continue;
|
|
327
|
+
const close = findDelimiterClose(index, openEnd, marker);
|
|
328
|
+
if (close === -1) {
|
|
329
|
+
noCloser.add(marker);
|
|
330
|
+
continue;
|
|
331
|
+
}
|
|
332
|
+
const tags = tagsFor(marker);
|
|
333
|
+
const next = [...anc, ...tags.filter((t) => !anc.includes(t) && mayOpenInside(t, anc))];
|
|
334
|
+
const inner = parseInline(text.slice(openEnd, close), next, depth + 1);
|
|
335
|
+
emit(tags.reduceRight((acc, tag) => wrapStyle(tag, acc, anc), inner));
|
|
336
|
+
i = close + marker.length;
|
|
337
|
+
continue outer;
|
|
338
|
+
}
|
|
339
|
+
pending += ch;
|
|
340
|
+
i += 1;
|
|
341
|
+
}
|
|
342
|
+
emit([]);
|
|
343
|
+
return nodes;
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
// src/telegram/html/markdown-lines.ts
|
|
347
|
+
var FENCE_OPEN = /^([ ]{0,3})(`{3,}|~{3,})(.*)$/;
|
|
348
|
+
var FENCE_CLOSE = /^[ ]{0,3}(`{3,}|~{3,})[ \t]*$/;
|
|
349
|
+
var QUOTE = /^[ ]{0,3}> ?(.*)$/;
|
|
350
|
+
var HEADING_OPEN = /^[ ]{0,3}(#{1,6})([ \t]+)/;
|
|
351
|
+
var HR = /^[ ]{0,3}(?:(?:\*[ \t]*){3,}|(?:-[ \t]*){3,}|(?:_[ \t]*){3,})$/;
|
|
352
|
+
var LIST_ITEM = /^([ \t]*)(?:(?:[-*+]|\d+[.)])[ \t]+\[([ xX])\]|([-*+])|(\d+)[.)])[ \t]+(.*)$/;
|
|
353
|
+
var DETAILS_OPEN = /^[ \t]*<details(?:\s[^<>]*)?>(.*)$/i;
|
|
354
|
+
var DETAILS_TOKEN = /<(\/?)details(?:\s[^<>]*)?>/gi;
|
|
355
|
+
var isBlank = (char) => char === " " || char === "\t";
|
|
356
|
+
function headingTitle(line) {
|
|
357
|
+
const open = HEADING_OPEN.exec(line);
|
|
358
|
+
if (open === null)
|
|
359
|
+
return;
|
|
360
|
+
const content = line.slice(open[0].length);
|
|
361
|
+
if (content === "")
|
|
362
|
+
return (open[2] ?? "").length >= 2 ? "" : undefined;
|
|
363
|
+
let end = content.length;
|
|
364
|
+
while (end > 0 && isBlank(content[end - 1]))
|
|
365
|
+
end -= 1;
|
|
366
|
+
let hashes = end;
|
|
367
|
+
while (hashes > 0 && content[hashes - 1] === "#")
|
|
368
|
+
hashes -= 1;
|
|
369
|
+
if (hashes < end && hashes > 0 && isBlank(content[hashes - 1]))
|
|
370
|
+
end = hashes;
|
|
371
|
+
return content.slice(0, end).trim();
|
|
372
|
+
}
|
|
373
|
+
function matchFenceOpen(line) {
|
|
374
|
+
const match = FENCE_OPEN.exec(line);
|
|
375
|
+
if (!match)
|
|
376
|
+
return;
|
|
377
|
+
const run = match[2] ?? "";
|
|
378
|
+
const info = match[3] ?? "";
|
|
379
|
+
const char = run[0] === "~" ? "~" : "`";
|
|
380
|
+
if (char === "`" && info.includes("`"))
|
|
381
|
+
return;
|
|
382
|
+
return {
|
|
383
|
+
char,
|
|
384
|
+
length: run.length,
|
|
385
|
+
info,
|
|
386
|
+
openLine: line,
|
|
387
|
+
closeLine: char.repeat(run.length)
|
|
388
|
+
};
|
|
389
|
+
}
|
|
390
|
+
function isFenceClose(line, fence) {
|
|
391
|
+
const match = FENCE_CLOSE.exec(line);
|
|
392
|
+
if (!match)
|
|
393
|
+
return false;
|
|
394
|
+
const run = match[1] ?? "";
|
|
395
|
+
return run[0] === fence.char && run.length >= fence.length;
|
|
396
|
+
}
|
|
397
|
+
function findClosingFenceIndex(lines, openIndex, fence) {
|
|
398
|
+
for (let index = openIndex + 1;index < lines.length; index += 1) {
|
|
399
|
+
if (isFenceClose(lines[index] ?? "", fence))
|
|
400
|
+
return index;
|
|
401
|
+
}
|
|
402
|
+
return -1;
|
|
403
|
+
}
|
|
404
|
+
function isTableSeparator(line) {
|
|
405
|
+
const cells = line.trim().replace(/^\|/, "").replace(/\|$/, "");
|
|
406
|
+
if (cells === "")
|
|
407
|
+
return false;
|
|
408
|
+
for (const cell of cells.split("|")) {
|
|
409
|
+
const body = cell.trim();
|
|
410
|
+
const dashes = body.replace(/^:/, "").replace(/:$/, "");
|
|
411
|
+
if (dashes === "" || /[^-]/.test(dashes))
|
|
412
|
+
return false;
|
|
413
|
+
}
|
|
414
|
+
return true;
|
|
415
|
+
}
|
|
416
|
+
function splitRow(line) {
|
|
417
|
+
const body = line.trim().replace(/^\||(?<!\\)\|$/g, "");
|
|
418
|
+
return body.split(/(?<!\\)\|/).map((cell) => cell.replaceAll("\\|", "|").trim());
|
|
419
|
+
}
|
|
420
|
+
function isTableStart(line, nextLine) {
|
|
421
|
+
return line.includes("|") && nextLine.includes("|") && isTableSeparator(nextLine) && splitRow(line).length === splitRow(nextLine).length;
|
|
422
|
+
}
|
|
423
|
+
function startsOtherBlock(line) {
|
|
424
|
+
return QUOTE.test(line) || HR.test(line) || headingTitle(line) !== undefined || LIST_ITEM.test(line) || DETAILS_OPEN.test(line);
|
|
425
|
+
}
|
|
426
|
+
function tableBodyEnd(lines, first) {
|
|
427
|
+
let index = first;
|
|
428
|
+
for (;index < lines.length; index += 1) {
|
|
429
|
+
const row = lines[index] ?? "";
|
|
430
|
+
if (!row.includes("|") || !row.trim() || matchFenceOpen(row))
|
|
431
|
+
break;
|
|
432
|
+
if (QUOTE.test(row) || headingTitle(row) !== undefined || HR.test(row))
|
|
433
|
+
break;
|
|
434
|
+
}
|
|
435
|
+
return index;
|
|
436
|
+
}
|
|
437
|
+
|
|
438
|
+
// src/telegram/html/markdown.ts
|
|
439
|
+
var MAX_BLOCK_DEPTH = 32;
|
|
440
|
+
var MAX_TABLE_GROWTH = 4;
|
|
441
|
+
var SUMMARY_OPEN = /<summary(?:\s[^<>]*)?>/i;
|
|
442
|
+
var SUMMARY_CLOSE = /<\/summary>/gi;
|
|
443
|
+
var NEWLINE = textNode(`
|
|
444
|
+
`);
|
|
445
|
+
var joinParts = (parts) => parts.flatMap((part, i) => i > 0 ? [NEWLINE, ...part] : [...part]);
|
|
446
|
+
var boldInline = (title, anc) => wrapStyle("b", parseInline(title, anc.includes("b") ? anc : [...anc, "b"]), anc);
|
|
447
|
+
function wrapPre(text, anc, language) {
|
|
448
|
+
if (text === "")
|
|
449
|
+
return [];
|
|
450
|
+
if (!mayOpenInside("pre", anc))
|
|
451
|
+
return [textNode(text)];
|
|
452
|
+
const children = [textNode(text)];
|
|
453
|
+
const pre = language ? { kind: "element", tag: "pre", language, children } : { kind: "element", tag: "pre", children };
|
|
454
|
+
return [pre];
|
|
455
|
+
}
|
|
456
|
+
function formatGfmTable(headerLine, sepLine, body) {
|
|
457
|
+
const header = splitRow(headerLine);
|
|
458
|
+
const aligns = splitRow(sepLine).map((c) => c.startsWith(":") && c.endsWith(":") ? "c" : c.endsWith(":") ? "r" : "l");
|
|
459
|
+
const rows = [header, ...body.map(splitRow)];
|
|
460
|
+
const widths = [];
|
|
461
|
+
let source = sepLine.length;
|
|
462
|
+
for (const row of rows) {
|
|
463
|
+
row.forEach((cell, c) => {
|
|
464
|
+
widths[c] = Math.max(widths[c] ?? 1, cell.length);
|
|
465
|
+
source += cell.length + 3;
|
|
466
|
+
});
|
|
467
|
+
}
|
|
468
|
+
const last = widths.length - 1;
|
|
469
|
+
const lastWidth = widths[last] ?? 1;
|
|
470
|
+
const lead = widths.slice(0, last).reduce((sum, w) => sum + w + 3, 0);
|
|
471
|
+
const cell = (value, c) => {
|
|
472
|
+
const room = (widths[c] ?? 1) - value.length;
|
|
473
|
+
if (aligns[c] === "r")
|
|
474
|
+
return " ".repeat(room) + value;
|
|
475
|
+
const before = aligns[c] === "c" ? room >> 1 : 0;
|
|
476
|
+
return " ".repeat(before) + value + (c === last ? "" : " ".repeat(room - before));
|
|
477
|
+
};
|
|
478
|
+
const lastLength = (value) => aligns[last] === "r" ? lastWidth : value.length + (aligns[last] === "c" ? lastWidth - value.length >> 1 : 0);
|
|
479
|
+
let size = lead + lastWidth;
|
|
480
|
+
for (const row of rows)
|
|
481
|
+
size += lead + lastLength(row[last] ?? "") + 1;
|
|
482
|
+
if (size > MAX_TABLE_GROWTH * source)
|
|
483
|
+
return rows.map((row) => row.join(" | ")).join(`
|
|
484
|
+
`);
|
|
485
|
+
const render = (row) => widths.map((_, c) => cell(row[c] ?? "", c)).join(" | ").trimEnd();
|
|
486
|
+
const rule = widths.map((w) => "-".repeat(w)).join("-+-");
|
|
487
|
+
return [render(header), rule, ...rows.slice(1).map(render)].join(`
|
|
488
|
+
`);
|
|
489
|
+
}
|
|
490
|
+
function scanDetails(lines) {
|
|
491
|
+
const spans = new Map;
|
|
492
|
+
const fenced = [];
|
|
493
|
+
const open = [];
|
|
494
|
+
let fence;
|
|
495
|
+
lines.forEach((line, i) => {
|
|
496
|
+
if (fence !== undefined) {
|
|
497
|
+
fenced[i] = true;
|
|
498
|
+
if (isFenceClose(line, fence))
|
|
499
|
+
fence = undefined;
|
|
500
|
+
return;
|
|
501
|
+
}
|
|
502
|
+
const opener = DETAILS_OPEN.exec(line);
|
|
503
|
+
const rest = opener === null ? line : opener[1] ?? "";
|
|
504
|
+
const offset = line.length - rest.length;
|
|
505
|
+
if (opener !== null)
|
|
506
|
+
open.push(i);
|
|
507
|
+
fence = matchFenceOpen(rest);
|
|
508
|
+
if (fence !== undefined) {
|
|
509
|
+
fenced[i] = true;
|
|
510
|
+
return;
|
|
511
|
+
}
|
|
512
|
+
for (const token of rest.matchAll(DETAILS_TOKEN)) {
|
|
513
|
+
if (token[1] !== "/") {
|
|
514
|
+
open.push(undefined);
|
|
515
|
+
continue;
|
|
516
|
+
}
|
|
517
|
+
const start = open.pop();
|
|
518
|
+
if (start === undefined)
|
|
519
|
+
continue;
|
|
520
|
+
const closeAt = offset + (token.index ?? 0);
|
|
521
|
+
spans.set(start, { endLine: i, closeAt, closeEnd: closeAt + token[0].length });
|
|
522
|
+
}
|
|
523
|
+
});
|
|
524
|
+
return { spans, fenced };
|
|
525
|
+
}
|
|
526
|
+
function takeSummary(text, firstSegment) {
|
|
527
|
+
const open = SUMMARY_OPEN.exec(text);
|
|
528
|
+
if (open === null)
|
|
529
|
+
return;
|
|
530
|
+
SUMMARY_CLOSE.lastIndex = open.index + open[0].length;
|
|
531
|
+
const close = SUMMARY_CLOSE.exec(text);
|
|
532
|
+
if (close === null)
|
|
533
|
+
return;
|
|
534
|
+
const title = text.slice(open.index + open[0].length, close.index);
|
|
535
|
+
const before = text.slice(0, open.index);
|
|
536
|
+
const after = text.slice(SUMMARY_CLOSE.lastIndex);
|
|
537
|
+
return {
|
|
538
|
+
title: title.split(`
|
|
539
|
+
`).map((piece) => piece.trim()).filter((piece) => piece !== "").join(" "),
|
|
540
|
+
rest: firstSegment && /^[ \t]*$/.test(before) ? after.replace(/^[ \t]*\n/, "") : before + after
|
|
541
|
+
};
|
|
542
|
+
}
|
|
543
|
+
function parseDetailsBlock(lines, start, span, scan, anc, depth) {
|
|
544
|
+
const segments = [];
|
|
545
|
+
const push = (line, fenced) => {
|
|
546
|
+
const tail = segments.at(-1);
|
|
547
|
+
if (tail?.fenced === fenced)
|
|
548
|
+
tail.lines.push(line);
|
|
549
|
+
else
|
|
550
|
+
segments.push({ fenced, lines: [line] });
|
|
551
|
+
};
|
|
552
|
+
const opener = DETAILS_OPEN.exec(lines[start] ?? "");
|
|
553
|
+
const firstRest = opener?.[1] ?? "";
|
|
554
|
+
const offset = (lines[start] ?? "").length - firstRest.length;
|
|
555
|
+
for (let i = start;i <= span.endLine; i += 1) {
|
|
556
|
+
const from = i === start ? offset : 0;
|
|
557
|
+
const line = lines[i] ?? "";
|
|
558
|
+
const fenced = scan.fenced[i] === true;
|
|
559
|
+
if (i === span.endLine && !fenced) {
|
|
560
|
+
const content = line.slice(from, span.closeAt);
|
|
561
|
+
if (content.trim())
|
|
562
|
+
push(content, false);
|
|
563
|
+
break;
|
|
564
|
+
}
|
|
565
|
+
if (i === start && !firstRest.trim())
|
|
566
|
+
continue;
|
|
567
|
+
push(line.slice(from), fenced);
|
|
568
|
+
}
|
|
569
|
+
let title = "";
|
|
570
|
+
for (const seg of segments) {
|
|
571
|
+
if (seg.fenced)
|
|
572
|
+
continue;
|
|
573
|
+
const summary = takeSummary(seg.lines.join(`
|
|
574
|
+
`), seg === segments[0]);
|
|
575
|
+
if (summary === undefined)
|
|
576
|
+
continue;
|
|
577
|
+
title = summary.title;
|
|
578
|
+
seg.lines = [summary.rest];
|
|
579
|
+
break;
|
|
580
|
+
}
|
|
581
|
+
const rest = segments.flatMap((seg) => seg.lines).join(`
|
|
582
|
+
`);
|
|
583
|
+
const parts = [
|
|
584
|
+
...title ? [boldInline(title, anc)] : [],
|
|
585
|
+
...rest.trim() ? [parseBlocks(rest.split(`
|
|
586
|
+
`), anc, depth + 1)] : []
|
|
587
|
+
].filter((p) => p.length > 0);
|
|
588
|
+
return joinParts(parts);
|
|
589
|
+
}
|
|
590
|
+
function parseBlocks(lines, anc, depth) {
|
|
591
|
+
if (depth >= MAX_BLOCK_DEPTH)
|
|
592
|
+
return joinParts(lines.map((line) => parseInline(line, anc)));
|
|
593
|
+
const blocks = [];
|
|
594
|
+
const details = scanDetails(lines);
|
|
595
|
+
for (let i = 0;i < lines.length; i += 1) {
|
|
596
|
+
const line = lines[i] ?? "";
|
|
597
|
+
const fence = matchFenceOpen(line);
|
|
598
|
+
if (fence !== undefined) {
|
|
599
|
+
const closeIndex = findClosingFenceIndex(lines, i, fence);
|
|
600
|
+
if (closeIndex === -1) {
|
|
601
|
+
for (let r = i;r < lines.length; r += 1)
|
|
602
|
+
blocks.push([textNode(lines[r] ?? "")]);
|
|
603
|
+
break;
|
|
604
|
+
}
|
|
605
|
+
const token = fence.info.trim().split(/\s+/)[0] ?? "";
|
|
606
|
+
const lang = TELEGRAM_CODE_LANGUAGE_PATTERN.test(token) ? token : undefined;
|
|
607
|
+
blocks.push(wrapPre(lines.slice(i + 1, closeIndex).join(`
|
|
608
|
+
`), anc, lang));
|
|
609
|
+
i = closeIndex;
|
|
610
|
+
continue;
|
|
611
|
+
}
|
|
612
|
+
const span = details.spans.get(i);
|
|
613
|
+
if (span !== undefined) {
|
|
614
|
+
const nodes = parseDetailsBlock(lines, i, span, details, anc, depth);
|
|
615
|
+
if (nodes.length > 0)
|
|
616
|
+
blocks.push(nodes);
|
|
617
|
+
const trailing = (lines[span.endLine] ?? "").slice(span.closeEnd);
|
|
618
|
+
if (trailing.trim())
|
|
619
|
+
blocks.push(parseInline(trailing.trimStart(), anc));
|
|
620
|
+
i = span.endLine;
|
|
621
|
+
continue;
|
|
622
|
+
}
|
|
623
|
+
if (QUOTE.test(line)) {
|
|
624
|
+
const quoted = [];
|
|
625
|
+
for (;i < lines.length && QUOTE.test(lines[i] ?? ""); i += 1) {
|
|
626
|
+
quoted.push((lines[i] ?? "").replace(QUOTE, "$1"));
|
|
627
|
+
}
|
|
628
|
+
i -= 1;
|
|
629
|
+
const canQuote = mayOpenInside("blockquote", anc);
|
|
630
|
+
const children = parseBlocks(quoted, canQuote ? [...anc, "blockquote"] : anc, depth + 1);
|
|
631
|
+
if (!canQuote)
|
|
632
|
+
blocks.push(children);
|
|
633
|
+
else if (textOf(children).trim() !== "") {
|
|
634
|
+
blocks.push([{ kind: "element", tag: "blockquote", expandable: false, children }]);
|
|
635
|
+
} else
|
|
636
|
+
blocks.push([]);
|
|
637
|
+
continue;
|
|
638
|
+
}
|
|
639
|
+
if (HR.test(line)) {
|
|
640
|
+
blocks.push([textNode("───")]);
|
|
641
|
+
continue;
|
|
642
|
+
}
|
|
643
|
+
const title = headingTitle(line);
|
|
644
|
+
if (title !== undefined) {
|
|
645
|
+
blocks.push(title === "" ? [] : boldInline(title, anc));
|
|
646
|
+
continue;
|
|
647
|
+
}
|
|
648
|
+
const list = LIST_ITEM.exec(line);
|
|
649
|
+
if (list !== null) {
|
|
650
|
+
const indent = " ".repeat(Math.floor((list[1] ?? "").replaceAll("\t", " ").length / 2));
|
|
651
|
+
const marker = list[2] === " " ? "☐ " : list[2] ? "☑ " : list[4] ? `${list[4]}. ` : "• ";
|
|
652
|
+
blocks.push([textNode(indent + marker), ...parseInline(list[5] ?? "", anc)]);
|
|
653
|
+
continue;
|
|
654
|
+
}
|
|
655
|
+
const nextLine = lines[i + 1];
|
|
656
|
+
if (nextLine !== undefined && isTableStart(line, nextLine)) {
|
|
657
|
+
const end = tableBodyEnd(lines, i + 2);
|
|
658
|
+
blocks.push(wrapPre(formatGfmTable(line, nextLine, lines.slice(i + 2, end)), anc));
|
|
659
|
+
i = end - 1;
|
|
660
|
+
continue;
|
|
661
|
+
}
|
|
662
|
+
blocks.push(parseInline(line, anc));
|
|
663
|
+
}
|
|
664
|
+
return joinParts(blocks);
|
|
665
|
+
}
|
|
666
|
+
function markdownToTelegramHtml(source) {
|
|
667
|
+
if (source === "")
|
|
668
|
+
return "";
|
|
669
|
+
const lines = source.replace(/\r\n?/g, `
|
|
670
|
+
`).split(`
|
|
671
|
+
`);
|
|
672
|
+
return renderTelegramHtml2(normalizeTelegramHtmlNodes(parseBlocks(lines, [], 0)));
|
|
673
|
+
}
|
|
674
|
+
// src/telegram/html/markdown-split.ts
|
|
675
|
+
class TelegramMarkdownSplitError extends Error {
|
|
676
|
+
reason;
|
|
677
|
+
limit;
|
|
678
|
+
lineLength;
|
|
679
|
+
constructor(reason, details) {
|
|
680
|
+
const detail = details.lineLength === undefined ? `limit ${details.limit}` : `line length ${details.lineLength} exceeds limit ${details.limit}`;
|
|
681
|
+
super(`Telegram markdown split refused (${reason}): ${detail}`);
|
|
682
|
+
this.name = "TelegramMarkdownSplitError";
|
|
683
|
+
this.reason = reason;
|
|
684
|
+
this.limit = details.limit;
|
|
685
|
+
if (details.lineLength !== undefined)
|
|
686
|
+
this.lineLength = details.lineLength;
|
|
687
|
+
}
|
|
688
|
+
}
|
|
689
|
+
function splitTelegramMarkdown(source, options = {}) {
|
|
690
|
+
const limit = options.limit ?? TELEGRAM_TEXT_LIMIT2;
|
|
691
|
+
if (!Number.isSafeInteger(limit) || limit < 1) {
|
|
692
|
+
throw new TelegramMarkdownSplitError("invalid-limit", { limit });
|
|
693
|
+
}
|
|
694
|
+
const normalized = source.replace(/\r\n?/g, `
|
|
695
|
+
`);
|
|
696
|
+
if (normalized.trim() === "")
|
|
697
|
+
return [];
|
|
698
|
+
if (normalized.length <= limit)
|
|
699
|
+
return [normalized];
|
|
700
|
+
const lines = normalized.split(`
|
|
701
|
+
`);
|
|
702
|
+
const chunks = [];
|
|
703
|
+
let current = [];
|
|
704
|
+
let currentLength = 0;
|
|
705
|
+
let activeFence;
|
|
706
|
+
let inUnclosedFence = false;
|
|
707
|
+
const refuseLine = (lineLength) => {
|
|
708
|
+
throw new TelegramMarkdownSplitError("line-exceeds-limit", { limit, lineLength });
|
|
709
|
+
};
|
|
710
|
+
const pushLine = (line) => {
|
|
711
|
+
currentLength += current.length === 0 ? line.length : 1 + line.length;
|
|
712
|
+
current.push(line);
|
|
713
|
+
};
|
|
714
|
+
const flushOutsideFence = () => {
|
|
715
|
+
while (current.length > 0 && current[current.length - 1] === "")
|
|
716
|
+
current.pop();
|
|
717
|
+
if (current.length > 0)
|
|
718
|
+
chunks.push(current.join(`
|
|
719
|
+
`));
|
|
720
|
+
current = [];
|
|
721
|
+
currentLength = 0;
|
|
722
|
+
};
|
|
723
|
+
const flushInsideFence = (fence) => {
|
|
724
|
+
pushLine(fence.closeLine);
|
|
725
|
+
chunks.push(current.join(`
|
|
726
|
+
`));
|
|
727
|
+
current = [];
|
|
728
|
+
currentLength = 0;
|
|
729
|
+
};
|
|
730
|
+
for (let index = 0;index < lines.length; index += 1) {
|
|
731
|
+
const line = lines[index] ?? "";
|
|
732
|
+
if (activeFence !== undefined) {
|
|
733
|
+
if (index === activeFence.closeIndex) {
|
|
734
|
+
pushLine(line);
|
|
735
|
+
activeFence = undefined;
|
|
736
|
+
continue;
|
|
737
|
+
}
|
|
738
|
+
const nextIsClose = index + 1 === activeFence.closeIndex;
|
|
739
|
+
const closeReserve = 1 + (nextIsClose ? lines[activeFence.closeIndex]?.length ?? activeFence.closeLine.length : activeFence.closeLine.length);
|
|
740
|
+
if (currentLength + 1 + line.length + closeReserve <= limit) {
|
|
741
|
+
pushLine(line);
|
|
742
|
+
continue;
|
|
743
|
+
}
|
|
744
|
+
flushInsideFence(activeFence);
|
|
745
|
+
const freshLength = activeFence.openLine.length + 1 + line.length + closeReserve;
|
|
746
|
+
if (freshLength > limit) {
|
|
747
|
+
throw new TelegramMarkdownSplitError("line-exceeds-limit", {
|
|
748
|
+
limit,
|
|
749
|
+
lineLength: freshLength
|
|
750
|
+
});
|
|
751
|
+
}
|
|
752
|
+
pushLine(activeFence.openLine);
|
|
753
|
+
pushLine(line);
|
|
754
|
+
continue;
|
|
755
|
+
}
|
|
756
|
+
if (!inUnclosedFence) {
|
|
757
|
+
const opener = matchFenceOpen(line);
|
|
758
|
+
if (opener !== undefined) {
|
|
759
|
+
const closeIndex = findClosingFenceIndex(lines, index, opener);
|
|
760
|
+
if (closeIndex === -1) {
|
|
761
|
+
inUnclosedFence = true;
|
|
762
|
+
} else {
|
|
763
|
+
if (closeIndex === index + 1) {
|
|
764
|
+
const closeLine = lines[closeIndex] ?? opener.closeLine;
|
|
765
|
+
const blockLength = opener.openLine.length + 1 + closeLine.length;
|
|
766
|
+
if (current.length > 0 && currentLength + 1 + blockLength > limit) {
|
|
767
|
+
flushOutsideFence();
|
|
768
|
+
}
|
|
769
|
+
if (blockLength > limit) {
|
|
770
|
+
throw new TelegramMarkdownSplitError("line-exceeds-limit", {
|
|
771
|
+
limit,
|
|
772
|
+
lineLength: blockLength
|
|
773
|
+
});
|
|
774
|
+
}
|
|
775
|
+
pushLine(opener.openLine);
|
|
776
|
+
pushLine(closeLine);
|
|
777
|
+
index = closeIndex;
|
|
778
|
+
continue;
|
|
779
|
+
}
|
|
780
|
+
const firstBody = lines[index + 1] ?? "";
|
|
781
|
+
const closeReserve = 1 + (closeIndex === index + 2 ? lines[closeIndex]?.length ?? opener.closeLine.length : opener.closeLine.length);
|
|
782
|
+
const minStartLength = opener.openLine.length + 1 + firstBody.length + closeReserve;
|
|
783
|
+
if (current.length > 0 && currentLength + 1 + minStartLength > limit) {
|
|
784
|
+
flushOutsideFence();
|
|
785
|
+
}
|
|
786
|
+
if (minStartLength > limit) {
|
|
787
|
+
throw new TelegramMarkdownSplitError("line-exceeds-limit", {
|
|
788
|
+
limit,
|
|
789
|
+
lineLength: minStartLength
|
|
790
|
+
});
|
|
791
|
+
}
|
|
792
|
+
pushLine(opener.openLine);
|
|
793
|
+
activeFence = { ...opener, closeIndex };
|
|
794
|
+
continue;
|
|
795
|
+
}
|
|
796
|
+
}
|
|
797
|
+
}
|
|
798
|
+
const separator = lines[index + 1];
|
|
799
|
+
if (!inUnclosedFence && separator !== undefined && !startsOtherBlock(line) && isTableStart(line, separator)) {
|
|
800
|
+
const end = tableBodyEnd(lines, index + 2);
|
|
801
|
+
const head = line.length + 1 + separator.length;
|
|
802
|
+
const startRow = end > index + 2 ? lines[index + 2] ?? "" : undefined;
|
|
803
|
+
const minStart = head + (startRow === undefined ? 0 : 1 + startRow.length);
|
|
804
|
+
if (current.length > 0 && currentLength + 1 + minStart > limit)
|
|
805
|
+
flushOutsideFence();
|
|
806
|
+
if (minStart > limit)
|
|
807
|
+
refuseLine(minStart);
|
|
808
|
+
pushLine(line);
|
|
809
|
+
pushLine(separator);
|
|
810
|
+
for (let row = index + 2;row < end; row += 1) {
|
|
811
|
+
const body = lines[row] ?? "";
|
|
812
|
+
if (currentLength + 1 + body.length <= limit) {
|
|
813
|
+
pushLine(body);
|
|
814
|
+
continue;
|
|
815
|
+
}
|
|
816
|
+
flushOutsideFence();
|
|
817
|
+
if (head + 1 + body.length > limit)
|
|
818
|
+
refuseLine(head + 1 + body.length);
|
|
819
|
+
pushLine(line);
|
|
820
|
+
pushLine(separator);
|
|
821
|
+
pushLine(body);
|
|
822
|
+
}
|
|
823
|
+
index = end - 1;
|
|
824
|
+
continue;
|
|
825
|
+
}
|
|
826
|
+
if (line.length > limit) {
|
|
827
|
+
throw new TelegramMarkdownSplitError("line-exceeds-limit", {
|
|
828
|
+
limit,
|
|
829
|
+
lineLength: line.length
|
|
830
|
+
});
|
|
831
|
+
}
|
|
832
|
+
if (current.length === 0) {
|
|
833
|
+
if (line === "")
|
|
834
|
+
continue;
|
|
835
|
+
pushLine(line);
|
|
836
|
+
continue;
|
|
837
|
+
}
|
|
838
|
+
if (currentLength + 1 + line.length <= limit) {
|
|
839
|
+
pushLine(line);
|
|
840
|
+
continue;
|
|
841
|
+
}
|
|
842
|
+
flushOutsideFence();
|
|
843
|
+
if (line !== "")
|
|
844
|
+
pushLine(line);
|
|
845
|
+
}
|
|
846
|
+
flushOutsideFence();
|
|
847
|
+
return chunks;
|
|
848
|
+
}
|
|
15
849
|
export {
|
|
16
850
|
TELEGRAM_CAPTION_LIMIT2 as TELEGRAM_CAPTION_LIMIT,
|
|
17
851
|
TELEGRAM_TEXT_LIMIT2 as TELEGRAM_TEXT_LIMIT,
|
|
852
|
+
TelegramMarkdownSplitError,
|
|
18
853
|
checkTelegramHtml2 as checkTelegramHtml,
|
|
19
854
|
escapeTelegramHtml2 as escapeTelegramHtml,
|
|
855
|
+
markdownToTelegramHtml,
|
|
20
856
|
parseTelegramHtml2 as parseTelegramHtml,
|
|
21
857
|
renderTelegramHtml2 as renderTelegramHtml,
|
|
22
858
|
sanitizeTelegramHtml2 as sanitizeTelegramHtml,
|
|
23
859
|
splitTelegramHtml2 as splitTelegramHtml,
|
|
860
|
+
splitTelegramMarkdown,
|
|
24
861
|
telegramHtmlText2 as telegramHtmlText,
|
|
25
862
|
truncateTelegramHtml2 as truncateTelegramHtml
|
|
26
863
|
};
|