@soleri/core 2.4.0 → 2.6.0
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/brain/brain.d.ts +7 -0
- package/dist/brain/brain.d.ts.map +1 -1
- package/dist/brain/brain.js +56 -9
- package/dist/brain/brain.js.map +1 -1
- package/dist/brain/intelligence.d.ts +1 -0
- package/dist/brain/intelligence.d.ts.map +1 -1
- package/dist/brain/intelligence.js +164 -148
- package/dist/brain/intelligence.js.map +1 -1
- package/dist/brain/types.d.ts +2 -2
- package/dist/brain/types.d.ts.map +1 -1
- package/dist/cognee/client.d.ts +3 -0
- package/dist/cognee/client.d.ts.map +1 -1
- package/dist/cognee/client.js +17 -0
- package/dist/cognee/client.js.map +1 -1
- package/dist/cognee/sync-manager.d.ts +94 -0
- package/dist/cognee/sync-manager.d.ts.map +1 -0
- package/dist/cognee/sync-manager.js +293 -0
- package/dist/cognee/sync-manager.js.map +1 -0
- package/dist/control/identity-manager.d.ts +3 -1
- package/dist/control/identity-manager.d.ts.map +1 -1
- package/dist/control/identity-manager.js +49 -51
- package/dist/control/identity-manager.js.map +1 -1
- package/dist/control/intent-router.d.ts +1 -0
- package/dist/control/intent-router.d.ts.map +1 -1
- package/dist/control/intent-router.js +32 -32
- package/dist/control/intent-router.js.map +1 -1
- package/dist/curator/curator.d.ts +9 -1
- package/dist/curator/curator.d.ts.map +1 -1
- package/dist/curator/curator.js +104 -92
- package/dist/curator/curator.js.map +1 -1
- package/dist/errors/classify.d.ts +13 -0
- package/dist/errors/classify.d.ts.map +1 -0
- package/dist/errors/classify.js +97 -0
- package/dist/errors/classify.js.map +1 -0
- package/dist/errors/index.d.ts +6 -0
- package/dist/errors/index.d.ts.map +1 -0
- package/dist/errors/index.js +4 -0
- package/dist/errors/index.js.map +1 -0
- package/dist/errors/retry.d.ts +40 -0
- package/dist/errors/retry.d.ts.map +1 -0
- package/dist/errors/retry.js +97 -0
- package/dist/errors/retry.js.map +1 -0
- package/dist/errors/types.d.ts +48 -0
- package/dist/errors/types.d.ts.map +1 -0
- package/dist/errors/types.js +59 -0
- package/dist/errors/types.js.map +1 -0
- package/dist/governance/governance.d.ts +1 -0
- package/dist/governance/governance.d.ts.map +1 -1
- package/dist/governance/governance.js +51 -68
- package/dist/governance/governance.js.map +1 -1
- package/dist/index.d.ts +26 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +22 -3
- package/dist/index.js.map +1 -1
- package/dist/intake/content-classifier.d.ts +14 -0
- package/dist/intake/content-classifier.d.ts.map +1 -0
- package/dist/intake/content-classifier.js +125 -0
- package/dist/intake/content-classifier.js.map +1 -0
- package/dist/intake/dedup-gate.d.ts +17 -0
- package/dist/intake/dedup-gate.d.ts.map +1 -0
- package/dist/intake/dedup-gate.js +66 -0
- package/dist/intake/dedup-gate.js.map +1 -0
- package/dist/intake/intake-pipeline.d.ts +63 -0
- package/dist/intake/intake-pipeline.d.ts.map +1 -0
- package/dist/intake/intake-pipeline.js +373 -0
- package/dist/intake/intake-pipeline.js.map +1 -0
- package/dist/intake/types.d.ts +65 -0
- package/dist/intake/types.d.ts.map +1 -0
- package/dist/intake/types.js +3 -0
- package/dist/intake/types.js.map +1 -0
- package/dist/intelligence/loader.js +1 -1
- package/dist/intelligence/loader.js.map +1 -1
- package/dist/intelligence/types.d.ts +3 -1
- package/dist/intelligence/types.d.ts.map +1 -1
- package/dist/loop/loop-manager.d.ts +58 -7
- package/dist/loop/loop-manager.d.ts.map +1 -1
- package/dist/loop/loop-manager.js +280 -6
- package/dist/loop/loop-manager.js.map +1 -1
- package/dist/loop/types.d.ts +69 -1
- package/dist/loop/types.d.ts.map +1 -1
- package/dist/loop/types.js +4 -1
- package/dist/loop/types.js.map +1 -1
- package/dist/persistence/index.d.ts +4 -0
- package/dist/persistence/index.d.ts.map +1 -0
- package/dist/persistence/index.js +3 -0
- package/dist/persistence/index.js.map +1 -0
- package/dist/persistence/postgres-provider.d.ts +46 -0
- package/dist/persistence/postgres-provider.d.ts.map +1 -0
- package/dist/persistence/postgres-provider.js +115 -0
- package/dist/persistence/postgres-provider.js.map +1 -0
- package/dist/persistence/sqlite-provider.d.ts +28 -0
- package/dist/persistence/sqlite-provider.d.ts.map +1 -0
- package/dist/persistence/sqlite-provider.js +97 -0
- package/dist/persistence/sqlite-provider.js.map +1 -0
- package/dist/persistence/types.d.ts +58 -0
- package/dist/persistence/types.d.ts.map +1 -0
- package/dist/persistence/types.js +8 -0
- package/dist/persistence/types.js.map +1 -0
- package/dist/planning/gap-analysis.d.ts +47 -4
- package/dist/planning/gap-analysis.d.ts.map +1 -1
- package/dist/planning/gap-analysis.js +190 -13
- package/dist/planning/gap-analysis.js.map +1 -1
- package/dist/planning/gap-types.d.ts +1 -1
- package/dist/planning/gap-types.d.ts.map +1 -1
- package/dist/planning/gap-types.js.map +1 -1
- package/dist/planning/planner.d.ts +277 -9
- package/dist/planning/planner.d.ts.map +1 -1
- package/dist/planning/planner.js +611 -46
- package/dist/planning/planner.js.map +1 -1
- package/dist/playbooks/generic/brainstorming.d.ts +9 -0
- package/dist/playbooks/generic/brainstorming.d.ts.map +1 -0
- package/dist/playbooks/generic/brainstorming.js +105 -0
- package/dist/playbooks/generic/brainstorming.js.map +1 -0
- package/dist/playbooks/generic/code-review.d.ts +11 -0
- package/dist/playbooks/generic/code-review.d.ts.map +1 -0
- package/dist/playbooks/generic/code-review.js +176 -0
- package/dist/playbooks/generic/code-review.js.map +1 -0
- package/dist/playbooks/generic/subagent-execution.d.ts +9 -0
- package/dist/playbooks/generic/subagent-execution.d.ts.map +1 -0
- package/dist/playbooks/generic/subagent-execution.js +68 -0
- package/dist/playbooks/generic/subagent-execution.js.map +1 -0
- package/dist/playbooks/generic/systematic-debugging.d.ts +9 -0
- package/dist/playbooks/generic/systematic-debugging.d.ts.map +1 -0
- package/dist/playbooks/generic/systematic-debugging.js +87 -0
- package/dist/playbooks/generic/systematic-debugging.js.map +1 -0
- package/dist/playbooks/generic/tdd.d.ts +9 -0
- package/dist/playbooks/generic/tdd.d.ts.map +1 -0
- package/dist/playbooks/generic/tdd.js +70 -0
- package/dist/playbooks/generic/tdd.js.map +1 -0
- package/dist/playbooks/generic/verification.d.ts +9 -0
- package/dist/playbooks/generic/verification.d.ts.map +1 -0
- package/dist/playbooks/generic/verification.js +74 -0
- package/dist/playbooks/generic/verification.js.map +1 -0
- package/dist/playbooks/index.d.ts +4 -0
- package/dist/playbooks/index.d.ts.map +1 -0
- package/dist/playbooks/index.js +5 -0
- package/dist/playbooks/index.js.map +1 -0
- package/dist/playbooks/playbook-registry.d.ts +42 -0
- package/dist/playbooks/playbook-registry.d.ts.map +1 -0
- package/dist/playbooks/playbook-registry.js +227 -0
- package/dist/playbooks/playbook-registry.js.map +1 -0
- package/dist/playbooks/playbook-seeder.d.ts +47 -0
- package/dist/playbooks/playbook-seeder.d.ts.map +1 -0
- package/dist/playbooks/playbook-seeder.js +104 -0
- package/dist/playbooks/playbook-seeder.js.map +1 -0
- package/dist/playbooks/playbook-types.d.ts +132 -0
- package/dist/playbooks/playbook-types.d.ts.map +1 -0
- package/dist/playbooks/playbook-types.js +12 -0
- package/dist/playbooks/playbook-types.js.map +1 -0
- package/dist/project/project-registry.d.ts +4 -4
- package/dist/project/project-registry.d.ts.map +1 -1
- package/dist/project/project-registry.js +30 -57
- package/dist/project/project-registry.js.map +1 -1
- package/dist/prompts/index.d.ts +4 -0
- package/dist/prompts/index.d.ts.map +1 -0
- package/dist/prompts/index.js +3 -0
- package/dist/prompts/index.js.map +1 -0
- package/dist/prompts/parser.d.ts +17 -0
- package/dist/prompts/parser.d.ts.map +1 -0
- package/dist/prompts/parser.js +47 -0
- package/dist/prompts/parser.js.map +1 -0
- package/dist/prompts/template-manager.d.ts +25 -0
- package/dist/prompts/template-manager.d.ts.map +1 -0
- package/dist/prompts/template-manager.js +71 -0
- package/dist/prompts/template-manager.js.map +1 -0
- package/dist/prompts/types.d.ts +26 -0
- package/dist/prompts/types.d.ts.map +1 -0
- package/dist/prompts/types.js +5 -0
- package/dist/prompts/types.js.map +1 -0
- package/dist/runtime/admin-extra-ops.d.ts +5 -3
- package/dist/runtime/admin-extra-ops.d.ts.map +1 -1
- package/dist/runtime/admin-extra-ops.js +348 -11
- package/dist/runtime/admin-extra-ops.js.map +1 -1
- package/dist/runtime/admin-ops.d.ts.map +1 -1
- package/dist/runtime/admin-ops.js +10 -3
- package/dist/runtime/admin-ops.js.map +1 -1
- package/dist/runtime/capture-ops.d.ts.map +1 -1
- package/dist/runtime/capture-ops.js +20 -2
- package/dist/runtime/capture-ops.js.map +1 -1
- package/dist/runtime/cognee-sync-ops.d.ts +12 -0
- package/dist/runtime/cognee-sync-ops.d.ts.map +1 -0
- package/dist/runtime/cognee-sync-ops.js +55 -0
- package/dist/runtime/cognee-sync-ops.js.map +1 -0
- package/dist/runtime/core-ops.d.ts +8 -6
- package/dist/runtime/core-ops.d.ts.map +1 -1
- package/dist/runtime/core-ops.js +226 -9
- package/dist/runtime/core-ops.js.map +1 -1
- package/dist/runtime/curator-extra-ops.d.ts +2 -2
- package/dist/runtime/curator-extra-ops.d.ts.map +1 -1
- package/dist/runtime/curator-extra-ops.js +15 -3
- package/dist/runtime/curator-extra-ops.js.map +1 -1
- package/dist/runtime/domain-ops.js +2 -2
- package/dist/runtime/domain-ops.js.map +1 -1
- package/dist/runtime/grading-ops.d.ts.map +1 -1
- package/dist/runtime/grading-ops.js.map +1 -1
- package/dist/runtime/intake-ops.d.ts +14 -0
- package/dist/runtime/intake-ops.d.ts.map +1 -0
- package/dist/runtime/intake-ops.js +110 -0
- package/dist/runtime/intake-ops.js.map +1 -0
- package/dist/runtime/loop-ops.d.ts +5 -4
- package/dist/runtime/loop-ops.d.ts.map +1 -1
- package/dist/runtime/loop-ops.js +84 -12
- package/dist/runtime/loop-ops.js.map +1 -1
- package/dist/runtime/memory-cross-project-ops.d.ts.map +1 -1
- package/dist/runtime/memory-cross-project-ops.js.map +1 -1
- package/dist/runtime/memory-extra-ops.js +5 -5
- package/dist/runtime/memory-extra-ops.js.map +1 -1
- package/dist/runtime/orchestrate-ops.d.ts.map +1 -1
- package/dist/runtime/orchestrate-ops.js +8 -2
- package/dist/runtime/orchestrate-ops.js.map +1 -1
- package/dist/runtime/planning-extra-ops.d.ts +13 -5
- package/dist/runtime/planning-extra-ops.d.ts.map +1 -1
- package/dist/runtime/planning-extra-ops.js +381 -18
- package/dist/runtime/planning-extra-ops.js.map +1 -1
- package/dist/runtime/playbook-ops.d.ts +14 -0
- package/dist/runtime/playbook-ops.d.ts.map +1 -0
- package/dist/runtime/playbook-ops.js +141 -0
- package/dist/runtime/playbook-ops.js.map +1 -0
- package/dist/runtime/project-ops.d.ts.map +1 -1
- package/dist/runtime/project-ops.js +7 -2
- package/dist/runtime/project-ops.js.map +1 -1
- package/dist/runtime/runtime.d.ts.map +1 -1
- package/dist/runtime/runtime.js +28 -9
- package/dist/runtime/runtime.js.map +1 -1
- package/dist/runtime/types.d.ts +8 -0
- package/dist/runtime/types.d.ts.map +1 -1
- package/dist/runtime/vault-extra-ops.d.ts +4 -2
- package/dist/runtime/vault-extra-ops.d.ts.map +1 -1
- package/dist/runtime/vault-extra-ops.js +383 -4
- package/dist/runtime/vault-extra-ops.js.map +1 -1
- package/dist/vault/playbook.d.ts +34 -0
- package/dist/vault/playbook.d.ts.map +1 -0
- package/dist/vault/playbook.js +60 -0
- package/dist/vault/playbook.js.map +1 -0
- package/dist/vault/vault.d.ts +52 -32
- package/dist/vault/vault.d.ts.map +1 -1
- package/dist/vault/vault.js +300 -181
- package/dist/vault/vault.js.map +1 -1
- package/package.json +9 -3
- package/src/__tests__/admin-extra-ops.test.ts +62 -15
- package/src/__tests__/admin-ops.test.ts +2 -2
- package/src/__tests__/brain.test.ts +3 -3
- package/src/__tests__/cognee-integration.test.ts +80 -0
- package/src/__tests__/cognee-sync-manager.test.ts +103 -0
- package/src/__tests__/core-ops.test.ts +36 -4
- package/src/__tests__/curator-extra-ops.test.ts +24 -2
- package/src/__tests__/errors.test.ts +388 -0
- package/src/__tests__/grading-ops.test.ts +28 -7
- package/src/__tests__/intake-pipeline.test.ts +162 -0
- package/src/__tests__/loop-ops.test.ts +74 -3
- package/src/__tests__/memory-cross-project-ops.test.ts +3 -1
- package/src/__tests__/orchestrate-ops.test.ts +8 -3
- package/src/__tests__/persistence.test.ts +291 -0
- package/src/__tests__/planner.test.ts +99 -21
- package/src/__tests__/planning-extra-ops.test.ts +168 -10
- package/src/__tests__/playbook-registry.test.ts +326 -0
- package/src/__tests__/playbook-seeder.test.ts +163 -0
- package/src/__tests__/playbook.test.ts +389 -0
- package/src/__tests__/postgres-provider.test.ts +58 -0
- package/src/__tests__/project-ops.test.ts +18 -4
- package/src/__tests__/template-manager.test.ts +222 -0
- package/src/__tests__/vault-extra-ops.test.ts +82 -7
- package/src/__tests__/vault.test.ts +184 -0
- package/src/brain/brain.ts +71 -9
- package/src/brain/intelligence.ts +258 -307
- package/src/brain/types.ts +2 -2
- package/src/cognee/client.ts +18 -0
- package/src/cognee/sync-manager.ts +389 -0
- package/src/control/identity-manager.ts +77 -75
- package/src/control/intent-router.ts +55 -57
- package/src/curator/curator.ts +199 -139
- package/src/errors/classify.ts +102 -0
- package/src/errors/index.ts +5 -0
- package/src/errors/retry.ts +132 -0
- package/src/errors/types.ts +81 -0
- package/src/governance/governance.ts +90 -107
- package/src/index.ts +116 -3
- package/src/intake/content-classifier.ts +146 -0
- package/src/intake/dedup-gate.ts +92 -0
- package/src/intake/intake-pipeline.ts +503 -0
- package/src/intake/types.ts +69 -0
- package/src/intelligence/loader.ts +1 -1
- package/src/intelligence/types.ts +3 -1
- package/src/loop/loop-manager.ts +325 -7
- package/src/loop/types.ts +72 -1
- package/src/persistence/index.ts +9 -0
- package/src/persistence/postgres-provider.ts +157 -0
- package/src/persistence/sqlite-provider.ts +115 -0
- package/src/persistence/types.ts +74 -0
- package/src/planning/gap-analysis.ts +286 -17
- package/src/planning/gap-types.ts +4 -1
- package/src/planning/planner.ts +828 -55
- package/src/playbooks/generic/brainstorming.ts +110 -0
- package/src/playbooks/generic/code-review.ts +181 -0
- package/src/playbooks/generic/subagent-execution.ts +74 -0
- package/src/playbooks/generic/systematic-debugging.ts +92 -0
- package/src/playbooks/generic/tdd.ts +75 -0
- package/src/playbooks/generic/verification.ts +79 -0
- package/src/playbooks/index.ts +27 -0
- package/src/playbooks/playbook-registry.ts +284 -0
- package/src/playbooks/playbook-seeder.ts +119 -0
- package/src/playbooks/playbook-types.ts +162 -0
- package/src/project/project-registry.ts +81 -74
- package/src/prompts/index.ts +3 -0
- package/src/prompts/parser.ts +59 -0
- package/src/prompts/template-manager.ts +77 -0
- package/src/prompts/types.ts +28 -0
- package/src/runtime/admin-extra-ops.ts +391 -13
- package/src/runtime/admin-ops.ts +17 -6
- package/src/runtime/capture-ops.ts +25 -6
- package/src/runtime/cognee-sync-ops.ts +63 -0
- package/src/runtime/core-ops.ts +258 -8
- package/src/runtime/curator-extra-ops.ts +17 -3
- package/src/runtime/domain-ops.ts +2 -2
- package/src/runtime/grading-ops.ts +11 -2
- package/src/runtime/intake-ops.ts +126 -0
- package/src/runtime/loop-ops.ts +96 -13
- package/src/runtime/memory-cross-project-ops.ts +1 -2
- package/src/runtime/memory-extra-ops.ts +5 -5
- package/src/runtime/orchestrate-ops.ts +8 -2
- package/src/runtime/planning-extra-ops.ts +414 -23
- package/src/runtime/playbook-ops.ts +169 -0
- package/src/runtime/project-ops.ts +9 -3
- package/src/runtime/runtime.ts +36 -10
- package/src/runtime/types.ts +8 -0
- package/src/runtime/vault-extra-ops.ts +425 -4
- package/src/vault/playbook.ts +87 -0
- package/src/vault/vault.ts +419 -235
package/src/runtime/core-ops.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Generic core operations factory —
|
|
2
|
+
* Generic core operations factory — 207 ops that every agent gets.
|
|
3
3
|
*
|
|
4
4
|
* These ops are agent-agnostic (no persona, no activation).
|
|
5
5
|
* The 5 agent-specific ops (health, identity, activate, inject_claude_md, setup)
|
|
@@ -25,16 +25,21 @@ import { createCaptureOps } from './capture-ops.js';
|
|
|
25
25
|
import { createCuratorExtraOps } from './curator-extra-ops.js';
|
|
26
26
|
import { createProjectOps } from './project-ops.js';
|
|
27
27
|
import { createMemoryCrossProjectOps } from './memory-cross-project-ops.js';
|
|
28
|
+
import { createPlaybookOps } from './playbook-ops.js';
|
|
29
|
+
import { createCogneeSyncOps } from './cognee-sync-ops.js';
|
|
30
|
+
import { createIntakeOps } from './intake-ops.js';
|
|
28
31
|
|
|
29
32
|
/**
|
|
30
|
-
* Create the
|
|
33
|
+
* Create the 207 generic core operations for an agent runtime.
|
|
31
34
|
*
|
|
32
35
|
* Groups: search/vault (4), memory (4), export (1), planning (5),
|
|
33
|
-
* brain (
|
|
36
|
+
* brain (8), brain intelligence (11), cognee (5),
|
|
34
37
|
* llm (2), curator (8), control (8), governance (5),
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
+
* playbook (5), prompt templates (2),
|
|
39
|
+
* planning-extra (22), memory-extra (8), vault-extra (23),
|
|
40
|
+
* admin (8), admin-extra (24), loop (9), orchestrate (5),
|
|
41
|
+
* grading (5), capture (4), curator-extra (5), project (12),
|
|
42
|
+
* cognee-sync (3), intake (4).
|
|
38
43
|
*/
|
|
39
44
|
export function createCoreOps(runtime: AgentRuntime): OpDefinition[] {
|
|
40
45
|
const {
|
|
@@ -49,6 +54,8 @@ export function createCoreOps(runtime: AgentRuntime): OpDefinition[] {
|
|
|
49
54
|
intentRouter,
|
|
50
55
|
llmClient,
|
|
51
56
|
keyPool,
|
|
57
|
+
syncManager,
|
|
58
|
+
intakePipeline,
|
|
52
59
|
} = runtime;
|
|
53
60
|
|
|
54
61
|
return [
|
|
@@ -61,7 +68,7 @@ export function createCoreOps(runtime: AgentRuntime): OpDefinition[] {
|
|
|
61
68
|
schema: z.object({
|
|
62
69
|
query: z.string(),
|
|
63
70
|
domain: z.string().optional(),
|
|
64
|
-
type: z.enum(['pattern', 'anti-pattern', 'rule']).optional(),
|
|
71
|
+
type: z.enum(['pattern', 'anti-pattern', 'rule', 'playbook']).optional(),
|
|
65
72
|
severity: z.enum(['critical', 'warning', 'suggestion']).optional(),
|
|
66
73
|
tags: z.array(z.string()).optional(),
|
|
67
74
|
limit: z.number().optional(),
|
|
@@ -88,7 +95,7 @@ export function createCoreOps(runtime: AgentRuntime): OpDefinition[] {
|
|
|
88
95
|
auth: 'read',
|
|
89
96
|
schema: z.object({
|
|
90
97
|
domain: z.string().optional(),
|
|
91
|
-
type: z.enum(['pattern', 'anti-pattern', 'rule']).optional(),
|
|
98
|
+
type: z.enum(['pattern', 'anti-pattern', 'rule', 'playbook']).optional(),
|
|
92
99
|
severity: z.enum(['critical', 'warning', 'suggestion']).optional(),
|
|
93
100
|
tags: z.array(z.string()).optional(),
|
|
94
101
|
limit: z.number().optional(),
|
|
@@ -461,6 +468,23 @@ export function createCoreOps(runtime: AgentRuntime): OpDefinition[] {
|
|
|
461
468
|
return { ...base, intelligence };
|
|
462
469
|
},
|
|
463
470
|
},
|
|
471
|
+
{
|
|
472
|
+
name: 'brain_decay_report',
|
|
473
|
+
description:
|
|
474
|
+
'Show temporal decay scores for entries matching a query — reveals which entries are expiring, active, or expired.',
|
|
475
|
+
auth: 'read',
|
|
476
|
+
schema: z.object({
|
|
477
|
+
query: z.string().describe('Search query to find entries'),
|
|
478
|
+
limit: z.number().optional().describe('Max results (default 10)'),
|
|
479
|
+
}),
|
|
480
|
+
handler: async (params) => {
|
|
481
|
+
const results = await brain.getDecayReport(
|
|
482
|
+
params.query as string,
|
|
483
|
+
(params.limit as number | undefined) ?? 10,
|
|
484
|
+
);
|
|
485
|
+
return { results, count: results.length };
|
|
486
|
+
},
|
|
487
|
+
},
|
|
464
488
|
{
|
|
465
489
|
name: 'llm_status',
|
|
466
490
|
description:
|
|
@@ -746,6 +770,194 @@ export function createCoreOps(runtime: AgentRuntime): OpDefinition[] {
|
|
|
746
770
|
return { config: cognee.getConfig(), cachedStatus: cognee.getStatus() };
|
|
747
771
|
},
|
|
748
772
|
},
|
|
773
|
+
// ─── Cognee Graph (#156) ──────────────────────────────────────
|
|
774
|
+
{
|
|
775
|
+
name: 'cognee_get_node',
|
|
776
|
+
description: 'Get a specific Cognee graph node by UUID with all properties and connections.',
|
|
777
|
+
auth: 'read',
|
|
778
|
+
schema: z.object({
|
|
779
|
+
nodeId: z.string().describe('UUID of the graph node'),
|
|
780
|
+
}),
|
|
781
|
+
handler: async (params) => {
|
|
782
|
+
try {
|
|
783
|
+
// Use Cognee search with specific ID query — the graph node API is accessed via search
|
|
784
|
+
const results = await cognee.search(params.nodeId as string, {
|
|
785
|
+
searchType: 'GRAPH_COMPLETION' as CogneeSearchType,
|
|
786
|
+
limit: 1,
|
|
787
|
+
});
|
|
788
|
+
if (!results || (Array.isArray(results) && results.length === 0)) {
|
|
789
|
+
return { found: false, nodeId: params.nodeId };
|
|
790
|
+
}
|
|
791
|
+
return {
|
|
792
|
+
found: true,
|
|
793
|
+
nodeId: params.nodeId,
|
|
794
|
+
node: Array.isArray(results) ? results[0] : results,
|
|
795
|
+
};
|
|
796
|
+
} catch (err) {
|
|
797
|
+
return { error: (err as Error).message };
|
|
798
|
+
}
|
|
799
|
+
},
|
|
800
|
+
},
|
|
801
|
+
{
|
|
802
|
+
name: 'cognee_graph_stats',
|
|
803
|
+
description:
|
|
804
|
+
'Cognee graph statistics — availability, endpoint, latency from last health check.',
|
|
805
|
+
auth: 'read',
|
|
806
|
+
handler: async () => {
|
|
807
|
+
try {
|
|
808
|
+
const status = cognee.getStatus();
|
|
809
|
+
const health = await cognee.healthCheck();
|
|
810
|
+
return {
|
|
811
|
+
available: status?.available ?? false,
|
|
812
|
+
url: status?.url ?? cognee.getConfig().baseUrl,
|
|
813
|
+
latencyMs: status?.latencyMs ?? health.latencyMs ?? null,
|
|
814
|
+
error: status?.error ?? health.error ?? null,
|
|
815
|
+
};
|
|
816
|
+
} catch (err) {
|
|
817
|
+
return { error: (err as Error).message };
|
|
818
|
+
}
|
|
819
|
+
},
|
|
820
|
+
},
|
|
821
|
+
{
|
|
822
|
+
name: 'cognee_export_status',
|
|
823
|
+
description: 'Check Cognee dataset and processing status — availability, pending operations.',
|
|
824
|
+
auth: 'read',
|
|
825
|
+
handler: async () => {
|
|
826
|
+
try {
|
|
827
|
+
const status = cognee.getStatus();
|
|
828
|
+
const config = cognee.getConfig();
|
|
829
|
+
return {
|
|
830
|
+
available: status?.available ?? false,
|
|
831
|
+
dataset: config.dataset ?? 'default',
|
|
832
|
+
pendingCognify: false, // CogneeClient tracks internally via flushPendingCognify
|
|
833
|
+
url: status?.url ?? config.baseUrl,
|
|
834
|
+
};
|
|
835
|
+
} catch (err) {
|
|
836
|
+
return { error: (err as Error).message };
|
|
837
|
+
}
|
|
838
|
+
},
|
|
839
|
+
},
|
|
840
|
+
|
|
841
|
+
// ─── Enriched Capture (#154) ─────────────────────────────────
|
|
842
|
+
{
|
|
843
|
+
name: 'capture_enriched',
|
|
844
|
+
description:
|
|
845
|
+
'Unified LLM-enriched capture — accepts minimal fields (title, description, type), uses LLM to auto-infer tags, category, and severity.',
|
|
846
|
+
auth: 'write',
|
|
847
|
+
schema: z.object({
|
|
848
|
+
title: z.string().describe('Knowledge title'),
|
|
849
|
+
description: z.string().describe('Knowledge description'),
|
|
850
|
+
type: z
|
|
851
|
+
.enum(['pattern', 'anti-pattern', 'rule', 'playbook'])
|
|
852
|
+
.optional()
|
|
853
|
+
.describe('Entry type. If omitted, LLM infers from content.'),
|
|
854
|
+
domain: z.string().optional().describe('Domain. If omitted, LLM infers.'),
|
|
855
|
+
tags: z.array(z.string()).optional().describe('Tags. LLM adds more if needed.'),
|
|
856
|
+
}),
|
|
857
|
+
handler: async (params) => {
|
|
858
|
+
try {
|
|
859
|
+
const title = params.title as string;
|
|
860
|
+
const description = params.description as string;
|
|
861
|
+
|
|
862
|
+
// Try LLM enrichment for auto-tagging
|
|
863
|
+
let inferredTags: string[] = (params.tags as string[] | undefined) ?? [];
|
|
864
|
+
let inferredType = (params.type as IntelligenceEntry['type'] | undefined) ?? 'pattern';
|
|
865
|
+
const inferredDomain = (params.domain as string | undefined) ?? 'general';
|
|
866
|
+
let inferredSeverity: IntelligenceEntry['severity'] = 'suggestion';
|
|
867
|
+
const enriched = false;
|
|
868
|
+
|
|
869
|
+
try {
|
|
870
|
+
const captureId = `enriched-${Date.now()}-${Math.random().toString(36).slice(2, 6)}`;
|
|
871
|
+
const enrichResult = brain.enrichAndCapture({
|
|
872
|
+
id: captureId,
|
|
873
|
+
title,
|
|
874
|
+
description,
|
|
875
|
+
type: inferredType,
|
|
876
|
+
domain: inferredDomain,
|
|
877
|
+
severity: inferredSeverity,
|
|
878
|
+
tags: inferredTags,
|
|
879
|
+
});
|
|
880
|
+
|
|
881
|
+
if (enrichResult.captured) {
|
|
882
|
+
return {
|
|
883
|
+
captured: true,
|
|
884
|
+
enriched: true,
|
|
885
|
+
entryId: enrichResult.id,
|
|
886
|
+
autoTags: enrichResult.autoTags,
|
|
887
|
+
duplicate: enrichResult.duplicate ?? null,
|
|
888
|
+
};
|
|
889
|
+
}
|
|
890
|
+
} catch {
|
|
891
|
+
// LLM enrichment failed — fall back to basic capture
|
|
892
|
+
}
|
|
893
|
+
|
|
894
|
+
// Fallback: basic capture without LLM enrichment
|
|
895
|
+
// Infer type from keywords
|
|
896
|
+
const lowerDesc = description.toLowerCase();
|
|
897
|
+
if (!params.type) {
|
|
898
|
+
if (
|
|
899
|
+
lowerDesc.includes('avoid') ||
|
|
900
|
+
lowerDesc.includes("don't") ||
|
|
901
|
+
lowerDesc.includes('anti-pattern')
|
|
902
|
+
)
|
|
903
|
+
inferredType = 'anti-pattern';
|
|
904
|
+
else if (
|
|
905
|
+
lowerDesc.includes('rule') ||
|
|
906
|
+
lowerDesc.includes('must') ||
|
|
907
|
+
lowerDesc.includes('always')
|
|
908
|
+
)
|
|
909
|
+
inferredType = 'rule';
|
|
910
|
+
}
|
|
911
|
+
|
|
912
|
+
// Infer severity from keywords
|
|
913
|
+
if (
|
|
914
|
+
lowerDesc.includes('critical') ||
|
|
915
|
+
lowerDesc.includes('security') ||
|
|
916
|
+
lowerDesc.includes('breaking')
|
|
917
|
+
)
|
|
918
|
+
inferredSeverity = 'critical';
|
|
919
|
+
else if (
|
|
920
|
+
lowerDesc.includes('warning') ||
|
|
921
|
+
lowerDesc.includes('careful') ||
|
|
922
|
+
lowerDesc.includes('avoid')
|
|
923
|
+
)
|
|
924
|
+
inferredSeverity = 'warning';
|
|
925
|
+
|
|
926
|
+
// Auto-generate tags from title words
|
|
927
|
+
if (inferredTags.length === 0) {
|
|
928
|
+
inferredTags = title
|
|
929
|
+
.toLowerCase()
|
|
930
|
+
.split(/\s+/)
|
|
931
|
+
.filter(
|
|
932
|
+
(w) =>
|
|
933
|
+
w.length > 3 && !['with', 'from', 'that', 'this', 'have', 'been'].includes(w),
|
|
934
|
+
)
|
|
935
|
+
.slice(0, 5);
|
|
936
|
+
}
|
|
937
|
+
|
|
938
|
+
const entry: IntelligenceEntry = {
|
|
939
|
+
id: `enriched-${Date.now()}-${Math.random().toString(36).slice(2, 6)}`,
|
|
940
|
+
type: inferredType,
|
|
941
|
+
domain: inferredDomain,
|
|
942
|
+
title,
|
|
943
|
+
severity: inferredSeverity,
|
|
944
|
+
description,
|
|
945
|
+
tags: inferredTags,
|
|
946
|
+
};
|
|
947
|
+
|
|
948
|
+
vault.add(entry);
|
|
949
|
+
|
|
950
|
+
return {
|
|
951
|
+
captured: true,
|
|
952
|
+
enriched,
|
|
953
|
+
entry,
|
|
954
|
+
autoTags: inferredTags,
|
|
955
|
+
};
|
|
956
|
+
} catch (err) {
|
|
957
|
+
return { error: (err as Error).message };
|
|
958
|
+
}
|
|
959
|
+
},
|
|
960
|
+
},
|
|
749
961
|
|
|
750
962
|
// ─── LLM ─────────────────────────────────────────────────────
|
|
751
963
|
{
|
|
@@ -1176,6 +1388,9 @@ export function createCoreOps(runtime: AgentRuntime): OpDefinition[] {
|
|
|
1176
1388
|
},
|
|
1177
1389
|
},
|
|
1178
1390
|
|
|
1391
|
+
// ─── Playbook ops (from dedicated module) ─────────────────────────
|
|
1392
|
+
...createPlaybookOps(runtime),
|
|
1393
|
+
|
|
1179
1394
|
// ─── Extra Ops (from dedicated modules) ─────────────────────────
|
|
1180
1395
|
...createPlanningExtraOps(runtime),
|
|
1181
1396
|
...createMemoryExtraOps(runtime),
|
|
@@ -1189,5 +1404,40 @@ export function createCoreOps(runtime: AgentRuntime): OpDefinition[] {
|
|
|
1189
1404
|
...createCuratorExtraOps(runtime),
|
|
1190
1405
|
...createProjectOps(runtime),
|
|
1191
1406
|
...createMemoryCrossProjectOps(runtime),
|
|
1407
|
+
|
|
1408
|
+
// ─── Cognee Sync ──────────────────────────────────────────────
|
|
1409
|
+
...createCogneeSyncOps(syncManager),
|
|
1410
|
+
|
|
1411
|
+
// ─── Intake Pipeline ──────────────────────────────────────────
|
|
1412
|
+
...createIntakeOps(intakePipeline),
|
|
1413
|
+
|
|
1414
|
+
// ─── Prompt Templates ─────────────────────────────────────────
|
|
1415
|
+
{
|
|
1416
|
+
name: 'render_prompt',
|
|
1417
|
+
description:
|
|
1418
|
+
'Render a prompt template with variable substitution. Templates are .prompt files loaded from the templates directory.',
|
|
1419
|
+
auth: 'read' as const,
|
|
1420
|
+
schema: z.object({
|
|
1421
|
+
template: z.string().describe('Template name (without .prompt extension)'),
|
|
1422
|
+
variables: z.record(z.string()).optional().default({}),
|
|
1423
|
+
strict: z.boolean().optional().default(true),
|
|
1424
|
+
}),
|
|
1425
|
+
handler: async (params) => {
|
|
1426
|
+
const rendered = runtime.templateManager.render(
|
|
1427
|
+
params.template as string,
|
|
1428
|
+
(params.variables ?? {}) as Record<string, string>,
|
|
1429
|
+
{ strict: params.strict as boolean },
|
|
1430
|
+
);
|
|
1431
|
+
return { rendered };
|
|
1432
|
+
},
|
|
1433
|
+
},
|
|
1434
|
+
{
|
|
1435
|
+
name: 'list_templates',
|
|
1436
|
+
description: 'List all loaded prompt templates.',
|
|
1437
|
+
auth: 'read' as const,
|
|
1438
|
+
handler: async () => ({
|
|
1439
|
+
templates: runtime.templateManager.listTemplates(),
|
|
1440
|
+
}),
|
|
1441
|
+
},
|
|
1192
1442
|
];
|
|
1193
1443
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Extra curator operations —
|
|
2
|
+
* Extra curator operations — 5 ops that extend the 8 base curator ops in core-ops.ts.
|
|
3
3
|
*
|
|
4
|
-
* Groups: entry history (2), queue stats (1), metadata enrichment (1).
|
|
4
|
+
* Groups: entry history (2), queue stats (1), metadata enrichment (1), hybrid detection (1).
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import { z } from 'zod';
|
|
@@ -27,7 +27,7 @@ export function createCuratorExtraOps(runtime: AgentRuntime): OpDefinition[] {
|
|
|
27
27
|
},
|
|
28
28
|
{
|
|
29
29
|
name: 'curator_record_snapshot',
|
|
30
|
-
description:
|
|
30
|
+
description: "Manually record a snapshot of an entry's current state.",
|
|
31
31
|
auth: 'write',
|
|
32
32
|
schema: z.object({
|
|
33
33
|
entryId: z.string().describe('Entry ID to snapshot.'),
|
|
@@ -67,5 +67,19 @@ export function createCuratorExtraOps(runtime: AgentRuntime): OpDefinition[] {
|
|
|
67
67
|
return curator.enrichMetadata(params.entryId as string);
|
|
68
68
|
},
|
|
69
69
|
},
|
|
70
|
+
|
|
71
|
+
// ─── Hybrid Contradiction Detection (#36) ────────────────────────
|
|
72
|
+
{
|
|
73
|
+
name: 'curator_hybrid_contradictions',
|
|
74
|
+
description:
|
|
75
|
+
'Detect contradictions using hybrid TF-IDF + Cognee vector similarity. Falls back to TF-IDF only when Cognee is unavailable.',
|
|
76
|
+
auth: 'read',
|
|
77
|
+
schema: z.object({
|
|
78
|
+
threshold: z.number().optional().describe('Similarity threshold (default 0.4)'),
|
|
79
|
+
}),
|
|
80
|
+
handler: async (params) => {
|
|
81
|
+
return curator.detectContradictionsHybrid(params.threshold as number | undefined);
|
|
82
|
+
},
|
|
83
|
+
},
|
|
70
84
|
];
|
|
71
85
|
}
|
|
@@ -36,7 +36,7 @@ export function createDomainFacade(
|
|
|
36
36
|
schema: z.object({
|
|
37
37
|
tags: z.array(z.string()).optional(),
|
|
38
38
|
severity: z.enum(['critical', 'warning', 'suggestion']).optional(),
|
|
39
|
-
type: z.enum(['pattern', 'anti-pattern', 'rule']).optional(),
|
|
39
|
+
type: z.enum(['pattern', 'anti-pattern', 'rule', 'playbook']).optional(),
|
|
40
40
|
limit: z.number().optional(),
|
|
41
41
|
}),
|
|
42
42
|
handler: async (params) => {
|
|
@@ -83,7 +83,7 @@ export function createDomainFacade(
|
|
|
83
83
|
auth: 'write',
|
|
84
84
|
schema: z.object({
|
|
85
85
|
id: z.string(),
|
|
86
|
-
type: z.enum(['pattern', 'anti-pattern', 'rule']),
|
|
86
|
+
type: z.enum(['pattern', 'anti-pattern', 'rule', 'playbook']),
|
|
87
87
|
title: z.string(),
|
|
88
88
|
severity: z.enum(['critical', 'warning', 'suggestion']),
|
|
89
89
|
description: z.string(),
|
|
@@ -35,7 +35,8 @@ export function createGradingOps(runtime: AgentRuntime): OpDefinition[] {
|
|
|
35
35
|
|
|
36
36
|
{
|
|
37
37
|
name: 'plan_check_history',
|
|
38
|
-
description:
|
|
38
|
+
description:
|
|
39
|
+
'Get all grading checks for a plan (history). Shows score progression across iterations.',
|
|
39
40
|
auth: 'read',
|
|
40
41
|
schema: z.object({
|
|
41
42
|
planId: z.string().describe('The plan ID.'),
|
|
@@ -96,7 +97,15 @@ export function createGradingOps(runtime: AgentRuntime): OpDefinition[] {
|
|
|
96
97
|
);
|
|
97
98
|
|
|
98
99
|
// Group by severity for structured output
|
|
99
|
-
const grouped: Record<
|
|
100
|
+
const grouped: Record<
|
|
101
|
+
string,
|
|
102
|
+
Array<{
|
|
103
|
+
category: string;
|
|
104
|
+
description: string;
|
|
105
|
+
recommendation: string;
|
|
106
|
+
location?: string;
|
|
107
|
+
}>
|
|
108
|
+
> = {};
|
|
100
109
|
for (const g of sortedGaps) {
|
|
101
110
|
if (!grouped[g.severity]) grouped[g.severity] = [];
|
|
102
111
|
grouped[g.severity].push({
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Intake operations — 4 ops for book/PDF ingestion.
|
|
3
|
+
*
|
|
4
|
+
* Ops: intake_ingest_book, intake_process, intake_status, intake_preview.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import { z } from 'zod';
|
|
8
|
+
import type { OpDefinition } from '../facades/types.js';
|
|
9
|
+
import type { IntakePipeline } from '../intake/intake-pipeline.js';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Create the 4 intake operations.
|
|
13
|
+
*
|
|
14
|
+
* The pipeline is optional — when null, all ops return a graceful error.
|
|
15
|
+
*/
|
|
16
|
+
export function createIntakeOps(pipeline: IntakePipeline | null): OpDefinition[] {
|
|
17
|
+
return [
|
|
18
|
+
// ─── Ingest Book ──────────────────────────────────────────────
|
|
19
|
+
{
|
|
20
|
+
name: 'intake_ingest_book',
|
|
21
|
+
description:
|
|
22
|
+
'Ingest a PDF book — parse, hash, chunk into fixed-size page windows, and create a resumable job.',
|
|
23
|
+
auth: 'write',
|
|
24
|
+
schema: z.object({
|
|
25
|
+
pdfPath: z.string().describe('Absolute path to the PDF file.'),
|
|
26
|
+
title: z.string().describe('Book title for citation and chunk labeling.'),
|
|
27
|
+
domain: z.string().describe('Knowledge domain (e.g., "design-systems", "accessibility").'),
|
|
28
|
+
author: z.string().optional().describe('Book author for metadata.'),
|
|
29
|
+
chunkPageSize: z.number().optional().describe('Number of pages per chunk. Defaults to 10.'),
|
|
30
|
+
tags: z
|
|
31
|
+
.array(z.string())
|
|
32
|
+
.optional()
|
|
33
|
+
.describe('Additional tags applied to all extracted entries.'),
|
|
34
|
+
}),
|
|
35
|
+
handler: async (params) => {
|
|
36
|
+
if (!pipeline) {
|
|
37
|
+
return { error: 'Intake pipeline not configured' };
|
|
38
|
+
}
|
|
39
|
+
const config = {
|
|
40
|
+
pdfPath: params.pdfPath as string,
|
|
41
|
+
title: params.title as string,
|
|
42
|
+
domain: params.domain as string,
|
|
43
|
+
author: params.author as string | undefined,
|
|
44
|
+
chunkPageSize: params.chunkPageSize as number | undefined,
|
|
45
|
+
tags: params.tags as string[] | undefined,
|
|
46
|
+
};
|
|
47
|
+
return pipeline.ingestBook(config);
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
|
|
51
|
+
// ─── Process Chunks ───────────────────────────────────────────
|
|
52
|
+
{
|
|
53
|
+
name: 'intake_process',
|
|
54
|
+
description:
|
|
55
|
+
'Process pending chunks for a job — extract text, classify via LLM, dedup, and store unique items in the vault.',
|
|
56
|
+
auth: 'write',
|
|
57
|
+
schema: z.object({
|
|
58
|
+
jobId: z.string().describe('Job ID returned from intake_ingest_book.'),
|
|
59
|
+
count: z
|
|
60
|
+
.number()
|
|
61
|
+
.optional()
|
|
62
|
+
.describe('Max number of chunks to process in this batch. Defaults to 5.'),
|
|
63
|
+
}),
|
|
64
|
+
handler: async (params) => {
|
|
65
|
+
if (!pipeline) {
|
|
66
|
+
return { error: 'Intake pipeline not configured' };
|
|
67
|
+
}
|
|
68
|
+
return pipeline.processChunks(params.jobId as string, params.count as number | undefined);
|
|
69
|
+
},
|
|
70
|
+
},
|
|
71
|
+
|
|
72
|
+
// ─── Status ───────────────────────────────────────────────────
|
|
73
|
+
{
|
|
74
|
+
name: 'intake_status',
|
|
75
|
+
description:
|
|
76
|
+
'Get intake job status. With jobId: returns job record and chunks. Without: lists all jobs.',
|
|
77
|
+
auth: 'read',
|
|
78
|
+
schema: z.object({
|
|
79
|
+
jobId: z.string().optional().describe('Job ID to inspect. Omit to list all jobs.'),
|
|
80
|
+
}),
|
|
81
|
+
handler: async (params) => {
|
|
82
|
+
if (!pipeline) {
|
|
83
|
+
return { error: 'Intake pipeline not configured' };
|
|
84
|
+
}
|
|
85
|
+
const jobId = params.jobId as string | undefined;
|
|
86
|
+
if (jobId) {
|
|
87
|
+
const job = pipeline.getJob(jobId);
|
|
88
|
+
if (!job) {
|
|
89
|
+
return { error: `Job not found: ${jobId}` };
|
|
90
|
+
}
|
|
91
|
+
const chunks = pipeline.getChunks(jobId);
|
|
92
|
+
return { job, chunks };
|
|
93
|
+
}
|
|
94
|
+
return { jobs: pipeline.listJobs() };
|
|
95
|
+
},
|
|
96
|
+
},
|
|
97
|
+
|
|
98
|
+
// ─── Preview ──────────────────────────────────────────────────
|
|
99
|
+
{
|
|
100
|
+
name: 'intake_preview',
|
|
101
|
+
description:
|
|
102
|
+
'Preview what the pipeline would extract from a page range — parses and classifies without storing.',
|
|
103
|
+
auth: 'read',
|
|
104
|
+
schema: z.object({
|
|
105
|
+
pdfPath: z.string().describe('Absolute path to the PDF file.'),
|
|
106
|
+
title: z.string().describe('Book title for citation context.'),
|
|
107
|
+
domain: z.string().describe('Knowledge domain for classification context.'),
|
|
108
|
+
pageStart: z.number().describe('First page of the range (1-indexed, inclusive).'),
|
|
109
|
+
pageEnd: z.number().describe('Last page of the range (1-indexed, inclusive).'),
|
|
110
|
+
}),
|
|
111
|
+
handler: async (params) => {
|
|
112
|
+
if (!pipeline) {
|
|
113
|
+
return { error: 'Intake pipeline not configured' };
|
|
114
|
+
}
|
|
115
|
+
const { pdfPath, title, domain, pageStart, pageEnd } = params as {
|
|
116
|
+
pdfPath: string;
|
|
117
|
+
title: string;
|
|
118
|
+
domain: string;
|
|
119
|
+
pageStart: number;
|
|
120
|
+
pageEnd: number;
|
|
121
|
+
};
|
|
122
|
+
return pipeline.preview({ pdfPath, title, domain }, pageStart, pageEnd);
|
|
123
|
+
},
|
|
124
|
+
},
|
|
125
|
+
];
|
|
126
|
+
}
|