@octopi-agent/engine 0.98.4 → 0.102.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/config-schema/agent.d.ts +35 -5
- package/dist/config-schema/agent.js +24 -4
- package/dist/config-schema/context.d.ts +6 -36
- package/dist/config-schema/context.js +4 -28
- package/dist/config-schema/engine.d.ts +57 -160
- package/dist/config-schema/engine.js +1 -5
- package/dist/config-schema/governance.d.ts +8 -1
- package/dist/config-schema/governance.js +8 -1
- package/dist/config-schema/models.d.ts +2 -8
- package/dist/config-schema/models.js +0 -2
- package/dist/config-schema/run.d.ts +2 -2
- package/dist/config-schema/run.js +2 -2
- package/dist/config-schema/shared.d.ts +0 -3
- package/dist/config-schema/shared.js +0 -2
- package/dist/config-schema/substrate.d.ts +14 -88
- package/dist/config-schema/substrate.js +22 -107
- package/dist/config.d.ts +45 -113
- package/dist/config.js +8 -2
- package/dist/harness/activation/dispatcher.js +7 -0
- package/dist/harness/activation/inbox.d.ts +3 -3
- package/dist/harness/activation/inbox.js +3 -3
- package/dist/harness/activation/runtime.js +13 -5
- package/dist/harness/activation/types.d.ts +2 -2
- package/dist/harness/agent/builder.d.ts +24 -3
- package/dist/harness/agent/builder.js +131 -27
- package/dist/harness/agent/config-bridge.js +9 -2
- package/dist/harness/agent/config-integrity.js +19 -2
- package/dist/harness/agent/wire-agent-builder.d.ts +11 -3
- package/dist/harness/agent/wire-agent-builder.js +26 -7
- package/dist/harness/capabilities/document/factory.d.ts +5 -0
- package/dist/harness/capabilities/document/factory.js +1 -0
- package/dist/harness/capabilities/document/port.js +6 -3
- package/dist/harness/capabilities/document/types.d.ts +5 -0
- package/dist/harness/collaboration/autonomous-subsystem/loader.js +1 -1
- package/dist/harness/collaboration/autonomous-subsystem/sense/engine.d.ts +1 -1
- package/dist/harness/collaboration/autonomous-subsystem/sense/engine.js +2 -2
- package/dist/harness/collaboration/autonomous-subsystem/sense/input-builder.js +4 -4
- package/dist/harness/collaboration/autonomous-subsystem/sense/metrics.d.ts +2 -2
- package/dist/harness/collaboration/autonomous-subsystem/sense/metrics.js +2 -2
- package/dist/harness/collaboration/autonomous-subsystem/signal/bus.d.ts +6 -0
- package/dist/harness/collaboration/autonomous-subsystem/signal/bus.js +25 -4
- package/dist/harness/collaboration/autonomous-subsystem/think/executor.js +1 -1
- package/dist/harness/collaboration/autonomous-subsystem/types.d.ts +3 -3
- package/dist/harness/collaboration/delegation/child-run.d.ts +1 -1
- package/dist/harness/collaboration/delegation/child-run.js +4 -4
- package/dist/harness/collaboration/delegation/index.d.ts +1 -1
- package/dist/harness/collaboration/delegation/index.js +1 -1
- package/dist/harness/collaboration/delegation/notifier.d.ts +6 -1
- package/dist/harness/collaboration/delegation/notifier.js +8 -1
- package/dist/harness/collaboration/delegation/service.d.ts +2 -0
- package/dist/harness/collaboration/delegation/service.js +2 -1
- package/dist/harness/collaboration/delegation/store.d.ts +2 -0
- package/dist/harness/collaboration/delegation/store.js +2 -1
- package/dist/harness/collaboration/delegation/types.d.ts +23 -2
- package/dist/harness/collaboration/delegation/types.js +22 -0
- package/dist/harness/collaboration/delegation/wiring.js +11 -1
- package/dist/harness/context/budget-allocator.d.ts +26 -18
- package/dist/harness/context/budget-allocator.js +67 -32
- package/dist/harness/context/capabilities/compact/engine.d.ts +0 -6
- package/dist/harness/context/capabilities/compact/engine.js +169 -121
- package/dist/harness/context/capabilities/compact/handover.d.ts +5 -3
- package/dist/harness/context/capabilities/compact/handover.js +7 -5
- package/dist/harness/context/capabilities/compact/index.d.ts +5 -1
- package/dist/harness/context/capabilities/compact/index.js +4 -0
- package/dist/harness/context/capabilities/compact/mechanical.d.ts +130 -0
- package/dist/harness/context/capabilities/compact/mechanical.js +268 -0
- package/dist/harness/context/capabilities/compact/messages.d.ts +60 -0
- package/dist/harness/context/capabilities/compact/messages.js +91 -0
- package/dist/harness/context/capabilities/compact/types.d.ts +76 -11
- package/dist/harness/context/capabilities/compact/types.js +11 -1
- package/dist/harness/context/capabilities/compact/view-split.d.ts +36 -0
- package/dist/harness/context/capabilities/compact/view-split.js +72 -0
- package/dist/harness/context/capabilities/summary/port.js +0 -1
- package/dist/harness/context/capabilities/summary/resolver.d.ts +1 -1
- package/dist/harness/context/capabilities/summary/resolver.js +1 -6
- package/dist/harness/context/capabilities/summary/tool-binding.d.ts +1 -1
- package/dist/harness/context/capabilities/summary/types.d.ts +3 -6
- package/dist/harness/context/context-size-ledger.d.ts +143 -0
- package/dist/harness/context/context-size-ledger.js +236 -0
- package/dist/harness/context/default-context-engine.d.ts +195 -119
- package/dist/harness/context/default-context-engine.js +1241 -743
- package/dist/harness/context/index.d.ts +2 -2
- package/dist/harness/context/index.js +1 -1
- package/dist/harness/context/layer-types.d.ts +15 -0
- package/dist/harness/context/layer-types.js +14 -1
- package/dist/harness/context/layers.d.ts +14 -15
- package/dist/harness/context/layers.js +41 -11
- package/dist/harness/context/message-selector.d.ts +10 -8
- package/dist/harness/context/message-selector.js +49 -27
- package/dist/harness/context/summarize.d.ts +2 -2
- package/dist/harness/context/summarize.js +9 -2
- package/dist/harness/context/system-prompt-assembler.d.ts +2 -0
- package/dist/harness/context/system-prompt-assembler.js +2 -1
- package/dist/harness/context/token-constants.d.ts +8 -6
- package/dist/harness/context/token-constants.js +8 -7
- package/dist/harness/context/token-estimate-fns.d.ts +37 -27
- package/dist/harness/context/token-estimate-fns.js +85 -66
- package/dist/harness/context/token-estimator.d.ts +27 -12
- package/dist/harness/context/token-estimator.js +120 -66
- package/dist/harness/context/token-segments.d.ts +88 -0
- package/dist/harness/context/token-segments.js +103 -0
- package/dist/harness/context/tool-result-aging.d.ts +6 -1
- package/dist/harness/context/tool-result-aging.js +16 -5
- package/dist/harness/context/tool-result-body.js +2 -0
- package/dist/harness/context/transform/anchors.d.ts +66 -0
- package/dist/harness/context/transform/anchors.js +125 -0
- package/dist/harness/context/transform/fold.d.ts +56 -0
- package/dist/harness/context/transform/fold.js +135 -0
- package/dist/harness/context/transform/migrate.d.ts +41 -0
- package/dist/harness/context/transform/migrate.js +69 -0
- package/dist/harness/context/transform/types.d.ts +129 -0
- package/dist/harness/context/transform/types.js +19 -0
- package/dist/harness/context/turn-envelope.d.ts +6 -3
- package/dist/harness/context/types.d.ts +127 -117
- package/dist/harness/extension/execution-environment/ops-audit.d.ts +1 -1
- package/dist/harness/extension/execution-environment/resource-limits.d.ts +1 -1
- package/dist/harness/extension/execution-environment/resource-limits.js +1 -1
- package/dist/harness/extension/plugin-ecosystem/channel-types.d.ts +1 -1
- package/dist/harness/extension/plugin-ecosystem/commands/index.d.ts +3 -1
- package/dist/harness/extension/plugin-ecosystem/commands/index.js +1 -0
- package/dist/harness/extension/plugin-ecosystem/commands/plugin-bridge.d.ts +12 -1
- package/dist/harness/extension/plugin-ecosystem/commands/plugin-bridge.js +14 -4
- package/dist/harness/extension/plugin-ecosystem/commands/router.d.ts +5 -4
- package/dist/harness/extension/plugin-ecosystem/commands/router.js +23 -14
- package/dist/harness/extension/plugin-ecosystem/commands/types.d.ts +8 -1
- package/dist/harness/extension/plugin-ecosystem/commands/types.js +2 -1
- package/dist/harness/extension/plugin-ecosystem/hooks/adapter.d.ts +54 -0
- package/dist/harness/extension/plugin-ecosystem/hooks/adapter.js +397 -0
- package/dist/harness/extension/plugin-ecosystem/hooks/compaction-integration.d.ts +16 -0
- package/dist/harness/extension/plugin-ecosystem/hooks/compaction-integration.js +66 -0
- package/dist/harness/extension/plugin-ecosystem/hooks/index.d.ts +4 -0
- package/dist/harness/extension/plugin-ecosystem/hooks/index.js +2 -0
- package/dist/harness/extension/plugin-ecosystem/hooks/iteration-snapshot.d.ts +11 -0
- package/dist/harness/extension/plugin-ecosystem/hooks/iteration-snapshot.js +54 -0
- package/dist/harness/extension/plugin-ecosystem/hooks/journal.d.ts +9 -0
- package/dist/harness/extension/plugin-ecosystem/hooks/journal.js +22 -0
- package/dist/harness/extension/plugin-ecosystem/hooks/policy-error.d.ts +12 -0
- package/dist/harness/extension/plugin-ecosystem/hooks/policy-error.js +19 -0
- package/dist/harness/extension/plugin-ecosystem/hooks/run-integration.d.ts +36 -0
- package/dist/harness/extension/plugin-ecosystem/hooks/run-integration.js +338 -0
- package/dist/harness/extension/plugin-ecosystem/hooks/services.d.ts +24 -0
- package/dist/harness/extension/plugin-ecosystem/hooks/services.js +139 -0
- package/dist/harness/extension/plugin-ecosystem/hooks/types.d.ts +229 -0
- package/dist/harness/extension/plugin-ecosystem/hooks/types.js +1 -0
- package/dist/harness/extension/plugin-ecosystem/plugins/api.d.ts +83 -249
- package/dist/harness/extension/plugin-ecosystem/plugins/api.js +88 -214
- package/dist/harness/extension/plugin-ecosystem/plugins/contribution-registry.d.ts +43 -0
- package/dist/harness/extension/plugin-ecosystem/plugins/contribution-registry.js +61 -0
- package/dist/harness/extension/plugin-ecosystem/plugins/engine-compatibility.d.ts +4 -0
- package/dist/harness/extension/plugin-ecosystem/plugins/engine-compatibility.js +18 -0
- package/dist/harness/extension/plugin-ecosystem/plugins/entry.d.ts +7 -85
- package/dist/harness/extension/plugin-ecosystem/plugins/entry.js +8 -50
- package/dist/harness/extension/plugin-ecosystem/plugins/index.d.ts +6 -23
- package/dist/harness/extension/plugin-ecosystem/plugins/index.js +3 -23
- package/dist/harness/extension/plugin-ecosystem/plugins/loader.d.ts +50 -117
- package/dist/harness/extension/plugin-ecosystem/plugins/loader.js +316 -285
- package/dist/harness/extension/plugin-ecosystem/plugins/manager.d.ts +23 -490
- package/dist/harness/extension/plugin-ecosystem/plugins/manager.js +85 -353
- package/dist/harness/extension/plugin-ecosystem/plugins/manifest.d.ts +41 -223
- package/dist/harness/extension/plugin-ecosystem/plugins/manifest.js +138 -19
- package/dist/harness/extension/plugin-ecosystem/plugins/staging.d.ts +15 -0
- package/dist/harness/extension/plugin-ecosystem/plugins/staging.js +15 -0
- package/dist/harness/extension/plugin-ecosystem/skills/manager.d.ts +6 -1
- package/dist/harness/extension/plugin-ecosystem/skills/manager.js +17 -1
- package/dist/harness/extension/plugin-ecosystem/tools/ask-user.d.ts +3 -0
- package/dist/harness/extension/plugin-ecosystem/tools/ask-user.js +46 -21
- package/dist/harness/extension/plugin-ecosystem/tools/delegation.js +18 -8
- package/dist/harness/extension/plugin-ecosystem/tools/plugin-tool.d.ts +11 -0
- package/dist/harness/extension/plugin-ecosystem/tools/plugin-tool.js +39 -0
- package/dist/harness/extension/plugin-ecosystem/tools/tool-bus.d.ts +1 -1
- package/dist/harness/extension/plugin-ecosystem/tools/tool-bus.js +11 -2
- package/dist/harness/governance/accounting/usage-ledger.d.ts +13 -1
- package/dist/harness/governance/accounting/usage-ledger.js +23 -1
- package/dist/harness/governance/human-in-the-loop/decision-cache.d.ts +3 -3
- package/dist/harness/governance/human-in-the-loop/decision-cache.js +2 -2
- package/dist/harness/governance/security/capability-enforcer.js +1 -2
- package/dist/harness/index.d.ts +12 -12
- package/dist/harness/index.js +7 -7
- package/dist/harness/knowledge/boot-config.d.ts +55 -0
- package/dist/harness/knowledge/boot-config.js +50 -0
- package/dist/harness/knowledge/catalog-types.d.ts +2 -0
- package/dist/harness/knowledge/client.d.ts +24 -2
- package/dist/harness/knowledge/client.js +19 -5
- package/dist/harness/knowledge/db.js +5 -0
- package/dist/harness/knowledge/describe-sample.d.ts +23 -0
- package/dist/harness/knowledge/describe-sample.js +58 -0
- package/dist/harness/knowledge/describe.d.ts +8 -0
- package/dist/harness/knowledge/describe.js +18 -2
- package/dist/harness/knowledge/engine-thread.js +6 -0
- package/dist/harness/knowledge/grounding.js +3 -1
- package/dist/harness/knowledge/http-app.js +35 -4
- package/dist/harness/knowledge/http-params.d.ts +18 -0
- package/dist/harness/knowledge/http-params.js +24 -0
- package/dist/harness/knowledge/index.d.ts +2 -0
- package/dist/harness/knowledge/index.js +1 -0
- package/dist/harness/knowledge/knowledge-serve-child.js +3 -0
- package/dist/harness/knowledge/purge.js +5 -2
- package/dist/harness/knowledge/query-service.d.ts +13 -2
- package/dist/harness/knowledge/query-service.js +4 -2
- package/dist/harness/knowledge/query-worker-client.d.ts +9 -1
- package/dist/harness/knowledge/query-worker-client.js +4 -2
- package/dist/harness/knowledge/query-worker.js +4 -2
- package/dist/harness/knowledge/read-http.js +5 -1
- package/dist/harness/knowledge/serve.d.ts +8 -7
- package/dist/harness/knowledge/serve.js +9 -0
- package/dist/harness/knowledge/source-store.js +26 -3
- package/dist/harness/knowledge/start-service-process.d.ts +15 -7
- package/dist/harness/knowledge/start-service-process.js +21 -9
- package/dist/harness/knowledge/types.d.ts +7 -0
- package/dist/harness/knowledge/writer-service.d.ts +37 -9
- package/dist/harness/knowledge/writer-service.js +120 -14
- package/dist/harness/knowledge/writer-worker-client.d.ts +10 -9
- package/dist/harness/knowledge/writer-worker-client.js +20 -2
- package/dist/harness/knowledge/writer-worker.js +9 -1
- package/dist/harness/memory/sqlite/wisdom-store.js +35 -10
- package/dist/harness/memory/types.d.ts +6 -4
- package/dist/harness/memory/wisdom-formation.d.ts +14 -3
- package/dist/harness/memory/wisdom-formation.js +85 -22
- package/dist/harness/memory/wisdom-gates.d.ts +14 -0
- package/dist/harness/memory/wisdom-gates.js +59 -19
- package/dist/harness/memory/wisdom.js +9 -0
- package/dist/harness/observability/observer/hub.js +25 -15
- package/dist/harness/observability/observer/types.d.ts +10 -6
- package/dist/harness/run/agent/agent.d.ts +40 -21
- package/dist/harness/run/agent/agent.js +66 -13
- package/dist/harness/run/agent/index.d.ts +1 -1
- package/dist/harness/run/budget/budget.d.ts +28 -10
- package/dist/harness/run/budget/budget.js +38 -15
- package/dist/harness/run/model/index.d.ts +3 -1
- package/dist/harness/run/model/index.js +2 -1
- package/dist/harness/run/model/resolver.d.ts +4 -1
- package/dist/harness/run/model/resolver.js +36 -2
- package/dist/harness/run/model/run-scope.d.ts +2 -0
- package/dist/harness/run/model/run-scope.js +7 -0
- package/dist/harness/run/model/types.d.ts +22 -5
- package/dist/harness/run/model/types.js +3 -2
- package/dist/harness/run/model/window-truth.d.ts +37 -0
- package/dist/harness/run/model/window-truth.js +39 -0
- package/dist/harness/run/reliability/context-length-feedback.d.ts +77 -0
- package/dist/harness/run/reliability/context-length-feedback.js +128 -0
- package/dist/harness/run/reliability/harness-events.d.ts +3 -3
- package/dist/harness/run/reliability/model-error-policy.js +4 -0
- package/dist/harness/run/reliability/run-agent.d.ts +10 -4
- package/dist/harness/run/reliability/run-agent.js +137 -53
- package/dist/harness/run/reliability/run-metrics-collector.d.ts +19 -8
- package/dist/harness/run/reliability/run-metrics-collector.js +38 -23
- package/dist/harness/run/run-guard/default-run-guard.js +8 -8
- package/dist/harness/run/run-scope.d.ts +37 -4
- package/dist/harness/run/runner.d.ts +44 -29
- package/dist/harness/run/runner.js +320 -102
- package/dist/harness/session/attachments/index.d.ts +1 -0
- package/dist/harness/session/attachments/index.js +1 -0
- package/dist/harness/session/attachments/inject.d.ts +21 -10
- package/dist/harness/session/attachments/inject.js +76 -24
- package/dist/harness/session/attachments/recall-index.d.ts +70 -0
- package/dist/harness/session/attachments/recall-index.js +219 -0
- package/dist/harness/session/attachments/service.d.ts +21 -0
- package/dist/harness/session/attachments/service.js +258 -139
- package/dist/harness/session/attachments/types.d.ts +6 -0
- package/dist/harness/session/transform-store.d.ts +136 -0
- package/dist/harness/session/transform-store.js +302 -0
- package/dist/harness/session/types.d.ts +2 -2
- package/dist/harness/shared/events/agent-event-map.d.ts +46 -13
- package/dist/harness/shared/events/agent-event-map.js +3 -2
- package/dist/harness/shared/events/scenario-events.d.ts +6 -6
- package/dist/harness/shared/types/agent-definition.d.ts +1 -2
- package/dist/index.d.ts +14 -17
- package/dist/index.js +7 -9
- package/dist/integration/observability/metrics.d.ts +6 -6
- package/dist/integration/observability/metrics.js +13 -13
- package/dist/integration/observability/observer-bridge.js +2 -2
- package/dist/integration/observability/trace-collector.d.ts +5 -5
- package/dist/integration/observability/trace-collector.js +34 -35
- package/dist/integration/observability/trace-events.d.ts +3 -3
- package/dist/integration/observability/trace-events.js +3 -3
- package/dist/integration/providers/anthropic.js +14 -1
- package/dist/integration/providers/openai.js +7 -1
- package/dist/integration/providers/usage.d.ts +1 -1
- package/dist/integration/providers/wire-dump.d.ts +1 -1
- package/dist/integration/storage/archive-manager.d.ts +6 -0
- package/dist/integration/storage/archive-manager.js +10 -0
- package/dist/integration/storage/jsonl.d.ts +1 -1
- package/dist/integration/storage/jsonl.js +18 -16
- package/dist/subsystems/wisdom-steward/formation/SUBSYSTEM.md +8 -1
- package/dist/subsystems/wisdom-steward/formation/config.yaml +1 -0
- package/dist/subsystems/wisdom-steward/formation/handler.js +27 -5
- package/package.json +11 -14
- package/dist/harness/context/hybrid-compressor.d.ts +0 -41
- package/dist/harness/context/hybrid-compressor.js +0 -159
- package/dist/harness/context/llm-summarizer.d.ts +0 -46
- package/dist/harness/context/llm-summarizer.js +0 -249
- package/dist/harness/context/smart-router.d.ts +0 -75
- package/dist/harness/context/smart-router.js +0 -118
- package/dist/harness/context/truncate-compressor.d.ts +0 -28
- package/dist/harness/context/truncate-compressor.js +0 -107
- package/dist/harness/extension/plugin-ecosystem/plugins/capability.d.ts +0 -97
- package/dist/harness/extension/plugin-ecosystem/plugins/capability.js +0 -155
- package/dist/harness/extension/plugin-ecosystem/plugins/hooks.d.ts +0 -7
- package/dist/harness/extension/plugin-ecosystem/plugins/hooks.js +0 -7
- package/dist/harness/extension/plugin-ecosystem/plugins/lifecycle.d.ts +0 -86
- package/dist/harness/extension/plugin-ecosystem/plugins/lifecycle.js +0 -139
package/dist/config.d.ts
CHANGED
|
@@ -72,7 +72,7 @@ export interface AgentConfig {
|
|
|
72
72
|
rightsCeiling?: import('@octopi-agent/engine/harness/governance/session-acl/types.js').SessionRights;
|
|
73
73
|
/** 委派预算上限(请求预算与此取交集) */
|
|
74
74
|
budget?: {
|
|
75
|
-
|
|
75
|
+
maxSteps?: number;
|
|
76
76
|
maxTokens?: number;
|
|
77
77
|
timeoutMs?: number;
|
|
78
78
|
};
|
|
@@ -125,20 +125,18 @@ export interface KnowledgeRuntimeConfig {
|
|
|
125
125
|
includePriorUserTurns?: number;
|
|
126
126
|
skipIfUserTokensBelow?: number;
|
|
127
127
|
};
|
|
128
|
-
index
|
|
129
|
-
|
|
130
|
-
|
|
128
|
+
/** Phase B 向量化(v0.98.11 起取代 index.phaseB / index.embedding / index.embedSecretPolicy) */
|
|
129
|
+
embed?: {
|
|
130
|
+
/** false = 纯关键词索引(不外发 embed);缺省 true */
|
|
131
|
+
enabled?: boolean;
|
|
132
|
+
embedBatch?: number;
|
|
133
|
+
embedMinIntervalMs?: number;
|
|
134
|
+
embedConcurrency?: number;
|
|
131
135
|
/** embedding 外发前敏感形态策略(默认 redact) */
|
|
132
136
|
embedSecretPolicy?: 'allow' | 'redact' | 'skip';
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
};
|
|
137
|
-
phaseB?: {
|
|
138
|
-
embedBatch?: number;
|
|
139
|
-
concurrency?: number;
|
|
140
|
-
ratePerMin?: number;
|
|
141
|
-
};
|
|
137
|
+
};
|
|
138
|
+
index?: {
|
|
139
|
+
hybridKeyword?: boolean;
|
|
142
140
|
queue?: {
|
|
143
141
|
maxDepth?: number;
|
|
144
142
|
};
|
|
@@ -172,6 +170,8 @@ export interface KnowledgeRuntimeConfig {
|
|
|
172
170
|
};
|
|
173
171
|
load?: {
|
|
174
172
|
parseConcurrency?: number;
|
|
173
|
+
/** fs watch debounce ms(默认 800;原 index.phaseA.debounceMs) */
|
|
174
|
+
debounceMs?: number;
|
|
175
175
|
diskWatermarkAlert?: boolean;
|
|
176
176
|
};
|
|
177
177
|
promotion?: {
|
|
@@ -187,22 +187,13 @@ export interface KnowledgeRuntimeConfig {
|
|
|
187
187
|
maxFileBytes?: number;
|
|
188
188
|
maxTotalBytes?: number;
|
|
189
189
|
allowedExtensions?: string[];
|
|
190
|
-
parse?: {
|
|
191
|
-
extract?: boolean;
|
|
192
|
-
keywordIndex?: boolean;
|
|
193
|
-
embedding?: 'off' | 'lazy' | 'on-upload';
|
|
194
|
-
};
|
|
195
190
|
inject?: {
|
|
196
191
|
fullTextMaxChars?: number;
|
|
197
192
|
recallTopK?: number;
|
|
198
|
-
inventory?: boolean;
|
|
199
193
|
intent?: 'llm' | 'off';
|
|
200
194
|
intentTimeoutMs?: number;
|
|
201
195
|
emptyMessagePrompt?: string;
|
|
202
196
|
};
|
|
203
|
-
tools?: {
|
|
204
|
-
attachmentsRootReadOnly?: boolean;
|
|
205
|
-
};
|
|
206
197
|
};
|
|
207
198
|
}
|
|
208
199
|
/** 单个 web search provider slot */
|
|
@@ -261,8 +252,15 @@ export interface SessionConfig {
|
|
|
261
252
|
export interface PluginConfig {
|
|
262
253
|
/** Plugin 目录扫描路径 */
|
|
263
254
|
loadPaths?: string[];
|
|
264
|
-
/**
|
|
265
|
-
|
|
255
|
+
/** 宿主允许的插件 ID;未配置 = 不限制 */
|
|
256
|
+
allowList?: string[];
|
|
257
|
+
/** 宿主明确阻止的插件 ID,优先于其他启用决策 */
|
|
258
|
+
blockList?: string[];
|
|
259
|
+
/** 插件启停与业务配置;单纯存在 config 不代表启用 */
|
|
260
|
+
entries?: Record<string, {
|
|
261
|
+
enabled?: boolean;
|
|
262
|
+
config?: Record<string, unknown>;
|
|
263
|
+
}>;
|
|
266
264
|
}
|
|
267
265
|
/**
|
|
268
266
|
* 监听 host 配置值
|
|
@@ -319,7 +317,7 @@ export interface ChannelConfig {
|
|
|
319
317
|
*
|
|
320
318
|
* 见 arch/budget-redesign.md:
|
|
321
319
|
* - 默认 **无** nominal token hard(Σ nominalTotalTokens 不作为出厂熔断)
|
|
322
|
-
* - P0:仅 wall-clock 安全阀 + 可显式
|
|
320
|
+
* - P0:仅 wall-clock 安全阀 + 可显式 steps/tool 上限
|
|
323
321
|
* - P2:控制梯配置(wrap-up 策略)
|
|
324
322
|
* - P3:扩展 usd / uncached 等 opt-in 单位;键名仅 budgetPolicy(无 budget)
|
|
325
323
|
*/
|
|
@@ -327,13 +325,13 @@ export interface BudgetPolicyJsonConfig {
|
|
|
327
325
|
/** 安全阀:最大运行时间毫秒(默认 6h) */
|
|
328
326
|
maxWallClockMs?: number;
|
|
329
327
|
/** 最大迭代次数。仅显式设置时硬停 */
|
|
330
|
-
|
|
328
|
+
maxSteps?: number;
|
|
331
329
|
/** 最大工具调用次数。仅显式设置时硬停 */
|
|
332
330
|
maxToolCalls?: number;
|
|
333
331
|
/** Policy 触达时的行为:'stop' 立即停止 | 'wrap_up_then_stop' 先总结再停止(默认) */
|
|
334
332
|
onPolicyHit?: 'stop' | 'wrap_up_then_stop';
|
|
335
333
|
/** wrap-up 窗口的轮次数(默认 3) */
|
|
336
|
-
|
|
334
|
+
wrapUpSteps?: number;
|
|
337
335
|
/** context 轴 wrap-up 触发阈值比例(默认 0.85) */
|
|
338
336
|
contextWrapUpRatio?: number;
|
|
339
337
|
/** 预算单位配置(仅显式配置才启用 hard) */
|
|
@@ -461,6 +459,13 @@ export interface ContextEngineConfig {
|
|
|
461
459
|
protectFirstN?: number;
|
|
462
460
|
/** 尾部保护消息数(默认 20) */
|
|
463
461
|
protectLastN?: number;
|
|
462
|
+
/**
|
|
463
|
+
* turn 内活跃窗口条数(默认 50):工具活动进行中(isMidTurn)时主动压缩选段的
|
|
464
|
+
* tail 扩大到 max(protectLastN, 本值),进行中的工具步骤/证据/推理链不进选段。
|
|
465
|
+
* 2026-11-07 方案 E 修订:取代「turn 内禁 LLM 摘要」。条数上限,token 密集的
|
|
466
|
+
* 短 turn 仍有已知限制(见 CHANGELOG v0.102.2 已接受风险)。
|
|
467
|
+
*/
|
|
468
|
+
midTurnProtectLastN?: number;
|
|
464
469
|
/** 摘要软目标预算(P1c 缺省 clamp(2%, 2k, 8k)):可配置 ratioPct/minTokens/maxTokens */
|
|
465
470
|
summaryBudget?: {
|
|
466
471
|
ratioPct?: number;
|
|
@@ -471,7 +476,8 @@ export interface ContextEngineConfig {
|
|
|
471
476
|
* 窗口比例线:消息 token / messagesBudget 超过该比例时,
|
|
472
477
|
* 在硬溢出前先主动压缩(默认 0.6)。
|
|
473
478
|
* `0` = **禁止发起新的**路径 A 压缩(不只禁 LLM;目标线/窗口比例线同闸);**不**丢弃已有
|
|
474
|
-
* `previousSummary` 粘滞视图(粘滞重建仍生效)。turn
|
|
479
|
+
* `previousSummary` 粘滞视图(粘滞重建仍生效)。turn 内(工具活动中)同样打 LLM
|
|
480
|
+
* (2026-11-07 方案 E 修订),活动记录由 `midTurnProtectLastN` 活跃窗口保护。
|
|
475
481
|
*/
|
|
476
482
|
proactiveCompactRatio?: number;
|
|
477
483
|
/**
|
|
@@ -479,6 +485,12 @@ export interface ContextEngineConfig {
|
|
|
479
485
|
* 冷却期内优先缓存重建,降低单 turn 双摘要。
|
|
480
486
|
*/
|
|
481
487
|
proactiveCooldownMs?: number;
|
|
488
|
+
/**
|
|
489
|
+
* 单次摘要 LLM 调用预算 ms(默认 300000;0 = 不设预算,只受 provider 超时约束)。
|
|
490
|
+
* 超时即中止摘要请求并按 onSummarizeFail 降级——防止 provider 挂死时 UI 全程假等。
|
|
491
|
+
* 中断不续做:下一轮重新发起压缩即可。
|
|
492
|
+
*/
|
|
493
|
+
summarizeTimeoutMs?: number;
|
|
482
494
|
/**
|
|
483
495
|
* 历史工具结果批量冻结老化(F1-B2):当前 run 永不老化、近 rawWindow 条跨轮原文、
|
|
484
496
|
* 更旧按 freezeBatch 成批降级为结构化指针(视图级、write-once、禁渐进)。
|
|
@@ -513,10 +525,6 @@ export interface ContextEngineConfig {
|
|
|
513
525
|
minOutputReserve?: number;
|
|
514
526
|
/** 输出预留最大值(默认 8000) */
|
|
515
527
|
maxOutputReserve?: number;
|
|
516
|
-
/** 是否启用 LLM 摘要(默认 true) */
|
|
517
|
-
enableLLMSummary?: boolean;
|
|
518
|
-
/** 摘要模型(可选,使用主模型) */
|
|
519
|
-
summaryModel?: string;
|
|
520
528
|
}
|
|
521
529
|
/**
|
|
522
530
|
* 公用能力 summary 配置(harness/context/capabilities)
|
|
@@ -543,21 +551,10 @@ export interface SummaryCapabilityConfig {
|
|
|
543
551
|
} & Record<string, unknown>;
|
|
544
552
|
cache?: {
|
|
545
553
|
enabled?: boolean;
|
|
546
|
-
backend?: 'memory' | 'file';
|
|
547
554
|
ttlMs?: number;
|
|
548
555
|
maxEntries?: number;
|
|
549
|
-
dir?: string;
|
|
550
556
|
};
|
|
551
557
|
}
|
|
552
|
-
/**
|
|
553
|
-
* 公用能力 compact 缺省配置
|
|
554
|
-
*/
|
|
555
|
-
export interface CompactCapabilityConfig {
|
|
556
|
-
defaultProtectHead?: number;
|
|
557
|
-
defaultProtectTail?: number;
|
|
558
|
-
defaultTargetTokens?: number;
|
|
559
|
-
defaultMode?: 'structure_only' | 'summary_only' | 'head_tail_only' | 'auto';
|
|
560
|
-
}
|
|
561
558
|
/**
|
|
562
559
|
* 公用能力 documents(DocumentPort 读抽取)
|
|
563
560
|
*/
|
|
@@ -577,19 +574,6 @@ export interface DocumentsCapabilityConfig {
|
|
|
577
574
|
timeoutMs?: number;
|
|
578
575
|
maxInputBytes?: number;
|
|
579
576
|
};
|
|
580
|
-
markitdown?: {
|
|
581
|
-
enabled?: boolean;
|
|
582
|
-
command?: string;
|
|
583
|
-
};
|
|
584
|
-
enhanced?: {
|
|
585
|
-
enabled?: boolean;
|
|
586
|
-
provider?: 'mineru' | 'azure-di' | 'azure-cu' | string;
|
|
587
|
-
endpoint?: string | null;
|
|
588
|
-
command?: string | null;
|
|
589
|
-
authRef?: string | null;
|
|
590
|
-
timeoutMs?: number;
|
|
591
|
-
preferOn?: string[];
|
|
592
|
-
};
|
|
593
577
|
}
|
|
594
578
|
/**
|
|
595
579
|
* system prompt 层装配器配置(七层 ContextAssembler)
|
|
@@ -649,8 +633,6 @@ export interface ModelDefinition {
|
|
|
649
633
|
provider: string;
|
|
650
634
|
/** 模型名称 */
|
|
651
635
|
model: string;
|
|
652
|
-
/** 温度 */
|
|
653
|
-
temperature?: number;
|
|
654
636
|
/** 最大 token 数 */
|
|
655
637
|
maxTokens?: number;
|
|
656
638
|
/** 上下文窗口大小 */
|
|
@@ -767,8 +749,6 @@ export interface EmbeddingModelConfig {
|
|
|
767
749
|
}
|
|
768
750
|
/** 新格式的 models 配置 */
|
|
769
751
|
export interface ModelsConfig {
|
|
770
|
-
/** 合并模式:merge=与 builtin 合并,replace=完全替代 */
|
|
771
|
-
mode?: 'merge' | 'replace';
|
|
772
752
|
/** Provider 映射(key = provider 名称) */
|
|
773
753
|
providers: Record<string, ModelProviderConfig>;
|
|
774
754
|
/** 模型级别映射(子系统通过级别名引用具体模型) */
|
|
@@ -836,19 +816,13 @@ export interface HarnessConfig {
|
|
|
836
816
|
contextEngine?: ContextEngineConfig;
|
|
837
817
|
/** 公用能力 summary(harness/context/capabilities) */
|
|
838
818
|
summary?: SummaryCapabilityConfig;
|
|
839
|
-
/** 公用能力 compact 缺省 */
|
|
840
|
-
compact?: CompactCapabilityConfig;
|
|
841
819
|
/** 公用能力 documents(DocumentPort 读抽取) */
|
|
842
820
|
documents?: DocumentsCapabilityConfig;
|
|
843
|
-
/** system prompt
|
|
844
|
-
contextAssembler?: ContextAssemblerConfig;
|
|
845
|
-
/** context 域扩展:全局宪法等 */
|
|
821
|
+
/** system prompt 七层装配器 / 全局宪法(唯一声明面:context 域;v0.98.11 起顶层简写已删除) */
|
|
846
822
|
context?: {
|
|
847
823
|
constitution?: ConstitutionConfig;
|
|
848
824
|
contextAssembler?: ContextAssemblerConfig;
|
|
849
825
|
};
|
|
850
|
-
/** 全局宪法(顶层简写,等价 context.constitution) */
|
|
851
|
-
constitution?: ConstitutionConfig;
|
|
852
826
|
/** Memory 写入/置信度策略 */
|
|
853
827
|
memory?: {
|
|
854
828
|
profile?: 'personal_assistant' | 'embedded_interactive' | 'embedded_headless';
|
|
@@ -895,16 +869,10 @@ export interface HarnessConfig {
|
|
|
895
869
|
maxLength?: Partial<Record<'fact' | 'method' | 'norm', number>>;
|
|
896
870
|
};
|
|
897
871
|
};
|
|
898
|
-
/** Cognition 概念图谱(arch/cognition-graph-formation.md
|
|
872
|
+
/** Cognition 概念图谱(arch/cognition-graph-formation.md);steward 调参面在子系统 config.yaml metadata.config */
|
|
899
873
|
cognition?: {
|
|
900
874
|
enabled?: boolean;
|
|
901
|
-
conceptualize?: {
|
|
902
|
-
onMemoryWrite?: boolean;
|
|
903
|
-
maxNodesPerProposition?: number;
|
|
904
|
-
maxEdgesPerProposition?: number;
|
|
905
|
-
};
|
|
906
875
|
relations?: {
|
|
907
|
-
requireCue?: boolean;
|
|
908
876
|
causesMinIndependentMemories?: number;
|
|
909
877
|
};
|
|
910
878
|
identity?: {
|
|
@@ -912,59 +880,23 @@ export interface HarnessConfig {
|
|
|
912
880
|
candidateBandHi?: number;
|
|
913
881
|
};
|
|
914
882
|
capacity?: {
|
|
915
|
-
warnNodes?: number;
|
|
916
|
-
warnEdges?: number;
|
|
917
883
|
stopNodes?: number;
|
|
918
884
|
stopEdges?: number;
|
|
919
885
|
};
|
|
920
|
-
retrieval?: {
|
|
921
|
-
depth?: number;
|
|
922
|
-
delta?: number;
|
|
923
|
-
tau?: number;
|
|
924
|
-
limit?: number;
|
|
925
|
-
};
|
|
926
|
-
consolidation?: {
|
|
927
|
-
debounceMinutes?: number;
|
|
928
|
-
ttlHours?: number;
|
|
929
|
-
};
|
|
930
886
|
};
|
|
931
|
-
/** Wisdom 判断范式(arch/wisdom-layer-formation.md
|
|
887
|
+
/** Wisdom 判断范式(arch/wisdom-layer-formation.md);steward 调参面在子系统 config.yaml metadata.config */
|
|
932
888
|
wisdom?: {
|
|
933
889
|
enabled?: boolean;
|
|
934
890
|
capacity?: {
|
|
935
|
-
softCap?: number;
|
|
936
891
|
hardCap?: number;
|
|
937
892
|
};
|
|
938
|
-
formation?: {
|
|
939
|
-
enabled?: boolean;
|
|
940
|
-
dryRun?: boolean;
|
|
941
|
-
ttlHours?: number;
|
|
942
|
-
minMemorySupport?: number;
|
|
943
|
-
minClusterSize?: number;
|
|
944
|
-
minPromotionStack?: number;
|
|
945
|
-
maxItemsPerRun?: number;
|
|
946
|
-
maxEvidenceChars?: number;
|
|
947
|
-
};
|
|
948
|
-
evaluation?: {
|
|
949
|
-
dryRun?: boolean;
|
|
950
|
-
windowHours?: number;
|
|
951
|
-
minAppliesForActive?: number;
|
|
952
|
-
contestRate?: number;
|
|
953
|
-
counterevidenceWeight?: number;
|
|
954
|
-
strengthenMinApplies?: number;
|
|
955
|
-
};
|
|
956
893
|
injection?: {
|
|
957
894
|
coreMaxItems?: number;
|
|
958
|
-
coreMaxTokens?: number;
|
|
959
895
|
scenarioMaxItems?: number;
|
|
896
|
+
/** trial 轮转试用名额(缺省 2;0 = 关闭轮转) */
|
|
897
|
+
trialMaxItems?: number;
|
|
960
898
|
trialVisible?: boolean;
|
|
961
899
|
};
|
|
962
|
-
govern?: {
|
|
963
|
-
dryRun?: boolean;
|
|
964
|
-
zeroApplyIdleMs?: number;
|
|
965
|
-
priorityDecayStep?: number;
|
|
966
|
-
priorityFloor?: number;
|
|
967
|
-
};
|
|
968
900
|
};
|
|
969
901
|
/** Knowledge 检索/召回(全局缺省;agents[].knowledge.recall 可覆盖) */
|
|
970
902
|
knowledge?: KnowledgeRuntimeConfig;
|
package/dist/config.js
CHANGED
|
@@ -145,7 +145,6 @@ function resolveFallbackModels(fallbacks, models, defaults, depth = 0) {
|
|
|
145
145
|
return {
|
|
146
146
|
provider: m.provider,
|
|
147
147
|
model: m.model,
|
|
148
|
-
temperature: m.temperature,
|
|
149
148
|
maxTokens: m.maxTokens,
|
|
150
149
|
contextWindow: m.contextWindow ?? defaults?.contextWindow,
|
|
151
150
|
fallbackModels: resolveFallbackModels(m.fallbackModels, models, defaults, depth + 1),
|
|
@@ -195,7 +194,14 @@ export async function createWireDumpSinkFromConfig(cfg) {
|
|
|
195
194
|
*/
|
|
196
195
|
export async function createProviderFromConfig(name, pc, options) {
|
|
197
196
|
const apiType = pc.api === 'anthropic-messages' ? 'anthropic' : 'openai';
|
|
198
|
-
const models = pc.models.map(m => ({
|
|
197
|
+
const models = pc.models.map(m => ({
|
|
198
|
+
name: m.name ?? m.id,
|
|
199
|
+
contextWindow: m.contextWindow,
|
|
200
|
+
maxOutputTokens: m.maxTokens,
|
|
201
|
+
temperature: m.temperature,
|
|
202
|
+
reasoning: m.reasoning,
|
|
203
|
+
input: m.input,
|
|
204
|
+
}));
|
|
199
205
|
const defaultModel = pc.models[0]?.name ?? pc.models[0]?.id;
|
|
200
206
|
let decorate = (inner) => inner;
|
|
201
207
|
if (options?.wireDump) {
|
|
@@ -27,6 +27,13 @@ export class SessionRunnerDispatcher {
|
|
|
27
27
|
sessionId: req.sessionId,
|
|
28
28
|
model: req.modelOverride,
|
|
29
29
|
modelProvider: req.modelProvider,
|
|
30
|
+
...(req.actorId === undefined && req.actorType === undefined && req.tenantId === undefined ? {} : {
|
|
31
|
+
principal: {
|
|
32
|
+
...(req.actorId === undefined ? {} : { actorId: req.actorId }),
|
|
33
|
+
...(req.actorType === undefined ? {} : { actorType: req.actorType }),
|
|
34
|
+
...(req.tenantId === undefined ? {} : { tenantId: req.tenantId }),
|
|
35
|
+
},
|
|
36
|
+
}),
|
|
30
37
|
};
|
|
31
38
|
const entries = req.triggers.map((trigger, index) => ({
|
|
32
39
|
id: trigger.id,
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
import type { AgentEvent } from '@octopi-agent/core/primitives/event-bus.js';
|
|
10
10
|
import type { Message } from '@octopi-agent/core/types.js';
|
|
11
11
|
import type { Trigger } from './types.js';
|
|
12
|
-
export type InboxOfferResult = '
|
|
12
|
+
export type InboxOfferResult = 'continued' | 'dispatched' | 'duplicate';
|
|
13
13
|
export interface SessionInboxSignal {
|
|
14
14
|
agentId: string;
|
|
15
15
|
sessionId: string;
|
|
@@ -26,7 +26,7 @@ export interface SessionInboxSignal {
|
|
|
26
26
|
trigger?: Trigger;
|
|
27
27
|
/** 调用方的收尾通道(频道回复捕获等);消费时由 Runner 转发事件。 */
|
|
28
28
|
onEvent?: (event: AgentEvent) => void;
|
|
29
|
-
onAdmitted?: (delivery: '
|
|
29
|
+
onAdmitted?: (delivery: 'continued') => void;
|
|
30
30
|
}
|
|
31
31
|
export interface SessionInboxEntry {
|
|
32
32
|
readonly id: string;
|
|
@@ -71,7 +71,7 @@ export declare class SessionInbox {
|
|
|
71
71
|
private readonly unacked;
|
|
72
72
|
constructor(redispatch: (entry: SessionInboxEntry) => void | Promise<unknown>, idLimit?: number);
|
|
73
73
|
/**
|
|
74
|
-
* 有兼容的活跃接收端才接收(返回
|
|
74
|
+
* 有兼容的活跃接收端才接收(返回 continued);否则调用方继续原 Trigger。
|
|
75
75
|
* duplicate = 同 id 已被接收或已入上下文,不得再次执行。
|
|
76
76
|
* 兼容性:显式换模型(≠ 活跃 Run 模型)/ 带附件输入不接续,走完整新 Run。
|
|
77
77
|
*/
|
|
@@ -31,7 +31,7 @@ export class SessionInbox {
|
|
|
31
31
|
this.idLimit = idLimit;
|
|
32
32
|
}
|
|
33
33
|
/**
|
|
34
|
-
* 有兼容的活跃接收端才接收(返回
|
|
34
|
+
* 有兼容的活跃接收端才接收(返回 continued);否则调用方继续原 Trigger。
|
|
35
35
|
* duplicate = 同 id 已被接收或已入上下文,不得再次执行。
|
|
36
36
|
* 兼容性:显式换模型(≠ 活跃 Run 模型)/ 带附件输入不接续,走完整新 Run。
|
|
37
37
|
*/
|
|
@@ -61,8 +61,8 @@ export class SessionInbox {
|
|
|
61
61
|
};
|
|
62
62
|
this.owned.add(id);
|
|
63
63
|
active.state.pending.push(entry);
|
|
64
|
-
signal.onAdmitted?.('
|
|
65
|
-
return '
|
|
64
|
+
signal.onAdmitted?.('continued');
|
|
65
|
+
return 'continued';
|
|
66
66
|
}
|
|
67
67
|
/** 仅 Runner 持锁后调用;同 (agent, session) 同时只有一个接收端。 */
|
|
68
68
|
open(sessionId, agentId, runId, entries, runModel) {
|
|
@@ -295,9 +295,9 @@ export class AgentRuntime {
|
|
|
295
295
|
// 单一 offer 点:活跃 Run 接收 = 不再开新 Run(原 Trigger 不 dispatch,
|
|
296
296
|
// Run 关闭未消费时由 inbox 按原 Trigger 重投)
|
|
297
297
|
const offerResult = this.offerToTarget(trigger, agent, sessionId, options?.onEvent);
|
|
298
|
-
if (offerResult === '
|
|
299
|
-
options?.onDelivery?.('
|
|
300
|
-
return { status: 'accepted', agentId: agent.agentId, sessionId, delivery: '
|
|
298
|
+
if (offerResult === 'continued' || offerResult === 'duplicate') {
|
|
299
|
+
options?.onDelivery?.('continued');
|
|
300
|
+
return { status: 'accepted', agentId: agent.agentId, sessionId, delivery: 'continued' };
|
|
301
301
|
}
|
|
302
302
|
options?.onDelivery?.('run');
|
|
303
303
|
if (trigger.coalesceKey) {
|
|
@@ -327,9 +327,17 @@ export class AgentRuntime {
|
|
|
327
327
|
}
|
|
328
328
|
// I6:schedule 点火以 timer 主体入审计(arch/session-schedules.md)
|
|
329
329
|
const isScheduleWake = triggers.some((t) => t.type === 'schedule');
|
|
330
|
+
// Channel/user triggers carry their real sender as the Run principal so Hook
|
|
331
|
+
// audit attribution reflects who actually asked; host-internal triggers keep
|
|
332
|
+
// no actor rather than inventing one.
|
|
333
|
+
const senderId = isScheduleWake
|
|
334
|
+
? undefined
|
|
335
|
+
: triggers
|
|
336
|
+
.map((t) => ('source' in t.payload ? t.payload.source?.senderId : undefined))
|
|
337
|
+
.find((id) => typeof id === 'string' && id.length > 0);
|
|
330
338
|
const request = buildRunRequest(agent, triggers, sessionId, {
|
|
331
|
-
actorType: isScheduleWake ? 'timer' : undefined,
|
|
332
|
-
actorId: isScheduleWake ? (triggers[0]?.metadata?.reason ?? triggers[0]?.id) :
|
|
339
|
+
actorType: isScheduleWake ? 'timer' : senderId ? 'user' : undefined,
|
|
340
|
+
actorId: isScheduleWake ? (triggers[0]?.metadata?.reason ?? triggers[0]?.id) : senderId,
|
|
333
341
|
intent: isScheduleWake ? 'schedule_wake' : undefined,
|
|
334
342
|
});
|
|
335
343
|
const controller = new AbortController();
|
|
@@ -105,7 +105,7 @@ export interface DispatchOptions {
|
|
|
105
105
|
/** Run 事件流转发(频道回复捕获等);不变量 #6 */
|
|
106
106
|
onEvent?: (event: AgentEvent) => void;
|
|
107
107
|
/** 活跃 Run 接收即回执(早于 Run 结束);run = 走新 Run。 */
|
|
108
|
-
onDelivery?: (delivery: '
|
|
108
|
+
onDelivery?: (delivery: 'continued' | 'run') => void;
|
|
109
109
|
}
|
|
110
110
|
export interface RouteTarget {
|
|
111
111
|
agentId: string;
|
|
@@ -143,7 +143,7 @@ export type DispatchResult = {
|
|
|
143
143
|
status: 'accepted';
|
|
144
144
|
agentId: string;
|
|
145
145
|
sessionId: string;
|
|
146
|
-
delivery: '
|
|
146
|
+
delivery: 'continued';
|
|
147
147
|
} | {
|
|
148
148
|
status: 'skipped';
|
|
149
149
|
reason: 'no_agent' | 'filtered' | 'runtime_stopped' | 'aborted';
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* .model('gpt-5.5')
|
|
10
10
|
* .persona('./personas/my-agent')
|
|
11
11
|
* .tool(myTool)
|
|
12
|
-
* .budget({
|
|
12
|
+
* .budget({ maxSteps: 15 })
|
|
13
13
|
* .build();
|
|
14
14
|
* ```
|
|
15
15
|
*/
|
|
@@ -45,6 +45,7 @@ export interface ToolContextProvider {
|
|
|
45
45
|
sessionId: string;
|
|
46
46
|
agentId: string;
|
|
47
47
|
runId?: string;
|
|
48
|
+
agentToolPolicy?: import('@octopi-agent/core/types.js').ToolPolicy;
|
|
48
49
|
messages: import('@octopi-agent/core/types.js').Message[];
|
|
49
50
|
cwd?: string;
|
|
50
51
|
attachmentRoots?: string[];
|
|
@@ -158,7 +159,9 @@ export declare class AgentBuilder {
|
|
|
158
159
|
private _toolBus;
|
|
159
160
|
private _contextEngine?;
|
|
160
161
|
private _summarize?;
|
|
161
|
-
/**
|
|
162
|
+
/** 按 session 键控的 context 压力(由 convertToLlm 更新;共享 Agent 下并发会话不串号) */
|
|
163
|
+
private _contextPressureBySession;
|
|
164
|
+
/** 兜底:无 sessionId 的调用方(仅 advisory 用途;并发下可能串号,不得用于持久化) */
|
|
162
165
|
private _lastContextPressure?;
|
|
163
166
|
/** 为 true 时禁止自动挂默认 summarize(测试/特殊场景) */
|
|
164
167
|
private _disableAutoSummarize;
|
|
@@ -179,6 +182,8 @@ export declare class AgentBuilder {
|
|
|
179
182
|
private _systemPrompt?;
|
|
180
183
|
/** Skill 目录(SKILL.md);build 时 discover 并注入 system prompt 索引 */
|
|
181
184
|
private _skillDirectory?;
|
|
185
|
+
/** Skill id allowlist(agents[].skills);未设置 = 全部启用 */
|
|
186
|
+
private _skillAllowlist?;
|
|
182
187
|
private _skillManager?;
|
|
183
188
|
/** 记忆检索(注入 system prompt MemoryLayer) */
|
|
184
189
|
private _memoryStore?;
|
|
@@ -198,7 +203,7 @@ export declare class AgentBuilder {
|
|
|
198
203
|
private _knowledgeGrounding?;
|
|
199
204
|
/** 智慧(注入 system prompt WisdomLayer) */
|
|
200
205
|
private _wisdomStore?;
|
|
201
|
-
/** Wisdom 注入策略(wisdom.injection:core/scenario 上限 + trialVisible) */
|
|
206
|
+
/** Wisdom 注入策略(wisdom.injection:core/scenario/trial 上限 + trialVisible) */
|
|
202
207
|
private _wisdomInjection?;
|
|
203
208
|
/** 认知图谱(注入 system prompt CognitionLayer) */
|
|
204
209
|
private _cognitionStore?;
|
|
@@ -240,6 +245,8 @@ export declare class AgentBuilder {
|
|
|
240
245
|
private _agentHome?;
|
|
241
246
|
/** 逻辑 agentId(观测 / 子系统审计用) */
|
|
242
247
|
private _agentId?;
|
|
248
|
+
/** Deferred until build so .pluginTools() and .agentId() order is immaterial. */
|
|
249
|
+
private _pluginToolRecords;
|
|
243
250
|
/** 设置模型提供者 */
|
|
244
251
|
model(provider: ModelProvider): this;
|
|
245
252
|
model(name: string): this;
|
|
@@ -249,6 +256,11 @@ export declare class AgentBuilder {
|
|
|
249
256
|
* 覆盖注册(显式)。用于热更新/替换同名工具,不可默默发生。
|
|
250
257
|
*/
|
|
251
258
|
toolReplace(tool: RegisteredTool): this;
|
|
259
|
+
/**
|
|
260
|
+
* Mount host-owned plugin contributions into this Agent's ToolBus projection.
|
|
261
|
+
* Authorization is applied by ToolBus/RunScope; mounting is not Tool exposure.
|
|
262
|
+
*/
|
|
263
|
+
pluginTools(records: readonly import('../extension/plugin-ecosystem/plugins/contribution-registry.js').PluginToolRecord[]): this;
|
|
252
264
|
/** 批量注册:逐个 try/catch,避免一个工具失败拖垮整表 */
|
|
253
265
|
tools(...tools: RegisteredTool[]): this;
|
|
254
266
|
private _contextProvider;
|
|
@@ -309,6 +321,14 @@ export declare class AgentBuilder {
|
|
|
309
321
|
* `~` 形态在此展开(与 workspace / agentHome 同规,幂等)。
|
|
310
322
|
*/
|
|
311
323
|
skillDirectory(dir: string): this;
|
|
324
|
+
/**
|
|
325
|
+
* Skill 启用清单(agents[].skills):discover 只保留列出的 skill id。
|
|
326
|
+
* 不调用或传 undefined = 目录内全部启用。
|
|
327
|
+
*
|
|
328
|
+
* @param ids - 允许的 skill id 列表(SKILL.md 目录名)
|
|
329
|
+
* @returns this
|
|
330
|
+
*/
|
|
331
|
+
skillAllowlist(ids: string[] | undefined): this;
|
|
312
332
|
/** 直接注入 SkillManager(跳过目录 discover) */
|
|
313
333
|
skills(manager: import('../extension/plugin-ecosystem/skills/types.js').SkillManager): this;
|
|
314
334
|
/** 注入 MemoryStore(每轮按 query 召回进 system prompt) */
|
|
@@ -360,6 +380,7 @@ export declare class AgentBuilder {
|
|
|
360
380
|
wisdomInjection(cfg: {
|
|
361
381
|
coreMaxItems?: number;
|
|
362
382
|
scenarioMaxItems?: number;
|
|
383
|
+
trialMaxItems?: number;
|
|
363
384
|
trialVisible?: boolean;
|
|
364
385
|
}): this;
|
|
365
386
|
/** 注入 ConceptGraphStore(spreadingActivate 召回概念子图,进 system prompt CognitionLayer) */
|