@testmuai/kane-cli 0.6.3 → 0.6.6
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/bin/kane-cli.cjs +91 -0
- package/bin/resolve-runtime.cjs +45 -0
- package/dist/ChatSurface-LV3KW6WN.js +8 -0
- package/dist/{ChromeProfilePicker-UUGUMJPI.js → ChromeProfilePicker-6PLUQ5TW.js} +1 -1
- package/dist/{CliFeedbackPrompt-JZWESL7Z.js → CliFeedbackPrompt-I4F56IVK.js} +1 -1
- package/dist/{CliUploadProgress-62U3LAUU.js → CliUploadProgress-ULRSPKY3.js} +1 -1
- package/dist/{ConfigView-WHEFCVHR.js → ConfigView-7NMYALEA.js} +1 -1
- package/dist/EvidenceViewOffer-KQKPTMXA.js +2 -0
- package/dist/{FolderPicker-HJUUHQEI.js → FolderPicker-4IOVDO2P.js} +1 -1
- package/dist/{HelpView-EWHP7LSJ.js → HelpView-SHMVMHNU.js} +1 -1
- package/dist/{InfoBox-GQQJVTI5.js → InfoBox-W2LZVGQS.js} +1 -1
- package/dist/{LinksBox-EWCPAZFN.js → LinksBox-ZS25VTBY.js} +1 -1
- package/dist/{ProfilesView-5FJNQMUW.js → ProfilesView-XBBRIQ3U.js} +1 -1
- package/dist/{ProjectPicker-IN7GFN7I.js → ProjectPicker-AUN47FXS.js} +1 -1
- package/dist/{SaveSessionPrompt-ISODGFP7.js → SaveSessionPrompt-Z2K225VN.js} +1 -1
- package/dist/SingleShotApp-M7R5PW4X.js +2 -0
- package/dist/{SummaryBox-R6WHU7VD.js → SummaryBox-4T545XRB.js} +1 -1
- package/dist/TestMdRunView-JXRXMACE.js +2 -0
- package/dist/{WhoamiView-YRQNOSOH.js → WhoamiView-GCVD35EX.js} +1 -1
- package/dist/bind-JLMT57Q3.js +6 -0
- package/dist/{bridge-7UMWMIJJ.js → bridge-PDJEOSAJ.js} +1 -1
- package/dist/{changelog-YQC2QDCO.js → changelog-D65HWZDM.js} +1 -1
- package/dist/{chat-committer-GHDZY5XF.js → chat-committer-ADJJTDUT.js} +1 -1
- package/dist/{chat-controller-QXFAB2DK.js → chat-controller-VAC57IEV.js} +1 -1
- package/dist/{chunk-B5LJCGAY.js → chunk-24OFJ7SE.js} +1 -1
- package/dist/{chunk-PJDOXRLB.js → chunk-24VYAMMK.js} +1 -1
- package/dist/chunk-262ES67I.js +14 -0
- package/dist/{chunk-CIW2KP4C.js → chunk-2BWRAY3Y.js} +1 -1
- package/dist/{chunk-KHDUQ33H.js → chunk-2PQXEEVY.js} +1 -1
- package/dist/{chunk-F66SSA4C.js → chunk-2WO7G2HO.js} +1 -1
- package/dist/{chunk-Y6LMHBLE.js → chunk-32GP7KTM.js} +1 -1
- package/dist/{chunk-NNZV5RCE.js → chunk-3C5GMAM4.js} +1 -1
- package/dist/{chunk-SHSV64GX.js → chunk-3Z3UIW5H.js} +1 -1
- package/dist/{chunk-OE7TVGNB.js → chunk-4A6BLXQN.js} +3 -3
- package/dist/chunk-4R2HOA7J.js +14 -0
- package/dist/{chunk-AV5SUGRY.js → chunk-4SXD6XWV.js} +1 -1
- package/dist/{chunk-FFL2TQEJ.js → chunk-5JJ245FW.js} +1 -1
- package/dist/chunk-5YPBPZUR.js +2 -0
- package/dist/chunk-64LC36AF.js +2 -0
- package/dist/{chunk-Z56AWGVY.js → chunk-6AYUSR7X.js} +1 -1
- package/dist/{chunk-Y7KW5AEN.js → chunk-6CZIEK6B.js} +1 -1
- package/dist/{chunk-VJUIW2ES.js → chunk-6GTOYTCQ.js} +1 -1
- package/dist/{chunk-EWFFJBAM.js → chunk-6NIV7AVZ.js} +1 -1
- package/dist/chunk-6SGPN76K.js +2 -0
- package/dist/{chunk-7MV5UF6O.js → chunk-6XHAXAL2.js} +1 -1
- package/dist/{chunk-AE6SS34N.js → chunk-74RUSHIB.js} +1 -1
- package/dist/{chunk-RLG5NUTE.js → chunk-AKHUNBQS.js} +1 -1
- package/dist/{chunk-53VDR5DN.js → chunk-BLSZ4H5W.js} +12 -12
- package/dist/{chunk-OGVIHL5G.js → chunk-BV5QKFMJ.js} +1 -1
- package/dist/{chunk-SL7AJ7JQ.js → chunk-C42WWO7Y.js} +1 -1
- package/dist/{chunk-FYOCF7DY.js → chunk-CJJXT5DO.js} +1 -1
- package/dist/chunk-D7L6UW5Z.js +7 -0
- package/dist/chunk-EHN5HTUD.js +147 -0
- package/dist/{chunk-P46TIMGQ.js → chunk-EOLQUB4Q.js} +1 -1
- package/dist/{chunk-C5POEXSX.js → chunk-EWTX7HSU.js} +2 -2
- package/dist/{chunk-RGEAEAZB.js → chunk-FJTWJ243.js} +1 -1
- package/dist/{chunk-CE664P73.js → chunk-GBBVP2JW.js} +1 -1
- package/dist/chunk-GLS46X7N.js +5 -0
- package/dist/{chunk-AD46OCZ4.js → chunk-GRB66C5S.js} +1 -1
- package/dist/{chunk-22A2ECA2.js → chunk-GYW7LVVL.js} +1 -1
- package/dist/{chunk-BO3JA2GS.js → chunk-HA5GE57Z.js} +15 -15
- package/dist/{chunk-VXGOWBET.js → chunk-HWA7WD44.js} +1 -1
- package/dist/{chunk-7YQW4TFI.js → chunk-JF7Q2I45.js} +1 -1
- package/dist/{chunk-TTSYHJLX.js → chunk-JTEY32TL.js} +1 -1
- package/dist/{chunk-DEEBPSJN.js → chunk-JU5KRCKD.js} +4 -4
- package/dist/chunk-JV356AYH.js +5 -0
- package/dist/chunk-K5JGCJ2K.js +6 -0
- package/dist/{chunk-UXJPCWGW.js → chunk-KI2DVQSA.js} +1 -1
- package/dist/chunk-KNCHEM6A.js +9 -0
- package/dist/{chunk-YZSYXNMB.js → chunk-KYHXDJN4.js} +1 -1
- package/dist/{chunk-326XAPMW.js → chunk-L26LU6TU.js} +2 -2
- package/dist/{chunk-WFRL54GK.js → chunk-LABIRPOT.js} +1 -1
- package/dist/{chunk-BFFCGEUH.js → chunk-LEQ2B3PR.js} +1 -1
- package/dist/{chunk-EEO4XWY6.js → chunk-LLS47HUA.js} +1 -1
- package/dist/{chunk-2S4S2XJC.js → chunk-LURGFJEE.js} +1 -1
- package/dist/{chunk-D5T4ARTB.js → chunk-MCQXRJGH.js} +1 -1
- package/dist/{chunk-2TVRHXRK.js → chunk-MSPZOEFB.js} +1 -1
- package/dist/{chunk-YZKPZXHY.js → chunk-MY32TBBR.js} +1 -1
- package/dist/{chunk-BGGNBWAJ.js → chunk-N6DO2LBH.js} +1 -1
- package/dist/{chunk-ARS72637.js → chunk-OFEOWKM3.js} +1 -1
- package/dist/{chunk-TZZYRDCF.js → chunk-P4HW2NTZ.js} +1 -1
- package/dist/{chunk-LMJTY32X.js → chunk-RHNKYNNZ.js} +1 -1
- package/dist/{chunk-RZFINU7J.js → chunk-RIMJDJWY.js} +1 -1
- package/dist/{chunk-ZKYYZ5NO.js → chunk-RN4OSVTG.js} +2 -2
- package/dist/{chunk-ME5QSYWX.js → chunk-RV2NXHIC.js} +1 -1
- package/dist/{chunk-SQFNMZJ2.js → chunk-S2C62SDY.js} +1 -1
- package/dist/chunk-SJ2KQKOV.js +3 -0
- package/dist/{chunk-G6AF2JUA.js → chunk-UZJ7MRBV.js} +1 -1
- package/dist/{chunk-XBE7PGVY.js → chunk-VBCE4U4B.js} +1 -1
- package/dist/chunk-WIA7TPK3.js +2 -0
- package/dist/{chunk-F2K3XFFH.js → chunk-WJGBXJT4.js} +2 -2
- package/dist/{chunk-7LFCSSPX.js → chunk-WWH7CW5R.js} +1 -1
- package/dist/{chunk-NFGG5DA2.js → chunk-XQL53VB7.js} +1 -1
- package/dist/{chunk-B2PZAB7J.js → chunk-ZG2V2ODK.js} +1 -1
- package/dist/{chunk-GIRXJOJI.js → chunk-ZZLR3O5A.js} +1 -1
- package/dist/{config-5OOP2BO3.js → config-6PAZZ7CR.js} +1 -1
- package/dist/{cover-cmd-Y5L4O4Q3.js → cover-cmd-K3LCXHAQ.js} +1 -1
- package/dist/{credentials-XCP6DJZZ.js → credentials-BJCIWQWA.js} +1 -1
- package/dist/descriptor-EHK3DRCZ.js +2 -0
- package/dist/{evidence-AX67Q6RN.js → evidence-7VE5EGEF.js} +1 -1
- package/dist/evolve-cmd-RUGUWKAG.js +2 -0
- package/dist/explain-VFIZTHFN.js +2 -0
- package/dist/{explain-cmd-RIDEMDMY.js → explain-cmd-KV5YUXKB.js} +1 -1
- package/dist/{explain-cmd-55WRDIMW.js → explain-cmd-U367SD4N.js} +1 -1
- package/dist/{extract-bind-ZDAXRQUS.js → extract-bind-YS7C4KZ3.js} +2 -2
- package/dist/{extract-cmd-5GGI6LAM.js → extract-cmd-Z4PMDIMZ.js} +2 -2
- package/dist/{gaps-cmd-P2DRK6FW.js → gaps-cmd-DTVDIOED.js} +1 -1
- package/dist/{gate-FACZRGOC.js → gate-B6C6KLFA.js} +1 -1
- package/dist/{generate-headless-DRDE46ON.js → generate-headless-IWY32HC4.js} +2 -2
- package/dist/{headless-io-GXHKDPHB.js → headless-io-PWW6YKH2.js} +1 -1
- package/dist/index.js +43 -43
- package/dist/ingest-C5ANIN7S.js +2 -0
- package/dist/ingest-cmd-LLC5CDQ5.js +3 -0
- package/dist/interactive-bind-ZIIJDRBU.js +7 -0
- package/dist/{lifecycle-cmd-55NZL3UO.js → lifecycle-cmd-BXE5IMFN.js} +1 -1
- package/dist/{list-cmd-JB2ABACD.js → list-cmd-KBWPYJMV.js} +1 -1
- package/dist/{list-commands-UDAL3SBY.js → list-commands-SSXJQGE7.js} +1 -1
- package/dist/{logical-ids-ATVR6PF2.js → logical-ids-3Y6RX5C2.js} +1 -1
- package/dist/login-flow-HRS6YACY.js +2 -0
- package/dist/{maintenance-cmd-E3HEEVQW.js → maintenance-cmd-VS3APIUN.js} +1 -1
- package/dist/{persist-recorded-session-BW3YSFMP.js → persist-recorded-session-3AOYZJT2.js} +1 -1
- package/dist/pipeline-IZSODNCC.js +2 -0
- package/dist/readmodel-XOGOELUP.js +2 -0
- package/dist/reconcile-cmd-6HVZJFG3.js +2 -0
- package/dist/{recording-banner-6FVTCUWQ.js → recording-banner-KKEUWS3N.js} +1 -1
- package/dist/{require-project-folder-AQUVEEJB.js → require-project-folder-NPTKR2AW.js} +1 -1
- package/dist/{revert-3TKLOYQA.js → revert-AQQ2VHRM.js} +1 -1
- package/dist/{review-cmd-RXPPC5GK.js → review-cmd-4WZUUOE4.js} +1 -1
- package/dist/run-2A7M7EJK.js +2 -0
- package/dist/run-6AFY35QW.js +2 -0
- package/dist/{run-test-md-AUK7NGLL.js → run-test-md-QNC6KDMN.js} +2 -2
- package/dist/{skill-installer-2MNPCPRD.js → skill-installer-ULFNSE6X.js} +1 -1
- package/dist/{spawner-XCOMTJJC.js → spawner-DWONVIPI.js} +1 -1
- package/dist/tcg-generate-IHHPRVNG.js +2 -0
- package/dist/{testmd-actions-TU4KTO32.js → testmd-actions-S3ZNOZEK.js} +1 -1
- package/dist/token-refresh-CFVOA62N.js +2 -0
- package/dist/{validate-basic-IYMPP7C7.js → validate-basic-4OLDKIA2.js} +1 -1
- package/dist/{version-check-MUPSKONS.js → version-check-UL4S6R4N.js} +1 -1
- package/dist/{view-cmd-QE2FS3GB.js → view-cmd-FRMQF76B.js} +1 -1
- package/dist/walk-session-N3BP57HK.js +2 -0
- package/package.json +16 -8
- package/bin/kane-cli.js +0 -2
- package/dist/ChatSurface-J777M5WC.js +0 -8
- package/dist/EvidenceViewOffer-JQDEAE2T.js +0 -2
- package/dist/SingleShotApp-QANGFAPO.js +0 -2
- package/dist/TestMdRunView-74A3LCNE.js +0 -2
- package/dist/archive-committer-3NI773TP.js +0 -2
- package/dist/bind-FZ4X4SOK.js +0 -6
- package/dist/chunk-6RQAUK5F.js +0 -5
- package/dist/chunk-E4OYR32M.js +0 -2
- package/dist/chunk-FTD3B7QA.js +0 -2
- package/dist/chunk-GIGD4M7V.js +0 -5
- package/dist/chunk-I2S6KNZW.js +0 -2
- package/dist/chunk-IACKIGPX.js +0 -2
- package/dist/chunk-NFOBDHZK.js +0 -147
- package/dist/chunk-Q4HLQOJI.js +0 -7
- package/dist/chunk-SGU72YLH.js +0 -9
- package/dist/chunk-TY5LWU6I.js +0 -14
- package/dist/chunk-YANCBRER.js +0 -3
- package/dist/descriptor-SL5A7RQE.js +0 -2
- package/dist/distill-cmd-EYCCCFL3.js +0 -2
- package/dist/evolve-cmd-HR25DRTC.js +0 -2
- package/dist/explain-JIXUWEFJ.js +0 -2
- package/dist/ingest-4CGBXC2L.js +0 -2
- package/dist/ingest-cmd-X7BWGIN7.js +0 -3
- package/dist/interactive-bind-T6OBLZCT.js +0 -7
- package/dist/login-flow-LJ4BH3OS.js +0 -2
- package/dist/pipeline-TZJ652NT.js +0 -2
- package/dist/readmodel-MPTENJ2R.js +0 -2
- package/dist/reconcile-cmd-242S7XNO.js +0 -8
- package/dist/run-UGAOGR3B.js +0 -2
- package/dist/signals-cmd-LXHZQLXZ.js +0 -2
- package/dist/tcg-generate-E5X23RVP.js +0 -2
- package/dist/token-refresh-GGLARJV4.js +0 -2
package/bin/kane-cli.cjs
ADDED
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// Trampoline: respawn kane-cli onto the bundled Node runtime shipped in the
|
|
3
|
+
// kane-cli-node platform runtime package, so the CLI runs on OUR pinned Node
|
|
4
|
+
// regardless of the PATH one. ES5-only syntax on purpose: an ancient Node must PARSE this file
|
|
5
|
+
// and reach the friendly floor error below instead of dying on a SyntaxError.
|
|
6
|
+
// (.cjs is load-bearing too — the package is "type": "module", so a .js file
|
|
7
|
+
// would parse as ESM where `require` is undefined.)
|
|
8
|
+
// Escape hatch: KANE_CLI_SYSTEM_NODE=1 forces the system node, silently.
|
|
9
|
+
"use strict";
|
|
10
|
+
var MIN_MAJOR = 18; // lockstep with package.json "engines"
|
|
11
|
+
var path = require("path");
|
|
12
|
+
var entry = path.join(__dirname, "..", "dist", "index.js");
|
|
13
|
+
|
|
14
|
+
var bundled = null;
|
|
15
|
+
try {
|
|
16
|
+
bundled = require("./resolve-runtime.cjs")();
|
|
17
|
+
} catch (e) {
|
|
18
|
+
bundled = null; // resolution must never take the CLI down
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
var wantRespawn =
|
|
22
|
+
bundled &&
|
|
23
|
+
process.env.KANE_CLI_RESPAWNED !== "1" &&
|
|
24
|
+
process.env.KANE_CLI_SYSTEM_NODE !== "1";
|
|
25
|
+
|
|
26
|
+
if (wantRespawn) {
|
|
27
|
+
// Keep the parent alive through Ctrl+C: the child shares the terminal's
|
|
28
|
+
// process group and owns the interrupt UX (Ink double-press). Installing
|
|
29
|
+
// listeners replaces the default kill-the-parent disposition; they run
|
|
30
|
+
// (as no-ops) only after spawnSync unblocks.
|
|
31
|
+
process.on("SIGINT", function () {});
|
|
32
|
+
process.on("SIGTERM", function () {});
|
|
33
|
+
var spawnSync = require("child_process").spawnSync;
|
|
34
|
+
var childEnv = {};
|
|
35
|
+
for (var k in process.env) childEnv[k] = process.env[k];
|
|
36
|
+
childEnv.KANE_CLI_RESPAWNED = "1";
|
|
37
|
+
var r = spawnSync(bundled, [entry].concat(process.argv.slice(2)), {
|
|
38
|
+
stdio: "inherit",
|
|
39
|
+
env: childEnv,
|
|
40
|
+
});
|
|
41
|
+
// A broken runtime surfaces differently per OS: macOS/Windows report a
|
|
42
|
+
// spawn error (ENOEXEC/EACCES), but glibc's execvp masks ENOEXEC by
|
|
43
|
+
// retrying the file through /bin/sh — Linux then reports a "successful"
|
|
44
|
+
// spawn exiting 126/127. Those are POSIX exec-failure codes the CLI can
|
|
45
|
+
// never legitimately emit (its contract is 0/1/2/3), so both shapes mean
|
|
46
|
+
// the same thing: the bundled runtime never started.
|
|
47
|
+
var spawnFailed = r.error || r.status === 126 || r.status === 127;
|
|
48
|
+
if (spawnFailed) {
|
|
49
|
+
// The fallback continues IN THIS process — restore default signal
|
|
50
|
+
// dispositions or the no-op listeners above would make it ignore
|
|
51
|
+
// SIGINT/SIGTERM for the whole session.
|
|
52
|
+
process.removeAllListeners("SIGINT");
|
|
53
|
+
process.removeAllListeners("SIGTERM");
|
|
54
|
+
process.stderr.write(
|
|
55
|
+
"kane-cli: bundled Node runtime failed to start (" +
|
|
56
|
+
(r.error ? r.error.message : "exit " + r.status) +
|
|
57
|
+
") - falling back to system node\n"
|
|
58
|
+
);
|
|
59
|
+
// fall through to the system-node path below
|
|
60
|
+
} else {
|
|
61
|
+
if (r.signal) {
|
|
62
|
+
process.removeAllListeners(r.signal);
|
|
63
|
+
process.kill(process.pid, r.signal);
|
|
64
|
+
}
|
|
65
|
+
process.exit(r.status === null ? 1 : r.status);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
// ── System-node path: respawned child, deliberate escape hatch, platform
|
|
70
|
+
// package absent, or bundled spawn failure. ──
|
|
71
|
+
var major = parseInt(process.versions.node.split(".")[0], 10);
|
|
72
|
+
if (major < MIN_MAJOR) {
|
|
73
|
+
process.stderr.write(
|
|
74
|
+
"kane-cli requires Node >= " + MIN_MAJOR + " (found " + process.versions.node + ").\n" +
|
|
75
|
+
"Install a newer Node, or reinstall kane-cli so its bundled runtime is available.\n"
|
|
76
|
+
);
|
|
77
|
+
process.exit(1);
|
|
78
|
+
}
|
|
79
|
+
if (
|
|
80
|
+
!bundled &&
|
|
81
|
+
process.env.KANE_CLI_RESPAWNED !== "1" &&
|
|
82
|
+
process.env.KANE_CLI_SYSTEM_NODE !== "1"
|
|
83
|
+
) {
|
|
84
|
+
process.stderr.write(
|
|
85
|
+
"kane-cli: bundled Node runtime not found (runtime package missing) - running on system node " +
|
|
86
|
+
process.versions.node + "\n"
|
|
87
|
+
);
|
|
88
|
+
}
|
|
89
|
+
// Dynamic import via Function keeps this file parseable on Nodes that predate
|
|
90
|
+
// import() in CJS; pathToFileURL keeps Windows absolute paths valid.
|
|
91
|
+
new Function("p", "return import(p)")(require("url").pathToFileURL(entry).href);
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
// Locate the bundled Node runtime for the installed CLI.
|
|
2
|
+
// ES5-only CJS: bin/kane-cli.cjs requires this before any floor check, so an
|
|
3
|
+
// ancient Node must be able to PARSE it. Resolution mirrors
|
|
4
|
+
// src/context/extract/spawner.ts (explicit platform map — win32 != win — and
|
|
5
|
+
// public scope before private), plus the flat-sibling layout that a
|
|
6
|
+
// project-local npm install produces. The runtime ships in its own
|
|
7
|
+
// kane-cli-node-<platform> package (the combined platform package tripped
|
|
8
|
+
// npmjs's publish-size cap); the v1 in-platform-package location is kept as
|
|
9
|
+
// a fallback so a meta paired with pre-split platform packages still resolves.
|
|
10
|
+
"use strict";
|
|
11
|
+
var fs = require("fs");
|
|
12
|
+
var path = require("path");
|
|
13
|
+
|
|
14
|
+
var PLATFORMS = {
|
|
15
|
+
"darwin-arm64": "darwin-arm64",
|
|
16
|
+
"darwin-x64": "darwin-x64",
|
|
17
|
+
"linux-x64": "linux-x64",
|
|
18
|
+
"linux-arm64": "linux-arm64",
|
|
19
|
+
"win32-x64": "win-x64",
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
module.exports = function resolveRuntime(baseDir) {
|
|
23
|
+
var base = baseDir || __dirname; // <pkg>/bin
|
|
24
|
+
var plat = PLATFORMS[process.platform + "-" + process.arch];
|
|
25
|
+
if (!plat) return null;
|
|
26
|
+
var binName = process.platform === "win32" ? "node.exe" : "node";
|
|
27
|
+
var pkgRoot = path.resolve(base, "..");
|
|
28
|
+
var scopes = ["@testmuai", "@lambdatestincprivate"];
|
|
29
|
+
var pkgNames = ["kane-cli-node-" + plat, "kane-cli-" + plat];
|
|
30
|
+
// Family-major: exhaust the kane-cli-node package across BOTH scopes and
|
|
31
|
+
// layouts before touching any v1 location. Pin bumps ship only via the
|
|
32
|
+
// node packages — a v1 hit may carry a stale runtime, so it must never
|
|
33
|
+
// shadow a node package from the other scope.
|
|
34
|
+
for (var n = 0; n < pkgNames.length; n++) {
|
|
35
|
+
for (var s = 0; s < scopes.length; s++) {
|
|
36
|
+
// Tier 1: nested under the installed package (brew, npm -g)
|
|
37
|
+
var nested = path.join(pkgRoot, "node_modules", scopes[s], pkgNames[n], "bin", binName);
|
|
38
|
+
if (fs.existsSync(nested)) return nested;
|
|
39
|
+
// Tier 2: flat sibling in the enclosing node_modules (project-local npm)
|
|
40
|
+
var flat = path.join(pkgRoot, "..", "..", scopes[s], pkgNames[n], "bin", binName);
|
|
41
|
+
if (fs.existsSync(flat)) return flat;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
return null;
|
|
45
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
+
import{a as ee}from"./chunk-64LC36AF.js";import{a as Re,b as Ie}from"./chunk-6PS65QFF.js";import{a as ve,b as ke}from"./chunk-OFEOWKM3.js";import{b as Te,d as Ce}from"./chunk-6CZIEK6B.js";import{a as be}from"./chunk-5Y2G4NC7.js";import{a as Se}from"./chunk-YCCUBQY4.js";import{a as $e}from"./chunk-3Z3UIW5H.js";import{b as we}from"./chunk-DFS4RMVP.js";import"./chunk-4SXD6XWV.js";import{y as s}from"./chunk-6SGPN76K.js";import{a as B}from"./chunk-HCBYKLMW.js";import{a as b,b as n,k as W}from"./chunk-C44QQJR4.js";import{a as yt}from"./chunk-6YGTRKDT.js";import{e as R}from"./chunk-UR6MHSHU.js";var v=R(yt(),1);var $=R(B(),1),Be=3,Tt=60;function X(e){return e.options.length}var bt={high:{text:"\u203C high",color:s.red},med:{text:"med",color:"yellow"},low:{text:"low",color:s.dim}};function $t({batch:e,i:t}){let r=e.resolution[t],i=r.form==="deferred"?"\u2013 deferred (the agent keeps it)":`\u2713 ${r.form}: ${r.choice}${r.form==="assumed"?" (flagged)":" (you)"}`;return(0,$.jsx)(n,{color:s.dim,children:` ${i}`})}function wt({batch:e,i:t,sel:r,focused:i,freeText:m}){let u=e.questions[t],l=e.cursor===t,o=e.resolution[t],a=l?"\u203A":" ",f=bt[u.risk],h=y=>l&&i&&r===y?(0,$.jsx)(n,{color:s.generateAccent,children:"\u25B8"}):" ";return(0,$.jsxs)(b,{flexDirection:"column",children:[(0,$.jsxs)(n,{bold:l,children:[` ${t+1} ${a} ${u.text}`,f?(0,$.jsx)(n,{color:f.color,bold:!1,children:` ${f.text}`}):null]}),(0,$.jsx)(n,{color:s.muted,children:` ${u.rationale}`}),o&&!l?(0,$.jsx)($t,{batch:e,i:t}):(0,$.jsxs)(b,{flexDirection:"column",children:[u.multi_select?(0,$.jsx)(n,{color:s.dim,children:" note: multi-select not yet supported \u2014 pick the best single option"}):null,u.options.map((y,x)=>(0,$.jsxs)(n,{children:[" ",h(x),` ${x+1} ${y.label}`,x===u.recommended_index?(0,$.jsx)(n,{color:s.dim,children:" (recommended)"}):null,o?.selected_index===x?(0,$.jsx)(n,{color:s.dim,children:" (current)"}):null]},`o-${x}`)),u.allow_free_text&&l?m?(0,$.jsxs)(b,{children:[(0,$.jsxs)(n,{children:[" ",(0,$.jsx)(n,{color:s.generateAccent,children:"\u25B8"})," ",(0,$.jsx)(n,{color:s.dim,children:"\u270E "})]}),(0,$.jsx)(Se,{value:m.value,onChange:m.onChange,onSubmit:m.onSubmit,onCancel:m.onCancel,placeholder:"tell me what to do"})]}):(0,$.jsxs)(n,{children:[" ",h(u.options.length)," ",(0,$.jsx)(n,{color:s.dim,children:"\u270E tell me what to do"})]}):null]})]})}function De({batch:e,sel:t=0,focused:r=!1,freeText:i=null}){let{stdout:m}=W(),l=(m?.columns??80)<Tt,o=e.resolution.filter(I=>!I).length,a=Math.max(0,Math.min(e.cursor<0?0:e.cursor,e.questions.length-Be)),f=e.questions.slice(a,a+Be),h=a,y=e.questions.length-a-f.length,x=(0,$.jsxs)(b,{flexDirection:"column",children:[(0,$.jsx)(n,{bold:!0,color:s.generateAccent,children:`? the agent needs ${o===1?"one answer":`${o} answers`} before it can continue`}),h>0?(0,$.jsx)(n,{color:s.muted,children:` \u22EE ${h} above`}):null,f.map((I,d)=>(0,$.jsx)(wt,{batch:e,i:a+d,sel:t,focused:r,freeText:i},I.id)),y>0?(0,$.jsx)(n,{color:s.muted,children:` \u22EE ${y} more`}):null]});return l?x:(0,$.jsx)(b,{flexDirection:"column",borderStyle:"round",borderColor:s.generateAccent,paddingX:1,children:x})}var D=R(B(),1),Ee=60,Ct=e=>e.length<=Ee?e:`${e.slice(0,Ee-1)}\u2026`,St={high:s.red,med:"yellow"};function te({item:e}){return(0,D.jsxs)(b,{flexDirection:"column",marginLeft:2,children:[(e.cite??[]).map((t,r)=>(0,D.jsx)(n,{dimColor:!0,children:`cite ${t.anchor??"conv"} \u2014 "${t.quote??""}"`},`cite-${r}`)),(e.depends_on_hint??[]).length>0&&(0,D.jsx)(n,{dimColor:!0,children:`depends on: ${(e.depends_on_hint??[]).join(", ")}`}),Object.entries(e.extra??{}).map(([t,r])=>(0,D.jsx)(n,{dimColor:!0,children:`${t}: ${r}`},`extra-${t}`))]})}function G({heading:e,turn:t,items:r,expandedRef:i,total:m,compact:u,numbers:l,marks:o}){return(0,D.jsxs)(b,{flexDirection:"column",children:[(0,D.jsx)(n,{bold:!0,children:`${e} \xB7 turn ${t} \xB7 ${m??r.length} proposed`}),r.map((a,f)=>{let h=a.matches_existing,y=h?h.cid?h.archived?` \u2248 matches archived \u2014 previously rejected${h.reason?`: "${h.reason}"`:""}`:" \u2248 matches existing":" \u2248overlap":"",x=o?.[f]?" \xB7 updated":"",I=u?` ${l?.[f]??f+1} \xB7 ${a.title}`:` ${a.title}`,d=a.why?` \u2014 ${u?Ct(a.why):a.why}`:"";return(0,D.jsxs)(b,{flexDirection:"column",children:[(0,D.jsxs)(n,{children:[I,a.badge!==void 0?(0,D.jsx)(n,{color:St[a.badge]??s.dim,children:` ${a.badge}`}):null,d?(0,D.jsx)(n,{color:s.dim,children:d}):null,y?(0,D.jsx)(n,{color:h?.archived?"yellow":"magenta",children:y}):null,x?(0,D.jsx)(n,{color:s.dim,children:x}):null]}),i===a.temp_ref&&(0,D.jsx)(te,{item:a})]},a.temp_ref)})]})}var Le=R(B(),1),vt=e=>e.summary??e.description??"";function kt(e){return{temp_ref:e.temp_ref,title:e.title,badge:e.risk,why:vt(e),matches_existing:e.matches_existing?e.matches_existing:null,cite:e.cite??[],depends_on_hint:e.depends_on_hint??[]}}function _e({turn:e,items:t,expandedRef:r,total:i,compact:m,numbers:u,marks:l}){return(0,Le.jsx)(G,{heading:"use-cases",turn:e,items:t.map(kt),expandedRef:r,total:i,compact:m,numbers:u,marks:l})}var Rt={"use-case":"use-cases",ac:"ACs",scenario:"scenarios",test:"tests",gap:"gaps"},P=e=>Rt[e]??`${e}s`,Ae=e=>e==="ac"?"AC":e==="use-case"?"use-case":e,ne=e=>e.kind??"use-case",Oe=e=>`${ne(e)}:${e.temp_ref}`;function Pe(e){let t=e,r=t.badge??e.risk??null,i=t.why??e.summary??e.description??null;return JSON.stringify([e.title,r,i,t.extra??null,e.depends_on_hint??null])}function Me(e){return e.filter(t=>t.role==="agent"&&typeof t.turnIndex=="number"&&Array.isArray(t.items)&&t.items.length>0)}function V(e){let t=new Map,r=1;for(let u of Me(e)){let l=new Set;for(let o of u.items){let a=Oe(o);if(l.has(a))continue;l.add(a);let f=t.get(a);t.set(a,{num:f?.num??r++,ref:o.temp_ref,kind:ne(o),item:o,turnIndex:u.turnIndex,fingerprint:Pe(o)})}}let i=[...t.values()].sort((u,l)=>u.num-l.num),m=[];for(let u of i){let l=m.find(o=>o.kind===u.kind);l?l.count++:m.push({kind:u.kind,label:P(u.kind),count:1})}return{entries:i,byRef:t,counts:m}}function qe(e,t){let i=Me(e).find(d=>d.turnIndex===t);if(!i)return null;let m=e.filter(d=>d.role!=="agent"||typeof d.turnIndex!="number"||d.turnIndex<=t),u=V(m),l=V(e.filter(d=>d.role!=="agent"||typeof d.turnIndex!="number"||d.turnIndex<t)),o=[],a=new Map,f=new Map,h=new Map,y=new Set;for(let d of i.items){let k=Oe(d);if(y.has(k))continue;y.add(k);let q=l.byRef.get(k),F=d.changed===!0,A=u.byRef.get(k).num,_=ne(d);if(q&&!F&&q.fingerprint===Pe(d)){a.set(_,(a.get(_)??0)+1);continue}let w=!!q||F,N=w?h:f;N.set(_,(N.get(_)??0)+1),o.push({item:d,num:A,updated:w})}let x=[...a.entries()].map(([d,k])=>({label:P(d),count:k})),I=[...[...f.entries()].map(([d,k])=>`${k} new ${k===1?Ae(d):P(d)}`),...[...h.entries()].map(([d,k])=>`${k} updated ${k===1?Ae(d):P(d)}`)].join(" \xB7 ");return{fresh:o,unchanged:x,headerStats:I}}var E=R(B(),1);function Fe({turnIndex:e,fresh:t,headerStats:r,unchangedTotal:i}){let m=[];for(let l of t){let o=l.item.kind??"use-case",a=m.find(f=>f.kind===o);a?a.rows.push(l):m.push({kind:o,rows:[l]})}let u=`design \xB7 turn ${e} \u2014 ${r||"no new items"}${i>0?` (${i} unchanged)`:""}`;return(0,E.jsxs)(b,{flexDirection:"column",children:[(0,E.jsx)(n,{bold:!0,children:u}),m.map(({kind:l,rows:o})=>{let a=o.filter(y=>!y.updated).length,f=o.length-a,h=[...a>0?[`${a} new`]:[],...f>0?[`${f} updated`]:[]].join(" \xB7 ");return(0,E.jsxs)(b,{flexDirection:"column",children:[(0,E.jsx)(n,{color:s.dim,children:`${P(l).toLowerCase()} \xB7 ${h}`}),o.map(({item:y,num:x,updated:I})=>{let d=y;return(0,E.jsxs)(b,{flexDirection:"column",children:[(0,E.jsxs)(n,{children:[(0,E.jsx)(n,{children:` ${x} \xB7 ${y.title}`}),d.badge?(0,E.jsx)(n,{color:s.dim,children:` \xB7 ${d.badge}`}):null,I?(0,E.jsx)(n,{color:s.dim,children:" \xB7 updated"}):null]}),d.why?(0,E.jsx)(n,{color:s.dim,children:` ${d.why}`}):null]},`${l}:${y.temp_ref}`)})]},l)})]})}var g=R(B(),1);function It(e){let t=e.form==="assumed"?" (flagged)":e.form==="deferred"?"":" (you)",r=e.note?` \u2014 ${e.note}`:"";return e.form==="deferred"?`\u21B3 deferred q${e.qNum} ${e.stub}${r}`:e.form==="changed"?`\u21B3 changed q${e.qNum} ${e.stub}: ${e.prev??"?"} \u2192 ${e.choice??"?"}${t}${r}`:`\u21B3 ${e.form} q${e.qNum} ${e.stub}: ${e.choice??"?"}${t}${r}`}function Ne({block:e,annotations:t}){switch(e.kind){case"banner":return(0,g.jsx)(n,{color:s.dim,children:` \u2500\u2500 ${e.text} \u2500\u2500`});case"user":return(0,g.jsxs)(b,{children:[(0,g.jsx)(n,{color:s.orange,children:"\u276F "}),(0,g.jsx)(n,{children:e.text})]});case"note":return(0,g.jsx)(n,{color:s.dim,children:` ${e.text}`});case"agent":return(0,g.jsx)(ve,{text:e.text});case"thinking":return(0,g.jsx)(n,{color:s.dim,children:` thought for ${(e.tookMs/1e3).toFixed(1)}s`});case"tool":return(0,g.jsx)(n,{color:s.dim,children:` ${Re({name:e.name,status:e.status==="ok"?"done":e.status,detail:e.detail})}`});case"usage":return(0,g.jsx)(n,{color:s.dim,children:` \xB7 ${e.credits.toFixed(1)} credits \u2014 total ${e.total.toFixed(1)}`});case"turn":{let r=t??null,i=r?r.fresh.map(o=>o.item):e.items,m=r?r.fresh.map(o=>o.num):void 0,u=r?r.fresh.map(o=>o.updated):void 0,l=i.some(o=>!!o.kind);return(0,g.jsxs)(b,{flexDirection:"column",marginLeft:2,children:[l?(0,g.jsx)(Fe,{turnIndex:e.turnIndex,fresh:r?r.fresh:i.map((o,a)=>({item:o,num:a+1,updated:!1})),headerStats:r?.headerStats??"",unchangedTotal:(r?.unchanged??[]).reduce((o,a)=>o+a.count,0)}):e.heading==="use-cases"?(0,g.jsx)(_e,{turn:e.turnIndex,items:i,expandedRef:null,compact:!0,total:i.length,numbers:m,marks:u}):(0,g.jsx)(G,{heading:e.heading,turn:e.turnIndex,items:i,expandedRef:null,compact:!0,total:i.length,numbers:m,marks:u}),r&&r.unchanged.length>0&&(0,g.jsx)(n,{color:s.dim,children:` \u22EE unchanged: ${r.unchanged.map(o=>`${o.count} ${o.label}`).join(" \xB7 ")} \u2014 /view to browse`})]})}case"answer":return(0,g.jsx)(n,{color:s.dim,children:It(e.receipt)});case"continued":return(0,g.jsx)(n,{color:s.dim,children:"\u21B3 continued"});case"commit":return(0,g.jsxs)(b,{flexDirection:"column",children:[(0,g.jsx)(n,{color:e.ok?s.green:s.red,children:` ${e.ok?"\u2714":"\u2717"} ${e.line}`}),(e.warnings??[]).map((r,i)=>(0,g.jsx)(n,{color:s.dim,children:` \u26A0 ${r}`},`w-${i}`))]});case"error":return(0,g.jsxs)($e,{variant:"error",paddingX:1,children:[(0,g.jsx)(n,{color:s.red,children:e.title}),e.detail.map((r,i)=>(0,g.jsx)(n,{color:s.dim,children:r},`d-${i}`))]});case"interrupted":return(0,g.jsxs)(b,{flexDirection:"column",children:[(0,g.jsx)(n,{color:s.red,children:"interrupted \u2014 session not saved"}),e.detail?(0,g.jsx)(n,{color:s.dim,children:e.detail}):null]});case"pause":return(0,g.jsxs)(b,{flexDirection:"column",children:[(0,g.jsx)(n,{children:`paused: session ${e.sid} saved`}),e.expires_at?(0,g.jsx)(n,{color:s.dim,children:`expires: ${e.expires_at}`}):null,(0,g.jsx)(n,{children:`resume: ${e.resume}`}),e.messageForm?(0,g.jsx)(n,{children:`or say something on the way in: ${e.messageForm}`}):null]});case"summary":return(0,g.jsxs)(b,{flexDirection:"column",children:[(0,g.jsx)(n,{bold:!0,children:"session summary"}),e.lines.map((r,i)=>(0,g.jsx)(n,{children:` ${r}`},`s-${i}`))]})}}var je=R(B(),1),re="ctrl+t thinking \xB7 ctrl+c exit";function Ue(e,t){if(e.length<=t)return e;if(t<=1)return"\u2026";let r=Math.ceil((t-1)/2),i=Math.floor((t-1)/2);return`${e.slice(0,r)}\u2026${i>0?e.slice(-i):""}`}function We({verb:e,subject:t,turn:r,pendingCount:i,creditsTotal:m}){let{stdout:u}=W(),l=u?.columns??80,o=[];o.push(e),r&&o.push(`turn ${r}`),m!==void 0&&o.push(`${m.toFixed(1)} cr`);let a=i?`[${i} pending]`:null,f=" \xB7 ",y=[...o,...a?[a]:[]].join(f).length,x,I=[...o,...t?[t]:[],...a?[a]:[],re].join(f);if(I.length<=l)x=I;else{let d=l-y-(t?f.length:0)-f.length-re.length;if(t&&d>=8)x=[...o,Ue(t,d),...a?[a]:[],re].join(f);else{let k=l-y-(t?f.length:0);x=[...o,...t&&k>=4?[Ue(t,k)]:[],...a?[a]:[]].join(f)}}return(0,je.jsx)(n,{color:s.dim,children:x})}var C=R(B(),1),oe=(e,t)=>Math.max(0,Math.min(t,e));function Y(e,t,r){switch(t.type){case"move":return{...e,cursor:oe(e.cursor+t.delta,Math.max(0,r-1))};case"enter":return e.level==="list"?{...e,level:"detail"}:e;case"back":return e.level==="detail"?{...e,level:"list"}:null}}var Ke={"use-case":"use-cases",ac:"acs",scenario:"scenarios",test:"tests",gap:"gaps"};function He(e,t){if(e.level==="detail")return{level:"detail",cursor:oe(e.num-1,Math.max(0,t.entries.length-1))};if(e.section){let r=t.entries.findIndex(i=>Ke[i.kind]===e.section);if(r>=0)return{level:"list",cursor:r}}return{level:"list",cursor:0}}function Bt(e){let t=[];for(let r of e.entries){let i=t.find(m=>m.kind===r.kind);i?i.entries.push(r):t.push({kind:r.kind,entries:[r]})}return t}var Ve=3;function Dt({items:e,cursor:t,verb:r}){let i=`view \xB7 ${r} so far \xB7 ${e.counts.map(u=>`${u.count} ${u.count===1?u.label.replace(/s$/,""):u.label}`).join(" \xB7 ")}`,m=e.entries[t];return(0,C.jsxs)(b,{flexDirection:"column",borderStyle:"round",borderColor:s.dim,paddingX:1,children:[(0,C.jsx)(n,{bold:!0,children:i}),Bt(e).map(({kind:u,entries:l})=>{let o=m?.kind===u,a=o?l.findIndex(x=>x.ref===m.ref):-1,f=o?oe(a-1,Math.max(0,l.length-Ve)):0,h=l.slice(f,f+(o?Ve:1)),y=l.length-h.length;return(0,C.jsxs)(b,{flexDirection:"column",children:[(0,C.jsx)(n,{color:s.dim,children:`${Ke[u]??P(u)} \xB7 ${l.length}`}),h.map(x=>{let I=o&&x.ref===m.ref,d=x.item.badge;return(0,C.jsxs)(n,{children:[(0,C.jsx)(n,{color:s.generateAccent,children:I?"\u203A ":" "}),(0,C.jsx)(n,{children:`${x.num} \xB7 ${x.item.title}`}),d?(0,C.jsx)(n,{color:s.dim,children:` \xB7 ${d}`}):null]},`${x.kind}:${x.ref}`)}),y>0&&(0,C.jsx)(n,{color:s.dim,children:` \u22EE ${y} more`})]},u)}),(0,C.jsx)(n,{color:s.dim,children:"\u2191\u2193 move \xB7 \u21B5 detail \xB7 esc back to chat"})]})}function Et({items:e,cursor:t}){let r=e.entries[t];if(!r)return(0,C.jsx)(n,{color:s.dim,children:"nothing to show"});let i=r.item;return(0,C.jsxs)(b,{flexDirection:"column",borderStyle:"round",borderColor:s.dim,paddingX:1,children:[(0,C.jsx)(n,{bold:!0,children:`view \xB7 ${r.kind} ${r.num} of ${e.entries.length}`}),(0,C.jsx)(n,{children:r.item.title}),i.badge?(0,C.jsx)(n,{color:s.dim,children:`kind: ${i.badge}`}):null,i.why?(0,C.jsx)(n,{color:s.dim,children:i.why}):null,(0,C.jsx)(te,{item:r.item}),(0,C.jsx)(n,{color:s.dim,children:"view-only \u2014 approvals happen in chat"}),(0,C.jsx)(n,{color:s.dim,children:"\u2191\u2193 prev/next \xB7 esc back to list"})]})}function Qe({items:e,state:t,verb:r}){return t.level==="list"?(0,C.jsx)(Dt,{items:e,cursor:t.cursor,verb:r}):(0,C.jsx)(Et,{items:e,cursor:t.cursor})}var Xe=[{name:"view",description:"browse the proposal set"},{name:"explain",description:"why a committed item exists"},{name:"pause",description:"save + exit (resumable)"},{name:"done",description:"finish the session"}],_t={"use-cases":"use-cases",usecases:"use-cases","use-case":"use-cases",acs:"acs",ac:"acs",scenarios:"scenarios",scenario:"scenarios",tests:"tests",test:"tests",gaps:"gaps",gap:"gaps"};function Ge(e){let t=(e??"").trim().toLowerCase();if(!t)return{level:"list"};if(/^\d+$/.test(t)){let i=parseInt(t,10);return i>=1?{level:"detail",num:i}:{error:"items are numbered from 1 \u2014 /view 1"}}let r=_t[t];return r?{level:"list",section:r}:{error:"try /view, /view <number>, or /view acs|scenarios|tests"}}var S=R(B(),1),Lt=6,Ye=12;function At(e,t,r){let i=Math.max(20,t),m=[];for(let l of e.split(`
|
|
3
|
+
`)){if(l.length<=i){m.push(l);continue}let o="";for(let a of l.split(" "))o&&o.length+1+a.length>i?(m.push(o),o=a):o=o?`${o} ${a}`:a;m.push(o)}let u=Math.max(0,m.length-r);return{body:m.slice(-r).join(`
|
|
4
|
+
`),hidden:u}}var Ot='chat with the agent \u2014 "/" for commands',ze=["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"];function Pt(e,t){return t?" \u2014 Enter continues \xB7 or type to adjust":e==="design"?" \u2014 reply, or /done to finish":' \u2014 reply, "looks good" approves, /done finishes'}function En({controller:e,verb:t="extract",onCtrlC:r}){let[,i]=(0,v.useState)(0),[m,u]=(0,v.useState)(!1),[l,o]=(0,v.useState)(null),[a,f]=(0,v.useState)(null),h=(0,v.useRef)(null),y=c=>{h.current=c,f(c)},x=we(),{stdout:I}=W(),d=I?.columns??80,k=(0,v.useRef)(0),q=(0,v.useRef)(0),F=(0,v.useRef)(null);F.current||(F.current=new Te(null)),(0,v.useEffect)(()=>{let c=()=>{let T=e.state.ledger;for(let L=k.current;L<T.length;L++){let M=T[L],ht=M.kind==="turn"?qe(e.state.turns,M.turnIndex):void 0;x.append((0,S.jsx)(Ne,{block:M,annotations:ht},`lg-${L}`))}k.current=T.length};c();let p=e.subscribe(()=>{c();let T=e.state;h.current&&(T.pending||T.status==="pausing")&&(y(null),T.pending&&o("questions arrived \u2014 back to chat")),i(L=>L+1)});return i(T=>T+1),p},[e,x]);let{thinking:A,status:_,pending:w,confirm:N,ledger:se,activeTurn:ie,stream:Je,notice:K}=e.state,ae=(Je?.text??"").trimEnd(),ce=ae.length>0,Ze=m&&(A.liveThinking.length>0||A.thinkingLog.length>0),et=At(A.liveThinking||A.thinkingLog.map(c=>c.text).join(`
|
|
5
|
+
`),d-6,Ye),le=ce?ae.split(`
|
|
6
|
+
`).slice(-Lt):[];ie&&(q.current=ie.turnIndex);let tt=w?w.resolution.filter(c=>!c).length:0,ue;for(let c=se.length-1;c>=0;c--){let p=se[c];if(p.kind==="banner"&&!p.text.startsWith("kane")){ue=p.text;break}}let j=A.activity[A.activity.length-1],z=j?j.status==="decision"?j.label:Ie({name:j.name,status:j.status}):void 0,me=_==="streaming"||_==="working",[nt,rt]=(0,v.useState)(0);be(()=>rt(c=>c+1),me?120:null);let ot=e.state.busySince?Math.floor((Date.now()-e.state.busySince)/1e3):0,st=ce?"Writing\u2026":z?`${z.charAt(0).toUpperCase()}${z.slice(1)}\u2026`:e.state.workingLabel??(t==="design"?"Designing\u2026":"Thinking\u2026"),it=e.state.turns.some(c=>c.role==="agent"),[at,ct]=(0,v.useState)(0),[de,lt]=(0,v.useState)(!1),[pe,ut]=(0,v.useState)(null),H=(0,v.useRef)(0),ge=(0,v.useRef)(!1),fe=(0,v.useRef)(null),Q=c=>{H.current=c,ct(c)},xe=c=>{ge.current=c,lt(c)},U=c=>{fe.current=c,ut(c)},he=w&&w.cursor>=0?w.questions[w.cursor]:void 0,O=(0,v.useRef)(he);O.current=he;let J=(0,v.useRef)(w);J.current=w;let mt=w?`${w.questions[0]?.id??"b"}:${w.cursor}`:null;(0,v.useEffect)(()=>{if(U(null),O.current){xe(!0);let c=J.current?.resolution[J.current.cursor]?.selected_index;Q(c??O.current.recommended_index??0)}else xe(!1)},[mt]);let dt={isFocused:()=>ge.current&&O.current!=null&&fe.current==null,onMove:c=>{let p=O.current;if(!p)return;let T=p.allow_free_text?X(p):p.options.length-1;Q(Math.max(0,Math.min(T,H.current+c)))},onSelect:()=>{let c=O.current;if(c){if(c.allow_free_text&&H.current===X(c)){U("");return}e.submit(String(H.current+1))}},onDigit:c=>{let p=O.current;p&&c-1<p.options.length&&Q(c-1)},onType:c=>{let p=O.current;p?.allow_free_text&&(Q(X(p)),U(c))},onBack:()=>e.reopenQuestion()},pt=pe!=null?{value:pe,onChange:c=>U(c),onSubmit:c=>{U(null),c.trim()&&e.submit(c.trim())},onCancel:()=>U(null)}:null,gt=_==="streaming"&&!w||!!w&&de,ft=w?"answer in the panel above \u2014 \u2191/\u2193 + Enter, or just type your answer":Ot,Z=r??(()=>e.requestPause()),xt=c=>{let p=Ge(c);if("error"in p){o(p.error);return}let T=V(e.state.turns);if(T.entries.length===0){o("nothing proposed yet \u2014 the first turn is still coming");return}if(p.level==="detail"&&p.num>T.entries.length){o(`no item ${p.num} \u2014 the set has ${T.entries.length} item${T.entries.length===1?"":"s"}`);return}y(He(p,T))},ye=(0,S.jsx)(We,{verb:t,subject:ue,turn:q.current||void 0,pendingCount:tt,creditsTotal:e.state.credits?.total});if(a){let c=V(e.state.turns),p=c.entries.length;return(0,S.jsxs)(b,{flexDirection:"column",children:[(0,S.jsx)(ee,{onToggleThinking:()=>u(T=>!T),onCtrlC:Z,explorer:{isOpen:()=>h.current!==null,onClose:()=>{y(null),o("closed the explorer \u2014 your text didn't send, retype to chat"),setTimeout(()=>i(T=>T+1),0)},onMove:T=>y(h.current&&Y(h.current,{type:"move",delta:T},p)),onEnter:()=>y(h.current&&Y(h.current,{type:"enter"},p)),onBack:()=>{y(h.current&&Y(h.current,{type:"back"},p)),setTimeout(()=>i(T=>T+1),0)}}}),(0,S.jsx)(Qe,{items:c,state:a,verb:t}),(K??l)&&(K??l).split(`
|
|
7
|
+
`).map((T,L)=>(0,S.jsx)(n,{color:s.orange,children:T},`nt-${L}`)),ye]})}return(0,S.jsxs)(b,{flexDirection:"column",children:[(0,S.jsx)(ee,{onToggleThinking:()=>u(c=>!c),onCtrlC:Z,panel:dt}),Ze&&(0,S.jsx)(ke,{thinking:et.body,expanded:!0,thinkingDone:_!=="streaming",maxLines:Ye+1}),le.length>0&&(0,S.jsx)(b,{flexDirection:"column",children:le.map((c,p)=>(0,S.jsx)(n,{children:c},`st-${p}`))}),w&&(0,S.jsx)(De,{batch:w,sel:at,focused:de,freeText:pt}),N&&(0,S.jsx)(n,{color:"yellow",children:N.prompt}),(K??l)&&(K??l).split(`
|
|
8
|
+
`).map((c,p)=>(0,S.jsx)(n,{color:s.orange,children:c},`nt-${p}`)),me&&!w&&(0,S.jsxs)(n,{color:s.generateAccent,children:[`${ze[nt%ze.length]} ${st} `,(0,S.jsx)(n,{color:s.dim,children:`(${ot}s)`})]}),_==="idle"&&it&&!w&&!N&&(0,S.jsxs)(n,{color:s.generateAccent,children:["\u25CF your turn",(0,S.jsx)(n,{color:s.dim,children:Pt(t,e.state.checkpoint)})]}),_==="pausing"?(0,S.jsx)(n,{color:s.dim,children:"pausing \u2014 saving session\u2026 (ctrl+c again = force quit)"}):(0,S.jsx)(Ce,{history:F.current,placeholder:ft,accent:s.generateAccent,submitVerb:w?"answer":"send",submitEmpty:!!w||t==="design"&&e.state.checkpoint,inert:gt,commands:Xe,footerBindings:[{keys:"\u21B5",label:w?"answer":"send"},{keys:"\u2191\u2193",label:"history"},{keys:"ctrl+t",label:"thinking"},{keys:"ctrl+c",label:"exit"}],onSubmit:c=>{let p=c.trim();if(!p){w?e.submit(""):t==="design"&&e.state.checkpoint&&e.continueParked();return}if(o(null),p.startsWith("/")){let[T="",...L]=p.slice(1).split(/\s+/),M=L.join(" ");if(!T){o('type "/" then a command \u2014 /view, /explain, /pause, /done');return}switch(T.toLowerCase()){case"view":xt(M);return;case"explain":if(!M){o("usage: /explain <ref> \u2014 e.g. /explain guest-checkout");return}e.explainRef(M);return;case"pause":Z();return;case"done":case"exit":e.completeSession();return;default:o(`unknown command "/${T}" \u2014 try /view, /explain, /pause, /done`);return}}e.submit(p)}}),ye]})}export{En as ChatSurface,At as tailVisualRows,Pt as yourTurnTail};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a,b,c}from"./chunk-
|
|
2
|
+
import{a,b,c}from"./chunk-LABIRPOT.js";import"./chunk-4SXD6XWV.js";import"./chunk-6SGPN76K.js";import"./chunk-HCBYKLMW.js";import"./chunk-C44QQJR4.js";import"./chunk-6YGTRKDT.js";import"./chunk-UR6MHSHU.js";export{c as ChromeProfilePicker,b as formatChromeProfileLine,a as listChromeProfiles};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as r}from"./chunk-
|
|
2
|
+
import{a as r}from"./chunk-S2C62SDY.js";import"./chunk-4SXD6XWV.js";import"./chunk-6SGPN76K.js";import"./chunk-HCBYKLMW.js";import{c as e}from"./chunk-C44QQJR4.js";import{a as i}from"./chunk-6YGTRKDT.js";import{e as m}from"./chunk-UR6MHSHU.js";var t=m(i(),1);async function d(){return new Promise(o=>{let c=e(t.default.createElement(r,{onSubmit:n=>{c.unmount(),o(n)}}),{stdout:process.stderr,exitOnCtrlC:!1})})}export{d as renderFeedbackPrompt};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as P,b as g,c as f}from"./chunk-
|
|
2
|
+
import{a as P,b as g,c as f}from"./chunk-24VYAMMK.js";import"./chunk-2WO7G2HO.js";import"./chunk-5Y2G4NC7.js";import"./chunk-6SGPN76K.js";import{a as c}from"./chunk-HCBYKLMW.js";import{c as d}from"./chunk-C44QQJR4.js";import{a as h}from"./chunk-6YGTRKDT.js";import{e as p}from"./chunk-UR6MHSHU.js";var e=p(h(),1);var m=p(c(),1);function w({pipeline:t,buildShareUrl:r,onDone:o}){let[n,i]=(0,e.useState)(P()),[S,l]=(0,e.useState)("uploading"),[U,R]=(0,e.useState)(),[C,E]=(0,e.useState)();return(0,e.useEffect)(()=>{let x=t.config.onProgress;t.config.onProgress=(s,u,a)=>{x(s,u,a),i(y=>g(y,s,u,a))},t.execute().then(s=>{s.success?(R(r?.(s)),l("success")):(E(s.error),l("failed")),setTimeout(()=>o(s),1500)})},[]),(0,m.jsx)(f,{steps:n,status:S,testUrl:U,error:C})}async function O(t,r){return new Promise(o=>{let n=d(e.default.createElement(w,{pipeline:t,buildShareUrl:r,onDone:i=>{n.unmount(),o(i)}}),{stdout:process.stderr,exitOnCtrlC:!1})})}export{O as renderUploadProgress};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as p,b as l,c as n}from"./chunk-
|
|
2
|
+
import{a as p,b as l,c as n}from"./chunk-3Z3UIW5H.js";import{y as o}from"./chunk-6SGPN76K.js";import{a as g}from"./chunk-HCBYKLMW.js";import{a,j as c}from"./chunk-C44QQJR4.js";import{a as R}from"./chunk-6YGTRKDT.js";import{e as t}from"./chunk-UR6MHSHU.js";var b=t(R(),1);var e=t(g(),1);function A({model:d,authLabel:v,profile:x,env:w,defaultUrl:u,projectId:r,projectName:s,folderId:i,folderName:f,windowSize:B,chromeProfile:C}){let h=r?s?`${s} (${r})`:r:"(none)",D=i?f?`${f} (${i})`:i:"(none)",{exit:m}=c();return(0,b.useEffect)(()=>{let P=setTimeout(()=>m(),50);return()=>clearTimeout(P)},[m]),(0,e.jsx)(a,{flexDirection:"column",children:(0,e.jsx)(p,{title:"Configuration",children:(0,e.jsxs)(a,{flexDirection:"column",paddingY:1,children:[(0,e.jsx)(n,{label:"Auth"}),(0,e.jsx)(l,{label:" method",value:v}),(0,e.jsx)(l,{label:" profile",value:x}),(0,e.jsx)(l,{label:" env",value:w}),(0,e.jsx)(n,{label:"Defaults"}),(0,e.jsx)(l,{label:" url",value:u??"(none)",valueColor:u?o.orange:o.dim}),(0,e.jsx)(l,{label:" model",value:d}),(0,e.jsx)(l,{label:" window",value:B}),(0,e.jsx)(l,{label:" project",value:h}),(0,e.jsx)(l,{label:" folder",value:D}),(0,e.jsx)(n,{label:"Paths"}),(0,e.jsx)(l,{label:" chrome",value:C,valueColor:o.dim})]})})})}export{A as ConfigView};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
+
import{a}from"./chunk-24OFJ7SE.js";import"./chunk-RFHMDQXZ.js";import"./chunk-4A6BLXQN.js";import"./chunk-CJJXT5DO.js";import"./chunk-FJTWJ243.js";import"./chunk-BC7UVJJB.js";import"./chunk-2PQXEEVY.js";import"./chunk-EHN5HTUD.js";import"./chunk-L5LI2JF4.js";import"./chunk-MCQXRJGH.js";import"./chunk-74RUSHIB.js";import"./chunk-ZZLR3O5A.js";import"./chunk-ZG2V2ODK.js";import"./chunk-5YPBPZUR.js";import"./chunk-M5JQXOCE.js";import"./chunk-AKHUNBQS.js";import"./chunk-6SGPN76K.js";import"./chunk-HCBYKLMW.js";import"./chunk-C44QQJR4.js";import"./chunk-6YGTRKDT.js";import"./chunk-UR6MHSHU.js";export{a as EvidenceViewOffer};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a,b}from"./chunk-
|
|
2
|
+
import{a,b}from"./chunk-N6DO2LBH.js";import"./chunk-YCCUBQY4.js";import"./chunk-MY32TBBR.js";import"./chunk-2WVKOZ6W.js";import"./chunk-NLCCBXXV.js";import"./chunk-RZ4F3BHX.js";import"./chunk-AKHUNBQS.js";import"./chunk-4SXD6XWV.js";import"./chunk-6SGPN76K.js";import"./chunk-HCBYKLMW.js";import"./chunk-C44QQJR4.js";import"./chunk-6YGTRKDT.js";import"./chunk-UR6MHSHU.js";export{b as FolderPicker,a as formatFolderLine};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as f,b as r,
|
|
2
|
+
import{a as f,b as r,y as t}from"./chunk-6SGPN76K.js";import{a as T}from"./chunk-HCBYKLMW.js";import{a as s,b as o,j as x,k as p}from"./chunk-C44QQJR4.js";import{a as v}from"./chunk-6YGTRKDT.js";import{e as h}from"./chunk-UR6MHSHU.js";var w=h(v(),1);var e=h(T(),1),b="https://www.testmuai.com/support/docs/kane-cli-introduction",S="https://github.com/LambdaTest/kane-cli/issues";function L(){let{exit:c}=x(),{stdout:a}=p(),l=a?.columns??80;return(0,w.useEffect)(()=>{let m=setTimeout(()=>c(),50);return()=>clearTimeout(m)},[c]),(0,e.jsxs)(s,{flexDirection:"column",children:[(0,e.jsxs)(s,{paddingX:1,paddingTop:1,flexDirection:"column",children:[(0,e.jsx)(o,{color:t.orange,bold:!0,children:r}),(0,e.jsxs)(s,{children:[(0,e.jsx)(o,{color:t.dim,children:"Browser automation powered by AI "}),(0,e.jsxs)(o,{color:t.muted,children:[" v",f]})]})]}),(0,e.jsx)(o,{children:" "}),(0,e.jsxs)(d,{title:"USAGE",children:[(0,e.jsx)(g,{cmd:`${r}`,desc:"Single-shot prompt (no args, TTY)"}),(0,e.jsx)(g,{cmd:`${r} --tui`,desc:"Full interactive TUI",highlight:!0}),(0,e.jsx)(g,{cmd:`${r} run "<objective>"`,desc:"Inline objective"}),(0,e.jsx)(g,{cmd:`${r} testmd run <path>.md`,desc:"Replay a saved *_test.md file"})]}),(0,e.jsxs)(d,{title:"HELP",children:[(0,e.jsx)(g,{cmd:`${r} --help`,desc:"Show this help (long form)"}),(0,e.jsx)(g,{cmd:`${r} -h`,desc:"Show this help (short form)"}),(0,e.jsx)(g,{cmd:`${r} help`,desc:"Show this help (subcommand form)"}),(0,e.jsxs)(s,{marginLeft:2,marginTop:0,flexDirection:"column",children:[(0,e.jsxs)(o,{color:t.dim,children:["These are the only supported help invocations. Anything else (e.g. ",(0,e.jsx)(o,{color:t.orange,children:"-help"}),") is an unknown flag."]}),(0,e.jsxs)(o,{color:t.dim,children:["Terminal tab-completion is a shell feature; ",r," does not ship shell-completion scripts, so any flag your shell suggests is a generic guess \u2014 not from ",r,"."]})]})]}),(0,e.jsxs)(d,{title:"COMMANDS",children:[(0,e.jsx)(i,{cmd:"run",args:"<objective>",desc:"Run an objective (inline string)",highlight:!0}),(0,e.jsx)(i,{cmd:"testmd",args:"run|list|status|delete|export",desc:"Manage *_test.md files"}),(0,e.jsx)(i,{cmd:"testrun",args:"run",desc:"Run M *_test.md files as one sealed execution"}),(0,e.jsx)(i,{cmd:"login",desc:"Auth setup (interactive, --oauth, or --username)"}),(0,e.jsx)(i,{cmd:"logout",desc:"Revoke tokens + delete profile"}),(0,e.jsx)(i,{cmd:"whoami",desc:"Show authenticated identity"}),(0,e.jsx)(i,{cmd:"config",args:"show|set-mode|set-assertion-mode|\u2026",desc:"Chrome, run & generate settings"}),(0,e.jsx)(i,{cmd:"profiles",args:"list|switch|delete",desc:"Manage auth profiles"}),(0,e.jsx)(i,{cmd:"evidence",args:"validate|serve|merge",desc:"Validate, serve (viewer) or merge evidence packs"}),(0,e.jsx)(i,{cmd:"changelog",args:"[--all]",desc:"Show recent release notes"}),(0,e.jsx)(i,{cmd:"context",args:"ingest|extract|list|review|sessions|\u2026",desc:"Build & manage the assurance context store"}),(0,e.jsx)(i,{cmd:"design",args:"tests --use-case <ref>",desc:"Design tests from the context store"})]}),(0,e.jsxs)(d,{title:"TESTMD ACTIONS",children:[(0,e.jsx)(i,{cmd:"testmd run",args:"<path>",desc:"Replay a saved *_test.md file",highlight:!0}),(0,e.jsx)(i,{cmd:"testmd list",desc:"List *_test.md files in cwd (recursive)"}),(0,e.jsx)(i,{cmd:"testmd status",args:"<path>",desc:"Print local meta.json for a test"}),(0,e.jsx)(i,{cmd:"testmd delete",args:"<path>",desc:"Remove output-<stem>/ and the source file"}),(0,e.jsx)(i,{cmd:"testmd export",args:"<path> --language <py|js>",desc:"Generate standalone Playwright code"})]}),(0,e.jsxs)(d,{title:"RUN FLAGS",children:[(0,e.jsx)(n,{long:"--max-steps",arg:"<n>",desc:"Max agent steps (default: 30)"}),(0,e.jsx)(n,{long:"--timeout",arg:"<sec>",desc:"Kill run after N seconds"}),(0,e.jsx)(n,{long:"--headless",desc:"No visible browser window"}),(0,e.jsx)(n,{long:"--mode",arg:"<action|testing>",desc:"Run mode (default: testing)"}),(0,e.jsx)(n,{long:"--name",arg:"<name>",desc:"Persist session under this name"}),(0,e.jsx)(n,{long:"--variables",arg:"<json>",desc:"Inline variables as JSON"}),(0,e.jsx)(n,{long:"--variables-file",arg:"<path>",desc:"Load variables from file"}),(0,e.jsx)(n,{long:"--session-context",arg:"<json>",desc:"Prior runs context JSON"}),(0,e.jsx)(n,{long:"--global-context",arg:"<file>",desc:"Override global context markdown"}),(0,e.jsx)(n,{long:"--local-context",arg:"<file>",desc:"Override local context markdown"}),(0,e.jsx)(n,{long:"--ws-endpoint",arg:"<url>",desc:"Remote browser (LambdaTest)"}),(0,e.jsx)(n,{long:"--cdp-endpoint",arg:"<url>",desc:"Connect to existing Chrome CDP"}),(0,e.jsx)(n,{long:"--task-skills",desc:"Domain-specific task skills (experimental)"}),(0,e.jsx)(n,{long:"--code-export",desc:"Generate code export after upload"}),(0,e.jsx)(n,{long:"--code-language",arg:"<lang>",desc:"Code export language: python | javascript"}),(0,e.jsx)(n,{long:"--skip-code-validation",desc:"Skip post-codegen validation"}),(0,e.jsx)(n,{long:"--username",arg:"<user>",desc:"Basic auth (skip OAuth)"}),(0,e.jsx)(n,{long:"--access-key",arg:"<key>",desc:"Basic auth access key"}),(0,e.jsx)(n,{long:"--env",arg:"<name>",desc:"Environment (prod or stage)"}),(0,e.jsx)(n,{long:"--agent",desc:"NDJSON output (no UI)",highlight:!0})]}),(0,e.jsxs)(d,{title:"EXAMPLES",children:[(0,e.jsx)(u,{label:"Inline objective",cmd:`${r} run "Search for laptop"`}),(0,e.jsx)(u,{label:"Replay a saved test",cmd:`${r} testmd run smoke_test.md`}),(0,e.jsx)(u,{label:"Variables",cmd:`${r} run "Login as {{user}}" --variables '{"user":{"value":"alice"}}'`}),(0,e.jsx)(u,{label:"Agent mode (NDJSON)",cmd:`${r} run "Add to cart" --agent | jq .status`})]}),(0,e.jsx)(d,{title:"TEST FILES",children:(0,e.jsxs)(s,{marginLeft:2,flexDirection:"column",children:[(0,e.jsxs)(o,{color:t.dim,children:[(0,e.jsx)(o,{color:t.orange,children:"*_test.md"})," \u2014 markdown test files with YAML frontmatter and ",(0,e.jsx)(o,{color:t.orange,children:"## "}),"step headings."]}),(0,e.jsxs)(o,{color:t.dim,children:["Run with ",(0,e.jsxs)(o,{color:t.orange,children:[r," testmd run path/to/foo_test.md"]}),". (`.md` paths are not accepted by `",r," run`.)"]}),(0,e.jsxs)(o,{color:t.dim,children:["Sessions you run in TUI auto-save to ",(0,e.jsx)(o,{color:t.orange,children:"<cwd>/.testmuai/tests/<name>_test.md"})," (testing mode prompts on exit)."]})]})}),(0,e.jsxs)(s,{flexDirection:"column",marginTop:0,paddingX:1,children:[(0,e.jsx)(o,{color:t.muted,children:"\u2500".repeat(Math.min(l-2,70))}),(0,e.jsxs)(s,{gap:3,children:[(0,e.jsxs)(s,{children:[(0,e.jsx)(o,{color:t.dim,children:"Docs "}),(0,e.jsx)(o,{color:t.orange,underline:!0,children:b})]}),(0,e.jsxs)(s,{children:[(0,e.jsx)(o,{color:t.dim,children:"Bugs "}),(0,e.jsx)(o,{color:t.orange,underline:!0,children:S})]})]})]}),(0,e.jsx)(o,{children:" "})]})}function d({title:c,children:a}){return(0,e.jsxs)(s,{flexDirection:"column",marginBottom:1,children:[(0,e.jsx)(s,{marginLeft:1,children:(0,e.jsx)(o,{bold:!0,color:t.dim,children:c})}),a]})}function g({cmd:c,desc:a,highlight:l}){return(0,e.jsxs)(s,{marginLeft:2,children:[(0,e.jsxs)(s,{width:40,children:[(0,e.jsx)(o,{color:t.dim,children:"$ "}),(0,e.jsx)(o,{color:l?t.orange:t.orange,children:c})]}),(0,e.jsx)(o,{color:t.dim,children:a})]})}function i({cmd:c,args:a,desc:l,highlight:m}){return(0,e.jsxs)(s,{marginLeft:2,children:[(0,e.jsx)(s,{width:16,children:(0,e.jsx)(o,{color:m?t.orange:t.green,bold:!0,children:c})}),(0,e.jsx)(s,{width:32,children:a?(0,e.jsx)(o,{color:t.dim,children:a}):null}),(0,e.jsx)(o,{color:t.dim,children:l})]})}function n({long:c,arg:a,desc:l,highlight:m}){return(0,e.jsxs)(s,{marginLeft:2,children:[(0,e.jsxs)(s,{width:30,children:[(0,e.jsx)(o,{color:m?t.orange:t.orange,children:c}),a&&(0,e.jsxs)(o,{color:t.dim,children:[" ",a]})]}),(0,e.jsx)(o,{color:t.dim,children:l})]})}function u({label:c,cmd:a}){return(0,e.jsxs)(s,{marginLeft:2,flexDirection:"column",children:[(0,e.jsxs)(o,{color:t.dim,children:["# ",c]}),(0,e.jsxs)(o,{color:t.orange,children:["$ ",a]})]})}export{L as HelpView};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a}from"./chunk-
|
|
2
|
+
import{a}from"./chunk-6NIV7AVZ.js";import"./chunk-3Z3UIW5H.js";import"./chunk-6SGPN76K.js";import"./chunk-HCBYKLMW.js";import"./chunk-C44QQJR4.js";import"./chunk-6YGTRKDT.js";import"./chunk-UR6MHSHU.js";export{a as InfoBox};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a}from"./chunk-
|
|
2
|
+
import{a}from"./chunk-XQL53VB7.js";import"./chunk-6SGPN76K.js";import"./chunk-HCBYKLMW.js";import"./chunk-C44QQJR4.js";import"./chunk-6YGTRKDT.js";import"./chunk-UR6MHSHU.js";export{a as LinksBox};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a,b}from"./chunk-
|
|
2
|
+
import{a,b}from"./chunk-LEQ2B3PR.js";import"./chunk-4SXD6XWV.js";import"./chunk-6SGPN76K.js";import"./chunk-HCBYKLMW.js";import"./chunk-C44QQJR4.js";import"./chunk-6YGTRKDT.js";import"./chunk-UR6MHSHU.js";export{b as ProfilesView,a as formatProfileLine};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a,b}from"./chunk-
|
|
2
|
+
import{a,b}from"./chunk-HWA7WD44.js";import"./chunk-YCCUBQY4.js";import"./chunk-MY32TBBR.js";import"./chunk-2WVKOZ6W.js";import"./chunk-NLCCBXXV.js";import"./chunk-RZ4F3BHX.js";import"./chunk-AKHUNBQS.js";import"./chunk-4SXD6XWV.js";import"./chunk-6SGPN76K.js";import"./chunk-HCBYKLMW.js";import"./chunk-C44QQJR4.js";import"./chunk-6YGTRKDT.js";import"./chunk-UR6MHSHU.js";export{b as ProjectPicker,a as formatProjectLine};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a,b,c}from"./chunk-
|
|
2
|
+
import{a,b,c}from"./chunk-LLS47HUA.js";import"./chunk-S3DAAAE5.js";import"./chunk-6NIV7AVZ.js";import"./chunk-3Z3UIW5H.js";import"./chunk-6SGPN76K.js";import"./chunk-HCBYKLMW.js";import"./chunk-C44QQJR4.js";import"./chunk-6YGTRKDT.js";import"./chunk-UR6MHSHU.js";export{a as SaveSessionPrompt,b as defaultSessionTimestamp,c as renderSavePrompt};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
+
import{a}from"./chunk-RIMJDJWY.js";import"./chunk-JF7Q2I45.js";import"./chunk-6CZIEK6B.js";import"./chunk-6XHAXAL2.js";import"./chunk-VBCE4U4B.js";import"./chunk-C42WWO7Y.js";import"./chunk-FPFOW6BS.js";import"./chunk-WAOCHXJ5.js";import"./chunk-L5LI2JF4.js";import"./chunk-HWA7WD44.js";import"./chunk-N6DO2LBH.js";import"./chunk-YCCUBQY4.js";import"./chunk-MY32TBBR.js";import"./chunk-M5JQXOCE.js";import"./chunk-2WVKOZ6W.js";import"./chunk-NLCCBXXV.js";import"./chunk-RZ4F3BHX.js";import"./chunk-AKHUNBQS.js";import"./chunk-VE3SUJMA.js";import"./chunk-P4HW2NTZ.js";import"./chunk-4SXD6XWV.js";import"./chunk-6SGPN76K.js";import"./chunk-HCBYKLMW.js";import"./chunk-C44QQJR4.js";import"./chunk-6YGTRKDT.js";import"./chunk-UR6MHSHU.js";export{a as SingleShotApp};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a,b,c,d}from"./chunk-
|
|
2
|
+
import{a,b,c,d}from"./chunk-RV2NXHIC.js";import"./chunk-6NIV7AVZ.js";import"./chunk-3Z3UIW5H.js";import"./chunk-6SGPN76K.js";import"./chunk-HCBYKLMW.js";import"./chunk-C44QQJR4.js";import"./chunk-6YGTRKDT.js";import"./chunk-UR6MHSHU.js";export{d as AutoExitSummaryBox,c as SummaryBox,b as buildSummaryEvent,a as buildSummaryRendered};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
+
import{g as a}from"./chunk-KI2DVQSA.js";import"./chunk-5JJ245FW.js";import"./chunk-D7L6UW5Z.js";import"./chunk-VBCE4U4B.js";import"./chunk-2WO7G2HO.js";import"./chunk-5Y2G4NC7.js";import"./chunk-M5JQXOCE.js";import"./chunk-AKHUNBQS.js";import"./chunk-6NIV7AVZ.js";import"./chunk-3Z3UIW5H.js";import"./chunk-DFS4RMVP.js";import"./chunk-6SGPN76K.js";import"./chunk-HCBYKLMW.js";import"./chunk-C44QQJR4.js";import"./chunk-6YGTRKDT.js";import"./chunk-UR6MHSHU.js";export{a as TestMdRunView};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as b,b as r}from"./chunk-
|
|
2
|
+
import{a as b,b as r}from"./chunk-3Z3UIW5H.js";import{y as o}from"./chunk-6SGPN76K.js";import{a as p}from"./chunk-HCBYKLMW.js";import{a as i,b as l,j as s}from"./chunk-C44QQJR4.js";import{a as T}from"./chunk-6YGTRKDT.js";import{e as a}from"./chunk-UR6MHSHU.js";var f=a(T(),1);var e=a(p(),1);function V({profile:g,env:v,authenticated:n,authMethod:h,username:c,tokenStatus:t,expiresAt:d,serverStatus:u,detail:m}){let{exit:x}=s();return(0,f.useEffect)(()=>{let B=setTimeout(()=>x(),50);return()=>clearTimeout(B)},[x]),(0,e.jsx)(i,{flexDirection:"column",children:(0,e.jsx)(b,{title:"Identity",variant:n?"success":"warning",children:(0,e.jsxs)(i,{flexDirection:"column",paddingY:1,children:[(0,e.jsx)(i,{children:u==="rejected"?(0,e.jsx)(l,{color:o.red,bold:!0,children:"\u2717 Not authenticated"}):u==="unreachable"?(0,e.jsx)(l,{color:o.orange,bold:!0,children:"\u26A0 Couldn't verify"}):n?(0,e.jsx)(l,{color:o.green,bold:!0,children:"\u2713 Authenticated"}):(0,e.jsx)(l,{color:o.orange,bold:!0,children:"\u26A0 Not logged in"})}),(0,e.jsxs)(i,{flexDirection:"column",marginTop:1,children:[(0,e.jsx)(r,{label:"Profile",value:g}),(0,e.jsx)(r,{label:"Environment",value:v}),(0,e.jsx)(r,{label:"Method",value:h}),c&&(0,e.jsx)(r,{label:"User",value:c}),t&&(0,e.jsx)(r,{label:"Token",value:t,valueColor:t==="valid"?o.green:t==="expired"?o.red:o.dim}),d&&(0,e.jsx)(r,{label:"Expires",value:d}),m&&(0,e.jsx)(r,{label:"Detail",value:m})]})]})})})}export{V as WhoamiView};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
+
import{a as p}from"./chunk-WWH7CW5R.js";import"./chunk-KHU7C6EE.js";import"./chunk-3C5GMAM4.js";import"./chunk-KNCHEM6A.js";import"./chunk-FXPPQL4D.js";import"./chunk-RE3BZVGE.js";import"./chunk-6PS65QFF.js";import"./chunk-JFAFKHDX.js";import"./chunk-WIA7TPK3.js";import"./chunk-QPZRHAYK.js";import"./chunk-6GTOYTCQ.js";import"./chunk-YKTYVJBN.js";import"./chunk-6AYUSR7X.js";import"./chunk-427OQS2N.js";import"./chunk-FJTWJ243.js";import{a as u}from"./chunk-BC7UVJJB.js";import"./chunk-2PQXEEVY.js";import"./chunk-L5LI2JF4.js";import"./chunk-MCQXRJGH.js";import"./chunk-74RUSHIB.js";import"./chunk-ZZLR3O5A.js";import"./chunk-ZG2V2ODK.js";import"./chunk-5YPBPZUR.js";import"./chunk-6SGPN76K.js";import"./chunk-UR6MHSHU.js";import{existsSync as D}from"fs";var b=new Set(["interactive","agent","ci","override"]);function E(e){return e.mode!=null&&!b.has(e.mode)?{error:`design: --mode must be interactive | agent | ci | override, got '${e.mode}'`}:e.strength!=null&&e.strength!=="pairwise"&&e.strength!=="3-wise"?{error:`design: --strength must be pairwise | 3-wise, got '${e.strength}'`}:e.max!=null&&(!Number.isInteger(e.max)||e.max<1)?{error:"design: --max must be a positive integer"}:!e.useCase&&!e.resume?{error:"design: --use-case is required (or --resume <sid> \u2014 the session remembers its use-case)"}:{useCase:e.useCase,max:e.max,strength:e.strength,mode:e.mode,force:e.force,resume:e.resume,plan:e.plan,message:e.message,because:e.because,changeDelta:e.changeDelta,priorDesign:e.priorDesign}}async function A(e){let c=async(r,s)=>{if(process.stderr.write(r+`
|
|
3
|
+
`),e.mode!=="agent")return 2;let{makeHeadlessIO:t,agentRefusal:i}=await import("./headless-io-PWW6YKH2.js");return i(t("ndjson","design"),r,s)},d=E(e);if("error"in d)return c(d.error);let a=d;{let{validateResumeMessage:r}=await import("./headless-io-PWW6YKH2.js"),s=r(a,"design");if(s)return c(s)}if(!D(u(process.cwd())))return c("error: no context store here (run `kane-cli context ingest` + `kane-cli context extract` first)","NO_STORE");let n=null;try{if(!a.mode&&!process.stdin.isTTY)return process.stderr.write(`design: no TTY \u2014 pass an explicit --mode agent|ci|override to run headless
|
|
4
|
+
`),2;let r=a.mode??"interactive";if(r==="interactive"){if(!process.stdin.isTTY||!process.stdout.isTTY)return process.stderr.write(`design: --mode interactive needs a TTY on stdin and stdout (use --mode agent|ci|override headless)
|
|
5
|
+
`),2;let{bindDesignInteractive:o}=await import("./interactive-bind-ZIIJDRBU.js");return await o(a)}let{resolveAgentAuthEnv:s}=await import("./spawner-DWONVIPI.js"),{runAgent:t}=await import("./bridge-PDJEOSAJ.js"),{preflightTurn:i}=await import("./turn-preflight-JGYT7LXP.js"),{makeInterruptGuard:h}=await import("./interrupt-guard-UREUWNRL.js"),{baseUrlAdvisory:w}=await import("./turn-preflight-JGYT7LXP.js"),{makeHeadlessIO:T,resolveEncoding:v,guardedChannels:x}=await import("./headless-io-PWW6YKH2.js");n=T(v(r),"design");let m=await s(),l=w();l&&n.out(l);let g=h(t,o=>n.out(o)),f=x(n,()=>g.interrupted(),/^error: (design agent failed|the design agent ended)/);try{let o=await p({...a,mode:r},{contextDir:u(process.cwd()),agent:g.agent,preflightTurn:()=>i(m),ask:async()=>[],out:f.out,emit:f.emit,progress:n.progress,isTTY:!1,auth:m});return g.interrupted()&&o!==3?(n.out("interrupted \u2014 no session saved"),n.done(130)):n.done(o)}finally{g.dispose()}}catch(r){let s=r instanceof Error?r.message:String(r);n?.event({type:"error",message:`error: design failed: ${s}`});let t=n?i=>n.out(i):i=>process.stderr.write(i+`
|
|
6
|
+
`);return t(`error: design failed: ${s}`),(process.env.ASSURANCE_LOG_LEVEL??"").toLowerCase()==="debug"&&r instanceof Error&&r.stack&&t(r.stack),t("hint: per-run trace logs live under .context/logs/ (design-*.log)"),n?n.done(1):1}}export{A as designTestsCommand};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a}from"./chunk-
|
|
2
|
+
import{a}from"./chunk-LURGFJEE.js";import"./chunk-KYHXDJN4.js";import"./chunk-UR6MHSHU.js";export{a as runAgent};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as l}from"./chunk-RZ4F3BHX.js";import{c as i,
|
|
2
|
+
import{a as l}from"./chunk-RZ4F3BHX.js";import{c as i,g as c}from"./chunk-6SGPN76K.js";import"./chunk-UR6MHSHU.js";import{readFileSync as u,writeFileSync as g,mkdirSync as d}from"fs";import{join as f}from"path";var h=f(i,"changelog-cache.json"),p=3600*1e3;function y(){try{let e=JSON.parse(u(h,"utf-8"));if(Date.now()-e.cachedAt<p)return e}catch{}return null}function m(e){try{d(i,{recursive:!0}),g(h,JSON.stringify({entries:e,cachedAt:Date.now()}))}catch{}}async function A(e){try{let t=y();if(t){let r=t.entries;return e?.all?r:r.slice(0,5)}let n=new AbortController,o=setTimeout(()=>n.abort(),5e3),a=await l(`${c}?per_page=30`,{headers:{Accept:"application/vnd.github+json"},signal:n.signal});if(clearTimeout(o),!a.ok)return[];let s=(await a.json()).map(r=>({version:r.tag_name.replace(/^v/,""),date:r.published_at?r.published_at.slice(0,10):"",body:r.body??""}));return m(s),e?.all?s:s.slice(0,5)}catch{return[]}}function v(e){if(e.length===0)return"Could not fetch changelog. Visit https://github.com/LambdaTest/kane-cli/releases";let t=["kane-cli Changelog","\u2500".repeat(40),""];for(let n of e){if(t.push(`v${n.version} (${n.date})`),n.body){let o=n.body.split(`
|
|
3
3
|
`).filter(a=>a.trim());for(let a of o)t.push(` ${a}`)}t.push("")}return t.join(`
|
|
4
4
|
`)}export{A as fetchChangelog,v as formatChangelog};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as V,c as ne}from"./chunk-JFAFKHDX.js";import{b as X,c as Z,d as ee}from"./chunk-
|
|
2
|
+
import{a as V,c as ne}from"./chunk-JFAFKHDX.js";import{b as X,c as Z,d as ee}from"./chunk-WIA7TPK3.js";import"./chunk-QPZRHAYK.js";import{a as w,b as te}from"./chunk-6GTOYTCQ.js";import{a as oe}from"./chunk-427OQS2N.js";import{d as Q}from"./chunk-2PQXEEVY.js";import{a as z}from"./chunk-MCQXRJGH.js";import"./chunk-74RUSHIB.js";import{a as j,b as F}from"./chunk-ZZLR3O5A.js";import{e as W,g as Y}from"./chunk-ZG2V2ODK.js";import{e as L,f as A,g as J,h as x}from"./chunk-5YPBPZUR.js";import"./chunk-UR6MHSHU.js";var ce=new Set(["approve","edit","reject"]);function Ie(k){let{contextDir:f,graph:o,ops:se,by:l}=k,N=k.mintable??oe(),T=W(f);if(o.latestHash!==T)return{record:null,errors:[{code:"STALE_BASIS",detail:`graph opened at ${String(o.latestHash)} but chain head is ${String(T)} \u2014 re-open and retry`}]};let C=[],h=[],M=new Set;for(let e of se){if(o.appliedEvents.has(e.eventId)||M.has(e.eventId)){C.push(e.eventId);continue}M.add(e.eventId),h.push(e)}if(h.length===0)return{record:null,errors:null,applied:[],skipped:C,minted:[],staleDelta:[]};let s=[],$=[],y=[],m=[],I=[],O=[],_=[...k.judgements??[]],D=[],q=new Map,B=new Set,G=[],b=new Set,ie=new Set(N),H=new Set;for(let e of h){if(!ce.has(e.kind))continue;let n=e.target,t=o.resolve(n)?.cid??n;H.has(t)&&s.push({code:"MULTIPLE_TERMINAL_OPS",detail:`${n} has more than one terminal op in this turn \u2014 normalize latest-wins first`}),H.add(t)}let S=(e,n,t)=>{let d=o.resolve(n);if(!d)return s.push({code:"UNKNOWN_NODE",detail:`${e}: ${n} names nothing in the graph`}),null;let p=o.tipOf(d.cid);return p!==t||o.superseded.has(t)?(s.push({code:"EXPECTED_CID_MOVED",detail:`${e}: ${n} moved or was archived since it was displayed`,data:{tip:p}}),null):t};for(let e of h)if(e.kind==="approve"){let n=S("approve",e.target,e.expectedCid);n&&m.push({id:n,kind:"review-item",resolution:"approved",edit:null,reason:null,by:l})}else if(e.kind==="reject"){let n=S("reject",e.target,e.expectedCid);if(!n)continue;if(m.push({id:n,kind:"review-item",resolution:"rejected",edit:null,reason:e.reason,by:l}),e.redirectTo!==void 0){let t=o.resolve(e.redirectTo);if(!t||t.superseded){s.push({code:"UNKNOWN_NODE",detail:`reject.redirectTo: ${e.redirectTo} is not a live node`});continue}I.push({kind:"node",old:n,new:t.cid,reason:e.reason,by:l})}}else if(e.kind==="edit"){let n=S("edit",e.target,e.expectedCid);if(!n)continue;let t=o.getNode(n);if(!t){s.push({code:"UNKNOWN_NODE",detail:`edit: ${e.target} node file unreadable`});continue}let d={...t.content};for(let[r,g]of Object.entries(e.edit))g!==void 0&&(d[r]=g);if(typeof d.title=="string"&&!d.title.trim()){s.push({code:"EMPTY_TITLE",detail:`edit: ${e.target} edited title is empty`});continue}let p=A(t.label,d);if(p.length>0){for(let r of p)s.push({code:r.code,detail:`edit ${e.target}: ${r.detail}`});continue}let c=j(t.label,d);if(c===n){m.push({id:n,kind:"review-item",resolution:"approved",edit:null,reason:null,by:l});continue}$.push({cid:c,label:t.label,content:d}),I.push({kind:"node",old:n,new:c,reason:e.reason??"edited in chat",by:l}),m.push({id:c,kind:"review-item",resolution:"edited",edit:{...e.edit},reason:null,by:l})}else if(e.kind==="enhance"){if(!S("enhance",e.target,e.expectedCid))continue;for(let t of e.edges){let d=o.nodeLabel.get(t.src)??"(unknown)",p=o.nodeLabel.get(t.dst)??"(unknown)";for(let i of x(t.type,d,p,t.props))s.push({code:i.code,detail:`enhance ${e.target}: ${i.detail}`});let c=F(t.type,t.src,t.dst,t.props);if(o.edgesFrom(t.src).some(i=>i.ecid===c)||y.some(i=>i.ecid===c))continue;let r=Z(o,t.type,t.src,t.dst,G);r&&s.push(r);let g=ee(o,t.type,t.src,t.dst);g&&s.push(g);let a=J(t.type)?.cardinality;if(a==="one-live-per-src"||a==="one-live-per-src-and-dst"){let i=`${t.type}|${t.src}`;b.has(i)&&s.push({code:"CARDINALITY_VIOLATION",detail:`${t.type} from ${t.src}: two one-live edges in one turn`}),b.add(i)}if(a==="one-live-per-src-and-dst"){let i=`${t.type}|dst|${t.dst}`;b.has(i)&&s.push({code:"CARDINALITY_VIOLATION",detail:`${t.type} onto ${t.dst}: two one-live edges in one turn (strict 1:1)`}),b.add(i)}y.push({ecid:c,type:t.type,src:t.src,dst:t.dst,props:t.props}),G.push({src:t.src,dst:t.dst,type:t.type})}}else if(e.kind==="add"){if(!ie.has(e.label)){s.push({code:"GATED_LABEL",detail:`add: ${e.label} is not mintable in v1 (gate: ${N.join("|")})`,data:{gate:[...N]}});continue}let n=o.heads.get(e.convSourceId),t=o.convChains.get(e.convSourceId);if(typeof n!="string"||!t){s.push({code:"CONV_SOURCE_MISSING",detail:`add: ${e.convSourceId} is not a live conversation source`});continue}let d=o.getNode(n)?.content?.blob,p=typeof d=="string"?Q(f,d)?.toString("utf8")??"":"",c=te(p,e.cite.turn);if(c===null){s.push({code:"BAD_ANCHOR",detail:`add: ${w(e.cite.turn)} does not resolve in ${e.convSourceId}`});continue}if(!c.includes(e.cite.quote)){s.push({code:"QUOTE_MISMATCH",detail:`add: quote is not verbatim within ${w(e.cite.turn)}`});continue}let r={...e.content,derived:!0},g=A(e.label,r);if(g.length>0){for(let u of g)s.push({code:u.code,detail:`add: ${u.detail}`});continue}let a=j(e.label,r),i={source_id:e.convSourceId,source_cid:n,anchor:w(e.cite.turn),quote:e.cite.quote};for(let u of x(L.DERIVES,"source",e.label,i))s.push({code:u.code,detail:`add: ${u.detail}`});$.push({cid:a,label:e.label,content:r}),y.push({ecid:F("DERIVES",n,a,i),type:L.DERIVES,src:n,dst:a,props:i}),e.rationale&&_.push({about:a,rationale:e.rationale,by:l});let P=typeof r.title=="string"?r.title:typeof r.intent=="string"?r.intent:"",v=P?X(e.label,P,u=>B.has(u)||o.names.has(u)&&!o.superseded.has(o.names.get(u))):null;v!==null&&(B.add(v),O.push({cid:a,slug:v,by:l})),D.push({cid:a,...v!==null?{slug:v}:{}}),q.set(e.eventId,a)}if(s.length)return{record:null,errors:s};let U=new Date().toISOString();for(let e of h){if(e.kind==="add"){let n=q.get(e.eventId);n&&V(f,{ts:U,command:"extract-chat",id:n,verdict:"add",polarity:"preference",tag:e.label,by:l,event_id:e.eventId,target:n});continue}for(let n of ne(e,{ts:U,command:"extract-chat",by:l}))V(f,n)}let K=h.map(e=>e.eventId).sort(),re=Y(f,{ts:new Date().toISOString(),proposal_id:null,nodes:$,edges:y,review:m,supersessions:I,...O.length>0?{names:O}:{},..._.length>0?{judgements:_}:{},event_ids:K,source_head_moves:{}},{expectPrev:T}),R=z(f),E=new Set;for(let e of I)if(e.kind==="node"){E.add(e.old);for(let n of R.edgesInto(e.old))E.add(n.src)}for(let e of D)E.add(e.cid);let de=[...E].map(e=>({cid:e,state:R.stale(R.tipOf(e))})).filter(e=>e.state!=="fresh");return{record:re.record,errors:null,applied:K,skipped:C,minted:D,staleDelta:de}}export{Ie as commitChatTurn};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as K,b as X,c as Y,d as Z}from"./chunk-RE3BZVGE.js";import"./chunk-6PS65QFF.js";import{b as N,d as J}from"./chunk-
|
|
2
|
+
import{a as K,b as X,c as Y,d as Z}from"./chunk-RE3BZVGE.js";import"./chunk-6PS65QFF.js";import{b as N,d as J}from"./chunk-6GTOYTCQ.js";import{d as V}from"./chunk-2PQXEEVY.js";import"./chunk-ZZLR3O5A.js";import"./chunk-ZG2V2ODK.js";import"./chunk-5YPBPZUR.js";import"./chunk-UR6MHSHU.js";var re=new Set(["approve","edit","reject"]);function se(r,t){return`chatop:${t}:${r.target??"new"}:${r.op}:${r.seq}`}function oe(r,t,x,c){let u=se(r,t),m=r.payload;switch(r.op){case"approve":return{kind:"approve",target:r.target,expectedCid:r.expected_cid,eventId:u};case"edit":{let{reason:i,...h}=m;return{kind:"edit",target:r.target,expectedCid:r.expected_cid,edit:h,reason:i,eventId:u}}case"enhance":return{kind:"enhance",target:r.target,expectedCid:r.expected_cid,edges:m.edges??[],eventId:u};case"reject":return{kind:"reject",target:r.target,expectedCid:r.expected_cid,reason:m.reason??"",redirectTo:m.redirect_to,eventId:u};case"add":{let i=m.proposal_item??{},h=String(i.label??"");if(!x.mint_gate.includes(h))throw new Error(`GATED_LABEL: cannot mint "${h}" (gate: ${x.mint_gate.join(", ")})`);let d=i.cite??{},a=i.conv_source_id??c;if(!a||typeof d.turn!="number"||!d.quote)throw new Error("INVALID_ADD: a chat add requires a conversation cite {turn, quote} and conv_source_id");return{kind:"add",label:h,content:i.content??{},cite:{turn:d.turn,quote:d.quote},convSourceId:a,rationale:i.rationale,eventId:u}}}}function ee(r,t,x={}){let c=x.turn??0,u=[],m=[];for(let d of r)(d.op==="add"||d.op==="enhance")&&m.push(d);let i=new Map;for(let d of r){if(!re.has(d.op)||!d.target)continue;let a=i.get(d.target)??[];a.push(d),i.set(d.target,a)}for(let[d,a]of i){let b=Math.max(...a.map(_=>_.seq)),C=a.filter(_=>_.seq===b);if(C.length>1){u.push({target:d,seq:b,kinds:C.map(_=>_.op)});continue}m.push(C[0])}return{chatOps:m.sort((d,a)=>d.seq-a.seq).map(d=>oe(d,c,t,x.convSourceId)),ambiguous:u}}function ae(r,t){let x=r.trim();if(x==="")return{kind:"defaults"};if(/^defer$/i.test(x))return{kind:"defer-all"};let c=t.cursor,u=x,m=/^(\d+):\s*(.*)$/.exec(x);if(m){let a=Number(m[1]);if(a<1||a>t.questions.length)return{kind:"invalid",target:null,message:`no question ${a} \u2014 this batch has ${t.questions.length}`};if(c=a-1,u=m[2].trim(),!u)return{kind:"invalid",target:c,message:`say what to answer \u2014 e.g. \`${a}: yes\``}}if(c<0||c>=t.questions.length)return{kind:"invalid",target:null,message:"no pending question to answer"};let i=t.questions[c],h=/^"(.*)"$/.exec(u);if(h)return i.allow_free_text?{kind:"free",target:c,text:h[1]}:{kind:"invalid",target:c,message:`question ${c+1} takes an option (1-${i.options.length}) \u2014 free text isn't allowed here`};if(i.multi_select&&/^\d+(\s+\d+)+$/.test(u)){let a=u.split(/\s+/).map(Number);if(a.every(b=>b>=1&&b<=i.options.length))return{kind:"multi",target:c,indices:a.map(b=>b-1)}}if(/^\d+$/.test(u)){let a=Number(u);if(a>=1&&a<=i.options.length)return{kind:"option",target:c,index:a-1}}let d=i.options.findIndex(a=>a.label.toLowerCase()===u.toLowerCase());return d>=0?{kind:"option",target:c,index:d}:i.allow_free_text?{kind:"free",target:c,text:u}:{kind:"invalid",target:c,message:`question ${c+1} takes an option \u2014 type 1-${i.options.length} or an option name`}}function te(r){let t=r.text.replace(/\?+\s*$/,"");return t.length<=36?t:`${t.slice(0,33)}\u2026`}function ue(r){return r.use_cases??[]}var de={acs:"acceptance criteria",scenarios:"scenarios",tests:"tests",gaps:"gaps"};function ce(r){let t=[],x=[],c=(i,h)=>{h.length!==0&&(x.push(i),t.push(...h))},u=i=>typeof i=="string"&&/^[a-z]{1,4}\d{1,4}$/i.test(i)?i:null,m=i=>{let h=u(i.automates)??"1 scenario",d=i.verifies??[],a=d.map(u).filter(_=>_!==null).slice(0,2),b=d.length-a.length,C=a.length?`${a.join(" ")}${b>0?` +${b}`:""}`:`${d.length} ACs`;return`covers ${h} \xB7 verifies ${C}`};return c("acs",(r.acs??[]).map(i=>({temp_ref:i.temp_ref,title:i.text,kind:"ac",badge:String(i.kind),extra:{...i.expected_answer?{expects:`${String(i.expected_answer.operator??"")} \xB7 ${String(i.expected_answer.operand??"")}`}:{},"scoped to":i.scoped_to??"(use-case)"}}))),c("scenarios",(r.scenarios??[]).map(i=>({temp_ref:i.temp_ref,title:i.title,kind:"scenario",badge:i.case_type,why:i.intent,depends_on_hint:i.depends_on??[],extra:{technique:i.technique_notes}}))),c("tests",(r.tests??[]).map(i=>({temp_ref:i.temp_ref,title:i.title,kind:"test",why:m(i),depends_on_hint:i.reuses??[],extra:{automates:String(i.automates??"?"),verifies:(i.verifies??[]).join(", "),check:i.check?`${String(i.check.kind)} vs ${String(i.check.verified_against)}`:"?"}}))),c("gaps",(r.gaps??[]).map(i=>({temp_ref:i.temp_ref??i.ref??"?",title:String(i.question?.header??i.kind),kind:"gap",badge:i.kind,why:i.risk_rationale}))),{items:t,heading:x.join(" + ")||"design"}}function ke(r={}){let t={turns:[],thinking:X(),pending:null,confirm:null,status:"idle",ledger:[],activeTurn:null,stream:null,checkpoint:!1},x=e=>{let n=[],o=e.minted.map(g=>g.slug).filter(Boolean);o.length&&n.push(`added ${o.join(", ")}`);let s=e.applied.length-e.minted.length;return s>0&&n.push(`${s} change${s===1?"":"s"} applied`),e.staleDelta.length&&n.push(`stales ${e.staleDelta.length}`),n.join(" \xB7 ")||"no changes"},c=[];r.onRender&&c.push(r.onRender);let u=0,m=0,i=null,h=null,d=null,a=[],b=0,C=e=>{if(!(!d||!r.contextDir||!e.trim()))try{let n=r.refreshGraph?.()??r.graph;if(!n)return;J({contextDir:r.contextDir,graph:n,sourceId:d,text:e,by:r.by??{kind:"human",id:"owner"}})}catch{}},_=e=>{if(!d||!r.contextDir)return;let n=r.refreshGraph?.()??r.graph,o=n?.heads.get(d),s=n?.convChains.get(d);if(!n||typeof o!="string"||!s)return;let g=n.getNode(o)?.content?.blob,f=typeof g=="string"?V(r.contextDir,g)?.toString("utf8")??"":"";if(f)for(let v of e){if(v.kind!=="add"||v.convSourceId!==d)continue;let O=N(f,v.cite.turn);if(!(O!==null&&O.includes(v.cite.quote)))for(let S=s.turns;S>=1;S--){let L=N(f,S);if(L!==null&&L.includes(v.cite.quote)){v.cite={...v.cite,turn:S};break}}}},j=null,E=new Map,Q=new Map,B=null,k=()=>{R&&(clearTimeout(R),R=null);for(let e of c)e()},R=null,G=()=>{R||(R=setTimeout(()=>{R=null;for(let e of c)e()},80))},l=e=>{t.ledger.push(e)},D=null,A=!1,M=(e=!1)=>{D?l({kind:"agent",text:D}):e&&A&&l({kind:"note",text:'chat to refine ("looks good" approves; /done finishes)'}),D=null,A=!1},ne=()=>{D=null,A=!1},I=()=>{t.activeTurn&&(t.activeTurn=null)},W=(e,n)=>n.choice||(n.selected_index!=null?e.options[n.selected_index]?.label??"?":"?"),U=()=>{let e=t.pending;if(!e)return;if(!e.resolution.every(Boolean)){e.cursor=e.resolution.findIndex(s=>s===null);return}let n=e.questions.map((s,g)=>{let f=e.resolution[g];return f.form==="deferred"?{id:s.id,selected_index:null,free_text:null}:f.free_text!=null?{id:s.id,selected_index:null,free_text:f.free_text}:{id:s.id,selected_index:f.selected_index,free_text:null}});t.pending=null,t.status=t.status==="pausing"?"pausing":"streaming";let o=j;j=null,o?.(n)},T=(e,n)=>{let o=t.pending,s=o.questions[e],g=o.resolution[e];o.resolution[e]=n;let f=te(s);g?l({kind:"answer",receipt:{form:"changed",qNum:e+1,stub:f,choice:W(s,n),prev:g.choice}}):n.form==="deferred"?l({kind:"answer",receipt:{form:"deferred",qNum:e+1,stub:f}}):l({kind:"answer",receipt:{form:n.form,qNum:e+1,stub:f,choice:W(s,n)}})},P=()=>{let e=t.pending;e&&(e.questions.forEach((n,o)=>{e.resolution[o]||T(o,{form:"deferred",selected_index:null,free_text:null,choice:""})}),U())},z=e=>({questions:e,cursor:0,resolution:e.map(()=>null)}),ie=e=>{let n=t.pending;t.notice=void 0;let o=ae(e,n);switch(o.kind){case"invalid":t.notice=o.message;return;case"defaults":{let s=!1;if(n.questions.forEach((g,f)=>{if(!n.resolution[f]){if(g.risk==="high"){s=!0;return}T(f,{form:"assumed",selected_index:g.recommended_index,free_text:null,choice:g.options[g.recommended_index]?.label??"?"})}}),s){n.cursor=n.questions.findIndex((g,f)=>!n.resolution[f]),t.notice="high-risk questions need an explicit answer (or type 'defer' to leave them with the agent)";return}break}case"defer-all":P();return;case"option":{let s=n.questions[o.target];T(o.target,{form:"answered",selected_index:o.index,free_text:null,choice:s.options[o.index]?.label??String(o.index+1)});break}case"free":T(o.target,{form:"answered",selected_index:null,free_text:o.text,choice:o.text});break;case"multi":{let s=n.questions[o.target],g=o.indices[0];T(o.target,{form:"answered",selected_index:g,free_text:null,choice:s.options[g]?.label??String(g+1)}),t.notice="multi-select not yet supported end-to-end \u2014 sent your first choice";break}}U()};return{state:t,explainRef(e){if(!r.explain||!r.graph||r.contextDir===void 0){l({kind:"note",text:"explain isn't available here"}),k();return}let n=r.explain(r.contextDir,r.graph,e),o=n.target?[`${n.target.label} ${n.target.slug??n.target.cid.slice(0,19)}:`,...n.entries.map(s=>` [${s.kind}] ${s.rationale??s.detail}`)].join(`
|
|
3
3
|
`):`unknown ref: ${e}`;l({kind:"note",text:o}),k()},subscribe(e){return c.push(e),()=>{let n=c.indexOf(e);n>=0&&c.splice(n,1)}},submit(e){if(t.confirm&&(t.confirm=null),t.pending){ie(e),k();return}if(!i){t.turns.push({role:"user",text:e}),l({kind:"user",text:e}),t.notice="the agent isn't running \u2014 nothing sent",k();return}for(t.notice=void 0,t.checkpoint=!1,M(),t.turns.push({role:"user",text:e}),l({kind:"user",text:e}),C(e),t.status="streaming",t.busySince=Date.now(),t.error=void 0,m+=1;a.length>0;)m+=1,i({type:"user_message",message_id:`u${m}-receipt`,text:a.shift()});i({type:"user_message",message_id:`u${m}`,text:e}),k()},attachSender(e){i=e},attachOnCommitted(e){h=e},attachConversationSource(e){d=e},holdReceipt(e){a.push(e),t.checkpoint=!0,k()},drainHeldReceipts(){return a.splice(0,a.length)},reopenQuestion(){let e=t.pending;if(!e)return;let n=e.cursor<0?e.questions.length:e.cursor;for(let o=n-1;o>=0;o--)if(e.resolution[o]){e.cursor=o,k();return}},continueParked(){if(!(!i||a.length===0)){for(t.checkpoint=!1,l({kind:"continued"});a.length>0;)m+=1,i({type:"user_message",message_id:`u${m}-receipt`,text:a.shift()});m+=1,i({type:"user_message",message_id:`u${m}`,text:"continue"}),t.status="streaming",t.busySince=Date.now(),k()}},note(e){l({kind:"note",text:e}),k()},registerAliases(e){for(let n of e)Q.set(n.ref,n.cid)},setWorking(e){if(e!=null){if(t.status!=="idle"&&t.status!=="working")return;t.status==="idle"&&(t.busySince=Date.now()),t.status="working",t.workingLabel=e}else{if(t.status!=="working")return;t.status="idle",t.workingLabel=void 0}k()},ledger(e){(e.kind==="pause"||e.kind==="error"||e.kind==="summary")&&(I(),M()),(e.kind==="summary"||e.kind==="pause")&&(t.stream=null),l(e),e.kind==="commit"&&(e.ok?M(!0):ne()),k()},completeSession(){P(),i?.({type:"session_complete"}),t.status="idle",k()},requestPause(){P(),t.status="pausing";let e=i;Promise.resolve().then(()=>e?.({type:"pause"})),k()},ask(e){return t.pending=z(e),E=new Map(e.map((n,o)=>[n.id,o+1])),t.status="awaiting-input",k(),new Promise(n=>{j=n})},noteCoercion(e,n){l({kind:"answer",receipt:{form:"assumed",qNum:E.get(e.id)??0,stub:te(e),choice:n,note:"your typed answer couldn't be used here"}}),k()},onAgentEvent(e){switch(e.type){case"reasoning_delta":case"reasoning_done":case"tool_activity":case"decision_activity":{let n=t.thinking;if(t.thinking=Z(n,e),t.thinking!==n){if(e.type==="reasoning_done"&&e.present)l({kind:"thinking",tookMs:e.took_ms});else if(e.type==="tool_activity"&&e.status!=="started")l({kind:"tool",name:e.name,status:e.status==="done"?"ok":e.status,detail:e.detail});else if(e.type==="decision_activity"){let o=`\xB7 ${Y(e)}`,s=t.ledger[t.ledger.length-1];s&&s.kind==="note"&&s.text===o||l({kind:"note",text:o})}}if(e.type==="reasoning_delta"){G();return}break}case"usage":t.credits={turn:e.credits,total:e.total_credits};break;case"text_delta":{let n=B;if(n&&(e.turn_id<n.turn_id||e.turn_id===n.turn_id&&e.attempt<n.attempt))return;(!n||n.turn_id!==e.turn_id||n.attempt!==e.attempt)&&(B={turn_id:e.turn_id,attempt:e.attempt},t.stream={text:""}),t.stream={text:(t.stream?.text??"")+e.text},G();return}case"progress":break;case"proposal":{u+=1,I(),t.stream=null,t.busySince&&(l({kind:"note",text:`\u2713 done in ${Math.max(1,Math.round((Date.now()-t.busySince)/1e3))}s`}),t.busySince=void 0);let n=ue(e.proposal),o=r.dedupFlags?.(e.proposal);if(o)for(let s of n){let g=o.get(s.temp_ref);g&&(s.matches_existing=g)}t.turns.push({role:"agent",turnIndex:u,items:n,text:e.narrative}),D=e.narrative??null,A=!0,t.activeTurn={turnIndex:u,heading:"use-cases",items:n},l({kind:"turn",turnIndex:u,heading:"use-cases",items:n}),(t.status==="streaming"||t.status==="working")&&(t.status="idle"),t.workingLabel=void 0;break}case"design":{u+=1,I(),t.stream=null,t.busySince&&(l({kind:"note",text:`\u2713 done in ${Math.max(1,Math.round((Date.now()-t.busySince)/1e3))}s`}),t.busySince=void 0);let{items:n,heading:o}=ce(e.design),s=o.split(" + ").map(g=>de[g]??g).join(" + ");l({kind:"banner",text:`designing: ${s}`}),t.turns.push({role:"agent",turnIndex:u,items:n,itemsHeading:o,text:e.narrative}),D=e.narrative??null,A=!0,t.activeTurn={turnIndex:u,heading:o,items:n},l({kind:"turn",turnIndex:u,heading:o,items:n}),(t.status==="streaming"||t.status==="working")&&(t.status="idle"),t.workingLabel=void 0;break}case"ask_user":t.pending=z(e.questions),t.status="awaiting-input";break;case"chat_ops":{u+=1,I(),t.stream=null,t.status==="streaming"&&(t.status="idle");let n=e.chat_ops??e,o=Array.isArray(n.ops)?n.ops:[],s=n.text??e.text??"",g=r.refreshGraph?.()??r.graph,f=p=>Q.get(p)??p,v=o.map(p=>{if(!p.target)return p;let y=f(p.target),w=p.expected_cid;if(w==null&&g){let H=g.resolve(y);H&&(w=g.tipOf(H.cid))}let $=p.payload?.redirect_to,q=$&&f($);return y===p.target&&w===p.expected_cid&&q===$?p:{...p,target:y,expected_cid:w,...q!==$?{payload:{...p.payload,redirect_to:q}}:{}}}),O;try{if(!Array.isArray(n.ops))throw new Error("the agent sent an unreadable change set (no ops array) \u2014 say it again in different words");O=ee(v,r.descriptor??{mint_gate:[]},{turn:u,...d?{convSourceId:d}:{}})}catch(p){t.error=p instanceof Error?p.message:String(p),t.turns.push({role:"agent",turnIndex:u,text:s,narration:t.error}),s&&l({kind:"agent",text:s}),l({kind:"error",title:t.error,detail:[]});break}let{chatOps:S,ambiguous:L}=O;if(L.length>0){let p=L[0];t.confirm={kind:"ambiguity-confirm",prompt:`did you mean edit or ${p.kinds.filter(y=>y!=="edit").join("/")} on ${p.target}?`},t.turns.push({role:"agent",turnIndex:u,text:s}),s&&l({kind:"agent",text:s});break}if(_(S),r.commitChatTurn&&S.length>0){let p=r.commitChatTurn({contextDir:r.contextDir??"",graph:r.refreshGraph?.()??r.graph,ops:S,by:r.by??{kind:"human",id:"owner"},...r.descriptor?.mint_gate?{mintable:r.descriptor.mint_gate}:{}});if(p.errors)t.error=p.errors.map(y=>y.detail).join("; "),t.turns.push({role:"agent",turnIndex:u,text:s}),l({kind:"commit",ok:!1,line:"commit failed \u2014 nothing landed",warnings:p.errors.map(y=>`${y.code}: ${y.detail}`)}),s&&l({kind:"agent",text:s});else{p.applied.length>0&&r.session?.markApplied(p.applied);let y=x(p);t.turns.push({role:"agent",turnIndex:u,text:s,narration:y}),l({kind:"commit",ok:!0,line:y});let w=r.refreshGraph?.();if(w&&h&&h(w),w)try{b+=1;let F=r.descriptor?.mint_gate?.includes("usecase")?"extract":"design",$=K({verb:F,commitN:b,phase:"chat",committed:p.minted.map(q=>({cid:q.cid,...q.slug?{logical_id:q.slug}:{}}))},w);a.push($.text)}catch{}s&&l({kind:"agent",text:s})}}else t.turns.push({role:"agent",turnIndex:u,text:s}),s&&l({kind:"agent",text:s});C(s);break}case"done":case"session_complete":I(),M(),t.status="idle",i=null;break;case"error":I(),M(),t.stream=null,t.status="idle",t.error=e.message,i=null,l({kind:"error",title:e.message,detail:[]});break;case"session_paused":break;default:break}k()}}}export{ke as makeChatController,ae as parseAnswerInput,te as questionStub};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{c as L}from"./chunk-RFHMDQXZ.js";import{Q as O,S}from"./chunk-
|
|
2
|
+
import{c as L}from"./chunk-RFHMDQXZ.js";import{Q as O,S}from"./chunk-4A6BLXQN.js";import{e as P,f as R}from"./chunk-M5JQXOCE.js";import{y as s}from"./chunk-6SGPN76K.js";import{a as y}from"./chunk-HCBYKLMW.js";import{a as E,b as o,i as h}from"./chunk-C44QQJR4.js";import{a as B}from"./chunk-6YGTRKDT.js";import{e as d}from"./chunk-UR6MHSHU.js";var n=d(B(),1);import{basename as D}from"path";var r=d(y(),1),U="evidence-view-server";function Q({packPath:m,viewerBase:w,onDone:V,openUrl:k}){let[t,a]=(0,n.useState)("ask"),[g,b]=(0,n.useState)(null),[l,p]=(0,n.useState)(null),f=(0,n.useRef)(null),u=(0,n.useRef)(!1),x=async()=>{let e=f.current;f.current=null,e&&(R(U),await e.close())},v=()=>{u.current||(u.current=!0,V())};return h((e,i)=>{u.current||(t==="ask"?e==="y"||e==="Y"?a("starting"):(e==="n"||e==="N"||i.return||i.escape)&&v():t==="serving"&&(e==="q"||e==="Q"||i.escape)&&x().then(v))}),(0,n.useEffect)(()=>{if(t!=="starting")return;let e=!1;return(async()=>{try{let i=D(m),c=await O({packs:new Map([[i,m]]),allowedOrigins:[new URL(w).origin]});if(e){await c.close();return}f.current=c,P(U,()=>{c.close()});let T=S(c.urlFor(i),w);b(T);try{await(k??(q=>L(q)))(T)}catch{p("could not open browser \u2014 open the URL manually")}a("serving")}catch(i){p(`evidence view failed \u2014 ${i.message}`),a("failed")}})(),()=>{e=!0}},[t]),(0,n.useEffect)(()=>{if(t!=="failed")return;let e=setTimeout(v,0);return()=>clearTimeout(e)},[t]),(0,n.useEffect)(()=>()=>{x()},[]),t==="ask"?(0,r.jsxs)(o,{children:["View evidence in browser? ",(0,r.jsx)(o,{color:s.dim,children:"(y/N)"})]}):t==="serving"||t==="starting"?(0,r.jsxs)(E,{flexDirection:"column",children:[g?(0,r.jsxs)(o,{children:["viewer ",(0,r.jsx)(o,{color:s.orange,children:g})]}):(0,r.jsx)(o,{color:s.dim,children:"starting\u2026"}),l?(0,r.jsx)(o,{color:"yellow",children:l}):null,t==="serving"?(0,r.jsx)(o,{color:s.dim,children:"Press q when done"}):null]}):l?(0,r.jsx)(o,{color:"yellow",children:l}):null}export{Q as a};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as f}from"./chunk-
|
|
2
|
+
import{a as f}from"./chunk-2WO7G2HO.js";import{y as t}from"./chunk-6SGPN76K.js";import{a as x}from"./chunk-HCBYKLMW.js";import{a as r,b as n}from"./chunk-C44QQJR4.js";import{a as B}from"./chunk-6YGTRKDT.js";import{e as p}from"./chunk-UR6MHSHU.js";var c=p(B(),1);var e=p(x(),1);function v(){return[{name:"convert",label:"Converting session data",status:"pending"},{name:"zip",label:"Compressing artifacts",status:"pending"},{name:"presign",label:"Requesting upload URLs",status:"pending"},{name:"upload",label:"Uploading to KaneAI",status:"pending"},{name:"atomic_replace",label:"Replacing local output",status:"pending"},{name:"commit_lock",label:"Committing to TMS",status:"pending"},{name:"finalize",label:"Finalizing test case",status:"pending"},{name:"code_export",label:"Downloading test code",status:"pending"}]}function U(s,o,d,a){return s.map(l=>l.name===o?{...l,status:d,detail:a}:l)}function R(s){let o=s/1e3;if(o<60)return`${o.toFixed(1)}s`;let d=Math.floor(o/60),a=Math.round(o%60);return`${d}m ${a}s`}function D(s){let[o,d]=(0,c.useState)(0),a=c.default.useRef(Date.now());return(0,c.useEffect)(()=>{if(!s)return;a.current=Date.now();let l=setInterval(()=>{d(Date.now()-a.current)},100);return()=>clearInterval(l)},[s]),o}function h({steps:s,status:o,testUrl:d,error:a}){let l=D(o==="uploading");return o==="uploading"?(0,e.jsxs)(r,{flexDirection:"column",paddingX:1,paddingY:1,children:[(0,e.jsxs)(r,{children:[(0,e.jsx)(n,{color:t.orange,children:"\u2601 "}),(0,e.jsx)(n,{color:t.orange,bold:!0,children:"Saving to KaneAI"}),(0,e.jsxs)(n,{color:t.dim,children:[" ",R(l)]})]}),(0,e.jsx)(r,{flexDirection:"column",marginTop:1,children:s.filter(i=>i.status!=="skipped").map((i,S,T)=>{let b=S===T.length-1?"\u2514\u2500":"\u251C\u2500",u=i.status==="done",m=i.status==="running",g=i.status==="failed";return(0,e.jsxs)(r,{children:[(0,e.jsxs)(n,{color:t.dim,children:[" ",b," "]}),(0,e.jsx)(r,{width:3,children:m?(0,e.jsx)(f,{}):u?(0,e.jsx)(n,{color:t.green,children:"\u2713"}):g?(0,e.jsx)(n,{color:t.red,children:"\u2717"}):(0,e.jsx)(n,{color:t.muted,children:"\u25CB"})}),(0,e.jsx)(n,{color:u?t.dim:m?void 0:g?t.red:t.muted,children:i.label}),i.detail&&(0,e.jsxs)(n,{color:t.dim,children:[" ",i.detail]})]},i.name)})}),(0,e.jsx)(r,{marginTop:1,children:(0,e.jsx)(n,{color:t.muted,children:" press Ctrl+C twice to force exit"})})]}):o==="success"?(0,e.jsx)(e.Fragment,{}):(0,e.jsxs)(r,{flexDirection:"column",paddingX:1,paddingY:1,children:[(0,e.jsxs)(r,{children:[(0,e.jsx)(n,{color:t.red,children:"\u2601 "}),(0,e.jsx)(n,{color:t.red,bold:!0,children:"Save failed"})]}),a&&(0,e.jsxs)(r,{marginTop:0,children:[(0,e.jsx)(n,{color:t.dim,children:" "}),(0,e.jsx)(n,{color:t.dim,children:a})]})]})}export{v as a,U as b,h as c};
|