@staticpayload/zai-code 1.0.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.
- package/LICENSE +678 -0
- package/README.md +115 -0
- package/bin/zcode +3 -0
- package/dist/apply.d.ts +44 -0
- package/dist/apply.d.ts.map +1 -0
- package/dist/apply.js +307 -0
- package/dist/apply.js.map +1 -0
- package/dist/auth.d.ts +9 -0
- package/dist/auth.d.ts.map +1 -0
- package/dist/auth.js +170 -0
- package/dist/auth.js.map +1 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +179 -0
- package/dist/cli.js.map +1 -0
- package/dist/commands.d.ts +15 -0
- package/dist/commands.d.ts.map +1 -0
- package/dist/commands.js +560 -0
- package/dist/commands.js.map +1 -0
- package/dist/config.d.ts +9 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +97 -0
- package/dist/config.js.map +1 -0
- package/dist/context/context_builder.d.ts +29 -0
- package/dist/context/context_builder.d.ts.map +1 -0
- package/dist/context/context_builder.js +307 -0
- package/dist/context/context_builder.js.map +1 -0
- package/dist/context/project_memory.d.ts +14 -0
- package/dist/context/project_memory.d.ts.map +1 -0
- package/dist/context/project_memory.js +142 -0
- package/dist/context/project_memory.js.map +1 -0
- package/dist/doctor.d.ts +2 -0
- package/dist/doctor.d.ts.map +1 -0
- package/dist/doctor.js +3 -0
- package/dist/doctor.js.map +1 -0
- package/dist/git.d.ts +10 -0
- package/dist/git.d.ts.map +1 -0
- package/dist/git.js +90 -0
- package/dist/git.js.map +1 -0
- package/dist/history.d.ts +14 -0
- package/dist/history.d.ts.map +1 -0
- package/dist/history.js +103 -0
- package/dist/history.js.map +1 -0
- package/dist/interactive.d.ts +6 -0
- package/dist/interactive.d.ts.map +1 -0
- package/dist/interactive.js +83 -0
- package/dist/interactive.js.map +1 -0
- package/dist/orchestrator.d.ts +11 -0
- package/dist/orchestrator.d.ts.map +1 -0
- package/dist/orchestrator.js +135 -0
- package/dist/orchestrator.js.map +1 -0
- package/dist/planner.d.ts +22 -0
- package/dist/planner.d.ts.map +1 -0
- package/dist/planner.js +259 -0
- package/dist/planner.js.map +1 -0
- package/dist/profiles.d.ts +16 -0
- package/dist/profiles.d.ts.map +1 -0
- package/dist/profiles.js +80 -0
- package/dist/profiles.js.map +1 -0
- package/dist/rollback.d.ts +27 -0
- package/dist/rollback.d.ts.map +1 -0
- package/dist/rollback.js +154 -0
- package/dist/rollback.js.map +1 -0
- package/dist/runtime.d.ts +131 -0
- package/dist/runtime.d.ts.map +1 -0
- package/dist/runtime.js +374 -0
- package/dist/runtime.js.map +1 -0
- package/dist/session.d.ts +95 -0
- package/dist/session.d.ts.map +1 -0
- package/dist/session.js +174 -0
- package/dist/session.js.map +1 -0
- package/dist/settings.d.ts +41 -0
- package/dist/settings.d.ts.map +1 -0
- package/dist/settings.js +225 -0
- package/dist/settings.js.map +1 -0
- package/dist/settings_menu.d.ts +2 -0
- package/dist/settings_menu.d.ts.map +1 -0
- package/dist/settings_menu.js +265 -0
- package/dist/settings_menu.js.map +1 -0
- package/dist/shell.d.ts +18 -0
- package/dist/shell.d.ts.map +1 -0
- package/dist/shell.js +128 -0
- package/dist/shell.js.map +1 -0
- package/dist/task_runner.d.ts +22 -0
- package/dist/task_runner.d.ts.map +1 -0
- package/dist/task_runner.js +230 -0
- package/dist/task_runner.js.map +1 -0
- package/dist/ui.d.ts +15 -0
- package/dist/ui.d.ts.map +1 -0
- package/dist/ui.js +160 -0
- package/dist/ui.js.map +1 -0
- package/dist/workspace.d.ts +17 -0
- package/dist/workspace.d.ts.map +1 -0
- package/dist/workspace.js +134 -0
- package/dist/workspace.js.map +1 -0
- package/dist/workspace_model.d.ts +45 -0
- package/dist/workspace_model.d.ts.map +1 -0
- package/dist/workspace_model.js +253 -0
- package/dist/workspace_model.js.map +1 -0
- package/package.json +45 -0
package/dist/commands.js
ADDED
|
@@ -0,0 +1,560 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.parseInput = parseInput;
|
|
37
|
+
exports.executeCommand = executeCommand;
|
|
38
|
+
exports.getAvailableCommands = getAvailableCommands;
|
|
39
|
+
const session_1 = require("./session");
|
|
40
|
+
const settings_1 = require("./settings");
|
|
41
|
+
const git_1 = require("./git");
|
|
42
|
+
const profiles_1 = require("./profiles");
|
|
43
|
+
const history_1 = require("./history");
|
|
44
|
+
const settings_menu_1 = require("./settings_menu");
|
|
45
|
+
const shell_1 = require("./shell");
|
|
46
|
+
const workspace_model_1 = require("./workspace_model");
|
|
47
|
+
const auth_1 = require("./auth");
|
|
48
|
+
const apply_1 = require("./apply");
|
|
49
|
+
const ui_1 = require("./ui");
|
|
50
|
+
const planner_1 = require("./planner");
|
|
51
|
+
const task_runner_1 = require("./task_runner");
|
|
52
|
+
const rollback_1 = require("./rollback");
|
|
53
|
+
const path = __importStar(require("path"));
|
|
54
|
+
const fs = __importStar(require("fs"));
|
|
55
|
+
const os = __importStar(require("os"));
|
|
56
|
+
// Parse input to detect slash commands
|
|
57
|
+
function parseInput(input) {
|
|
58
|
+
const trimmed = input.trim();
|
|
59
|
+
if (!trimmed.startsWith('/')) {
|
|
60
|
+
return { isSlashCommand: false, rawInput: trimmed };
|
|
61
|
+
}
|
|
62
|
+
const parts = trimmed.slice(1).split(/\s+/);
|
|
63
|
+
const command = parts[0]?.toLowerCase() || '';
|
|
64
|
+
const args = parts.slice(1);
|
|
65
|
+
return {
|
|
66
|
+
isSlashCommand: true,
|
|
67
|
+
command,
|
|
68
|
+
args,
|
|
69
|
+
rawInput: trimmed,
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
// Stub handlers for all commands
|
|
73
|
+
const handlers = {
|
|
74
|
+
help: () => {
|
|
75
|
+
console.log('Navigation:');
|
|
76
|
+
console.log(' /help /context /files /open /workspace');
|
|
77
|
+
console.log('Execution:');
|
|
78
|
+
console.log(' /plan /generate /diff /apply /undo');
|
|
79
|
+
console.log('Modes:');
|
|
80
|
+
console.log(' /mode /dry-run /profile');
|
|
81
|
+
console.log('Tasks:');
|
|
82
|
+
console.log(' /decompose /step /next /skip /progress');
|
|
83
|
+
console.log('System:');
|
|
84
|
+
console.log(' /settings /git /exec /history /doctor');
|
|
85
|
+
console.log('Session:');
|
|
86
|
+
console.log(' /reset /exit');
|
|
87
|
+
},
|
|
88
|
+
reset: () => {
|
|
89
|
+
(0, session_1.resetSession)();
|
|
90
|
+
(0, rollback_1.clearUndoHistory)();
|
|
91
|
+
console.log('Reset.');
|
|
92
|
+
},
|
|
93
|
+
settings: async (ctx) => {
|
|
94
|
+
if (ctx.args.length === 0) {
|
|
95
|
+
// Open interactive menu
|
|
96
|
+
await (0, settings_menu_1.openSettingsMenu)();
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
// Check for --project flag
|
|
100
|
+
if (ctx.args[0] === '--project') {
|
|
101
|
+
if ((0, settings_1.hasProjectSettings)()) {
|
|
102
|
+
console.log('Project settings active: .zai/settings.json');
|
|
103
|
+
}
|
|
104
|
+
else {
|
|
105
|
+
console.log('No project settings. Using global settings.');
|
|
106
|
+
}
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
// Quick set via command line
|
|
110
|
+
const arg = ctx.args.join(' ');
|
|
111
|
+
const match = arg.match(/^(\S+)\s*=\s*(\S+)$/);
|
|
112
|
+
if (!match) {
|
|
113
|
+
console.log('Usage: /settings [key = value]');
|
|
114
|
+
console.log('Or run /settings to open interactive menu.');
|
|
115
|
+
return;
|
|
116
|
+
}
|
|
117
|
+
const [, key, value] = match;
|
|
118
|
+
const success = (0, settings_1.setNestedSetting)(key, value);
|
|
119
|
+
if (success) {
|
|
120
|
+
console.log(`Set ${key} = ${value}`);
|
|
121
|
+
}
|
|
122
|
+
else {
|
|
123
|
+
console.log((0, ui_1.error)(`Invalid: ${key} = ${value}`));
|
|
124
|
+
}
|
|
125
|
+
},
|
|
126
|
+
context: () => {
|
|
127
|
+
const session = (0, session_1.getSession)();
|
|
128
|
+
const ws = (0, workspace_model_1.getWorkspace)();
|
|
129
|
+
console.log(`Workspace: ${ws.getRoot()}`);
|
|
130
|
+
console.log(`Mode: ${session.mode}`);
|
|
131
|
+
console.log(`Dry run: ${session.dryRun}`);
|
|
132
|
+
console.log(`Open files: ${session.openFiles.length}`);
|
|
133
|
+
console.log(`Intent: ${session.currentIntent || 'none'}`);
|
|
134
|
+
console.log(`Intent type: ${session.intentType || 'none'}`);
|
|
135
|
+
console.log(`Plan: ${session.lastPlan ? `${session.lastPlan.length} steps` : 'none'}`);
|
|
136
|
+
console.log(`Pending: ${session.pendingActions ? 'yes' : 'no'}`);
|
|
137
|
+
},
|
|
138
|
+
files: () => {
|
|
139
|
+
const session = (0, session_1.getSession)();
|
|
140
|
+
if (session.openFiles.length === 0) {
|
|
141
|
+
console.log('No open files');
|
|
142
|
+
}
|
|
143
|
+
else {
|
|
144
|
+
session.openFiles.forEach(f => console.log(f));
|
|
145
|
+
}
|
|
146
|
+
},
|
|
147
|
+
open: (ctx) => {
|
|
148
|
+
const path = ctx.args[0];
|
|
149
|
+
if (!path) {
|
|
150
|
+
console.log('Usage: /open <path>');
|
|
151
|
+
return;
|
|
152
|
+
}
|
|
153
|
+
(0, session_1.addOpenFile)(path);
|
|
154
|
+
console.log(`Added: ${path}`);
|
|
155
|
+
},
|
|
156
|
+
mode: (ctx) => {
|
|
157
|
+
const newMode = ctx.args[0]?.toLowerCase();
|
|
158
|
+
const validModes = ['edit', 'explain', 'review', 'debug'];
|
|
159
|
+
if (!newMode) {
|
|
160
|
+
const session = (0, session_1.getSession)();
|
|
161
|
+
console.log(`Current mode: ${session.mode}`);
|
|
162
|
+
console.log('Available modes: edit, explain, review, debug');
|
|
163
|
+
return;
|
|
164
|
+
}
|
|
165
|
+
if (!validModes.includes(newMode)) {
|
|
166
|
+
console.log(`Invalid mode: ${newMode}`);
|
|
167
|
+
console.log('Available modes: edit, explain, review, debug');
|
|
168
|
+
return;
|
|
169
|
+
}
|
|
170
|
+
(0, session_1.setMode)(newMode);
|
|
171
|
+
console.log((0, ui_1.success)(`Mode set to: ${newMode}`));
|
|
172
|
+
},
|
|
173
|
+
plan: async () => {
|
|
174
|
+
console.log('Planning...');
|
|
175
|
+
const result = await (0, planner_1.runPlannerLoop)();
|
|
176
|
+
if (!result.success) {
|
|
177
|
+
console.log((0, ui_1.error)(result.message));
|
|
178
|
+
return;
|
|
179
|
+
}
|
|
180
|
+
console.log('Plan generated.');
|
|
181
|
+
console.log(`Steps: ${result.plan?.length || 0}`);
|
|
182
|
+
console.log('Use /generate to proceed.');
|
|
183
|
+
},
|
|
184
|
+
generate: async () => {
|
|
185
|
+
console.log('Generating...');
|
|
186
|
+
const result = await (0, planner_1.runGenerateLoop)();
|
|
187
|
+
if (!result.success) {
|
|
188
|
+
console.log((0, ui_1.error)(result.message));
|
|
189
|
+
return;
|
|
190
|
+
}
|
|
191
|
+
console.log('Changes generated.');
|
|
192
|
+
const fileCount = (result.changes?.files?.length || 0) + (result.changes?.diffs?.length || 0);
|
|
193
|
+
console.log(`Files: ${fileCount}`);
|
|
194
|
+
console.log('Use /diff to review.');
|
|
195
|
+
},
|
|
196
|
+
diff: () => {
|
|
197
|
+
const session = (0, session_1.getSession)();
|
|
198
|
+
// Check if there's a diff to display
|
|
199
|
+
if (!session.lastDiff) {
|
|
200
|
+
console.log('Nothing to review.');
|
|
201
|
+
return;
|
|
202
|
+
}
|
|
203
|
+
const response = session.lastDiff;
|
|
204
|
+
// Display file operations if present
|
|
205
|
+
if (response.files && response.files.length > 0) {
|
|
206
|
+
for (const file of response.files) {
|
|
207
|
+
console.log(`--- ${file.operation}: ${file.path} ---`);
|
|
208
|
+
if (file.content && file.operation !== 'delete') {
|
|
209
|
+
console.log(file.content);
|
|
210
|
+
}
|
|
211
|
+
console.log('');
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
// Display diffs if present
|
|
215
|
+
if (response.diffs && response.diffs.length > 0) {
|
|
216
|
+
for (const diff of response.diffs) {
|
|
217
|
+
console.log(`--- ${diff.file} ---`);
|
|
218
|
+
for (const hunk of diff.hunks) {
|
|
219
|
+
console.log(`@@ -${hunk.start},${hunk.end - hunk.start + 1} @@`);
|
|
220
|
+
console.log(hunk.content);
|
|
221
|
+
}
|
|
222
|
+
console.log('');
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
// If neither files nor diffs present
|
|
226
|
+
if ((!response.files || response.files.length === 0) &&
|
|
227
|
+
(!response.diffs || response.diffs.length === 0)) {
|
|
228
|
+
console.log('No file changes in last response.');
|
|
229
|
+
return;
|
|
230
|
+
}
|
|
231
|
+
},
|
|
232
|
+
apply: () => {
|
|
233
|
+
const session = (0, session_1.getSession)();
|
|
234
|
+
// Check dry run mode
|
|
235
|
+
if (session.dryRun) {
|
|
236
|
+
console.log((0, ui_1.error)('Dry-run mode. Apply blocked.'));
|
|
237
|
+
console.log('Use /dry-run off to disable.');
|
|
238
|
+
return;
|
|
239
|
+
}
|
|
240
|
+
// Warn on dirty git
|
|
241
|
+
const gitInfo = (0, git_1.getGitInfo)(session.workingDirectory);
|
|
242
|
+
if (gitInfo.isRepo && gitInfo.isDirty) {
|
|
243
|
+
console.log((0, ui_1.info)('Warning: uncommitted changes exist.'));
|
|
244
|
+
}
|
|
245
|
+
// Check if there are pending actions
|
|
246
|
+
if (!session.pendingActions) {
|
|
247
|
+
// Also check lastDiff as fallback
|
|
248
|
+
if (!session.lastDiff) {
|
|
249
|
+
console.log('Nothing to apply.');
|
|
250
|
+
return;
|
|
251
|
+
}
|
|
252
|
+
// Use lastDiff if no pendingActions
|
|
253
|
+
session.pendingActions = session.lastDiff;
|
|
254
|
+
}
|
|
255
|
+
const actions = session.pendingActions;
|
|
256
|
+
// Check if there are actual file operations
|
|
257
|
+
if ((!actions.files || actions.files.length === 0) &&
|
|
258
|
+
(!actions.diffs || actions.diffs.length === 0)) {
|
|
259
|
+
console.log('No file changes to apply.');
|
|
260
|
+
return;
|
|
261
|
+
}
|
|
262
|
+
// Apply using the apply engine
|
|
263
|
+
const result = (0, apply_1.applyResponse)(actions, {
|
|
264
|
+
basePath: session.workingDirectory,
|
|
265
|
+
dryRun: false,
|
|
266
|
+
});
|
|
267
|
+
if (!result.success) {
|
|
268
|
+
for (const failed of result.failed) {
|
|
269
|
+
console.log((0, ui_1.error)(`Failed: ${failed.path}: ${failed.error}`));
|
|
270
|
+
}
|
|
271
|
+
return;
|
|
272
|
+
}
|
|
273
|
+
// Clear pending actions after success
|
|
274
|
+
(0, session_1.setPendingActions)(null);
|
|
275
|
+
console.log('Applied.');
|
|
276
|
+
console.log('Session clean.');
|
|
277
|
+
},
|
|
278
|
+
workspace: () => {
|
|
279
|
+
const ws = (0, workspace_model_1.getWorkspace)();
|
|
280
|
+
ws.indexFileTree();
|
|
281
|
+
console.log(ws.printTreeSummary());
|
|
282
|
+
console.log(`Root: ${ws.getRoot()}`);
|
|
283
|
+
},
|
|
284
|
+
doctor: async () => {
|
|
285
|
+
console.log('System check...');
|
|
286
|
+
console.log('');
|
|
287
|
+
// Check 1: API key
|
|
288
|
+
const hasKey = await (0, auth_1.hasValidCredentials)();
|
|
289
|
+
console.log(`API key: ${hasKey ? (0, ui_1.success)('configured') : (0, ui_1.error)('missing')}`);
|
|
290
|
+
// Check 2: Config directory
|
|
291
|
+
const configExists = fs.existsSync(path.join(os.homedir(), '.zai'));
|
|
292
|
+
console.log(`Config dir: ${configExists ? (0, ui_1.success)('exists') : (0, ui_1.error)('missing')}`);
|
|
293
|
+
// Check 3: Working directory writable
|
|
294
|
+
const session = (0, session_1.getSession)();
|
|
295
|
+
let writable = false;
|
|
296
|
+
try {
|
|
297
|
+
const testFile = path.join(session.workingDirectory, '.zai-test');
|
|
298
|
+
fs.writeFileSync(testFile, 'test');
|
|
299
|
+
fs.unlinkSync(testFile);
|
|
300
|
+
writable = true;
|
|
301
|
+
}
|
|
302
|
+
catch {
|
|
303
|
+
writable = false;
|
|
304
|
+
}
|
|
305
|
+
console.log(`Workspace: ${writable ? (0, ui_1.success)('writable') : (0, ui_1.error)('read-only')}`);
|
|
306
|
+
// Check 4: Node version
|
|
307
|
+
const nodeVersion = process.version;
|
|
308
|
+
const major = parseInt(nodeVersion.slice(1).split('.')[0], 10);
|
|
309
|
+
console.log(`Node.js: ${major >= 18 ? (0, ui_1.success)(nodeVersion) : (0, ui_1.error)(`${nodeVersion} (requires 18+)`)}`);
|
|
310
|
+
// Summary
|
|
311
|
+
console.log('');
|
|
312
|
+
const allGood = hasKey && configExists && writable && major >= 18;
|
|
313
|
+
if (allGood) {
|
|
314
|
+
console.log((0, ui_1.success)('All checks passed.'));
|
|
315
|
+
}
|
|
316
|
+
else {
|
|
317
|
+
console.log((0, ui_1.error)('Some checks failed.'));
|
|
318
|
+
}
|
|
319
|
+
},
|
|
320
|
+
exit: () => { process.exit(0); },
|
|
321
|
+
exec: (ctx) => {
|
|
322
|
+
const command = ctx.args.join(' ');
|
|
323
|
+
if (!command) {
|
|
324
|
+
console.log('Usage: /exec <command>');
|
|
325
|
+
console.log('Allowed commands: ' + (0, shell_1.getAllowedCommands)().join(', '));
|
|
326
|
+
return;
|
|
327
|
+
}
|
|
328
|
+
// Validate before execution
|
|
329
|
+
const validation = (0, shell_1.validateCommand)(command);
|
|
330
|
+
if (!validation.valid) {
|
|
331
|
+
console.log((0, ui_1.error)(`Blocked: ${validation.error}`));
|
|
332
|
+
return;
|
|
333
|
+
}
|
|
334
|
+
console.log(`Executing: ${command}`);
|
|
335
|
+
const result = (0, shell_1.executeCommand)(command);
|
|
336
|
+
// Store in session
|
|
337
|
+
(0, session_1.setLastExecResult)(result);
|
|
338
|
+
if (result.success) {
|
|
339
|
+
if (result.stdout) {
|
|
340
|
+
console.log(result.stdout);
|
|
341
|
+
}
|
|
342
|
+
console.log((0, ui_1.success)(`Exit code: ${result.exitCode}`));
|
|
343
|
+
}
|
|
344
|
+
else {
|
|
345
|
+
if (result.stderr) {
|
|
346
|
+
console.log(result.stderr);
|
|
347
|
+
}
|
|
348
|
+
console.log((0, ui_1.error)(`Failed: ${result.error || `Exit code ${result.exitCode}`}`));
|
|
349
|
+
}
|
|
350
|
+
},
|
|
351
|
+
decompose: async () => {
|
|
352
|
+
const intent = (0, session_1.getIntent)();
|
|
353
|
+
if (!intent) {
|
|
354
|
+
console.log('No intent set. Enter a task first.');
|
|
355
|
+
return;
|
|
356
|
+
}
|
|
357
|
+
console.log('Decomposing task...');
|
|
358
|
+
const result = await (0, task_runner_1.decomposeTask)();
|
|
359
|
+
if (!result.success) {
|
|
360
|
+
console.log((0, ui_1.error)(result.message));
|
|
361
|
+
return;
|
|
362
|
+
}
|
|
363
|
+
console.log((0, ui_1.success)(result.message));
|
|
364
|
+
console.log('');
|
|
365
|
+
(0, task_runner_1.printProgress)();
|
|
366
|
+
console.log('');
|
|
367
|
+
console.log('Use /step to plan current step, or /next to advance.');
|
|
368
|
+
},
|
|
369
|
+
step: async () => {
|
|
370
|
+
const step = (0, session_1.getCurrentStep)();
|
|
371
|
+
if (!step) {
|
|
372
|
+
console.log('No current step. Use /decompose first.');
|
|
373
|
+
return;
|
|
374
|
+
}
|
|
375
|
+
console.log(`Planning step: ${step.description}`);
|
|
376
|
+
const result = await (0, task_runner_1.planCurrentStep)();
|
|
377
|
+
if (!result.success) {
|
|
378
|
+
console.log((0, ui_1.error)(result.message));
|
|
379
|
+
return;
|
|
380
|
+
}
|
|
381
|
+
console.log((0, ui_1.success)(result.message));
|
|
382
|
+
console.log('Use /generate to create changes, then /diff and /apply.');
|
|
383
|
+
},
|
|
384
|
+
next: () => {
|
|
385
|
+
const result = (0, task_runner_1.completeCurrentStep)();
|
|
386
|
+
if (!result.success) {
|
|
387
|
+
console.log((0, ui_1.error)(result.message));
|
|
388
|
+
return;
|
|
389
|
+
}
|
|
390
|
+
console.log((0, ui_1.success)(result.message));
|
|
391
|
+
if (result.hasMore) {
|
|
392
|
+
(0, task_runner_1.printProgress)();
|
|
393
|
+
}
|
|
394
|
+
},
|
|
395
|
+
skip: () => {
|
|
396
|
+
const result = (0, task_runner_1.skipCurrentStep)();
|
|
397
|
+
if (!result.success) {
|
|
398
|
+
console.log((0, ui_1.error)(result.message));
|
|
399
|
+
return;
|
|
400
|
+
}
|
|
401
|
+
console.log(result.message);
|
|
402
|
+
if (result.hasMore) {
|
|
403
|
+
(0, task_runner_1.printProgress)();
|
|
404
|
+
}
|
|
405
|
+
},
|
|
406
|
+
progress: () => {
|
|
407
|
+
(0, task_runner_1.printProgress)();
|
|
408
|
+
},
|
|
409
|
+
undo: (ctx) => {
|
|
410
|
+
const count = ctx.args[0] ? parseInt(ctx.args[0], 10) : 1;
|
|
411
|
+
if (isNaN(count) || count < 1) {
|
|
412
|
+
console.log('Usage: /undo [count]');
|
|
413
|
+
return;
|
|
414
|
+
}
|
|
415
|
+
if (count === 1) {
|
|
416
|
+
const result = (0, rollback_1.undoLast)();
|
|
417
|
+
if (result.success) {
|
|
418
|
+
console.log((0, ui_1.success)(result.message));
|
|
419
|
+
}
|
|
420
|
+
else {
|
|
421
|
+
console.log((0, ui_1.error)(result.message));
|
|
422
|
+
}
|
|
423
|
+
}
|
|
424
|
+
else {
|
|
425
|
+
const result = (0, rollback_1.undoN)(count);
|
|
426
|
+
for (const msg of result.messages) {
|
|
427
|
+
console.log(msg);
|
|
428
|
+
}
|
|
429
|
+
console.log((0, ui_1.success)(`Undone: ${result.undone} operation(s)`));
|
|
430
|
+
}
|
|
431
|
+
},
|
|
432
|
+
history: (ctx) => {
|
|
433
|
+
const subcommand = ctx.args[0];
|
|
434
|
+
if (subcommand === 'clear') {
|
|
435
|
+
(0, history_1.clearHistory)();
|
|
436
|
+
console.log('History cleared.');
|
|
437
|
+
return;
|
|
438
|
+
}
|
|
439
|
+
if (subcommand === 'last') {
|
|
440
|
+
const last = (0, history_1.getLastEntry)();
|
|
441
|
+
if (!last) {
|
|
442
|
+
console.log('No history.');
|
|
443
|
+
return;
|
|
444
|
+
}
|
|
445
|
+
console.log(`${last.timestamp}`);
|
|
446
|
+
console.log(` Intent: ${last.intent}`);
|
|
447
|
+
console.log(` Type: ${last.intentType}`);
|
|
448
|
+
console.log(` Outcome: ${last.outcome}`);
|
|
449
|
+
return;
|
|
450
|
+
}
|
|
451
|
+
const entries = (0, history_1.getHistory)(10);
|
|
452
|
+
if (entries.length === 0) {
|
|
453
|
+
console.log('No history.');
|
|
454
|
+
return;
|
|
455
|
+
}
|
|
456
|
+
console.log('Recent tasks:');
|
|
457
|
+
for (const e of entries) {
|
|
458
|
+
const ts = e.timestamp.split('T')[0];
|
|
459
|
+
const outcome = e.outcome === 'success' ? '+' : e.outcome === 'failed' ? 'x' : '-';
|
|
460
|
+
console.log(` [${outcome}] ${ts} ${e.intent.substring(0, 40)}`);
|
|
461
|
+
}
|
|
462
|
+
},
|
|
463
|
+
'undo-history': () => {
|
|
464
|
+
const entries = (0, rollback_1.getUndoHistory)();
|
|
465
|
+
if (entries.length === 0) {
|
|
466
|
+
console.log('No undo history.');
|
|
467
|
+
return;
|
|
468
|
+
}
|
|
469
|
+
console.log(`Undo history (${entries.length} entries):`);
|
|
470
|
+
// Show last 10 entries
|
|
471
|
+
const recent = entries.slice(-10).reverse();
|
|
472
|
+
for (let i = 0; i < recent.length; i++) {
|
|
473
|
+
const entry = recent[i];
|
|
474
|
+
const relativePath = path.relative(process.cwd(), entry.path);
|
|
475
|
+
console.log(` ${i + 1}. ${entry.operation}: ${relativePath}`);
|
|
476
|
+
}
|
|
477
|
+
if (entries.length > 10) {
|
|
478
|
+
console.log(` ... and ${entries.length - 10} more`);
|
|
479
|
+
}
|
|
480
|
+
},
|
|
481
|
+
profile: (ctx) => {
|
|
482
|
+
const subcommand = ctx.args[0];
|
|
483
|
+
if (!subcommand || subcommand === 'list') {
|
|
484
|
+
const profiles = (0, profiles_1.listProfiles)();
|
|
485
|
+
const active = (0, profiles_1.getActiveProfileName)();
|
|
486
|
+
console.log('Profiles:');
|
|
487
|
+
for (const p of profiles) {
|
|
488
|
+
const marker = p.name === active ? '*' : ' ';
|
|
489
|
+
console.log(` ${marker} ${p.name} - ${p.description}`);
|
|
490
|
+
}
|
|
491
|
+
return;
|
|
492
|
+
}
|
|
493
|
+
if (subcommand === 'set') {
|
|
494
|
+
const name = ctx.args[1];
|
|
495
|
+
if (!name) {
|
|
496
|
+
console.log('Usage: /profile set <name>');
|
|
497
|
+
return;
|
|
498
|
+
}
|
|
499
|
+
if ((0, profiles_1.applyProfile)(name)) {
|
|
500
|
+
console.log((0, ui_1.success)(`Profile set: ${name}`));
|
|
501
|
+
}
|
|
502
|
+
else {
|
|
503
|
+
console.log((0, ui_1.error)(`Unknown profile: ${name}`));
|
|
504
|
+
}
|
|
505
|
+
return;
|
|
506
|
+
}
|
|
507
|
+
console.log('Usage: /profile [list | set <name>]');
|
|
508
|
+
},
|
|
509
|
+
'dry-run': (ctx) => {
|
|
510
|
+
const arg = ctx.args[0]?.toLowerCase();
|
|
511
|
+
if (!arg) {
|
|
512
|
+
const current = (0, session_1.isDryRun)();
|
|
513
|
+
console.log(`Dry-run: ${current ? 'on' : 'off'}`);
|
|
514
|
+
return;
|
|
515
|
+
}
|
|
516
|
+
if (arg === 'on') {
|
|
517
|
+
(0, session_1.setDryRun)(true);
|
|
518
|
+
console.log('Dry-run enabled. Apply will be blocked.');
|
|
519
|
+
}
|
|
520
|
+
else if (arg === 'off') {
|
|
521
|
+
(0, session_1.setDryRun)(false);
|
|
522
|
+
console.log('Dry-run disabled.');
|
|
523
|
+
}
|
|
524
|
+
else {
|
|
525
|
+
console.log('Usage: /dry-run [on | off]');
|
|
526
|
+
}
|
|
527
|
+
},
|
|
528
|
+
git: () => {
|
|
529
|
+
const session = (0, session_1.getSession)();
|
|
530
|
+
const info = (0, git_1.getGitInfo)(session.workingDirectory);
|
|
531
|
+
if (!info.isRepo) {
|
|
532
|
+
console.log('Not a git repository.');
|
|
533
|
+
return;
|
|
534
|
+
}
|
|
535
|
+
console.log(`Repository: ${info.repoName}`);
|
|
536
|
+
console.log(`Branch: ${info.branch}`);
|
|
537
|
+
console.log(`Status: ${info.isDirty ? 'dirty' : 'clean'}`);
|
|
538
|
+
if (info.uncommittedFiles > 0) {
|
|
539
|
+
console.log(`Uncommitted files: ${info.uncommittedFiles}`);
|
|
540
|
+
}
|
|
541
|
+
},
|
|
542
|
+
};
|
|
543
|
+
// Execute a parsed slash command
|
|
544
|
+
async function executeCommand(parsed) {
|
|
545
|
+
if (!parsed.isSlashCommand || !parsed.command) {
|
|
546
|
+
return false;
|
|
547
|
+
}
|
|
548
|
+
const handler = handlers[parsed.command];
|
|
549
|
+
if (!handler) {
|
|
550
|
+
console.log(`Unknown command: /${parsed.command}`);
|
|
551
|
+
return true;
|
|
552
|
+
}
|
|
553
|
+
await handler({ args: parsed.args || [], rawInput: parsed.rawInput });
|
|
554
|
+
return true;
|
|
555
|
+
}
|
|
556
|
+
// Get list of available commands
|
|
557
|
+
function getAvailableCommands() {
|
|
558
|
+
return Object.keys(handlers);
|
|
559
|
+
}
|
|
560
|
+
//# sourceMappingURL=commands.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"commands.js","sourceRoot":"","sources":["../src/commands.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoDA,gCAiBC;AAihBD,wCAaC;AAGD,oDAEC;AAxmBD,uCAiBmB;AACnB,yCAAgF;AAChF,+BAAmC;AACnC,yCAA8E;AAC9E,uCAA4G;AAC5G,mDAAmD;AACnD,mCAA8G;AAC9G,uDAAiD;AACjD,iCAAkE;AAGlE,mCAAwC;AACxC,6BAAkD;AAClD,uCAA4D;AAC5D,+CAAoH;AACpH,yCAA+E;AAC/E,2CAA6B;AAC7B,uCAAyB;AACzB,uCAAyB;AAgBzB,uCAAuC;AACvC,SAAgB,UAAU,CAAC,KAAa;IACtC,MAAM,OAAO,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC;IAE7B,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;QAC7B,OAAO,EAAE,cAAc,EAAE,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC;IACtD,CAAC;IAED,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAA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AC;QACtC,OAAO,CAAC,GAAG,CAAC,WAAW,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC;QAC3D,IAAI,IAAI,CAAC,gBAAgB,GAAG,CAAC,EAAE,CAAC;YAC9B,OAAO,CAAC,GAAG,CAAC,sBAAsB,IAAI,CAAC,gBAAgB,EAAE,CAAC,CAAC;QAC7D,CAAC;IACH,CAAC;CACF,CAAC;AAEF,iCAAiC;AAC1B,KAAK,UAAU,cAAc,CAAC,MAAqB;IACxD,IAAI,CAAC,MAAM,CAAC,cAAc,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;QAC9C,OAAO,KAAK,CAAC;IACf,CAAC;IAED,MAAM,OAAO,GAAG,QAAQ,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IACzC,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,OAAO,CAAC,GAAG,CAAC,qBAAqB,MAAM,CAAC,OAAO,EAAE,CAAC,CAAC;QACnD,OAAO,IAAI,CAAC;IACd,CAAC;IAED,MAAM,OAAO,CAAC,EAAE,IAAI,EAAE,MAAM,CAAC,IAAI,IAAI,EAAE,EAAE,QAAQ,EAAE,MAAM,CAAC,QAAQ,EAAE,CAAC,CAAC;IACtE,OAAO,IAAI,CAAC;AACd,CAAC;AAED,iCAAiC;AACjC,SAAgB,oBAAoB;IAClC,OAAO,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;AAC/B,CAAC"}
|
package/dist/config.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare const CONFIG_DIR: string;
|
|
2
|
+
export declare const CONFIG_PATH: string;
|
|
3
|
+
export declare const STATE_PATH: string;
|
|
4
|
+
export declare function ensureConfigDir(): void;
|
|
5
|
+
export declare function loadConfig(): Record<string, unknown>;
|
|
6
|
+
export declare function saveConfig(config: Record<string, unknown>): void;
|
|
7
|
+
export declare function loadState(): Record<string, unknown>;
|
|
8
|
+
export declare function saveState(state: Record<string, unknown>): void;
|
|
9
|
+
//# sourceMappingURL=config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,UAAU,QAAkC,CAAC;AAC1D,eAAO,MAAM,WAAW,QAAuC,CAAC;AAChE,eAAO,MAAM,UAAU,QAAsC,CAAC;AAY9D,wBAAgB,eAAe,IAAI,IAAI,CAItC;AAED,wBAAgB,UAAU,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAYpD;AAED,wBAAgB,UAAU,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAGhE;AAED,wBAAgB,SAAS,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAYnD;AAED,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAG9D"}
|