@gowelle/stint-agent 1.2.56 → 1.2.58
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-SVQONIEE.js → StatusDashboard-5CQMAIYN.js} +2 -2
- package/dist/api-PWWFTHZJ.js +7 -0
- package/dist/{chunk-GCWEUJWP.js → chunk-I5BUGWPT.js} +56 -29
- package/dist/{chunk-7OSHGB4C.js → chunk-KTMQKNBV.js} +1 -1
- package/dist/{chunk-UQKCG3UM.js → chunk-UGPSA4OM.js} +28 -156
- package/dist/{chunk-UHR52B56.js → chunk-WHQU5Y4G.js} +1 -1
- package/dist/daemon/runner.js +4 -4
- package/dist/index.js +7 -7
- package/package.json +2 -2
- package/dist/api-FOWWYJSV.js +0 -7
|
@@ -2,10 +2,10 @@ import {
|
|
|
2
2
|
gitService,
|
|
3
3
|
projectService,
|
|
4
4
|
validatePidFile
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-KTMQKNBV.js";
|
|
6
6
|
import {
|
|
7
7
|
authService
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-WHQU5Y4G.js";
|
|
9
9
|
|
|
10
10
|
// src/components/StatusDashboard.tsx
|
|
11
11
|
import { useState, useEffect } from "react";
|
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
authService,
|
|
3
3
|
config,
|
|
4
4
|
logger
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-WHQU5Y4G.js";
|
|
6
6
|
|
|
7
7
|
// src/utils/circuit-breaker.ts
|
|
8
8
|
var CircuitBreaker = class {
|
|
@@ -100,7 +100,7 @@ var CircuitBreaker = class {
|
|
|
100
100
|
};
|
|
101
101
|
|
|
102
102
|
// src/services/api.ts
|
|
103
|
-
var AGENT_VERSION = "1.2.
|
|
103
|
+
var AGENT_VERSION = "1.2.58";
|
|
104
104
|
var ApiServiceImpl = class {
|
|
105
105
|
sessionId = null;
|
|
106
106
|
circuitBreaker = new CircuitBreaker({
|
|
@@ -139,6 +139,39 @@ var ApiServiceImpl = class {
|
|
|
139
139
|
Accept: "application/json"
|
|
140
140
|
};
|
|
141
141
|
}
|
|
142
|
+
/**
|
|
143
|
+
* Internal request execution without circuit breaker
|
|
144
|
+
*/
|
|
145
|
+
async executeRequest(endpoint, options = {}, timeoutMs = 3e4) {
|
|
146
|
+
const url = `${config.getApiUrl()}${endpoint}`;
|
|
147
|
+
const headers = await this.getHeaders();
|
|
148
|
+
const controller = new AbortController();
|
|
149
|
+
const timeoutId = setTimeout(() => controller.abort(), timeoutMs);
|
|
150
|
+
try {
|
|
151
|
+
const response = await fetch(url, {
|
|
152
|
+
...options,
|
|
153
|
+
headers: {
|
|
154
|
+
...headers,
|
|
155
|
+
...options.headers
|
|
156
|
+
},
|
|
157
|
+
signal: controller.signal
|
|
158
|
+
});
|
|
159
|
+
if (!response.ok) {
|
|
160
|
+
const errorText = await response.text();
|
|
161
|
+
throw new Error(`API request failed: ${response.status} ${errorText}`);
|
|
162
|
+
}
|
|
163
|
+
return await response.json();
|
|
164
|
+
} catch (error) {
|
|
165
|
+
if (error.name === "AbortError") {
|
|
166
|
+
throw new Error(
|
|
167
|
+
`Request to ${endpoint} timed out after ${timeoutMs}ms`
|
|
168
|
+
);
|
|
169
|
+
}
|
|
170
|
+
throw error;
|
|
171
|
+
} finally {
|
|
172
|
+
clearTimeout(timeoutId);
|
|
173
|
+
}
|
|
174
|
+
}
|
|
142
175
|
/**
|
|
143
176
|
* Make an HTTP request to the API with circuit breaker protection
|
|
144
177
|
* @param endpoint - API endpoint path (e.g., '/api/user')
|
|
@@ -148,37 +181,12 @@ var ApiServiceImpl = class {
|
|
|
148
181
|
* @throws Error if request fails, times out, or circuit breaker is open
|
|
149
182
|
*/
|
|
150
183
|
async request(endpoint, options = {}, timeoutMs = 3e4) {
|
|
151
|
-
const url = `${config.getApiUrl()}${endpoint}`;
|
|
152
|
-
const headers = await this.getHeaders();
|
|
153
184
|
return this.circuitBreaker.execute(async () => {
|
|
154
|
-
const controller = new AbortController();
|
|
155
|
-
const timeoutId = setTimeout(() => controller.abort(), timeoutMs);
|
|
156
185
|
try {
|
|
157
|
-
|
|
158
|
-
...options,
|
|
159
|
-
headers: {
|
|
160
|
-
...headers,
|
|
161
|
-
...options.headers
|
|
162
|
-
},
|
|
163
|
-
signal: controller.signal
|
|
164
|
-
});
|
|
165
|
-
if (!response.ok) {
|
|
166
|
-
const errorText = await response.text();
|
|
167
|
-
throw new Error(
|
|
168
|
-
`API request failed: ${response.status} ${errorText}`
|
|
169
|
-
);
|
|
170
|
-
}
|
|
171
|
-
return await response.json();
|
|
186
|
+
return await this.executeRequest(endpoint, options, timeoutMs);
|
|
172
187
|
} catch (error) {
|
|
173
|
-
if (error.name === "AbortError") {
|
|
174
|
-
throw new Error(
|
|
175
|
-
`Request to ${endpoint} timed out after ${timeoutMs}ms`
|
|
176
|
-
);
|
|
177
|
-
}
|
|
178
188
|
logger.error("api", `Request to ${endpoint} failed`, error);
|
|
179
189
|
throw error;
|
|
180
|
-
} finally {
|
|
181
|
-
clearTimeout(timeoutId);
|
|
182
190
|
}
|
|
183
191
|
});
|
|
184
192
|
}
|
|
@@ -511,7 +519,7 @@ var ApiServiceImpl = class {
|
|
|
511
519
|
async streamCommitOutput(commitId, output) {
|
|
512
520
|
if (!output) return;
|
|
513
521
|
try {
|
|
514
|
-
await this.
|
|
522
|
+
await this.executeRequest(`/api/agent/commits/${commitId}/stream`, {
|
|
515
523
|
method: "POST",
|
|
516
524
|
body: JSON.stringify({ output }),
|
|
517
525
|
headers: {
|
|
@@ -525,6 +533,25 @@ var ApiServiceImpl = class {
|
|
|
525
533
|
);
|
|
526
534
|
}
|
|
527
535
|
}
|
|
536
|
+
/**
|
|
537
|
+
* Report commit processing progress.
|
|
538
|
+
* @param commitId - Commit ID
|
|
539
|
+
* @param stage - Current processing stage
|
|
540
|
+
*/
|
|
541
|
+
async reportCommitProgress(commitId, stage) {
|
|
542
|
+
if (!stage) return;
|
|
543
|
+
try {
|
|
544
|
+
await this.executeRequest(`/api/agent/commits/${commitId}/progress`, {
|
|
545
|
+
method: "POST",
|
|
546
|
+
body: JSON.stringify({ stage })
|
|
547
|
+
});
|
|
548
|
+
} catch (error) {
|
|
549
|
+
logger.debug(
|
|
550
|
+
"api",
|
|
551
|
+
`Progress report failed for ${commitId}: ${error.message}`
|
|
552
|
+
);
|
|
553
|
+
}
|
|
554
|
+
}
|
|
528
555
|
/**
|
|
529
556
|
* Get tasks for a project, optionally filtered by branch
|
|
530
557
|
* @param projectId - Project ID
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
apiService
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-I5BUGWPT.js";
|
|
4
4
|
import {
|
|
5
5
|
gitService,
|
|
6
6
|
projectService
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-KTMQKNBV.js";
|
|
8
8
|
import {
|
|
9
9
|
authService,
|
|
10
10
|
config,
|
|
11
11
|
logger
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-WHQU5Y4G.js";
|
|
13
13
|
|
|
14
14
|
// src/services/package-detector.ts
|
|
15
15
|
import fs from "fs";
|
|
@@ -541,83 +541,6 @@ function notify(options) {
|
|
|
541
541
|
}
|
|
542
542
|
}
|
|
543
543
|
|
|
544
|
-
// src/utils/streamer.ts
|
|
545
|
-
var OutputBuffer = class {
|
|
546
|
-
buffer = "";
|
|
547
|
-
commitId;
|
|
548
|
-
lastSendTime = 0;
|
|
549
|
-
timer = null;
|
|
550
|
-
MAX_BUFFER_SIZE = 50 * 1024;
|
|
551
|
-
// 50KB safety limit
|
|
552
|
-
FLUSH_INTERVAL = 500;
|
|
553
|
-
// 500ms
|
|
554
|
-
isClosed = false;
|
|
555
|
-
constructor(commitId) {
|
|
556
|
-
this.commitId = commitId;
|
|
557
|
-
}
|
|
558
|
-
/**
|
|
559
|
-
* Add output to the buffer
|
|
560
|
-
* @param data String data to append
|
|
561
|
-
*/
|
|
562
|
-
append(data) {
|
|
563
|
-
if (this.isClosed) return;
|
|
564
|
-
const text = typeof data === "string" ? data : String(data);
|
|
565
|
-
if (!text) return;
|
|
566
|
-
this.buffer += text;
|
|
567
|
-
if (this.buffer.length > this.MAX_BUFFER_SIZE) {
|
|
568
|
-
this.flush();
|
|
569
|
-
return;
|
|
570
|
-
}
|
|
571
|
-
this.scheduleFlush();
|
|
572
|
-
}
|
|
573
|
-
/**
|
|
574
|
-
* Schedule a flush operation
|
|
575
|
-
*/
|
|
576
|
-
scheduleFlush() {
|
|
577
|
-
const now = Date.now();
|
|
578
|
-
const timeSinceLastSend = now - this.lastSendTime;
|
|
579
|
-
if (this.timer) {
|
|
580
|
-
return;
|
|
581
|
-
}
|
|
582
|
-
if (timeSinceLastSend >= this.FLUSH_INTERVAL) {
|
|
583
|
-
this.flush();
|
|
584
|
-
} else {
|
|
585
|
-
const delay = this.FLUSH_INTERVAL - timeSinceLastSend;
|
|
586
|
-
this.timer = setTimeout(() => this.flush(), delay);
|
|
587
|
-
}
|
|
588
|
-
}
|
|
589
|
-
/**
|
|
590
|
-
* Flush current buffer to API
|
|
591
|
-
*/
|
|
592
|
-
async flush() {
|
|
593
|
-
if (this.timer) {
|
|
594
|
-
clearTimeout(this.timer);
|
|
595
|
-
this.timer = null;
|
|
596
|
-
}
|
|
597
|
-
if (!this.buffer) {
|
|
598
|
-
return;
|
|
599
|
-
}
|
|
600
|
-
const chunk = this.buffer;
|
|
601
|
-
this.buffer = "";
|
|
602
|
-
this.lastSendTime = Date.now();
|
|
603
|
-
try {
|
|
604
|
-
await apiService.streamCommitOutput(this.commitId, chunk);
|
|
605
|
-
} catch (error) {
|
|
606
|
-
logger.debug(
|
|
607
|
-
"stream",
|
|
608
|
-
`Failed to stream output for ${this.commitId}: ${error.message}`
|
|
609
|
-
);
|
|
610
|
-
}
|
|
611
|
-
}
|
|
612
|
-
/**
|
|
613
|
-
* Close the buffer and flush remaining data
|
|
614
|
-
*/
|
|
615
|
-
async close() {
|
|
616
|
-
this.isClosed = true;
|
|
617
|
-
await this.flush();
|
|
618
|
-
}
|
|
619
|
-
};
|
|
620
|
-
|
|
621
544
|
// src/services/hook.ts
|
|
622
545
|
import { spawn } from "child_process";
|
|
623
546
|
var HookService = class {
|
|
@@ -763,7 +686,10 @@ var CommitQueueProcessor = class {
|
|
|
763
686
|
* @param commitId - Commit ID to cancel
|
|
764
687
|
*/
|
|
765
688
|
cancel(commitId) {
|
|
766
|
-
logger.info(
|
|
689
|
+
logger.info(
|
|
690
|
+
"queue",
|
|
691
|
+
`Received cancellation request for commit ${commitId}`
|
|
692
|
+
);
|
|
767
693
|
if (this.currentCommitId === commitId) {
|
|
768
694
|
logger.info(
|
|
769
695
|
"queue",
|
|
@@ -817,7 +743,10 @@ var CommitQueueProcessor = class {
|
|
|
817
743
|
this.currentCommitId = item.commit.id;
|
|
818
744
|
this.abortedCommitId = null;
|
|
819
745
|
try {
|
|
820
|
-
await this.executeCommit(item.commit, item.project)
|
|
746
|
+
await this.executeCommit(item.commit, item.project, (stage) => {
|
|
747
|
+
apiService.reportCommitProgress(item.commit.id, stage);
|
|
748
|
+
logger.info("queue", stage);
|
|
749
|
+
});
|
|
821
750
|
} catch (error) {
|
|
822
751
|
if (error.message === "Commit canceled") {
|
|
823
752
|
logger.info("queue", `Commit ${item.commit.id} processing canceled.`);
|
|
@@ -848,14 +777,8 @@ var CommitQueueProcessor = class {
|
|
|
848
777
|
*/
|
|
849
778
|
async executeCommit(commit, project, onProgress, options) {
|
|
850
779
|
logger.info("queue", `Processing commit: ${commit.id} - ${commit.message}`);
|
|
851
|
-
const streamer = new OutputBuffer(commit.id);
|
|
852
|
-
const streamOutput = (text) => {
|
|
853
|
-
streamer.append(text);
|
|
854
|
-
};
|
|
855
780
|
try {
|
|
856
781
|
this.checkAborted(commit.id);
|
|
857
|
-
streamer.append(`Processing commit: ${commit.message}
|
|
858
|
-
`);
|
|
859
782
|
onProgress?.("Finding project directory...");
|
|
860
783
|
const projectPath = this.findProjectPath(project.id);
|
|
861
784
|
if (!projectPath) {
|
|
@@ -865,8 +788,6 @@ var CommitQueueProcessor = class {
|
|
|
865
788
|
}
|
|
866
789
|
this.checkAborted(commit.id);
|
|
867
790
|
logger.info("queue", `Executing in directory: ${projectPath}`);
|
|
868
|
-
streamer.append(`> Project directory: ${projectPath}
|
|
869
|
-
`);
|
|
870
791
|
onProgress?.("Validating repository...");
|
|
871
792
|
const isRepo = await gitService.isRepo(projectPath);
|
|
872
793
|
if (!isRepo) {
|
|
@@ -884,11 +805,9 @@ var CommitQueueProcessor = class {
|
|
|
884
805
|
this.checkAborted(commit.id);
|
|
885
806
|
onProgress?.("Running pre-commit hooks...");
|
|
886
807
|
logger.info("queue", "Executing pre-commit hooks...");
|
|
887
|
-
streamer.append("\n> Executing pre-commit hooks...\n");
|
|
888
808
|
const hookResults = await hookService.executeHooks(
|
|
889
809
|
project.commitSettings.hooks,
|
|
890
|
-
projectPath
|
|
891
|
-
streamOutput
|
|
810
|
+
projectPath
|
|
892
811
|
);
|
|
893
812
|
this.checkAborted(commit.id);
|
|
894
813
|
const failedBlockingHook = hookResults.find(
|
|
@@ -900,11 +819,6 @@ var CommitQueueProcessor = class {
|
|
|
900
819
|
"queue",
|
|
901
820
|
`Blocking hook "${failedBlockingHook.hookName}" failed: ${errorMsg}`
|
|
902
821
|
);
|
|
903
|
-
streamer.append(
|
|
904
|
-
`
|
|
905
|
-
Error: Blocking hook "${failedBlockingHook.hookName}" failed: ${errorMsg}
|
|
906
|
-
`
|
|
907
|
-
);
|
|
908
822
|
if (failedBlockingHook.output) {
|
|
909
823
|
logger.warn("queue", `Hook output:
|
|
910
824
|
${failedBlockingHook.output}`);
|
|
@@ -919,11 +833,6 @@ ${failedBlockingHook.output}`);
|
|
|
919
833
|
"queue",
|
|
920
834
|
`${failedNonBlockingHooks.length} hooks failed but were not blocking: ${failedNonBlockingHooks.map((h) => h.hookName).join(", ")}`
|
|
921
835
|
);
|
|
922
|
-
streamer.append(
|
|
923
|
-
`
|
|
924
|
-
Warning: ${failedNonBlockingHooks.length} non-blocking hooks failed.
|
|
925
|
-
`
|
|
926
|
-
);
|
|
927
836
|
}
|
|
928
837
|
const statusAfterHooks = await gitService.getStatus(projectPath);
|
|
929
838
|
hookModifiedFiles = [
|
|
@@ -935,11 +844,6 @@ Warning: ${failedNonBlockingHooks.length} non-blocking hooks failed.
|
|
|
935
844
|
"queue",
|
|
936
845
|
`Hooks modified ${hookModifiedFiles.length} additional files: ${hookModifiedFiles.join(", ")}`
|
|
937
846
|
);
|
|
938
|
-
streamer.append(
|
|
939
|
-
`
|
|
940
|
-
> Hooks modified ${hookModifiedFiles.length} additional files: ${hookModifiedFiles.join(", ")}
|
|
941
|
-
`
|
|
942
|
-
);
|
|
943
847
|
}
|
|
944
848
|
}
|
|
945
849
|
this.checkAborted(commit.id);
|
|
@@ -953,24 +857,16 @@ Warning: ${failedNonBlockingHooks.length} non-blocking hooks failed.
|
|
|
953
857
|
const extraFiles = filesToStage.length - commit.files.length;
|
|
954
858
|
const extraMsg = extraFiles > 0 ? ` (+${extraFiles} from hooks)` : "";
|
|
955
859
|
onProgress?.(`Staging ${filesToStage.length} files${extraMsg}...`);
|
|
956
|
-
streamer.append(
|
|
957
|
-
`
|
|
958
|
-
> Staging ${filesToStage.length} files${extraMsg}...
|
|
959
|
-
`
|
|
960
|
-
);
|
|
961
860
|
this.checkAborted(commit.id);
|
|
962
|
-
await gitService.stageFiles(projectPath, filesToStage
|
|
861
|
+
await gitService.stageFiles(projectPath, filesToStage);
|
|
963
862
|
status = await gitService.getStatus(projectPath);
|
|
964
863
|
logger.info("queue", `Auto-staged files: ${filesToStage.join(", ")}`);
|
|
965
864
|
} else if (status.staged.length === 0) {
|
|
966
865
|
const hasChanges = status.unstaged.length > 0 || status.untracked.length > 0;
|
|
967
866
|
if (hasChanges) {
|
|
968
867
|
onProgress?.("Staging all changes...");
|
|
969
|
-
streamer.append(`
|
|
970
|
-
> Auto-staging all changes...
|
|
971
|
-
`);
|
|
972
868
|
this.checkAborted(commit.id);
|
|
973
|
-
await gitService.stageAll(projectPath
|
|
869
|
+
await gitService.stageAll(projectPath);
|
|
974
870
|
status = await gitService.getStatus(projectPath);
|
|
975
871
|
logger.info("queue", `Auto-staged all changes`);
|
|
976
872
|
}
|
|
@@ -982,24 +878,16 @@ Warning: ${failedNonBlockingHooks.length} non-blocking hooks failed.
|
|
|
982
878
|
);
|
|
983
879
|
}
|
|
984
880
|
logger.info("queue", `Committing ${status.staged.length} staged files.`);
|
|
985
|
-
streamer.append(
|
|
986
|
-
`
|
|
987
|
-
> Committing ${status.staged.length} staged files...
|
|
988
|
-
`
|
|
989
|
-
);
|
|
990
881
|
this.checkAborted(commit.id);
|
|
991
882
|
onProgress?.("Creating commit...");
|
|
992
883
|
logger.info("queue", `Creating commit with message: "${commit.message}"`);
|
|
993
884
|
const sha = await gitService.commit(
|
|
994
885
|
projectPath,
|
|
995
886
|
commit.message,
|
|
996
|
-
|
|
887
|
+
void 0,
|
|
997
888
|
commit.body
|
|
998
889
|
);
|
|
999
890
|
logger.success("queue", `Commit created successfully: ${sha}`);
|
|
1000
|
-
streamer.append(`
|
|
1001
|
-
> Commit created: ${sha}
|
|
1002
|
-
`);
|
|
1003
891
|
this.checkAborted(commit.id);
|
|
1004
892
|
let pushed = false;
|
|
1005
893
|
let pushError;
|
|
@@ -1007,33 +895,20 @@ Warning: ${failedNonBlockingHooks.length} non-blocking hooks failed.
|
|
|
1007
895
|
if (shouldPush) {
|
|
1008
896
|
try {
|
|
1009
897
|
onProgress?.("Pushing to remote...");
|
|
1010
|
-
streamer.append(`
|
|
1011
|
-
> Pushing to remote...
|
|
1012
|
-
`);
|
|
1013
898
|
this.checkAborted(commit.id);
|
|
1014
|
-
await gitService.push(
|
|
1015
|
-
projectPath,
|
|
1016
|
-
void 0,
|
|
1017
|
-
void 0,
|
|
1018
|
-
streamOutput
|
|
1019
|
-
);
|
|
899
|
+
await gitService.push(projectPath, void 0, void 0);
|
|
1020
900
|
pushed = true;
|
|
1021
901
|
logger.success("queue", `Pushed commit ${sha} to remote`);
|
|
1022
|
-
streamer.append(`
|
|
1023
|
-
> Implementation sent to remote successfully.
|
|
1024
|
-
`);
|
|
1025
902
|
notify({
|
|
1026
903
|
title: `Commit Pushed - ${project.name}`,
|
|
1027
904
|
message: `Commit "${commit.message}" successfully pushed.`,
|
|
1028
905
|
category: "commits"
|
|
1029
906
|
});
|
|
1030
907
|
} catch (error) {
|
|
1031
|
-
if (this.abortedCommitId === commit.id)
|
|
908
|
+
if (this.abortedCommitId === commit.id)
|
|
909
|
+
throw new Error("Commit canceled");
|
|
1032
910
|
pushError = error.message;
|
|
1033
911
|
const isConflict = pushError.includes("rejected") || pushError.includes("non-fast-forward") || pushError.includes("failed to push") || pushError.includes("Updates were rejected");
|
|
1034
|
-
streamer.append(`
|
|
1035
|
-
> Push failed: ${pushError}
|
|
1036
|
-
`);
|
|
1037
912
|
if (isConflict) {
|
|
1038
913
|
logger.warn(
|
|
1039
914
|
"queue",
|
|
@@ -1058,10 +933,6 @@ Run "git pull --rebase" to resolve.`,
|
|
|
1058
933
|
this.checkAborted(commit.id);
|
|
1059
934
|
onProgress?.("Reporting to server...");
|
|
1060
935
|
await this.reportSuccess(commit.id, sha, pushed, pushError);
|
|
1061
|
-
streamer.append(`
|
|
1062
|
-
> Execution completed.
|
|
1063
|
-
`);
|
|
1064
|
-
await streamer.close();
|
|
1065
936
|
if (!pushed && !pushError) {
|
|
1066
937
|
notify({
|
|
1067
938
|
title: `Commit Created - ${project.name}`,
|
|
@@ -1074,10 +945,6 @@ Run "git pull --rebase" to resolve.`,
|
|
|
1074
945
|
const msg = error.message;
|
|
1075
946
|
if (msg === "Commit canceled") {
|
|
1076
947
|
logger.info("queue", `Commit execution aborted: ${commit.id}`);
|
|
1077
|
-
streamer.append(`
|
|
1078
|
-
> Execution canceled by user.
|
|
1079
|
-
`);
|
|
1080
|
-
await streamer.close();
|
|
1081
948
|
notify({
|
|
1082
949
|
title: `Commit Canceled - ${project.name}`,
|
|
1083
950
|
message: `Commit processing canceled.`,
|
|
@@ -1086,10 +953,6 @@ Run "git pull --rebase" to resolve.`,
|
|
|
1086
953
|
throw error;
|
|
1087
954
|
}
|
|
1088
955
|
logger.error("queue", `Commit execution failed: ${msg}`);
|
|
1089
|
-
streamer.append(`
|
|
1090
|
-
> Execution failed: ${msg}
|
|
1091
|
-
`);
|
|
1092
|
-
await streamer.close();
|
|
1093
956
|
notify({
|
|
1094
957
|
title: `Commit Failed - ${project.name}`,
|
|
1095
958
|
message: `Failed to execute commit "${commit.message}": ${msg}`,
|
|
@@ -1161,6 +1024,15 @@ Run "git pull --rebase" to resolve.`,
|
|
|
1161
1024
|
getQueueLength() {
|
|
1162
1025
|
return this.queue.length;
|
|
1163
1026
|
}
|
|
1027
|
+
/**
|
|
1028
|
+
* Clear the queue and reset processing state (for testing)
|
|
1029
|
+
*/
|
|
1030
|
+
clear() {
|
|
1031
|
+
this.queue = [];
|
|
1032
|
+
this.isProcessing = false;
|
|
1033
|
+
this.currentCommitId = null;
|
|
1034
|
+
this.abortedCommitId = null;
|
|
1035
|
+
}
|
|
1164
1036
|
};
|
|
1165
1037
|
var commitQueue = new CommitQueueProcessor();
|
|
1166
1038
|
|
|
@@ -1498,7 +1370,7 @@ var WebSocketServiceImpl = class {
|
|
|
1498
1370
|
"websocket",
|
|
1499
1371
|
`Commit ${commit.id} marked as large, fetching full details...`
|
|
1500
1372
|
);
|
|
1501
|
-
const { apiService: apiService2 } = await import("./api-
|
|
1373
|
+
const { apiService: apiService2 } = await import("./api-PWWFTHZJ.js");
|
|
1502
1374
|
const fullCommit = await apiService2.getCommit(commit.id);
|
|
1503
1375
|
commit = {
|
|
1504
1376
|
...commit,
|
|
@@ -358,7 +358,7 @@ var AuthServiceImpl = class {
|
|
|
358
358
|
return null;
|
|
359
359
|
}
|
|
360
360
|
try {
|
|
361
|
-
const { apiService } = await import("./api-
|
|
361
|
+
const { apiService } = await import("./api-PWWFTHZJ.js");
|
|
362
362
|
const user = await apiService.getCurrentUser();
|
|
363
363
|
logger.info("auth", `Token validated for user: ${user.email}`);
|
|
364
364
|
return user;
|
package/dist/daemon/runner.js
CHANGED
|
@@ -4,21 +4,21 @@ import {
|
|
|
4
4
|
notify,
|
|
5
5
|
packageDetector,
|
|
6
6
|
websocketService
|
|
7
|
-
} from "../chunk-
|
|
7
|
+
} from "../chunk-UGPSA4OM.js";
|
|
8
8
|
import {
|
|
9
9
|
apiService
|
|
10
|
-
} from "../chunk-
|
|
10
|
+
} from "../chunk-I5BUGWPT.js";
|
|
11
11
|
import {
|
|
12
12
|
gitService,
|
|
13
13
|
projectService,
|
|
14
14
|
removePidFile,
|
|
15
15
|
writePidFile
|
|
16
|
-
} from "../chunk-
|
|
16
|
+
} from "../chunk-KTMQKNBV.js";
|
|
17
17
|
import {
|
|
18
18
|
authService,
|
|
19
19
|
config,
|
|
20
20
|
logger
|
|
21
|
-
} from "../chunk-
|
|
21
|
+
} from "../chunk-WHQU5Y4G.js";
|
|
22
22
|
|
|
23
23
|
// src/daemon/runner.ts
|
|
24
24
|
import "dotenv/config";
|
package/dist/index.js
CHANGED
|
@@ -3,10 +3,10 @@ import {
|
|
|
3
3
|
commitQueue,
|
|
4
4
|
packageDetector,
|
|
5
5
|
websocketService
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-UGPSA4OM.js";
|
|
7
7
|
import {
|
|
8
8
|
apiService
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-I5BUGWPT.js";
|
|
10
10
|
import {
|
|
11
11
|
getPidFilePath,
|
|
12
12
|
gitService,
|
|
@@ -15,14 +15,14 @@ import {
|
|
|
15
15
|
projectService,
|
|
16
16
|
spawnDetached,
|
|
17
17
|
validatePidFile
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-KTMQKNBV.js";
|
|
19
19
|
import {
|
|
20
20
|
__commonJS,
|
|
21
21
|
__toESM,
|
|
22
22
|
authService,
|
|
23
23
|
config,
|
|
24
24
|
logger
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-WHQU5Y4G.js";
|
|
26
26
|
|
|
27
27
|
// node_modules/semver/internal/constants.js
|
|
28
28
|
var require_constants = __commonJS({
|
|
@@ -2658,7 +2658,7 @@ function registerStatusCommand(program2) {
|
|
|
2658
2658
|
try {
|
|
2659
2659
|
const { render } = await import("ink");
|
|
2660
2660
|
const { createElement } = await import("react");
|
|
2661
|
-
const { StatusDashboard } = await import("./StatusDashboard-
|
|
2661
|
+
const { StatusDashboard } = await import("./StatusDashboard-5CQMAIYN.js");
|
|
2662
2662
|
render(createElement(StatusDashboard, { cwd }));
|
|
2663
2663
|
return;
|
|
2664
2664
|
} catch (error) {
|
|
@@ -5056,7 +5056,7 @@ function displayLocalProjects(entries) {
|
|
|
5056
5056
|
|
|
5057
5057
|
// src/commands/about.ts
|
|
5058
5058
|
import chalk17 from "chalk";
|
|
5059
|
-
var AGENT_VERSION = "1.2.
|
|
5059
|
+
var AGENT_VERSION = "1.2.58";
|
|
5060
5060
|
function registerAboutCommand(program2) {
|
|
5061
5061
|
program2.command("about").description("Display information about Stint Agent").action(() => {
|
|
5062
5062
|
console.log();
|
|
@@ -5097,7 +5097,7 @@ function registerAboutCommand(program2) {
|
|
|
5097
5097
|
}
|
|
5098
5098
|
|
|
5099
5099
|
// src/index.ts
|
|
5100
|
-
var AGENT_VERSION2 = "1.2.
|
|
5100
|
+
var AGENT_VERSION2 = "1.2.58";
|
|
5101
5101
|
var program = new Command3();
|
|
5102
5102
|
program.name("stint").description("Stint Agent - Local daemon for Stint Project Assistant").version(AGENT_VERSION2, "-v, --version", "output the current version").addHelpText(
|
|
5103
5103
|
"after",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gowelle/stint-agent",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.58",
|
|
4
4
|
"description": "Local agent for Stint - Project Assistant",
|
|
5
5
|
"author": "Gowelle John <gowelle.john@icloud.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"typecheck": "tsc --noEmit",
|
|
37
37
|
"format": "prettier --write src",
|
|
38
38
|
"format:check": "prettier --check src",
|
|
39
|
-
"test": "vitest",
|
|
39
|
+
"test": "npx vitest run",
|
|
40
40
|
"test:update": "node --loader ts-node/esm scripts/test-update.ts",
|
|
41
41
|
"prepublishOnly": "npm run build"
|
|
42
42
|
},
|