@octopi-agent/engine 0.65.0 → 0.70.7
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/engine.d.ts +84 -0
- package/dist/config-schema/engine.js +4 -1
- package/dist/config-schema/substrate.d.ts +86 -0
- package/dist/config-schema/substrate.js +114 -0
- package/dist/config.d.ts +71 -0
- package/dist/harness/agent/builder.d.ts +1 -1
- package/dist/harness/agent/builder.js +27 -2
- package/dist/harness/agent/config-bridge.js +17 -4
- package/dist/harness/context/capabilities/summary/gate.js +2 -2
- package/dist/harness/context/capabilities/summary/policies.js +5 -5
- package/dist/harness/context/capabilities/summary/registry.js +29 -24
- package/dist/harness/context/layer-health.js +3 -2
- package/dist/harness/context/layers.d.ts +27 -13
- package/dist/harness/context/layers.js +76 -66
- package/dist/harness/context/system-prompt-assembler.d.ts +3 -0
- package/dist/harness/context/system-prompt-assembler.js +11 -1
- package/dist/harness/extension/plugin-ecosystem/client-tools/index.d.ts +4 -0
- package/dist/harness/extension/plugin-ecosystem/client-tools/index.js +3 -0
- package/dist/harness/extension/plugin-ecosystem/client-tools/invoke.d.ts +56 -0
- package/dist/harness/extension/plugin-ecosystem/client-tools/invoke.js +281 -0
- package/dist/harness/extension/plugin-ecosystem/client-tools/registry.d.ts +98 -0
- package/dist/harness/extension/plugin-ecosystem/client-tools/registry.js +250 -0
- package/dist/harness/extension/plugin-ecosystem/client-tools/stream.d.ts +124 -0
- package/dist/harness/extension/plugin-ecosystem/client-tools/stream.js +372 -0
- package/dist/harness/extension/plugin-ecosystem/client-tools/types.d.ts +109 -0
- package/dist/harness/extension/plugin-ecosystem/client-tools/types.js +8 -0
- package/dist/harness/extension/plugin-ecosystem/index.d.ts +1 -0
- package/dist/harness/extension/plugin-ecosystem/index.js +1 -0
- package/dist/harness/extension/plugin-ecosystem/tools/builtin.js +1 -1
- package/dist/harness/extension/plugin-ecosystem/tools/memory.d.ts +11 -1
- package/dist/harness/extension/plugin-ecosystem/tools/memory.js +14 -0
- package/dist/harness/index.d.ts +4 -3
- package/dist/harness/index.js +2 -1
- package/dist/harness/knowledge/query-service.js +5 -5
- package/dist/harness/knowledge/retriever.js +1 -1
- package/dist/harness/knowledge/source-store.d.ts +17 -2
- package/dist/harness/knowledge/source-store.js +6 -5
- package/dist/harness/memory/cognition-decay.d.ts +36 -0
- package/dist/harness/memory/cognition-decay.js +55 -0
- package/dist/harness/memory/cognition-gates.d.ts +60 -0
- package/dist/harness/memory/cognition-gates.js +191 -0
- package/dist/harness/memory/cognition-trigger.d.ts +30 -0
- package/dist/harness/memory/cognition-trigger.js +41 -0
- package/dist/harness/memory/cognition-types.d.ts +1 -1
- package/dist/harness/memory/cognition.d.ts +40 -8
- package/dist/harness/memory/cognition.js +432 -79
- package/dist/harness/memory/conceptualizer.d.ts +66 -0
- package/dist/harness/memory/conceptualizer.js +246 -0
- package/dist/harness/memory/index.d.ts +16 -2
- package/dist/harness/memory/index.js +11 -1
- package/dist/harness/memory/sqlite/agent-db.d.ts +9 -0
- package/dist/harness/memory/sqlite/agent-db.js +118 -15
- package/dist/harness/memory/sqlite/cognition-store.d.ts +55 -16
- package/dist/harness/memory/sqlite/cognition-store.js +591 -144
- package/dist/harness/memory/sqlite/wisdom-store.d.ts +33 -14
- package/dist/harness/memory/sqlite/wisdom-store.js +257 -44
- package/dist/harness/memory/types.d.ts +331 -16
- package/dist/harness/memory/types.js +49 -0
- package/dist/harness/memory/wisdom-formation.d.ts +101 -0
- package/dist/harness/memory/wisdom-formation.js +304 -0
- package/dist/harness/memory/wisdom-gates.d.ts +50 -0
- package/dist/harness/memory/wisdom-gates.js +204 -0
- package/dist/harness/memory/wisdom-policy.d.ts +107 -0
- package/dist/harness/memory/wisdom-policy.js +220 -0
- package/dist/harness/memory/wisdom-types.d.ts +3 -2
- package/dist/harness/memory/wisdom-types.js +2 -2
- package/dist/harness/memory/wisdom.d.ts +27 -0
- package/dist/harness/memory/wisdom.js +181 -0
- package/dist/harness/run/agent/agent.d.ts +9 -0
- package/dist/harness/run/agent/agent.js +19 -0
- package/dist/harness/run/reliability/run-agent.js +6 -2
- package/dist/harness/run/runner.js +2 -1
- package/dist/harness/session/index.d.ts +1 -0
- package/dist/harness/session/index.js +1 -0
- package/dist/harness/session/title.d.ts +86 -0
- package/dist/harness/session/title.js +268 -0
- package/dist/harness/shared/events/agent-event-map.d.ts +8 -0
- package/dist/harness/shared/events/agent-event-map.js +1 -0
- package/dist/index.d.ts +3 -1
- package/dist/index.js +1 -0
- package/dist/subsystems/cognition-steward/conceptualize/SUBSYSTEM.md +43 -0
- package/dist/subsystems/cognition-steward/conceptualize/config.yaml +50 -0
- package/dist/subsystems/cognition-steward/conceptualize/handler.d.ts +9 -0
- package/dist/subsystems/cognition-steward/conceptualize/handler.js +125 -0
- package/dist/subsystems/cognition-steward/consolidate/SUBSYSTEM.md +6 -0
- package/dist/subsystems/cognition-steward/consolidate/config.yaml +54 -0
- package/dist/subsystems/cognition-steward/consolidate/handler.d.ts +12 -0
- package/dist/subsystems/cognition-steward/consolidate/handler.js +93 -0
- package/dist/subsystems/wisdom-steward/evaluate/config.yaml +50 -0
- package/dist/subsystems/wisdom-steward/evaluate/handler.d.ts +18 -0
- package/dist/subsystems/wisdom-steward/evaluate/handler.js +91 -0
- package/dist/subsystems/wisdom-steward/formation/SUBSYSTEM.md +42 -0
- package/dist/subsystems/wisdom-steward/formation/config.yaml +54 -0
- package/dist/subsystems/wisdom-steward/formation/handler.d.ts +18 -0
- package/dist/subsystems/wisdom-steward/formation/handler.js +212 -0
- package/dist/subsystems/wisdom-steward/govern/config.yaml +55 -0
- package/dist/subsystems/wisdom-steward/govern/handler.d.ts +17 -0
- package/dist/subsystems/wisdom-steward/govern/handler.js +68 -0
- package/package.json +2 -2
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* wisdom.steward.govern — 零应用衰减 + 容量演化 + 软退休
|
|
3
|
+
*
|
|
4
|
+
* 只写 WisdomStore;可 dryRun。不写 Memory / Cognition。
|
|
5
|
+
*/
|
|
6
|
+
import { planWisdomGovern, wisdomUtility, } from '../../../harness/memory/wisdom-policy.js';
|
|
7
|
+
const DEP_WISDOM = 'wisdomStore';
|
|
8
|
+
const DEP_CONFIG = '__subsystem_config__';
|
|
9
|
+
async function handler(_input, deps) {
|
|
10
|
+
const store = deps?.[DEP_WISDOM];
|
|
11
|
+
if (!store)
|
|
12
|
+
throw new Error('wisdom.steward.govern: wisdomStore not injected');
|
|
13
|
+
const config = deps?.[DEP_CONFIG] ?? {};
|
|
14
|
+
const dryRun = config.dryRun ?? false;
|
|
15
|
+
const entries = await store.listForGovern({ includeRetired: false });
|
|
16
|
+
const plan = planWisdomGovern(entries, config);
|
|
17
|
+
let decayed = 0;
|
|
18
|
+
let retired = 0;
|
|
19
|
+
if (!dryRun) {
|
|
20
|
+
for (const item of plan) {
|
|
21
|
+
if (item.action === 'decay_priority' && item.priority != null) {
|
|
22
|
+
await store.update(item.id, { priority: item.priority });
|
|
23
|
+
decayed++;
|
|
24
|
+
}
|
|
25
|
+
else if (item.action === 'retire') {
|
|
26
|
+
await store.softRetire(item.id, { by: 'wisdom.steward.govern', reason: item.reason });
|
|
27
|
+
retired++;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
else {
|
|
32
|
+
decayed = plan.filter((p) => p.action === 'decay_priority').length;
|
|
33
|
+
retired = plan.filter((p) => p.action === 'retire').length;
|
|
34
|
+
}
|
|
35
|
+
const stats = await store.stats();
|
|
36
|
+
return {
|
|
37
|
+
act: {
|
|
38
|
+
mode: 'inject',
|
|
39
|
+
status: 'success',
|
|
40
|
+
target: 'wisdom-store',
|
|
41
|
+
messages: [{
|
|
42
|
+
role: 'system',
|
|
43
|
+
content: `wisdom.steward.governed decayed=${decayed} retired=${retired} total=${stats.total} ` +
|
|
44
|
+
`live=${stats.byStatus.trial + stats.byStatus.active + stats.byStatus.strengthened} dryRun=${dryRun}`,
|
|
45
|
+
}],
|
|
46
|
+
},
|
|
47
|
+
signals: [{
|
|
48
|
+
action: 'suggest',
|
|
49
|
+
reason: 'govern_completed',
|
|
50
|
+
data: {
|
|
51
|
+
decayed,
|
|
52
|
+
retired,
|
|
53
|
+
dryRun,
|
|
54
|
+
plan: plan.slice(0, 30),
|
|
55
|
+
stats,
|
|
56
|
+
utilities: entries
|
|
57
|
+
.slice(0, 10)
|
|
58
|
+
.map((e) => ({ id: e.id, utility: wisdomUtility(e), status: e.status })),
|
|
59
|
+
},
|
|
60
|
+
}],
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
export default {
|
|
64
|
+
handler,
|
|
65
|
+
contract: { input: 'WisdomGovernInput', output: 'WisdomGovernResult' },
|
|
66
|
+
dependencies: [DEP_WISDOM],
|
|
67
|
+
};
|
|
68
|
+
export { handler };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@octopi-agent/engine",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.70.7",
|
|
4
4
|
"description": "Octopi Engine — Harness product domains, library integrations, and embeddable Agent.run()",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -80,7 +80,7 @@
|
|
|
80
80
|
},
|
|
81
81
|
"dependencies": {
|
|
82
82
|
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
83
|
-
"@octopi-agent/core": "0.
|
|
83
|
+
"@octopi-agent/core": "0.70.7",
|
|
84
84
|
"js-yaml": "^4.3.2",
|
|
85
85
|
"zod": "^4.4.3"
|
|
86
86
|
},
|