@octopi-agent/engine 0.70.7 → 0.86.38
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/LICENSE +201 -201
- package/NOTICE +7 -7
- package/README.md +64 -26
- package/dist/config-schema/agent.d.ts +89 -1
- package/dist/config-schema/agent.js +69 -0
- package/dist/config-schema/context.d.ts +23 -4
- package/dist/config-schema/context.js +28 -1
- package/dist/config-schema/engine.d.ts +201 -9
- package/dist/config-schema/engine.js +31 -2
- package/dist/config-schema/governance.d.ts +95 -0
- package/dist/config-schema/governance.js +91 -0
- package/dist/config-schema/models.d.ts +1 -1
- package/dist/config-schema/observability.d.ts +6 -0
- package/dist/config-schema/observability.js +16 -0
- package/dist/config-schema/run.d.ts +10 -0
- package/dist/config-schema/run.js +18 -0
- package/dist/config-schema/shared.d.ts +10 -0
- package/dist/config-schema/shared.js +10 -0
- package/dist/config-schema/substrate.d.ts +1 -1
- package/dist/config-schema/subsystems.d.ts +1 -1
- package/dist/config-schema/subsystems.js +2 -1
- package/dist/config.d.ts +178 -7
- package/dist/config.js +113 -3
- package/dist/harness/activation/compiler.js +3 -0
- package/dist/harness/activation/runtime.d.ts +7 -0
- package/dist/harness/activation/runtime.js +60 -2
- package/dist/harness/activation/sources/agent-signal.d.ts +11 -0
- package/dist/harness/activation/sources/agent-signal.js +33 -0
- package/dist/harness/activation/types.d.ts +6 -1
- package/dist/harness/agent/builder.d.ts +47 -3
- package/dist/harness/agent/builder.js +180 -54
- package/dist/harness/agent/config-bridge.d.ts +33 -25
- package/dist/harness/agent/config-bridge.js +81 -291
- package/dist/harness/agent/index.d.ts +3 -1
- package/dist/harness/agent/index.js +2 -1
- package/dist/harness/agent/tool-purpose.d.ts +38 -0
- package/dist/harness/agent/tool-purpose.js +118 -0
- package/dist/harness/agent/wire-agent-builder.d.ts +133 -0
- package/dist/harness/agent/wire-agent-builder.js +363 -0
- package/dist/harness/collaboration/autonomous-subsystem/runtime.d.ts +4 -1
- package/dist/harness/collaboration/autonomous-subsystem/runtime.js +14 -8
- package/dist/harness/collaboration/autonomous-subsystem/sense/metrics.d.ts +12 -0
- package/dist/harness/collaboration/autonomous-subsystem/sense/metrics.js +19 -0
- package/dist/harness/collaboration/autonomous-subsystem/sense/session-lifecycle-bridge.d.ts +6 -0
- package/dist/harness/collaboration/autonomous-subsystem/sense/session-lifecycle-bridge.js +24 -7
- package/dist/harness/collaboration/autonomous-subsystem/think/executor.d.ts +5 -2
- package/dist/harness/collaboration/autonomous-subsystem/think/executor.js +11 -3
- package/dist/harness/collaboration/autonomous-subsystem/think/index.d.ts +1 -1
- package/dist/harness/collaboration/autonomous-subsystem/think/index.js +1 -1
- package/dist/harness/collaboration/autonomous-subsystem/think/llm-port.d.ts +7 -4
- package/dist/harness/collaboration/autonomous-subsystem/think/llm-port.js +8 -9
- package/dist/harness/collaboration/autonomous-subsystem/think/model-resolver.d.ts +36 -10
- package/dist/harness/collaboration/autonomous-subsystem/think/model-resolver.js +60 -7
- package/dist/harness/collaboration/delegation/child-run.d.ts +144 -0
- package/dist/harness/collaboration/delegation/child-run.js +241 -0
- package/dist/harness/collaboration/delegation/index.d.ts +26 -0
- package/dist/harness/collaboration/delegation/index.js +25 -0
- package/dist/harness/collaboration/delegation/notifier.d.ts +46 -0
- package/dist/harness/collaboration/delegation/notifier.js +84 -0
- package/dist/harness/collaboration/delegation/registry-types.d.ts +200 -0
- package/dist/harness/collaboration/delegation/registry-types.js +61 -0
- package/dist/harness/collaboration/delegation/registry.d.ts +110 -0
- package/dist/harness/collaboration/delegation/registry.js +220 -0
- package/dist/harness/collaboration/delegation/service.d.ts +249 -0
- package/dist/harness/collaboration/delegation/service.js +499 -0
- package/dist/harness/collaboration/delegation/store.d.ts +155 -0
- package/dist/harness/collaboration/delegation/store.js +271 -0
- package/dist/harness/collaboration/delegation/transport.d.ts +73 -0
- package/dist/harness/collaboration/delegation/transport.js +61 -0
- package/dist/harness/collaboration/delegation/types.d.ts +231 -0
- package/dist/harness/collaboration/delegation/types.js +70 -0
- package/dist/harness/collaboration/delegation/wiring.d.ts +111 -0
- package/dist/harness/collaboration/delegation/wiring.js +145 -0
- package/dist/harness/collaboration/orchestration/index.d.ts +11 -13
- package/dist/harness/collaboration/orchestration/index.js +11 -11
- package/dist/harness/context/assembler.d.ts +2 -2
- package/dist/harness/context/assembler.js +12 -7
- package/dist/harness/context/capabilities/compact/engine.js +80 -38
- package/dist/harness/context/capabilities/compact/types.d.ts +12 -1
- package/dist/harness/context/capabilities/summary/registry.js +10 -0
- package/dist/harness/context/constitution/default-agents.md +230 -228
- package/dist/harness/context/default-context-engine.d.ts +101 -23
- package/dist/harness/context/default-context-engine.js +483 -172
- package/dist/harness/context/hybrid-compressor.d.ts +3 -3
- package/dist/harness/context/hybrid-compressor.js +18 -23
- package/dist/harness/context/index.d.ts +5 -1
- package/dist/harness/context/index.js +2 -0
- package/dist/harness/context/layer-snapshot.d.ts +4 -0
- package/dist/harness/context/layer-snapshot.js +30 -18
- package/dist/harness/context/layer-types.d.ts +49 -1
- package/dist/harness/context/layer-types.js +72 -4
- package/dist/harness/context/layers.d.ts +5 -2
- package/dist/harness/context/layers.js +11 -5
- package/dist/harness/context/llm-summarizer.d.ts +15 -1
- package/dist/harness/context/llm-summarizer.js +107 -56
- package/dist/harness/context/message-selector.js +6 -2
- package/dist/harness/context/root-instructions.d.ts +72 -0
- package/dist/harness/context/root-instructions.js +227 -0
- package/dist/harness/context/runtime-datetime.d.ts +34 -7
- package/dist/harness/context/runtime-datetime.js +66 -10
- package/dist/harness/context/smart-router.d.ts +1 -1
- package/dist/harness/context/smart-router.js +1 -1
- package/dist/harness/context/system-prompt-assembler.d.ts +30 -0
- package/dist/harness/context/system-prompt-assembler.js +67 -6
- package/dist/harness/context/token-constants.d.ts +2 -2
- package/dist/harness/context/token-constants.js +2 -2
- package/dist/harness/context/token-estimate-fns.d.ts +1 -3
- package/dist/harness/context/token-estimate-fns.js +2 -4
- package/dist/harness/context/token-estimator.d.ts +1 -1
- package/dist/harness/context/token-estimator.js +14 -6
- package/dist/harness/context/tool-result-aging.d.ts +140 -0
- package/dist/harness/context/tool-result-aging.js +331 -0
- package/dist/harness/context/tool-result-body.d.ts +10 -0
- package/dist/harness/context/tool-result-body.js +27 -0
- package/dist/harness/context/turn-envelope.d.ts +123 -0
- package/dist/harness/context/turn-envelope.js +188 -0
- package/dist/harness/context/types.d.ts +35 -47
- package/dist/harness/extension/execution-environment/effect-policy.d.ts +248 -0
- package/dist/harness/extension/execution-environment/effect-policy.js +334 -0
- package/dist/harness/extension/execution-environment/index.d.ts +18 -2
- package/dist/harness/extension/execution-environment/index.js +11 -2
- package/dist/harness/extension/execution-environment/memory-undo.d.ts +101 -0
- package/dist/harness/extension/execution-environment/memory-undo.js +192 -0
- package/dist/harness/extension/execution-environment/process-isolation.d.ts +84 -0
- package/dist/harness/extension/execution-environment/process-isolation.js +315 -0
- package/dist/harness/extension/execution-environment/resource-limits.d.ts +36 -0
- package/dist/harness/extension/execution-environment/resource-limits.js +84 -0
- package/dist/harness/extension/execution-environment/sandbox.d.ts +125 -4
- package/dist/harness/extension/execution-environment/sandbox.js +493 -51
- package/dist/harness/extension/execution-environment/shell-journal.d.ts +100 -0
- package/dist/harness/extension/execution-environment/shell-journal.js +299 -0
- package/dist/harness/extension/execution-environment/tool-capabilities.d.ts +45 -0
- package/dist/harness/extension/execution-environment/tool-capabilities.js +126 -0
- package/dist/harness/extension/execution-environment/types.d.ts +67 -39
- package/dist/harness/extension/execution-environment/types.js +2 -2
- package/dist/harness/extension/execution-environment/undo-log.d.ts +203 -0
- package/dist/harness/extension/execution-environment/undo-log.js +627 -0
- package/dist/harness/extension/execution-environment/undo-merge.d.ts +40 -0
- package/dist/harness/extension/execution-environment/undo-merge.js +167 -0
- package/dist/harness/extension/plugin-ecosystem/client-tools/index.d.ts +1 -1
- package/dist/harness/extension/plugin-ecosystem/client-tools/types.d.ts +9 -0
- package/dist/harness/extension/plugin-ecosystem/mcp/bridge.js +2 -0
- package/dist/harness/extension/plugin-ecosystem/plugins/api.d.ts +1 -6
- package/dist/harness/extension/plugin-ecosystem/plugins/api.js +3 -8
- package/dist/harness/extension/plugin-ecosystem/plugins/capability.d.ts +0 -3
- package/dist/harness/extension/plugin-ecosystem/plugins/capability.js +0 -3
- package/dist/harness/extension/plugin-ecosystem/plugins/entry.d.ts +2 -10
- package/dist/harness/extension/plugin-ecosystem/plugins/entry.js +2 -9
- package/dist/harness/extension/plugin-ecosystem/plugins/index.d.ts +1 -3
- package/dist/harness/extension/plugin-ecosystem/plugins/index.js +1 -3
- package/dist/harness/extension/plugin-ecosystem/plugins/loader.d.ts +2 -4
- package/dist/harness/extension/plugin-ecosystem/plugins/loader.js +4 -21
- package/dist/harness/extension/plugin-ecosystem/plugins/manager.d.ts +3 -9
- package/dist/harness/extension/plugin-ecosystem/plugins/manager.js +4 -8
- package/dist/harness/extension/plugin-ecosystem/plugins/manifest.d.ts +1 -4
- package/dist/harness/extension/plugin-ecosystem/plugins/manifest.js +1 -3
- package/dist/harness/extension/plugin-ecosystem/skills/manager.d.ts +1 -1
- package/dist/harness/extension/plugin-ecosystem/skills/manager.js +1 -1
- package/dist/harness/extension/plugin-ecosystem/tools/allowlisted-run.d.ts +45 -0
- package/dist/harness/extension/plugin-ecosystem/tools/allowlisted-run.js +136 -0
- package/dist/harness/extension/plugin-ecosystem/tools/ask-user.js +1 -0
- package/dist/harness/extension/plugin-ecosystem/tools/builtin.d.ts +18 -3
- package/dist/harness/extension/plugin-ecosystem/tools/builtin.js +277 -81
- package/dist/harness/extension/plugin-ecosystem/tools/delegation.d.ts +31 -0
- package/dist/harness/extension/plugin-ecosystem/tools/delegation.js +291 -0
- package/dist/harness/extension/plugin-ecosystem/tools/document-tools.js +10 -2
- package/dist/harness/extension/plugin-ecosystem/tools/env-info.js +1 -0
- package/dist/harness/extension/plugin-ecosystem/tools/eol.d.ts +35 -0
- package/dist/harness/extension/plugin-ecosystem/tools/eol.js +43 -0
- package/dist/harness/extension/plugin-ecosystem/tools/file-edit.js +40 -9
- package/dist/harness/extension/plugin-ecosystem/tools/file-ops.d.ts +33 -0
- package/dist/harness/extension/plugin-ecosystem/tools/file-ops.js +376 -0
- package/dist/harness/extension/plugin-ecosystem/tools/file-search.d.ts +12 -2
- package/dist/harness/extension/plugin-ecosystem/tools/file-search.js +239 -61
- package/dist/harness/extension/plugin-ecosystem/tools/git-tools.d.ts +27 -0
- package/dist/harness/extension/plugin-ecosystem/tools/git-tools.js +554 -0
- package/dist/harness/extension/plugin-ecosystem/tools/http.d.ts +10 -6
- package/dist/harness/extension/plugin-ecosystem/tools/http.js +41 -47
- package/dist/harness/extension/plugin-ecosystem/tools/index.d.ts +2 -0
- package/dist/harness/extension/plugin-ecosystem/tools/index.js +2 -0
- package/dist/harness/extension/plugin-ecosystem/tools/knowledge.js +4 -0
- package/dist/harness/extension/plugin-ecosystem/tools/memory.js +25 -1
- package/dist/harness/extension/plugin-ecosystem/tools/package-tools.d.ts +13 -0
- package/dist/harness/extension/plugin-ecosystem/tools/package-tools.js +391 -0
- package/dist/harness/extension/plugin-ecosystem/tools/platform.d.ts +51 -2
- package/dist/harness/extension/plugin-ecosystem/tools/platform.js +151 -12
- package/dist/harness/extension/plugin-ecosystem/tools/session-history.js +2 -0
- package/dist/harness/extension/plugin-ecosystem/tools/tool-bus.d.ts +10 -1
- package/dist/harness/extension/plugin-ecosystem/tools/tool-bus.js +35 -19
- package/dist/harness/extension/plugin-ecosystem/tools/tool-set.d.ts +8 -0
- package/dist/harness/extension/plugin-ecosystem/tools/tool-set.js +5 -0
- package/dist/harness/extension/plugin-ecosystem/tools/web-search.js +1 -0
- package/dist/harness/governance/credentials/index.d.ts +1 -1
- package/dist/harness/governance/credentials/store.d.ts +16 -4
- package/dist/harness/governance/credentials/store.js +33 -6
- package/dist/harness/governance/credentials/types.d.ts +11 -0
- package/dist/harness/governance/human-in-the-loop/decision-cache.d.ts +105 -0
- package/dist/harness/governance/human-in-the-loop/decision-cache.js +184 -0
- package/dist/harness/governance/human-in-the-loop/index.d.ts +5 -5
- package/dist/harness/governance/human-in-the-loop/index.js +3 -3
- package/dist/harness/governance/human-in-the-loop/types.d.ts +7 -62
- package/dist/harness/governance/human-in-the-loop/types.js +6 -2
- package/dist/harness/governance/security/capability-enforcer.d.ts +9 -1
- package/dist/harness/governance/security/capability-enforcer.js +31 -8
- package/dist/harness/governance/security/degradation.js +5 -7
- package/dist/harness/governance/security/risk-evaluator.d.ts +1 -1
- package/dist/harness/governance/security/risk-evaluator.js +4 -82
- package/dist/harness/governance/security/temp-path.d.ts +41 -0
- package/dist/harness/governance/security/temp-path.js +117 -0
- package/dist/harness/governance/session-acl/index.d.ts +1 -0
- package/dist/harness/governance/session-acl/index.js +1 -0
- package/dist/harness/governance/session-acl/rights.d.ts +12 -0
- package/dist/harness/governance/session-acl/rights.js +89 -7
- package/dist/harness/governance/session-acl/seed-roles.js +9 -1
- package/dist/harness/governance/session-acl/service.js +21 -29
- package/dist/harness/governance/session-acl/tool-rights.d.ts +81 -0
- package/dist/harness/governance/session-acl/tool-rights.js +238 -0
- package/dist/harness/governance/session-acl/types.d.ts +22 -0
- package/dist/harness/index.d.ts +14 -12
- package/dist/harness/index.js +9 -6
- package/dist/harness/knowledge/file-index-store.js +11 -11
- package/dist/harness/knowledge/grounding.d.ts +2 -1
- package/dist/harness/knowledge/grounding.js +6 -3
- package/dist/harness/knowledge/index.d.ts +2 -2
- package/dist/harness/knowledge/index.js +1 -1
- package/dist/harness/knowledge/ingest.js +4 -1
- package/dist/harness/knowledge/job-control-state.js +4 -4
- package/dist/harness/knowledge/job-control.js +11 -11
- package/dist/harness/knowledge/membership-store.js +11 -11
- package/dist/harness/knowledge/network-guard.d.ts +61 -4
- package/dist/harness/knowledge/network-guard.js +390 -113
- package/dist/harness/knowledge/query-service.js +3 -3
- package/dist/harness/knowledge/writer-service.d.ts +2 -0
- package/dist/harness/knowledge/writer-service.js +14 -13
- package/dist/harness/memory/backfill-trigger.d.ts +2 -2
- package/dist/harness/memory/backfill-trigger.js +4 -4
- package/dist/harness/memory/index.d.ts +1 -0
- package/dist/harness/memory/index.js +1 -0
- package/dist/harness/memory/sqlite/agent-db.js +2 -0
- package/dist/harness/memory/sqlite/memory-store.d.ts +1 -0
- package/dist/harness/memory/sqlite/memory-store.js +14 -4
- package/dist/harness/memory/sqlite/wisdom-store.js +9 -9
- package/dist/harness/memory/store.d.ts +1 -0
- package/dist/harness/memory/store.js +3 -0
- package/dist/harness/memory/time-format.d.ts +28 -0
- package/dist/harness/memory/time-format.js +52 -0
- package/dist/harness/memory/types.d.ts +12 -0
- package/dist/harness/observability/observer/hub.js +23 -1
- package/dist/harness/observability/observer/index.d.ts +2 -2
- package/dist/harness/observability/observer/index.js +1 -1
- package/dist/harness/observability/observer/types.d.ts +57 -0
- package/dist/harness/observability/observer/types.js +118 -9
- package/dist/harness/run/agent/agent.d.ts +18 -0
- package/dist/harness/run/agent/agent.js +26 -0
- package/dist/harness/run/concurrency/tool-loop-detection-core.d.ts +1 -1
- package/dist/harness/run/concurrency/tool-loop-detection-core.js +1 -1
- package/dist/harness/run/reliability/harness-events.d.ts +4 -0
- package/dist/harness/run/reliability/run-agent.js +110 -18
- package/dist/harness/run/reliability/run-metrics-collector.d.ts +28 -2
- package/dist/harness/run/reliability/run-metrics-collector.js +92 -2
- package/dist/harness/run/run-guard/default-run-guard.d.ts +0 -5
- package/dist/harness/run/run-guard/default-run-guard.js +104 -44
- package/dist/harness/run/run-scope.d.ts +52 -0
- package/dist/harness/run/runner.d.ts +101 -16
- package/dist/harness/run/runner.js +556 -158
- package/dist/harness/session/attachments/llm-intent.js +17 -17
- package/dist/harness/session/history/port.js +1 -0
- package/dist/harness/session/in-memory-store.d.ts +1 -0
- package/dist/harness/session/in-memory-store.js +22 -1
- package/dist/harness/session/schedules/index.d.ts +10 -0
- package/dist/harness/session/schedules/index.js +10 -0
- package/dist/harness/session/schedules/render.d.ts +13 -0
- package/dist/harness/session/schedules/render.js +63 -0
- package/dist/harness/session/schedules/service.d.ts +179 -0
- package/dist/harness/session/schedules/service.js +695 -0
- package/dist/harness/session/schedules/store.d.ts +119 -0
- package/dist/harness/session/schedules/store.js +323 -0
- package/dist/harness/session/schedules/tools.d.ts +39 -0
- package/dist/harness/session/schedules/tools.js +442 -0
- package/dist/harness/session/schedules/types.d.ts +104 -0
- package/dist/harness/session/schedules/types.js +97 -0
- package/dist/harness/session/tasks/tools.js +22 -0
- package/dist/harness/session/types.d.ts +35 -0
- package/dist/harness/shared/events/agent-event-map.d.ts +13 -0
- package/dist/harness/shared/types/agent-definition.d.ts +23 -0
- package/dist/index.d.ts +23 -9
- package/dist/index.js +10 -2
- package/dist/integration/providers/anthropic.d.ts +10 -0
- package/dist/integration/providers/anthropic.js +44 -1
- package/dist/integration/providers/openai.d.ts +10 -0
- package/dist/integration/providers/openai.js +58 -2
- package/dist/integration/providers/wire-dump-diff.d.ts +191 -0
- package/dist/integration/providers/wire-dump-diff.js +351 -0
- package/dist/integration/providers/wire-dump.d.ts +178 -0
- package/dist/integration/providers/wire-dump.js +396 -0
- package/dist/integration/storage/jsonl.d.ts +11 -0
- package/dist/integration/storage/jsonl.js +148 -39
- package/dist/integration/storage/session-index.js +63 -8
- package/dist/subsystems/cognition-steward/conceptualize/SUBSYSTEM.md +43 -43
- package/dist/subsystems/cognition-steward/conceptualize/config.yaml +50 -50
- package/dist/subsystems/cognition-steward/consolidate/SUBSYSTEM.md +6 -6
- package/dist/subsystems/cognition-steward/consolidate/config.yaml +54 -54
- package/dist/subsystems/memory-steward/backfill/handler.js +9 -0
- package/dist/subsystems/wisdom-steward/evaluate/config.yaml +50 -50
- package/dist/subsystems/wisdom-steward/formation/SUBSYSTEM.md +42 -42
- package/dist/subsystems/wisdom-steward/formation/config.yaml +54 -54
- package/dist/subsystems/wisdom-steward/govern/config.yaml +55 -55
- package/package.json +115 -115
- package/dist/harness/collaboration/multi-agent/agent-registry-types.d.ts +0 -144
- package/dist/harness/collaboration/multi-agent/agent-registry-types.js +0 -25
- package/dist/harness/collaboration/multi-agent/index.d.ts +0 -17
- package/dist/harness/collaboration/multi-agent/index.js +0 -15
- package/dist/harness/collaboration/multi-agent/process.d.ts +0 -167
- package/dist/harness/collaboration/multi-agent/process.js +0 -256
- package/dist/harness/collaboration/multi-agent/registry.d.ts +0 -36
- package/dist/harness/collaboration/multi-agent/registry.js +0 -137
- package/dist/harness/collaboration/multi-agent/swarm.d.ts +0 -135
- package/dist/harness/collaboration/multi-agent/swarm.js +0 -317
- package/dist/harness/collaboration/multi-agent/types.d.ts +0 -66
- package/dist/harness/collaboration/multi-agent/types.js +0 -15
- package/dist/harness/collaboration/orchestration/async-task-store.d.ts +0 -107
- package/dist/harness/collaboration/orchestration/async-task-store.js +0 -12
- package/dist/harness/collaboration/orchestration/async-task.d.ts +0 -156
- package/dist/harness/collaboration/orchestration/async-task.js +0 -359
- package/dist/harness/collaboration/orchestration/planner/hybrid-planner.d.ts +0 -47
- package/dist/harness/collaboration/orchestration/planner/hybrid-planner.js +0 -61
- package/dist/harness/collaboration/orchestration/planner/index.d.ts +0 -9
- package/dist/harness/collaboration/orchestration/planner/index.js +0 -6
- package/dist/harness/collaboration/orchestration/planner/llm-planner.d.ts +0 -54
- package/dist/harness/collaboration/orchestration/planner/llm-planner.js +0 -167
- package/dist/harness/collaboration/orchestration/planner/rule-planner.d.ts +0 -85
- package/dist/harness/collaboration/orchestration/planner/rule-planner.js +0 -175
- package/dist/harness/collaboration/orchestration/quality/classifier.d.ts +0 -21
- package/dist/harness/collaboration/orchestration/quality/classifier.js +0 -235
- package/dist/harness/collaboration/orchestration/quality/gate.d.ts +0 -29
- package/dist/harness/collaboration/orchestration/quality/gate.js +0 -409
- package/dist/harness/collaboration/orchestration/quality/index.d.ts +0 -9
- package/dist/harness/collaboration/orchestration/quality/index.js +0 -8
- package/dist/harness/collaboration/orchestration/quality/types.d.ts +0 -159
- package/dist/harness/collaboration/orchestration/quality/types.js +0 -33
- package/dist/harness/collaboration/orchestration/scheduler/index.d.ts +0 -5
- package/dist/harness/collaboration/orchestration/scheduler/index.js +0 -4
- package/dist/harness/collaboration/orchestration/scheduler/task-scheduler.d.ts +0 -143
- package/dist/harness/collaboration/orchestration/scheduler/task-scheduler.js +0 -297
- package/dist/harness/collaboration/orchestration/strategy/classifier.d.ts +0 -12
- package/dist/harness/collaboration/orchestration/strategy/classifier.js +0 -81
- package/dist/harness/collaboration/orchestration/strategy/index.d.ts +0 -3
- package/dist/harness/collaboration/orchestration/strategy/index.js +0 -2
- package/dist/harness/collaboration/orchestration/strategy/router.d.ts +0 -28
- package/dist/harness/collaboration/orchestration/strategy/router.js +0 -105
- package/dist/harness/collaboration/orchestration/strategy/types.d.ts +0 -49
- package/dist/harness/collaboration/orchestration/strategy/types.js +0 -4
- package/dist/harness/collaboration/orchestration/workflow/engine.d.ts +0 -86
- package/dist/harness/collaboration/orchestration/workflow/engine.js +0 -298
- package/dist/harness/collaboration/orchestration/workflow/index.d.ts +0 -9
- package/dist/harness/collaboration/orchestration/workflow/index.js +0 -7
- package/dist/harness/collaboration/orchestration/workflow/types.d.ts +0 -143
- package/dist/harness/collaboration/orchestration/workflow/types.js +0 -7
- package/dist/harness/governance/human-in-the-loop/approval-manager.d.ts +0 -32
- package/dist/harness/governance/human-in-the-loop/approval-manager.js +0 -93
- /package/dist/harness/collaboration/{multi-agent → delegation}/message-channel-types.d.ts +0 -0
- /package/dist/harness/collaboration/{multi-agent → delegation}/message-channel-types.js +0 -0
|
@@ -32,6 +32,7 @@ export function createTaskListTool(service) {
|
|
|
32
32
|
return {
|
|
33
33
|
definition: {
|
|
34
34
|
name: 'task_list',
|
|
35
|
+
capabilities: ['fs-read'],
|
|
35
36
|
description: 'List session tasks (goals and steps). Goals have no parent_id; steps have parent_id of their goal.',
|
|
36
37
|
parameters: {
|
|
37
38
|
status: {
|
|
@@ -71,6 +72,7 @@ export function createTaskCreateTool(service) {
|
|
|
71
72
|
return {
|
|
72
73
|
definition: {
|
|
73
74
|
name: 'task_create',
|
|
75
|
+
capabilities: ['fs-write'],
|
|
74
76
|
description: 'Create a session task. Without parent_id creates a user-level goal. With parent_id creates a step under an existing goal (depth 1 only).',
|
|
75
77
|
parameters: {
|
|
76
78
|
description: {
|
|
@@ -84,6 +86,8 @@ export function createTaskCreateTool(service) {
|
|
|
84
86
|
},
|
|
85
87
|
},
|
|
86
88
|
},
|
|
89
|
+
// 写共享 SessionData(读改写整包存回):所在 tool_call 批次整体串行,防并发丢更新
|
|
90
|
+
executionMode: 'sequential',
|
|
87
91
|
handler: async (args, context) => {
|
|
88
92
|
const description = String(args.description ?? '');
|
|
89
93
|
const parentId = args.parent_id ? String(args.parent_id) : undefined;
|
|
@@ -96,6 +100,7 @@ export function createTaskPlanTool(service) {
|
|
|
96
100
|
return {
|
|
97
101
|
definition: {
|
|
98
102
|
name: 'task_plan',
|
|
103
|
+
capabilities: ['fs-write'],
|
|
99
104
|
description: 'Create ordered steps for an existing goal in one call.',
|
|
100
105
|
parameters: {
|
|
101
106
|
goal_id: { type: 'string', description: 'Goal task id', required: true },
|
|
@@ -108,6 +113,8 @@ export function createTaskPlanTool(service) {
|
|
|
108
113
|
},
|
|
109
114
|
},
|
|
110
115
|
},
|
|
116
|
+
// 写共享 SessionData(读改写整包存回):所在 tool_call 批次整体串行,防并发丢更新
|
|
117
|
+
executionMode: 'sequential',
|
|
111
118
|
handler: async (args, context) => {
|
|
112
119
|
const goalId = String(args.goal_id ?? '');
|
|
113
120
|
const raw = args.steps;
|
|
@@ -124,12 +131,15 @@ export function createTaskCompleteTool(service) {
|
|
|
124
131
|
return {
|
|
125
132
|
definition: {
|
|
126
133
|
name: 'task_complete',
|
|
134
|
+
capabilities: ['fs-write'],
|
|
127
135
|
description: 'Mark a goal or step as done. Explicitly complete the goal when the whole job is finished.',
|
|
128
136
|
parameters: {
|
|
129
137
|
task_id: { type: 'string', description: 'Task id', required: true },
|
|
130
138
|
progress_note: { type: 'string', description: 'Optional short progress note' },
|
|
131
139
|
},
|
|
132
140
|
},
|
|
141
|
+
// 写共享 SessionData(读改写整包存回):所在 tool_call 批次整体串行,防并发丢更新
|
|
142
|
+
executionMode: 'sequential',
|
|
133
143
|
handler: async (args, context) => {
|
|
134
144
|
const taskId = String(args.task_id ?? '');
|
|
135
145
|
const progressNote = args.progress_note ? String(args.progress_note) : undefined;
|
|
@@ -142,12 +152,15 @@ export function createTaskPauseTool(service) {
|
|
|
142
152
|
return {
|
|
143
153
|
definition: {
|
|
144
154
|
name: 'task_pause',
|
|
155
|
+
capabilities: ['fs-write'],
|
|
145
156
|
description: 'Pause an open task (goal or step).',
|
|
146
157
|
parameters: {
|
|
147
158
|
task_id: { type: 'string', description: 'Task id', required: true },
|
|
148
159
|
reason: { type: 'string', description: 'Optional reason' },
|
|
149
160
|
},
|
|
150
161
|
},
|
|
162
|
+
// 写共享 SessionData(读改写整包存回):所在 tool_call 批次整体串行,防并发丢更新
|
|
163
|
+
executionMode: 'sequential',
|
|
151
164
|
handler: async (args, context) => {
|
|
152
165
|
const taskId = String(args.task_id ?? '');
|
|
153
166
|
const reason = args.reason ? String(args.reason) : undefined;
|
|
@@ -160,11 +173,14 @@ export function createTaskResumeTool(service) {
|
|
|
160
173
|
return {
|
|
161
174
|
definition: {
|
|
162
175
|
name: 'task_resume',
|
|
176
|
+
capabilities: ['fs-write'],
|
|
163
177
|
description: 'Resume a paused task.',
|
|
164
178
|
parameters: {
|
|
165
179
|
task_id: { type: 'string', description: 'Task id', required: true },
|
|
166
180
|
},
|
|
167
181
|
},
|
|
182
|
+
// 写共享 SessionData(读改写整包存回):所在 tool_call 批次整体串行,防并发丢更新
|
|
183
|
+
executionMode: 'sequential',
|
|
168
184
|
handler: async (args, context) => {
|
|
169
185
|
const taskId = String(args.task_id ?? '');
|
|
170
186
|
const task = await service.resume(context.agentId, context.sessionId, taskId);
|
|
@@ -176,12 +192,15 @@ export function createTaskDropTool(service) {
|
|
|
176
192
|
return {
|
|
177
193
|
definition: {
|
|
178
194
|
name: 'task_drop',
|
|
195
|
+
capabilities: ['fs-write'],
|
|
179
196
|
description: 'Drop/cancel a task. Dropping a goal also drops its open steps.',
|
|
180
197
|
parameters: {
|
|
181
198
|
task_id: { type: 'string', description: 'Task id', required: true },
|
|
182
199
|
reason: { type: 'string', description: 'Optional reason' },
|
|
183
200
|
},
|
|
184
201
|
},
|
|
202
|
+
// 写共享 SessionData(读改写整包存回):所在 tool_call 批次整体串行,防并发丢更新
|
|
203
|
+
executionMode: 'sequential',
|
|
185
204
|
handler: async (args, context) => {
|
|
186
205
|
const taskId = String(args.task_id ?? '');
|
|
187
206
|
const reason = args.reason ? String(args.reason) : undefined;
|
|
@@ -194,12 +213,15 @@ export function createTaskNoteTool(service) {
|
|
|
194
213
|
return {
|
|
195
214
|
definition: {
|
|
196
215
|
name: 'task_note',
|
|
216
|
+
capabilities: ['fs-write'],
|
|
197
217
|
description: 'Update the progress note on a task without changing status.',
|
|
198
218
|
parameters: {
|
|
199
219
|
task_id: { type: 'string', description: 'Task id', required: true },
|
|
200
220
|
progress_note: { type: 'string', description: 'Short progress note', required: true },
|
|
201
221
|
},
|
|
202
222
|
},
|
|
223
|
+
// 写共享 SessionData(读改写整包存回):所在 tool_call 批次整体串行,防并发丢更新
|
|
224
|
+
executionMode: 'sequential',
|
|
203
225
|
handler: async (args, context) => {
|
|
204
226
|
const taskId = String(args.task_id ?? '');
|
|
205
227
|
const progressNote = String(args.progress_note ?? '');
|
|
@@ -19,6 +19,27 @@ export interface SessionSwitchRecord extends PrincipalRef {
|
|
|
19
19
|
toPrimaryAgentId?: string;
|
|
20
20
|
reason?: string;
|
|
21
21
|
}
|
|
22
|
+
/**
|
|
23
|
+
* 委派产生的 Session 父子关联(I2 投影可重建)
|
|
24
|
+
*
|
|
25
|
+
* 子 agent 经委派(`arch/delegation.md`)起 Run 时落**独立 Session**,
|
|
26
|
+
* 并在此记录来源,使审计链不断(D7)。
|
|
27
|
+
*
|
|
28
|
+
* 刻意不塞 `metadata`:I2 要求 Discourse 权威可重建,
|
|
29
|
+
* 显式字段才好投影 / 检索 / 审计。
|
|
30
|
+
*/
|
|
31
|
+
export interface SessionSpawnLink {
|
|
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
|
+
}
|
|
22
43
|
/** Session 生命周期状态(`extracted` 已废除:提炼进度归 memory.steward) */
|
|
23
44
|
export type SessionLifecycleStatus = 'active' | 'recent' | 'archived';
|
|
24
45
|
/**
|
|
@@ -60,11 +81,25 @@ export interface SessionData {
|
|
|
60
81
|
preferredAgentId?: string;
|
|
61
82
|
/** preferred / handoff 切换审计(I6 Principal 进审计) */
|
|
62
83
|
switchAudit?: SessionSwitchRecord[];
|
|
84
|
+
/**
|
|
85
|
+
* 委派来源(`arch/delegation.md` D7)。
|
|
86
|
+
*
|
|
87
|
+
* 本 Session 由父 agent 的委派产生时写入;用户直接创建的 Session 无此字段。
|
|
88
|
+
* 父 Run 结束后子 Session **继续存在**(决策 C1),故关联必须持久化。
|
|
89
|
+
*/
|
|
90
|
+
spawnBy?: SessionSpawnLink;
|
|
63
91
|
meta: SessionMeta;
|
|
64
92
|
messages: Message[];
|
|
65
93
|
turns: Turn[];
|
|
66
94
|
metadata: Record<string, unknown>;
|
|
67
95
|
lifecycle?: SessionLifecycleMeta;
|
|
96
|
+
/**
|
|
97
|
+
* 上下文租约截断点(messages 下标)。
|
|
98
|
+
*
|
|
99
|
+
* 仅影响 LLM 默认消息窗口;Discourse 全量仍在 `messages`。
|
|
100
|
+
* `undefined` / `0` = 不截断。由 Runner 在 `idleExpiryMs` 显式配置且闲置超时后写入。
|
|
101
|
+
*/
|
|
102
|
+
contextDetachIndex?: number;
|
|
68
103
|
/**
|
|
69
104
|
* 会话任务(goal/step 两级)。见 docs/task-system.md。
|
|
70
105
|
* 历史数据可能缺省;Service/Runner 会视作 []。
|
|
@@ -47,6 +47,19 @@ export interface AgentEventMap {
|
|
|
47
47
|
hasError?: boolean;
|
|
48
48
|
result?: unknown;
|
|
49
49
|
durationMs?: number;
|
|
50
|
+
/** 行动简述 */
|
|
51
|
+
purpose?: string;
|
|
52
|
+
};
|
|
53
|
+
/** ToolEffectPolicy §5.6 效应账本摘要(turn 级;Observer tool.effect) */
|
|
54
|
+
'tool.effect.ledger': {
|
|
55
|
+
entries: number;
|
|
56
|
+
truncated?: boolean;
|
|
57
|
+
notReversed?: {
|
|
58
|
+
reason: string;
|
|
59
|
+
created?: string[];
|
|
60
|
+
modified?: string[];
|
|
61
|
+
deleted?: string[];
|
|
62
|
+
};
|
|
50
63
|
};
|
|
51
64
|
'budget.exceeded': {
|
|
52
65
|
reason: 'wall_clock' | 'iteration' | 'tool_calls';
|
|
@@ -43,9 +43,32 @@ export interface AgentDefinition {
|
|
|
43
43
|
* handle authorize 时与角色 max / 绑定取交集。
|
|
44
44
|
*/
|
|
45
45
|
maxSessionRights?: SessionRights;
|
|
46
|
+
/** ToolEffectPolicy 运行模式(P3);agents[].effectPolicy 覆盖顶层 */
|
|
47
|
+
effectPolicy?: import('../../extension/execution-environment/effect-policy.js').EffectPolicyConfig;
|
|
46
48
|
/** Knowledge 召回姿态(覆盖全局 knowledge.recall) */
|
|
47
49
|
knowledge?: {
|
|
48
50
|
recall?: 'off' | 'hint' | 'hybrid' | 'inject';
|
|
49
51
|
};
|
|
52
|
+
/** 特质标签(arch/delegation.md §9.2:供父 agent 按特质发现委派目标);无权限语义 */
|
|
53
|
+
traits?: string[];
|
|
54
|
+
/** 委派策略(arch/delegation.md §9.2);整段可省略 = 用 DEFAULT_DELEGATION_POLICY(委派默认开启) */
|
|
55
|
+
delegation?: {
|
|
56
|
+
/** 能否被委派(默认 true;显式 false = 只能被用户直接对话) */
|
|
57
|
+
callable: boolean;
|
|
58
|
+
/** 允许哪些 agentId 调我(缺省 = 任意) */
|
|
59
|
+
callableBy?: string[];
|
|
60
|
+
/** 我能不能再委派、获得 delegate_* 工具(默认 true) */
|
|
61
|
+
canDelegate: boolean;
|
|
62
|
+
/** 递归上限(默认 1 = 我能派子,子不能再派;runaway 兜底) */
|
|
63
|
+
maxDepth?: number;
|
|
64
|
+
/** 被委派时的权利天花板(只能收紧不能放宽,D3) */
|
|
65
|
+
rightsCeiling?: SessionRights;
|
|
66
|
+
/** 委派预算上限(请求预算与此取交集) */
|
|
67
|
+
budget?: {
|
|
68
|
+
maxTurns?: number;
|
|
69
|
+
maxTokens?: number;
|
|
70
|
+
timeoutMs?: number;
|
|
71
|
+
};
|
|
72
|
+
};
|
|
50
73
|
}
|
|
51
74
|
export type { ModelInfo, ToolPolicy };
|
package/dist/index.d.ts
CHANGED
|
@@ -22,7 +22,7 @@ export type { SecurityAction } from '@octopi-agent/core/security-guard.js';
|
|
|
22
22
|
export type { Observer, Span, LogLevel } from '@octopi-agent/core/interfaces/observer.js';
|
|
23
23
|
export type { SessionStore, SessionListFilter } from '@octopi-agent/core/interfaces/session-store.js';
|
|
24
24
|
export type { SessionData, SessionLifecycleMeta, SessionLifecycleStatus, MemoryExtractionStatus } from './harness/session/types.js';
|
|
25
|
-
export type { ContextEngine, ContextEngineInfo, AssembleParams, AssembleResult, IngestParams,
|
|
25
|
+
export type { ContextEngine, ContextEngineInfo, AssembleParams, AssembleResult, IngestParams, CompactResult, AfterTurnParams, TokenEstimator, SummarizeFunction, MessageSelector, SelectResult, SelectOptions, Compressor, CompressParams, CompressResult, BudgetAllocator, BudgetAllocateParams, BudgetAllocateResult, } from './harness/context/types.js';
|
|
26
26
|
export { setRunTelemetryFactory, getRunTelemetryFactory } from './harness/observability/run-telemetry.js';
|
|
27
27
|
export type { RunTelemetry, RunTelemetryFactory } from './harness/observability/run-telemetry.js';
|
|
28
28
|
export { createRunTelemetry } from './integration/observability/run-telemetry.js';
|
|
@@ -36,6 +36,20 @@ export type { HarnessLoopEvent, BudgetControlEvent, ControlStopMetric, PolicyUni
|
|
|
36
36
|
export { SessionAwareRunner } from './harness/run/runner.js';
|
|
37
37
|
export { DEFAULT_TOOL_ISOLATION, resolveToolIsolationCwd, } from './harness/extension/execution-environment/isolation.js';
|
|
38
38
|
export type { ToolIsolationMode } from './harness/extension/execution-environment/isolation.js';
|
|
39
|
+
export { TurnFileUndoLog, commitSessionFileUndo, discardSessionFileUndo, resolveSessionUndoPaths, resolveSessionUndoOnClose, createUnconfiguredFileEffects, createUnconfiguredMemoryEffects, } from './harness/extension/execution-environment/undo-log.js';
|
|
40
|
+
export { TurnMemoryJournal, JournaledMemoryStore, createMemoryRestorer, discardMemoryUndo, } from './harness/extension/execution-environment/memory-undo.js';
|
|
41
|
+
export type { MemoryUndoEntry, MemoryEffectRestorer, DiscardMemoryEffectsResult, } from './harness/extension/execution-environment/memory-undo.js';
|
|
42
|
+
export type { MemoryEffectJournal, MemoryEffectDomain } from '@octopi-agent/core/types/tools.js';
|
|
43
|
+
export { resolveEffectiveEffectPolicy, isPathAllowed, isToolAllowedOnSurface, DEFAULT_EFFECT_RUN_MODE, readSessionEffectOverrides, normalizeTransactionRoots, mergeTransactionRoots, SESSION_EFFECT_OVERRIDES_KEY, } from './harness/extension/execution-environment/effect-policy.js';
|
|
44
|
+
export { ProcessSandbox, createProcessSandbox, assessL4ProcessMinimum, probeProcessIsolation, scrubEnv, killProcessTree, supervisedSpawnProfile, } from './harness/extension/execution-environment/index.js';
|
|
45
|
+
export type { ProcessIsolationProfile, IsolationBackend, L4ProcessAssessment, } from './harness/extension/execution-environment/process-isolation.js';
|
|
46
|
+
export { runWithToolLimits, resolveToolTimeoutMs, ToolTimeoutError, } from './harness/extension/execution-environment/resource-limits.js';
|
|
47
|
+
export type { EffectIntent, ConfirmEffect, ConfirmEffectDecision, UntrustedAdmission, ToolSurface, SecurityDegradation, SessionEffectOverrides, } from './harness/extension/execution-environment/effect-policy.js';
|
|
48
|
+
export type { EffectRunMode, EffectPolicyConfig, EffectiveEffectPolicy, PathContainment, ShellEscapePolicy, } from './harness/extension/execution-environment/effect-policy.js';
|
|
49
|
+
export { scanOrphanSessionUndo, } from './harness/extension/execution-environment/undo-log.js';
|
|
50
|
+
export type { SessionUndoPaths, FileUndoEntry, DiscardFileEffectsResult, DiscardConflictReason, EditResendResult, NotReversedEffects, NotReversedReason, UndoLimitConfig, OrphanUndoDir, } from './harness/extension/execution-environment/undo-log.js';
|
|
51
|
+
export type { ShellJournalMode } from './harness/extension/execution-environment/effect-policy.js';
|
|
52
|
+
export type { ToolFileEffects } from '@octopi-agent/core/types/tools.js';
|
|
39
53
|
export { InProcessSessionLock } from './harness/run/concurrency/session-lease.js';
|
|
40
54
|
export type { SessionLease } from './harness/run/concurrency/session-lease.js';
|
|
41
55
|
export { SessionAclService, BUILTIN_SESSION_ROLES, computeEffectiveRights, } from './harness/governance/session-acl/index.js';
|
|
@@ -69,8 +83,9 @@ export type { SkillDefinition, SkillManager } from './harness/extension/plugin-e
|
|
|
69
83
|
/** 产品装配 DTO(非 Kernel);ModelInfo/ToolPolicy 仍从 core/types 导出 */
|
|
70
84
|
export type { AgentPersona, ModelConfig, AgentDefinition } from './harness/shared/types/agent-definition.js';
|
|
71
85
|
export { DefaultToolBus } from './harness/extension/plugin-ecosystem/tools/tool-bus.js';
|
|
86
|
+
export { buildToolLlmParameters, prepareHandlerArgs, readToolCallPurpose, resolveToolCallPurpose, sanitizeToolJsonSchema, toolDeclaresPurpose, TOOL_PURPOSE_PARAM, } from './harness/agent/tool-purpose.js';
|
|
72
87
|
export { createClientTool, makeClientToolCallId, ClientToolRegistry, DEFAULT_CLIENT_TOOL_TIMEOUT_MS, } from './harness/extension/plugin-ecosystem/client-tools/index.js';
|
|
73
|
-
export type { ClientToolCall, ClientToolCallId, ClientToolCallOutcome, ClientToolDescriptor, ClientToolDeviceMeta, ClientToolErrorReason, ClientToolInvoker, ClientToolInteraction, ClientToolName, ClientToolProvider, ClientToolResult, ClientToolSensitivity, ClientToolRouteDecision, } from './harness/extension/plugin-ecosystem/client-tools/index.js';
|
|
88
|
+
export type { ClientToolCall, ClientToolCallId, ClientToolCallOutcome, ClientToolDescriptor, ClientToolDeviceMeta, ClientToolErrorReason, ClientToolInvoker, ClientToolInteraction, ClientToolName, ClientToolProvider, ClientToolFileRef, ClientToolResult, ClientToolSensitivity, ClientToolRouteDecision, } from './harness/extension/plugin-ecosystem/client-tools/index.js';
|
|
74
89
|
export { getBuiltinTools, createShellTool, createFileReadTool, createFileWriteTool, createFileListTool } from './harness/extension/plugin-ecosystem/tools/builtin.js';
|
|
75
90
|
export { createToolSet } from './harness/extension/plugin-ecosystem/tools/tool-set.js';
|
|
76
91
|
export { createSummaryPort, applyToolOutputGate, createCompactEngine } from './harness/context/capabilities/index.js';
|
|
@@ -85,10 +100,8 @@ export { createSessionHistoryTools, createSessionSearchTool, createSessionReadTo
|
|
|
85
100
|
export type { SessionHistoryPort, SessionHistoryQuery, SessionHistorySearchResult, } from './harness/session/history/index.js';
|
|
86
101
|
export { buildFromConfig } from './harness/agent/config-bridge.js';
|
|
87
102
|
export type { BuiltAgent } from './harness/agent/config-bridge.js';
|
|
88
|
-
export { DefaultAgentRegistry,
|
|
89
|
-
export type {
|
|
90
|
-
export type { AgentRegistry, AgentInfo, AgentQuery, AgentRelation, AgentRelationType } from './harness/collaboration/multi-agent/agent-registry-types.js';
|
|
91
|
-
export { AgentRegistryEvents } from './harness/collaboration/multi-agent/agent-registry-types.js';
|
|
103
|
+
export { DefaultAgentRegistry, DelegationStore, DelegateService, DelegateResolutionError, InProcessTransport, RunnerChildRunPort, createChildRunExecutor, createDelegationNotifier, renderDelegationNotice, wireDelegation, createDelegationRuntime, AgentRegistryEvents, DelegationEvents, DELEGATION_SCHEMA_VERSION, } from './harness/collaboration/delegation/index.js';
|
|
104
|
+
export type { Delegation, DelegateRequest, DelegateResult, AgentHandle, AgentRegistry, AgentInfo, AgentQuery, AgentRelation, AgentRelationType, AgentDelegationPolicy, DelegateTransport, DelegatableAgent, DelegationRuntime, } from './harness/collaboration/delegation/index.js';
|
|
92
105
|
export { JsonlSessionStore } from './integration/storage/jsonl.js';
|
|
93
106
|
export { InMemorySessionStore } from './integration/storage/memory.js';
|
|
94
107
|
export { SessionArchiveManager } from './integration/storage/archive-manager.js';
|
|
@@ -112,10 +125,11 @@ export type { EngineConfig } from './config-schema/engine.js';
|
|
|
112
125
|
export { getBuiltinModelInfo, mergeWithBuiltinInfo } from './builtin-model-info.js';
|
|
113
126
|
export * from '@octopi-agent/core/types.js';
|
|
114
127
|
export { getTextContent, hasMediaContent } from '@octopi-agent/core/types.js';
|
|
115
|
-
export type { AsyncTaskStore, AsyncTaskRecord } from './harness/collaboration/orchestration/async-task-store.js';
|
|
116
128
|
export type { MemoryStore, MemoryEntry, MemoryType, MemoryQuery, MemoryStats, WisdomStore, WisdomEntry, WisdomStatus, WisdomOrigin, WisdomKind, WisdomScenario, WisdomEffect, WisdomDerivation, WisdomOutcomes, AdmitWisdomInput, AdmitWisdomResult, WisdomInjectQuery, WisdomInjectPick, WisdomStats, ConceptGraphStore, ConceptNode, ConceptEdge, ConceptGraph, ConceptKind, ConceptRelationType, ConceptStatus, EvidenceClass, EdgeBasis, AdmitConceptInput, AdmitConceptResult, AdmitEdgeInput, AdmitEdgeResult, SpreadingActivateOptions, ActivatedGraph, ConceptGraphStats, DecayResult, MergeCandidate, ConceptGateReason, KnowledgeCatalogItem, KnowledgeCatalogProvider, Planner, Reflector, AgentState, } from './harness/index.js';
|
|
117
129
|
export type { McpClient, McpManager, McpServerConfig, McpToolDefinition, McpToolResult, } from './harness/extension/plugin-ecosystem/mcp/types.js';
|
|
118
|
-
export type { MessageChannel, ProcessMessage, } from './harness/collaboration/
|
|
119
|
-
export type {
|
|
130
|
+
export type { MessageChannel, ProcessMessage, } from './harness/collaboration/delegation/message-channel-types.js';
|
|
131
|
+
export type { HitlDecision } from '@octopi-agent/core/types/tools.js';
|
|
132
|
+
export { HitlDecisionCache, defaultHitlCache, resolveHitlDecision, } from './harness/governance/human-in-the-loop/decision-cache.js';
|
|
133
|
+
export type { HitlChannel, HitlCacheScope, } from './harness/governance/human-in-the-loop/decision-cache.js';
|
|
120
134
|
export type { SandboxProvider, Workspace, IsolationLevel, SandboxConfig, SandboxResult, } from './harness/extension/execution-environment/types.js';
|
|
121
135
|
export type { EventSource, EventSourceDescriptor, ExternalEvent, } from './harness/activation/event-source-types.js';
|
package/dist/index.js
CHANGED
|
@@ -25,6 +25,12 @@ export { AgentBuilder, createAgent, isSubsystemAllowed, discoverSubsystemSpecs }
|
|
|
25
25
|
export { Agent } from './harness/run/agent/index.js';
|
|
26
26
|
export { SessionAwareRunner } from './harness/run/runner.js';
|
|
27
27
|
export { DEFAULT_TOOL_ISOLATION, resolveToolIsolationCwd, } from './harness/extension/execution-environment/isolation.js';
|
|
28
|
+
export { TurnFileUndoLog, commitSessionFileUndo, discardSessionFileUndo, resolveSessionUndoPaths, resolveSessionUndoOnClose, createUnconfiguredFileEffects, createUnconfiguredMemoryEffects, } from './harness/extension/execution-environment/undo-log.js';
|
|
29
|
+
export { TurnMemoryJournal, JournaledMemoryStore, createMemoryRestorer, discardMemoryUndo, } from './harness/extension/execution-environment/memory-undo.js';
|
|
30
|
+
export { resolveEffectiveEffectPolicy, isPathAllowed, isToolAllowedOnSurface, DEFAULT_EFFECT_RUN_MODE, readSessionEffectOverrides, normalizeTransactionRoots, mergeTransactionRoots, SESSION_EFFECT_OVERRIDES_KEY, } from './harness/extension/execution-environment/effect-policy.js';
|
|
31
|
+
export { ProcessSandbox, createProcessSandbox, assessL4ProcessMinimum, probeProcessIsolation, scrubEnv, killProcessTree, supervisedSpawnProfile, } from './harness/extension/execution-environment/index.js';
|
|
32
|
+
export { runWithToolLimits, resolveToolTimeoutMs, ToolTimeoutError, } from './harness/extension/execution-environment/resource-limits.js';
|
|
33
|
+
export { scanOrphanSessionUndo, } from './harness/extension/execution-environment/undo-log.js';
|
|
28
34
|
export { InProcessSessionLock } from './harness/run/concurrency/session-lease.js';
|
|
29
35
|
export { SessionAclService, BUILTIN_SESSION_ROLES, computeEffectiveRights, } from './harness/governance/session-acl/index.js';
|
|
30
36
|
export { loadPersona, composePersonas, PersonaSource } from './harness/agent/persona.js';
|
|
@@ -45,6 +51,7 @@ export { CapabilityRegistry } from './harness/extension/plugin-ecosystem/plugins
|
|
|
45
51
|
export { validateManifest, parseManifest } from './harness/extension/plugin-ecosystem/plugins/manifest.js';
|
|
46
52
|
export { DefaultSkillManager, FileSystemSkillSource } from './harness/extension/plugin-ecosystem/skills/manager.js';
|
|
47
53
|
export { DefaultToolBus } from './harness/extension/plugin-ecosystem/tools/tool-bus.js';
|
|
54
|
+
export { buildToolLlmParameters, prepareHandlerArgs, readToolCallPurpose, resolveToolCallPurpose, sanitizeToolJsonSchema, toolDeclaresPurpose, TOOL_PURPOSE_PARAM, } from './harness/agent/tool-purpose.js';
|
|
48
55
|
export { createClientTool, makeClientToolCallId, ClientToolRegistry, DEFAULT_CLIENT_TOOL_TIMEOUT_MS, } from './harness/extension/plugin-ecosystem/client-tools/index.js';
|
|
49
56
|
export { getBuiltinTools, createShellTool, createFileReadTool, createFileWriteTool, createFileListTool } from './harness/extension/plugin-ecosystem/tools/builtin.js';
|
|
50
57
|
export { createToolSet } from './harness/extension/plugin-ecosystem/tools/tool-set.js';
|
|
@@ -54,8 +61,8 @@ export { createWebSearchTool } from './harness/extension/plugin-ecosystem/tools/
|
|
|
54
61
|
export { createSessionHistoryPort, resolveHistoryAccess, } from './harness/session/history/index.js';
|
|
55
62
|
export { createSessionHistoryTools, createSessionSearchTool, createSessionReadTool, } from './harness/extension/plugin-ecosystem/tools/session-history.js';
|
|
56
63
|
export { buildFromConfig } from './harness/agent/config-bridge.js';
|
|
57
|
-
|
|
58
|
-
export { AgentRegistryEvents } from './harness/collaboration/
|
|
64
|
+
// ── Delegation(L2 委派契约层;arch/delegation.md)──
|
|
65
|
+
export { DefaultAgentRegistry, DelegationStore, DelegateService, DelegateResolutionError, InProcessTransport, RunnerChildRunPort, createChildRunExecutor, createDelegationNotifier, renderDelegationNotice, wireDelegation, createDelegationRuntime, AgentRegistryEvents, DelegationEvents, DELEGATION_SCHEMA_VERSION, } from './harness/collaboration/delegation/index.js';
|
|
59
66
|
// ============================================================
|
|
60
67
|
// Integration 层(engine 库能力)
|
|
61
68
|
// ============================================================
|
|
@@ -80,3 +87,4 @@ export { getBuiltinModelInfo, mergeWithBuiltinInfo } from './builtin-model-info.
|
|
|
80
87
|
// ============================================================
|
|
81
88
|
export * from '@octopi-agent/core/types.js';
|
|
82
89
|
export { getTextContent, hasMediaContent } from '@octopi-agent/core/types.js';
|
|
90
|
+
export { HitlDecisionCache, defaultHitlCache, resolveHitlDecision, } from './harness/governance/human-in-the-loop/decision-cache.js';
|
|
@@ -72,6 +72,16 @@ export declare class AnthropicProvider implements ModelProvider {
|
|
|
72
72
|
* 检查 provider 是否可用
|
|
73
73
|
*/
|
|
74
74
|
isAvailable(): Promise<boolean>;
|
|
75
|
+
/**
|
|
76
|
+
* 构造实际发送的请求体(wire dump 观测用)
|
|
77
|
+
*
|
|
78
|
+
* 与 chat/stream 共用 {@link toAnthropicRequest},保证落盘内容与真实请求一致。
|
|
79
|
+
*
|
|
80
|
+
* @param request - 原始 LLM 请求
|
|
81
|
+
* @param mode - chat 或 stream
|
|
82
|
+
* @returns 实际发送的请求体
|
|
83
|
+
*/
|
|
84
|
+
wireBodyFor(request: LLMRequest, mode: 'chat' | 'stream'): Record<string, unknown>;
|
|
75
85
|
/**
|
|
76
86
|
* OpenAI 格式 → Anthropic 格式
|
|
77
87
|
*/
|
|
@@ -196,6 +196,9 @@ export class AnthropicProvider {
|
|
|
196
196
|
if (delta?.type === 'text_delta') {
|
|
197
197
|
yield { type: 'content', content: delta.text ?? '' };
|
|
198
198
|
}
|
|
199
|
+
else if (delta?.type === 'thinking_delta') {
|
|
200
|
+
yield { type: 'reasoning', content: delta.thinking ?? '' };
|
|
201
|
+
}
|
|
199
202
|
else if (delta?.type === 'input_json_delta') {
|
|
200
203
|
toolArgsBuffer += delta.partial_json ?? '';
|
|
201
204
|
}
|
|
@@ -283,6 +286,19 @@ export class AnthropicProvider {
|
|
|
283
286
|
}
|
|
284
287
|
}
|
|
285
288
|
// ===== 格式转换 =====
|
|
289
|
+
/**
|
|
290
|
+
* 构造实际发送的请求体(wire dump 观测用)
|
|
291
|
+
*
|
|
292
|
+
* 与 chat/stream 共用 {@link toAnthropicRequest},保证落盘内容与真实请求一致。
|
|
293
|
+
*
|
|
294
|
+
* @param request - 原始 LLM 请求
|
|
295
|
+
* @param mode - chat 或 stream
|
|
296
|
+
* @returns 实际发送的请求体
|
|
297
|
+
*/
|
|
298
|
+
wireBodyFor(request, mode) {
|
|
299
|
+
const body = this.toAnthropicRequest(request);
|
|
300
|
+
return mode === 'stream' ? { ...body, stream: true } : body;
|
|
301
|
+
}
|
|
286
302
|
/**
|
|
287
303
|
* OpenAI 格式 → Anthropic 格式
|
|
288
304
|
*/
|
|
@@ -376,7 +392,7 @@ export class AnthropicProvider {
|
|
|
376
392
|
return {
|
|
377
393
|
name: fn?.name ?? tool.name,
|
|
378
394
|
description: fn?.description ?? tool.description,
|
|
379
|
-
input_schema: fn?.parameters ?? tool.parameters ?? { type: 'object', properties: {} },
|
|
395
|
+
input_schema: stripSchemaKeywords(fn?.parameters ?? tool.parameters ?? { type: 'object', properties: {} }),
|
|
380
396
|
};
|
|
381
397
|
}
|
|
382
398
|
/**
|
|
@@ -430,3 +446,30 @@ export class AnthropicProvider {
|
|
|
430
446
|
}
|
|
431
447
|
}
|
|
432
448
|
}
|
|
449
|
+
/** 去掉部分 API 会拒绝的 JSON Schema 扩展关键字 */
|
|
450
|
+
function stripSchemaKeywords(node) {
|
|
451
|
+
if (Array.isArray(node))
|
|
452
|
+
return node.map(stripSchemaKeywords);
|
|
453
|
+
if (!node || typeof node !== 'object')
|
|
454
|
+
return node;
|
|
455
|
+
const src = node;
|
|
456
|
+
const out = {};
|
|
457
|
+
if (typeof src.type === 'string')
|
|
458
|
+
out.type = src.type;
|
|
459
|
+
if (typeof src.description === 'string')
|
|
460
|
+
out.description = src.description;
|
|
461
|
+
if (Array.isArray(src.enum))
|
|
462
|
+
out.enum = src.enum;
|
|
463
|
+
if (src.properties && typeof src.properties === 'object') {
|
|
464
|
+
const props = {};
|
|
465
|
+
for (const [k, v] of Object.entries(src.properties)) {
|
|
466
|
+
props[k] = stripSchemaKeywords(v);
|
|
467
|
+
}
|
|
468
|
+
out.properties = props;
|
|
469
|
+
}
|
|
470
|
+
if (Array.isArray(src.required))
|
|
471
|
+
out.required = src.required.filter((x) => typeof x === 'string');
|
|
472
|
+
if (src.items !== undefined)
|
|
473
|
+
out.items = stripSchemaKeywords(src.items);
|
|
474
|
+
return out;
|
|
475
|
+
}
|
|
@@ -76,6 +76,16 @@ export declare class OpenAIProvider implements ModelProvider {
|
|
|
76
76
|
* 检查 provider 是否可用
|
|
77
77
|
*/
|
|
78
78
|
isAvailable(): Promise<boolean>;
|
|
79
|
+
/**
|
|
80
|
+
* 构造实际发送的请求体(wire dump 观测用)
|
|
81
|
+
*
|
|
82
|
+
* 与 chat/stream 共用 {@link buildRequestBody},保证落盘内容与真实请求一致。
|
|
83
|
+
*
|
|
84
|
+
* @param request - 原始 LLM 请求
|
|
85
|
+
* @param mode - chat 或 stream
|
|
86
|
+
* @returns 实际发送的请求体
|
|
87
|
+
*/
|
|
88
|
+
wireBodyFor(request: LLMRequest, mode: 'chat' | 'stream'): Record<string, unknown>;
|
|
79
89
|
/**
|
|
80
90
|
* 构建 OpenAI API 请求体
|
|
81
91
|
*/
|
|
@@ -217,6 +217,21 @@ export class OpenAIProvider {
|
|
|
217
217
|
// ================================================================
|
|
218
218
|
// 内部方法
|
|
219
219
|
// ================================================================
|
|
220
|
+
/**
|
|
221
|
+
* 构造实际发送的请求体(wire dump 观测用)
|
|
222
|
+
*
|
|
223
|
+
* 与 chat/stream 共用 {@link buildRequestBody},保证落盘内容与真实请求一致。
|
|
224
|
+
*
|
|
225
|
+
* @param request - 原始 LLM 请求
|
|
226
|
+
* @param mode - chat 或 stream
|
|
227
|
+
* @returns 实际发送的请求体
|
|
228
|
+
*/
|
|
229
|
+
wireBodyFor(request, mode) {
|
|
230
|
+
const body = this.buildRequestBody(request);
|
|
231
|
+
return mode === 'stream'
|
|
232
|
+
? { ...body, stream: true, stream_options: { include_usage: true } }
|
|
233
|
+
: body;
|
|
234
|
+
}
|
|
220
235
|
/**
|
|
221
236
|
* 构建 OpenAI API 请求体
|
|
222
237
|
*/
|
|
@@ -238,7 +253,19 @@ export class OpenAIProvider {
|
|
|
238
253
|
body.max_tokens = cap;
|
|
239
254
|
}
|
|
240
255
|
if (request.tools && request.tools.length > 0) {
|
|
241
|
-
|
|
256
|
+
// 兼容接口可能拒绝 maxLength 等未知 schema 关键字
|
|
257
|
+
body.tools = request.tools.map((tool) => {
|
|
258
|
+
const params = tool?.function?.parameters;
|
|
259
|
+
if (!params)
|
|
260
|
+
return tool;
|
|
261
|
+
return {
|
|
262
|
+
...tool,
|
|
263
|
+
function: {
|
|
264
|
+
...tool.function,
|
|
265
|
+
parameters: sanitizeOpenAiJsonSchema(params),
|
|
266
|
+
},
|
|
267
|
+
};
|
|
268
|
+
});
|
|
242
269
|
}
|
|
243
270
|
return body;
|
|
244
271
|
}
|
|
@@ -387,7 +414,9 @@ export class OpenAIProvider {
|
|
|
387
414
|
if (delta.content)
|
|
388
415
|
chunks.push({ type: 'content', content: delta.content });
|
|
389
416
|
if (delta.reasoning)
|
|
390
|
-
chunks.push({ type: '
|
|
417
|
+
chunks.push({ type: 'reasoning', content: delta.reasoning });
|
|
418
|
+
if (delta.reasoning_content)
|
|
419
|
+
chunks.push({ type: 'reasoning', content: delta.reasoning_content });
|
|
391
420
|
if (delta.tool_calls) {
|
|
392
421
|
for (const tc of delta.tool_calls) {
|
|
393
422
|
const idx = tc.index ?? 0;
|
|
@@ -427,3 +456,30 @@ export class OpenAIProvider {
|
|
|
427
456
|
}
|
|
428
457
|
}
|
|
429
458
|
}
|
|
459
|
+
/** 仅保留 OpenAI function calling 可识别的 JSON Schema 关键字 */
|
|
460
|
+
function sanitizeOpenAiJsonSchema(node) {
|
|
461
|
+
if (Array.isArray(node))
|
|
462
|
+
return node.map(sanitizeOpenAiJsonSchema);
|
|
463
|
+
if (!node || typeof node !== 'object')
|
|
464
|
+
return node;
|
|
465
|
+
const src = node;
|
|
466
|
+
const out = {};
|
|
467
|
+
if (typeof src.type === 'string')
|
|
468
|
+
out.type = src.type;
|
|
469
|
+
if (typeof src.description === 'string')
|
|
470
|
+
out.description = src.description;
|
|
471
|
+
if (Array.isArray(src.enum))
|
|
472
|
+
out.enum = src.enum;
|
|
473
|
+
if (src.properties && typeof src.properties === 'object') {
|
|
474
|
+
const props = {};
|
|
475
|
+
for (const [k, v] of Object.entries(src.properties)) {
|
|
476
|
+
props[k] = sanitizeOpenAiJsonSchema(v);
|
|
477
|
+
}
|
|
478
|
+
out.properties = props;
|
|
479
|
+
}
|
|
480
|
+
if (Array.isArray(src.required))
|
|
481
|
+
out.required = src.required.filter((x) => typeof x === 'string');
|
|
482
|
+
if (src.items !== undefined)
|
|
483
|
+
out.items = sanitizeOpenAiJsonSchema(src.items);
|
|
484
|
+
return out;
|
|
485
|
+
}
|