@staticpayload/zai-code 1.0.0 → 1.0.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.
@@ -1,83 +1,255 @@
1
1
  "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || (function () {
19
- var ownKeys = function(o) {
20
- ownKeys = Object.getOwnPropertyNames || function (o) {
21
- var ar = [];
22
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
- return ar;
24
- };
25
- return ownKeys(o);
26
- };
27
- return function (mod) {
28
- if (mod && mod.__esModule) return mod;
29
- var result = {};
30
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
- __setModuleDefault(result, mod);
32
- return result;
33
- };
34
- })();
35
2
  Object.defineProperty(exports, "__esModule", { value: true });
36
3
  exports.startInteractive = startInteractive;
37
- const readline = __importStar(require("readline"));
38
- const orchestrator_1 = require("./orchestrator");
39
4
  const session_1 = require("./session");
40
5
  const ui_1 = require("./ui");
6
+ const orchestrator_1 = require("./orchestrator");
7
+ const commands_1 = require("./commands");
8
+ // Command definitions with descriptions for autocomplete
9
+ const COMMAND_DESCRIPTIONS = {
10
+ help: 'Show all commands',
11
+ plan: 'Generate execution plan',
12
+ generate: 'Create file changes',
13
+ diff: 'Review pending changes',
14
+ apply: 'Apply changes',
15
+ undo: 'Rollback last operation',
16
+ reset: 'Reset session state',
17
+ exit: 'Exit zcode',
18
+ mode: 'Set mode (edit/explain/review/debug)',
19
+ 'dry-run': 'Toggle dry-run mode',
20
+ profile: 'Manage profiles',
21
+ settings: 'Open settings menu',
22
+ context: 'Show current context',
23
+ files: 'List open files',
24
+ open: 'Add file to context',
25
+ workspace: 'Show workspace info',
26
+ git: 'Show git status',
27
+ exec: 'Run shell command',
28
+ history: 'View task history',
29
+ doctor: 'System health check',
30
+ decompose: 'Break task into steps',
31
+ step: 'Plan current step',
32
+ next: 'Complete and advance',
33
+ skip: 'Skip current step',
34
+ progress: 'Show task progress',
35
+ 'undo-history': 'View undo history',
36
+ };
37
+ // Get filtered commands based on input
38
+ function getFilteredCommands(input) {
39
+ const query = input.toLowerCase().replace(/^\//, '');
40
+ const commands = (0, commands_1.getAvailableCommands)();
41
+ return commands
42
+ .filter(cmd => cmd.startsWith(query))
43
+ .map(cmd => ({
44
+ name: cmd,
45
+ description: COMMAND_DESCRIPTIONS[cmd] || '',
46
+ }))
47
+ .slice(0, 8); // Max 8 suggestions
48
+ }
49
+ // Render suggestions dropdown
50
+ function renderSuggestions(suggestions, selectedIndex, promptLength) {
51
+ if (suggestions.length === 0)
52
+ return;
53
+ // Move cursor to new line and show suggestions
54
+ process.stdout.write('\n');
55
+ for (let i = 0; i < suggestions.length; i++) {
56
+ const cmd = suggestions[i];
57
+ const prefix = i === selectedIndex ? '>' : ' ';
58
+ const highlight = i === selectedIndex;
59
+ const line = ` ${prefix} /${cmd.name.padEnd(12)} ${(0, ui_1.dim)(cmd.description)}`;
60
+ if (highlight) {
61
+ process.stdout.write(`\x1b[7m${line}\x1b[0m\n`); // Inverted colors
62
+ }
63
+ else {
64
+ process.stdout.write(`${line}\n`);
65
+ }
66
+ }
67
+ // Move cursor back up
68
+ process.stdout.write(`\x1b[${suggestions.length + 1}A`);
69
+ // Move to end of current input
70
+ process.stdout.write(`\x1b[${promptLength}G`);
71
+ }
72
+ // Clear suggestions from screen
73
+ function clearSuggestions(count) {
74
+ if (count === 0)
75
+ return;
76
+ // Save cursor position
77
+ process.stdout.write('\x1b[s');
78
+ // Move down and clear each line
79
+ for (let i = 0; i < count + 1; i++) {
80
+ process.stdout.write('\n\x1b[2K');
81
+ }
82
+ // Restore cursor position
83
+ process.stdout.write('\x1b[u');
84
+ }
85
+ // Main interactive loop with autocomplete
41
86
  async function startInteractive(options) {
42
- const rl = readline.createInterface({
43
- input: process.stdin,
44
- output: process.stdout,
45
- });
46
- const askQuestion = () => {
87
+ let currentInput = '';
88
+ let suggestions = [];
89
+ let selectedIndex = 0;
90
+ let showingSuggestions = false;
91
+ // Print initial hint
92
+ console.log((0, ui_1.dim)('Type / for commands, or enter a task'));
93
+ console.log('');
94
+ // Show prompt
95
+ const printPrompt = () => {
47
96
  const session = (0, session_1.getSession)();
48
- const currentPrompt = (0, ui_1.getPrompt)(session);
49
- rl.question(currentPrompt, async (input) => {
50
- const trimmed = input.trim();
51
- // Exit commands (handled before orchestrator for immediate response)
52
- if (trimmed === 'exit' || trimmed === 'quit' || trimmed === ':q') {
53
- rl.close();
54
- options?.onExit?.();
97
+ const prompt = (0, ui_1.getPrompt)(session);
98
+ process.stdout.write(prompt + currentInput);
99
+ };
100
+ // Enable raw mode for key-by-key input
101
+ if (process.stdin.isTTY) {
102
+ process.stdin.setRawMode(true);
103
+ }
104
+ process.stdin.resume();
105
+ process.stdin.setEncoding('utf8');
106
+ printPrompt();
107
+ const handleKey = async (key) => {
108
+ const session = (0, session_1.getSession)();
109
+ const prompt = (0, ui_1.getPrompt)(session);
110
+ const promptLen = prompt.length + currentInput.length;
111
+ // Ctrl+C - exit
112
+ if (key === '\x03') {
113
+ if (process.stdin.isTTY)
114
+ process.stdin.setRawMode(false);
115
+ process.stdout.write('\n');
116
+ options?.onExit?.();
117
+ return;
118
+ }
119
+ // Escape - close suggestions or clear input
120
+ if (key === '\x1b' && showingSuggestions) {
121
+ clearSuggestions(suggestions.length);
122
+ showingSuggestions = false;
123
+ suggestions = [];
124
+ selectedIndex = 0;
125
+ return;
126
+ }
127
+ // Up arrow - navigate suggestions
128
+ if (key === '\x1b[A' && showingSuggestions) {
129
+ selectedIndex = Math.max(0, selectedIndex - 1);
130
+ clearSuggestions(suggestions.length);
131
+ renderSuggestions(suggestions, selectedIndex, promptLen);
132
+ return;
133
+ }
134
+ // Down arrow - navigate suggestions
135
+ if (key === '\x1b[B' && showingSuggestions) {
136
+ selectedIndex = Math.min(suggestions.length - 1, selectedIndex + 1);
137
+ clearSuggestions(suggestions.length);
138
+ renderSuggestions(suggestions, selectedIndex, promptLen);
139
+ return;
140
+ }
141
+ // Tab - autocomplete if showing suggestions
142
+ if (key === '\t' && showingSuggestions && suggestions.length > 0) {
143
+ clearSuggestions(suggestions.length);
144
+ currentInput = '/' + suggestions[selectedIndex].name + ' ';
145
+ showingSuggestions = false;
146
+ suggestions = [];
147
+ selectedIndex = 0;
148
+ // Reprint line
149
+ process.stdout.write('\r\x1b[2K');
150
+ printPrompt();
151
+ return;
152
+ }
153
+ // Enter - submit or select suggestion
154
+ if (key === '\r' || key === '\n') {
155
+ if (showingSuggestions && suggestions.length > 0) {
156
+ // Select suggestion
157
+ clearSuggestions(suggestions.length);
158
+ currentInput = '/' + suggestions[selectedIndex].name;
159
+ showingSuggestions = false;
160
+ suggestions = [];
161
+ selectedIndex = 0;
162
+ // Reprint line
163
+ process.stdout.write('\r\x1b[2K');
164
+ printPrompt();
55
165
  return;
56
166
  }
57
- // Empty input - just re-prompt
58
- if (!trimmed) {
59
- askQuestion();
167
+ // Submit input
168
+ clearSuggestions(suggestions.length);
169
+ process.stdout.write('\n');
170
+ const input = currentInput.trim();
171
+ currentInput = '';
172
+ showingSuggestions = false;
173
+ suggestions = [];
174
+ selectedIndex = 0;
175
+ // Handle exit
176
+ if (input === 'exit' || input === 'quit' || input === ':q' || input === '/exit') {
177
+ if (process.stdin.isTTY)
178
+ process.stdin.setRawMode(false);
179
+ options?.onExit?.();
60
180
  return;
61
181
  }
62
- // Route ALL input through orchestrator
63
- try {
64
- await (0, orchestrator_1.orchestrate)(trimmed);
182
+ // Process input
183
+ if (input) {
184
+ try {
185
+ await (0, orchestrator_1.orchestrate)(input);
186
+ }
187
+ catch (e) {
188
+ // Swallow errors
189
+ }
190
+ }
191
+ // Show prompt again
192
+ console.log('');
193
+ printPrompt();
194
+ return;
195
+ }
196
+ // Backspace
197
+ if (key === '\x7f' || key === '\b') {
198
+ if (currentInput.length > 0) {
199
+ currentInput = currentInput.slice(0, -1);
200
+ process.stdout.write('\b \b');
201
+ // Update suggestions
202
+ if (currentInput.startsWith('/')) {
203
+ clearSuggestions(suggestions.length);
204
+ suggestions = getFilteredCommands(currentInput);
205
+ selectedIndex = 0;
206
+ if (suggestions.length > 0) {
207
+ showingSuggestions = true;
208
+ const newPromptLen = prompt.length + currentInput.length;
209
+ renderSuggestions(suggestions, selectedIndex, newPromptLen);
210
+ }
211
+ else {
212
+ showingSuggestions = false;
213
+ }
214
+ }
215
+ else {
216
+ if (showingSuggestions) {
217
+ clearSuggestions(suggestions.length);
218
+ showingSuggestions = false;
219
+ suggestions = [];
220
+ }
221
+ }
65
222
  }
66
- catch (error) {
67
- // Swallow errors, continue loop
223
+ return;
224
+ }
225
+ // Regular character input
226
+ if (key.length === 1 && key >= ' ') {
227
+ currentInput += key;
228
+ process.stdout.write(key);
229
+ // Check if typing slash command
230
+ if (currentInput.startsWith('/')) {
231
+ clearSuggestions(suggestions.length);
232
+ suggestions = getFilteredCommands(currentInput);
233
+ selectedIndex = 0;
234
+ if (suggestions.length > 0) {
235
+ showingSuggestions = true;
236
+ const newPromptLen = prompt.length + currentInput.length;
237
+ renderSuggestions(suggestions, selectedIndex, newPromptLen);
238
+ }
239
+ else {
240
+ showingSuggestions = false;
241
+ }
68
242
  }
69
- // Continue loop
70
- askQuestion();
71
- });
243
+ }
72
244
  };
73
- // Handle Ctrl+C gracefully
74
- rl.on('close', () => {
75
- options?.onExit?.();
76
- });
245
+ process.stdin.on('data', handleKey);
246
+ // Handle SIGINT
77
247
  process.on('SIGINT', () => {
78
- rl.close();
248
+ if (process.stdin.isTTY)
249
+ process.stdin.setRawMode(false);
250
+ process.stdout.write('\n');
251
+ options?.onExit?.();
79
252
  });
80
- askQuestion();
81
253
  return new Promise(() => { });
82
254
  }
83
255
  //# sourceMappingURL=interactive.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"interactive.js","sourceRoot":"","sources":["../src/interactive.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAUA,4CAkDC;AA5DD,mDAAqC;AACrC,iDAA6C;AAC7C,uCAAuC;AACvC,6BAAiC;AAO1B,KAAK,UAAU,gBAAgB,CAAC,OAA4B;IACjE,MAAM,EAAE,GAAG,QAAQ,CAAC,eAAe,CAAC;QAClC,KAAK,EAAE,OAAO,CAAC,KAAK;QACpB,MAAM,EAAE,OAAO,CAAC,MAAM;KACvB,CAAC,CAAC;IAEH,MAAM,WAAW,GAAG,GAAS,EAAE;QAC7B,MAAM,OAAO,GAAG,IAAA,oBAAU,GAAE,CAAC;QAC7B,MAAM,aAAa,GAAG,IAAA,cAAS,EAAC,OAAO,CAAC,CAAC;QAEzC,EAAE,CAAC,QAAQ,CAAC,aAAa,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE;YACzC,MAAM,OAAO,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC;YAE7B,qEAAqE;YACrE,IAAI,OAAO,KAAK,MAAM,IAAI,OAAO,KAAK,MAAM,IAAI,OAAO,KAAK,IAAI,EAAE,CAAC;gBACjE,EAAE,CAAC,KAAK,EAAE,CAAC;gBACX,OAAO,EAAE,MAAM,EAAE,EAAE,CAAC;gBACpB,OAAO;YACT,CAAC;YAED,+BAA+B;YAC/B,IAAI,CAAC,OAAO,EAAE,CAAC;gBACb,WAAW,EAAE,CAAC;gB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,CAAC,CAAC;AAChC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"orchestrator.d.ts","sourceRoot":"","sources":["../src/orchestrator.ts"],"names":[],"mappings":"AACA,OAAO,EAAoC,UAAU,EAAiB,MAAM,WAAW,CAAC;AAGxF,MAAM,MAAM,YAAY,GACpB,eAAe,GACf,gBAAgB,GAChB,gBAAgB,GAChB,gBAAgB,GAChB,QAAQ,CAAC;AAGb,MAAM,WAAW,mBAAmB;IAClC,SAAS,EAAE,OAAO,GAAG,WAAW,CAAC;IACjC,MAAM,EAAE,UAAU,CAAC;IACnB,QAAQ,EAAE,YAAY,CAAC;IACvB,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AA8GD,wBAAsB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,mBAAmB,CAAC,CA8C7E"}
1
+ {"version":3,"file":"orchestrator.d.ts","sourceRoot":"","sources":["../src/orchestrator.ts"],"names":[],"mappings":"AACA,OAAO,EAAoC,UAAU,EAAiB,MAAM,WAAW,CAAC;AAIxF,MAAM,MAAM,YAAY,GACpB,eAAe,GACf,gBAAgB,GAChB,gBAAgB,GAChB,gBAAgB,GAChB,QAAQ,CAAC;AAEb,MAAM,WAAW,mBAAmB;IAClC,SAAS,EAAE,OAAO,GAAG,WAAW,CAAC;IACjC,MAAM,EAAE,UAAU,CAAC;IACnB,QAAQ,EAAE,YAAY,CAAC;IACvB,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AA6FD,wBAAsB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAuC7E"}
@@ -3,62 +3,39 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.orchestrate = orchestrate;
4
4
  const commands_1 = require("./commands");
5
5
  const session_1 = require("./session");
6
- // Classify free text intent (rule-based, no model calls)
6
+ const ui_1 = require("./ui");
7
+ // Intent classification (rule-based, no model)
7
8
  function classifyIntent(input) {
8
9
  const lower = input.toLowerCase().trim();
9
- // QUESTION patterns - explain, clarify, what/why/how questions
10
- const questionPatterns = [
11
- /^(what|why|how|when|where|who|explain|clarify|describe|tell me)/i,
12
- /\?$/,
13
- /^(is|are|can|could|would|should|do|does|did|has|have|will)\s/i,
14
- /(what is|what are|what does|how does|how do|how to|why does|why is)/i,
15
- ];
16
- if (questionPatterns.some(p => p.test(lower))) {
10
+ // QUESTION
11
+ if (/^(what|why|how|when|where|who|explain|clarify|describe|tell me)/i.test(lower) ||
12
+ /\?$/.test(lower) ||
13
+ /^(is|are|can|could|would|should|do|does|did|has|have|will)\s/i.test(lower)) {
17
14
  return 'QUESTION';
18
15
  }
19
- // DEBUG patterns - fix, debug, error, bug, issue, broken, failing
20
- const debugPatterns = [
21
- /(fix|debug|error|bug|issue|broken|failing|crash|exception|problem|wrong|doesn'?t work|not working)/i,
22
- /(resolve|troubleshoot|diagnose|investigate)/i,
23
- ];
24
- if (debugPatterns.some(p => p.test(lower))) {
16
+ // DEBUG
17
+ if (/(fix|debug|error|bug|issue|broken|failing|crash|exception|problem|wrong|doesn'?t work|not working)/i.test(lower)) {
25
18
  return 'DEBUG';
26
19
  }
27
- // REFACTOR patterns - refactor, rename, reorganize, extract, move, restructure
28
- const refactorPatterns = [
29
- /(refactor|rename|reorganize|restructure|extract|move|split|merge|consolidate)/i,
30
- /(clean up|cleanup|simplify|optimize|improve structure)/i,
31
- ];
32
- if (refactorPatterns.some(p => p.test(lower))) {
20
+ // REFACTOR
21
+ if (/(refactor|rename|reorganize|restructure|extract|move|split|merge|consolidate|clean up|cleanup|simplify)/i.test(lower)) {
33
22
  return 'REFACTOR';
34
23
  }
35
- // REVIEW patterns - review, analyze, audit, check, inspect, look at
36
- const reviewPatterns = [
37
- /(review|analyze|audit|check|inspect|examine|assess|evaluate)/i,
38
- /(look at|understand|read|show me)/i,
39
- ];
40
- if (reviewPatterns.some(p => p.test(lower))) {
24
+ // REVIEW
25
+ if (/(review|analyze|audit|check|inspect|examine|assess|evaluate|look at|understand|read|show me)/i.test(lower)) {
41
26
  return 'REVIEW';
42
27
  }
43
- // CODE_EDIT patterns - add, create, implement, update, change, modify, write
44
- const codeEditPatterns = [
45
- /(add|create|implement|update|change|modify|write|build|make|generate)/i,
46
- /(new|feature|function|component|class|method|file|module)/i,
47
- /(edit|insert|append|remove|delete|replace)/i,
48
- ];
49
- if (codeEditPatterns.some(p => p.test(lower))) {
28
+ // CODE_EDIT
29
+ if (/(add|create|implement|update|change|modify|write|build|make|generate|new|feature|function|component|edit|insert|append|remove|delete|replace)/i.test(lower)) {
50
30
  return 'CODE_EDIT';
51
31
  }
52
- // Default: COMMAND (unclear, may need clarification)
53
32
  return 'COMMAND';
54
33
  }
55
- // Determine workflow based on intent
34
+ // Determine workflow
56
35
  function determineWorkflow(intent, hasExistingIntent) {
57
- // All intent types map to capture_intent for now
58
- // The intent type is stored separately for later use
59
36
  return 'capture_intent';
60
37
  }
61
- // Handle the workflow
38
+ // Handle workflow
62
39
  async function handleWorkflow(workflow, input, parsed, intent) {
63
40
  switch (workflow) {
64
41
  case 'slash_command':
@@ -67,31 +44,38 @@ async function handleWorkflow(workflow, input, parsed, intent) {
67
44
  case 'capture_intent':
68
45
  (0, session_1.setIntent)(input);
69
46
  (0, session_1.setIntentType)(intent);
70
- console.log(`Intent: ${intent}`);
71
- console.log('Use /plan to proceed.');
47
+ // Clear, minimal output with next action
48
+ const intentLabel = intent.toLowerCase().replace('_', ' ');
49
+ console.log(`${(0, ui_1.dim)('intent:')} ${intentLabel}`);
50
+ console.log((0, ui_1.hint)('/plan'));
72
51
  return { handled: true };
73
52
  case 'append_context':
74
53
  const existing = (0, session_1.getIntent)();
75
54
  if (existing) {
76
55
  (0, session_1.setIntent)(`${existing}\n\nClarification: ${input}`);
77
- return { handled: true, message: 'Context appended to intent.' };
56
+ console.log((0, ui_1.dim)('Context updated.'));
57
+ console.log((0, ui_1.hint)('/plan'));
58
+ return { handled: true };
78
59
  }
79
60
  (0, session_1.setIntent)(input);
80
- return { handled: true, message: 'Intent recorded. Use /plan to proceed.' };
61
+ console.log((0, ui_1.dim)('Intent captured.'));
62
+ console.log((0, ui_1.hint)('/plan'));
63
+ return { handled: true };
81
64
  case 'confirm_action':
82
65
  const session = (0, session_1.getSession)();
83
66
  if (session.pendingActions) {
84
- // There are pending actions - user might want to apply
85
- return { handled: true, message: 'Pending changes exist. Use /apply to execute or /diff to review.' };
67
+ console.log((0, ui_1.hint)('/diff or /apply'));
68
+ return { handled: true };
86
69
  }
87
- return { handled: true, message: 'Nothing to confirm.' };
70
+ console.log((0, ui_1.dim)('Nothing pending.'));
71
+ return { handled: true };
88
72
  case 'ignore':
89
- return { handled: true, message: 'Cancelled.' };
73
+ return { handled: true };
90
74
  default:
91
75
  return { handled: false };
92
76
  }
93
77
  }
94
- // Main orchestration entry point
78
+ // Main orchestration entry
95
79
  async function orchestrate(input) {
96
80
  const trimmed = input.trim();
97
81
  if (!trimmed) {
@@ -102,28 +86,22 @@ async function orchestrate(input) {
102
86
  handled: true,
103
87
  };
104
88
  }
105
- // Parse input
106
89
  const parsed = (0, commands_1.parseInput)(trimmed);
107
- // Slash commands bypass intent detection
90
+ // Slash commands
108
91
  if (parsed.isSlashCommand) {
109
92
  await (0, commands_1.executeCommand)(parsed);
110
93
  return {
111
94
  inputType: 'slash',
112
- intent: 'COMMAND', // Not classified for slash commands
95
+ intent: 'COMMAND',
113
96
  workflow: 'slash_command',
114
97
  handled: true,
115
98
  };
116
99
  }
117
- // Free text goes through intent classification
100
+ // Free text - classify and capture
118
101
  const intent = classifyIntent(trimmed);
119
102
  const hasExistingIntent = (0, session_1.getIntent)() !== null;
120
103
  const workflow = determineWorkflow(intent, hasExistingIntent);
121
- // Execute workflow
122
104
  const result = await handleWorkflow(workflow, trimmed, parsed, intent);
123
- // Print message if any
124
- if (result.message) {
125
- console.log(result.message);
126
- }
127
105
  return {
128
106
  inputType: 'free_text',
129
107
  intent,
@@ -1 +1 @@
1
- {"version":3,"file":"orchestrator.js","sourceRoot":"","sources":["../src/orchestrator.ts"],"names":[],"mappings":";;AAgIA,kCA8CC;AA9KD,yCAAuE;AACvE,uCAAwF;AAmBxF,yDAAyD;AACzD,SAAS,cAAc,CAAC,KAAa;IACnC,MAAM,KAAK,GAAG,KAAK,CAAC,WAAW,EAAE,CAAC,IAAI,EAAE,CAAC;IAEzC,+DAA+D;IAC/D,MAAM,gBAAgB,GAAG;QACvB,kEAAkE;QAClE,KAAK;QACL,+DAA+D;QAC/D,sEAAsE;KACvE,CAAC;IACF,IAAI,gBAAgB,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC;QAC9C,OAAO,UAAU,CAAC;IACpB,CAAC;IAED,kEAAkE;IAClE,MAAM,aAAa,GAAG;QACpB,qGAAqG;QACrG,8CAA8C;KAC/C,CAAC;IACF,IAAI,aAAa,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC;QAC3C,OAAO,OAAO,CAAC;IACjB,CAAC;IAED,+EAA+E;IAC/E,MAAM,gBAAgB,GAAG;QACvB,gFAAgF;QAChF,yDAAyD;KAC1D,CAAC;IACF,IAAI,gBAAgB,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC;QAC9C,OAAO,UAAU,CAAC;IACpB,CAAC;IAED,oEAAoE;IACpE,MAAM,cAAc,GAAG;QACrB,+DAA+D;QAC/D,oCAAoC;KACrC,CAAC;IACF,IAAI,cAAc,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC;QAC5C,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED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C;IAEnC,iBAAiB;IACjB,IAAI,MAAM,CAAC,cAAc,EAAE,CAAC;QAC1B,MAAM,IAAA,yBAAc,EAAC,MAAM,CAAC,CAAC;QAC7B,OAAO;YACL,SAAS,EAAE,OAAO;YAClB,MAAM,EAAE,SAAS;YACjB,QAAQ,EAAE,eAAe;YACzB,OAAO,EAAE,IAAI;SACd,CAAC;IACJ,CAAC;IAED,mCAAmC;IACnC,MAAM,MAAM,GAAG,cAAc,CAAC,OAAO,CAAC,CAAC;IACvC,MAAM,iBAAiB,GAAG,IAAA,mBAAS,GAAE,KAAK,IAAI,CAAC;IAC/C,MAAM,QAAQ,GAAG,iBAAiB,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAC;IAE9D,MAAM,MAAM,GAAG,MAAM,cAAc,CAAC,QAAQ,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IAEvE,OAAO;QACL,SAAS,EAAE,WAAW;QACtB,MAAM;QACN,QAAQ;QACR,OAAO,EAAE,MAAM,CAAC,OAAO;QACvB,OAAO,EAAE,MAAM,CAAC,OAAO;KACxB,CAAC;AACJ,CAAC"}
package/dist/ui.d.ts CHANGED
@@ -1,15 +1,17 @@
1
1
  import { SessionState } from './session';
2
- declare const ASCII_LOGO = "\n _____ ___ ___\n|__ // _ |/ /\n / // __ | __|\n /___\\___|___| code\n";
2
+ declare const ASCII_LOGO = "zai\u00B7code";
3
3
  export declare function renderStartup(projectName: string): string;
4
4
  export declare function getPrompt(session: SessionState): string;
5
- export declare function renderStatus(session: SessionState): string;
6
5
  export declare function renderStatusBar(session: SessionState): string;
6
+ export declare function renderStatus(session: SessionState): string;
7
7
  export declare function getWarnings(session: SessionState): string[];
8
8
  export declare function success(msg: string): string;
9
9
  export declare function warning(msg: string): string;
10
10
  export declare function error(msg: string): string;
11
11
  export declare function dim(msg: string): string;
12
12
  export declare function info(msg: string): string;
13
- export declare function hint(msg: string): string;
13
+ export declare function hint(action: string): string;
14
+ export declare function header(title: string): string;
15
+ export declare function box(content: string[], title?: string): string;
14
16
  export { ASCII_LOGO };
15
17
  //# sourceMappingURL=ui.d.ts.map
package/dist/ui.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"ui.d.ts","sourceRoot":"","sources":["../src/ui.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAoBzC,QAAA,MAAM,UAAU,iFAKf,CAAC;AAGF,wBAAgB,aAAa,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAczD;AAwBD,wBAAgB,SAAS,CAAC,OAAO,EAAE,YAAY,GAAG,MAAM,CAevD;AAGD,wBAAgB,YAAY,CAAC,OAAO,EAAE,YAAY,GAAG,MAAM,CAI1D;AAGD,wBAAgB,eAAe,CAAC,OAAO,EAAE,YAAY,GAAG,MAAM,CAmB7D;AAGD,wBAAgB,WAAW,CAAC,OAAO,EAAE,YAAY,GAAG,MAAM,EAAE,CAuB3D;AAGD,wBAAgB,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAG3C;AAED,wBAAgB,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAG3C;AAED,wBAAgB,KAAK,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAGzC;AAED,wBAAgB,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAGvC;AAED,wBAAgB,IAAI,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAGxC;AAGD,wBAAgB,IAAI,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAGxC;AAGD,OAAO,EAAE,UAAU,EAAE,CAAC"}
1
+ {"version":3,"file":"ui.d.ts","sourceRoot":"","sources":["../src/ui.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAuBzC,QAAA,MAAM,UAAU,kBAAa,CAAC;AAG9B,wBAAgB,aAAa,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,C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