@roarpeng/graphflow 1.4.3 → 1.7.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.
Files changed (94) hide show
  1. package/AGENTS.md +11 -37
  2. package/CHANGELOG.md +40 -0
  3. package/CLAUDE.md +1 -1
  4. package/README.md +116 -44
  5. package/dist/agents/atp-schema.d.ts +59 -0
  6. package/dist/agents/atp-schema.d.ts.map +1 -0
  7. package/dist/agents/atp-schema.js +3 -0
  8. package/dist/agents/atp-schema.js.map +1 -0
  9. package/dist/agents/decision-engine.d.ts +55 -0
  10. package/dist/agents/decision-engine.d.ts.map +1 -0
  11. package/dist/agents/decision-engine.js +338 -0
  12. package/dist/agents/decision-engine.js.map +1 -0
  13. package/dist/agents/insight.d.ts +57 -1
  14. package/dist/agents/insight.d.ts.map +1 -1
  15. package/dist/agents/insight.js +365 -2
  16. package/dist/agents/insight.js.map +1 -1
  17. package/dist/config/defaults.d.ts.map +1 -1
  18. package/dist/config/defaults.js +1 -2
  19. package/dist/config/defaults.js.map +1 -1
  20. package/dist/config/discover-workspace.d.ts.map +1 -1
  21. package/dist/config/discover-workspace.js +4 -0
  22. package/dist/config/discover-workspace.js.map +1 -1
  23. package/dist/config/embedding-factory.js +6 -6
  24. package/dist/config/embedding-factory.js.map +1 -1
  25. package/dist/config/loader.d.ts.map +1 -1
  26. package/dist/config/loader.js +1 -2
  27. package/dist/config/loader.js.map +1 -1
  28. package/dist/config/schema.d.ts +1 -2
  29. package/dist/config/schema.d.ts.map +1 -1
  30. package/dist/core/agent-delegation.d.ts +3 -1
  31. package/dist/core/agent-delegation.d.ts.map +1 -1
  32. package/dist/core/agent-delegation.js +121 -0
  33. package/dist/core/agent-delegation.js.map +1 -1
  34. package/dist/core/orchestrator-context.d.ts.map +1 -1
  35. package/dist/core/orchestrator-context.js +25 -3
  36. package/dist/core/orchestrator-context.js.map +1 -1
  37. package/dist/core/types.d.ts +12 -0
  38. package/dist/core/types.d.ts.map +1 -1
  39. package/dist/graph/context-slicer-types.d.ts +0 -4
  40. package/dist/graph/context-slicer-types.d.ts.map +1 -1
  41. package/dist/graph/context-slicer-types.js.map +1 -1
  42. package/dist/graph/context-slicer.d.ts.map +1 -1
  43. package/dist/graph/context-slicer.js +5 -15
  44. package/dist/graph/context-slicer.js.map +1 -1
  45. package/dist/graph/file-indexer-walker.d.ts +3 -0
  46. package/dist/graph/file-indexer-walker.d.ts.map +1 -1
  47. package/dist/graph/file-indexer-walker.js.map +1 -1
  48. package/dist/graph/file-indexer.d.ts +1 -0
  49. package/dist/graph/file-indexer.d.ts.map +1 -1
  50. package/dist/graph/file-indexer.js +14 -18
  51. package/dist/graph/file-indexer.js.map +1 -1
  52. package/dist/integrations/agent-mcp-installer.d.ts.map +1 -1
  53. package/dist/integrations/agent-mcp-installer.js +26 -10
  54. package/dist/integrations/agent-mcp-installer.js.map +1 -1
  55. package/dist/integrations/skill-installer.d.ts +24 -2
  56. package/dist/integrations/skill-installer.d.ts.map +1 -1
  57. package/dist/integrations/skill-installer.js +262 -18
  58. package/dist/integrations/skill-installer.js.map +1 -1
  59. package/dist/learning/embeddings.d.ts +2 -3
  60. package/dist/learning/embeddings.d.ts.map +1 -1
  61. package/dist/learning/embeddings.js +18 -33
  62. package/dist/learning/embeddings.js.map +1 -1
  63. package/dist/learning/hnsw-index.d.ts +9 -35
  64. package/dist/learning/hnsw-index.d.ts.map +1 -1
  65. package/dist/learning/hnsw-index.js +8 -154
  66. package/dist/learning/hnsw-index.js.map +1 -1
  67. package/dist/surfaces/antigravity-rules/graphflow.md +45 -0
  68. package/dist/surfaces/cli/init.d.ts.map +1 -1
  69. package/dist/surfaces/cli/init.js +24 -1
  70. package/dist/surfaces/cli/init.js.map +1 -1
  71. package/dist/surfaces/cli/runtime/graph.d.ts.map +1 -1
  72. package/dist/surfaces/cli/runtime/graph.js +0 -1
  73. package/dist/surfaces/cli/runtime/graph.js.map +1 -1
  74. package/dist/surfaces/cli/runtime/settings.d.ts.map +1 -1
  75. package/dist/surfaces/cli/runtime/settings.js +0 -5
  76. package/dist/surfaces/cli/runtime/settings.js.map +1 -1
  77. package/dist/surfaces/cli/runtime/types.d.ts +0 -8
  78. package/dist/surfaces/cli/runtime/types.d.ts.map +1 -1
  79. package/dist/surfaces/copilot-instructions/graphflow.md +74 -0
  80. package/dist/surfaces/cursor-rules/graphflow.mdc +17 -25
  81. package/dist/surfaces/mcp/tool-definitions.d.ts.map +1 -1
  82. package/dist/surfaces/mcp/tool-definitions.js +31 -124
  83. package/dist/surfaces/mcp/tool-definitions.js.map +1 -1
  84. package/dist/surfaces/mcp/tool-handlers.d.ts.map +1 -1
  85. package/dist/surfaces/mcp/tool-handlers.js +78 -42
  86. package/dist/surfaces/mcp/tool-handlers.js.map +1 -1
  87. package/dist/surfaces/trae-rules/graphflow.md +52 -0
  88. package/dist/surfaces/trae-skill/graphflow/SKILL.md +104 -73
  89. package/package.json +5 -2
  90. package/src/surfaces/antigravity-rules/graphflow.md +45 -0
  91. package/src/surfaces/copilot-instructions/graphflow.md +74 -0
  92. package/src/surfaces/cursor-rules/graphflow.mdc +17 -25
  93. package/src/surfaces/trae-rules/graphflow.md +52 -0
  94. package/src/surfaces/trae-skill/graphflow/SKILL.md +104 -73
@@ -0,0 +1,338 @@
1
+ "use strict";
2
+ /**
3
+ * Decision Engine — First Principles Analysis + Decision Matrix.
4
+ *
5
+ * These two modules form the core of ATP v1.0's analytical depth:
6
+ * - First Principles: strip away assumptions, decompose to fundamental
7
+ * truths, and challenge every belief about the problem.
8
+ * - Decision Matrix: generate viable options, score them across
9
+ * multiple dimensions, and recommend the best path forward.
10
+ *
11
+ * Each module has an LLM-powered version (calls executeRolePrompt) and
12
+ * a heuristic fallback (rule-based, no LLM dependency). The LLM version
13
+ * always falls back to the heuristic when the call fails or the JSON
14
+ * response is unparseable.
15
+ */
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ exports.applyFirstPrinciples = applyFirstPrinciples;
18
+ exports.applyFirstPrinciplesHeuristic = applyFirstPrinciplesHeuristic;
19
+ exports.evaluateOptions = evaluateOptions;
20
+ exports.evaluateOptionsHeuristic = evaluateOptionsHeuristic;
21
+ const provider_executor_1 = require("../routing/provider-executor");
22
+ const logger_1 = require("../utils/logger");
23
+ /** === First Principles Analysis === */
24
+ /**
25
+ * Apply first principles thinking to the task using LLM.
26
+ *
27
+ * Asks the LLM to:
28
+ * 1. List current assumptions (assumptions)
29
+ * 2. Decompose to irreducible facts (facts)
30
+ * 3. Identify fundamental elements (deconstructedTo)
31
+ * 4. Challenge each assumption (challenges)
32
+ *
33
+ * Falls back to heuristic on LLM failure or unparseable response.
34
+ */
35
+ async function applyFirstPrinciples(task, insight, options) {
36
+ const prompt = [
37
+ `You are performing a First Principles analysis on the following task.`,
38
+ ``,
39
+ `Task: "${task}"`,
40
+ ``,
41
+ `Prior analysis context:`,
42
+ `- Root causes identified: ${insight.rootCauses.length > 0 ? insight.rootCauses.join("; ") : "(none)"}`,
43
+ `- Critical risks: ${insight.criticalRisks.length > 0 ? insight.criticalRisks.join("; ") : "(none)"}`,
44
+ `- Core value: ${insight.coreValue || "(not yet identified)"}`,
45
+ `- Refined task statement: ${insight.refinedTaskStatement}`,
46
+ ``,
47
+ `Your job:`,
48
+ `1. List the assumptions currently held about this task (things believed to be true but not verified).`,
49
+ `2. Identify the irreducible facts — fundamental truths that cannot be broken down further.`,
50
+ `3. Decompose the problem into its most basic elements.`,
51
+ `4. Challenge each assumption: is it truly valid, or is it based on convention?`,
52
+ ``,
53
+ `Return ONLY a JSON object:`,
54
+ `{`,
55
+ ` "assumptions": ["assumption 1", "assumption 2", ...],`,
56
+ ` "facts": ["irreducible fact 1", "fact 2", ...],`,
57
+ ` "deconstructedTo": ["fundamental element 1", "element 2", ...],`,
58
+ ` "challenges": ["challenge to assumption 1", "challenge to assumption 2", ...]`,
59
+ `}`,
60
+ ``,
61
+ `Each array should contain 2-6 concise items. Be specific and analytical.`,
62
+ ].join("\n");
63
+ let raw = "";
64
+ try {
65
+ raw = await (0, provider_executor_1.executeRolePrompt)("planner", prompt, options.selection, options.context);
66
+ }
67
+ catch (error) {
68
+ logger_1.logger.warn({ error }, "First principles LLM call failed, using heuristic fallback");
69
+ return applyFirstPrinciplesHeuristic(task, insight);
70
+ }
71
+ const parsed = parseFirstPrinciplesResponse(raw);
72
+ if (parsed === null) {
73
+ logger_1.logger.warn({ raw }, "First principles response unparseable, using heuristic fallback");
74
+ return applyFirstPrinciplesHeuristic(task, insight);
75
+ }
76
+ return parsed;
77
+ }
78
+ /**
79
+ * Heuristic first principles analysis — no LLM calls.
80
+ * Derives assumptions, facts, decomposition, and challenges from
81
+ * the Six Hats insight using rule-based logic.
82
+ */
83
+ function applyFirstPrinciplesHeuristic(task, insight) {
84
+ return {
85
+ assumptions: insight.criticalRisks.length > 0
86
+ ? ["Assumption: identified risks are addressable within scope"]
87
+ : ["Assumption: no significant risks identified means the task is straightforward"],
88
+ facts: [
89
+ `Task: ${task}`,
90
+ `Root causes found: ${insight.rootCauses.length}`,
91
+ `Critical risks: ${insight.criticalRisks.length}`,
92
+ `Core value: ${insight.coreValue}`,
93
+ ],
94
+ deconstructedTo: [
95
+ "Problem decomposed into: context gathering, analysis, implementation, verification",
96
+ `Root cause driven: ${insight.rootCauses.slice(0, 2).join("; ")}`,
97
+ ],
98
+ challenges: insight.criticalRisks.map((r) => `Challenge: "${r}" — is this risk real or based on assumption?`),
99
+ };
100
+ }
101
+ /** === Decision Matrix Evaluation === */
102
+ /**
103
+ * Evaluate solution options using a decision matrix with LLM.
104
+ *
105
+ * Asks the LLM to:
106
+ * 1. Generate 2-3 viable options based on first principles analysis
107
+ * 2. Score each option on complexity, cost, risk, maintainability, impact (1-10)
108
+ * 3. List pros and cons for each option
109
+ * 4. Recommend one option with rationale
110
+ *
111
+ * Falls back to heuristic on LLM failure or unparseable response.
112
+ */
113
+ async function evaluateOptions(task, insight, firstPrinciples, options) {
114
+ const prompt = [
115
+ `You are evaluating solution options for a task using a Decision Matrix.`,
116
+ ``,
117
+ `Task: "${task}"`,
118
+ ``,
119
+ `First Principles Analysis:`,
120
+ `- Assumptions: ${firstPrinciples.assumptions.join("; ")}`,
121
+ `- Facts: ${firstPrinciples.facts.join("; ")}`,
122
+ `- Decomposed to: ${firstPrinciples.deconstructedTo.join("; ")}`,
123
+ `- Challenges: ${firstPrinciples.challenges.join("; ")}`,
124
+ ``,
125
+ `Six Hats Insight:`,
126
+ `- Root causes: ${insight.rootCauses.join("; ") || "(none)"}`,
127
+ `- Critical risks: ${insight.criticalRisks.join("; ") || "(none)"}`,
128
+ `- Core value: ${insight.coreValue || "(not identified)"}`,
129
+ ``,
130
+ `Your job:`,
131
+ `1. Based on the analysis above, generate 2-3 viable solution options.`,
132
+ `2. Score each option on these dimensions (1-10, where 1 is best/lowest and 10 is worst/highest):`,
133
+ ` - complexity: how technically complex (1=simple, 10=very complex)`,
134
+ ` - cost: resource cost (1=low, 10=high)`,
135
+ ` - risk: level of risk (1=low, 10=high)`,
136
+ ` - maintainability: ease of maintenance (1=easy, 10=hard — INVERTED: high score means hard to maintain)`,
137
+ ` - impact: potential impact (1=low, 10=high — high score is GOOD)`,
138
+ `3. List pros and cons for each option.`,
139
+ `4. Recommend the best option and explain your rationale.`,
140
+ ``,
141
+ `Return ONLY a JSON object:`,
142
+ `{`,
143
+ ` "options": [`,
144
+ ` {`,
145
+ ` "name": "Option Name",`,
146
+ ` "description": "Brief description of the approach",`,
147
+ ` "scores": {`,
148
+ ` "complexity": 1-10,`,
149
+ ` "cost": 1-10,`,
150
+ ` "risk": 1-10,`,
151
+ ` "maintainability": 1-10,`,
152
+ ` "impact": 1-10`,
153
+ ` },`,
154
+ ` "pros": ["pro 1", "pro 2", ...],`,
155
+ ` "cons": ["con 1", "con 2", ...]`,
156
+ ` }`,
157
+ ` ],`,
158
+ ` "recommendedOption": "Name of the recommended option",`,
159
+ ` "rationale": "Why this option is recommended over the others"`,
160
+ `}`,
161
+ ].join("\n");
162
+ let raw = "";
163
+ try {
164
+ raw = await (0, provider_executor_1.executeRolePrompt)("planner", prompt, options.selection, options.context);
165
+ }
166
+ catch (error) {
167
+ logger_1.logger.warn({ error }, "Decision matrix LLM call failed, using heuristic fallback");
168
+ return evaluateOptionsHeuristic(task, insight);
169
+ }
170
+ const parsed = parseDecisionMatrixResponse(raw);
171
+ if (parsed === null) {
172
+ logger_1.logger.warn({ raw }, "Decision matrix response unparseable, using heuristic fallback");
173
+ return evaluateOptionsHeuristic(task, insight);
174
+ }
175
+ return parsed;
176
+ }
177
+ /**
178
+ * Heuristic decision matrix evaluation — no LLM calls.
179
+ * Generates two standard options (Incremental vs Comprehensive)
180
+ * and recommends based on risk count.
181
+ */
182
+ function evaluateOptionsHeuristic(_task, insight) {
183
+ const optionA = {
184
+ name: "Incremental Approach",
185
+ description: "Build incrementally, addressing root causes one by one",
186
+ scores: { complexity: 4, cost: 3, risk: 3, maintainability: 8, impact: 6 },
187
+ pros: ["Low risk", "Easy to validate", "Quick feedback"],
188
+ cons: ["May take longer overall", "Requires more iterations"],
189
+ };
190
+ const optionB = {
191
+ name: "Comprehensive Approach",
192
+ description: "Address all root causes and risks in a single coordinated effort",
193
+ scores: { complexity: 7, cost: 6, risk: 6, maintainability: 7, impact: 9 },
194
+ pros: ["Higher impact", "Complete solution", "Single deployment"],
195
+ cons: ["Higher complexity", "More risk", "Longer initial timeline"],
196
+ };
197
+ return {
198
+ options: [optionA, optionB],
199
+ recommendedOption: insight.criticalRisks.length > 2 ? "Incremental Approach" : "Comprehensive Approach",
200
+ rationale: insight.criticalRisks.length > 2
201
+ ? "High risk count suggests incremental approach to manage exposure"
202
+ : "Low risk count allows comprehensive approach for maximum impact",
203
+ };
204
+ }
205
+ /** === JSON Parsing Helpers === */
206
+ /**
207
+ * Parse a First Principles JSON response from the LLM.
208
+ * Returns null if the response cannot be parsed into a valid
209
+ * FirstPrinciplesAnalysis object.
210
+ */
211
+ function parseFirstPrinciplesResponse(raw) {
212
+ const text = stripCodeFence(raw).trim();
213
+ const start = text.indexOf("{");
214
+ const end = text.lastIndexOf("}");
215
+ if (start === -1 || end === -1) {
216
+ return null;
217
+ }
218
+ let parsed;
219
+ try {
220
+ parsed = JSON.parse(text.slice(start, end + 1));
221
+ }
222
+ catch {
223
+ return null;
224
+ }
225
+ const assumptions = extractStringArray(parsed, "assumptions");
226
+ const facts = extractStringArray(parsed, "facts");
227
+ const deconstructedTo = extractStringArray(parsed, "deconstructedTo");
228
+ const challenges = extractStringArray(parsed, "challenges");
229
+ // Require at least some meaningful content
230
+ if (assumptions.length === 0 && facts.length === 0) {
231
+ return null;
232
+ }
233
+ return { assumptions, facts, deconstructedTo, challenges };
234
+ }
235
+ /**
236
+ * Parse a Decision Matrix JSON response from the LLM.
237
+ * Returns null if the response cannot be parsed into a valid
238
+ * DecisionMatrixResult object.
239
+ */
240
+ function parseDecisionMatrixResponse(raw) {
241
+ const text = stripCodeFence(raw).trim();
242
+ const start = text.indexOf("{");
243
+ const end = text.lastIndexOf("}");
244
+ if (start === -1 || end === -1) {
245
+ return null;
246
+ }
247
+ let parsed;
248
+ try {
249
+ parsed = JSON.parse(text.slice(start, end + 1));
250
+ }
251
+ catch {
252
+ return null;
253
+ }
254
+ // Parse options array
255
+ const optionsRaw = parsed.options;
256
+ if (!Array.isArray(optionsRaw) || optionsRaw.length === 0) {
257
+ return null;
258
+ }
259
+ const options = [];
260
+ for (const entry of optionsRaw) {
261
+ if (!entry || typeof entry !== "object")
262
+ continue;
263
+ const obj = entry;
264
+ const name = typeof obj.name === "string" ? obj.name.trim() : "";
265
+ const description = typeof obj.description === "string" ? obj.description.trim() : "";
266
+ if (!name)
267
+ continue;
268
+ const scoresRaw = obj.scores;
269
+ const scores = scoresRaw && typeof scoresRaw === "object"
270
+ ? scoresRaw
271
+ : {};
272
+ options.push({
273
+ name,
274
+ description,
275
+ scores: {
276
+ complexity: clampScore(scores.complexity),
277
+ cost: clampScore(scores.cost),
278
+ risk: clampScore(scores.risk),
279
+ maintainability: clampScore(scores.maintainability),
280
+ impact: clampScore(scores.impact),
281
+ },
282
+ pros: extractStringArray(obj, "pros"),
283
+ cons: extractStringArray(obj, "cons"),
284
+ });
285
+ }
286
+ if (options.length === 0) {
287
+ return null;
288
+ }
289
+ const recommendedOption = typeof parsed.recommendedOption === "string" ? parsed.recommendedOption.trim() : "";
290
+ const rationale = typeof parsed.rationale === "string" ? parsed.rationale.trim() : "";
291
+ // Validate that recommendedOption matches one of the option names
292
+ const firstOption = options[0];
293
+ if (!recommendedOption || !options.some((o) => o.name === recommendedOption)) {
294
+ // If recommendation doesn't match, pick the first option as fallback
295
+ return {
296
+ options,
297
+ recommendedOption: firstOption?.name ?? recommendedOption,
298
+ rationale: rationale || "Default recommendation: first viable option",
299
+ };
300
+ }
301
+ return { options, recommendedOption, rationale };
302
+ }
303
+ /** === Utility Functions === */
304
+ /**
305
+ * Strip markdown code fences (```json ... ```) from a raw LLM response.
306
+ */
307
+ function stripCodeFence(raw) {
308
+ const text = raw.trim();
309
+ const fenceMatch = text.match(/^```(?:json)?\s*([\s\S]*?)\s*```$/i);
310
+ if (fenceMatch && fenceMatch[1]) {
311
+ return fenceMatch[1].trim();
312
+ }
313
+ return text;
314
+ }
315
+ /**
316
+ * Extract a string array from a parsed JSON object field.
317
+ * Returns an empty array if the field is missing or invalid.
318
+ */
319
+ function extractStringArray(obj, key) {
320
+ const value = obj[key];
321
+ if (!Array.isArray(value))
322
+ return [];
323
+ return value
324
+ .filter((item) => typeof item === "string")
325
+ .map((item) => item.trim())
326
+ .filter((item) => item.length > 0);
327
+ }
328
+ /**
329
+ * Clamp a score value to the 1-10 range.
330
+ * Returns 5 (midpoint) if the value is not a valid number.
331
+ */
332
+ function clampScore(value) {
333
+ if (typeof value !== "number" || !Number.isFinite(value)) {
334
+ return 5;
335
+ }
336
+ return Math.max(1, Math.min(10, Math.round(value)));
337
+ }
338
+ //# sourceMappingURL=decision-engine.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"decision-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AAC,IAAI,CAAC,IAAI,EAAE,CAAC;SAC1B,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;AACvC,CAAC;AAED;;;GAGG;AACH,SAAS,UAAU,CAAC,KAAc;IAChC,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;QACzD,OAAO,CAAC,CAAC;IACX,CAAC;IACD,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AACtD,CAAC"}
@@ -13,6 +13,7 @@
13
13
  import type { TaskNode } from "../core/types";
14
14
  import type { ModelSelection } from "../routing/model-router";
15
15
  import { type PromptContext } from "../routing/provider-executor";
16
+ import type { IntentAnalysis, RequirementAnalysis, PlanReflection, AgentThinkingProtocol } from "./atp-schema";
16
17
  /** === Hat Definitions === */
17
18
  export interface HatDefinition {
18
19
  name: string;
@@ -62,16 +63,71 @@ export interface PlanInsightOptions {
62
63
  selection: ModelSelection;
63
64
  context?: PromptContext;
64
65
  }
66
+ /** === ATP Stage 1: Intent Analysis === */
67
+ /**
68
+ * Analyze the intent behind a task using LLM.
69
+ *
70
+ * Identifies explicit intent, implicit intent, core problem,
71
+ * non-goals, and success definition.
72
+ *
73
+ * Falls back to heuristic on LLM failure or unparseable response.
74
+ */
75
+ export declare function analyzeIntent(task: string, options: PlanInsightOptions): Promise<IntentAnalysis>;
76
+ /**
77
+ * Heuristic intent analysis — no LLM calls.
78
+ */
79
+ export declare function analyzeIntentHeuristic(task: string): IntentAnalysis;
80
+ /** === ATP Stage 2: Requirement Analysis === */
81
+ /**
82
+ * Extract requirements from the task and intent using LLM.
83
+ *
84
+ * Identifies functional, non-functional, constraints, priority, and scope.
85
+ *
86
+ * Falls back to heuristic on LLM failure or unparseable response.
87
+ */
88
+ export declare function extractRequirements(task: string, intent: IntentAnalysis, options: PlanInsightOptions): Promise<RequirementAnalysis>;
89
+ /**
90
+ * Heuristic requirement extraction — no LLM calls.
91
+ */
92
+ export declare function extractRequirementsHeuristic(_task: string, intent: IntentAnalysis): RequirementAnalysis;
93
+ /** === ATP Stage 8: Plan Reflection === */
94
+ /**
95
+ * Reflect on the generated plan using LLM.
96
+ *
97
+ * Evaluates confidence, uncertainties, missing information,
98
+ * and improvement directions.
99
+ *
100
+ * Falls back to heuristic on LLM failure or unparseable response.
101
+ */
102
+ export declare function reflectOnPlan(insight: SixHatsInsight, plan: TaskNode[] | null, options: PlanInsightOptions): Promise<PlanReflection>;
103
+ /**
104
+ * Heuristic plan reflection — no LLM calls.
105
+ */
106
+ export declare function reflectOnPlanHeuristic(insight: SixHatsInsight, plan: TaskNode[] | null): PlanReflection;
107
+ /** === Main Entry Point === */
108
+ /**
109
+ * Determine whether the full ATP pipeline should be short-circuited
110
+ * based on intent analysis and task characteristics.
111
+ */
112
+ export declare function shouldShortCircuitAtp(intent: IntentAnalysis, requirements: RequirementAnalysis, task: string): boolean;
65
113
  /**
66
114
  * Run the full Six Thinking Hats + Five Whys analysis on a task,
67
115
  * then generate a DAG-style plan that incorporates the insights.
68
116
  *
117
+ * When `runFullAtp` is true, the complete ATP v1.0 pipeline is executed:
118
+ * Intent -> Requirement -> SixHats -> 5Why -> FirstPrinciples
119
+ * -> DecisionMatrix -> Planning -> Reflection.
120
+ *
121
+ * Adaptive short-circuit: simple tasks skip FirstPrinciples, DecisionMatrix, and Reflection.
122
+ *
69
123
  * @param task The task to analyze
70
124
  * @param options Model selection and context options
125
+ * @param runFullAtp Whether to run the full ATP pipeline (default: false for backward compatibility)
71
126
  */
72
- export declare function planInsight(task: string, options: PlanInsightOptions): Promise<{
127
+ export declare function planInsight(task: string, options: PlanInsightOptions, runFullAtp?: boolean): Promise<{
73
128
  insight: SixHatsInsight;
74
129
  plan: TaskNode[] | null;
130
+ atp?: AgentThinkingProtocol;
75
131
  }>;
76
132
  /**
77
133
  * Run the Six Thinking Hats analysis with automatic 5 Why triggers.
@@ -1 +1 @@
1
- {"version":3,"file":"insight.d.ts","sourceRoot":"","sources":["../../src/agents/insight.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAqB,KAAK,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAGrF,8BAA8B;AAE9B,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,OAAO,GAAG,KAAK,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,GAAG,MAAM,CAAC;IAC/D,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;CACtB;AAED,eAAO,MAAM,QAAQ,EAAE,aAAa,EAuDnC,CAAC;AAEF,8BAA8B;AAE9B,MAAM,WAAW,OAAO;IACtB,KAAK,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACzB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,aAAa;IAC5B,kBAAkB,EAAE,MAAM,CAAC;IAC3B,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,OAAO,EAAE,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,eAAe;IAC9B,GAAG,EAAE,aAAa,CAAC;IACnB,2CAA2C;IAC3C,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAA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