@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,421 @@
|
|
|
1
|
+
import {
|
|
2
|
+
canManageSchedule,
|
|
3
|
+
matchesScheduleFilter,
|
|
4
|
+
scheduleErrorMessage,
|
|
5
|
+
} from "../lib/schedule-presentation.js";
|
|
6
|
+
|
|
7
|
+
export function createSchedulesController({
|
|
8
|
+
client,
|
|
9
|
+
getEnvironmentId,
|
|
10
|
+
render,
|
|
11
|
+
openConversation,
|
|
12
|
+
setTimer = setTimeout,
|
|
13
|
+
clearTimer = clearTimeout,
|
|
14
|
+
}) {
|
|
15
|
+
const state = {
|
|
16
|
+
environmentId: "",
|
|
17
|
+
jobs: [],
|
|
18
|
+
sessions: [],
|
|
19
|
+
models: [],
|
|
20
|
+
defaultModelProfileId: "",
|
|
21
|
+
selectedId: "",
|
|
22
|
+
runs: [],
|
|
23
|
+
runsCursor: null,
|
|
24
|
+
runsNextCursor: null,
|
|
25
|
+
runsPreviousCursors: [],
|
|
26
|
+
query: "",
|
|
27
|
+
filter: "current",
|
|
28
|
+
loading: false,
|
|
29
|
+
loadingRuns: false,
|
|
30
|
+
mutation: "",
|
|
31
|
+
error: "",
|
|
32
|
+
detailError: "",
|
|
33
|
+
editor: null,
|
|
34
|
+
};
|
|
35
|
+
let active = false;
|
|
36
|
+
let loadRevision = 0;
|
|
37
|
+
let detailRevision = 0;
|
|
38
|
+
let selectionRevision = 0;
|
|
39
|
+
let pendingDetailRead = null;
|
|
40
|
+
let pollTimer;
|
|
41
|
+
const publish = () => render({ ...state });
|
|
42
|
+
const isCurrentEnvironment = (environmentId) =>
|
|
43
|
+
environmentId === getEnvironmentId();
|
|
44
|
+
const hasCurrentListRead = (revision, environmentId) =>
|
|
45
|
+
revision === loadRevision && isCurrentEnvironment(environmentId);
|
|
46
|
+
const hasCurrentDetailRead = (revision, environmentId, jobId) =>
|
|
47
|
+
revision === detailRevision &&
|
|
48
|
+
isCurrentEnvironment(environmentId) &&
|
|
49
|
+
state.selectedId === jobId;
|
|
50
|
+
|
|
51
|
+
function resetRunPages() {
|
|
52
|
+
Object.assign(state, {
|
|
53
|
+
runs: [],
|
|
54
|
+
runsCursor: null,
|
|
55
|
+
runsNextCursor: null,
|
|
56
|
+
runsPreviousCursors: [],
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
function selectJobIdentity(jobId) {
|
|
61
|
+
if (state.selectedId !== jobId) resetRunPages();
|
|
62
|
+
state.selectedId = jobId;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
function isVisibleJob(job) {
|
|
66
|
+
return matchesScheduleFilter(
|
|
67
|
+
job,
|
|
68
|
+
state.query,
|
|
69
|
+
state.filter,
|
|
70
|
+
state.sessions,
|
|
71
|
+
);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
function firstVisibleJob() {
|
|
75
|
+
return state.jobs.find(isVisibleJob);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
function hasLoadedJob(jobId) {
|
|
79
|
+
return state.jobs.some((job) => job.id === jobId);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
function hasVisibleSelection(selected) {
|
|
83
|
+
if (!selected) return false;
|
|
84
|
+
return isVisibleJob(selected);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
function hasPendingDetailRead(jobId, environmentId) {
|
|
88
|
+
if (!pendingDetailRead) return false;
|
|
89
|
+
if (pendingDetailRead.revision !== detailRevision) return false;
|
|
90
|
+
if (pendingDetailRead.environmentId !== environmentId) return false;
|
|
91
|
+
if (pendingDetailRead.jobId !== jobId) return false;
|
|
92
|
+
return pendingDetailRead.cursor === state.runsCursor;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
function shouldShowHistoryLoading(background) {
|
|
96
|
+
if (!background) return true;
|
|
97
|
+
return state.runs.length === 0;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
function shouldOpenEntryEditor(
|
|
101
|
+
openFirstEditor,
|
|
102
|
+
environmentChanged,
|
|
103
|
+
targetJobId,
|
|
104
|
+
readSelectionRevision,
|
|
105
|
+
) {
|
|
106
|
+
if (readSelectionRevision !== selectionRevision) return false;
|
|
107
|
+
if (targetJobId) return false;
|
|
108
|
+
if (state.editor) return false;
|
|
109
|
+
if (state.mutation) return false;
|
|
110
|
+
if (!active) return false;
|
|
111
|
+
if (openFirstEditor) return true;
|
|
112
|
+
return environmentChanged;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
function canRestoreRequestedJob(targetJobId, readSelectionRevision) {
|
|
116
|
+
if (!targetJobId) return false;
|
|
117
|
+
return readSelectionRevision === selectionRevision;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
function shouldPreserveMissingSelection(selected, readSelectionRevision) {
|
|
121
|
+
if (selected) return false;
|
|
122
|
+
return readSelectionRevision === selectionRevision;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
function openEntryScheduleEditor() {
|
|
126
|
+
const job = firstVisibleJob();
|
|
127
|
+
selectJobIdentity(job?.id || "");
|
|
128
|
+
if (!canManageSchedule(job)) return;
|
|
129
|
+
state.editor = { job, environmentId: getEnvironmentId() };
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
function reconcileLoadedSelection(
|
|
133
|
+
openEditor,
|
|
134
|
+
targetJobId,
|
|
135
|
+
readSelectionRevision,
|
|
136
|
+
) {
|
|
137
|
+
if (canRestoreRequestedJob(targetJobId, readSelectionRevision)) {
|
|
138
|
+
selectJobIdentity(targetJobId);
|
|
139
|
+
return;
|
|
140
|
+
}
|
|
141
|
+
if (state.editor) return;
|
|
142
|
+
if (openEditor) {
|
|
143
|
+
openEntryScheduleEditor();
|
|
144
|
+
return;
|
|
145
|
+
}
|
|
146
|
+
const selected = state.jobs.find((job) => job.id === state.selectedId);
|
|
147
|
+
if (shouldPreserveMissingSelection(selected, readSelectionRevision)) return;
|
|
148
|
+
if (hasVisibleSelection(selected)) return;
|
|
149
|
+
selectJobIdentity(firstVisibleJob()?.id || "");
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
function scheduleRefresh() {
|
|
153
|
+
clearTimer(pollTimer);
|
|
154
|
+
if (!active) return;
|
|
155
|
+
pollTimer = setTimer(() => {
|
|
156
|
+
if (state.mutation) {
|
|
157
|
+
scheduleRefresh();
|
|
158
|
+
return;
|
|
159
|
+
}
|
|
160
|
+
void load({ background: true });
|
|
161
|
+
}, 5000);
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
async function load({
|
|
165
|
+
background = false,
|
|
166
|
+
openFirstEditor = false,
|
|
167
|
+
targetJobId = "",
|
|
168
|
+
} = {}) {
|
|
169
|
+
const environmentId = getEnvironmentId();
|
|
170
|
+
const revision = ++loadRevision;
|
|
171
|
+
const readSelectionRevision = selectionRevision;
|
|
172
|
+
const environmentChanged = state.environmentId !== environmentId;
|
|
173
|
+
if (environmentChanged) {
|
|
174
|
+
Object.assign(state, {
|
|
175
|
+
environmentId,
|
|
176
|
+
jobs: [],
|
|
177
|
+
sessions: [],
|
|
178
|
+
models: [],
|
|
179
|
+
selectedId: "",
|
|
180
|
+
query: "",
|
|
181
|
+
filter: targetJobId ? "all" : "current",
|
|
182
|
+
runs: [],
|
|
183
|
+
editor: null,
|
|
184
|
+
error: "",
|
|
185
|
+
detailError: "",
|
|
186
|
+
});
|
|
187
|
+
resetRunPages();
|
|
188
|
+
detailRevision += 1;
|
|
189
|
+
}
|
|
190
|
+
state.loading = !background;
|
|
191
|
+
if (!background) publish();
|
|
192
|
+
try {
|
|
193
|
+
const [jobs, sessions, models] = await Promise.all([
|
|
194
|
+
client.listSchedules(environmentId),
|
|
195
|
+
client.listSessions(environmentId),
|
|
196
|
+
client.listModels(environmentId),
|
|
197
|
+
]);
|
|
198
|
+
if (!hasCurrentListRead(revision, environmentId)) return;
|
|
199
|
+
state.jobs = jobs.jobs || [];
|
|
200
|
+
state.sessions = sessions.sessions || [];
|
|
201
|
+
state.models = models.profiles || [];
|
|
202
|
+
state.defaultModelProfileId = models.defaultProfileId || "";
|
|
203
|
+
state.error = "";
|
|
204
|
+
reconcileLoadedSelection(
|
|
205
|
+
shouldOpenEntryEditor(
|
|
206
|
+
openFirstEditor,
|
|
207
|
+
environmentChanged,
|
|
208
|
+
targetJobId,
|
|
209
|
+
readSelectionRevision,
|
|
210
|
+
),
|
|
211
|
+
targetJobId,
|
|
212
|
+
readSelectionRevision,
|
|
213
|
+
);
|
|
214
|
+
if (state.selectedId)
|
|
215
|
+
void select(state.selectedId, {
|
|
216
|
+
background: true,
|
|
217
|
+
reusePendingRead: background,
|
|
218
|
+
});
|
|
219
|
+
} catch (error) {
|
|
220
|
+
if (!hasCurrentListRead(revision, environmentId)) return;
|
|
221
|
+
state.error = scheduleErrorMessage(error);
|
|
222
|
+
} finally {
|
|
223
|
+
if (hasCurrentListRead(revision, environmentId)) {
|
|
224
|
+
state.loading = false;
|
|
225
|
+
publish();
|
|
226
|
+
scheduleRefresh();
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
async function select(
|
|
232
|
+
jobId,
|
|
233
|
+
{ background = false, reusePendingRead = background } = {},
|
|
234
|
+
) {
|
|
235
|
+
const environmentId = getEnvironmentId();
|
|
236
|
+
if (reusePendingRead && hasPendingDetailRead(jobId, environmentId)) return;
|
|
237
|
+
if (!background) selectionRevision += 1;
|
|
238
|
+
const revision = ++detailRevision;
|
|
239
|
+
selectJobIdentity(jobId);
|
|
240
|
+
state.loadingRuns = shouldShowHistoryLoading(background);
|
|
241
|
+
state.detailError = "";
|
|
242
|
+
if (!hasLoadedJob(jobId)) {
|
|
243
|
+
resetRunPages();
|
|
244
|
+
state.loadingRuns = false;
|
|
245
|
+
publish();
|
|
246
|
+
return;
|
|
247
|
+
}
|
|
248
|
+
const read = { revision, environmentId, jobId, cursor: state.runsCursor };
|
|
249
|
+
pendingDetailRead = read;
|
|
250
|
+
if (!background) publish();
|
|
251
|
+
try {
|
|
252
|
+
const result = await client.listScheduleRuns(jobId, environmentId, {
|
|
253
|
+
cursor: read.cursor ?? undefined,
|
|
254
|
+
});
|
|
255
|
+
if (!hasCurrentDetailRead(revision, environmentId, jobId)) return;
|
|
256
|
+
state.runs = result.runs || [];
|
|
257
|
+
state.runsNextCursor = result.nextCursor ?? null;
|
|
258
|
+
} catch (error) {
|
|
259
|
+
if (!hasCurrentDetailRead(revision, environmentId, jobId)) return;
|
|
260
|
+
state.detailError = scheduleErrorMessage(error);
|
|
261
|
+
} finally {
|
|
262
|
+
if (pendingDetailRead === read) pendingDetailRead = null;
|
|
263
|
+
if (hasCurrentDetailRead(revision, environmentId, jobId)) {
|
|
264
|
+
state.loadingRuns = false;
|
|
265
|
+
publish();
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
async function moveRunPage(cursor, previousCursors) {
|
|
271
|
+
state.runsCursor = cursor;
|
|
272
|
+
state.runsPreviousCursors = previousCursors;
|
|
273
|
+
state.runsNextCursor = null;
|
|
274
|
+
state.runs = [];
|
|
275
|
+
await select(state.selectedId);
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
async function olderRuns() {
|
|
279
|
+
if (state.loadingRuns || !state.runsNextCursor) return;
|
|
280
|
+
await moveRunPage(state.runsNextCursor, [
|
|
281
|
+
...state.runsPreviousCursors,
|
|
282
|
+
state.runsCursor,
|
|
283
|
+
]);
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
async function newerRuns() {
|
|
287
|
+
if (state.loadingRuns || !state.runsPreviousCursors.length) return;
|
|
288
|
+
const previous = [...state.runsPreviousCursors];
|
|
289
|
+
await moveRunPage(previous.pop(), previous);
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
async function latestRuns() {
|
|
293
|
+
if (state.loadingRuns || state.runsCursor === null) return;
|
|
294
|
+
await moveRunPage(null, []);
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
function beginEdit(jobId = "", initialValues = null) {
|
|
298
|
+
selectionRevision += 1;
|
|
299
|
+
state.editor = {
|
|
300
|
+
job: state.jobs.find((job) => job.id === jobId) || null,
|
|
301
|
+
environmentId: getEnvironmentId(),
|
|
302
|
+
initialValues,
|
|
303
|
+
};
|
|
304
|
+
publish();
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
function cancelEdit() {
|
|
308
|
+
selectionRevision += 1;
|
|
309
|
+
state.editor = null;
|
|
310
|
+
publish();
|
|
311
|
+
scheduleRefresh();
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
async function save(input) {
|
|
315
|
+
const editor = state.editor;
|
|
316
|
+
if (!editor || !isCurrentEnvironment(editor.environmentId))
|
|
317
|
+
throw new Error("The environment changed. Reopen the schedule editor.");
|
|
318
|
+
state.mutation = "save";
|
|
319
|
+
try {
|
|
320
|
+
const result = editor.job
|
|
321
|
+
? await client.updateSchedule(
|
|
322
|
+
editor.job.id,
|
|
323
|
+
input,
|
|
324
|
+
editor.environmentId,
|
|
325
|
+
)
|
|
326
|
+
: await client.createSchedule(input, editor.environmentId);
|
|
327
|
+
if (!isCurrentEnvironment(editor.environmentId)) return;
|
|
328
|
+
state.editor = null;
|
|
329
|
+
selectJobIdentity(result.job.id);
|
|
330
|
+
await load();
|
|
331
|
+
} finally {
|
|
332
|
+
state.mutation = "";
|
|
333
|
+
publish();
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
async function action(jobId, actionName) {
|
|
338
|
+
if (state.mutation) return;
|
|
339
|
+
const environmentId = getEnvironmentId();
|
|
340
|
+
state.mutation = actionName;
|
|
341
|
+
state.error = "";
|
|
342
|
+
publish();
|
|
343
|
+
try {
|
|
344
|
+
await client.scheduleAction(jobId, actionName, environmentId);
|
|
345
|
+
if (isCurrentEnvironment(environmentId)) await load();
|
|
346
|
+
} catch (error) {
|
|
347
|
+
if (isCurrentEnvironment(environmentId))
|
|
348
|
+
state.error = scheduleErrorMessage(error);
|
|
349
|
+
} finally {
|
|
350
|
+
state.mutation = "";
|
|
351
|
+
publish();
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
async function openJob(jobId) {
|
|
356
|
+
selectionRevision += 1;
|
|
357
|
+
Object.assign(state, { query: "", filter: "all", editor: null });
|
|
358
|
+
selectJobIdentity(jobId);
|
|
359
|
+
await load({ targetJobId: jobId });
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
async function openCreate(initialValues = {}) {
|
|
363
|
+
const environmentId = getEnvironmentId();
|
|
364
|
+
const revision = ++selectionRevision;
|
|
365
|
+
await load();
|
|
366
|
+
if (!isCurrentEnvironment(environmentId)) return;
|
|
367
|
+
if (revision !== selectionRevision) return;
|
|
368
|
+
if (state.error) return;
|
|
369
|
+
beginEdit("", {
|
|
370
|
+
...initialValues,
|
|
371
|
+
modelProfileId: initialValues.modelProfileId || state.defaultModelProfileId,
|
|
372
|
+
});
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
async function filter(query, filter) {
|
|
376
|
+
selectionRevision += 1;
|
|
377
|
+
Object.assign(state, { query, filter });
|
|
378
|
+
if (state.editor) {
|
|
379
|
+
publish();
|
|
380
|
+
return;
|
|
381
|
+
}
|
|
382
|
+
const selected = state.jobs.find((job) => job.id === state.selectedId);
|
|
383
|
+
if (hasVisibleSelection(selected)) {
|
|
384
|
+
publish();
|
|
385
|
+
return;
|
|
386
|
+
}
|
|
387
|
+
const job = firstVisibleJob();
|
|
388
|
+
await select(job?.id || "");
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
return {
|
|
392
|
+
load,
|
|
393
|
+
select,
|
|
394
|
+
olderRuns,
|
|
395
|
+
newerRuns,
|
|
396
|
+
latestRuns,
|
|
397
|
+
beginEdit,
|
|
398
|
+
cancelEdit,
|
|
399
|
+
save,
|
|
400
|
+
action,
|
|
401
|
+
openJob,
|
|
402
|
+
openCreate,
|
|
403
|
+
snapshot: () => ({ ...state }),
|
|
404
|
+
filter,
|
|
405
|
+
setActive(value) {
|
|
406
|
+
const entering = value && !active;
|
|
407
|
+
active = value;
|
|
408
|
+
if (active) {
|
|
409
|
+
void load({ openFirstEditor: entering });
|
|
410
|
+
return;
|
|
411
|
+
}
|
|
412
|
+
loadRevision += 1;
|
|
413
|
+
detailRevision += 1;
|
|
414
|
+
state.loading = false;
|
|
415
|
+
state.loadingRuns = false;
|
|
416
|
+
clearTimer(pollTimer);
|
|
417
|
+
},
|
|
418
|
+
openConversation: (sessionId, requestId) =>
|
|
419
|
+
openConversation(sessionId, requestId),
|
|
420
|
+
};
|
|
421
|
+
}
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
import {
|
|
2
|
+
isOlderSessionReadState,
|
|
3
|
+
isSessionReadStateUnavailable,
|
|
4
|
+
mergeSessionReadStateUpdate,
|
|
5
|
+
} from "../lib/session-read-state.js";
|
|
1
6
|
import { matchesSessionQuery } from "../ui-behavior.js";
|
|
2
7
|
import { escapeAttribute, escapeHtml, textOf } from "../lib/text-format.js";
|
|
3
8
|
import { getNumber } from "../lib/event-presentation.js";
|
|
@@ -81,7 +86,10 @@ export function createSessionController({
|
|
|
81
86
|
const pinned = isPinned(sessionId);
|
|
82
87
|
const busy = state.busySessionIds.has(sessionId);
|
|
83
88
|
const unreadCount = getNumber(session.unreadCount, 0);
|
|
84
|
-
const
|
|
89
|
+
const unreadUnavailable = isSessionReadStateUnavailable(session);
|
|
90
|
+
const hasUnread = unreadUnavailable
|
|
91
|
+
? false
|
|
92
|
+
: session.hasUnread === true || unreadCount > 0;
|
|
85
93
|
const item = document.createElement("div");
|
|
86
94
|
item.className = `session-item ${
|
|
87
95
|
session.id === state.currentSessionId ? "active" : ""
|
|
@@ -92,6 +100,7 @@ export function createSessionController({
|
|
|
92
100
|
<button class="session-open-button" type="button" title="${escapeAttribute(titleOf(session))}">
|
|
93
101
|
<div class="session-title-row">
|
|
94
102
|
<div class="session-title" dir="auto">${escapeHtml(titleOf(session))}</div>
|
|
103
|
+
${unreadUnavailable ? '<span class="session-unread-badge" title="Unread status unavailable" aria-label="Unread status unavailable">?</span>' : ""}
|
|
95
104
|
${
|
|
96
105
|
hasUnread
|
|
97
106
|
? `<span class="session-unread-badge" title="${escapeAttribute(
|
|
@@ -175,12 +184,20 @@ export function createSessionController({
|
|
|
175
184
|
}
|
|
176
185
|
|
|
177
186
|
function applyReadState(sessionId, readState) {
|
|
178
|
-
const
|
|
179
|
-
|
|
187
|
+
const incoming =
|
|
188
|
+
readState && typeof readState === "object" ? readState : {};
|
|
189
|
+
const normalizedSessionId = textOf(incoming.sessionId || sessionId);
|
|
180
190
|
if (!normalizedSessionId) return false;
|
|
191
|
+
const known = byId(normalizedSessionId);
|
|
192
|
+
if (isOlderSessionReadState(incoming, known)) return false;
|
|
193
|
+
const value = mergeSessionReadStateUpdate(incoming, known);
|
|
194
|
+
const unreadUnavailable = isSessionReadStateUnavailable(value);
|
|
181
195
|
const unreadCount = getNumber(value.unreadCount, 0);
|
|
182
196
|
const normalized = {
|
|
183
197
|
sessionId: normalizedSessionId,
|
|
198
|
+
readStateStatus: unreadUnavailable
|
|
199
|
+
? "unavailable"
|
|
200
|
+
: value.readStateStatus,
|
|
184
201
|
lastReadMessageId: textOf(value.lastReadMessageId),
|
|
185
202
|
lastReadAt: value.lastReadAt || null,
|
|
186
203
|
unreadCount,
|
|
@@ -188,6 +205,15 @@ export function createSessionController({
|
|
|
188
205
|
latestMessageId: textOf(value.latestMessageId),
|
|
189
206
|
latestAssistantMessageId: textOf(value.latestAssistantMessageId),
|
|
190
207
|
};
|
|
208
|
+
if (unreadUnavailable) {
|
|
209
|
+
for (const field of [
|
|
210
|
+
"lastReadMessageId",
|
|
211
|
+
"lastReadAt",
|
|
212
|
+
"unreadCount",
|
|
213
|
+
"hasUnread",
|
|
214
|
+
])
|
|
215
|
+
normalized[field] = value[field] ?? null;
|
|
216
|
+
}
|
|
191
217
|
let changed = false;
|
|
192
218
|
state.sessions = state.sessions.map((session) => {
|
|
193
219
|
if (textOf(session.id) !== normalized.sessionId) return session;
|
|
@@ -195,6 +221,7 @@ export function createSessionController({
|
|
|
195
221
|
return {
|
|
196
222
|
...session,
|
|
197
223
|
readState: normalized,
|
|
224
|
+
readStateStatus: normalized.readStateStatus,
|
|
198
225
|
unreadCount: normalized.unreadCount,
|
|
199
226
|
hasUnread: normalized.hasUnread,
|
|
200
227
|
lastReadMessageId: normalized.lastReadMessageId,
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { createDashboardWorkspace } from "./components/dashboard/workspace.js";
|
|
2
|
+
import { createDashboardController } from "./controllers/dashboard-controller.js";
|
|
3
|
+
import { dashboardJobInitialValues } from "./lib/dashboard-job-templates.js";
|
|
4
|
+
|
|
5
|
+
export function createDashboardFeature({
|
|
6
|
+
dom, state, client, shell, schedules, selectedEnvironmentId,
|
|
7
|
+
loadSessions, openSession, isComposerAvailable,
|
|
8
|
+
}) {
|
|
9
|
+
let view;
|
|
10
|
+
const controller = createDashboardController({
|
|
11
|
+
client, getEnvironmentId: selectedEnvironmentId,
|
|
12
|
+
getSessions: () => state.sessions, loadSessions,
|
|
13
|
+
render: (snapshot) => view?.render({ ...snapshot, composerAvailable: isComposerAvailable() }),
|
|
14
|
+
});
|
|
15
|
+
view = createDashboardWorkspace({
|
|
16
|
+
root: dom.homeDashboardRoot,
|
|
17
|
+
actions: {
|
|
18
|
+
attach: () => dom.attachmentButton.click(),
|
|
19
|
+
createJob: (templateId) => schedules.createJob(dashboardJobInitialValues(templateId, dom.modelSelect.value)),
|
|
20
|
+
continueConversation: () => shell.setSessionsDrawerOpen(true),
|
|
21
|
+
openConfiguration: () => shell.activateWorkspace("config"),
|
|
22
|
+
openJobs: () => shell.activateWorkspace("schedules"),
|
|
23
|
+
refresh: controller.refresh,
|
|
24
|
+
openConversation: async (sessionId, requestId) => {
|
|
25
|
+
if (!shell.activateWorkspace("chat")) return;
|
|
26
|
+
try {
|
|
27
|
+
await openSession(sessionId);
|
|
28
|
+
if (state.currentSessionId !== sessionId) return;
|
|
29
|
+
if (!requestId) return;
|
|
30
|
+
requestAnimationFrame(() => {
|
|
31
|
+
const message = [...dom.messagesList.querySelectorAll("[data-request-id]")]
|
|
32
|
+
.find((node) => node.dataset.requestId === requestId);
|
|
33
|
+
message?.scrollIntoView({ block: "center", behavior: "smooth" });
|
|
34
|
+
});
|
|
35
|
+
} catch (error) {
|
|
36
|
+
shell.showToast(error instanceof Error ? error.message : String(error), "failed");
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
});
|
|
41
|
+
controller.publish();
|
|
42
|
+
document.addEventListener("visibilitychange", controller.visibilityChanged);
|
|
43
|
+
return { ...controller, composerHost: view.composerHost, setupHost: view.setupHost };
|
|
44
|
+
}
|
|
@@ -25,13 +25,18 @@
|
|
|
25
25
|
<span class="rail-button-label">Chats</span>
|
|
26
26
|
</button>
|
|
27
27
|
<div class="rail-actions">
|
|
28
|
+
<button id="homeWorkspaceButton" class="rail-button" type="button"
|
|
29
|
+
aria-label="Open home dashboard" aria-controls="homeWorkspacePanel"
|
|
30
|
+
aria-current="page" title="Home">
|
|
31
|
+
<svg viewBox="0 0 24 24" aria-hidden="true"><path d="m3 10 9-7 9 7M5 9v12h5v-7h4v7h5V9" /></svg>
|
|
32
|
+
<span class="rail-button-label">Home</span>
|
|
33
|
+
</button>
|
|
28
34
|
<button
|
|
29
35
|
id="chatWorkspaceButton"
|
|
30
36
|
class="rail-button"
|
|
31
37
|
type="button"
|
|
32
38
|
aria-label="Open chat workspace"
|
|
33
39
|
aria-controls="chatWorkspace"
|
|
34
|
-
aria-current="page"
|
|
35
40
|
title="Chat"
|
|
36
41
|
>
|
|
37
42
|
<svg viewBox="0 0 24 24" aria-hidden="true">
|
|
@@ -52,6 +57,22 @@
|
|
|
52
57
|
</svg>
|
|
53
58
|
<span class="rail-button-label">New</span>
|
|
54
59
|
</button>
|
|
60
|
+
<button
|
|
61
|
+
id="schedulesWorkspaceButton"
|
|
62
|
+
hidden
|
|
63
|
+
disabled
|
|
64
|
+
class="rail-button"
|
|
65
|
+
type="button"
|
|
66
|
+
aria-label="Open schedules workspace"
|
|
67
|
+
aria-controls="schedulesWorkspacePanel"
|
|
68
|
+
title="Schedules"
|
|
69
|
+
>
|
|
70
|
+
<svg viewBox="0 0 24 24" aria-hidden="true">
|
|
71
|
+
<circle cx="12" cy="12" r="8" />
|
|
72
|
+
<path d="M12 7v5l3 2" />
|
|
73
|
+
</svg>
|
|
74
|
+
<span class="rail-button-label">Schedules</span>
|
|
75
|
+
</button>
|
|
55
76
|
<button
|
|
56
77
|
id="configWorkspaceButton"
|
|
57
78
|
class="rail-button"
|
|
@@ -104,6 +125,11 @@
|
|
|
104
125
|
</div>
|
|
105
126
|
</nav>
|
|
106
127
|
|
|
128
|
+
<section id="homeWorkspacePanel" class="home-workspace-panel" aria-label="Home dashboard">
|
|
129
|
+
<header class="home-workspace-header"><h1>Home</h1></header>
|
|
130
|
+
<div id="homeDashboardRoot"></div>
|
|
131
|
+
</section>
|
|
132
|
+
|
|
107
133
|
<aside
|
|
108
134
|
id="sessionsPanel"
|
|
109
135
|
class="sessions-panel workspace-sheet sessions-sheet"
|
|
@@ -359,6 +385,32 @@
|
|
|
359
385
|
</div>
|
|
360
386
|
</main>
|
|
361
387
|
|
|
388
|
+
<section
|
|
389
|
+
id="schedulesWorkspacePanel"
|
|
390
|
+
class="workspace-page-panel schedules-workspace-panel"
|
|
391
|
+
aria-labelledby="schedulesWorkspaceTitle"
|
|
392
|
+
hidden
|
|
393
|
+
>
|
|
394
|
+
<header class="workspace-page-header">
|
|
395
|
+
<div class="workspace-page-heading">
|
|
396
|
+
<p class="eyebrow">Automations</p>
|
|
397
|
+
<h2 id="schedulesWorkspaceTitle">Schedules</h2>
|
|
398
|
+
<p>Tasks that return to the conversation, right on time.</p>
|
|
399
|
+
</div>
|
|
400
|
+
<button
|
|
401
|
+
id="closeSchedulesWorkspaceButton"
|
|
402
|
+
class="workspace-page-back"
|
|
403
|
+
type="button"
|
|
404
|
+
>
|
|
405
|
+
Back to chat
|
|
406
|
+
</button>
|
|
407
|
+
</header>
|
|
408
|
+
<div
|
|
409
|
+
id="schedulesRoot"
|
|
410
|
+
class="workspace-page-body schedules-workspace-body"
|
|
411
|
+
></div>
|
|
412
|
+
</section>
|
|
413
|
+
|
|
362
414
|
<section
|
|
363
415
|
id="configWorkspacePanel"
|
|
364
416
|
class="workspace-page-panel config-workspace-panel"
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export interface ComposerSubmissionView {
|
|
2
|
+
currentSessionId: string;
|
|
3
|
+
sessionViewVersion?: number;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
export interface ComposerSubmissionScope {
|
|
7
|
+
environmentId: string;
|
|
8
|
+
sessionId: string;
|
|
9
|
+
viewVersion: number | undefined;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export declare function captureComposerSubmissionScope(
|
|
13
|
+
state: ComposerSubmissionView,
|
|
14
|
+
environmentId: string,
|
|
15
|
+
): ComposerSubmissionScope;
|
|
16
|
+
|
|
17
|
+
export declare function isCurrentComposerSubmissionScope(
|
|
18
|
+
scope: ComposerSubmissionScope,
|
|
19
|
+
state: ComposerSubmissionView,
|
|
20
|
+
environmentId: string,
|
|
21
|
+
): boolean;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export function captureComposerSubmissionScope(state, environmentId) {
|
|
2
|
+
return {
|
|
3
|
+
environmentId,
|
|
4
|
+
sessionId: state.currentSessionId,
|
|
5
|
+
viewVersion: state.sessionViewVersion,
|
|
6
|
+
};
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export function isCurrentComposerSubmissionScope(scope, state, environmentId) {
|
|
10
|
+
if (scope.environmentId !== environmentId) return false;
|
|
11
|
+
if (scope.sessionId !== state.currentSessionId) return false;
|
|
12
|
+
return scope.viewVersion === state.sessionViewVersion;
|
|
13
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
interface ContextWindowSequence {
|
|
2
|
+
eventSequence?: unknown;
|
|
3
|
+
seqNo?: unknown;
|
|
4
|
+
lastSeqNo?: unknown;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export declare function canReplaceContextWindowEvidence(
|
|
8
|
+
previous: ContextWindowSequence | null | undefined,
|
|
9
|
+
incoming: ContextWindowSequence,
|
|
10
|
+
): boolean;
|
|
11
|
+
|
|
12
|
+
export declare function isEventAfterContextWindowSnapshot(
|
|
13
|
+
snapshot: ContextWindowSequence,
|
|
14
|
+
event: ContextWindowSequence,
|
|
15
|
+
): boolean;
|