@decibelsystems/tools 2.1.2 → 2.1.3
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/agentCommands.d.ts +11 -0
- package/dist/agentCommands.d.ts.map +1 -0
- package/dist/agentCommands.js +267 -0
- package/dist/agentCommands.js.map +1 -0
- package/dist/agentInbox.d.ts +37 -0
- package/dist/agentInbox.d.ts.map +1 -0
- package/dist/agentInbox.js +128 -0
- package/dist/agentInbox.js.map +1 -0
- package/dist/agentPresence.d.ts +36 -0
- package/dist/agentPresence.d.ts.map +1 -0
- package/dist/agentPresence.js +227 -0
- package/dist/agentPresence.js.map +1 -0
- package/dist/agenticJobs.d.ts +49 -0
- package/dist/agenticJobs.d.ts.map +1 -0
- package/dist/agenticJobs.js +190 -0
- package/dist/agenticJobs.js.map +1 -0
- package/dist/architectAdrs.d.ts +7 -0
- package/dist/architectAdrs.d.ts.map +1 -1
- package/dist/architectAdrs.js +91 -28
- package/dist/architectAdrs.js.map +1 -1
- package/dist/daemon.d.ts +6 -0
- package/dist/daemon.d.ts.map +1 -1
- package/dist/daemon.js +14 -0
- package/dist/daemon.js.map +1 -1
- package/dist/facades/definitions.d.ts.map +1 -1
- package/dist/facades/definitions.js +40 -6
- package/dist/facades/definitions.js.map +1 -1
- package/dist/hq/defineAgent.d.ts +11 -0
- package/dist/hq/defineAgent.d.ts.map +1 -0
- package/dist/hq/defineAgent.js +185 -0
- package/dist/hq/defineAgent.js.map +1 -0
- package/dist/hq/index.d.ts +3 -0
- package/dist/hq/index.d.ts.map +1 -0
- package/dist/hq/index.js +28 -0
- package/dist/hq/index.js.map +1 -0
- package/dist/hq/types.d.ts +59 -0
- package/dist/hq/types.d.ts.map +1 -0
- package/dist/hq/types.js +12 -0
- package/dist/hq/types.js.map +1 -0
- package/dist/httpServer.d.ts +1 -1
- package/dist/httpServer.d.ts.map +1 -1
- package/dist/httpServer.js +327 -19
- package/dist/httpServer.js.map +1 -1
- package/dist/kernel.d.ts +3 -1
- package/dist/kernel.d.ts.map +1 -1
- package/dist/kernel.js +40 -9
- package/dist/kernel.js.map +1 -1
- package/dist/projectRegistry.d.ts +27 -0
- package/dist/projectRegistry.d.ts.map +1 -1
- package/dist/projectRegistry.js +191 -5
- package/dist/projectRegistry.js.map +1 -1
- package/dist/sentinelIssues.d.ts +5 -0
- package/dist/sentinelIssues.d.ts.map +1 -1
- package/dist/sentinelIssues.js +1 -1
- package/dist/sentinelIssues.js.map +1 -1
- package/dist/server.js +12 -0
- package/dist/server.js.map +1 -1
- package/dist/store/fsStore.d.ts +6 -0
- package/dist/store/fsStore.d.ts.map +1 -0
- package/dist/store/fsStore.js +77 -0
- package/dist/store/fsStore.js.map +1 -0
- package/dist/store/index.d.ts +8 -0
- package/dist/store/index.d.ts.map +1 -0
- package/dist/store/index.js +23 -0
- package/dist/store/index.js.map +1 -0
- package/dist/store/markdown.d.ts +21 -0
- package/dist/store/markdown.d.ts.map +1 -0
- package/dist/store/markdown.js +175 -0
- package/dist/store/markdown.js.map +1 -0
- package/dist/store/supabaseStore.d.ts +6 -0
- package/dist/store/supabaseStore.d.ts.map +1 -0
- package/dist/store/supabaseStore.js +152 -0
- package/dist/store/supabaseStore.js.map +1 -0
- package/dist/store/types.d.ts +49 -0
- package/dist/store/types.d.ts.map +1 -0
- package/dist/store/types.js +11 -0
- package/dist/store/types.js.map +1 -0
- package/dist/supabaseRetry.d.ts +21 -0
- package/dist/supabaseRetry.d.ts.map +1 -0
- package/dist/supabaseRetry.js +72 -0
- package/dist/supabaseRetry.js.map +1 -0
- package/dist/toolConfig.d.ts +49 -0
- package/dist/toolConfig.d.ts.map +1 -0
- package/dist/toolConfig.js +309 -0
- package/dist/toolConfig.js.map +1 -0
- package/dist/tools/agentic/agentQueue.d.ts.map +1 -1
- package/dist/tools/agentic/agentQueue.js +7 -5
- package/dist/tools/agentic/agentQueue.js.map +1 -1
- package/dist/tools/agentic/index.d.ts +3 -0
- package/dist/tools/agentic/index.d.ts.map +1 -1
- package/dist/tools/agentic/index.js +158 -1
- package/dist/tools/agentic/index.js.map +1 -1
- package/dist/tools/codereview/index.d.ts +4 -0
- package/dist/tools/codereview/index.d.ts.map +1 -0
- package/dist/tools/codereview/index.js +93 -0
- package/dist/tools/codereview/index.js.map +1 -0
- package/dist/tools/codereview.d.ts +56 -0
- package/dist/tools/codereview.d.ts.map +1 -0
- package/dist/tools/codereview.js +304 -0
- package/dist/tools/codereview.js.map +1 -0
- package/dist/tools/concepts.d.ts +38 -0
- package/dist/tools/concepts.d.ts.map +1 -0
- package/dist/tools/concepts.js +283 -0
- package/dist/tools/concepts.js.map +1 -0
- package/dist/tools/corpus/index.d.ts +3 -0
- package/dist/tools/corpus/index.d.ts.map +1 -1
- package/dist/tools/corpus/index.js +183 -1
- package/dist/tools/corpus/index.js.map +1 -1
- package/dist/tools/corpus.d.ts +52 -0
- package/dist/tools/corpus.d.ts.map +1 -1
- package/dist/tools/corpus.js +207 -2
- package/dist/tools/corpus.js.map +1 -1
- package/dist/tools/dojo.d.ts.map +1 -1
- package/dist/tools/dojo.js +11 -1
- package/dist/tools/dojo.js.map +1 -1
- package/dist/tools/git-sentinel.d.ts.map +1 -1
- package/dist/tools/git-sentinel.js +24 -8
- package/dist/tools/git-sentinel.js.map +1 -1
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +6 -0
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/oracle.d.ts +2 -0
- package/dist/tools/oracle.d.ts.map +1 -1
- package/dist/tools/oracle.js +146 -17
- package/dist/tools/oracle.js.map +1 -1
- package/dist/tools/peers.d.ts +15 -0
- package/dist/tools/peers.d.ts.map +1 -0
- package/dist/tools/peers.js +70 -0
- package/dist/tools/peers.js.map +1 -0
- package/dist/tools/registry/index.d.ts +4 -0
- package/dist/tools/registry/index.d.ts.map +1 -1
- package/dist/tools/registry/index.js +274 -1
- package/dist/tools/registry/index.js.map +1 -1
- package/dist/tools/roadmap.d.ts +4 -0
- package/dist/tools/roadmap.d.ts.map +1 -1
- package/dist/tools/roadmap.js.map +1 -1
- package/dist/tools/sentinel.d.ts +15 -1
- package/dist/tools/sentinel.d.ts.map +1 -1
- package/dist/tools/sentinel.js +198 -34
- package/dist/tools/sentinel.js.map +1 -1
- package/dist/tools/voice/index.d.ts.map +1 -1
- package/dist/tools/voice/index.js +2 -3
- package/dist/tools/voice/index.js.map +1 -1
- package/dist/tools/voice.d.ts +1 -1
- package/dist/tools/voice.js +2 -2
- package/dist/tools/voice.js.map +1 -1
- package/dist/tools/workflow.js +5 -5
- package/dist/tools/workflow.js.map +1 -1
- package/dist/transports/http.js +1 -1
- package/package.json +4 -2
|
@@ -0,0 +1,283 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Concepts Domain — pre-project product ideas.
|
|
3
|
+
*
|
|
4
|
+
* Discrete from dojo: dojo wishes/proposals are *feature-scoped* (a capability
|
|
5
|
+
* inside an existing project). Concepts are *project-scoped* — a candidate for
|
|
6
|
+
* a NEW project that doesn't yet exist. Once a concept is committed, it
|
|
7
|
+
* graduates to a real project (project_init + registry_add stay separate
|
|
8
|
+
* deliberately, so the user sees what's happening).
|
|
9
|
+
*
|
|
10
|
+
* Storage: ~/.decibel/concepts/<id>.yaml — user-level, cross-project. Concepts
|
|
11
|
+
* have no project_id by definition; they are pre-project artifacts. The
|
|
12
|
+
* graduated_to field links a committed concept to its eventual project_id.
|
|
13
|
+
*/
|
|
14
|
+
import fs from 'fs/promises';
|
|
15
|
+
import path from 'path';
|
|
16
|
+
import os from 'os';
|
|
17
|
+
import YAML from 'yaml';
|
|
18
|
+
import { toolSuccess, toolError, requireFields } from './shared/index.js';
|
|
19
|
+
const CONCEPTS_DIR = path.join(os.homedir(), '.decibel', 'concepts');
|
|
20
|
+
async function ensureConceptsDir() {
|
|
21
|
+
await fs.mkdir(CONCEPTS_DIR, { recursive: true });
|
|
22
|
+
}
|
|
23
|
+
function slugify(text) {
|
|
24
|
+
return text
|
|
25
|
+
.toLowerCase()
|
|
26
|
+
.replace(/[^a-z0-9]+/g, '-')
|
|
27
|
+
.replace(/^-|-$/g, '')
|
|
28
|
+
.substring(0, 50);
|
|
29
|
+
}
|
|
30
|
+
function generateId(title, when = new Date()) {
|
|
31
|
+
const date = when.toISOString().slice(0, 10);
|
|
32
|
+
const slug = slugify(title) || 'concept';
|
|
33
|
+
const suffix = Math.random().toString(36).slice(2, 5);
|
|
34
|
+
return `concept-${date}-${slug}-${suffix}`;
|
|
35
|
+
}
|
|
36
|
+
function conceptPath(id) {
|
|
37
|
+
return path.join(CONCEPTS_DIR, `${id}.yaml`);
|
|
38
|
+
}
|
|
39
|
+
async function readConcept(id) {
|
|
40
|
+
try {
|
|
41
|
+
const raw = await fs.readFile(conceptPath(id), 'utf-8');
|
|
42
|
+
return YAML.parse(raw);
|
|
43
|
+
}
|
|
44
|
+
catch {
|
|
45
|
+
return null;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
async function writeConcept(concept) {
|
|
49
|
+
await ensureConceptsDir();
|
|
50
|
+
const yaml = YAML.stringify(concept, { lineWidth: 0 });
|
|
51
|
+
await fs.writeFile(conceptPath(concept.id), yaml, 'utf-8');
|
|
52
|
+
}
|
|
53
|
+
// ============================================================================
|
|
54
|
+
// Tools
|
|
55
|
+
// ============================================================================
|
|
56
|
+
export const conceptsAddTool = {
|
|
57
|
+
definition: {
|
|
58
|
+
name: 'concepts_add',
|
|
59
|
+
description: 'Capture a new product concept — a candidate for a new project that does not yet exist. Distinct from dojo_add_wish (feature-scoped, inside an existing project). Use this when the idea is project-scale: "we should build a new app for X" rather than "we should add feature Y to project Z".',
|
|
60
|
+
inputSchema: {
|
|
61
|
+
type: 'object',
|
|
62
|
+
properties: {
|
|
63
|
+
title: { type: 'string', description: 'Short name for the concept (becomes part of the id).' },
|
|
64
|
+
pitch: { type: 'string', description: 'One-sentence elevator pitch.' },
|
|
65
|
+
problem: { type: 'string', description: 'What problem this concept would solve.' },
|
|
66
|
+
why_now: { type: 'string', description: 'Why this is worth exploring now (optional).' },
|
|
67
|
+
tags: {
|
|
68
|
+
type: 'array',
|
|
69
|
+
items: { type: 'string' },
|
|
70
|
+
description: 'Tags for filtering (e.g. ["desktop", "ui", "agents"]).',
|
|
71
|
+
},
|
|
72
|
+
prior_attempts: {
|
|
73
|
+
type: 'array',
|
|
74
|
+
items: { type: 'string' },
|
|
75
|
+
description: 'Project ids of prior failed attempts at this concept (e.g. ["vector"] for HQ).',
|
|
76
|
+
},
|
|
77
|
+
},
|
|
78
|
+
required: ['title', 'pitch', 'problem'],
|
|
79
|
+
},
|
|
80
|
+
},
|
|
81
|
+
handler: async (args) => {
|
|
82
|
+
try {
|
|
83
|
+
requireFields(args, 'title', 'pitch', 'problem');
|
|
84
|
+
const now = new Date();
|
|
85
|
+
const concept = {
|
|
86
|
+
id: generateId(args.title, now),
|
|
87
|
+
title: args.title,
|
|
88
|
+
pitch: args.pitch,
|
|
89
|
+
problem: args.problem,
|
|
90
|
+
why_now: args.why_now || undefined,
|
|
91
|
+
status: 'ideating',
|
|
92
|
+
tags: args.tags || [],
|
|
93
|
+
prior_attempts: args.prior_attempts || [],
|
|
94
|
+
graduated_to: null,
|
|
95
|
+
graduated_at: null,
|
|
96
|
+
shelved_reason: null,
|
|
97
|
+
shelved_at: null,
|
|
98
|
+
created_at: now.toISOString(),
|
|
99
|
+
updated_at: now.toISOString(),
|
|
100
|
+
};
|
|
101
|
+
await writeConcept(concept);
|
|
102
|
+
return toolSuccess({
|
|
103
|
+
id: concept.id,
|
|
104
|
+
path: conceptPath(concept.id),
|
|
105
|
+
status: concept.status,
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
catch (err) {
|
|
109
|
+
return toolError(err instanceof Error ? err.message : String(err));
|
|
110
|
+
}
|
|
111
|
+
},
|
|
112
|
+
};
|
|
113
|
+
export const conceptsListTool = {
|
|
114
|
+
definition: {
|
|
115
|
+
name: 'concepts_list',
|
|
116
|
+
description: 'List captured product concepts from ~/.decibel/concepts/. Optional filter by status. Returns id, title, pitch, status, tags, graduated_to, created_at — sorted newest first.',
|
|
117
|
+
inputSchema: {
|
|
118
|
+
type: 'object',
|
|
119
|
+
properties: {
|
|
120
|
+
status: {
|
|
121
|
+
type: 'string',
|
|
122
|
+
enum: ['ideating', 'exploring', 'committed', 'shelved'],
|
|
123
|
+
description: 'Filter by lifecycle status.',
|
|
124
|
+
},
|
|
125
|
+
tag: { type: 'string', description: 'Filter to concepts containing this tag.' },
|
|
126
|
+
},
|
|
127
|
+
},
|
|
128
|
+
},
|
|
129
|
+
handler: async (args) => {
|
|
130
|
+
try {
|
|
131
|
+
await ensureConceptsDir();
|
|
132
|
+
const files = await fs.readdir(CONCEPTS_DIR);
|
|
133
|
+
const yamlFiles = files.filter((f) => f.endsWith('.yaml'));
|
|
134
|
+
const concepts = [];
|
|
135
|
+
for (const file of yamlFiles) {
|
|
136
|
+
const id = file.replace(/\.yaml$/, '');
|
|
137
|
+
const c = await readConcept(id);
|
|
138
|
+
if (c)
|
|
139
|
+
concepts.push(c);
|
|
140
|
+
}
|
|
141
|
+
let filtered = concepts;
|
|
142
|
+
if (args.status)
|
|
143
|
+
filtered = filtered.filter((c) => c.status === args.status);
|
|
144
|
+
if (args.tag)
|
|
145
|
+
filtered = filtered.filter((c) => c.tags.includes(args.tag));
|
|
146
|
+
filtered.sort((a, b) => (b.created_at > a.created_at ? 1 : -1));
|
|
147
|
+
return toolSuccess({
|
|
148
|
+
concepts: filtered.map((c) => ({
|
|
149
|
+
id: c.id,
|
|
150
|
+
title: c.title,
|
|
151
|
+
pitch: c.pitch,
|
|
152
|
+
status: c.status,
|
|
153
|
+
tags: c.tags,
|
|
154
|
+
graduated_to: c.graduated_to,
|
|
155
|
+
created_at: c.created_at,
|
|
156
|
+
})),
|
|
157
|
+
count: filtered.length,
|
|
158
|
+
storage_dir: CONCEPTS_DIR,
|
|
159
|
+
});
|
|
160
|
+
}
|
|
161
|
+
catch (err) {
|
|
162
|
+
return toolError(err instanceof Error ? err.message : String(err));
|
|
163
|
+
}
|
|
164
|
+
},
|
|
165
|
+
};
|
|
166
|
+
export const conceptsReadTool = {
|
|
167
|
+
definition: {
|
|
168
|
+
name: 'concepts_read',
|
|
169
|
+
description: 'Read a single concept by id. Returns the full YAML record.',
|
|
170
|
+
inputSchema: {
|
|
171
|
+
type: 'object',
|
|
172
|
+
properties: {
|
|
173
|
+
id: { type: 'string', description: 'Concept id (e.g. "concept-2026-04-26-decibel-hq-7f").' },
|
|
174
|
+
},
|
|
175
|
+
required: ['id'],
|
|
176
|
+
},
|
|
177
|
+
},
|
|
178
|
+
handler: async (args) => {
|
|
179
|
+
try {
|
|
180
|
+
requireFields(args, 'id');
|
|
181
|
+
const concept = await readConcept(args.id);
|
|
182
|
+
if (!concept) {
|
|
183
|
+
return toolError(`Concept "${args.id}" not found`, `Storage dir: ${CONCEPTS_DIR}. Use concepts_list to see all.`);
|
|
184
|
+
}
|
|
185
|
+
return toolSuccess({ concept, path: conceptPath(concept.id) });
|
|
186
|
+
}
|
|
187
|
+
catch (err) {
|
|
188
|
+
return toolError(err instanceof Error ? err.message : String(err));
|
|
189
|
+
}
|
|
190
|
+
},
|
|
191
|
+
};
|
|
192
|
+
export const conceptsCommitTool = {
|
|
193
|
+
definition: {
|
|
194
|
+
name: 'concepts_commit',
|
|
195
|
+
description: 'Mark a concept as committed — i.e. you are going to build it. Optionally links to a project_id (existing or about-to-be-created). Does NOT call project_init or registry_add — those stay separate so you see what is happening. Status moves to "committed", graduated_to + graduated_at recorded.',
|
|
196
|
+
inputSchema: {
|
|
197
|
+
type: 'object',
|
|
198
|
+
properties: {
|
|
199
|
+
id: { type: 'string', description: 'Concept id to commit.' },
|
|
200
|
+
project_id: {
|
|
201
|
+
type: 'string',
|
|
202
|
+
description: 'The project_id this concept graduates into (optional — can be set later via concepts_commit again).',
|
|
203
|
+
},
|
|
204
|
+
},
|
|
205
|
+
required: ['id'],
|
|
206
|
+
},
|
|
207
|
+
},
|
|
208
|
+
handler: async (args) => {
|
|
209
|
+
try {
|
|
210
|
+
requireFields(args, 'id');
|
|
211
|
+
const concept = await readConcept(args.id);
|
|
212
|
+
if (!concept) {
|
|
213
|
+
return toolError(`Concept "${args.id}" not found`);
|
|
214
|
+
}
|
|
215
|
+
const now = new Date().toISOString();
|
|
216
|
+
// Kernel normalizes incoming project_id → projectId before reaching handlers.
|
|
217
|
+
const incomingProjectId = args.projectId || args.project_id;
|
|
218
|
+
concept.status = 'committed';
|
|
219
|
+
concept.graduated_to = incomingProjectId || concept.graduated_to;
|
|
220
|
+
concept.graduated_at = concept.graduated_at || now;
|
|
221
|
+
concept.updated_at = now;
|
|
222
|
+
await writeConcept(concept);
|
|
223
|
+
return toolSuccess({
|
|
224
|
+
id: concept.id,
|
|
225
|
+
status: concept.status,
|
|
226
|
+
graduated_to: concept.graduated_to,
|
|
227
|
+
graduated_at: concept.graduated_at,
|
|
228
|
+
next_step: concept.graduated_to
|
|
229
|
+
? `Concept linked to project_id "${concept.graduated_to}". Run project_init + registry_add separately if it does not exist yet.`
|
|
230
|
+
: 'Set project_id later by running concepts_commit again with a project_id.',
|
|
231
|
+
});
|
|
232
|
+
}
|
|
233
|
+
catch (err) {
|
|
234
|
+
return toolError(err instanceof Error ? err.message : String(err));
|
|
235
|
+
}
|
|
236
|
+
},
|
|
237
|
+
};
|
|
238
|
+
export const conceptsShelveTool = {
|
|
239
|
+
definition: {
|
|
240
|
+
name: 'concepts_shelve',
|
|
241
|
+
description: 'Park a concept with a reason. Status moves to "shelved". Use when you decide not to pursue (yet) — the record stays so future Claudes can see prior thinking and avoid re-litigating.',
|
|
242
|
+
inputSchema: {
|
|
243
|
+
type: 'object',
|
|
244
|
+
properties: {
|
|
245
|
+
id: { type: 'string', description: 'Concept id to shelve.' },
|
|
246
|
+
reason: { type: 'string', description: 'Why this is being shelved (timing, scope, redundant, etc.).' },
|
|
247
|
+
},
|
|
248
|
+
required: ['id', 'reason'],
|
|
249
|
+
},
|
|
250
|
+
},
|
|
251
|
+
handler: async (args) => {
|
|
252
|
+
try {
|
|
253
|
+
requireFields(args, 'id', 'reason');
|
|
254
|
+
const concept = await readConcept(args.id);
|
|
255
|
+
if (!concept) {
|
|
256
|
+
return toolError(`Concept "${args.id}" not found`);
|
|
257
|
+
}
|
|
258
|
+
const now = new Date().toISOString();
|
|
259
|
+
concept.status = 'shelved';
|
|
260
|
+
concept.shelved_reason = args.reason;
|
|
261
|
+
concept.shelved_at = now;
|
|
262
|
+
concept.updated_at = now;
|
|
263
|
+
await writeConcept(concept);
|
|
264
|
+
return toolSuccess({
|
|
265
|
+
id: concept.id,
|
|
266
|
+
status: concept.status,
|
|
267
|
+
shelved_reason: concept.shelved_reason,
|
|
268
|
+
shelved_at: concept.shelved_at,
|
|
269
|
+
});
|
|
270
|
+
}
|
|
271
|
+
catch (err) {
|
|
272
|
+
return toolError(err instanceof Error ? err.message : String(err));
|
|
273
|
+
}
|
|
274
|
+
},
|
|
275
|
+
};
|
|
276
|
+
export const conceptsTools = [
|
|
277
|
+
conceptsAddTool,
|
|
278
|
+
conceptsListTool,
|
|
279
|
+
conceptsReadTool,
|
|
280
|
+
conceptsCommitTool,
|
|
281
|
+
conceptsShelveTool,
|
|
282
|
+
];
|
|
283
|
+
//# sourceMappingURL=concepts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"concepts.js","sourceRoot":"","sources":["../../src/tools/concepts.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,MAAM,aAAa,CAAC;AAC7B,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAyB1E,MAAM,YAAY,GAAG,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,UAAU,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|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { ToolSpec } from '../types.js';
|
|
2
2
|
export declare const corpusSearchTool: ToolSpec;
|
|
3
3
|
export declare const corpusStatusTool: ToolSpec;
|
|
4
|
+
export declare const corpusAddPatternTool: ToolSpec;
|
|
5
|
+
export declare const corpusAddFieldNoteTool: ToolSpec;
|
|
6
|
+
export declare const corpusAddPlaybookTool: ToolSpec;
|
|
4
7
|
export declare const corpusTools: ToolSpec[];
|
|
5
8
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tools/corpus/index.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tools/corpus/index.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AA0BvC,eAAO,MAAM,gBAAgB,EAAE,QAoD9B,CAAC;AAMF,eAAO,MAAM,gBAAgB,EAAE,QA8B9B,CAAC;AAMF,eAAO,MAAM,oBAAoB,EAAE,QAgElC,CAAC;AAMF,eAAO,MAAM,sBAAsB,EAAE,QAoDpC,CAAC;AAMF,eAAO,MAAM,qBAAqB,EAAE,QAgDnC,CAAC;AAMF,eAAO,MAAM,WAAW,EAAE,QAAQ,EAMjC,CAAC"}
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
// Enables cross-project learning from patterns, playbooks, and field notes.
|
|
6
6
|
// ============================================================================
|
|
7
7
|
import { toolSuccess, toolError, requireFields } from '../shared/index.js';
|
|
8
|
-
import { corpusSearch, getCorpusPath, corpusExists, } from '../corpus.js';
|
|
8
|
+
import { corpusSearch, getCorpusPath, corpusExists, addPattern, addFieldNote, addPlaybook, } from '../corpus.js';
|
|
9
9
|
// ============================================================================
|
|
10
10
|
// Constants
|
|
11
11
|
// ============================================================================
|
|
@@ -96,10 +96,192 @@ export const corpusStatusTool = {
|
|
|
96
96
|
},
|
|
97
97
|
};
|
|
98
98
|
// ============================================================================
|
|
99
|
+
// Corpus Add Pattern Tool
|
|
100
|
+
// ============================================================================
|
|
101
|
+
export const corpusAddPatternTool = {
|
|
102
|
+
definition: {
|
|
103
|
+
name: 'corpus_add_pattern',
|
|
104
|
+
description: `Add a reusable pattern to decibel-corpus. Patterns are named solutions to recurring problems (e.g., "advisory lock for idempotency", "exponential backoff with jitter"). The id must match PREFIX-NNNN format (e.g., DBS-0004). Will not overwrite existing files.`,
|
|
105
|
+
annotations: {
|
|
106
|
+
title: 'Add Corpus Pattern',
|
|
107
|
+
readOnlyHint: false,
|
|
108
|
+
destructiveHint: false,
|
|
109
|
+
idempotentHint: false,
|
|
110
|
+
},
|
|
111
|
+
inputSchema: {
|
|
112
|
+
type: 'object',
|
|
113
|
+
properties: {
|
|
114
|
+
id: {
|
|
115
|
+
type: 'string',
|
|
116
|
+
description: 'Pattern identifier in PREFIX-NNNN format (e.g., DBS-0004, A11Y-0001)',
|
|
117
|
+
},
|
|
118
|
+
title: {
|
|
119
|
+
type: 'string',
|
|
120
|
+
description: 'Human-readable title (e.g., "Advisory Lock for Idempotent Mutations")',
|
|
121
|
+
},
|
|
122
|
+
content: {
|
|
123
|
+
type: 'string',
|
|
124
|
+
description: 'Markdown body — problem statement, solution, code examples, trade-offs',
|
|
125
|
+
},
|
|
126
|
+
category: {
|
|
127
|
+
type: 'string',
|
|
128
|
+
description: 'Optional subdirectory within primitives/patterns/ (e.g., "concurrency", "auth")',
|
|
129
|
+
},
|
|
130
|
+
status: {
|
|
131
|
+
type: 'string',
|
|
132
|
+
description: 'Pattern maturity: draft, reviewed, canonical (default: draft)',
|
|
133
|
+
},
|
|
134
|
+
severity: {
|
|
135
|
+
type: 'string',
|
|
136
|
+
description: 'Impact level if the pattern is not followed (e.g., "high", "critical")',
|
|
137
|
+
},
|
|
138
|
+
source: {
|
|
139
|
+
type: 'string',
|
|
140
|
+
description: 'Where this pattern was discovered (e.g., "EPIC-0032", "incident-2026-03")',
|
|
141
|
+
},
|
|
142
|
+
owner: {
|
|
143
|
+
type: 'string',
|
|
144
|
+
description: 'Who authored or is responsible for this pattern',
|
|
145
|
+
},
|
|
146
|
+
tags: {
|
|
147
|
+
type: 'array',
|
|
148
|
+
items: { type: 'string' },
|
|
149
|
+
description: 'Searchable tags (e.g., ["postgres", "concurrency", "idempotency"])',
|
|
150
|
+
},
|
|
151
|
+
},
|
|
152
|
+
required: ['id', 'title', 'content'],
|
|
153
|
+
},
|
|
154
|
+
},
|
|
155
|
+
handler: async (args) => {
|
|
156
|
+
try {
|
|
157
|
+
const input = args;
|
|
158
|
+
requireFields(input, 'id', 'title', 'content');
|
|
159
|
+
const result = await addPattern(input);
|
|
160
|
+
return toolSuccess(result);
|
|
161
|
+
}
|
|
162
|
+
catch (err) {
|
|
163
|
+
return toolError(err instanceof Error ? err.message : String(err));
|
|
164
|
+
}
|
|
165
|
+
},
|
|
166
|
+
};
|
|
167
|
+
// ============================================================================
|
|
168
|
+
// Corpus Add Field Note Tool
|
|
169
|
+
// ============================================================================
|
|
170
|
+
export const corpusAddFieldNoteTool = {
|
|
171
|
+
definition: {
|
|
172
|
+
name: 'corpus_add_field_note',
|
|
173
|
+
description: `Add a field note to decibel-corpus. Field notes capture lessons learned, gotchas, and observations from real work — things that aren't patterns yet but are worth remembering. Filename is auto-generated as YYYY-MM-DD-{slug}.md. Will not overwrite existing files.`,
|
|
174
|
+
annotations: {
|
|
175
|
+
title: 'Add Corpus Field Note',
|
|
176
|
+
readOnlyHint: false,
|
|
177
|
+
destructiveHint: false,
|
|
178
|
+
idempotentHint: false,
|
|
179
|
+
},
|
|
180
|
+
inputSchema: {
|
|
181
|
+
type: 'object',
|
|
182
|
+
properties: {
|
|
183
|
+
title: {
|
|
184
|
+
type: 'string',
|
|
185
|
+
description: 'Descriptive title (e.g., "Supabase RLS gotcha with service role key")',
|
|
186
|
+
},
|
|
187
|
+
content: {
|
|
188
|
+
type: 'string',
|
|
189
|
+
description: 'Markdown body — what happened, what was learned, any code examples',
|
|
190
|
+
},
|
|
191
|
+
source: {
|
|
192
|
+
type: 'string',
|
|
193
|
+
description: 'Context where this was observed (e.g., "EPIC-0032", "senken deploy 2026-03")',
|
|
194
|
+
},
|
|
195
|
+
owner: {
|
|
196
|
+
type: 'string',
|
|
197
|
+
description: 'Who captured this note',
|
|
198
|
+
},
|
|
199
|
+
status: {
|
|
200
|
+
type: 'string',
|
|
201
|
+
description: 'Note maturity: draft, reviewed, promoted (default: draft)',
|
|
202
|
+
},
|
|
203
|
+
tags: {
|
|
204
|
+
type: 'array',
|
|
205
|
+
items: { type: 'string' },
|
|
206
|
+
description: 'Searchable tags (e.g., ["supabase", "rls", "auth"])',
|
|
207
|
+
},
|
|
208
|
+
},
|
|
209
|
+
required: ['title', 'content'],
|
|
210
|
+
},
|
|
211
|
+
},
|
|
212
|
+
handler: async (args) => {
|
|
213
|
+
try {
|
|
214
|
+
const input = args;
|
|
215
|
+
requireFields(input, 'title', 'content');
|
|
216
|
+
const result = await addFieldNote(input);
|
|
217
|
+
return toolSuccess(result);
|
|
218
|
+
}
|
|
219
|
+
catch (err) {
|
|
220
|
+
return toolError(err instanceof Error ? err.message : String(err));
|
|
221
|
+
}
|
|
222
|
+
},
|
|
223
|
+
};
|
|
224
|
+
// ============================================================================
|
|
225
|
+
// Corpus Add Playbook Tool
|
|
226
|
+
// ============================================================================
|
|
227
|
+
export const corpusAddPlaybookTool = {
|
|
228
|
+
definition: {
|
|
229
|
+
name: 'corpus_add_playbook',
|
|
230
|
+
description: `Add a playbook to decibel-corpus. Playbooks are step-by-step guides for specific operations (e.g., "deploy senken to production", "rotate Supabase keys", "onboard new MCP module"). Filename is auto-generated as {slug}.md. Will not overwrite existing files.`,
|
|
231
|
+
annotations: {
|
|
232
|
+
title: 'Add Corpus Playbook',
|
|
233
|
+
readOnlyHint: false,
|
|
234
|
+
destructiveHint: false,
|
|
235
|
+
idempotentHint: false,
|
|
236
|
+
},
|
|
237
|
+
inputSchema: {
|
|
238
|
+
type: 'object',
|
|
239
|
+
properties: {
|
|
240
|
+
title: {
|
|
241
|
+
type: 'string',
|
|
242
|
+
description: 'Playbook title (e.g., "Deploy Senken to Production")',
|
|
243
|
+
},
|
|
244
|
+
content: {
|
|
245
|
+
type: 'string',
|
|
246
|
+
description: 'Markdown body — numbered steps, prerequisites, rollback procedures',
|
|
247
|
+
},
|
|
248
|
+
owner: {
|
|
249
|
+
type: 'string',
|
|
250
|
+
description: 'Who authored this playbook',
|
|
251
|
+
},
|
|
252
|
+
status: {
|
|
253
|
+
type: 'string',
|
|
254
|
+
description: 'Playbook maturity: draft, reviewed, canonical (default: draft)',
|
|
255
|
+
},
|
|
256
|
+
tags: {
|
|
257
|
+
type: 'array',
|
|
258
|
+
items: { type: 'string' },
|
|
259
|
+
description: 'Searchable tags (e.g., ["deployment", "senken", "production"])',
|
|
260
|
+
},
|
|
261
|
+
},
|
|
262
|
+
required: ['title', 'content'],
|
|
263
|
+
},
|
|
264
|
+
},
|
|
265
|
+
handler: async (args) => {
|
|
266
|
+
try {
|
|
267
|
+
const input = args;
|
|
268
|
+
requireFields(input, 'title', 'content');
|
|
269
|
+
const result = await addPlaybook(input);
|
|
270
|
+
return toolSuccess(result);
|
|
271
|
+
}
|
|
272
|
+
catch (err) {
|
|
273
|
+
return toolError(err instanceof Error ? err.message : String(err));
|
|
274
|
+
}
|
|
275
|
+
},
|
|
276
|
+
};
|
|
277
|
+
// ============================================================================
|
|
99
278
|
// Export All Tools
|
|
100
279
|
// ============================================================================
|
|
101
280
|
export const corpusTools = [
|
|
102
281
|
corpusSearchTool,
|
|
103
282
|
corpusStatusTool,
|
|
283
|
+
corpusAddPatternTool,
|
|
284
|
+
corpusAddFieldNoteTool,
|
|
285
|
+
corpusAddPlaybookTool,
|
|
104
286
|
];
|
|
105
287
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/tools/corpus/index.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAC/E,sBAAsB;AACtB,+EAA+E;AAC/E,sEAAsE;AACtE,4EAA4E;AAC5E,+EAA+E;AAG/E,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAC3E,OAAO,EACL,YAAY,EAGZ,aAAa,EACb,YAAY,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/tools/corpus/index.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAC/E,sBAAsB;AACtB,+EAA+E;AAC/E,sEAAsE;AACtE,4EAA4E;AAC5E,+EAA+E;AAG/E,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAC3E,OAAO,EACL,YAAY,EAGZ,aAAa,EACb,YAAY,EACZ,UAAU,EAEV,YAAY,EAEZ,WAAW,GAEZ,MAAM,cAAc,CAAC;AAEtB,+EAA+E;AAC/E,YAAY;AACZ,+EAA+E;AAE/E,MAAM,WAAW,GAAkC,CAAC,SAAS,EAAE,UAAU,EAAE,YAAY,EAAE,KAAK,CAAC,CAAC;AAEhG,+EAA+E;AAC/E,qBAAqB;AACrB,+EAA+E;AAE/E,MAAM,CAAC,MAAM,gBAAgB,GAAa;IACxC,UAAU,EAAE;QACV,IAAI,EAAE,eAAe;QACrB,WAAW,EAAE,2QAA2Q;QACxR,WAAW,EAAE;YACX,KAAK,EAAE,eAAe;YACtB,YAAY,EAAE,IAAI;YAClB,eAAe,EAAE,KAAK;SACvB;QACD,WAAW,EAAE;YACX,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE;gBACV,KAAK,EAAE;oBACL,IAAI,EAAE,QAAQ;oBACd,WAAW,EAAE,sFAAsF;iBACpG;gBACD,IAAI,EAAE;oBACJ,IAAI,EAAE,QAAQ;oBACd,IAAI,EAAE,CAA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AO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;QACrE,CAAC;IACH,CAAC;CACF,CAAC;AAEF,+EAA+E;AAC/E,mBAAmB;AACnB,+EAA+E;AAE/E,MAAM,CAAC,MAAM,WAAW,GAAe;IACrC,gBAAgB;IAChB,gBAAgB;IAChB,oBAAoB;IACpB,sBAAsB;IACtB,qBAAqB;CACtB,CAAC"}
|
package/dist/tools/corpus.d.ts
CHANGED
|
@@ -18,6 +18,38 @@ export interface CorpusSearchResult {
|
|
|
18
18
|
searched: number;
|
|
19
19
|
corpus_path: string;
|
|
20
20
|
}
|
|
21
|
+
export interface AddPatternInput {
|
|
22
|
+
id: string;
|
|
23
|
+
title: string;
|
|
24
|
+
content: string;
|
|
25
|
+
category?: string;
|
|
26
|
+
status?: string;
|
|
27
|
+
severity?: string;
|
|
28
|
+
source?: string;
|
|
29
|
+
owner?: string;
|
|
30
|
+
tags?: string[];
|
|
31
|
+
}
|
|
32
|
+
export interface AddFieldNoteInput {
|
|
33
|
+
title: string;
|
|
34
|
+
content: string;
|
|
35
|
+
source?: string;
|
|
36
|
+
owner?: string;
|
|
37
|
+
status?: string;
|
|
38
|
+
tags?: string[];
|
|
39
|
+
}
|
|
40
|
+
export interface AddPlaybookInput {
|
|
41
|
+
title: string;
|
|
42
|
+
content: string;
|
|
43
|
+
owner?: string;
|
|
44
|
+
status?: string;
|
|
45
|
+
tags?: string[];
|
|
46
|
+
}
|
|
47
|
+
export interface CorpusWriteResult {
|
|
48
|
+
id: string;
|
|
49
|
+
path: string;
|
|
50
|
+
absolute_path: string;
|
|
51
|
+
title: string;
|
|
52
|
+
}
|
|
21
53
|
/**
|
|
22
54
|
* Search the decibel-corpus for patterns, playbooks, and field notes
|
|
23
55
|
*/
|
|
@@ -30,4 +62,24 @@ export declare function getCorpusPath(): string;
|
|
|
30
62
|
* Check if corpus exists at the configured path
|
|
31
63
|
*/
|
|
32
64
|
export declare function corpusExists(): Promise<boolean>;
|
|
65
|
+
/**
|
|
66
|
+
* Slugify text for use in filenames.
|
|
67
|
+
* Lowercases, replaces non-alphanumeric with dashes, trims dashes, max 80 chars.
|
|
68
|
+
*/
|
|
69
|
+
export declare function slugify(text: string): string;
|
|
70
|
+
/**
|
|
71
|
+
* Add a pattern to decibel-corpus.
|
|
72
|
+
* Writes to primitives/patterns/{category?}/{id}-{slug}.md
|
|
73
|
+
*/
|
|
74
|
+
export declare function addPattern(input: AddPatternInput): Promise<CorpusWriteResult>;
|
|
75
|
+
/**
|
|
76
|
+
* Add a field note to decibel-corpus.
|
|
77
|
+
* Writes to field-notes/YYYY-MM-DD-{slug}.md
|
|
78
|
+
*/
|
|
79
|
+
export declare function addFieldNote(input: AddFieldNoteInput): Promise<CorpusWriteResult>;
|
|
80
|
+
/**
|
|
81
|
+
* Add a playbook to decibel-corpus.
|
|
82
|
+
* Writes to playbooks/{slug}.md
|
|
83
|
+
*/
|
|
84
|
+
export declare function addPlaybook(input: AddPlaybookInput): Promise<CorpusWriteResult>;
|
|
33
85
|
//# sourceMappingURL=corpus.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"corpus.d.ts","sourceRoot":"","sources":["../../src/tools/corpus.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"corpus.d.ts","sourceRoot":"","sources":["../../src/tools/corpus.ts"],"names":[],"mappings":"AAmBA,MAAM,MAAM,iBAAiB,GAAG,SAAS,GAAG,UAAU,GAAG,YAAY,CAAC;AAEtE,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,iBAAiB,GAAG,KAAK,CAAC;IACjC,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,WAAW;IAC1B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,iBAAiB,CAAC;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,E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