@autonav/core 1.1.2 → 1.1.4

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.
@@ -9,6 +9,7 @@ import { Box, Text, useApp, useInput } from "ink";
9
9
  import TextInput from "ink-text-input";
10
10
  import { query } from "@anthropic-ai/claude-agent-sdk";
11
11
  import { getInterviewSystemPrompt, parseNavigatorConfig, } from "./prompts.js";
12
+ import { saveProgress, clearProgress } from "./progress.js";
12
13
  // Check if debug mode is enabled
13
14
  const DEBUG = process.env.AUTONAV_DEBUG === "1" || process.env.DEBUG === "1";
14
15
  // Model to use for interview
@@ -18,15 +19,17 @@ function debugLog(...args) {
18
19
  console.error("[DEBUG]", ...args);
19
20
  }
20
21
  }
21
- export function InterviewApp({ name, packContext, onComplete }) {
22
- // Get the system prompt, customized for pack if provided
23
- const systemPrompt = getInterviewSystemPrompt(packContext);
24
- const [messages, setMessages] = useState([]);
22
+ export function InterviewApp({ name, navigatorPath, packContext, analysisContext, initialMessages, onComplete, }) {
23
+ // Get the system prompt, customized for pack or analysis if provided
24
+ const systemPrompt = getInterviewSystemPrompt(packContext, analysisContext);
25
+ const [messages, setMessages] = useState(initialMessages || []);
25
26
  const [input, setInput] = useState("");
26
27
  const [isLoading, setIsLoading] = useState(true);
27
28
  const [error, setError] = useState(null);
29
+ const [showHint, setShowHint] = useState(false);
28
30
  const queryRef = useRef(null);
29
31
  const completedRef = useRef(false);
32
+ const consecutiveDone = useRef(0);
30
33
  const { exit } = useApp();
31
34
  // Process messages from Claude
32
35
  const processResponse = useCallback(async () => {
@@ -45,10 +48,28 @@ export function InterviewApp({ name, packContext, onComplete }) {
45
48
  const text = textBlocks.map((b) => b.text).join("\n");
46
49
  if (text) {
47
50
  fullText = text;
48
- setMessages((prev) => [
49
- ...prev,
50
- { role: "assistant", content: text },
51
- ]);
51
+ setMessages((prev) => {
52
+ const newMessages = [
53
+ ...prev,
54
+ { role: "assistant", content: text },
55
+ ];
56
+ // Save progress after assistant message
57
+ try {
58
+ const progress = {
59
+ navigatorName: name,
60
+ messages: newMessages,
61
+ packContext,
62
+ analysisContext,
63
+ lastSaved: new Date().toISOString(),
64
+ };
65
+ saveProgress(navigatorPath, progress);
66
+ debugLog("Progress saved after assistant message:", newMessages.length, "messages");
67
+ }
68
+ catch (err) {
69
+ debugLog("Failed to save progress:", err);
70
+ }
71
+ return newMessages;
72
+ });
52
73
  }
53
74
  }
54
75
  else if (message.type === "result") {
@@ -59,13 +80,29 @@ export function InterviewApp({ name, packContext, onComplete }) {
59
80
  }
60
81
  // Check if the response contains a navigator config
61
82
  if (fullText) {
83
+ debugLog("Checking for navigator config in response...");
62
84
  const config = parseNavigatorConfig(fullText);
63
85
  if (config) {
64
- debugLog("Interview complete, config parsed");
86
+ debugLog("Interview complete! Config parsed successfully");
87
+ debugLog(" - purpose:", config.purpose?.substring(0, 50) + "...");
88
+ debugLog(" - Calling onComplete to exit...");
65
89
  completedRef.current = true;
90
+ // Clear progress file on successful completion
91
+ try {
92
+ clearProgress(navigatorPath);
93
+ debugLog("Progress cleared");
94
+ }
95
+ catch (err) {
96
+ debugLog("Failed to clear progress:", err);
97
+ }
66
98
  onComplete(config);
99
+ debugLog("onComplete called, should be exiting now");
67
100
  return;
68
101
  }
102
+ else {
103
+ debugLog("✗ No valid config found in response (or validation failed)");
104
+ debugLog(" Response preview:", fullText.substring(0, 200));
105
+ }
69
106
  }
70
107
  setIsLoading(false);
71
108
  }
@@ -74,14 +111,24 @@ export function InterviewApp({ name, packContext, onComplete }) {
74
111
  setError(err instanceof Error ? err.message : "Error communicating with Claude");
75
112
  setIsLoading(false);
76
113
  }
77
- }, [onComplete]);
114
+ }, [onComplete, name, navigatorPath, packContext, analysisContext]);
78
115
  // Initialize query and send first message
79
116
  useEffect(() => {
80
117
  const initQuery = async () => {
81
118
  try {
82
119
  debugLog("Creating query with model:", INTERVIEW_MODEL);
83
- // Create initial prompt
84
- const initialMessage = `I want to create a navigator called "${name}".`;
120
+ // Build initial message with analysis context if available
121
+ let initialMessage = `I want to create a navigator called "${name}".`;
122
+ if (analysisContext) {
123
+ initialMessage += `\n\nI've already analyzed the repository and found:\n`;
124
+ initialMessage += `- Purpose: ${analysisContext.purpose}\n`;
125
+ initialMessage += `- Scope: ${analysisContext.scope}\n`;
126
+ initialMessage += `- Audience: ${analysisContext.audience}\n`;
127
+ if (analysisContext.suggestedKnowledgePaths.length > 0) {
128
+ initialMessage += `- Knowledge paths: ${analysisContext.suggestedKnowledgePaths.join(", ")}\n`;
129
+ }
130
+ initialMessage += `\nI'd like to refine these details before creating the navigator.`;
131
+ }
85
132
  debugLog("Initial message:", initialMessage);
86
133
  // Create query with system prompt
87
134
  const queryInstance = query({
@@ -107,21 +154,75 @@ export function InterviewApp({ name, packContext, onComplete }) {
107
154
  };
108
155
  initQuery();
109
156
  }, [name, processResponse]);
157
+ // Show hint after 5+ user messages
158
+ useEffect(() => {
159
+ const userMessageCount = messages.filter(m => m.role === 'user').length;
160
+ if (userMessageCount >= 5 && !showHint) {
161
+ setShowHint(true);
162
+ }
163
+ }, [messages, showHint]);
110
164
  // Handle user input submission
111
165
  const handleSubmit = useCallback(async (value) => {
112
166
  if (!value.trim() || isLoading || completedRef.current)
113
167
  return;
168
+ // Detect 'done' command - case-insensitive, trimmed
169
+ const normalizedInput = value.trim().toLowerCase();
170
+ const isDoneCommand = ['done', 'finish', 'ready', 'create'].includes(normalizedInput);
114
171
  setInput("");
115
- setMessages((prev) => [...prev, { role: "user", content: value }]);
172
+ const newMessages = [...messages, { role: "user", content: value }];
173
+ setMessages(newMessages);
116
174
  setIsLoading(true);
175
+ // Update consecutive done tracking
176
+ if (isDoneCommand) {
177
+ consecutiveDone.current += 1;
178
+ }
179
+ else {
180
+ consecutiveDone.current = 0;
181
+ }
182
+ // Save progress after user input
183
+ try {
184
+ const progress = {
185
+ navigatorName: name,
186
+ messages: newMessages,
187
+ packContext,
188
+ analysisContext,
189
+ lastSaved: new Date().toISOString(),
190
+ };
191
+ saveProgress(navigatorPath, progress);
192
+ debugLog("Progress saved after user input:", newMessages.length, "messages");
193
+ }
194
+ catch (err) {
195
+ debugLog("Failed to save progress:", err);
196
+ // Don't block on save failures
197
+ }
117
198
  try {
118
199
  debugLog("Sending user message:", value);
119
- // Create a new query for each turn
120
- // Include conversation history in the prompt with clear separation
200
+ // Build conversation history
121
201
  const conversationHistory = messages
122
202
  .map((m) => `<${m.role}>\n${m.content}\n</${m.role}>`)
123
203
  .join("\n\n");
124
- const fullPrompt = `<conversation_history>
204
+ // Modify prompt based on 'done' command
205
+ let fullPrompt;
206
+ if (isDoneCommand) {
207
+ // User wants to finish - FORCE config generation
208
+ const urgency = consecutiveDone.current > 1
209
+ ? "The user has REPEATEDLY indicated they are ready. You MUST generate the configuration NOW, even if it's basic or has gaps. Work with what you have."
210
+ : "The user has indicated they are ready to create the navigator by typing \"" + value + "\".";
211
+ fullPrompt = `<conversation_history>
212
+ ${conversationHistory}
213
+ </conversation_history>
214
+
215
+ ${urgency}
216
+
217
+ CRITICAL: You MUST now generate the JSON configuration based on the information gathered so far. Even if you would prefer more details, work with what you have.
218
+
219
+ Output ONLY the JSON configuration block wrapped in \`\`\`json and \`\`\` markers. DO NOT add any text before or after the JSON block. DO NOT provide explanations, summaries, or ask for confirmation. The JSON itself is your complete and final response.
220
+
221
+ If you truly don't have enough information to create a basic configuration (e.g., only 1-2 exchanges with no meaningful detail), explain what critical information is missing and ask ONE final clarifying question. Otherwise, generate ONLY the JSON configuration block and nothing else.`;
222
+ }
223
+ else {
224
+ // Normal conversation flow
225
+ fullPrompt = `<conversation_history>
125
226
  ${conversationHistory}
126
227
  </conversation_history>
127
228
 
@@ -130,7 +231,8 @@ The user just responded with:
130
231
  ${value}
131
232
  </user_message>
132
233
 
133
- Continue the interview by responding to their message. Ask your next question OR if you have enough information, output the JSON configuration. Do NOT simulate user responses - only provide YOUR response as the assistant.`;
234
+ Continue the interview by responding to their message. Remember: after gathering enough information (usually 4-6 exchanges), you should signal that you're ready to create the navigator and wait for the user to type 'done'. Do NOT output the JSON configuration until the user explicitly says they're ready. Do NOT simulate user responses - only provide YOUR response as the assistant.`;
235
+ }
134
236
  const queryInstance = query({
135
237
  prompt: fullPrompt,
136
238
  options: {
@@ -147,13 +249,13 @@ Continue the interview by responding to their message. Ask your next question OR
147
249
  setError(err instanceof Error ? err.message : "Failed to send message");
148
250
  setIsLoading(false);
149
251
  }
150
- }, [isLoading, messages, processResponse]);
252
+ }, [isLoading, messages, systemPrompt, processResponse, name, navigatorPath, packContext, analysisContext]);
151
253
  // Handle Ctrl+C to exit
152
254
  useInput((input, key) => {
153
255
  if (key.ctrl && input === "c") {
154
256
  exit();
155
257
  }
156
258
  });
157
- return (_jsxs(Box, { flexDirection: "column", padding: 1, children: [_jsx(Box, { marginBottom: 1, children: _jsxs(Text, { bold: true, color: "cyan", children: ["\uD83E\uDDED Creating navigator: ", name] }) }), _jsx(Box, { marginBottom: 1, children: _jsx(Text, { color: "gray", children: "Answer the questions below. Press Ctrl+C to cancel." }) }), messages.map((msg, i) => (_jsx(Box, { marginBottom: 1, flexDirection: "column", children: msg.role === "user" ? (_jsxs(Box, { children: [_jsx(Text, { color: "green", children: "› " }), _jsx(Text, { children: msg.content })] })) : (_jsx(Box, { children: _jsx(Text, { color: "white", children: msg.content }) })) }, i))), error && (_jsx(Box, { marginBottom: 1, children: _jsxs(Text, { color: "red", children: ["Error: ", error] }) })), isLoading && (_jsx(Box, { marginBottom: 1, children: _jsx(Text, { color: "gray", children: "Thinking..." }) })), !isLoading && !error && (_jsxs(Box, { children: [_jsx(Text, { color: "green", children: "› " }), _jsx(TextInput, { value: input, onChange: setInput, onSubmit: handleSubmit, placeholder: "Type your response..." })] }))] }));
259
+ return (_jsxs(Box, { flexDirection: "column", padding: 1, children: [_jsx(Box, { marginBottom: 1, children: _jsxs(Text, { bold: true, color: "cyan", children: ["\uD83E\uDDED Creating navigator: ", name] }) }), _jsx(Box, { marginBottom: 1, children: _jsx(Text, { color: "gray", children: "Answer the questions below. Press Ctrl+C to cancel." }) }), messages.map((msg, i) => (_jsx(Box, { marginBottom: 1, flexDirection: "column", children: msg.role === "user" ? (_jsxs(Box, { children: [_jsx(Text, { color: "green", children: "› " }), _jsx(Text, { children: msg.content })] })) : (_jsx(Box, { children: _jsx(Text, { color: "white", children: msg.content }) })) }, i))), error && (_jsx(Box, { marginBottom: 1, children: _jsxs(Text, { color: "red", children: ["Error: ", error] }) })), isLoading && (_jsx(Box, { marginBottom: 1, children: _jsx(Text, { color: "gray", children: "Thinking..." }) })), showHint && !isLoading && !error && (_jsx(Box, { marginBottom: 1, children: _jsx(Text, { color: "yellow", children: "\uD83D\uDCA1 Tip: Type 'done' when ready to create your navigator" }) })), !isLoading && !error && (_jsxs(Box, { children: [_jsx(Text, { color: "green", children: "› " }), _jsx(TextInput, { value: input, onChange: setInput, onSubmit: handleSubmit, placeholder: "Type your response..." })] }))] }));
158
260
  }
159
261
  //# sourceMappingURL=App.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"App.js","sourceRoot":"","sources":["../../src/interview/App.tsx"],"names":[],"mappings":";AAAA;;;;GAIG;AAEH,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACjE,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,KAAK,CAAC;AAClD,OAAO,SAAS,MAAM,gBAAgB,CAAC;AACvC,OAAO,EAAE,KAAK,EAAc,MAAM,gCAAgC,CAAC;AACnE,OAAO,EACL,wBAAwB,EACxB,oBAAoB,GAGrB,MAAM,cAAc,CAAC;AAEtB,iCAAiC;AACjC,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,aAAa,KAAK,GAAG,IAAI,OAAO,CAAC,GAAG,CAAC,KAAK,KAAK,GAAG,CAAC;AAE7E,6BAA6B;AAC7B,MAAM,eAAe,GAAG,mBAAmB,CAAC;AAE5C,SAAS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EAAE,aAAa,EAAC,QAAQ,YACjD,GAAG,CAAC,IAAI,KAAK,MAAM,CAAC,CAAC,CAAC,CACrB,MAAC,GAAG,eACF,KAAC,IAAI,IAAC,KAAK,EAAC,OAAO,YAAE,IAAI,GAAQ,EACjC,KAAC,IAAI,cAAE,GAAG,CAAC,OAAO,GAAQ,IACtB,CACP,CAAC,CAAC,CAAC,CACF,KAAC,GAAG,cACF,KAAC,IAAI,IAAC,KAAK,EAAC,OAAO,YAAE,GAAG,CAAC,OAAO,GAAQ,GACpC,CACP,IAVO,CAAC,CAWL,CACP,CAAC,EAGD,KAAK,IAAI,CACR,KAAC,GAAG,IAAC,YAAY,EAAE,CAAC,YAClB,MAAC,IAAI,IAAC,KAAK,EAAC,KAAK,wBAAS,KAAK,IAAQ,GACnC,CACP,EAGA,SAAS,IAAI,CACZ,KAAC,GAAG,IAAC,YAAY,EAAE,CAAC,YAClB,KAAC,IAAI,IAAC,KAAK,EAAC,MAAM,4BAAmB,GACjC,CACP,EAGA,QAAQ,IAAI,CAAC,SAAS,IAAI,CAAC,KAAK,IAAI,CACnC,KAAC,GAAG,IAAC,YAAY,EAAE,CAAC,YAClB,KAAC,IAAI,IAAC,KAAK,EAAC,QAAQ,kFAA+D,GAC/E,CACP,EAGA,CAAC,SAAS,IAAI,CAAC,KAAK,IAAI,CACvB,MAAC,GAAG,eACF,KAAC,IAAI,IAAC,KAAK,EAAC,OAAO,YAAE,IAAI,GAAQ,EACjC,KAAC,SAAS,IACR,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,YAAY,EACtB,WAAW,EAAC,uBAAuB,GACnC,IACE,CACP,IACG,CACP,CAAC;AACJ,CAAC"}
@@ -5,14 +5,24 @@
5
5
  * conversational interface for creating navigators.
6
6
  */
7
7
  import type { NavigatorConfig, PackContext } from "./prompts.js";
8
+ import type { AnalysisResult } from "../repo-analyzer/index.js";
9
+ import type { InterviewProgress } from "./progress.js";
8
10
  export type { NavigatorConfig, PackContext } from "./prompts.js";
11
+ export type { InterviewProgress } from "./progress.js";
9
12
  export { getInterviewSystemPrompt } from "./prompts.js";
13
+ export { hasProgress, loadProgress, clearProgress, getProgressSummary, } from "./progress.js";
10
14
  /**
11
15
  * Options for the interview TUI
12
16
  */
13
17
  export interface InterviewOptions {
18
+ /** Path to the navigator directory */
19
+ navigatorPath: string;
14
20
  /** Optional pack context to customize the interview */
15
21
  packContext?: PackContext;
22
+ /** Optional analysis context from repository scan */
23
+ analysisContext?: AnalysisResult;
24
+ /** Optional saved progress to resume from */
25
+ savedProgress?: InterviewProgress;
16
26
  }
17
27
  /**
18
28
  * Check if the current environment supports interactive TTY input
@@ -22,9 +32,9 @@ export declare function isInteractiveTerminal(): boolean;
22
32
  * Run the interactive interview TUI
23
33
  *
24
34
  * @param name - Name of the navigator to create
25
- * @param options - Optional interview options (pack context, etc.)
35
+ * @param options - Interview options (navigatorPath required, pack context, saved progress optional)
26
36
  * @returns Promise that resolves with the navigator configuration
27
37
  * @throws Error if terminal doesn't support interactive mode
28
38
  */
29
- export declare function runInterviewTUI(name: string, options?: InterviewOptions): Promise<NavigatorConfig>;
39
+ export declare function runInterviewTUI(name: string, options: InterviewOptions): Promise<NavigatorConfig>;
30
40
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/interview/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH,OAAO,KAAK,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAEjE,YAAY,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AACjE,OAAO,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAC;AAExD;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,uDAAuD;IACvD,WAAW,CAAC,EAAE,WAAW,CAAC;CAC3B;AAED;;GAEG;AACH,wBAAgB,qBAAqB,IAAI,OAAO,CAM/C;AAED;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAC7B,IAAI,EAAE,MAAM,EACZ,OAAO,CAAC,EAAE,gBAAgB,GACzB,OAAO,CAAC,eAAe,CAAC,CAgC1B"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/interview/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH,OAAO,KAAK,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AACjE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAEvD,YAAY,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AACjE,YAAY,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAC;AACxD,OAAO,EACL,WAAW,EACX,YAAY,EACZ,aAAa,EACb,kBAAkB,GACnB,MAAM,eAAe,CAAC;AAEvB;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,sCAAsC;IACtC,aAAa,EAAE,MAAM,CAAC;IACtB,uDAAuD;IACvD,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,qDAAqD;IACrD,eAAe,CAAC,EAAE,cAAc,CAAC;IACjC,6CAA6C;IAC7C,aAAa,CAAC,EAAE,iBAAiB,CAAC;CACnC;AAED;;GAEG;AACH,wBAAgB,qBAAqB,IAAI,OAAO,CAM/C;AAED;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAC7B,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,gBAAgB,GACxB,OAAO,CAAC,eAAe,CAAC,CAyC1B"}
@@ -8,6 +8,7 @@ import React from "react";
8
8
  import { render } from "ink";
9
9
  import { InterviewApp } from "./App.js";
10
10
  export { getInterviewSystemPrompt } from "./prompts.js";
11
+ export { hasProgress, loadProgress, clearProgress, getProgressSummary, } from "./progress.js";
11
12
  /**
12
13
  * Check if the current environment supports interactive TTY input
13
14
  */
@@ -20,7 +21,7 @@ export function isInteractiveTerminal() {
20
21
  * Run the interactive interview TUI
21
22
  *
22
23
  * @param name - Name of the navigator to create
23
- * @param options - Optional interview options (pack context, etc.)
24
+ * @param options - Interview options (navigatorPath required, pack context, saved progress optional)
24
25
  * @returns Promise that resolves with the navigator configuration
25
26
  * @throws Error if terminal doesn't support interactive mode
26
27
  */
@@ -32,13 +33,22 @@ export function runInterviewTUI(name, options) {
32
33
  return new Promise((resolve, reject) => {
33
34
  let completed = false;
34
35
  const handleComplete = (config) => {
36
+ if (process.env.AUTONAV_DEBUG === "1" || process.env.DEBUG === "1") {
37
+ console.error("[DEBUG] handleComplete called - unmounting Ink instance");
38
+ }
35
39
  completed = true;
36
40
  instance.unmount();
41
+ if (process.env.AUTONAV_DEBUG === "1" || process.env.DEBUG === "1") {
42
+ console.error("[DEBUG] Ink unmounted, resolving promise");
43
+ }
37
44
  resolve(config);
38
45
  };
39
46
  const instance = render(React.createElement(InterviewApp, {
40
47
  name,
41
- packContext: options?.packContext,
48
+ navigatorPath: options.navigatorPath,
49
+ packContext: options.packContext,
50
+ analysisContext: options.analysisContext,
51
+ initialMessages: options.savedProgress?.messages,
42
52
  onComplete: handleComplete,
43
53
  }));
44
54
  // Handle unmount without completion (user cancelled)
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/interview/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,MAAM,EAAE,MAAM,KAAK,CAAC;AAC7B,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAIxC,OAAO,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAC;AAUxD;;GAEG;AACH,MAAM,UAAU,qBAAqB;IACnC,OAAO,OAAO,CACZ,OAAO,CAAC,KAAK,CAAC,KAAK;QACnB,OAAO,CAAC,MAA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YACJ,aAAa,EAAE,OAAO,CAAC,aAAa;YACpC,WAAW,EAAE,OAAO,CAAC,WAAW;YAChC,eAAe,EAAE,OAAO,CAAC,eAAe;YACxC,eAAe,EAAE,OAAO,CAAC,aAAa,EAAE,QAAQ;YAChD,UAAU,EAAE,cAAc;SAC3B,CAAC,CACH,CAAC;QAEF,qDAAqD;QACrD,QAAQ,CAAC,aAAa,EAAE,CAAC,IAAI,CAAC,GAAG,EAAE;YACjC,IAAI,CAAC,SAAS,EAAE,CAAC;gBACf,MAAM,CAAC,IAAI,KAAK,CAAC,6BAA6B,CAAC,CAAC,CAAC;YACnD,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,55 @@
1
+ /**
2
+ * Interview progress persistence
3
+ *
4
+ * Saves interview state after each user reply to prevent data loss on failure.
5
+ */
6
+ export interface InterviewProgress {
7
+ /** Navigator name */
8
+ navigatorName: string;
9
+ /** Conversation messages */
10
+ messages: Array<{
11
+ role: "user" | "assistant";
12
+ content: string;
13
+ }>;
14
+ /** Pack context if provided */
15
+ packContext?: {
16
+ packName: string;
17
+ packVersion: string;
18
+ initGuide?: string;
19
+ };
20
+ /** Analysis context if provided */
21
+ analysisContext?: {
22
+ purpose: string;
23
+ scope: string;
24
+ audience: string;
25
+ suggestedKnowledgePaths: string[];
26
+ confidence: number;
27
+ };
28
+ /** Timestamp of last save */
29
+ lastSaved: string;
30
+ }
31
+ /**
32
+ * Get the path to the progress file for a navigator
33
+ */
34
+ export declare function getProgressPath(navigatorPath: string): string;
35
+ /**
36
+ * Check if a progress file exists for a navigator
37
+ */
38
+ export declare function hasProgress(navigatorPath: string): boolean;
39
+ /**
40
+ * Save interview progress to disk
41
+ */
42
+ export declare function saveProgress(navigatorPath: string, progress: InterviewProgress): void;
43
+ /**
44
+ * Load interview progress from disk
45
+ */
46
+ export declare function loadProgress(navigatorPath: string): InterviewProgress | null;
47
+ /**
48
+ * Delete progress file after successful completion
49
+ */
50
+ export declare function clearProgress(navigatorPath: string): void;
51
+ /**
52
+ * Get a summary of saved progress for display to user
53
+ */
54
+ export declare function getProgressSummary(progress: InterviewProgress): string;
55
+ //# sourceMappingURL=progress.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"progress.d.ts","sourceRoot":"","sources":["../../src/interview/progress.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH,MAAM,WAAW,iBAAiB;IAChC,qBAAqB;IACrB,aAAa,EAAE,MAAM,CAAC;IACtB,4BAA4B;IAC5B,QAAQ,EAAE,KAAK,CAAC;QACd,IAAI,EAAE,MAAM,GAAG,WAAW,CAAC;QAC3B,OAAO,EAAE,MAAM,CAAC;KACjB,CAAC,CAAC;IACH,+BAA+B;IAC/B,WAAW,CAAC,EAAE;QACZ,QAAQ,EAAE,MAAM,CAAC;QACjB,WAAW,EAAE,MAAM,CAAC;QACpB,SAAS,CAAC,EAAE,MAAM,CAAC;KACpB,CAAC;IACF,mCAAmC;IACnC,eAAe,CAAC,EAAE;QAChB,OAAO,EAAE,MAAM,CAAC;QAChB,KAAK,EAAE,MAAM,CAAC;QACd,QAAQ,EAAE,MAAM,CAAC;QACjB,uBAAuB,EAAE,MAAM,EAAE,CAAC;QAClC,UAAU,EAAE,MAAM,CAAC;KACpB,CAAC;IACF,6BAA6B;IAC7B,SAAS,EAAE,MAAM,CAAC;CACnB;AAID;;GAEG;AACH,wBAAgB,eAAe,CAAC,aAAa,EAAE,MAAM,GAAG,MAAM,CAE7D;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO,CAE1D;AAED;;GAEG;AACH,wBAAgB,YAAY,CAC1B,aAAa,EAAE,MAAM,EACrB,QAAQ,EAAE,iBAAiB,GAC1B,IAAI,CAiBN;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,aAAa,EAAE,MAAM,GAAG,iBAAiB,GAAG,IAAI,CAiB5E;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,aAAa,EAAE,MAAM,GAAG,IAAI,CAMzD;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,iBAAiB,GAAG,MAAM,CAMtE"}
@@ -0,0 +1,88 @@
1
+ /**
2
+ * Interview progress persistence
3
+ *
4
+ * Saves interview state after each user reply to prevent data loss on failure.
5
+ */
6
+ import * as fs from "node:fs";
7
+ import * as path from "node:path";
8
+ const PROGRESS_FILENAME = ".autonav-init-progress.json";
9
+ /**
10
+ * Get the path to the progress file for a navigator
11
+ */
12
+ export function getProgressPath(navigatorPath) {
13
+ return path.join(navigatorPath, PROGRESS_FILENAME);
14
+ }
15
+ /**
16
+ * Check if a progress file exists for a navigator
17
+ */
18
+ export function hasProgress(navigatorPath) {
19
+ return fs.existsSync(getProgressPath(navigatorPath));
20
+ }
21
+ /**
22
+ * Save interview progress to disk
23
+ */
24
+ export function saveProgress(navigatorPath, progress) {
25
+ const progressPath = getProgressPath(navigatorPath);
26
+ // Ensure directory exists
27
+ fs.mkdirSync(navigatorPath, { recursive: true });
28
+ // Save with pretty formatting for readability
29
+ const content = JSON.stringify({
30
+ ...progress,
31
+ lastSaved: new Date().toISOString(),
32
+ }, null, 2);
33
+ fs.writeFileSync(progressPath, content, "utf-8");
34
+ }
35
+ /**
36
+ * Load interview progress from disk
37
+ */
38
+ export function loadProgress(navigatorPath) {
39
+ const progressPath = getProgressPath(navigatorPath);
40
+ if (!fs.existsSync(progressPath)) {
41
+ return null;
42
+ }
43
+ try {
44
+ const content = fs.readFileSync(progressPath, "utf-8");
45
+ return JSON.parse(content);
46
+ }
47
+ catch (error) {
48
+ // If parsing fails, return null (corrupted file)
49
+ console.warn(`Warning: Could not parse progress file: ${error instanceof Error ? error.message : String(error)}`);
50
+ return null;
51
+ }
52
+ }
53
+ /**
54
+ * Delete progress file after successful completion
55
+ */
56
+ export function clearProgress(navigatorPath) {
57
+ const progressPath = getProgressPath(navigatorPath);
58
+ if (fs.existsSync(progressPath)) {
59
+ fs.unlinkSync(progressPath);
60
+ }
61
+ }
62
+ /**
63
+ * Get a summary of saved progress for display to user
64
+ */
65
+ export function getProgressSummary(progress) {
66
+ const messageCount = progress.messages.length;
67
+ const lastSaved = new Date(progress.lastSaved);
68
+ const timeAgo = getTimeAgo(lastSaved);
69
+ return `Found saved progress from ${timeAgo} (${messageCount} message${messageCount === 1 ? "" : "s"})`;
70
+ }
71
+ /**
72
+ * Helper to get human-readable time difference
73
+ */
74
+ function getTimeAgo(date) {
75
+ const now = new Date();
76
+ const diffMs = now.getTime() - date.getTime();
77
+ const diffMins = Math.floor(diffMs / 60000);
78
+ const diffHours = Math.floor(diffMins / 60);
79
+ const diffDays = Math.floor(diffHours / 24);
80
+ if (diffMins < 1)
81
+ return "just now";
82
+ if (diffMins < 60)
83
+ return `${diffMins} minute${diffMins === 1 ? "" : "s"} ago`;
84
+ if (diffHours < 24)
85
+ return `${diffHours} hour${diffHours === 1 ? "" : "s"} ago`;
86
+ return `${diffDays} day${diffDays === 1 ? "" : "s"} ago`;
87
+ }
88
+ //# sourceMappingURL=progress.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"progress.js","sourceRoot":"","sources":["../../src/interview/progress.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AA4BlC,MAAM,iBAAiB,GAAG,6BAA6B,CAAC;AAExD;;GAEG;AACH,MAAM,UAAU,eAAe,CAAC,aAAqB;IACnD,OAAO,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE,iBAAiB,CAAC,CAAC;AACrD,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,WAAW,CAAC,aAAqB;IAC/C,OAAO,EAAE,CAAC,UAAU,CAAC,eAAe,CAAC,aAAa,CAAC,CAAC,CAAC;AACvD,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,YAAY,CAC1B,aAAqB,EACrB,QA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AAC,EAAE,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC;AAC3D,CAAC"}
@@ -1,6 +1,7 @@
1
1
  /**
2
2
  * Interview prompts and tool definitions for interactive nav init
3
3
  */
4
+ import type { AnalysisResult } from "../repo-analyzer/index.js";
4
5
  /**
5
6
  * Context for pack-based interviews
6
7
  */
@@ -10,13 +11,13 @@ export interface PackContext {
10
11
  initGuide?: string;
11
12
  }
12
13
  /**
13
- * Get the interview system prompt, optionally customized for a pack
14
+ * Get the interview system prompt, optionally customized for a pack or analysis
14
15
  */
15
- export declare function getInterviewSystemPrompt(packContext?: PackContext): string;
16
+ export declare function getInterviewSystemPrompt(packContext?: PackContext, analysisContext?: AnalysisResult): string;
16
17
  /**
17
18
  * Legacy export for backwards compatibility
18
19
  */
19
- export declare const INTERVIEW_SYSTEM_PROMPT = "You are helping create a new Autonav navigator - a self-organizing knowledge assistant.\n\n## Your Role\nGuide the user through understanding their needs so you can create a well-configured navigator. Ask questions naturally, one at a time. Listen carefully and ask follow-up questions when needed.\n\n## Key Topics to Explore\n\n1. **Purpose**: What is this navigator for? What problems will it solve?\n2. **Scope**: What topics should it know about? What's explicitly out of scope?\n3. **Knowledge Structure**: How should knowledge be organized? (by topic, project, chronologically, as a journal, etc.)\n4. **Knowledge Sources**: What documentation will be added? How should new knowledge be captured over time?\n5. **Audience**: Who will use this? How should it communicate? (formal, casual, technical depth)\n6. **Autonomy**: How autonomous should it be? Should it create/modify files freely, or ask first?\n\n## Philosophy\nNavs are \"self-organizing notebooks that talk back\" - they edit their own knowledge files, learn from conversations, and maintain their own context. Help the user think through how they want this self-organization to work.\n\n## Guidelines\n- Ask ONE question at a time\n- Be conversational and helpful\n- Ask follow-up questions when answers are vague\n- After gathering enough information (usually 4-6 exchanges), output the navigator configuration\n\n## When Creating the Navigator\nAfter gathering enough information, output a JSON configuration block wrapped in ```json and ``` markers. The JSON must include:\n\n```json\n{\n \"purpose\": \"One-sentence description of what this navigator is for\",\n \"scope\": \"Topics in scope and explicitly out of scope\",\n \"knowledgeStructure\": \"How knowledge should be organized (by topic, chronologically, by project, etc.)\",\n \"audience\": \"Who uses this navigator and how it should communicate\",\n \"autonomy\": \"Autonomy level - can it create files freely or should it ask first\",\n \"claudeMd\": \"The complete CLAUDE.md content as a string with proper newlines (\\n)\",\n \"suggestedDirectories\": [\"optional\", \"array\", \"of\", \"subdirectories\"]\n}\n```\n\nThe claudeMd field should be a complete, personalized CLAUDE.md file based on what you learned, including:\n- Clear purpose statement\n- Grounding rules (always cite, never invent, acknowledge uncertainty)\n- Domain-specific scope definition\n- Knowledge organization guidance\n- Response format expectations\n- Self-organization rules based on their autonomy preference\n\nIMPORTANT: Only output the JSON configuration when you have gathered enough information. Before that, just ask questions conversationally.";
20
+ export declare const INTERVIEW_SYSTEM_PROMPT = "You are helping create a new Autonav navigator - a self-organizing knowledge assistant.\n\n## Your Role\nGuide the user through understanding their needs so you can create a well-configured navigator. Ask questions naturally, one at a time. Listen carefully and ask follow-up questions when needed.\n\n## Key Topics to Explore\n\n1. **Purpose**: What is this navigator for? What problems will it solve?\n2. **Scope**: What topics should it know about? What's explicitly out of scope?\n3. **Knowledge Structure**: How should knowledge be organized? (by topic, project, chronologically, as a journal, etc.)\n4. **Knowledge Sources**: What documentation will be added? How should new knowledge be captured over time?\n5. **Audience**: Who will use this? How should it communicate? (formal, casual, technical depth)\n6. **Autonomy**: How autonomous should it be? Should it create/modify files freely, or ask first?\n\n## Philosophy\nNavs are \"self-organizing notebooks that talk back\" - they edit their own knowledge files, learn from conversations, and maintain their own context. Help the user think through how they want this self-organization to work.\n\n## Interview Flow\n\n### Phase 1: Information Gathering (Exchanges 1-4)\n- Ask ONE question at a time\n- Be conversational and helpful\n- Ask follow-up questions when answers are vague\n- Focus on understanding their needs\n\n### Phase 2: Signal Readiness (After 4-6 exchanges)\nOnce you have gathered enough information to create a basic navigator configuration, signal that you're ready by saying something like:\n\n\"I have enough information to create your navigator. Type 'done' when you're ready, or we can continue refining if you have more details to share.\"\n\n**IMPORTANT**: After signaling readiness, DO NOT generate the JSON configuration yet. Wait for the user to explicitly type 'done', 'finish', 'ready', or similar. Continue answering any additional questions they have.\n\n### Phase 3: Configuration Generation (User types 'done')\nOnly generate the configuration when the user explicitly indicates they're ready.\n\n## When Creating the Navigator\nAfter the user types 'done' (or similar), output a JSON configuration block wrapped in ```json and ``` markers.\n\n**CRITICAL**: Output ONLY the JSON block and NOTHING ELSE. Do NOT add explanatory text before or after the JSON. The JSON itself IS your final response.\n\nThe JSON must include:\n\n```json\n{\n \"purpose\": \"One-sentence description of what this navigator is for\",\n \"scope\": \"Topics in scope and explicitly out of scope\",\n \"knowledgeStructure\": \"How knowledge should be organized (by topic, chronologically, by project, etc.)\",\n \"audience\": \"Who uses this navigator and how it should communicate\",\n \"autonomy\": \"Autonomy level - can it create files freely or should it ask first\",\n \"claudeMd\": \"The complete CLAUDE.md content as a string with proper newlines (\\n)\",\n \"suggestedDirectories\": [\"optional\", \"array\", \"of\", \"subdirectories\"]\n}\n```\n\n**IMPORTANT**: After outputting the JSON block, your job is complete. Do NOT add any commentary, instructions, or ask for further confirmation. The system will automatically use this configuration to create the navigator.\n\nThe claudeMd field should be a complete, personalized CLAUDE.md file based on what you learned, including:\n- Clear purpose statement\n- Grounding rules (always cite, never invent, acknowledge uncertainty)\n- Domain-specific scope definition\n- Knowledge organization guidance\n- Response format expectations\n- Self-organization rules based on their autonomy preference\n\n## Critical Rules\n1. Ask questions conversationally until you have enough information (4-6 exchanges typically)\n2. Signal readiness explicitly but DO NOT auto-generate configuration\n3. Wait for user's explicit 'done' command before generating JSON\n4. Never simulate user responses or create multi-turn conversations alone";
20
21
  /**
21
22
  * Type for the navigator configuration from the interview
22
23
  */
@@ -31,6 +32,9 @@ export interface NavigatorConfig {
31
32
  }
32
33
  /**
33
34
  * Parse a JSON configuration from the assistant's response
35
+ *
36
+ * This function extracts JSON from markdown code blocks and validates it.
37
+ * It handles cases where the agent includes additional text before or after the JSON.
34
38
  */
35
39
  export declare function parseNavigatorConfig(text: string): NavigatorConfig | null;
36
40
  //# sourceMappingURL=prompts.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"prompts.d.ts","sourceRoot":"","sources":["../../src/interview/prompts.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAqDD;;GAEG;AACH,wBAAgB,wBAAwB,CAAC,WAAW,CAAC,EAAE,WAAW,GAAG,MAAM,CAmC1E;AAED;;GAEG;AACH,eAAO,MAAM,uBAAuB,unFAAwB,CAAC;AAE7D;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,oBAAoB,CAAC,EAAE,MAAM,EAAE,CAAC;CACjC;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,eAAe,GAAG,IAAI,CAmBzE"}
1
+ {"version":3,"file":"prompts.d.ts","sourceRoot":"","sources":["../../src/interview/prompts.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAEhE;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AA2ED;;GAEG;AACH,wBAAgB,wBAAwB,CACtC,WAAW,CAAC,EAAE,WAAW,EACzB,eAAe,CAAC,EAAE,cAAc,GAC/B,MA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