@abot-ai/runtime 1.2.0 → 1.3.1
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/scripts/init-runtime.js +4 -13
- package/dist/scripts/runtime-setup-directories.d.ts +2 -0
- package/dist/scripts/runtime-setup-directories.js +38 -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/directory-authority/bootstrap.d.ts +1 -0
- package/dist/src/shared/directory-authority/bootstrap.js +118 -0
- package/dist/src/shared/directory-authority/command.d.ts +8 -0
- package/dist/src/shared/directory-authority/command.js +27 -0
- package/dist/src/shared/directory-authority/errors.d.ts +5 -0
- package/dist/src/shared/directory-authority/errors.js +10 -0
- package/dist/src/shared/directory-authority/index.d.ts +3 -0
- package/dist/src/shared/directory-authority/index.js +3 -0
- package/dist/src/shared/directory-authority/protocol.d.ts +11 -0
- package/dist/src/shared/directory-authority/protocol.js +62 -0
- package/dist/src/shared/directory-authority/task.d.ts +7 -0
- package/dist/src/shared/directory-authority/task.js +97 -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/plugins.md +15 -9
- 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/exec/plugin.json +3 -3
- package/plugins/exec/skills/exec_skill/SKILL.md +1 -1
- package/plugins/exec/source/process-manager.ts +1 -20
- package/plugins/exec/source/shell-platform.ts +29 -0
- package/plugins/exec/src/index.cjs +25 -18
- package/plugins/filesystem/plugin.json +17 -2
- package/plugins/filesystem/source/atomic-write.ts +9 -0
- package/plugins/filesystem/source/bounded-io.ts +5 -99
- package/plugins/filesystem/source/directory-authority-write.ts +64 -0
- package/plugins/filesystem/source/directory-sample-task.ts +23 -0
- package/plugins/filesystem/source/directory-sample.ts +132 -0
- package/plugins/filesystem/source/directory-write-task.ts +160 -0
- package/plugins/filesystem/source/mutation-parent.ts +11 -0
- package/plugins/filesystem/src/index.cjs +693 -118
- package/plugins/json-inspector/plugin.json +12 -0
- package/plugins/local-search/plugin.json +12 -0
- package/plugins/local-search/source/index.ts +2 -0
- package/plugins/local-search/source/paths.ts +30 -7
- package/plugins/local-search/source/ripgrep-process.ts +69 -0
- package/plugins/local-search/source/ripgrep.ts +19 -23
- package/plugins/local-search/src/index.cjs +295 -32
- 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,119 @@
|
|
|
1
|
+
import { createComposerAttachmentsController } from "./composer-attachments-controller.js";
|
|
2
|
+
import { createComposerSubmitController } from "./composer-submit-controller.js";
|
|
3
|
+
|
|
4
|
+
export function createHomeComposerFeature({
|
|
5
|
+
workspace,
|
|
6
|
+
shell,
|
|
7
|
+
client,
|
|
8
|
+
composerActions,
|
|
9
|
+
selectedEnvironmentId,
|
|
10
|
+
selectedModelSupportsImageInput,
|
|
11
|
+
isComposerAvailable,
|
|
12
|
+
getSubmissionBlock,
|
|
13
|
+
onSubmissionBlocked,
|
|
14
|
+
onControlEvent,
|
|
15
|
+
onStateChange,
|
|
16
|
+
activateHomeSession,
|
|
17
|
+
sendMessage,
|
|
18
|
+
}) {
|
|
19
|
+
const attachments = createComposerAttachmentsController({
|
|
20
|
+
state: workspace.homeState,
|
|
21
|
+
dom: workspace.homeDom,
|
|
22
|
+
shell,
|
|
23
|
+
client,
|
|
24
|
+
selectedEnvironmentId,
|
|
25
|
+
selectedModelSupportsImageInput,
|
|
26
|
+
ensureSession: workspace.ensureHomeSession,
|
|
27
|
+
isComposerAvailable,
|
|
28
|
+
isComposerVisible: workspace.isHome,
|
|
29
|
+
onSendStateChange: onStateChange,
|
|
30
|
+
onControlEvent,
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
async function sendHomeMessage(text) {
|
|
34
|
+
const draft = workspace.takeHomeDraft(text);
|
|
35
|
+
let activated = false;
|
|
36
|
+
try {
|
|
37
|
+
activated = activateHomeSession(draft) !== false;
|
|
38
|
+
} catch (error) {
|
|
39
|
+
workspace.restoreHomeDraft(draft);
|
|
40
|
+
attachments.render();
|
|
41
|
+
throw error;
|
|
42
|
+
}
|
|
43
|
+
if (!activated) {
|
|
44
|
+
workspace.restoreHomeDraft(draft);
|
|
45
|
+
attachments.render();
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
await sendMessage(text);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
function reportRequestError(error) {
|
|
52
|
+
onControlEvent({
|
|
53
|
+
type: "control",
|
|
54
|
+
name: "Message could not be sent",
|
|
55
|
+
tone: "failed",
|
|
56
|
+
summary: error instanceof Error ? error.message : String(error),
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
const submit = createComposerSubmitController({
|
|
61
|
+
state: workspace.homeState,
|
|
62
|
+
dom: workspace.homeDom,
|
|
63
|
+
composerActions,
|
|
64
|
+
attachments,
|
|
65
|
+
queue: {
|
|
66
|
+
isCurrentDraining: () => false,
|
|
67
|
+
queuedCount: () => 0,
|
|
68
|
+
},
|
|
69
|
+
chatRequests: { sendMessage: sendHomeMessage },
|
|
70
|
+
conversationSession: { appendRequestError: reportRequestError },
|
|
71
|
+
selectedEnvironmentId,
|
|
72
|
+
setMessageStatus: () => {},
|
|
73
|
+
getSubmissionBlock,
|
|
74
|
+
onSubmissionBlocked,
|
|
75
|
+
isComposerVisible: workspace.isHome,
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
function environmentChanged() {
|
|
79
|
+
if (workspace.homeState.environmentId === selectedEnvironmentId()) return;
|
|
80
|
+
attachments.clear();
|
|
81
|
+
workspace.resetHomeDraft();
|
|
82
|
+
if (workspace.isHome()) workspace.ensureHomeSession();
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
function render() {
|
|
86
|
+
workspace.syncChatDraft();
|
|
87
|
+
environmentChanged();
|
|
88
|
+
if (!workspace.isHome()) return;
|
|
89
|
+
attachments.render();
|
|
90
|
+
submit.resize();
|
|
91
|
+
submit.updateSendState();
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
function setWorkspace(destination) {
|
|
95
|
+
environmentChanged();
|
|
96
|
+
workspace.setWorkspace(destination);
|
|
97
|
+
render();
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
function dispatch() {
|
|
101
|
+
environmentChanged();
|
|
102
|
+
submit.dispatch("send");
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
async function upload(file) {
|
|
106
|
+
environmentChanged();
|
|
107
|
+
await attachments.upload(file);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
return {
|
|
111
|
+
attachments,
|
|
112
|
+
submit,
|
|
113
|
+
setWorkspace,
|
|
114
|
+
environmentChanged,
|
|
115
|
+
dispatch,
|
|
116
|
+
upload,
|
|
117
|
+
render,
|
|
118
|
+
};
|
|
119
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
export function createHomeConversationActivation({
|
|
2
|
+
state,
|
|
3
|
+
shell,
|
|
4
|
+
conversationSession,
|
|
5
|
+
composerQueue,
|
|
6
|
+
preferences,
|
|
7
|
+
selectedEnvironmentId,
|
|
8
|
+
renderSessions,
|
|
9
|
+
renderMessages,
|
|
10
|
+
applyModelSelection,
|
|
11
|
+
setCurrentTitle,
|
|
12
|
+
updateComposerSendState,
|
|
13
|
+
}) {
|
|
14
|
+
return function activateHomeConversation(draft) {
|
|
15
|
+
if (draft.environmentId !== selectedEnvironmentId()) return false;
|
|
16
|
+
const activateChat = shell.prepareWorkspaceActivation("chat", {
|
|
17
|
+
focus: false,
|
|
18
|
+
});
|
|
19
|
+
if (!activateChat) return false;
|
|
20
|
+
if (!composerQueue.suspendRecoveryForNavigation()) return false;
|
|
21
|
+
if (!activateChat()) return false;
|
|
22
|
+
conversationSession.clearCurrentSessionView();
|
|
23
|
+
state.currentSessionId = draft.sessionId;
|
|
24
|
+
state.pendingAttachments = draft.attachments;
|
|
25
|
+
preferences.saveSessionIdForEnvironment(
|
|
26
|
+
draft.environmentId,
|
|
27
|
+
draft.sessionId,
|
|
28
|
+
);
|
|
29
|
+
setCurrentTitle(draft.sessionId);
|
|
30
|
+
applyModelSelection();
|
|
31
|
+
conversationSession.subscribeSession(draft.sessionId);
|
|
32
|
+
updateComposerSendState();
|
|
33
|
+
renderSessions();
|
|
34
|
+
renderMessages();
|
|
35
|
+
return true;
|
|
36
|
+
};
|
|
37
|
+
}
|
|
@@ -27,6 +27,7 @@ export interface RealtimeEventControllerOptions {
|
|
|
27
27
|
): ConversationSessionMessage;
|
|
28
28
|
renderMessages(): void;
|
|
29
29
|
renderContextWindow?(): void;
|
|
30
|
+
renderActivityStatus?(): void;
|
|
30
31
|
scheduleMessageRender(): void;
|
|
31
32
|
scheduleThinkingRender(): void;
|
|
32
33
|
cancelScheduledMessageRender(): void;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { createScheduleRealtimeController } from "./schedule-realtime.js";
|
|
1
2
|
import { isMatchingActiveRequest } from "../ui-behavior.js";
|
|
2
3
|
import {
|
|
3
4
|
eventKeyFor,
|
|
@@ -10,6 +11,8 @@ import { textOf } from "../lib/text-format.js";
|
|
|
10
11
|
import { normalizeRealtimeMessage } from "../lib/realtime-message.js";
|
|
11
12
|
import { reduceTaskProgress } from "../lib/task-progress.js";
|
|
12
13
|
import { projectWebSourceEvent } from "../lib/web-source-event.js";
|
|
14
|
+
import { projectToolActivityEvent } from "../lib/tool-activity-event.js";
|
|
15
|
+
import { canReplaceContextWindowEvidence } from "../lib/context-window-snapshot-order.js";
|
|
13
16
|
|
|
14
17
|
export { normalizeRealtimeMessage } from "../lib/realtime-message.js";
|
|
15
18
|
export { taskStatusClass } from "../lib/task-progress.js";
|
|
@@ -26,9 +29,16 @@ function hasRecordedOriginalEvent(events, requestId, eventSequence) {
|
|
|
26
29
|
);
|
|
27
30
|
}
|
|
28
31
|
|
|
29
|
-
function canMergeUnsequencedActivity(
|
|
32
|
+
function canMergeUnsequencedActivity(
|
|
33
|
+
previous,
|
|
34
|
+
key,
|
|
35
|
+
eventSequence,
|
|
36
|
+
webSources,
|
|
37
|
+
toolActivity,
|
|
38
|
+
) {
|
|
30
39
|
if (eventSequence !== undefined) return false;
|
|
31
40
|
if (webSources || previous?.webSources) return false;
|
|
41
|
+
if (toolActivity || previous?.toolActivity) return false;
|
|
32
42
|
if (!previous?.key || previous.key !== key) return false;
|
|
33
43
|
return !hasOriginalEventSequence(previous.eventSequence);
|
|
34
44
|
}
|
|
@@ -45,6 +55,7 @@ export function createRealtimeEventController({
|
|
|
45
55
|
normalizeChatMessage,
|
|
46
56
|
renderMessages,
|
|
47
57
|
renderContextWindow = () => {},
|
|
58
|
+
renderActivityStatus = () => {},
|
|
48
59
|
scheduleMessageRender,
|
|
49
60
|
scheduleThinkingRender,
|
|
50
61
|
cancelScheduledMessageRender,
|
|
@@ -57,6 +68,19 @@ export function createRealtimeEventController({
|
|
|
57
68
|
drainQueuedComposerMessage,
|
|
58
69
|
loadSessions,
|
|
59
70
|
}) {
|
|
71
|
+
const scheduleRealtime = createScheduleRealtimeController({
|
|
72
|
+
state,
|
|
73
|
+
selectedEnvironmentId,
|
|
74
|
+
addOrMergeMessage,
|
|
75
|
+
normalizeChatMessage,
|
|
76
|
+
activeAssistantForRequest,
|
|
77
|
+
renderMessages,
|
|
78
|
+
updateComposerSendState,
|
|
79
|
+
setMessageActivityStatus,
|
|
80
|
+
trackSeq,
|
|
81
|
+
loadSessions,
|
|
82
|
+
});
|
|
83
|
+
|
|
60
84
|
function trackSeq(message) {
|
|
61
85
|
if (message.requestId && typeof message.seqNo === "number") {
|
|
62
86
|
state.lastSeqByRequest.set(message.requestId, message.seqNo);
|
|
@@ -81,6 +105,7 @@ export function createRealtimeEventController({
|
|
|
81
105
|
providerUsage: null,
|
|
82
106
|
pendingCompaction: null,
|
|
83
107
|
lastCompaction: null,
|
|
108
|
+
lastCompactionEvent: null,
|
|
84
109
|
};
|
|
85
110
|
if (eventName === "context.window.snapshot") {
|
|
86
111
|
const contextWindowTokens = Number(message.contextWindowTokens);
|
|
@@ -97,8 +122,11 @@ export function createRealtimeEventController({
|
|
|
97
122
|
return;
|
|
98
123
|
}
|
|
99
124
|
const previous = current.snapshot;
|
|
125
|
+
if (!canReplaceContextWindowEvidence(previous, message)) return;
|
|
100
126
|
const snapshot = {
|
|
101
127
|
requestId,
|
|
128
|
+
eventSequence: message.eventSequence,
|
|
129
|
+
seqNo: message.seqNo,
|
|
102
130
|
invocationId: textOf(message.invocationId),
|
|
103
131
|
modelStep: textOf(message.modelStep),
|
|
104
132
|
profileId: textOf(message.profileId),
|
|
@@ -143,10 +171,14 @@ export function createRealtimeEventController({
|
|
|
143
171
|
return true;
|
|
144
172
|
}
|
|
145
173
|
if (eventName === "context.window.provider_usage") {
|
|
174
|
+
if (!canReplaceContextWindowEvidence(current.providerUsage, message))
|
|
175
|
+
return;
|
|
146
176
|
state.contextWindowByRequest.set(requestId, {
|
|
147
177
|
...current,
|
|
148
178
|
requestId,
|
|
149
179
|
providerUsage: {
|
|
180
|
+
eventSequence: message.eventSequence,
|
|
181
|
+
seqNo: message.seqNo,
|
|
150
182
|
invocationId: textOf(message.invocationId),
|
|
151
183
|
modelStep: textOf(message.modelStep),
|
|
152
184
|
profileId: textOf(message.profileId),
|
|
@@ -159,9 +191,18 @@ export function createRealtimeEventController({
|
|
|
159
191
|
return true;
|
|
160
192
|
}
|
|
161
193
|
if (eventName === "context.compaction.started") {
|
|
194
|
+
if (
|
|
195
|
+
!canReplaceContextWindowEvidence(current.lastCompactionEvent, message)
|
|
196
|
+
)
|
|
197
|
+
return;
|
|
198
|
+
if (!canReplaceContextWindowEvidence(current.snapshot, message)) return;
|
|
162
199
|
state.contextWindowByRequest.set(requestId, {
|
|
163
200
|
...current,
|
|
164
201
|
requestId,
|
|
202
|
+
lastCompactionEvent: {
|
|
203
|
+
eventSequence: message.eventSequence,
|
|
204
|
+
seqNo: message.seqNo,
|
|
205
|
+
},
|
|
165
206
|
pendingCompaction: {
|
|
166
207
|
beforePercent: Number.isFinite(
|
|
167
208
|
Number(message.beforeUsedContextPercent),
|
|
@@ -173,11 +214,19 @@ export function createRealtimeEventController({
|
|
|
173
214
|
return true;
|
|
174
215
|
}
|
|
175
216
|
if (eventName === "context.compaction.completed") {
|
|
217
|
+
if (
|
|
218
|
+
!canReplaceContextWindowEvidence(current.lastCompactionEvent, message)
|
|
219
|
+
)
|
|
220
|
+
return;
|
|
176
221
|
const beforePercent = Number(message.beforeUsedContextPercent);
|
|
177
222
|
const afterPercent = Number(message.afterUsedContextPercent);
|
|
178
223
|
state.contextWindowByRequest.set(requestId, {
|
|
179
224
|
...current,
|
|
180
225
|
requestId,
|
|
226
|
+
lastCompactionEvent: {
|
|
227
|
+
eventSequence: message.eventSequence,
|
|
228
|
+
seqNo: message.seqNo,
|
|
229
|
+
},
|
|
181
230
|
pendingCompaction: null,
|
|
182
231
|
lastCompaction:
|
|
183
232
|
Number.isFinite(beforePercent) && Number.isFinite(afterPercent)
|
|
@@ -187,9 +236,17 @@ export function createRealtimeEventController({
|
|
|
187
236
|
return true;
|
|
188
237
|
}
|
|
189
238
|
if (eventName === "context.compaction.failed") {
|
|
239
|
+
if (
|
|
240
|
+
!canReplaceContextWindowEvidence(current.lastCompactionEvent, message)
|
|
241
|
+
)
|
|
242
|
+
return;
|
|
190
243
|
state.contextWindowByRequest.set(requestId, {
|
|
191
244
|
...current,
|
|
192
245
|
requestId,
|
|
246
|
+
lastCompactionEvent: {
|
|
247
|
+
eventSequence: message.eventSequence,
|
|
248
|
+
seqNo: message.seqNo,
|
|
249
|
+
},
|
|
193
250
|
pendingCompaction: null,
|
|
194
251
|
});
|
|
195
252
|
return true;
|
|
@@ -207,7 +264,10 @@ export function createRealtimeEventController({
|
|
|
207
264
|
}
|
|
208
265
|
updateTaskProgress(message);
|
|
209
266
|
const contextWindowUpdated = updateContextWindow(message);
|
|
210
|
-
if (contextWindowUpdated)
|
|
267
|
+
if (contextWindowUpdated) {
|
|
268
|
+
renderContextWindow();
|
|
269
|
+
renderActivityStatus();
|
|
270
|
+
}
|
|
211
271
|
const eventName = textOf(message.name || message.rawType || message.type);
|
|
212
272
|
if (isLowValueActivityEvent(message)) {
|
|
213
273
|
trackSeq(message);
|
|
@@ -220,9 +280,16 @@ export function createRealtimeEventController({
|
|
|
220
280
|
const phase = textOf(message.phase);
|
|
221
281
|
const key = eventKeyFor({ ...message, requestId }, name, tone);
|
|
222
282
|
const webSources = projectWebSourceEvent(message);
|
|
283
|
+
const toolActivity = projectToolActivityEvent(message);
|
|
223
284
|
const lastEvent = state.events[state.events.length - 1];
|
|
224
285
|
if (
|
|
225
|
-
canMergeUnsequencedActivity(
|
|
286
|
+
canMergeUnsequencedActivity(
|
|
287
|
+
lastEvent,
|
|
288
|
+
key,
|
|
289
|
+
eventSequence,
|
|
290
|
+
webSources,
|
|
291
|
+
toolActivity,
|
|
292
|
+
)
|
|
226
293
|
) {
|
|
227
294
|
lastEvent.count = (lastEvent.count || 1) + 1;
|
|
228
295
|
lastEvent.summary = summary;
|
|
@@ -252,6 +319,7 @@ export function createRealtimeEventController({
|
|
|
252
319
|
tool: textOf(message.tool),
|
|
253
320
|
approvalId: textOf(message.approvalId),
|
|
254
321
|
...(webSources ? { webSources } : {}),
|
|
322
|
+
...(toolActivity ? { toolActivity } : {}),
|
|
255
323
|
payload: {
|
|
256
324
|
plan: message.plan,
|
|
257
325
|
item: message.item,
|
|
@@ -263,6 +331,7 @@ export function createRealtimeEventController({
|
|
|
263
331
|
state.events.splice(0, state.events.length - 1_200);
|
|
264
332
|
}
|
|
265
333
|
trackSeq(message);
|
|
334
|
+
renderActivityStatus();
|
|
266
335
|
scheduleMessageRender();
|
|
267
336
|
if (eventName.startsWith("tool.approval.")) renderMessages();
|
|
268
337
|
}
|
|
@@ -316,6 +385,7 @@ export function createRealtimeEventController({
|
|
|
316
385
|
const message = normalizeRealtimeMessage(rawMessage);
|
|
317
386
|
if (message.type === "steer_ack" && handleSteerAcknowledgement(message))
|
|
318
387
|
return;
|
|
388
|
+
if (scheduleRealtime.handle(message)) return;
|
|
319
389
|
if (!shouldAcceptMessage(message)) return;
|
|
320
390
|
if (message.type === "chat_read_state") {
|
|
321
391
|
applySessionReadState(message.sessionId, message.readState || message);
|
|
@@ -377,6 +447,7 @@ export function createRealtimeEventController({
|
|
|
377
447
|
}
|
|
378
448
|
cancelScheduledMessageRender();
|
|
379
449
|
recordEvent(message);
|
|
450
|
+
renderActivityStatus();
|
|
380
451
|
cancelScheduledThinkingRender();
|
|
381
452
|
renderMessages();
|
|
382
453
|
setMessageActivityStatus("ABot response completed.");
|
|
@@ -146,6 +146,7 @@ export interface RuntimeSelectionControllerDependencies {
|
|
|
146
146
|
summary: string;
|
|
147
147
|
}) => void;
|
|
148
148
|
readonly onAttachmentPolicyChange: () => void;
|
|
149
|
+
readonly getComposerSessionId?: () => string;
|
|
149
150
|
readonly onModelCatalogLoading?: () => void;
|
|
150
151
|
readonly onModelCatalogLoaded?: (payload: Record<string, unknown>) => void;
|
|
151
152
|
readonly onModelCatalogUnavailable?: (error: unknown) => void;
|
|
@@ -171,7 +172,7 @@ export declare function createRuntimeSelectionController(
|
|
|
171
172
|
saveModelPreferences(): void;
|
|
172
173
|
selectedEnvironmentId(): string;
|
|
173
174
|
selectedModelPreference(): Record<string, unknown> | null;
|
|
174
|
-
selectedModelSupportsImageInput(): boolean;
|
|
175
|
+
selectedModelSupportsImageInput(profileId?: string): boolean;
|
|
175
176
|
setAgentMode(mode: AgentMode): Promise<boolean>;
|
|
176
177
|
setToolPermissionMode(mode: ToolPermissionMode): void;
|
|
177
178
|
};
|
|
@@ -52,6 +52,7 @@ export function createRuntimeSelectionController({
|
|
|
52
52
|
client,
|
|
53
53
|
recordControlEvent,
|
|
54
54
|
onAttachmentPolicyChange,
|
|
55
|
+
getComposerSessionId = () => state.currentSessionId,
|
|
55
56
|
onModelCatalogLoading = () => {},
|
|
56
57
|
onModelCatalogLoaded = () => {},
|
|
57
58
|
onModelCatalogUnavailable = () => {},
|
|
@@ -144,12 +145,12 @@ export function createRuntimeSelectionController({
|
|
|
144
145
|
|
|
145
146
|
const selectedModelPreference = () =>
|
|
146
147
|
dom.modelSelect.value ? { profileId: dom.modelSelect.value } : null;
|
|
147
|
-
const selectedModelProfile = () =>
|
|
148
|
+
const selectedModelProfile = (profileId = dom.modelSelect.value) =>
|
|
148
149
|
state.modelProfiles.find(
|
|
149
|
-
(profile) => profile.id === textOf(
|
|
150
|
+
(profile) => profile.id === textOf(profileId),
|
|
150
151
|
) || null;
|
|
151
|
-
function selectedModelSupportsImageInput() {
|
|
152
|
-
const profile = selectedModelProfile();
|
|
152
|
+
function selectedModelSupportsImageInput(profileId = dom.modelSelect.value) {
|
|
153
|
+
const profile = selectedModelProfile(profileId);
|
|
153
154
|
if (typeof profile?.supportsImageInput === "boolean")
|
|
154
155
|
return profile.supportsImageInput;
|
|
155
156
|
const inputModalities = profile?.capabilities?.inputModalities;
|
|
@@ -176,7 +177,7 @@ export function createRuntimeSelectionController({
|
|
|
176
177
|
state.lastModelByEnvironment,
|
|
177
178
|
);
|
|
178
179
|
const preferredModel = () =>
|
|
179
|
-
textOf(state.sessionModels[
|
|
180
|
+
textOf(state.sessionModels[getComposerSessionId()]) ||
|
|
180
181
|
textOf(state.lastModelByEnvironment[selectedEnvironmentId()]);
|
|
181
182
|
|
|
182
183
|
function applyModelSelection() {
|
|
@@ -201,8 +202,8 @@ export function createRuntimeSelectionController({
|
|
|
201
202
|
const profileId = textOf(dom.modelSelect.value);
|
|
202
203
|
if (!profileId) return;
|
|
203
204
|
state.lastModelByEnvironment[selectedEnvironmentId()] = profileId;
|
|
204
|
-
if (
|
|
205
|
-
state.sessionModels[
|
|
205
|
+
if (getComposerSessionId())
|
|
206
|
+
state.sessionModels[getComposerSessionId()] = profileId;
|
|
206
207
|
saveModelPreferences();
|
|
207
208
|
}
|
|
208
209
|
|
|
@@ -212,8 +213,8 @@ export function createRuntimeSelectionController({
|
|
|
212
213
|
};
|
|
213
214
|
const currentToolPermissionMode = () =>
|
|
214
215
|
normalizeToolPermissionMode(
|
|
215
|
-
|
|
216
|
-
? sessionModeFor(
|
|
216
|
+
getComposerSessionId()
|
|
217
|
+
? sessionModeFor(getComposerSessionId()).toolPermissionMode
|
|
217
218
|
: undefined,
|
|
218
219
|
);
|
|
219
220
|
|
|
@@ -224,13 +225,13 @@ export function createRuntimeSelectionController({
|
|
|
224
225
|
}
|
|
225
226
|
|
|
226
227
|
function setToolPermissionMode(mode) {
|
|
227
|
-
if (!
|
|
228
|
+
if (!getComposerSessionId()) return;
|
|
228
229
|
const normalized = normalizeToolPermissionMode(mode);
|
|
229
230
|
if (normalized === "full_access")
|
|
230
|
-
delete state.sessionModes[
|
|
231
|
+
delete state.sessionModes[getComposerSessionId()];
|
|
231
232
|
else {
|
|
232
|
-
state.sessionModes[
|
|
233
|
-
...sessionModeFor(
|
|
233
|
+
state.sessionModes[getComposerSessionId()] = {
|
|
234
|
+
...sessionModeFor(getComposerSessionId()),
|
|
234
235
|
toolPermissionMode: normalized,
|
|
235
236
|
savedAt: Date.now(),
|
|
236
237
|
};
|
|
@@ -246,7 +247,7 @@ export function createRuntimeSelectionController({
|
|
|
246
247
|
const meta = permissionMeta(mode);
|
|
247
248
|
dom.permissionModeButton.innerHTML = `<span class="permission-mode-label">${escapeHtml(meta.label)}</span>`;
|
|
248
249
|
dom.permissionModeButton.title = meta.title;
|
|
249
|
-
dom.permissionModeButton.disabled = !
|
|
250
|
+
dom.permissionModeButton.disabled = !getComposerSessionId();
|
|
250
251
|
dom.permissionModeButton.classList.toggle("full", mode === "full_access");
|
|
251
252
|
dom.permissionModeButton.classList.toggle(
|
|
252
253
|
"open",
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import { normalizeScheduleReference } from "../lib/schedule-message.js";
|
|
2
|
+
import { textOf } from "../lib/text-format.js";
|
|
3
|
+
|
|
4
|
+
export function isScheduleTriggerForConversation(
|
|
5
|
+
message,
|
|
6
|
+
sessionId,
|
|
7
|
+
environmentId,
|
|
8
|
+
) {
|
|
9
|
+
if (!sessionId || message.sessionId !== sessionId) return false;
|
|
10
|
+
return isScheduleTriggerInEnvironment(message, environmentId);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
function isScheduleTriggerInEnvironment(message, environmentId) {
|
|
14
|
+
if (!textOf(message.sessionId)) return false;
|
|
15
|
+
if (textOf(message.environment || message.environmentId) !== environmentId)
|
|
16
|
+
return false;
|
|
17
|
+
if (!textOf(message.requestId) || !textOf(message.messageId)) return false;
|
|
18
|
+
return Boolean(normalizeScheduleReference(message.schedule));
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export function createScheduleRealtimeController({
|
|
22
|
+
state,
|
|
23
|
+
selectedEnvironmentId,
|
|
24
|
+
addOrMergeMessage,
|
|
25
|
+
normalizeChatMessage,
|
|
26
|
+
activeAssistantForRequest,
|
|
27
|
+
renderMessages,
|
|
28
|
+
updateComposerSendState,
|
|
29
|
+
setMessageActivityStatus,
|
|
30
|
+
trackSeq,
|
|
31
|
+
loadSessions,
|
|
32
|
+
}) {
|
|
33
|
+
const scheduledRequests = new Map();
|
|
34
|
+
|
|
35
|
+
function hasRecordedTrigger(message) {
|
|
36
|
+
return (state.messages || []).some(
|
|
37
|
+
(item) => item.schedule?.runId === message.schedule.runId,
|
|
38
|
+
);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
function hasDifferentActiveRequest(requestId) {
|
|
42
|
+
if (!state.activeRequestId) return false;
|
|
43
|
+
return state.activeRequestId !== requestId;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
function isForegroundScheduledRequest(message) {
|
|
47
|
+
if (message.sessionId !== state.currentSessionId) return false;
|
|
48
|
+
return message.requestId === state.activeRequestId;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
function scheduledTerminalScope(message) {
|
|
52
|
+
const tracked = scheduledRequests.get(message.requestId);
|
|
53
|
+
if (tracked) return tracked;
|
|
54
|
+
if (message.requestOrigin !== "schedule") return undefined;
|
|
55
|
+
const environmentId = textOf(message.environment || message.environmentId);
|
|
56
|
+
if (!environmentId.trim()) return undefined;
|
|
57
|
+
if (!textOf(message.requestId).trim()) return undefined;
|
|
58
|
+
if (!textOf(message.sessionId).trim()) return undefined;
|
|
59
|
+
return { sessionId: message.sessionId, environmentId };
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
function handleScheduledTerminal(message) {
|
|
63
|
+
if (message.type !== "completed" && message.type !== "failed") return false;
|
|
64
|
+
const scope = scheduledTerminalScope(message);
|
|
65
|
+
if (!scope) return message.requestOrigin === "schedule";
|
|
66
|
+
if (message.sessionId !== scope.sessionId) return true;
|
|
67
|
+
const environmentId =
|
|
68
|
+
textOf(message.environment || message.environmentId) ||
|
|
69
|
+
scope.environmentId;
|
|
70
|
+
if (environmentId !== scope.environmentId) return true;
|
|
71
|
+
scheduledRequests.delete(message.requestId);
|
|
72
|
+
if (environmentId !== selectedEnvironmentId()) return true;
|
|
73
|
+
if (message.sessionDeleted === true) return true;
|
|
74
|
+
if (isForegroundScheduledRequest(message)) return false;
|
|
75
|
+
void loadSessions();
|
|
76
|
+
return true;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
function handle(message) {
|
|
80
|
+
if (handleScheduledTerminal(message)) return true;
|
|
81
|
+
if (message.type !== "event" || message.name !== "schedule.triggered")
|
|
82
|
+
return false;
|
|
83
|
+
if (!isScheduleTriggerInEnvironment(message, selectedEnvironmentId()))
|
|
84
|
+
return true;
|
|
85
|
+
if (message.sessionDeleted === true) return true;
|
|
86
|
+
scheduledRequests.set(message.requestId, {
|
|
87
|
+
sessionId: message.sessionId,
|
|
88
|
+
environmentId: selectedEnvironmentId(),
|
|
89
|
+
});
|
|
90
|
+
if (hasRecordedTrigger(message)) return true;
|
|
91
|
+
if (
|
|
92
|
+
!isScheduleTriggerForConversation(
|
|
93
|
+
message,
|
|
94
|
+
state.currentSessionId,
|
|
95
|
+
selectedEnvironmentId(),
|
|
96
|
+
)
|
|
97
|
+
)
|
|
98
|
+
return true;
|
|
99
|
+
if (hasDifferentActiveRequest(message.requestId)) return true;
|
|
100
|
+
const userMessage = normalizeChatMessage({
|
|
101
|
+
id: message.messageId,
|
|
102
|
+
role: "user",
|
|
103
|
+
requestId: message.requestId,
|
|
104
|
+
text: message.text,
|
|
105
|
+
createdAt: message.createdAt,
|
|
106
|
+
schedule: message.schedule,
|
|
107
|
+
});
|
|
108
|
+
addOrMergeMessage(userMessage);
|
|
109
|
+
state.activeRequestId = message.requestId;
|
|
110
|
+
activeAssistantForRequest(message.requestId);
|
|
111
|
+
trackSeq(message);
|
|
112
|
+
renderMessages();
|
|
113
|
+
updateComposerSendState();
|
|
114
|
+
setMessageActivityStatus("Scheduled task is running.", true);
|
|
115
|
+
return true;
|
|
116
|
+
}
|
|
117
|
+
return { handle };
|
|
118
|
+
}
|