@soleri/core 2.1.0 → 2.5.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 +10 -1
- package/dist/brain/brain.d.ts.map +1 -1
- package/dist/brain/brain.js +116 -13
- package/dist/brain/brain.js.map +1 -1
- package/dist/brain/intelligence.d.ts +36 -1
- package/dist/brain/intelligence.d.ts.map +1 -1
- package/dist/brain/intelligence.js +119 -14
- package/dist/brain/intelligence.js.map +1 -1
- package/dist/brain/types.d.ts +34 -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 +22 -0
- package/dist/control/identity-manager.d.ts.map +1 -0
- package/dist/control/identity-manager.js +233 -0
- package/dist/control/identity-manager.js.map +1 -0
- package/dist/control/intent-router.d.ts +32 -0
- package/dist/control/intent-router.d.ts.map +1 -0
- package/dist/control/intent-router.js +242 -0
- package/dist/control/intent-router.js.map +1 -0
- package/dist/control/types.d.ts +68 -0
- package/dist/control/types.d.ts.map +1 -0
- package/dist/control/types.js +9 -0
- package/dist/control/types.js.map +1 -0
- package/dist/curator/curator.d.ts +37 -1
- package/dist/curator/curator.d.ts.map +1 -1
- package/dist/curator/curator.js +199 -1
- 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/facades/types.d.ts +1 -1
- package/dist/governance/governance.d.ts +42 -0
- package/dist/governance/governance.d.ts.map +1 -0
- package/dist/governance/governance.js +488 -0
- package/dist/governance/governance.js.map +1 -0
- package/dist/governance/index.d.ts +3 -0
- package/dist/governance/index.d.ts.map +1 -0
- package/dist/governance/index.js +2 -0
- package/dist/governance/index.js.map +1 -0
- package/dist/governance/types.d.ts +102 -0
- package/dist/governance/types.d.ts.map +1 -0
- package/dist/governance/types.js +3 -0
- package/dist/governance/types.js.map +1 -0
- package/dist/index.d.ts +52 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +47 -1
- 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/logging/logger.d.ts +37 -0
- package/dist/logging/logger.d.ts.map +1 -0
- package/dist/logging/logger.js +145 -0
- package/dist/logging/logger.js.map +1 -0
- package/dist/logging/types.d.ts +19 -0
- package/dist/logging/types.d.ts.map +1 -0
- package/dist/logging/types.js +2 -0
- package/dist/logging/types.js.map +1 -0
- package/dist/loop/loop-manager.d.ts +100 -0
- package/dist/loop/loop-manager.d.ts.map +1 -0
- package/dist/loop/loop-manager.js +379 -0
- package/dist/loop/loop-manager.js.map +1 -0
- package/dist/loop/types.d.ts +103 -0
- package/dist/loop/types.d.ts.map +1 -0
- package/dist/loop/types.js +11 -0
- package/dist/loop/types.js.map +1 -0
- package/dist/persistence/index.d.ts +3 -0
- package/dist/persistence/index.d.ts.map +1 -0
- package/dist/persistence/index.js +2 -0
- package/dist/persistence/index.js.map +1 -0
- package/dist/persistence/sqlite-provider.d.ts +25 -0
- package/dist/persistence/sqlite-provider.d.ts.map +1 -0
- package/dist/persistence/sqlite-provider.js +59 -0
- package/dist/persistence/sqlite-provider.js.map +1 -0
- package/dist/persistence/types.d.ts +36 -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 +72 -0
- package/dist/planning/gap-analysis.d.ts.map +1 -0
- package/dist/planning/gap-analysis.js +442 -0
- package/dist/planning/gap-analysis.js.map +1 -0
- package/dist/planning/gap-types.d.ts +29 -0
- package/dist/planning/gap-types.d.ts.map +1 -0
- package/dist/planning/gap-types.js +28 -0
- package/dist/planning/gap-types.js.map +1 -0
- package/dist/planning/planner.d.ts +421 -4
- package/dist/planning/planner.d.ts.map +1 -1
- package/dist/planning/planner.js +949 -21
- 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 +79 -0
- package/dist/project/project-registry.d.ts.map +1 -0
- package/dist/project/project-registry.js +274 -0
- package/dist/project/project-registry.js.map +1 -0
- package/dist/project/types.d.ts +28 -0
- package/dist/project/types.d.ts.map +1 -0
- package/dist/project/types.js +5 -0
- package/dist/project/types.js.map +1 -0
- 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 +15 -0
- package/dist/runtime/admin-extra-ops.d.ts.map +1 -0
- package/dist/runtime/admin-extra-ops.js +595 -0
- package/dist/runtime/admin-extra-ops.js.map +1 -0
- package/dist/runtime/admin-ops.d.ts +15 -0
- package/dist/runtime/admin-ops.d.ts.map +1 -0
- package/dist/runtime/admin-ops.js +329 -0
- package/dist/runtime/admin-ops.js.map +1 -0
- package/dist/runtime/capture-ops.d.ts +15 -0
- package/dist/runtime/capture-ops.d.ts.map +1 -0
- package/dist/runtime/capture-ops.js +363 -0
- package/dist/runtime/capture-ops.js.map +1 -0
- 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 +9 -3
- package/dist/runtime/core-ops.d.ts.map +1 -1
- package/dist/runtime/core-ops.js +693 -10
- package/dist/runtime/core-ops.js.map +1 -1
- package/dist/runtime/curator-extra-ops.d.ts +9 -0
- package/dist/runtime/curator-extra-ops.d.ts.map +1 -0
- package/dist/runtime/curator-extra-ops.js +71 -0
- package/dist/runtime/curator-extra-ops.js.map +1 -0
- package/dist/runtime/domain-ops.d.ts.map +1 -1
- package/dist/runtime/domain-ops.js +61 -15
- package/dist/runtime/domain-ops.js.map +1 -1
- package/dist/runtime/grading-ops.d.ts +14 -0
- package/dist/runtime/grading-ops.d.ts.map +1 -0
- package/dist/runtime/grading-ops.js +105 -0
- package/dist/runtime/grading-ops.js.map +1 -0
- 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 +14 -0
- package/dist/runtime/loop-ops.d.ts.map +1 -0
- package/dist/runtime/loop-ops.js +251 -0
- package/dist/runtime/loop-ops.js.map +1 -0
- package/dist/runtime/memory-cross-project-ops.d.ts +12 -0
- package/dist/runtime/memory-cross-project-ops.d.ts.map +1 -0
- package/dist/runtime/memory-cross-project-ops.js +165 -0
- package/dist/runtime/memory-cross-project-ops.js.map +1 -0
- package/dist/runtime/memory-extra-ops.d.ts +13 -0
- package/dist/runtime/memory-extra-ops.d.ts.map +1 -0
- package/dist/runtime/memory-extra-ops.js +173 -0
- package/dist/runtime/memory-extra-ops.js.map +1 -0
- package/dist/runtime/orchestrate-ops.d.ts +17 -0
- package/dist/runtime/orchestrate-ops.d.ts.map +1 -0
- package/dist/runtime/orchestrate-ops.js +246 -0
- package/dist/runtime/orchestrate-ops.js.map +1 -0
- package/dist/runtime/planning-extra-ops.d.ts +25 -0
- package/dist/runtime/planning-extra-ops.d.ts.map +1 -0
- package/dist/runtime/planning-extra-ops.js +663 -0
- package/dist/runtime/planning-extra-ops.js.map +1 -0
- 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 +15 -0
- package/dist/runtime/project-ops.d.ts.map +1 -0
- package/dist/runtime/project-ops.js +186 -0
- package/dist/runtime/project-ops.js.map +1 -0
- package/dist/runtime/runtime.d.ts.map +1 -1
- package/dist/runtime/runtime.js +65 -3
- package/dist/runtime/runtime.js.map +1 -1
- package/dist/runtime/types.d.ts +29 -0
- package/dist/runtime/types.d.ts.map +1 -1
- package/dist/runtime/vault-extra-ops.d.ts +10 -0
- package/dist/runtime/vault-extra-ops.d.ts.map +1 -0
- package/dist/runtime/vault-extra-ops.js +536 -0
- package/dist/runtime/vault-extra-ops.js.map +1 -0
- package/dist/telemetry/telemetry.d.ts +48 -0
- package/dist/telemetry/telemetry.d.ts.map +1 -0
- package/dist/telemetry/telemetry.js +87 -0
- package/dist/telemetry/telemetry.js.map +1 -0
- 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 +97 -4
- package/dist/vault/vault.d.ts.map +1 -1
- package/dist/vault/vault.js +424 -65
- package/dist/vault/vault.js.map +1 -1
- package/package.json +7 -3
- package/src/__tests__/admin-extra-ops.test.ts +467 -0
- package/src/__tests__/admin-ops.test.ts +271 -0
- package/src/__tests__/brain-intelligence.test.ts +205 -0
- package/src/__tests__/brain.test.ts +134 -3
- package/src/__tests__/capture-ops.test.ts +509 -0
- 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 +292 -2
- package/src/__tests__/curator-extra-ops.test.ts +381 -0
- package/src/__tests__/domain-ops.test.ts +66 -0
- package/src/__tests__/errors.test.ts +388 -0
- package/src/__tests__/governance.test.ts +522 -0
- package/src/__tests__/grading-ops.test.ts +361 -0
- package/src/__tests__/identity-manager.test.ts +243 -0
- package/src/__tests__/intake-pipeline.test.ts +162 -0
- package/src/__tests__/intent-router.test.ts +222 -0
- package/src/__tests__/logger.test.ts +200 -0
- package/src/__tests__/loop-ops.test.ts +469 -0
- package/src/__tests__/memory-cross-project-ops.test.ts +248 -0
- package/src/__tests__/memory-extra-ops.test.ts +352 -0
- package/src/__tests__/orchestrate-ops.test.ts +289 -0
- package/src/__tests__/persistence.test.ts +225 -0
- package/src/__tests__/planner.test.ts +416 -7
- package/src/__tests__/planning-extra-ops.test.ts +706 -0
- 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__/project-ops.test.ts +381 -0
- package/src/__tests__/template-manager.test.ts +222 -0
- package/src/__tests__/vault-extra-ops.test.ts +482 -0
- package/src/brain/brain.ts +185 -16
- package/src/brain/intelligence.ts +179 -10
- package/src/brain/types.ts +40 -2
- package/src/cognee/client.ts +18 -0
- package/src/cognee/sync-manager.ts +389 -0
- package/src/control/identity-manager.ts +354 -0
- package/src/control/intent-router.ts +326 -0
- package/src/control/types.ts +102 -0
- package/src/curator/curator.ts +295 -1
- 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 +698 -0
- package/src/governance/index.ts +18 -0
- package/src/governance/types.ts +111 -0
- package/src/index.ts +213 -2
- 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/logging/logger.ts +154 -0
- package/src/logging/types.ts +21 -0
- package/src/loop/loop-manager.ts +448 -0
- package/src/loop/types.ts +115 -0
- package/src/persistence/index.ts +7 -0
- package/src/persistence/sqlite-provider.ts +62 -0
- package/src/persistence/types.ts +44 -0
- package/src/planning/gap-analysis.ts +775 -0
- package/src/planning/gap-types.ts +61 -0
- package/src/planning/planner.ts +1273 -24
- 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 +370 -0
- package/src/project/types.ts +31 -0
- 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 +652 -0
- package/src/runtime/admin-ops.ts +340 -0
- package/src/runtime/capture-ops.ts +404 -0
- package/src/runtime/cognee-sync-ops.ts +63 -0
- package/src/runtime/core-ops.ts +787 -9
- package/src/runtime/curator-extra-ops.ts +85 -0
- package/src/runtime/domain-ops.ts +67 -15
- package/src/runtime/grading-ops.ts +130 -0
- package/src/runtime/intake-ops.ts +126 -0
- package/src/runtime/loop-ops.ts +277 -0
- package/src/runtime/memory-cross-project-ops.ts +191 -0
- package/src/runtime/memory-extra-ops.ts +186 -0
- package/src/runtime/orchestrate-ops.ts +278 -0
- package/src/runtime/planning-extra-ops.ts +718 -0
- package/src/runtime/playbook-ops.ts +169 -0
- package/src/runtime/project-ops.ts +202 -0
- package/src/runtime/runtime.ts +77 -3
- package/src/runtime/types.ts +29 -0
- package/src/runtime/vault-extra-ops.ts +606 -0
- package/src/telemetry/telemetry.ts +118 -0
- package/src/vault/playbook.ts +87 -0
- package/src/vault/vault.ts +575 -98
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Extra curator operations — 5 ops that extend the 8 base curator ops in core-ops.ts.
|
|
3
|
+
*
|
|
4
|
+
* Groups: entry history (2), queue stats (1), metadata enrichment (1), hybrid detection (1).
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import { z } from 'zod';
|
|
8
|
+
import type { OpDefinition } from '../facades/types.js';
|
|
9
|
+
import type { AgentRuntime } from './types.js';
|
|
10
|
+
|
|
11
|
+
export function createCuratorExtraOps(runtime: AgentRuntime): OpDefinition[] {
|
|
12
|
+
const { curator } = runtime;
|
|
13
|
+
|
|
14
|
+
return [
|
|
15
|
+
// ─── Entry History ──────────────────────────────────────────────
|
|
16
|
+
{
|
|
17
|
+
name: 'curator_entry_history',
|
|
18
|
+
description: 'Get version history (snapshots) for a vault entry.',
|
|
19
|
+
auth: 'read',
|
|
20
|
+
schema: z.object({
|
|
21
|
+
entryId: z.string().describe('Entry ID to get history for.'),
|
|
22
|
+
}),
|
|
23
|
+
handler: async (params) => {
|
|
24
|
+
const history = curator.getVersionHistory(params.entryId as string);
|
|
25
|
+
return { entryId: params.entryId, history, count: history.length };
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
name: 'curator_record_snapshot',
|
|
30
|
+
description: "Manually record a snapshot of an entry's current state.",
|
|
31
|
+
auth: 'write',
|
|
32
|
+
schema: z.object({
|
|
33
|
+
entryId: z.string().describe('Entry ID to snapshot.'),
|
|
34
|
+
changedBy: z.string().optional().describe('Who made the change. Default "system".'),
|
|
35
|
+
changeReason: z.string().optional().describe('Why the snapshot was recorded.'),
|
|
36
|
+
}),
|
|
37
|
+
handler: async (params) => {
|
|
38
|
+
return curator.recordSnapshot(
|
|
39
|
+
params.entryId as string,
|
|
40
|
+
params.changedBy as string | undefined,
|
|
41
|
+
params.changeReason as string | undefined,
|
|
42
|
+
);
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
|
|
46
|
+
// ─── Queue Stats ────────────────────────────────────────────────
|
|
47
|
+
{
|
|
48
|
+
name: 'curator_queue_stats',
|
|
49
|
+
description:
|
|
50
|
+
'Grooming queue statistics — total, groomed, ungroomed, stale (30+ days), fresh (7 days), average days since groom.',
|
|
51
|
+
auth: 'read',
|
|
52
|
+
handler: async () => {
|
|
53
|
+
return curator.getQueueStats();
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
|
|
57
|
+
// ─── Metadata Enrichment ────────────────────────────────────────
|
|
58
|
+
{
|
|
59
|
+
name: 'curator_enrich',
|
|
60
|
+
description:
|
|
61
|
+
'Rule-based metadata enrichment — auto-capitalize title, normalize tags, infer severity/type from keywords, trim description.',
|
|
62
|
+
auth: 'write',
|
|
63
|
+
schema: z.object({
|
|
64
|
+
entryId: z.string().describe('Entry ID to enrich.'),
|
|
65
|
+
}),
|
|
66
|
+
handler: async (params) => {
|
|
67
|
+
return curator.enrichMetadata(params.entryId as string);
|
|
68
|
+
},
|
|
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
|
+
},
|
|
84
|
+
];
|
|
85
|
+
}
|
|
@@ -25,7 +25,7 @@ export function createDomainFacade(
|
|
|
25
25
|
agentId: string,
|
|
26
26
|
domain: string,
|
|
27
27
|
): FacadeConfig {
|
|
28
|
-
const { vault, brain } = runtime;
|
|
28
|
+
const { vault, brain, governance } = runtime;
|
|
29
29
|
const facadeName = `${agentId}_${domain.replace(/-/g, '_')}`;
|
|
30
30
|
|
|
31
31
|
const ops: OpDefinition[] = [
|
|
@@ -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(),
|
|
@@ -92,21 +92,73 @@ export function createDomainFacade(
|
|
|
92
92
|
counterExample: z.string().optional(),
|
|
93
93
|
why: z.string().optional(),
|
|
94
94
|
tags: z.array(z.string()).optional().default([]),
|
|
95
|
+
projectPath: z.string().optional().default('.'),
|
|
95
96
|
}),
|
|
96
97
|
handler: async (params) => {
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
example: params.example as string | undefined,
|
|
106
|
-
counterExample: params.counterExample as string | undefined,
|
|
107
|
-
why: params.why as string | undefined,
|
|
108
|
-
tags: params.tags as string[],
|
|
98
|
+
const projectPath = (params.projectPath as string | undefined) ?? '.';
|
|
99
|
+
const entryType = params.type as string;
|
|
100
|
+
const title = params.title as string;
|
|
101
|
+
|
|
102
|
+
const decision = governance.evaluateCapture(projectPath, {
|
|
103
|
+
type: entryType,
|
|
104
|
+
category: domain,
|
|
105
|
+
title,
|
|
109
106
|
});
|
|
107
|
+
|
|
108
|
+
switch (decision.action) {
|
|
109
|
+
case 'capture': {
|
|
110
|
+
const result = brain.enrichAndCapture({
|
|
111
|
+
id: params.id as string,
|
|
112
|
+
type: params.type as 'pattern' | 'anti-pattern' | 'rule',
|
|
113
|
+
domain,
|
|
114
|
+
title,
|
|
115
|
+
severity: params.severity as 'critical' | 'warning' | 'suggestion',
|
|
116
|
+
description: params.description as string,
|
|
117
|
+
context: params.context as string | undefined,
|
|
118
|
+
example: params.example as string | undefined,
|
|
119
|
+
counterExample: params.counterExample as string | undefined,
|
|
120
|
+
why: params.why as string | undefined,
|
|
121
|
+
tags: params.tags as string[],
|
|
122
|
+
});
|
|
123
|
+
return { ...result, governance: { action: 'capture' as const } };
|
|
124
|
+
}
|
|
125
|
+
case 'propose': {
|
|
126
|
+
const proposalId = governance.propose(
|
|
127
|
+
projectPath,
|
|
128
|
+
{
|
|
129
|
+
entryId: params.id as string,
|
|
130
|
+
title,
|
|
131
|
+
type: entryType,
|
|
132
|
+
category: domain,
|
|
133
|
+
data: {
|
|
134
|
+
severity: params.severity,
|
|
135
|
+
description: params.description,
|
|
136
|
+
context: params.context,
|
|
137
|
+
example: params.example,
|
|
138
|
+
counterExample: params.counterExample,
|
|
139
|
+
why: params.why,
|
|
140
|
+
tags: params.tags,
|
|
141
|
+
},
|
|
142
|
+
},
|
|
143
|
+
'domain-capture',
|
|
144
|
+
);
|
|
145
|
+
return {
|
|
146
|
+
captured: false,
|
|
147
|
+
id: params.id as string,
|
|
148
|
+
autoTags: [],
|
|
149
|
+
governance: { action: 'propose' as const, proposalId, reason: decision.reason },
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
default: {
|
|
153
|
+
// reject or quarantine
|
|
154
|
+
return {
|
|
155
|
+
captured: false,
|
|
156
|
+
id: params.id as string,
|
|
157
|
+
autoTags: [],
|
|
158
|
+
governance: { action: decision.action, reason: decision.reason },
|
|
159
|
+
};
|
|
160
|
+
}
|
|
161
|
+
}
|
|
110
162
|
},
|
|
111
163
|
},
|
|
112
164
|
{
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Plan grading operations — 5 ops for iterative plan quality scoring.
|
|
3
|
+
* Uses 6-pass gap analysis with severity-weighted scoring (ported from Salvador).
|
|
4
|
+
*
|
|
5
|
+
* Ops: plan_grade, plan_check_history, plan_latest_check,
|
|
6
|
+
* plan_meets_grade, plan_auto_improve.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import { z } from 'zod';
|
|
10
|
+
import type { OpDefinition } from '../facades/types.js';
|
|
11
|
+
import type { AgentRuntime } from './types.js';
|
|
12
|
+
|
|
13
|
+
const planGradeSchema = z.enum(['A+', 'A', 'B', 'C', 'D', 'F']);
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Create the 5 plan grading operations for an agent runtime.
|
|
17
|
+
*/
|
|
18
|
+
export function createGradingOps(runtime: AgentRuntime): OpDefinition[] {
|
|
19
|
+
const { planner } = runtime;
|
|
20
|
+
|
|
21
|
+
return [
|
|
22
|
+
{
|
|
23
|
+
name: 'plan_grade',
|
|
24
|
+
description:
|
|
25
|
+
'Grade a plan using 6-pass gap analysis — severity-weighted scoring (critical=30, major=15, minor=2). Returns grade, score, gaps with recommendations, and iteration number.',
|
|
26
|
+
auth: 'read',
|
|
27
|
+
schema: z.object({
|
|
28
|
+
planId: z.string().describe('The plan ID to grade.'),
|
|
29
|
+
}),
|
|
30
|
+
handler: async (params) => {
|
|
31
|
+
const planId = params.planId as string;
|
|
32
|
+
return planner.grade(planId);
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
|
|
36
|
+
{
|
|
37
|
+
name: 'plan_check_history',
|
|
38
|
+
description:
|
|
39
|
+
'Get all grading checks for a plan (history). Shows score progression across iterations.',
|
|
40
|
+
auth: 'read',
|
|
41
|
+
schema: z.object({
|
|
42
|
+
planId: z.string().describe('The plan ID.'),
|
|
43
|
+
}),
|
|
44
|
+
handler: async (params) => {
|
|
45
|
+
const planId = params.planId as string;
|
|
46
|
+
const checks = planner.getCheckHistory(planId);
|
|
47
|
+
return { planId, count: checks.length, checks };
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
|
|
51
|
+
{
|
|
52
|
+
name: 'plan_latest_check',
|
|
53
|
+
description: 'Get the latest grading check for a plan.',
|
|
54
|
+
auth: 'read',
|
|
55
|
+
schema: z.object({
|
|
56
|
+
planId: z.string().describe('The plan ID.'),
|
|
57
|
+
}),
|
|
58
|
+
handler: async (params) => {
|
|
59
|
+
const planId = params.planId as string;
|
|
60
|
+
const check = planner.getLatestCheck(planId);
|
|
61
|
+
return check ?? { planId, check: null, message: 'No checks found for this plan.' };
|
|
62
|
+
},
|
|
63
|
+
},
|
|
64
|
+
|
|
65
|
+
{
|
|
66
|
+
name: 'plan_meets_grade',
|
|
67
|
+
description:
|
|
68
|
+
'Check if a plan meets a target grade. Thresholds: A+=95, A=90, B=80, C=70, D=60.',
|
|
69
|
+
auth: 'read',
|
|
70
|
+
schema: z.object({
|
|
71
|
+
planId: z.string().describe('The plan ID.'),
|
|
72
|
+
targetGrade: planGradeSchema.describe('Target grade: A+, A, B, C, D, or F.'),
|
|
73
|
+
}),
|
|
74
|
+
handler: async (params) => {
|
|
75
|
+
const planId = params.planId as string;
|
|
76
|
+
const targetGrade = params.targetGrade as 'A+' | 'A' | 'B' | 'C' | 'D' | 'F';
|
|
77
|
+
return planner.meetsGrade(planId, targetGrade);
|
|
78
|
+
},
|
|
79
|
+
},
|
|
80
|
+
|
|
81
|
+
{
|
|
82
|
+
name: 'plan_auto_improve',
|
|
83
|
+
description:
|
|
84
|
+
'Grade a plan and return gaps grouped by severity with actionable recommendations. Critical gaps first.',
|
|
85
|
+
auth: 'read',
|
|
86
|
+
schema: z.object({
|
|
87
|
+
planId: z.string().describe('The plan ID.'),
|
|
88
|
+
}),
|
|
89
|
+
handler: async (params) => {
|
|
90
|
+
const planId = params.planId as string;
|
|
91
|
+
const check = planner.grade(planId);
|
|
92
|
+
|
|
93
|
+
// Sort gaps by severity: critical > major > minor > info
|
|
94
|
+
const severityOrder: Record<string, number> = { critical: 0, major: 1, minor: 2, info: 3 };
|
|
95
|
+
const sortedGaps = [...check.gaps].sort(
|
|
96
|
+
(a, b) => (severityOrder[a.severity] ?? 4) - (severityOrder[b.severity] ?? 4),
|
|
97
|
+
);
|
|
98
|
+
|
|
99
|
+
// Group by severity for structured output
|
|
100
|
+
const grouped: Record<
|
|
101
|
+
string,
|
|
102
|
+
Array<{
|
|
103
|
+
category: string;
|
|
104
|
+
description: string;
|
|
105
|
+
recommendation: string;
|
|
106
|
+
location?: string;
|
|
107
|
+
}>
|
|
108
|
+
> = {};
|
|
109
|
+
for (const g of sortedGaps) {
|
|
110
|
+
if (!grouped[g.severity]) grouped[g.severity] = [];
|
|
111
|
+
grouped[g.severity].push({
|
|
112
|
+
category: g.category,
|
|
113
|
+
description: g.description,
|
|
114
|
+
recommendation: g.recommendation,
|
|
115
|
+
...(g.location ? { location: g.location } : {}),
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
return {
|
|
120
|
+
grade: check.grade,
|
|
121
|
+
score: check.score,
|
|
122
|
+
iteration: check.iteration,
|
|
123
|
+
totalGaps: check.gaps.length,
|
|
124
|
+
gapsBySeverity: grouped,
|
|
125
|
+
nextAction: check.score >= 90 ? 'approve' : 'iterate',
|
|
126
|
+
};
|
|
127
|
+
},
|
|
128
|
+
},
|
|
129
|
+
];
|
|
130
|
+
}
|
|
@@ -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
|
+
}
|