@abot-ai/runtime 1.2.0 → 1.3.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/README.md +14 -0
- package/dist/src/bridge/request-steering.d.ts +2 -1
- package/dist/src/bridge/request-steering.js +4 -2
- package/dist/src/bridge/runtime-replay.js +2 -19
- package/dist/src/bridge/start-agent-bridge.js +1 -1
- package/dist/src/capabilities/normal-invocation/validator.js +1 -1
- package/dist/src/capabilities/tool-definition-validator/event-presentation.js +3 -0
- package/dist/src/capabilities/tool-definition-validator/event-result-metadata.d.ts +2 -0
- package/dist/src/capabilities/tool-definition-validator/event-result-metadata.js +74 -0
- package/dist/src/capabilities/tool-event-metadata.js +3 -0
- package/dist/src/capabilities/tool-result-event-projection.d.ts +3 -0
- package/dist/src/capabilities/tool-result-event-projection.js +82 -0
- package/dist/src/capabilities/tool-types.d.ts +5 -0
- package/dist/src/cli/abot.js +2 -11
- package/dist/src/runtime/adapters/in-memory-session-store.js +1 -0
- package/dist/src/runtime/adapters/long-term-memory/file-lock/acquisition.js +11 -2
- package/dist/src/runtime/adapters/long-term-memory/file-lock/contracts.d.ts +2 -0
- package/dist/src/runtime/adapters/long-term-memory/file-lock/synchronous-release.d.ts +2 -0
- package/dist/src/runtime/adapters/long-term-memory/file-lock/synchronous-release.js +40 -0
- package/dist/src/runtime/adapters/registered-tool-normal-invocations/execution/approval.d.ts +3 -0
- package/dist/src/runtime/adapters/registered-tool-normal-invocations/execution/approval.js +9 -0
- package/dist/src/runtime/adapters/registered-tool-normal-invocations/execution/rejection-event.d.ts +13 -0
- package/dist/src/runtime/adapters/registered-tool-normal-invocations/execution/rejection-event.js +25 -0
- package/dist/src/runtime/adapters/registered-tool-normal-invocations/execution/run.js +18 -2
- package/dist/src/runtime/adapters/registered-tool-normal-invocations/executor.js +8 -0
- package/dist/src/runtime/adapters/registered-tool-normal-invocations/payload/lifecycle.js +7 -3
- package/dist/src/runtime/adapters/registered-tool-normal-invocations/shared/contracts.d.ts +17 -2
- package/dist/src/runtime/adapters/registered-tool-normal-invocations/shared/event-metadata.d.ts +9 -0
- package/dist/src/runtime/adapters/registered-tool-normal-invocations/shared/event-metadata.js +8 -0
- package/dist/src/runtime/adapters/registered-tool-worker-capabilities/execution.js +16 -1
- package/dist/src/runtime/adapters/registered-tool-worker-capabilities/payload-observability.js +2 -2
- package/dist/src/runtime/adapters/scheduled-request-outcome.d.ts +11 -0
- package/dist/src/runtime/adapters/scheduled-request-outcome.js +41 -0
- package/dist/src/runtime/adapters/scheduler-runtime.d.ts +19 -0
- package/dist/src/runtime/adapters/scheduler-runtime.js +138 -0
- package/dist/src/runtime/capabilities/scheduling/create-operations.d.ts +55 -0
- package/dist/src/runtime/capabilities/scheduling/create-operations.js +30 -0
- package/dist/src/runtime/capabilities/scheduling/create-time-zone.d.ts +1 -0
- package/dist/src/runtime/capabilities/scheduling/create-time-zone.js +11 -0
- package/dist/src/runtime/capabilities/scheduling/job-list-page.d.ts +25 -0
- package/dist/src/runtime/capabilities/scheduling/job-list-page.js +40 -0
- package/dist/src/runtime/capabilities/scheduling/model-validation.d.ts +2 -0
- package/dist/src/runtime/capabilities/scheduling/model-validation.js +15 -0
- package/dist/src/runtime/capabilities/scheduling/tool-contract.d.ts +2 -0
- package/dist/src/runtime/capabilities/scheduling/tool-contract.js +35 -0
- package/dist/src/runtime/capabilities/scheduling/tool-input-properties.d.ts +43 -0
- package/dist/src/runtime/capabilities/scheduling/tool-input-properties.js +27 -0
- package/dist/src/runtime/capabilities/scheduling/tool-module.d.ts +4 -0
- package/dist/src/runtime/capabilities/scheduling/tool-module.js +158 -0
- package/dist/src/runtime/capabilities/scheduling/update-operations.d.ts +2 -0
- package/dist/src/runtime/capabilities/scheduling/update-operations.js +49 -0
- package/dist/src/runtime/composition.d.ts +23 -3
- package/dist/src/runtime/composition.js +12 -17
- package/dist/src/runtime/config/environment-paths.d.ts +10 -0
- package/dist/src/runtime/config/environment-paths.js +31 -0
- package/dist/src/runtime/config/environment-storage.d.ts +9 -0
- package/dist/src/runtime/config/environment-storage.js +65 -0
- package/dist/src/runtime/config/fields.js +7 -0
- package/dist/src/runtime/config/long-term-memory.js +15 -0
- package/dist/src/runtime/config/schema.js +8 -0
- package/dist/src/runtime/config.js +9 -5
- package/dist/src/runtime/context/scheduled-execution-context.d.ts +10 -0
- package/dist/src/runtime/context/scheduled-execution-context.js +52 -0
- package/dist/src/runtime/default-adapters.d.ts +3 -32
- package/dist/src/runtime/default-adapters.js +3 -270
- package/dist/src/runtime/default-environment-adapters.d.ts +19 -0
- package/dist/src/runtime/default-environment-adapters.js +144 -0
- package/dist/src/runtime/index.d.ts +5 -0
- package/dist/src/runtime/index.js +4 -0
- package/dist/src/runtime/local-application.d.ts +22 -0
- package/dist/src/runtime/local-application.js +81 -0
- package/dist/src/runtime/local-host/app-memory-dispatch.d.ts +11 -0
- package/dist/src/runtime/local-host/app-memory-dispatch.js +103 -0
- package/dist/src/runtime/local-host/app-owner.d.ts +4 -0
- package/dist/src/runtime/local-host/app-owner.js +119 -0
- package/dist/src/runtime/local-host/app-request-control.d.ts +24 -0
- package/dist/src/runtime/local-host/app-request-control.js +135 -0
- package/dist/src/runtime/local-host/app-service-dispatch.d.ts +5 -0
- package/dist/src/runtime/local-host/app-service-dispatch.js +64 -0
- package/dist/src/runtime/local-host/client-identity.d.ts +3 -0
- package/dist/src/runtime/local-host/client-identity.js +17 -0
- package/dist/src/runtime/local-host/client-memory.d.ts +7 -0
- package/dist/src/runtime/local-host/client-memory.js +54 -0
- package/dist/src/runtime/local-host/client-requests.d.ts +19 -0
- package/dist/src/runtime/local-host/client-requests.js +145 -0
- package/dist/src/runtime/local-host/client-services.d.ts +10 -0
- package/dist/src/runtime/local-host/client-services.js +14 -0
- package/dist/src/runtime/local-host/contracts.d.ts +36 -0
- package/dist/src/runtime/local-host/contracts.js +1 -0
- package/dist/src/runtime/local-host/endpoint.d.ts +7 -0
- package/dist/src/runtime/local-host/endpoint.js +79 -0
- package/dist/src/runtime/local-host/owner-activity.d.ts +10 -0
- package/dist/src/runtime/local-host/owner-activity.js +30 -0
- package/dist/src/runtime/local-host/owner-retirement.d.ts +3 -0
- package/dist/src/runtime/local-host/owner-retirement.js +15 -0
- package/dist/src/runtime/local-host/owner-server.d.ts +6 -0
- package/dist/src/runtime/local-host/owner-server.js +88 -0
- package/dist/src/runtime/local-host/private-access.d.ts +2 -0
- package/dist/src/runtime/local-host/private-access.js +16 -0
- package/dist/src/runtime/local-host/private-directory.d.ts +1 -0
- package/dist/src/runtime/local-host/private-directory.js +57 -0
- package/dist/src/runtime/local-host/rpc-peer.d.ts +22 -0
- package/dist/src/runtime/local-host/rpc-peer.js +168 -0
- package/dist/src/runtime/local-host/rpc-protocol.d.ts +21 -0
- package/dist/src/runtime/local-host/rpc-protocol.js +46 -0
- package/dist/src/runtime/local-host/startup-connection.d.ts +5 -0
- package/dist/src/runtime/local-host/startup-connection.js +72 -0
- package/dist/src/runtime/local-host/transport.d.ts +3 -0
- package/dist/src/runtime/local-host/transport.js +88 -0
- package/dist/src/runtime/local-host/windows-private-access.d.ts +1 -0
- package/dist/src/runtime/local-host/windows-private-access.js +51 -0
- package/dist/src/runtime/long-term-memory/onboarding/configuration.js +6 -0
- package/dist/src/runtime/long-term-memory/recall-binding.d.ts +3 -0
- package/dist/src/runtime/long-term-memory/recall-binding.js +27 -0
- package/dist/src/runtime/long-term-memory/recall-context.d.ts +20 -0
- package/dist/src/runtime/long-term-memory/recall-context.js +101 -0
- package/dist/src/runtime/long-term-memory/recall-continuation.d.ts +8 -0
- package/dist/src/runtime/long-term-memory/recall-continuation.js +36 -0
- package/dist/src/runtime/long-term-memory/recall-policy.d.ts +7 -0
- package/dist/src/runtime/long-term-memory/recall-policy.js +14 -0
- package/dist/src/runtime/long-term-memory/recall-result.d.ts +5 -0
- package/dist/src/runtime/long-term-memory/recall-result.js +54 -0
- package/dist/src/runtime/long-term-memory/repository-state.d.ts +2 -1
- package/dist/src/runtime/long-term-memory/repository-state.js +2 -2
- package/dist/src/runtime/model/invoke-raw-step.d.ts +1 -0
- package/dist/src/runtime/model/invoke-raw-step.js +1 -0
- package/dist/src/runtime/model/invoke-step.js +6 -0
- package/dist/src/runtime/model/invoke-structured-step.d.ts +1 -0
- package/dist/src/runtime/model/invoke-structured-step.js +1 -0
- package/dist/src/runtime/model/model-step-port.d.ts +2 -0
- package/dist/src/runtime/model/model-step-steering.d.ts +8 -0
- package/dist/src/runtime/model/model-step-steering.js +19 -0
- package/dist/src/runtime/orchestration/final-response/authoring-contract.js +1 -1
- package/dist/src/runtime/orchestration/final-response/invoke.d.ts +1 -0
- package/dist/src/runtime/orchestration/final-response/invoke.js +1 -0
- package/dist/src/runtime/orchestration/role-calls/activation-budget.js +1 -0
- package/dist/src/runtime/orchestration/role-calls/candidate-validation.js +9 -49
- package/dist/src/runtime/orchestration/role-calls/capability-selection-reconsideration.d.ts +9 -0
- package/dist/src/runtime/orchestration/role-calls/capability-selection-reconsideration.js +17 -8
- package/dist/src/runtime/orchestration/role-calls/capability-selection-supervision-validation.d.ts +2 -0
- package/dist/src/runtime/orchestration/role-calls/capability-selection-supervision-validation.js +62 -0
- package/dist/src/runtime/orchestration/role-calls/command-decoder.js +4 -0
- package/dist/src/runtime/orchestration/role-calls/command-dispatch/memory-recall-transitions.d.ts +4 -0
- package/dist/src/runtime/orchestration/role-calls/command-dispatch/memory-recall-transitions.js +89 -0
- package/dist/src/runtime/orchestration/role-calls/command-dispatch.js +5 -0
- package/dist/src/runtime/orchestration/role-calls/contracts.d.ts +9 -7
- package/dist/src/runtime/orchestration/role-calls/contracts.js +2 -2
- package/dist/src/runtime/orchestration/role-calls/diagnostics.js +3 -0
- package/dist/src/runtime/orchestration/role-calls/index.d.ts +1 -0
- package/dist/src/runtime/orchestration/role-calls/index.js +1 -0
- package/dist/src/runtime/orchestration/role-calls/memory-recall-contract.d.ts +51 -0
- package/dist/src/runtime/orchestration/role-calls/memory-recall-contract.js +4 -0
- package/dist/src/runtime/orchestration/role-calls/memory-recall-decoder.d.ts +6 -0
- package/dist/src/runtime/orchestration/role-calls/memory-recall-decoder.js +147 -0
- package/dist/src/runtime/orchestration/role-calls/memory-recall-diagnostics.d.ts +5 -0
- package/dist/src/runtime/orchestration/role-calls/memory-recall-diagnostics.js +27 -0
- package/dist/src/runtime/orchestration/role-calls/memory-recall-state-validation.d.ts +3 -0
- package/dist/src/runtime/orchestration/role-calls/memory-recall-state-validation.js +121 -0
- package/dist/src/runtime/orchestration/role-calls/memory-recall-transactions.d.ts +3 -0
- package/dist/src/runtime/orchestration/role-calls/memory-recall-transactions.js +44 -0
- package/dist/src/runtime/orchestration/role-calls/reducer.js +1 -0
- package/dist/src/runtime/orchestration/role-calls/transaction-effect.d.ts +5 -0
- package/dist/src/runtime/orchestration/role-calls/transaction-effect.js +14 -0
- package/dist/src/runtime/orchestration/role-calls/transactions.js +3 -24
- package/dist/src/runtime/plugins/manifest-validator.js +4 -1
- package/dist/src/runtime/ports.d.ts +4 -0
- package/dist/src/runtime/request/bound-runtime-handler.d.ts +2 -0
- package/dist/src/runtime/request/bound-runtime-handler.js +25 -0
- package/dist/src/runtime/request/contracts.d.ts +6 -0
- package/dist/src/runtime/request/execution-agent-root-execution.js +12 -0
- package/dist/src/runtime/request/execution-facets.js +6 -0
- package/dist/src/runtime/request/execution-scope-surfaces.js +10 -0
- package/dist/src/runtime/request/execution-scope.d.ts +1 -1
- package/dist/src/runtime/request/handler.js +6 -0
- package/dist/src/runtime/request/root-contract.d.ts +7 -1
- package/dist/src/runtime/request/root-execution-kernel.js +33 -37
- package/dist/src/runtime/request/root-memory-recall.d.ts +11 -0
- package/dist/src/runtime/request/root-memory-recall.js +71 -0
- package/dist/src/runtime/request/root-observation-handoff.d.ts +17 -0
- package/dist/src/runtime/request/root-observation-handoff.js +44 -0
- package/dist/src/runtime/request/scheduled-execution.d.ts +9 -0
- package/dist/src/runtime/request/scheduled-execution.js +32 -0
- package/dist/src/runtime/request/session-admission.d.ts +17 -0
- package/dist/src/runtime/request/session-admission.js +88 -0
- package/dist/src/runtime/request/supervisor-root-execution-diagnostics.d.ts +1 -1
- package/dist/src/runtime/request/supervisor-root-execution.js +8 -0
- package/dist/src/runtime/runtime-environment.d.ts +31 -0
- package/dist/src/runtime/runtime-environment.js +102 -0
- package/dist/src/runtime/runtime-host-environment.d.ts +8 -0
- package/dist/src/runtime/runtime-host-environment.js +57 -0
- package/dist/src/runtime/runtime-host-lifecycle.d.ts +4 -0
- package/dist/src/runtime/runtime-host-lifecycle.js +64 -0
- package/dist/src/runtime/runtime-host-scheduler-ownership.d.ts +5 -0
- package/dist/src/runtime/runtime-host-scheduler-ownership.js +67 -0
- package/dist/src/runtime/runtime-host.d.ts +19 -0
- package/dist/src/runtime/runtime-host.js +63 -0
- package/dist/src/runtime/scheduler/calendar-time.d.ts +10 -0
- package/dist/src/runtime/scheduler/calendar-time.js +58 -0
- package/dist/src/runtime/scheduler/contracts.d.ts +143 -0
- package/dist/src/runtime/scheduler/contracts.js +1 -0
- package/dist/src/runtime/scheduler/file-store.d.ts +2 -0
- package/dist/src/runtime/scheduler/file-store.js +76 -0
- package/dist/src/runtime/scheduler/instant-validation.d.ts +4 -0
- package/dist/src/runtime/scheduler/instant-validation.js +69 -0
- package/dist/src/runtime/scheduler/interval-range.d.ts +8 -0
- package/dist/src/runtime/scheduler/interval-range.js +24 -0
- package/dist/src/runtime/scheduler/job-management.d.ts +8 -0
- package/dist/src/runtime/scheduler/job-management.js +212 -0
- package/dist/src/runtime/scheduler/journal-checkpoint.d.ts +9 -0
- package/dist/src/runtime/scheduler/journal-checkpoint.js +45 -0
- package/dist/src/runtime/scheduler/journal-durability.d.ts +8 -0
- package/dist/src/runtime/scheduler/journal-durability.js +59 -0
- package/dist/src/runtime/scheduler/journal-files.d.ts +14 -0
- package/dist/src/runtime/scheduler/journal-files.js +59 -0
- package/dist/src/runtime/scheduler/journal-head.d.ts +21 -0
- package/dist/src/runtime/scheduler/journal-head.js +81 -0
- package/dist/src/runtime/scheduler/journal-index-state.d.ts +31 -0
- package/dist/src/runtime/scheduler/journal-index-state.js +137 -0
- package/dist/src/runtime/scheduler/journal-index.d.ts +22 -0
- package/dist/src/runtime/scheduler/journal-index.js +195 -0
- package/dist/src/runtime/scheduler/journal-store.d.ts +21 -0
- package/dist/src/runtime/scheduler/journal-store.js +184 -0
- package/dist/src/runtime/scheduler/journal-transaction.d.ts +14 -0
- package/dist/src/runtime/scheduler/journal-transaction.js +104 -0
- package/dist/src/runtime/scheduler/next-occurrence.d.ts +3 -0
- package/dist/src/runtime/scheduler/next-occurrence.js +39 -0
- package/dist/src/runtime/scheduler/run-completion.d.ts +12 -0
- package/dist/src/runtime/scheduler/run-completion.js +77 -0
- package/dist/src/runtime/scheduler/run-list-query.d.ts +5 -0
- package/dist/src/runtime/scheduler/run-list-query.js +38 -0
- package/dist/src/runtime/scheduler/run-records.d.ts +6 -0
- package/dist/src/runtime/scheduler/run-records.js +41 -0
- package/dist/src/runtime/scheduler/schedule-update.d.ts +3 -0
- package/dist/src/runtime/scheduler/schedule-update.js +22 -0
- package/dist/src/runtime/scheduler/schedule-validation.d.ts +10 -0
- package/dist/src/runtime/scheduler/schedule-validation.js +132 -0
- package/dist/src/runtime/scheduler/scheduler-engine.d.ts +2 -0
- package/dist/src/runtime/scheduler/scheduler-engine.js +174 -0
- package/dist/src/runtime/scheduler/scheduler-service.d.ts +10 -0
- package/dist/src/runtime/scheduler/scheduler-service.js +115 -0
- package/dist/src/runtime/scheduler/service-context.d.ts +21 -0
- package/dist/src/runtime/scheduler/service-context.js +26 -0
- package/dist/src/runtime/scheduler/session-deletion-state.d.ts +9 -0
- package/dist/src/runtime/scheduler/session-deletion-state.js +30 -0
- package/dist/src/runtime/scheduler/snapshot-validation.d.ts +4 -0
- package/dist/src/runtime/scheduler/snapshot-validation.js +112 -0
- package/dist/src/runtime/scheduler/startup-recovery.d.ts +2 -0
- package/dist/src/runtime/scheduler/startup-recovery.js +38 -0
- package/dist/src/runtime/scheduler/validation-error.d.ts +4 -0
- package/dist/src/runtime/scheduler/validation-error.js +8 -0
- package/dist/src/runtime/scheduler/working-store.d.ts +3 -0
- 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 +14 -1
- package/dist/src/runtime/session/session-attachment-deletion.d.ts +8 -0
- package/dist/src/runtime/session/session-attachment-deletion.js +87 -0
- package/dist/src/runtime/session/session-deletion-boundary.d.ts +10 -0
- package/dist/src/runtime/session/session-deletion-boundary.js +39 -0
- package/dist/src/runtime/session/session-deletion-cleanup.d.ts +7 -0
- package/dist/src/runtime/session/session-deletion-cleanup.js +62 -0
- package/dist/src/runtime/session/session-deletion-finalization.d.ts +7 -0
- package/dist/src/runtime/session/session-deletion-finalization.js +34 -0
- package/dist/src/runtime/session/session-deletion-receipts.d.ts +7 -0
- package/dist/src/runtime/session/session-deletion-receipts.js +18 -0
- package/dist/src/runtime/session/session-lifecycle-store.d.ts +21 -0
- package/dist/src/runtime/session/session-lifecycle-store.js +72 -0
- package/dist/src/runtime/session/session-mutation-queue.d.ts +3 -0
- package/dist/src/runtime/session/session-mutation-queue.js +15 -0
- package/dist/src/runtime/steps/execution-agent/capability-decision-parsing.d.ts +16 -0
- package/dist/src/runtime/steps/execution-agent/capability-decision-parsing.js +165 -0
- package/dist/src/runtime/steps/execution-agent/contracts.d.ts +3 -1
- package/dist/src/runtime/steps/execution-agent/decision-parsing.d.ts +2 -0
- package/dist/src/runtime/steps/execution-agent/decision-parsing.js +195 -0
- package/dist/src/runtime/steps/execution-agent/decision-validation.d.ts +30 -0
- package/dist/src/runtime/steps/execution-agent/decision-validation.js +127 -0
- package/dist/src/runtime/steps/execution-agent/format.d.ts +1 -0
- package/dist/src/runtime/steps/execution-agent/format.js +12 -0
- package/dist/src/runtime/steps/execution-agent/input.d.ts +2 -1
- package/dist/src/runtime/steps/execution-agent/input.js +17 -2
- package/dist/src/runtime/steps/execution-agent/parser.d.ts +1 -2
- package/dist/src/runtime/steps/execution-agent/parser.js +1 -472
- package/dist/src/runtime/steps/execution-agent/prompt.d.ts +2 -0
- package/dist/src/runtime/steps/execution-agent/prompt.js +2 -0
- package/dist/src/runtime/steps/execution-agent/reconsideration-context.js +4 -3
- package/dist/src/runtime/steps/execution-agent/response-input.js +5 -4
- package/dist/src/runtime/steps/execution-agent/response-run.d.ts +3 -0
- package/dist/src/runtime/steps/execution-agent/response-run.js +7 -3
- package/dist/src/runtime/steps/execution-agent/run.d.ts +2 -0
- package/dist/src/runtime/steps/execution-agent/run.js +2 -0
- package/dist/src/runtime/steps/execution-agent/state-context.d.ts +2 -1
- package/dist/src/runtime/steps/execution-agent/state-context.js +13 -5
- package/dist/src/runtime/steps/memory-recall-decision.d.ts +30 -0
- package/dist/src/runtime/steps/memory-recall-decision.js +101 -0
- package/dist/src/runtime/steps/memory-recall-prompt.d.ts +1 -0
- package/dist/src/runtime/steps/memory-recall-prompt.js +15 -0
- package/dist/src/runtime/steps/supervisor-decision/contracts.d.ts +4 -2
- package/dist/src/runtime/steps/supervisor-decision/diagnostics.d.ts +2 -0
- package/dist/src/runtime/steps/supervisor-decision/diagnostics.js +13 -6
- package/dist/src/runtime/steps/supervisor-decision/format.d.ts +2 -0
- package/dist/src/runtime/steps/supervisor-decision/format.js +41 -2
- package/dist/src/runtime/steps/supervisor-decision/input.d.ts +5 -1
- package/dist/src/runtime/steps/supervisor-decision/input.js +25 -5
- package/dist/src/runtime/steps/supervisor-decision/memory-recall-continuation.d.ts +10 -0
- package/dist/src/runtime/steps/supervisor-decision/memory-recall-continuation.js +32 -0
- package/dist/src/runtime/steps/supervisor-decision/parser.d.ts +2 -0
- package/dist/src/runtime/steps/supervisor-decision/parser.js +36 -1
- package/dist/src/runtime/steps/supervisor-decision/prompt.d.ts +3 -0
- package/dist/src/runtime/steps/supervisor-decision/prompt.js +16 -8
- package/dist/src/runtime/steps/supervisor-decision/response-recommendation.d.ts +13 -0
- package/dist/src/runtime/steps/supervisor-decision/response-recommendation.js +32 -0
- package/dist/src/runtime/steps/supervisor-decision/resume.d.ts +2 -0
- package/dist/src/runtime/steps/supervisor-decision/resume.js +13 -0
- package/dist/src/runtime/steps/supervisor-decision/run.d.ts +3 -0
- package/dist/src/runtime/steps/supervisor-decision/run.js +19 -0
- package/dist/src/runtime/steps/supervisor-decision/working-directory.js +7 -1
- package/dist/src/runtime/steps/supervisor-response/diagnostics.d.ts +1 -0
- package/dist/src/runtime/steps/supervisor-response/diagnostics.js +1 -0
- package/dist/src/runtime/steps/supervisor-response/input.d.ts +2 -1
- package/dist/src/runtime/steps/supervisor-response/input.js +17 -4
- package/dist/src/runtime/steps/supervisor-response/memory-authoring.d.ts +1 -0
- package/dist/src/runtime/steps/supervisor-response/memory-authoring.js +4 -0
- package/dist/src/runtime/steps/supervisor-response/prompt.d.ts +1 -0
- package/dist/src/runtime/steps/supervisor-response/prompt.js +8 -2
- package/dist/src/runtime/steps/supervisor-response/response-recommendation.d.ts +10 -0
- package/dist/src/runtime/steps/supervisor-response/response-recommendation.js +25 -0
- package/dist/src/runtime/steps/supervisor-response/run.d.ts +6 -1
- package/dist/src/runtime/steps/supervisor-response/run.js +26 -7
- package/dist/src/sessions/record/projection.js +1 -0
- package/dist/src/sessions/schedule-metadata.d.ts +8 -0
- package/dist/src/sessions/schedule-metadata.js +1 -0
- package/dist/src/sessions/session-service.d.ts +1 -0
- package/dist/src/sessions/session-service.js +1 -0
- package/dist/src/sessions/types.d.ts +2 -0
- package/dist/src/shared/http-server-shutdown.d.ts +4 -0
- package/dist/src/shared/http-server-shutdown.js +17 -0
- package/dist/src/shared/public-http/aggregate-gate.d.ts +3 -0
- package/dist/src/shared/public-http/aggregate-gate.js +87 -0
- package/dist/src/shared/public-http/deadline.d.ts +2 -0
- package/dist/src/shared/public-http/deadline.js +29 -0
- package/dist/src/shared/public-http/errors.d.ts +6 -0
- package/dist/src/shared/public-http/errors.js +11 -0
- package/dist/src/shared/public-http/limits.d.ts +8 -0
- package/dist/src/shared/public-http/limits.js +8 -0
- package/dist/src/shared/public-http/network-policy.d.ts +11 -0
- package/dist/src/shared/public-http/network-policy.js +178 -0
- package/dist/src/shared/public-http/public-http.d.ts +24 -0
- package/dist/src/shared/public-http/public-http.js +85 -0
- package/dist/src/shared/public-http/request-hop.d.ts +18 -0
- package/dist/src/shared/public-http/request-hop.js +140 -0
- package/dist/src/web-ui/app/ARCHITECTURE.md +66 -4
- package/dist/src/web-ui/app/app-bootstrap.js +53 -0
- package/dist/src/web-ui/app/app-dom.js +80 -0
- package/dist/src/web-ui/app/app.js +195 -212
- package/dist/src/web-ui/app/components/conversation-activity.d.ts +2 -0
- package/dist/src/web-ui/app/components/conversation-activity.js +34 -7
- package/dist/src/web-ui/app/components/conversation-role-cards.d.ts +1 -0
- package/dist/src/web-ui/app/components/conversation-role-cards.js +61 -5
- package/dist/src/web-ui/app/components/conversation-schedule.js +71 -0
- package/dist/src/web-ui/app/components/conversation-status.js +65 -0
- package/dist/src/web-ui/app/components/conversation-tools.d.ts +13 -0
- package/dist/src/web-ui/app/components/conversation-tools.js +284 -0
- package/dist/src/web-ui/app/components/conversation-view.js +39 -11
- package/dist/src/web-ui/app/components/dashboard/activity.js +61 -0
- package/dist/src/web-ui/app/components/dashboard/icons.js +23 -0
- package/dist/src/web-ui/app/components/dashboard/recent-conversations.js +64 -0
- package/dist/src/web-ui/app/components/dashboard/workspace.js +107 -0
- package/dist/src/web-ui/app/components/message-link-previews.d.ts +16 -0
- package/dist/src/web-ui/app/components/message-link-previews.js +179 -0
- package/dist/src/web-ui/app/components/schedules/details.js +101 -0
- package/dist/src/web-ui/app/components/schedules/form.d.ts +13 -0
- package/dist/src/web-ui/app/components/schedules/form.js +246 -0
- package/dist/src/web-ui/app/components/schedules/workspace-state.js +59 -0
- package/dist/src/web-ui/app/components/schedules/workspace.js +165 -0
- package/dist/src/web-ui/app/components/workspace-shell.js +48 -2
- package/dist/src/web-ui/app/configuration-feature.js +72 -0
- package/dist/src/web-ui/app/controllers/composer-attachments-controller.d.ts +1 -0
- package/dist/src/web-ui/app/controllers/composer-attachments-controller.js +17 -6
- package/dist/src/web-ui/app/controllers/composer-submit-controller.d.ts +2 -0
- package/dist/src/web-ui/app/controllers/composer-submit-controller.js +15 -1
- package/dist/src/web-ui/app/controllers/composer-surface-controller.js +58 -0
- package/dist/src/web-ui/app/controllers/composer-workspace-controller.d.ts +53 -0
- package/dist/src/web-ui/app/controllers/composer-workspace-controller.js +180 -0
- package/dist/src/web-ui/app/controllers/conversation-read-state-controller.d.ts +23 -0
- package/dist/src/web-ui/app/controllers/conversation-read-state-controller.js +82 -0
- package/dist/src/web-ui/app/controllers/conversation-session-controller.d.ts +8 -0
- package/dist/src/web-ui/app/controllers/conversation-session-controller.js +28 -39
- package/dist/src/web-ui/app/controllers/dashboard-controller.js +127 -0
- package/dist/src/web-ui/app/controllers/home-composer-feature.d.ts +40 -0
- package/dist/src/web-ui/app/controllers/home-composer-feature.js +119 -0
- package/dist/src/web-ui/app/controllers/home-conversation-activation.js +37 -0
- package/dist/src/web-ui/app/controllers/realtime-event-controller.d.ts +1 -0
- package/dist/src/web-ui/app/controllers/realtime-event-controller.js +74 -3
- package/dist/src/web-ui/app/controllers/runtime-selection-controller.d.ts +2 -1
- package/dist/src/web-ui/app/controllers/runtime-selection-controller.js +15 -14
- package/dist/src/web-ui/app/controllers/schedule-realtime.js +118 -0
- package/dist/src/web-ui/app/controllers/schedules-controller.js +421 -0
- package/dist/src/web-ui/app/controllers/session-controller.js +30 -3
- package/dist/src/web-ui/app/dashboard-feature.js +44 -0
- package/dist/src/web-ui/app/index.html +53 -1
- package/dist/src/web-ui/app/lib/composer-submission-scope.d.ts +21 -0
- package/dist/src/web-ui/app/lib/composer-submission-scope.js +13 -0
- package/dist/src/web-ui/app/lib/context-window-snapshot-order.d.ts +15 -0
- package/dist/src/web-ui/app/lib/context-window-snapshot-order.js +31 -0
- package/dist/src/web-ui/app/lib/conversation-role-model.d.ts +10 -1
- package/dist/src/web-ui/app/lib/conversation-role-model.js +97 -15
- package/dist/src/web-ui/app/lib/conversation-status-model.d.ts +12 -0
- package/dist/src/web-ui/app/lib/conversation-status-model.js +116 -0
- package/dist/src/web-ui/app/lib/dashboard-job-templates.js +41 -0
- package/dist/src/web-ui/app/lib/dashboard-presentation.js +126 -0
- package/dist/src/web-ui/app/lib/message-markdown.d.ts +5 -0
- package/dist/src/web-ui/app/lib/message-markdown.js +99 -0
- package/dist/src/web-ui/app/lib/message-url-policy.d.ts +1 -0
- package/dist/src/web-ui/app/lib/message-url-policy.js +13 -0
- package/dist/src/web-ui/app/lib/schedule-errors.js +29 -0
- package/dist/src/web-ui/app/lib/schedule-message.js +30 -0
- package/dist/src/web-ui/app/lib/schedule-presentation.js +81 -0
- package/dist/src/web-ui/app/lib/session-read-state.d.ts +22 -0
- package/dist/src/web-ui/app/lib/session-read-state.js +63 -0
- package/dist/src/web-ui/app/lib/text-format.js +2 -143
- package/dist/src/web-ui/app/lib/tool-activity-event.d.ts +26 -0
- package/dist/src/web-ui/app/lib/tool-activity-event.js +228 -0
- package/dist/src/web-ui/app/lib/tool-activity-model.d.ts +41 -0
- package/dist/src/web-ui/app/lib/tool-activity-model.js +255 -0
- package/dist/src/web-ui/app/lib/tool-timeline.d.ts +3 -0
- package/dist/src/web-ui/app/lib/tool-timeline.js +18 -0
- package/dist/src/web-ui/app/schedules-feature.js +87 -0
- package/dist/src/web-ui/app/services/message-link-preview-client.d.ts +14 -0
- package/dist/src/web-ui/app/services/message-link-preview-client.js +96 -0
- package/dist/src/web-ui/app/services/runtime-web-client/schedules.js +51 -0
- package/dist/src/web-ui/app/services/runtime-web-client.d.ts +37 -0
- package/dist/src/web-ui/app/services/runtime-web-client.js +13 -8
- package/dist/src/web-ui/app/styles/00-tokens-base.css +11 -11
- package/dist/src/web-ui/app/styles/18-dashboard.css +384 -0
- package/dist/src/web-ui/app/styles/20-chat-composer.css +1 -130
- package/dist/src/web-ui/app/styles/26-message-content.css +295 -0
- package/dist/src/web-ui/app/styles/27-conversation-tools.css +266 -0
- package/dist/src/web-ui/app/styles/28-conversation-status.css +52 -0
- package/dist/src/web-ui/app/styles/38-schedule-workspace.css +263 -0
- package/dist/src/web-ui/app/styles/38-schedules.css +352 -0
- package/dist/src/web-ui/app/styles/90-responsive.css +14 -0
- package/dist/src/web-ui/app/styles/91-schedules-responsive.css +72 -0
- package/dist/src/web-ui/app/styles/92-dashboard-responsive.css +88 -0
- package/dist/src/web-ui/app/styles.css +8 -0
- package/dist/src/web-ui/app/ui-behavior.d.ts +1 -1
- package/dist/src/web-ui/app/ui-behavior.js +3 -1
- package/dist/src/web-ui/app/vendor/README.md +15 -0
- package/dist/src/web-ui/app/vendor/markdown-it.LICENSE +22 -0
- package/dist/src/web-ui/app/vendor/markdown-it.js +3003 -0
- package/dist/src/web-ui/link-preview/metadata.d.ts +9 -0
- package/dist/src/web-ui/link-preview/metadata.js +97 -0
- package/dist/src/web-ui/link-preview/preview-cache.d.ts +4 -0
- package/dist/src/web-ui/link-preview/preview-cache.js +23 -0
- package/dist/src/web-ui/link-preview/raster-response.d.ts +9 -0
- package/dist/src/web-ui/link-preview/raster-response.js +49 -0
- package/dist/src/web-ui/link-preview/routes.d.ts +3 -0
- package/dist/src/web-ui/link-preview/routes.js +97 -0
- package/dist/src/web-ui/link-preview/service.d.ts +11 -0
- package/dist/src/web-ui/link-preview/service.js +117 -0
- package/dist/src/web-ui/local-runtime/api-router.d.ts +4 -1
- package/dist/src/web-ui/local-runtime/api-router.js +42 -73
- package/dist/src/web-ui/local-runtime/contracts.d.ts +2 -2
- package/dist/src/web-ui/local-runtime/environment-registry.d.ts +12 -1
- package/dist/src/web-ui/local-runtime/environment-registry.js +38 -3
- package/dist/src/web-ui/local-runtime/realtime-controller.js +3 -1
- package/dist/src/web-ui/local-runtime/request-execution.d.ts +5 -1
- package/dist/src/web-ui/local-runtime/request-execution.js +38 -2
- package/dist/src/web-ui/local-runtime/schedule-job-creation.d.ts +7 -0
- package/dist/src/web-ui/local-runtime/schedule-job-creation.js +62 -0
- package/dist/src/web-ui/local-runtime/schedule-management-routes.d.ts +30 -0
- package/dist/src/web-ui/local-runtime/schedule-management-routes.js +134 -0
- package/dist/src/web-ui/local-runtime/schedule-run-page.d.ts +5 -0
- package/dist/src/web-ui/local-runtime/schedule-run-page.js +23 -0
- package/dist/src/web-ui/local-runtime/session-routes.d.ts +17 -0
- package/dist/src/web-ui/local-runtime/session-routes.js +74 -0
- package/dist/src/web-ui/local-runtime-backend.d.ts +2 -0
- package/dist/src/web-ui/local-runtime-backend.js +11 -1
- package/dist/src/web-ui/schedule-creation-contract.d.ts +7 -0
- package/dist/src/web-ui/schedule-creation-contract.js +1 -0
- package/dist/src/web-ui/server-shutdown.d.ts +4 -0
- package/dist/src/web-ui/server-shutdown.js +32 -0
- package/dist/src/web-ui/server.js +13 -10
- package/dist/src/web-ui/session-read-state/availability.d.ts +16 -0
- package/dist/src/web-ui/session-read-state/availability.js +20 -0
- package/dist/src/web-ui/session-read-state/projection.d.ts +17 -0
- package/dist/src/web-ui/session-read-state/projection.js +71 -0
- package/dist/src/web-ui/session-read-state/service.d.ts +86 -0
- package/dist/src/web-ui/session-read-state/service.js +89 -0
- package/dist/src/web-ui/session-read-state/store.d.ts +22 -0
- package/dist/src/web-ui/session-read-state/store.js +110 -0
- package/docs/configuration.md +41 -1
- package/docs/long-term-memory.md +46 -5
- package/docs/runtime-invariant-coverage.md +1 -1
- package/docs/runtime-library.md +23 -0
- package/docs/runtime-public-contracts.md +32 -1
- package/package.json +3 -1
- package/plugins/code-outline/plugin.json +15 -0
- package/plugins/document-reader/plugin.json +17 -0
- package/plugins/filesystem/plugin.json +17 -2
- package/plugins/json-inspector/plugin.json +12 -0
- package/plugins/local-search/plugin.json +12 -0
- package/plugins/memory/plugin.json +26 -1
- package/plugins/memory/source/index.ts +10 -6
- package/plugins/memory/src/index.cjs +11 -7
- package/plugins/project-orientation/plugin.json +14 -0
- package/plugins/web/source/aggregate-gate.ts +8 -130
- package/plugins/web/source/deadline.ts +14 -50
- package/plugins/web/source/errors.ts +17 -11
- package/plugins/web/source/limits.ts +3 -6
- package/plugins/web/source/network-policy.ts +28 -226
- package/plugins/web/source/public-http.ts +17 -142
- package/plugins/web/source/request-hop.ts +11 -191
- package/plugins/web/src/index.cjs +119 -59
- package/runtime.config.schema.json +7 -0
- package/src/runtime/README.md +105 -1
- package/src/runtime/local-host/README.md +86 -0
- package/src/runtime/scheduler/README.md +166 -0
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
# Local environment ownership
|
|
2
|
+
|
|
3
|
+
Installed applications use `createLocalRuntimeApplication(config)` from
|
|
4
|
+
`@abot-ai/runtime/runtime`, followed by `await application.start()` and
|
|
5
|
+
`await application.stop()` during shutdown. Web and Bridge use this managed
|
|
6
|
+
facade automatically. No manual port or Launcher setup is required.
|
|
7
|
+
|
|
8
|
+
`loadRuntimeConfig` gives named environments separate state namespaces when they
|
|
9
|
+
inherit a runtime base or share `LLM_RUNTIME_DIR`. The namespace uses only the
|
|
10
|
+
stable environment ID; owner attachment still checks the complete resolved
|
|
11
|
+
configuration. A changed model configuration therefore cannot create a second
|
|
12
|
+
owner over the same state. Explicit per-profile roots and the no-profile layout
|
|
13
|
+
remain unchanged. Populated legacy bases require an explicit assignment and
|
|
14
|
+
are never moved automatically; see [environment paths](../../../docs/configuration.md#environments).
|
|
15
|
+
|
|
16
|
+
A manually constructed `RuntimeConfig` supplies already-resolved final paths.
|
|
17
|
+
It is used unchanged by both managed and embedded factories. Such hosts must
|
|
18
|
+
provide distinct runtime, session, attachment and trace paths for distinct
|
|
19
|
+
environments, or use `loadRuntimeConfig` to resolve inherited bases consistently.
|
|
20
|
+
|
|
21
|
+
Use `application.requests.steer(requestId, update)` for the owner's canonical
|
|
22
|
+
steering acknowledgement. Request options may supply an initial steering prefix;
|
|
23
|
+
subsequent updates use the asynchronous method. The raw embedded factory keeps
|
|
24
|
+
its adapter injection semantics and must not be started over storage already
|
|
25
|
+
owned by a managed application.
|
|
26
|
+
|
|
27
|
+
The managed local entrypoints share one environment owner. The embedded
|
|
28
|
+
`createRuntimeApplication` remains the in-process core; this boundary transports
|
|
29
|
+
calls to that same core without moving orchestration or scheduling policy into
|
|
30
|
+
the transport.
|
|
31
|
+
|
|
32
|
+
`createLocalRuntimeConnection` accepts a private directory, resolved environment
|
|
33
|
+
identity and an owner factory. The first connection acquires the existing atomic
|
|
34
|
+
PID lock and invokes the factory once. It publishes an authenticated loopback
|
|
35
|
+
WebSocket endpoint on an ephemeral port. Later connections attach to that exact
|
|
36
|
+
owner and reject a different identity. Concurrent startup waits only for initial
|
|
37
|
+
endpoint establishment, with a bounded timeout. If the observed owner disappears
|
|
38
|
+
before the WebSocket handshake completes, startup returns to owner election
|
|
39
|
+
within that same deadline. Authentication, identity and private-access failures
|
|
40
|
+
remain terminal.
|
|
41
|
+
|
|
42
|
+
If initial startup fails before a connection is established, a later explicit
|
|
43
|
+
`start()` or service call can start a fresh connection attempt. Concurrent callers
|
|
44
|
+
share the current attempt. No attempt is repeated automatically, and an established
|
|
45
|
+
connection loss never reconnects or replays a request with an uncertain outcome.
|
|
46
|
+
|
|
47
|
+
The endpoint contains a random token and is private to the local user: Unix
|
|
48
|
+
directories/files use 0700/0600 and ownership checks; Windows directories are
|
|
49
|
+
prepared with a current-user ACL before an atomic installation, and directory
|
|
50
|
+
and endpoint ACLs are checked before reading credentials. Existing nonprivate
|
|
51
|
+
paths and symbolic links are rejected. There is no network listener beyond
|
|
52
|
+
127.0.0.1 and no dependency on an external bridge.
|
|
53
|
+
|
|
54
|
+
The binary RPC protocol preserves canonical Date, Buffer and undefined values.
|
|
55
|
+
Errors preserve message, name and string code without copying remote stacks.
|
|
56
|
+
The application dispatcher owns its explicit method allowlist. Bidirectional
|
|
57
|
+
peer calls carry request events and approval/steering callbacks; broadcasts are
|
|
58
|
+
projections of owner events and do not create another state store.
|
|
59
|
+
|
|
60
|
+
An owner connection's `close()` stops intake and scheduling and closes its
|
|
61
|
+
transport without waiting for active model requests to drain. Queued ordinary
|
|
62
|
+
requests and requests still awaiting peer acceptance cannot start after this
|
|
63
|
+
boundary. The endpoint is removed immediately, but the owner's PID lease stays
|
|
64
|
+
held until in-flight RPC calls, ordinary requests and scheduled reservations
|
|
65
|
+
actually settle. A replacement managed owner can then start; shutdown never
|
|
66
|
+
replays interrupted work. A real process exit permits abandoned-PID recovery.
|
|
67
|
+
After intake closes, the canonical owner's synchronous activity and admission
|
|
68
|
+
snapshot identifies an already-idle owner. Its `close()` awaits the idle fence
|
|
69
|
+
and physical lease release before returning; active owners retire separately.
|
|
70
|
+
Physical release of this long-lived owner lease is synchronous once the idle
|
|
71
|
+
fence settles. Graceful `process.exit()` cannot interrupt removal between the
|
|
72
|
+
token marker and its empty directories, leaving a spurious incomplete lease.
|
|
73
|
+
Other file locks retain their existing asynchronous release behavior.
|
|
74
|
+
The embedded factory remains outside managed ownership and must not be started
|
|
75
|
+
over a managed environment's storage, including while its owner is retiring.
|
|
76
|
+
A client connection's `close()` only detaches that client.
|
|
77
|
+
Detached passive-memory saves retain their existing background queue and
|
|
78
|
+
independent repository locking; they are not part of request admission.
|
|
79
|
+
Both are idempotent. `onClose` fires on local closure or connection loss and fires
|
|
80
|
+
immediately when registered after loss. Pending calls reject on connection loss;
|
|
81
|
+
the transport never reconnects or replays an uncertain request. A later explicit
|
|
82
|
+
connection can acquire an abandoned PID lock and start a new application.
|
|
83
|
+
|
|
84
|
+
The application boundary must carry ordinary execution, session lifecycle and
|
|
85
|
+
scheduler operations together. A scheduler-only proxy cannot protect admission,
|
|
86
|
+
session deletion or canonical conversation persistence across processes.
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
# Local scheduler
|
|
2
|
+
|
|
3
|
+
This environment-owned service persists Jobs and run records independently of
|
|
4
|
+
Socket and plugins. It invokes an injected executor; that adapter must reserve
|
|
5
|
+
the same session admission boundary used by ordinary Runtime requests and submit
|
|
6
|
+
the saved prompt through the canonical request path.
|
|
7
|
+
|
|
8
|
+
## Ownership and lifecycle
|
|
9
|
+
|
|
10
|
+
Call `start()` before management. Calls are serialized, so management queued after
|
|
11
|
+
`start()` waits for startup. Startup acquires one local process ownership lock for
|
|
12
|
+
the storage directory. A second owner fails with `scheduler_store_in_use`; it
|
|
13
|
+
must not start another clock or silently select a different store. This reuses
|
|
14
|
+
the existing atomic PID lock primitive. There is no multi-host lease protocol.
|
|
15
|
+
|
|
16
|
+
`stop()` invalidates preparations immediately and waits only for queued
|
|
17
|
+
preparation/storage work, not active requests. A generation guard prevents
|
|
18
|
+
asynchronous startup from reactivating a stopped service or old completions from
|
|
19
|
+
settling into a restarted generation. Startup marks previously running requests
|
|
20
|
+
`interrupted`, drops pending offline occurrences as `missed`, and advances active
|
|
21
|
+
Jobs to their next future occurrence. It never retries an interrupted or failed
|
|
22
|
+
request or backfills missed occurrences.
|
|
23
|
+
|
|
24
|
+
A session deletion reserves its start barrier synchronously, including while
|
|
25
|
+
startup is queued. Passing the running-state check confirms deletion; a rejected
|
|
26
|
+
lifecycle call releases only its own reservation. A storage failure after
|
|
27
|
+
acceptance keeps the deletion barrier; explicit deletion can finish cleanup
|
|
28
|
+
without admitting new runs for the deleted session.
|
|
29
|
+
|
|
30
|
+
Jobs and runs are stored in immutable transaction files selected by
|
|
31
|
+
`scheduler-journal.json`. Serialized commits use fsynced temporary files and
|
|
32
|
+
atomic rename. On POSIX, each rename is followed by a containing-directory fsync:
|
|
33
|
+
transaction and checkpoint entries are durable before the manifest is replaced,
|
|
34
|
+
and the manifest directory is synced before acknowledging a commit or retiring
|
|
35
|
+
old files. New generation/checkpoint directories are synced through their parents.
|
|
36
|
+
Owned acquisition validates the loaded head, then syncs its checkpoint directory,
|
|
37
|
+
generation directory, root path and ancestors before exposing the store or cleaning
|
|
38
|
+
the journal. This also establishes entries written by older versions and directories
|
|
39
|
+
left by interrupted initialization, without scanning historical transactions. POSIX
|
|
40
|
+
directory-open/sync errors propagate; ancestors must permit opening for sync.
|
|
41
|
+
Windows retains file sync and atomic replacement without a directory-fsync guarantee.
|
|
42
|
+
|
|
43
|
+
If the manifest replacement succeeds but its directory sync fails, the outcome
|
|
44
|
+
is uncertain. The owned store rejects further cached reads, writes and cleanup
|
|
45
|
+
until explicitly released and reacquired; it does not retry a mutation or dispatch
|
|
46
|
+
an unconfirmed claim. Both old and new files remain available. Reacquisition validates
|
|
47
|
+
and syncs the visible head and its directory dependencies before cleanup.
|
|
48
|
+
These barriers rely on the filesystem and device honoring fsync; they are not a
|
|
49
|
+
backup or repair mechanism for pre-existing corruption.
|
|
50
|
+
|
|
51
|
+
Normal ticks read Jobs and active runs and persist only changed
|
|
52
|
+
records; completed prompt/result payloads stay on disk. History queries select
|
|
53
|
+
run metadata before loading the requested payloads. History is never pruned.
|
|
54
|
+
|
|
55
|
+
The version 3 manifest records the committed transaction sequence and one
|
|
56
|
+
immutable checkpoint. Startup restores Jobs, active run payloads and compact
|
|
57
|
+
archived run metadata, then reads at most 256 exact transaction paths. It does
|
|
58
|
+
not enumerate the historical transaction directory or reread old prompt/result
|
|
59
|
+
payloads. The compact index still grows with the number of retained runs;
|
|
60
|
+
checkpoint loading and periodic index serialization therefore have metadata-sized
|
|
61
|
+
cost, while full historical payloads remain lazy.
|
|
62
|
+
|
|
63
|
+
A transaction becomes committed only after its durable file and the atomic
|
|
64
|
+
manifest replacement succeed. An unpublished tail is ignored on restart and
|
|
65
|
+
replaced by the next committed transaction at that sequence. Checkpoints are
|
|
66
|
+
published before the next logical mutation once the suffix reaches its bound;
|
|
67
|
+
checkpoint failure cannot turn an already committed mutation into a failure.
|
|
68
|
+
Only superseded or unpublished checkpoint artifacts are cleaned up at this
|
|
69
|
+
boundary. Archived transaction payloads stay available until explicit session
|
|
70
|
+
deletion. Concurrent unowned reads retry when a generation or checkpoint is
|
|
71
|
+
retired, while ordinary appends preserve the captured immutable snapshot.
|
|
72
|
+
|
|
73
|
+
The first owner migrates an existing `scheduler.json` without discarding history.
|
|
74
|
+
Existing version 2 journals replay once before publishing their initial version 3
|
|
75
|
+
checkpoint. A failed upgrade leaves the previous format authoritative; missing or
|
|
76
|
+
corrupt required version 3 files fail rather than falling back to replaying an
|
|
77
|
+
uncommitted tail. Older binaries that only support version 2 cannot open version 3.
|
|
78
|
+
Migration and deletion publish a complete new generation through one atomic
|
|
79
|
+
manifest replacement, then remove the superseded files. A failed cleanup remains
|
|
80
|
+
discoverable on the next owned operation. Concurrent reads cannot return partial
|
|
81
|
+
generations. Corrupt data is rejected, not silently reset. The public store's
|
|
82
|
+
default read/update view remains the complete snapshot; its optional `active`
|
|
83
|
+
view and `readRuns` path support efficient scheduler transactions and history.
|
|
84
|
+
|
|
85
|
+
If writing an executed run's terminal status fails, `run-completion.ts` retains
|
|
86
|
+
that captured outcome and its original completion time in the current service
|
|
87
|
+
generation. Each normal tick attempts those writes once before dispatching more
|
|
88
|
+
work; a failed terminal write does not prevent unrelated sessions from dispatching.
|
|
89
|
+
This only reconciles storage and never repeats the executor or model request.
|
|
90
|
+
Cancellation and pause preserve outcomes of already-started runs. Session deletion
|
|
91
|
+
or stop invalidates retained outcomes, and reconciliation never creates a missing
|
|
92
|
+
run. A process restart retains the existing `interrupted` recovery policy.
|
|
93
|
+
|
|
94
|
+
## Time and admission
|
|
95
|
+
|
|
96
|
+
The schedule contract accepts typed timer, once, interval, daily, weekly, and
|
|
97
|
+
monthly forms. Calendar forms require an exact `HH:mm` time and an explicit IANA
|
|
98
|
+
time zone. Once timestamps require an explicit UTC offset. Timer and interval
|
|
99
|
+
durations use integer milliseconds of at least one second. The default first
|
|
100
|
+
interval occurrence is creation plus the interval, persisted as an explicit
|
|
101
|
+
anchor.
|
|
102
|
+
|
|
103
|
+
New and changed timers derive their deadline from the acceptance clock plus
|
|
104
|
+
`delayMs`. Timer `at` is stored metadata; caller-supplied `at` cannot replace the
|
|
105
|
+
deadline or bypass duration overflow checks. Reading or restarting a stored timer,
|
|
106
|
+
metadata edits and an exactly unchanged stored schedule preserve its deadline.
|
|
107
|
+
|
|
108
|
+
New intervals and interval reschedules require their first two future occurrences
|
|
109
|
+
to fit the canonical four-digit-year ISO range. Existing intervals remain
|
|
110
|
+
readable and complete when no later occurrence fits that range; one exhausted
|
|
111
|
+
interval cannot block another Job or startup recovery. The Web editor retains
|
|
112
|
+
the exact saved interval anchor when its displayed field is unchanged, including
|
|
113
|
+
seconds, milliseconds and the selected occurrence of a repeated local time.
|
|
114
|
+
|
|
115
|
+
Calendar conversion uses `Intl.DateTimeFormat` from the host's IANA time-zone data.
|
|
116
|
+
Missing wall times/days are skipped; repeated local times select their first
|
|
117
|
+
occurrence once. Intervals preserve elapsed-time cadence across DST.
|
|
118
|
+
|
|
119
|
+
An online late tick advances to the next future occurrence after creating at most
|
|
120
|
+
one pending occurrence per Job. A busy session leaves that occurrence pending.
|
|
121
|
+
If a manual run occupies that slot, the ordinary due time remains unchanged
|
|
122
|
+
until it can be recorded as scheduled work. Run now cannot consume an ordinary
|
|
123
|
+
occurrence, and additional due times still coalesce to one scheduled occurrence.
|
|
124
|
+
Cancellation, pause, update, and session deletion invalidate preparation before
|
|
125
|
+
any awaited work can cross the final synchronous start boundary. Cancellation or
|
|
126
|
+
session deletion never interrupts an already started request. Session deletion
|
|
127
|
+
removes its Jobs and run records; late completion cannot recreate them.
|
|
128
|
+
Pausing again cancels a pending manual run even when the Job is already paused.
|
|
129
|
+
It leaves an already-started run alone; a later explicit Run now is still allowed.
|
|
130
|
+
|
|
131
|
+
Run records keep immutable prompt, title, model profile, agent mode, time zone,
|
|
132
|
+
and Job revision snapshots. A non-timing edit replaces pending work with a fresh
|
|
133
|
+
snapshot while preserving its original due time and trigger. Timing edits
|
|
134
|
+
reschedule it; empty and identical edits preserve its identity. Already-started
|
|
135
|
+
and completed history is unchanged. Resume preserves manual pending work.
|
|
136
|
+
Time-zone edits reschedule only calendar forms. Timer, once, and interval forms
|
|
137
|
+
keep their due time and trigger while replacing pending snapshot metadata.
|
|
138
|
+
|
|
139
|
+
A failed session lookup fails only that occurrence, records its error without
|
|
140
|
+
retry, and allows other pending runs to dispatch. Future recurrences remain
|
|
141
|
+
active. A missing session still removes that session's Jobs and run records.
|
|
142
|
+
|
|
143
|
+
The Runtime adapter owns canonical session deletion checks and persistence guards.
|
|
144
|
+
Preventing late persistence alone is not sufficient: it must also reserve
|
|
145
|
+
admission and reject a deleted session before executing its request.
|
|
146
|
+
|
|
147
|
+
## Source layout
|
|
148
|
+
|
|
149
|
+
- `contracts.ts`: public domain contracts.
|
|
150
|
+
- `scheduler-service.ts`, `service-context.ts`: lifecycle and serialized service.
|
|
151
|
+
- `job-management.ts`: CRUD and management state transitions.
|
|
152
|
+
- `scheduler-engine.ts`, `run-records.ts`, `startup-recovery.ts`: occurrence and
|
|
153
|
+
run lifecycle.
|
|
154
|
+
- `schedule-validation.ts`, `instant-validation.ts`, `validation-error.ts`:
|
|
155
|
+
typed input validation.
|
|
156
|
+
- `calendar-time.ts`, `next-occurrence.ts`: deterministic recurrence.
|
|
157
|
+
- `file-store.ts`: process ownership and serialized storage access.
|
|
158
|
+
- `journal-store.ts`, `journal-files.ts`: incremental commits and generation replacement.
|
|
159
|
+
- `journal-durability.ts`: ordered file/directory publication and uncertain-sync errors.
|
|
160
|
+
- `journal-index.ts`, `journal-transaction.ts`: indexed history and validated changes.
|
|
161
|
+
- `journal-head.ts`, `journal-checkpoint.ts`, `journal-index-state.ts`: committed
|
|
162
|
+
sequence, bounded startup replay and validated compact index persistence.
|
|
163
|
+
- `working-store.ts`, `snapshot-validation.ts`: active view and snapshot validation.
|
|
164
|
+
|
|
165
|
+
The model and Web layers share this service. Natural-language interpretation,
|
|
166
|
+
model choice, conversation projection, and UI rendering do not belong here.
|