@abot-ai/runtime 1.5.0 → 1.6.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/dist/src/bridge/start-agent-bridge.js +22 -0
- package/dist/src/capabilities/normal-invocation/contracts.d.ts +11 -0
- package/dist/src/capabilities/normal-invocation/contracts.js +1 -0
- package/dist/src/capabilities/normal-invocation/validator.js +40 -4
- package/dist/src/capabilities/result-budget.d.ts +17 -0
- package/dist/src/capabilities/result-budget.js +21 -0
- package/dist/src/capabilities/tool-context-text.d.ts +16 -0
- package/dist/src/capabilities/tool-context-text.js +30 -0
- package/dist/src/capabilities/tool-definition-validator/definition-parser.js +6 -0
- package/dist/src/capabilities/tool-definition-validator/event-input-text-options.js +3 -2
- package/dist/src/capabilities/tool-event-input-text.d.ts +1 -0
- package/dist/src/capabilities/tool-event-input-text.js +2 -1
- package/dist/src/capabilities/tool-executor.d.ts +3 -1
- package/dist/src/capabilities/tool-executor.js +29 -50
- package/dist/src/capabilities/tool-interruption.d.ts +3 -0
- package/dist/src/capabilities/tool-interruption.js +6 -0
- package/dist/src/capabilities/tool-result-normalization.d.ts +18 -0
- package/dist/src/capabilities/tool-result-normalization.js +68 -0
- package/dist/src/capabilities/tool-types.d.ts +25 -2
- package/dist/src/cli/host-companion-bundle.mjs +474 -212
- package/dist/src/cli/host-companion.js +6 -0
- package/dist/src/cli/host-permissions.d.ts +7 -0
- package/dist/src/cli/host-permissions.js +24 -0
- package/dist/src/computer-access/companion/native-messages.js +1 -0
- package/dist/src/computer-access/companion/native-permissions.d.ts +14 -0
- package/dist/src/computer-access/companion/native-permissions.js +49 -0
- package/dist/src/computer-access/companion/native-session.js +4 -0
- package/dist/src/computer-access/companion/notification-installation.js +2 -15
- package/dist/src/computer-access/companion/notification-macos-bundle.d.ts +3 -0
- package/dist/src/computer-access/companion/notification-macos-bundle.js +84 -0
- package/dist/src/computer-access/companion/notification-macos.js +1 -1
- package/dist/src/computer-access/companion/notification-protocol.d.ts +1 -1
- package/dist/src/computer-access/companion/notification-protocol.js +20 -1
- package/dist/src/computer-access/companion/notification-readiness.js +2 -1
- package/dist/src/computer-access/companion/permission-protocol.d.ts +22 -0
- package/dist/src/computer-access/companion/permission-protocol.js +45 -0
- package/dist/src/computer-access/companion/protocol.d.ts +2 -1
- package/dist/src/computer-access/companion/protocol.js +3 -0
- package/dist/src/computer-access/companion/release-version.d.ts +1 -1
- package/dist/src/computer-access/companion/release-version.js +1 -1
- package/dist/src/computer-access/companion/spark-notification-query.d.ts +2 -0
- package/dist/src/computer-access/companion/spark-notification-query.js +62 -0
- package/dist/src/computer-access/computer/macos-desktop.js +1 -1
- package/dist/src/computer-access/computer/macos-input.js +2 -5
- package/dist/src/computer-access/computer/macos-permission-helper.d.ts +4 -0
- package/dist/src/computer-access/computer/macos-permission-helper.js +38 -0
- package/dist/src/computer-access/host-observation.d.ts +3 -3
- package/dist/src/computer-access/native-permission-contract.d.ts +23 -0
- package/dist/src/computer-access/native-permission-contract.js +38 -0
- package/dist/src/model-gateway/policy/invocation-policy.js +10 -1
- package/dist/src/model-gateway/providers/openai/payload.js +8 -0
- package/dist/src/model-gateway/structured-output/ollama-format.js +5 -0
- package/dist/src/model-gateway/structured-output/openai-format.js +5 -0
- package/dist/src/model-gateway/types.d.ts +3 -0
- package/dist/src/plugin-contract/manifest.d.ts +2 -1
- package/dist/src/plugin-sdk/context-text-result.d.ts +10 -0
- package/dist/src/plugin-sdk/context-text-result.js +19 -0
- package/dist/src/plugin-sdk/index.d.ts +1 -0
- package/dist/src/plugin-sdk/index.js +1 -0
- package/dist/src/plugin-sdk/results.d.ts +7 -4
- package/dist/src/plugin-sdk/results.js +35 -10
- package/dist/src/runtime/adapters/co-worker-resources.d.ts +2 -0
- package/dist/src/runtime/adapters/co-worker-resources.js +2 -2
- package/dist/src/runtime/adapters/file-session-store.js +6 -0
- package/dist/src/runtime/adapters/in-memory-session-store.js +14 -1
- package/dist/src/runtime/adapters/long-term-memory/onboarding-service.d.ts +2 -1
- package/dist/src/runtime/adapters/long-term-memory/onboarding-service.js +5 -4
- package/dist/src/runtime/adapters/passive-learning-runtime.d.ts +2 -1
- package/dist/src/runtime/adapters/passive-learning-runtime.js +1 -1
- package/dist/src/runtime/adapters/registered-tool-normal-invocations/execution/prepared-execution.js +77 -26
- package/dist/src/runtime/adapters/registered-tool-normal-invocations/execution/result-budget.d.ts +11 -0
- package/dist/src/runtime/adapters/registered-tool-normal-invocations/execution/result-budget.js +30 -0
- package/dist/src/runtime/adapters/registered-tool-normal-invocations/shared/contracts.d.ts +28 -1
- package/dist/src/runtime/adapters/registered-tool-payload-plan.d.ts +3 -3
- package/dist/src/runtime/adapters/registered-tool-payload-plan.js +4 -4
- package/dist/src/runtime/adapters/registered-tool-worker-capabilities/contracts.d.ts +2 -0
- package/dist/src/runtime/adapters/registered-tool-worker-capabilities/payload-authoring-result.js +4 -18
- package/dist/src/runtime/adapters/registered-tool-worker-capabilities/prepared-execution.js +3 -3
- package/dist/src/runtime/adapters/registered-tool-worker-capabilities/result-envelope.d.ts +13 -0
- package/dist/src/runtime/adapters/registered-tool-worker-capabilities/result-envelope.js +15 -0
- package/dist/src/runtime/adapters/registered-tool-worker-capabilities/result-evidence.d.ts +3 -7
- package/dist/src/runtime/adapters/registered-tool-worker-capabilities/result-evidence.js +6 -38
- package/dist/src/runtime/adapters/registered-tool-worker-capabilities/result-observer.d.ts +2 -1
- package/dist/src/runtime/adapters/registered-tool-worker-capabilities/result-observer.js +14 -6
- package/dist/src/runtime/adapters/registered-tool-worker-capabilities/result-references.d.ts +9 -0
- package/dist/src/runtime/adapters/registered-tool-worker-capabilities/result-references.js +29 -0
- package/dist/src/runtime/adapters/registered-tool-worker-capabilities.js +1 -0
- package/dist/src/runtime/adapters/scheduler-executor-dispatch.d.ts +11 -0
- package/dist/src/runtime/adapters/scheduler-executor-dispatch.js +10 -0
- package/dist/src/runtime/adapters/scheduler-runtime.d.ts +3 -1
- package/dist/src/runtime/adapters/scheduler-runtime.js +28 -12
- package/dist/src/runtime/automations/agent-assignment.d.ts +8 -0
- package/dist/src/runtime/automations/agent-assignment.js +29 -0
- package/dist/src/runtime/automations/agent-request-failure.d.ts +2 -0
- package/dist/src/runtime/automations/agent-request-failure.js +74 -0
- package/dist/src/runtime/automations/agent-session-lifetime.d.ts +11 -0
- package/dist/src/runtime/automations/agent-session-lifetime.js +46 -0
- package/dist/src/runtime/automations/agent-step-executor.d.ts +35 -0
- package/dist/src/runtime/automations/agent-step-executor.js +278 -0
- package/dist/src/runtime/automations/agent-tool-scope.d.ts +4 -0
- package/dist/src/runtime/automations/agent-tool-scope.js +73 -0
- package/dist/src/runtime/automations/archive-management.d.ts +26 -0
- package/dist/src/runtime/automations/archive-management.js +50 -0
- package/dist/src/runtime/automations/binding-resolution.d.ts +28 -0
- package/dist/src/runtime/automations/binding-resolution.js +115 -0
- package/dist/src/runtime/automations/branch-result-projection.d.ts +4 -0
- package/dist/src/runtime/automations/branch-result-projection.js +15 -0
- package/dist/src/runtime/automations/catalog.d.ts +76 -0
- package/dist/src/runtime/automations/catalog.js +67 -0
- package/dist/src/runtime/automations/definition-contracts.d.ts +128 -0
- package/dist/src/runtime/automations/definition-contracts.js +1 -0
- package/dist/src/runtime/automations/definition-input.d.ts +3 -0
- package/dist/src/runtime/automations/definition-input.js +283 -0
- package/dist/src/runtime/automations/dependency-fingerprint.d.ts +9 -0
- package/dist/src/runtime/automations/dependency-fingerprint.js +55 -0
- package/dist/src/runtime/automations/draft-batch-aliases.d.ts +12 -0
- package/dist/src/runtime/automations/draft-batch-aliases.js +94 -0
- package/dist/src/runtime/automations/draft-batch.d.ts +29 -0
- package/dist/src/runtime/automations/draft-batch.js +147 -0
- package/dist/src/runtime/automations/draft-management.d.ts +53 -0
- package/dist/src/runtime/automations/draft-management.js +164 -0
- package/dist/src/runtime/automations/draft-mutations.d.ts +29 -0
- package/dist/src/runtime/automations/draft-mutations.js +219 -0
- package/dist/src/runtime/automations/draft-restoration.d.ts +11 -0
- package/dist/src/runtime/automations/draft-restoration.js +44 -0
- package/dist/src/runtime/automations/effect-admission-lifetime.d.ts +9 -0
- package/dist/src/runtime/automations/effect-admission-lifetime.js +31 -0
- package/dist/src/runtime/automations/failure-policy.d.ts +8 -0
- package/dist/src/runtime/automations/failure-policy.js +9 -0
- package/dist/src/runtime/automations/graph-executor.d.ts +23 -0
- package/dist/src/runtime/automations/graph-executor.js +227 -0
- package/dist/src/runtime/automations/graph-validation.d.ts +29 -0
- package/dist/src/runtime/automations/graph-validation.js +271 -0
- package/dist/src/runtime/automations/input-batch-selection.d.ts +7 -0
- package/dist/src/runtime/automations/input-batch-selection.js +42 -0
- package/dist/src/runtime/automations/input-capacity.d.ts +9 -0
- package/dist/src/runtime/automations/input-capacity.js +38 -0
- package/dist/src/runtime/automations/input-ledger.d.ts +45 -0
- package/dist/src/runtime/automations/input-ledger.js +147 -0
- package/dist/src/runtime/automations/late-settlement.d.ts +9 -0
- package/dist/src/runtime/automations/late-settlement.js +42 -0
- package/dist/src/runtime/automations/limits.d.ts +25 -0
- package/dist/src/runtime/automations/limits.js +41 -0
- package/dist/src/runtime/automations/model-capacity.d.ts +9 -0
- package/dist/src/runtime/automations/model-capacity.js +67 -0
- package/dist/src/runtime/automations/model-dependency-projection.d.ts +56 -0
- package/dist/src/runtime/automations/model-dependency-projection.js +88 -0
- package/dist/src/runtime/automations/node-transactions.d.ts +57 -0
- package/dist/src/runtime/automations/node-transactions.js +223 -0
- package/dist/src/runtime/automations/occurrence-preparation.d.ts +12 -0
- package/dist/src/runtime/automations/occurrence-preparation.js +257 -0
- package/dist/src/runtime/automations/permission-grants.d.ts +27 -0
- package/dist/src/runtime/automations/permission-grants.js +72 -0
- package/dist/src/runtime/automations/persistence.d.ts +9 -0
- package/dist/src/runtime/automations/persistence.js +13 -0
- package/dist/src/runtime/automations/publication-validation.d.ts +16 -0
- package/dist/src/runtime/automations/publication-validation.js +162 -0
- package/dist/src/runtime/automations/publication.d.ts +33 -0
- package/dist/src/runtime/automations/publication.js +97 -0
- package/dist/src/runtime/automations/replay-preparation.d.ts +7 -0
- package/dist/src/runtime/automations/replay-preparation.js +59 -0
- package/dist/src/runtime/automations/result-capacity.d.ts +5 -0
- package/dist/src/runtime/automations/result-capacity.js +9 -0
- package/dist/src/runtime/automations/result-publication.d.ts +10 -0
- package/dist/src/runtime/automations/result-publication.js +21 -0
- package/dist/src/runtime/automations/result-store.d.ts +17 -0
- package/dist/src/runtime/automations/result-store.js +109 -0
- package/dist/src/runtime/automations/retention.d.ts +12 -0
- package/dist/src/runtime/automations/retention.js +134 -0
- package/dist/src/runtime/automations/run-file-binding.d.ts +3 -0
- package/dist/src/runtime/automations/run-file-binding.js +19 -0
- package/dist/src/runtime/automations/run-output-summary.d.ts +25 -0
- package/dist/src/runtime/automations/run-output-summary.js +54 -0
- package/dist/src/runtime/automations/run-report.d.ts +83 -0
- package/dist/src/runtime/automations/run-report.js +121 -0
- package/dist/src/runtime/automations/runtime-executor.d.ts +16 -0
- package/dist/src/runtime/automations/runtime-executor.js +260 -0
- package/dist/src/runtime/automations/saved-agent-management.d.ts +16 -0
- package/dist/src/runtime/automations/saved-agent-management.js +94 -0
- package/dist/src/runtime/automations/service.d.ts +286 -0
- package/dist/src/runtime/automations/service.js +330 -0
- package/dist/src/runtime/automations/snapshot-staging.d.ts +13 -0
- package/dist/src/runtime/automations/snapshot-staging.js +126 -0
- package/dist/src/runtime/automations/source-attachment-access.d.ts +23 -0
- package/dist/src/runtime/automations/source-attachment-access.js +70 -0
- package/dist/src/runtime/automations/source-discovery.d.ts +25 -0
- package/dist/src/runtime/automations/source-discovery.js +179 -0
- package/dist/src/runtime/automations/starter-template-builder.d.ts +5 -0
- package/dist/src/runtime/automations/starter-template-builder.js +78 -0
- package/dist/src/runtime/automations/starter-template-contracts.d.ts +42 -0
- package/dist/src/runtime/automations/starter-template-contracts.js +1 -0
- package/dist/src/runtime/automations/starter-template-definitions.d.ts +3 -0
- package/dist/src/runtime/automations/starter-template-definitions.js +100 -0
- package/dist/src/runtime/automations/starter-template-showcases.d.ts +3 -0
- package/dist/src/runtime/automations/starter-template-showcases.js +154 -0
- package/dist/src/runtime/automations/starter-template-structure.d.ts +4 -0
- package/dist/src/runtime/automations/starter-template-structure.js +11 -0
- package/dist/src/runtime/automations/starter-templates.d.ts +20 -0
- package/dist/src/runtime/automations/starter-templates.js +75 -0
- package/dist/src/runtime/automations/step-evidence-effects.d.ts +46 -0
- package/dist/src/runtime/automations/step-evidence-effects.js +173 -0
- package/dist/src/runtime/automations/step-evidence-inputs.d.ts +22 -0
- package/dist/src/runtime/automations/step-evidence-inputs.js +105 -0
- package/dist/src/runtime/automations/step-evidence-output.d.ts +17 -0
- package/dist/src/runtime/automations/step-evidence-output.js +43 -0
- package/dist/src/runtime/automations/step-evidence.d.ts +24 -0
- package/dist/src/runtime/automations/step-evidence.js +53 -0
- package/dist/src/runtime/automations/step-interruption.d.ts +3 -0
- package/dist/src/runtime/automations/step-interruption.js +26 -0
- package/dist/src/runtime/automations/step-runner.d.ts +57 -0
- package/dist/src/runtime/automations/step-runner.js +278 -0
- package/dist/src/runtime/automations/storage-records.d.ts +133 -0
- package/dist/src/runtime/automations/storage-records.js +286 -0
- package/dist/src/runtime/automations/terminal-admission-receipt.d.ts +12 -0
- package/dist/src/runtime/automations/terminal-admission-receipt.js +39 -0
- package/dist/src/runtime/automations/tool-lifetimes.d.ts +13 -0
- package/dist/src/runtime/automations/tool-lifetimes.js +56 -0
- package/dist/src/runtime/automations/tool-step-executor.d.ts +32 -0
- package/dist/src/runtime/automations/tool-step-executor.js +136 -0
- package/dist/src/runtime/automations/tool-step-outcome.d.ts +24 -0
- package/dist/src/runtime/automations/tool-step-outcome.js +32 -0
- package/dist/src/runtime/automations/trigger-schedule.d.ts +7 -0
- package/dist/src/runtime/automations/trigger-schedule.js +19 -0
- package/dist/src/runtime/automations/working-directory.d.ts +3 -0
- package/dist/src/runtime/automations/working-directory.js +13 -0
- package/dist/src/runtime/capabilities/automation-builder/authoring-reference.d.ts +422 -0
- package/dist/src/runtime/capabilities/automation-builder/authoring-reference.js +130 -0
- package/dist/src/runtime/capabilities/automation-builder/creation-recipe.d.ts +9 -0
- package/dist/src/runtime/capabilities/automation-builder/creation-recipe.js +155 -0
- package/dist/src/runtime/capabilities/automation-builder/payload-instructions.d.ts +6 -0
- package/dist/src/runtime/capabilities/automation-builder/payload-instructions.js +6 -0
- package/dist/src/runtime/capabilities/automation-builder/payload-schema.d.ts +3 -0
- package/dist/src/runtime/capabilities/automation-builder/payload-schema.js +105 -0
- package/dist/src/runtime/capabilities/automation-builder/tool-contract.d.ts +65 -0
- package/dist/src/runtime/capabilities/automation-builder/tool-contract.js +27 -0
- package/dist/src/runtime/capabilities/automation-builder/tool-module.d.ts +4 -0
- package/dist/src/runtime/capabilities/automation-builder/tool-module.js +108 -0
- package/dist/src/runtime/capabilities/automations/authoring-catalog-contract.d.ts +78 -0
- package/dist/src/runtime/capabilities/automations/authoring-catalog-contract.js +28 -0
- package/dist/src/runtime/capabilities/automations/authoring-catalog.d.ts +320 -0
- package/dist/src/runtime/capabilities/automations/authoring-catalog.js +158 -0
- package/dist/src/runtime/capabilities/automations/authoring-input-contracts.d.ts +140 -0
- package/dist/src/runtime/capabilities/automations/authoring-input-contracts.js +36 -0
- package/dist/src/runtime/capabilities/automations/authoring-inputs.d.ts +9 -0
- package/dist/src/runtime/capabilities/automations/authoring-inputs.js +86 -0
- package/dist/src/runtime/capabilities/automations/authoring-preparation-limits.d.ts +5 -0
- package/dist/src/runtime/capabilities/automations/authoring-preparation-limits.js +5 -0
- package/dist/src/runtime/capabilities/automations/authoring-preparation.d.ts +483 -0
- package/dist/src/runtime/capabilities/automations/authoring-preparation.js +51 -0
- package/dist/src/runtime/capabilities/automations/draft-index.d.ts +14 -0
- package/dist/src/runtime/capabilities/automations/draft-index.js +26 -0
- package/dist/src/runtime/capabilities/automations/draft-operation-refs.d.ts +11 -0
- package/dist/src/runtime/capabilities/automations/draft-operation-refs.js +37 -0
- package/dist/src/runtime/capabilities/automations/draft-receipt-admission.d.ts +24 -0
- package/dist/src/runtime/capabilities/automations/draft-receipt-admission.js +36 -0
- package/dist/src/runtime/capabilities/automations/event-presentation.d.ts +3 -0
- package/dist/src/runtime/capabilities/automations/event-presentation.js +18 -0
- package/dist/src/runtime/capabilities/automations/model-tool-contract.d.ts +3 -0
- package/dist/src/runtime/capabilities/automations/model-tool-contract.js +34 -0
- package/dist/src/runtime/capabilities/automations/tool-contract.d.ts +3 -0
- package/dist/src/runtime/capabilities/automations/tool-contract.js +65 -0
- package/dist/src/runtime/capabilities/automations/tool-module.d.ts +4 -0
- package/dist/src/runtime/capabilities/automations/tool-module.js +286 -0
- package/dist/src/runtime/capabilities/runtime-path-namespace.d.ts +6 -0
- package/dist/src/runtime/capabilities/runtime-path-namespace.js +48 -0
- package/dist/src/runtime/capabilities/runtime-target-path.d.ts +1 -0
- package/dist/src/runtime/capabilities/runtime-target-path.js +16 -8
- package/dist/src/runtime/capabilities/scheduling/create-operations.d.ts +6 -0
- package/dist/src/runtime/capabilities/scheduling/job-list-page.d.ts +4 -1
- package/dist/src/runtime/composition.d.ts +5 -2
- package/dist/src/runtime/context/canonical-capability-result.d.ts +4 -0
- package/dist/src/runtime/context/canonical-capability-result.js +80 -0
- package/dist/src/runtime/context/capability-brief-readmission.js +2 -5
- package/dist/src/runtime/context/capability-result-compaction-source.d.ts +12 -0
- package/dist/src/runtime/context/capability-result-compaction-source.js +61 -0
- package/dist/src/runtime/context/compacted-capability-result-receipt.d.ts +7 -0
- package/dist/src/runtime/context/compacted-capability-result-receipt.js +29 -0
- package/dist/src/runtime/context/compaction-source-invariant.d.ts +6 -0
- package/dist/src/runtime/context/compaction-source-invariant.js +12 -0
- package/dist/src/runtime/context/execution-compacted-evidence.d.ts +29 -0
- package/dist/src/runtime/context/execution-compacted-evidence.js +87 -0
- package/dist/src/runtime/context/execution-compaction-objective.d.ts +11 -0
- package/dist/src/runtime/context/execution-compaction-objective.js +12 -0
- package/dist/src/runtime/context/model-step-compaction.d.ts +9 -0
- package/dist/src/runtime/context/model-step-compaction.js +115 -128
- package/dist/src/runtime/context/operation-supervision-compacted-evidence.d.ts +37 -0
- package/dist/src/runtime/context/operation-supervision-compacted-evidence.js +69 -0
- package/dist/src/runtime/context/operation-supervision-evidence-binding.d.ts +29 -0
- package/dist/src/runtime/context/operation-supervision-evidence-binding.js +66 -0
- package/dist/src/runtime/context/operation-supervision-evidence-projection.d.ts +5 -0
- package/dist/src/runtime/context/operation-supervision-evidence-projection.js +133 -0
- package/dist/src/runtime/context/operation-supervision-evidence.d.ts +2 -1
- package/dist/src/runtime/context/operation-supervision-evidence.js +38 -37
- package/dist/src/runtime/context/request-tool-results-checkpoint.d.ts +3 -0
- package/dist/src/runtime/context/request-tool-results-checkpoint.js +126 -0
- package/dist/src/runtime/context/request-tool-results-message-binding.d.ts +1 -0
- package/dist/src/runtime/context/request-tool-results-message-binding.js +10 -0
- package/dist/src/runtime/context/request-tool-results-supersession.d.ts +9 -0
- package/dist/src/runtime/context/request-tool-results-supersession.js +78 -0
- package/dist/src/runtime/context/request-tool-results.d.ts +3 -9
- package/dist/src/runtime/context/request-tool-results.js +15 -181
- package/dist/src/runtime/context/runtime-filesystem-scope.d.ts +21 -0
- package/dist/src/runtime/context/runtime-filesystem-scope.js +51 -0
- package/dist/src/runtime/context/semantic-compaction/checkpoint-message.d.ts +3 -0
- package/dist/src/runtime/context/semantic-compaction/checkpoint-message.js +22 -0
- package/dist/src/runtime/context/semantic-compaction/contracts.d.ts +0 -3
- package/dist/src/runtime/context/semantic-compaction/contracts.js +9 -20
- package/dist/src/runtime/context/semantic-compaction/dependency-results.js +15 -1
- package/dist/src/runtime/context/semantic-compaction/evidence-scope.d.ts +7 -0
- package/dist/src/runtime/context/semantic-compaction/evidence-scope.js +7 -0
- package/dist/src/runtime/context/semantic-compaction/format.d.ts +2 -1
- package/dist/src/runtime/context/semantic-compaction/format.js +27 -19
- package/dist/src/runtime/context/semantic-compaction/generation-contracts.d.ts +18 -0
- package/dist/src/runtime/context/semantic-compaction/generation-contracts.js +1 -0
- package/dist/src/runtime/context/semantic-compaction/generation-input.d.ts +11 -0
- package/dist/src/runtime/context/semantic-compaction/generation-input.js +74 -0
- package/dist/src/runtime/context/semantic-compaction/generation-source-registration.d.ts +3 -0
- package/dist/src/runtime/context/semantic-compaction/generation-source-registration.js +12 -0
- package/dist/src/runtime/context/semantic-compaction/output-validation.d.ts +10 -0
- package/dist/src/runtime/context/semantic-compaction/output-validation.js +75 -0
- package/dist/src/runtime/context/semantic-compaction/parser.d.ts +2 -2
- package/dist/src/runtime/context/semantic-compaction/parser.js +13 -26
- package/dist/src/runtime/context/semantic-compaction/prompt.js +18 -5
- package/dist/src/runtime/context/semantic-compaction/repair-headroom.d.ts +4 -3
- package/dist/src/runtime/context/semantic-compaction/repair-headroom.js +10 -4
- package/dist/src/runtime/context/semantic-compaction/replacement-budget.d.ts +25 -0
- package/dist/src/runtime/context/semantic-compaction/replacement-budget.js +55 -0
- package/dist/src/runtime/context/semantic-compaction/run.d.ts +3 -14
- package/dist/src/runtime/context/semantic-compaction/run.js +27 -186
- package/dist/src/runtime/context/semantic-compaction/scope-quarantine.d.ts +17 -0
- package/dist/src/runtime/context/semantic-compaction/scope-quarantine.js +37 -0
- package/dist/src/runtime/context/semantic-compaction/snapshot.d.ts +5 -1
- package/dist/src/runtime/context/semantic-compaction/snapshot.js +10 -2
- package/dist/src/runtime/context/semantic-compaction/source-registration.d.ts +3 -0
- package/dist/src/runtime/context/semantic-compaction/source-registration.js +34 -0
- package/dist/src/runtime/context/semantic-compaction/source-slots.d.ts +5 -0
- package/dist/src/runtime/context/semantic-compaction/source-slots.js +4 -0
- package/dist/src/runtime/context/semantic-compaction/store.d.ts +6 -1
- package/dist/src/runtime/context/semantic-compaction/store.js +54 -9
- package/dist/src/runtime/context/semantic-compaction/super-child-result-source.d.ts +8 -0
- package/dist/src/runtime/context/semantic-compaction/super-child-result-source.js +50 -0
- package/dist/src/runtime/context/semantic-compaction/super-operation-source.d.ts +8 -0
- package/dist/src/runtime/context/semantic-compaction/super-operation-source.js +99 -0
- package/dist/src/runtime/context/semantic-compaction/super-reviewer-source.d.ts +16 -0
- package/dist/src/runtime/context/semantic-compaction/super-reviewer-source.js +37 -0
- package/dist/src/runtime/context/semantic-compaction/super-source-integrity.d.ts +21 -0
- package/dist/src/runtime/context/semantic-compaction/super-source-integrity.js +169 -0
- package/dist/src/runtime/context/semantic-compaction/super-source-message.d.ts +4 -0
- package/dist/src/runtime/context/semantic-compaction/super-source-message.js +23 -0
- package/dist/src/runtime/context/session-memory/model-step-controller.js +34 -20
- package/dist/src/runtime/context/session-memory/selection.js +0 -2
- package/dist/src/runtime/context/spark-conversation-policy.d.ts +4 -0
- package/dist/src/runtime/context/spark-conversation-policy.js +16 -0
- package/dist/src/runtime/context/super-compaction-failure-owner.d.ts +10 -0
- package/dist/src/runtime/context/super-compaction-failure-owner.js +64 -0
- package/dist/src/runtime/context/super-context-failure.d.ts +28 -0
- package/dist/src/runtime/context/super-context-failure.js +37 -0
- package/dist/src/runtime/context/super-context-policy.d.ts +3 -0
- package/dist/src/runtime/context/super-context-policy.js +35 -0
- package/dist/src/runtime/context/super-request-tool-results-checkpoint.d.ts +6 -0
- package/dist/src/runtime/context/super-request-tool-results-checkpoint.js +29 -0
- package/dist/src/runtime/context/super-worker-compaction-failure.d.ts +5 -0
- package/dist/src/runtime/context/super-worker-compaction-failure.js +19 -0
- package/dist/src/runtime/context/super-worker-compaction-projection.d.ts +8 -0
- package/dist/src/runtime/context/super-worker-compaction-projection.js +41 -0
- package/dist/src/runtime/context/super-worker-compaction-sidecar.d.ts +21 -0
- package/dist/src/runtime/context/super-worker-compaction-sidecar.js +67 -0
- package/dist/src/runtime/context/verified-compaction-projection.d.ts +7 -0
- package/dist/src/runtime/context/verified-compaction-projection.js +16 -0
- package/dist/src/runtime/default-environment-adapters.d.ts +4 -0
- package/dist/src/runtime/default-environment-adapters.js +7 -1
- package/dist/src/runtime/local-application.d.ts +277 -0
- package/dist/src/runtime/local-application.js +7 -0
- package/dist/src/runtime/local-host/app-learning-dispatch.js +0 -8
- package/dist/src/runtime/local-host/app-native-permissions.d.ts +20 -0
- package/dist/src/runtime/local-host/app-native-permissions.js +76 -0
- package/dist/src/runtime/local-host/app-owner.js +12 -1
- package/dist/src/runtime/local-host/app-request-control.d.ts +1 -0
- package/dist/src/runtime/local-host/app-request-control.js +5 -0
- package/dist/src/runtime/local-host/app-service-dispatch.d.ts +2 -1
- package/dist/src/runtime/local-host/app-service-dispatch.js +31 -0
- package/dist/src/runtime/local-host/client-learning.d.ts +1 -1
- package/dist/src/runtime/local-host/client-learning.js +0 -1
- package/dist/src/runtime/local-host/client-native-permissions.d.ts +4 -0
- package/dist/src/runtime/local-host/client-native-permissions.js +37 -0
- package/dist/src/runtime/local-host/client-services.d.ts +273 -0
- package/dist/src/runtime/local-host/client-services.js +3 -2
- package/dist/src/runtime/local-host/learning-preferences-input.js +1 -0
- package/dist/src/runtime/model/context-compaction-admission.d.ts +21 -0
- package/dist/src/runtime/model/context-compaction-admission.js +214 -0
- package/dist/src/runtime/model/context-compaction-contracts.d.ts +32 -0
- package/dist/src/runtime/model/context-compaction-contracts.js +1 -0
- package/dist/src/runtime/model/context-compaction-diagnostics.d.ts +33 -0
- package/dist/src/runtime/model/context-compaction-diagnostics.js +97 -0
- package/dist/src/runtime/model/context-compaction-stage-plan.d.ts +3 -0
- package/dist/src/runtime/model/context-compaction-stage-plan.js +28 -0
- package/dist/src/runtime/model/input-token-count.d.ts +1 -0
- package/dist/src/runtime/model/input-token-count.js +4 -1
- package/dist/src/runtime/model/invoke-step.js +80 -126
- package/dist/src/runtime/model/invoke-structured-step.d.ts +1 -1
- package/dist/src/runtime/model/invoke-structured-step.js +3 -2
- package/dist/src/runtime/model/model-context-assessment.d.ts +17 -0
- package/dist/src/runtime/model/model-context-assessment.js +51 -0
- package/dist/src/runtime/model/model-context-budget.js +1 -0
- package/dist/src/runtime/model/model-step-acceptance.d.ts +4 -0
- package/dist/src/runtime/model/model-step-acceptance.js +28 -0
- package/dist/src/runtime/model/model-step-port.d.ts +4 -15
- package/dist/src/runtime/model/model-step-steering.d.ts +14 -1
- package/dist/src/runtime/model/model-step-steering.js +23 -0
- package/dist/src/runtime/orchestration/capability-adapters/result.d.ts +4 -1
- package/dist/src/runtime/orchestration/capability-adapters/result.js +11 -7
- package/dist/src/runtime/orchestration/role-calls/child-return.d.ts +5 -1
- package/dist/src/runtime/orchestration/role-calls/child-return.js +2 -2
- package/dist/src/runtime/orchestration/worker-capabilities/binding/invocation-preparation.js +1 -8
- package/dist/src/runtime/orchestration/worker-capabilities/contracts.d.ts +3 -4
- package/dist/src/runtime/orchestration/worker-capabilities/contracts.js +1 -1
- package/dist/src/runtime/orchestration/worker-capabilities/execution/context-projection.js +2 -1
- package/dist/src/runtime/orchestration/worker-capabilities/payload-assignment-validation.js +9 -9
- package/dist/src/runtime/orchestration/worker-capabilities/payload-author.js +9 -33
- package/dist/src/runtime/orchestration/worker-capabilities/payload-body-normalization.d.ts +12 -0
- package/dist/src/runtime/orchestration/worker-capabilities/payload-body-normalization.js +80 -0
- package/dist/src/runtime/orchestration/worker-capabilities/payload-compaction-transport.d.ts +3 -0
- package/dist/src/runtime/orchestration/worker-capabilities/payload-compaction-transport.js +14 -0
- package/dist/src/runtime/orchestration/worker-capabilities/payload-context-snapshot.d.ts +2 -0
- package/dist/src/runtime/orchestration/worker-capabilities/payload-context-snapshot.js +12 -0
- package/dist/src/runtime/orchestration/worker-capabilities/payload-contracts.d.ts +5 -1
- package/dist/src/runtime/orchestration/worker-capabilities/payload-instructions.js +1 -1
- package/dist/src/runtime/passive-learning/background-dependencies.d.ts +0 -1
- package/dist/src/runtime/passive-learning/contracts.d.ts +2 -3
- package/dist/src/runtime/passive-learning/proactive/agent.d.ts +3 -0
- package/dist/src/runtime/passive-learning/proactive/agent.js +36 -14
- package/dist/src/runtime/passive-learning/proactive/contracts.d.ts +7 -1
- package/dist/src/runtime/passive-learning/proactive/contracts.js +8 -1
- package/dist/src/runtime/passive-learning/proactive/conversation-style-prompt.d.ts +1 -0
- package/dist/src/runtime/passive-learning/proactive/conversation-style-prompt.js +6 -0
- package/dist/src/runtime/passive-learning/proactive/conversation-style-reference.d.ts +30 -0
- package/dist/src/runtime/passive-learning/proactive/conversation-style-reference.js +61 -0
- package/dist/src/runtime/passive-learning/proactive/handoff-brief.d.ts +1 -0
- package/dist/src/runtime/passive-learning/proactive/handoff-brief.js +4 -0
- package/dist/src/runtime/passive-learning/proactive/model-output.d.ts +1 -1
- package/dist/src/runtime/passive-learning/proactive/model-output.js +5 -4
- package/dist/src/runtime/passive-learning/proactive/model.d.ts +7 -1
- package/dist/src/runtime/passive-learning/proactive/model.js +58 -32
- package/dist/src/runtime/passive-learning/proactive/prompt.d.ts +1 -1
- package/dist/src/runtime/passive-learning/proactive/prompt.js +4 -2
- package/dist/src/runtime/passive-learning/proactive/staged-authoring.d.ts +14 -0
- package/dist/src/runtime/passive-learning/proactive/staged-authoring.js +27 -0
- package/dist/src/runtime/passive-learning/proactive/staged-context.d.ts +13 -0
- package/dist/src/runtime/passive-learning/proactive/staged-context.js +39 -4
- package/dist/src/runtime/passive-learning/proactive/staged-contract.d.ts +3 -0
- package/dist/src/runtime/passive-learning/proactive/staged-contract.js +4 -0
- package/dist/src/runtime/passive-learning/proactive/staged-format.d.ts +5 -1
- package/dist/src/runtime/passive-learning/proactive/staged-format.js +2 -4
- package/dist/src/runtime/passive-learning/proactive/staged-output.d.ts +3 -4
- package/dist/src/runtime/passive-learning/proactive/staged-output.js +13 -5
- package/dist/src/runtime/passive-learning/proactive/staged-progress-store.d.ts +0 -1
- package/dist/src/runtime/passive-learning/proactive/staged-progress-store.js +2 -18
- package/dist/src/runtime/passive-learning/proactive/staged-prompt.d.ts +3 -1
- package/dist/src/runtime/passive-learning/proactive/staged-prompt.js +13 -4
- package/dist/src/runtime/passive-learning/proactive/staged-review.d.ts +1 -1
- package/dist/src/runtime/passive-learning/proactive/staged-review.js +10 -11
- package/dist/src/runtime/passive-learning/proactive/store.d.ts +1 -1
- package/dist/src/runtime/passive-learning/proactive/store.js +11 -5
- package/dist/src/runtime/passive-learning/review-progress.d.ts +1 -1
- package/dist/src/runtime/passive-learning/review-progress.js +2 -2
- package/dist/src/runtime/passive-learning/service-status.js +2 -2
- package/dist/src/runtime/passive-learning/service.js +0 -6
- package/dist/src/runtime/passive-learning/spark-chat-preferences.d.ts +3 -0
- package/dist/src/runtime/passive-learning/spark-chat-preferences.js +8 -0
- package/dist/src/runtime/passive-learning/staged-review-call.d.ts +3 -0
- package/dist/src/runtime/passive-learning/staged-review-call.js +19 -13
- package/dist/src/runtime/passive-learning/store.js +4 -0
- package/dist/src/runtime/plugins/manifest-projection.js +4 -0
- package/dist/src/runtime/plugins/manifest-validator.js +7 -0
- package/dist/src/runtime/ports.d.ts +14 -1
- package/dist/src/runtime/request/approval-wait/activation-events.d.ts +5 -0
- package/dist/src/runtime/request/approval-wait/activation-events.js +4 -3
- package/dist/src/runtime/request/approval-wait/snapshot.d.ts +1 -1
- package/dist/src/runtime/request/approval-wait/snapshot.js +1 -0
- package/dist/src/runtime/request/approval-wait/super-compaction-restore.d.ts +20 -0
- package/dist/src/runtime/request/approval-wait/super-compaction-restore.js +61 -0
- package/dist/src/runtime/request/automation-output-contract.d.ts +6 -0
- package/dist/src/runtime/request/automation-output-contract.js +33 -0
- package/dist/src/runtime/request/contracts.d.ts +16 -0
- package/dist/src/runtime/request/execution-agent-root-execution.js +2 -0
- package/dist/src/runtime/request/execution-facets.js +7 -0
- package/dist/src/runtime/request/execution-payload-compacted-evidence.d.ts +64 -0
- package/dist/src/runtime/request/execution-payload-compacted-evidence.js +46 -0
- package/dist/src/runtime/request/execution-scope-surfaces.d.ts +2 -0
- package/dist/src/runtime/request/execution-scope-surfaces.js +28 -0
- package/dist/src/runtime/request/execution-scope.d.ts +8 -2
- package/dist/src/runtime/request/execution-scope.js +14 -2
- package/dist/src/runtime/request/handler.d.ts +7 -0
- package/dist/src/runtime/request/handler.js +196 -35
- package/dist/src/runtime/request/locked-request-steering.d.ts +3 -0
- package/dist/src/runtime/request/locked-request-steering.js +12 -0
- package/dist/src/runtime/request/policy-degraded-finalization.d.ts +10 -0
- package/dist/src/runtime/request/policy-degraded-finalization.js +27 -0
- package/dist/src/runtime/request/prepared-execution.d.ts +10 -1
- package/dist/src/runtime/request/prepared-execution.js +43 -8
- package/dist/src/runtime/request/request-steering.d.ts +1 -1
- package/dist/src/runtime/request/result.d.ts +3 -0
- package/dist/src/runtime/request/role-executor-composition.js +4 -3
- package/dist/src/runtime/request/root-contract.d.ts +2 -0
- package/dist/src/runtime/request/root-execution-kernel.js +10 -9
- package/dist/src/runtime/request/root-invalid-output.js +16 -1
- package/dist/src/runtime/request/session-admission.d.ts +6 -0
- package/dist/src/runtime/request/session-admission.js +47 -14
- package/dist/src/runtime/request/super-checkpoint-quarantine.d.ts +8 -0
- package/dist/src/runtime/request/super-checkpoint-quarantine.js +76 -0
- package/dist/src/runtime/request/super-context-failure-executor.d.ts +4 -0
- package/dist/src/runtime/request/super-context-failure-executor.js +68 -0
- package/dist/src/runtime/request/super-context-failure-integrity.d.ts +16 -0
- package/dist/src/runtime/request/super-context-failure-integrity.js +130 -0
- package/dist/src/runtime/request/super-context-scope.d.ts +9 -0
- package/dist/src/runtime/request/super-context-scope.js +65 -0
- package/dist/src/runtime/request/super-failure-explanation.d.ts +22 -0
- package/dist/src/runtime/request/super-failure-explanation.js +77 -0
- package/dist/src/runtime/request/super-failure-message.d.ts +10 -0
- package/dist/src/runtime/request/super-failure-message.js +40 -0
- package/dist/src/runtime/request/super-payload-context-failure.d.ts +11 -0
- package/dist/src/runtime/request/super-payload-context-failure.js +55 -0
- package/dist/src/runtime/request/super-root-failure-finalization.d.ts +23 -0
- package/dist/src/runtime/request/super-root-failure-finalization.js +112 -0
- package/dist/src/runtime/request/worker-capability-composition.d.ts +2 -0
- package/dist/src/runtime/request/worker-capability-composition.js +4 -1
- package/dist/src/runtime/request/worker-capability-payload.d.ts +2 -1
- package/dist/src/runtime/request/worker-capability-payload.js +74 -48
- package/dist/src/runtime/runtime-environment.d.ts +3 -1
- package/dist/src/runtime/runtime-environment.js +167 -1
- package/dist/src/runtime/scheduler/automation-job-management.d.ts +12 -0
- package/dist/src/runtime/scheduler/automation-job-management.js +288 -0
- package/dist/src/runtime/scheduler/automation-rerun.d.ts +6 -0
- package/dist/src/runtime/scheduler/automation-rerun.js +95 -0
- package/dist/src/runtime/scheduler/automation-run-budget.d.ts +4 -0
- package/dist/src/runtime/scheduler/automation-run-budget.js +16 -0
- package/dist/src/runtime/scheduler/automation-run-change-events.d.ts +11 -0
- package/dist/src/runtime/scheduler/automation-run-change-events.js +77 -0
- package/dist/src/runtime/scheduler/automation-run-completion.d.ts +11 -0
- package/dist/src/runtime/scheduler/automation-run-completion.js +93 -0
- package/dist/src/runtime/scheduler/automation-run-control.d.ts +3 -0
- package/dist/src/runtime/scheduler/automation-run-control.js +48 -0
- package/dist/src/runtime/scheduler/automation-run-records.d.ts +5 -0
- package/dist/src/runtime/scheduler/automation-run-records.js +37 -0
- package/dist/src/runtime/scheduler/automation-schedule.d.ts +10 -0
- package/dist/src/runtime/scheduler/automation-schedule.js +48 -0
- package/dist/src/runtime/scheduler/automation-scheduler-engine.d.ts +4 -0
- package/dist/src/runtime/scheduler/automation-scheduler-engine.js +188 -0
- package/dist/src/runtime/scheduler/automation-snapshot-validation.d.ts +3 -0
- package/dist/src/runtime/scheduler/automation-snapshot-validation.js +106 -0
- package/dist/src/runtime/scheduler/contracts.d.ts +143 -3
- package/dist/src/runtime/scheduler/file-store.js +15 -1
- package/dist/src/runtime/scheduler/job-management.js +3 -2
- package/dist/src/runtime/scheduler/journal-automation-index.d.ts +23 -0
- package/dist/src/runtime/scheduler/journal-automation-index.js +205 -0
- package/dist/src/runtime/scheduler/journal-automation-transaction.d.ts +11 -0
- package/dist/src/runtime/scheduler/journal-automation-transaction.js +90 -0
- package/dist/src/runtime/scheduler/journal-checkpoint.js +5 -2
- package/dist/src/runtime/scheduler/journal-head.d.ts +1 -1
- package/dist/src/runtime/scheduler/journal-head.js +2 -2
- package/dist/src/runtime/scheduler/journal-index-state.d.ts +21 -10
- package/dist/src/runtime/scheduler/journal-index-state.js +76 -17
- package/dist/src/runtime/scheduler/journal-index.d.ts +9 -3
- package/dist/src/runtime/scheduler/journal-index.js +84 -9
- package/dist/src/runtime/scheduler/journal-store.d.ts +9 -1
- package/dist/src/runtime/scheduler/journal-store.js +110 -7
- package/dist/src/runtime/scheduler/journal-transaction.d.ts +7 -4
- package/dist/src/runtime/scheduler/journal-transaction.js +13 -2
- package/dist/src/runtime/scheduler/next-occurrence.js +2 -0
- package/dist/src/runtime/scheduler/run-completion.js +2 -1
- package/dist/src/runtime/scheduler/run-records.js +8 -3
- package/dist/src/runtime/scheduler/schedule-update.d.ts +2 -2
- package/dist/src/runtime/scheduler/schedule-validation.d.ts +2 -2
- package/dist/src/runtime/scheduler/schedule-validation.js +2 -0
- package/dist/src/runtime/scheduler/scheduler-engine.js +24 -8
- package/dist/src/runtime/scheduler/scheduler-service.d.ts +4 -1
- package/dist/src/runtime/scheduler/scheduler-service.js +83 -10
- package/dist/src/runtime/scheduler/scheduler-target.d.ts +9 -0
- package/dist/src/runtime/scheduler/scheduler-target.js +41 -0
- package/dist/src/runtime/scheduler/service-context.d.ts +6 -2
- package/dist/src/runtime/scheduler/service-context.js +6 -3
- package/dist/src/runtime/scheduler/snapshot-validation.d.ts +3 -3
- package/dist/src/runtime/scheduler/snapshot-validation.js +21 -1
- package/dist/src/runtime/scheduler/startup-recovery.d.ts +1 -1
- package/dist/src/runtime/scheduler/startup-recovery.js +15 -2
- package/dist/src/runtime/scheduler/working-store.js +8 -0
- package/dist/src/runtime/session/request-session.d.ts +1 -0
- package/dist/src/runtime/session/request-session.js +1 -0
- package/dist/src/runtime/session/session-deletion-boundary.d.ts +1 -1
- package/dist/src/runtime/session/session-deletion-boundary.js +6 -2
- package/dist/src/runtime/session/session-lifecycle-store.d.ts +4 -1
- package/dist/src/runtime/session/session-lifecycle-store.js +32 -4
- package/dist/src/runtime/session/spark-session-attachments.d.ts +4 -0
- package/dist/src/runtime/session/spark-session-attachments.js +28 -0
- package/dist/src/runtime/session/spark-session-cleanup-receipt.d.ts +7 -0
- package/dist/src/runtime/session/spark-session-cleanup-receipt.js +61 -0
- package/dist/src/runtime/session/spark-session-clear.d.ts +6 -0
- package/dist/src/runtime/session/spark-session-clear.js +36 -0
- package/dist/src/runtime/session/terminal-response.d.ts +21 -0
- package/dist/src/runtime/session/terminal-response.js +38 -0
- package/dist/src/runtime/steps/auditor-decision/advisory-receipt.d.ts +1 -0
- package/dist/src/runtime/steps/auditor-decision/advisory-receipt.js +12 -0
- package/dist/src/runtime/steps/auditor-decision/contracts.d.ts +4 -0
- package/dist/src/runtime/steps/auditor-decision/evidence-coverage.js +5 -5
- package/dist/src/runtime/steps/auditor-decision/evidence-inventory.d.ts +2 -1
- package/dist/src/runtime/steps/auditor-decision/evidence-inventory.js +12 -1
- package/dist/src/runtime/steps/auditor-decision/evidence-representation.d.ts +8 -2
- package/dist/src/runtime/steps/auditor-decision/evidence-representation.js +14 -1
- package/dist/src/runtime/steps/auditor-decision/input.d.ts +2 -0
- package/dist/src/runtime/steps/auditor-decision/input.js +12 -3
- package/dist/src/runtime/steps/auditor-decision/projection.js +20 -1
- package/dist/src/runtime/steps/auditor-decision/prompt.js +6 -6
- package/dist/src/runtime/steps/auditor-decision/run.js +2 -3
- package/dist/src/runtime/steps/capability-execution-instructions.d.ts +5 -0
- package/dist/src/runtime/steps/capability-execution-instructions.js +5 -0
- package/dist/src/runtime/steps/degraded-finalization/contract.d.ts +3 -0
- package/dist/src/runtime/steps/degraded-finalization/fallback.js +14 -4
- package/dist/src/runtime/steps/degraded-finalization/input.js +11 -1
- package/dist/src/runtime/steps/degraded-finalization/output-limit-cause.d.ts +4 -0
- package/dist/src/runtime/steps/degraded-finalization/output-limit-cause.js +17 -0
- package/dist/src/runtime/steps/degraded-finalization/prompt.js +4 -1
- package/dist/src/runtime/steps/degraded-finalization/super.d.ts +20 -0
- package/dist/src/runtime/steps/degraded-finalization/super.js +128 -0
- package/dist/src/runtime/steps/execution-agent/capability-decision-parsing.d.ts +1 -0
- package/dist/src/runtime/steps/execution-agent/capability-decision-parsing.js +21 -3
- package/dist/src/runtime/steps/execution-agent/capability-invocation-contract.d.ts +1 -1
- package/dist/src/runtime/steps/execution-agent/capability-invocation-contract.js +4 -2
- package/dist/src/runtime/steps/execution-agent/capability-selection-schema.d.ts +3 -0
- package/dist/src/runtime/steps/execution-agent/capability-selection-schema.js +72 -0
- package/dist/src/runtime/steps/execution-agent/compaction.d.ts +5 -2
- package/dist/src/runtime/steps/execution-agent/compaction.js +10 -4
- package/dist/src/runtime/steps/execution-agent/contracts.d.ts +14 -2
- package/dist/src/runtime/steps/execution-agent/controls-compacted-evidence.d.ts +16 -0
- package/dist/src/runtime/steps/execution-agent/controls-compacted-evidence.js +67 -0
- package/dist/src/runtime/steps/execution-agent/controls-evidence-contract.d.ts +21 -0
- package/dist/src/runtime/steps/execution-agent/controls-evidence-contract.js +64 -0
- package/dist/src/runtime/steps/execution-agent/controls-evidence.d.ts +32 -0
- package/dist/src/runtime/steps/execution-agent/controls-evidence.js +119 -0
- package/dist/src/runtime/steps/execution-agent/decision-parsing.js +1 -0
- package/dist/src/runtime/steps/execution-agent/format.d.ts +2 -0
- package/dist/src/runtime/steps/execution-agent/format.js +9 -68
- package/dist/src/runtime/steps/execution-agent/input.js +19 -2
- package/dist/src/runtime/steps/execution-agent/prompt.d.ts +1 -0
- package/dist/src/runtime/steps/execution-agent/prompt.js +15 -2
- package/dist/src/runtime/steps/execution-agent/refinement-input.d.ts +32 -0
- package/dist/src/runtime/steps/execution-agent/refinement-input.js +146 -0
- package/dist/src/runtime/steps/execution-agent/refinement-prompt.d.ts +1 -0
- package/dist/src/runtime/steps/execution-agent/refinement-prompt.js +11 -0
- package/dist/src/runtime/steps/execution-agent/refinement.d.ts +4 -4
- package/dist/src/runtime/steps/execution-agent/refinement.js +18 -108
- package/dist/src/runtime/steps/execution-agent/response-input.js +13 -6
- package/dist/src/runtime/steps/execution-agent/response-prompt.js +1 -1
- package/dist/src/runtime/steps/execution-agent/response-run.js +19 -5
- package/dist/src/runtime/steps/execution-agent/run.js +9 -3
- package/dist/src/runtime/steps/execution-agent/state-context.d.ts +1 -1
- package/dist/src/runtime/steps/execution-agent/state-context.js +20 -5
- package/dist/src/runtime/steps/planner-decision/input.js +7 -0
- package/dist/src/runtime/steps/planner-decision/resume.d.ts +2 -1
- package/dist/src/runtime/steps/planner-decision/resume.js +3 -3
- package/dist/src/runtime/steps/planner-decision/run.js +13 -0
- package/dist/src/runtime/steps/planner-graph/prompt.js +2 -0
- package/dist/src/runtime/steps/planner-graph/run.js +1 -0
- package/dist/src/runtime/steps/reviewer-decision/projection.js +5 -0
- package/dist/src/runtime/steps/reviewer-decision/run.js +13 -0
- package/dist/src/runtime/steps/supervisor-decision/input.d.ts +1 -1
- package/dist/src/runtime/steps/supervisor-decision/input.js +2 -0
- package/dist/src/runtime/steps/supervisor-decision/run.js +14 -0
- package/dist/src/runtime/steps/supervisor-decision/working-directory.d.ts +2 -0
- package/dist/src/runtime/steps/supervisor-decision/working-directory.js +6 -0
- package/dist/src/runtime/steps/supervisor-response/input.d.ts +1 -1
- package/dist/src/runtime/steps/supervisor-response/input.js +14 -7
- package/dist/src/runtime/steps/supervisor-response/run.js +39 -9
- package/dist/src/runtime/steps/worker-decision/compaction-integrity.d.ts +11 -0
- package/dist/src/runtime/steps/worker-decision/compaction-integrity.js +40 -0
- package/dist/src/runtime/steps/worker-decision/input/reference-context.js +7 -0
- package/dist/src/runtime/steps/worker-decision/input/types.d.ts +4 -1
- package/dist/src/runtime/steps/worker-decision/prompt.js +9 -2
- package/dist/src/runtime/steps/worker-decision/result-author.js +4 -0
- package/dist/src/runtime/steps/worker-decision/run.js +12 -49
- package/dist/src/runtime/steps/worker-decision/worker-handoff-compaction.d.ts +4 -0
- package/dist/src/runtime/steps/worker-decision/worker-handoff-compaction.js +69 -0
- package/dist/src/sessions/assistant-initiative-append.d.ts +14 -0
- package/dist/src/sessions/assistant-initiative-append.js +64 -0
- package/dist/src/sessions/assistant-initiative.d.ts +4 -0
- package/dist/src/sessions/assistant-initiative.js +7 -1
- package/dist/src/sessions/automation-session-origin.d.ts +34 -0
- package/dist/src/sessions/automation-session-origin.js +78 -0
- package/dist/src/sessions/automation-session-store.d.ts +12 -0
- package/dist/src/sessions/automation-session-store.js +129 -0
- package/dist/src/sessions/index.d.ts +1 -0
- package/dist/src/sessions/index.js +3 -0
- package/dist/src/sessions/memory/source.d.ts +1 -1
- package/dist/src/sessions/memory/source.js +4 -11
- package/dist/src/sessions/project-binding.d.ts +1 -0
- package/dist/src/sessions/record/projection.d.ts +1 -0
- package/dist/src/sessions/record/projection.js +4 -0
- package/dist/src/sessions/session-service.d.ts +9 -0
- package/dist/src/sessions/session-service.js +53 -4
- package/dist/src/sessions/spark-handoff-brief.d.ts +3 -0
- package/dist/src/sessions/spark-handoff-brief.js +9 -0
- package/dist/src/sessions/spark-session.d.ts +13 -0
- package/dist/src/sessions/spark-session.js +25 -0
- package/dist/src/sessions/types.d.ts +5 -0
- package/dist/src/web-ui/app/ARCHITECTURE.md +89 -0
- package/dist/src/web-ui/app/app-bootstrap.js +24 -2
- package/dist/src/web-ui/app/app-dom.js +5 -0
- package/dist/src/web-ui/app/app-realtime-transport.js +27 -2
- package/dist/src/web-ui/app/app.js +5 -10
- package/dist/src/web-ui/app/automations-feature.js +103 -0
- package/dist/src/web-ui/app/components/automations/archive-actions.js +20 -0
- package/dist/src/web-ui/app/components/automations/authoring-entry.js +25 -0
- package/dist/src/web-ui/app/components/automations/binding-editor.js +101 -0
- package/dist/src/web-ui/app/components/automations/binding-fields.js +166 -0
- package/dist/src/web-ui/app/components/automations/chat-run-projection.js +280 -0
- package/dist/src/web-ui/app/components/automations/draft-recovery-actions.js +28 -0
- package/dist/src/web-ui/app/components/automations/editor-action-icons.js +18 -0
- package/dist/src/web-ui/app/components/automations/editor-actions.js +57 -0
- package/dist/src/web-ui/app/components/automations/editor.js +218 -0
- package/dist/src/web-ui/app/components/automations/failure-presentation.js +299 -0
- package/dist/src/web-ui/app/components/automations/library-tabs.js +45 -0
- package/dist/src/web-ui/app/components/automations/list.js +58 -0
- package/dist/src/web-ui/app/components/automations/live-view.js +39 -0
- package/dist/src/web-ui/app/components/automations/node-inspector.js +251 -0
- package/dist/src/web-ui/app/components/automations/permission-selection.js +37 -0
- package/dist/src/web-ui/app/components/automations/rerun-confirmation.js +16 -0
- package/dist/src/web-ui/app/components/automations/run-output-view.js +100 -0
- package/dist/src/web-ui/app/components/automations/run-report-view.js +224 -0
- package/dist/src/web-ui/app/components/automations/run-step-selection.js +7 -0
- package/dist/src/web-ui/app/components/automations/run-steps-view.js +33 -0
- package/dist/src/web-ui/app/components/automations/run.js +38 -0
- package/dist/src/web-ui/app/components/automations/schema-literal-inputs.js +212 -0
- package/dist/src/web-ui/app/components/automations/step-editor-dialog.js +243 -0
- package/dist/src/web-ui/app/components/automations/step-preview.js +48 -0
- package/dist/src/web-ui/app/components/automations/template-gallery.js +74 -0
- package/dist/src/web-ui/app/components/automations/timeline-camera.js +219 -0
- package/dist/src/web-ui/app/components/automations/timeline.js +141 -0
- package/dist/src/web-ui/app/components/automations/tool-identity.js +25 -0
- package/dist/src/web-ui/app/components/automations/workspace.js +462 -0
- package/dist/src/web-ui/app/components/composer-context-window.js +24 -13
- package/dist/src/web-ui/app/components/config-workspace/model-rendering.js +2 -2
- package/dist/src/web-ui/app/components/conversation-activity.d.ts +2 -28
- package/dist/src/web-ui/app/components/conversation-activity.js +23 -60
- package/dist/src/web-ui/app/components/conversation-status.js +3 -2
- package/dist/src/web-ui/app/components/conversation-view.js +36 -14
- package/dist/src/web-ui/app/components/dashboard/automations.js +28 -0
- package/dist/src/web-ui/app/components/dashboard/workspace.js +9 -0
- package/dist/src/web-ui/app/components/notifications/dom.js +1 -1
- package/dist/src/web-ui/app/components/notifications/feedback.js +34 -0
- package/dist/src/web-ui/app/components/notifications/pagination.js +13 -0
- package/dist/src/web-ui/app/components/notifications/presentation.js +25 -4
- package/dist/src/web-ui/app/components/notifications/tabs.js +49 -0
- package/dist/src/web-ui/app/components/notifications/workspace.js +19 -26
- package/dist/src/web-ui/app/components/onboarding-workspace-access.js +1 -1
- package/dist/src/web-ui/app/components/passive-learning/agent-state.js +0 -5
- package/dist/src/web-ui/app/components/passive-learning/agent-view.js +1 -1
- package/dist/src/web-ui/app/components/passive-learning/home.js +0 -4
- package/dist/src/web-ui/app/components/passive-learning/memory.js +0 -3
- package/dist/src/web-ui/app/components/passive-learning/settings-view.js +2 -2
- package/dist/src/web-ui/app/components/passive-learning/workspace-view.js +3 -3
- package/dist/src/web-ui/app/components/runtime-setup/optional-steps.js +7 -1
- package/dist/src/web-ui/app/components/runtime-setup-guide.d.ts +5 -1
- package/dist/src/web-ui/app/components/runtime-setup-guide.js +6 -3
- package/dist/src/web-ui/app/components/schedules/details.js +3 -2
- package/dist/src/web-ui/app/components/schedules/form.js +4 -4
- package/dist/src/web-ui/app/components/spark-chat/empty-state.js +45 -0
- package/dist/src/web-ui/app/components/spark-chat/handoff-actions.js +59 -0
- package/dist/src/web-ui/app/components/spark-chat/mascot-activity.js +27 -0
- package/dist/src/web-ui/app/components/spark-chat/motion.js +52 -0
- package/dist/src/web-ui/app/components/spark-chat/panel.js +109 -0
- package/dist/src/web-ui/app/components/spark-chat/placement.js +198 -0
- package/dist/src/web-ui/app/components/spark-chat/results.js +44 -0
- package/dist/src/web-ui/app/components/spark-chat/settings.js +84 -0
- package/dist/src/web-ui/app/components/system-host/macos-permission-preparation.js +83 -0
- package/dist/src/web-ui/app/components/system-host/macos-permission-rendering.js +85 -0
- package/dist/src/web-ui/app/components/system-host/macos-permission-scopes.js +51 -0
- package/dist/src/web-ui/app/components/system-host/manager.js +34 -0
- package/dist/src/web-ui/app/components/system-host/rendering.js +12 -4
- package/dist/src/web-ui/app/components/workspace-shell.js +39 -6
- package/dist/src/web-ui/app/computer-access-feature.js +5 -0
- package/dist/src/web-ui/app/configuration-feature.js +1 -0
- package/dist/src/web-ui/app/controllers/app-event-bindings.js +24 -2
- package/dist/src/web-ui/app/controllers/automation-draft-actions.js +153 -0
- package/dist/src/web-ui/app/controllers/automation-management-actions.js +75 -0
- package/dist/src/web-ui/app/controllers/automation-mutation-lifecycle.js +32 -0
- package/dist/src/web-ui/app/controllers/automation-read-projection.js +63 -0
- package/dist/src/web-ui/app/controllers/automation-run-actions.js +54 -0
- package/dist/src/web-ui/app/controllers/automation-view-scope.js +19 -0
- package/dist/src/web-ui/app/controllers/automations-controller.js +395 -0
- package/dist/src/web-ui/app/controllers/composer-queue-controller.d.ts +1 -0
- package/dist/src/web-ui/app/controllers/composer-queue-controller.js +18 -12
- package/dist/src/web-ui/app/controllers/conversation-session-controller.js +38 -15
- package/dist/src/web-ui/app/controllers/conversation-view-feature.js +1 -14
- package/dist/src/web-ui/app/controllers/dashboard-controller.js +42 -1
- package/dist/src/web-ui/app/controllers/notifications-controller.js +1 -1
- package/dist/src/web-ui/app/controllers/passive-learning-controller.js +33 -85
- package/dist/src/web-ui/app/controllers/projects-controller.d.ts +2 -0
- package/dist/src/web-ui/app/controllers/projects-controller.js +53 -18
- package/dist/src/web-ui/app/controllers/realtime-event-controller.js +42 -160
- package/dist/src/web-ui/app/controllers/request-lifecycle-controller.js +2 -0
- package/dist/src/web-ui/app/controllers/runtime-onboarding-controller.d.ts +4 -1
- package/dist/src/web-ui/app/controllers/runtime-onboarding-controller.js +14 -3
- package/dist/src/web-ui/app/controllers/schedules-controller.js +11 -19
- package/dist/src/web-ui/app/controllers/spark-chat-notices.js +34 -0
- package/dist/src/web-ui/app/controllers/spark-chat-reading.js +145 -0
- package/dist/src/web-ui/app/controllers/spark-chat-sync.js +151 -0
- package/dist/src/web-ui/app/controllers/spark-handoff-navigation.js +32 -0
- package/dist/src/web-ui/app/controllers/workspace-route-controller.js +21 -1
- package/dist/src/web-ui/app/dashboard-feature.js +0 -1
- package/dist/src/web-ui/app/index.html +12 -10
- package/dist/src/web-ui/app/lib/automation-binding-producers.js +47 -0
- package/dist/src/web-ui/app/lib/automation-graph-position.js +19 -0
- package/dist/src/web-ui/app/lib/automation-parallel-depth.js +19 -0
- package/dist/src/web-ui/app/lib/configuration-pages.js +3 -5
- package/dist/src/web-ui/app/lib/context-compaction-state.d.ts +41 -0
- package/dist/src/web-ui/app/lib/context-compaction-state.js +172 -0
- package/dist/src/web-ui/app/lib/context-window-measurement.d.ts +33 -0
- package/dist/src/web-ui/app/lib/context-window-measurement.js +99 -0
- package/dist/src/web-ui/app/lib/context-window-replay.d.ts +32 -0
- package/dist/src/web-ui/app/lib/context-window-replay.js +38 -0
- package/dist/src/web-ui/app/lib/context-window-snapshot-order.d.ts +16 -8
- package/dist/src/web-ui/app/lib/context-window-snapshot-order.js +29 -9
- package/dist/src/web-ui/app/lib/context-window-state.d.ts +80 -0
- package/dist/src/web-ui/app/lib/context-window-state.js +341 -0
- package/dist/src/web-ui/app/lib/conversation-status-model.js +15 -3
- package/dist/src/web-ui/app/lib/realtime-message.js +9 -0
- package/dist/src/web-ui/app/lib/schedule-conversation-presentation.js +19 -0
- package/dist/src/web-ui/app/lib/schedule-presentation.js +2 -2
- package/dist/src/web-ui/app/lib/spark-chat-address.js +22 -0
- package/dist/src/web-ui/app/lib/spark-chat-presentation.js +16 -0
- package/dist/src/web-ui/app/lib/spark-chat-read-state.js +13 -0
- package/dist/src/web-ui/app/lib/spark-proposal-message.js +7 -0
- package/dist/src/web-ui/app/lib/tool-activity-event.d.ts +1 -0
- package/dist/src/web-ui/app/lib/tool-activity-event.js +6 -2
- package/dist/src/web-ui/app/lib/tool-activity-model.js +1 -0
- package/dist/src/web-ui/app/lib/tool-approval-acknowledgement.js +7 -0
- package/dist/src/web-ui/app/lib/tool-automation-activity-fields.js +59 -0
- package/dist/src/web-ui/app/lib/tool-process-activity-fields.js +1 -1
- package/dist/src/web-ui/app/lib/workspace-change.js +2 -2
- package/dist/src/web-ui/app/lib/workspace-route.d.ts +3 -0
- package/dist/src/web-ui/app/lib/workspace-route.js +13 -2
- package/dist/src/web-ui/app/notifications-feature.js +13 -0
- package/dist/src/web-ui/app/passive-learning-feature.js +5 -30
- package/dist/src/web-ui/app/projects-feature.js +16 -5
- package/dist/src/web-ui/app/runtime-onboarding-feature.js +1 -0
- package/dist/src/web-ui/app/services/client-preferences.d.ts +0 -2
- package/dist/src/web-ui/app/services/client-preferences.js +0 -2
- package/dist/src/web-ui/app/services/runtime-web-client/automations.d.ts +36 -0
- package/dist/src/web-ui/app/services/runtime-web-client/automations.js +63 -0
- package/dist/src/web-ui/app/services/runtime-web-client/learning.js +0 -9
- package/dist/src/web-ui/app/services/runtime-web-client/spark-chat.d.ts +22 -0
- package/dist/src/web-ui/app/services/runtime-web-client/spark-chat.js +29 -0
- package/dist/src/web-ui/app/services/runtime-web-client/system-host.js +4 -2
- package/dist/src/web-ui/app/services/runtime-web-client.d.ts +24 -4
- package/dist/src/web-ui/app/services/runtime-web-client.js +5 -1
- package/dist/src/web-ui/app/spark-chat-conversation.js +217 -0
- package/dist/src/web-ui/app/spark-chat-feature.js +187 -0
- package/dist/src/web-ui/app/spark-mascot.svg +12 -0
- package/dist/src/web-ui/app/styles/11-workspace-header-width.css +48 -14
- package/dist/src/web-ui/app/styles/11-workspace-rail.css +6 -0
- package/dist/src/web-ui/app/styles/19-dashboard-automations.css +32 -0
- package/dist/src/web-ui/app/styles/41-co-worker-agent.css +6 -25
- package/dist/src/web-ui/app/styles/46-system-host.css +17 -0
- package/dist/src/web-ui/app/styles/48-notifications.css +14 -8
- package/dist/src/web-ui/app/styles/50-automations.css +353 -0
- package/dist/src/web-ui/app/styles/51-automation-editor-actions.css +35 -0
- package/dist/src/web-ui/app/styles/51-automation-templates.css +39 -0
- package/dist/src/web-ui/app/styles/52-automation-reports.css +84 -0
- package/dist/src/web-ui/app/styles/52-automation-step-editor.css +73 -0
- package/dist/src/web-ui/app/styles/53-automation-schema-inputs.css +21 -0
- package/dist/src/web-ui/app/styles/54-spark-chat.css +111 -0
- package/dist/src/web-ui/app/styles/94-automations-responsive.css +35 -0
- package/dist/src/web-ui/app/styles.css +9 -1
- package/dist/src/web-ui/app/ui-behavior.js +1 -0
- package/dist/src/web-ui/local-runtime/api-router.d.ts +2 -0
- package/dist/src/web-ui/local-runtime/api-router.js +18 -0
- package/dist/src/web-ui/local-runtime/automation-routes.d.ts +27 -0
- package/dist/src/web-ui/local-runtime/automation-routes.js +227 -0
- package/dist/src/web-ui/local-runtime/environment-registry.d.ts +4 -0
- package/dist/src/web-ui/local-runtime/environment-registry.js +5 -0
- package/dist/src/web-ui/local-runtime/learning-notifications.js +1 -1
- package/dist/src/web-ui/local-runtime/learning-routes.js +0 -22
- package/dist/src/web-ui/local-runtime/request-execution.js +35 -0
- package/dist/src/web-ui/local-runtime/session-routes.js +32 -2
- package/dist/src/web-ui/local-runtime/setup-embedding-config-repository.d.ts +6 -0
- package/dist/src/web-ui/local-runtime/setup-embedding-config-repository.js +25 -0
- package/dist/src/web-ui/local-runtime/setup-embedding-service.js +2 -0
- package/dist/src/web-ui/local-runtime/spark-chat-admission.d.ts +7 -0
- package/dist/src/web-ui/local-runtime/spark-chat-admission.js +37 -0
- package/dist/src/web-ui/local-runtime/spark-chat-configuration.d.ts +8 -0
- package/dist/src/web-ui/local-runtime/spark-chat-configuration.js +16 -0
- package/dist/src/web-ui/local-runtime/spark-chat-handoff.d.ts +4 -0
- package/dist/src/web-ui/local-runtime/spark-chat-handoff.js +84 -0
- package/dist/src/web-ui/local-runtime/spark-chat-routes.d.ts +19 -0
- package/dist/src/web-ui/local-runtime/spark-chat-routes.js +62 -0
- package/dist/src/web-ui/local-runtime-backend.d.ts +4 -0
- package/dist/src/web-ui/local-runtime-backend.js +3 -0
- package/dist/src/web-ui/notifications/automation-event-projection.d.ts +3 -0
- package/dist/src/web-ui/notifications/automation-event-projection.js +57 -0
- package/dist/src/web-ui/notifications/contracts.d.ts +20 -5
- package/dist/src/web-ui/notifications/contracts.js +7 -1
- package/dist/src/web-ui/notifications/conversation-source.d.ts +6 -0
- package/dist/src/web-ui/notifications/conversation-source.js +26 -0
- package/dist/src/web-ui/notifications/event-fields.d.ts +3 -0
- package/dist/src/web-ui/notifications/event-fields.js +12 -0
- package/dist/src/web-ui/notifications/event-projection.d.ts +2 -1
- package/dist/src/web-ui/notifications/event-projection.js +22 -20
- package/dist/src/web-ui/notifications/service.js +33 -2
- package/dist/src/web-ui/notifications/storage-schema.js +118 -21
- package/dist/src/web-ui/server.js +1 -1
- package/dist/src/web-ui/session-read-state/service.d.ts +39 -0
- package/dist/src/web-ui/session-read-state/service.js +20 -2
- package/dist/src/web-ui/session-read-state/store.d.ts +2 -0
- package/dist/src/web-ui/session-read-state/store.js +7 -0
- package/dist/src/web-ui/session-read-state/visible-messages.d.ts +30 -0
- package/dist/src/web-ui/session-read-state/visible-messages.js +119 -0
- package/dist/src/web-ui/system-host-service.d.ts +4 -1
- package/dist/src/web-ui/system-host-service.js +14 -3
- package/dist/src/web-ui/system-host-setup/local-request-authority.d.ts +3 -0
- package/dist/src/web-ui/system-host-setup/local-request-authority.js +15 -0
- package/dist/src/web-ui/system-host-setup/local-setup-availability.js +2 -12
- package/dist/src/web-ui/system-host-setup/native-permission-route.d.ts +26 -0
- package/dist/src/web-ui/system-host-setup/native-permission-route.js +96 -0
- package/dist/src/web-ui/system-host-setup/permission-route.d.ts +13 -0
- package/dist/src/web-ui/system-host-setup/permission-route.js +102 -0
- package/docs/installation.md +41 -9
- package/docs/plugins.md +53 -11
- package/docs/runtime-public-contracts.md +7 -2
- package/docs/tool-execution-result-evidence-contract.md +11 -4
- package/package.json +1 -1
- package/plugins/capability-brief/src/index.cjs +85 -37
- package/plugins/code-outline/source/index.ts +7 -2
- package/plugins/code-outline/src/index.cjs +91 -39
- package/plugins/document-reader/plugin.json +18 -3
- package/plugins/document-reader/skills/document_reader_skill/SKILL.md +6 -6
- package/plugins/document-reader/source/source-resolution.ts +1 -1
- package/plugins/document-reader/src/index.cjs +86 -38
- package/plugins/exec/plugin.json +3 -3
- package/plugins/exec/source/handlers.ts +78 -20
- package/plugins/exec/source/output-contracts.ts +45 -0
- package/plugins/exec/source/output-files.ts +161 -0
- package/plugins/exec/source/output-maintenance.ts +60 -0
- package/plugins/exec/source/output-range-reader.ts +97 -0
- package/plugins/exec/source/output-retention.ts +34 -0
- package/plugins/exec/source/output-snapshot.ts +54 -0
- package/plugins/exec/source/output-store.ts +182 -0
- package/plugins/exec/source/output-utf8-boundary.ts +14 -0
- package/plugins/exec/source/output-writer.ts +131 -0
- package/plugins/exec/source/process-manager.ts +142 -70
- package/plugins/exec/source/process-output-buffer.ts +13 -18
- package/plugins/exec/source/process-output.ts +158 -0
- package/plugins/exec/source/request-resources.ts +28 -12
- package/plugins/exec/source/result-presentation.ts +39 -39
- package/plugins/exec/source/retained-output-failure.ts +51 -0
- package/plugins/exec/source/settings.ts +9 -10
- package/plugins/exec/source/terminal-delivery.ts +49 -0
- package/plugins/exec/source/types.ts +12 -1
- package/plugins/exec/src/index.cjs +1112 -188
- package/plugins/filesystem/plugin.json +5 -5
- package/plugins/filesystem/skills/read_file_skill/SKILL.md +1 -1
- package/plugins/filesystem/src/index.cjs +85 -37
- package/plugins/json-inspector/source/index.ts +7 -2
- package/plugins/json-inspector/src/index.cjs +91 -39
- package/plugins/local-search/source/index.ts +9 -4
- package/plugins/local-search/src/index.cjs +93 -41
- package/plugins/memory/src/index.cjs +85 -37
- package/plugins/project-orientation/source/index.ts +9 -4
- package/plugins/project-orientation/src/index.cjs +93 -41
- package/plugins/system/plugin.json +2 -2
- package/plugins/system/source/computer/observation-output.ts +1 -1
- package/plugins/system/src/index.cjs +88 -43
- package/plugins/system-probe/source/index.ts +7 -2
- package/plugins/system-probe/src/index.cjs +91 -39
- package/plugins/web/README.md +9 -0
- package/plugins/web/source/plugin.ts +5 -3
- package/plugins/web/source/research.ts +7 -7
- package/plugins/web/src/index.cjs +96 -43
- package/src/runtime/README.md +100 -11
- package/src/runtime/scheduler/README.md +63 -0
- package/dist/src/web-ui/app/components/passive-learning/proposal-notifications.js +0 -106
- package/dist/src/web-ui/app/components/passive-learning/proposal-read-state.js +0 -23
- package/dist/src/web-ui/app/components/passive-learning/proposal-view.js +0 -23
- package/dist/src/web-ui/app/components/spark-conversation-actions.js +0 -62
- package/dist/src/web-ui/app/services/spark-conversation-preferences.js +0 -27
- package/dist/src/web-ui/app/styles/29-spark-conversation.css +0 -19
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import { randomUUID } from "node:crypto";
|
|
2
|
+
export function isVisibleMessageReadState(value) {
|
|
3
|
+
if (!value || typeof value !== "object")
|
|
4
|
+
return false;
|
|
5
|
+
const state = value;
|
|
6
|
+
if (typeof state.generation !== "string" || !state.generation)
|
|
7
|
+
return false;
|
|
8
|
+
if (!Number.isSafeInteger(state.revision) || state.revision < 0)
|
|
9
|
+
return false;
|
|
10
|
+
if (!Array.isArray(state.messages))
|
|
11
|
+
return false;
|
|
12
|
+
return state.messages.every((message) => typeof message?.messageId === "string" && Number.isFinite(message.createdAt)
|
|
13
|
+
&& (message.requestId === null || typeof message.requestId === "string"));
|
|
14
|
+
}
|
|
15
|
+
export function readVisibleMessageReceipts(value) {
|
|
16
|
+
if (value === undefined)
|
|
17
|
+
return undefined;
|
|
18
|
+
if (!Array.isArray(value))
|
|
19
|
+
throw new Error("Invalid visible message receipts.");
|
|
20
|
+
for (const entry of value) {
|
|
21
|
+
if (!isVisibleReceiptEntry(entry))
|
|
22
|
+
throw new Error("Invalid visible message receipts.");
|
|
23
|
+
}
|
|
24
|
+
return value;
|
|
25
|
+
}
|
|
26
|
+
function isVisibleReceiptEntry(entry) {
|
|
27
|
+
if (!Array.isArray(entry) || entry.length !== 2)
|
|
28
|
+
return false;
|
|
29
|
+
if (typeof entry[0] !== "string")
|
|
30
|
+
return false;
|
|
31
|
+
return isVisibleMessageReadState(entry[1]);
|
|
32
|
+
}
|
|
33
|
+
function ensureVisibleReadState(state, sessionId) {
|
|
34
|
+
const stored = new Map(state.visibleMessages ?? []);
|
|
35
|
+
const previous = stored.get(sessionId);
|
|
36
|
+
if (previous)
|
|
37
|
+
return previous;
|
|
38
|
+
const initial = { generation: randomUUID(), revision: 0, messages: [] };
|
|
39
|
+
stored.set(sessionId, initial);
|
|
40
|
+
state.visibleMessages = [...stored];
|
|
41
|
+
return initial;
|
|
42
|
+
}
|
|
43
|
+
function receiptIdentity(messageId, createdAt, requestId) {
|
|
44
|
+
return JSON.stringify([String(messageId), createdAt, requestId || null]);
|
|
45
|
+
}
|
|
46
|
+
export function visibleReadMessageIds(input) {
|
|
47
|
+
if (!Array.isArray(input) || input.length > 500)
|
|
48
|
+
throw new Error("visible_message_ids_invalid");
|
|
49
|
+
return [...new Set(input.map((id) => {
|
|
50
|
+
if (typeof id === "number" && Number.isSafeInteger(id) && id >= 0)
|
|
51
|
+
return String(id);
|
|
52
|
+
if (typeof id === "string" && id.length > 0 && id.length <= 256)
|
|
53
|
+
return id;
|
|
54
|
+
throw new Error("visible_message_ids_invalid");
|
|
55
|
+
}))];
|
|
56
|
+
}
|
|
57
|
+
export function visibleReadObservations(ids, input) {
|
|
58
|
+
if (!Array.isArray(input) || input.length !== ids.length)
|
|
59
|
+
throw new Error("visible_message_receipts_invalid");
|
|
60
|
+
const observations = input.map((entry) => {
|
|
61
|
+
if (!entry || typeof entry !== "object")
|
|
62
|
+
throw new Error("visible_message_receipts_invalid");
|
|
63
|
+
const id = visibleReadMessageIds([entry.id])[0];
|
|
64
|
+
if (!ids.includes(id))
|
|
65
|
+
throw new Error("visible_message_receipts_invalid");
|
|
66
|
+
if (!Number.isFinite(entry.createdAt))
|
|
67
|
+
throw new Error("visible_message_receipts_invalid");
|
|
68
|
+
const requestId = entry.requestId;
|
|
69
|
+
if (requestId !== null && typeof requestId !== "string")
|
|
70
|
+
throw new Error("visible_message_receipts_invalid");
|
|
71
|
+
return { messageId: id, createdAt: entry.createdAt, requestId: requestId || null };
|
|
72
|
+
});
|
|
73
|
+
if (new Set(observations.map((receipt) => receipt.messageId)).size !== ids.length)
|
|
74
|
+
throw new Error("visible_message_receipts_invalid");
|
|
75
|
+
return observations;
|
|
76
|
+
}
|
|
77
|
+
export function markVisibleAssistantMessages(state, sessionId, messages, observations, generation, now) {
|
|
78
|
+
const previous = ensureVisibleReadState(state, sessionId);
|
|
79
|
+
if (generation !== previous.generation)
|
|
80
|
+
throw new Error("read_generation_changed");
|
|
81
|
+
const stored = new Map(state.visibleMessages ?? []);
|
|
82
|
+
const assistants = messages.filter((message) => message.role === "assistant");
|
|
83
|
+
const canonical = new Set(assistants.map((message) => receiptIdentity(message.id, message.createdAt, message.requestId)));
|
|
84
|
+
const requested = new Set(observations.map((receipt) => receiptIdentity(receipt.messageId, receipt.createdAt, receipt.requestId)));
|
|
85
|
+
for (const identity of requested) {
|
|
86
|
+
if (!canonical.has(identity))
|
|
87
|
+
throw new Error("visible_message_receipt_stale");
|
|
88
|
+
}
|
|
89
|
+
const prior = new Set(previous.messages.map((receipt) => receiptIdentity(receipt.messageId, receipt.createdAt, receipt.requestId)));
|
|
90
|
+
const receipts = messages.filter((message) => message.role === "assistant").filter((message) => {
|
|
91
|
+
const identity = receiptIdentity(message.id, message.createdAt, message.requestId);
|
|
92
|
+
if (requested.has(identity))
|
|
93
|
+
return true;
|
|
94
|
+
return prior.has(identity);
|
|
95
|
+
}).map((message) => ({ messageId: String(message.id), createdAt: message.createdAt, requestId: message.requestId }));
|
|
96
|
+
if (JSON.stringify(receipts) === JSON.stringify(previous?.messages ?? []))
|
|
97
|
+
return;
|
|
98
|
+
stored.set(sessionId, { generation: previous.generation, revision: Math.max(now, previous.revision + 1), messages: receipts });
|
|
99
|
+
state.visibleMessages = [...stored];
|
|
100
|
+
}
|
|
101
|
+
export function projectVisibleSessionReadState(state, sessionId, messages) {
|
|
102
|
+
const saved = ensureVisibleReadState(state, sessionId);
|
|
103
|
+
const assistants = messages.filter((message) => message.role === "assistant");
|
|
104
|
+
const identities = new Set(saved.messages.map((receipt) => receiptIdentity(receipt.messageId, receipt.createdAt, receipt.requestId)));
|
|
105
|
+
const wasRead = (message) => identities.has(receiptIdentity(message.id, message.createdAt, message.requestId));
|
|
106
|
+
const unread = assistants.filter((message) => !wasRead(message));
|
|
107
|
+
const lastRead = [...assistants].reverse().find(wasRead);
|
|
108
|
+
return {
|
|
109
|
+
sessionId, readStateStatus: "available",
|
|
110
|
+
unreadMessageIds: unread.map((message) => message.id),
|
|
111
|
+
unreadCount: unread.length, hasUnread: unread.length > 0,
|
|
112
|
+
readRevision: saved?.revision ?? 0,
|
|
113
|
+
readGeneration: saved.generation,
|
|
114
|
+
lastReadAt: saved?.revision ?? state.initializedAt,
|
|
115
|
+
lastReadMessageId: lastRead?.id ?? null,
|
|
116
|
+
latestMessageId: messages.at(-1)?.id ?? null,
|
|
117
|
+
latestAssistantMessageId: assistants.at(-1)?.id ?? null,
|
|
118
|
+
};
|
|
119
|
+
}
|
|
@@ -1,15 +1,18 @@
|
|
|
1
1
|
import type { IncomingMessage, ServerResponse } from "node:http";
|
|
2
2
|
import type { Duplex } from "node:stream";
|
|
3
|
+
import { type NativePermissionAccess } from "./system-host-setup/native-permission-route.js";
|
|
3
4
|
export declare class WebSystemHostService {
|
|
4
5
|
private readonly rootDir;
|
|
5
6
|
private readonly store;
|
|
6
7
|
private readonly connection;
|
|
7
8
|
private readonly setup;
|
|
9
|
+
private readonly permissions;
|
|
10
|
+
private readonly nativePermissions;
|
|
8
11
|
private readonly wss;
|
|
9
12
|
private broker?;
|
|
10
13
|
private starting?;
|
|
11
14
|
private closing;
|
|
12
|
-
constructor(rootDir: string, connectionChanged?: () => void);
|
|
15
|
+
constructor(rootDir: string, connectionChanged?: () => void, nativePermissionAccess?: NativePermissionAccess);
|
|
13
16
|
private ensureStarted;
|
|
14
17
|
/** Native upgrade is separate from browser realtime and requires its own credential. */
|
|
15
18
|
handleUpgrade(request: IncomingMessage, socket: Duplex, head: Buffer, listenHost?: string): boolean;
|
|
@@ -16,6 +16,8 @@ import { readHostReadiness } from "./system-host-setup/readiness.js";
|
|
|
16
16
|
import { HostSetupRoutes, isHostSetupRoute, sendHostSetupInputError } from "./system-host-setup/routes.js";
|
|
17
17
|
import { reportHostStartupFailure } from "./system-host-startup-diagnostic.js";
|
|
18
18
|
import { withLocalMacSetup } from "./system-host-setup/local-setup-availability.js";
|
|
19
|
+
import { HOST_PERMISSION_PATH, HostPermissionRoute } from "./system-host-setup/permission-route.js";
|
|
20
|
+
import { NativeRuntimePermissionRoute } from "./system-host-setup/native-permission-route.js";
|
|
19
21
|
function isSystemHostRoute(pathname) {
|
|
20
22
|
if (pathname === "/web-api/runtime/system-host")
|
|
21
23
|
return true;
|
|
@@ -26,6 +28,8 @@ export class WebSystemHostService {
|
|
|
26
28
|
store;
|
|
27
29
|
connection;
|
|
28
30
|
setup;
|
|
31
|
+
permissions;
|
|
32
|
+
nativePermissions;
|
|
29
33
|
wss = new WebSocketServer({
|
|
30
34
|
noServer: true,
|
|
31
35
|
maxPayload: HOST_WIRE_MAX_BYTES,
|
|
@@ -34,10 +38,12 @@ export class WebSystemHostService {
|
|
|
34
38
|
broker;
|
|
35
39
|
starting;
|
|
36
40
|
closing = false;
|
|
37
|
-
constructor(rootDir, connectionChanged) {
|
|
41
|
+
constructor(rootDir, connectionChanged, nativePermissionAccess) {
|
|
38
42
|
this.rootDir = rootDir;
|
|
39
43
|
this.store = new HostPairingStore(rootDir);
|
|
40
44
|
this.connection = new HostConnection(this.store, connectionChanged);
|
|
45
|
+
this.nativePermissions = new NativeRuntimePermissionRoute(nativePermissionAccess);
|
|
46
|
+
this.permissions = new HostPermissionRoute(this.connection, this.nativePermissions);
|
|
41
47
|
this.setup = new HostSetupRoutes({
|
|
42
48
|
store: this.store,
|
|
43
49
|
readiness: () => readHostReadiness(this.connection.status()),
|
|
@@ -92,10 +98,14 @@ export class WebSystemHostService {
|
|
|
92
98
|
this.wss.handleUpgrade(request, socket, head, (client) => this.connection.accept(client, token));
|
|
93
99
|
}
|
|
94
100
|
async handleHttp(request, response, pathname) {
|
|
95
|
-
if (!isSystemHostRoute(pathname) && !isHostSetupRoute(pathname))
|
|
101
|
+
if (!isSystemHostRoute(pathname) && !isHostSetupRoute(pathname) && pathname !== HOST_PERMISSION_PATH)
|
|
96
102
|
return false;
|
|
97
103
|
response.setHeader("cache-control", "no-store");
|
|
98
104
|
try {
|
|
105
|
+
if (pathname === HOST_PERMISSION_PATH) {
|
|
106
|
+
await this.permissions.handle(request, response);
|
|
107
|
+
return true;
|
|
108
|
+
}
|
|
99
109
|
if (isHostSetupRoute(pathname)) {
|
|
100
110
|
await this.setup.handle(request, response, pathname);
|
|
101
111
|
return true;
|
|
@@ -104,7 +114,8 @@ export class WebSystemHostService {
|
|
|
104
114
|
pathname === "/web-api/runtime/system-host") {
|
|
105
115
|
const status = this.connection.status();
|
|
106
116
|
const readiness = withLocalMacSetup(request, await readHostReadiness(status));
|
|
107
|
-
|
|
117
|
+
const nativePermissions = await this.nativePermissions.status(request);
|
|
118
|
+
sendJson(response, 200, { ok: true, ...status, readiness, nativePermissions });
|
|
108
119
|
return true;
|
|
109
120
|
}
|
|
110
121
|
if (!acceptConfigMutationRequest(request, response))
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { isNativeLoopbackAddress } from "../../computer-access/companion/native-address.js";
|
|
2
|
+
import { hasLoopbackRequestAuthority } from "../request-authority.js";
|
|
3
|
+
/** Native preparation controls this listener's Mac, never a remote browser's OS. */
|
|
4
|
+
export function hasLocalRuntimeRequestAuthority(request) {
|
|
5
|
+
if (!hasLoopbackRequestAuthority(request))
|
|
6
|
+
return false;
|
|
7
|
+
if (!isNativeLoopbackAddress(request.socket.remoteAddress ?? ""))
|
|
8
|
+
return false;
|
|
9
|
+
if (!isNativeLoopbackAddress(request.socket.localAddress ?? ""))
|
|
10
|
+
return false;
|
|
11
|
+
const encrypted = "encrypted" in request.socket && request.socket.encrypted;
|
|
12
|
+
const authority = new URL(`${encrypted ? "https" : "http"}://${request.headers.host}`);
|
|
13
|
+
const port = Number(authority.port || (encrypted ? 443 : 80));
|
|
14
|
+
return port === request.socket.localPort;
|
|
15
|
+
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { isIP } from "node:net";
|
|
2
2
|
import { hostname } from "node:os";
|
|
3
|
-
import {
|
|
4
|
-
import { hasLoopbackRequestAuthority } from "../request-authority.js";
|
|
3
|
+
import { hasLocalRuntimeRequestAuthority } from "./local-request-authority.js";
|
|
5
4
|
/** Local setup controls the Runtime's computer, never an inferred browser OS. */
|
|
6
5
|
export function canSetUpLocalMac(request, readiness, platform = process.platform) {
|
|
7
6
|
if (platform !== "darwin")
|
|
@@ -12,16 +11,7 @@ export function canSetUpLocalMac(request, readiness, platform = process.platform
|
|
|
12
11
|
return false;
|
|
13
12
|
if (readiness.ready)
|
|
14
13
|
return false;
|
|
15
|
-
|
|
16
|
-
return false;
|
|
17
|
-
if (!isNativeLoopbackAddress(request.socket.remoteAddress ?? ""))
|
|
18
|
-
return false;
|
|
19
|
-
if (!isNativeLoopbackAddress(request.socket.localAddress ?? ""))
|
|
20
|
-
return false;
|
|
21
|
-
const encrypted = "encrypted" in request.socket && request.socket.encrypted;
|
|
22
|
-
const authority = new URL(`${encrypted ? "https" : "http"}://${request.headers.host}`);
|
|
23
|
-
const port = Number(authority.port || (encrypted ? 443 : 80));
|
|
24
|
-
return port === request.socket.localPort;
|
|
14
|
+
return hasLocalRuntimeRequestAuthority(request);
|
|
25
15
|
}
|
|
26
16
|
/** Use only after eligibility validates the loopback listener and authority. */
|
|
27
17
|
export function localMacSetupRuntimeUrl(request) {
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { IncomingMessage, ServerResponse } from "node:http";
|
|
2
|
+
import { type NativePermissionClient } from "../../computer-access/native-permission-contract.js";
|
|
3
|
+
export type NativePermissionAccess = (environmentId: string) => NativePermissionClient | undefined;
|
|
4
|
+
export declare function isNativeRuntimePermissionRequest(value: unknown): value is Record<string, unknown>;
|
|
5
|
+
/** Browser management binds to a running environment owner; it never starts one. */
|
|
6
|
+
export declare class NativeRuntimePermissionRoute {
|
|
7
|
+
private readonly clients;
|
|
8
|
+
private readonly platform;
|
|
9
|
+
constructor(clients?: NativePermissionAccess, platform?: NodeJS.Platform);
|
|
10
|
+
private unavailableReason;
|
|
11
|
+
private hasCurrentOwner;
|
|
12
|
+
status(request: IncomingMessage): Promise<{
|
|
13
|
+
available: boolean;
|
|
14
|
+
reason: string;
|
|
15
|
+
scope: "native_runtime";
|
|
16
|
+
environmentId: string;
|
|
17
|
+
} | {
|
|
18
|
+
available: true;
|
|
19
|
+
ownerId: string;
|
|
20
|
+
computerName: string;
|
|
21
|
+
executablePath: string;
|
|
22
|
+
scope: "native_runtime";
|
|
23
|
+
environmentId: string;
|
|
24
|
+
}>;
|
|
25
|
+
handle(request: IncomingMessage, response: ServerResponse, body: Record<string, unknown>): Promise<void>;
|
|
26
|
+
}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { isHostRecord } from "../../computer-access/companion/protocol.js";
|
|
2
|
+
import { isNativePermissionEnvironment, readNativePermissionInput } from "../../computer-access/native-permission-contract.js";
|
|
3
|
+
import { sendJson } from "../local-runtime/http.js";
|
|
4
|
+
import { hasLocalRuntimeRequestAuthority } from "./local-request-authority.js";
|
|
5
|
+
export function isNativeRuntimePermissionRequest(value) {
|
|
6
|
+
return isHostRecord(value) && value.scope === "native_runtime";
|
|
7
|
+
}
|
|
8
|
+
/** Browser management binds to a running environment owner; it never starts one. */
|
|
9
|
+
export class NativeRuntimePermissionRoute {
|
|
10
|
+
clients;
|
|
11
|
+
platform;
|
|
12
|
+
constructor(clients = () => undefined, platform = process.platform) {
|
|
13
|
+
this.clients = clients;
|
|
14
|
+
this.platform = platform;
|
|
15
|
+
}
|
|
16
|
+
unavailableReason(request) {
|
|
17
|
+
if (this.platform !== "darwin")
|
|
18
|
+
return "native_macos_unavailable";
|
|
19
|
+
if (!hasLocalRuntimeRequestAuthority(request))
|
|
20
|
+
return "local_browser_required";
|
|
21
|
+
return undefined;
|
|
22
|
+
}
|
|
23
|
+
hasCurrentOwner(environmentId, client, status, ownerId) {
|
|
24
|
+
if (!status.available)
|
|
25
|
+
return false;
|
|
26
|
+
if (status.ownerId !== ownerId)
|
|
27
|
+
return false;
|
|
28
|
+
return this.clients(environmentId) === client;
|
|
29
|
+
}
|
|
30
|
+
async status(request) {
|
|
31
|
+
const environmentId = new URL(request.url ?? "/", "http://localhost").searchParams.get("environment") ?? "";
|
|
32
|
+
const binding = { scope: "native_runtime", environmentId };
|
|
33
|
+
const unavailable = this.unavailableReason(request);
|
|
34
|
+
if (unavailable)
|
|
35
|
+
return { ...binding, available: false, reason: unavailable };
|
|
36
|
+
if (!isNativePermissionEnvironment(environmentId))
|
|
37
|
+
return { ...binding, available: false, reason: "runtime_not_started" };
|
|
38
|
+
const client = this.clients(environmentId);
|
|
39
|
+
if (!client)
|
|
40
|
+
return { ...binding, available: false, reason: "runtime_not_started" };
|
|
41
|
+
try {
|
|
42
|
+
const status = await client.status();
|
|
43
|
+
if (this.clients(environmentId) !== client)
|
|
44
|
+
return { ...binding, available: false, reason: "runtime_owner_unavailable" };
|
|
45
|
+
return { ...binding, ...status };
|
|
46
|
+
}
|
|
47
|
+
catch {
|
|
48
|
+
return { ...binding, available: false, reason: "runtime_owner_unavailable" };
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
async handle(request, response, body) {
|
|
52
|
+
const { scope, environmentId, ...fields } = body;
|
|
53
|
+
const input = readNativePermissionInput(fields);
|
|
54
|
+
if (scope !== "native_runtime" || !isNativePermissionEnvironment(environmentId) || !input) {
|
|
55
|
+
sendJson(response, 400, { ok: false, error: "macos_permissions_input_invalid" });
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
const unavailable = this.unavailableReason(request);
|
|
59
|
+
if (unavailable) {
|
|
60
|
+
sendJson(response, 409, { ok: false, error: unavailable, message: "Prepare native permissions from this Mac's local ABot page." });
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
const client = this.clients(environmentId);
|
|
64
|
+
if (!client) {
|
|
65
|
+
sendJson(response, 409, { ok: false, error: "runtime_not_started", message: "Start the selected Runtime environment, then check its native permissions." });
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
try {
|
|
69
|
+
const status = await client.status();
|
|
70
|
+
if (response.destroyed)
|
|
71
|
+
return;
|
|
72
|
+
if (!this.hasCurrentOwner(environmentId, client, status, input.ownerId))
|
|
73
|
+
throw new Error("macos_permissions_owner_changed");
|
|
74
|
+
const result = await client.prepare(input);
|
|
75
|
+
if (response.destroyed)
|
|
76
|
+
return;
|
|
77
|
+
if (this.clients(environmentId) !== client)
|
|
78
|
+
throw new Error("macos_permissions_owner_changed");
|
|
79
|
+
sendJson(response, 200, { ok: true, scope, environmentId, ...result });
|
|
80
|
+
}
|
|
81
|
+
catch (error) {
|
|
82
|
+
if (response.destroyed)
|
|
83
|
+
return;
|
|
84
|
+
const code = error instanceof Error ? error.message : "macos_permissions_check_failed";
|
|
85
|
+
if (code === "macos_permissions_owner_changed") {
|
|
86
|
+
sendJson(response, 409, { ok: false, error: code, message: "The native Runtime owner changed. Refresh and check its permissions again." });
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
if (code === "macos_permissions_busy") {
|
|
90
|
+
sendJson(response, 409, { ok: false, error: code, message: "A permission check or request is already in progress for this Runtime." });
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
sendJson(response, 503, { ok: false, error: "macos_permissions_check_failed", message: "Native permission preparation did not complete. Check the running Runtime and Swift developer tools. Any macOS permission prompt already opened is not revoked." });
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { IncomingMessage, ServerResponse } from "node:http";
|
|
2
|
+
import type { HostConnection } from "../../computer-access/companion/connection.js";
|
|
3
|
+
import { type NativeRuntimePermissionRoute } from "./native-permission-route.js";
|
|
4
|
+
export declare const HOST_PERMISSION_PATH = "/web-api/runtime/system-host/permissions";
|
|
5
|
+
/** User-only setup endpoint; permission actions are never exposed as model tools. */
|
|
6
|
+
export declare class HostPermissionRoute {
|
|
7
|
+
private readonly connection;
|
|
8
|
+
private readonly native?;
|
|
9
|
+
private busy;
|
|
10
|
+
constructor(connection: Pick<HostConnection, "status" | "execute">, native?: NativeRuntimePermissionRoute | undefined);
|
|
11
|
+
private hasCurrentMacBinding;
|
|
12
|
+
handle(request: IncomingMessage, response: ServerResponse): Promise<void>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { isHostIdentifier, isHostRecord } from "../../computer-access/companion/protocol.js";
|
|
2
|
+
import { isMacPermissionAction, MACOS_PERMISSION_CAPABILITY, MACOS_PERMISSION_OPERATION, readMacPermissionResult, } from "../../computer-access/companion/permission-protocol.js";
|
|
3
|
+
import { acceptConfigMutationRequest } from "../local-runtime/config-mutation-request.js";
|
|
4
|
+
import { readBody, sendJson } from "../local-runtime/http.js";
|
|
5
|
+
import { isNativeRuntimePermissionRequest } from "./native-permission-route.js";
|
|
6
|
+
export const HOST_PERMISSION_PATH = "/web-api/runtime/system-host/permissions";
|
|
7
|
+
function readPermissionInput(value) {
|
|
8
|
+
if (!isHostRecord(value))
|
|
9
|
+
return undefined;
|
|
10
|
+
const { hostId, connectionId, ...action } = value;
|
|
11
|
+
if (!isHostIdentifier(hostId))
|
|
12
|
+
return undefined;
|
|
13
|
+
if (!isHostIdentifier(connectionId))
|
|
14
|
+
return undefined;
|
|
15
|
+
if (!isMacPermissionAction(action))
|
|
16
|
+
return undefined;
|
|
17
|
+
return { hostId, connectionId, ...action };
|
|
18
|
+
}
|
|
19
|
+
/** User-only setup endpoint; permission actions are never exposed as model tools. */
|
|
20
|
+
export class HostPermissionRoute {
|
|
21
|
+
connection;
|
|
22
|
+
native;
|
|
23
|
+
busy = false;
|
|
24
|
+
constructor(connection, native) {
|
|
25
|
+
this.connection = connection;
|
|
26
|
+
this.native = native;
|
|
27
|
+
}
|
|
28
|
+
hasCurrentMacBinding(input) {
|
|
29
|
+
const status = this.connection.status();
|
|
30
|
+
if (!status.connected)
|
|
31
|
+
return false;
|
|
32
|
+
if (status.identity?.os !== "macos")
|
|
33
|
+
return false;
|
|
34
|
+
if (status.hostId !== input.hostId)
|
|
35
|
+
return false;
|
|
36
|
+
return status.connectionId === input.connectionId;
|
|
37
|
+
}
|
|
38
|
+
async handle(request, response) {
|
|
39
|
+
if (request.method !== "POST") {
|
|
40
|
+
sendJson(response, 405, { ok: false, error: "method_not_allowed" });
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
if (!acceptConfigMutationRequest(request, response))
|
|
44
|
+
return;
|
|
45
|
+
let input;
|
|
46
|
+
let body;
|
|
47
|
+
try {
|
|
48
|
+
const raw = await readBody(request, { maxBytes: 1024 });
|
|
49
|
+
body = JSON.parse(raw.toString());
|
|
50
|
+
input = readPermissionInput(body);
|
|
51
|
+
}
|
|
52
|
+
catch { /* malformed or oversized input is rejected before dispatch */ }
|
|
53
|
+
if (isNativeRuntimePermissionRequest(body) && this.native) {
|
|
54
|
+
await this.native.handle(request, response, body);
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
if (!input) {
|
|
58
|
+
sendJson(response, 400, { ok: false, error: "macos_permissions_input_invalid" });
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
if (!this.hasCurrentMacBinding(input)) {
|
|
62
|
+
sendJson(response, 409, { ok: false, error: "macos_permissions_host_changed", message: "Refresh Computer access and check the current Mac connection." });
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
if (!this.connection.status().capabilities?.includes(MACOS_PERMISSION_CAPABILITY)) {
|
|
66
|
+
sendJson(response, 409, { ok: false, error: "macos_permissions_update_required", message: "Update this Mac connection before preparing its permissions." });
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
if (this.busy) {
|
|
70
|
+
sendJson(response, 409, { ok: false, error: "macos_permissions_busy", message: "A permission check or request is already in progress." });
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
this.busy = true;
|
|
74
|
+
const stop = new AbortController();
|
|
75
|
+
const timeout = setTimeout(() => stop.abort(), 50_000);
|
|
76
|
+
const disconnected = () => { if (!response.writableEnded)
|
|
77
|
+
stop.abort(); };
|
|
78
|
+
response.once("close", disconnected);
|
|
79
|
+
try {
|
|
80
|
+
const { hostId, connectionId, ...action } = input;
|
|
81
|
+
const result = await this.connection.execute({
|
|
82
|
+
hostId, connectionId, operation: MACOS_PERMISSION_OPERATION,
|
|
83
|
+
params: { target: "macos", ...action }, abortSignal: stop.signal,
|
|
84
|
+
});
|
|
85
|
+
if (!this.hasCurrentMacBinding(input)) {
|
|
86
|
+
sendJson(response, 409, { ok: false, error: "macos_permissions_host_changed", message: "The Mac connection changed. Check its permissions again." });
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
const permissionResult = result.ok ? readMacPermissionResult(result.data) : undefined;
|
|
90
|
+
if (!permissionResult) {
|
|
91
|
+
sendJson(response, 503, { ok: false, error: "macos_permissions_check_failed", message: "Permission preparation did not complete. Check the Mac connection and Swift developer tools, then check again." });
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
sendJson(response, 200, { ok: true, hostId, connectionId, scope: "companion", ...permissionResult });
|
|
95
|
+
}
|
|
96
|
+
finally {
|
|
97
|
+
clearTimeout(timeout);
|
|
98
|
+
response.removeListener("close", disconnected);
|
|
99
|
+
this.busy = false;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
package/docs/installation.md
CHANGED
|
@@ -159,19 +159,51 @@ loopback; a remote Runtime needs a local port forward. Direct connections to a
|
|
|
159
159
|
remote network address are not supported. Mac desktop tools and Spark collection
|
|
160
160
|
still require local Swift tools and the relevant macOS privacy permissions.
|
|
161
161
|
|
|
162
|
-
**
|
|
163
|
-
|
|
162
|
+
**Prepare macOS permissions before chatting:** The optional Computer setup step
|
|
163
|
+
and **Home → Computer access** show separate preparation for desktop tools through
|
|
164
|
+
the **Companion** and direct **SYSTEM commands through the active Runtime**.
|
|
165
|
+
Connection status and operating-system permission status are separate; grants
|
|
166
|
+
for one route do not establish access for the other. Check Screen Recording and
|
|
167
|
+
Accessibility in each available route, then request its missing permission from
|
|
168
|
+
that section and follow macOS settings. Checking does not capture a screen,
|
|
169
|
+
read window content, type, or start Spark collection. Recheck after granting
|
|
170
|
+
access; if macOS requires a restart, finish it before starting a conversation.
|
|
171
|
+
|
|
172
|
+
Companion setup keeps a
|
|
164
173
|
private copy of its Node executable at `~/.abot/host-companion/runtime/node` and
|
|
165
|
-
uses that same path at sign-in, independently of NVM version paths.
|
|
166
|
-
|
|
174
|
+
uses that same path at sign-in, independently of NVM version paths. Authorize
|
|
175
|
+
the executable identified by the permission panel in **System
|
|
167
176
|
Settings → Privacy & Security → Accessibility** (called **Device Control & Data
|
|
168
177
|
Access** on some macOS versions). Use **+**, **Command–Shift–G**, and the path above
|
|
169
178
|
if needed. The entry may be named `node`; verify the path before approving it.
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
179
|
+
Setup reuses identical runtime bytes; replacing the runtime can require consent
|
|
180
|
+
again. Spark collection remains separately controlled and does not start when
|
|
181
|
+
permissions are prepared.
|
|
182
|
+
|
|
183
|
+
Native SYSTEM commands launched by ABot through Terminal or another application
|
|
184
|
+
have that caller's permission identity, separate from the Companion. Their panel
|
|
185
|
+
checks the process owning the selected Runtime environment, even when the Web
|
|
186
|
+
server is attached to a different process. Inspect the displayed computer and
|
|
187
|
+
executable, follow the macOS prompt for that route, and recheck after changing
|
|
188
|
+
access. A replaced Runtime or a different environment requires a new check.
|
|
189
|
+
If macOS asks to reopen Terminal or ABot, do that before starting a conversation.
|
|
190
|
+
Permission preparation does not restart either process automatically.
|
|
191
|
+
|
|
192
|
+
This Runtime preparation is available from a local Web connection on the Mac;
|
|
193
|
+
unsupported or unavailable routes are shown explicitly. The CLI remains useful
|
|
194
|
+
for setup before ABot starts or for diagnosis from the same Terminal/application:
|
|
195
|
+
|
|
196
|
+
```bash
|
|
197
|
+
abot host permissions
|
|
198
|
+
abot host permissions --request screen-recording
|
|
199
|
+
abot host permissions --request accessibility
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
The first command only checks. The request commands may show an operating-system
|
|
203
|
+
prompt; approve the identity shown by macOS and check again afterward. They do
|
|
204
|
+
not change Computer access pairing or send a model request. Application-specific
|
|
205
|
+
Automation/Apple Events and protected-file access may still require separate
|
|
206
|
+
consent for the applications or locations used by a later SYSTEM command.
|
|
175
207
|
|
|
176
208
|
For Windows or Linux, download setup and run it in that computer's graphical
|
|
177
209
|
login. Windows setup installs the companion and a private Node runtime; Linux
|
package/docs/plugins.md
CHANGED
|
@@ -307,10 +307,17 @@ explicitly, provide the required string `output` and boolean
|
|
|
307
307
|
`producedNewInformation`, and place structured operation facts needed by later
|
|
308
308
|
steps in `data`. JSON-safe here means primitives, plain objects, and dense
|
|
309
309
|
arrays with finite numbers: no functions, symbols, accessors, cycles, class
|
|
310
|
-
instances, or other non-plain prototypes.
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
310
|
+
instances, or other non-plain prototypes. Results use a 256 KiB serialized
|
|
311
|
+
envelope boundary. A context-aware host exposes `context.resultBudget`; pass it
|
|
312
|
+
to `deliverPluginTextResult(result, ["stdout", "stderr"], context.resultBudget)`
|
|
313
|
+
to hand exact large text to the existing context manager. The helper keeps
|
|
314
|
+
ordinary results unchanged. When needed, it declares `contextTextFields` on
|
|
315
|
+
the original result; metadata and references still count toward the byte limit.
|
|
316
|
+
Only `output`, `stdout`, and `stderr` are eligible string fields. The Runtime
|
|
317
|
+
retains their full content and applies token admission and compaction before
|
|
318
|
+
model invocation. This does not manage the plugin's output storage or RAM.
|
|
319
|
+
Hosts without this contract and plugins that do not opt in retain their
|
|
320
|
+
existing result limit. Neither plugin nor Runtime may silently remove facts.
|
|
314
321
|
|
|
315
322
|
`ToolRegistry` adds the selected tool identity and creates the canonical
|
|
316
323
|
`ToolExecutionResult`. The Runtime validates and persists that complete result,
|
|
@@ -322,6 +329,39 @@ they must not include secrets and they never act as instructions, new user
|
|
|
322
329
|
intent, or proof that the whole request completed. See
|
|
323
330
|
[tool-execution-result-evidence-contract.md](tool-execution-result-evidence-contract.md).
|
|
324
331
|
|
|
332
|
+
### EXEC output storage
|
|
333
|
+
|
|
334
|
+
EXEC captures stdout and stderr in private files under its injected `stateDir`.
|
|
335
|
+
Pipe backpressure bounds queued capture data; the plugin does not accumulate a
|
|
336
|
+
process's entire output in RAM while it runs. Disk writes use 64 KiB chunks, an
|
|
337
|
+
I/O buffer size independent of the model context budget. A storage failure stops
|
|
338
|
+
the producer and returns its process ID, status, cursor and committed byte
|
|
339
|
+
counts; it never claims that incomplete output was successfully delivered.
|
|
340
|
+
|
|
341
|
+
Delivery materializes the pending observation into the existing text-result
|
|
342
|
+
contract. This still requires memory proportional to that observation; this
|
|
343
|
+
contract is not streaming ingestion by the Runtime. The core owns token
|
|
344
|
+
admission and compaction. It does not read EXEC file paths or manage its storage.
|
|
345
|
+
|
|
346
|
+
Offsets advance only after the result fits the host's delivery contract. ASK
|
|
347
|
+
state stores plugin-owned, session-bound disk receipts with range hashes, rather
|
|
348
|
+
than copying the full text. Previously saved inline receipts remain readable.
|
|
349
|
+
`outputRetentionMs` defaults to 604,800,000 (seven days) from capture closure,
|
|
350
|
+
including unaccepted output and receipts saved for approval continuation. Reading,
|
|
351
|
+
restoring or accepting a receipt does not extend retention. Active writers and
|
|
352
|
+
readers prevent deletion until they finish. Interrupted and legacy captures
|
|
353
|
+
without a closure timestamp expire using their last captured-file modification.
|
|
354
|
+
|
|
355
|
+
The plugin sweeps existing storage when loaded and periodically while files
|
|
356
|
+
remain (at most one hour between sweeps). A stopped runtime resumes cleanup when
|
|
357
|
+
the plugin loads again. Expired output returns an explicit tool failure with the
|
|
358
|
+
process ID; it never replays a command. Retention bounds age, not total disk usage.
|
|
359
|
+
Preparation does not create storage directories, and cleanup belongs to EXEC.
|
|
360
|
+
|
|
361
|
+
Concurrent terminal observations reserve one delivery before leaving the process
|
|
362
|
+
transition. Rejected presentation releases the reservation without consuming any
|
|
363
|
+
output. The same rule applies to restored terminal receipts.
|
|
364
|
+
|
|
325
365
|
## Filesystem Roots
|
|
326
366
|
|
|
327
367
|
`environment.paths.agentWorkDir` is the configured primary work root. Plugins
|
|
@@ -406,13 +446,15 @@ searches use procfs; macOS searches inherit the verified current directory of
|
|
|
406
446
|
an isolated Node child. File content searches use the held input descriptor on
|
|
407
447
|
both platforms. A search fails closed when its authority cannot be established.
|
|
408
448
|
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
and
|
|
414
|
-
|
|
415
|
-
|
|
449
|
+
Plugins own resource bounds such as filesystem iteration, file/archive input,
|
|
450
|
+
collection size, and buffered process output. Passing `context.resultBudget`
|
|
451
|
+
lets the shared SDK use the Runtime's final envelope accounting, including
|
|
452
|
+
canonical metadata and target references. Without it, the SDK measures the
|
|
453
|
+
plugin object and the Runtime checks the canonical envelope separately.
|
|
454
|
+
Declared context text is preserved separately from that byte
|
|
455
|
+
accounting and remains subject to the complete model-input budget. An explicit
|
|
456
|
+
truncated success reports machine-readable truncation metadata; an operation
|
|
457
|
+
that cannot produce a truthful result fails explicitly.
|
|
416
458
|
|
|
417
459
|
The bundled `exec` plugin provides trusted, non-interactive `/bin/bash` execution
|
|
418
460
|
on Linux and macOS. Execute, wait and cancel each declare `approval="always"`:
|