@octopi-agent/engine 0.70.7 → 0.90.11
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 +81 -5
- package/dist/config-schema/context.d.ts +24 -5
- package/dist/config-schema/context.js +28 -1
- package/dist/config-schema/engine.d.ts +205 -13
- package/dist/config-schema/engine.js +31 -2
- package/dist/config-schema/governance.d.ts +95 -0
- package/dist/config-schema/governance.js +93 -1
- package/dist/config-schema/models.d.ts +3 -3
- 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 +13 -0
- package/dist/config-schema/shared.js +22 -0
- package/dist/config-schema/substrate.d.ts +2 -2
- package/dist/config-schema/subsystems.d.ts +1 -1
- package/dist/config-schema/subsystems.js +2 -1
- package/dist/config.d.ts +201 -8
- package/dist/config.js +105 -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 +50 -5
- package/dist/harness/agent/builder.js +189 -59
- package/dist/harness/agent/config-bridge.d.ts +33 -25
- package/dist/harness/agent/config-bridge.js +84 -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 +46 -0
- package/dist/harness/agent/tool-purpose.js +127 -0
- package/dist/harness/agent/wire-agent-builder.d.ts +133 -0
- package/dist/harness/agent/wire-agent-builder.js +370 -0
- package/dist/harness/collaboration/autonomous-subsystem/boundary/validator.d.ts +11 -1
- package/dist/harness/collaboration/autonomous-subsystem/boundary/validator.js +11 -1
- package/dist/harness/collaboration/autonomous-subsystem/loader.d.ts +13 -0
- package/dist/harness/collaboration/autonomous-subsystem/loader.js +16 -1
- package/dist/harness/collaboration/autonomous-subsystem/runtime.d.ts +8 -1
- package/dist/harness/collaboration/autonomous-subsystem/runtime.js +17 -9
- 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 +85 -1
- package/dist/harness/context/layer-types.js +110 -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 +73 -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 +258 -0
- package/dist/harness/extension/execution-environment/effect-policy.js +358 -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/isolation.js +5 -1
- 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 +521 -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 +51 -0
- package/dist/harness/extension/plugin-ecosystem/tools/allowlisted-run.js +153 -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 +241 -70
- package/dist/harness/extension/plugin-ecosystem/tools/git-runner.d.ts +31 -0
- package/dist/harness/extension/plugin-ecosystem/tools/git-runner.js +104 -0
- package/dist/harness/extension/plugin-ecosystem/tools/git-status-snapshot.d.ts +111 -0
- package/dist/harness/extension/plugin-ecosystem/tools/git-status-snapshot.js +197 -0
- package/dist/harness/extension/plugin-ecosystem/tools/git-tools.d.ts +27 -0
- package/dist/harness/extension/plugin-ecosystem/tools/git-tools.js +463 -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 +6 -0
- package/dist/harness/extension/plugin-ecosystem/tools/index.js +4 -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 +16 -12
- package/dist/harness/index.js +10 -6
- package/dist/harness/knowledge/file-identity.d.ts +8 -0
- package/dist/harness/knowledge/file-identity.js +26 -1
- 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 +8 -5
- package/dist/harness/knowledge/index-store.d.ts +31 -4
- package/dist/harness/knowledge/index-store.js +121 -39
- package/dist/harness/knowledge/index.d.ts +2 -2
- package/dist/harness/knowledge/index.js +1 -1
- package/dist/harness/knowledge/ingest.d.ts +115 -115
- package/dist/harness/knowledge/ingest.js +154 -151
- package/dist/harness/knowledge/job-control-state.js +4 -4
- package/dist/harness/knowledge/job-control.js +11 -11
- package/dist/harness/knowledge/knowledge-serve-child.js +1 -1
- 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/purge.js +4 -1
- 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-coverage.js +3 -1
- 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 +53 -2
- 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 +80 -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 +117 -16
- package/dist/harness/run/runner.js +668 -157
- package/dist/harness/session/attachments/llm-intent.js +17 -17
- package/dist/harness/session/history/port.js +16 -5
- package/dist/harness/session/in-memory-store.d.ts +6 -0
- package/dist/harness/session/in-memory-store.js +55 -3
- 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/title.js +25 -9
- package/dist/harness/session/types.d.ts +35 -0
- package/dist/harness/shared/events/agent-event-map.d.ts +39 -0
- package/dist/harness/shared/events/agent-event-map.js +2 -0
- package/dist/harness/shared/types/agent-definition.d.ts +23 -0
- package/dist/index.d.ts +25 -9
- package/dist/index.js +11 -2
- package/dist/integration/observability/run-telemetry.d.ts +8 -0
- package/dist/integration/observability/run-telemetry.js +31 -8
- package/dist/integration/observability/trace-collector.js +26 -4
- package/dist/integration/observability/trace-events.d.ts +1 -0
- package/dist/integration/observability/trace-events.js +2 -0
- package/dist/integration/observability/trace-logger.js +27 -17
- 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 +29 -0
- package/dist/integration/storage/jsonl.js +243 -41
- package/dist/integration/storage/session-index.js +63 -8
- package/dist/paths.d.ts +19 -0
- package/dist/paths.js +38 -1
- 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/safety-guard/config.yaml +3 -1
- 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
package/package.json
CHANGED
|
@@ -1,115 +1,115 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@octopi-agent/engine",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "Octopi Engine — Harness product domains, library integrations, and embeddable Agent.run()",
|
|
5
|
-
"type": "module",
|
|
6
|
-
"license": "Apache-2.0",
|
|
7
|
-
"main": "./dist/index.js",
|
|
8
|
-
"types": "./dist/index.d.ts",
|
|
9
|
-
"exports": {
|
|
10
|
-
".": {
|
|
11
|
-
"types": "./dist/index.d.ts",
|
|
12
|
-
"import": "./dist/index.js"
|
|
13
|
-
},
|
|
14
|
-
"./harness": {
|
|
15
|
-
"types": "./dist/harness/index.d.ts",
|
|
16
|
-
"import": "./dist/harness/index.js"
|
|
17
|
-
},
|
|
18
|
-
"./harness/orchestration": {
|
|
19
|
-
"types": "./dist/harness/collaboration/orchestration/index.d.ts",
|
|
20
|
-
"import": "./dist/harness/collaboration/orchestration/index.js"
|
|
21
|
-
},
|
|
22
|
-
"./integration": {
|
|
23
|
-
"types": "./dist/integration/index.d.ts",
|
|
24
|
-
"import": "./dist/integration/index.js"
|
|
25
|
-
},
|
|
26
|
-
"./plugin-sdk/plugin-entry": {
|
|
27
|
-
"types": "./dist/harness/extension/plugin-ecosystem/plugins/entry.d.ts",
|
|
28
|
-
"import": "./dist/harness/extension/plugin-ecosystem/plugins/entry.js"
|
|
29
|
-
},
|
|
30
|
-
"./plugin-sdk/api": {
|
|
31
|
-
"types": "./dist/harness/extension/plugin-ecosystem/plugins/api.d.ts",
|
|
32
|
-
"import": "./dist/harness/extension/plugin-ecosystem/plugins/api.js"
|
|
33
|
-
},
|
|
34
|
-
"./plugin-sdk/manifest": {
|
|
35
|
-
"types": "./dist/harness/extension/plugin-ecosystem/plugins/manifest.d.ts",
|
|
36
|
-
"import": "./dist/harness/extension/plugin-ecosystem/plugins/manifest.js"
|
|
37
|
-
},
|
|
38
|
-
"./plugin-sdk/capability": {
|
|
39
|
-
"types": "./dist/harness/extension/plugin-ecosystem/plugins/capability.d.ts",
|
|
40
|
-
"import": "./dist/harness/extension/plugin-ecosystem/plugins/capability.js"
|
|
41
|
-
},
|
|
42
|
-
"./plugin-sdk/loader": {
|
|
43
|
-
"types": "./dist/harness/extension/plugin-ecosystem/plugins/loader.d.ts",
|
|
44
|
-
"import": "./dist/harness/extension/plugin-ecosystem/plugins/loader.js"
|
|
45
|
-
},
|
|
46
|
-
"./plugin-sdk/manager": {
|
|
47
|
-
"types": "./dist/harness/extension/plugin-ecosystem/plugins/manager.d.ts",
|
|
48
|
-
"import": "./dist/harness/extension/plugin-ecosystem/plugins/manager.js"
|
|
49
|
-
},
|
|
50
|
-
"./package.json": "./package.json",
|
|
51
|
-
"./harness/*": {
|
|
52
|
-
"types": "./dist/harness/*",
|
|
53
|
-
"import": "./dist/harness/*"
|
|
54
|
-
},
|
|
55
|
-
"./integration/*": {
|
|
56
|
-
"types": "./dist/integration/*",
|
|
57
|
-
"import": "./dist/integration/*"
|
|
58
|
-
},
|
|
59
|
-
"./config-schema/*": {
|
|
60
|
-
"types": "./dist/config-schema/*",
|
|
61
|
-
"import": "./dist/config-schema/*"
|
|
62
|
-
},
|
|
63
|
-
"./*": {
|
|
64
|
-
"types": "./dist/*",
|
|
65
|
-
"import": "./dist/*"
|
|
66
|
-
}
|
|
67
|
-
},
|
|
68
|
-
"files": [
|
|
69
|
-
"dist",
|
|
70
|
-
"LICENSE",
|
|
71
|
-
"NOTICE",
|
|
72
|
-
"README.md"
|
|
73
|
-
],
|
|
74
|
-
"scripts": {
|
|
75
|
-
"build": "tsc -p tsconfig.json && node ./scripts/copy-engine-assets.mjs",
|
|
76
|
-
"dev": "tsc -p tsconfig.json --watch"
|
|
77
|
-
},
|
|
78
|
-
"engines": {
|
|
79
|
-
"node": ">=24"
|
|
80
|
-
},
|
|
81
|
-
"dependencies": {
|
|
82
|
-
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
83
|
-
"@octopi-agent/core": "0.
|
|
84
|
-
"js-yaml": "^4.3.2",
|
|
85
|
-
"zod": "^4.4.3"
|
|
86
|
-
},
|
|
87
|
-
"optionalDependencies": {
|
|
88
|
-
"fflate": "^0.8.3",
|
|
89
|
-
"mammoth": "^1.13.0",
|
|
90
|
-
"officeparser": "^8.1.0",
|
|
91
|
-
"sqlite-vec": "^0.1.9",
|
|
92
|
-
"unpdf": "^1.8.1",
|
|
93
|
-
"xlsx": "^0.18.5"
|
|
94
|
-
},
|
|
95
|
-
"private": false,
|
|
96
|
-
"publishConfig": {
|
|
97
|
-
"access": "public"
|
|
98
|
-
},
|
|
99
|
-
"repository": {
|
|
100
|
-
"type": "git",
|
|
101
|
-
"url": "git+https://github.com/JK-Ai-Era/octopi.git",
|
|
102
|
-
"directory": "packages/engine"
|
|
103
|
-
},
|
|
104
|
-
"homepage": "https://github.com/JK-Ai-Era/octopi#readme",
|
|
105
|
-
"bugs": {
|
|
106
|
-
"url": "https://github.com/JK-Ai-Era/octopi/issues"
|
|
107
|
-
},
|
|
108
|
-
"keywords": [
|
|
109
|
-
"agent",
|
|
110
|
-
"ai",
|
|
111
|
-
"llm",
|
|
112
|
-
"octopi",
|
|
113
|
-
"harness"
|
|
114
|
-
]
|
|
115
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@octopi-agent/engine",
|
|
3
|
+
"version": "0.90.11",
|
|
4
|
+
"description": "Octopi Engine — Harness product domains, library integrations, and embeddable Agent.run()",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"license": "Apache-2.0",
|
|
7
|
+
"main": "./dist/index.js",
|
|
8
|
+
"types": "./dist/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"types": "./dist/index.d.ts",
|
|
12
|
+
"import": "./dist/index.js"
|
|
13
|
+
},
|
|
14
|
+
"./harness": {
|
|
15
|
+
"types": "./dist/harness/index.d.ts",
|
|
16
|
+
"import": "./dist/harness/index.js"
|
|
17
|
+
},
|
|
18
|
+
"./harness/orchestration": {
|
|
19
|
+
"types": "./dist/harness/collaboration/orchestration/index.d.ts",
|
|
20
|
+
"import": "./dist/harness/collaboration/orchestration/index.js"
|
|
21
|
+
},
|
|
22
|
+
"./integration": {
|
|
23
|
+
"types": "./dist/integration/index.d.ts",
|
|
24
|
+
"import": "./dist/integration/index.js"
|
|
25
|
+
},
|
|
26
|
+
"./plugin-sdk/plugin-entry": {
|
|
27
|
+
"types": "./dist/harness/extension/plugin-ecosystem/plugins/entry.d.ts",
|
|
28
|
+
"import": "./dist/harness/extension/plugin-ecosystem/plugins/entry.js"
|
|
29
|
+
},
|
|
30
|
+
"./plugin-sdk/api": {
|
|
31
|
+
"types": "./dist/harness/extension/plugin-ecosystem/plugins/api.d.ts",
|
|
32
|
+
"import": "./dist/harness/extension/plugin-ecosystem/plugins/api.js"
|
|
33
|
+
},
|
|
34
|
+
"./plugin-sdk/manifest": {
|
|
35
|
+
"types": "./dist/harness/extension/plugin-ecosystem/plugins/manifest.d.ts",
|
|
36
|
+
"import": "./dist/harness/extension/plugin-ecosystem/plugins/manifest.js"
|
|
37
|
+
},
|
|
38
|
+
"./plugin-sdk/capability": {
|
|
39
|
+
"types": "./dist/harness/extension/plugin-ecosystem/plugins/capability.d.ts",
|
|
40
|
+
"import": "./dist/harness/extension/plugin-ecosystem/plugins/capability.js"
|
|
41
|
+
},
|
|
42
|
+
"./plugin-sdk/loader": {
|
|
43
|
+
"types": "./dist/harness/extension/plugin-ecosystem/plugins/loader.d.ts",
|
|
44
|
+
"import": "./dist/harness/extension/plugin-ecosystem/plugins/loader.js"
|
|
45
|
+
},
|
|
46
|
+
"./plugin-sdk/manager": {
|
|
47
|
+
"types": "./dist/harness/extension/plugin-ecosystem/plugins/manager.d.ts",
|
|
48
|
+
"import": "./dist/harness/extension/plugin-ecosystem/plugins/manager.js"
|
|
49
|
+
},
|
|
50
|
+
"./package.json": "./package.json",
|
|
51
|
+
"./harness/*": {
|
|
52
|
+
"types": "./dist/harness/*",
|
|
53
|
+
"import": "./dist/harness/*"
|
|
54
|
+
},
|
|
55
|
+
"./integration/*": {
|
|
56
|
+
"types": "./dist/integration/*",
|
|
57
|
+
"import": "./dist/integration/*"
|
|
58
|
+
},
|
|
59
|
+
"./config-schema/*": {
|
|
60
|
+
"types": "./dist/config-schema/*",
|
|
61
|
+
"import": "./dist/config-schema/*"
|
|
62
|
+
},
|
|
63
|
+
"./*": {
|
|
64
|
+
"types": "./dist/*",
|
|
65
|
+
"import": "./dist/*"
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
"files": [
|
|
69
|
+
"dist",
|
|
70
|
+
"LICENSE",
|
|
71
|
+
"NOTICE",
|
|
72
|
+
"README.md"
|
|
73
|
+
],
|
|
74
|
+
"scripts": {
|
|
75
|
+
"build": "tsc -p tsconfig.json && node ./scripts/copy-engine-assets.mjs",
|
|
76
|
+
"dev": "tsc -p tsconfig.json --watch"
|
|
77
|
+
},
|
|
78
|
+
"engines": {
|
|
79
|
+
"node": ">=24"
|
|
80
|
+
},
|
|
81
|
+
"dependencies": {
|
|
82
|
+
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
83
|
+
"@octopi-agent/core": "0.90.11",
|
|
84
|
+
"js-yaml": "^4.3.2",
|
|
85
|
+
"zod": "^4.4.3"
|
|
86
|
+
},
|
|
87
|
+
"optionalDependencies": {
|
|
88
|
+
"fflate": "^0.8.3",
|
|
89
|
+
"mammoth": "^1.13.0",
|
|
90
|
+
"officeparser": "^8.1.0",
|
|
91
|
+
"sqlite-vec": "^0.1.9",
|
|
92
|
+
"unpdf": "^1.8.1",
|
|
93
|
+
"xlsx": "^0.18.5"
|
|
94
|
+
},
|
|
95
|
+
"private": false,
|
|
96
|
+
"publishConfig": {
|
|
97
|
+
"access": "public"
|
|
98
|
+
},
|
|
99
|
+
"repository": {
|
|
100
|
+
"type": "git",
|
|
101
|
+
"url": "git+https://github.com/JK-Ai-Era/octopi.git",
|
|
102
|
+
"directory": "packages/engine"
|
|
103
|
+
},
|
|
104
|
+
"homepage": "https://github.com/JK-Ai-Era/octopi#readme",
|
|
105
|
+
"bugs": {
|
|
106
|
+
"url": "https://github.com/JK-Ai-Era/octopi/issues"
|
|
107
|
+
},
|
|
108
|
+
"keywords": [
|
|
109
|
+
"agent",
|
|
110
|
+
"ai",
|
|
111
|
+
"llm",
|
|
112
|
+
"octopi",
|
|
113
|
+
"harness"
|
|
114
|
+
]
|
|
115
|
+
}
|
|
@@ -1,144 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* AgentRegistry — Agent 注册与发现契约
|
|
3
|
-
*
|
|
4
|
-
* @layer harness/collaboration/multi-agent — 多 Agent 产品契约,非 Core Kernel。
|
|
5
|
-
* 实现:DefaultAgentRegistry(registry.ts)。
|
|
6
|
-
*
|
|
7
|
-
* 设计原则:
|
|
8
|
-
* - 契约与实现同域;跨域只 import 本文件 types
|
|
9
|
-
* - 支持按能力(capability)发现 Agent
|
|
10
|
-
* - 支持 Agent 上下线通知
|
|
11
|
-
* - 支持多 Agent 拓扑描述
|
|
12
|
-
*/
|
|
13
|
-
/** Agent 注册信息 */
|
|
14
|
-
export interface AgentInfo {
|
|
15
|
-
/** Agent 唯一 ID */
|
|
16
|
-
id: string;
|
|
17
|
-
/** Agent 名称(人类可读) */
|
|
18
|
-
name: string;
|
|
19
|
-
/** Agent 描述 */
|
|
20
|
-
description?: string;
|
|
21
|
-
/** Agent 能力标签(用于发现) */
|
|
22
|
-
capabilities: string[];
|
|
23
|
-
/** Agent 元数据 */
|
|
24
|
-
metadata?: Record<string, unknown>;
|
|
25
|
-
/** 注册时间 */
|
|
26
|
-
registeredAt: number;
|
|
27
|
-
/** 最后活跃时间 */
|
|
28
|
-
lastActiveAt: number;
|
|
29
|
-
/** Agent 状态 */
|
|
30
|
-
status: 'active' | 'idle' | 'busy' | 'offline';
|
|
31
|
-
}
|
|
32
|
-
/** Agent 查询条件 */
|
|
33
|
-
export interface AgentQuery {
|
|
34
|
-
/** 按能力过滤 */
|
|
35
|
-
capabilities?: string[];
|
|
36
|
-
/** 按状态过滤 */
|
|
37
|
-
status?: AgentInfo['status'];
|
|
38
|
-
/** 按元数据过滤 */
|
|
39
|
-
metadata?: Record<string, unknown>;
|
|
40
|
-
}
|
|
41
|
-
/** Agent 间关系类型 */
|
|
42
|
-
export type AgentRelationType = 'peer' | 'superior' | 'subordinate' | 'pipeline' | 'depends';
|
|
43
|
-
/** Agent 间关系 */
|
|
44
|
-
export interface AgentRelation {
|
|
45
|
-
/** 关系来源 Agent */
|
|
46
|
-
from: string;
|
|
47
|
-
/** 关系目标 Agent */
|
|
48
|
-
to: string;
|
|
49
|
-
/** 关系类型 */
|
|
50
|
-
type: AgentRelationType;
|
|
51
|
-
/** 关系元数据 */
|
|
52
|
-
metadata?: Record<string, unknown>;
|
|
53
|
-
}
|
|
54
|
-
export declare const AgentRegistryEvents: {
|
|
55
|
-
/** Agent 注册 */
|
|
56
|
-
readonly AGENT_REGISTERED: "registry.agent.registered";
|
|
57
|
-
/** Agent 注销 */
|
|
58
|
-
readonly AGENT_UNREGISTERED: "registry.agent.unregistered";
|
|
59
|
-
/** Agent 状态变更 */
|
|
60
|
-
readonly AGENT_STATUS_CHANGED: "registry.agent.status_changed";
|
|
61
|
-
/** 关系添加 */
|
|
62
|
-
readonly RELATION_ADDED: "registry.relation.added";
|
|
63
|
-
/** 关系移除 */
|
|
64
|
-
readonly RELATION_REMOVED: "registry.relation.removed";
|
|
65
|
-
};
|
|
66
|
-
/**
|
|
67
|
-
* AgentRegistry 接口
|
|
68
|
-
*
|
|
69
|
-
* Agent 注册与发现的核心契约。
|
|
70
|
-
*/
|
|
71
|
-
export interface AgentRegistry {
|
|
72
|
-
/**
|
|
73
|
-
* 注册 Agent
|
|
74
|
-
*
|
|
75
|
-
* @param info - Agent 信息
|
|
76
|
-
*/
|
|
77
|
-
register(info: Omit<AgentInfo, 'registeredAt' | 'lastActiveAt'>): void;
|
|
78
|
-
/**
|
|
79
|
-
* 注销 Agent
|
|
80
|
-
*
|
|
81
|
-
* @param agentId - Agent ID
|
|
82
|
-
* @returns 是否成功注销
|
|
83
|
-
*/
|
|
84
|
-
unregister(agentId: string): boolean;
|
|
85
|
-
/**
|
|
86
|
-
* 获取 Agent 信息
|
|
87
|
-
*
|
|
88
|
-
* @param agentId - Agent ID
|
|
89
|
-
* @returns Agent 信息,不存在返回 undefined
|
|
90
|
-
*/
|
|
91
|
-
get(agentId: string): AgentInfo | undefined;
|
|
92
|
-
/**
|
|
93
|
-
* 查询 Agent
|
|
94
|
-
*
|
|
95
|
-
* @param query - 查询条件
|
|
96
|
-
* @returns 匹配的 Agent 列表
|
|
97
|
-
*/
|
|
98
|
-
query(query: AgentQuery): AgentInfo[];
|
|
99
|
-
/**
|
|
100
|
-
* 列出所有已注册 Agent
|
|
101
|
-
*/
|
|
102
|
-
list(): AgentInfo[];
|
|
103
|
-
/**
|
|
104
|
-
* 更新 Agent 状态
|
|
105
|
-
*
|
|
106
|
-
* @param agentId - Agent ID
|
|
107
|
-
* @param status - 新状态
|
|
108
|
-
*/
|
|
109
|
-
updateStatus(agentId: string, status: AgentInfo['status']): void;
|
|
110
|
-
/**
|
|
111
|
-
* 更新 Agent 活跃时间
|
|
112
|
-
*
|
|
113
|
-
* @param agentId - Agent ID
|
|
114
|
-
*/
|
|
115
|
-
touch(agentId: string): void;
|
|
116
|
-
/**
|
|
117
|
-
* 添加 Agent 间关系
|
|
118
|
-
*
|
|
119
|
-
* @param relation - 关系描述
|
|
120
|
-
*/
|
|
121
|
-
addRelation(relation: AgentRelation): void;
|
|
122
|
-
/**
|
|
123
|
-
* 移除 Agent 间关系
|
|
124
|
-
*
|
|
125
|
-
* @param from - 来源 Agent ID
|
|
126
|
-
* @param to - 目标 Agent ID
|
|
127
|
-
* @param type - 关系类型(不传则移除所有关系)
|
|
128
|
-
*/
|
|
129
|
-
removeRelation(from: string, to: string, type?: AgentRelationType): void;
|
|
130
|
-
/**
|
|
131
|
-
* 获取 Agent 的所有关系
|
|
132
|
-
*
|
|
133
|
-
* @param agentId - Agent ID
|
|
134
|
-
* @returns 关系列表
|
|
135
|
-
*/
|
|
136
|
-
getRelations(agentId: string): AgentRelation[];
|
|
137
|
-
/**
|
|
138
|
-
* 查找具有特定能力的 Agent
|
|
139
|
-
*
|
|
140
|
-
* @param capability - 能力标签
|
|
141
|
-
* @returns 具备该能力的 Agent 列表
|
|
142
|
-
*/
|
|
143
|
-
findByCapability(capability: string): AgentInfo[];
|
|
144
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* AgentRegistry — Agent 注册与发现契约
|
|
3
|
-
*
|
|
4
|
-
* @layer harness/collaboration/multi-agent — 多 Agent 产品契约,非 Core Kernel。
|
|
5
|
-
* 实现:DefaultAgentRegistry(registry.ts)。
|
|
6
|
-
*
|
|
7
|
-
* 设计原则:
|
|
8
|
-
* - 契约与实现同域;跨域只 import 本文件 types
|
|
9
|
-
* - 支持按能力(capability)发现 Agent
|
|
10
|
-
* - 支持 Agent 上下线通知
|
|
11
|
-
* - 支持多 Agent 拓扑描述
|
|
12
|
-
*/
|
|
13
|
-
// ── 事件 ──
|
|
14
|
-
export const AgentRegistryEvents = {
|
|
15
|
-
/** Agent 注册 */
|
|
16
|
-
AGENT_REGISTERED: 'registry.agent.registered',
|
|
17
|
-
/** Agent 注销 */
|
|
18
|
-
AGENT_UNREGISTERED: 'registry.agent.unregistered',
|
|
19
|
-
/** Agent 状态变更 */
|
|
20
|
-
AGENT_STATUS_CHANGED: 'registry.agent.status_changed',
|
|
21
|
-
/** 关系添加 */
|
|
22
|
-
RELATION_ADDED: 'registry.relation.added',
|
|
23
|
-
/** 关系移除 */
|
|
24
|
-
RELATION_REMOVED: 'registry.relation.removed',
|
|
25
|
-
};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Multi-Agent 模块统一导出
|
|
3
|
-
*
|
|
4
|
-
* 多 Agent 编排、注册、发现。
|
|
5
|
-
*/
|
|
6
|
-
export type { SwarmTopology, SwarmConfig, SwarmAgent, SwarmTask, } from './types.js';
|
|
7
|
-
export { SwarmEvents } from './types.js';
|
|
8
|
-
export type { AgentRegistry, AgentInfo, AgentQuery, AgentRelation, AgentRelationType, } from './agent-registry-types.js';
|
|
9
|
-
export { AgentRegistryEvents } from './agent-registry-types.js';
|
|
10
|
-
export type { MessageChannel, ProcessMessage, MessageHandler, } from './message-channel-types.js';
|
|
11
|
-
export { DefaultAgentRegistry } from './registry.js';
|
|
12
|
-
export { AgentSwarm } from './swarm.js';
|
|
13
|
-
export type { OrchestrationStrategy } from './swarm.js';
|
|
14
|
-
export { RoundRobinStrategy, CapabilityStrategy, PipelineStrategy, } from './swarm.js';
|
|
15
|
-
export { AgentProcess, spawnAgentProcess, forkAgentProcess } from './process.js';
|
|
16
|
-
export type { AgentProcessState, AgentProcessResult, AgentProcessAnnounce, AgentProcessConfig } from './process.js';
|
|
17
|
-
export { AgentProcessEvents } from './process.js';
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Multi-Agent 模块统一导出
|
|
3
|
-
*
|
|
4
|
-
* 多 Agent 编排、注册、发现。
|
|
5
|
-
*/
|
|
6
|
-
export { SwarmEvents } from './types.js';
|
|
7
|
-
export { AgentRegistryEvents } from './agent-registry-types.js';
|
|
8
|
-
// ── 注册表 ──
|
|
9
|
-
export { DefaultAgentRegistry } from './registry.js';
|
|
10
|
-
// ── 编排器 ──
|
|
11
|
-
export { AgentSwarm } from './swarm.js';
|
|
12
|
-
export { RoundRobinStrategy, CapabilityStrategy, PipelineStrategy, } from './swarm.js';
|
|
13
|
-
// ── 进程 ──
|
|
14
|
-
export { AgentProcess, spawnAgentProcess, forkAgentProcess } from './process.js';
|
|
15
|
-
export { AgentProcessEvents } from './process.js';
|
|
@@ -1,167 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* AgentProcess — Agent 进程运行时
|
|
3
|
-
*
|
|
4
|
-
* 将 Agent 的一次运行包装为可追踪的进程。
|
|
5
|
-
* 支持父子关系、完成通知(announce)、上下文分叉(fork)。
|
|
6
|
-
*
|
|
7
|
-
* 设计原则:
|
|
8
|
-
* - 独立状态机(pending/running/completed/failed/aborted),不继承任何进程壳
|
|
9
|
-
* - 结果通过 EventBus 推送给父进程(announce 模式)
|
|
10
|
-
* - 支持 context fork:子进程继承父进程的消息历史
|
|
11
|
-
* - 进程完成后不可重用(completed/failed/aborted 终态)
|
|
12
|
-
*/
|
|
13
|
-
import type { EventBus } from '@octopi-agent/core/primitives/event-bus.js';
|
|
14
|
-
import type { Message } from '@octopi-agent/core/types.js';
|
|
15
|
-
import type { Agent } from '../../run/agent/index.js';
|
|
16
|
-
import type { ReliabilityHarness } from '../../run/reliability/index.js';
|
|
17
|
-
import type { AgentInfo } from './agent-registry-types.js';
|
|
18
|
-
/** Agent 进程状态 */
|
|
19
|
-
export type AgentProcessState = 'pending' | 'running' | 'completed' | 'failed' | 'aborted';
|
|
20
|
-
/** 进程完成信息 */
|
|
21
|
-
export interface AgentProcessResult {
|
|
22
|
-
/** 最终回复内容 */
|
|
23
|
-
content: string;
|
|
24
|
-
/** 完整消息历史(含工具调用) */
|
|
25
|
-
messages: Message[];
|
|
26
|
-
/** 使用统计 */
|
|
27
|
-
usage?: import('@octopi-agent/core/types/turn.js').TokenUsage;
|
|
28
|
-
/** 运行时长(毫秒) */
|
|
29
|
-
durationMs: number;
|
|
30
|
-
}
|
|
31
|
-
/** 进程完成事件数据 */
|
|
32
|
-
export interface AgentProcessAnnounce {
|
|
33
|
-
/** 进程 ID */
|
|
34
|
-
processId: string;
|
|
35
|
-
/** 父进程 ID */
|
|
36
|
-
parentId?: string;
|
|
37
|
-
/** Agent 信息 */
|
|
38
|
-
agentInfo: AgentInfo;
|
|
39
|
-
/** 完成状态 */
|
|
40
|
-
state: 'completed' | 'failed' | 'aborted';
|
|
41
|
-
/** 完成结果(completed 时有值) */
|
|
42
|
-
result?: AgentProcessResult;
|
|
43
|
-
/** 错误信息(failed 时有值) */
|
|
44
|
-
error?: string;
|
|
45
|
-
/** 时间戳 */
|
|
46
|
-
timestamp: number;
|
|
47
|
-
}
|
|
48
|
-
export declare const AgentProcessEvents: {
|
|
49
|
-
/** 进程启动 */
|
|
50
|
-
readonly STARTED: "agent_process.started";
|
|
51
|
-
/** 进程完成(announce 核心事件) */
|
|
52
|
-
readonly COMPLETED: "agent_process.completed";
|
|
53
|
-
/** 进程失败 */
|
|
54
|
-
readonly FAILED: "agent_process.failed";
|
|
55
|
-
/** 进程中止 */
|
|
56
|
-
readonly ABORTED: "agent_process.aborted";
|
|
57
|
-
/** 子进程 spawn */
|
|
58
|
-
readonly CHILD_SPAWNED: "agent_process.child_spawned";
|
|
59
|
-
};
|
|
60
|
-
/** AgentProcess 配置 */
|
|
61
|
-
export interface AgentProcessConfig {
|
|
62
|
-
/** 进程 ID(不传则自动生成) */
|
|
63
|
-
id?: string;
|
|
64
|
-
/** 父进程 ID */
|
|
65
|
-
parentId?: string;
|
|
66
|
-
/** Agent 信息 */
|
|
67
|
-
agentInfo: AgentInfo;
|
|
68
|
-
/** Agent 实例 */
|
|
69
|
-
agent: Agent;
|
|
70
|
-
/** 可靠性 Harness */
|
|
71
|
-
harness: ReliabilityHarness;
|
|
72
|
-
/** EventBus(用于 announce) */
|
|
73
|
-
events: EventBus;
|
|
74
|
-
/** 系统提示词 */
|
|
75
|
-
systemPrompt: string;
|
|
76
|
-
/** 超时(毫秒,默认 0 = 不超时) */
|
|
77
|
-
timeoutMs?: number;
|
|
78
|
-
/** 是否启用 context fork(默认 false) */
|
|
79
|
-
forkContext?: boolean;
|
|
80
|
-
}
|
|
81
|
-
/**
|
|
82
|
-
* AgentProcess — Agent 进程运行时
|
|
83
|
-
*
|
|
84
|
-
* 用法:
|
|
85
|
-
* ```ts
|
|
86
|
-
* const process = new AgentProcess({
|
|
87
|
-
* agentInfo: coderAgent,
|
|
88
|
-
* engine: coderEngine,
|
|
89
|
-
* events: eventBus,
|
|
90
|
-
* systemPrompt: 'You are a coding assistant...',
|
|
91
|
-
* });
|
|
92
|
-
*
|
|
93
|
-
* // 非阻塞启动
|
|
94
|
-
* process.start(userMessages);
|
|
95
|
-
*
|
|
96
|
-
* // 监听完成事件
|
|
97
|
-
* events.on(AgentProcessEvents.COMPLETED, (event) => {
|
|
98
|
-
* console.log(event.data.result);
|
|
99
|
-
* });
|
|
100
|
-
*
|
|
101
|
-
* // 或等待完成
|
|
102
|
-
* const result = await process.waitForCompletion();
|
|
103
|
-
* ```
|
|
104
|
-
*/
|
|
105
|
-
export declare class AgentProcess {
|
|
106
|
-
readonly id: string;
|
|
107
|
-
readonly parentId?: string;
|
|
108
|
-
readonly agentInfo: AgentInfo;
|
|
109
|
-
private _agent;
|
|
110
|
-
private _harness;
|
|
111
|
-
private _events;
|
|
112
|
-
private _systemPrompt;
|
|
113
|
-
private _timeoutMs;
|
|
114
|
-
private _forkContext;
|
|
115
|
-
private _state;
|
|
116
|
-
private _result?;
|
|
117
|
-
private _error?;
|
|
118
|
-
private _startedAt?;
|
|
119
|
-
private _completedAt?;
|
|
120
|
-
private _abortController?;
|
|
121
|
-
private _completionResolvers;
|
|
122
|
-
constructor(config: AgentProcessConfig);
|
|
123
|
-
/** 当前状态 */
|
|
124
|
-
get state(): AgentProcessState;
|
|
125
|
-
/** 完成结果 */
|
|
126
|
-
get result(): AgentProcessResult | undefined;
|
|
127
|
-
/** 错误信息 */
|
|
128
|
-
get error(): string | undefined;
|
|
129
|
-
/** 运行时长(毫秒) */
|
|
130
|
-
get durationMs(): number | undefined;
|
|
131
|
-
/**
|
|
132
|
-
* 启动进程(非阻塞)
|
|
133
|
-
*
|
|
134
|
-
* @param messages - 输入消息
|
|
135
|
-
* @param parentMessages - 父进程的消息历史(用于 context fork)
|
|
136
|
-
* @returns this(链式调用)
|
|
137
|
-
*/
|
|
138
|
-
start(messages: Message[], parentMessages?: Message[]): this;
|
|
139
|
-
/**
|
|
140
|
-
* 中止进程
|
|
141
|
-
*/
|
|
142
|
-
abort(): void;
|
|
143
|
-
/**
|
|
144
|
-
* 等待进程完成(Promise 模式)
|
|
145
|
-
*/
|
|
146
|
-
waitForCompletion(): Promise<AgentProcessAnnounce>;
|
|
147
|
-
private _runAsync;
|
|
148
|
-
private _collectRun;
|
|
149
|
-
private _buildAnnounce;
|
|
150
|
-
private _resolveCompletion;
|
|
151
|
-
private _emit;
|
|
152
|
-
private _withTimeout;
|
|
153
|
-
}
|
|
154
|
-
/**
|
|
155
|
-
* 创建并启动 AgentProcess
|
|
156
|
-
*/
|
|
157
|
-
export declare function spawnAgentProcess(config: Omit<AgentProcessConfig, 'id'> & {
|
|
158
|
-
id?: string;
|
|
159
|
-
}, messages: Message[], parentMessages?: Message[]): AgentProcess;
|
|
160
|
-
/**
|
|
161
|
-
* 创建 context fork 子进程
|
|
162
|
-
*
|
|
163
|
-
* 从父进程的消息历史创建子进程,子进程继承父上下文。
|
|
164
|
-
*/
|
|
165
|
-
export declare function forkAgentProcess(config: Omit<AgentProcessConfig, 'forkContext'> & {
|
|
166
|
-
forkContext?: boolean;
|
|
167
|
-
}, messages: Message[], parentMessages: Message[]): AgentProcess;
|