@autonav/core 1.7.0 → 1.8.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 (44) hide show
  1. package/dist/cli/nav-chat.d.ts.map +1 -1
  2. package/dist/cli/nav-chat.js +3 -1
  3. package/dist/cli/nav-chat.js.map +1 -1
  4. package/dist/conversation/App.d.ts +3 -1
  5. package/dist/conversation/App.d.ts.map +1 -1
  6. package/dist/conversation/App.js +2 -2
  7. package/dist/conversation/App.js.map +1 -1
  8. package/dist/conversation/index.d.ts +2 -0
  9. package/dist/conversation/index.d.ts.map +1 -1
  10. package/dist/conversation/index.js.map +1 -1
  11. package/dist/conversation/prompts.d.ts +1 -1
  12. package/dist/conversation/prompts.d.ts.map +1 -1
  13. package/dist/conversation/prompts.js +42 -1
  14. package/dist/conversation/prompts.js.map +1 -1
  15. package/dist/interview/prompts.d.ts +1 -1
  16. package/dist/interview/prompts.d.ts.map +1 -1
  17. package/dist/interview/prompts.js +9 -0
  18. package/dist/interview/prompts.js.map +1 -1
  19. package/dist/standup/types.d.ts +8 -8
  20. package/package.json +4 -4
  21. package/dist/adapter/claude-adapter.d.ts +0 -189
  22. package/dist/adapter/claude-adapter.d.ts.map +0 -1
  23. package/dist/adapter/claude-adapter.js +0 -541
  24. package/dist/adapter/claude-adapter.js.map +0 -1
  25. package/dist/memento/worker-agent.d.ts +0 -33
  26. package/dist/memento/worker-agent.d.ts.map +0 -1
  27. package/dist/memento/worker-agent.js +0 -93
  28. package/dist/memento/worker-agent.js.map +0 -1
  29. package/dist/skill-generator/index.d.ts +0 -142
  30. package/dist/skill-generator/index.d.ts.map +0 -1
  31. package/dist/skill-generator/index.js +0 -510
  32. package/dist/skill-generator/index.js.map +0 -1
  33. package/dist/templates/.gitignore.template +0 -26
  34. package/dist/templates/CLAUDE-pack.md.template +0 -114
  35. package/dist/templates/CLAUDE.md.template +0 -153
  36. package/dist/templates/README.md.template +0 -174
  37. package/dist/templates/config-pack.json.template +0 -16
  38. package/dist/templates/config.json.template +0 -11
  39. package/dist/templates/index.d.ts +0 -22
  40. package/dist/templates/index.d.ts.map +0 -1
  41. package/dist/templates/index.js +0 -32
  42. package/dist/templates/index.js.map +0 -1
  43. package/dist/templates/plugins.json.template +0 -33
  44. package/dist/templates/system-configuration.md.template +0 -70
@@ -1,541 +0,0 @@
1
- import { query } from "@anthropic-ai/claude-agent-sdk";
2
- import * as fs from "node:fs";
3
- import * as path from "node:path";
4
- import { NavigatorConfigSchema, NavigatorResponseSchema, createAnswerQuestionPrompt, validateResponse, SELF_CONFIG_RULES, } from "@autonav/communication-layer";
5
- import { createPluginManager, PluginConfigFileSchema } from "../plugins/index.js";
6
- import { sanitizeError } from "../plugins/utils/security.js";
7
- import { createSelfConfigMcpServer, createResponseMcpServer, SUBMIT_ANSWER_TOOL } from "../tools/index.js";
8
- /**
9
- * Optional LangSmith integration for tracing Claude Agent SDK calls
10
- */
11
- let langsmithTraceable = null;
12
- let langsmithInitialized = false;
13
- /**
14
- * Lazily initialize LangSmith tracing if enabled via environment variables
15
- */
16
- async function initializeLangSmith() {
17
- if (langsmithInitialized) {
18
- return !!langsmithTraceable;
19
- }
20
- langsmithInitialized = true;
21
- // Check if LangSmith tracing is enabled via environment variable
22
- const tracingEnabled = process.env.LANGSMITH_TRACING === "true";
23
- const hasApiKey = !!process.env.LANGSMITH_API_KEY;
24
- if (!tracingEnabled || !hasApiKey) {
25
- return false;
26
- }
27
- try {
28
- // Dynamically import langsmith (optional peer dependency)
29
- // Using dynamic import with string to avoid TypeScript compile-time resolution
30
- const moduleName = "langsmith/traceable";
31
- const langsmith = await import(moduleName);
32
- langsmithTraceable = langsmith.traceable;
33
- console.log("✅ LangSmith tracing enabled");
34
- if (process.env.LANGSMITH_PROJECT) {
35
- console.log(` Project: ${process.env.LANGSMITH_PROJECT}`);
36
- }
37
- return true;
38
- }
39
- catch (error) {
40
- // langsmith not installed or import failed - continue without tracing
41
- console.warn("⚠️ LangSmith tracing requested but langsmith package not found.");
42
- console.warn(" Install with: npm install langsmith");
43
- return false;
44
- }
45
- }
46
- /**
47
- * Claude Agent SDK Adapter
48
- *
49
- * Bridges Claude Agent SDK to the Communication Layer protocol.
50
- * Loads navigators, executes queries, and validates responses.
51
- *
52
- * @example
53
- * ```typescript
54
- * const adapter = new ClaudeAdapter({
55
- * model: 'claude-sonnet-4-5'
56
- * });
57
- *
58
- * const navigator = adapter.loadNavigator('./my-navigator');
59
- * const response = await adapter.query(navigator, 'How do I deploy?');
60
- * ```
61
- */
62
- export class ClaudeAdapter {
63
- options;
64
- /**
65
- * Create a new Claude Adapter
66
- *
67
- * @param options - Configuration options
68
- */
69
- constructor(options = {}) {
70
- this.options = {
71
- model: options.model || "claude-sonnet-4-5",
72
- maxTurns: options.maxTurns ?? 50, // Default: 50 turns max (prevents runaway execution)
73
- };
74
- }
75
- /**
76
- * Load a navigator from a directory
77
- *
78
- * Reads and validates config.json and CLAUDE.md (or custom instructions file).
79
- * Verifies that the knowledge base directory exists.
80
- * If .claude/plugins.json exists, initializes configured plugins.
81
- *
82
- * @param navigatorPath - Path to the navigator directory
83
- * @returns Loaded navigator with config, system prompt, paths, and optional plugin manager
84
- * @throws {Error} If directory doesn't exist, config is invalid, or required files are missing
85
- *
86
- * @example
87
- * ```typescript
88
- * const adapter = new ClaudeAdapter();
89
- * const navigator = await adapter.loadNavigator('./my-navigator');
90
- * console.log(`Loaded: ${navigator.config.name}`);
91
- * ```
92
- */
93
- async loadNavigator(navigatorPath) {
94
- const configPath = path.join(navigatorPath, "config.json");
95
- // Validate directory exists
96
- if (!fs.existsSync(navigatorPath)) {
97
- throw new Error(`Navigator directory not found: ${navigatorPath}\n` +
98
- `Make sure the path is correct and the navigator exists.`);
99
- }
100
- // Verify it's a directory
101
- const pathStats = fs.statSync(navigatorPath);
102
- if (!pathStats.isDirectory()) {
103
- throw new Error(`Path is not a directory: ${navigatorPath}\n` +
104
- `Navigator path must point to a directory containing config.json`);
105
- }
106
- // Load and validate config.json
107
- if (!fs.existsSync(configPath)) {
108
- throw new Error(`config.json not found in ${navigatorPath}\n` +
109
- `Expected file: ${configPath}\n` +
110
- `Use 'autonav init' to create a new navigator with the required structure.`);
111
- }
112
- const configContent = fs.readFileSync(configPath, "utf-8");
113
- let config;
114
- try {
115
- const configJson = JSON.parse(configContent);
116
- config = NavigatorConfigSchema.parse(configJson);
117
- }
118
- catch (error) {
119
- throw new Error(`Invalid config.json in ${navigatorPath}:\n` +
120
- `${error instanceof Error ? error.message : String(error)}\n\n` +
121
- `Config file must match the NavigatorConfig schema.`);
122
- }
123
- // Load instructions file (CLAUDE.md or custom)
124
- const instructionsFile = config.instructionsPath || "CLAUDE.md";
125
- const actualInstructionsPath = path.join(navigatorPath, instructionsFile);
126
- if (!fs.existsSync(actualInstructionsPath)) {
127
- throw new Error(`Instructions file not found: ${instructionsFile}\n` +
128
- `Expected path: ${actualInstructionsPath}\n` +
129
- `Create a ${instructionsFile} file with the navigator's system prompt.`);
130
- }
131
- const systemPrompt = fs.readFileSync(actualInstructionsPath, "utf-8");
132
- // Validate knowledge base exists
133
- const knowledgeBasePath = path.join(navigatorPath, config.knowledgeBasePath);
134
- if (!fs.existsSync(knowledgeBasePath)) {
135
- throw new Error(`Knowledge base directory not found: ${config.knowledgeBasePath}\n` +
136
- `Expected path: ${knowledgeBasePath}\n` +
137
- `Create the directory and add documentation files for the navigator to search.`);
138
- }
139
- // Verify knowledge base is a directory
140
- const kbStats = fs.statSync(knowledgeBasePath);
141
- if (!kbStats.isDirectory()) {
142
- throw new Error(`Knowledge base path is not a directory: ${config.knowledgeBasePath}\n` +
143
- `The knowledge base must be a directory containing documentation files.`);
144
- }
145
- // Load and initialize plugins if .claude/plugins.json exists
146
- let pluginManager;
147
- const pluginsConfigPath = path.join(navigatorPath, ".claude", "plugins.json");
148
- if (fs.existsSync(pluginsConfigPath)) {
149
- try {
150
- const pluginsConfigContent = fs.readFileSync(pluginsConfigPath, "utf-8");
151
- const pluginsConfig = PluginConfigFileSchema.parse(JSON.parse(pluginsConfigContent));
152
- // Create plugin manager
153
- pluginManager = createPluginManager(pluginsConfigPath);
154
- // Actually initialize the plugins
155
- await pluginManager.loadPlugins(pluginsConfig);
156
- }
157
- catch (error) {
158
- // Sanitize error to prevent credential leakage in logs
159
- const safeMessage = sanitizeError(error instanceof Error ? error.message : String(error));
160
- console.warn(`⚠️ Failed to load plugins: ${safeMessage}`);
161
- console.warn(" Continuing without plugins...");
162
- // Continue without plugins (fail-safe)
163
- pluginManager = undefined;
164
- }
165
- }
166
- return {
167
- config,
168
- systemPrompt,
169
- navigatorPath,
170
- knowledgeBasePath,
171
- pluginManager,
172
- pluginsConfigPath,
173
- };
174
- }
175
- /**
176
- * Execute a query using Claude Agent SDK
177
- *
178
- * Sends the question to Claude with the navigator's system prompt,
179
- * handles tool use via the built-in agentic loop, parses the response,
180
- * and validates it against the knowledge base.
181
- *
182
- * @param navigator - Loaded navigator to query
183
- * @param question - Question to ask
184
- * @param options - Query options (enableSelfConfig, maxTurns)
185
- * @returns Validated navigator response with answer and sources
186
- * @throws {Error} If API call fails, response parsing fails, or validation fails
187
- *
188
- * @example
189
- * ```typescript
190
- * const response = await adapter.query(navigator, 'How do I deploy?');
191
- * console.log(response.answer);
192
- * console.log(`Confidence: ${response.confidence}`);
193
- * console.log(`Sources: ${response.sources.map(s => s.filePath).join(', ')}`);
194
- * ```
195
- */
196
- async query(navigator, question, options = {}) {
197
- // Initialize LangSmith if needed
198
- const tracingEnabled = await initializeLangSmith();
199
- // Wrap the query execution with LangSmith tracing if enabled
200
- if (tracingEnabled && langsmithTraceable) {
201
- const tracedQuery = langsmithTraceable(this.executeQuery.bind(this), {
202
- name: "autonav_query",
203
- run_type: "chain",
204
- metadata: {
205
- navigator: navigator.config.name,
206
- model: this.options.model,
207
- },
208
- });
209
- return tracedQuery(navigator, question, options);
210
- }
211
- // Execute query without tracing
212
- return this.executeQuery(navigator, question, options);
213
- }
214
- /**
215
- * Internal method to execute the query
216
- * Separated to allow for LangSmith tracing wrapper
217
- *
218
- * @internal
219
- */
220
- async executeQuery(navigator, question, options = {}) {
221
- const { enableSelfConfig = true, maxTurns = this.options.maxTurns, // undefined = no limit
222
- } = options;
223
- // Validate inputs
224
- if (!question || question.trim().length === 0) {
225
- throw new Error('Question cannot be empty');
226
- }
227
- // Create the prompt with Agent Identity Protocol
228
- const prompt = createAnswerQuestionPrompt(question, navigator.config.description
229
- ? {
230
- name: navigator.config.name,
231
- description: navigator.config.description,
232
- }
233
- : undefined);
234
- // Build system prompt with self-config rules if enabled
235
- let systemPrompt = navigator.systemPrompt;
236
- if (enableSelfConfig && !systemPrompt.includes("Self-Configuration Capabilities")) {
237
- systemPrompt = `${navigator.systemPrompt}\n\n${SELF_CONFIG_RULES}`;
238
- }
239
- // Set up MCP servers
240
- const mcpServers = {};
241
- // Always add response tools for structured output
242
- mcpServers["autonav-response"] = createResponseMcpServer();
243
- // Add self-config tools if enabled
244
- if (enableSelfConfig && navigator.pluginsConfigPath) {
245
- mcpServers["autonav-self-config"] = createSelfConfigMcpServer(navigator.pluginManager, navigator.pluginsConfigPath);
246
- }
247
- // Debug logging
248
- const debug = process.env.AUTONAV_DEBUG === "1";
249
- if (debug) {
250
- console.error("\n[DEBUG] Query execution starting");
251
- console.error(`[DEBUG] Model: ${this.options.model}`);
252
- console.error(`[DEBUG] Max turns: ${maxTurns ?? 'unlimited (timeout only)'}`);
253
- console.error(`[DEBUG] MCP servers registered: ${Object.keys(mcpServers).join(", ")}`);
254
- console.error(`[DEBUG] System prompt length: ${systemPrompt.length} chars`);
255
- }
256
- try {
257
- // Execute query using Claude Agent SDK
258
- // The SDK handles the agentic loop automatically
259
- const queryIterator = query({
260
- prompt,
261
- options: {
262
- model: this.options.model,
263
- maxTurns,
264
- systemPrompt,
265
- cwd: navigator.navigatorPath,
266
- mcpServers: Object.keys(mcpServers).length > 0 ? mcpServers : undefined,
267
- // Allow the SDK to handle permissions
268
- permissionMode: "bypassPermissions",
269
- },
270
- });
271
- // Collect messages and find the result
272
- let resultMessage;
273
- let lastAssistantText = "";
274
- let submitAnswerInput;
275
- let turnNumber = 0;
276
- let submitAnswerTurn;
277
- for await (const message of queryIterator) {
278
- // Count turns (increment for each assistant message)
279
- if (message.type === "assistant") {
280
- turnNumber++;
281
- if (debug) {
282
- console.error(`\n[DEBUG] Turn ${turnNumber}: Assistant message`);
283
- }
284
- }
285
- // Log tool usage for debugging
286
- if (message.type === "assistant") {
287
- const content = message.message.content;
288
- for (const block of content) {
289
- if (block.type === "tool_use") {
290
- if (debug) {
291
- console.error(`[DEBUG] Tool called: ${block.name}`);
292
- }
293
- // Check if this is the submit_answer tool
294
- // Note: MCP SDK prefixes tool names with server name: "mcp__autonav-response__submit_answer"
295
- if (block.name === SUBMIT_ANSWER_TOOL || block.name.endsWith(`__${SUBMIT_ANSWER_TOOL}`)) {
296
- // Extract the structured response from tool input
297
- submitAnswerInput = block.input;
298
- submitAnswerTurn = turnNumber; // Track which turn submit_answer was called
299
- if (debug) {
300
- console.error(`[DEBUG] submit_answer tool called successfully at turn ${turnNumber}!`);
301
- }
302
- }
303
- }
304
- else if (block.type === "text") {
305
- lastAssistantText = block.text;
306
- if (debug) {
307
- console.error(`[DEBUG] Text response: ${block.text.substring(0, 100)}...`);
308
- }
309
- }
310
- }
311
- }
312
- // Capture the result message
313
- if (message.type === "result") {
314
- resultMessage = message;
315
- if (debug) {
316
- console.error(`\n[DEBUG] Result: ${resultMessage.subtype}`);
317
- console.error(`[DEBUG] Total turns: ${turnNumber}`);
318
- }
319
- }
320
- }
321
- // Log execution metrics (controlled by AUTONAV_METRICS or AUTONAV_DEBUG)
322
- const showMetrics = process.env.AUTONAV_METRICS === "1" || debug;
323
- if (showMetrics && resultMessage) {
324
- console.error(`\n[METRICS] Query completed`);
325
- console.error(`[METRICS] Total turns: ${turnNumber}`);
326
- // Track turns after submit_answer (diagnostic for termination behavior)
327
- if (submitAnswerTurn !== undefined) {
328
- const turnsAfterSubmit = turnNumber - submitAnswerTurn;
329
- console.error(`[METRICS] submit_answer called at turn: ${submitAnswerTurn}`);
330
- console.error(`[METRICS] Turns after submit_answer: ${turnsAfterSubmit}`);
331
- // Warn if Claude continued for many turns after submit_answer
332
- if (turnsAfterSubmit > 3) {
333
- console.error(`[METRICS] ⚠️ Claude continued for ${turnsAfterSubmit} turns after submit_answer`);
334
- }
335
- }
336
- if (resultMessage.duration_ms) {
337
- console.error(`[METRICS] Duration: ${resultMessage.duration_ms}ms`);
338
- }
339
- if (resultMessage.duration_api_ms) {
340
- console.error(`[METRICS] API duration: ${resultMessage.duration_api_ms}ms`);
341
- }
342
- if (resultMessage.total_cost_usd !== undefined) {
343
- console.error(`[METRICS] Cost: $${resultMessage.total_cost_usd.toFixed(4)}`);
344
- }
345
- }
346
- // Check for errors
347
- if (!resultMessage) {
348
- throw new Error("No result message received from Claude Agent SDK");
349
- }
350
- if (resultMessage.subtype !== "success") {
351
- const errorDetails = "errors" in resultMessage
352
- ? resultMessage.errors.join(", ")
353
- : "Unknown error";
354
- throw new Error(`Query failed: ${resultMessage.subtype} - ${errorDetails}`);
355
- }
356
- // Build the navigator response
357
- let navigatorResponse;
358
- if (submitAnswerInput) {
359
- // Use structured output from tool call (preferred)
360
- navigatorResponse = NavigatorResponseSchema.parse({
361
- query: question,
362
- answer: submitAnswerInput.answer,
363
- sources: submitAnswerInput.sources,
364
- confidence: submitAnswerInput.confidence,
365
- confidenceReason: submitAnswerInput.confidenceReason,
366
- outOfDomain: submitAnswerInput.outOfDomain,
367
- });
368
- }
369
- else {
370
- // Fall back to parsing text response (legacy path)
371
- const finalText = resultMessage.result || lastAssistantText;
372
- if (!finalText) {
373
- throw new Error("No response received from Claude. Expected submit_answer tool call or text response.");
374
- }
375
- // Parse the response from text
376
- navigatorResponse = this.parseResponse(finalText, question);
377
- }
378
- // NOTE: Validation removed from adapter - happens in CLI/query-engine layer
379
- // Adapters should be thin wrappers that just return responses
380
- // The calling code (nav-query.ts) handles validation and error display
381
- return navigatorResponse;
382
- }
383
- catch (error) {
384
- if (error instanceof Error) {
385
- throw error;
386
- }
387
- throw new Error(`Failed to query Claude: ${error instanceof Error ? error.message : String(error)}`);
388
- }
389
- }
390
- /**
391
- * Update navigator documentation
392
- *
393
- * Sends an update message to Claude with write permissions enabled.
394
- * Claude can edit files in the knowledge base to document progress,
395
- * add troubleshooting steps, or update existing documentation.
396
- *
397
- * @param navigator - Loaded navigator to update
398
- * @param message - Update message or report
399
- * @param options - Query options (maxTurns)
400
- * @returns Text response from Claude describing what was updated
401
- * @throws {Error} If API call fails or update fails
402
- *
403
- * @example
404
- * ```typescript
405
- * const result = await adapter.update(
406
- * navigator,
407
- * 'I completed feature X. Please document this in the knowledge base.'
408
- * );
409
- * console.log(result);
410
- * ```
411
- */
412
- async update(navigator, message, options = {}) {
413
- const { maxTurns = this.options.maxTurns } = options;
414
- // Validate inputs
415
- if (!message || message.trim().length === 0) {
416
- throw new Error('Update message cannot be empty');
417
- }
418
- // Build system prompt with update-specific instructions
419
- const systemPrompt = `${navigator.systemPrompt}
420
-
421
- # Update Mode
422
-
423
- You are in UPDATE MODE with write permissions enabled. The user wants to update the navigator's documentation.
424
-
425
- When updating documentation:
426
- - Edit existing files or create new files in the knowledge/ directory
427
- - Be specific about what you're changing and why
428
- - Maintain consistent formatting and style
429
- - Cite which files you modified in your response
430
-
431
- Your task: ${message}`;
432
- try {
433
- // Execute update using Claude Agent SDK with write permissions
434
- const queryIterator = query({
435
- prompt: message,
436
- options: {
437
- model: this.options.model,
438
- maxTurns,
439
- systemPrompt,
440
- cwd: navigator.navigatorPath,
441
- // Allow file writes in the navigator directory
442
- permissionMode: "bypassPermissions",
443
- },
444
- });
445
- // Collect the result
446
- let resultMessage;
447
- let lastAssistantText = "";
448
- for await (const message of queryIterator) {
449
- if (message.type === "assistant") {
450
- const content = message.message.content;
451
- for (const block of content) {
452
- if (block.type === "text") {
453
- lastAssistantText = block.text;
454
- }
455
- }
456
- }
457
- if (message.type === "result") {
458
- resultMessage = message;
459
- }
460
- }
461
- // Check for errors
462
- if (!resultMessage) {
463
- throw new Error("No result message received from Claude Agent SDK");
464
- }
465
- if (resultMessage.subtype !== "success") {
466
- const errorDetails = "errors" in resultMessage
467
- ? resultMessage.errors.join(", ")
468
- : "Unknown error";
469
- throw new Error(`Update failed: ${resultMessage.subtype} - ${errorDetails}`);
470
- }
471
- // Return the final response text
472
- return resultMessage.result || lastAssistantText || "Update completed (no response text)";
473
- }
474
- catch (error) {
475
- if (error instanceof Error) {
476
- throw error;
477
- }
478
- throw new Error(`Failed to update navigator: ${error instanceof Error ? error.message : String(error)}`);
479
- }
480
- }
481
- /**
482
- * Parse Claude's response into a NavigatorResponse
483
- *
484
- * Extracts JSON from the response text (either from code blocks or raw JSON)
485
- * and validates it against the NavigatorResponseSchema.
486
- *
487
- * @param rawResponse - Raw text response from Claude
488
- * @param query - Original query (used to populate missing query field)
489
- * @returns Parsed and validated NavigatorResponse
490
- * @throws {Error} If JSON cannot be extracted or schema validation fails
491
- *
492
- * @internal
493
- */
494
- parseResponse(rawResponse, query) {
495
- // Try to extract JSON from code blocks
496
- const jsonMatch = rawResponse.match(/```json\s*([\s\S]*?)\s*```/);
497
- let jsonText;
498
- if (jsonMatch && jsonMatch[1]) {
499
- jsonText = jsonMatch[1];
500
- }
501
- else {
502
- // Try to find JSON object in the text
503
- const objectMatch = rawResponse.match(/\{[\s\S]*\}/);
504
- if (objectMatch && objectMatch[0]) {
505
- jsonText = objectMatch[0];
506
- }
507
- else {
508
- throw new Error("Could not find JSON in Claude's response. Response should contain a JSON object.");
509
- }
510
- }
511
- try {
512
- const parsed = JSON.parse(jsonText);
513
- // Ensure query field is set
514
- if (!parsed.query) {
515
- parsed.query = query;
516
- }
517
- return NavigatorResponseSchema.parse(parsed);
518
- }
519
- catch (error) {
520
- throw new Error(`Failed to parse response: ${error instanceof Error ? error.message : String(error)}\n\nRaw response:\n${rawResponse}`);
521
- }
522
- }
523
- /**
524
- * Validate a NavigatorResponse
525
- *
526
- * Runs comprehensive validation including:
527
- * - Source file existence checks
528
- * - Hallucination pattern detection
529
- * - Confidence level validation
530
- *
531
- * @param response - Navigator response to validate
532
- * @param knowledgeBasePath - Path to knowledge base directory
533
- * @returns Validation result with errors and warnings
534
- *
535
- * @internal
536
- */
537
- validate(response, knowledgeBasePath) {
538
- return validateResponse(response, knowledgeBasePath);
539
- }
540
- }
541
- //# sourceMappingURL=claude-adapter.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"claude-adapter.js","sourceRoot":"","sources":["../../src/adapter/claude-adapter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAyB,MAAM,gCAAgC,CAAC;AAC9E,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EAEL,qBAAqB,EAErB,uBAAuB,EACvB,0BAA0B,EAC1B,gBAAgB,EAChB,iBAAiB,GAElB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,mBAAmB,EAAiB,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AACjG,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAC7D,OAAO,EAAE,yBAAyB,EAAE,uBAAuB,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAE3G;;GAEG;AACH,IAAI,kBAAkB,GAAQ,IAAI,CAAC;AACnC,IAAI,oBAAoB,GAAG,KAAK,CAAC;AAEjC;;GAEG;AACH,KAAK,UAAU,mBAAmB;IAChC,IAAI,oBAAoB,EAAE,CAAC;QACzB,OAAO,CAAC,CAAC,kBAAkB,CAAC;IAC9B,CAAC;IAED,oBAAoB,GAAG,IAAI,CAAC;IAE5B,iEAAiE;IACjE,MAAM,cAAc,GAAG,OAAO,CAAC,GAAG,CAAC,iBAAiB,KAAK,MAAM,CAAC;IAChE,MAAM,SAAS,GAAG,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAA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,QAA2B,EAC3B,iBAAyB;QAEzB,OAAO,gBAAgB,CAAC,QAAQ,EAAE,iBAAiB,CAAC,CAAC;IACvD,CAAC;CACF"}
@@ -1,33 +0,0 @@
1
- /**
2
- * Worker Agent for Memento Loop
3
- *
4
- * Executes implementation plans via the harness adapter.
5
- */
6
- import type { ImplementationPlan, WorkerResult } from "./types.js";
7
- import { type Harness } from "../harness/index.js";
8
- /**
9
- * Minimal context for worker (no persisted state)
10
- */
11
- interface WorkerContext {
12
- codeDirectory: string;
13
- task: string;
14
- }
15
- /**
16
- * Options for worker agent execution
17
- */
18
- export interface WorkerAgentOptions {
19
- /** Show detailed logging */
20
- verbose?: boolean;
21
- /** Model to use (defaults to claude-sonnet-4-5) */
22
- model?: string;
23
- /** Maximum turns for worker agent */
24
- maxTurns?: number;
25
- /** Harness to use (defaults to ClaudeCodeHarness) */
26
- harness?: Harness;
27
- }
28
- /**
29
- * Run the worker agent to implement a plan
30
- */
31
- export declare function runWorkerAgent(context: WorkerContext, plan: ImplementationPlan, options?: WorkerAgentOptions): Promise<WorkerResult>;
32
- export {};
33
- //# sourceMappingURL=worker-agent.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"worker-agent.d.ts","sourceRoot":"","sources":["../../src/memento/worker-agent.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAEnE,OAAO,EAAE,KAAK,OAAO,EAAqB,MAAM,qBAAqB,CAAC;AAEtE;;GAEG;AACH,UAAU,aAAa;IACrB,aAAa,EAAE,MAAM,CAAC;IACtB,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,4BAA4B;IAC5B,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB,mDAAmD;IACnD,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf,qCAAqC;IACrC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB,qDAAqD;IACrD,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED;;GAEG;AACH,wBAAsB,cAAc,CAClC,OAAO,EAAE,aAAa,EACtB,IAAI,EAAE,kBAAkB,EACxB,OAAO,GAAE,kBAAuB,GAC/B,OAAO,CAAC,YAAY,CAAC,CAoGvB"}