@indigoai-us/hq-cli 5.345.243 → 5.345.244
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/CHANGELOG.md +8 -0
- package/dist/command-catalog.generated.d.ts +3 -3
- package/dist/command-catalog.generated.js +3 -3
- package/dist/commands/bot.d.ts +12 -0
- package/dist/commands/bot.js +126 -44
- package/dist/hq-cloud-sync-runner/bin/sync-runner.js +285 -225
- package/dist/hq-cloud-sync-runner/package.json +1 -1
- package/dist/lib/bot/config.d.ts +10 -0
- package/dist/lib/bot/config.js +15 -0
- package/dist/lib/bot/continuity.js +2 -2
- package/dist/lib/bot/promote-sign-in.d.ts +78 -0
- package/dist/lib/bot/promote-sign-in.js +152 -0
- package/dist/lib/bot/promote.d.ts +19 -1
- package/dist/lib/bot/promote.js +25 -5
- package/dist/lib/bot/scaffold.d.ts +20 -3
- package/dist/lib/bot/scaffold.js +18 -8
- package/dist/lib/daemon/hook-requests-fleet-session-start.d.ts +10 -0
- package/dist/lib/daemon/hook-requests-fleet-session-start.js +86 -42
- package/dist/lib/daemon/hook-requests.d.ts +2 -2
- package/dist/lib/daemon/hook-requests.js +13 -3
- package/dist/lib/flag-registry-worker-source.generated.d.ts +1 -1
- package/dist/lib/flag-registry-worker-source.generated.js +1 -1
- package/dist/lib/lanes/liveness.js +46 -16
- package/package.json +8 -8
|
@@ -189,10 +189,20 @@ export function ingestSpoolLine(line, sessions, lineNo) {
|
|
|
189
189
|
entry.lastSeq = seq;
|
|
190
190
|
sessions[sessionId] = entry;
|
|
191
191
|
}
|
|
192
|
-
/** 64 KiB.
|
|
192
|
+
/** 64 KiB. The spool is read in chunks of this size, never as one string. */
|
|
193
193
|
const SPOOL_READ_CHUNK = 64 * 1024;
|
|
194
|
-
/**
|
|
194
|
+
/**
|
|
195
|
+
* A spool line longer than this is skipped whole with a warning. Liveness
|
|
196
|
+
* events are small JSON (well under 1 KiB), so this only bounds memory when a
|
|
197
|
+
* line is corrupt or has no newline.
|
|
198
|
+
*/
|
|
195
199
|
const SPOOL_MAX_LINE = 1_048_576;
|
|
200
|
+
/**
|
|
201
|
+
* Visit each spool line, reading the file in fixed-size chunks. Lines are
|
|
202
|
+
* split on the raw newline byte and decoded only once complete, so a
|
|
203
|
+
* multi-byte UTF-8 character cut by a chunk boundary stays intact. Line
|
|
204
|
+
* numbers match a whole-file `split("\n")`.
|
|
205
|
+
*/
|
|
196
206
|
function ingestSpoolFile(spoolPath, sessions, deps) {
|
|
197
207
|
const openSync = deps.openSync ?? fs.openSync;
|
|
198
208
|
const readSync = deps.readSync ?? fs.readSync;
|
|
@@ -200,27 +210,47 @@ function ingestSpoolFile(spoolPath, sessions, deps) {
|
|
|
200
210
|
const fd = openSync(spoolPath, "r");
|
|
201
211
|
try {
|
|
202
212
|
const buf = Buffer.alloc(SPOOL_READ_CHUNK);
|
|
203
|
-
let
|
|
213
|
+
let pending = [];
|
|
214
|
+
let pendingBytes = 0;
|
|
215
|
+
let oversized = false;
|
|
204
216
|
let lineNo = 0;
|
|
217
|
+
const finishLine = (tail) => {
|
|
218
|
+
lineNo += 1;
|
|
219
|
+
if (oversized) {
|
|
220
|
+
process.stderr.write(`lanes liveness: skipping oversized spool line ${lineNo}\n`);
|
|
221
|
+
}
|
|
222
|
+
else {
|
|
223
|
+
const bytes = pending.length > 0 ? Buffer.concat([...pending, tail]) : tail;
|
|
224
|
+
ingestSpoolLine(bytes.toString("utf8"), sessions, lineNo);
|
|
225
|
+
}
|
|
226
|
+
pending = [];
|
|
227
|
+
pendingBytes = 0;
|
|
228
|
+
oversized = false;
|
|
229
|
+
};
|
|
205
230
|
for (;;) {
|
|
206
231
|
const n = readSync(fd, buf, 0, buf.length, null);
|
|
207
232
|
if (n === 0)
|
|
208
233
|
break;
|
|
209
|
-
|
|
210
|
-
let
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
234
|
+
const chunk = buf.subarray(0, n);
|
|
235
|
+
let start = 0;
|
|
236
|
+
for (let nl = chunk.indexOf(0x0a, start); nl !== -1; nl = chunk.indexOf(0x0a, start)) {
|
|
237
|
+
finishLine(chunk.subarray(start, nl));
|
|
238
|
+
start = nl + 1;
|
|
239
|
+
}
|
|
240
|
+
if (start < n && !oversized) {
|
|
241
|
+
pendingBytes += n - start;
|
|
242
|
+
if (pendingBytes > SPOOL_MAX_LINE) {
|
|
243
|
+
oversized = true;
|
|
244
|
+
pending = [];
|
|
245
|
+
}
|
|
246
|
+
else {
|
|
247
|
+
// Copy: buf is reused by the next read.
|
|
248
|
+
pending.push(Buffer.from(chunk.subarray(start)));
|
|
249
|
+
}
|
|
216
250
|
}
|
|
217
|
-
if (leftover.length > SPOOL_MAX_LINE)
|
|
218
|
-
leftover = "";
|
|
219
|
-
}
|
|
220
|
-
if (leftover) {
|
|
221
|
-
lineNo += 1;
|
|
222
|
-
ingestSpoolLine(leftover, sessions, lineNo);
|
|
223
251
|
}
|
|
252
|
+
if (oversized || pendingBytes > 0)
|
|
253
|
+
finishLine(Buffer.alloc(0));
|
|
224
254
|
}
|
|
225
255
|
finally {
|
|
226
256
|
closeSync(fd);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@indigoai-us/hq-cli",
|
|
3
|
-
"version": "5.345.
|
|
3
|
+
"version": "5.345.244",
|
|
4
4
|
"description": "HQ by Indigo management CLI — modules and cloud sync",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"bin": {
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
"@aws-sdk/client-iot-data-plane": "^3.1096.0",
|
|
64
64
|
"@aws-sdk/client-s3": "^3.1049.0",
|
|
65
65
|
"@aws-sdk/dsql-signer": "^3.1146.0",
|
|
66
|
-
"@indigoai-us/hq-cloud": "6.18.
|
|
66
|
+
"@indigoai-us/hq-cloud": "6.18.119",
|
|
67
67
|
"@indigoai-us/hq-flags-client": "^0.2.0",
|
|
68
68
|
"@modelcontextprotocol/sdk": "1.32.2",
|
|
69
69
|
"@sentry/node": "^10.49.0",
|
|
@@ -126,11 +126,11 @@
|
|
|
126
126
|
"*.{ts,tsx,mts,cts,js,jsx,mjs,cjs}": "eslint --cache --no-error-on-unmatched-pattern"
|
|
127
127
|
},
|
|
128
128
|
"optionalDependencies": {
|
|
129
|
-
"@indigoai-us/hq-hook-win32-x64": "5.345.
|
|
130
|
-
"@indigoai-us/hq-hook-win32-arm64": "5.345.
|
|
131
|
-
"@indigoai-us/hq-hook-darwin-x64": "5.345.
|
|
132
|
-
"@indigoai-us/hq-hook-darwin-arm64": "5.345.
|
|
133
|
-
"@indigoai-us/hq-hook-linux-x64": "5.345.
|
|
134
|
-
"@indigoai-us/hq-hook-linux-arm64": "5.345.
|
|
129
|
+
"@indigoai-us/hq-hook-win32-x64": "5.345.244",
|
|
130
|
+
"@indigoai-us/hq-hook-win32-arm64": "5.345.244",
|
|
131
|
+
"@indigoai-us/hq-hook-darwin-x64": "5.345.244",
|
|
132
|
+
"@indigoai-us/hq-hook-darwin-arm64": "5.345.244",
|
|
133
|
+
"@indigoai-us/hq-hook-linux-x64": "5.345.244",
|
|
134
|
+
"@indigoai-us/hq-hook-linux-arm64": "5.345.244"
|
|
135
135
|
}
|
|
136
136
|
}
|