@octopi-agent/engine 0.98.4 → 0.121.10
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/builtin-model-info.js +28 -7
- package/dist/config-admin/agent-presets.d.ts +32 -0
- package/dist/config-admin/agent-presets.js +133 -0
- package/dist/config-admin/discover.d.ts +33 -4
- package/dist/config-admin/discover.js +101 -6
- package/dist/config-admin/env.d.ts +11 -0
- package/dist/config-admin/env.js +41 -0
- package/dist/config-admin/error-copy.d.ts +106 -0
- package/dist/config-admin/error-copy.js +287 -0
- package/dist/config-admin/i18n.d.ts +21 -0
- package/dist/config-admin/i18n.js +19 -0
- package/dist/config-admin/index.d.ts +6 -2
- package/dist/config-admin/index.js +3 -1
- package/dist/config-admin/model-presets.d.ts +14 -0
- package/dist/config-admin/model-presets.js +595 -70
- package/dist/config-admin/onboarding-apply.d.ts +71 -0
- package/dist/config-admin/onboarding-apply.js +235 -0
- package/dist/config-admin/onboarding.d.ts +154 -0
- package/dist/config-admin/onboarding.js +270 -0
- package/dist/config-admin/redact.d.ts +42 -9
- package/dist/config-admin/redact.js +69 -5
- package/dist/config-schema/agent.d.ts +40 -6
- package/dist/config-schema/agent.js +44 -6
- package/dist/config-schema/browser.d.ts +62 -0
- package/dist/config-schema/browser.js +89 -0
- package/dist/config-schema/context.d.ts +12 -37
- package/dist/config-schema/context.js +10 -31
- package/dist/config-schema/engine.d.ts +140 -164
- package/dist/config-schema/engine.js +10 -7
- package/dist/config-schema/governance.d.ts +20 -2
- package/dist/config-schema/governance.js +18 -3
- package/dist/config-schema/models.d.ts +10 -12
- package/dist/config-schema/models.js +16 -3
- package/dist/config-schema/run.d.ts +6 -2
- package/dist/config-schema/run.js +12 -2
- package/dist/config-schema/shared.d.ts +1 -3
- package/dist/config-schema/shared.js +4 -4
- package/dist/config-schema/substrate.d.ts +19 -88
- package/dist/config-schema/substrate.js +30 -107
- package/dist/config.d.ts +161 -123
- package/dist/config.js +109 -7
- package/dist/file-mode.d.ts +67 -0
- package/dist/file-mode.js +182 -0
- package/dist/fork-child.d.ts +82 -0
- package/dist/fork-child.js +123 -0
- package/dist/harness/activation/delegated-run.d.ts +42 -0
- package/dist/harness/activation/delegated-run.js +71 -0
- package/dist/harness/activation/dispatcher.js +11 -0
- package/dist/harness/activation/inbox.d.ts +3 -3
- package/dist/harness/activation/inbox.js +3 -3
- package/dist/harness/activation/index.d.ts +1 -0
- package/dist/harness/activation/run-backend.d.ts +92 -0
- package/dist/harness/activation/run-backend.js +16 -0
- package/dist/harness/activation/run-protocol.d.ts +392 -0
- package/dist/harness/activation/run-protocol.js +19 -0
- package/dist/harness/activation/runtime.d.ts +33 -0
- package/dist/harness/activation/runtime.js +130 -31
- package/dist/harness/activation/types.d.ts +20 -3
- package/dist/harness/agent/builder.d.ts +36 -3
- package/dist/harness/agent/builder.js +206 -46
- package/dist/harness/agent/config-bridge.d.ts +10 -1
- package/dist/harness/agent/config-bridge.js +24 -5
- package/dist/harness/agent/config-integrity.js +19 -2
- package/dist/harness/agent/registered-tool-adapter.d.ts +27 -0
- package/dist/harness/agent/registered-tool-adapter.js +67 -0
- package/dist/harness/agent/wire-agent-builder.d.ts +13 -3
- package/dist/harness/agent/wire-agent-builder.js +35 -9
- package/dist/harness/capabilities/document/backends/plain.js +2 -1
- package/dist/harness/capabilities/document/factory.d.ts +5 -0
- package/dist/harness/capabilities/document/factory.js +1 -0
- package/dist/harness/capabilities/document/legacy/factory.js +3 -2
- package/dist/harness/capabilities/document/port.js +6 -3
- package/dist/harness/capabilities/document/types.d.ts +5 -0
- package/dist/harness/collaboration/autonomous-subsystem/audit/reader.d.ts +17 -0
- package/dist/harness/collaboration/autonomous-subsystem/audit/reader.js +66 -36
- package/dist/harness/collaboration/autonomous-subsystem/audit/writer.d.ts +6 -2
- package/dist/harness/collaboration/autonomous-subsystem/audit/writer.js +27 -7
- package/dist/harness/collaboration/autonomous-subsystem/boundary/validator.js +13 -0
- package/dist/harness/collaboration/autonomous-subsystem/loader.js +2 -1
- package/dist/harness/collaboration/autonomous-subsystem/runtime.d.ts +11 -0
- package/dist/harness/collaboration/autonomous-subsystem/runtime.js +17 -0
- package/dist/harness/collaboration/autonomous-subsystem/sense/engine.d.ts +14 -4
- package/dist/harness/collaboration/autonomous-subsystem/sense/engine.js +50 -41
- package/dist/harness/collaboration/autonomous-subsystem/sense/input-builder.js +4 -4
- package/dist/harness/collaboration/autonomous-subsystem/sense/metrics.d.ts +2 -2
- package/dist/harness/collaboration/autonomous-subsystem/sense/metrics.js +2 -2
- package/dist/harness/collaboration/autonomous-subsystem/signal/bus.d.ts +6 -0
- package/dist/harness/collaboration/autonomous-subsystem/signal/bus.js +25 -4
- package/dist/harness/collaboration/autonomous-subsystem/think/executor.js +4 -1
- package/dist/harness/collaboration/autonomous-subsystem/types.d.ts +7 -3
- package/dist/harness/collaboration/delegation/child-run.d.ts +10 -1
- package/dist/harness/collaboration/delegation/child-run.js +38 -6
- package/dist/harness/collaboration/delegation/index.d.ts +1 -1
- package/dist/harness/collaboration/delegation/index.js +1 -1
- package/dist/harness/collaboration/delegation/notifier.d.ts +6 -1
- package/dist/harness/collaboration/delegation/notifier.js +8 -1
- package/dist/harness/collaboration/delegation/registry-types.d.ts +2 -0
- package/dist/harness/collaboration/delegation/service.d.ts +11 -4
- package/dist/harness/collaboration/delegation/service.js +35 -13
- package/dist/harness/collaboration/delegation/store.d.ts +4 -0
- package/dist/harness/collaboration/delegation/store.js +3 -1
- package/dist/harness/collaboration/delegation/types.d.ts +34 -2
- package/dist/harness/collaboration/delegation/types.js +22 -0
- package/dist/harness/collaboration/delegation/wiring.d.ts +2 -0
- package/dist/harness/collaboration/delegation/wiring.js +12 -1
- package/dist/harness/context/budget-allocator.d.ts +26 -18
- package/dist/harness/context/budget-allocator.js +67 -32
- package/dist/harness/context/capabilities/compact/engine.d.ts +44 -11
- package/dist/harness/context/capabilities/compact/engine.js +296 -160
- package/dist/harness/context/capabilities/compact/handover.d.ts +5 -3
- package/dist/harness/context/capabilities/compact/handover.js +7 -5
- package/dist/harness/context/capabilities/compact/index.d.ts +7 -2
- package/dist/harness/context/capabilities/compact/index.js +5 -1
- package/dist/harness/context/capabilities/compact/mechanical.d.ts +130 -0
- package/dist/harness/context/capabilities/compact/mechanical.js +268 -0
- package/dist/harness/context/capabilities/compact/messages.d.ts +60 -0
- package/dist/harness/context/capabilities/compact/messages.js +91 -0
- package/dist/harness/context/capabilities/compact/types.d.ts +134 -19
- package/dist/harness/context/capabilities/compact/types.js +11 -1
- package/dist/harness/context/capabilities/compact/view-split.d.ts +36 -0
- package/dist/harness/context/capabilities/compact/view-split.js +72 -0
- package/dist/harness/context/capabilities/summary/gate.d.ts +19 -2
- package/dist/harness/context/capabilities/summary/gate.js +53 -6
- package/dist/harness/context/capabilities/summary/port.js +0 -1
- package/dist/harness/context/capabilities/summary/registry.js +20 -0
- package/dist/harness/context/capabilities/summary/resolver.d.ts +1 -1
- package/dist/harness/context/capabilities/summary/resolver.js +1 -6
- package/dist/harness/context/capabilities/summary/tool-binding.d.ts +1 -1
- package/dist/harness/context/capabilities/summary/tool-binding.js +16 -12
- package/dist/harness/context/capabilities/summary/tool-bindings.d.ts +13 -0
- package/dist/harness/context/capabilities/summary/tool-bindings.js +22 -0
- package/dist/harness/context/capabilities/summary/types.d.ts +19 -6
- package/dist/harness/context/constitution/default-agents.md +85 -0
- package/dist/harness/context/context-size-ledger.d.ts +143 -0
- package/dist/harness/context/context-size-ledger.js +243 -0
- package/dist/harness/context/default-context-engine.d.ts +290 -120
- package/dist/harness/context/default-context-engine.js +1555 -764
- package/dist/harness/context/index.d.ts +3 -2
- package/dist/harness/context/index.js +2 -1
- package/dist/harness/context/layer-health.d.ts +4 -0
- package/dist/harness/context/layer-health.js +4 -0
- package/dist/harness/context/layer-types.d.ts +72 -0
- package/dist/harness/context/layer-types.js +87 -2
- package/dist/harness/context/layers.d.ts +17 -15
- package/dist/harness/context/layers.js +54 -17
- package/dist/harness/context/message-selector.d.ts +10 -8
- package/dist/harness/context/message-selector.js +49 -27
- package/dist/harness/context/prefix-fingerprint.d.ts +46 -0
- package/dist/harness/context/prefix-fingerprint.js +52 -0
- package/dist/harness/context/summarize.d.ts +2 -2
- package/dist/harness/context/summarize.js +27 -2
- package/dist/harness/context/system-prompt-assembler.d.ts +4 -0
- package/dist/harness/context/system-prompt-assembler.js +7 -3
- package/dist/harness/context/token-constants.d.ts +8 -6
- package/dist/harness/context/token-constants.js +8 -7
- package/dist/harness/context/token-estimate-fns.d.ts +37 -27
- package/dist/harness/context/token-estimate-fns.js +85 -66
- package/dist/harness/context/token-estimator.d.ts +27 -12
- package/dist/harness/context/token-estimator.js +120 -66
- package/dist/harness/context/token-segments.d.ts +88 -0
- package/dist/harness/context/token-segments.js +103 -0
- package/dist/harness/context/tool-result-aging.d.ts +109 -16
- package/dist/harness/context/tool-result-aging.js +220 -55
- package/dist/harness/context/tool-result-body.js +2 -0
- package/dist/harness/context/transform/anchors.d.ts +66 -0
- package/dist/harness/context/transform/anchors.js +125 -0
- package/dist/harness/context/transform/fold.d.ts +56 -0
- package/dist/harness/context/transform/fold.js +135 -0
- package/dist/harness/context/transform/migrate.d.ts +41 -0
- package/dist/harness/context/transform/migrate.js +69 -0
- package/dist/harness/context/transform/types.d.ts +129 -0
- package/dist/harness/context/transform/types.js +19 -0
- package/dist/harness/context/turn-envelope.d.ts +6 -3
- package/dist/harness/context/types.d.ts +196 -119
- package/dist/harness/context/types.js +25 -1
- package/dist/harness/extension/execution-environment/effect-policy.d.ts +4 -3
- package/dist/harness/extension/execution-environment/effect-policy.js +2 -2
- package/dist/harness/extension/execution-environment/ops-audit.d.ts +1 -1
- package/dist/harness/extension/execution-environment/privileged-exec.js +4 -1
- package/dist/harness/extension/execution-environment/resource-limits.d.ts +1 -1
- package/dist/harness/extension/execution-environment/resource-limits.js +1 -1
- package/dist/harness/extension/execution-environment/workspace.js +1 -1
- package/dist/harness/extension/plugin-ecosystem/channel-types.d.ts +28 -2
- package/dist/harness/extension/plugin-ecosystem/channel-types.js +11 -2
- package/dist/harness/extension/plugin-ecosystem/client-tools/registry.d.ts +12 -0
- package/dist/harness/extension/plugin-ecosystem/client-tools/registry.js +25 -0
- package/dist/harness/extension/plugin-ecosystem/commands/builtin.js +28 -1
- package/dist/harness/extension/plugin-ecosystem/commands/index.d.ts +3 -1
- package/dist/harness/extension/plugin-ecosystem/commands/index.js +1 -0
- package/dist/harness/extension/plugin-ecosystem/commands/plugin-bridge.d.ts +12 -1
- package/dist/harness/extension/plugin-ecosystem/commands/plugin-bridge.js +14 -4
- package/dist/harness/extension/plugin-ecosystem/commands/router.d.ts +5 -4
- package/dist/harness/extension/plugin-ecosystem/commands/router.js +23 -14
- package/dist/harness/extension/plugin-ecosystem/commands/types.d.ts +8 -1
- package/dist/harness/extension/plugin-ecosystem/commands/types.js +2 -1
- package/dist/harness/extension/plugin-ecosystem/hooks/adapter.d.ts +54 -0
- package/dist/harness/extension/plugin-ecosystem/hooks/adapter.js +397 -0
- package/dist/harness/extension/plugin-ecosystem/hooks/compaction-integration.d.ts +16 -0
- package/dist/harness/extension/plugin-ecosystem/hooks/compaction-integration.js +66 -0
- package/dist/harness/extension/plugin-ecosystem/hooks/index.d.ts +4 -0
- package/dist/harness/extension/plugin-ecosystem/hooks/index.js +2 -0
- package/dist/harness/extension/plugin-ecosystem/hooks/iteration-snapshot.d.ts +11 -0
- package/dist/harness/extension/plugin-ecosystem/hooks/iteration-snapshot.js +54 -0
- package/dist/harness/extension/plugin-ecosystem/hooks/journal.d.ts +9 -0
- package/dist/harness/extension/plugin-ecosystem/hooks/journal.js +22 -0
- package/dist/harness/extension/plugin-ecosystem/hooks/policy-error.d.ts +12 -0
- package/dist/harness/extension/plugin-ecosystem/hooks/policy-error.js +19 -0
- package/dist/harness/extension/plugin-ecosystem/hooks/run-integration.d.ts +36 -0
- package/dist/harness/extension/plugin-ecosystem/hooks/run-integration.js +338 -0
- package/dist/harness/extension/plugin-ecosystem/hooks/services.d.ts +24 -0
- package/dist/harness/extension/plugin-ecosystem/hooks/services.js +139 -0
- package/dist/harness/extension/plugin-ecosystem/hooks/types.d.ts +229 -0
- package/dist/harness/extension/plugin-ecosystem/hooks/types.js +1 -0
- package/dist/harness/extension/plugin-ecosystem/index.d.ts +1 -0
- package/dist/harness/extension/plugin-ecosystem/index.js +1 -0
- package/dist/harness/extension/plugin-ecosystem/plugins/api.d.ts +223 -222
- package/dist/harness/extension/plugin-ecosystem/plugins/api.js +218 -203
- package/dist/harness/extension/plugin-ecosystem/plugins/contribution-instances.d.ts +95 -0
- package/dist/harness/extension/plugin-ecosystem/plugins/contribution-instances.js +170 -0
- package/dist/harness/extension/plugin-ecosystem/plugins/contribution-kinds.d.ts +178 -0
- package/dist/harness/extension/plugin-ecosystem/plugins/contribution-kinds.js +314 -0
- package/dist/harness/extension/plugin-ecosystem/plugins/contribution-registry.d.ts +78 -0
- package/dist/harness/extension/plugin-ecosystem/plugins/contribution-registry.js +80 -0
- package/dist/harness/extension/plugin-ecosystem/plugins/engine-compatibility.d.ts +4 -0
- package/dist/harness/extension/plugin-ecosystem/plugins/engine-compatibility.js +18 -0
- package/dist/harness/extension/plugin-ecosystem/plugins/entry.d.ts +7 -85
- package/dist/harness/extension/plugin-ecosystem/plugins/entry.js +8 -50
- package/dist/harness/extension/plugin-ecosystem/plugins/index.d.ts +6 -23
- package/dist/harness/extension/plugin-ecosystem/plugins/index.js +3 -23
- package/dist/harness/extension/plugin-ecosystem/plugins/loader.d.ts +57 -114
- package/dist/harness/extension/plugin-ecosystem/plugins/loader.js +279 -282
- package/dist/harness/extension/plugin-ecosystem/plugins/manager.d.ts +46 -484
- package/dist/harness/extension/plugin-ecosystem/plugins/manager.js +123 -345
- package/dist/harness/extension/plugin-ecosystem/plugins/manifest.d.ts +50 -223
- package/dist/harness/extension/plugin-ecosystem/plugins/manifest.js +144 -20
- package/dist/harness/extension/plugin-ecosystem/plugins/staging.d.ts +17 -0
- package/dist/harness/extension/plugin-ecosystem/plugins/staging.js +15 -0
- package/dist/harness/extension/plugin-ecosystem/skills/manager.d.ts +6 -1
- package/dist/harness/extension/plugin-ecosystem/skills/manager.js +17 -1
- package/dist/harness/extension/plugin-ecosystem/tools/ask-user.d.ts +3 -0
- package/dist/harness/extension/plugin-ecosystem/tools/ask-user.js +46 -21
- package/dist/harness/extension/plugin-ecosystem/tools/browser-types.d.ts +333 -0
- package/dist/harness/extension/plugin-ecosystem/tools/browser-types.js +16 -0
- package/dist/harness/extension/plugin-ecosystem/tools/browser.d.ts +64 -0
- package/dist/harness/extension/plugin-ecosystem/tools/browser.js +692 -0
- package/dist/harness/extension/plugin-ecosystem/tools/builtin.d.ts +0 -37
- package/dist/harness/extension/plugin-ecosystem/tools/builtin.js +108 -4
- package/dist/harness/extension/plugin-ecosystem/tools/delegation.js +36 -8
- package/dist/harness/extension/plugin-ecosystem/tools/file-edit.js +34 -0
- package/dist/harness/extension/plugin-ecosystem/tools/file-search.d.ts +0 -6
- package/dist/harness/extension/plugin-ecosystem/tools/file-search.js +57 -4
- package/dist/harness/extension/plugin-ecosystem/tools/git-tools.js +81 -13
- package/dist/harness/extension/plugin-ecosystem/tools/http.js +5 -0
- package/dist/harness/extension/plugin-ecosystem/tools/knowledge.js +13 -7
- package/dist/harness/extension/plugin-ecosystem/tools/package-tools.js +126 -14
- package/dist/harness/extension/plugin-ecosystem/tools/platform.d.ts +1 -1
- package/dist/harness/extension/plugin-ecosystem/tools/platform.js +44 -5
- package/dist/harness/extension/plugin-ecosystem/tools/plugin-tool.d.ts +11 -0
- package/dist/harness/extension/plugin-ecosystem/tools/plugin-tool.js +39 -0
- package/dist/harness/extension/plugin-ecosystem/tools/tool-bus.d.ts +1 -1
- package/dist/harness/extension/plugin-ecosystem/tools/tool-bus.js +19 -24
- package/dist/harness/extension/plugin-ecosystem/tools/tool-set.d.ts +7 -0
- package/dist/harness/extension/plugin-ecosystem/tools/tool-set.js +4 -0
- package/dist/harness/governance/accounting/usage-ledger.d.ts +13 -1
- package/dist/harness/governance/accounting/usage-ledger.js +23 -1
- package/dist/harness/governance/credentials/db.d.ts +9 -0
- package/dist/harness/governance/credentials/db.js +122 -31
- package/dist/harness/governance/credentials/store.d.ts +68 -7
- package/dist/harness/governance/credentials/store.js +177 -64
- package/dist/harness/governance/credentials/types.d.ts +13 -2
- package/dist/harness/governance/human-in-the-loop/decision-cache.d.ts +3 -3
- package/dist/harness/governance/human-in-the-loop/decision-cache.js +2 -2
- package/dist/harness/governance/index.d.ts +1 -0
- package/dist/harness/governance/index.js +1 -0
- package/dist/harness/governance/registry/db.d.ts +32 -0
- package/dist/harness/governance/registry/db.js +142 -0
- package/dist/harness/governance/registry/index.d.ts +9 -0
- package/dist/harness/governance/registry/index.js +9 -0
- package/dist/harness/governance/registry/service.d.ts +381 -0
- package/dist/harness/governance/registry/service.js +825 -0
- package/dist/harness/governance/registry/types.d.ts +77 -0
- package/dist/harness/governance/registry/types.js +7 -0
- package/dist/harness/governance/security/capability-enforcer.js +1 -2
- package/dist/harness/governance/security/default-security-guard.d.ts +3 -0
- package/dist/harness/governance/security/default-security-guard.js +12 -1
- package/dist/harness/governance/security/risk-evaluator.d.ts +13 -3
- package/dist/harness/governance/security/risk-evaluator.js +307 -21
- package/dist/harness/governance/security/shell-parser-treesitter.js +12 -4
- package/dist/harness/governance/session-acl/tool-rights.d.ts +1 -0
- package/dist/harness/index.d.ts +17 -15
- package/dist/harness/index.js +9 -9
- package/dist/harness/knowledge/boot-config.d.ts +57 -0
- package/dist/harness/knowledge/boot-config.js +52 -0
- package/dist/harness/knowledge/catalog-types.d.ts +2 -0
- package/dist/harness/knowledge/client.d.ts +77 -9
- package/dist/harness/knowledge/client.js +95 -24
- package/dist/harness/knowledge/db.d.ts +16 -0
- package/dist/harness/knowledge/db.js +112 -41
- package/dist/harness/knowledge/describe-sample.d.ts +23 -0
- package/dist/harness/knowledge/describe-sample.js +58 -0
- package/dist/harness/knowledge/describe.d.ts +8 -0
- package/dist/harness/knowledge/describe.js +18 -2
- package/dist/harness/knowledge/engine-thread.js +11 -7
- package/dist/harness/knowledge/grounding.js +7 -2
- package/dist/harness/knowledge/http-app.d.ts +15 -0
- package/dist/harness/knowledge/http-app.js +117 -25
- package/dist/harness/knowledge/http-bridge.d.ts +15 -0
- package/dist/harness/knowledge/http-bridge.js +19 -0
- package/dist/harness/knowledge/http-params.d.ts +18 -0
- package/dist/harness/knowledge/http-params.js +24 -0
- package/dist/harness/knowledge/index.d.ts +2 -0
- package/dist/harness/knowledge/index.js +1 -0
- package/dist/harness/knowledge/knowledge-serve-child.js +5 -3
- package/dist/harness/knowledge/purge.js +5 -2
- package/dist/harness/knowledge/query-service.d.ts +25 -4
- package/dist/harness/knowledge/query-service.js +79 -43
- package/dist/harness/knowledge/query-worker-client.d.ts +14 -2
- package/dist/harness/knowledge/query-worker-client.js +8 -3
- package/dist/harness/knowledge/query-worker.js +9 -5
- package/dist/harness/knowledge/read-http.d.ts +2 -0
- package/dist/harness/knowledge/read-http.js +14 -3
- package/dist/harness/knowledge/retriever.d.ts +1 -1
- package/dist/harness/knowledge/retriever.js +1 -2
- package/dist/harness/knowledge/serve.d.ts +14 -8
- package/dist/harness/knowledge/serve.js +14 -6
- package/dist/harness/knowledge/source-store.d.ts +101 -5
- package/dist/harness/knowledge/source-store.js +323 -74
- package/dist/harness/knowledge/start-service-process.d.ts +41 -14
- package/dist/harness/knowledge/start-service-process.js +67 -96
- package/dist/harness/knowledge/tenant-gate.d.ts +81 -0
- package/dist/harness/knowledge/tenant-gate.js +167 -0
- package/dist/harness/knowledge/types.d.ts +7 -0
- package/dist/harness/knowledge/writer-service.d.ts +55 -11
- package/dist/harness/knowledge/writer-service.js +200 -30
- package/dist/harness/knowledge/writer-worker-client.d.ts +19 -11
- package/dist/harness/knowledge/writer-worker-client.js +40 -5
- package/dist/harness/knowledge/writer-worker.js +20 -5
- package/dist/harness/memory/backfill-trigger.d.ts +10 -3
- package/dist/harness/memory/backfill-trigger.js +19 -19
- package/dist/harness/memory/cognition-seeds.d.ts +45 -0
- package/dist/harness/memory/cognition-seeds.js +67 -0
- package/dist/harness/memory/cognition.d.ts +12 -3
- package/dist/harness/memory/cognition.js +55 -35
- package/dist/harness/memory/conceptualizer.d.ts +11 -1
- package/dist/harness/memory/conceptualizer.js +10 -1
- package/dist/harness/memory/context-slice.d.ts +42 -0
- package/dist/harness/memory/context-slice.js +197 -0
- package/dist/harness/memory/health-probe.d.ts +8 -2
- package/dist/harness/memory/health-probe.js +10 -13
- package/dist/harness/memory/index.d.ts +5 -1
- package/dist/harness/memory/index.js +3 -1
- package/dist/harness/memory/sqlite/agent-db.d.ts +1 -0
- package/dist/harness/memory/sqlite/agent-db.js +9 -8
- package/dist/harness/memory/sqlite/cognition-store.d.ts +26 -3
- package/dist/harness/memory/sqlite/cognition-store.js +103 -45
- package/dist/harness/memory/sqlite/memory-store.js +4 -0
- package/dist/harness/memory/sqlite/sqlite-vec.d.ts +24 -1
- package/dist/harness/memory/sqlite/sqlite-vec.js +37 -1
- package/dist/harness/memory/sqlite/wisdom-store.js +35 -10
- package/dist/harness/memory/types.d.ts +24 -6
- package/dist/harness/memory/wisdom-formation.d.ts +14 -3
- package/dist/harness/memory/wisdom-formation.js +85 -22
- package/dist/harness/memory/wisdom-gates.d.ts +14 -0
- package/dist/harness/memory/wisdom-gates.js +59 -19
- package/dist/harness/memory/wisdom.js +9 -0
- package/dist/harness/observability/observer/hub.d.ts +10 -0
- package/dist/harness/observability/observer/hub.js +120 -17
- package/dist/harness/observability/observer/types.d.ts +10 -6
- package/dist/harness/run/agent/agent.d.ts +40 -21
- package/dist/harness/run/agent/agent.js +67 -13
- package/dist/harness/run/agent/index.d.ts +1 -1
- package/dist/harness/run/budget/budget.d.ts +28 -10
- package/dist/harness/run/budget/budget.js +38 -15
- package/dist/harness/run/concurrency/tool-validator.js +4 -3
- package/dist/harness/run/model/index.d.ts +3 -1
- package/dist/harness/run/model/index.js +2 -1
- package/dist/harness/run/model/resolver.d.ts +4 -1
- package/dist/harness/run/model/resolver.js +36 -2
- package/dist/harness/run/model/run-scope.d.ts +2 -0
- package/dist/harness/run/model/run-scope.js +7 -0
- package/dist/harness/run/model/types.d.ts +22 -5
- package/dist/harness/run/model/types.js +3 -2
- package/dist/harness/run/model/window-truth.d.ts +37 -0
- package/dist/harness/run/model/window-truth.js +39 -0
- package/dist/harness/run/reliability/context-length-feedback.d.ts +77 -0
- package/dist/harness/run/reliability/context-length-feedback.js +128 -0
- package/dist/harness/run/reliability/harness-events.d.ts +3 -3
- package/dist/harness/run/reliability/model-error-policy.js +4 -0
- package/dist/harness/run/reliability/run-agent.d.ts +32 -4
- package/dist/harness/run/reliability/run-agent.js +216 -63
- package/dist/harness/run/reliability/run-metrics-collector.d.ts +19 -8
- package/dist/harness/run/reliability/run-metrics-collector.js +38 -23
- package/dist/harness/run/run-guard/default-run-guard.js +8 -8
- package/dist/harness/run/run-host.d.ts +302 -0
- package/dist/harness/run/run-host.js +978 -0
- package/dist/harness/run/run-scope.d.ts +48 -4
- package/dist/harness/run/run-scope.js +19 -1
- package/dist/harness/run/runner.d.ts +181 -39
- package/dist/harness/run/runner.js +654 -119
- package/dist/harness/session/attachments/index.d.ts +1 -0
- package/dist/harness/session/attachments/index.js +1 -0
- package/dist/harness/session/attachments/inject.d.ts +21 -10
- package/dist/harness/session/attachments/inject.js +76 -24
- package/dist/harness/session/attachments/recall-index.d.ts +70 -0
- package/dist/harness/session/attachments/recall-index.js +219 -0
- package/dist/harness/session/attachments/service.d.ts +21 -0
- package/dist/harness/session/attachments/service.js +258 -139
- package/dist/harness/session/attachments/types.d.ts +6 -0
- package/dist/harness/session/in-memory-store.js +13 -1
- package/dist/harness/session/schedules/service.d.ts +10 -2
- package/dist/harness/session/schedules/service.js +13 -2
- package/dist/harness/session/tasks/tools.js +12 -0
- package/dist/harness/session/transform-store.d.ts +136 -0
- package/dist/harness/session/transform-store.js +302 -0
- package/dist/harness/session/types.d.ts +11 -15
- package/dist/harness/shared/events/agent-event-map.d.ts +75 -13
- package/dist/harness/shared/events/agent-event-map.js +3 -2
- package/dist/harness/shared/events/scenario-events.d.ts +6 -6
- package/dist/harness/shared/types/agent-definition.d.ts +7 -2
- package/dist/index.d.ts +16 -18
- package/dist/index.js +9 -10
- package/dist/integration/agent-runtime/channel-message-source.d.ts +3 -1
- package/dist/integration/agent-runtime/channel-message-source.js +4 -3
- package/dist/integration/browser/camoufox.d.ts +40 -0
- package/dist/integration/browser/camoufox.js +80 -0
- package/dist/integration/browser/index.d.ts +91 -0
- package/dist/integration/browser/index.js +110 -0
- package/dist/integration/browser/install.d.ts +47 -0
- package/dist/integration/browser/install.js +214 -0
- package/dist/integration/browser/playwright.d.ts +224 -0
- package/dist/integration/browser/playwright.js +925 -0
- package/dist/integration/browser/service.d.ts +41 -0
- package/dist/integration/browser/service.js +181 -0
- package/dist/integration/browser/stealth.d.ts +42 -0
- package/dist/integration/browser/stealth.js +104 -0
- package/dist/integration/observability/metrics.d.ts +6 -6
- package/dist/integration/observability/metrics.js +13 -13
- package/dist/integration/observability/observer-bridge.js +2 -2
- package/dist/integration/observability/trace-collector.d.ts +5 -5
- package/dist/integration/observability/trace-collector.js +34 -35
- package/dist/integration/observability/trace-events.d.ts +3 -3
- package/dist/integration/observability/trace-events.js +3 -3
- package/dist/integration/providers/anthropic-message-normalize.d.ts +20 -0
- package/dist/integration/providers/anthropic-message-normalize.js +48 -0
- package/dist/integration/providers/anthropic.js +41 -3
- package/dist/integration/providers/fetch-timeout.d.ts +17 -0
- package/dist/integration/providers/fetch-timeout.js +24 -0
- package/dist/integration/providers/openai.d.ts +8 -0
- package/dist/integration/providers/openai.js +48 -2
- package/dist/integration/providers/usage.d.ts +1 -1
- package/dist/integration/providers/wire-dump-diff.js +2 -1
- package/dist/integration/providers/wire-dump.d.ts +57 -3
- package/dist/integration/providers/wire-dump.js +119 -6
- package/dist/integration/storage/archive-manager.d.ts +20 -2
- package/dist/integration/storage/archive-manager.js +34 -8
- package/dist/integration/storage/atomic-tmp.d.ts +12 -0
- package/dist/integration/storage/atomic-tmp.js +36 -0
- package/dist/integration/storage/jsonl.d.ts +10 -1
- package/dist/integration/storage/jsonl.js +155 -54
- package/dist/integration/storage/session-index.d.ts +5 -0
- package/dist/integration/storage/session-index.js +25 -4
- package/dist/integration/tools/assemble.d.ts +50 -0
- package/dist/integration/tools/assemble.js +137 -0
- package/dist/paths.d.ts +18 -0
- package/dist/paths.js +36 -0
- package/dist/subsystems/cognition-steward/conceptualize/config.yaml +3 -1
- package/dist/subsystems/cognition-steward/conceptualize/handler.js +74 -5
- package/dist/subsystems/cognition-steward/consolidate/SUBSYSTEM.md +3 -2
- package/dist/subsystems/cognition-steward/consolidate/config.yaml +11 -2
- package/dist/subsystems/cognition-steward/consolidate/handler.d.ts +6 -3
- package/dist/subsystems/cognition-steward/consolidate/handler.js +266 -28
- package/dist/subsystems/memory-steward/backfill/handler.js +3 -2
- package/dist/subsystems/memory-steward/govern/config.yaml +6 -1
- package/dist/subsystems/wisdom-steward/attribute/config.yaml +5 -1
- package/dist/subsystems/wisdom-steward/formation/SUBSYSTEM.md +8 -1
- package/dist/subsystems/wisdom-steward/formation/config.yaml +4 -0
- package/dist/subsystems/wisdom-steward/formation/handler.js +27 -5
- package/dist/subsystems/wisdom-steward/govern/config.yaml +6 -1
- package/package.json +14 -15
- package/dist/harness/context/hybrid-compressor.d.ts +0 -41
- package/dist/harness/context/hybrid-compressor.js +0 -159
- package/dist/harness/context/llm-summarizer.d.ts +0 -46
- package/dist/harness/context/llm-summarizer.js +0 -249
- package/dist/harness/context/smart-router.d.ts +0 -75
- package/dist/harness/context/smart-router.js +0 -118
- package/dist/harness/context/truncate-compressor.d.ts +0 -28
- package/dist/harness/context/truncate-compressor.js +0 -107
- package/dist/harness/extension/plugin-ecosystem/plugins/capability.d.ts +0 -97
- package/dist/harness/extension/plugin-ecosystem/plugins/capability.js +0 -155
- package/dist/harness/extension/plugin-ecosystem/plugins/hooks.d.ts +0 -7
- package/dist/harness/extension/plugin-ecosystem/plugins/hooks.js +0 -7
- package/dist/harness/extension/plugin-ecosystem/plugins/lifecycle.d.ts +0 -86
- package/dist/harness/extension/plugin-ecosystem/plugins/lifecycle.js +0 -139
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Transform record store — durable ledger for compaction products.
|
|
3
|
+
*
|
|
4
|
+
* Layout (same base as turn-undo, sibling of `undo/` and `attachments/`):
|
|
5
|
+
*
|
|
6
|
+
* ```
|
|
7
|
+
* sessions/<sid>/transform/
|
|
8
|
+
* <agent-file>.jsonl # append-only entries: {kind:'record'|'revoke', ...}
|
|
9
|
+
* blobs/<sha256> # content-addressed replacement texts
|
|
10
|
+
* ```
|
|
11
|
+
*
|
|
12
|
+
* Durability contract: blobs are written (atomic tmp+rename, skip-if-exists)
|
|
13
|
+
* **before** their record line is appended — a line is never readable without
|
|
14
|
+
* its blob. Revocations are append-only lines; the ledger folds them at load.
|
|
15
|
+
* Appends are serialized per (sessionId, agentId) inside the store (review F5:
|
|
16
|
+
* seq assignment must not race), and load returns records sorted by seq.
|
|
17
|
+
*
|
|
18
|
+
* ⚠️ This must NOT live under `sessions/<sid>/undo/` — that directory is
|
|
19
|
+
* deleted wholesale on turn-undo commit/discard.
|
|
20
|
+
*
|
|
21
|
+
* @module harness/session/transform-store
|
|
22
|
+
*/
|
|
23
|
+
import type { NewTransformRecord, TransformLedger, TransformRecord, TransformStore } from '../context/transform/types.js';
|
|
24
|
+
/** transform 目录布局 */
|
|
25
|
+
export interface SessionTransformPaths {
|
|
26
|
+
/** `sessions/<sid>/transform` */
|
|
27
|
+
root: string;
|
|
28
|
+
blobsDir: string;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* 解析会话 transform 目录
|
|
32
|
+
*
|
|
33
|
+
* @param sessionsDir - 通常 `OCTOPI_HOME/sessions`
|
|
34
|
+
* @param sessionId - 会话 id
|
|
35
|
+
* @returns 路径
|
|
36
|
+
*/
|
|
37
|
+
export declare function resolveSessionTransformPaths(sessionsDir: string, sessionId: string): SessionTransformPaths;
|
|
38
|
+
/**
|
|
39
|
+
* 复制会话 transform 账本(session fork 用)。
|
|
40
|
+
*
|
|
41
|
+
* 源缺失/复制失败返回 false——调用方降级路径是旧快照迁移(拷贝的 legacy 快照在
|
|
42
|
+
* 目标端一次性转换),不是静默成功。
|
|
43
|
+
*
|
|
44
|
+
* @param sessionsDir - `OCTOPI_HOME/sessions`
|
|
45
|
+
* @param fromSessionId - 源会话
|
|
46
|
+
* @param toSessionId - 目标会话
|
|
47
|
+
* @returns 是否完整复制
|
|
48
|
+
*/
|
|
49
|
+
export declare function copySessionTransformDir(sessionsDir: string, fromSessionId: string, toSessionId: string): Promise<boolean>;
|
|
50
|
+
/**
|
|
51
|
+
* 删除会话 transform 账本(会话删除清理;摘要正文含用户内容,不得遗留)。
|
|
52
|
+
*
|
|
53
|
+
* @param sessionsDir - `OCTOPI_HOME/sessions`
|
|
54
|
+
* @param sessionId - 会话 id
|
|
55
|
+
* @returns void
|
|
56
|
+
*/
|
|
57
|
+
export declare function removeSessionTransformDir(sessionsDir: string, sessionId: string): Promise<void>;
|
|
58
|
+
/** transform 孤儿目录(会话已删除/不在,账本残留) */
|
|
59
|
+
export interface OrphanTransformDir {
|
|
60
|
+
sessionDirName: string;
|
|
61
|
+
transformRoot: string;
|
|
62
|
+
ledgerFiles: number;
|
|
63
|
+
blobFiles: number;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* 扫描 transform 孤儿目录(doctor 兜底)。
|
|
67
|
+
*
|
|
68
|
+
* 与 undo 不同:transform 账本**设计上常驻**(记录是持久事实),孤儿判据是
|
|
69
|
+
* 「会话 jsonl 已不存在而 transform/ 仍在」(删除清理之外的残留)。
|
|
70
|
+
*
|
|
71
|
+
* @param sessionsDir - `OCTOPI_HOME/sessions`
|
|
72
|
+
* @returns 孤儿列表
|
|
73
|
+
*/
|
|
74
|
+
export declare function scanOrphanSessionTransform(sessionsDir: string): Promise<OrphanTransformDir[]>;
|
|
75
|
+
/**
|
|
76
|
+
* JSONL file-backed transform store (durable).
|
|
77
|
+
*/
|
|
78
|
+
export declare class JsonlTransformStore implements TransformStore {
|
|
79
|
+
private readonly sessionsDir;
|
|
80
|
+
/** per (sessionId, agentId) append chain(F5:seq 分配互斥) */
|
|
81
|
+
private readonly appendChains;
|
|
82
|
+
/**
|
|
83
|
+
* @param options - sessionsDir (`OCTOPI_HOME/sessions`)
|
|
84
|
+
*/
|
|
85
|
+
constructor(options: {
|
|
86
|
+
sessionsDir: string;
|
|
87
|
+
});
|
|
88
|
+
/**
|
|
89
|
+
* Load the ledger for (sessionId, agentId), blobs hydrated into `text`,
|
|
90
|
+
* records sorted by seq(fold 的 later-seq-wins 依赖序)。
|
|
91
|
+
*
|
|
92
|
+
* @param sessionId - session id
|
|
93
|
+
* @param agentId - agent id
|
|
94
|
+
* @returns ledger (empty when none)
|
|
95
|
+
*/
|
|
96
|
+
load(sessionId: string, agentId: string): Promise<TransformLedger>;
|
|
97
|
+
/**
|
|
98
|
+
* Durably append records and/or revocations (serialized per key — seq safe).
|
|
99
|
+
*
|
|
100
|
+
* @param sessionId - session id
|
|
101
|
+
* @param agentId - agent id
|
|
102
|
+
* @param records - new records (seq assigned here)
|
|
103
|
+
* @param revokeSeqs - seqs to revoke
|
|
104
|
+
* @returns appended records with seq assigned
|
|
105
|
+
*/
|
|
106
|
+
append(sessionId: string, agentId: string, records: NewTransformRecord[], revokeSeqs?: number[]): Promise<TransformRecord[]>;
|
|
107
|
+
private appendInternal;
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* In-memory transform store (standalone engines / tests). Same append semantics,
|
|
111
|
+
* no durability — permanence holds across assemblies within the process only.
|
|
112
|
+
* First append logs a one-time durability warning (review F4: degradation must
|
|
113
|
+
* not be silent).
|
|
114
|
+
*/
|
|
115
|
+
export declare class InMemoryTransformStore implements TransformStore {
|
|
116
|
+
private readonly ledgers;
|
|
117
|
+
private key;
|
|
118
|
+
/**
|
|
119
|
+
* Load the ledger for (sessionId, agentId).
|
|
120
|
+
*
|
|
121
|
+
* @param sessionId - session id
|
|
122
|
+
* @param agentId - agent id
|
|
123
|
+
* @returns ledger
|
|
124
|
+
*/
|
|
125
|
+
load(sessionId: string, agentId: string): Promise<TransformLedger>;
|
|
126
|
+
/**
|
|
127
|
+
* Append records and/or revocations in memory.
|
|
128
|
+
*
|
|
129
|
+
* @param sessionId - session id
|
|
130
|
+
* @param agentId - agent id
|
|
131
|
+
* @param records - new records
|
|
132
|
+
* @param revokeSeqs - seqs to revoke
|
|
133
|
+
* @returns appended records
|
|
134
|
+
*/
|
|
135
|
+
append(sessionId: string, agentId: string, records: NewTransformRecord[], revokeSeqs?: number[]): Promise<TransformRecord[]>;
|
|
136
|
+
}
|
|
@@ -0,0 +1,302 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Transform record store — durable ledger for compaction products.
|
|
3
|
+
*
|
|
4
|
+
* Layout (same base as turn-undo, sibling of `undo/` and `attachments/`):
|
|
5
|
+
*
|
|
6
|
+
* ```
|
|
7
|
+
* sessions/<sid>/transform/
|
|
8
|
+
* <agent-file>.jsonl # append-only entries: {kind:'record'|'revoke', ...}
|
|
9
|
+
* blobs/<sha256> # content-addressed replacement texts
|
|
10
|
+
* ```
|
|
11
|
+
*
|
|
12
|
+
* Durability contract: blobs are written (atomic tmp+rename, skip-if-exists)
|
|
13
|
+
* **before** their record line is appended — a line is never readable without
|
|
14
|
+
* its blob. Revocations are append-only lines; the ledger folds them at load.
|
|
15
|
+
* Appends are serialized per (sessionId, agentId) inside the store (review F5:
|
|
16
|
+
* seq assignment must not race), and load returns records sorted by seq.
|
|
17
|
+
*
|
|
18
|
+
* ⚠️ This must NOT live under `sessions/<sid>/undo/` — that directory is
|
|
19
|
+
* deleted wholesale on turn-undo commit/discard.
|
|
20
|
+
*
|
|
21
|
+
* @module harness/session/transform-store
|
|
22
|
+
*/
|
|
23
|
+
import { createHash } from 'node:crypto';
|
|
24
|
+
import { appendFile, cp, mkdir, readFile, rename, rm, stat, writeFile } from 'node:fs/promises';
|
|
25
|
+
import { join } from 'node:path';
|
|
26
|
+
import { toSessionFileName } from '@octopi-agent/core/session-filename.js';
|
|
27
|
+
/**
|
|
28
|
+
* 解析会话 transform 目录
|
|
29
|
+
*
|
|
30
|
+
* @param sessionsDir - 通常 `OCTOPI_HOME/sessions`
|
|
31
|
+
* @param sessionId - 会话 id
|
|
32
|
+
* @returns 路径
|
|
33
|
+
*/
|
|
34
|
+
export function resolveSessionTransformPaths(sessionsDir, sessionId) {
|
|
35
|
+
const root = join(sessionsDir, toSessionFileName(sessionId), 'transform');
|
|
36
|
+
return { root, blobsDir: join(root, 'blobs') };
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* 复制会话 transform 账本(session fork 用)。
|
|
40
|
+
*
|
|
41
|
+
* 源缺失/复制失败返回 false——调用方降级路径是旧快照迁移(拷贝的 legacy 快照在
|
|
42
|
+
* 目标端一次性转换),不是静默成功。
|
|
43
|
+
*
|
|
44
|
+
* @param sessionsDir - `OCTOPI_HOME/sessions`
|
|
45
|
+
* @param fromSessionId - 源会话
|
|
46
|
+
* @param toSessionId - 目标会话
|
|
47
|
+
* @returns 是否完整复制
|
|
48
|
+
*/
|
|
49
|
+
export async function copySessionTransformDir(sessionsDir, fromSessionId, toSessionId) {
|
|
50
|
+
const from = resolveSessionTransformPaths(sessionsDir, fromSessionId).root;
|
|
51
|
+
const to = resolveSessionTransformPaths(sessionsDir, toSessionId).root;
|
|
52
|
+
const st = await stat(from).catch(() => undefined);
|
|
53
|
+
if (!st)
|
|
54
|
+
return false;
|
|
55
|
+
try {
|
|
56
|
+
await mkdir(to, { recursive: true });
|
|
57
|
+
await cp(from, to, { recursive: true, force: true });
|
|
58
|
+
return true;
|
|
59
|
+
}
|
|
60
|
+
catch {
|
|
61
|
+
return false;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* 删除会话 transform 账本(会话删除清理;摘要正文含用户内容,不得遗留)。
|
|
66
|
+
*
|
|
67
|
+
* @param sessionsDir - `OCTOPI_HOME/sessions`
|
|
68
|
+
* @param sessionId - 会话 id
|
|
69
|
+
* @returns void
|
|
70
|
+
*/
|
|
71
|
+
export async function removeSessionTransformDir(sessionsDir, sessionId) {
|
|
72
|
+
await rm(resolveSessionTransformPaths(sessionsDir, sessionId).root, {
|
|
73
|
+
recursive: true,
|
|
74
|
+
force: true,
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* 扫描 transform 孤儿目录(doctor 兜底)。
|
|
79
|
+
*
|
|
80
|
+
* 与 undo 不同:transform 账本**设计上常驻**(记录是持久事实),孤儿判据是
|
|
81
|
+
* 「会话 jsonl 已不存在而 transform/ 仍在」(删除清理之外的残留)。
|
|
82
|
+
*
|
|
83
|
+
* @param sessionsDir - `OCTOPI_HOME/sessions`
|
|
84
|
+
* @returns 孤儿列表
|
|
85
|
+
*/
|
|
86
|
+
export async function scanOrphanSessionTransform(sessionsDir) {
|
|
87
|
+
const { readdir } = await import('node:fs/promises');
|
|
88
|
+
const names = await readdir(sessionsDir, { withFileTypes: true }).catch(() => []);
|
|
89
|
+
const out = [];
|
|
90
|
+
for (const ent of names) {
|
|
91
|
+
if (!ent.isDirectory())
|
|
92
|
+
continue;
|
|
93
|
+
const transformRoot = join(sessionsDir, ent.name, 'transform');
|
|
94
|
+
const st = await stat(transformRoot).catch(() => undefined);
|
|
95
|
+
if (!st)
|
|
96
|
+
continue;
|
|
97
|
+
const sessionFile = join(sessionsDir, `${ent.name}.jsonl`);
|
|
98
|
+
if (await stat(sessionFile).catch(() => undefined))
|
|
99
|
+
continue; // 会话仍在:正常账本
|
|
100
|
+
let ledgerFiles = 0;
|
|
101
|
+
let blobFiles = 0;
|
|
102
|
+
try {
|
|
103
|
+
const items = await readdir(transformRoot, { withFileTypes: true });
|
|
104
|
+
ledgerFiles = items.filter((i) => i.isFile() && i.name.endsWith('.jsonl')).length;
|
|
105
|
+
}
|
|
106
|
+
catch { /* 视为 0 */ }
|
|
107
|
+
try {
|
|
108
|
+
blobFiles = (await readdir(join(transformRoot, 'blobs'))).length;
|
|
109
|
+
}
|
|
110
|
+
catch { /* 视为 0 */ }
|
|
111
|
+
out.push({ sessionDirName: ent.name, transformRoot, ledgerFiles, blobFiles });
|
|
112
|
+
}
|
|
113
|
+
return out;
|
|
114
|
+
}
|
|
115
|
+
/** Per-agent ledger file name (record lines also carry agentId — load filters by it). */
|
|
116
|
+
function agentLedgerFile(root, agentId) {
|
|
117
|
+
return join(root, `${agentId === '' ? '_' : encodeURIComponent(agentId)}.jsonl`);
|
|
118
|
+
}
|
|
119
|
+
/** sha256 hex of replacement text */
|
|
120
|
+
function blobHash(text) {
|
|
121
|
+
return createHash('sha256').update(text, 'utf8').digest('hex');
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* JSONL file-backed transform store (durable).
|
|
125
|
+
*/
|
|
126
|
+
export class JsonlTransformStore {
|
|
127
|
+
sessionsDir;
|
|
128
|
+
/** per (sessionId, agentId) append chain(F5:seq 分配互斥) */
|
|
129
|
+
appendChains = new Map();
|
|
130
|
+
/**
|
|
131
|
+
* @param options - sessionsDir (`OCTOPI_HOME/sessions`)
|
|
132
|
+
*/
|
|
133
|
+
constructor(options) {
|
|
134
|
+
this.sessionsDir = options.sessionsDir;
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* Load the ledger for (sessionId, agentId), blobs hydrated into `text`,
|
|
138
|
+
* records sorted by seq(fold 的 later-seq-wins 依赖序)。
|
|
139
|
+
*
|
|
140
|
+
* @param sessionId - session id
|
|
141
|
+
* @param agentId - agent id
|
|
142
|
+
* @returns ledger (empty when none)
|
|
143
|
+
*/
|
|
144
|
+
async load(sessionId, agentId) {
|
|
145
|
+
const { root, blobsDir } = resolveSessionTransformPaths(this.sessionsDir, sessionId);
|
|
146
|
+
const raw = await readFile(agentLedgerFile(root, agentId), 'utf8').catch(() => undefined);
|
|
147
|
+
if (raw === undefined)
|
|
148
|
+
return { records: [] };
|
|
149
|
+
const records = [];
|
|
150
|
+
const revokeTargets = new Set();
|
|
151
|
+
let hadEntries = false;
|
|
152
|
+
for (const line of raw.split('\n')) {
|
|
153
|
+
if (!line.trim())
|
|
154
|
+
continue;
|
|
155
|
+
hadEntries = true;
|
|
156
|
+
let entry;
|
|
157
|
+
try {
|
|
158
|
+
entry = JSON.parse(line);
|
|
159
|
+
}
|
|
160
|
+
catch {
|
|
161
|
+
// 损坏行跳过并保留其余账本:append-only 流的尾行可能被崩溃撕裂;
|
|
162
|
+
// 跳过是降级(少一段覆盖→原文可见),不是成功假象。完整校验在红线测试。
|
|
163
|
+
continue;
|
|
164
|
+
}
|
|
165
|
+
if (entry.kind === 'revoke') {
|
|
166
|
+
revokeTargets.add(entry.targetSeq);
|
|
167
|
+
continue;
|
|
168
|
+
}
|
|
169
|
+
if (entry.record.agentId !== agentId)
|
|
170
|
+
continue;
|
|
171
|
+
const record = { ...entry.record, revoked: false };
|
|
172
|
+
if (record.blobRef) {
|
|
173
|
+
const text = await readFile(join(blobsDir, record.blobRef.replace(/^sha256:/, '')), 'utf8').catch(() => undefined);
|
|
174
|
+
if (text === undefined) {
|
|
175
|
+
// blob 丢失(外部清扫):记录不生效(占位无文可渲染)——原文回可见是
|
|
176
|
+
// 降级方向(宁胖不丢),但不得静默(F7):如实告警。
|
|
177
|
+
console.warn(`[transform] session=${sessionId} agent=${agentId} record seq=${record.seq}: blob ${record.blobRef} missing; record dropped (raw text stays visible)`);
|
|
178
|
+
continue;
|
|
179
|
+
}
|
|
180
|
+
record.text = text;
|
|
181
|
+
}
|
|
182
|
+
records.push(record);
|
|
183
|
+
}
|
|
184
|
+
for (const record of records) {
|
|
185
|
+
if (revokeTargets.has(record.seq))
|
|
186
|
+
record.revoked = true;
|
|
187
|
+
}
|
|
188
|
+
// 文件序 → seq 序(跨进程交错写也可能倒置;fold 的 later-seq-wins 依赖它)
|
|
189
|
+
records.sort((a, b) => a.seq - b.seq);
|
|
190
|
+
return { records, hadEntries };
|
|
191
|
+
}
|
|
192
|
+
/**
|
|
193
|
+
* Durably append records and/or revocations (serialized per key — seq safe).
|
|
194
|
+
*
|
|
195
|
+
* @param sessionId - session id
|
|
196
|
+
* @param agentId - agent id
|
|
197
|
+
* @param records - new records (seq assigned here)
|
|
198
|
+
* @param revokeSeqs - seqs to revoke
|
|
199
|
+
* @returns appended records with seq assigned
|
|
200
|
+
*/
|
|
201
|
+
async append(sessionId, agentId, records, revokeSeqs) {
|
|
202
|
+
const key = `${sessionId}\u0000${agentId}`;
|
|
203
|
+
const prev = this.appendChains.get(key) ?? Promise.resolve();
|
|
204
|
+
const task = prev.then(() => this.appendInternal(sessionId, agentId, records, revokeSeqs));
|
|
205
|
+
this.appendChains.set(key, task.catch(() => undefined));
|
|
206
|
+
return task;
|
|
207
|
+
}
|
|
208
|
+
async appendInternal(sessionId, agentId, records, revokeSeqs) {
|
|
209
|
+
const { root, blobsDir } = resolveSessionTransformPaths(this.sessionsDir, sessionId);
|
|
210
|
+
await mkdir(blobsDir, { recursive: true });
|
|
211
|
+
const existing = await this.load(sessionId, agentId);
|
|
212
|
+
let nextSeq = existing.records.reduce((n, r) => Math.max(n, r.seq), 0) + 1;
|
|
213
|
+
const at = Date.now();
|
|
214
|
+
const out = [];
|
|
215
|
+
const lines = [];
|
|
216
|
+
for (const rec of records) {
|
|
217
|
+
const seq = nextSeq++;
|
|
218
|
+
let blobRef;
|
|
219
|
+
if (rec.text !== undefined) {
|
|
220
|
+
const hash = blobHash(rec.text);
|
|
221
|
+
blobRef = `sha256:${hash}`;
|
|
222
|
+
await writeBlobIfAbsent(join(blobsDir, hash), rec.text);
|
|
223
|
+
}
|
|
224
|
+
const record = { ...rec, seq, blobRef, revoked: false };
|
|
225
|
+
out.push(record);
|
|
226
|
+
const { text: _text, revoked: _revoked, ...persisted } = record;
|
|
227
|
+
lines.push(JSON.stringify({ kind: 'record', record: persisted }));
|
|
228
|
+
}
|
|
229
|
+
for (const targetSeq of revokeSeqs ?? []) {
|
|
230
|
+
lines.push(JSON.stringify({ kind: 'revoke', seq: nextSeq++, targetSeq, at }));
|
|
231
|
+
}
|
|
232
|
+
if (lines.length > 0) {
|
|
233
|
+
await appendFile(agentLedgerFile(root, agentId), `${lines.join('\n')}\n`, 'utf8');
|
|
234
|
+
}
|
|
235
|
+
return out;
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
/** 内容寻址 blob:不存在才写(tmp+rename 原子替换,防半截文件) */
|
|
239
|
+
async function writeBlobIfAbsent(path, text) {
|
|
240
|
+
const st = await stat(path).catch(() => undefined);
|
|
241
|
+
if (st)
|
|
242
|
+
return;
|
|
243
|
+
const tmp = `${path}.${process.pid}.${Date.now()}.tmp`;
|
|
244
|
+
await writeFile(tmp, text, 'utf8');
|
|
245
|
+
await rename(tmp, path);
|
|
246
|
+
}
|
|
247
|
+
let warnedInMemoryDurability = false;
|
|
248
|
+
/**
|
|
249
|
+
* In-memory transform store (standalone engines / tests). Same append semantics,
|
|
250
|
+
* no durability — permanence holds across assemblies within the process only.
|
|
251
|
+
* First append logs a one-time durability warning (review F4: degradation must
|
|
252
|
+
* not be silent).
|
|
253
|
+
*/
|
|
254
|
+
export class InMemoryTransformStore {
|
|
255
|
+
ledgers = new Map();
|
|
256
|
+
key(sessionId, agentId) {
|
|
257
|
+
return `${sessionId}\u0000${agentId}`;
|
|
258
|
+
}
|
|
259
|
+
/**
|
|
260
|
+
* Load the ledger for (sessionId, agentId).
|
|
261
|
+
*
|
|
262
|
+
* @param sessionId - session id
|
|
263
|
+
* @param agentId - agent id
|
|
264
|
+
* @returns ledger
|
|
265
|
+
*/
|
|
266
|
+
async load(sessionId, agentId) {
|
|
267
|
+
const entry = this.ledgers.get(this.key(sessionId, agentId));
|
|
268
|
+
return { records: entry ? entry.records.map((r) => ({ ...r })) : [] };
|
|
269
|
+
}
|
|
270
|
+
/**
|
|
271
|
+
* Append records and/or revocations in memory.
|
|
272
|
+
*
|
|
273
|
+
* @param sessionId - session id
|
|
274
|
+
* @param agentId - agent id
|
|
275
|
+
* @param records - new records
|
|
276
|
+
* @param revokeSeqs - seqs to revoke
|
|
277
|
+
* @returns appended records
|
|
278
|
+
*/
|
|
279
|
+
async append(sessionId, agentId, records, revokeSeqs) {
|
|
280
|
+
if (records.length > 0 && !warnedInMemoryDurability) {
|
|
281
|
+
warnedInMemoryDurability = true;
|
|
282
|
+
console.warn('[transform] in-memory transform store: compaction products are process-local and will not survive restarts (inject JsonlTransformStore for durability)');
|
|
283
|
+
}
|
|
284
|
+
const key = this.key(sessionId, agentId);
|
|
285
|
+
const entry = this.ledgers.get(key) ?? { records: [], seq: 0 };
|
|
286
|
+
const out = [];
|
|
287
|
+
for (const rec of records) {
|
|
288
|
+
entry.seq += 1;
|
|
289
|
+
const record = { ...rec, seq: entry.seq, blobRef: undefined, revoked: false };
|
|
290
|
+
entry.records.push(record);
|
|
291
|
+
out.push({ ...record });
|
|
292
|
+
}
|
|
293
|
+
for (const targetSeq of revokeSeqs ?? []) {
|
|
294
|
+
entry.seq += 1;
|
|
295
|
+
const target = entry.records.find((r) => r.seq === targetSeq);
|
|
296
|
+
if (target)
|
|
297
|
+
target.revoked = true;
|
|
298
|
+
}
|
|
299
|
+
this.ledgers.set(key, entry);
|
|
300
|
+
return out;
|
|
301
|
+
}
|
|
302
|
+
}
|
|
@@ -4,7 +4,8 @@
|
|
|
4
4
|
* @layer harness — Session 的具体结构和生命周期管理类型。
|
|
5
5
|
* Core 层的 SessionStore 接口是泛型的,不引用此文件。
|
|
6
6
|
*/
|
|
7
|
-
import type {
|
|
7
|
+
import type { TenantId } from '@octopi-agent/core/types.js';
|
|
8
|
+
import type { Message, Step, SessionMeta, SessionSpawnLink } from '@octopi-agent/core/types.js';
|
|
8
9
|
import type { SessionTask } from './tasks/types.js';
|
|
9
10
|
import type { ContextCompactSnapshot } from '../context/types.js';
|
|
10
11
|
import type { SessionParticipant } from '../governance/session-acl/types.js';
|
|
@@ -22,24 +23,14 @@ export interface SessionSwitchRecord extends PrincipalRef {
|
|
|
22
23
|
/**
|
|
23
24
|
* 委派产生的 Session 父子关联(I2 投影可重建)
|
|
24
25
|
*
|
|
26
|
+
* 形状单一来源在 core(`@octopi-agent/core/types.js`):`SessionMeta` 投影同源复用。
|
|
25
27
|
* 子 agent 经委派(`arch/delegation.md`)起 Run 时落**独立 Session**,
|
|
26
|
-
*
|
|
28
|
+
* 写入 `SessionData.spawnBy`,使审计链不断(D7)。
|
|
27
29
|
*
|
|
28
30
|
* 刻意不塞 `metadata`:I2 要求 Discourse 权威可重建,
|
|
29
31
|
* 显式字段才好投影 / 检索 / 审计。
|
|
30
32
|
*/
|
|
31
|
-
export
|
|
32
|
-
/** 委派单 ID(`harness/collaboration/delegation`) */
|
|
33
|
-
delegationId: string;
|
|
34
|
-
/** 发起委派的 agentId */
|
|
35
|
-
parentAgentId: string;
|
|
36
|
-
/** 父 session ID */
|
|
37
|
-
parentSessionId: string;
|
|
38
|
-
/** 父 run ID */
|
|
39
|
-
parentRunId: string;
|
|
40
|
-
/** 委派链深度(根委派 = 1) */
|
|
41
|
-
depth?: number;
|
|
42
|
-
}
|
|
33
|
+
export type { SessionSpawnLink };
|
|
43
34
|
/** Session 生命周期状态(`extracted` 已废除:提炼进度归 memory.steward) */
|
|
44
35
|
export type SessionLifecycleStatus = 'active' | 'recent' | 'archived';
|
|
45
36
|
/**
|
|
@@ -67,6 +58,11 @@ export interface SessionData {
|
|
|
67
58
|
* **存储主键是 sessionId**,本字段不再决定物理路径。
|
|
68
59
|
*/
|
|
69
60
|
agentId: string;
|
|
61
|
+
/**
|
|
62
|
+
* 归属租户(arch/multi-tenancy.md §4);创建时写入,不可变。
|
|
63
|
+
* 缺省 DEFAULT_TENANT_ID(存量数据与未接身份层的创建路径同)。
|
|
64
|
+
*/
|
|
65
|
+
tenantId?: TenantId;
|
|
70
66
|
/**
|
|
71
67
|
* 主责 Agent(模型 2 · Accountability)。
|
|
72
68
|
*
|
|
@@ -90,7 +86,7 @@ export interface SessionData {
|
|
|
90
86
|
spawnBy?: SessionSpawnLink;
|
|
91
87
|
meta: SessionMeta;
|
|
92
88
|
messages: Message[];
|
|
93
|
-
|
|
89
|
+
steps: Step[];
|
|
94
90
|
metadata: Record<string, unknown>;
|
|
95
91
|
lifecycle?: SessionLifecycleMeta;
|
|
96
92
|
/**
|
|
@@ -32,11 +32,11 @@ export interface AgentEventMap {
|
|
|
32
32
|
delayMs: number;
|
|
33
33
|
error: string;
|
|
34
34
|
};
|
|
35
|
-
'
|
|
35
|
+
'step.start': Record<string, never>;
|
|
36
36
|
'llm.usage': {
|
|
37
|
-
usage: import('@octopi-agent/core/types/
|
|
37
|
+
usage: import('@octopi-agent/core/types/step.js').TokenUsage;
|
|
38
38
|
};
|
|
39
|
-
'
|
|
39
|
+
'step.end': {
|
|
40
40
|
/** 本次调用的正文;error=true 时 = 中断前的部分流出(不是回答,不得当回复外发) */
|
|
41
41
|
content?: string;
|
|
42
42
|
userText?: string;
|
|
@@ -46,11 +46,19 @@ export interface AgentEventMap {
|
|
|
46
46
|
stopped?: boolean;
|
|
47
47
|
/** 本次 LLM 调用失败(只出现在重试中途;彻底失败走 agent_end reason='error') */
|
|
48
48
|
error?: boolean;
|
|
49
|
-
usage?: import('@octopi-agent/core/types/
|
|
49
|
+
usage?: import('@octopi-agent/core/types/step.js').TokenUsage;
|
|
50
50
|
/** F3 LLM 计时摘要(loop turn_end 透传;Run 页签耗时区消费) */
|
|
51
51
|
llmTiming?: import('@octopi-agent/core/loop/types.js').LoopLLMTiming;
|
|
52
|
-
|
|
52
|
+
/** 上下文用量三量纲(P0-C 单源分账):provider 实测(usage/stale 写入);无实测不写不猜 */
|
|
53
|
+
promptTokensActual?: number;
|
|
54
|
+
/** 请求视图估算(校准后,最近一次 assemble 口径;estimate 写入,压缩后清空待下轮重算) */
|
|
55
|
+
viewTokensEst?: number;
|
|
56
|
+
/** 全量原文估算(仅 Run 页签展示,不进决策/主显示) */
|
|
57
|
+
rawTokens?: number;
|
|
53
58
|
contextWindow?: number;
|
|
59
|
+
/** 当前上下文大小快照(显示槽):只随真实用量写入(stale 回填不带,不冒名新实测)——
|
|
60
|
+
* web 顶栏「xxx / xxx」前段唯一取数源(持久化同源) */
|
|
61
|
+
contextSize?: import('../../context/types.js').ContextSizeSnapshot;
|
|
54
62
|
};
|
|
55
63
|
'tool.exec.start': {
|
|
56
64
|
toolCallId: string;
|
|
@@ -111,7 +119,7 @@ export interface AgentEventMap {
|
|
|
111
119
|
stopReason?: string;
|
|
112
120
|
};
|
|
113
121
|
'budget.exceeded': {
|
|
114
|
-
reason: 'wall_clock' | '
|
|
122
|
+
reason: 'wall_clock' | 'steps' | 'tool_calls';
|
|
115
123
|
report?: unknown;
|
|
116
124
|
};
|
|
117
125
|
'run_guard.stopped': {
|
|
@@ -175,26 +183,79 @@ export interface AgentEventMap {
|
|
|
175
183
|
'persona.resolve.failed': {
|
|
176
184
|
error: string;
|
|
177
185
|
};
|
|
178
|
-
/** 上下文压缩开始(主动摘要 /
|
|
186
|
+
/** 上下文压缩开始(主动摘要 / 硬溢出 / 手动;UI 可显示进行中) */
|
|
179
187
|
'context.compact.start': {
|
|
180
|
-
reason: 'proactive' | 'overflow';
|
|
188
|
+
reason: 'proactive' | 'overflow' | 'manual';
|
|
181
189
|
tokensBefore?: number;
|
|
182
190
|
threshold?: number;
|
|
183
191
|
};
|
|
184
192
|
/** 上下文压缩结束 */
|
|
185
193
|
'context.compact.end': {
|
|
186
|
-
reason: 'proactive' | 'overflow';
|
|
194
|
+
reason: 'proactive' | 'overflow' | 'manual';
|
|
187
195
|
tokensBefore?: number;
|
|
188
196
|
tokensAfter?: number;
|
|
197
|
+
/** 当前上下文大小快照(显示槽;tokens 与 tokensAfter 同值同源,报告尺)。
|
|
198
|
+
* 只在真压缩完成时携带——0/0(无新压缩)与 cancelled(中止零写入)不带 = 显示不动 */
|
|
199
|
+
contextSize?: import('../../context/types.js').ContextSizeSnapshot;
|
|
189
200
|
durationMs?: number;
|
|
190
201
|
cached?: boolean;
|
|
202
|
+
/** true=中止收尾(本轮作废、零写入)——不是「压缩完成」,UI 不得显示 compacted */
|
|
203
|
+
cancelled?: boolean;
|
|
191
204
|
};
|
|
192
|
-
/**
|
|
205
|
+
/** 上下文压缩受阻(failed=压缩失败已回退截断;denied=before_compaction 策略拒绝,非故障) */
|
|
193
206
|
'context.compact.error': {
|
|
194
|
-
reason?: 'proactive' | 'overflow';
|
|
207
|
+
reason?: 'proactive' | 'overflow' | 'manual';
|
|
195
208
|
error: string;
|
|
209
|
+
kind?: 'denied' | 'failed';
|
|
196
210
|
durationMs?: number;
|
|
197
211
|
};
|
|
212
|
+
/**
|
|
213
|
+
* overflow 症状告警(P3 红线 7):守门人触发 = 罕见异常信号,每次触发打告警。
|
|
214
|
+
* proactive_failed=A 类(前馈溢出,proactive 失效症状);config_drift/config_missing=F 类实证;
|
|
215
|
+
* structural_over_budget=D 类(保护段超限);window_mismatch=F 类归因未定(收缩兜底)。
|
|
216
|
+
*/
|
|
217
|
+
'context.overflow.alert': {
|
|
218
|
+
symptom: 'proactive_failed' | 'config_drift' | 'config_missing' | 'structural_over_budget' | 'window_mismatch';
|
|
219
|
+
message: string;
|
|
220
|
+
estimatedTokens?: number;
|
|
221
|
+
contextWindow?: number;
|
|
222
|
+
trigger?: 'T1' | 'T2' | 'T3';
|
|
223
|
+
};
|
|
224
|
+
/** 摘要请求进行中(P3):请求已发出、等 provider 返回——UI 据此显示「已发出 N 条 / 预算 Ms」而非只显示「进行中」 */
|
|
225
|
+
'context.compact.progress': {
|
|
226
|
+
reason?: 'proactive' | 'overflow' | 'manual';
|
|
227
|
+
/** 当前阶段(当前只有 summarize:请求已发出、等 provider 返回) */
|
|
228
|
+
phase: 'summarize';
|
|
229
|
+
/** 摘要请求体量(JSON 字符数)——事故里就是它从 ~150KB 涨到 2.13MB */
|
|
230
|
+
requestChars?: number;
|
|
231
|
+
/** 摘要请求体量的 token 估算(与会话侧同口径)——面板据此显示,避免「字符 vs token」量纲混排 */
|
|
232
|
+
requestTokens?: number;
|
|
233
|
+
/** 摘要请求消息条数 */
|
|
234
|
+
requestMessages?: number;
|
|
235
|
+
/** 本次调用的单次预算(ms);缺失 = 不设预算 */
|
|
236
|
+
timeoutMs?: number;
|
|
237
|
+
};
|
|
238
|
+
/**
|
|
239
|
+
* 摘要输出闸门判定结果(可观测):每次闸门检查都上报,无论通过与否。
|
|
240
|
+
*
|
|
241
|
+
* 事故背景(2026-11-13):一次摘要被判污染触发 strict 重试,重发整份 348k token
|
|
242
|
+
* 请求(+59s),但全程零事件——UI 只显示「已等待 Ns」,日志无迹可查。闸门必须
|
|
243
|
+
* fail-loud:判定理由、命中量、被丢弃的输出体量都要如实上报。
|
|
244
|
+
*/
|
|
245
|
+
'context.compact.contamination': {
|
|
246
|
+
reason?: 'proactive' | 'overflow' | 'manual';
|
|
247
|
+
/** 判定结论;null = 干净通过 */
|
|
248
|
+
verdict: 'clean' | 'canned_refusal' | 'transcript_shape' | 'verbatim_echo';
|
|
249
|
+
/** 第几次尝试(1=首次,2=strict 重试) */
|
|
250
|
+
attempt: number;
|
|
251
|
+
/** 回声命中行数 / 命中字符数(仅 verbatim_echo 有意义) */
|
|
252
|
+
echoHits?: number;
|
|
253
|
+
echoHitChars?: number;
|
|
254
|
+
/** 被判定输出的字符数 */
|
|
255
|
+
textChars?: number;
|
|
256
|
+
/** 是否因此触发重试(true = 本次输出被丢弃) */
|
|
257
|
+
retryTriggered: boolean;
|
|
258
|
+
};
|
|
198
259
|
/** 摘要请求 cache-miss 旁路/穷尽可观测(F22):no_prefix=无同形前缀,window_guard=前缀放不下改文本化旁路,window_exhausted=最终失败 */
|
|
199
260
|
'context.compact.summarize_fallback': {
|
|
200
261
|
reason?: 'proactive' | 'overflow';
|
|
@@ -337,8 +398,8 @@ export declare const AgentEvents: {
|
|
|
337
398
|
readonly ENGINE_END: "engine.end";
|
|
338
399
|
readonly ENGINE_ERROR: "engine.error";
|
|
339
400
|
readonly ENGINE_MODEL_RETRY: "engine.model_retry";
|
|
340
|
-
readonly
|
|
341
|
-
readonly
|
|
401
|
+
readonly STEP_START: "step.start";
|
|
402
|
+
readonly STEP_END: "step.end";
|
|
342
403
|
/** Runner 收口计时(F3 转正) */
|
|
343
404
|
readonly RUN_TIMING: "run.timing";
|
|
344
405
|
readonly TOOL_EXEC_START: "tool.exec.start";
|
|
@@ -357,6 +418,7 @@ export declare const AgentEvents: {
|
|
|
357
418
|
readonly SESSION_UPDATED: "session.updated";
|
|
358
419
|
readonly PERSONA_RESOLVE_FAILED: "persona.resolve.failed";
|
|
359
420
|
readonly CONTEXT_COMPACT_START: "context.compact.start";
|
|
421
|
+
readonly CONTEXT_COMPACT_PROGRESS: "context.compact.progress";
|
|
360
422
|
readonly CONTEXT_COMPACT_END: "context.compact.end";
|
|
361
423
|
readonly CONTEXT_COMPACT_ERROR: "context.compact.error";
|
|
362
424
|
readonly CONTEXT_LAYERS_ASSEMBLED: "context.layers.assembled";
|
|
@@ -19,8 +19,8 @@ export const AgentEvents = {
|
|
|
19
19
|
ENGINE_END: 'engine.end',
|
|
20
20
|
ENGINE_ERROR: 'engine.error',
|
|
21
21
|
ENGINE_MODEL_RETRY: 'engine.model_retry',
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
STEP_START: 'step.start',
|
|
23
|
+
STEP_END: 'step.end',
|
|
24
24
|
/** Runner 收口计时(F3 转正) */
|
|
25
25
|
RUN_TIMING: 'run.timing',
|
|
26
26
|
TOOL_EXEC_START: 'tool.exec.start',
|
|
@@ -39,6 +39,7 @@ export const AgentEvents = {
|
|
|
39
39
|
SESSION_UPDATED: 'session.updated',
|
|
40
40
|
PERSONA_RESOLVE_FAILED: 'persona.resolve.failed',
|
|
41
41
|
CONTEXT_COMPACT_START: 'context.compact.start',
|
|
42
|
+
CONTEXT_COMPACT_PROGRESS: 'context.compact.progress',
|
|
42
43
|
CONTEXT_COMPACT_END: 'context.compact.end',
|
|
43
44
|
CONTEXT_COMPACT_ERROR: 'context.compact.error',
|
|
44
45
|
CONTEXT_LAYERS_ASSEMBLED: 'context.layers.assembled',
|