@testmuai/kane-cli 0.6.4 → 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.
Files changed (109) hide show
  1. package/bin/kane-cli.cjs +91 -0
  2. package/bin/resolve-runtime.cjs +45 -0
  3. package/dist/{ChatSurface-VXYU6KFW.js → ChatSurface-LV3KW6WN.js} +1 -1
  4. package/dist/{ChromeProfilePicker-QWTM7DK6.js → ChromeProfilePicker-6PLUQ5TW.js} +1 -1
  5. package/dist/{CliFeedbackPrompt-6NVWMONO.js → CliFeedbackPrompt-I4F56IVK.js} +1 -1
  6. package/dist/{CliUploadProgress-2YRQLECI.js → CliUploadProgress-ULRSPKY3.js} +1 -1
  7. package/dist/{ConfigView-I4R5M7BO.js → ConfigView-7NMYALEA.js} +1 -1
  8. package/dist/{EvidenceViewOffer-54GEARRX.js → EvidenceViewOffer-KQKPTMXA.js} +1 -1
  9. package/dist/{FolderPicker-5VWBYTAK.js → FolderPicker-4IOVDO2P.js} +1 -1
  10. package/dist/{HelpView-OJZW4XWX.js → HelpView-SHMVMHNU.js} +1 -1
  11. package/dist/{InfoBox-TGELGCBR.js → InfoBox-W2LZVGQS.js} +1 -1
  12. package/dist/{LinksBox-B5EBRY26.js → LinksBox-ZS25VTBY.js} +1 -1
  13. package/dist/{ProfilesView-3SJRIBHQ.js → ProfilesView-XBBRIQ3U.js} +1 -1
  14. package/dist/{ProjectPicker-72HKMBEY.js → ProjectPicker-AUN47FXS.js} +1 -1
  15. package/dist/{SaveSessionPrompt-CK5SGNRO.js → SaveSessionPrompt-Z2K225VN.js} +1 -1
  16. package/dist/SingleShotApp-M7R5PW4X.js +2 -0
  17. package/dist/{SummaryBox-ABB7ST26.js → SummaryBox-4T545XRB.js} +1 -1
  18. package/dist/TestMdRunView-JXRXMACE.js +2 -0
  19. package/dist/{WhoamiView-OF354UGC.js → WhoamiView-GCVD35EX.js} +1 -1
  20. package/dist/{bind-BWILBZGR.js → bind-JLMT57Q3.js} +2 -2
  21. package/dist/{bridge-LNDJS3HH.js → bridge-PDJEOSAJ.js} +1 -1
  22. package/dist/{changelog-BWCEZQ23.js → changelog-D65HWZDM.js} +1 -1
  23. package/dist/{chunk-AXABTFCD.js → chunk-24OFJ7SE.js} +1 -1
  24. package/dist/{chunk-UZSG54OY.js → chunk-24VYAMMK.js} +1 -1
  25. package/dist/{chunk-6LRKYF67.js → chunk-262ES67I.js} +2 -2
  26. package/dist/{chunk-64QURIT6.js → chunk-2BWRAY3Y.js} +1 -1
  27. package/dist/{chunk-2K4XOHVK.js → chunk-2WO7G2HO.js} +1 -1
  28. package/dist/{chunk-BYUARJE7.js → chunk-32GP7KTM.js} +1 -1
  29. package/dist/{chunk-IRRGSC7B.js → chunk-3Z3UIW5H.js} +1 -1
  30. package/dist/{chunk-QNNBNIR7.js → chunk-4A6BLXQN.js} +2 -2
  31. package/dist/{chunk-ACEODVSC.js → chunk-4R2HOA7J.js} +1 -1
  32. package/dist/{chunk-XUJ5EPVW.js → chunk-4SXD6XWV.js} +1 -1
  33. package/dist/{chunk-ADOXYGZE.js → chunk-5JJ245FW.js} +1 -1
  34. package/dist/{chunk-OB6CKLEL.js → chunk-6CZIEK6B.js} +1 -1
  35. package/dist/{chunk-POI6DCP6.js → chunk-6NIV7AVZ.js} +1 -1
  36. package/dist/chunk-6SGPN76K.js +2 -0
  37. package/dist/{chunk-I2JUBAPU.js → chunk-6XHAXAL2.js} +1 -1
  38. package/dist/{chunk-DNOBOZPO.js → chunk-AKHUNBQS.js} +1 -1
  39. package/dist/{chunk-IOTJZTHX.js → chunk-BLSZ4H5W.js} +12 -12
  40. package/dist/{chunk-5KSB5MOF.js → chunk-BV5QKFMJ.js} +1 -1
  41. package/dist/{chunk-4MUHS3UL.js → chunk-C42WWO7Y.js} +1 -1
  42. package/dist/chunk-D7L6UW5Z.js +7 -0
  43. package/dist/{chunk-MVF4KRHA.js → chunk-EOLQUB4Q.js} +1 -1
  44. package/dist/{chunk-PYB2EXRE.js → chunk-EWTX7HSU.js} +2 -2
  45. package/dist/chunk-GLS46X7N.js +5 -0
  46. package/dist/{chunk-YI4XULHR.js → chunk-HA5GE57Z.js} +15 -15
  47. package/dist/{chunk-YMSN25DX.js → chunk-HWA7WD44.js} +1 -1
  48. package/dist/{chunk-3HEPW6SN.js → chunk-JF7Q2I45.js} +1 -1
  49. package/dist/{chunk-QZI43UNV.js → chunk-JTEY32TL.js} +1 -1
  50. package/dist/{chunk-HNE4TDOZ.js → chunk-JU5KRCKD.js} +4 -4
  51. package/dist/{chunk-ANIVHX3P.js → chunk-JV356AYH.js} +1 -1
  52. package/dist/{chunk-MK2G7VIF.js → chunk-KI2DVQSA.js} +1 -1
  53. package/dist/{chunk-DXK55KGR.js → chunk-KNCHEM6A.js} +1 -1
  54. package/dist/{chunk-CT2I5KUM.js → chunk-KYHXDJN4.js} +1 -1
  55. package/dist/{chunk-652FEDL4.js → chunk-L26LU6TU.js} +2 -2
  56. package/dist/{chunk-3WJJ43MT.js → chunk-LABIRPOT.js} +1 -1
  57. package/dist/{chunk-IXVR66NS.js → chunk-LEQ2B3PR.js} +1 -1
  58. package/dist/{chunk-WE57PD6K.js → chunk-LLS47HUA.js} +1 -1
  59. package/dist/{chunk-OLXOZJ7X.js → chunk-LURGFJEE.js} +1 -1
  60. package/dist/{chunk-5CTMOJG4.js → chunk-MSPZOEFB.js} +1 -1
  61. package/dist/{chunk-PICCLJSO.js → chunk-MY32TBBR.js} +1 -1
  62. package/dist/{chunk-STH6I3UB.js → chunk-N6DO2LBH.js} +1 -1
  63. package/dist/{chunk-O66EU5UV.js → chunk-OFEOWKM3.js} +1 -1
  64. package/dist/{chunk-BOO7YXAV.js → chunk-P4HW2NTZ.js} +1 -1
  65. package/dist/{chunk-CY5NDMO7.js → chunk-RIMJDJWY.js} +1 -1
  66. package/dist/{chunk-ZQP3MCZW.js → chunk-RV2NXHIC.js} +1 -1
  67. package/dist/{chunk-WT3SMSY5.js → chunk-S2C62SDY.js} +1 -1
  68. package/dist/{chunk-FV4LLU3T.js → chunk-UZJ7MRBV.js} +1 -1
  69. package/dist/{chunk-W36P7S5W.js → chunk-VBCE4U4B.js} +1 -1
  70. package/dist/{chunk-CLTANA4L.js → chunk-WJGBXJT4.js} +2 -2
  71. package/dist/{chunk-BNN6ZDJW.js → chunk-WWH7CW5R.js} +1 -1
  72. package/dist/{chunk-WFEGGQJ4.js → chunk-XQL53VB7.js} +1 -1
  73. package/dist/{config-OJF53CHL.js → config-6PAZZ7CR.js} +1 -1
  74. package/dist/{credentials-NLJHSVBY.js → credentials-BJCIWQWA.js} +1 -1
  75. package/dist/{evidence-UPOFW3XC.js → evidence-7VE5EGEF.js} +1 -1
  76. package/dist/{evolve-cmd-MVALOB3G.js → evolve-cmd-RUGUWKAG.js} +1 -1
  77. package/dist/{extract-bind-SSTKQGTV.js → extract-bind-YS7C4KZ3.js} +2 -2
  78. package/dist/{extract-cmd-GO4UV7ER.js → extract-cmd-Z4PMDIMZ.js} +1 -1
  79. package/dist/{generate-headless-2HYMSVN5.js → generate-headless-IWY32HC4.js} +2 -2
  80. package/dist/index.js +12 -12
  81. package/dist/{interactive-bind-Q5TQFQ6N.js → interactive-bind-ZIIJDRBU.js} +2 -2
  82. package/dist/{list-commands-6WDXAECV.js → list-commands-SSXJQGE7.js} +1 -1
  83. package/dist/login-flow-HRS6YACY.js +2 -0
  84. package/dist/{persist-recorded-session-KHIMN4A3.js → persist-recorded-session-3AOYZJT2.js} +1 -1
  85. package/dist/{pipeline-2HRAWT5U.js → pipeline-IZSODNCC.js} +1 -1
  86. package/dist/{reconcile-cmd-DH4VV6PG.js → reconcile-cmd-6HVZJFG3.js} +1 -1
  87. package/dist/{recording-banner-SADVYNEP.js → recording-banner-KKEUWS3N.js} +1 -1
  88. package/dist/{require-project-folder-LP7V26IU.js → require-project-folder-NPTKR2AW.js} +1 -1
  89. package/dist/{run-RT2VMPTQ.js → run-2A7M7EJK.js} +1 -1
  90. package/dist/{run-XAZMT7WO.js → run-6AFY35QW.js} +1 -1
  91. package/dist/{run-test-md-ATB2HZRG.js → run-test-md-QNC6KDMN.js} +2 -2
  92. package/dist/{skill-installer-DE2LSSKU.js → skill-installer-ULFNSE6X.js} +1 -1
  93. package/dist/{spawner-GOTVIFR5.js → spawner-DWONVIPI.js} +1 -1
  94. package/dist/tcg-generate-IHHPRVNG.js +2 -0
  95. package/dist/{testmd-actions-RYQHBX4K.js → testmd-actions-S3ZNOZEK.js} +1 -1
  96. package/dist/token-refresh-CFVOA62N.js +2 -0
  97. package/dist/{validate-basic-6BQ2L7TT.js → validate-basic-4OLDKIA2.js} +1 -1
  98. package/dist/{version-check-YW3FUWDH.js → version-check-UL4S6R4N.js} +1 -1
  99. package/dist/{walk-session-O4TMVORI.js → walk-session-N3BP57HK.js} +1 -1
  100. package/package.json +15 -7
  101. package/bin/kane-cli.js +0 -2
  102. package/dist/SingleShotApp-AJBIWW74.js +0 -2
  103. package/dist/TestMdRunView-5PMLLLFT.js +0 -2
  104. package/dist/chunk-E3BO7OVR.js +0 -7
  105. package/dist/chunk-HJGUEZLW.js +0 -2
  106. package/dist/chunk-IJPFAWBH.js +0 -5
  107. package/dist/login-flow-XQMJFC4H.js +0 -2
  108. package/dist/tcg-generate-7PUXJ5R4.js +0 -2
  109. package/dist/token-refresh-F5KRV7ER.js +0 -2
@@ -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
+ };
@@ -1,5 +1,5 @@
1
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-O66EU5UV.js";import{b as Te,d as Ce}from"./chunk-OB6CKLEL.js";import{a as be}from"./chunk-5Y2G4NC7.js";import{a as Se}from"./chunk-YCCUBQY4.js";import{a as $e}from"./chunk-IRRGSC7B.js";import{b as we}from"./chunk-DFS4RMVP.js";import"./chunk-XUJ5EPVW.js";import{x as s}from"./chunk-HJGUEZLW.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(`
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
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
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
5
  `),d-6,Ye),le=ce?ae.split(`
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{a,b,c}from"./chunk-3WJJ43MT.js";import"./chunk-XUJ5EPVW.js";import"./chunk-HJGUEZLW.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};
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-WT3SMSY5.js";import"./chunk-XUJ5EPVW.js";import"./chunk-HJGUEZLW.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};
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-UZSG54OY.js";import"./chunk-2K4XOHVK.js";import"./chunk-5Y2G4NC7.js";import"./chunk-HJGUEZLW.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};
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-IRRGSC7B.js";import{x as o}from"./chunk-HJGUEZLW.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};
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};
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{a}from"./chunk-AXABTFCD.js";import"./chunk-RFHMDQXZ.js";import"./chunk-QNNBNIR7.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-DNOBOZPO.js";import"./chunk-HJGUEZLW.js";import"./chunk-HCBYKLMW.js";import"./chunk-C44QQJR4.js";import"./chunk-6YGTRKDT.js";import"./chunk-UR6MHSHU.js";export{a as EvidenceViewOffer};
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-STH6I3UB.js";import"./chunk-YCCUBQY4.js";import"./chunk-PICCLJSO.js";import"./chunk-2WVKOZ6W.js";import"./chunk-NLCCBXXV.js";import"./chunk-RZ4F3BHX.js";import"./chunk-DNOBOZPO.js";import"./chunk-XUJ5EPVW.js";import"./chunk-HJGUEZLW.js";import"./chunk-HCBYKLMW.js";import"./chunk-C44QQJR4.js";import"./chunk-6YGTRKDT.js";import"./chunk-UR6MHSHU.js";export{b as FolderPicker,a as formatFolderLine};
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,x as t}from"./chunk-HJGUEZLW.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};
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-POI6DCP6.js";import"./chunk-IRRGSC7B.js";import"./chunk-HJGUEZLW.js";import"./chunk-HCBYKLMW.js";import"./chunk-C44QQJR4.js";import"./chunk-6YGTRKDT.js";import"./chunk-UR6MHSHU.js";export{a as InfoBox};
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-WFEGGQJ4.js";import"./chunk-HJGUEZLW.js";import"./chunk-HCBYKLMW.js";import"./chunk-C44QQJR4.js";import"./chunk-6YGTRKDT.js";import"./chunk-UR6MHSHU.js";export{a as LinksBox};
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-IXVR66NS.js";import"./chunk-XUJ5EPVW.js";import"./chunk-HJGUEZLW.js";import"./chunk-HCBYKLMW.js";import"./chunk-C44QQJR4.js";import"./chunk-6YGTRKDT.js";import"./chunk-UR6MHSHU.js";export{b as ProfilesView,a as formatProfileLine};
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-YMSN25DX.js";import"./chunk-YCCUBQY4.js";import"./chunk-PICCLJSO.js";import"./chunk-2WVKOZ6W.js";import"./chunk-NLCCBXXV.js";import"./chunk-RZ4F3BHX.js";import"./chunk-DNOBOZPO.js";import"./chunk-XUJ5EPVW.js";import"./chunk-HJGUEZLW.js";import"./chunk-HCBYKLMW.js";import"./chunk-C44QQJR4.js";import"./chunk-6YGTRKDT.js";import"./chunk-UR6MHSHU.js";export{b as ProjectPicker,a as formatProjectLine};
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-WE57PD6K.js";import"./chunk-S3DAAAE5.js";import"./chunk-POI6DCP6.js";import"./chunk-IRRGSC7B.js";import"./chunk-HJGUEZLW.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};
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-ZQP3MCZW.js";import"./chunk-POI6DCP6.js";import"./chunk-IRRGSC7B.js";import"./chunk-HJGUEZLW.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};
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-IRRGSC7B.js";import{x as o}from"./chunk-HJGUEZLW.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};
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};
@@ -1,6 +1,6 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{a as p}from"./chunk-BNN6ZDJW.js";import"./chunk-KHU7C6EE.js";import"./chunk-3C5GMAM4.js";import"./chunk-DXK55KGR.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-HJGUEZLW.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+`
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
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
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-Q5TQFQ6N.js");return await o(a)}let{resolveAgentAuthEnv:s}=await import("./spawner-GOTVIFR5.js"),{runAgent:t}=await import("./bridge-LNDJS3HH.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+`
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
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-OLXOZJ7X.js";import"./chunk-CT2I5KUM.js";import"./chunk-UR6MHSHU.js";export{a as runAgent};
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,f as c}from"./chunk-HJGUEZLW.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(`
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{c as L}from"./chunk-RFHMDQXZ.js";import{Q as O,S}from"./chunk-QNNBNIR7.js";import{e as P,f as R}from"./chunk-M5JQXOCE.js";import{x as s}from"./chunk-HJGUEZLW.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};
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-2K4XOHVK.js";import{x as t}from"./chunk-HJGUEZLW.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};
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};
@@ -1,5 +1,5 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{a as U}from"./chunk-GBBVP2JW.js";import{b as F}from"./chunk-ANIVHX3P.js";import{e as P,f as G}from"./chunk-WIA7TPK3.js";import{a as L}from"./chunk-QPZRHAYK.js";import{d as N}from"./chunk-2PQXEEVY.js";import{a as $}from"./chunk-MCQXRJGH.js";import{d as I}from"./chunk-ZG2V2ODK.js";import{d as R,e as x,g as V}from"./chunk-5YPBPZUR.js";function Q(e,s,t,r,n){let a=t.rows.filter(f=>{let g=r.get(f.temp_ref);return g!==void 0&&g!=="reject"});if(a.length===0)return{record:null,errors:null};let o={version:1,read_basis:s.latestHash,source:{source_id:t.source_id,source_cid:s.heads.get(t.source_id)??""},use_cases:a.map(f=>f.uc)},p=new Map;for(let f of a){let g=r.get(f.temp_ref);typeof g=="object"?p.set(f.temp_ref,{resolution:"edited",edit:g.edited}):p.set(f.temp_ref,{resolution:f.uc.matches_existing&&f.uc.changed?"edited":"approved"})}let m=o,i=o.source.source_cid?D(e,s,o.source.source_cid):null;if(i!==null){m=W(o,i);let f=P(m,X(i),s);if(f.length>0)return{record:null,errors:[{code:"HELD_CITES_STALE",detail:"the source moved after this plan staged \u2014 its quotes no longer verify against the current head; re-run kane-cli maintain reconcile to re-stage"},...f]}}let u=`held-${(s.latestHash??"root").slice(-12)}-${a.length}`;return G({contextDir:e,graph:s,proposal:m,proposalId:u,verdicts:p,by:n,autoName:!0})}function X(e){return e.replace(/\n$/,"").split(`
2
+ import{a as U}from"./chunk-GBBVP2JW.js";import{b as F}from"./chunk-JV356AYH.js";import{e as P,f as G}from"./chunk-WIA7TPK3.js";import{a as L}from"./chunk-QPZRHAYK.js";import{d as N}from"./chunk-2PQXEEVY.js";import{a as $}from"./chunk-MCQXRJGH.js";import{d as I}from"./chunk-ZG2V2ODK.js";import{d as R,e as x,g as V}from"./chunk-5YPBPZUR.js";function Q(e,s,t,r,n){let a=t.rows.filter(f=>{let g=r.get(f.temp_ref);return g!==void 0&&g!=="reject"});if(a.length===0)return{record:null,errors:null};let o={version:1,read_basis:s.latestHash,source:{source_id:t.source_id,source_cid:s.heads.get(t.source_id)??""},use_cases:a.map(f=>f.uc)},p=new Map;for(let f of a){let g=r.get(f.temp_ref);typeof g=="object"?p.set(f.temp_ref,{resolution:"edited",edit:g.edited}):p.set(f.temp_ref,{resolution:f.uc.matches_existing&&f.uc.changed?"edited":"approved"})}let m=o,i=o.source.source_cid?D(e,s,o.source.source_cid):null;if(i!==null){m=W(o,i);let f=P(m,X(i),s);if(f.length>0)return{record:null,errors:[{code:"HELD_CITES_STALE",detail:"the source moved after this plan staged \u2014 its quotes no longer verify against the current head; re-run kane-cli maintain reconcile to re-stage"},...f]}}let u=`held-${(s.latestHash??"root").slice(-12)}-${a.length}`;return G({contextDir:e,graph:s,proposal:m,proposalId:u,verdicts:p,by:n,autoName:!0})}function X(e){return e.replace(/\n$/,"").split(`
3
3
  `).map((t,r)=>`${String(r+1).padStart(4,"0")}| ${t}`).join(`
4
4
  `)}function W(e,s){let t=s.replace(/\n$/,""),r=X(s),n=a=>{if(!a?.quote)return a;let o=L(r,a.anchor);if(o!==null&&o.includes(a.quote))return a;let p=t.indexOf(a.quote);if(p===-1||t.indexOf(a.quote,p+1)!==-1)return a;let m=t.slice(0,p).split(`
5
5
  `).length,i=m+a.quote.replace(/\n$/,"").split(`
@@ -9,6 +9,6 @@ import{a as U}from"./chunk-GBBVP2JW.js";import{b as F}from"./chunk-ANIVHX3P.js";
9
9
  `),n=0;for(;n<t.length&&n<r.length&&t[n]===r[n];)n++;let a=t.length,o=r.length;for(;a>n&&o>n&&t[a-1]===r[o-1];)a--,o--;if(a===n&&o===n)return"";let p=t.slice(n,a),m=r.slice(n,o),u=se(p,m,2e3),f=[];if(u===null)f.push(`@@ old L${n+1}-L${a} \u2192 new L${n+1}-L${o} @@`,...p.map(g=>`- ${g}`),...m.map(g=>`+ ${g}`));else{let g=u.map((c,w)=>c.op==="="?-1:w).filter(c=>c>=0),d=0;for(;d<g.length;){let c=d;for(;c+1<g.length&&g[c+1]-g[c]<=3;)c++;let w=Math.max(g[d]-1,0),y=Math.min(g[c]+1,u.length-1),_=u.slice(w,y+1),E=n+(_[0].ai??0)+1,h=n+(_[0].bi??0)+1,l=_.filter(v=>v.op!=="+").length,S=_.filter(v=>v.op!=="-").length;f.push(`@@ old L${E}-L${E+Math.max(l-1,0)} \u2192 new L${h}-L${h+Math.max(S-1,0)} @@`);for(let v of _)f.push(v.op==="="?` ${v.line}`:`${v.op} ${v.line}`);d=c+1}}return f.join(`
10
10
  `)}function se(e,s,t){let r=e.length,n=s.length,a=Math.min(r+n,t),o=new Map([[1,0]]),p=[],m=!1;for(let g=0;g<=a&&!m;g++){p.push(new Map(o));for(let d=-g;d<=g;d+=2){let c=d===-g||d!==g&&(o.get(d-1)??0)<(o.get(d+1)??0)?o.get(d+1)??0:(o.get(d-1)??0)+1,w=c-d;for(;c<r&&w<n&&e[c]===s[w];)c++,w++;if(o.set(d,c),c>=r&&w>=n){m=!0;break}}}if(!m)return null;let i=r,u=n,f=[];for(let g=p.length-1;g>0;g--){let d=p[g],c=i-u,w=c===-g||c!==g&&(d.get(c-1)??0)<(d.get(c+1)??0)?c+1:c-1,y=d.get(w)??0,_=y-w;for(;i>y&&u>_;)f.push({op:"=",line:e[i-1],ai:i-1,bi:u-1}),i--,u--;g>0&&(i===y?(f.push({op:"+",line:s[u-1],ai:i,bi:u-1}),u--):(f.push({op:"-",line:e[i-1],ai:i-1,bi:u}),i--))}for(;i>0&&u>0;)f.push({op:"=",line:e[i-1],ai:i-1,bi:u-1}),i--,u--;for(;i>0;)f.push({op:"-",line:e[i-1],ai:i-1,bi:0}),i--;for(;u>0;)f.push({op:"+",line:s[u-1],ai:0,bi:u-1}),u--;return f.reverse()}function oe(e){let s=Buffer.byteLength(e,"utf8");if(s<=q+K)return{diff:e,truncated:!1};let t=Buffer.from(e,"utf8"),r=q;for(;r>0&&(t[r]&192)===128;)r--;let n=s-K;for(;n<s&&(t[n]&192)===128;)n++;let a=t.subarray(0,r).toString("utf8"),o=t.subarray(n).toString("utf8");return{diff:`${a}
11
11
  \u2026 [diff truncated: ${s-r-(s-n)} bytes omitted] \u2026
12
- ${o}`,truncated:!0}}function re(e,s){let t=$(e),r=t.heads.get(s);if(typeof r!="string")return null;let n=[];for(let d of I(e).records){let c=d.source_head_moves?.[s];c!==void 0&&c!==n[n.length-1]&&n.push(c)}let a=n.lastIndexOf(r),o=a>0?n[a-1]:null;if(typeof o!="string"||o===r)return null;let p=D(e,t,o),m=D(e,t,r);if(p===null||m===null)return null;let{diff:i,truncated:u}=oe(ne(p,m)),f=new Set,g=[];for(let d of t.edgesFrom(o))d.type!==x.DERIVES||t.nodeLabel.get(d.dst)!==R.USECASE||f.has(d.dst)||(f.add(d.dst),g.push({id:d.dst,title:String(t.getNode(d.dst)?.content.title??"")}));return{source_id:s,old_head:o,new_head:r,diff:i,...u?{truncated:!0}:{},prior_ucs:g}}function ie(e,s,t){let r=e.getNode(s)?.content??{},n=e.getNode(t)?.content??{},o=[...new Set([...Object.keys(r),...Object.keys(n)])].sort().filter(p=>JSON.stringify(r[p])!==JSON.stringify(n[p]));return o.length>0?`updated: ${o.join(", ")}`:"updated"}function ce(e,s,t,r,n,a,o){let p=new Set((o?.rows??[]).map(c=>c.matched_cid).filter(c=>!!c)),m=[];for(let[c,w]of t.superseded)w===null||c===w||s.superseded.has(c)||t.nodeLabel.get(c)===R.USECASE&&m.push({kind:"MODIFY",ref:b(t,c),old_cid:c,new_cid:w,summary:ie(t,c,w)});let i=a.map(c=>({kind:"ADD",ref:b(t,c),cid:c}));for(let c of o?.rows??[])c.kind==="MODIFY"&&c.matched_cid?m.push({kind:"MODIFY",ref:b(t,c.matched_cid),old_cid:c.matched_cid,new_cid:null,summary:`${c.why} (staged)`}):c.kind==="ADD"&&i.push({kind:"ADD",ref:c.title,cid:null});let u=[],f=D(e,t,n),g=new Map;for(let{cid:c}of t.byLabel(R.USECASE)){if(!M(t,c)||p.has(c))continue;let w=t.derivesInto(c),y=w.filter(h=>String(h.props.source_id)===r);y.length===0||y.some(h=>h.props.source_cid===n)||f!==null&&y.some(h=>String(h.props.anchor)!=="img#whole"&&te(e,t,h,f,g))||w.some(h=>{let l=String(h.props.source_id);if(l===r)return!1;let S=t.heads.get(l);return S!=null})||u.push({kind:"ARCHIVE",ref:b(t,c),cid:c,why:`evidence decayed: no quote from ${r} relocates into @${O(n)}, no other live source, no fresh evidence this run`,impact:z(t,t.tipOf(c))})}let d=(c,w)=>c.ref<w.ref?-1:c.ref>w.ref?1:0;return[...m.sort(d),...i.sort(d),...u.sort(d)]}function he(e,s,t,r,n){let a=s.rows.find(d=>d.temp_ref===t);if(!a)return{ok:!1,message:`held item ${t} missing from the plan artifact`};let o=a,p=$(e);if(o.matched_cid){let d=p.tipOf(o.matched_cid);if(p.superseded.get(d)===null)return{ok:!1,message:`use-case for "${o.title}" was retired meanwhile \u2014 nothing to update`};d!==o.matched_cid&&(o={...o,matched_cid:d,uc:{...o.uc,matches_existing:{cid:d}}})}let m=n?{edited:n}:"approve",i=Q(e,p,{source_id:s.source_id,rows:[o]},new Map([[o.temp_ref,m]]),r);if(i.errors)return{ok:!1,message:i.errors.map(d=>`${d.code}: ${d.detail}`).join("; ")};let u=$(e),f=o.matched_cid?u.tipOf(o.matched_cid):i.record?.nodes.find(d=>d.label==="usecase")?.cid??i.record?.review[0]?.id;return{ok:!0,ref:f?b(u,f):o.title,kind:o.kind}}async function we(e,s,t,r={}){let n=$(e),a=n.heads.get(s)??null,o=new Set(n.staleList().filter(l=>l.state==="stale").map(l=>l.cid)),p=await t.reingest(s);if(p.status==="unchanged"&&!r.resumeHeld)return{source_id:s,changed:!1,head:{status:p.status,before:a,after:p.cid},note:`nothing to reconcile \u2014 ${s} is unchanged`,skipped_arms:j,changeset:[],rows:[]};let m=r.resumeHeld?{minted:[],matched:[],held:r.resumeHeld}:await t.reextract(s),i=$(e),u=m.minted.map(l=>{let S=b(i,l);return{kind:"ADD",origin:"content-change",ref:S,reason:`new use-case extracted from ${s}`,provenance:`extraction commit \u2014 DERIVES ${s} @ ${O(p.cid)}`,action:`kane-cli design tests --use-case ${S}`}}),f=i.staleList().filter(l=>l.state==="stale"&&!o.has(l.cid)&&M(i,l.cid)).map(l=>l.cid),g=f.map(l=>{let S=b(i,l),v=ee.has(i.nodeLabel.get(l)??"");return{kind:"MODIFY",origin:"structural-stale",ref:S,reason:"stale (structural)",provenance:Y(i,l),action:v?`kane-cli maintain evolve ${S}`:`kane-cli design explain ${S}`}}),d=[],c=[];for(let l of m.held?.rows??[])if(l.kind==="ADD")d.push({kind:"ADD",origin:"content-change",ref:l.title,held_ref:l.temp_ref,reason:`${l.why} (staged \u2014 commits on approval)`,provenance:`staged extraction of ${s} @ ${O(p.cid)}`,action:"approve to commit + design"});else{let S=l.matched_cid?i.tipOf(l.matched_cid):null,v=S?i.getNode(S)?.content.criteria??[]:[],T=(l.uc.updated?.criteria??[]).map(C=>typeof C=="string"?C:C.text),J=[...T.filter(C=>!v.includes(C)),...l.uc.updated?.criteria!==void 0?v.filter(C=>!T.includes(C)):[]],H=S?z(i,S,J):void 0;c.push({kind:"MODIFY",origin:"content-change",ref:l.matched_cid?b(i,l.matched_cid):l.title,held_ref:l.temp_ref,reason:`${l.why} (staged \u2014 commits on approval)`,provenance:`staged extraction of ${s} @ ${O(p.cid)}`,action:"approve to commit the updated version (old\u2192new redirect)",...H?{impact:H}:{}})}let w=new Set;for(let l of[...m.minted,...m.matched])w.add(i.tipOf(l));for(let l of m.held?.rows??[])l.matched_cid&&w.add(i.tipOf(l.matched_cid));for(let l of f){let S=B(i,i.tipOf(l));S&&i.nodeLabel.get(S)===R.USECASE&&w.add(i.tipOf(S))}let y=[];for(let l of await U(i,"design")){if(l.kind!=="no-verifies")continue;let S=i.resolve(l.ref);if(!S)continue;let v=B(i,S.tip);!v||!w.has(i.tipOf(v))||y.push({kind:"ADD",origin:"content-change",ref:l.ref,reason:l.why,provenance:`gaps engine (design) \u2014 uncovered AC of touched use-case ${b(i,v)}`,action:l.ready_command})}let _=[];for(let{cid:l}of i.byLabel(R.USECASE))M(i,l)&&i.stale(l)==="orphaned"&&_.push({kind:"REMOVE",ref:b(i,l),reason:"orphaned \u2014 no live source evidences this use-case",provenance:Y(i,l),action:"plan-only \u2014 REMOVE is not executed in this release"});let E=new Set,h=[...u.sort(k),...d.sort(k),...y.sort(k),...c.sort(k),...g.sort(k),..._.sort(k)].filter(l=>{let S=`${l.kind}\0${l.ref}`;return E.has(S)?!1:(E.add(S),!0)});return{source_id:s,changed:!0,head:{status:p.status,before:a,after:p.cid},note:Z,skipped_arms:j,changeset:ce(e,n,i,s,p.cid,m.minted,m.held),rows:h,...m.held?{held:m.held}:{}}}function _e(e,s){return async t=>{let{ingestFile:r}=await import("./ingest-C5ANIN7S.js"),n=await r({contextDir:e,filePath:s,asId:t});return{status:n.status,cid:n.cid}}}function Se(e,s={}){return async t=>{let r=[],[{runExtract:n},{resolveAgentAuthEnv:a},{runAgent:o},{preflightTurn:p}]=await Promise.all([import("./run-RT2VMPTQ.js"),import("./spawner-GOTVIFR5.js"),import("./bridge-LNDJS3HH.js"),import("./turn-preflight-JGYT7LXP.js")]),m=await a(),i=new Set($(e).byLabel(R.USECASE).map(_=>_.cid)),u=re(e,t)??void 0,f=0,g=await n({mode:"override",...u?{changeContext:u}:{}},{contextDir:e,agent:o,preflightTurn:()=>p(m),ask:async()=>[],review:async _=>{if(!s.stage)return new Map(_.map(h=>[h.temp_ref,{resolution:h.matches_existing&&h.changed?"edited":"skipped"}]));let E=new Map;for(let h of _){if(h.matches_existing&&!h.changed){E.set(h.temp_ref,{resolution:"skipped"});continue}r.push({kind:h.matches_existing?"MODIFY":"ADD",temp_ref:h.temp_ref,title:h.title,why:h.matches_existing?`updated: ${Object.keys(h.updated??{}).join(", ")||"content"}`:`newly extracted from ${t}`,...h.matches_existing?{matched_cid:h.matches_existing.cid,updated:h.updated}:{},uc:h}),E.set(h.temp_ref,{resolution:"rejected"})}return E},confirmStale:async()=>!1,out:_=>process.stderr.write(_+`
12
+ ${o}`,truncated:!0}}function re(e,s){let t=$(e),r=t.heads.get(s);if(typeof r!="string")return null;let n=[];for(let d of I(e).records){let c=d.source_head_moves?.[s];c!==void 0&&c!==n[n.length-1]&&n.push(c)}let a=n.lastIndexOf(r),o=a>0?n[a-1]:null;if(typeof o!="string"||o===r)return null;let p=D(e,t,o),m=D(e,t,r);if(p===null||m===null)return null;let{diff:i,truncated:u}=oe(ne(p,m)),f=new Set,g=[];for(let d of t.edgesFrom(o))d.type!==x.DERIVES||t.nodeLabel.get(d.dst)!==R.USECASE||f.has(d.dst)||(f.add(d.dst),g.push({id:d.dst,title:String(t.getNode(d.dst)?.content.title??"")}));return{source_id:s,old_head:o,new_head:r,diff:i,...u?{truncated:!0}:{},prior_ucs:g}}function ie(e,s,t){let r=e.getNode(s)?.content??{},n=e.getNode(t)?.content??{},o=[...new Set([...Object.keys(r),...Object.keys(n)])].sort().filter(p=>JSON.stringify(r[p])!==JSON.stringify(n[p]));return o.length>0?`updated: ${o.join(", ")}`:"updated"}function ce(e,s,t,r,n,a,o){let p=new Set((o?.rows??[]).map(c=>c.matched_cid).filter(c=>!!c)),m=[];for(let[c,w]of t.superseded)w===null||c===w||s.superseded.has(c)||t.nodeLabel.get(c)===R.USECASE&&m.push({kind:"MODIFY",ref:b(t,c),old_cid:c,new_cid:w,summary:ie(t,c,w)});let i=a.map(c=>({kind:"ADD",ref:b(t,c),cid:c}));for(let c of o?.rows??[])c.kind==="MODIFY"&&c.matched_cid?m.push({kind:"MODIFY",ref:b(t,c.matched_cid),old_cid:c.matched_cid,new_cid:null,summary:`${c.why} (staged)`}):c.kind==="ADD"&&i.push({kind:"ADD",ref:c.title,cid:null});let u=[],f=D(e,t,n),g=new Map;for(let{cid:c}of t.byLabel(R.USECASE)){if(!M(t,c)||p.has(c))continue;let w=t.derivesInto(c),y=w.filter(h=>String(h.props.source_id)===r);y.length===0||y.some(h=>h.props.source_cid===n)||f!==null&&y.some(h=>String(h.props.anchor)!=="img#whole"&&te(e,t,h,f,g))||w.some(h=>{let l=String(h.props.source_id);if(l===r)return!1;let S=t.heads.get(l);return S!=null})||u.push({kind:"ARCHIVE",ref:b(t,c),cid:c,why:`evidence decayed: no quote from ${r} relocates into @${O(n)}, no other live source, no fresh evidence this run`,impact:z(t,t.tipOf(c))})}let d=(c,w)=>c.ref<w.ref?-1:c.ref>w.ref?1:0;return[...m.sort(d),...i.sort(d),...u.sort(d)]}function he(e,s,t,r,n){let a=s.rows.find(d=>d.temp_ref===t);if(!a)return{ok:!1,message:`held item ${t} missing from the plan artifact`};let o=a,p=$(e);if(o.matched_cid){let d=p.tipOf(o.matched_cid);if(p.superseded.get(d)===null)return{ok:!1,message:`use-case for "${o.title}" was retired meanwhile \u2014 nothing to update`};d!==o.matched_cid&&(o={...o,matched_cid:d,uc:{...o.uc,matches_existing:{cid:d}}})}let m=n?{edited:n}:"approve",i=Q(e,p,{source_id:s.source_id,rows:[o]},new Map([[o.temp_ref,m]]),r);if(i.errors)return{ok:!1,message:i.errors.map(d=>`${d.code}: ${d.detail}`).join("; ")};let u=$(e),f=o.matched_cid?u.tipOf(o.matched_cid):i.record?.nodes.find(d=>d.label==="usecase")?.cid??i.record?.review[0]?.id;return{ok:!0,ref:f?b(u,f):o.title,kind:o.kind}}async function we(e,s,t,r={}){let n=$(e),a=n.heads.get(s)??null,o=new Set(n.staleList().filter(l=>l.state==="stale").map(l=>l.cid)),p=await t.reingest(s);if(p.status==="unchanged"&&!r.resumeHeld)return{source_id:s,changed:!1,head:{status:p.status,before:a,after:p.cid},note:`nothing to reconcile \u2014 ${s} is unchanged`,skipped_arms:j,changeset:[],rows:[]};let m=r.resumeHeld?{minted:[],matched:[],held:r.resumeHeld}:await t.reextract(s),i=$(e),u=m.minted.map(l=>{let S=b(i,l);return{kind:"ADD",origin:"content-change",ref:S,reason:`new use-case extracted from ${s}`,provenance:`extraction commit \u2014 DERIVES ${s} @ ${O(p.cid)}`,action:`kane-cli design tests --use-case ${S}`}}),f=i.staleList().filter(l=>l.state==="stale"&&!o.has(l.cid)&&M(i,l.cid)).map(l=>l.cid),g=f.map(l=>{let S=b(i,l),v=ee.has(i.nodeLabel.get(l)??"");return{kind:"MODIFY",origin:"structural-stale",ref:S,reason:"stale (structural)",provenance:Y(i,l),action:v?`kane-cli maintain evolve ${S}`:`kane-cli design explain ${S}`}}),d=[],c=[];for(let l of m.held?.rows??[])if(l.kind==="ADD")d.push({kind:"ADD",origin:"content-change",ref:l.title,held_ref:l.temp_ref,reason:`${l.why} (staged \u2014 commits on approval)`,provenance:`staged extraction of ${s} @ ${O(p.cid)}`,action:"approve to commit + design"});else{let S=l.matched_cid?i.tipOf(l.matched_cid):null,v=S?i.getNode(S)?.content.criteria??[]:[],T=(l.uc.updated?.criteria??[]).map(C=>typeof C=="string"?C:C.text),J=[...T.filter(C=>!v.includes(C)),...l.uc.updated?.criteria!==void 0?v.filter(C=>!T.includes(C)):[]],H=S?z(i,S,J):void 0;c.push({kind:"MODIFY",origin:"content-change",ref:l.matched_cid?b(i,l.matched_cid):l.title,held_ref:l.temp_ref,reason:`${l.why} (staged \u2014 commits on approval)`,provenance:`staged extraction of ${s} @ ${O(p.cid)}`,action:"approve to commit the updated version (old\u2192new redirect)",...H?{impact:H}:{}})}let w=new Set;for(let l of[...m.minted,...m.matched])w.add(i.tipOf(l));for(let l of m.held?.rows??[])l.matched_cid&&w.add(i.tipOf(l.matched_cid));for(let l of f){let S=B(i,i.tipOf(l));S&&i.nodeLabel.get(S)===R.USECASE&&w.add(i.tipOf(S))}let y=[];for(let l of await U(i,"design")){if(l.kind!=="no-verifies")continue;let S=i.resolve(l.ref);if(!S)continue;let v=B(i,S.tip);!v||!w.has(i.tipOf(v))||y.push({kind:"ADD",origin:"content-change",ref:l.ref,reason:l.why,provenance:`gaps engine (design) \u2014 uncovered AC of touched use-case ${b(i,v)}`,action:l.ready_command})}let _=[];for(let{cid:l}of i.byLabel(R.USECASE))M(i,l)&&i.stale(l)==="orphaned"&&_.push({kind:"REMOVE",ref:b(i,l),reason:"orphaned \u2014 no live source evidences this use-case",provenance:Y(i,l),action:"plan-only \u2014 REMOVE is not executed in this release"});let E=new Set,h=[...u.sort(k),...d.sort(k),...y.sort(k),...c.sort(k),...g.sort(k),..._.sort(k)].filter(l=>{let S=`${l.kind}\0${l.ref}`;return E.has(S)?!1:(E.add(S),!0)});return{source_id:s,changed:!0,head:{status:p.status,before:a,after:p.cid},note:Z,skipped_arms:j,changeset:ce(e,n,i,s,p.cid,m.minted,m.held),rows:h,...m.held?{held:m.held}:{}}}function _e(e,s){return async t=>{let{ingestFile:r}=await import("./ingest-C5ANIN7S.js"),n=await r({contextDir:e,filePath:s,asId:t});return{status:n.status,cid:n.cid}}}function Se(e,s={}){return async t=>{let r=[],[{runExtract:n},{resolveAgentAuthEnv:a},{runAgent:o},{preflightTurn:p}]=await Promise.all([import("./run-2A7M7EJK.js"),import("./spawner-DWONVIPI.js"),import("./bridge-PDJEOSAJ.js"),import("./turn-preflight-JGYT7LXP.js")]),m=await a(),i=new Set($(e).byLabel(R.USECASE).map(_=>_.cid)),u=re(e,t)??void 0,f=0,g=await n({mode:"override",...u?{changeContext:u}:{}},{contextDir:e,agent:o,preflightTurn:()=>p(m),ask:async()=>[],review:async _=>{if(!s.stage)return new Map(_.map(h=>[h.temp_ref,{resolution:h.matches_existing&&h.changed?"edited":"skipped"}]));let E=new Map;for(let h of _){if(h.matches_existing&&!h.changed){E.set(h.temp_ref,{resolution:"skipped"});continue}r.push({kind:h.matches_existing?"MODIFY":"ADD",temp_ref:h.temp_ref,title:h.title,why:h.matches_existing?`updated: ${Object.keys(h.updated??{}).join(", ")||"content"}`:`newly extracted from ${t}`,...h.matches_existing?{matched_cid:h.matches_existing.cid,updated:h.updated}:{},uc:h}),E.set(h.temp_ref,{resolution:"rejected"})}return E},confirmStale:async()=>!1,out:_=>process.stderr.write(_+`
13
13
  `),progress:_=>process.stderr.write(_+`
14
14
  `),emit:_=>{_.type==="commit"&&typeof _.assumed=="number"&&(f+=_.assumed)},isTTY:!1,auth:m});if(g!==0)throw new Error(`reconcile: re-extract of ${t} failed (exit ${g})`);let d=$(e),c=d.heads.get(t),w=[],y=[];if(typeof c=="string"){let _=new Set;for(let E of d.edgesFrom(c))E.type!==x.DERIVES||d.nodeLabel.get(E.dst)!==R.USECASE||_.has(E.dst)||(_.add(E.dst),!(s.stage&&d.trust.get(E.dst)==="archived")&&(i.has(E.dst)?y:w).push(E.dst))}return{minted:w,matched:y,defaultsTaken:f,...s.stage?{held:{source_id:t,rows:r}}:{}}}}export{he as a,we as b,_e as c,Se as d};
@@ -1,5 +1,5 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{a as m}from"./chunk-2WVKOZ6W.js";import{a as g}from"./chunk-DNOBOZPO.js";import{b as f,c as j}from"./chunk-VE3SUJMA.js";var _="KaneAI Generated",E="Untitled";async function p(e){let r=e.config.load(),d=new m(g(e.env).tmsBaseUrl,e.tmsCreds.username,e.tmsCreds.access_key),n=e.projectName??_,o=e.folderName??E,t=r.project_id??null,s=r.project_name??null;if(!t){let a=(await d.listProjects()).find(l=>l.name===n);if(a)t=a.project_id,s=a.name,e.log("info","ENSURE_PROJECT_FOUND","Found default project",{project_id:t,name:s});else{let l=await d.createProject(n);t=l.id,s=l.name,e.log("info","ENSURE_PROJECT_CREATED","Created default project",{project_id:t,name:s})}f(e.creds,e.config,e.profile,e.env,{projectId:t,projectName:s})}let c=r.folder_id??null,i=r.folder_name??null,u=!r.project_id;if(!c||u){let a=(await d.listFolders(t)).find(l=>l.name===o);if(a)c=a.id,i=a.name,e.log("info","ENSURE_FOLDER_FOUND","Found default folder",{folder_id:c,name:i});else{let l=await d.createFolder(t,o);c=l.id,i=l.name,e.log("info","ENSURE_FOLDER_CREATED","Created default folder",{folder_id:c,name:i})}f(e.creds,e.config,e.profile,e.env,{folderId:c,folderName:i})}return{projectId:t,projectName:s??n,folderId:c,folderName:i??o}}function A(e,r,d){let n=e.loadProfileConfig(r,d)??{};return{projectId:n.project_id??null,folderId:n.folder_id??null}}function N(e,r){return e.projectId===null||e.folderId===null||r===null?"needs-picker":r.project==="ok"&&r.folder==="ok"?"ok":r.project==="error"&&r.folder==="error"?"ok-tms-degraded":"needs-picker"}var k=(e,r)=>`error: profile "${e}" (${r}) has no project/folder configured AND no TMS credentials were available to auto-configure one.
2
+ import{a as m}from"./chunk-2WVKOZ6W.js";import{a as g}from"./chunk-AKHUNBQS.js";import{b as f,c as j}from"./chunk-VE3SUJMA.js";var _="KaneAI Generated",E="Untitled";async function p(e){let r=e.config.load(),d=new m(g(e.env).tmsBaseUrl,e.tmsCreds.username,e.tmsCreds.access_key),n=e.projectName??_,o=e.folderName??E,t=r.project_id??null,s=r.project_name??null;if(!t){let a=(await d.listProjects()).find(l=>l.name===n);if(a)t=a.project_id,s=a.name,e.log("info","ENSURE_PROJECT_FOUND","Found default project",{project_id:t,name:s});else{let l=await d.createProject(n);t=l.id,s=l.name,e.log("info","ENSURE_PROJECT_CREATED","Created default project",{project_id:t,name:s})}f(e.creds,e.config,e.profile,e.env,{projectId:t,projectName:s})}let c=r.folder_id??null,i=r.folder_name??null,u=!r.project_id;if(!c||u){let a=(await d.listFolders(t)).find(l=>l.name===o);if(a)c=a.id,i=a.name,e.log("info","ENSURE_FOLDER_FOUND","Found default folder",{folder_id:c,name:i});else{let l=await d.createFolder(t,o);c=l.id,i=l.name,e.log("info","ENSURE_FOLDER_CREATED","Created default folder",{folder_id:c,name:i})}f(e.creds,e.config,e.profile,e.env,{folderId:c,folderName:i})}return{projectId:t,projectName:s??n,folderId:c,folderName:i??o}}function A(e,r,d){let n=e.loadProfileConfig(r,d)??{};return{projectId:n.project_id??null,folderId:n.folder_id??null}}function N(e,r){return e.projectId===null||e.folderId===null||r===null?"needs-picker":r.project==="ok"&&r.folder==="ok"?"ok":r.project==="error"&&r.folder==="error"?"ok-tms-degraded":"needs-picker"}var k=(e,r)=>`error: profile "${e}" (${r}) has no project/folder configured AND no TMS credentials were available to auto-configure one.
3
3
 
4
4
  discover IDs:
5
5
  kane-cli projects list --search "<keyword>" --limit 10
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{a}from"./chunk-5Y2G4NC7.js";import{x as o}from"./chunk-HJGUEZLW.js";import{a as n}from"./chunk-HCBYKLMW.js";import{b as t}from"./chunk-C44QQJR4.js";import{a as s}from"./chunk-6YGTRKDT.js";import{e as r}from"./chunk-UR6MHSHU.js";var l=r(s(),1);var m=r(n(),1),i=["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"];function b({active:e=!0}){let[p,c]=(0,l.useState)(0);return a(()=>{c(f=>(f+1)%i.length)},e?80:null),(0,m.jsx)(t,{color:o.orange,children:e?i[p]:"\u25CF"})}export{b as a};
2
+ import{a}from"./chunk-5Y2G4NC7.js";import{y as o}from"./chunk-6SGPN76K.js";import{a as n}from"./chunk-HCBYKLMW.js";import{b as t}from"./chunk-C44QQJR4.js";import{a as s}from"./chunk-6YGTRKDT.js";import{e as r}from"./chunk-UR6MHSHU.js";var l=r(s(),1);var m=r(n(),1),i=["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"];function b({active:e=!0}){let[p,c]=(0,l.useState)(0);return a(()=>{c(f=>(f+1)%i.length)},e?80:null),(0,m.jsx)(t,{color:o.orange,children:e?i[p]:"\u25CF"})}export{b 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-MVF4KRHA.js";import{a as h}from"./chunk-FPFOW6BS.js";import{a as m}from"./chunk-DNOBOZPO.js";var o=class extends Error{constructor(a,l){super(a);this.code=l;this.name="AuthError"}};async function k(c){let{creds:i,env:a,usernameFlag:l,accessKeyFlag:p,log:t}=c,e=null,u=null;if(l&&p)e={username:l,access_key:p},t("info","AUTH_RESOLVE_FLAGS","Auth resolved via CLI flags",{username:l});else{let r=i.resolveAuth();r?.method==="basic"&&(e={username:r.username,access_key:r.access_key},t("info","AUTH_RESOLVE_CONFIG","Auth resolved via config",{username:r.username}))}if(!e){let{credentials:r,profile:E}=i.getActiveCredentials();if(!r)throw new o("Not authenticated \u2014 no credentials found","not_authenticated");if(u=r.access_token,r.expires_at-Date.now()/1e3<300)try{let n=await f({creds:i,profile:E,env:a,credentials:r});n&&(u=n.accessToken,t("info","AUTH_TOKEN_REFRESHED","OAuth token refreshed"))}catch(n){let d=n instanceof Error?n.message:String(n);throw t("error","TOKEN_REFRESH_FAILED","Token refresh failed",{error:d}),new o(`Token refresh failed: ${d}`,"refresh_failed")}}let v=m(a),b=async()=>u,y=e?{username:e.username,access_key:e.access_key}:null,g=new h(v.controllerBaseUrl,b,y,t),s=await g.resolve();return s&&!e&&(e={username:s.username,access_key:s.access_key},t("info","AUTH_RESOLVE_CONTROLLER","Auth resolved via controller",{username:s.username})),{basicAuth:e,token:u,resolver:g,resolvedCreds:s}}export{o as a,k as b};
2
+ import{a as f}from"./chunk-EOLQUB4Q.js";import{a as h}from"./chunk-FPFOW6BS.js";import{a as m}from"./chunk-AKHUNBQS.js";var o=class extends Error{constructor(a,l){super(a);this.code=l;this.name="AuthError"}};async function k(c){let{creds:i,env:a,usernameFlag:l,accessKeyFlag:p,log:t}=c,e=null,u=null;if(l&&p)e={username:l,access_key:p},t("info","AUTH_RESOLVE_FLAGS","Auth resolved via CLI flags",{username:l});else{let r=i.resolveAuth();r?.method==="basic"&&(e={username:r.username,access_key:r.access_key},t("info","AUTH_RESOLVE_CONFIG","Auth resolved via config",{username:r.username}))}if(!e){let{credentials:r,profile:E}=i.getActiveCredentials();if(!r)throw new o("Not authenticated \u2014 no credentials found","not_authenticated");if(u=r.access_token,r.expires_at-Date.now()/1e3<300)try{let n=await f({creds:i,profile:E,env:a,credentials:r});n&&(u=n.accessToken,t("info","AUTH_TOKEN_REFRESHED","OAuth token refreshed"))}catch(n){let d=n instanceof Error?n.message:String(n);throw t("error","TOKEN_REFRESH_FAILED","Token refresh failed",{error:d}),new o(`Token refresh failed: ${d}`,"refresh_failed")}}let v=m(a),b=async()=>u,y=e?{username:e.username,access_key:e.access_key}:null,g=new h(v.controllerBaseUrl,b,y,t),s=await g.resolve();return s&&!e&&(e={username:s.username,access_key:s.access_key},t("info","AUTH_RESOLVE_CONTROLLER","Auth resolved via controller",{username:s.username})),{basicAuth:e,token:u,resolver:g,resolvedCreds:s}}export{o as a,k as b};
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{x as o}from"./chunk-HJGUEZLW.js";import{a as m}from"./chunk-HCBYKLMW.js";import{a as e,b as i}from"./chunk-C44QQJR4.js";import{e as d}from"./chunk-UR6MHSHU.js";var r=d(m(),1),s={default:o.muted,error:o.red,success:o.green,info:o.orange,warning:o.orange};function h({title:t,titleColor:a,borderColor:l,variant:n="default",children:c,width:u,paddingX:x=2,paddingY:g=0,marginBottom:f=0}){let p=l??s[n],B=a??(n==="default"?o.orange:s[n]);return(0,r.jsxs)(e,{flexDirection:"column",marginBottom:f,children:[t&&(0,r.jsx)(e,{marginBottom:0,children:(0,r.jsxs)(i,{color:B,bold:!0,children:[" ",t]})}),(0,r.jsx)(e,{borderStyle:"round",borderColor:p,flexDirection:"column",paddingX:x,paddingY:g,width:u,children:c})]})}function k({label:t,value:a,labelColor:l=o.dim,valueColor:n,labelWidth:c=14}){return(0,r.jsxs)(e,{children:[(0,r.jsx)(e,{width:c,flexShrink:0,children:(0,r.jsx)(i,{color:l,children:t})}),(0,r.jsx)(e,{flexShrink:1,children:(0,r.jsx)(i,{color:n,wrap:"wrap",children:a})})]})}function I({label:t}){return(0,r.jsx)(e,{marginTop:1,marginBottom:0,children:(0,r.jsx)(i,{bold:!0,children:t})})}export{h as a,k as b,I as c};
2
+ import{y as o}from"./chunk-6SGPN76K.js";import{a as m}from"./chunk-HCBYKLMW.js";import{a as e,b as i}from"./chunk-C44QQJR4.js";import{e as d}from"./chunk-UR6MHSHU.js";var r=d(m(),1),s={default:o.muted,error:o.red,success:o.green,info:o.orange,warning:o.orange};function h({title:t,titleColor:a,borderColor:l,variant:n="default",children:c,width:u,paddingX:x=2,paddingY:g=0,marginBottom:f=0}){let p=l??s[n],B=a??(n==="default"?o.orange:s[n]);return(0,r.jsxs)(e,{flexDirection:"column",marginBottom:f,children:[t&&(0,r.jsx)(e,{marginBottom:0,children:(0,r.jsxs)(i,{color:B,bold:!0,children:[" ",t]})}),(0,r.jsx)(e,{borderStyle:"round",borderColor:p,flexDirection:"column",paddingX:x,paddingY:g,width:u,children:c})]})}function k({label:t,value:a,labelColor:l=o.dim,valueColor:n,labelWidth:c=14}){return(0,r.jsxs)(e,{children:[(0,r.jsx)(e,{width:c,flexShrink:0,children:(0,r.jsx)(i,{color:l,children:t})}),(0,r.jsx)(e,{flexShrink:1,children:(0,r.jsx)(i,{color:n,wrap:"wrap",children:a})})]})}function I({label:t}){return(0,r.jsx)(e,{marginTop:1,marginBottom:0,children:(0,r.jsx)(i,{bold:!0,children:t})})}export{h as a,k as b,I as c};