@medicine-wheel/prompt-decomposition 0.2.2
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/README.md +93 -0
- package/dist/decomposer.d.ts +61 -0
- package/dist/decomposer.d.ts.map +1 -0
- package/dist/decomposer.js +593 -0
- package/dist/decomposer.js.map +1 -0
- package/dist/index.browser.d.ts +10 -0
- package/dist/index.browser.d.ts.map +1 -0
- package/dist/index.browser.js +19 -0
- package/dist/index.browser.js.map +1 -0
- package/dist/index.d.ts +20 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +32 -0
- package/dist/index.js.map +1 -0
- package/dist/relational_enricher.d.ts +55 -0
- package/dist/relational_enricher.d.ts.map +1 -0
- package/dist/relational_enricher.js +142 -0
- package/dist/relational_enricher.js.map +1 -0
- package/dist/storage.d.ts +16 -0
- package/dist/storage.d.ts.map +1 -0
- package/dist/storage.js +181 -0
- package/dist/storage.js.map +1 -0
- package/dist/types.d.ts +143 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +17 -0
- package/dist/types.js.map +1 -0
- package/package.json +60 -0
|
@@ -0,0 +1,593 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @medicine-wheel/prompt-decomposition — Decomposer
|
|
4
|
+
*
|
|
5
|
+
* Ontology-enriched prompt decomposition engine.
|
|
6
|
+
* Reuses the PDE patterns from ava-langchain-prompt-decomposition
|
|
7
|
+
* but grounds them in @medicine-wheel/ontology-core types.
|
|
8
|
+
*
|
|
9
|
+
* Design:
|
|
10
|
+
* - Keyword-based directional classification (same algorithm as langchainjs)
|
|
11
|
+
* - Intent extraction with hedging language detection (mcp-pde lineage)
|
|
12
|
+
* - Dependency mapping with directional inference
|
|
13
|
+
* - Ontological enrichment with Ojibwe names, seasons, acts, obligations
|
|
14
|
+
* - Ceremony guidance based on directional balance
|
|
15
|
+
*/
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.MedicineWheelDecomposer = void 0;
|
|
18
|
+
exports.detectEpistemicSource = detectEpistemicSource;
|
|
19
|
+
const ontology_core_1 = require("@medicine-wheel/ontology-core");
|
|
20
|
+
// ── Direction keywords (same as ava-langchain-prompt-decomposition) ─────────
|
|
21
|
+
const DIRECTION_KEYWORDS = {
|
|
22
|
+
east: [
|
|
23
|
+
'vision', 'goal', 'purpose', 'intention', 'want', 'need', 'desire',
|
|
24
|
+
'dream', 'imagine', 'envision', 'aspire', 'mission', 'why', 'objective',
|
|
25
|
+
'outcome', 'result', 'achieve', 'create', 'build', 'design',
|
|
26
|
+
],
|
|
27
|
+
south: [
|
|
28
|
+
'learn', 'research', 'investigate', 'understand', 'study', 'analyze',
|
|
29
|
+
'explore', 'discover', 'examine', 'review', 'compare', 'assess',
|
|
30
|
+
'dependency', 'require', 'prerequisite', 'context', 'background',
|
|
31
|
+
'existing', 'current', 'pattern',
|
|
32
|
+
],
|
|
33
|
+
west: [
|
|
34
|
+
'test', 'verify', 'validate', 'check', 'ensure', 'confirm',
|
|
35
|
+
'reflect', 'review', 'audit', 'quality', 'feedback', 'iterate',
|
|
36
|
+
'ceremony', 'accountable', 'responsible', 'ethical', 'protocol',
|
|
37
|
+
'appropriate', 'respectful', 'consent',
|
|
38
|
+
],
|
|
39
|
+
north: [
|
|
40
|
+
'implement', 'execute', 'deploy', 'run', 'build', 'code', 'script',
|
|
41
|
+
'install', 'configure', 'setup', 'create', 'write', 'develop',
|
|
42
|
+
'ship', 'launch', 'deliver', 'produce', 'output', 'generate',
|
|
43
|
+
'commit', 'push', 'merge',
|
|
44
|
+
],
|
|
45
|
+
};
|
|
46
|
+
const ACTION_VERBS = {
|
|
47
|
+
create: ['create', 'build', 'make', 'generate', 'write', 'develop', 'design', 'scaffold', 'implement'],
|
|
48
|
+
modify: ['modify', 'update', 'change', 'edit', 'adjust', 'refactor', 'rename'],
|
|
49
|
+
investigate: ['investigate', 'research', 'explore', 'understand', 'learn', 'study', 'analyze', 'examine', 'look', 'check', 'review', 'see'],
|
|
50
|
+
add: ['add', 'install', 'include', 'import', 'integrate', 'connect'],
|
|
51
|
+
remove: ['remove', 'delete', 'clean', 'prune', 'drop'],
|
|
52
|
+
test: ['test', 'verify', 'validate', 'ensure', 'confirm', 'assert'],
|
|
53
|
+
deploy: ['deploy', 'ship', 'publish', 'release', 'push', 'launch'],
|
|
54
|
+
use: ['use', 'leverage', 'utilize', 'employ', 'apply', 'run', 'execute'],
|
|
55
|
+
draft: ['draft', 'outline', 'plan', 'sketch', 'propose', 'document'],
|
|
56
|
+
};
|
|
57
|
+
const URGENCY_KEYWORDS = {
|
|
58
|
+
immediate: ['now', 'immediately', 'urgent', 'asap', 'right away'],
|
|
59
|
+
session: ['today', 'this session', "let's", 'get to work', 'start'],
|
|
60
|
+
sprint: ['this week', 'sprint', 'soon', 'next', 'upcoming'],
|
|
61
|
+
ongoing: ['eventually', 'someday', 'long-term', 'future', 'ongoing'],
|
|
62
|
+
};
|
|
63
|
+
const ALL_DIRECTIONS = ['east', 'south', 'west', 'north'];
|
|
64
|
+
// ── Helper: UUID ─────────────────────────────────────────────────────────────
|
|
65
|
+
function generateId() {
|
|
66
|
+
if (typeof globalThis.crypto?.randomUUID === 'function') {
|
|
67
|
+
return `mw-pde-${globalThis.crypto.randomUUID()}`;
|
|
68
|
+
}
|
|
69
|
+
// Fallback for environments without crypto.randomUUID
|
|
70
|
+
const hex = () => Math.random().toString(16).slice(2, 10);
|
|
71
|
+
return `mw-pde-${hex()}${hex()}-${hex()}-${hex()}`;
|
|
72
|
+
}
|
|
73
|
+
// ── Decomposer ──────────────────────────────────────────────────────────────
|
|
74
|
+
class MedicineWheelDecomposer {
|
|
75
|
+
extractImplicit;
|
|
76
|
+
mapDependencies;
|
|
77
|
+
ceremonyThreshold;
|
|
78
|
+
constructor(options) {
|
|
79
|
+
this.extractImplicit = options?.extractImplicit ?? true;
|
|
80
|
+
this.mapDependencies = options?.mapDependencies ?? true;
|
|
81
|
+
this.ceremonyThreshold = options?.ceremonyThreshold ?? 0.3;
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Decompose a prompt into an ontology-enriched result.
|
|
85
|
+
* Flows through Four Directions: EAST → SOUTH → WEST → NORTH
|
|
86
|
+
*/
|
|
87
|
+
decompose(prompt) {
|
|
88
|
+
const id = generateId();
|
|
89
|
+
const timestamp = new Date().toISOString();
|
|
90
|
+
// EAST: Extract intents and directional insights
|
|
91
|
+
const directionalInsights = this.classifyByDirection(prompt);
|
|
92
|
+
const intents = this.extractIntents(prompt);
|
|
93
|
+
const context = this.extractContext(prompt);
|
|
94
|
+
// SOUTH: Map dependencies
|
|
95
|
+
const enrichedIntents = this.enrichWithDirections(intents.secondary);
|
|
96
|
+
const dependencies = this.mapDependencies
|
|
97
|
+
? this.inferDependencies(enrichedIntents)
|
|
98
|
+
: [];
|
|
99
|
+
// Apply dependencies to intents
|
|
100
|
+
for (const dep of dependencies) {
|
|
101
|
+
const intent = enrichedIntents.find(i => i.id === dep.fromId);
|
|
102
|
+
if (intent)
|
|
103
|
+
intent.dependency = dep.toId;
|
|
104
|
+
}
|
|
105
|
+
// Build ontological directions
|
|
106
|
+
const directions = this.buildOntologicalDirections(directionalInsights);
|
|
107
|
+
// WEST: Assess balance and ceremony needs
|
|
108
|
+
const { balance, leadDirection, neglectedDirections } = this.assessBalance(directionalInsights);
|
|
109
|
+
const ceremonyRequired = this.checkCeremonyRequired(directions, balance);
|
|
110
|
+
const ceremonyGuidance = ceremonyRequired ? this.generateCeremonyGuidance(neglectedDirections) : null;
|
|
111
|
+
const wilsonAlignment = this.computeWilsonAlignment(enrichedIntents);
|
|
112
|
+
// Detect ambiguities (mcp-pde lineage)
|
|
113
|
+
const ambiguities = this.detectAmbiguities(prompt, intents.primary, neglectedDirections);
|
|
114
|
+
// Extract expected outputs
|
|
115
|
+
const outputs = this.extractExpectedOutputs(intents.primary, enrichedIntents);
|
|
116
|
+
// NORTH: Build action stack
|
|
117
|
+
const actionStack = this.buildActionStack(enrichedIntents, dependencies);
|
|
118
|
+
// Generate narrative beats from action stack
|
|
119
|
+
const narrativeBeats = this.generateNarrativeBeats(actionStack, id);
|
|
120
|
+
return {
|
|
121
|
+
id,
|
|
122
|
+
timestamp,
|
|
123
|
+
prompt,
|
|
124
|
+
primary: intents.primary,
|
|
125
|
+
secondary: enrichedIntents,
|
|
126
|
+
context,
|
|
127
|
+
outputs,
|
|
128
|
+
directions,
|
|
129
|
+
actionStack,
|
|
130
|
+
ambiguities,
|
|
131
|
+
balance,
|
|
132
|
+
leadDirection,
|
|
133
|
+
neglectedDirections,
|
|
134
|
+
ceremonyGuidance,
|
|
135
|
+
ceremonyRequired,
|
|
136
|
+
wilsonAlignment,
|
|
137
|
+
narrativeBeats,
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
// ── EAST: Classification ────────────────────────────────────────────────────
|
|
141
|
+
classifyByDirection(prompt) {
|
|
142
|
+
const segments = prompt.split(/(?<=[.!?])\s+|\n+/).filter(s => s.length > 3);
|
|
143
|
+
const result = {
|
|
144
|
+
east: [], south: [], west: [], north: [],
|
|
145
|
+
};
|
|
146
|
+
for (const segment of segments) {
|
|
147
|
+
const scores = this.scoreSegment(segment);
|
|
148
|
+
const topDir = this.topDirection(scores);
|
|
149
|
+
const isImplicit = scores[topDir] < 0.3;
|
|
150
|
+
result[topDir].push({
|
|
151
|
+
text: segment.trim(),
|
|
152
|
+
confidence: Math.min(scores[topDir] * 2, 1),
|
|
153
|
+
implicit: isImplicit,
|
|
154
|
+
});
|
|
155
|
+
// Cross-direction implicit insights
|
|
156
|
+
for (const dir of ALL_DIRECTIONS) {
|
|
157
|
+
if (dir !== topDir && scores[dir] > 0.2) {
|
|
158
|
+
result[dir].push({
|
|
159
|
+
text: segment.trim(),
|
|
160
|
+
confidence: scores[dir],
|
|
161
|
+
implicit: true,
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
return result;
|
|
167
|
+
}
|
|
168
|
+
scoreSegment(segment) {
|
|
169
|
+
const lower = segment.toLowerCase();
|
|
170
|
+
const words = lower.split(/\s+/);
|
|
171
|
+
const scores = { east: 0, south: 0, west: 0, north: 0 };
|
|
172
|
+
for (const dir of ALL_DIRECTIONS) {
|
|
173
|
+
for (const keyword of DIRECTION_KEYWORDS[dir]) {
|
|
174
|
+
for (const word of words) {
|
|
175
|
+
if (word.includes(keyword))
|
|
176
|
+
scores[dir] += 1;
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
const total = Object.values(scores).reduce((a, b) => a + b, 0) || 1;
|
|
181
|
+
for (const dir of ALL_DIRECTIONS)
|
|
182
|
+
scores[dir] /= total;
|
|
183
|
+
return scores;
|
|
184
|
+
}
|
|
185
|
+
topDirection(scores) {
|
|
186
|
+
let top = 'north';
|
|
187
|
+
let max = -1;
|
|
188
|
+
for (const dir of ALL_DIRECTIONS) {
|
|
189
|
+
if (scores[dir] > max) {
|
|
190
|
+
max = scores[dir];
|
|
191
|
+
top = dir;
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
return top;
|
|
195
|
+
}
|
|
196
|
+
// ── EAST: Intent Extraction ─────────────────────────────────────────────────
|
|
197
|
+
extractIntents(prompt) {
|
|
198
|
+
const sentences = prompt.split(/(?<=[.!?])\s+|\n+|,\s+(?=[A-Z])|;\s+/)
|
|
199
|
+
.map(s => s.trim()).filter(s => s.length > 5);
|
|
200
|
+
const rawIntents = [];
|
|
201
|
+
for (const sentence of sentences) {
|
|
202
|
+
const lower = sentence.toLowerCase();
|
|
203
|
+
let bestAction = '';
|
|
204
|
+
let bestCategory = '';
|
|
205
|
+
let found = false;
|
|
206
|
+
for (const [category, verbs] of Object.entries(ACTION_VERBS)) {
|
|
207
|
+
for (const verb of verbs) {
|
|
208
|
+
if (lower.includes(verb)) {
|
|
209
|
+
if (!found || verb.length > bestAction.length) {
|
|
210
|
+
bestAction = verb;
|
|
211
|
+
bestCategory = category;
|
|
212
|
+
found = true;
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
if (found) {
|
|
218
|
+
const verbIdx = lower.indexOf(bestAction);
|
|
219
|
+
const afterVerb = sentence.substring(verbIdx + bestAction.length).trim();
|
|
220
|
+
const target = afterVerb.replace(/^(the|a|an|this|that|our|your)\s+/i, '').trim();
|
|
221
|
+
rawIntents.push({
|
|
222
|
+
action: bestCategory,
|
|
223
|
+
target: target || sentence,
|
|
224
|
+
confidence: this.calculateConfidence(sentence, bestAction),
|
|
225
|
+
implicit: false,
|
|
226
|
+
});
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
// Extract implicit intents (mcp-pde lineage)
|
|
230
|
+
if (this.extractImplicit) {
|
|
231
|
+
for (const sentence of sentences) {
|
|
232
|
+
const lower = sentence.toLowerCase();
|
|
233
|
+
if (rawIntents.some(i => i.target === sentence))
|
|
234
|
+
continue;
|
|
235
|
+
if (/i assume|which i assume|assuming/.test(lower) ||
|
|
236
|
+
/i expect|expecting|you will need/.test(lower)) {
|
|
237
|
+
rawIntents.push({ action: 'investigate', target: sentence, confidence: 0.5, implicit: true });
|
|
238
|
+
}
|
|
239
|
+
else if (/\bsomehow\b/.test(lower)) {
|
|
240
|
+
rawIntents.push({ action: 'investigate', target: sentence, confidence: 0.4, implicit: true });
|
|
241
|
+
}
|
|
242
|
+
else if (/\bprobably\b|\bshould\b(?!\s+not)/.test(lower)) {
|
|
243
|
+
rawIntents.push({ action: 'investigate', target: sentence, confidence: 0.45, implicit: true });
|
|
244
|
+
}
|
|
245
|
+
else if (/\bwhich\b/.test(lower)) {
|
|
246
|
+
rawIntents.push({ action: 'investigate', target: sentence, confidence: 0.6, implicit: true });
|
|
247
|
+
}
|
|
248
|
+
else if (/^if\b|\bif\b|\bwhen\b/.test(lower)) {
|
|
249
|
+
rawIntents.push({ action: 'test', target: sentence, confidence: 0.5, implicit: true });
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
// Primary = highest confidence
|
|
254
|
+
const sorted = [...rawIntents].sort((a, b) => b.confidence - a.confidence);
|
|
255
|
+
const primary = sorted.length > 0
|
|
256
|
+
? { action: sorted[0].action, target: sorted[0].target.substring(0, 200), urgency: this.detectUrgency(prompt), confidence: sorted[0].confidence }
|
|
257
|
+
: { action: 'investigate', target: prompt.substring(0, 100), urgency: this.detectUrgency(prompt), confidence: 0.5 };
|
|
258
|
+
const secondary = rawIntents.map(raw => ({
|
|
259
|
+
id: generateId(),
|
|
260
|
+
action: raw.action,
|
|
261
|
+
target: raw.target.substring(0, 300),
|
|
262
|
+
implicit: raw.implicit,
|
|
263
|
+
dependency: null,
|
|
264
|
+
confidence: raw.confidence,
|
|
265
|
+
}));
|
|
266
|
+
return { primary, secondary };
|
|
267
|
+
}
|
|
268
|
+
calculateConfidence(sentence, verb) {
|
|
269
|
+
const lower = sentence.toLowerCase();
|
|
270
|
+
let confidence = 0.7;
|
|
271
|
+
if (lower.startsWith(verb))
|
|
272
|
+
confidence += 0.15;
|
|
273
|
+
if (/\/[a-z]/.test(lower) || /@[a-z]/.test(lower))
|
|
274
|
+
confidence += 0.1;
|
|
275
|
+
if (/maybe|perhaps|could|might|possibly/.test(lower))
|
|
276
|
+
confidence -= 0.2;
|
|
277
|
+
return Math.min(1, Math.max(0.1, confidence));
|
|
278
|
+
}
|
|
279
|
+
detectUrgency(prompt) {
|
|
280
|
+
const lower = prompt.toLowerCase();
|
|
281
|
+
for (const [urgency, keywords] of Object.entries(URGENCY_KEYWORDS)) {
|
|
282
|
+
for (const kw of keywords) {
|
|
283
|
+
if (lower.includes(kw))
|
|
284
|
+
return urgency;
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
return 'session';
|
|
288
|
+
}
|
|
289
|
+
extractContext(prompt) {
|
|
290
|
+
const filesNeeded = [];
|
|
291
|
+
const toolsRequired = [];
|
|
292
|
+
const assumptions = [];
|
|
293
|
+
const pathMatches = prompt.match(/(?:\/[\w.-]+)+\/?/g);
|
|
294
|
+
if (pathMatches)
|
|
295
|
+
filesNeeded.push(...new Set(pathMatches));
|
|
296
|
+
const atRefs = prompt.match(/@[\w./-]+/g);
|
|
297
|
+
if (atRefs)
|
|
298
|
+
filesNeeded.push(...atRefs.map(r => r.substring(1)));
|
|
299
|
+
// Extract assumptions from hedging language
|
|
300
|
+
const sentences = prompt.split(/(?<=[.!?])\s+|\n+/).filter(s => s.length > 5);
|
|
301
|
+
for (const sentence of sentences) {
|
|
302
|
+
const lower = sentence.toLowerCase();
|
|
303
|
+
if (/i assume|i expect|i know that|assuming that/.test(lower)) {
|
|
304
|
+
assumptions.push(sentence.trim());
|
|
305
|
+
}
|
|
306
|
+
else if (/\bprobably\b|\bsomehow\b|\bshould\b/.test(lower) && lower.length < 200) {
|
|
307
|
+
assumptions.push(sentence.trim());
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
return { filesNeeded, toolsRequired, assumptions };
|
|
311
|
+
}
|
|
312
|
+
// ── SOUTH: Enrichment & Dependency Mapping ──────────────────────────────────
|
|
313
|
+
enrichWithDirections(intents) {
|
|
314
|
+
return intents.map(intent => {
|
|
315
|
+
const direction = this.inferDirection(intent.action);
|
|
316
|
+
return {
|
|
317
|
+
...intent,
|
|
318
|
+
direction,
|
|
319
|
+
obligations: this.inferObligations(direction),
|
|
320
|
+
wilsonAlignment: 0.5, // default, enriched later
|
|
321
|
+
};
|
|
322
|
+
});
|
|
323
|
+
}
|
|
324
|
+
inferDirection(action) {
|
|
325
|
+
if (['investigate', 'research', 'explore', 'study', 'analyze'].includes(action))
|
|
326
|
+
return 'south';
|
|
327
|
+
if (['test', 'verify', 'validate', 'review', 'check'].includes(action))
|
|
328
|
+
return 'west';
|
|
329
|
+
if (['create', 'build', 'implement', 'add', 'deploy', 'install', 'modify', 'use', 'run'].includes(action))
|
|
330
|
+
return 'north';
|
|
331
|
+
if (['draft', 'plan', 'design'].includes(action))
|
|
332
|
+
return 'east';
|
|
333
|
+
return 'north';
|
|
334
|
+
}
|
|
335
|
+
inferObligations(direction) {
|
|
336
|
+
switch (direction) {
|
|
337
|
+
case 'east':
|
|
338
|
+
return [{ category: 'spirit', obligations: ['Clarify vision and intention'] }];
|
|
339
|
+
case 'south':
|
|
340
|
+
return [{ category: 'human', obligations: ['Research with reciprocity'] }];
|
|
341
|
+
case 'west':
|
|
342
|
+
return [{ category: 'human', obligations: ['Reflect and validate with care'] }];
|
|
343
|
+
case 'north':
|
|
344
|
+
return [{ category: 'future', obligations: ['Execute with responsibility to future generations'] }];
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
inferDependencies(intents) {
|
|
348
|
+
const deps = [];
|
|
349
|
+
const southIntents = intents.filter(i => i.direction === 'south');
|
|
350
|
+
const northIntents = intents.filter(i => i.direction === 'north');
|
|
351
|
+
const westIntents = intents.filter(i => i.direction === 'west');
|
|
352
|
+
// south (research) → north (action)
|
|
353
|
+
for (const south of southIntents) {
|
|
354
|
+
for (const north of northIntents) {
|
|
355
|
+
if (this.topicsRelated(south.target, north.target)) {
|
|
356
|
+
deps.push({
|
|
357
|
+
fromId: north.id, toId: south.id,
|
|
358
|
+
type: 'depends_on', direction: south.direction, confidence: 0.7,
|
|
359
|
+
});
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
// north (action) → west (validation)
|
|
364
|
+
for (const north of northIntents) {
|
|
365
|
+
for (const west of westIntents) {
|
|
366
|
+
if (this.topicsRelated(north.target, west.target)) {
|
|
367
|
+
deps.push({
|
|
368
|
+
fromId: west.id, toId: north.id,
|
|
369
|
+
type: 'validates', direction: north.direction, confidence: 0.7,
|
|
370
|
+
});
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
return deps;
|
|
375
|
+
}
|
|
376
|
+
topicsRelated(a, b) {
|
|
377
|
+
const wordsA = new Set(a.toLowerCase().split(/\s+/).filter(w => w.length > 3));
|
|
378
|
+
const wordsB = new Set(b.toLowerCase().split(/\s+/).filter(w => w.length > 3));
|
|
379
|
+
let overlap = 0;
|
|
380
|
+
for (const w of wordsA) {
|
|
381
|
+
if (wordsB.has(w))
|
|
382
|
+
overlap++;
|
|
383
|
+
}
|
|
384
|
+
return overlap >= 1;
|
|
385
|
+
}
|
|
386
|
+
// ── Ontological Direction Building ──────────────────────────────────────────
|
|
387
|
+
buildOntologicalDirections(insights) {
|
|
388
|
+
const result = {};
|
|
389
|
+
for (const dir of ALL_DIRECTIONS) {
|
|
390
|
+
result[dir] = {
|
|
391
|
+
name: dir,
|
|
392
|
+
ojibwe: ontology_core_1.OJIBWE_NAMES[dir],
|
|
393
|
+
season: ontology_core_1.DIRECTION_SEASONS[dir],
|
|
394
|
+
act: ontology_core_1.DIRECTION_ACTS[dir],
|
|
395
|
+
insights: insights[dir],
|
|
396
|
+
obligations: this.inferObligations(dir),
|
|
397
|
+
ceremonyRecommended: insights[dir].length === 0,
|
|
398
|
+
};
|
|
399
|
+
}
|
|
400
|
+
return result;
|
|
401
|
+
}
|
|
402
|
+
// ── WEST: Balance & Ceremony ────────────────────────────────────────────────
|
|
403
|
+
assessBalance(insights) {
|
|
404
|
+
const counts = ALL_DIRECTIONS.map(d => insights[d].length);
|
|
405
|
+
const total = counts.reduce((a, b) => a + b, 0) || 1;
|
|
406
|
+
const proportions = counts.map(c => c / total);
|
|
407
|
+
const deviation = proportions.reduce((sum, p) => sum + Math.abs(p - 0.25), 0) / 4;
|
|
408
|
+
const balance = Math.max(0, Math.min(1, 1 - deviation * 4));
|
|
409
|
+
const maxCount = Math.max(...counts);
|
|
410
|
+
const leadDirection = ALL_DIRECTIONS[counts.indexOf(maxCount)] || 'north';
|
|
411
|
+
const neglectedDirections = ALL_DIRECTIONS.filter(d => insights[d].length / total < 0.1);
|
|
412
|
+
return { balance, leadDirection, neglectedDirections };
|
|
413
|
+
}
|
|
414
|
+
checkCeremonyRequired(directions, balance) {
|
|
415
|
+
const eastPresence = directions.east.insights.length;
|
|
416
|
+
const westPresence = directions.west.insights.length;
|
|
417
|
+
const total = ALL_DIRECTIONS.reduce((sum, d) => sum + directions[d].insights.length, 0) || 1;
|
|
418
|
+
const ceremonialPresence = (eastPresence + westPresence) / total;
|
|
419
|
+
return ceremonialPresence < this.ceremonyThreshold;
|
|
420
|
+
}
|
|
421
|
+
generateCeremonyGuidance(neglectedDirections) {
|
|
422
|
+
const directionGuide = neglectedDirections.map(d => `${ontology_core_1.OJIBWE_NAMES[d]} (${d}): address the ${d === 'east' ? 'vision' : d === 'south' ? 'analysis' : d === 'west' ? 'reflection' : 'action'} dimension`).join('; ');
|
|
423
|
+
return {
|
|
424
|
+
opening_practice: 'Acknowledge the Four Directions before proceeding.',
|
|
425
|
+
intention: `Attend to neglected directions: ${directionGuide || 'all directions need balance'}.`,
|
|
426
|
+
protocol: 'Pause for relational check-in. Consider who this work serves and what obligations it carries.',
|
|
427
|
+
medicines_used: [],
|
|
428
|
+
};
|
|
429
|
+
}
|
|
430
|
+
computeWilsonAlignment(intents) {
|
|
431
|
+
if (intents.length === 0)
|
|
432
|
+
return 0.5;
|
|
433
|
+
return intents.reduce((sum, i) => sum + i.wilsonAlignment, 0) / intents.length;
|
|
434
|
+
}
|
|
435
|
+
// ── Ambiguity Detection (mcp-pde lineage) ─────────────────────────────────
|
|
436
|
+
detectAmbiguities(prompt, primary, neglectedDirections) {
|
|
437
|
+
const ambiguities = [];
|
|
438
|
+
if (primary.confidence < 0.5) {
|
|
439
|
+
ambiguities.push({
|
|
440
|
+
text: `Primary intent has low confidence (${Math.round(primary.confidence * 100)}%)`,
|
|
441
|
+
suggestion: 'Clarify the main goal with a more specific action verb and target.',
|
|
442
|
+
});
|
|
443
|
+
}
|
|
444
|
+
for (const dir of neglectedDirections) {
|
|
445
|
+
const desc = dir === 'east' ? 'vision clarity' : dir === 'south' ? 'research context' : dir === 'west' ? 'validation criteria' : 'actionable steps';
|
|
446
|
+
ambiguities.push({
|
|
447
|
+
text: `Direction ${ontology_core_1.OJIBWE_NAMES[dir]} (${dir}) is neglected`,
|
|
448
|
+
suggestion: `The prompt lacks ${desc}. Consider addressing what is missing from this perspective.`,
|
|
449
|
+
});
|
|
450
|
+
}
|
|
451
|
+
const lower = prompt.toLowerCase();
|
|
452
|
+
if (/\bsomehow\b/.test(lower)) {
|
|
453
|
+
ambiguities.push({
|
|
454
|
+
text: '"somehow" — method left unspecified',
|
|
455
|
+
suggestion: 'Specify the approach or method to use.',
|
|
456
|
+
});
|
|
457
|
+
}
|
|
458
|
+
if (/\bprobably\b|\bmaybe\b|\bperhaps\b/.test(lower)) {
|
|
459
|
+
ambiguities.push({
|
|
460
|
+
text: 'Hedging language detected ("probably", "maybe", "perhaps")',
|
|
461
|
+
suggestion: 'Confirm or deny the hedged assumptions before proceeding.',
|
|
462
|
+
});
|
|
463
|
+
}
|
|
464
|
+
return ambiguities;
|
|
465
|
+
}
|
|
466
|
+
// ── Expected Outputs ──────────────────────────────────────────────────────
|
|
467
|
+
extractExpectedOutputs(primary, intents) {
|
|
468
|
+
const artifacts = [];
|
|
469
|
+
const updates = [];
|
|
470
|
+
const communications = [];
|
|
471
|
+
for (const intent of intents) {
|
|
472
|
+
if (['create', 'add'].includes(intent.action))
|
|
473
|
+
artifacts.push(intent.target);
|
|
474
|
+
else if (['modify', 'use'].includes(intent.action))
|
|
475
|
+
updates.push(intent.target);
|
|
476
|
+
else if (['deploy', 'draft'].includes(intent.action))
|
|
477
|
+
communications.push(intent.target);
|
|
478
|
+
}
|
|
479
|
+
if (['create', 'add'].includes(primary.action))
|
|
480
|
+
artifacts.push(primary.target);
|
|
481
|
+
else if (['modify'].includes(primary.action))
|
|
482
|
+
updates.push(primary.target);
|
|
483
|
+
return { artifacts, updates, communications };
|
|
484
|
+
}
|
|
485
|
+
// ── NORTH: Action Stack ───────────────────────────────────────────────────
|
|
486
|
+
buildActionStack(intents, dependencies) {
|
|
487
|
+
// Topological sort by direction flow (east=0, south=1, west=2, north=3)
|
|
488
|
+
const dirOrder = { east: 0, south: 1, west: 2, north: 3 };
|
|
489
|
+
const sorted = [...intents].sort((a, b) => {
|
|
490
|
+
const dirDiff = dirOrder[a.direction] - dirOrder[b.direction];
|
|
491
|
+
if (dirDiff !== 0)
|
|
492
|
+
return dirDiff;
|
|
493
|
+
return b.confidence - a.confidence;
|
|
494
|
+
});
|
|
495
|
+
return sorted.map(intent => ({
|
|
496
|
+
id: intent.id,
|
|
497
|
+
text: `${intent.action} ${intent.target}`,
|
|
498
|
+
direction: intent.direction,
|
|
499
|
+
dependency: intent.dependency,
|
|
500
|
+
completed: false,
|
|
501
|
+
confidence: intent.confidence,
|
|
502
|
+
implicit: intent.implicit,
|
|
503
|
+
}));
|
|
504
|
+
}
|
|
505
|
+
// ── Narrative Beats ───────────────────────────────────────────────────────
|
|
506
|
+
generateNarrativeBeats(actionStack, decompositionId) {
|
|
507
|
+
return actionStack.map((action, i) => ({
|
|
508
|
+
id: `${decompositionId}-beat-${i}`,
|
|
509
|
+
direction: action.direction,
|
|
510
|
+
title: action.text,
|
|
511
|
+
description: `${action.implicit ? 'Implicit: ' : ''}${action.text}`,
|
|
512
|
+
ceremonies: [],
|
|
513
|
+
learnings: [],
|
|
514
|
+
timestamp: new Date().toISOString(),
|
|
515
|
+
act: ontology_core_1.DIRECTION_ACTS[action.direction],
|
|
516
|
+
relations_honored: [],
|
|
517
|
+
}));
|
|
518
|
+
}
|
|
519
|
+
}
|
|
520
|
+
exports.MedicineWheelDecomposer = MedicineWheelDecomposer;
|
|
521
|
+
// ── Epistemic Source Detection ─────────────────────────────────────────────
|
|
522
|
+
const EPISTEMIC_KEYWORDS = {
|
|
523
|
+
land: [
|
|
524
|
+
'place', 'territory', 'walking', 'embodied', 'land', 'ground',
|
|
525
|
+
'earth', 'river', 'mountain', 'forest', 'body', 'physical',
|
|
526
|
+
'sensation', 'touch', 'landscape', 'soil', 'roots', 'habitat',
|
|
527
|
+
],
|
|
528
|
+
dream: [
|
|
529
|
+
'vision', 'dream', 'intuition', 'liminal', 'imagine', 'spirit',
|
|
530
|
+
'ceremony', 'prayer', 'meditation', 'ancestor', 'sleep', 'unconscious',
|
|
531
|
+
'symbol', 'omen', 'feeling', 'sense', 'inner', 'calling',
|
|
532
|
+
],
|
|
533
|
+
code: [
|
|
534
|
+
'implement', 'function', 'algorithm', 'code', 'program', 'compile',
|
|
535
|
+
'syntax', 'module', 'class', 'method', 'variable', 'data',
|
|
536
|
+
'structure', 'logic', 'compute', 'binary', 'interface', 'api',
|
|
537
|
+
],
|
|
538
|
+
vision: [
|
|
539
|
+
'intention', 'aspiration', 'future', 'goal', 'purpose', 'mission',
|
|
540
|
+
'plan', 'strategy', 'direction', 'horizon', 'possibility', 'potential',
|
|
541
|
+
'transform', 'become', 'evolve', 'next', 'forward', 'beyond',
|
|
542
|
+
],
|
|
543
|
+
unknown: [],
|
|
544
|
+
};
|
|
545
|
+
/**
|
|
546
|
+
* Heuristic classification of epistemic source from language patterns.
|
|
547
|
+
*
|
|
548
|
+
* Scans text for keywords associated with each of Wilson's four
|
|
549
|
+
* epistemic sources and returns the best match. Returns 'unknown'
|
|
550
|
+
* when no clear signal is present.
|
|
551
|
+
*
|
|
552
|
+
* - **land**: mentions of place, territory, walking, embodied experience
|
|
553
|
+
* - **dream**: mentions of vision, dream, intuition, liminal space
|
|
554
|
+
* - **code**: mentions of implementation, function, algorithm, structure
|
|
555
|
+
* - **vision**: mentions of intention, aspiration, future, purpose
|
|
556
|
+
*/
|
|
557
|
+
function detectEpistemicSource(text) {
|
|
558
|
+
const lower = text.toLowerCase();
|
|
559
|
+
const words = lower.split(/\s+/);
|
|
560
|
+
const scores = {
|
|
561
|
+
land: 0,
|
|
562
|
+
dream: 0,
|
|
563
|
+
code: 0,
|
|
564
|
+
vision: 0,
|
|
565
|
+
};
|
|
566
|
+
for (const word of words) {
|
|
567
|
+
for (const [source, keywords] of Object.entries(EPISTEMIC_KEYWORDS)) {
|
|
568
|
+
if (source === 'unknown')
|
|
569
|
+
continue;
|
|
570
|
+
for (const keyword of keywords) {
|
|
571
|
+
if (word.includes(keyword)) {
|
|
572
|
+
scores[source]++;
|
|
573
|
+
}
|
|
574
|
+
}
|
|
575
|
+
}
|
|
576
|
+
}
|
|
577
|
+
const total = Object.values(scores).reduce((a, b) => a + b, 0);
|
|
578
|
+
if (total === 0)
|
|
579
|
+
return 'unknown';
|
|
580
|
+
let bestSource = 'unknown';
|
|
581
|
+
let bestScore = 0;
|
|
582
|
+
for (const [source, score] of Object.entries(scores)) {
|
|
583
|
+
if (score > bestScore) {
|
|
584
|
+
bestScore = score;
|
|
585
|
+
bestSource = source;
|
|
586
|
+
}
|
|
587
|
+
}
|
|
588
|
+
// Require at least 20% signal strength to avoid noisy classification
|
|
589
|
+
if (bestScore / total < 0.2)
|
|
590
|
+
return 'unknown';
|
|
591
|
+
return bestSource;
|
|
592
|
+
}
|
|
593
|
+
//# sourceMappingURL=decomposer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"decomposer.js","sourceRoot":"","sources":["../src/decomposer.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;GAaG;;;AA0nBH,sDAsCC;AA9pBD,iEAEuC;AAoBvC,+EAA+E;AAE/E,MAAM,kBAAkB,GAAoC;IAC1D,IAAI,EAAE;QACJ,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ;QAClE,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,QAAQ,EAAE,SAAS,EAAE,KAAK,EAAE,WAAW;QACvE,SAAS,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ;KAC5D;IACD,KAAK,EAAE;QACL,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,YAAY,EAAE,OAAO,EAAE,SAAS;QACpE,SAAS,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ;Q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AM,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC;IAC/D,IAAI,KAAK,KAAK,CAAC;QAAE,OAAO,SAAS,CAAC;IAElC,IAAI,UAAU,GAAwB,SAAS,CAAC;IAChD,IAAI,SAAS,GAAG,CAAC,CAAC;IAClB,KAAK,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;QACrD,IAAI,KAAK,GAAG,SAAS,EAAE,CAAC;YACtB,SAAS,GAAG,KAAK,CAAC;YAClB,UAAU,GAAG,MAA6B,CAAC;QAC7C,CAAC;IACH,CAAC;IAED,qEAAqE;IACrE,IAAI,SAAS,GAAG,KAAK,GAAG,GAAG;QAAE,OAAO,SAAS,CAAC;IAE9C,OAAO,UAAU,CAAC;AACpB,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @medicine-wheel/prompt-decomposition — Browser Entry
|
|
3
|
+
*
|
|
4
|
+
* Re-exports everything EXCEPT storage (which requires Node.js built-ins).
|
|
5
|
+
* Use this entry when bundling for browser/edge environments.
|
|
6
|
+
*/
|
|
7
|
+
export type { Urgency, PrimaryIntent, SecondaryIntent, ExtractionContext, AmbiguityFlag, ExpectedOutputs, DirectionalInsight, OntologicalDirection, RelationalIntent, OntologicalDependency, OntologicalDecomposition, ActionItem, StoredDecomposition, DecomposerOptions, } from './types.js';
|
|
8
|
+
export { MedicineWheelDecomposer } from './decomposer.js';
|
|
9
|
+
export { RelationalEnricher, type RelationalGraph, type EnrichmentResult, type IntentNodeMapping, type AccountabilityGap, } from './relational_enricher.js';
|
|
10
|
+
//# sourceMappingURL=index.browser.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.browser.d.ts","sourceRoot":"","sources":["../src/index.browser.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,YAAY,EACV,OAAO,EACP,aAAa,EACb,eAAe,EACf,iBAAiB,EACjB,aAAa,EACb,eAAe,EACf,kBAAkB,EAClB,oBAAoB,EACpB,gBAAgB,EAChB,qBAAqB,EACrB,wBAAwB,EACxB,UAAU,EACV,mBAAmB,EACnB,iBAAiB,GAClB,MAAM,YAAY,CAAC;AAGpB,OAAO,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAC;AAG1D,OAAO,EACL,kBAAkB,EAClB,KAAK,eAAe,EACpB,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,EACtB,KAAK,iBAAiB,GACvB,MAAM,0BAA0B,CAAC"}
|