@testmuai/kane-cli 0.7.2 → 0.8.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ChatSurface-B3ULYDYC.js +8 -0
- package/dist/{ChromeProfilePicker-DGDWGCZD.js → ChromeProfilePicker-T77E7ZSC.js} +1 -1
- package/dist/{CliFeedbackPrompt-SYCZXSME.js → CliFeedbackPrompt-FQ2XV5DZ.js} +1 -1
- package/dist/{CliUploadProgress-VDEAKXJY.js → CliUploadProgress-TZ55LONO.js} +1 -1
- package/dist/ConfigView-WWQMH36G.js +2 -0
- package/dist/EvidenceViewOffer-L5FVBQNK.js +2 -0
- package/dist/FolderPicker-6Z3CYSHF.js +2 -0
- package/dist/{HelpView-ON6BFGJM.js → HelpView-XXPCPJNF.js} +1 -1
- package/dist/{InfoBox-B23NZ6IG.js → InfoBox-SHBRHQX5.js} +1 -1
- package/dist/{LinksBox-TI26VFFH.js → LinksBox-ENNF7TDJ.js} +1 -1
- package/dist/{ProfilesView-CRO5AH3H.js → ProfilesView-CNF2FXF3.js} +1 -1
- package/dist/{ProjectPicker-3N7LJOXU.js → ProjectPicker-PVPLS642.js} +1 -1
- package/dist/{SaveSessionPrompt-UTOEC5AW.js → SaveSessionPrompt-4QP4GNGO.js} +1 -1
- package/dist/SingleShotApp-M3HNSUMZ.js +2 -0
- package/dist/{SummaryBox-JK64EKC2.js → SummaryBox-HYNINDNN.js} +1 -1
- package/dist/TestMdRunView-ISOVQ7YP.js +2 -0
- package/dist/{WhoamiView-6QSLPNF6.js → WhoamiView-NN2HOK6H.js} +1 -1
- package/dist/adbkit-apkreader-ORZBGCJQ.js +184 -0
- package/dist/app-client-ZCCNE3RV.js +2 -0
- package/dist/app-download-5UJMXPF3.js +2 -0
- package/dist/{auth-IKFVW3NX.js → auth-QKBTOWQX.js} +1 -1
- package/dist/{bind-KCUSVJXG.js → bind-LVGP5KHO.js} +3 -3
- package/dist/{bootstrap-NFYYRGGR.js → bootstrap-RUJBMB2P.js} +1 -1
- package/dist/bridge-QDPBIIOW.js +2 -0
- package/dist/{changelog-AAH2ZBYO.js → changelog-HBPBPR2O.js} +1 -1
- package/dist/{chat-committer-UUC6JTRJ.js → chat-committer-ZWWCLJFD.js} +1 -1
- package/dist/{chat-controller-T2FAI55V.js → chat-controller-R4THYYPU.js} +1 -1
- package/dist/chunk-2E3ZWGIK.js +12 -0
- package/dist/chunk-2KH2JUGL.js +13 -0
- package/dist/{chunk-VWKVUOXU.js → chunk-2TYCUPCN.js} +1 -1
- package/dist/{chunk-GYNTNKNB.js → chunk-2ZZDNPFN.js} +1 -1
- package/dist/chunk-3654GK6O.js +66 -0
- package/dist/{chunk-M6FKJKC6.js → chunk-3NHO5R4P.js} +3 -3
- package/dist/{chunk-SFII7HPP.js → chunk-4II6VDXG.js} +1 -1
- package/dist/chunk-4J6DQFPC.js +4 -0
- package/dist/chunk-4JOD47QI.js +2 -0
- package/dist/{chunk-5FJJJNJK.js → chunk-4U4OSOA4.js} +1 -1
- package/dist/{chunk-QIGPXYMF.js → chunk-56PAQAX5.js} +6 -6
- package/dist/chunk-5NIYYD7O.js +2 -0
- package/dist/chunk-5SNT2MK5.js +2 -0
- package/dist/chunk-6IA6QMPH.js +2 -0
- package/dist/chunk-6J5T5FEY.js +2 -0
- package/dist/chunk-6N726QLP.js +349 -0
- package/dist/chunk-7F2ZV46B.js +2 -0
- package/dist/{chunk-7OYZR6JA.js → chunk-7S3JZ6FQ.js} +1 -1
- package/dist/chunk-A2SQD2AY.js +4 -0
- package/dist/chunk-AJQT4IWZ.js +2 -0
- package/dist/chunk-AN2ZPHCE.js +2 -0
- package/dist/{chunk-7QJ75SYR.js → chunk-ATGRRKEV.js} +2 -2
- package/dist/chunk-AXTPNZPX.js +2 -0
- package/dist/{chunk-ZRASQ63J.js → chunk-BKVDAZEJ.js} +1 -1
- package/dist/{chunk-2WVKOZ6W.js → chunk-BPMSNGXQ.js} +1 -1
- package/dist/chunk-BRIEBB2U.js +2 -0
- package/dist/chunk-BSYX225I.js +2 -0
- package/dist/{chunk-B5RS2XZU.js → chunk-CAMO26QU.js} +3 -3
- package/dist/chunk-DPUV6OSP.js +2 -0
- package/dist/chunk-ECZMYPLJ.js +19 -0
- package/dist/chunk-EYOCNMUM.js +2 -0
- package/dist/{chunk-DZPGG4S6.js → chunk-FNS2EAA5.js} +2 -2
- package/dist/{chunk-VMM4LC4V.js → chunk-GNIFMQNK.js} +3 -3
- package/dist/chunk-GUVM6SZF.js +2 -0
- package/dist/{chunk-ZBOWFJB2.js → chunk-HFFPPCZO.js} +2 -2
- package/dist/chunk-HRZOFTV7.js +4 -0
- package/dist/chunk-HWH3UYD6.js +4 -0
- package/dist/{chunk-JKM2PUHI.js → chunk-I7RQS65W.js} +1 -1
- package/dist/chunk-IUEEFGEW.js +11 -0
- package/dist/{chunk-KWIK22R6.js → chunk-IV76ZXCY.js} +1 -1
- package/dist/{chunk-HYSFJSIG.js → chunk-IZ2FJYHG.js} +1 -1
- package/dist/{chunk-4NFCAGRK.js → chunk-J7KT44IC.js} +1 -1
- package/dist/{chunk-VOOPWFHW.js → chunk-JEDLXUO5.js} +1 -1
- package/dist/chunk-JGOZUAMC.js +2 -0
- package/dist/{chunk-4LTXE3IX.js → chunk-JHKM7W5X.js} +1 -1
- package/dist/chunk-JJN76EXE.js +2 -0
- package/dist/{chunk-EOLFTMWF.js → chunk-JUVQQP42.js} +1 -1
- package/dist/chunk-KKRNTSLL.js +6 -0
- package/dist/chunk-KRKGZ2ZW.js +47 -0
- package/dist/{chunk-YTHQNN2L.js → chunk-LDCLZR2U.js} +1 -1
- package/dist/chunk-LQQXPY5B.js +4 -0
- package/dist/{chunk-UC7MNPIN.js → chunk-LVCY5IYI.js} +1 -1
- package/dist/{chunk-O75ZHGJG.js → chunk-LVN6VHFN.js} +1 -1
- package/dist/chunk-MMBBQ4OZ.js +2 -0
- package/dist/chunk-MSGW4JDG.js +2 -0
- package/dist/{chunk-VLWMMOMF.js → chunk-MTIC65NK.js} +1 -1
- package/dist/chunk-NHBYZCSX.js +4 -0
- package/dist/chunk-NRUD56FY.js +7 -0
- package/dist/chunk-NXFAEDHV.js +26 -0
- package/dist/{chunk-OIYGGEUL.js → chunk-NXXJ56QA.js} +1 -1
- package/dist/{chunk-AXTGYOMK.js → chunk-O3AHFP3K.js} +1 -1
- package/dist/chunk-OAVPM6YJ.js +2 -0
- package/dist/{chunk-FBHRBFHP.js → chunk-OJTCIZDK.js} +1 -1
- package/dist/{chunk-JPWLGHPM.js → chunk-OOEPLMKA.js} +1 -1
- package/dist/{chunk-VT54ARGE.js → chunk-PXCMEI73.js} +1 -1
- package/dist/{chunk-APPYQZFK.js → chunk-R4UCBA5R.js} +1 -1
- package/dist/chunk-RKXHVP2Z.js +2 -0
- package/dist/{chunk-AJ56AMT6.js → chunk-RN4PKQFR.js} +1 -1
- package/dist/chunk-RUCSRS4C.js +5 -0
- package/dist/chunk-TAOHYWEO.js +2 -0
- package/dist/chunk-TZXXJWHA.js +2 -0
- package/dist/{chunk-VRLUNZAK.js → chunk-U5GHOGLM.js} +1 -1
- package/dist/chunk-UJZZDPDY.js +2 -0
- package/dist/{chunk-VHZ4S57N.js → chunk-UODLRQQ4.js} +1 -1
- package/dist/chunk-VK3NU742.js +21 -0
- package/dist/{chunk-FDIPQRX4.js → chunk-VPRNGWIY.js} +1 -1
- package/dist/{chunk-RDNFVZEB.js → chunk-WOEQDUJ6.js} +1 -1
- package/dist/chunk-WQPQNL4S.js +2 -0
- package/dist/{chunk-SL6PCVM2.js → chunk-WV27D55O.js} +1 -1
- package/dist/{chunk-2WFZIQ62.js → chunk-WVCH66YH.js} +1 -1
- package/dist/{chunk-PLOWZLG5.js → chunk-YCLG3T5E.js} +2 -2
- package/dist/chunk-YGMC3FGJ.js +26 -0
- package/dist/{chunk-5SXMV66P.js → chunk-YHYTCENI.js} +1 -1
- package/dist/{chunk-KQZA2QSC.js → chunk-YSSYT5F5.js} +1 -1
- package/dist/{chunk-OR6MCL6Z.js → chunk-YTDSQAYN.js} +1 -1
- package/dist/{chunk-XUS4WKDS.js → chunk-ZEDAPY7M.js} +1 -1
- package/dist/{chunk-F7ISS545.js → chunk-ZGBSGZZM.js} +1 -1
- package/dist/chunk-ZI6UIJUN.js +11 -0
- package/dist/{config-CWZV6XPT.js → config-RLDXM5ZH.js} +1 -1
- package/dist/{controller-client-RD2YEMAH.js → controller-client-OB4WD2C4.js} +1 -1
- package/dist/{cover-cmd-NWIRJY5Z.js → cover-cmd-HDZZWJXG.js} +1 -1
- package/dist/{credentials-YHTJGKEO.js → credentials-CALNKQMN.js} +1 -1
- package/dist/deps-bundle-GVHIMZ5E.js +2 -0
- package/dist/deps-resolve-T6P4EACP.js +2 -0
- package/dist/{dispatch-WVNXB7AD.js → dispatch-ECUEAMXS.js} +1 -1
- package/dist/doctor-SIBHJVGC.js +2 -0
- package/dist/docx-convert-JMUMT5C4.js +2 -0
- package/dist/evidence-ZVQHPELX.js +2 -0
- package/dist/evolve-cmd-JGCFTXWA.js +2 -0
- package/dist/exec-P2IKJRRR.js +2 -0
- package/dist/exit-manager-3FVBTNYR.js +2 -0
- package/dist/{explain-cmd-IZEHWZV5.js → explain-cmd-3GEKR7O5.js} +1 -1
- package/dist/{explain-cmd-75MCF2ZV.js → explain-cmd-EX24XKD6.js} +1 -1
- package/dist/extract-bind-EXW32RUY.js +10 -0
- package/dist/{extract-cmd-ZRYMJ6IC.js → extract-cmd-7IOLJJCL.js} +2 -2
- package/dist/gaps-cmd-WPCJPLGB.js +3 -0
- package/dist/{generate-headless-D6BISWDC.js → generate-headless-U4GTG234.js} +3 -3
- package/dist/host-7GZPBA74.js +2 -0
- package/dist/index.js +84 -67
- package/dist/ingest-cmd-YYNAKI2U.js +2 -0
- package/dist/interactive-bind-Y65XV4Y5.js +25 -0
- package/dist/{lifecycle-cmd-EQSFAZG6.js → lifecycle-cmd-HO5VL7AM.js} +1 -1
- package/dist/{list-cmd-IRJSUCM5.js → list-cmd-N4KMA34H.js} +1 -1
- package/dist/list-commands-3EROWJWV.js +2 -0
- package/dist/login-flow-TRINUSBB.js +2 -0
- package/dist/{maintenance-cmd-MVFA6H74.js → maintenance-cmd-6XSVO6FO.js} +1 -1
- package/dist/mobile-prompts-TP3ODM5M.js +2 -0
- package/dist/persist-recorded-session-EHYT3PVN.js +3 -0
- package/dist/pipeline-5GOS2KV2.js +2 -0
- package/dist/prepare-target-BUEOZVJV.js +2 -0
- package/dist/reconcile-cmd-TY3MWZL3.js +2 -0
- package/dist/reconcile-deps-6KTJHBMJ.js +4 -0
- package/dist/reconcile-engine-O7QEZVX6.js +2 -0
- package/dist/{recording-banner-76GCIPUN.js → recording-banner-BWWFOJCR.js} +1 -1
- package/dist/registry-KXEDLM6X.js +2 -0
- package/dist/{require-project-folder-ACRDP5ZB.js → require-project-folder-CXDRRWEQ.js} +1 -1
- package/dist/resolve-run-intent-PZXEQTHC.js +7 -0
- package/dist/{resolver-SRPCFW7P.js → resolver-FTU5KO7H.js} +1 -1
- package/dist/{review-cmd-L3V5UP5T.js → review-cmd-DQRKQUMG.js} +1 -1
- package/dist/run-CMFBSYWF.js +2 -0
- package/dist/run-WKHPVWUN.js +2 -0
- package/dist/{run-test-md-KEHSRMCM.js → run-test-md-7HGOZJSU.js} +3 -3
- package/dist/session-items-2ATN7VXG.js +2 -0
- package/dist/session-target-UWROGOCY.js +2 -0
- package/dist/{sessions-cmd-ZVYGSRJ3.js → sessions-cmd-ZZIZN2VB.js} +1 -1
- package/dist/{skill-installer-HBN3A35K.js → skill-installer-QNUDLGPD.js} +1 -1
- package/dist/spawner-DQZRJIE6.js +2 -0
- package/dist/{structured-answers-A43Q25CZ.js → structured-answers-5EY2AZN7.js} +1 -1
- package/dist/tcg-generate-XKSTMCOG.js +2 -0
- package/dist/testmd-actions-IFRW7NGG.js +2 -0
- package/dist/{tms-client-VD3B3SMU.js → tms-client-V3TR4QW3.js} +1 -1
- package/dist/token-refresh-FP6JFLXB.js +2 -0
- package/dist/types-6E2HTDKJ.js +2 -0
- package/dist/{validate-basic-ZGWPBYB6.js → validate-basic-3CNUDDH7.js} +1 -1
- package/dist/{verdicts-SCETLY5J.js → verdicts-NYCSBWUC.js} +1 -1
- package/dist/{version-check-CJWKDAXV.js → version-check-7TSAVA6V.js} +1 -1
- package/dist/{view-cmd-SOVM64L2.js → view-cmd-KPJTP4DI.js} +1 -1
- package/dist/walk-session-AINBHZKB.js +2 -0
- package/dist/{with-telemetry-E7QWPGL6.js → with-telemetry-3DL7ZEZL.js} +1 -1
- package/package.json +12 -6
- package/dist/ChatSurface-E7QKI4LA.js +0 -8
- package/dist/ConfigView-HPKRQXMC.js +0 -2
- package/dist/EvidenceViewOffer-F5YG54OC.js +0 -2
- package/dist/FolderPicker-4NSDXQY5.js +0 -2
- package/dist/SingleShotApp-Y3YDFQSD.js +0 -2
- package/dist/TestMdRunView-O6JTHV5W.js +0 -2
- package/dist/bridge-JSKEO4N3.js +0 -2
- package/dist/chunk-23VPUWBD.js +0 -23
- package/dist/chunk-2WRBTLFN.js +0 -13
- package/dist/chunk-53IBTIL3.js +0 -12
- package/dist/chunk-5WXGMXGA.js +0 -26
- package/dist/chunk-5ZQZOVWY.js +0 -4
- package/dist/chunk-74HTO7K3.js +0 -11
- package/dist/chunk-AECMF3T2.js +0 -8
- package/dist/chunk-AFBKGZFG.js +0 -2
- package/dist/chunk-BXYWX4J3.js +0 -2
- package/dist/chunk-C3T7TKAC.js +0 -349
- package/dist/chunk-DBKNJRJG.js +0 -2
- package/dist/chunk-H32GM5G4.js +0 -2
- package/dist/chunk-J5FBU425.js +0 -62
- package/dist/chunk-KCCSWEGA.js +0 -4
- package/dist/chunk-MK7JUOYV.js +0 -6
- package/dist/chunk-ORQNKZ2Z.js +0 -5
- package/dist/chunk-OUJQVBUT.js +0 -7
- package/dist/chunk-QOFZSHSC.js +0 -47
- package/dist/chunk-RKWJG3WW.js +0 -19
- package/dist/chunk-STVP2XHO.js +0 -2
- package/dist/chunk-VFII6C46.js +0 -2
- package/dist/chunk-VGFTNLQQ.js +0 -2
- package/dist/chunk-WAOCHXJ5.js +0 -2
- package/dist/chunk-ZUGCHQFC.js +0 -2
- package/dist/docx-convert-CHLJUTFH.js +0 -2
- package/dist/evidence-IVDNXWPL.js +0 -2
- package/dist/evolve-cmd-XBX4SX5H.js +0 -2
- package/dist/exit-manager-XZL4KIJU.js +0 -2
- package/dist/extract-bind-5OWELRME.js +0 -10
- package/dist/gaps-cmd-XBRXKXDL.js +0 -3
- package/dist/ingest-cmd-YTGOICTC.js +0 -2
- package/dist/interactive-bind-XSRD36MO.js +0 -25
- package/dist/list-commands-RCYHJ5Y3.js +0 -2
- package/dist/login-flow-PYAPYCPY.js +0 -2
- package/dist/persist-recorded-session-DTYCLXTQ.js +0 -3
- package/dist/pipeline-MXFOD6ES.js +0 -2
- package/dist/reconcile-cmd-EG6BOU3A.js +0 -2
- package/dist/reconcile-deps-HTT6IPHT.js +0 -4
- package/dist/reconcile-engine-JQNXALNY.js +0 -2
- package/dist/run-GMZCDRDD.js +0 -2
- package/dist/run-TFRWPGXP.js +0 -2
- package/dist/spawner-GC5CFAJ7.js +0 -2
- package/dist/tcg-generate-V7YFNC5O.js +0 -2
- package/dist/testmd-actions-MNDOO76O.js +0 -2
- package/dist/token-refresh-3UYMCYG3.js +0 -2
- package/dist/walk-session-YUYRULPY.js +0 -2
package/dist/chunk-C3T7TKAC.js
DELETED
|
@@ -1,349 +0,0 @@
|
|
|
1
|
-
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{c as We}from"./chunk-IOD3HQVW.js";import{a as Ve}from"./chunk-KHU7C6EE.js";import{a as ze,b as me}from"./chunk-3Q6WAK6P.js";import{a as te,b as Ne,e as ce,f as le,g as je,h as Ge}from"./chunk-AJ56AMT6.js";import{a as qe,c as Me,d as Fe,e as de,f as Be}from"./chunk-F7ISS545.js";import{a as Te,b as Ae,c as Ie}from"./chunk-7OYZR6JA.js";import{a as $e,b as Ee,c as Ce}from"./chunk-BB2W35TW.js";import{a as Le}from"./chunk-IMR64OCZ.js";import{a as He,b as Ue}from"./chunk-JZ26R6UL.js";import{a as Oe}from"./chunk-L2TV4G56.js";import{c as Pe}from"./chunk-6KPPGMO2.js";import{a as De,e as Re}from"./chunk-GFKCTYCA.js";import{b as ye,c as be,d as we,e as re,f as oe,g as ae}from"./chunk-ZPDM6FO7.js";import{a as ie}from"./chunk-L5LI2JF4.js";import{A as G}from"./chunk-TH47OOBV.js";import{f as Se}from"./chunk-DUAXZYAD.js";import{a as ve,e as ke,f as xe}from"./chunk-DBIBROYW.js";import{d as V,e as J}from"./chunk-WXHQYYD5.js";import{a as _e,b as ne}from"./chunk-IDX3TOPY.js";import{a as he}from"./chunk-5EOX4MEY.js";import{mkdirSync as xt,appendFileSync as St,rmdirSync as lt}from"fs";import{randomBytes as Dt}from"crypto";import{dirname as dt,join as fe}from"path";function Ke(t,e){let n=[];for(let i of e??[]){let g=t.resolve(i.ref)?.tip??null;g!==i.cid&&n.push({ref:i.ref,pinned:i.cid,now:g})}return n}import{existsSync as ue,readFileSync as ge,readdirSync as gt}from"fs";import{join as Z}from"path";var Qe=`
|
|
3
|
-
version: 1
|
|
4
|
-
techniques:
|
|
5
|
-
- id: eqp
|
|
6
|
-
name: "Equivalence partitioning"
|
|
7
|
-
applies_hint: "any constrained input"
|
|
8
|
-
emits: [absolute, forbidden-presence]
|
|
9
|
-
- id: bva
|
|
10
|
-
name: "Boundary value analysis"
|
|
11
|
-
applies_hint: "input has an ordered range or length"
|
|
12
|
-
emits: [absolute, forbidden-presence]
|
|
13
|
-
- id: negative
|
|
14
|
-
name: "Negative / error"
|
|
15
|
-
applies_hint: "any input or action that can fail"
|
|
16
|
-
emits: [forbidden-presence]
|
|
17
|
-
- id: state_flow
|
|
18
|
-
name: "State / flow"
|
|
19
|
-
applies_hint: "the AC sits in a multi-step flow"
|
|
20
|
-
emits: [state-transition]
|
|
21
|
-
- id: crud
|
|
22
|
-
name: "CRUD round-trip"
|
|
23
|
-
applies_hint: "AC touches a persisted resource"
|
|
24
|
-
emits: [delta, presence, forbidden-presence]
|
|
25
|
-
- id: auth
|
|
26
|
-
name: "Auth / permission"
|
|
27
|
-
applies_hint: "AC is behind a gate or role"
|
|
28
|
-
emits: [forbidden-presence, presence]
|
|
29
|
-
- id: api_contract
|
|
30
|
-
name: "API-contract"
|
|
31
|
-
applies_hint: "surface is REST/GraphQL"
|
|
32
|
-
emits: [absolute]
|
|
33
|
-
- id: concurrency
|
|
34
|
-
name: "Concurrency / race"
|
|
35
|
-
applies_hint: "high-risk (money / data-loss) or shared-resource AC"
|
|
36
|
-
emits: [state-transition, forbidden-presence]
|
|
37
|
-
- id: idempotency
|
|
38
|
-
name: "Idempotency / retry"
|
|
39
|
-
applies_hint: "money or write operations"
|
|
40
|
-
emits: [delta]
|
|
41
|
-
- id: i18n
|
|
42
|
-
name: "i18n / l10n"
|
|
43
|
-
applies_hint: "AC renders user text or formats numbers/dates/currency"
|
|
44
|
-
emits: [presence, absolute]
|
|
45
|
-
- id: a11y
|
|
46
|
-
name: "a11y"
|
|
47
|
-
applies_hint: "any rendered surface"
|
|
48
|
-
emits: [presence, absolute]
|
|
49
|
-
- id: responsiveness
|
|
50
|
-
name: "Responsiveness / layout"
|
|
51
|
-
applies_hint: "rendered surface"
|
|
52
|
-
emits: [presence, forbidden-presence]
|
|
53
|
-
- id: empty_state
|
|
54
|
-
name: "Empty / null / zero state"
|
|
55
|
-
applies_hint: "list / search / collection AC"
|
|
56
|
-
emits: [presence]
|
|
57
|
-
- id: overflow_underflow
|
|
58
|
-
name: "Overflow / underflow"
|
|
59
|
-
applies_hint: "numeric or quantity AC (R9: explicit underflow/overflow)"
|
|
60
|
-
emits: [forbidden-presence]
|
|
61
|
-
- id: persistence
|
|
62
|
-
name: "Persistence / refresh"
|
|
63
|
-
applies_hint: "AC asserts durable state"
|
|
64
|
-
emits: [absolute]
|
|
65
|
-
- id: temporal
|
|
66
|
-
name: "Time / timezone / expiry"
|
|
67
|
-
applies_hint: "AC involves dates, TTLs, schedules"
|
|
68
|
-
emits: [state-transition, forbidden-presence]
|
|
69
|
-
- id: currency
|
|
70
|
-
name: "Currency / rounding"
|
|
71
|
-
applies_hint: "money AC"
|
|
72
|
-
emits: [absolute]
|
|
73
|
-
- id: pagination
|
|
74
|
-
name: "Pagination / sort / filter"
|
|
75
|
-
applies_hint: "list / search AC"
|
|
76
|
-
emits: [absolute, presence]
|
|
77
|
-
- id: file_media
|
|
78
|
-
name: "File / media"
|
|
79
|
-
applies_hint: "upload surface"
|
|
80
|
-
emits: [forbidden-presence]
|
|
81
|
-
- id: notification
|
|
82
|
-
name: "Notification / async-effect"
|
|
83
|
-
applies_hint: "AC produces an out-of-band effect (email/SMS/push)"
|
|
84
|
-
emits: [presence, delta]
|
|
85
|
-
`;var Ye={"web-form":`
|
|
86
|
-
id: web-form
|
|
87
|
-
name: "Web form"
|
|
88
|
-
version: 1
|
|
89
|
-
applies_when: >
|
|
90
|
-
The AC concerns a data-entry form: input fields, required fields, submit,
|
|
91
|
-
validation messages.
|
|
92
|
-
candidate_checks:
|
|
93
|
-
- id: field-validation
|
|
94
|
-
family: negative
|
|
95
|
-
measurable_example: "Enter 'abc' in a numeric quantity field \u2192 inline error 'must be a number', value not accepted"
|
|
96
|
-
emits: forbidden-presence
|
|
97
|
-
- id: required-fields
|
|
98
|
-
family: negative
|
|
99
|
-
measurable_example: "Submit with a required field empty \u2192 submit blocked, field flagged"
|
|
100
|
-
emits: forbidden-presence
|
|
101
|
-
- id: formats
|
|
102
|
-
family: negative
|
|
103
|
-
measurable_example: "Email without @ rejected; valid accepted"
|
|
104
|
-
emits: forbidden-presence
|
|
105
|
-
- id: empty-state
|
|
106
|
-
family: empty_state
|
|
107
|
-
measurable_example: "First load: no stale values, placeholders shown"
|
|
108
|
-
emits: presence
|
|
109
|
-
- id: error-messages
|
|
110
|
-
family: negative
|
|
111
|
-
measurable_example: "Each error is specific and tied to its field"
|
|
112
|
-
emits: presence
|
|
113
|
-
- id: a11y
|
|
114
|
-
family: a11y
|
|
115
|
-
measurable_example: "Every input has a programmatic label; keyboard-only submit works"
|
|
116
|
-
emits: presence
|
|
117
|
-
- id: responsiveness
|
|
118
|
-
family: responsiveness
|
|
119
|
-
measurable_example: "No field overlap at 1280/768/375 px"
|
|
120
|
-
emits: forbidden-presence
|
|
121
|
-
`,"rest-graphql-api":`
|
|
122
|
-
id: rest-graphql-api
|
|
123
|
-
name: "REST / GraphQL API"
|
|
124
|
-
version: 1
|
|
125
|
-
applies_when: >
|
|
126
|
-
The surface is an HTTP/GraphQL endpoint.
|
|
127
|
-
candidate_checks:
|
|
128
|
-
- id: response-shape
|
|
129
|
-
family: api_contract
|
|
130
|
-
measurable_example: "Body validates against the declared schema"
|
|
131
|
-
emits: absolute
|
|
132
|
-
- id: status-codes
|
|
133
|
-
family: api_contract
|
|
134
|
-
measurable_example: "GET 200, POST 201, missing 404, bad 400, unauth 401"
|
|
135
|
-
emits: absolute
|
|
136
|
-
- id: verbs
|
|
137
|
-
family: idempotency
|
|
138
|
-
measurable_example: "PUT is idempotent, POST is not"
|
|
139
|
-
emits: delta
|
|
140
|
-
- id: bad-payloads
|
|
141
|
-
family: negative
|
|
142
|
-
measurable_example: "Malformed JSON \u2192 400, never 500"
|
|
143
|
-
emits: absolute
|
|
144
|
-
- id: idempotency
|
|
145
|
-
family: idempotency
|
|
146
|
-
measurable_example: "Same POST with idempotency-key twice \u2192 one effect"
|
|
147
|
-
emits: delta
|
|
148
|
-
- id: pagination
|
|
149
|
-
family: pagination
|
|
150
|
-
measurable_example: "Page beyond last \u2192 empty list, not error; cursor stable"
|
|
151
|
-
emits: absolute
|
|
152
|
-
- id: versioning
|
|
153
|
-
family: api_contract
|
|
154
|
-
measurable_example: "v1 contract unchanged after v2 ships"
|
|
155
|
-
emits: absolute
|
|
156
|
-
- id: rate-limits
|
|
157
|
-
family: api_contract
|
|
158
|
-
measurable_example: "Over the limit \u2192 429 with retry-after"
|
|
159
|
-
emits: absolute
|
|
160
|
-
`,"mobile-native":`
|
|
161
|
-
id: mobile-native
|
|
162
|
-
name: "Mobile native"
|
|
163
|
-
version: 1
|
|
164
|
-
applies_when: >
|
|
165
|
-
iOS/Android native surface.
|
|
166
|
-
candidate_checks:
|
|
167
|
-
- id: interruptions
|
|
168
|
-
family: state_flow
|
|
169
|
-
measurable_example: "Incoming call mid-flow \u2192 state preserved on return"
|
|
170
|
-
emits: state-transition
|
|
171
|
-
- id: network-transitions
|
|
172
|
-
family: state_flow
|
|
173
|
-
measurable_example: "wifi\u2192cellular\u21924G drop: no data loss, graceful retry"
|
|
174
|
-
emits: state-transition
|
|
175
|
-
- id: permissions
|
|
176
|
-
family: negative
|
|
177
|
-
measurable_example: "Deny camera \u2192 feature degrades, no crash"
|
|
178
|
-
emits: forbidden-presence
|
|
179
|
-
- id: orientation
|
|
180
|
-
family: persistence
|
|
181
|
-
measurable_example: "Rotate mid-form \u2192 input preserved"
|
|
182
|
-
emits: absolute
|
|
183
|
-
- id: deep-links
|
|
184
|
-
family: state_flow
|
|
185
|
-
measurable_example: "Cold-start deep link lands on the right screen with auth"
|
|
186
|
-
emits: state-transition
|
|
187
|
-
- id: state-persistence
|
|
188
|
-
family: persistence
|
|
189
|
-
measurable_example: "Kill + relaunch \u2192 resume where left off"
|
|
190
|
-
emits: absolute
|
|
191
|
-
- id: localization
|
|
192
|
-
family: i18n
|
|
193
|
-
measurable_example: "Device locale switch reformats and re-translates"
|
|
194
|
-
emits: presence
|
|
195
|
-
`,"stateful-flow":`
|
|
196
|
-
id: stateful-flow
|
|
197
|
-
name: "Stateful flow"
|
|
198
|
-
version: 1
|
|
199
|
-
applies_when: >
|
|
200
|
-
Multi-step wizard / checkout / onboarding.
|
|
201
|
-
candidate_checks:
|
|
202
|
-
- id: valid-transitions
|
|
203
|
-
family: state_flow
|
|
204
|
-
measurable_example: "Each step advances only when its precondition is met"
|
|
205
|
-
emits: state-transition
|
|
206
|
-
- id: invalid-transitions
|
|
207
|
-
family: state_flow
|
|
208
|
-
measurable_example: "Can't jump to step 3 with step 2 incomplete"
|
|
209
|
-
emits: forbidden-presence
|
|
210
|
-
- id: back-and-abandon
|
|
211
|
-
family: state_flow
|
|
212
|
-
measurable_example: "Back from step 3, then abandon \u2192 no partial commit"
|
|
213
|
-
emits: forbidden-presence
|
|
214
|
-
- id: refresh-persistence
|
|
215
|
-
family: persistence
|
|
216
|
-
measurable_example: "Reload at step 2 \u2192 still at step 2 with data"
|
|
217
|
-
emits: absolute
|
|
218
|
-
- id: resume
|
|
219
|
-
family: persistence
|
|
220
|
-
measurable_example: "Return later \u2192 resume the saved flow"
|
|
221
|
-
emits: absolute
|
|
222
|
-
- id: double-submission
|
|
223
|
-
family: idempotency
|
|
224
|
-
measurable_example: "Double-click submit \u2192 exactly one submission"
|
|
225
|
-
emits: delta
|
|
226
|
-
`,"data-crud":`
|
|
227
|
-
id: data-crud
|
|
228
|
-
name: "Data CRUD"
|
|
229
|
-
version: 1
|
|
230
|
-
applies_when: >
|
|
231
|
-
A persisted record.
|
|
232
|
-
candidate_checks:
|
|
233
|
-
- id: crud-round-trip
|
|
234
|
-
family: crud
|
|
235
|
-
measurable_example: "Create \u2192 read shows it \u2192 update \u2192 read shows the change \u2192 delete \u2192 read 404"
|
|
236
|
-
emits: state-transition
|
|
237
|
-
- id: retry-safety
|
|
238
|
-
family: idempotency
|
|
239
|
-
measurable_example: "Retried create with same key \u2192 one row"
|
|
240
|
-
emits: delta
|
|
241
|
-
- id: concurrency-lost-update
|
|
242
|
-
family: concurrency
|
|
243
|
-
measurable_example: "Two writers, last must not silently clobber \u2192 conflict surfaced"
|
|
244
|
-
emits: forbidden-presence
|
|
245
|
-
- id: delete-cascade
|
|
246
|
-
family: crud
|
|
247
|
-
measurable_example: "Delete parent \u2192 children handled per rule"
|
|
248
|
-
emits: state-transition
|
|
249
|
-
- id: referential-consistency
|
|
250
|
-
family: crud
|
|
251
|
-
measurable_example: "Can't create a child for a missing parent"
|
|
252
|
-
emits: forbidden-presence
|
|
253
|
-
`,"auth-gated":`
|
|
254
|
-
id: auth-gated
|
|
255
|
-
name: "Auth gated"
|
|
256
|
-
version: 1
|
|
257
|
-
applies_when: >
|
|
258
|
-
Behind login/role.
|
|
259
|
-
candidate_checks:
|
|
260
|
-
- id: login-gate
|
|
261
|
-
family: auth
|
|
262
|
-
measurable_example: "Anonymous \u2192 redirected to login, not the resource"
|
|
263
|
-
emits: forbidden-presence
|
|
264
|
-
- id: role-permission-matrix
|
|
265
|
-
family: auth
|
|
266
|
-
measurable_example: "For each role \xD7 action: allowed/denied as specified"
|
|
267
|
-
emits: absolute
|
|
268
|
-
- id: cross-user-record
|
|
269
|
-
family: auth
|
|
270
|
-
measurable_example: "User A cannot read/edit user B's record by id"
|
|
271
|
-
emits: forbidden-presence
|
|
272
|
-
- id: token-session-expiry
|
|
273
|
-
family: auth
|
|
274
|
-
measurable_example: "Expired token \u2192 401/redirect, no stale access"
|
|
275
|
-
emits: forbidden-presence
|
|
276
|
-
- id: privilege-escalation
|
|
277
|
-
family: auth
|
|
278
|
-
measurable_example: "Non-admin cannot reach an admin action by direct URL/API"
|
|
279
|
-
emits: forbidden-presence
|
|
280
|
-
`,"search-list":`
|
|
281
|
-
id: search-list
|
|
282
|
-
name: "Search / list"
|
|
283
|
-
version: 1
|
|
284
|
-
applies_when: >
|
|
285
|
-
Search results / list views.
|
|
286
|
-
candidate_checks:
|
|
287
|
-
- id: pagination
|
|
288
|
-
family: pagination
|
|
289
|
-
measurable_example: "First/last/empty page correct; total accurate"
|
|
290
|
-
emits: absolute
|
|
291
|
-
- id: sorting
|
|
292
|
-
family: pagination
|
|
293
|
-
measurable_example: "Sort asc/desc actually orders; ties stable"
|
|
294
|
-
emits: absolute
|
|
295
|
-
- id: filtering
|
|
296
|
-
family: pagination
|
|
297
|
-
measurable_example: "Each filter narrows correctly; combined filters AND"
|
|
298
|
-
emits: absolute
|
|
299
|
-
- id: empty-state
|
|
300
|
-
family: empty_state
|
|
301
|
-
measurable_example: "No results \u2192 friendly empty state, not blank/error"
|
|
302
|
-
emits: presence
|
|
303
|
-
- id: invalid-input
|
|
304
|
-
family: negative
|
|
305
|
-
measurable_example: "Garbage query \u2192 no crash, sane result"
|
|
306
|
-
emits: forbidden-presence
|
|
307
|
-
- id: length-limits
|
|
308
|
-
family: bva
|
|
309
|
-
measurable_example: "Max-length query handled"
|
|
310
|
-
emits: absolute
|
|
311
|
-
- id: locale
|
|
312
|
-
family: i18n
|
|
313
|
-
measurable_example: "Locale-correct collation/casing"
|
|
314
|
-
emits: presence
|
|
315
|
-
`};var Je=`
|
|
316
|
-
version: 1
|
|
317
|
-
principles:
|
|
318
|
-
- "Each step is one complete OBJECTIVE the browser agent achieves autonomously \u2014 state the goal and the path, never low-level actions (the agent emits its own actions)."
|
|
319
|
-
- "One objective (or tightly-related items of one goal) per step; unrelated goals split."
|
|
320
|
-
- "Verbose path: name site, page, section, panel, control, state \u2014 'On the search results page for Noida, in the filter panel's Budget section, set min to 50L and max to 1Cr'."
|
|
321
|
-
- "Self-contained: concrete values inline; never 'as defined in the scenario' \u2014 the agent cannot see the graph."
|
|
322
|
-
- "Browser-only: the agent authors/runs BROWSER tests. Direct API calls and the page's own network traffic ARE in scope; native-app-only behavior, out-of-band email/SMS, backend state with no browser surface are NOT."
|
|
323
|
-
verification:
|
|
324
|
-
- "Phrase checks against the analyzer that observes them:"
|
|
325
|
-
- "Visual \u2014 visible text, labels, counts, prices ('verify the price is 29.99', 'the Sold out label is shown')."
|
|
326
|
-
- "Textual/DOM \u2014 element states/attributes ('the Add button is disabled', 'the placeholder of the search box is \u2026')."
|
|
327
|
-
- "URL \u2014 'URL contains /checkout', 'redirected to /login'. Title \u2014 'page title contains \u2026'."
|
|
328
|
-
- "DevTools/Network \u2014 'no API calls returned 5xx', 'the POST /api/login returned 200' (covers direct API calls too)."
|
|
329
|
-
- "DevTools/Console \u2014 'no console errors'. Performance \u2014 'LCP under 2500ms'. Cookies/localStorage \u2014 'a cookie named session_id exists'."
|
|
330
|
-
- "Assertions: 'Assert/Verify/Confirm \u2026'. Extractions: 'Store \u2026 as name' \u2014 vague verbs (read/tell/report) do NOT persist values."
|
|
331
|
-
- "Baselines/deltas are EXTRACTIONS: 'store the result count as baseline_count' BEFORE the action; compare after. Never an abstract 'capture the state'."
|
|
332
|
-
variables:
|
|
333
|
-
- "Credentials and environment values are {{name}} variables; concrete domain values from the source stay literal."
|
|
334
|
-
- "A value no evidence supplies (start URL, test account, seed data) is ASKED for \u2014 actual value or a variable name \u2014 never invented."
|
|
335
|
-
pitfalls:
|
|
336
|
-
- "A test without a starting URL cannot run \u2014 the first step names it."
|
|
337
|
-
- "'Test the checkout flow' has no end state \u2014 state what done looks like."
|
|
338
|
-
- "Do not cram many unrelated operations into one step; do not reference data outside the step."
|
|
339
|
-
`;var pt=["presence","forbidden-presence","count","delta","state-transition","absolute","bound","propagation","latency","graded"];function et(t,e){for(let n of t)if(!pt.includes(n))throw new Error(`${e}: emits '${n}' is not an oracle kind`)}function Xe(t,e){let n=ie(t);if(!n||!Array.isArray(n.techniques))throw new Error(`${e}: expected { techniques: [...] }`);for(let i of n.techniques){if(!i.id||!i.name||!i.applies_hint||!Array.isArray(i.emits))throw new Error(`${e}: technique '${i?.id??"?"}' missing id/name/applies_hint/emits`);et(i.emits,`${e}: technique '${i.id}'`)}return n.techniques}function Ze(t,e){let n=ie(t);if(!n||!n.id||!n.name||!n.applies_when||!Array.isArray(n.candidate_checks))throw new Error(`${e}: profile missing id/name/applies_when/candidate_checks`);for(let i of n.candidate_checks){if(!i.id||!i.family||!i.measurable_example||!i.emits)throw new Error(`${e}: candidate_check '${i?.id??"?"}' missing id/family/measurable_example/emits`);et([i.emits],`${e}: check '${i.id}'`)}return n}function tt(t){let e=new Map(Xe(Qe,"packaged techniques").map(i=>[i.id,i])),n=Z(t,"design","techniques.yaml");if(ue(n))for(let i of Xe(ge(n,"utf8"),n))e.set(i.id,i);return[...e.values()]}function st(t){let e=new Map(Object.entries(Ye).map(([i,g])=>[i,Ze(g,`packaged profile '${i}'`)])),n=Z(t,"design","profiles");if(ue(n))for(let i of gt(n).filter(g=>g.endsWith(".yaml")||g.endsWith(".yml")).sort()){let g=Ze(ge(Z(n,i),"utf8"),Z(n,i));e.set(g.id,g)}return[...e.values()]}function it(t){let e=Z(t,"design","runner-grammar.yaml");return ue(e)?ge(e,"utf8"):Je}function ee(t,e){return!t.superseded.has(e)}function pe(t,e,n){return{cid:e,logical_id:t.nameOf.get(e)??null,content:n}}async function nt(t,e,n,i,g){let r=await Ne(t,"search_similar",{text:e,label:n,k:i},g);return r.ok&&Array.isArray(r.result)?r.result:[]}async function rt(t,e,n={}){let i=G(t),g=i.resolve(e);if(!g)throw new Error(`assembleDesignContext: unknown use-case '${e}' (run designGate first)`);let r=g.tip,x=i.getNode(r);if(!x||x.label!==V.USECASE)throw new Error(`assembleDesignContext: '${e}' is not a use-case (run designGate first)`);let O=i.derivesInto(r).map(d=>({source_id:d.props.source_id??null,anchor:d.props.anchor??null})),S=[],E=new Set;for(let{cid:d,content:k}of i.byLabel(V.SCENARIO))ee(i,d)&&i.edgesFrom(d).some(y=>y.type===J.BELONGS_TO&&y.dst===r)&&(S.push(pe(i,d,k)),E.add(d));let D=[];for(let{cid:d,content:k}of i.byLabel(V.AC)){if(!ee(i,d))continue;let y=i.edgesFrom(d).find(T=>T.type===J.SCOPED_TO);!y||y.dst!==r&&!E.has(y.dst)||D.push({...pe(i,d,k),scoped_to:y.dst})}let w=Array.isArray(x.content.criteria)?x.content.criteria:[],_=[x.content.title,x.content.description,...w].filter(Boolean).join(`
|
|
340
|
-
`),F=(await nt(i,_,V.SCENARIO,10,n.embedSearch)).filter(d=>!E.has(d.cid)),B=[],R=new Set,p=[],f=[r],v=new Set([r]);for(;f.length>0;){let d=f.shift();for(let k of i.edgesFrom(d)){if(k.type!==J.DEPENDS_ON||i.nodeLabel.get(k.dst)!==V.USECASE)continue;let y=i.tipOf(k.dst);v.has(y)||(v.add(y),p.push(y),f.push(y))}}for(let d of p){let k=`depends_on ${i.nameOf.get(d)??d.slice(0,19)}`;for(let{cid:y}of i.byLabel(V.SCENARIO))if(ee(i,y)&&i.edgesFrom(y).some(T=>T.type===J.BELONGS_TO&&T.dst===d))for(let T of i.edgesInto(y)){if(T.type!==J.AUTOMATES||!ee(i,T.src)||R.has(T.src))continue;R.add(T.src);let Q=String(i.getNode(T.src)?.content.title??"");B.push({cid:T.src,logical_id:i.nameOf.get(T.src)??null,title:Q,via:k})}}for(let d of await nt(i,_,V.TEST,5,n.embedSearch)){let{cid:k,title:y}=d;R.has(k)||(R.add(k),B.push({cid:k,logical_id:i.nameOf.get(k)??null,title:y??"",via:"similar"}))}let P=i.byLabel(V.STYLENOTE).filter(d=>ee(i,d.cid)).sort((d,k)=>d.cid<k.cid?-1:1).slice(0,5).map(d=>`${String(d.content.statement)} [${String(d.content.learned_from_kind)}]`);return{usecase:pe(i,r,x.content),cites:O,committed_acs:D,existing:{scenarios:S,reuse_candidates:F},import_candidates:B,style_notes:P,techniques:tt(t),profiles:st(t),runner_grammar:it(t),budget:{...n.max!=null?{max_pairs:n.max}:{},...n.strength!=null?{strength_override:n.strength}:{}},design_of:(()=>{let d=He(i,r);return d?{engine:d.engine,seq:d.seq}:null})()}}function ot(t){let e=n=>{if(Array.isArray(n))return n.map(e);if(n!==null&&typeof n=="object"){let i={};for(let g of Object.keys(n).sort())i[g]=e(n[g]);return i}return n};return JSON.stringify(e(t),null,1)}import{basename as ht,dirname as _t,resolve as yt}from"path";var ft=oe,bt=new Set(["narrative","acs","scenarios","tests","exercises","gaps","scoped_to_repoints","judgements","phase"]);function wt(t){let e=/strength=(\d+)\s*(?:—|-)?\s*(.*)/.exec(t??"");return e?{strength:Number(e[1]),reason:e[2]||t||""}:{strength:2,reason:t??""}}function vt(t,e,n=new Set,i=0){return ft(e,ae(t),n,i)}function kt(t,e,n,i){let g=e.scenarios?.find(w=>w.temp_ref===n.automates)??(()=>{let w=t.resolve(n.automates),_=w?t.getNode(w.tip)?.content:void 0;return _?{title:String(_.title??""),intent:String(_.intent??""),technique_notes:String(_.technique_notes??"")}:{}})(),r=[...(e.acs??[]).map(w=>({ref:w.temp_ref,text:w.text})),...n.verifies.filter(w=>!(e.acs??[]).some(_=>_.temp_ref===w)).map(w=>{let _=t.resolve(w);return{ref:w,text:_?String(t.getNode(_.tip)?.content.text??""):""}})],{test_md:x,objectives_yaml:O}=we({title:n.title,steps:n.steps,check:n.check,check_prose:n.check_prose,reuses:n.reuses},{title:g.title,intent:g.intent},r),S=re(vt(t,x)),E=n.check,D={technique:g.technique_notes??"",profile_family:e.judgements?.find(w=>w.kind==="profile_family"&&(w.target===n.temp_ref||w.target===n.automates))?.rationale??"unspecified",anchor:E.verified_against,expected_how:e.judgements?.find(w=>w.kind==="expected_how"&&w.target===E.verified_against)?.rationale??`expected_mode: ${E.expected_mode??"inferred"}`,combinatorial:wt(g.technique_notes),surface_state:"absent",deferred_bindings:E.expected_mode==="runtime-derived"?1:0};return i.push({definitionId:S,rationale:D,anchorRef:E.verified_against,tempRef:n.temp_ref}),{temp_ref:n.temp_ref,title:n.title,automates:n.automates,verifies:n.verifies,check:n.check,definitionId:S,test_md_blob:x,objectives_blob:O,...n.reuses?.length?{reuses:n.reuses}:{},...n.surface_required!==void 0?{surface_required:n.surface_required}:{}}}function at(t){let e=0,n=t.forceScope??null;return{terminalEventType:"design",async onProposalEvent(i){let g=o=>t.steer?(t.steer(`[auto-repair] ${o} \u2014 please re-finalize with this fixed.`),{proposal:null,error:null}):{proposal:null,error:o};if(i==null||typeof i!="object")return g("finalize_design payload is not an object");let r=i,x=Object.keys(r).filter(o=>!bt.has(o));if(x.length>0)return g(`finalize_design carries ungated/unknown section(s): ${x.join(", ")} \u2014 mintable here: acs, scenarios, tests (+gaps)`);let O=new Map;for(let o of r.tests??[]){let u=O.get(o.automates);if(u)return g(`strict 1:1 violated in-payload: ${u} and ${o.temp_ref} both automate ${o.automates}`);O.set(o.automates,o.temp_ref)}let S=G(t.contextDir);t.force&&!t.resuming&&e===0&&n===null&&(n=ze(S,t.ucRef));let E=S.resolve(t.ucRef),D=E?String(S.getNode(E.tip)?.content.risk??"med"):"med",w=[],_=new Set([t.ucRef,E?.cid,E?.tip].filter(Boolean)),F=o=>{if(_.has(o))return!0;let u=S.resolve(o);return u!=null&&(_.has(u.cid)||_.has(u.tip))},B;try{B={...r.acs?.length?{acs:r.acs.map(o=>({temp_ref:o.temp_ref,text:o.text,kind:o.kind,risk:o.risk??D,...o.expected_answer?{expected_answer:o.expected_answer}:{},...o.scoped_to&&!F(o.scoped_to)?{scope:{type:"scenario",ref:o.scoped_to}}:{}}))}:{},...r.scenarios?.length?{scenarios:r.scenarios}:{},...r.tests?.length?{tests:r.tests.map(o=>kt(S,r,o,w))}:{},...r.exercises?.length?{exercises:r.exercises}:{},...r.gaps?.length?{gaps:r.gaps}:{},...r.scoped_to_repoints?.length?{scoped_to_repoints:r.scoped_to_repoints}:{},...r.judgements?.length?{judgements:r.judgements}:{}}}catch(o){return g(o instanceof Error?o.message:String(o))}let R=r.phase??(r.tests?.length?"tests":r.scenarios?.length?"scenarios":r.acs?.length?"acs":"design"),p=(o,u={})=>({contextDir:t.contextDir,graph:o,ucRef:t.ucRef,sections:B,by:t.by,phase:R,...u,...t.templateVersion?{templateVersion:t.templateVersion()}:{},...t.engine?{engine:t.engine}:{},...n?.length?{forceScope:n}:{},...t.because?{reason:t.because}:{},finalizeTestBody:(()=>{let A=new Map((B.tests??[]).map(I=>[I.temp_ref,I])),C=new Map,Y=(I,q,H)=>{let j=A.get(I);if(!j?.test_md_blob)return null;let U=C.get(I);if(U!==void 0)return U;if(H.has(I))return j.test_md_blob;H.add(I);let z=new Map;for(let W of j.reuses??[]){Y(W,q,H);let b=q(W);b!==null&&b!==W&&z.set(W,b)}let N=j.verifies.map(q).filter(W=>W!==null),K=ye(be(j.test_md_blob,z),N);return C.set(I,K),K};return(I,q)=>{if(!I.test_md_blob)return null;let H=Y(I.temp_ref,q,new Set)??I.test_md_blob;if(H===I.test_md_blob)return null;let j=U=>{for(let z of A.keys())if(q(z)===U){let N=Y(z,q,new Set);if(N!==null)return{body:N,cycleKey:`batch:${U}`,next:j}}return ae(S)(U)};return{test_md_blob:H,definitionId:re(oe(H,j))}}})()}),f;if(t.protocol){let o=t.generationTicket,u=await Te(t.protocol,{verb:"design",ucTargets:[{ref:t.ucRef}],newBuCandidates:[],sourcePins:[],readBasis:S.latestHash,...o?{generationTicket:o}:{}},A=>{let C=me(p(A.graph,{eventIds:A.eventIds("design",1),sid:A.sid,...o&&!t.generationStamped?{generationTicket:o}:{}}));return C.errors!==null?{errors:C.errors}:{result:C,record:C.record}});u.ok&&"result"in u?(f=u.result,o&&!t.generationStamped&&(t.generationStamped=!0,t.generationTicket={...o,expected_prev_gen:o.next_gen})):u.ok?f={record:null,errors:null,minted:{},logicalIds:{},superseded:[],warnings:["commit already applied (recommit)"],finalizedTests:{}}:f={record:null,errors:u.kind==="validation"?u.errors:u.kind==="contended"?[{code:u.err.code,detail:`${t.ucRef} is held by ${u.err.holder?.owner_sid??"another session"}${u.err.holder?.alive?" (live)":" (stale)"} \u2014 try another use-case or wait for it to free`}]:u.kind==="drifted"?u.asks.map(C=>({code:"DRIFTED",detail:C.detail})):[{code:"UNSETTLED",detail:`concurrent activity kept moving the store (${u.attempts} attempts) \u2014 retry when the store is quieter`}],minted:{},logicalIds:{},superseded:[],warnings:[],finalizedTests:{}}}else f=me(p(S));if(f.errors)return g("design commit failed: "+f.errors.map(o=>`${o.code}: ${o.detail}`).join("; "));let v=f.warnings.filter(o=>o.includes("\u2014 committed anyway; approve"));for(let o of f.warnings)(!v.includes(o)||v.length===1)&&t.note(`warning: ${o}`);v.length>1&&t.note(`warning: ${v.length} test link(s) refer to items still awaiting approval \u2014 saved anyway; review and approve those items in chat or via kane-cli context review`);let P=(o,u)=>o?`${o} ${u}${o>1?"s":""}`:null,d=[P(r.acs?.length,"AC"),P(r.scenarios?.length,"scenario"),P(r.tests?.length,"test"),P(r.gaps?.length,"gap")].filter(Boolean);t.aliases?.(Object.entries(f.minted).map(([o,u])=>({ref:o,cid:u,...f.logicalIds[o]?{id:f.logicalIds[o]}:{}})));{let o=`saved ${d.join(" \xB7 ")||"judgements/wiring"} as drafts`;(t.commitLine??t.note)(o)}let k=G(t.contextDir);t.onCommitted?.(k);for(let o of w){let u=f.logicalIds[o.anchorRef]??f.minted[o.anchorRef];Ve(t.contextDir,f.finalizedTests[o.tempRef]??o.definitionId,{...o.rationale,anchor:u??o.rationale.anchor})}try{let o=Object.values(f.minted).filter(u=>k.getNode(u)?.label==="test");if(o.length>0){let u=_t(yt(t.contextDir)),A=We({graph:k,cids:o,cwd:u});A.wrote.length>0&&t.note(`\u2692 wrote ${A.wrote.map(C=>ht(C.path)).join(" \xB7 ")}`);for(let C of A.refused)t.note(`warning: could not create the test file for ${C.id} \u2014 ${C.reason}`)}}catch(o){t.note(`warning: the design was saved, but its test file could not be created (${o instanceof Error?o.message:String(o)})`)}t.event?.({type:"commit",acs:r.acs?.length??0,scenarios:r.scenarios?.length??0,tests:r.tests?.length??0,gaps:r.gaps?.length??0,warnings:f.warnings.length,minted:Object.entries(f.minted).map(([o,u])=>({temp_ref:o,cid:u,...f.logicalIds[o]?{logical_id:f.logicalIds[o]}:{}}))}),e+=1,n!==null&&(n=f.forceScopeRemaining??n,t.onForceScope?.(n));let y=Oe({verb:"design",commitN:e,ucRef:t.ucRef,phase:R,committed:Object.entries(f.minted).map(([o,u])=>({temp_ref:o,cid:u,...f.logicalIds[o]?{logical_id:f.logicalIds[o]}:{}})),warnings:f.warnings},k),T=y.event.parity?.missing??[],Q=!!r.tests?.length&&T.length===0;return{proposal:f,error:null,receipt:y,...Q?{sessionComplete:Q}:{}}}}}function ct(t,e){return{type:"run_config",version:1,session_id:e.session_id,mode:e.mode,source:{source_id:`design:${t.usecase.logical_id??e.ucCid.slice(0,19)}`,source_cid:e.ucCid,kind:"design_context",numbered_text:ot({...t,session_mode:e.mode})},existing_use_cases:[],read_basis:e.readBasis,max_free_text_rounds:2,graph_reads:!0,verb:"design",chat:!0,design_budget:t.budget,topology:e.topology}}var mt=Symbol("design-out-tee");function Rt(t,e,n,i){return{terminalEventType:"design",async onProposalEvent(g){let r=g??{},x=["acs","scenarios","tests","gaps"].map(O=>r[O]?.length?`${r[O].length} ${O}`:null).filter(Boolean).join(" \xB7 ");return n?.("plan_payload",{payload:r}),t(`plan: finalize_design \u2014 ${x||"wiring/judgements only"} (nothing committed${i?`; full payload: ${te(i)}`:""})`),e?.({type:"plan",payload:r}),{proposal:r,error:null}}}}async function Rs(t,e){let n=G(e.contextDir),i=null,g=null,r=t.useCase;if(t.resume){try{{let m=await Be(e.contextDir,t.resume,n,{deps:{onWarn:h=>e.out(`note: ${h}`)}});g=m,i=m.handle,m.drift.length>0&&(e.out(`note: sources changed since the pause: ${m.drift.map(h=>h.subject).join(", ")} \u2014 the design continues against the current versions`),e.emit?.({type:"stale_basis",sources:m.drift.map(h=>h.subject)}))}}catch(m){if(m instanceof _e||m instanceof de)return e.out(`error: ${m.message}`),e.emit?.({type:"error",message:`error: ${m.message}`}),m instanceof de||m.code==="SESSION_MISSING"||m.code==="SESSION_EXPIRED"?2:1;throw m}let s=i.state,c=qe(s.verb,"design",t.resume);if(c)return e.out(c.message),e.emit?.({type:"error",message:c.message,code:c.code}),i.release(),2;if(r&&s.use_case&&r!==s.use_case){let m=`session ${t.resume} was designing ${s.use_case}; --use-case ${r} RETARGETS it`;if(!(t.confirmRetarget?await t.confirmRetarget(`${m} \u2014 continue with the new target?`):!1))return e.out(`error: ${m} \u2014 resume without --use-case to continue ${s.use_case}, or start a fresh session on ${r}`),e.emit?.({type:"error",code:"RETARGET_MISMATCH",message:m}),i.release(),2}if(r=r??s.use_case,s.uc_tip&&r){let m=n.resolve(r)?.tip;if(m&&m!==s.uc_tip){let h=`the use-case changed since the pause (${s.uc_tip.slice(0,19)}\u2026 \u2192 ${m.slice(0,19)}\u2026)`;if(!(t.confirmRetarget?await t.confirmRetarget(`${h} \u2014 re-ground and continue against the new version?`):!1))return e.out(`error: ${h} \u2014 resume interactively to re-ground, or abandon this session`),e.emit?.({type:"error",code:"UC_TIP_MOVED",message:h}),i.release(),2;e.emit?.({type:"stale_basis",usecase:r})}}let l=Ke(n,s.target_pins);if(l.length>0){let m=`items this session pinned have changed since it paused: ${l.map($=>`${$.ref}${$.now===null?" (now gone)":""}`).join(", ")}`;if(!(t.confirmRetarget?await t.confirmRetarget(`${m} \u2014 re-ground and continue?`):!1))return e.out(`error: ${m} \u2014 resume interactively to re-ground, or abandon`),e.emit?.({type:"error",code:"TARGET_PIN_MOVED",message:m}),i.release(),2;i.save({target_pins:(s.target_pins??[]).map($=>({ref:$.ref,cid:n.resolve($.ref)?.tip??$.cid}))})}let a=[...new Set([...i.state.held_receipts??[],...g?.view.kane?.held_receipts??[]])];if(a.length>0)if(e.chat?.holdReceipt)for(let m of a)e.chat.holdReceipt(m);else e={...e,initialMessage:[a.join(`
|
|
341
|
-
|
|
342
|
-
`),e.initialMessage].filter(Boolean).join(`
|
|
343
|
-
|
|
344
|
-
`)};if(!r)return e.out(`error: session ${t.resume} predates use-case persistence \u2014 re-supply --use-case <ref>`),e.emit?.({type:"error",message:`error: session ${t.resume} predates use-case persistence \u2014 re-supply --use-case <ref>`}),i.release(),2}let x=t.resume?void 0:t.phase,O=!1;if(x!==void 0){let{checkPhaseEntry:s,phaseEntryCmd:c,phaseLadderFor:l}=await import("./phase-seed-DIRETNU6.js");O=l(e.contextDir,n,r).length>0;let a=s(e.contextDir,n,r,x);if(!a.ok&&a.code==="UNKNOWN_PHASE")return e.out(`error: ${a.message}`),e.emit?.({type:"error",code:"UNKNOWN_PHASE",message:a.message}),i?.release(),2;if(!a.ok&&a.code==="PHASE_ORDER"){let m=t.askPhaseEntry?await t.askPhaseEntry({message:a.message,earliest:a.earliest}):"cancel";if(m==="earliest")e.out(`starting at ${a.earliest} instead (${a.missing.join(", ")} not committed yet)`),x=a.earliest;else if(m==="proceed")e.out(`note: entering at ${x} with ${a.missing.join(", ")} uncommitted \u2014 proceeding on your say-so`),e.emit?.({type:"phase_entry_override",phase:x,missing:a.missing});else{let h=(t.mode??"interactive")==="agent",$=c(r,a.earliest,h);return e.out(`error: ${a.message}`),e.emit?.({type:"error",code:"PHASE_ORDER",message:a.message,next:[{cmd:$,why:`${a.earliest} is the earliest uncommitted phase for ${r}`,title:`Start at ${a.earliest}`}]}),i?.release(),2}}}let S=!!(t.force||i?.state.force),E=!!(t.resume&&i),D=Ue(n,r,S||E||O);if(!D.ok){let s=(t.mode??"interactive")==="interactive";if(D.wall&&s&&t.askDesignEntry){let{captureForceScope:c}=await import("./design-committer-VYT6NU3T.js"),l=c(n,r).length,a=await t.askDesignEntry({wall:D.wall.kind,message:D.message,display:D.wall.display,impactPairs:l});if(a.pick==="redesign"||a.pick==="proceed"){if(!a.because.trim())return e.out("a redesign needs a reason (--because) \u2014 nothing executed"),i?.release(),2;e.out(a.pick==="redesign"?`redesigning ${D.wall.display} (${l} pair(s) superseded) \u2014 because: ${a.because.trim()}`:`proceeding against the stale design (noted) \u2014 because: ${a.because.trim()}`),t={...t,force:!0,because:t.because??a.because.trim()},S=!0}else return a.pick==="view"?(e.out(`view the existing design: kane-cli context view ${D.wall.display}`),i?.release(),0):a.pick==="refresh"?(e.out(`refresh it first: kane-cli maintain evolve ${D.wall.display}`),i?.release(),0):(e.out("nothing executed \u2014 list use-cases: kane-cli context list"),i?.release(),0)}else{e.out(`design: ${D.message}`);let c=D.wall&&t.mode==="agent"?[{cmd:`kane-cli context view ${D.wall.display}`,why:"view the existing design",title:"View the design"},...D.wall.kind==="designed-stale"?[{cmd:`kane-cli maintain evolve ${D.wall.display}`,why:"the use-case moved since the design \u2014 evolve refreshes it",title:"Evolve the design"}]:[],{cmd:`kane-cli design tests --use-case ${D.wall.display} --force --mode agent`,why:"redesign \u2014 supersedes the live scenario+test pairs",title:"Redesign"}]:void 0;return e.emit?.({type:"gate_refused",message:D.message,...c?{next:c}:{}}),i?.release(),D.code}}if(e.preflightTurn){let s=await e.preflightTurn();if(!s.ok)return e.out(s.message??"error: turn-endpoint preflight failed"),e.emit?.({type:"error",message:s.message??"error: turn-endpoint preflight failed",code:"PREFLIGHT"}),i?.release(),2}let w={contextDir:e.contextDir,resolveAlias:s=>Ae(s,{env:process.env,auth:e.auth}),embed:(s,c)=>Ie(s,c,{env:process.env,auth:e.auth})};e.chat?.setWorking?.("assembling context\u2026");let _=await rt(e.contextDir,r,{max:t.max,strength:t.strength,embedSearch:w});if(t.priorDesign!==void 0&&(_.prior_design=t.priorDesign),t.changeDelta!==void 0&&(_.change_delta=t.changeDelta),t.because&&(_.because=t.because),x!==void 0){let{buildPhaseSeed:s}=await import("./phase-seed-DIRETNU6.js"),c=s(e.contextDir,n,r,x);_.prior_design===void 0&&c.priorDesign!==void 0&&(_.prior_design=c.priorDesign),_.entry_phase=x,c.phaseLadder.length>0&&(_.phase_ladder=c.phaseLadder)}let F=e.now?.()??new Date,B=`${F.toISOString().replace(/[-:]/g,"").slice(0,15)}-${Dt(2).toString("hex")}`,R=t.mode??"interactive",p=g?{...g.spawnConfig,mode:R}:ct(_,{session_id:t.resume??`design-${B}`,mode:R,ucCid:_.usecase.cid,readBasis:n.latestHash,topology:Le("design")}),f={current:null};if(p.resume&&"schema"in p.resume){let s=p.resume.binding?.template_version;typeof s=="string"&&(f.current=s)}t.plan?p.chat=!1:p.chat=!0;let v=e.telemetry?.enabled?e.telemetry:void 0,P=v?he(v.ids.context_instance_id??null,"design",v.ids.session_id):fe(e.contextDir,"logs",`design-${B}.log`);xt(dt(P),{recursive:!0}),e.out(`trace: ${te(P)}`),e.emit?.({type:"run_start",mode:R,trace:P,use_case:r,...v?{session:v.ids.session_id}:{}});let d=(s,c,l)=>{try{St(P,JSON.stringify({ts:new Date().toISOString(),level:s==="error"?"error":"info",run_id:v?.ids.operation_id,...v?{user_session_id:v.ids.session_id}:{},kind:s,session_id:l,data:c})+`
|
|
345
|
-
`)}catch{}v?.wireTrace(s,c,l)};{let s=e.out;if(s[mt]!==!0){let c=l=>{d("transcript",{line:l}),s(l)};c[mt]=!0,e.out=c}}if(t.resume&&i){g||(p.resume={agent_state:i.state.agent_state}),e.out(`resuming design session ${t.resume}`),i.state.assumed.length>0&&e.out(`note: ${i.state.assumed.length} default(s) were assumed while you were away \u2014 kane-cli context sessions show ${t.resume} lists them`);try{let{readRecords:s}=await import("./records-IOZTZUZV.js"),c=s(e.contextDir).records.filter(l=>l.sid===t.resume).map(l=>l.design_phase).filter(l=>l!=null&&typeof l.phase=="string");if(c.length>0){let l=c.map(m=>`${m.phase}${m.completeness==="partial"?" (partial)":""}`).join(" \u2192 "),a=`[kane] durable record for this session (${t.resume}) on ${r}: design phases already COMMITTED \u2014 ${l}. Those finalizes landed; do not re-send them. Continue from the next uncommitted phase, or finish if the design is complete.`;e={...e,initialMessage:[e.initialMessage,a].filter(Boolean).join(`
|
|
346
|
-
|
|
347
|
-
`)}}}catch{}t.message&&(e={...e,initialMessage:[e.initialMessage,t.message].filter(Boolean).join(`
|
|
348
|
-
|
|
349
|
-
`)})}let k=null,y={current:n},T={detach:null},Q=()=>{let s=T.detach;T.detach=null,s&&s()},o=(s,c)=>{let l=i;if(!l)return{};let a=s.ask,m=je({contextDir:s.contextDir,cwd:dt(s.contextDir),handle:l,note:h=>s.chat?s.chat.note(h):s.out(h),graphSlot:c,...s.now?{now:s.now}:{}});if(s.chat?.attachIngest){let h=s.chat;T.detach=h.attachIngest(async $=>{try{l.save({ingest_registry:le(l.state.ingest_registry,$,s.now?.()??new Date)});let L=await m({id:`attach-${l.state.sid}-${(l.state.ingest_registry??[]).length}`,ref:$,purpose:null});return L.ok?(h.deferBatch({source_id:L.result.source_id,cid:L.result.cid}),{ok:!0}):{ok:!1,error:L.error.message}}catch(L){return{ok:!1,error:L instanceof Error?L.message:String(L)}}})}return{ask:async h=>{let $=await a(h);if(Array.isArray($)){let L=$.filter(M=>{if(M.free_text==null||M.free_text.trim()==="")return!1;let se=h.find(ut=>ut.id===M.id);return M.selected_index!=null&&se?.options[M.selected_index]?.input===!0}).map(M=>M.free_text.trim());if(L.length>0){let M=l.state.ingest_registry;for(let se of L)M=le(M,se,s.now?.()??new Date);l.save({ingest_registry:M})}}return $},ingest:m}};e.nested||e.chat?.attachOnCommitted?.(s=>{y.current=s});let u="";if(e.chat&&!t.plan&&!e.nested){let s=Pe({contextDir:e.contextDir,graph:G(e.contextDir),sessionStamp:p.session_id,by:e.by??{kind:"human",id:"owner"}});s.errors===null||s.errors[0]?.code==="CONV_SOURCE_EXISTS"?(u=s.sourceId,e.chat.attachConversationSource?.(u),y.current=G(e.contextDir)):e.out(`warning: notes you add in chat can't be saved to the context this session (${s.errors[0]?.detail})`)}let A=G(e.contextDir),C;if(!t.plan){let s=Ee(A,r);if(E&&s!==null&&s.live){let c=A.resolve(r);C={uc_root:$e(A,c.cid),next_gen:s.gen,expected_prev_gen:s.gen}}else{let c=Ce(A,r,{...S?{force:!0}:{},because:t.because??(S?"forced redesign (--force)":void 0)});if("error"in c)return e.out(`design: ${c.error.detail}`),e.emit?.({type:"gate_refused",message:c.error.detail,code:c.error.code}),i?.release(),2;C=c}}let Y=ke(e.contextDir,p.session_id),I=null,q=()=>{try{I?.release()}catch{}};if(!t.plan)try{I=Y.acquire([xe(A,r).key],{hold:"session",verb:"design"})}catch(s){if(s instanceof ve&&s.code==="UC_HELD"){let c=s.holder,l=`design: ${r} is being designed by another session${c?.alive===!1?` \u2014 that session looks stopped; resume it with kane-cli design tests --resume ${c?.owner_sid??"<session>"}`:""} \u2014 pick another use-case (kane-cli design tests) or wait for it to finish`;return e.out(l),e.emit?.({type:"error",code:"UC_HELD",message:l}),i?.release(),2}throw s}let H={contextDir:e.contextDir,rootSid:p.session_id,locks:Y,probe:{batchSimilar:async()=>({hits:[],degraded:!1,probeBasis:null}),recheckLocal:()=>({hits:[],uncachedNewNodes:[]})}},j=!t.plan&&R!=="ci",U=()=>Object.fromEntries((n.resolve(r)?n.edgesInto(n.resolve(r).tip):[]).filter(s=>s.type==="DERIVES"&&typeof s.props.source_id=="string").map(s=>[String(s.props.source_id),n.heads.get(String(s.props.source_id))??null])),z=!1;j&&!i&&(z=!0,i=ne(e.contextDir,{sid:p.session_id,mode:"agent",created_at:F.toISOString(),expires_at:new Date(F.getTime()+1440*60*1e3).toISOString(),agent_state:{schema:2,items:[],provider_state:""},pending:{questions:[],proposals:[]},read_basis:U(),assumed:[],corpus_cursor:{remaining:[]},conv_source:u,target_pins:n.resolve(r)?[{ref:r,cid:n.resolve(r).tip}]:[],verb:"design",use_case:r,...n.resolve(r)?.tip?{uc_tip:n.resolve(r).tip}:{},...S?{force:!0}:{},...v?{user_session_id:v.ids.session_id}:{}}));let N;if(j&&i){let{resume:s,...c}=p;Re(e.contextDir,p.session_id,{schema:De,kind:"base",sid:p.session_id,verb:"design",mode:R,created_at:F.toISOString(),run_config:c,conv_source:u||i.state.conv_source||"",...r?{use_case:r}:{},...n.resolve(r)?.tip?{uc_tip:n.resolve(r).tip}:{},store_watermark:Se(e.contextDir)}),p.checkpoints=!0,t.resume&&d("resume_kind",{kind:g?g.view.pointer===null?"bare-base":g.view.pointer.at==="final"?"pause":"crash":"v1-shim"},p.session_id);let l=g?0:i.state.checkpoint?.seq??0,a=i;N=Fe({contextDir:e.contextDir,handle:a,seqBase:()=>l,peekHeldReceipts:()=>e.chat?.peekHeldReceipts?.()??[],readBasis:()=>U(),corpusCursor:()=>({remaining:[]}),onSoftCap:h=>e.out(h),onStat:h=>d("ckpt_stat",h,p.session_id),...e.now?{now:e.now}:{}});let m=N;N={...m,persist:h=>{let $=h.binding?.template_version;return typeof $=="string"&&$&&(f.current=$),m.persist(h)}}}let K=()=>{if(!i)return;let s=i.state.checkpoint;if(s){let c=R!=="interactive"?` --mode ${R}`:"";e.out(`session ${i.state.sid} kept its last checkpoint (seq ${s.seq}, ${s.ts}) \u2014 resume with: kane-cli design tests --resume ${i.state.sid}${c}`),i.release()}else if(z){try{i.complete()}catch{i.release()}try{lt(fe(e.contextDir,"sessions"))}catch{}}else i.release();i=null},W=t.plan?Rt(e.out,e.emit,d,P):at({templateVersion:()=>f.current,contextDir:e.contextDir,ucRef:r,by:{kind:"ai",id:"design-agent"},force:S,engine:"design@1",note:s=>e.chat?e.chat.note(s):e.out(s),commitLine:s=>e.chat?e.chat.ledger({kind:"commit",ok:!0,line:s}):e.out(s),steer:e.chat?s=>e.chat.submit(s):void 0,event:e.emit,resuming:E,...i?.state.force_scope?.length?{forceScope:i.state.force_scope}:{},onForceScope:s=>{k=s},...t.because?{because:t.because}:{},aliases:e.chat?s=>e.chat.registerAliases?.(s):void 0,onCommitted:s=>{y.current=s},protocol:H,...C?{generationTicket:C}:{},...E?{generationStamped:!0}:{}});e.chat||(d("design_budget",{max_pairs:_.budget.max_pairs??null,strength:_.budget.strength_override??null}),e.out(`designing: ${_.usecase.logical_id??r}`)),e.chat?.setWorking?.(`designing ${_.usecase.logical_id??r}\u2026`);let b;try{b=await ce(p,{...e,graphSlot:y,...o(e,y),...N?{checkpoint:N}:{}},new Map,n,d,W)}catch(s){throw d("error",{message:s instanceof Error?s.message:String(s),stack:s instanceof Error?s.stack:void 0},p.session_id),K(),s}finally{e.chat?.setWorking?.(null),Q()}if(b.errorCode==="binding_mismatch"&&g){let s=await e.ask([{id:"binding-mismatch",text:"this session's saved conversation is no longer accepted by the service \u2014 start the conversation fresh (committed work is kept), or stop and keep the session?",risk:"high",rationale:"the service refused the saved conversation on the first turn after resume",options:[{label:"start fresh",detail:"continue with a fresh conversation \u2014 earlier answers may be re-asked"},{label:"stop",detail:"stop here; the session stays resumable"}],recommended_index:1,allow_free_text:!1}]);if((Array.isArray(s)?s.find(a=>a.id==="binding-mismatch"):void 0)?.selected_index!==0){let a=`resume abandoned: binding mismatch on session ${p.session_id} \u2014 the session is preserved`;return e.out(a),e.emit?.({type:"error",message:a,code:"BINDING_MISMATCH"}),i?.release(),2}d("binding_migrate",{sid:p.session_id},p.session_id);let l=p.resume&&"schema"in p.resume?{...p.resume,binding:{}}:void 0;try{b=await ce({...p,...l?{resume:l}:{}},{...e,graphSlot:y,...o(e,y),...N?{checkpoint:N}:{}},new Map,n,d,W)}catch(a){throw d("error",{message:a instanceof Error?a.message:String(a),stack:a instanceof Error?a.stack:void 0},p.session_id),K(),a}finally{e.chat?.setWorking?.(null),Q()}}if(b.highRisk)return e.out(`error: ${b.highRisk.length} high-risk decision${b.highRisk.length===1?"":"s"} need a human \u2014 ci mode won't guess. Re-run with --mode agent to pause for review.`),e.emit?.({type:"error",message:`error: high-risk question(s) in ci mode (fail-closed): ${b.highRisk.map(s=>s.id).join(", ")}`,code:"HIGH_RISK_CI"}),K(),q(),1;if(b.paused){let s=i;s||(s=ne(e.contextDir,{sid:p.session_id,mode:"agent",created_at:F.toISOString(),expires_at:new Date(F.getTime()+1440*60*1e3).toISOString(),agent_state:b.paused.agent_state,pending:{questions:[],proposals:[]},read_basis:Object.fromEntries((n.resolve(r)?n.edgesInto(n.resolve(r).tip):[]).filter(a=>a.type==="DERIVES"&&typeof a.props.source_id=="string").map(a=>[String(a.props.source_id),n.heads.get(String(a.props.source_id))??null])),assumed:[],corpus_cursor:{remaining:[]},conv_source:u,target_pins:n.resolve(r)?[{ref:r,cid:n.resolve(r).tip}]:[],verb:"design",use_case:r,...n.resolve(r)?.tip?{uc_tip:n.resolve(r).tip}:{},...S?{force:!0}:{},...v?{user_session_id:v.ids.session_id}:{}}));try{S&&!s.state.force&&s.save({force:!0}),v&&s.state.user_session_id!==v.ids.session_id&&s.save({user_session_id:v.ids.session_id}),u&&s.state.conv_source!==u&&s.save({conv_source:u});let a=e.chat?.drainHeldReceipts?.()??[];(a.length>0||(s.state.held_receipts?.length??0)>0)&&s.save({held_receipts:a}),k!==null&&s.save({force_scope:k}),Me(s,b.paused)}catch(a){let m=s.state.checkpoint,h=`error: couldn't persist the pause for session ${s.state.sid}`+(m?` \u2014 last durable checkpoint: seq ${m.seq} @ ${m.ts}`:" \u2014 no durable checkpoint exists")+` (${a instanceof Error?a.message:String(a)})`;return e.out(h),e.emit?.({type:"error",message:h,code:"PAUSE_PERSIST_FAILED",sid:s.state.sid}),1}d("session_paused",{sid:s.state.sid},p.session_id);let c=R!=="interactive"?` --mode ${R}`:"",l=`kane-cli design tests --resume ${s.state.sid}${c}`;return e.out(`paused \u2014 resume with: ${l}`),e.emit?.({type:"session_paused",sid:s.state.sid,mode:R,resume:l,expires_at:s.state.expires_at,pending_questions:b.paused.pending.questions}),e.chat?.ledger?.({kind:"pause",sid:s.state.sid,expires_at:s.state.expires_at,resume:l,messageForm:`${l} --message "<your words>"`}),q(),3}if(b.crashed&&i?.state.checkpoint){let s=i.state.checkpoint,c=R!=="interactive"?` --mode ${R}`:"",l=`kane-cli design tests --resume ${i.state.sid}${c}`;return d("agent_crashed_resumable",{sid:i.state.sid,seq:s.seq},p.session_id),e.out(`agent crashed \u2014 session ${i.state.sid} is resumable at checkpoint seq ${s.seq} (at most the in-flight turn lost); resume with: ${l}`),e.emit?.({type:"session_paused",sid:i.state.sid,mode:R,resume:l,expires_at:i.state.expires_at,crashed:!0}),i.release(),i=null,3}if(b.error)return e.out(`error: design agent failed: ${b.error}`),e.emit?.({type:"error",message:`error: design agent failed: ${b.error}`}),K(),q(),1;if(b.proposal==null&&R!=="interactive")return e.out(`error: the design session stopped before saving anything \u2014 nothing committed (trace: ${P})`),e.emit?.({type:"error",message:`error: the design session stopped before saving anything \u2014 nothing committed (trace: ${P})`}),K(),q(),1;let X=0;if(b.proposal==null)try{let{readRecords:s}=await import("./records-IOZTZUZV.js"),c=t.resume??p.session_id;X=s(e.contextDir).records.filter(l=>l.sid===c).reduce((l,a)=>l+a.nodes.filter(m=>m.label!=="source").length,0)}catch{}if(b.proposal==null&&e.out(X>0?`done \u2014 ${X} item(s) committed in this session (earlier legs included); nothing new since the resume`:"done \u2014 nothing designed this session (no finalize before the session ended)"),b.assumedDefaults&&e.out(`assumed: ${b.assumedDefaults} default(s) taken while unattended`),i&&e.emit?.({type:"session_complete",sid:t.resume??p.session_id}),v?.event("ASR_SESSION_COMPLETE",{}),i?.complete(),z)try{lt(fe(e.contextDir,"sessions"))}catch{}if(!e.nested){let s=e.chat?.state.ledger.filter(a=>a.kind==="answer"&&a.receipt.form==="assumed").length??0,c=(b.assumedDefaults??0)+s,l=e.chat?.state.credits?.total??b.creditsTotal;e.chat?.ledger?.({kind:"summary",lines:[`designed: ${_.usecase.logical_id??r}${b.proposal==null?X>0?` (${X} item(s) committed across this session)`:" (nothing committed this session)":""}`,...c>0?[`${c} assumed default(s)`]:[],...l!==void 0?[`credits used: ${l.toFixed(1)}`]:[],`trace: ${te(P)}`]})}return t.plan||Ge(e.contextDir),q(),0}export{Rs as a};
|
package/dist/chunk-DBKNJRJG.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{b as f}from"./chunk-5FJJJNJK.js";import{c as g}from"./chunk-UD7KKHPW.js";import{existsSync as u}from"fs";import{dirname as d,resolve as l}from"path";import{fileURLToPath as A}from"url";var p=d(A(import.meta.url));function E(){return[l(p,".."),l(p,"../../..")]}function _(a){return{"darwin-arm64":"kane-cli-darwin-arm64","darwin-x64":"kane-cli-darwin-x64","linux-x64":"kane-cli-linux-x64","linux-arm64":"kane-cli-linux-arm64","win32-x64":"kane-cli-win-x64"}[a]??null}function k(){let a=_(`${process.platform}-${process.arch}`),n=process.platform==="win32"?"assurance-agent.exe":"assurance-agent";for(let r of E()){for(let s of a?["@testmuai","@lambdatestincprivate"]:[]){let e=l(r,"node_modules",s,a,"bin",n);if(u(e))return{cmd:e,args:[],tier:"platform"}}let o=l(r,"../assurance-agent/dist",n);if(u(o))return{cmd:o,args:[],tier:"sibling"};let t=l(r,"../assurance-agent/main.py");if(u(t)){let s=l(r,"../assurance-agent/.venv/bin/python");return{cmd:u(s)?s:"python3",args:[t],tier:"dev-python"}}}return null}function I(a,n={}){return{...process.env,...n,...f(),TESTMUAI_SOURCE:"kane-cli",TESTMUAI_SESSION_ID:a,ASSURANCE_LOG_LEVEL:process.env.ASSURANCE_LOG_LEVEL??"info"}}async function U(){if(process.env.TESTMUAI_API_KEY||process.env.TESTMUAI_BASIC_AUTH)return{};try{let{CredentialsManager:a}=await import("./credentials-YHTJGKEO.js"),n=process.env.TESTMUAI_ENV==="stage"?"stage":"prod",r=new a,o=r.getActiveProfile()??"default",t={TESTMUAI_ENV:n},s=r.loadBasicAuth(o,n);if(s)return t.TESTMUAI_BASIC_AUTH=Buffer.from(`${s.username}:${s.access_key}`,"utf8").toString("base64"),t;let e=r.loadCredentials(o,n);if(e){try{let{refreshOAuthToken:c}=await import("./token-refresh-3UYMCYG3.js");await c({creds:r,profile:o,env:n,credentials:e})}catch{}let i=r.loadCredentials(o,n)??e;if(typeof i.access_token=="string"){let c=await y(n,i.access_token);return c?(t.TESTMUAI_BASIC_AUTH=c,t):(t.TESTMUAI_API_KEY=i.access_token,t)}}return{}}catch{return{}}}var T=8e3;function m(){return g("warn: session auth may expire during long runs \u2014 if that happens, run `kane-cli login` and retry","AUTH_EXCHANGE_FAILED"),null}async function y(a,n){try{let[{getEnvironment:r},{ControllerClient:o}]=await Promise.all([import("./config-CWZV6XPT.js"),import("./controller-client-RD2YEMAH.js")]),t=new o(r(a).controllerBaseUrl,n),s;try{let e=await Promise.race([t.getTmsCredentials().catch(()=>null),new Promise(i=>{s=setTimeout(()=>i(null),T)})]);if(typeof e?.username!="string"||!e.username||typeof e.access_key!="string"||!e.access_key)return m();try{let[{refreshIdentitySnapshot:i},{telemetryEnvName:c}]=await Promise.all([import("./identity-ADZ4PAJF.js"),import("./bootstrap-NFYYRGGR.js")]);await i(c(),e)}catch{}return Buffer.from(`${e.username}:${e.access_key}`,"utf8").toString("base64")}finally{clearTimeout(s)}}catch{return m()}}export{_ as a,k as b,I as c,U as d};
|
package/dist/chunk-H32GM5G4.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as R}from"./chunk-VRLUNZAK.js";import{y as r}from"./chunk-ZUGCHQFC.js";import{a as Y}from"./chunk-HCBYKLMW.js";import{a,b as i,i as X}from"./chunk-C44QQJR4.js";import{a as G}from"./chunk-6YGTRKDT.js";import{e as P}from"./chunk-UR6MHSHU.js";var u=P(G(),1);var e=P(Y(),1),f=5;function K(t,I){if(!I)return t;let c=I.toLowerCase();return t.filter(B=>B.label.toLowerCase().includes(c))}function J(t){let{title:I,items:c,loading:B=!1,loadingText:F,error:L=null,itemNoun:T="items",onSelect:H,onCancel:E,defaultActiveId:w,onTab:y,extraHint:N}=t,[x,d]=(0,u.useState)(0),[S,g]=(0,u.useState)(0),[s,A]=(0,u.useState)(""),[C,h]=(0,u.useState)(null);(0,u.useEffect)(()=>{if(c.length===0)return;if(t.preserveSelectionById&&C!==null){let n=c.findIndex(o=>o.id===C);if(n>=0){g(Math.floor(n/f)),d(n%f);return}}let l=w?c.findIndex(n=>n.id===w):c.findIndex(n=>n.isActive);l>=0?(g(Math.floor(l/f)),d(l%f),t.preserveSelectionById&&h(c[l].id)):t.preserveSelectionById&&(g(0),d(0),h(c[0]?.id??null))},[c,w,t.preserveSelectionById,C]),(0,u.useEffect)(()=>{if(!t.onSearch)return;let l=setTimeout(()=>t.onSearch(s),t.searchDebounceMs??250);return()=>clearTimeout(l)},[s,t.onSearch,t.searchDebounceMs]);let m=t.onSearch?c:K(c,s),M=S*f,p=Math.min(M+f,m.length),D=Math.ceil(m.length/f),O=p-M,v=m.slice(M,p);return X((l,n)=>{if(L){n.escape&&E();return}if(n.escape){s?(A(""),d(0),g(0)):E();return}if(n.tab&&y){y();return}if(n.upArrow){if(x>0){let o=x-1;d(o),t.preserveSelectionById&&h(v[o]?.id??null)}else if(S>0){let o=S-1,b=f-1;g(o),d(b),t.preserveSelectionById&&h(m[o*f+b]?.id??null)}return}if(n.downArrow){if(x<O-1){let o=x+1;d(o),t.preserveSelectionById&&h(v[o]?.id??null)}else if(S<D-1){let o=S+1,b=0;g(o),d(b),t.preserveSelectionById&&h(m[o*f+b]?.id??null)}return}if(n.return&&v[x]){H(v[x]);return}if(n.backspace||n.delete){A(o=>o.slice(0,-1)),d(0),g(0);return}l&&!n.ctrl&&!n.meta&&(A(o=>o+l),d(0),g(0))},{isActive:!B}),B?(0,e.jsxs)(a,{flexDirection:"column",borderStyle:"round",borderColor:r.orange,paddingX:2,paddingY:1,children:[(0,e.jsx)(i,{color:r.orange,bold:!0,children:I}),(0,e.jsx)(a,{marginTop:1,children:(0,e.jsx)(i,{color:r.secondary,children:F??`Loading ${T}\u2026`})})]}):L?(0,e.jsxs)(a,{flexDirection:"column",borderStyle:"round",borderColor:r.red,paddingX:2,paddingY:1,children:[(0,e.jsx)(i,{color:r.red,bold:!0,children:I}),(0,e.jsx)(a,{marginTop:1,children:(0,e.jsx)(i,{color:r.red,children:L})}),(0,e.jsx)(R,{bindings:[]})]}):(0,e.jsxs)(a,{flexDirection:"column",borderStyle:"round",borderColor:r.orange,paddingX:2,paddingY:1,children:[(0,e.jsxs)(a,{children:[(0,e.jsx)(i,{color:r.orange,bold:!0,children:I}),(0,e.jsxs)(i,{color:r.dim,children:[" (",m.length,!t.onSearch&&s?`/${c.length}`:""," ",T,t.loadingMore?" \xB7 loading more":"",")"]})]}),(0,e.jsxs)(a,{marginTop:1,children:[(0,e.jsx)(i,{color:r.secondary,children:s?"filter: ":""}),s?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(i,{children:s}),(0,e.jsx)(i,{inverse:!0,children:" "})]}):(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)(i,{color:r.dim,children:["Search ",T,"\u2026"]}),(0,e.jsx)(i,{inverse:!0,children:" "})]})]}),(0,e.jsx)(a,{flexDirection:"column",marginTop:1,children:t.searching?(0,e.jsxs)(i,{color:r.secondary,children:["Searching ",T,"\u2026"]}):m.length===0?(0,e.jsxs)(i,{color:r.dim,children:["No ",T,' match "',s,'"']}):v.map((l,n)=>{let o=n===x,b=o?"\u276F ":" ",$=l.isActive?r.green:o?r.orange:void 0;return(0,e.jsxs)(i,{color:$,children:[b,l.label,l.isActive?" \u25CF selected":""]},l.id)})}),!t.searching&&D>1&&(0,e.jsx)(a,{marginTop:1,children:(0,e.jsxs)(i,{color:r.dim,children:["Page ",S+1,"/",D]})}),t.footer&&(0,e.jsx)(a,{marginTop:1,flexDirection:"column",children:t.footer}),(0,e.jsx)(R,{bindings:[{keys:"\u2191\u2193",label:"navigate"},{keys:"type",label:"to search"},{keys:"\u21B5",label:"select"},...y&&N?[{keys:"tab",label:N}]:[]],escBackLabel:s?"clear":"back to chat"})]})}export{J as a};
|