@dadado/agent-kit-cli 6.7.2 → 6.9.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/dashboard/README.md +16 -6
- package/dashboard/dashboard-data.mjs +237 -3
- package/dashboard/dashboard.html +398 -74
- package/dashboard/lib/ship-lane.mjs +690 -0
- package/dashboard/serve.mjs +19 -0
- package/dist/{chunk-5WDFOFL4.js → chunk-3Z4PGEEJ.js} +8 -15
- package/dist/{chunk-R6WH5P7R.js → chunk-CXDAT76O.js} +15 -1
- package/dist/{engine-info-UQNVNOA2.js → engine-info-3MQML5I2.js} +1 -1
- package/dist/index.js +4 -4
- package/dist/run-VOVR5O7S.js +600 -0
- package/dist/{run-plan-P7VTOWYI.js → run-plan-KWGS2SOZ.js} +2 -2
- package/package.json +1 -1
- package/dist/run-QG7XQ3XF.js +0 -335
package/dashboard/serve.mjs
CHANGED
|
@@ -39,6 +39,7 @@ import {
|
|
|
39
39
|
} from "./lib/live-refresh.mjs";
|
|
40
40
|
import { PIPELINE_CACHE_ENV, pipelineCacheJsonFromSnapshot } from "./lib/pipeline-cache.mjs";
|
|
41
41
|
import { buildInventoryBaseline } from "./lib/semantic-model.mjs";
|
|
42
|
+
import { SHIP_LANE_CACHE_ENV, shipLaneCacheJsonFromSnapshot } from "./lib/ship-lane.mjs";
|
|
42
43
|
|
|
43
44
|
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
44
45
|
/** Kit tree that owns `dashboard/` static assets and serve.mjs. */
|
|
@@ -78,6 +79,8 @@ const dataScript = join(__dirname, "dashboard-data.mjs");
|
|
|
78
79
|
let previousInventoryJson = null;
|
|
79
80
|
/** Last attempted devops.pipeline (with fetchedAt); the data script reuses it while fresh. */
|
|
80
81
|
let previousPipelineJson = null;
|
|
82
|
+
/** Last attempted shipLane.remote (with fetchedAt); reused for up to 120s (lib/ship-lane.mjs). */
|
|
83
|
+
let previousShipLaneJson = null;
|
|
81
84
|
|
|
82
85
|
/**
|
|
83
86
|
* @param {string} payload
|
|
@@ -113,6 +116,19 @@ function pipelineCacheJsonFromPayload(payload) {
|
|
|
113
116
|
}
|
|
114
117
|
}
|
|
115
118
|
|
|
119
|
+
/**
|
|
120
|
+
* @param {string} payload
|
|
121
|
+
* @returns {string|null}
|
|
122
|
+
*/
|
|
123
|
+
function shipLaneCacheJsonFromPayload(payload) {
|
|
124
|
+
try {
|
|
125
|
+
const data = JSON.parse(payload);
|
|
126
|
+
return data && !data.error ? shipLaneCacheJsonFromSnapshot(data) : null;
|
|
127
|
+
} catch {
|
|
128
|
+
return null;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
|
|
116
132
|
function setCorsHeaders(req, res) {
|
|
117
133
|
applyCorsHeaders(req, res, PORT);
|
|
118
134
|
}
|
|
@@ -286,6 +302,7 @@ function runDataScript() {
|
|
|
286
302
|
// Empty string = cold start (dashboard-data treats falsy as no previous).
|
|
287
303
|
AGENT_KIT_PREV_INVENTORY: previousInventoryJson || "",
|
|
288
304
|
[PIPELINE_CACHE_ENV]: previousPipelineJson || "",
|
|
305
|
+
[SHIP_LANE_CACHE_ENV]: previousShipLaneJson || "",
|
|
289
306
|
};
|
|
290
307
|
execFile(
|
|
291
308
|
process.execPath,
|
|
@@ -310,6 +327,8 @@ function runDataScript() {
|
|
|
310
327
|
if (baseline) previousInventoryJson = baseline;
|
|
311
328
|
const pipelineCache = pipelineCacheJsonFromPayload(stdout);
|
|
312
329
|
if (pipelineCache) previousPipelineJson = pipelineCache;
|
|
330
|
+
const shipLaneCache = shipLaneCacheJsonFromPayload(stdout);
|
|
331
|
+
if (shipLaneCache) previousShipLaneJson = shipLaneCache;
|
|
313
332
|
// Chat titles are private: a broadcast (LAN, token-gated) server never serves them, even
|
|
314
333
|
// if the child missed the bind env. Every route (/api/data, SSE connect, push) reads this.
|
|
315
334
|
resolve(authResolved.broadcast ? withholdChatsFromPayload(stdout) : stdout);
|
|
@@ -2,8 +2,10 @@ import {
|
|
|
2
2
|
DRIVER_PROTOCOL_VERSION,
|
|
3
3
|
DriverAgentSink,
|
|
4
4
|
createDriverAnswerReader,
|
|
5
|
-
createDriverEmitter
|
|
6
|
-
|
|
5
|
+
createDriverEmitter,
|
|
6
|
+
driverReplies,
|
|
7
|
+
driverStop
|
|
8
|
+
} from "./chunk-CXDAT76O.js";
|
|
7
9
|
import {
|
|
8
10
|
classifyGateExit,
|
|
9
11
|
landGateExit
|
|
@@ -1036,6 +1038,7 @@ async function runPlanLoop(opts) {
|
|
|
1036
1038
|
emit({
|
|
1037
1039
|
type: "run_start",
|
|
1038
1040
|
protocol: DRIVER_PROTOCOL_VERSION,
|
|
1041
|
+
command: "run-plan",
|
|
1039
1042
|
backend: opts.backend.id,
|
|
1040
1043
|
plan: path5.basename(planPath),
|
|
1041
1044
|
pending: pendingAtStart,
|
|
@@ -1123,19 +1126,8 @@ async function runPlanLoop(opts) {
|
|
|
1123
1126
|
pendingBefore: before,
|
|
1124
1127
|
pendingAfter,
|
|
1125
1128
|
result: driverSentinel(sentinel2),
|
|
1126
|
-
replies: replies
|
|
1127
|
-
|
|
1128
|
-
reply,
|
|
1129
|
-
label,
|
|
1130
|
-
line,
|
|
1131
|
-
at
|
|
1132
|
-
})),
|
|
1133
|
-
stop: hitlStop ? {
|
|
1134
|
-
askId: hitlStop.askId,
|
|
1135
|
-
cause: hitlStop.cause,
|
|
1136
|
-
message: hitlStop.message,
|
|
1137
|
-
exitCode: hitlStop.exitCode
|
|
1138
|
-
} : null
|
|
1129
|
+
replies: driverReplies(replies),
|
|
1130
|
+
stop: driverStop(hitlStop)
|
|
1139
1131
|
});
|
|
1140
1132
|
try {
|
|
1141
1133
|
const runOpts = {
|
|
@@ -1318,6 +1310,7 @@ async function runPlanLoop(opts) {
|
|
|
1318
1310
|
}
|
|
1319
1311
|
|
|
1320
1312
|
export {
|
|
1313
|
+
readRunQueueState,
|
|
1321
1314
|
shouldUseLiveTui,
|
|
1322
1315
|
withLiveTui,
|
|
1323
1316
|
runPlanLoop
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
import { createInterface } from "readline";
|
|
7
7
|
import { StringDecoder } from "string_decoder";
|
|
8
8
|
var DRIVER_PROTOCOL_MAJOR = 1;
|
|
9
|
-
var DRIVER_PROTOCOL_VERSION = "1.
|
|
9
|
+
var DRIVER_PROTOCOL_VERSION = "1.2.0";
|
|
10
10
|
var DRIVER_EVENTS_FORMATS = ["ndjson"];
|
|
11
11
|
var INBOUND_MAX_CHARS = 64 * 1024;
|
|
12
12
|
var AGENT_PENDING_MAX_CHARS = 4 * 1024 * 1024;
|
|
@@ -26,6 +26,18 @@ function createDriverEmitter(write = (text) => {
|
|
|
26
26
|
}
|
|
27
27
|
};
|
|
28
28
|
}
|
|
29
|
+
function driverReplies(replies) {
|
|
30
|
+
return (replies ?? []).map(({ askId, reply, label, line, at }) => ({
|
|
31
|
+
askId,
|
|
32
|
+
reply,
|
|
33
|
+
label,
|
|
34
|
+
line,
|
|
35
|
+
at
|
|
36
|
+
}));
|
|
37
|
+
}
|
|
38
|
+
function driverStop(stop) {
|
|
39
|
+
return stop ? { askId: stop.askId, cause: stop.cause, message: stop.message, exitCode: stop.exitCode } : null;
|
|
40
|
+
}
|
|
29
41
|
function parseDriverInbound(line) {
|
|
30
42
|
const text = line.trim();
|
|
31
43
|
if (text.length > INBOUND_MAX_CHARS) return { ok: false, error: "line too long" };
|
|
@@ -218,6 +230,8 @@ export {
|
|
|
218
230
|
DRIVER_PROTOCOL_VERSION,
|
|
219
231
|
DRIVER_EVENTS_FORMATS,
|
|
220
232
|
createDriverEmitter,
|
|
233
|
+
driverReplies,
|
|
234
|
+
driverStop,
|
|
221
235
|
createDriverAnswerReader,
|
|
222
236
|
DriverAgentSink
|
|
223
237
|
};
|
package/dist/index.js
CHANGED
|
@@ -240,9 +240,9 @@ var main = defineCommand({
|
|
|
240
240
|
contribute: () => import("./contribute-VSVPRHQ7.js").then((m) => m.contributeCommand),
|
|
241
241
|
handoff: () => import("./handoff-5AGE2D3T.js").then((m) => m.handoffCommand),
|
|
242
242
|
"plan-index": () => import("./plan-index-BNLUU6T5.js").then((m) => m.planIndexCommand),
|
|
243
|
-
run: () => import("./run-
|
|
244
|
-
"run-plan": () => import("./run-plan-
|
|
245
|
-
"run-plan-all": () => import("./run-
|
|
243
|
+
run: () => import("./run-VOVR5O7S.js").then((m) => m.runCommand),
|
|
244
|
+
"run-plan": () => import("./run-plan-KWGS2SOZ.js").then((m) => m.runPlanCommand),
|
|
245
|
+
"run-plan-all": () => import("./run-VOVR5O7S.js").then((m) => m.runPlanAllCommand),
|
|
246
246
|
countdown: () => import("./countdown-XYRE4GZU.js").then((m) => m.countdownCommand),
|
|
247
247
|
"ground-control": () => import("./ground-control-726LRB6Q.js").then((m) => m.groundControlCommand),
|
|
248
248
|
dashboard: () => import("./dashboard-YNCFISNO.js").then((m) => m.dashboardCommand),
|
|
@@ -253,7 +253,7 @@ var main = defineCommand({
|
|
|
253
253
|
monitors: () => import("./monitors-PDXBLB3U.js").then((m) => m.monitorsCommand),
|
|
254
254
|
sessions: () => import("./sessions-O7MYEMCT.js").then((m) => m.sessionsCommand),
|
|
255
255
|
validate: () => import("./validate-V2CW7J4B.js").then((m) => m.validateCommand),
|
|
256
|
-
"engine-info": () => import("./engine-info-
|
|
256
|
+
"engine-info": () => import("./engine-info-3MQML5I2.js").then((m) => m.engineInfoCommand),
|
|
257
257
|
commands: () => import("./commands-EQHK3ZEP.js").then((m) => m.commandsCommand)
|
|
258
258
|
},
|
|
259
259
|
async run({ rawArgs }) {
|