@abot-ai/runtime 1.8.1 → 1.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/scripts/runtime-setup-files.js +46 -2
- package/dist/src/model-gateway/client/chat.js +9 -5
- package/dist/src/model-gateway/client/invocation-error.d.ts +9 -0
- package/dist/src/model-gateway/client/invocation-error.js +30 -0
- package/dist/src/model-gateway/client/stream-consumer.js +9 -2
- package/dist/src/model-gateway/client/stream-parser.js +2 -1
- package/dist/src/runtime/adapters/registered-tool-normal-invocations/execution/approval.d.ts +5 -1
- package/dist/src/runtime/adapters/registered-tool-normal-invocations/execution/approval.js +15 -1
- package/dist/src/runtime/adapters/registered-tool-normal-invocations/execution/prepared-execution.js +7 -5
- package/dist/src/runtime/adapters/registered-tool-normal-invocations/execution/prepared-snapshot.js +9 -2
- package/dist/src/runtime/automations/service.d.ts +1 -1
- package/dist/src/runtime/capabilities/automation-builder/tool-module.js +4 -4
- package/dist/src/runtime/capabilities/automations/draft-index.d.ts +1 -1
- package/dist/src/runtime/capabilities/automations/tool-module.js +4 -4
- package/dist/src/runtime/capabilities/core-tool-contracts.d.ts +29 -0
- package/dist/src/runtime/capabilities/core-tool-contracts.js +38 -0
- package/dist/src/runtime/capabilities/knowledge-skills/read-many.d.ts +4 -0
- package/dist/src/runtime/capabilities/knowledge-skills/read-many.js +21 -0
- package/dist/src/runtime/capabilities/knowledge-skills/read-targets.d.ts +13 -0
- package/dist/src/runtime/capabilities/knowledge-skills/read-targets.js +44 -0
- package/dist/src/runtime/capabilities/knowledge-skills/tool-contract.d.ts +141 -0
- package/dist/src/runtime/capabilities/knowledge-skills/tool-contract.js +58 -0
- package/dist/src/runtime/capabilities/knowledge-skills/tool-module.d.ts +4 -0
- package/dist/src/runtime/capabilities/knowledge-skills/tool-module.js +78 -0
- package/dist/src/runtime/capabilities/knowledge-skills/tool-output.d.ts +12 -0
- package/dist/src/runtime/capabilities/knowledge-skills/tool-output.js +21 -0
- package/dist/src/runtime/capabilities/knowledge-skills/write-contract.d.ts +77 -0
- package/dist/src/runtime/capabilities/knowledge-skills/write-contract.js +28 -0
- package/dist/src/runtime/capabilities/knowledge-skills/write-operations.d.ts +3 -0
- package/dist/src/runtime/capabilities/knowledge-skills/write-operations.js +34 -0
- package/dist/src/runtime/capabilities/scheduling/tool-module.js +3 -3
- package/dist/src/runtime/composition.d.ts +5 -0
- package/dist/src/runtime/context/capability-result-compaction-source.d.ts +3 -1
- package/dist/src/runtime/context/capability-result-compaction-source.js +13 -1
- package/dist/src/runtime/context/core-skill-read-context.d.ts +16 -0
- package/dist/src/runtime/context/core-skill-read-context.js +76 -0
- package/dist/src/runtime/context/exact-evidence-match.d.ts +3 -0
- package/dist/src/runtime/context/exact-evidence-match.js +34 -0
- package/dist/src/runtime/context/model-step-compaction.js +20 -6
- package/dist/src/runtime/context/semantic-compaction/core-skill-read-source.d.ts +9 -0
- package/dist/src/runtime/context/semantic-compaction/core-skill-read-source.js +38 -0
- package/dist/src/runtime/context/semantic-compaction/generation-contracts.d.ts +2 -0
- package/dist/src/runtime/context/semantic-compaction/prompt.js +7 -7
- package/dist/src/runtime/context/semantic-compaction/run.js +10 -3
- package/dist/src/runtime/context/semantic-compaction/super-source-integrity.js +33 -3
- package/dist/src/runtime/context/session-artifact-paths.d.ts +2 -1
- package/dist/src/runtime/context/session-artifact-paths.js +2 -1
- package/dist/src/runtime/context/session-memory/model-step-controller.d.ts +2 -2
- package/dist/src/runtime/context/super-worker-compaction-failure.d.ts +1 -1
- package/dist/src/runtime/context/super-worker-compaction-failure.js +2 -1
- package/dist/src/runtime/context/super-worker-compaction-sidecar.d.ts +2 -1
- package/dist/src/runtime/context/super-worker-compaction-sidecar.js +9 -3
- package/dist/src/runtime/default-environment-adapters.d.ts +2 -1
- package/dist/src/runtime/default-environment-adapters.js +5 -1
- package/dist/src/runtime/knowledge-skills/available-skills-projection.d.ts +17 -0
- package/dist/src/runtime/knowledge-skills/available-skills-projection.js +66 -0
- package/dist/src/runtime/knowledge-skills/available-skills.d.ts +7 -0
- package/dist/src/runtime/knowledge-skills/available-skills.js +17 -0
- package/dist/src/runtime/knowledge-skills/builtins/abot-studio.d.ts +2 -0
- package/dist/src/runtime/knowledge-skills/builtins/abot-studio.js +27 -0
- package/dist/src/runtime/knowledge-skills/builtins/computer-use.d.ts +2 -0
- package/dist/src/runtime/knowledge-skills/builtins/computer-use.js +34 -0
- package/dist/src/runtime/knowledge-skills/builtins/skill-creator.d.ts +2 -0
- package/dist/src/runtime/knowledge-skills/builtins/skill-creator.js +29 -0
- package/dist/src/runtime/knowledge-skills/builtins/technical-work.d.ts +2 -0
- package/dist/src/runtime/knowledge-skills/builtins/technical-work.js +27 -0
- package/dist/src/runtime/knowledge-skills/catalog.d.ts +2 -0
- package/dist/src/runtime/knowledge-skills/catalog.js +12 -0
- package/dist/src/runtime/knowledge-skills/personal-contracts.d.ts +48 -0
- package/dist/src/runtime/knowledge-skills/personal-contracts.js +29 -0
- package/dist/src/runtime/knowledge-skills/personal-documents.d.ts +6 -0
- package/dist/src/runtime/knowledge-skills/personal-documents.js +56 -0
- package/dist/src/runtime/knowledge-skills/personal-management.d.ts +9 -0
- package/dist/src/runtime/knowledge-skills/personal-management.js +64 -0
- package/dist/src/runtime/knowledge-skills/personal-repository.d.ts +6 -0
- package/dist/src/runtime/knowledge-skills/personal-repository.js +76 -0
- package/dist/src/runtime/knowledge-skills/personal-store.d.ts +4 -0
- package/dist/src/runtime/knowledge-skills/personal-store.js +33 -0
- package/dist/src/runtime/knowledge-skills/read-evidence.d.ts +3 -0
- package/dist/src/runtime/knowledge-skills/read-evidence.js +13 -0
- package/dist/src/runtime/knowledge-skills/store.d.ts +19 -0
- package/dist/src/runtime/knowledge-skills/store.js +41 -0
- package/dist/src/runtime/local-application.d.ts +2 -1
- package/dist/src/runtime/local-host/app-service-dispatch.d.ts +1 -0
- package/dist/src/runtime/local-host/app-service-dispatch.js +5 -0
- package/dist/src/runtime/local-host/client-services.d.ts +3 -1
- package/dist/src/runtime/local-host/client-services.js +3 -2
- package/dist/src/runtime/long-term-memory/conversation-authoring/context.d.ts +1 -0
- package/dist/src/runtime/long-term-memory/conversation-authoring/context.js +1 -1
- package/dist/src/runtime/long-term-memory/conversation-authoring/plain-text-context.d.ts +5 -0
- package/dist/src/runtime/long-term-memory/conversation-authoring/plain-text-context.js +28 -0
- package/dist/src/runtime/long-term-memory/initial-context.d.ts +1 -0
- package/dist/src/runtime/model/context-compaction-admission.d.ts +1 -0
- package/dist/src/runtime/model/context-compaction-admission.js +35 -1
- package/dist/src/runtime/model/context-compaction-contracts.d.ts +9 -1
- package/dist/src/runtime/model/invoke-step.js +6 -2
- package/dist/src/runtime/model/provider-failure.d.ts +13 -0
- package/dist/src/runtime/model/provider-failure.js +37 -0
- package/dist/src/runtime/orchestration/role-calls/activation-budget.js +1 -0
- package/dist/src/runtime/orchestration/role-calls/candidate-validation.js +2 -0
- package/dist/src/runtime/orchestration/role-calls/checkpoint-state.js +2 -1
- package/dist/src/runtime/orchestration/role-calls/command-decoder.js +3 -0
- package/dist/src/runtime/orchestration/role-calls/command-dispatch/skill-read-transition.d.ts +4 -0
- package/dist/src/runtime/orchestration/role-calls/command-dispatch/skill-read-transition.js +48 -0
- package/dist/src/runtime/orchestration/role-calls/command-dispatch.js +3 -0
- package/dist/src/runtime/orchestration/role-calls/contracts.d.ts +6 -3
- package/dist/src/runtime/orchestration/role-calls/contracts.js +3 -3
- package/dist/src/runtime/orchestration/role-calls/skill-read.d.ts +47 -0
- package/dist/src/runtime/orchestration/role-calls/skill-read.js +196 -0
- package/dist/src/runtime/orchestration/role-executors/activation/model-output-failure.d.ts +1 -1
- package/dist/src/runtime/orchestration/role-executors/activation/model-output-failure.js +4 -2
- package/dist/src/runtime/orchestration/worker-capabilities/binding/create-binding.js +4 -1
- package/dist/src/runtime/orchestration/worker-capabilities/contracts.d.ts +1 -1
- package/dist/src/runtime/orchestration/worker-capabilities/contracts.js +1 -1
- package/dist/src/runtime/orchestration/worker-capabilities/execution/approval-group.js +5 -3
- package/dist/src/runtime/orchestration/worker-capabilities/payload-compaction-transport.d.ts +2 -0
- package/dist/src/runtime/orchestration/worker-capabilities/payload-compaction-transport.js +7 -2
- package/dist/src/runtime/orchestration/worker-capabilities/supervisor-skill-authority.d.ts +19 -0
- package/dist/src/runtime/orchestration/worker-capabilities/supervisor-skill-authority.js +43 -0
- package/dist/src/runtime/plugins/loader.js +7 -6
- package/dist/src/runtime/request/approval-wait/preflight.js +1 -0
- package/dist/src/runtime/request/bound-runtime-handler.js +1 -0
- package/dist/src/runtime/request/contracts.d.ts +2 -0
- package/dist/src/runtime/request/execution-payload-compacted-evidence.d.ts +2 -2
- package/dist/src/runtime/request/execution-scope-surfaces.d.ts +2 -0
- package/dist/src/runtime/request/execution-scope-surfaces.js +7 -0
- package/dist/src/runtime/request/execution-scope.d.ts +6 -2
- package/dist/src/runtime/request/execution-scope.js +11 -0
- package/dist/src/runtime/request/payload-settled-evidence.d.ts +11 -0
- package/dist/src/runtime/request/payload-settled-evidence.js +29 -0
- package/dist/src/runtime/request/prepared-execution.js +2 -0
- package/dist/src/runtime/request/role-call-delegation-events.d.ts +19 -0
- package/dist/src/runtime/request/role-call-delegation-events.js +52 -0
- package/dist/src/runtime/request/role-call-return-events.d.ts +19 -0
- package/dist/src/runtime/request/role-call-return-events.js +63 -0
- package/dist/src/runtime/request/role-executor-composition.js +2 -2
- package/dist/src/runtime/request/root-capability-binding.d.ts +24 -0
- package/dist/src/runtime/request/root-capability-binding.js +57 -0
- package/dist/src/runtime/request/root-capability-catalog.d.ts +16 -0
- package/dist/src/runtime/request/root-capability-catalog.js +20 -0
- package/dist/src/runtime/request/root-contract.d.ts +11 -1
- package/dist/src/runtime/request/root-execution-kernel.js +35 -68
- package/dist/src/runtime/request/root-reference-action.d.ts +15 -0
- package/dist/src/runtime/request/root-reference-action.js +48 -0
- package/dist/src/runtime/request/root-skill-read.d.ts +13 -0
- package/dist/src/runtime/request/root-skill-read.js +102 -0
- package/dist/src/runtime/request/runner.js +10 -0
- package/dist/src/runtime/request/super-payload-context-failure.js +13 -4
- package/dist/src/runtime/request/supervisor-root-execution.js +48 -1
- package/dist/src/runtime/request/supervisor-skill-edit-target.d.ts +9 -0
- package/dist/src/runtime/request/supervisor-skill-edit-target.js +25 -0
- package/dist/src/runtime/request/supervisor-skill-payload-context.d.ts +21 -0
- package/dist/src/runtime/request/supervisor-skill-payload-context.js +91 -0
- package/dist/src/runtime/request/supervisor-skill-write-preparation.d.ts +25 -0
- package/dist/src/runtime/request/supervisor-skill-write-preparation.js +71 -0
- package/dist/src/runtime/request/worker-capability-composition.d.ts +4 -1
- package/dist/src/runtime/request/worker-capability-composition.js +4 -1
- package/dist/src/runtime/request/worker-capability-payload.d.ts +1 -1
- package/dist/src/runtime/request/worker-capability-payload.js +44 -37
- package/dist/src/runtime/runtime-environment.d.ts +2 -0
- package/dist/src/runtime/runtime-environment.js +12 -1
- package/dist/src/runtime/scheduler/contracts.d.ts +4 -0
- package/dist/src/runtime/scheduler/run-list-filter.d.ts +11 -0
- package/dist/src/runtime/scheduler/run-list-filter.js +56 -0
- package/dist/src/runtime/scheduler/run-list-query.d.ts +2 -2
- package/dist/src/runtime/scheduler/run-list-query.js +4 -1
- package/dist/src/runtime/steps/auditor-decision/contracts.d.ts +2 -0
- package/dist/src/runtime/steps/auditor-decision/evidence-representation.d.ts +2 -2
- package/dist/src/runtime/steps/auditor-decision/evidence-representation.js +2 -34
- package/dist/src/runtime/steps/auditor-decision/input.js +21 -3
- package/dist/src/runtime/steps/auditor-decision/projection.js +5 -0
- package/dist/src/runtime/steps/auditor-decision/prompt.d.ts +1 -1
- package/dist/src/runtime/steps/auditor-decision/prompt.js +14 -3
- package/dist/src/runtime/steps/capability-execution-guidance.d.ts +7 -0
- package/dist/src/runtime/steps/capability-execution-guidance.js +28 -0
- package/dist/src/runtime/steps/capability-execution-instructions.d.ts +0 -2
- package/dist/src/runtime/steps/capability-execution-instructions.js +0 -2
- package/dist/src/runtime/steps/execution-agent/capability-result-context.d.ts +5 -2
- package/dist/src/runtime/steps/execution-agent/capability-result-context.js +22 -3
- package/dist/src/runtime/steps/execution-agent/compaction.d.ts +3 -2
- package/dist/src/runtime/steps/execution-agent/compaction.js +9 -1
- package/dist/src/runtime/steps/execution-agent/direct-response-prompt.js +14 -14
- package/dist/src/runtime/steps/execution-agent/input.js +14 -2
- package/dist/src/runtime/steps/execution-agent/prompt.js +40 -38
- package/dist/src/runtime/steps/execution-agent/refinement-input.d.ts +1 -0
- package/dist/src/runtime/steps/execution-agent/refinement-prompt.js +4 -1
- package/dist/src/runtime/steps/execution-agent/response-prompt.js +1 -0
- package/dist/src/runtime/steps/execution-agent/response-run.js +1 -1
- package/dist/src/runtime/steps/execution-agent/run.js +1 -1
- package/dist/src/runtime/steps/execution-agent/state-context.js +1 -1
- package/dist/src/runtime/steps/knowledge-skill-instructions.d.ts +3 -0
- package/dist/src/runtime/steps/knowledge-skill-instructions.js +3 -0
- package/dist/src/runtime/steps/planner-decision/capability-brief.d.ts +2 -2
- package/dist/src/runtime/steps/planner-decision/capability-brief.js +5 -1
- package/dist/src/runtime/steps/planner-decision/input.d.ts +2 -2
- package/dist/src/runtime/steps/planner-decision/input.js +7 -1
- package/dist/src/runtime/steps/planner-decision/prompt.js +3 -0
- package/dist/src/runtime/steps/planner-graph/input.d.ts +2 -2
- package/dist/src/runtime/steps/planner-graph/input.js +9 -8
- package/dist/src/runtime/steps/planner-graph/prompt.js +2 -2
- package/dist/src/runtime/steps/planner-graph/run.d.ts +2 -2
- package/dist/src/runtime/steps/planner-graph/run.js +5 -5
- package/dist/src/runtime/steps/planner-graph/skill-guidance.d.ts +5 -0
- package/dist/src/runtime/steps/planner-graph/skill-guidance.js +62 -0
- package/dist/src/runtime/steps/reviewer-decision/final-evidence.d.ts +1 -0
- package/dist/src/runtime/steps/reviewer-decision/final-evidence.js +3 -1
- package/dist/src/runtime/steps/reviewer-decision/input.d.ts +3 -1
- package/dist/src/runtime/steps/reviewer-decision/input.js +2 -22
- package/dist/src/runtime/steps/reviewer-decision/model-context.d.ts +21 -0
- package/dist/src/runtime/steps/reviewer-decision/model-context.js +32 -1
- package/dist/src/runtime/steps/reviewer-decision/projection.js +4 -0
- package/dist/src/runtime/steps/reviewer-decision/prompt.d.ts +1 -1
- package/dist/src/runtime/steps/reviewer-decision/prompt.js +15 -4
- package/dist/src/runtime/steps/reviewer-decision/run.d.ts +2 -0
- package/dist/src/runtime/steps/reviewer-decision/run.js +6 -0
- package/dist/src/runtime/steps/skill-read-decision.d.ts +34 -0
- package/dist/src/runtime/steps/skill-read-decision.js +91 -0
- package/dist/src/runtime/steps/supervisor-decision/artifact-paths.d.ts +22 -0
- package/dist/src/runtime/steps/supervisor-decision/artifact-paths.js +132 -0
- package/dist/src/runtime/steps/supervisor-decision/capability-brief.d.ts +2 -0
- package/dist/src/runtime/steps/supervisor-decision/capability-brief.js +9 -2
- package/dist/src/runtime/steps/supervisor-decision/contracts.d.ts +12 -3
- package/dist/src/runtime/steps/supervisor-decision/contracts.js +3 -0
- package/dist/src/runtime/steps/supervisor-decision/decision-phases.d.ts +37 -0
- package/dist/src/runtime/steps/supervisor-decision/decision-phases.js +124 -0
- package/dist/src/runtime/steps/supervisor-decision/diagnostics.d.ts +5 -1
- package/dist/src/runtime/steps/supervisor-decision/diagnostics.js +4 -0
- package/dist/src/runtime/steps/supervisor-decision/format.d.ts +1 -0
- package/dist/src/runtime/steps/supervisor-decision/format.js +2 -0
- package/dist/src/runtime/steps/supervisor-decision/input.d.ts +7 -1
- package/dist/src/runtime/steps/supervisor-decision/input.js +30 -11
- package/dist/src/runtime/steps/supervisor-decision/parser.d.ts +1 -0
- package/dist/src/runtime/steps/supervisor-decision/parser.js +11 -0
- package/dist/src/runtime/steps/supervisor-decision/preparation-input.d.ts +26 -0
- package/dist/src/runtime/steps/supervisor-decision/preparation-input.js +39 -0
- package/dist/src/runtime/steps/supervisor-decision/preparation.d.ts +17 -0
- package/dist/src/runtime/steps/supervisor-decision/preparation.js +65 -0
- package/dist/src/runtime/steps/supervisor-decision/presentation.d.ts +13 -0
- package/dist/src/runtime/steps/supervisor-decision/presentation.js +47 -0
- package/dist/src/runtime/steps/supervisor-decision/prompt.d.ts +4 -0
- package/dist/src/runtime/steps/supervisor-decision/prompt.js +96 -109
- package/dist/src/runtime/steps/supervisor-decision/response-recommendation.d.ts +2 -0
- package/dist/src/runtime/steps/supervisor-decision/response-recommendation.js +2 -0
- package/dist/src/runtime/steps/supervisor-decision/resume.d.ts +3 -0
- package/dist/src/runtime/steps/supervisor-decision/resume.js +20 -0
- package/dist/src/runtime/steps/supervisor-decision/run.d.ts +6 -0
- package/dist/src/runtime/steps/supervisor-decision/run.js +73 -159
- package/dist/src/runtime/steps/supervisor-decision/skill-selection-input.d.ts +21 -0
- package/dist/src/runtime/steps/supervisor-decision/skill-selection-input.js +29 -0
- package/dist/src/runtime/steps/supervisor-decision/skill-selection.d.ts +16 -0
- package/dist/src/runtime/steps/supervisor-decision/skill-selection.js +44 -0
- package/dist/src/runtime/steps/supervisor-response/input.d.ts +3 -0
- package/dist/src/runtime/steps/supervisor-response/input.js +5 -0
- package/dist/src/runtime/steps/supervisor-response/prompt.js +2 -0
- package/dist/src/runtime/steps/supervisor-response/response-recommendation.d.ts +3 -0
- package/dist/src/runtime/steps/supervisor-response/response-recommendation.js +24 -4
- package/dist/src/runtime/steps/supervisor-response/run.d.ts +5 -0
- package/dist/src/runtime/steps/supervisor-skill-authoring/contract.d.ts +43 -0
- package/dist/src/runtime/steps/supervisor-skill-authoring/contract.js +85 -0
- package/dist/src/runtime/steps/supervisor-skill-authoring/input.d.ts +35 -0
- package/dist/src/runtime/steps/supervisor-skill-authoring/input.js +87 -0
- package/dist/src/runtime/steps/supervisor-skill-authoring/run.d.ts +10 -0
- package/dist/src/runtime/steps/supervisor-skill-authoring/run.js +35 -0
- package/dist/src/runtime/steps/supervisor-skill-instructions.d.ts +4 -0
- package/dist/src/runtime/steps/supervisor-skill-instructions.js +4 -0
- package/dist/src/runtime/steps/worker-capability-scope-decision.js +14 -1
- package/dist/src/runtime/steps/worker-decision/contracts.d.ts +1 -0
- package/dist/src/runtime/steps/worker-decision/input/execution-guidance.d.ts +5 -0
- package/dist/src/runtime/steps/worker-decision/input/execution-guidance.js +31 -0
- package/dist/src/runtime/steps/worker-decision/input/prompt-context.js +2 -25
- package/dist/src/runtime/steps/worker-decision/input/reference-context.js +4 -0
- package/dist/src/runtime/steps/worker-decision/prompt.js +6 -2
- package/dist/src/runtime/steps/worker-decision/result-author.js +6 -0
- package/dist/src/web-ui/app/app-bootstrap.js +3 -0
- package/dist/src/web-ui/app/app.js +6 -1
- package/dist/src/web-ui/app/components/automations/run-history-controls.js +77 -0
- package/dist/src/web-ui/app/components/automations/run-history.js +55 -0
- package/dist/src/web-ui/app/components/automations/run.js +3 -8
- package/dist/src/web-ui/app/components/automations/workspace.js +11 -2
- package/dist/src/web-ui/app/components/conversation-role-cards.js +27 -0
- package/dist/src/web-ui/app/components/conversation-role-delegations.d.ts +12 -0
- package/dist/src/web-ui/app/components/conversation-role-delegations.js +24 -0
- package/dist/src/web-ui/app/components/conversation-role-history.d.ts +13 -0
- package/dist/src/web-ui/app/components/conversation-role-history.js +81 -0
- package/dist/src/web-ui/app/components/conversation-role-returns.d.ts +12 -0
- package/dist/src/web-ui/app/components/conversation-role-returns.js +23 -0
- package/dist/src/web-ui/app/components/onboarding-workspace-access.js +1 -1
- package/dist/src/web-ui/app/components/skills/workspace.js +119 -0
- package/dist/src/web-ui/app/components/workspace-shell.js +11 -1
- package/dist/src/web-ui/app/controllers/automation-read-projection.js +8 -4
- package/dist/src/web-ui/app/controllers/automation-run-actions.js +3 -1
- package/dist/src/web-ui/app/controllers/automation-run-history.js +159 -0
- package/dist/src/web-ui/app/controllers/automations-controller.js +27 -11
- package/dist/src/web-ui/app/controllers/environment-workspace-preparation.js +6 -2
- package/dist/src/web-ui/app/controllers/realtime-event-controller.js +22 -1
- package/dist/src/web-ui/app/controllers/runtime-selection-controller.js +7 -1
- package/dist/src/web-ui/app/controllers/skills-controller.js +237 -0
- package/dist/src/web-ui/app/lib/conversation-role-model.d.ts +5 -0
- package/dist/src/web-ui/app/lib/conversation-role-model.js +63 -5
- package/dist/src/web-ui/app/lib/event-presentation.js +34 -0
- package/dist/src/web-ui/app/lib/role-delegation-event.d.ts +18 -0
- package/dist/src/web-ui/app/lib/role-delegation-event.js +47 -0
- package/dist/src/web-ui/app/lib/role-return-event.d.ts +19 -0
- package/dist/src/web-ui/app/lib/role-return-event.js +36 -0
- package/dist/src/web-ui/app/lib/tool-activity-event.js +8 -6
- package/dist/src/web-ui/app/lib/tool-skill-activity-fields.js +50 -0
- package/dist/src/web-ui/app/lib/workspace-route.js +1 -0
- package/dist/src/web-ui/app/services/runtime-web-client/automations.d.ts +9 -1
- package/dist/src/web-ui/app/services/runtime-web-client/automations.js +10 -2
- package/dist/src/web-ui/app/services/runtime-web-client/skills.js +23 -0
- package/dist/src/web-ui/app/services/runtime-web-client.js +2 -0
- package/dist/src/web-ui/app/skills-feature.js +36 -0
- package/dist/src/web-ui/app/styles/24-conversation-role-cards.css +58 -0
- package/dist/src/web-ui/app/styles/40-skills.css +34 -0
- package/dist/src/web-ui/app/styles/50-automations.css +24 -3
- package/dist/src/web-ui/app/styles/95-home-widgets.css +2 -1
- package/dist/src/web-ui/app/styles.css +1 -0
- package/dist/src/web-ui/app/ui-behavior.d.ts +1 -1
- package/dist/src/web-ui/app/ui-behavior.js +1 -0
- package/dist/src/web-ui/client-state/store.js +3 -2
- package/dist/src/web-ui/client-state/transaction-order.d.ts +2 -0
- package/dist/src/web-ui/client-state/transaction-order.js +18 -0
- package/dist/src/web-ui/local-runtime/api-router.d.ts +1 -0
- package/dist/src/web-ui/local-runtime/api-router.js +7 -0
- package/dist/src/web-ui/local-runtime/automation-routes.js +2 -1
- package/dist/src/web-ui/local-runtime/automation-run-page.d.ts +5 -0
- package/dist/src/web-ui/local-runtime/automation-run-page.js +26 -0
- package/dist/src/web-ui/local-runtime/skill-management-routes.d.ts +18 -0
- package/dist/src/web-ui/local-runtime/skill-management-routes.js +118 -0
- package/docs/configuration.md +8 -0
- package/docs/runtime-public-contracts.md +37 -0
- package/examples/request-runner.config.example.json +3 -0
- package/package.json +1 -1
- package/plugins/web/skills/web_fetch_skill/SKILL.md +1 -2
- package/plugins/web/skills/web_search_skill/SKILL.md +3 -7
- package/src/runtime/README.md +96 -1
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { escapeHtml, formatTime } from "../../lib/text-format.js";
|
|
2
|
+
|
|
3
|
+
const RUN_STATUSES = ["pending", "running", "stopping", "succeeded", "completed_with_skips", "failed", "cancelled", "interrupted", "missed"];
|
|
4
|
+
|
|
5
|
+
function renderHistoryFilters(snapshot) {
|
|
6
|
+
const filters = snapshot.runsFilters || {};
|
|
7
|
+
return `<form class="automation-run-filters" data-run-history-filters id="automation-run-history-filters">
|
|
8
|
+
<label>Status<select name="status" id="automation-run-status-filter"><option value="">All statuses</option>${RUN_STATUSES.map((status) => `<option value="${status}"${filters.status === status ? " selected" : ""}>${escapeHtml(status.replaceAll("_", " "))}</option>`).join("")}</select></label>
|
|
9
|
+
<label>Scheduled from<input type="date" name="from" id="automation-run-date-from" value="${escapeHtml(filters.from || "")}" aria-describedby="automation-run-date-help"></label>
|
|
10
|
+
<label>Through<input type="date" name="to" id="automation-run-date-to" value="${escapeHtml(filters.to || "")}" aria-describedby="automation-run-date-help"></label>
|
|
11
|
+
<button type="submit"${snapshot.runsLoading ? " disabled" : ""}>Apply</button>
|
|
12
|
+
<button type="button" data-reset-run-history${snapshot.runsLoading ? " disabled" : ""}>Newest</button>
|
|
13
|
+
<small id="automation-run-date-help">Scheduled dates in your local time.</small>
|
|
14
|
+
</form>`;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
function renderHistoryRow(run, selectedRunId) {
|
|
18
|
+
const status = run.status || "unknown";
|
|
19
|
+
return `<button type="button" data-select-run="${escapeHtml(run.id)}" data-run-id="${escapeHtml(run.id)}" aria-current="${run.id === selectedRunId}">
|
|
20
|
+
<span class="automation-run-time">${escapeHtml(formatTime(run.scheduledAt || run.startedAt || run.createdAt) || "Run")}</span>
|
|
21
|
+
<span class="automation-run-status" data-status="${escapeHtml(status)}">${escapeHtml(status.replaceAll("_", " "))}</span>
|
|
22
|
+
</button>`;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export function renderAutomationRunHistory(snapshot) {
|
|
26
|
+
const runs = Array.isArray(snapshot.runs) ? snapshot.runs : [];
|
|
27
|
+
const filtered = Object.values(snapshot.runsFilters || {}).some(Boolean);
|
|
28
|
+
const empty = snapshot.runsLoading ? "Loading runs…" : filtered ? "No runs match these filters." : "No runs yet.";
|
|
29
|
+
const canLoadMore = snapshot.runsNextCursor || snapshot.runsError;
|
|
30
|
+
return `<section class="automation-run-history" aria-labelledby="automation-run-history-heading">
|
|
31
|
+
<h4 id="automation-run-history-heading">Run history <span>${runs.length} loaded</span></h4>
|
|
32
|
+
${renderHistoryFilters(snapshot)}
|
|
33
|
+
${snapshot.runsFilterError ? `<p class="automation-run-history-error" role="alert">${escapeHtml(snapshot.runsFilterError)}</p>` : ""}
|
|
34
|
+
<div class="automation-run-choices" id="automation-run-history-list" aria-busy="${Boolean(snapshot.runsLoading)}">${runs.map((run) => renderHistoryRow(run, snapshot.selectedRunId)).join("") || `<p class="automation-muted">${empty}</p>`}</div>
|
|
35
|
+
${snapshot.selectedRunId && !runs.some((run) => run.id === snapshot.selectedRunId) ? `<p class="automation-muted">The selected report is outside these results and remains open below.</p>` : ""}
|
|
36
|
+
<div class="automation-run-history-footer">
|
|
37
|
+
<span role="status">${snapshot.runsLoading ? "Loading…" : snapshot.runsNextCursor ? "Scroll for older runs" : runs.length ? "All matching runs loaded" : ""}</span>
|
|
38
|
+
${canLoadMore ? `<button type="button" data-load-more-runs${snapshot.runsLoading ? " disabled" : ""}>${snapshot.runsError ? "Retry" : "Load more"}</button>` : ""}
|
|
39
|
+
</div>
|
|
40
|
+
${snapshot.runsError ? `<p class="automation-run-history-error" role="alert">${escapeHtml(snapshot.runsError)}</p>` : ""}
|
|
41
|
+
</section>`;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export function revealSelectedAutomationRun(root, { focus = false } = {}) {
|
|
45
|
+
const list = root.querySelector("#automation-run-history-list");
|
|
46
|
+
const selected = list?.querySelector('[aria-current="true"]');
|
|
47
|
+
if (!selected) return;
|
|
48
|
+
if (focus) selected.focus({ preventScroll: true });
|
|
49
|
+
const viewport = list.getBoundingClientRect();
|
|
50
|
+
const row = selected.getBoundingClientRect();
|
|
51
|
+
const top = viewport.top + list.clientTop;
|
|
52
|
+
const bottom = top + list.clientHeight;
|
|
53
|
+
if (row.top < top) list.scrollTop += row.top - top;
|
|
54
|
+
else if (row.bottom > bottom) list.scrollTop += row.bottom - bottom;
|
|
55
|
+
}
|
|
@@ -1,18 +1,13 @@
|
|
|
1
|
-
import { escapeHtml
|
|
1
|
+
import { escapeHtml } from "../../lib/text-format.js";
|
|
2
2
|
import { findAutomationNode, renderAutomationNodeDetails, renderAutomationTimeline } from "./timeline.js";
|
|
3
3
|
import { renderAutomationReport, renderAutomationStepEvidence } from "./run-report-view.js";
|
|
4
4
|
import { renderAutomationRunSteps } from "./run-steps-view.js";
|
|
5
|
+
import { renderAutomationRunHistory } from "./run-history.js";
|
|
5
6
|
|
|
6
7
|
function runIsActive(run) {
|
|
7
8
|
return ["running", "stopping", "pending"].includes(run?.status);
|
|
8
9
|
}
|
|
9
10
|
|
|
10
|
-
function renderRunChoices(snapshot) {
|
|
11
|
-
const runs = Array.isArray(snapshot.runs) ? snapshot.runs : [];
|
|
12
|
-
if (!runs.length) return `<p class="automation-muted">No runs yet.</p>`;
|
|
13
|
-
return `<div class="automation-run-choices" aria-label="Recent runs">${runs.map((run) => `<button type="button" data-select-run="${escapeHtml(run.id)}" aria-current="${run.id === snapshot.selectedRunId}">${escapeHtml(formatTime(run.startedAt || run.createdAt) || "Run")} · ${escapeHtml(run.status || "Unknown")}</button>`).join("")}</div>`;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
11
|
export function renderAutomationRun(snapshot, { locked = false } = {}) {
|
|
17
12
|
const run = snapshot.run;
|
|
18
13
|
const current = snapshot.automations.find((item) => item.id === snapshot.selectedAutomationId);
|
|
@@ -26,7 +21,7 @@ export function renderAutomationRun(snapshot, { locked = false } = {}) {
|
|
|
26
21
|
<div class="automation-heading"><div><button type="button" class="automation-text-button" data-action="${locked ? "return-studio" : "editor"}">← ${locked ? "ABot Studio" : "Editor"}</button><h3 dir="auto">${escapeHtml(title)}</h3><p>${run ? `Read-only run${definitionRevision ? ` · Revision ${escapeHtml(definitionRevision)}` : ""}` : "Select a saved run"}</p></div>
|
|
27
22
|
<div class="automation-actions">${!locked && run ? `<button type="button" data-action="open-chat-run">Open read-only view</button>` : ""}${runIsActive(run) && run?.status !== "stopping" ? `<button type="button" class="automation-stop" data-action="stop">Stop run</button>` : ""}${!locked && run && !runIsActive(run) && current?.status !== "archived" ? `<button type="button" data-action="rerun"${rerunDisabled ? " disabled" : ""}${runPending ? ' aria-busy="true"' : ""}>${runPending ? "Starting…" : "Run again"}</button>` : ""}</div></div>
|
|
28
23
|
<p class="automation-feedback" role="status" aria-live="polite" data-tone="${snapshot.error ? "error" : ""}">${escapeHtml(snapshot.error || snapshot.feedback || (run ? "Run details loaded." : "Open a run to see its timeline and report."))}</p>
|
|
29
|
-
${locked ? "" : `<div class="automation-tabs" role="tablist"><button type="button" role="tab" aria-selected="false" data-action="editor">Editor</button><button type="button" role="tab" aria-selected="true">Runs</button></div>${
|
|
24
|
+
${locked ? "" : `<div class="automation-tabs" role="tablist"><button type="button" role="tab" aria-selected="false" data-action="editor">Editor</button><button type="button" role="tab" aria-selected="true">Runs</button></div>${renderAutomationRunHistory(snapshot)}`}
|
|
30
25
|
${run ? `${renderAutomationReport(run)}
|
|
31
26
|
<div class="automation-run-explorer">${renderAutomationRunSteps(run, snapshot.selectedNodeId, detailId)}
|
|
32
27
|
${selectedNode ? `<section class="automation-run-detail" id="${escapeHtml(detailId)}" data-selected-step-result tabindex="-1" aria-label="Selected step result">
|
|
@@ -7,6 +7,7 @@ import { readAutomationDefinitionPatch, renderAutomationEditor, renderAutomation
|
|
|
7
7
|
import { createAutomationStepEditorDialog } from "./step-editor-dialog.js";
|
|
8
8
|
import { focusSelectedAutomationStep } from "./run-steps-view.js";
|
|
9
9
|
import { renderAutomationRun } from "./run.js";
|
|
10
|
+
import { createAutomationRunHistoryControls } from "./run-history-controls.js";
|
|
10
11
|
import { findAutomationPosition } from "../../lib/automation-graph-position.js";
|
|
11
12
|
import { canWrapAutomationSequence } from "../../lib/automation-parallel-depth.js";
|
|
12
13
|
import { createAutomationTimelineCamera } from "./timeline-camera.js";
|
|
@@ -70,6 +71,7 @@ export function createAutomationsWorkspace({
|
|
|
70
71
|
isEditing: () => Boolean(current.selectedNodeId) || stepEditor.isOpen(),
|
|
71
72
|
});
|
|
72
73
|
const liveView = createAutomationLiveView(root);
|
|
74
|
+
const runHistory = createAutomationRunHistoryControls({ root, actions });
|
|
73
75
|
|
|
74
76
|
function isDirty() { return definitionDirty || stepEditor.isDirty(); }
|
|
75
77
|
|
|
@@ -132,7 +134,9 @@ export function createAutomationsWorkspace({
|
|
|
132
134
|
const previousNodeId = renderedNodeId;
|
|
133
135
|
const viewIdentity = `${snapshot.selectedAutomationId}/${snapshot.selectedRunId || "editor"}`;
|
|
134
136
|
const sameEditor = snapshot.selectedAutomationId === current.selectedAutomationId && !snapshot.selectedRunId;
|
|
135
|
-
|
|
137
|
+
const viewChanged = !liveView.isCurrent(viewIdentity);
|
|
138
|
+
const historyHadFocus = documentRoot.activeElement?.matches?.("[data-select-run]");
|
|
139
|
+
if (viewChanged) { paletteQuery = ""; paletteSelectedTool = ""; insertion = null; detailsCollapsed = false; camera.resetState(); }
|
|
136
140
|
else camera.capture();
|
|
137
141
|
const retainedDefinition = definitionDirty && sameEditor
|
|
138
142
|
? root.querySelector("[data-automation-definition-form]") : null;
|
|
@@ -144,6 +148,7 @@ export function createAutomationsWorkspace({
|
|
|
144
148
|
: renderAutomationEditor(snapshot, { query: paletteQuery, selectedToolName: paletteSelectedTool });
|
|
145
149
|
const changed = liveView.update(viewIdentity, renderAutomationLibraryTabs(snapshot, markup, activeLibraryTab));
|
|
146
150
|
if (changed && retainedDefinition) root.querySelector("[data-automation-definition-form]")?.replaceWith(retainedDefinition);
|
|
151
|
+
runHistory.sync(snapshot, { viewChanged, focus: historyHadFocus });
|
|
147
152
|
markInsertion();
|
|
148
153
|
updateDetailsVisibility();
|
|
149
154
|
camera.restore();
|
|
@@ -314,7 +319,11 @@ export function createAutomationsWorkspace({
|
|
|
314
319
|
run: () => { if (requireSavedGraph()) return actions.startRun(); },
|
|
315
320
|
"toggle-active": () => current.automations.find((item) => item.id === current.selectedAutomationId)?.status === "active"
|
|
316
321
|
? actions.setActive(false) : openPermissionDialog("activate"),
|
|
317
|
-
"show-runs": () => {
|
|
322
|
+
"show-runs": () => {
|
|
323
|
+
if (!prepareLeave()) return;
|
|
324
|
+
const runId = current.runs[0]?.id || current.lastViewedRunId;
|
|
325
|
+
return runId ? actions.openRun(runId) : notify("No runs yet.");
|
|
326
|
+
},
|
|
318
327
|
editor: () => { if (prepareLeave()) return actions.openRoute(current.selectedAutomationId, ""); },
|
|
319
328
|
stop: () => actions.stopRun(),
|
|
320
329
|
rerun: () => current.run &&
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { createConversationTools } from "./conversation-tools.js";
|
|
2
|
+
import { createConversationRoleDelegations } from "./conversation-role-delegations.js";
|
|
3
|
+
import { createConversationRoleReturns } from "./conversation-role-returns.js";
|
|
2
4
|
|
|
3
5
|
const ROLE_INITIALS = {
|
|
4
6
|
supervisor: "S",
|
|
@@ -16,6 +18,8 @@ export function createConversationRoleCards({
|
|
|
16
18
|
const timelineRequests = new Set();
|
|
17
19
|
const timelineToggles = new Map();
|
|
18
20
|
const toolsByRequest = new Map();
|
|
21
|
+
const delegations = createConversationRoleDelegations({ documentRoot });
|
|
22
|
+
const returns = createConversationRoleReturns({ documentRoot });
|
|
19
23
|
let panelSequence = 0;
|
|
20
24
|
|
|
21
25
|
function element(tag, className, text = "") {
|
|
@@ -97,6 +101,25 @@ export function createConversationRoleCards({
|
|
|
97
101
|
}
|
|
98
102
|
content.appendChild(header);
|
|
99
103
|
const message = element("div", "conversation-role-message");
|
|
104
|
+
for (const activity of card.skillActivities || []) {
|
|
105
|
+
const skill = textElement(
|
|
106
|
+
"p",
|
|
107
|
+
"conversation-role-summary conversation-role-skill-activity",
|
|
108
|
+
activity.summary,
|
|
109
|
+
);
|
|
110
|
+
skill.dataset.tone = activity.tone;
|
|
111
|
+
message.appendChild(skill);
|
|
112
|
+
}
|
|
113
|
+
if (card.role === "supervisor") {
|
|
114
|
+
const history = delegations.createNode({
|
|
115
|
+
requestId, delegations: card.delegations || [],
|
|
116
|
+
});
|
|
117
|
+
if (history) message.appendChild(history);
|
|
118
|
+
}
|
|
119
|
+
if (card.role === "planner") {
|
|
120
|
+
const history = returns.createNode({ requestId, returns: card.returns || [] });
|
|
121
|
+
if (history) message.appendChild(history);
|
|
122
|
+
}
|
|
100
123
|
if (card.summary) {
|
|
101
124
|
const summary = element("p", "conversation-role-summary");
|
|
102
125
|
summary.append(
|
|
@@ -187,6 +210,8 @@ export function createConversationRoleCards({
|
|
|
187
210
|
}
|
|
188
211
|
|
|
189
212
|
function forget(requestId) {
|
|
213
|
+
delegations.forget(requestId);
|
|
214
|
+
returns.forget(requestId);
|
|
190
215
|
timelineRequests.delete(requestId);
|
|
191
216
|
timelineToggles.delete(requestId);
|
|
192
217
|
const tools = toolsByRequest.get(requestId);
|
|
@@ -195,6 +220,8 @@ export function createConversationRoleCards({
|
|
|
195
220
|
}
|
|
196
221
|
|
|
197
222
|
function reset() {
|
|
223
|
+
delegations.reset();
|
|
224
|
+
returns.reset();
|
|
198
225
|
timelineRequests.clear();
|
|
199
226
|
timelineToggles.clear();
|
|
200
227
|
for (const tools of toolsByRequest.values()) {
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { RoleDelegation } from "../lib/role-delegation-event.js";
|
|
2
|
+
|
|
3
|
+
export declare function createConversationRoleDelegations(options?: {
|
|
4
|
+
documentRoot?: Document;
|
|
5
|
+
}): {
|
|
6
|
+
createNode(input: {
|
|
7
|
+
requestId: string;
|
|
8
|
+
delegations?: RoleDelegation[];
|
|
9
|
+
}): HTMLElement | null;
|
|
10
|
+
forget(requestId: string): void;
|
|
11
|
+
reset(): void;
|
|
12
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { titleCaseEventValue } from "../lib/event-presentation.js";
|
|
2
|
+
import { createConversationRoleHistory } from "./conversation-role-history.js";
|
|
3
|
+
|
|
4
|
+
export function createConversationRoleDelegations({ documentRoot = document } = {}) {
|
|
5
|
+
const history = createConversationRoleHistory({
|
|
6
|
+
documentRoot,
|
|
7
|
+
kind: "delegation",
|
|
8
|
+
textClassName: "conversation-role-delegation-objective",
|
|
9
|
+
ariaLabel: "Delegated work",
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
function createNode({ requestId, delegations = [] }) {
|
|
13
|
+
return history.createNode({
|
|
14
|
+
requestId,
|
|
15
|
+
items: delegations.map((delegation) => ({
|
|
16
|
+
id: delegation.id,
|
|
17
|
+
label: `Delegated to ${titleCaseEventValue(delegation.childRole)}`,
|
|
18
|
+
text: delegation.objective,
|
|
19
|
+
})),
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
return { createNode, forget: history.forget, reset: history.reset };
|
|
24
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare function createConversationRoleHistory(options: {
|
|
2
|
+
documentRoot?: Document;
|
|
3
|
+
kind: "delegation" | "return";
|
|
4
|
+
textClassName: string;
|
|
5
|
+
ariaLabel: string;
|
|
6
|
+
}): {
|
|
7
|
+
createNode(input: {
|
|
8
|
+
requestId: string;
|
|
9
|
+
items?: { id: string; label: string; text: string }[];
|
|
10
|
+
}): HTMLElement | null;
|
|
11
|
+
forget(requestId: string): void;
|
|
12
|
+
reset(): void;
|
|
13
|
+
};
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
export function createConversationRoleHistory({
|
|
2
|
+
documentRoot = document,
|
|
3
|
+
kind,
|
|
4
|
+
textClassName,
|
|
5
|
+
ariaLabel,
|
|
6
|
+
}) {
|
|
7
|
+
const requests = new Map();
|
|
8
|
+
const prefix = `conversation-role-${kind}`;
|
|
9
|
+
|
|
10
|
+
function element(tag, className, text = "") {
|
|
11
|
+
const node = documentRoot.createElement(tag);
|
|
12
|
+
node.className = className;
|
|
13
|
+
node.textContent = text;
|
|
14
|
+
return node;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
function requestState(requestId) {
|
|
18
|
+
const existing = requests.get(requestId);
|
|
19
|
+
if (existing) return existing;
|
|
20
|
+
const state = { expanded: new Set(), nodes: new Map() };
|
|
21
|
+
requests.set(requestId, state);
|
|
22
|
+
return state;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
function isCurrentDisclosure(requestId, state, id, node) {
|
|
26
|
+
if (requests.get(requestId) !== state) return false;
|
|
27
|
+
return state.nodes.get(id) === node;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
function historyRow(requestId, state, item) {
|
|
31
|
+
const row = element("li", `${prefix}-row`);
|
|
32
|
+
const details = element("details", `conversation-role-history-item ${prefix}`);
|
|
33
|
+
details.dataset[`${kind}Id`] = item.id;
|
|
34
|
+
details.open = state.expanded.has(item.id);
|
|
35
|
+
state.nodes.set(item.id, details);
|
|
36
|
+
const summary = element("summary", `conversation-role-history-toggle ${prefix}-toggle`);
|
|
37
|
+
const label = element("span", `conversation-role-history-label ${prefix}-label`, item.label);
|
|
38
|
+
const chevron = element("span", `conversation-role-history-chevron ${prefix}-chevron`, "⌄");
|
|
39
|
+
chevron.setAttribute("aria-hidden", "true");
|
|
40
|
+
const text = element("span", `conversation-role-history-text ${textClassName}`, item.text);
|
|
41
|
+
text.setAttribute("dir", "auto");
|
|
42
|
+
summary.append(label, chevron, text);
|
|
43
|
+
details.appendChild(summary);
|
|
44
|
+
details.addEventListener("toggle", () => {
|
|
45
|
+
if (!isCurrentDisclosure(requestId, state, item.id, details)) return;
|
|
46
|
+
if (details.open) {
|
|
47
|
+
state.expanded.add(item.id);
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
state.expanded.delete(item.id);
|
|
51
|
+
});
|
|
52
|
+
row.appendChild(details);
|
|
53
|
+
return row;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
function createNode({ requestId, items = [] }) {
|
|
57
|
+
requests.get(requestId)?.nodes.clear();
|
|
58
|
+
if (items.length === 0) return null;
|
|
59
|
+
const state = requestState(requestId);
|
|
60
|
+
const identities = new Set(items.map((item) => item.id));
|
|
61
|
+
for (const id of state.expanded) {
|
|
62
|
+
if (!identities.has(id)) state.expanded.delete(id);
|
|
63
|
+
}
|
|
64
|
+
const list = element("ol", `conversation-role-history ${prefix}s`);
|
|
65
|
+
list.setAttribute("aria-label", ariaLabel);
|
|
66
|
+
for (const item of items) {
|
|
67
|
+
list.appendChild(historyRow(requestId, state, item));
|
|
68
|
+
}
|
|
69
|
+
return list;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
function forget(requestId) {
|
|
73
|
+
requests.delete(requestId);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
function reset() {
|
|
77
|
+
requests.clear();
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
return { createNode, forget, reset };
|
|
81
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { RoleReturn } from "../lib/role-return-event.js";
|
|
2
|
+
|
|
3
|
+
export declare function createConversationRoleReturns(options?: {
|
|
4
|
+
documentRoot?: Document;
|
|
5
|
+
}): {
|
|
6
|
+
createNode(input: {
|
|
7
|
+
requestId: string;
|
|
8
|
+
returns?: RoleReturn[];
|
|
9
|
+
}): HTMLElement | null;
|
|
10
|
+
forget(requestId: string): void;
|
|
11
|
+
reset(): void;
|
|
12
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { createConversationRoleHistory } from "./conversation-role-history.js";
|
|
2
|
+
|
|
3
|
+
export function createConversationRoleReturns({ documentRoot = document } = {}) {
|
|
4
|
+
const history = createConversationRoleHistory({
|
|
5
|
+
documentRoot,
|
|
6
|
+
kind: "return",
|
|
7
|
+
textClassName: "conversation-role-return-summary",
|
|
8
|
+
ariaLabel: "Planner results",
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
function createNode({ requestId, returns = [] }) {
|
|
12
|
+
return history.createNode({
|
|
13
|
+
requestId,
|
|
14
|
+
items: returns.map((receipt) => ({
|
|
15
|
+
id: receipt.id,
|
|
16
|
+
label: receipt.outcome === "failed" ? "Planner failed" : "Returned result",
|
|
17
|
+
text: receipt.summary,
|
|
18
|
+
})),
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
return { createNode, forget: history.forget, reset: history.reset };
|
|
23
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const navigation = Object.freeze({
|
|
2
2
|
home: "homeWorkspaceButton", chat: "chatWorkspaceButton", learning: "learningWorkspaceButton",
|
|
3
|
-
memory: "memoryWorkspaceButton", schedules: "schedulesWorkspaceButton", automations: "automationsWorkspaceButton", models: "modelsWorkspaceButton",
|
|
3
|
+
skills: "skillsWorkspaceButton", memory: "memoryWorkspaceButton", schedules: "schedulesWorkspaceButton", automations: "automationsWorkspaceButton", models: "modelsWorkspaceButton",
|
|
4
4
|
plugins: "pluginsWorkspaceButton", notifications: "notificationsWorkspaceButton", config: "configWorkspaceButton",
|
|
5
5
|
});
|
|
6
6
|
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import { escapeAttribute, escapeHtml } from "../../lib/text-format.js";
|
|
2
|
+
|
|
3
|
+
/** Mounts the existing shell's navigation/panel contract without growing index.html. */
|
|
4
|
+
export function mountSkillsWorkspace(dom, documentRoot = document) {
|
|
5
|
+
const button = documentRoot.createElement("button");
|
|
6
|
+
button.id = "skillsWorkspaceButton";
|
|
7
|
+
button.className = "rail-button";
|
|
8
|
+
button.type = "button";
|
|
9
|
+
button.setAttribute("aria-label", "Open Skills");
|
|
10
|
+
button.setAttribute("aria-controls", "skillsWorkspacePanel");
|
|
11
|
+
button.title = "Skills";
|
|
12
|
+
button.innerHTML = `<span class="rail-icon" aria-hidden="true"><svg viewBox="0 0 24 24"><rect x="5" y="3" width="14" height="18" rx="2" /><path d="m8 9 1 1 2-2m2 1h3m-8 6 1 1 2-2m2 1h3" /></svg></span><span class="rail-button-label">Skills</span>`;
|
|
13
|
+
dom.memoryWorkspaceButton.after(button);
|
|
14
|
+
const panel = documentRoot.createElement("section");
|
|
15
|
+
panel.id = "skillsWorkspacePanel";
|
|
16
|
+
panel.className = "workspace-page-panel skills-workspace-panel";
|
|
17
|
+
panel.hidden = true;
|
|
18
|
+
panel.inert = true;
|
|
19
|
+
panel.setAttribute("aria-hidden", "true");
|
|
20
|
+
panel.setAttribute("aria-labelledby", "skillsWorkspaceTitle");
|
|
21
|
+
panel.innerHTML = `<header class="workspace-page-header"><div class="workspace-page-heading"><p class="eyebrow">Personal guidance</p><h2 id="skillsWorkspaceTitle">Skills</h2></div><button type="button" class="workspace-page-back" data-skills-close>Back to chat</button></header><div class="workspace-page-body" data-skills-root></div>`;
|
|
22
|
+
dom.app.append(panel);
|
|
23
|
+
Object.assign(dom, { skillsWorkspaceButton: button, skillsWorkspacePanel: panel,
|
|
24
|
+
closeSkillsWorkspaceButton: panel.querySelector("[data-skills-close]"), skillsRoot: panel.querySelector("[data-skills-root]") });
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export function renderSkillRows(snapshot) {
|
|
28
|
+
const items = snapshot.items.filter((item) => item.source === "personal" && item.archived === snapshot.archived);
|
|
29
|
+
if (!items.length) return `<p class="skills-empty">${snapshot.loading ? "Loading Skills…" : snapshot.archived ? "No archived Skills." : "No personal Skills yet. Create one here or ask ABot to help."}</p>`;
|
|
30
|
+
return items.map((item) => `<button type="button" class="config-model-button skills-list-item" data-skill-id="${escapeAttribute(item.skillId)}" aria-pressed="${item.skillId === snapshot.skill?.skillId}"><strong dir="auto">${escapeHtml(item.name)}</strong><span dir="auto">${escapeHtml(item.description)}</span></button>`).join("");
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export function createSkillsWorkspace({ root, actions, confirmArchive = (message) => window.confirm(message) }) {
|
|
34
|
+
root.innerHTML = `<div class="config-dashboard skills-workspace-content"><div class="skills-toolbar"><div class="skills-filters" role="group" aria-label="Skill status"><button type="button" class="config-category-tab" data-skills-filter="active" aria-pressed="true">Active</button><button type="button" class="config-category-tab" data-skills-filter="archived" aria-pressed="false">Archived</button></div><div class="skills-toolbar-actions"><button type="button" data-skills-refresh>Refresh</button><button type="button" class="primary-button" data-skills-new>New Skill</button></div></div><p class="skills-intro">Personal Skills guide how ABot works. Built-in Skills are maintained by ABot.</p><p class="skills-feedback" role="alert" data-skills-error hidden></p><p class="skills-feedback" role="status" data-skills-message hidden></p><div class="skills-layout"><div class="skills-list" data-skills-list></div><section class="skills-detail" data-skills-detail><p class="skills-empty" data-skills-placeholder>Select a Skill to read or edit it.</p><form data-skills-form hidden><div data-skills-creation-fields hidden><h3>New Skill</h3><label class="skills-creation-label">Name<input type="text" data-skills-new-name maxlength="160" dir="auto" required disabled></label><label class="skills-creation-label">Description<textarea data-skills-new-description rows="3" maxlength="512" dir="auto" required disabled></textarea></label></div><div data-skills-saved-metadata><h3 dir="auto" data-skills-name></h3><p dir="auto" class="skills-description" data-skills-description></p><p class="skills-id">ID: <span dir="ltr" data-skills-id></span></p></div><label class="skills-content-label">Content<textarea data-skills-content rows="16" dir="auto" maxlength="65536" required></textarea></label><p class="skills-archived-note" data-skills-archived-note hidden>Archived Skills are unavailable to models. Restore this Skill to use or edit it.</p><div class="skills-editor-actions"><button class="primary-button" type="submit" data-skills-save>Save changes</button><button type="button" data-skills-cancel hidden>Cancel</button><button type="button" data-skills-reload>Reload saved</button><button type="button" data-skills-archive>Archive</button><button type="button" data-skills-restore hidden>Restore</button></div></form></section></div></div>`;
|
|
35
|
+
const find = (selector) => root.querySelector(selector);
|
|
36
|
+
const list = find("[data-skills-list]");
|
|
37
|
+
const form = find("[data-skills-form]");
|
|
38
|
+
const content = find("[data-skills-content]");
|
|
39
|
+
const nameInput = find("[data-skills-new-name]");
|
|
40
|
+
const descriptionInput = find("[data-skills-new-description]");
|
|
41
|
+
let current;
|
|
42
|
+
let listMarkup = "";
|
|
43
|
+
root.addEventListener("click", (event) => {
|
|
44
|
+
const selected = event.target.closest?.("[data-skill-id]");
|
|
45
|
+
if (selected) void actions.select(selected.dataset.skillId);
|
|
46
|
+
const filter = event.target.closest?.("[data-skills-filter]");
|
|
47
|
+
if (filter) actions.setArchived(filter.dataset.skillsFilter === "archived");
|
|
48
|
+
if (event.target.closest?.("[data-skills-new]")) actions.beginCreate();
|
|
49
|
+
if (event.target.closest?.("[data-skills-cancel]")) actions.cancelCreate();
|
|
50
|
+
if (event.target.closest?.("[data-skills-refresh]")) void actions.refresh();
|
|
51
|
+
if (event.target.closest?.("[data-skills-reload]")) void actions.reloadSelected();
|
|
52
|
+
if (event.target.closest?.("[data-skills-restore]")) void actions.restore();
|
|
53
|
+
if (event.target.closest?.("[data-skills-archive]")) {
|
|
54
|
+
const warning = current?.dirty ? " Unsaved edits will be discarded." : "";
|
|
55
|
+
if (confirmArchive(`Archive this Skill? Models will no longer discover or read it.${warning}`)) void actions.archive();
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
nameInput.addEventListener("input", () => actions.setCreationField("name", nameInput.value));
|
|
59
|
+
descriptionInput.addEventListener("input", () => actions.setCreationField("description", descriptionInput.value));
|
|
60
|
+
content.addEventListener("input", () => actions.setDraft(content.value));
|
|
61
|
+
form.addEventListener("submit", (event) => { event.preventDefault(); void actions.save(); });
|
|
62
|
+
function render(snapshot) {
|
|
63
|
+
current = snapshot;
|
|
64
|
+
const nextList = renderSkillRows(snapshot);
|
|
65
|
+
if (nextList !== listMarkup) { list.innerHTML = nextList; listMarkup = nextList; }
|
|
66
|
+
list.setAttribute("aria-busy", String(snapshot.loading));
|
|
67
|
+
for (const button of root.querySelectorAll("[data-skills-filter]")) {
|
|
68
|
+
const selected = (button.dataset.skillsFilter === "archived") === snapshot.archived;
|
|
69
|
+
button.setAttribute("aria-pressed", String(selected));
|
|
70
|
+
button.className = selected ? "config-category-tab active" : "config-category-tab";
|
|
71
|
+
button.disabled = Boolean(snapshot.mutation);
|
|
72
|
+
}
|
|
73
|
+
for (const [selector, message] of [["[data-skills-error]", snapshot.error], ["[data-skills-message]", snapshot.message]]) {
|
|
74
|
+
const element = find(selector); element.textContent = message; element.hidden = !message;
|
|
75
|
+
}
|
|
76
|
+
const skill = snapshot.skill;
|
|
77
|
+
const creating = snapshot.creating === true;
|
|
78
|
+
const editing = Boolean(skill) || creating;
|
|
79
|
+
const archived = skill?.archived === true;
|
|
80
|
+
const busy = Boolean(snapshot.mutation);
|
|
81
|
+
find("[data-skills-new]").disabled = busy;
|
|
82
|
+
const placeholder = find("[data-skills-placeholder]");
|
|
83
|
+
placeholder.hidden = editing;
|
|
84
|
+
placeholder.textContent = snapshot.reading ? "Loading Skill…" : "Select a Skill to read or edit it.";
|
|
85
|
+
form.hidden = !editing;
|
|
86
|
+
if (!editing) return;
|
|
87
|
+
find("[data-skills-creation-fields]").hidden = !creating;
|
|
88
|
+
find("[data-skills-saved-metadata]").hidden = creating;
|
|
89
|
+
nameInput.disabled = !creating || busy;
|
|
90
|
+
descriptionInput.disabled = !creating || busy;
|
|
91
|
+
if (nameInput.value !== (snapshot.name || "")) nameInput.value = snapshot.name || "";
|
|
92
|
+
if (descriptionInput.value !== (snapshot.description || "")) descriptionInput.value = snapshot.description || "";
|
|
93
|
+
find("[data-skills-name]").textContent = skill?.name || "";
|
|
94
|
+
find("[data-skills-description]").textContent = skill?.description || "";
|
|
95
|
+
find("[data-skills-id]").textContent = skill?.skillId || "";
|
|
96
|
+
if (content.value !== snapshot.draft) content.value = snapshot.draft;
|
|
97
|
+
content.readOnly = archived;
|
|
98
|
+
content.disabled = busy;
|
|
99
|
+
find("[data-skills-archived-note]").hidden = !archived;
|
|
100
|
+
find("[data-skills-save]").hidden = archived;
|
|
101
|
+
find("[data-skills-save]").disabled = cannotSave(snapshot);
|
|
102
|
+
const saveLabels = { create: "Creating…", save: "Saving…" };
|
|
103
|
+
find("[data-skills-save]").textContent = saveLabels[snapshot.mutation] || (creating ? "Create Skill" : "Save changes");
|
|
104
|
+
find("[data-skills-cancel]").hidden = !creating;
|
|
105
|
+
find("[data-skills-reload]").hidden = creating;
|
|
106
|
+
find("[data-skills-archive]").hidden = creating || archived;
|
|
107
|
+
find("[data-skills-restore]").hidden = creating || !archived;
|
|
108
|
+
for (const selector of ["[data-skills-cancel]", "[data-skills-reload]", "[data-skills-archive]", "[data-skills-restore]"])
|
|
109
|
+
find(selector).disabled = busy;
|
|
110
|
+
}
|
|
111
|
+
return { render };
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
function cannotSave(snapshot) {
|
|
115
|
+
if (snapshot.mutation || !snapshot.dirty || !snapshot.draft.trim()) return true;
|
|
116
|
+
if (!snapshot.creating) return false;
|
|
117
|
+
if (!snapshot.name.trim()) return true;
|
|
118
|
+
return !snapshot.description.trim();
|
|
119
|
+
}
|
|
@@ -74,6 +74,7 @@ export function createWorkspaceShell({
|
|
|
74
74
|
const automationsWorkspace = shellState.workspace === "automations";
|
|
75
75
|
const learningWorkspace = shellState.workspace === "learning";
|
|
76
76
|
const memoryWorkspace = shellState.workspace === "memory";
|
|
77
|
+
const skillsWorkspace = shellState.workspace === "skills";
|
|
77
78
|
const notificationsWorkspace = shellState.workspace === "notifications";
|
|
78
79
|
const sessions = sidebarLayout();
|
|
79
80
|
const showSessionsToggle = chatWorkspace && !sessions.docked;
|
|
@@ -128,6 +129,12 @@ export function createWorkspaceShell({
|
|
|
128
129
|
"aria-hidden",
|
|
129
130
|
String(!memoryWorkspace),
|
|
130
131
|
);
|
|
132
|
+
if (dom.skillsWorkspacePanel) {
|
|
133
|
+
dom.skillsWorkspacePanel.hidden = !skillsWorkspace;
|
|
134
|
+
dom.skillsWorkspacePanel.inert = !skillsWorkspace;
|
|
135
|
+
dom.skillsWorkspacePanel.setAttribute("aria-hidden", String(!skillsWorkspace));
|
|
136
|
+
}
|
|
137
|
+
setCurrentPage(dom.skillsWorkspaceButton, skillsWorkspace);
|
|
131
138
|
if (dom.notificationsWorkspacePanel) {
|
|
132
139
|
dom.notificationsWorkspacePanel.hidden = !notificationsWorkspace;
|
|
133
140
|
dom.notificationsWorkspacePanel.inert = !notificationsWorkspace;
|
|
@@ -263,6 +270,7 @@ export function createWorkspaceShell({
|
|
|
263
270
|
automations: dom.closeAutomationsWorkspaceButton,
|
|
264
271
|
learning: dom.closeLearningWorkspaceButton,
|
|
265
272
|
memory: dom.closeMemoryWorkspaceButton,
|
|
273
|
+
skills: dom.closeSkillsWorkspaceButton,
|
|
266
274
|
config: dom.closeConfigWorkspaceButton,
|
|
267
275
|
models: dom.closeConfigWorkspaceButton,
|
|
268
276
|
plugins: dom.closeConfigWorkspaceButton,
|
|
@@ -342,7 +350,7 @@ export function createWorkspaceShell({
|
|
|
342
350
|
setSessionsDrawerOpen(false, { restoreFocus: true });
|
|
343
351
|
return true;
|
|
344
352
|
}
|
|
345
|
-
if (["config", "models", "plugins", "schedules", "automations", "learning", "memory", "notifications"].includes(shellState.workspace)) {
|
|
353
|
+
if (["config", "models", "plugins", "schedules", "automations", "learning", "memory", "skills", "notifications"].includes(shellState.workspace)) {
|
|
346
354
|
return activateWorkspace("chat");
|
|
347
355
|
}
|
|
348
356
|
return false;
|
|
@@ -351,6 +359,8 @@ export function createWorkspaceShell({
|
|
|
351
359
|
function bind() {
|
|
352
360
|
if (shellState.bound) return;
|
|
353
361
|
shellState.bound = true;
|
|
362
|
+
dom.skillsWorkspaceButton?.addEventListener("click", () => activateWorkspace("skills"));
|
|
363
|
+
dom.closeSkillsWorkspaceButton?.addEventListener("click", () => activateWorkspace("chat"));
|
|
354
364
|
dom.notificationsWorkspaceButton?.addEventListener("click", () => activateWorkspace("notifications"));
|
|
355
365
|
dom.closeNotificationsWorkspaceButton?.addEventListener("click", () => activateWorkspace("chat"));
|
|
356
366
|
dom.homeWorkspaceButton?.addEventListener("click", () => {
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { automationRunPage } from "./automation-run-history.js";
|
|
2
|
+
|
|
1
3
|
export function validationResult(value) {
|
|
2
4
|
if (Array.isArray(value)) return { issues: value };
|
|
3
5
|
if (Array.isArray(value?.issues)) return value;
|
|
@@ -17,11 +19,12 @@ export async function readAutomationList(client, environmentId) {
|
|
|
17
19
|
};
|
|
18
20
|
}
|
|
19
21
|
|
|
20
|
-
export async function readAutomationSelection(client, automationId, runId, environmentId
|
|
22
|
+
export async function readAutomationSelection(client, automationId, runId, environmentId,
|
|
23
|
+
{ runsQuery = { limit: 50 } } = {}) {
|
|
21
24
|
const [draftResponse, catalog, runsResponse, runResponse] = await Promise.all([
|
|
22
25
|
client.getAutomationDraft(automationId, environmentId),
|
|
23
26
|
client.getAutomationCatalog(automationId, environmentId),
|
|
24
|
-
client.listAutomationRuns(automationId, environmentId),
|
|
27
|
+
runsQuery ? client.listAutomationRuns(automationId, environmentId, runsQuery) : Promise.resolve(null),
|
|
25
28
|
runId ? client.getAutomationRun(runId, environmentId) : Promise.resolve(null),
|
|
26
29
|
]);
|
|
27
30
|
if (runResponse?.run && runResponse.run.automationId !== automationId)
|
|
@@ -32,7 +35,7 @@ export async function readAutomationSelection(client, automationId, runId, envir
|
|
|
32
35
|
grant: draftResponse.grant || null,
|
|
33
36
|
validation: validationResult(draftResponse.validation),
|
|
34
37
|
catalog,
|
|
35
|
-
|
|
38
|
+
...(runsResponse ? automationRunPage(runsResponse) : {}),
|
|
36
39
|
run: runResponse?.run || null,
|
|
37
40
|
};
|
|
38
41
|
}
|
|
@@ -41,7 +44,8 @@ export async function readAutomationBackgroundProjection(client, identity) {
|
|
|
41
44
|
const [list, selected, evidenceResponse] = await Promise.all([
|
|
42
45
|
readAutomationList(client, identity.environmentId),
|
|
43
46
|
identity.automationId
|
|
44
|
-
? readAutomationSelection(client, identity.automationId, identity.runId, identity.environmentId
|
|
47
|
+
? readAutomationSelection(client, identity.automationId, identity.runId, identity.environmentId,
|
|
48
|
+
{ runsQuery: identity.runsQuery })
|
|
45
49
|
: Promise.resolve(null),
|
|
46
50
|
identity.runId && identity.nodeId
|
|
47
51
|
? client.getAutomationStepEvidence(identity.runId, identity.nodeId,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** Async run commands retain the view that authorized them through every read. */
|
|
2
|
-
export function createAutomationRunActions({ client, mutation, publish, loadSelected, openRun,
|
|
2
|
+
export function createAutomationRunActions({ client, mutation, publish, loadSelected, refreshRunHistory, openRun,
|
|
3
3
|
captureView }) {
|
|
4
4
|
const pendingStarts = new Set();
|
|
5
5
|
const runStartKey = (view) => JSON.stringify([view.environmentId, view.automationId]);
|
|
@@ -10,6 +10,8 @@ export function createAutomationRunActions({ client, mutation, publish, loadSele
|
|
|
10
10
|
const continuation = view.captureContinuation();
|
|
11
11
|
const refreshed = await loadSelected(view.automationId, "", continuation.isCurrent);
|
|
12
12
|
if (!refreshed || !continuation.isCurrent()) return false;
|
|
13
|
+
await refreshRunHistory(continuation.isCurrent);
|
|
14
|
+
if (!continuation.isCurrent()) return false;
|
|
13
15
|
return openRun(result.run.id, continuation.ownsMutation);
|
|
14
16
|
}
|
|
15
17
|
|