@gowelle/stint-agent 1.2.24 → 1.2.26
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/dist/{StatusDashboard-LBWMHOJP.js → StatusDashboard-6BRCPQQO.js} +2 -2
- package/dist/api-3Y72TBXG.js +7 -0
- package/dist/{chunk-ZBOIXU7G.js → chunk-CCMXVYVO.js} +198 -43
- package/dist/{chunk-YXU3YS4B.js → chunk-YXNR7UVV.js} +24 -2
- package/dist/{chunk-7HPDJIUC.js → chunk-Z7ZSQCVR.js} +22 -11
- package/dist/{chunk-OPGKT2KO.js → chunk-ZHIGA6EY.js} +1 -1
- package/dist/daemon/runner.js +4 -4
- package/dist/index.js +6 -6
- package/package.json +1 -1
- package/dist/api-SBH72CS3.js +0 -7
|
@@ -2,10 +2,10 @@ import {
|
|
|
2
2
|
gitService,
|
|
3
3
|
projectService,
|
|
4
4
|
validatePidFile
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-Z7ZSQCVR.js";
|
|
6
6
|
import {
|
|
7
7
|
authService
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-ZHIGA6EY.js";
|
|
9
9
|
|
|
10
10
|
// src/components/StatusDashboard.tsx
|
|
11
11
|
import { useState, useEffect } from "react";
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
apiService
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-YXNR7UVV.js";
|
|
4
4
|
import {
|
|
5
5
|
gitService,
|
|
6
6
|
projectService
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-Z7ZSQCVR.js";
|
|
8
8
|
import {
|
|
9
9
|
authService,
|
|
10
10
|
config,
|
|
11
11
|
logger
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-ZHIGA6EY.js";
|
|
13
13
|
|
|
14
14
|
// src/utils/notify.ts
|
|
15
15
|
import notifier from "node-notifier";
|
|
@@ -43,8 +43,84 @@ function notify(options) {
|
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
+
// src/utils/streamer.ts
|
|
47
|
+
var OutputBuffer = class {
|
|
48
|
+
buffer = "";
|
|
49
|
+
commitId;
|
|
50
|
+
lastSendTime = 0;
|
|
51
|
+
timer = null;
|
|
52
|
+
MAX_BUFFER_SIZE = 50 * 1024;
|
|
53
|
+
// 50KB safety limit
|
|
54
|
+
FLUSH_INTERVAL = 500;
|
|
55
|
+
// 500ms
|
|
56
|
+
MIN_CHUNK_SIZE = 100;
|
|
57
|
+
// Minimum characters to trigger immediate send (optional optimization)
|
|
58
|
+
isClosed = false;
|
|
59
|
+
constructor(commitId) {
|
|
60
|
+
this.commitId = commitId;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Add output to the buffer
|
|
64
|
+
* @param data String data to append
|
|
65
|
+
*/
|
|
66
|
+
append(data) {
|
|
67
|
+
if (this.isClosed) return;
|
|
68
|
+
const text = typeof data === "string" ? data : String(data);
|
|
69
|
+
if (!text) return;
|
|
70
|
+
this.buffer += text;
|
|
71
|
+
if (this.buffer.length > this.MAX_BUFFER_SIZE) {
|
|
72
|
+
this.flush();
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
this.scheduleFlush();
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Schedule a flush operation
|
|
79
|
+
*/
|
|
80
|
+
scheduleFlush() {
|
|
81
|
+
const now = Date.now();
|
|
82
|
+
const timeSinceLastSend = now - this.lastSendTime;
|
|
83
|
+
if (this.timer) {
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
if (timeSinceLastSend >= this.FLUSH_INTERVAL) {
|
|
87
|
+
this.flush();
|
|
88
|
+
} else {
|
|
89
|
+
const delay = this.FLUSH_INTERVAL - timeSinceLastSend;
|
|
90
|
+
this.timer = setTimeout(() => this.flush(), delay);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Flush current buffer to API
|
|
95
|
+
*/
|
|
96
|
+
async flush() {
|
|
97
|
+
if (this.timer) {
|
|
98
|
+
clearTimeout(this.timer);
|
|
99
|
+
this.timer = null;
|
|
100
|
+
}
|
|
101
|
+
if (!this.buffer) {
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
104
|
+
const chunk = this.buffer;
|
|
105
|
+
this.buffer = "";
|
|
106
|
+
this.lastSendTime = Date.now();
|
|
107
|
+
try {
|
|
108
|
+
await apiService.streamCommitOutput(this.commitId, chunk);
|
|
109
|
+
} catch (error) {
|
|
110
|
+
logger.debug("stream", `Failed to stream output for ${this.commitId}`, error);
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Close the buffer and flush remaining data
|
|
115
|
+
*/
|
|
116
|
+
async close() {
|
|
117
|
+
this.isClosed = true;
|
|
118
|
+
await this.flush();
|
|
119
|
+
}
|
|
120
|
+
};
|
|
121
|
+
|
|
46
122
|
// src/services/hook.ts
|
|
47
|
-
import {
|
|
123
|
+
import { spawn } from "child_process";
|
|
48
124
|
var HookService = class {
|
|
49
125
|
/**
|
|
50
126
|
* Execute a list of hooks sequentially
|
|
@@ -52,7 +128,7 @@ var HookService = class {
|
|
|
52
128
|
* @param cwd Current working directory (project root)
|
|
53
129
|
* @returns List of results
|
|
54
130
|
*/
|
|
55
|
-
async executeHooks(hooks, cwd) {
|
|
131
|
+
async executeHooks(hooks, cwd, onOutput) {
|
|
56
132
|
const results = [];
|
|
57
133
|
const enabledHooks = hooks.filter((h) => h.enabled);
|
|
58
134
|
if (enabledHooks.length === 0) {
|
|
@@ -61,7 +137,7 @@ var HookService = class {
|
|
|
61
137
|
logger.info("hooks", `Running ${enabledHooks.length} pre-commit hooks...`);
|
|
62
138
|
for (const hook of enabledHooks) {
|
|
63
139
|
try {
|
|
64
|
-
const result = await this.executeSingleHook(hook, cwd);
|
|
140
|
+
const result = await this.executeSingleHook(hook, cwd, onOutput);
|
|
65
141
|
results.push(result);
|
|
66
142
|
if (!result.success && hook.blockOnFailure) {
|
|
67
143
|
logger.warn("hooks", `Hook "${hook.name}" failed and is blocking. Stopping execution.`);
|
|
@@ -88,48 +164,74 @@ var HookService = class {
|
|
|
88
164
|
/**
|
|
89
165
|
* Execute a single hook with timeout
|
|
90
166
|
*/
|
|
91
|
-
executeSingleHook(hook, cwd) {
|
|
167
|
+
executeSingleHook(hook, cwd, onOutput) {
|
|
92
168
|
return new Promise((resolve) => {
|
|
93
169
|
const startTime = Date.now();
|
|
94
170
|
logger.debug("hooks", `Executing hook: ${hook.name} (${hook.command})`);
|
|
95
|
-
|
|
96
|
-
|
|
171
|
+
if (onOutput) {
|
|
172
|
+
onOutput(`
|
|
173
|
+
> Running hook: ${hook.name}
|
|
174
|
+
`);
|
|
175
|
+
}
|
|
176
|
+
const child = spawn(hook.command, {
|
|
97
177
|
cwd,
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
178
|
+
shell: true,
|
|
179
|
+
stdio: ["ignore", "pipe", "pipe"],
|
|
180
|
+
env: { ...process.env, FORCE_COLOR: "1" }
|
|
181
|
+
// Force color output for better terminal experience
|
|
182
|
+
});
|
|
183
|
+
let combinedOutput = "";
|
|
184
|
+
child.stdout.on("data", (data) => {
|
|
185
|
+
const text = data.toString();
|
|
186
|
+
combinedOutput += text;
|
|
187
|
+
if (onOutput) onOutput(text);
|
|
188
|
+
});
|
|
189
|
+
child.stderr.on("data", (data) => {
|
|
190
|
+
const text = data.toString();
|
|
191
|
+
combinedOutput += text;
|
|
192
|
+
if (onOutput) onOutput(text);
|
|
193
|
+
});
|
|
194
|
+
const timeoutMs = hook.timeout || 3e4;
|
|
195
|
+
const timeoutTimer = setTimeout(() => {
|
|
196
|
+
if (child.kill()) {
|
|
197
|
+
const duration = Date.now() - startTime;
|
|
198
|
+
const timeoutMsg = `
|
|
199
|
+
Hook timed out after ${timeoutMs}ms`;
|
|
200
|
+
combinedOutput += timeoutMsg;
|
|
201
|
+
if (onOutput) onOutput(timeoutMsg);
|
|
116
202
|
resolve({
|
|
117
203
|
hookId: hook.id,
|
|
118
204
|
hookName: hook.name,
|
|
119
205
|
success: false,
|
|
120
|
-
output: combinedOutput,
|
|
121
|
-
error:
|
|
122
|
-
duration
|
|
123
|
-
});
|
|
124
|
-
} else {
|
|
125
|
-
resolve({
|
|
126
|
-
hookId: hook.id,
|
|
127
|
-
hookName: hook.name,
|
|
128
|
-
success: true,
|
|
129
|
-
output: combinedOutput,
|
|
206
|
+
output: combinedOutput.trim(),
|
|
207
|
+
error: `Timed out after ${timeoutMs}ms`,
|
|
130
208
|
duration
|
|
131
209
|
});
|
|
132
210
|
}
|
|
211
|
+
}, timeoutMs);
|
|
212
|
+
child.on("close", (code) => {
|
|
213
|
+
clearTimeout(timeoutTimer);
|
|
214
|
+
const duration = Date.now() - startTime;
|
|
215
|
+
resolve({
|
|
216
|
+
hookId: hook.id,
|
|
217
|
+
hookName: hook.name,
|
|
218
|
+
success: code === 0,
|
|
219
|
+
output: combinedOutput.trim(),
|
|
220
|
+
error: code !== 0 ? `Process exited with code ${code}` : void 0,
|
|
221
|
+
duration
|
|
222
|
+
});
|
|
223
|
+
});
|
|
224
|
+
child.on("error", (err) => {
|
|
225
|
+
clearTimeout(timeoutTimer);
|
|
226
|
+
const duration = Date.now() - startTime;
|
|
227
|
+
resolve({
|
|
228
|
+
hookId: hook.id,
|
|
229
|
+
hookName: hook.name,
|
|
230
|
+
success: false,
|
|
231
|
+
output: combinedOutput.trim(),
|
|
232
|
+
error: err.message,
|
|
233
|
+
duration
|
|
234
|
+
});
|
|
133
235
|
});
|
|
134
236
|
});
|
|
135
237
|
}
|
|
@@ -174,13 +276,21 @@ var CommitQueueProcessor = class {
|
|
|
174
276
|
*/
|
|
175
277
|
async executeCommit(commit, project, onProgress, options) {
|
|
176
278
|
logger.info("queue", `Processing commit: ${commit.id} - ${commit.message}`);
|
|
279
|
+
const streamer = new OutputBuffer(commit.id);
|
|
280
|
+
const streamOutput = (text) => {
|
|
281
|
+
streamer.append(text);
|
|
282
|
+
};
|
|
177
283
|
try {
|
|
284
|
+
streamer.append(`Processing commit: ${commit.message}
|
|
285
|
+
`);
|
|
178
286
|
onProgress?.("Finding project directory...");
|
|
179
287
|
const projectPath = this.findProjectPath(project.id);
|
|
180
288
|
if (!projectPath) {
|
|
181
289
|
throw new Error(`Project ${project.id} is not linked to any local directory`);
|
|
182
290
|
}
|
|
183
291
|
logger.info("queue", `Executing in directory: ${projectPath}`);
|
|
292
|
+
streamer.append(`> Project directory: ${projectPath}
|
|
293
|
+
`);
|
|
184
294
|
onProgress?.("Validating repository...");
|
|
185
295
|
const isRepo = await gitService.isRepo(projectPath);
|
|
186
296
|
if (!isRepo) {
|
|
@@ -189,13 +299,21 @@ var CommitQueueProcessor = class {
|
|
|
189
299
|
if (project.commitSettings?.hooks?.length) {
|
|
190
300
|
onProgress?.("Running pre-commit hooks...");
|
|
191
301
|
logger.info("queue", "Executing pre-commit hooks...");
|
|
192
|
-
|
|
302
|
+
streamer.append("\n> Executing pre-commit hooks...\n");
|
|
303
|
+
const hookResults = await hookService.executeHooks(
|
|
304
|
+
project.commitSettings.hooks,
|
|
305
|
+
projectPath,
|
|
306
|
+
streamOutput
|
|
307
|
+
);
|
|
193
308
|
const failedBlockingHook = hookResults.find(
|
|
194
309
|
(r) => !r.success && project.commitSettings?.hooks.find((h) => h.id === r.hookId)?.blockOnFailure
|
|
195
310
|
);
|
|
196
311
|
if (failedBlockingHook) {
|
|
197
312
|
const errorMsg = failedBlockingHook.error || "Unknown error";
|
|
198
313
|
logger.error("queue", `Blocking hook "${failedBlockingHook.hookName}" failed: ${errorMsg}`);
|
|
314
|
+
streamer.append(`
|
|
315
|
+
Error: Blocking hook "${failedBlockingHook.hookName}" failed: ${errorMsg}
|
|
316
|
+
`);
|
|
199
317
|
if (failedBlockingHook.output) {
|
|
200
318
|
logger.warn("queue", `Hook output:
|
|
201
319
|
${failedBlockingHook.output}`);
|
|
@@ -205,20 +323,29 @@ ${failedBlockingHook.output}`);
|
|
|
205
323
|
const failedNonBlockingHooks = hookResults.filter((r) => !r.success);
|
|
206
324
|
if (failedNonBlockingHooks.length > 0) {
|
|
207
325
|
logger.warn("queue", `${failedNonBlockingHooks.length} hooks failed but were not blocking: ${failedNonBlockingHooks.map((h) => h.hookName).join(", ")}`);
|
|
326
|
+
streamer.append(`
|
|
327
|
+
Warning: ${failedNonBlockingHooks.length} non-blocking hooks failed.
|
|
328
|
+
`);
|
|
208
329
|
}
|
|
209
330
|
}
|
|
210
331
|
onProgress?.("Checking repository status...");
|
|
211
332
|
let status = await gitService.getStatus(projectPath);
|
|
212
333
|
if (commit.files && commit.files.length > 0) {
|
|
213
334
|
onProgress?.(`Staging ${commit.files.length} specified files...`);
|
|
214
|
-
|
|
335
|
+
streamer.append(`
|
|
336
|
+
> Staging ${commit.files.length} files...
|
|
337
|
+
`);
|
|
338
|
+
await gitService.stageFiles(projectPath, commit.files, streamOutput);
|
|
215
339
|
status = await gitService.getStatus(projectPath);
|
|
216
340
|
logger.info("queue", `Auto-staged files: ${commit.files.join(", ")}`);
|
|
217
341
|
} else if (status.staged.length === 0) {
|
|
218
342
|
const hasChanges = status.unstaged.length > 0 || status.untracked.length > 0;
|
|
219
343
|
if (hasChanges) {
|
|
220
344
|
onProgress?.("Staging all changes...");
|
|
221
|
-
|
|
345
|
+
streamer.append(`
|
|
346
|
+
> Auto-staging all changes...
|
|
347
|
+
`);
|
|
348
|
+
await gitService.stageAll(projectPath, streamOutput);
|
|
222
349
|
status = await gitService.getStatus(projectPath);
|
|
223
350
|
logger.info("queue", `Auto-staged all changes`);
|
|
224
351
|
}
|
|
@@ -227,19 +354,31 @@ ${failedBlockingHook.output}`);
|
|
|
227
354
|
throw new Error("No changes to commit. The working directory is clean.");
|
|
228
355
|
}
|
|
229
356
|
logger.info("queue", `Committing ${status.staged.length} staged files.`);
|
|
357
|
+
streamer.append(`
|
|
358
|
+
> Committing ${status.staged.length} staged files...
|
|
359
|
+
`);
|
|
230
360
|
onProgress?.("Creating commit...");
|
|
231
361
|
logger.info("queue", `Creating commit with message: "${commit.message}"`);
|
|
232
|
-
const sha = await gitService.commit(projectPath, commit.message);
|
|
362
|
+
const sha = await gitService.commit(projectPath, commit.message, streamOutput);
|
|
233
363
|
logger.success("queue", `Commit created successfully: ${sha}`);
|
|
364
|
+
streamer.append(`
|
|
365
|
+
> Commit created: ${sha}
|
|
366
|
+
`);
|
|
234
367
|
let pushed = false;
|
|
235
368
|
let pushError;
|
|
236
369
|
const shouldPush = options?.push !== false;
|
|
237
370
|
if (shouldPush) {
|
|
238
371
|
try {
|
|
239
372
|
onProgress?.("Pushing to remote...");
|
|
240
|
-
|
|
373
|
+
streamer.append(`
|
|
374
|
+
> Pushing to remote...
|
|
375
|
+
`);
|
|
376
|
+
await gitService.push(projectPath, void 0, void 0, streamOutput);
|
|
241
377
|
pushed = true;
|
|
242
378
|
logger.success("queue", `Pushed commit ${sha} to remote`);
|
|
379
|
+
streamer.append(`
|
|
380
|
+
> Implementation sent to remote successfully.
|
|
381
|
+
`);
|
|
243
382
|
notify({
|
|
244
383
|
title: `Commit Pushed - ${project.name}`,
|
|
245
384
|
message: `Commit "${commit.message}" successfully pushed.`
|
|
@@ -247,6 +386,9 @@ ${failedBlockingHook.output}`);
|
|
|
247
386
|
} catch (error) {
|
|
248
387
|
pushError = error.message;
|
|
249
388
|
const isConflict = pushError.includes("rejected") || pushError.includes("non-fast-forward") || pushError.includes("failed to push") || pushError.includes("Updates were rejected");
|
|
389
|
+
streamer.append(`
|
|
390
|
+
> Push failed: ${pushError}
|
|
391
|
+
`);
|
|
250
392
|
if (isConflict) {
|
|
251
393
|
logger.warn("queue", `Push failed due to remote conflict: ${pushError}`);
|
|
252
394
|
notify({
|
|
@@ -265,6 +407,10 @@ Run "git pull --rebase" to resolve.`
|
|
|
265
407
|
}
|
|
266
408
|
onProgress?.("Reporting to server...");
|
|
267
409
|
await this.reportSuccess(commit.id, sha, pushed, pushError);
|
|
410
|
+
streamer.append(`
|
|
411
|
+
> Execution completed.
|
|
412
|
+
`);
|
|
413
|
+
await streamer.close();
|
|
268
414
|
if (!pushed && !pushError) {
|
|
269
415
|
notify({
|
|
270
416
|
title: `Commit Created - ${project.name}`,
|
|
@@ -275,6 +421,10 @@ Run "git pull --rebase" to resolve.`
|
|
|
275
421
|
} catch (error) {
|
|
276
422
|
const msg = error.message;
|
|
277
423
|
logger.error("queue", `Commit execution failed: ${msg}`);
|
|
424
|
+
streamer.append(`
|
|
425
|
+
> Execution failed: ${msg}
|
|
426
|
+
`);
|
|
427
|
+
await streamer.close();
|
|
278
428
|
notify({
|
|
279
429
|
title: `Commit Failed - ${project.name}`,
|
|
280
430
|
message: `Failed to execute commit "${commit.message}": ${msg}`
|
|
@@ -382,6 +532,11 @@ var WebSocketServiceImpl = class {
|
|
|
382
532
|
* @throws Error if connection fails or no auth token available
|
|
383
533
|
*/
|
|
384
534
|
async connect() {
|
|
535
|
+
if (this.echo) {
|
|
536
|
+
logger.debug("websocket", "Closing existing connection before reconnecting...");
|
|
537
|
+
this.echo.disconnect();
|
|
538
|
+
this.echo = null;
|
|
539
|
+
}
|
|
385
540
|
try {
|
|
386
541
|
const token = await authService.getToken();
|
|
387
542
|
if (!token) {
|
|
@@ -561,7 +716,7 @@ var WebSocketServiceImpl = class {
|
|
|
561
716
|
if (commit.has_large_files) {
|
|
562
717
|
try {
|
|
563
718
|
logger.info("websocket", `Commit ${commit.id} marked as large, fetching full details...`);
|
|
564
|
-
const { apiService: apiService2 } = await import("./api-
|
|
719
|
+
const { apiService: apiService2 } = await import("./api-3Y72TBXG.js");
|
|
565
720
|
const fullCommit = await apiService2.getCommit(commit.id);
|
|
566
721
|
commit = {
|
|
567
722
|
...commit,
|
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
authService,
|
|
3
3
|
config,
|
|
4
4
|
logger
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-ZHIGA6EY.js";
|
|
6
6
|
|
|
7
7
|
// src/utils/circuit-breaker.ts
|
|
8
8
|
var CircuitBreaker = class {
|
|
@@ -98,7 +98,7 @@ var CircuitBreaker = class {
|
|
|
98
98
|
};
|
|
99
99
|
|
|
100
100
|
// src/services/api.ts
|
|
101
|
-
var AGENT_VERSION = "1.2.
|
|
101
|
+
var AGENT_VERSION = "1.2.26";
|
|
102
102
|
var ApiServiceImpl = class {
|
|
103
103
|
sessionId = null;
|
|
104
104
|
circuitBreaker = new CircuitBreaker({
|
|
@@ -399,6 +399,9 @@ var ApiServiceImpl = class {
|
|
|
399
399
|
logger.info("api", `Fetched user: ${user.email}`);
|
|
400
400
|
return user;
|
|
401
401
|
}
|
|
402
|
+
/**
|
|
403
|
+
* Create project
|
|
404
|
+
*/
|
|
402
405
|
async createProject(data) {
|
|
403
406
|
logger.info("api", `Creating project: ${data.name}`);
|
|
404
407
|
const response = await this.request("/api/agent/projects", {
|
|
@@ -409,6 +412,25 @@ var ApiServiceImpl = class {
|
|
|
409
412
|
logger.success("api", `Created project: ${project.name} (${project.id})`);
|
|
410
413
|
return project;
|
|
411
414
|
}
|
|
415
|
+
/**
|
|
416
|
+
* Stream commit output chunk to API
|
|
417
|
+
* @param commitId - Commit ID
|
|
418
|
+
* @param output - Output chunk string
|
|
419
|
+
*/
|
|
420
|
+
async streamCommitOutput(commitId, output) {
|
|
421
|
+
if (!output) return;
|
|
422
|
+
try {
|
|
423
|
+
await this.request(`/api/agent/commits/${commitId}/stream`, {
|
|
424
|
+
method: "POST",
|
|
425
|
+
body: JSON.stringify({ output }),
|
|
426
|
+
headers: {
|
|
427
|
+
// customized headers if needed
|
|
428
|
+
}
|
|
429
|
+
});
|
|
430
|
+
} catch (error) {
|
|
431
|
+
logger.debug("api", `Stream failed for ${commitId}`, error);
|
|
432
|
+
}
|
|
433
|
+
}
|
|
412
434
|
};
|
|
413
435
|
var apiService = new ApiServiceImpl();
|
|
414
436
|
|
|
@@ -1,13 +1,24 @@
|
|
|
1
1
|
import {
|
|
2
2
|
config,
|
|
3
3
|
logger
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-ZHIGA6EY.js";
|
|
5
5
|
|
|
6
6
|
// src/services/git.ts
|
|
7
7
|
import simpleGit from "simple-git";
|
|
8
8
|
var GitServiceImpl = class {
|
|
9
|
-
getGit(path3) {
|
|
10
|
-
|
|
9
|
+
getGit(path3, onOutput) {
|
|
10
|
+
const git = simpleGit(path3);
|
|
11
|
+
if (onOutput) {
|
|
12
|
+
git.outputHandler((_command, stdout, stderr) => {
|
|
13
|
+
stdout.on("data", (data) => {
|
|
14
|
+
onOutput(data.toString());
|
|
15
|
+
});
|
|
16
|
+
stderr.on("data", (data) => {
|
|
17
|
+
onOutput(data.toString());
|
|
18
|
+
});
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
return git;
|
|
11
22
|
}
|
|
12
23
|
/**
|
|
13
24
|
* Check if a directory is a git repository
|
|
@@ -78,9 +89,9 @@ var GitServiceImpl = class {
|
|
|
78
89
|
throw new Error(`Failed to get repository information: ${error.message}`);
|
|
79
90
|
}
|
|
80
91
|
}
|
|
81
|
-
async stageAll(path3) {
|
|
92
|
+
async stageAll(path3, onOutput) {
|
|
82
93
|
try {
|
|
83
|
-
const git = this.getGit(path3);
|
|
94
|
+
const git = this.getGit(path3, onOutput);
|
|
84
95
|
await git.add(".");
|
|
85
96
|
logger.info("git", `Staged all changes in ${path3}`);
|
|
86
97
|
} catch (error) {
|
|
@@ -88,9 +99,9 @@ var GitServiceImpl = class {
|
|
|
88
99
|
throw new Error(`Failed to stage changes: ${error.message}`);
|
|
89
100
|
}
|
|
90
101
|
}
|
|
91
|
-
async stageFiles(path3, files) {
|
|
102
|
+
async stageFiles(path3, files, onOutput) {
|
|
92
103
|
try {
|
|
93
|
-
const git = this.getGit(path3);
|
|
104
|
+
const git = this.getGit(path3, onOutput);
|
|
94
105
|
await git.add(files);
|
|
95
106
|
logger.info("git", `Staged ${files.length} files in ${path3}`);
|
|
96
107
|
} catch (error) {
|
|
@@ -98,9 +109,9 @@ var GitServiceImpl = class {
|
|
|
98
109
|
throw new Error(`Failed to stage files: ${error.message}`);
|
|
99
110
|
}
|
|
100
111
|
}
|
|
101
|
-
async commit(path3, message) {
|
|
112
|
+
async commit(path3, message, onOutput) {
|
|
102
113
|
try {
|
|
103
|
-
const git = this.getGit(path3);
|
|
114
|
+
const git = this.getGit(path3, onOutput);
|
|
104
115
|
const result = await git.commit(message);
|
|
105
116
|
const sha = result.commit;
|
|
106
117
|
logger.success("git", `Created commit ${sha} in ${path3}`);
|
|
@@ -223,9 +234,9 @@ var GitServiceImpl = class {
|
|
|
223
234
|
* @param remote - Remote name (default: 'origin')
|
|
224
235
|
* @param branch - Branch name (optional, uses current branch if not specified)
|
|
225
236
|
*/
|
|
226
|
-
async push(path3, remote = "origin", branch) {
|
|
237
|
+
async push(path3, remote = "origin", branch, onOutput) {
|
|
227
238
|
try {
|
|
228
|
-
const git = this.getGit(path3);
|
|
239
|
+
const git = this.getGit(path3, onOutput);
|
|
229
240
|
if (branch) {
|
|
230
241
|
await git.push(remote, branch);
|
|
231
242
|
} else {
|
|
@@ -308,7 +308,7 @@ var AuthServiceImpl = class {
|
|
|
308
308
|
return null;
|
|
309
309
|
}
|
|
310
310
|
try {
|
|
311
|
-
const { apiService } = await import("./api-
|
|
311
|
+
const { apiService } = await import("./api-3Y72TBXG.js");
|
|
312
312
|
const user = await apiService.getCurrentUser();
|
|
313
313
|
logger.info("auth", `Token validated for user: ${user.email}`);
|
|
314
314
|
return user;
|
package/dist/daemon/runner.js
CHANGED
|
@@ -3,20 +3,20 @@ import {
|
|
|
3
3
|
commitQueue,
|
|
4
4
|
notify,
|
|
5
5
|
websocketService
|
|
6
|
-
} from "../chunk-
|
|
6
|
+
} from "../chunk-CCMXVYVO.js";
|
|
7
7
|
import {
|
|
8
8
|
apiService
|
|
9
|
-
} from "../chunk-
|
|
9
|
+
} from "../chunk-YXNR7UVV.js";
|
|
10
10
|
import {
|
|
11
11
|
gitService,
|
|
12
12
|
projectService,
|
|
13
13
|
removePidFile,
|
|
14
14
|
writePidFile
|
|
15
|
-
} from "../chunk-
|
|
15
|
+
} from "../chunk-Z7ZSQCVR.js";
|
|
16
16
|
import {
|
|
17
17
|
authService,
|
|
18
18
|
logger
|
|
19
|
-
} from "../chunk-
|
|
19
|
+
} from "../chunk-ZHIGA6EY.js";
|
|
20
20
|
|
|
21
21
|
// src/daemon/runner.ts
|
|
22
22
|
import "dotenv/config";
|
package/dist/index.js
CHANGED
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
import {
|
|
3
3
|
commitQueue,
|
|
4
4
|
websocketService
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-CCMXVYVO.js";
|
|
6
6
|
import {
|
|
7
7
|
apiService
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-YXNR7UVV.js";
|
|
9
9
|
import {
|
|
10
10
|
getPidFilePath,
|
|
11
11
|
gitService,
|
|
@@ -14,14 +14,14 @@ import {
|
|
|
14
14
|
projectService,
|
|
15
15
|
spawnDetached,
|
|
16
16
|
validatePidFile
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-Z7ZSQCVR.js";
|
|
18
18
|
import {
|
|
19
19
|
__commonJS,
|
|
20
20
|
__toESM,
|
|
21
21
|
authService,
|
|
22
22
|
config,
|
|
23
23
|
logger
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-ZHIGA6EY.js";
|
|
25
25
|
|
|
26
26
|
// node_modules/semver/internal/constants.js
|
|
27
27
|
var require_constants = __commonJS({
|
|
@@ -2552,7 +2552,7 @@ function registerStatusCommand(program2) {
|
|
|
2552
2552
|
try {
|
|
2553
2553
|
const { render } = await import("ink");
|
|
2554
2554
|
const { createElement } = await import("react");
|
|
2555
|
-
const { StatusDashboard } = await import("./StatusDashboard-
|
|
2555
|
+
const { StatusDashboard } = await import("./StatusDashboard-6BRCPQQO.js");
|
|
2556
2556
|
render(createElement(StatusDashboard, { cwd }));
|
|
2557
2557
|
return;
|
|
2558
2558
|
} catch (error) {
|
|
@@ -4356,7 +4356,7 @@ ${chalk14.bold("Config file:")} ${chalk14.cyan(configPath)}
|
|
|
4356
4356
|
}
|
|
4357
4357
|
|
|
4358
4358
|
// src/index.ts
|
|
4359
|
-
var AGENT_VERSION = "1.2.
|
|
4359
|
+
var AGENT_VERSION = "1.2.26";
|
|
4360
4360
|
var program = new Command();
|
|
4361
4361
|
program.name("stint").description("Stint Agent - Local daemon for Stint Project Assistant").version(AGENT_VERSION, "-v, --version", "output the current version").addHelpText("after", `
|
|
4362
4362
|
${chalk15.bold("Examples:")}
|
package/package.json
CHANGED