@gowelle/stint-agent 1.2.49 → 1.2.52
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-SV67LHN2.js → StatusDashboard-YNXIZTX5.js} +2 -2
- package/dist/api-WLMF4NID.js +7 -0
- package/dist/{chunk-RBG4PQQH.js → chunk-M7326ZDD.js} +10 -10
- package/dist/{chunk-NNK7GJL4.js → chunk-MEMRGMOW.js} +48 -4
- package/dist/{chunk-NUYTAWHX.js → chunk-VXWZVT6P.js} +5 -3
- package/dist/{chunk-3JSOITUS.js → chunk-ZVSUMF5E.js} +1 -1
- package/dist/daemon/runner.js +5 -4
- package/dist/index.js +128 -89
- package/package.json +2 -1
- package/dist/api-XHW54OCY.js +0 -7
|
@@ -2,10 +2,10 @@ import {
|
|
|
2
2
|
gitService,
|
|
3
3
|
projectService,
|
|
4
4
|
validatePidFile
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-MEMRGMOW.js";
|
|
6
6
|
import {
|
|
7
7
|
authService
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-ZVSUMF5E.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-VXWZVT6P.js";
|
|
4
4
|
import {
|
|
5
5
|
gitService,
|
|
6
6
|
projectService
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-MEMRGMOW.js";
|
|
8
8
|
import {
|
|
9
9
|
authService,
|
|
10
10
|
config,
|
|
11
11
|
logger
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-ZVSUMF5E.js";
|
|
13
13
|
|
|
14
14
|
// src/services/package-detector.ts
|
|
15
15
|
import fs from "fs";
|
|
@@ -551,8 +551,6 @@ var OutputBuffer = class {
|
|
|
551
551
|
// 50KB safety limit
|
|
552
552
|
FLUSH_INTERVAL = 500;
|
|
553
553
|
// 500ms
|
|
554
|
-
MIN_CHUNK_SIZE = 100;
|
|
555
|
-
// Minimum characters to trigger immediate send (optional optimization)
|
|
556
554
|
isClosed = false;
|
|
557
555
|
constructor(commitId) {
|
|
558
556
|
this.commitId = commitId;
|
|
@@ -607,8 +605,7 @@ var OutputBuffer = class {
|
|
|
607
605
|
} catch (error) {
|
|
608
606
|
logger.debug(
|
|
609
607
|
"stream",
|
|
610
|
-
`Failed to stream output for ${this.commitId}
|
|
611
|
-
error
|
|
608
|
+
`Failed to stream output for ${this.commitId}: ${error.message}`
|
|
612
609
|
);
|
|
613
610
|
}
|
|
614
611
|
}
|
|
@@ -686,8 +683,9 @@ var HookService = class {
|
|
|
686
683
|
cwd,
|
|
687
684
|
shell: true,
|
|
688
685
|
stdio: ["ignore", "pipe", "pipe"],
|
|
689
|
-
env: { ...process.env, FORCE_COLOR: "1" }
|
|
686
|
+
env: { ...process.env, FORCE_COLOR: "1" },
|
|
690
687
|
// Force color output for better terminal experience
|
|
688
|
+
windowsHide: true
|
|
691
689
|
});
|
|
692
690
|
let combinedOutput = "";
|
|
693
691
|
child.stdout.on("data", (data) => {
|
|
@@ -944,7 +942,8 @@ Warning: ${failedNonBlockingHooks.length} non-blocking hooks failed.
|
|
|
944
942
|
const sha = await gitService.commit(
|
|
945
943
|
projectPath,
|
|
946
944
|
commit.message,
|
|
947
|
-
streamOutput
|
|
945
|
+
streamOutput,
|
|
946
|
+
commit.body
|
|
948
947
|
);
|
|
949
948
|
logger.success("queue", `Commit created successfully: ${sha}`);
|
|
950
949
|
streamer.append(`
|
|
@@ -1203,6 +1202,7 @@ var WebSocketServiceImpl = class {
|
|
|
1203
1202
|
// Pong timeout: wait this long for pong response before considering connection dead
|
|
1204
1203
|
pongTimeout: 3e4,
|
|
1205
1204
|
// 30 seconds (default is 30s)
|
|
1205
|
+
// @ts-expect-error - Custom authorizer type differs slightly from Pusher's expected signature
|
|
1206
1206
|
authorizer: (channel) => ({
|
|
1207
1207
|
authorize: async (socketId, callback) => {
|
|
1208
1208
|
try {
|
|
@@ -1429,7 +1429,7 @@ var WebSocketServiceImpl = class {
|
|
|
1429
1429
|
"websocket",
|
|
1430
1430
|
`Commit ${commit.id} marked as large, fetching full details...`
|
|
1431
1431
|
);
|
|
1432
|
-
const { apiService: apiService2 } = await import("./api-
|
|
1432
|
+
const { apiService: apiService2 } = await import("./api-WLMF4NID.js");
|
|
1433
1433
|
const fullCommit = await apiService2.getCommit(commit.id);
|
|
1434
1434
|
commit = {
|
|
1435
1435
|
...commit,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
config,
|
|
3
3
|
logger
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-ZVSUMF5E.js";
|
|
5
5
|
|
|
6
6
|
// src/services/git.ts
|
|
7
7
|
import simpleGit from "simple-git";
|
|
@@ -122,10 +122,17 @@ var GitServiceImpl = class {
|
|
|
122
122
|
throw new Error(`Failed to stage files: ${error.message}`);
|
|
123
123
|
}
|
|
124
124
|
}
|
|
125
|
-
async commit(path3, message, onOutput) {
|
|
125
|
+
async commit(path3, message, onOutput, body) {
|
|
126
126
|
try {
|
|
127
127
|
const git = this.getGit(path3, onOutput);
|
|
128
|
-
|
|
128
|
+
let fullMessage = message;
|
|
129
|
+
if (body && body.trim()) {
|
|
130
|
+
const wrappedBody = this.wrapText(body.trim(), 72);
|
|
131
|
+
fullMessage = `${message}
|
|
132
|
+
|
|
133
|
+
${wrappedBody}`;
|
|
134
|
+
}
|
|
135
|
+
const result = await git.commit(fullMessage);
|
|
129
136
|
const sha = result.commit;
|
|
130
137
|
logger.success("git", `Created commit ${sha} in ${path3}`);
|
|
131
138
|
return sha;
|
|
@@ -134,6 +141,42 @@ var GitServiceImpl = class {
|
|
|
134
141
|
throw new Error(`Failed to create commit: ${error.message}`);
|
|
135
142
|
}
|
|
136
143
|
}
|
|
144
|
+
/**
|
|
145
|
+
* Wrap text at specified line width (for 50/72 rule compliance)
|
|
146
|
+
*/
|
|
147
|
+
wrapText(text, width) {
|
|
148
|
+
const lines = [];
|
|
149
|
+
const paragraphs = text.split(/\n\n+/);
|
|
150
|
+
for (const paragraph of paragraphs) {
|
|
151
|
+
const existingLines = paragraph.split("\n");
|
|
152
|
+
for (const line of existingLines) {
|
|
153
|
+
if (line.length <= width) {
|
|
154
|
+
lines.push(line);
|
|
155
|
+
} else {
|
|
156
|
+
const words = line.split(" ");
|
|
157
|
+
let currentLine = "";
|
|
158
|
+
for (const word of words) {
|
|
159
|
+
if (currentLine.length === 0) {
|
|
160
|
+
currentLine = word;
|
|
161
|
+
} else if (currentLine.length + 1 + word.length <= width) {
|
|
162
|
+
currentLine += " " + word;
|
|
163
|
+
} else {
|
|
164
|
+
lines.push(currentLine);
|
|
165
|
+
currentLine = word;
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
if (currentLine.length > 0) {
|
|
169
|
+
lines.push(currentLine);
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
lines.push("");
|
|
174
|
+
}
|
|
175
|
+
while (lines.length > 0 && lines[lines.length - 1] === "") {
|
|
176
|
+
lines.pop();
|
|
177
|
+
}
|
|
178
|
+
return lines.join("\n");
|
|
179
|
+
}
|
|
137
180
|
async getCurrentBranch(path3) {
|
|
138
181
|
try {
|
|
139
182
|
const git = this.getGit(path3);
|
|
@@ -423,7 +466,8 @@ function spawnDetached(command, args, options = {}) {
|
|
|
423
466
|
detached: true,
|
|
424
467
|
stdio: ["ignore", out, err],
|
|
425
468
|
cwd: options.cwd || process.cwd(),
|
|
426
|
-
env: options.env || process.env
|
|
469
|
+
env: options.env || process.env,
|
|
470
|
+
windowsHide: true
|
|
427
471
|
});
|
|
428
472
|
child.unref();
|
|
429
473
|
logger.info("process", `Spawned detached process ${child.pid}`);
|
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
authService,
|
|
3
3
|
config,
|
|
4
4
|
logger
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-ZVSUMF5E.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.52";
|
|
104
104
|
var ApiServiceImpl = class {
|
|
105
105
|
sessionId = null;
|
|
106
106
|
circuitBreaker = new CircuitBreaker({
|
|
@@ -171,7 +171,9 @@ var ApiServiceImpl = class {
|
|
|
171
171
|
return await response.json();
|
|
172
172
|
} catch (error) {
|
|
173
173
|
if (error.name === "AbortError") {
|
|
174
|
-
throw new Error(
|
|
174
|
+
throw new Error(
|
|
175
|
+
`Request to ${endpoint} timed out after ${timeoutMs}ms`
|
|
176
|
+
);
|
|
175
177
|
}
|
|
176
178
|
logger.error("api", `Request to ${endpoint} failed`, error);
|
|
177
179
|
throw error;
|
|
@@ -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-WLMF4NID.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,20 +4,21 @@ import {
|
|
|
4
4
|
notify,
|
|
5
5
|
packageDetector,
|
|
6
6
|
websocketService
|
|
7
|
-
} from "../chunk-
|
|
7
|
+
} from "../chunk-M7326ZDD.js";
|
|
8
8
|
import {
|
|
9
9
|
apiService
|
|
10
|
-
} from "../chunk-
|
|
10
|
+
} from "../chunk-VXWZVT6P.js";
|
|
11
11
|
import {
|
|
12
12
|
gitService,
|
|
13
13
|
projectService,
|
|
14
14
|
removePidFile,
|
|
15
15
|
writePidFile
|
|
16
|
-
} from "../chunk-
|
|
16
|
+
} from "../chunk-MEMRGMOW.js";
|
|
17
17
|
import {
|
|
18
18
|
authService,
|
|
19
|
+
config,
|
|
19
20
|
logger
|
|
20
|
-
} from "../chunk-
|
|
21
|
+
} from "../chunk-ZVSUMF5E.js";
|
|
21
22
|
|
|
22
23
|
// src/daemon/runner.ts
|
|
23
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-M7326ZDD.js";
|
|
7
7
|
import {
|
|
8
8
|
apiService
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-VXWZVT6P.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-MEMRGMOW.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-ZVSUMF5E.js";
|
|
26
26
|
|
|
27
27
|
// node_modules/semver/internal/constants.js
|
|
28
28
|
var require_constants = __commonJS({
|
|
@@ -504,11 +504,11 @@ var require_valid = __commonJS({
|
|
|
504
504
|
"node_modules/semver/functions/valid.js"(exports, module) {
|
|
505
505
|
"use strict";
|
|
506
506
|
var parse = require_parse();
|
|
507
|
-
var
|
|
507
|
+
var valid2 = (version, options) => {
|
|
508
508
|
const v = parse(version, options);
|
|
509
509
|
return v ? v.version : null;
|
|
510
510
|
};
|
|
511
|
-
module.exports =
|
|
511
|
+
module.exports = valid2;
|
|
512
512
|
}
|
|
513
513
|
});
|
|
514
514
|
|
|
@@ -705,8 +705,8 @@ var require_gt = __commonJS({
|
|
|
705
705
|
"node_modules/semver/functions/gt.js"(exports, module) {
|
|
706
706
|
"use strict";
|
|
707
707
|
var compare = require_compare();
|
|
708
|
-
var
|
|
709
|
-
module.exports =
|
|
708
|
+
var gt2 = (a, b, loose) => compare(a, b, loose) > 0;
|
|
709
|
+
module.exports = gt2;
|
|
710
710
|
}
|
|
711
711
|
});
|
|
712
712
|
|
|
@@ -766,7 +766,7 @@ var require_cmp = __commonJS({
|
|
|
766
766
|
"use strict";
|
|
767
767
|
var eq = require_eq();
|
|
768
768
|
var neq = require_neq();
|
|
769
|
-
var
|
|
769
|
+
var gt2 = require_gt();
|
|
770
770
|
var gte = require_gte();
|
|
771
771
|
var lt = require_lt();
|
|
772
772
|
var lte = require_lte();
|
|
@@ -795,7 +795,7 @@ var require_cmp = __commonJS({
|
|
|
795
795
|
case "!=":
|
|
796
796
|
return neq(a, b, loose);
|
|
797
797
|
case ">":
|
|
798
|
-
return
|
|
798
|
+
return gt2(a, b, loose);
|
|
799
799
|
case ">=":
|
|
800
800
|
return gte(a, b, loose);
|
|
801
801
|
case "<":
|
|
@@ -1475,7 +1475,7 @@ var require_min_version = __commonJS({
|
|
|
1475
1475
|
"use strict";
|
|
1476
1476
|
var SemVer = require_semver();
|
|
1477
1477
|
var Range = require_range();
|
|
1478
|
-
var
|
|
1478
|
+
var gt2 = require_gt();
|
|
1479
1479
|
var minVersion = (range, loose) => {
|
|
1480
1480
|
range = new Range(range, loose);
|
|
1481
1481
|
let minver = new SemVer("0.0.0");
|
|
@@ -1503,7 +1503,7 @@ var require_min_version = __commonJS({
|
|
|
1503
1503
|
/* fallthrough */
|
|
1504
1504
|
case "":
|
|
1505
1505
|
case ">=":
|
|
1506
|
-
if (!setMin ||
|
|
1506
|
+
if (!setMin || gt2(compver, setMin)) {
|
|
1507
1507
|
setMin = compver;
|
|
1508
1508
|
}
|
|
1509
1509
|
break;
|
|
@@ -1515,7 +1515,7 @@ var require_min_version = __commonJS({
|
|
|
1515
1515
|
throw new Error(`Unexpected operation: ${comparator.operator}`);
|
|
1516
1516
|
}
|
|
1517
1517
|
});
|
|
1518
|
-
if (setMin && (!minver ||
|
|
1518
|
+
if (setMin && (!minver || gt2(minver, setMin))) {
|
|
1519
1519
|
minver = setMin;
|
|
1520
1520
|
}
|
|
1521
1521
|
}
|
|
@@ -1553,7 +1553,7 @@ var require_outside = __commonJS({
|
|
|
1553
1553
|
var { ANY } = Comparator;
|
|
1554
1554
|
var Range = require_range();
|
|
1555
1555
|
var satisfies = require_satisfies();
|
|
1556
|
-
var
|
|
1556
|
+
var gt2 = require_gt();
|
|
1557
1557
|
var lt = require_lt();
|
|
1558
1558
|
var lte = require_lte();
|
|
1559
1559
|
var gte = require_gte();
|
|
@@ -1563,7 +1563,7 @@ var require_outside = __commonJS({
|
|
|
1563
1563
|
let gtfn, ltefn, ltfn, comp, ecomp;
|
|
1564
1564
|
switch (hilo) {
|
|
1565
1565
|
case ">":
|
|
1566
|
-
gtfn =
|
|
1566
|
+
gtfn = gt2;
|
|
1567
1567
|
ltefn = lte;
|
|
1568
1568
|
ltfn = lt;
|
|
1569
1569
|
comp = ">";
|
|
@@ -1572,7 +1572,7 @@ var require_outside = __commonJS({
|
|
|
1572
1572
|
case "<":
|
|
1573
1573
|
gtfn = lt;
|
|
1574
1574
|
ltefn = gte;
|
|
1575
|
-
ltfn =
|
|
1575
|
+
ltfn = gt2;
|
|
1576
1576
|
comp = "<";
|
|
1577
1577
|
ecomp = "<=";
|
|
1578
1578
|
break;
|
|
@@ -1750,10 +1750,10 @@ var require_subset = __commonJS({
|
|
|
1750
1750
|
}
|
|
1751
1751
|
}
|
|
1752
1752
|
const eqSet = /* @__PURE__ */ new Set();
|
|
1753
|
-
let
|
|
1753
|
+
let gt2, lt;
|
|
1754
1754
|
for (const c of sub) {
|
|
1755
1755
|
if (c.operator === ">" || c.operator === ">=") {
|
|
1756
|
-
|
|
1756
|
+
gt2 = higherGT(gt2, c, options);
|
|
1757
1757
|
} else if (c.operator === "<" || c.operator === "<=") {
|
|
1758
1758
|
lt = lowerLT(lt, c, options);
|
|
1759
1759
|
} else {
|
|
@@ -1764,16 +1764,16 @@ var require_subset = __commonJS({
|
|
|
1764
1764
|
return null;
|
|
1765
1765
|
}
|
|
1766
1766
|
let gtltComp;
|
|
1767
|
-
if (
|
|
1768
|
-
gtltComp = compare(
|
|
1767
|
+
if (gt2 && lt) {
|
|
1768
|
+
gtltComp = compare(gt2.semver, lt.semver, options);
|
|
1769
1769
|
if (gtltComp > 0) {
|
|
1770
1770
|
return null;
|
|
1771
|
-
} else if (gtltComp === 0 && (
|
|
1771
|
+
} else if (gtltComp === 0 && (gt2.operator !== ">=" || lt.operator !== "<=")) {
|
|
1772
1772
|
return null;
|
|
1773
1773
|
}
|
|
1774
1774
|
}
|
|
1775
1775
|
for (const eq of eqSet) {
|
|
1776
|
-
if (
|
|
1776
|
+
if (gt2 && !satisfies(eq, String(gt2), options)) {
|
|
1777
1777
|
return null;
|
|
1778
1778
|
}
|
|
1779
1779
|
if (lt && !satisfies(eq, String(lt), options)) {
|
|
@@ -1789,25 +1789,25 @@ var require_subset = __commonJS({
|
|
|
1789
1789
|
let higher, lower;
|
|
1790
1790
|
let hasDomLT, hasDomGT;
|
|
1791
1791
|
let needDomLTPre = lt && !options.includePrerelease && lt.semver.prerelease.length ? lt.semver : false;
|
|
1792
|
-
let needDomGTPre =
|
|
1792
|
+
let needDomGTPre = gt2 && !options.includePrerelease && gt2.semver.prerelease.length ? gt2.semver : false;
|
|
1793
1793
|
if (needDomLTPre && needDomLTPre.prerelease.length === 1 && lt.operator === "<" && needDomLTPre.prerelease[0] === 0) {
|
|
1794
1794
|
needDomLTPre = false;
|
|
1795
1795
|
}
|
|
1796
1796
|
for (const c of dom) {
|
|
1797
1797
|
hasDomGT = hasDomGT || c.operator === ">" || c.operator === ">=";
|
|
1798
1798
|
hasDomLT = hasDomLT || c.operator === "<" || c.operator === "<=";
|
|
1799
|
-
if (
|
|
1799
|
+
if (gt2) {
|
|
1800
1800
|
if (needDomGTPre) {
|
|
1801
1801
|
if (c.semver.prerelease && c.semver.prerelease.length && c.semver.major === needDomGTPre.major && c.semver.minor === needDomGTPre.minor && c.semver.patch === needDomGTPre.patch) {
|
|
1802
1802
|
needDomGTPre = false;
|
|
1803
1803
|
}
|
|
1804
1804
|
}
|
|
1805
1805
|
if (c.operator === ">" || c.operator === ">=") {
|
|
1806
|
-
higher = higherGT(
|
|
1807
|
-
if (higher === c && higher !==
|
|
1806
|
+
higher = higherGT(gt2, c, options);
|
|
1807
|
+
if (higher === c && higher !== gt2) {
|
|
1808
1808
|
return false;
|
|
1809
1809
|
}
|
|
1810
|
-
} else if (
|
|
1810
|
+
} else if (gt2.operator === ">=" && !satisfies(gt2.semver, String(c), options)) {
|
|
1811
1811
|
return false;
|
|
1812
1812
|
}
|
|
1813
1813
|
}
|
|
@@ -1826,14 +1826,14 @@ var require_subset = __commonJS({
|
|
|
1826
1826
|
return false;
|
|
1827
1827
|
}
|
|
1828
1828
|
}
|
|
1829
|
-
if (!c.operator && (lt ||
|
|
1829
|
+
if (!c.operator && (lt || gt2) && gtltComp !== 0) {
|
|
1830
1830
|
return false;
|
|
1831
1831
|
}
|
|
1832
1832
|
}
|
|
1833
|
-
if (
|
|
1833
|
+
if (gt2 && hasDomLT && !lt && gtltComp !== 0) {
|
|
1834
1834
|
return false;
|
|
1835
1835
|
}
|
|
1836
|
-
if (lt && hasDomGT && !
|
|
1836
|
+
if (lt && hasDomGT && !gt2 && gtltComp !== 0) {
|
|
1837
1837
|
return false;
|
|
1838
1838
|
}
|
|
1839
1839
|
if (needDomGTPre || needDomLTPre) {
|
|
@@ -1868,7 +1868,7 @@ var require_semver2 = __commonJS({
|
|
|
1868
1868
|
var SemVer = require_semver();
|
|
1869
1869
|
var identifiers = require_identifiers();
|
|
1870
1870
|
var parse = require_parse();
|
|
1871
|
-
var
|
|
1871
|
+
var valid2 = require_valid();
|
|
1872
1872
|
var clean = require_clean();
|
|
1873
1873
|
var inc = require_inc();
|
|
1874
1874
|
var diff = require_diff();
|
|
@@ -1882,7 +1882,7 @@ var require_semver2 = __commonJS({
|
|
|
1882
1882
|
var compareBuild = require_compare_build();
|
|
1883
1883
|
var sort = require_sort();
|
|
1884
1884
|
var rsort = require_rsort();
|
|
1885
|
-
var
|
|
1885
|
+
var gt2 = require_gt();
|
|
1886
1886
|
var lt = require_lt();
|
|
1887
1887
|
var eq = require_eq();
|
|
1888
1888
|
var neq = require_neq();
|
|
@@ -1906,7 +1906,7 @@ var require_semver2 = __commonJS({
|
|
|
1906
1906
|
var subset = require_subset();
|
|
1907
1907
|
module.exports = {
|
|
1908
1908
|
parse,
|
|
1909
|
-
valid,
|
|
1909
|
+
valid: valid2,
|
|
1910
1910
|
clean,
|
|
1911
1911
|
inc,
|
|
1912
1912
|
diff,
|
|
@@ -1920,7 +1920,7 @@ var require_semver2 = __commonJS({
|
|
|
1920
1920
|
compareBuild,
|
|
1921
1921
|
sort,
|
|
1922
1922
|
rsort,
|
|
1923
|
-
gt,
|
|
1923
|
+
gt: gt2,
|
|
1924
1924
|
lt,
|
|
1925
1925
|
eq,
|
|
1926
1926
|
neq,
|
|
@@ -1957,7 +1957,7 @@ var require_semver2 = __commonJS({
|
|
|
1957
1957
|
// src/index.ts
|
|
1958
1958
|
import "dotenv/config";
|
|
1959
1959
|
import { Command as Command3 } from "commander";
|
|
1960
|
-
import
|
|
1960
|
+
import chalk18 from "chalk";
|
|
1961
1961
|
|
|
1962
1962
|
// src/commands/login.ts
|
|
1963
1963
|
import open from "open";
|
|
@@ -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-YNXIZTX5.js");
|
|
2662
2662
|
render(createElement(StatusDashboard, { cwd }));
|
|
2663
2663
|
return;
|
|
2664
2664
|
} catch (error) {
|
|
@@ -2680,7 +2680,7 @@ function registerStatusCommand(program2) {
|
|
|
2680
2680
|
} catch {
|
|
2681
2681
|
}
|
|
2682
2682
|
}
|
|
2683
|
-
const { valid, pid } = validatePidFile();
|
|
2683
|
+
const { valid: valid2, pid } = validatePidFile();
|
|
2684
2684
|
if (options.json) {
|
|
2685
2685
|
logger.disableConsole();
|
|
2686
2686
|
const statusOutput = {
|
|
@@ -2716,7 +2716,7 @@ function registerStatusCommand(program2) {
|
|
|
2716
2716
|
isRepo: !!isRepo
|
|
2717
2717
|
},
|
|
2718
2718
|
daemon: {
|
|
2719
|
-
running:
|
|
2719
|
+
running: valid2 && !!pid,
|
|
2720
2720
|
pid: pid || null,
|
|
2721
2721
|
logFile: path2.join(
|
|
2722
2722
|
os.homedir(),
|
|
@@ -2825,7 +2825,7 @@ function registerStatusCommand(program2) {
|
|
|
2825
2825
|
}
|
|
2826
2826
|
console.log(chalk6.blue("\n\u2699\uFE0F Daemon:"));
|
|
2827
2827
|
console.log(chalk6.gray("\u2500".repeat(50)));
|
|
2828
|
-
if (
|
|
2828
|
+
if (valid2 && pid) {
|
|
2829
2829
|
console.log(
|
|
2830
2830
|
`${chalk6.bold("Status:")} ${chalk6.green("\u2713 Running")}`
|
|
2831
2831
|
);
|
|
@@ -3110,8 +3110,8 @@ function registerDaemonCommands(program2) {
|
|
|
3110
3110
|
daemon.command("start").description("Start the daemon in the background").action(async () => {
|
|
3111
3111
|
const spinner = ora8("Starting daemon...").start();
|
|
3112
3112
|
try {
|
|
3113
|
-
const { valid, pid } = validatePidFile();
|
|
3114
|
-
if (
|
|
3113
|
+
const { valid: valid2, pid } = validatePidFile();
|
|
3114
|
+
if (valid2 && pid) {
|
|
3115
3115
|
spinner.info("Daemon already running");
|
|
3116
3116
|
console.log(
|
|
3117
3117
|
chalk8.yellow(`
|
|
@@ -3163,8 +3163,8 @@ function registerDaemonCommands(program2) {
|
|
|
3163
3163
|
daemon.command("stop").description("Stop the running daemon").action(async () => {
|
|
3164
3164
|
const spinner = ora8("Stopping daemon...").start();
|
|
3165
3165
|
try {
|
|
3166
|
-
const { valid, pid } = validatePidFile();
|
|
3167
|
-
if (!
|
|
3166
|
+
const { valid: valid2, pid } = validatePidFile();
|
|
3167
|
+
if (!valid2 || !pid) {
|
|
3168
3168
|
spinner.info("Daemon not running");
|
|
3169
3169
|
console.log(chalk8.yellow("\n\u26A0 Daemon is not running.\n"));
|
|
3170
3170
|
return;
|
|
@@ -3201,11 +3201,11 @@ function registerDaemonCommands(program2) {
|
|
|
3201
3201
|
daemon.command("status").description("Check if the daemon is running").action(async () => {
|
|
3202
3202
|
const spinner = ora8("Checking daemon status...").start();
|
|
3203
3203
|
try {
|
|
3204
|
-
const { valid, pid } = validatePidFile();
|
|
3204
|
+
const { valid: valid2, pid } = validatePidFile();
|
|
3205
3205
|
spinner.stop();
|
|
3206
3206
|
console.log(chalk8.blue("\n\u2699\uFE0F Daemon Status:"));
|
|
3207
3207
|
console.log(chalk8.gray("\u2500".repeat(50)));
|
|
3208
|
-
if (
|
|
3208
|
+
if (valid2 && pid) {
|
|
3209
3209
|
console.log(
|
|
3210
3210
|
`${chalk8.bold("Status:")} ${chalk8.green("\u2713 Running")}`
|
|
3211
3211
|
);
|
|
@@ -3279,7 +3279,7 @@ function registerDaemonCommands(program2) {
|
|
|
3279
3279
|
console.log();
|
|
3280
3280
|
logger.info(
|
|
3281
3281
|
"daemon",
|
|
3282
|
-
`Status check: ${
|
|
3282
|
+
`Status check: ${valid2 ? "running" : "not running"}`
|
|
3283
3283
|
);
|
|
3284
3284
|
} catch (error) {
|
|
3285
3285
|
spinner.fail("Failed to check status");
|
|
@@ -3292,8 +3292,8 @@ function registerDaemonCommands(program2) {
|
|
|
3292
3292
|
});
|
|
3293
3293
|
daemon.command("restart").description("Restart the daemon").action(async () => {
|
|
3294
3294
|
console.log(chalk8.blue("\u{1F504} Restarting daemon...\n"));
|
|
3295
|
-
const { valid, pid } = validatePidFile();
|
|
3296
|
-
if (
|
|
3295
|
+
const { valid: valid2, pid } = validatePidFile();
|
|
3296
|
+
if (valid2 && pid) {
|
|
3297
3297
|
const stopSpinner = ora8("Stopping daemon...").start();
|
|
3298
3298
|
try {
|
|
3299
3299
|
killProcess(pid, "SIGTERM");
|
|
@@ -3996,7 +3996,7 @@ import ora12 from "ora";
|
|
|
3996
3996
|
import chalk12 from "chalk";
|
|
3997
3997
|
|
|
3998
3998
|
// src/services/version.ts
|
|
3999
|
-
var
|
|
3999
|
+
var semver = __toESM(require_semver2(), 1);
|
|
4000
4000
|
import fs3 from "fs";
|
|
4001
4001
|
import path5 from "path";
|
|
4002
4002
|
import os5 from "os";
|
|
@@ -4031,13 +4031,13 @@ var VersionService = class {
|
|
|
4031
4031
|
} else {
|
|
4032
4032
|
latestVersion = registryData["dist-tags"].latest;
|
|
4033
4033
|
}
|
|
4034
|
-
if (!latestVersion || !
|
|
4034
|
+
if (!latestVersion || !semver.valid(latestVersion)) {
|
|
4035
4035
|
throw new Error(`Invalid latest version: ${latestVersion}`);
|
|
4036
4036
|
}
|
|
4037
|
-
if (!
|
|
4037
|
+
if (!semver.valid(this.currentVersion)) {
|
|
4038
4038
|
throw new Error(`Invalid current version: ${this.currentVersion}`);
|
|
4039
4039
|
}
|
|
4040
|
-
const hasUpdate =
|
|
4040
|
+
const hasUpdate = semver.gt(latestVersion, this.currentVersion);
|
|
4041
4041
|
logger.info(
|
|
4042
4042
|
"version",
|
|
4043
4043
|
`Current: ${this.currentVersion}, Latest (${channel}): ${latestVersion}, Update available: ${hasUpdate}`
|
|
@@ -4095,7 +4095,10 @@ var VersionService = class {
|
|
|
4095
4095
|
const content = fs3.readFileSync(CACHE_FILE, "utf8");
|
|
4096
4096
|
return JSON.parse(content);
|
|
4097
4097
|
} catch (error) {
|
|
4098
|
-
logger.debug(
|
|
4098
|
+
logger.debug(
|
|
4099
|
+
"version",
|
|
4100
|
+
`Failed to load cache: ${error.message}`
|
|
4101
|
+
);
|
|
4099
4102
|
return null;
|
|
4100
4103
|
}
|
|
4101
4104
|
}
|
|
@@ -4115,7 +4118,10 @@ var VersionService = class {
|
|
|
4115
4118
|
};
|
|
4116
4119
|
fs3.writeFileSync(CACHE_FILE, JSON.stringify(cache, null, 2));
|
|
4117
4120
|
} catch (error) {
|
|
4118
|
-
logger.debug(
|
|
4121
|
+
logger.debug(
|
|
4122
|
+
"version",
|
|
4123
|
+
`Failed to save cache: ${error.message}`
|
|
4124
|
+
);
|
|
4119
4125
|
}
|
|
4120
4126
|
}
|
|
4121
4127
|
/**
|
|
@@ -4128,7 +4134,10 @@ var VersionService = class {
|
|
|
4128
4134
|
logger.debug("version", "Cache cleared");
|
|
4129
4135
|
}
|
|
4130
4136
|
} catch (error) {
|
|
4131
|
-
logger.debug(
|
|
4137
|
+
logger.debug(
|
|
4138
|
+
"version",
|
|
4139
|
+
`Failed to clear cache: ${error.message}`
|
|
4140
|
+
);
|
|
4132
4141
|
}
|
|
4133
4142
|
}
|
|
4134
4143
|
};
|
|
@@ -4169,8 +4178,8 @@ var UpdateService = class {
|
|
|
4169
4178
|
async performUpdate(channel = "stable") {
|
|
4170
4179
|
const spinner = ora11("Preparing update...").start();
|
|
4171
4180
|
try {
|
|
4172
|
-
const { valid, pid } = validatePidFile();
|
|
4173
|
-
const daemonWasRunning =
|
|
4181
|
+
const { valid: valid2, pid } = validatePidFile();
|
|
4182
|
+
const daemonWasRunning = valid2 && pid !== null;
|
|
4174
4183
|
if (daemonWasRunning) {
|
|
4175
4184
|
spinner.text = "Stopping daemon...";
|
|
4176
4185
|
await this.stopDaemonForUpdate(pid);
|
|
@@ -4744,10 +4753,7 @@ ${chalk14.bold(key)}: ${formatValue(value)}
|
|
|
4744
4753
|
const allConfig = config.getAll();
|
|
4745
4754
|
setNestedValue(allConfig, key, parsedValue);
|
|
4746
4755
|
const topKey = key.split(".")[0];
|
|
4747
|
-
config.set(
|
|
4748
|
-
topKey,
|
|
4749
|
-
allConfig[topKey]
|
|
4750
|
-
);
|
|
4756
|
+
config.set(topKey, allConfig[topKey]);
|
|
4751
4757
|
} else {
|
|
4752
4758
|
config.set(
|
|
4753
4759
|
key,
|
|
@@ -4969,17 +4975,13 @@ var projectsCommand = new Command2("projects").description("List all linked proj
|
|
|
4969
4975
|
const token = await authService.getToken();
|
|
4970
4976
|
if (!token) {
|
|
4971
4977
|
spinner.fail("Not authenticated");
|
|
4972
|
-
console.log(
|
|
4973
|
-
chalk16.yellow("Run 'stint login' to authenticate first.")
|
|
4974
|
-
);
|
|
4978
|
+
console.log(chalk16.yellow("Run 'stint login' to authenticate first."));
|
|
4975
4979
|
return;
|
|
4976
4980
|
}
|
|
4977
4981
|
try {
|
|
4978
4982
|
const remoteProjects = await apiService.getLinkedProjects();
|
|
4979
4983
|
spinner.stop();
|
|
4980
|
-
const remoteMap = new Map(
|
|
4981
|
-
remoteProjects.map((p) => [p.id, p])
|
|
4982
|
-
);
|
|
4984
|
+
const remoteMap = new Map(remoteProjects.map((p) => [p.id, p]));
|
|
4983
4985
|
entries.forEach(([path7, linked]) => {
|
|
4984
4986
|
const remote = remoteMap.get(linked.projectId);
|
|
4985
4987
|
if (remote) {
|
|
@@ -4989,9 +4991,7 @@ var projectsCommand = new Command2("projects").description("List all linked proj
|
|
|
4989
4991
|
if (remote.description) {
|
|
4990
4992
|
console.log(` ${chalk16.gray(remote.description)}`);
|
|
4991
4993
|
}
|
|
4992
|
-
console.log(
|
|
4993
|
-
` ${chalk16.gray("Path:")} ${chalk16.cyan(path7)}`
|
|
4994
|
-
);
|
|
4994
|
+
console.log(` ${chalk16.gray("Path:")} ${chalk16.cyan(path7)}`);
|
|
4995
4995
|
if (remote.default_branch) {
|
|
4996
4996
|
console.log(
|
|
4997
4997
|
` ${chalk16.gray("Branch:")} ${chalk16.blue(remote.default_branch)}`
|
|
@@ -5004,9 +5004,7 @@ var projectsCommand = new Command2("projects").description("List all linked proj
|
|
|
5004
5004
|
console.log(
|
|
5005
5005
|
`${chalk16.yellow("\u25CB")} ${chalk16.gray("Unknown Project")} ${chalk16.gray(`(${linked.projectId})`)}`
|
|
5006
5006
|
);
|
|
5007
|
-
console.log(
|
|
5008
|
-
` ${chalk16.gray("Path:")} ${chalk16.cyan(path7)}`
|
|
5009
|
-
);
|
|
5007
|
+
console.log(` ${chalk16.gray("Path:")} ${chalk16.cyan(path7)}`);
|
|
5010
5008
|
console.log(
|
|
5011
5009
|
` ${chalk16.gray("Linked:")} ${chalk16.gray(new Date(linked.linkedAt).toLocaleDateString())}`
|
|
5012
5010
|
);
|
|
@@ -5044,34 +5042,74 @@ var projectsCommand = new Command2("projects").description("List all linked proj
|
|
|
5044
5042
|
});
|
|
5045
5043
|
function displayLocalProjects(entries) {
|
|
5046
5044
|
entries.forEach(([path7, linked]) => {
|
|
5047
|
-
console.log(
|
|
5048
|
-
`${chalk16.green("\u25CF")} ${chalk16.white.bold(linked.projectId)}`
|
|
5049
|
-
);
|
|
5045
|
+
console.log(`${chalk16.green("\u25CF")} ${chalk16.white.bold(linked.projectId)}`);
|
|
5050
5046
|
console.log(` ${chalk16.gray("Path:")} ${chalk16.cyan(path7)}`);
|
|
5051
5047
|
console.log(
|
|
5052
5048
|
` ${chalk16.gray("Linked:")} ${chalk16.gray(new Date(linked.linkedAt).toLocaleDateString())}`
|
|
5053
5049
|
);
|
|
5054
5050
|
console.log("");
|
|
5055
5051
|
});
|
|
5056
|
-
console.log(
|
|
5052
|
+
console.log(
|
|
5053
|
+
chalk16.gray("Tip: Use 'stint projects --remote' for more details")
|
|
5054
|
+
);
|
|
5055
|
+
}
|
|
5056
|
+
|
|
5057
|
+
// src/commands/about.ts
|
|
5058
|
+
import chalk17 from "chalk";
|
|
5059
|
+
var AGENT_VERSION = "1.2.52";
|
|
5060
|
+
function registerAboutCommand(program2) {
|
|
5061
|
+
program2.command("about").description("Display information about Stint Agent").action(() => {
|
|
5062
|
+
console.log();
|
|
5063
|
+
console.log(
|
|
5064
|
+
chalk17.bold.cyan(" \u2554\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2557")
|
|
5065
|
+
);
|
|
5066
|
+
console.log(
|
|
5067
|
+
chalk17.bold.cyan(" \u2551") + chalk17.bold.white(" \u26A1 Stint Agent \u26A1 ") + chalk17.bold.cyan("\u2551")
|
|
5068
|
+
);
|
|
5069
|
+
console.log(
|
|
5070
|
+
chalk17.bold.cyan(" \u255A\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u255D")
|
|
5071
|
+
);
|
|
5072
|
+
console.log();
|
|
5073
|
+
console.log(chalk17.bold.blue(" \u{1F4E6} Version: ") + chalk17.white(AGENT_VERSION));
|
|
5074
|
+
console.log(
|
|
5075
|
+
chalk17.bold.blue(" \u{1F464} Author: ") + chalk17.white("John Gowelle")
|
|
5076
|
+
);
|
|
5077
|
+
console.log(
|
|
5078
|
+
chalk17.bold.blue(" \u{1F3E0} Homepage: ") + chalk17.underline.blue("https://stint.codes")
|
|
5079
|
+
);
|
|
5080
|
+
console.log(
|
|
5081
|
+
chalk17.bold.blue(" \u{1F4DA} Docs: ") + chalk17.underline.blue("https://stint.codes/docs")
|
|
5082
|
+
);
|
|
5083
|
+
console.log(
|
|
5084
|
+
chalk17.bold.blue(" \u{1F41B} Issues: ") + chalk17.underline.blue("https://github.com/gowelle/stint-agent/issues")
|
|
5085
|
+
);
|
|
5086
|
+
console.log();
|
|
5087
|
+
console.log(chalk17.gray(" Local daemon for Stint Project Assistant."));
|
|
5088
|
+
console.log(chalk17.gray(" Tracks time, manages commits, and syncs with Stint."));
|
|
5089
|
+
console.log();
|
|
5090
|
+
console.log(
|
|
5091
|
+
chalk17.dim(" Made with \u2764\uFE0F by John Gowelle")
|
|
5092
|
+
);
|
|
5093
|
+
console.log();
|
|
5094
|
+
});
|
|
5057
5095
|
}
|
|
5058
5096
|
|
|
5059
5097
|
// src/index.ts
|
|
5060
|
-
var
|
|
5098
|
+
var AGENT_VERSION2 = "1.2.52";
|
|
5061
5099
|
var program = new Command3();
|
|
5062
|
-
program.name("stint").description("Stint Agent - Local daemon for Stint Project Assistant").version(
|
|
5100
|
+
program.name("stint").description("Stint Agent - Local daemon for Stint Project Assistant").version(AGENT_VERSION2, "-v, --version", "output the current version").addHelpText(
|
|
5063
5101
|
"after",
|
|
5064
5102
|
`
|
|
5065
|
-
${
|
|
5066
|
-
${
|
|
5067
|
-
${
|
|
5068
|
-
${
|
|
5069
|
-
${
|
|
5070
|
-
${
|
|
5071
|
-
${
|
|
5103
|
+
${chalk18.bold("Examples:")}
|
|
5104
|
+
${chalk18.cyan("$")} stint login ${chalk18.gray("# Authenticate with Stint")}
|
|
5105
|
+
${chalk18.cyan("$")} stint install ${chalk18.gray("# Install agent to run on startup")}
|
|
5106
|
+
${chalk18.cyan("$")} stint link ${chalk18.gray("# Link current directory to a project")}
|
|
5107
|
+
${chalk18.cyan("$")} stint daemon start ${chalk18.gray("# Start background daemon")}
|
|
5108
|
+
${chalk18.cyan("$")} stint status ${chalk18.gray("# Check status")}
|
|
5109
|
+
${chalk18.cyan("$")} stint commits ${chalk18.gray("# List pending commits")}
|
|
5072
5110
|
|
|
5073
|
-
${
|
|
5074
|
-
For more information, visit: ${
|
|
5111
|
+
${chalk18.bold("Documentation:")}
|
|
5112
|
+
For more information, visit: ${chalk18.blue("https://stint.codes/docs")}
|
|
5075
5113
|
`
|
|
5076
5114
|
);
|
|
5077
5115
|
registerLoginCommand(program);
|
|
@@ -5090,6 +5128,7 @@ registerDoctorCommand(program);
|
|
|
5090
5128
|
registerConfigCommand(program);
|
|
5091
5129
|
program.addCommand(tasksCommand);
|
|
5092
5130
|
program.addCommand(projectsCommand);
|
|
5131
|
+
registerAboutCommand(program);
|
|
5093
5132
|
program.exitOverride();
|
|
5094
5133
|
try {
|
|
5095
5134
|
await program.parseAsync(process.argv);
|
|
@@ -5097,7 +5136,7 @@ try {
|
|
|
5097
5136
|
const commanderError = error;
|
|
5098
5137
|
if (commanderError.code !== "commander.help" && commanderError.code !== "commander.version" && commanderError.code !== "commander.helpDisplayed") {
|
|
5099
5138
|
logger.error("cli", "Command execution failed", error);
|
|
5100
|
-
console.error(
|
|
5139
|
+
console.error(chalk18.red(`
|
|
5101
5140
|
\u2716 Error: ${error.message}
|
|
5102
5141
|
`));
|
|
5103
5142
|
process.exit(1);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gowelle/stint-agent",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.52",
|
|
4
4
|
"description": "Local agent for Stint - Project Assistant",
|
|
5
5
|
"author": "Gowelle John <gowelle.john@icloud.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -33,6 +33,7 @@
|
|
|
33
33
|
"build": "tsup",
|
|
34
34
|
"dev": "tsup --watch",
|
|
35
35
|
"lint": "eslint src",
|
|
36
|
+
"typecheck": "tsc --noEmit",
|
|
36
37
|
"format": "prettier --write src",
|
|
37
38
|
"format:check": "prettier --check src",
|
|
38
39
|
"test": "vitest",
|