@abot-ai/runtime 1.9.0 → 2.0.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 +5 -1
- package/dist/scripts/add-runtime-model.js +11 -5
- package/dist/scripts/init-runtime.js +15 -10
- package/dist/scripts/runtime-model-addition.js +6 -1
- package/dist/scripts/runtime-setup-command-options.d.ts +11 -0
- package/dist/scripts/runtime-setup-command-options.js +41 -0
- package/dist/scripts/runtime-setup-files.d.ts +3 -2
- package/dist/scripts/runtime-setup-files.js +19 -4
- package/dist/scripts/runtime-setup-model-options.d.ts +8 -0
- package/dist/scripts/runtime-setup-model-options.js +40 -0
- package/dist/scripts/runtime-setup-presentation.js +2 -2
- package/dist/scripts/runtime-setup-provider-options.d.ts +4 -0
- package/dist/scripts/runtime-setup-provider-options.js +20 -0
- package/dist/src/model-gateway/client/contracts.d.ts +3 -0
- package/dist/src/model-gateway/client/input-token-count.js +36 -16
- package/dist/src/model-gateway/client/message-projection.d.ts +2 -0
- package/dist/src/model-gateway/client/message-projection.js +1 -0
- package/dist/src/model-gateway/client/options.js +1 -1
- package/dist/src/model-gateway/client/raw.js +1 -0
- package/dist/src/model-gateway/index.d.ts +1 -1
- package/dist/src/model-gateway/observability/input-token-count-diagnostics.d.ts +26 -0
- package/dist/src/model-gateway/observability/input-token-count-diagnostics.js +178 -0
- package/dist/src/model-gateway/policy/invocation-policy.d.ts +1 -3
- package/dist/src/model-gateway/policy/invocation-policy.js +3 -30
- package/dist/src/model-gateway/policy/reasoning-mode-budget.d.ts +5 -0
- package/dist/src/model-gateway/policy/reasoning-mode-budget.js +13 -0
- package/dist/src/model-gateway/policy/reasoning-policy.d.ts +10 -0
- package/dist/src/model-gateway/policy/reasoning-policy.js +124 -0
- package/dist/src/model-gateway/protocol/openai-embedding-response.d.ts +1 -0
- package/dist/src/model-gateway/protocol/openai-embedding-response.js +28 -0
- package/dist/src/model-gateway/protocol/sse-data.d.ts +9 -0
- package/dist/src/model-gateway/protocol/sse-data.js +67 -0
- package/dist/src/model-gateway/providers/envelope-budget.js +10 -1
- package/dist/src/model-gateway/providers/llamacpp/adapter.d.ts +2 -0
- package/dist/src/model-gateway/providers/llamacpp/adapter.js +79 -0
- package/dist/src/model-gateway/providers/llamacpp/connection.d.ts +9 -0
- package/dist/src/model-gateway/providers/llamacpp/connection.js +73 -0
- package/dist/src/model-gateway/providers/llamacpp/diagnostics.d.ts +2 -0
- package/dist/src/model-gateway/providers/llamacpp/diagnostics.js +17 -0
- package/dist/src/model-gateway/providers/llamacpp/embeddings.d.ts +2 -0
- package/dist/src/model-gateway/providers/llamacpp/embeddings.js +56 -0
- package/dist/src/model-gateway/providers/llamacpp/input-token-count.d.ts +3 -0
- package/dist/src/model-gateway/providers/llamacpp/input-token-count.js +59 -0
- package/dist/src/model-gateway/providers/llamacpp/message-projection.d.ts +2 -0
- package/dist/src/model-gateway/providers/llamacpp/message-projection.js +33 -0
- package/dist/src/model-gateway/providers/llamacpp/payload.d.ts +2 -0
- package/dist/src/model-gateway/providers/llamacpp/payload.js +44 -0
- package/dist/src/model-gateway/providers/llamacpp/response-lifetime.d.ts +1 -0
- package/dist/src/model-gateway/providers/llamacpp/response-lifetime.js +56 -0
- package/dist/src/model-gateway/providers/llamacpp/schema-format.d.ts +2 -0
- package/dist/src/model-gateway/providers/llamacpp/schema-format.js +29 -0
- package/dist/src/model-gateway/providers/llamacpp/settings.d.ts +9 -0
- package/dist/src/model-gateway/providers/llamacpp/settings.js +25 -0
- package/dist/src/model-gateway/providers/llamacpp/stream-normalizer.d.ts +10 -0
- package/dist/src/model-gateway/providers/llamacpp/stream-normalizer.js +85 -0
- package/dist/src/model-gateway/providers/llamacpp/stream.d.ts +9 -0
- package/dist/src/model-gateway/providers/llamacpp/stream.js +33 -0
- package/dist/src/model-gateway/providers/openai/embeddings.js +2 -29
- package/dist/src/model-gateway/providers/openai/sse-data.d.ts +1 -9
- package/dist/src/model-gateway/providers/openai/sse-data.js +1 -67
- package/dist/src/model-gateway/providers/registry.js +2 -0
- package/dist/src/model-gateway/server/input-token-count-handler.js +10 -1
- package/dist/src/model-gateway/types.d.ts +11 -1
- package/dist/src/runtime/adapters/long-term-memory/onboarding-provider-availability.d.ts +4 -0
- package/dist/src/runtime/adapters/long-term-memory/onboarding-provider-availability.js +11 -0
- package/dist/src/runtime/adapters/long-term-memory/onboarding-service.js +28 -1
- package/dist/src/runtime/adapters/registered-tool-payload-related-artifacts.d.ts +1 -0
- package/dist/src/runtime/adapters/registered-tool-payload-related-artifacts.js +6 -1
- package/dist/src/runtime/adapters/registered-tool-worker-capabilities/contracts.d.ts +1 -0
- package/dist/src/runtime/adapters/registered-tool-worker-capabilities/execution.d.ts +1 -0
- package/dist/src/runtime/adapters/registered-tool-worker-capabilities/execution.js +2 -0
- package/dist/src/runtime/adapters/registered-tool-worker-capabilities/payload-lifecycle.d.ts +1 -0
- package/dist/src/runtime/adapters/registered-tool-worker-capabilities/payload-lifecycle.js +2 -0
- package/dist/src/runtime/adapters/registered-tool-worker-capabilities/payload-stages.d.ts +1 -0
- package/dist/src/runtime/adapters/registered-tool-worker-capabilities/payload-stages.js +1 -0
- package/dist/src/runtime/adapters/registered-tool-worker-capabilities.js +1 -0
- package/dist/src/runtime/adapters/scheduler-runtime.js +2 -0
- package/dist/src/runtime/automations/agent-step-executor.js +1 -0
- package/dist/src/runtime/automations/catalog.d.ts +3 -0
- package/dist/src/runtime/automations/catalog.js +2 -0
- package/dist/src/runtime/automations/definition-contracts.d.ts +2 -0
- package/dist/src/runtime/automations/definition-input.js +3 -1
- package/dist/src/runtime/automations/draft-mutations.js +5 -1
- package/dist/src/runtime/automations/model-dependency-projection.d.ts +3 -1
- package/dist/src/runtime/automations/model-dependency-projection.js +4 -2
- package/dist/src/runtime/automations/publication-validation.js +7 -0
- package/dist/src/runtime/automations/saved-agent-management.js +1 -0
- package/dist/src/runtime/automations/service.d.ts +3 -0
- package/dist/src/runtime/capabilities/automation-builder/payload-schema.js +7 -5
- package/dist/src/runtime/capabilities/automations/authoring-catalog.d.ts +9 -0
- package/dist/src/runtime/capabilities/automations/authoring-catalog.js +1 -0
- package/dist/src/runtime/capabilities/automations/authoring-preparation.d.ts +3 -0
- package/dist/src/runtime/capabilities/automations/tool-contract.js +3 -2
- package/dist/src/runtime/capabilities/automations/tool-module.js +16 -7
- package/dist/src/runtime/capabilities/model-reasoning-controls.d.ts +23 -0
- package/dist/src/runtime/capabilities/model-reasoning-controls.js +56 -0
- package/dist/src/runtime/capabilities/scheduling/create-operations.js +2 -0
- package/dist/src/runtime/capabilities/scheduling/job-list-page.d.ts +1 -0
- package/dist/src/runtime/capabilities/scheduling/tool-module.js +5 -2
- package/dist/src/runtime/capabilities/scheduling/update-operations.js +2 -0
- package/dist/src/runtime/config/builders.js +6 -0
- package/dist/src/runtime/config/effective-model-config-validation.js +4 -0
- package/dist/src/runtime/config/llamacpp-profile-validation.d.ts +3 -0
- package/dist/src/runtime/config/llamacpp-profile-validation.js +15 -0
- package/dist/src/runtime/config/model-reasoning-schema.d.ts +40 -0
- package/dist/src/runtime/config/model-reasoning-schema.js +38 -0
- package/dist/src/runtime/config/model-reasoning-validation.d.ts +3 -0
- package/dist/src/runtime/config/model-reasoning-validation.js +37 -0
- package/dist/src/runtime/config/runner/step-instructions.d.ts +4 -0
- package/dist/src/runtime/config/runner/step-instructions.js +10 -6
- package/dist/src/runtime/config/schema.js +3 -0
- package/dist/src/runtime/config/validation/model-invocation-config-validation.js +14 -0
- package/dist/src/runtime/context/compacted-capability-result-receipt.d.ts +2 -0
- package/dist/src/runtime/context/compacted-capability-result-receipt.js +8 -7
- package/dist/src/runtime/context/execution-compacted-evidence.d.ts +4 -0
- package/dist/src/runtime/context/execution-compacted-evidence.js +2 -23
- package/dist/src/runtime/context/execution-compaction-checkpoint-selection.d.ts +19 -0
- package/dist/src/runtime/context/execution-compaction-checkpoint-selection.js +104 -0
- package/dist/src/runtime/context/model-step-compaction-inheritance.d.ts +12 -0
- package/dist/src/runtime/context/model-step-compaction-inheritance.js +28 -0
- package/dist/src/runtime/context/model-step-compaction-projection.d.ts +12 -0
- package/dist/src/runtime/context/model-step-compaction-projection.js +322 -0
- package/dist/src/runtime/context/model-step-compaction.d.ts +2 -1
- package/dist/src/runtime/context/model-step-compaction.js +25 -316
- package/dist/src/runtime/context/operation-supervision-compacted-evidence.js +7 -1
- package/dist/src/runtime/context/request-context.d.ts +2 -0
- package/dist/src/runtime/context/request-context.js +16 -0
- package/dist/src/runtime/context/request-tool-results-checkpoint.d.ts +2 -1
- package/dist/src/runtime/context/request-tool-results-checkpoint.js +35 -6
- package/dist/src/runtime/context/request-tool-results.js +3 -1
- package/dist/src/runtime/context/semantic-compaction/checkpoint-message.d.ts +5 -1
- package/dist/src/runtime/context/semantic-compaction/checkpoint-message.js +10 -4
- package/dist/src/runtime/context/semantic-compaction/execution-evidence-instructions.d.ts +4 -0
- package/dist/src/runtime/context/semantic-compaction/execution-evidence-instructions.js +38 -0
- package/dist/src/runtime/context/semantic-compaction/generation-contracts.d.ts +3 -1
- package/dist/src/runtime/context/semantic-compaction/generation-input.js +15 -10
- package/dist/src/runtime/context/semantic-compaction/inherited-source-digests.d.ts +8 -0
- package/dist/src/runtime/context/semantic-compaction/inherited-source-digests.js +76 -0
- package/dist/src/runtime/context/semantic-compaction/replacement-budget.js +3 -1
- package/dist/src/runtime/context/semantic-compaction/run.js +6 -12
- package/dist/src/runtime/knowledge-skills/builtins/computer-use.js +1 -1
- package/dist/src/runtime/knowledge-skills/builtins/technical-work.js +20 -2
- package/dist/src/runtime/knowledge-skills/builtins/what-can-i-do.d.ts +2 -0
- package/dist/src/runtime/knowledge-skills/builtins/what-can-i-do.js +27 -0
- package/dist/src/runtime/knowledge-skills/catalog.js +2 -0
- package/dist/src/runtime/local-application.d.ts +5 -0
- package/dist/src/runtime/local-host/app-service-dispatch.d.ts +1 -1
- package/dist/src/runtime/local-host/app-service-dispatch.js +2 -0
- package/dist/src/runtime/local-host/client-services.d.ts +5 -0
- package/dist/src/runtime/local-host/saved-approvals.js +1 -0
- package/dist/src/runtime/long-term-memory/onboarding/configuration.js +5 -7
- package/dist/src/runtime/long-term-memory/onboarding/contracts.d.ts +26 -0
- package/dist/src/runtime/long-term-memory/onboarding/embedding-profile-id.d.ts +1 -0
- package/dist/src/runtime/long-term-memory/onboarding/embedding-profile-id.js +8 -0
- package/dist/src/runtime/long-term-memory/onboarding/saved-profiles.d.ts +17 -0
- package/dist/src/runtime/long-term-memory/onboarding/saved-profiles.js +77 -0
- package/dist/src/runtime/long-term-memory/onboarding/service.js +40 -10
- package/dist/src/runtime/model/input-token-count.js +1 -0
- package/dist/src/runtime/model/invoke-step.js +12 -0
- package/dist/src/runtime/model/invoke-structured-step.d.ts +4 -1
- package/dist/src/runtime/model/invoke-structured-step.js +4 -0
- package/dist/src/runtime/model/model-catalog.d.ts +3 -0
- package/dist/src/runtime/model/model-catalog.js +2 -0
- package/dist/src/runtime/model/model-context-budget.d.ts +5 -0
- package/dist/src/runtime/model/model-context-budget.js +2 -0
- package/dist/src/runtime/model/model-step-port.d.ts +7 -0
- package/dist/src/runtime/model/optional-context-admission.d.ts +18 -0
- package/dist/src/runtime/model/optional-context-admission.js +23 -0
- package/dist/src/runtime/ports.d.ts +3 -1
- package/dist/src/runtime/projects/contracts.d.ts +6 -0
- package/dist/src/runtime/projects/registry-format.d.ts +3 -0
- package/dist/src/runtime/projects/registry-format.js +50 -0
- package/dist/src/runtime/projects/repository.d.ts +6 -3
- package/dist/src/runtime/projects/repository.js +26 -19
- package/dist/src/runtime/projects/service.js +11 -0
- package/dist/src/runtime/request/approval-wait/preflight.js +1 -0
- package/dist/src/runtime/request/approval-wait/snapshot.d.ts +1 -1
- package/dist/src/runtime/request/approval-wait/snapshot.js +1 -0
- package/dist/src/runtime/request/contracts.d.ts +5 -1
- package/dist/src/runtime/request/execution-facets.js +2 -0
- package/dist/src/runtime/request/execution-payload-artifact-policy.d.ts +3 -0
- package/dist/src/runtime/request/execution-payload-artifact-policy.js +6 -0
- package/dist/src/runtime/request/execution-payload-compacted-evidence.js +1 -0
- package/dist/src/runtime/request/execution-scope-surfaces.d.ts +2 -0
- package/dist/src/runtime/request/execution-scope-surfaces.js +3 -0
- package/dist/src/runtime/request/execution-scope.d.ts +2 -0
- package/dist/src/runtime/request/execution-scope.js +2 -0
- package/dist/src/runtime/request/input.d.ts +1 -0
- package/dist/src/runtime/request/input.js +1 -0
- package/dist/src/runtime/request/prepared-execution.d.ts +1 -0
- package/dist/src/runtime/request/prepared-execution.js +3 -0
- package/dist/src/runtime/request/reasoning-preference.d.ts +10 -0
- package/dist/src/runtime/request/reasoning-preference.js +29 -0
- package/dist/src/runtime/request/root-reference-action.js +3 -3
- package/dist/src/runtime/request/root-skill-read-admission.d.ts +4 -0
- package/dist/src/runtime/request/root-skill-read-admission.js +14 -0
- package/dist/src/runtime/request/root-skill-read.js +13 -5
- package/dist/src/runtime/request/supervisor-skill-selection-window.d.ts +16 -0
- package/dist/src/runtime/request/supervisor-skill-selection-window.js +17 -0
- package/dist/src/runtime/request/worker-capability-composition.js +2 -0
- package/dist/src/runtime/scheduler/contracts.d.ts +7 -1
- package/dist/src/runtime/scheduler/job-management.js +7 -1
- package/dist/src/runtime/scheduler/run-records.js +2 -0
- package/dist/src/runtime/scheduler/schedule-validation.js +2 -0
- package/dist/src/runtime/scheduler/scheduler-engine.js +1 -0
- package/dist/src/runtime/scheduler/snapshot-validation.js +2 -0
- package/dist/src/runtime/steps/auditor-decision/projection.js +2 -0
- package/dist/src/runtime/steps/execution-agent/capability-controls-partition.d.ts +9 -0
- package/dist/src/runtime/steps/execution-agent/capability-controls-partition.js +29 -0
- package/dist/src/runtime/steps/execution-agent/capability-scope.d.ts +17 -0
- package/dist/src/runtime/steps/execution-agent/capability-scope.js +54 -0
- package/dist/src/runtime/steps/execution-agent/compaction.js +22 -6
- package/dist/src/runtime/steps/execution-agent/controls-compacted-evidence.js +2 -0
- package/dist/src/runtime/steps/execution-agent/evidence-reuse-instructions.d.ts +6 -0
- package/dist/src/runtime/steps/execution-agent/evidence-reuse-instructions.js +13 -0
- package/dist/src/runtime/steps/execution-agent/format.js +3 -6
- package/dist/src/runtime/steps/execution-agent/input.d.ts +5 -1
- package/dist/src/runtime/steps/execution-agent/input.js +10 -36
- package/dist/src/runtime/steps/execution-agent/observation-guidance.d.ts +11 -0
- package/dist/src/runtime/steps/execution-agent/observation-guidance.js +33 -0
- package/dist/src/runtime/steps/execution-agent/prompt.js +2 -0
- package/dist/src/runtime/steps/execution-agent/refinement.d.ts +3 -2
- package/dist/src/runtime/steps/execution-agent/refinement.js +17 -6
- package/dist/src/runtime/steps/execution-agent/run.js +7 -1
- package/dist/src/runtime/steps/skill-read-decision.d.ts +1 -0
- package/dist/src/runtime/steps/skill-read-decision.js +9 -4
- package/dist/src/runtime/steps/supervisor-decision/artifact-paths.d.ts +6 -1
- package/dist/src/runtime/steps/supervisor-decision/artifact-paths.js +15 -0
- package/dist/src/runtime/steps/supervisor-decision/contracts.d.ts +1 -1
- package/dist/src/runtime/steps/supervisor-decision/contracts.js +2 -0
- package/dist/src/runtime/steps/supervisor-decision/decision-phases.d.ts +3 -0
- package/dist/src/runtime/steps/supervisor-decision/decision-phases.js +22 -3
- package/dist/src/runtime/steps/supervisor-decision/delegation-contract.d.ts +9 -0
- package/dist/src/runtime/steps/supervisor-decision/delegation-contract.js +82 -0
- package/dist/src/runtime/steps/supervisor-decision/delegation-input.d.ts +7 -0
- package/dist/src/runtime/steps/supervisor-decision/delegation-input.js +105 -0
- package/dist/src/runtime/steps/supervisor-decision/delegation-prompt.d.ts +7 -0
- package/dist/src/runtime/steps/supervisor-decision/delegation-prompt.js +13 -0
- package/dist/src/runtime/steps/supervisor-decision/input.d.ts +1 -0
- package/dist/src/runtime/steps/supervisor-decision/preparation-input.d.ts +3 -5
- package/dist/src/runtime/steps/supervisor-decision/preparation-input.js +5 -21
- package/dist/src/runtime/steps/supervisor-decision/preparation.d.ts +4 -1
- package/dist/src/runtime/steps/supervisor-decision/preparation.js +58 -6
- package/dist/src/runtime/steps/supervisor-decision/procedure-entry.d.ts +22 -0
- package/dist/src/runtime/steps/supervisor-decision/procedure-entry.js +61 -0
- package/dist/src/runtime/steps/supervisor-decision/procedure-gate.d.ts +39 -0
- package/dist/src/runtime/steps/supervisor-decision/procedure-gate.js +146 -0
- package/dist/src/runtime/steps/supervisor-decision/procedure-memory.d.ts +9 -0
- package/dist/src/runtime/steps/supervisor-decision/procedure-memory.js +100 -0
- package/dist/src/runtime/steps/supervisor-decision/procedure-recall.d.ts +10 -0
- package/dist/src/runtime/steps/supervisor-decision/procedure-recall.js +52 -0
- package/dist/src/runtime/steps/supervisor-decision/prompt.js +3 -16
- package/dist/src/runtime/steps/supervisor-decision/response-recommendation.js +2 -2
- package/dist/src/runtime/steps/supervisor-decision/role-guidance.d.ts +3 -0
- package/dist/src/runtime/steps/supervisor-decision/role-guidance.js +20 -0
- package/dist/src/runtime/steps/supervisor-decision/run.js +50 -7
- package/dist/src/runtime/steps/supervisor-decision/skill-read-state.d.ts +10 -0
- package/dist/src/runtime/steps/supervisor-decision/skill-read-state.js +45 -0
- package/dist/src/runtime/steps/supervisor-decision/skill-selection-candidates.d.ts +15 -0
- package/dist/src/runtime/steps/supervisor-decision/skill-selection-candidates.js +25 -0
- package/dist/src/runtime/steps/supervisor-decision/skill-selection-catalog.d.ts +3 -0
- package/dist/src/runtime/steps/supervisor-decision/skill-selection-catalog.js +15 -0
- package/dist/src/runtime/steps/supervisor-decision/skill-selection-continuation.d.ts +10 -0
- package/dist/src/runtime/steps/supervisor-decision/skill-selection-continuation.js +65 -0
- package/dist/src/runtime/steps/supervisor-decision/skill-selection-input.d.ts +3 -1
- package/dist/src/runtime/steps/supervisor-decision/skill-selection-input.js +20 -22
- package/dist/src/runtime/steps/supervisor-decision/skill-selection.d.ts +3 -2
- package/dist/src/runtime/steps/supervisor-decision/skill-selection.js +62 -15
- package/dist/src/runtime/steps/supervisor-response/prompt.js +18 -4
- package/dist/src/shared/model-reasoning-modes.d.ts +5 -0
- package/dist/src/shared/model-reasoning-modes.js +20 -0
- package/dist/src/shared/model-reasoning-schema.d.ts +38 -0
- package/dist/src/shared/model-reasoning-schema.js +29 -0
- package/dist/src/shared/model-reasoning.d.ts +35 -0
- package/dist/src/shared/model-reasoning.js +100 -0
- package/dist/src/web-ui/app/ARCHITECTURE.md +13 -0
- package/dist/src/web-ui/app/app-bootstrap.js +9 -12
- package/dist/src/web-ui/app/app-dom.js +6 -1
- package/dist/src/web-ui/app/app-state.js +1 -0
- package/dist/src/web-ui/app/app.js +8 -3
- package/dist/src/web-ui/app/appearance-feature.js +28 -0
- package/dist/src/web-ui/app/automations-feature.js +20 -11
- package/dist/src/web-ui/app/components/appearance-dialog.js +79 -0
- package/dist/src/web-ui/app/components/automations/archive-actions.js +5 -3
- package/dist/src/web-ui/app/components/automations/authoring-entry.js +26 -7
- package/dist/src/web-ui/app/components/automations/confirmation-actions.js +78 -0
- package/dist/src/web-ui/app/components/automations/draft-recovery-actions.js +1 -0
- package/dist/src/web-ui/app/components/automations/node-inspector.js +5 -1
- package/dist/src/web-ui/app/components/automations/step-editor-dialog.js +4 -2
- package/dist/src/web-ui/app/components/automations/timeline.js +2 -2
- package/dist/src/web-ui/app/components/automations/workspace-navigation.js +37 -0
- package/dist/src/web-ui/app/components/automations/workspace.js +31 -46
- package/dist/src/web-ui/app/components/config-workspace/config-model.js +6 -0
- package/dist/src/web-ui/app/components/config-workspace/model-removal.js +4 -2
- package/dist/src/web-ui/app/components/config-workspace/model-rendering.js +8 -16
- package/dist/src/web-ui/app/components/config-workspace/reasoning-budget-edit.js +113 -0
- package/dist/src/web-ui/app/components/config-workspace/reasoning-budget.d.ts +16 -0
- package/dist/src/web-ui/app/components/config-workspace/reasoning-budget.js +67 -0
- package/dist/src/web-ui/app/components/config-workspace/reasoning-mode-budgets.d.ts +7 -0
- package/dist/src/web-ui/app/components/config-workspace/reasoning-mode-budgets.js +25 -0
- package/dist/src/web-ui/app/components/config-workspace/workspace-events.js +15 -7
- package/dist/src/web-ui/app/components/config-workspace/workspace-mutations.js +32 -12
- package/dist/src/web-ui/app/components/config-workspace/workspace-persistence.js +1 -1
- package/dist/src/web-ui/app/components/config-workspace.js +2 -1
- package/dist/src/web-ui/app/components/confirmation-dialog.js +88 -0
- package/dist/src/web-ui/app/components/conversation-activity.d.ts +2 -0
- package/dist/src/web-ui/app/components/conversation-activity.js +32 -3
- package/dist/src/web-ui/app/components/conversation-memory-activity.js +31 -0
- package/dist/src/web-ui/app/components/conversation-role-cards.d.ts +2 -0
- package/dist/src/web-ui/app/components/conversation-role-cards.js +14 -11
- package/dist/src/web-ui/app/components/conversation-skill-activity.js +67 -0
- package/dist/src/web-ui/app/components/conversation-tools.js +5 -5
- package/dist/src/web-ui/app/components/conversation-view.js +6 -0
- package/dist/src/web-ui/app/components/dashboard/approvals.js +13 -1
- package/dist/src/web-ui/app/components/long-term-memory/embedding-connection-dialog.d.ts +38 -0
- package/dist/src/web-ui/app/components/long-term-memory/embedding-connection-dialog.js +289 -0
- package/dist/src/web-ui/app/components/long-term-memory/embedding-connection-feature.js +75 -0
- package/dist/src/web-ui/app/components/long-term-memory/embedding-connection-rendering.js +31 -0
- package/dist/src/web-ui/app/components/long-term-memory/manager.js +15 -5
- package/dist/src/web-ui/app/components/long-term-memory/saved-embedding-profiles.js +114 -0
- package/dist/src/web-ui/app/components/long-term-memory/setup-rendering.js +55 -0
- package/dist/src/web-ui/app/components/long-term-memory-setup.js +141 -76
- package/dist/src/web-ui/app/components/model-setup/rendering.js +3 -2
- package/dist/src/web-ui/app/components/model-setup/validation.js +6 -2
- package/dist/src/web-ui/app/components/model-setup/wizard.d.ts +1 -0
- package/dist/src/web-ui/app/components/model-setup/wizard.js +28 -5
- package/dist/src/web-ui/app/components/passive-learning/memory.js +12 -5
- package/dist/src/web-ui/app/components/plugins/manager.js +14 -0
- package/dist/src/web-ui/app/components/plugins/removal.js +10 -2
- package/dist/src/web-ui/app/components/project-group-actions.js +35 -0
- package/dist/src/web-ui/app/components/project-session-groups.js +17 -31
- package/dist/src/web-ui/app/components/runtime-setup/commands.js +1 -1
- package/dist/src/web-ui/app/components/runtime-setup/connection-form.d.ts +15 -0
- package/dist/src/web-ui/app/components/runtime-setup/connection-form.js +32 -9
- package/dist/src/web-ui/app/components/runtime-setup/connection-input.js +23 -0
- package/dist/src/web-ui/app/components/runtime-setup/connection-inspection.js +57 -0
- package/dist/src/web-ui/app/components/runtime-setup/connection-state.js +18 -4
- package/dist/src/web-ui/app/components/runtime-setup/embedding-credential-status.js +3 -0
- package/dist/src/web-ui/app/components/runtime-setup/embedding-provider-options.js +54 -0
- package/dist/src/web-ui/app/components/runtime-setup/embedding-provider-receipt.js +3 -0
- package/dist/src/web-ui/app/components/runtime-setup/embedding-rendering.js +22 -22
- package/dist/src/web-ui/app/components/runtime-setup/embedding.js +60 -16
- package/dist/src/web-ui/app/components/runtime-setup/reasoning-fields.d.ts +17 -0
- package/dist/src/web-ui/app/components/runtime-setup/reasoning-fields.js +54 -0
- package/dist/src/web-ui/app/components/runtime-setup/validation.js +5 -1
- package/dist/src/web-ui/app/components/runtime-setup-guide.d.ts +9 -3
- package/dist/src/web-ui/app/components/runtime-setup-guide.js +20 -29
- package/dist/src/web-ui/app/components/schedules/details.js +2 -2
- package/dist/src/web-ui/app/components/schedules/form.js +12 -5
- package/dist/src/web-ui/app/components/schedules/workspace.js +30 -18
- package/dist/src/web-ui/app/components/session-list-viewport.js +49 -0
- package/dist/src/web-ui/app/components/session-search-disclosure.js +27 -0
- package/dist/src/web-ui/app/components/skills/workspace.js +7 -3
- package/dist/src/web-ui/app/components/spark-chat/panel.js +7 -3
- package/dist/src/web-ui/app/components/spark-chat/settings.js +57 -15
- package/dist/src/web-ui/app/components/tool-approval-card.d.ts +2 -1
- package/dist/src/web-ui/app/components/tool-approval-card.js +10 -2
- package/dist/src/web-ui/app/components/tool-approval-rejection-input.js +116 -0
- package/dist/src/web-ui/app/components/workspace-shell.js +30 -38
- package/dist/src/web-ui/app/components/workspace-transitions.js +42 -0
- package/dist/src/web-ui/app/configuration-feature.js +34 -4
- package/dist/src/web-ui/app/controllers/app-event-bindings.js +45 -29
- package/dist/src/web-ui/app/controllers/appearance-controller.js +105 -0
- package/dist/src/web-ui/app/controllers/automations-controller.js +9 -1
- package/dist/src/web-ui/app/controllers/composer-feature.d.ts +1 -1
- package/dist/src/web-ui/app/controllers/composer-feature.js +10 -3
- package/dist/src/web-ui/app/controllers/composer-queue-controller.d.ts +1 -1
- package/dist/src/web-ui/app/controllers/composer-queue-controller.js +9 -3
- package/dist/src/web-ui/app/controllers/composer-submission-lifecycle.d.ts +1 -1
- package/dist/src/web-ui/app/controllers/conversation-workspace-activation.js +8 -2
- package/dist/src/web-ui/app/controllers/dashboard-approvals-controller.js +10 -9
- package/dist/src/web-ui/app/controllers/environment-transition.js +2 -2
- package/dist/src/web-ui/app/controllers/environment-workspace-preparation.js +9 -7
- package/dist/src/web-ui/app/controllers/preference-view-sync.js +35 -0
- package/dist/src/web-ui/app/controllers/projects-controller.d.ts +4 -0
- package/dist/src/web-ui/app/controllers/projects-controller.js +64 -3
- package/dist/src/web-ui/app/controllers/reasoning-budget-controller.d.ts +17 -0
- package/dist/src/web-ui/app/controllers/reasoning-budget-controller.js +80 -0
- package/dist/src/web-ui/app/controllers/reasoning-budget-menu-events.js +45 -0
- package/dist/src/web-ui/app/controllers/reasoning-mode-controller.js +35 -40
- package/dist/src/web-ui/app/controllers/runtime-selection-controller.d.ts +6 -1
- package/dist/src/web-ui/app/controllers/runtime-selection-controller.js +16 -3
- package/dist/src/web-ui/app/controllers/session-controller.js +34 -9
- package/dist/src/web-ui/app/controllers/session-sidebar-controller.js +4 -3
- package/dist/src/web-ui/app/controllers/skills-controller.js +33 -16
- package/dist/src/web-ui/app/controllers/spark-chat-sync.js +1 -1
- package/dist/src/web-ui/app/controllers/spark-handoff-navigation.js +7 -1
- package/dist/src/web-ui/app/controllers/tool-approval-controller.d.ts +2 -1
- package/dist/src/web-ui/app/controllers/tool-approval-controller.js +36 -3
- package/dist/src/web-ui/app/controllers/workspace-conversation-opener.js +8 -2
- package/dist/src/web-ui/app/controllers/workspace-route-controller.js +41 -10
- package/dist/src/web-ui/app/index.html +38 -32
- package/dist/src/web-ui/app/lib/color-palettes.d.ts +17 -0
- package/dist/src/web-ui/app/lib/color-palettes.js +20 -0
- package/dist/src/web-ui/app/lib/memory-activity-model.d.ts +12 -0
- package/dist/src/web-ui/app/lib/memory-activity-model.js +61 -0
- package/dist/src/web-ui/app/lib/navigation-display.d.ts +8 -0
- package/dist/src/web-ui/app/lib/navigation-display.js +12 -0
- package/dist/src/web-ui/app/lib/reasoning-controls.js +47 -6
- package/dist/src/web-ui/app/lib/reasoning-preference.d.ts +9 -0
- package/dist/src/web-ui/app/lib/reasoning-preference.js +75 -0
- package/dist/src/web-ui/app/lib/session-composer-queue.d.ts +4 -0
- package/dist/src/web-ui/app/lib/session-composer-queue.js +4 -0
- package/dist/src/web-ui/app/lib/session-project-groups.js +28 -0
- package/dist/src/web-ui/app/lib/session-sidebar-order.js +7 -5
- package/dist/src/web-ui/app/lib/tool-activity-event.d.ts +1 -0
- package/dist/src/web-ui/app/lib/tool-activity-event.js +1 -0
- package/dist/src/web-ui/app/lib/tool-activity-model.d.ts +1 -0
- package/dist/src/web-ui/app/lib/tool-activity-model.js +1 -0
- package/dist/src/web-ui/app/lib/tool-approval-rejection-drafts.js +45 -0
- package/dist/src/web-ui/app/lib/tool-skill-activity-fields.js +1 -1
- package/dist/src/web-ui/app/notifications-feature.js +10 -2
- package/dist/src/web-ui/app/passive-learning-feature.js +2 -2
- package/dist/src/web-ui/app/projects-feature.js +40 -10
- package/dist/src/web-ui/app/runtime-onboarding-feature.js +1 -0
- package/dist/src/web-ui/app/schedules-feature.js +28 -5
- package/dist/src/web-ui/app/services/client-preferences.d.ts +4 -1
- package/dist/src/web-ui/app/services/client-preferences.js +2 -0
- package/dist/src/web-ui/app/services/conversation-reasoning-preferences.d.ts +11 -0
- package/dist/src/web-ui/app/services/conversation-reasoning-preferences.js +30 -0
- package/dist/src/web-ui/app/services/runtime-web-client/automations.js +6 -4
- package/dist/src/web-ui/app/services/runtime-web-client/configuration.js +5 -0
- package/dist/src/web-ui/app/services/runtime-web-client/memory.js +21 -0
- package/dist/src/web-ui/app/services/runtime-web-client/projects.d.ts +2 -1
- package/dist/src/web-ui/app/services/runtime-web-client/projects.js +4 -0
- package/dist/src/web-ui/app/services/runtime-web-client/tool-approvals.js +2 -0
- package/dist/src/web-ui/app/services/runtime-web-client.d.ts +16 -0
- package/dist/src/web-ui/app/services/runtime-web-client.js +2 -0
- package/dist/src/web-ui/app/services/session-sidebar-preferences.js +33 -13
- package/dist/src/web-ui/app/skills-feature.js +2 -3
- package/dist/src/web-ui/app/spark-chat-conversation.js +29 -3
- package/dist/src/web-ui/app/spark-chat-feature.js +13 -7
- package/dist/src/web-ui/app/styles/01-color-palettes.css +90 -0
- package/dist/src/web-ui/app/styles/11-product-links.css +6 -2
- package/dist/src/web-ui/app/styles/11-workspace-header-width.css +37 -25
- package/dist/src/web-ui/app/styles/12-conversation-sidebar.css +56 -22
- package/dist/src/web-ui/app/styles/13-projects.css +56 -19
- package/dist/src/web-ui/app/styles/19-runtime-setup.css +16 -0
- package/dist/src/web-ui/app/styles/22-reasoning-budget.css +39 -0
- package/dist/src/web-ui/app/styles/27-conversation-memory.css +45 -0
- package/dist/src/web-ui/app/styles/27-conversation-skills.css +96 -0
- package/dist/src/web-ui/app/styles/28-tool-approval-card.css +38 -1
- package/dist/src/web-ui/app/styles/35-embedding-profiles.css +159 -0
- package/dist/src/web-ui/app/styles/54-spark-chat.css +62 -46
- package/dist/src/web-ui/app/styles/65-appearance.css +60 -0
- package/dist/src/web-ui/app/styles/66-navigation-display.css +30 -0
- package/dist/src/web-ui/app/styles/67-confirmation-dialog.css +32 -0
- package/dist/src/web-ui/app/styles.css +8 -0
- package/dist/src/web-ui/client-state/preference-shapes.js +6 -1
- package/dist/src/web-ui/client-state/preferences.js +8 -2
- package/dist/src/web-ui/client-state/reasoning-preference-shape.d.ts +1 -0
- package/dist/src/web-ui/client-state/reasoning-preference-shape.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 +11 -0
- package/dist/src/web-ui/local-runtime/memory-embedding-connection-input.d.ts +7 -0
- package/dist/src/web-ui/local-runtime/memory-embedding-connection-input.js +22 -0
- package/dist/src/web-ui/local-runtime/memory-embedding-connection-service.d.ts +20 -0
- package/dist/src/web-ui/local-runtime/memory-embedding-connection-service.js +47 -0
- package/dist/src/web-ui/local-runtime/memory-onboarding-routes.js +32 -0
- package/dist/src/web-ui/local-runtime/model-connection-inspection.d.ts +7 -0
- package/dist/src/web-ui/local-runtime/model-connection-inspection.js +48 -0
- package/dist/src/web-ui/local-runtime/model-setup-catalog.d.ts +2 -1
- package/dist/src/web-ui/local-runtime/model-setup-catalog.js +3 -1
- package/dist/src/web-ui/local-runtime/model-setup-identity.js +1 -1
- package/dist/src/web-ui/local-runtime/model-setup-input.d.ts +5 -2
- package/dist/src/web-ui/local-runtime/model-setup-input.js +29 -6
- package/dist/src/web-ui/local-runtime/model-setup-provider.d.ts +1 -1
- package/dist/src/web-ui/local-runtime/model-setup-provider.js +9 -6
- package/dist/src/web-ui/local-runtime/model-setup-retry.js +4 -1
- package/dist/src/web-ui/local-runtime/model-setup-service.d.ts +2 -1
- package/dist/src/web-ui/local-runtime/pending-tool-approvals.js +4 -1
- package/dist/src/web-ui/local-runtime/project-routes.js +10 -2
- package/dist/src/web-ui/local-runtime/request-execution.js +1 -0
- package/dist/src/web-ui/local-runtime/runtime-setup-auth.d.ts +2 -0
- package/dist/src/web-ui/local-runtime/runtime-setup-auth.js +20 -0
- package/dist/src/web-ui/local-runtime/runtime-setup-connection-edit.js +3 -2
- package/dist/src/web-ui/local-runtime/runtime-setup-credential-completion.js +6 -1
- package/dist/src/web-ui/local-runtime/runtime-setup-input.d.ts +3 -2
- package/dist/src/web-ui/local-runtime/runtime-setup-input.js +17 -5
- package/dist/src/web-ui/local-runtime/runtime-setup-provider.d.ts +4 -1
- package/dist/src/web-ui/local-runtime/runtime-setup-provider.js +6 -2
- package/dist/src/web-ui/local-runtime/runtime-setup-routes.d.ts +11 -2
- package/dist/src/web-ui/local-runtime/runtime-setup-routes.js +11 -2
- package/dist/src/web-ui/local-runtime/runtime-setup-scaffold.js +3 -2
- package/dist/src/web-ui/local-runtime/runtime-setup-service.d.ts +25 -4
- package/dist/src/web-ui/local-runtime/runtime-setup-service.js +19 -9
- package/dist/src/web-ui/local-runtime/setup-embedding-input.d.ts +3 -1
- package/dist/src/web-ui/local-runtime/setup-embedding-input.js +38 -6
- package/dist/src/web-ui/local-runtime/setup-embedding-llamacpp.d.ts +11 -0
- package/dist/src/web-ui/local-runtime/setup-embedding-llamacpp.js +53 -0
- package/dist/src/web-ui/local-runtime/setup-embedding-provider.js +23 -9
- package/dist/src/web-ui/local-runtime/setup-embedding-routes.d.ts +7 -2
- package/dist/src/web-ui/local-runtime/setup-embedding-routes.js +5 -3
- package/dist/src/web-ui/local-runtime/setup-embedding-service.d.ts +1 -0
- package/docs/configuration.md +10 -8
- package/docs/installation.md +11 -5
- package/docs/llamacpp.md +248 -0
- package/docs/long-term-memory.md +12 -0
- package/docs/running-locally.md +7 -1
- package/package.json +2 -1
- package/plugins/project-orientation/source/index.ts +2 -3
- package/plugins/project-orientation/source/inspection-failure.ts +1 -1
- package/plugins/project-orientation/source/project-target.ts +29 -0
- package/plugins/project-orientation/src/index.cjs +21 -2
- package/runtime.config.schema.json +140 -0
- package/src/runtime/README.md +50 -4
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import { buildRemovedEmbeddingProfile, buildSavedEmbeddingProfile } from "./saved-profiles.js";
|
|
1
2
|
import { buildModelConfig } from "../../config/builders.js";
|
|
2
3
|
import { validateRuntimeConfigFile } from "../../config/validation.js";
|
|
3
|
-
import { buildDisabledMemoryConfig, buildEnabledMemoryConfig,
|
|
4
|
-
|
|
4
|
+
import { buildDisabledMemoryConfig, buildEnabledMemoryConfig, projectOnboardingStatus, requireConfiguredProvider, } from "./configuration.js";
|
|
5
|
+
import { readEmbeddingProfileId } from "./embedding-profile-id.js";
|
|
5
6
|
export function createLongTermMemoryOnboardingService(dependencies) {
|
|
6
7
|
return Object.freeze({
|
|
7
8
|
async status() {
|
|
@@ -24,7 +25,7 @@ export function createLongTermMemoryOnboardingService(dependencies) {
|
|
|
24
25
|
const snapshot = await dependencies.repository.read();
|
|
25
26
|
const providerId = requireText(input.providerId, "providerId");
|
|
26
27
|
const model = requireText(input.model, "model");
|
|
27
|
-
const profileId =
|
|
28
|
+
const profileId = readEmbeddingProfileId(input.profileId);
|
|
28
29
|
const abortSignal = input.abortSignal ?? new AbortController().signal;
|
|
29
30
|
abortSignal.throwIfAborted();
|
|
30
31
|
requireConfiguredProvider(snapshot.config, providerId);
|
|
@@ -51,6 +52,42 @@ export function createLongTermMemoryOnboardingService(dependencies) {
|
|
|
51
52
|
probe: Object.freeze({ ...probe }),
|
|
52
53
|
});
|
|
53
54
|
},
|
|
55
|
+
async saveProfile(input) {
|
|
56
|
+
const snapshot = await dependencies.repository.read();
|
|
57
|
+
const providerId = requireText(input.providerId, "providerId");
|
|
58
|
+
const model = requireText(input.model, "model");
|
|
59
|
+
const label = requireText(input.label, "profile_label");
|
|
60
|
+
const abortSignal = input.abortSignal ?? new AbortController().signal;
|
|
61
|
+
abortSignal.throwIfAborted();
|
|
62
|
+
requireConfiguredProvider(snapshot.config, providerId);
|
|
63
|
+
const candidate = buildSavedEmbeddingProfile({ config: snapshot.config, providerId, model, label });
|
|
64
|
+
validateRuntimeConfigFile(candidate.config, snapshot.path);
|
|
65
|
+
abortSignal.throwIfAborted();
|
|
66
|
+
const persisted = await dependencies.repository.write(candidate.config, snapshot.config);
|
|
67
|
+
return Object.freeze({
|
|
68
|
+
status: projectOnboardingStatus(candidate.config),
|
|
69
|
+
profileId: candidate.profileId,
|
|
70
|
+
configPath: persisted.configPath,
|
|
71
|
+
...(persisted.backupPath ? { backupPath: persisted.backupPath } : {}),
|
|
72
|
+
});
|
|
73
|
+
},
|
|
74
|
+
async removeProfile(input) {
|
|
75
|
+
const snapshot = await dependencies.repository.read();
|
|
76
|
+
const profileId = requireText(input.profileId, "profileId");
|
|
77
|
+
const abortSignal = input.abortSignal ?? new AbortController().signal;
|
|
78
|
+
abortSignal.throwIfAborted();
|
|
79
|
+
const candidate = buildRemovedEmbeddingProfile(snapshot.config, profileId);
|
|
80
|
+
validateRuntimeConfigFile(candidate, snapshot.path);
|
|
81
|
+
abortSignal.throwIfAborted();
|
|
82
|
+
const persisted = await dependencies.repository.write(candidate, snapshot.config);
|
|
83
|
+
return Object.freeze({
|
|
84
|
+
removed: true,
|
|
85
|
+
status: projectOnboardingStatus(candidate),
|
|
86
|
+
profileId,
|
|
87
|
+
configPath: persisted.configPath,
|
|
88
|
+
...(persisted.backupPath ? { backupPath: persisted.backupPath } : {}),
|
|
89
|
+
});
|
|
90
|
+
},
|
|
54
91
|
async disable() {
|
|
55
92
|
const snapshot = await dependencies.repository.read();
|
|
56
93
|
const candidate = buildDisabledMemoryConfig(snapshot.config);
|
|
@@ -72,13 +109,6 @@ function requireModelPolicy(config, configPath) {
|
|
|
72
109
|
}
|
|
73
110
|
return modelPolicy;
|
|
74
111
|
}
|
|
75
|
-
function readProfileId(value) {
|
|
76
|
-
const profileId = value?.trim() || DEFAULT_MEMORY_EMBEDDING_PROFILE_ID;
|
|
77
|
-
if (!PROFILE_ID_PATTERN.test(profileId)) {
|
|
78
|
-
throw new Error("long_term_memory_embedding_profile_id_invalid");
|
|
79
|
-
}
|
|
80
|
-
return profileId;
|
|
81
|
-
}
|
|
82
112
|
function requireText(value, field) {
|
|
83
113
|
const normalized = value.trim();
|
|
84
114
|
if (!normalized) {
|
|
@@ -11,6 +11,7 @@ export async function countModelInputTokens(params) {
|
|
|
11
11
|
messages: params.messages,
|
|
12
12
|
agentMode: params.request.agentMode,
|
|
13
13
|
modelStep: params.modelStep,
|
|
14
|
+
...(params.request.reasoningPreference ? { reasoningPreference: params.request.reasoningPreference } : {}),
|
|
14
15
|
...(params.request.modelPreference
|
|
15
16
|
? { modelPreference: params.request.modelPreference }
|
|
16
17
|
: {}),
|
|
@@ -7,6 +7,7 @@ import { appendRequestSteeringContext } from "../request/request-steering-contex
|
|
|
7
7
|
import { createModelStepAbort } from "../steps/model-step-timeout.js";
|
|
8
8
|
import { acceptModelStepOutput } from "./model-step-acceptance.js";
|
|
9
9
|
import { createModelContextAssessment } from "./model-context-assessment.js";
|
|
10
|
+
import { admitOptionalModelContext } from "./optional-context-admission.js";
|
|
10
11
|
import { invokeModelProvider, projectModelProviderFailureDiagnostics, } from "./provider-failure.js";
|
|
11
12
|
import { isModelStepCompactionEligible, resolveModelContextAdmission, } from "./model-context-budget.js";
|
|
12
13
|
import { resolveModelStepTimeout, } from "./model-step-timeout-policy.js";
|
|
@@ -155,6 +156,7 @@ class ModelStepInvocation {
|
|
|
155
156
|
runnerConfig: request.runnerConfig,
|
|
156
157
|
modelStep: params.modelStep,
|
|
157
158
|
messages: params.messages,
|
|
159
|
+
configuredInstructionPolicy: params.configuredInstructionPolicy,
|
|
158
160
|
});
|
|
159
161
|
const compactionTriggerEligible = isModelStepCompactionEligible(params);
|
|
160
162
|
const contextCompaction = compactionTriggerEligible
|
|
@@ -171,6 +173,7 @@ class ModelStepInvocation {
|
|
|
171
173
|
runnerConfig: request.runnerConfig,
|
|
172
174
|
agentMode: request.agentMode,
|
|
173
175
|
modelStep: params.modelStep,
|
|
176
|
+
...(request.reasoningPreference ? { reasoningPreference: request.reasoningPreference } : {}),
|
|
174
177
|
...(request.modelPreference
|
|
175
178
|
? { modelPreference: request.modelPreference }
|
|
176
179
|
: {}),
|
|
@@ -184,6 +187,14 @@ class ModelStepInvocation {
|
|
|
184
187
|
assertCurrent,
|
|
185
188
|
});
|
|
186
189
|
let assessment = await assess(messages);
|
|
190
|
+
if (params.optionalContextProjection) {
|
|
191
|
+
const optional = await admitOptionalModelContext({
|
|
192
|
+
messages, assessment, project: params.optionalContextProjection, assess, assertCurrent,
|
|
193
|
+
diagnostic: { requestId: request.requestId, modelStep: params.modelStep },
|
|
194
|
+
});
|
|
195
|
+
messages = [...optional.messages];
|
|
196
|
+
assessment = optional.assessment;
|
|
197
|
+
}
|
|
187
198
|
const invocationId = this.input.nextInvocationId();
|
|
188
199
|
if (requiresContextCompaction(compactionTriggerEligible, assessment)) {
|
|
189
200
|
const admitted = await admitCompactedContext({
|
|
@@ -389,6 +400,7 @@ class ModelStepAttempt {
|
|
|
389
400
|
messages: this.input.messages,
|
|
390
401
|
agentMode: request.agentMode,
|
|
391
402
|
modelStep: params.modelStep,
|
|
403
|
+
...(request.reasoningPreference ? { reasoningPreference: request.reasoningPreference } : {}),
|
|
392
404
|
...(request.modelPreference
|
|
393
405
|
? { modelPreference: request.modelPreference }
|
|
394
406
|
: {}),
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import type { ChatMessage, ModelGatewayJsonSchemaFormat } from "../../model-gateway/types.js";
|
|
2
2
|
import type { ModelStep } from "../../shared/model-steps.js";
|
|
3
|
+
import type { ConfiguredStepInstructionPolicy } from "../config/runner/step-instructions.js";
|
|
3
4
|
import type { BoundRequestModelInvocationContext } from "../request/contracts.js";
|
|
4
|
-
import type { ModelStepContextCompactionController } from "./model-step-port.js";
|
|
5
|
+
import type { ModelStepContextCompactionController, ModelStepOptionalContextProjection } from "./model-step-port.js";
|
|
5
6
|
export type StructuredModelValidationIssue = Readonly<{
|
|
6
7
|
code: string;
|
|
7
8
|
path: string;
|
|
@@ -38,6 +39,8 @@ export declare function invokeStructuredModelStep<T>(params: {
|
|
|
38
39
|
boundSteeringVersion?: number;
|
|
39
40
|
invalidOutputReason: string;
|
|
40
41
|
contextRetention?: "exact";
|
|
42
|
+
configuredInstructionPolicy?: ConfiguredStepInstructionPolicy;
|
|
43
|
+
optionalContextProjection?: ModelStepOptionalContextProjection;
|
|
41
44
|
contextCompaction?: ModelStepContextCompactionController;
|
|
42
45
|
parse: (text: string, abortSignal: AbortSignal) => StructuredModelParseResult<T> | Promise<StructuredModelParseResult<T>>;
|
|
43
46
|
}): Promise<T>;
|
|
@@ -32,6 +32,10 @@ export async function invokeStructuredModelStep(params) {
|
|
|
32
32
|
boundSteeringVersion: params.boundSteeringVersion,
|
|
33
33
|
format: params.format,
|
|
34
34
|
contextRetention: params.contextRetention,
|
|
35
|
+
configuredInstructionPolicy: params.configuredInstructionPolicy,
|
|
36
|
+
...(params.optionalContextProjection
|
|
37
|
+
? { optionalContextProjection: params.optionalContextProjection }
|
|
38
|
+
: {}),
|
|
35
39
|
...(params.contextCompaction
|
|
36
40
|
? { contextCompaction: params.contextCompaction }
|
|
37
41
|
: {}),
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { supportsModelReasoningBudget } from "../../shared/model-reasoning.js";
|
|
1
2
|
import { MODEL_STEPS } from "../../shared/model-steps.js";
|
|
2
3
|
import { loadRequestRunnerConfig } from "../config/runner/loader.js";
|
|
3
4
|
import { createRequestModelPolicy } from "../config/runner/model-policy.js";
|
|
@@ -28,6 +29,7 @@ export function projectRuntimeModelCatalog(modelPolicy) {
|
|
|
28
29
|
provider: providerConfig.type,
|
|
29
30
|
model: profile.model,
|
|
30
31
|
supportsThinking: profile.supportsThinking === true,
|
|
32
|
+
...(supportsModelReasoningBudget({ provider: providerConfig.type, supportsThinking: profile.supportsThinking }) ? { reasoningControls: { budgetTokens: true } } : {}),
|
|
31
33
|
capabilities: profile.capabilities ?? {
|
|
32
34
|
inputModalities: ["text"],
|
|
33
35
|
outputModalities: ["text"],
|
|
@@ -1,13 +1,17 @@
|
|
|
1
|
+
import type { ModelReasoningPreference } from "../../shared/model-reasoning.js";
|
|
1
2
|
import type { ModelGatewayFormat, ModelGatewayPolicyConfig, ModelPreference, ResolvedModelInvocation } from "../../model-gateway/types.js";
|
|
2
3
|
import type { AgentMode } from "../../shared/types.js";
|
|
3
4
|
import type { ModelStep } from "../../shared/model-steps.js";
|
|
4
5
|
import type { RequestRunnerConfig } from "../config/runner/contracts.js";
|
|
6
|
+
import { type ConfiguredStepInstructionPolicy } from "../config/runner/step-instructions.js";
|
|
5
7
|
import type { RequestContextBudget } from "../context/request-context-contracts.js";
|
|
6
8
|
export declare function resolveModelContextBudget(params: {
|
|
7
9
|
runnerConfig: RequestRunnerConfig;
|
|
8
10
|
agentMode: AgentMode;
|
|
9
11
|
modelStep: ModelStep;
|
|
12
|
+
configuredInstructionPolicy?: ConfiguredStepInstructionPolicy;
|
|
10
13
|
modelPreference?: ModelPreference;
|
|
14
|
+
reasoningPreference?: ModelReasoningPreference;
|
|
11
15
|
modelPolicy?: ModelGatewayPolicyConfig;
|
|
12
16
|
}): RequestContextBudget;
|
|
13
17
|
export type ResolvedModelContextAdmission = Readonly<{
|
|
@@ -20,6 +24,7 @@ export declare function resolveModelContextAdmission(params: {
|
|
|
20
24
|
agentMode: AgentMode;
|
|
21
25
|
modelStep: ModelStep;
|
|
22
26
|
modelPreference?: ModelPreference;
|
|
27
|
+
reasoningPreference?: ModelReasoningPreference;
|
|
23
28
|
modelPolicy?: ModelGatewayPolicyConfig;
|
|
24
29
|
requestFormat?: ModelGatewayFormat;
|
|
25
30
|
}): ResolvedModelContextAdmission;
|
|
@@ -5,6 +5,7 @@ export function resolveModelContextBudget(params) {
|
|
|
5
5
|
const configuredInstructionReserveTokens = estimateConfiguredStepInstructionReserveTokens({
|
|
6
6
|
runnerConfig: params.runnerConfig,
|
|
7
7
|
modelStep: params.modelStep,
|
|
8
|
+
configuredInstructionPolicy: params.configuredInstructionPolicy,
|
|
8
9
|
...(admission.budget.tokenEstimation
|
|
9
10
|
? { tokenEstimation: admission.budget.tokenEstimation }
|
|
10
11
|
: {}),
|
|
@@ -21,6 +22,7 @@ export function resolveModelContextAdmission(params) {
|
|
|
21
22
|
agentMode: params.agentMode,
|
|
22
23
|
modelStep: params.modelStep,
|
|
23
24
|
...(params.requestFormat === undefined ? {} : { format: params.requestFormat }),
|
|
25
|
+
...(params.reasoningPreference ? { reasoningPreference: params.reasoningPreference } : {}),
|
|
24
26
|
...(params.modelPreference
|
|
25
27
|
? { modelPreference: params.modelPreference }
|
|
26
28
|
: {}),
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { ChatMessage } from "../../model-gateway/types.js";
|
|
2
2
|
import type { ModelStep } from "../../shared/model-steps.js";
|
|
3
|
+
import type { ConfiguredStepInstructionPolicy } from "../config/runner/step-instructions.js";
|
|
3
4
|
import type { ModelStepContextCompactionController } from "./context-compaction-contracts.js";
|
|
4
5
|
export type { ModelStepCompactionScope, ModelStepCompactionStage, ModelStepCompactionStageOutcome, ModelStepContextCompactionController, ModelStepContextCompactionPreparation, } from "./context-compaction-contracts.js";
|
|
5
6
|
export type ModelStepOutputDiagnostics = Readonly<{
|
|
@@ -13,6 +14,8 @@ export type ModelStepOutputDiagnostics = Readonly<{
|
|
|
13
14
|
providerOutputTokens?: number;
|
|
14
15
|
providerTotalTokens?: number;
|
|
15
16
|
}>;
|
|
17
|
+
/** Removes only caller-owned optional context; mandatory messages stay exact. */
|
|
18
|
+
export type ModelStepOptionalContextProjection = (messages: readonly ChatMessage[]) => readonly ChatMessage[];
|
|
16
19
|
export type ModelStepInvocationInput<T> = Readonly<{
|
|
17
20
|
modelStep: ModelStep;
|
|
18
21
|
messages: ChatMessage[];
|
|
@@ -22,6 +25,10 @@ export type ModelStepInvocationInput<T> = Readonly<{
|
|
|
22
25
|
format?: "json" | Record<string, unknown>;
|
|
23
26
|
/** Exact input bypasses compaction, but must fit the shared input budget. */
|
|
24
27
|
contextRetention?: "exact";
|
|
28
|
+
/** Isolated internal phases may omit the semantic step's configured guidance. */
|
|
29
|
+
configuredInstructionPolicy?: ConfiguredStepInstructionPolicy;
|
|
30
|
+
/** Pure optional omission after full-envelope assessment; never compacts or persists. */
|
|
31
|
+
optionalContextProjection?: ModelStepOptionalContextProjection;
|
|
25
32
|
contextCompaction?: ModelStepContextCompactionController;
|
|
26
33
|
/** Async validators must forward this attempt signal to their own work. */
|
|
27
34
|
accept(text: string, diagnostics: ModelStepOutputDiagnostics, abortSignal: AbortSignal): T | Promise<T>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { ChatMessage } from "../../model-gateway/types.js";
|
|
2
|
+
import type { RequestMessagesBudgetAssessment } from "../context/request-context-budget.js";
|
|
3
|
+
import type { ModelStepOptionalContextProjection } from "./model-step-port.js";
|
|
4
|
+
type OptionalContextEnvelope = Readonly<{
|
|
5
|
+
messages: readonly ChatMessage[];
|
|
6
|
+
assessment: RequestMessagesBudgetAssessment;
|
|
7
|
+
}>;
|
|
8
|
+
/** Optional references yield at the existing pressure threshold, even for exact input. */
|
|
9
|
+
export declare function admitOptionalModelContext(params: OptionalContextEnvelope & Readonly<{
|
|
10
|
+
project?: ModelStepOptionalContextProjection;
|
|
11
|
+
assess(messages: readonly ChatMessage[]): Promise<RequestMessagesBudgetAssessment>;
|
|
12
|
+
assertCurrent(): void;
|
|
13
|
+
diagnostic: Readonly<{
|
|
14
|
+
requestId: string;
|
|
15
|
+
modelStep: string;
|
|
16
|
+
}>;
|
|
17
|
+
}>): Promise<OptionalContextEnvelope>;
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { traceDebug } from "../observability/debug-logger.js";
|
|
2
|
+
import { requiresContextCompaction } from "./context-compaction-admission.js";
|
|
3
|
+
/** Optional references yield at the existing pressure threshold, even for exact input. */
|
|
4
|
+
export async function admitOptionalModelContext(params) {
|
|
5
|
+
if (!params.project)
|
|
6
|
+
return params;
|
|
7
|
+
if (!requiresContextCompaction(true, params.assessment))
|
|
8
|
+
return params;
|
|
9
|
+
params.assertCurrent();
|
|
10
|
+
const messages = params.project(params.messages);
|
|
11
|
+
if (messages === params.messages)
|
|
12
|
+
return params;
|
|
13
|
+
params.assertCurrent();
|
|
14
|
+
const assessment = await params.assess(messages);
|
|
15
|
+
params.assertCurrent();
|
|
16
|
+
traceDebug("runtime.context", "optional_context.projected", {
|
|
17
|
+
...params.diagnostic,
|
|
18
|
+
beforeMessageCount: params.messages.length,
|
|
19
|
+
afterMessageCount: messages.length,
|
|
20
|
+
fits: assessment.fits,
|
|
21
|
+
});
|
|
22
|
+
return { messages, assessment };
|
|
23
|
+
}
|
|
@@ -4,7 +4,7 @@ import type { AgentMode, ModelReasoningLevel, ModelStep } from "../shared/types.
|
|
|
4
4
|
import type { ContextBuckets, ModelContextMessage } from "../sessions/context-window.js";
|
|
5
5
|
import type { SessionArtifactPathInput, SessionContextEntryKind, SessionDeleteResult, SessionListResult, SessionMessageDeleteResult, SessionMessageGrounding, SessionMessageObservationMeta, SessionMessageRole, SessionMessageSource, SessionMessageTaskType, SessionMessagesClearResult, SessionRecord, SessionRequestReplay, SessionSnapshot, SessionThinkingTraceEntry } from "../sessions/types.js";
|
|
6
6
|
import type { SessionMemoryRepository } from "../sessions/memory/contracts.js";
|
|
7
|
-
import type { ModelGatewayInputTokenCountParams, ModelGatewayInputTokenCountResult, ModelGatewayEmbeddingParams, ModelGatewayEmbeddingResult, ModelGatewayPolicyConfig, ModelPreference, ModelTokenUsage } from "../model-gateway/types.js";
|
|
7
|
+
import type { ModelGatewayInputTokenCountParams, ModelGatewayInputTokenCountResult, ModelGatewayEmbeddingParams, ModelGatewayEmbeddingResult, ModelGatewayPolicyConfig, ModelPreference, ModelReasoningPreference, ModelTokenUsage } from "../model-gateway/types.js";
|
|
8
8
|
import type { RuntimeAttachmentStore } from "./attachments/store.js";
|
|
9
9
|
import type { RuntimeAttachmentReference } from "../shared/attachments.js";
|
|
10
10
|
import type { StreamCallbacks } from "../model-gateway/client-stream-parser.js";
|
|
@@ -220,6 +220,7 @@ export type ModelGatewayInvokeParams = StreamCallbacks & {
|
|
|
220
220
|
modelOverride?: string;
|
|
221
221
|
reasoningOverride?: ModelReasoningLevel;
|
|
222
222
|
modelPreference?: ModelPreference;
|
|
223
|
+
reasoningPreference?: ModelReasoningPreference;
|
|
223
224
|
modelPolicy?: ModelGatewayPolicyConfig;
|
|
224
225
|
abortSignal: AbortSignal;
|
|
225
226
|
debugRequestId?: string;
|
|
@@ -233,6 +234,7 @@ export type ModelGatewayRawInvokeParams = {
|
|
|
233
234
|
modelOverride?: string;
|
|
234
235
|
reasoningOverride?: ModelReasoningLevel;
|
|
235
236
|
modelPreference?: ModelPreference;
|
|
237
|
+
reasoningPreference?: ModelReasoningPreference;
|
|
236
238
|
modelPolicy?: ModelGatewayPolicyConfig;
|
|
237
239
|
abortSignal: AbortSignal;
|
|
238
240
|
debugRequestId?: string;
|
|
@@ -2,6 +2,10 @@ import type { SessionProject } from "../../sessions/project-binding.js";
|
|
|
2
2
|
export type RuntimeProject = SessionProject & Readonly<{
|
|
3
3
|
createdAt: string;
|
|
4
4
|
}>;
|
|
5
|
+
export type RuntimeProjectCatalog = Readonly<{
|
|
6
|
+
projects: readonly RuntimeProject[];
|
|
7
|
+
deletedProjectIds: readonly string[];
|
|
8
|
+
}>;
|
|
5
9
|
export type ProjectFolder = Readonly<{
|
|
6
10
|
name: string;
|
|
7
11
|
path: string;
|
|
@@ -19,6 +23,8 @@ export type ProjectFolderPage = Readonly<{
|
|
|
19
23
|
}>;
|
|
20
24
|
export type RuntimeProjectService = Readonly<{
|
|
21
25
|
list: () => Promise<readonly RuntimeProject[]>;
|
|
26
|
+
catalog: () => Promise<RuntimeProjectCatalog>;
|
|
27
|
+
delete: (projectId: string) => Promise<void>;
|
|
22
28
|
get: (id: string) => Promise<RuntimeProject | null>;
|
|
23
29
|
create: (input: {
|
|
24
30
|
name?: string;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { copySessionProject } from "../../sessions/project-binding.js";
|
|
2
|
+
function isCatalogRecord(value) {
|
|
3
|
+
if (!value)
|
|
4
|
+
return false;
|
|
5
|
+
if (Array.isArray(value))
|
|
6
|
+
return false;
|
|
7
|
+
return typeof value === "object";
|
|
8
|
+
}
|
|
9
|
+
function hasCatalogFields(value) {
|
|
10
|
+
return Object.keys(value).every((key) => ["version", "projects", "deletedProjectIds"].includes(key));
|
|
11
|
+
}
|
|
12
|
+
function hasDeletedProjectIds(value) {
|
|
13
|
+
if (!Array.isArray(value))
|
|
14
|
+
return false;
|
|
15
|
+
if (!value.every((id) => typeof id === "string" && id.trim().length > 0))
|
|
16
|
+
return false;
|
|
17
|
+
return new Set(value).size === value.length;
|
|
18
|
+
}
|
|
19
|
+
function readProjects(input) {
|
|
20
|
+
const projects = input.map((entry) => {
|
|
21
|
+
const record = entry;
|
|
22
|
+
const project = copySessionProject(record);
|
|
23
|
+
if (typeof record.createdAt !== "string")
|
|
24
|
+
throw new Error("project_registry_created_at_invalid");
|
|
25
|
+
return { ...project, createdAt: record.createdAt };
|
|
26
|
+
});
|
|
27
|
+
if (new Set(projects.map((project) => project.id)).size !== projects.length)
|
|
28
|
+
throw new Error("project_registry_duplicate_id");
|
|
29
|
+
return projects;
|
|
30
|
+
}
|
|
31
|
+
/** Legacy arrays have no removals; versioned catalogs retain explicit deletions. */
|
|
32
|
+
export function readProjectCatalog(input) {
|
|
33
|
+
if (Array.isArray(input))
|
|
34
|
+
return { projects: readProjects(input), deletedProjectIds: [] };
|
|
35
|
+
if (!isCatalogRecord(input))
|
|
36
|
+
throw new Error("project_registry_invalid");
|
|
37
|
+
if (input.version !== 1)
|
|
38
|
+
throw new Error("project_registry_version_invalid");
|
|
39
|
+
if (!hasCatalogFields(input))
|
|
40
|
+
throw new Error("project_registry_fields_invalid");
|
|
41
|
+
if (!Array.isArray(input.projects))
|
|
42
|
+
throw new Error("project_registry_projects_invalid");
|
|
43
|
+
if (!hasDeletedProjectIds(input.deletedProjectIds))
|
|
44
|
+
throw new Error("project_registry_deleted_ids_invalid");
|
|
45
|
+
const projects = readProjects(input.projects);
|
|
46
|
+
const deleted = new Set(input.deletedProjectIds);
|
|
47
|
+
if (projects.some((project) => deleted.has(project.id)))
|
|
48
|
+
throw new Error("project_registry_active_deleted_conflict");
|
|
49
|
+
return { projects, deletedProjectIds: [...input.deletedProjectIds] };
|
|
50
|
+
}
|
|
@@ -1,10 +1,13 @@
|
|
|
1
|
-
import type { RuntimeProject } from "./contracts.js";
|
|
2
|
-
/** One environment owner serializes updates; rename publishes a complete
|
|
1
|
+
import type { RuntimeProject, RuntimeProjectCatalog } from "./contracts.js";
|
|
2
|
+
/** One environment owner serializes updates; rename publishes a complete catalog. */
|
|
3
3
|
export declare class FileProjectRepository {
|
|
4
4
|
private readonly filename;
|
|
5
5
|
private tail;
|
|
6
6
|
constructor(filename: string);
|
|
7
|
-
|
|
7
|
+
catalog(): Promise<RuntimeProjectCatalog>;
|
|
8
|
+
list(): Promise<readonly RuntimeProject[]>;
|
|
8
9
|
create(project: RuntimeProject): Promise<RuntimeProject>;
|
|
10
|
+
delete(projectId: string): Promise<void>;
|
|
11
|
+
private mutate;
|
|
9
12
|
private save;
|
|
10
13
|
}
|
|
@@ -1,49 +1,56 @@
|
|
|
1
1
|
import { randomUUID } from "node:crypto";
|
|
2
2
|
import { mkdir, readFile, rename, rm, writeFile } from "node:fs/promises";
|
|
3
3
|
import { dirname } from "node:path";
|
|
4
|
-
import {
|
|
5
|
-
/** One environment owner serializes updates; rename publishes a complete
|
|
4
|
+
import { readProjectCatalog } from "./registry-format.js";
|
|
5
|
+
/** One environment owner serializes updates; rename publishes a complete catalog. */
|
|
6
6
|
export class FileProjectRepository {
|
|
7
7
|
filename;
|
|
8
8
|
tail = Promise.resolve();
|
|
9
9
|
constructor(filename) {
|
|
10
10
|
this.filename = filename;
|
|
11
11
|
}
|
|
12
|
-
async
|
|
12
|
+
async catalog() {
|
|
13
13
|
try {
|
|
14
|
-
|
|
15
|
-
if (!Array.isArray(input))
|
|
16
|
-
throw new Error("project_registry_invalid");
|
|
17
|
-
return input.map((entry) => {
|
|
18
|
-
const project = copySessionProject(entry);
|
|
19
|
-
if (typeof entry.createdAt !== "string")
|
|
20
|
-
throw new Error("project_registry_created_at_invalid");
|
|
21
|
-
return { ...project, createdAt: entry.createdAt };
|
|
22
|
-
});
|
|
14
|
+
return readProjectCatalog(JSON.parse(await readFile(this.filename, "utf8")));
|
|
23
15
|
}
|
|
24
16
|
catch (error) {
|
|
25
17
|
if (error.code === "ENOENT")
|
|
26
|
-
return [];
|
|
18
|
+
return { projects: [], deletedProjectIds: [] };
|
|
27
19
|
throw error;
|
|
28
20
|
}
|
|
29
21
|
}
|
|
22
|
+
async list() {
|
|
23
|
+
return (await this.catalog()).projects;
|
|
24
|
+
}
|
|
30
25
|
create(project) {
|
|
31
|
-
|
|
32
|
-
const
|
|
33
|
-
const existing = projects.find((entry) => entry.directory === project.directory);
|
|
26
|
+
return this.mutate(async (catalog) => {
|
|
27
|
+
const existing = catalog.projects.find((entry) => entry.directory === project.directory);
|
|
34
28
|
if (existing)
|
|
35
29
|
return existing;
|
|
36
|
-
await this.save([...projects, project]);
|
|
30
|
+
await this.save({ ...catalog, projects: [...catalog.projects, project] });
|
|
37
31
|
return project;
|
|
38
32
|
});
|
|
33
|
+
}
|
|
34
|
+
delete(projectId) {
|
|
35
|
+
return this.mutate(async (catalog) => {
|
|
36
|
+
if (catalog.deletedProjectIds.includes(projectId))
|
|
37
|
+
return;
|
|
38
|
+
await this.save({
|
|
39
|
+
projects: catalog.projects.filter((project) => project.id !== projectId),
|
|
40
|
+
deletedProjectIds: [...catalog.deletedProjectIds, projectId],
|
|
41
|
+
});
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
mutate(apply) {
|
|
45
|
+
const result = this.tail.then(async () => apply(await this.catalog()));
|
|
39
46
|
this.tail = result.then(() => undefined, () => undefined);
|
|
40
47
|
return result;
|
|
41
48
|
}
|
|
42
|
-
async save(
|
|
49
|
+
async save(catalog) {
|
|
43
50
|
await mkdir(dirname(this.filename), { recursive: true });
|
|
44
51
|
const temporary = `${this.filename}.${process.pid}.${randomUUID()}.tmp`;
|
|
45
52
|
try {
|
|
46
|
-
await writeFile(temporary, JSON.stringify(
|
|
53
|
+
await writeFile(temporary, JSON.stringify({ version: 1, ...catalog }, null, 2), "utf8");
|
|
47
54
|
await rename(temporary, this.filename);
|
|
48
55
|
}
|
|
49
56
|
catch (error) {
|
|
@@ -4,11 +4,22 @@ import { copySessionProject } from "../../sessions/project-binding.js";
|
|
|
4
4
|
import { FileProjectRepository } from "./repository.js";
|
|
5
5
|
import { browseProjectFolders, projectDisplayName, resolveProjectDirectory, } from "./folders.js";
|
|
6
6
|
import { ProjectOperationError, } from "./contracts.js";
|
|
7
|
+
function hasProjectDeleteTarget(value) {
|
|
8
|
+
if (typeof value !== "string")
|
|
9
|
+
return false;
|
|
10
|
+
return value.trim().length > 0;
|
|
11
|
+
}
|
|
7
12
|
export function createRuntimeProjectService(config, sessions) {
|
|
8
13
|
const repository = new FileProjectRepository(join(config.paths.runtimeDir, "projects", "registry.json"));
|
|
9
14
|
const get = async (id) => (await repository.list()).find((project) => project.id === id) ?? null;
|
|
10
15
|
return Object.freeze({
|
|
11
16
|
list: () => repository.list(),
|
|
17
|
+
catalog: () => repository.catalog(),
|
|
18
|
+
async delete(projectId) {
|
|
19
|
+
if (!hasProjectDeleteTarget(projectId))
|
|
20
|
+
throw new ProjectOperationError("project_id_required", "Select a project to delete.");
|
|
21
|
+
await repository.delete(projectId);
|
|
22
|
+
},
|
|
12
23
|
get,
|
|
13
24
|
async create(input) {
|
|
14
25
|
const directory = await resolveProjectDirectory(input.directory);
|
|
@@ -74,6 +74,7 @@ export async function validateApprovalResume(services, snapshot, current) {
|
|
|
74
74
|
rawAttachments: [],
|
|
75
75
|
rawAgentMode: snapshot.seed.agentMode,
|
|
76
76
|
rawModelPreference: snapshot.seed.modelPreference,
|
|
77
|
+
rawReasoningPreference: snapshot.seed.reasoningPreference,
|
|
77
78
|
toolPermissionMode: snapshot.seed.toolPermissionMode,
|
|
78
79
|
},
|
|
79
80
|
temporalContext: snapshot.seed.temporalContext ?? captureRequestTemporalContext(),
|
|
@@ -11,7 +11,7 @@ import type { RequestToolResources } from "../../capabilities/request-tool-resou
|
|
|
11
11
|
import type { RequestApprovalContinuation } from "../approval-continuation.js";
|
|
12
12
|
export declare const REQUEST_APPROVAL_SNAPSHOT = "request_approval_snapshot_v1";
|
|
13
13
|
/** Frozen data consumed by the existing request constructor; no service objects. */
|
|
14
|
-
export type PersistedRequestSeed = Pick<RequestExecutionSeed, "requestId" | "sessionId" | "sessionKind" | "prompt" | "temporalContext" | "historyMessages" | "sessionArtifactPaths" | "shouldGenerateSessionTitle" | "runnerConfig" | "executionPolicySelection" | "attachments" | "agentMode" | "modelPreference" | "modelPolicy" | "toolPermissionMode" | "memoryRecallLimit">;
|
|
14
|
+
export type PersistedRequestSeed = Pick<RequestExecutionSeed, "requestId" | "sessionId" | "sessionKind" | "prompt" | "temporalContext" | "historyMessages" | "sessionArtifactPaths" | "shouldGenerateSessionTitle" | "runnerConfig" | "executionPolicySelection" | "attachments" | "agentMode" | "modelPreference" | "reasoningPreference" | "modelPolicy" | "toolPermissionMode" | "memoryRecallLimit">;
|
|
15
15
|
export type RequestApprovalSnapshot = Readonly<{
|
|
16
16
|
kind: typeof REQUEST_APPROVAL_SNAPSHOT;
|
|
17
17
|
originalPrompt: string;
|
|
@@ -15,6 +15,7 @@ export function snapshotRequestSeed(seed) {
|
|
|
15
15
|
attachments: seed.attachments,
|
|
16
16
|
agentMode: seed.agentMode,
|
|
17
17
|
modelPreference: seed.modelPreference,
|
|
18
|
+
reasoningPreference: seed.reasoningPreference,
|
|
18
19
|
modelPolicy: seed.modelPolicy,
|
|
19
20
|
toolPermissionMode: seed.toolPermissionMode,
|
|
20
21
|
memoryRecallLimit: seed.memoryRecallLimit,
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ModelReasoningPreference } from "../../shared/model-reasoning.js";
|
|
1
2
|
import type { KnowledgeSkillStore } from "../knowledge-skills/store.js";
|
|
2
3
|
import type { RequestToolResources } from "../capabilities/request-tool-resources.js";
|
|
3
4
|
import type { CapabilityApprovalGate } from "../orchestration/worker-capabilities/approval-contracts.js";
|
|
@@ -29,6 +30,7 @@ export type RunRequestMessage = {
|
|
|
29
30
|
text?: string;
|
|
30
31
|
agentMode?: unknown;
|
|
31
32
|
modelPreference?: unknown;
|
|
33
|
+
reasoningPreference?: unknown;
|
|
32
34
|
toolPermissionMode?: unknown;
|
|
33
35
|
attachments?: unknown;
|
|
34
36
|
};
|
|
@@ -79,6 +81,7 @@ export type RequestExecutionSeed = Readonly<{
|
|
|
79
81
|
attachments?: ModelGatewayAttachment[];
|
|
80
82
|
agentMode: AgentMode;
|
|
81
83
|
modelPreference?: ModelPreference;
|
|
84
|
+
reasoningPreference?: ModelReasoningPreference;
|
|
82
85
|
modelPolicy?: ModelGatewayPolicyConfig;
|
|
83
86
|
modelGatewayClient: Pick<ModelGatewayClient, "invoke" | "invokeRaw" | "countInputTokens">;
|
|
84
87
|
contextCompactionStore?: RequestContextCompactionStore;
|
|
@@ -128,6 +131,7 @@ export type RequestModelRuntime = Readonly<{
|
|
|
128
131
|
modelInvocationScope?: RequestExecutionSeed["modelInvocationScope"];
|
|
129
132
|
runnerConfig: RequestExecutionSeed["runnerConfig"];
|
|
130
133
|
modelPreference?: RequestExecutionSeed["modelPreference"];
|
|
134
|
+
reasoningPreference?: RequestExecutionSeed["reasoningPreference"];
|
|
131
135
|
modelPolicy?: RequestExecutionSeed["modelPolicy"];
|
|
132
136
|
modelGatewayClient: RequestExecutionSeed["modelGatewayClient"];
|
|
133
137
|
}>;
|
|
@@ -155,7 +159,7 @@ export type RequestPresentation = Readonly<{
|
|
|
155
159
|
onAnswerToken: RequestExecutionSeed["onAnswerToken"];
|
|
156
160
|
}>;
|
|
157
161
|
/** The exact request-owned surface required by model invocation. */
|
|
158
|
-
export type RequestModelInvocationView = Readonly<Pick<RequestExecutionSeed, "requestId" | "toolResources" | "modelInvocationScope" | "runnerConfig" | "agentMode" | "modelPreference" | "modelPolicy" | "modelGatewayClient" | "requestSteering" | "abortSignal" | "onThinkingDelta" | "onThinkingTrace">>;
|
|
162
|
+
export type RequestModelInvocationView = Readonly<Pick<RequestExecutionSeed, "requestId" | "toolResources" | "modelInvocationScope" | "runnerConfig" | "agentMode" | "modelPreference" | "reasoningPreference" | "modelPolicy" | "modelGatewayClient" | "requestSteering" | "abortSignal" | "onThinkingDelta" | "onThinkingTrace">>;
|
|
159
163
|
/**
|
|
160
164
|
* Nominal marker for a request that already owns its single model-step port.
|
|
161
165
|
* It is non-enumerable on canonical request views, so it cannot enter model or
|
|
@@ -40,6 +40,7 @@ export function createRequestSeedFacets(seed) {
|
|
|
40
40
|
? { modelInvocationScope: seed.modelInvocationScope }
|
|
41
41
|
: {}),
|
|
42
42
|
runnerConfig: seed.runnerConfig,
|
|
43
|
+
...(seed.reasoningPreference ? { reasoningPreference: seed.reasoningPreference } : {}),
|
|
43
44
|
...(seed.modelPreference !== undefined
|
|
44
45
|
? { modelPreference: seed.modelPreference }
|
|
45
46
|
: {}),
|
|
@@ -101,6 +102,7 @@ export function createModelInvocationView(facets) {
|
|
|
101
102
|
requestId: enumerableGetter(() => facets.identity.requestId),
|
|
102
103
|
runnerConfig: enumerableGetter(() => facets.model.runnerConfig),
|
|
103
104
|
agentMode: enumerableGetter(() => facets.input.agentMode),
|
|
105
|
+
...(facets.model.reasoningPreference ? { reasoningPreference: enumerableGetter(() => facets.model.reasoningPreference) } : {}),
|
|
104
106
|
...(facets.model.modelPreference !== undefined
|
|
105
107
|
? {
|
|
106
108
|
modelPreference: enumerableGetter(() => facets.model.modelPreference),
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { ExecutionPolicyAuthoritySnapshot } from "../orchestration/role-calls/index.js";
|
|
2
|
+
/** The frozen request policy owns implicit payload evidence collection. */
|
|
3
|
+
export declare function allowsAutomaticPayloadArtifactLoading(authority: ExecutionPolicyAuthoritySnapshot | undefined): boolean;
|
|
@@ -12,6 +12,7 @@ export function projectExecutionPayloadCompactedEvidence(request, context, resul
|
|
|
12
12
|
prompt: request.prompt,
|
|
13
13
|
objective: projectExecutionCompactionObjective(request.prompt, context.root.updates),
|
|
14
14
|
callId: context.root.callId,
|
|
15
|
+
updates: context.root.updates,
|
|
15
16
|
store: request.contextCompactionStore,
|
|
16
17
|
results,
|
|
17
18
|
});
|