@namzu/cli 41.0.0 → 41.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +42 -0
- package/dist/bin.js +1 -1
- package/dist/chunks/{acp-CLFVQCFH.js → acp-ZNDDGL4A.js} +40 -35
- package/dist/chunks/acp-ZNDDGL4A.js.map +6 -0
- package/dist/chunks/{activity-command-XULXEUGH.js → activity-command-IGRDHYFY.js} +12 -11
- package/dist/chunks/activity-command-IGRDHYFY.js.map +6 -0
- package/dist/chunks/{add-BALM5DGZ.js → add-DKDPH2O7.js} +20 -19
- package/dist/chunks/add-DKDPH2O7.js.map +6 -0
- package/dist/chunks/{agent-CLYE4KWV.js → agent-5MAZW7PD.js} +31 -26
- package/dist/chunks/agent-session-SY5BWKNS.js +59 -0
- package/dist/chunks/{archive-FWXFWMZJ.js → archive-3PH42KH6.js} +10 -9
- package/dist/chunks/archive-3PH42KH6.js.map +6 -0
- package/dist/chunks/{bin-main-HO4CMSMY.js → bin-main-YJBHUBGV.js} +3 -3
- package/dist/chunks/{browser-Z46YPGWH.js → browser-DYA5FWWB.js} +6 -6
- package/dist/chunks/{chat-NOXE5RTE.js → chat-W7G4NIMV.js} +15 -14
- package/dist/chunks/chat-W7G4NIMV.js.map +6 -0
- package/dist/chunks/{chunk-BPRT5LV7.js → chunk-24CZYMWP.js} +2 -2
- package/dist/chunks/{chunk-V4PHIKLW.js → chunk-2F4BARJH.js} +2 -2
- package/dist/chunks/{chunk-SPZWLMZY.js → chunk-2X5QU773.js} +3 -3
- package/dist/chunks/{chunk-PKLBJMCY.js → chunk-3RSNEZOX.js} +4 -4
- package/dist/chunks/{chunk-B2RMIYPZ.js → chunk-4OHKGKUE.js} +4 -4
- package/dist/chunks/{chunk-NQGMYAXK.js → chunk-56MTJMCE.js} +3 -3
- package/dist/chunks/{chunk-AX4Z3H7N.js → chunk-5CF5NKWH.js} +2 -2
- package/dist/chunks/{chunk-IR3AZZFJ.js → chunk-5ND5QQDO.js} +15 -19
- package/dist/chunks/chunk-5ND5QQDO.js.map +6 -0
- package/dist/chunks/{chunk-WV7XGYNQ.js → chunk-64BXKXCY.js} +5 -5
- package/dist/chunks/{chunk-YXZBHG5N.js → chunk-6DY377DD.js} +333 -42
- package/dist/chunks/chunk-6DY377DD.js.map +6 -0
- package/dist/chunks/{chunk-B6BQ5ULO.js → chunk-72SF2UK7.js} +2 -2
- package/dist/chunks/chunk-7AAONVMX.js +406 -0
- package/dist/chunks/chunk-7AAONVMX.js.map +6 -0
- package/dist/chunks/{chunk-HE7K6IZ2.js → chunk-7UHIIE6W.js} +50 -30
- package/dist/chunks/chunk-7UHIIE6W.js.map +6 -0
- package/dist/chunks/{chunk-KD4Q2INM.js → chunk-7Y6IIRSM.js} +2 -2
- package/dist/chunks/{chunk-5OVI35QS.js → chunk-ABTQVE2K.js} +3 -3
- package/dist/chunks/{chunk-4JQUY3DT.js → chunk-BO4VL25F.js} +2 -2
- package/dist/chunks/{chunk-SEYEOYMT.js → chunk-BPLY6HCD.js} +4 -4
- package/dist/chunks/{chunk-O6FOUL5S.js → chunk-DSW5QXUB.js} +4 -4
- package/dist/chunks/{chunk-YGV3VBYL.js → chunk-E5FAPPFH.js} +2 -2
- package/dist/chunks/{chunk-AGN45S6D.js → chunk-EAQJSEKA.js} +2 -2
- package/dist/chunks/{chunk-OUQEMJ26.js → chunk-ELVAEMBF.js} +3 -3
- package/dist/chunks/{chunk-XWLQH2NW.js → chunk-FTBXHPCM.js} +19 -19
- package/dist/chunks/chunk-FVHJPEJU.js +403 -0
- package/dist/chunks/chunk-FVHJPEJU.js.map +6 -0
- package/dist/chunks/{chunk-3WAQN6DX.js → chunk-G5747QGU.js} +2 -2
- package/dist/chunks/{chunk-MNDFPZVQ.js → chunk-GFBEQZGH.js} +3 -3
- package/dist/chunks/{chunk-XRX3DHEW.js → chunk-GR7FEYP5.js} +4 -4
- package/dist/chunks/{chunk-4GJSW2KC.js → chunk-HKY44MS7.js} +18 -18
- package/dist/chunks/{chunk-4GJSW2KC.js.map → chunk-HKY44MS7.js.map} +2 -2
- package/dist/chunks/{chunk-EL6GXINV.js → chunk-HPBQLE3Y.js} +2 -2
- package/dist/chunks/chunk-ITSVWCSR.js +197 -0
- package/dist/chunks/chunk-ITSVWCSR.js.map +6 -0
- package/dist/chunks/chunk-KES7QU4W.js +56 -0
- package/dist/chunks/chunk-KES7QU4W.js.map +6 -0
- package/dist/chunks/{chunk-SMR6TQN2.js → chunk-KSWPRDI2.js} +2 -2
- package/dist/chunks/{chunk-MDG3THRR.js → chunk-L3NHCRUZ.js} +2 -2
- package/dist/chunks/chunk-LCGXWCVU.js +28 -0
- package/dist/chunks/chunk-LCGXWCVU.js.map +6 -0
- package/dist/chunks/{chunk-37S7MY2T.js → chunk-LSHPFJKI.js} +69 -4
- package/dist/chunks/chunk-LSHPFJKI.js.map +6 -0
- package/dist/chunks/{chunk-M5RW7JBV.js → chunk-LXGH4QBJ.js} +9 -9
- package/dist/chunks/{chunk-FLYE25VX.js → chunk-M7TGNC4F.js} +2 -2
- package/dist/chunks/{chunk-6RNVFKSZ.js → chunk-MIPMLOJ4.js} +3 -3
- package/dist/chunks/{chunk-QSDPQR3F.js → chunk-MOUJITK2.js} +3 -3
- package/dist/chunks/{chunk-K5OXOYM5.js → chunk-NWTFQJZI.js} +32245 -31293
- package/dist/chunks/chunk-NWTFQJZI.js.map +6 -0
- package/dist/chunks/{chunk-G4LCCGQR.js → chunk-OS33YOPX.js} +2 -2
- package/dist/chunks/{chunk-65CAAE7I.js → chunk-P4BH5CLU.js} +4 -4
- package/dist/chunks/{chunk-CBL2FUHG.js → chunk-P7PEG3T2.js} +2 -2
- package/dist/chunks/{chunk-SE5UKEXD.js → chunk-PJQJZFYF.js} +2 -2
- package/dist/chunks/{chunk-VUZYMKPD.js → chunk-PUXPTJMD.js} +7 -7
- package/dist/chunks/{chunk-QY77MJS4.js → chunk-R5FI7ST2.js} +4 -4
- package/dist/chunks/{chunk-PSZ44BRO.js → chunk-RT7XM57Q.js} +4 -4
- package/dist/chunks/{chunk-PPZKCA6K.js → chunk-RVEF2EUC.js} +2 -2
- package/dist/chunks/{chunk-WZPN6PWE.js → chunk-S7L7KHGT.js} +7 -7
- package/dist/chunks/{chunk-WQRBEQ2P.js → chunk-TBQRTGCQ.js} +2 -2
- package/dist/chunks/{chunk-RWOPUQNS.js → chunk-TRX6W6TD.js} +2 -2
- package/dist/chunks/{chunk-V2ZSQXYQ.js → chunk-TTEKFLTN.js} +8 -8
- package/dist/chunks/{chunk-DMPPM3IA.js → chunk-UJVN6557.js} +3 -3
- package/dist/chunks/{chunk-V2NG7LLL.js → chunk-UOPSAWJE.js} +9 -50
- package/dist/chunks/chunk-UOPSAWJE.js.map +6 -0
- package/dist/chunks/{chunk-AOHJCFG3.js → chunk-VEB3EYJK.js} +2 -2
- package/dist/chunks/{chunk-P3JHLZH4.js → chunk-VHSRFBTI.js} +2 -2
- package/dist/chunks/{chunk-6CCX6DPQ.js → chunk-VJZ4NHWX.js} +2 -2
- package/dist/chunks/{chunk-AUZB4LKS.js → chunk-VXJFOQIO.js} +4 -4
- package/dist/chunks/{chunk-JSGZ4V7Y.js → chunk-VYJUJQ4H.js} +2 -2
- package/dist/chunks/{chunk-O6JILDEY.js → chunk-XBEW7SQB.js} +6 -6
- package/dist/chunks/{chunk-PTJI2QA4.js → chunk-XKFG3473.js} +3 -3
- package/dist/chunks/chunk-XTSD7XEF.js +609 -0
- package/dist/chunks/chunk-XTSD7XEF.js.map +6 -0
- package/dist/chunks/{chunk-WLAVNIFG.js → chunk-YL2SBQDK.js} +3 -3
- package/dist/chunks/{chunk-MZI4TLFB.js → chunk-Z37S7NJH.js} +22 -20
- package/dist/chunks/chunk-Z37S7NJH.js.map +6 -0
- package/dist/chunks/{chunk-PDZZ64IH.js → chunk-ZZIK6J3Q.js} +26 -201
- package/dist/chunks/chunk-ZZIK6J3Q.js.map +6 -0
- package/dist/chunks/{cli-runtime-5H7CTXF2.js → cli-runtime-CBVA2QU3.js} +11 -10
- package/dist/chunks/cli-runtime-CBVA2QU3.js.map +6 -0
- package/dist/chunks/{commands-XC67PG6L.js → commands-7KVEJYKS.js} +5 -5
- package/dist/chunks/{crash-report-UE423ET4.js → crash-report-NXFD4VH5.js} +6 -6
- package/dist/chunks/{dist-SY7OYS74.js → dist-6LIEN5YB.js} +2 -2
- package/dist/chunks/{dist-DSK2VZQB.js → dist-CUCXA33N.js} +2 -2
- package/dist/chunks/{dist-YZRXSX7C.js → dist-FRHHWOOW.js} +2 -2
- package/dist/chunks/{dist-DCOPEJDN.js → dist-HTMWZWBC.js} +2 -2
- package/dist/chunks/{dist-SN7QXPO2.js → dist-JZXBY5D3.js} +2 -2
- package/dist/chunks/{dist-4ACX6FL7.js → dist-KURG5KLO.js} +2 -2
- package/dist/chunks/{dist-OXUHOXCU.js → dist-VQIK2TS3.js} +2 -2
- package/dist/chunks/{doctor-VCCIYKNL.js → doctor-B3TR2C6U.js} +9 -9
- package/dist/chunks/{drain-QKEXEMCO.js → drain-YWRSLFBO.js} +10 -10
- package/dist/chunks/{eval-K47YMZVT.js → eval-BP6U5TEX.js} +2 -2
- package/dist/chunks/{exec-K3LRQU6R.js → exec-Y6TR57J4.js} +30 -27
- package/dist/chunks/exec-Y6TR57J4.js.map +6 -0
- package/dist/chunks/{home-OSHELFKX.js → home-HVHU4PVC.js} +3 -3
- package/dist/chunks/{host-queries-TV3XH3YV.js → host-queries-W7ATBLK2.js} +15 -14
- package/dist/chunks/host-queries-W7ATBLK2.js.map +6 -0
- package/dist/chunks/learn-WM5TTHUD.js +92 -0
- package/dist/chunks/learn-WM5TTHUD.js.map +6 -0
- package/dist/chunks/learn-builtin-RXNSBTBC.js +235 -0
- package/dist/chunks/learn-builtin-RXNSBTBC.js.map +6 -0
- package/dist/chunks/{lifecycle-R3QWZ664.js → lifecycle-SHRBIHQV.js} +26 -24
- package/dist/chunks/{list-L5QFDBPX.js → list-WB7ULXJM.js} +21 -20
- package/dist/chunks/list-WB7ULXJM.js.map +6 -0
- package/dist/chunks/{login-N4EO2F45.js → login-PDYMJ6JR.js} +8 -8
- package/dist/chunks/{logs-264INNUN.js → logs-5X7RTN2P.js} +4 -4
- package/dist/chunks/{mcp-7H3G3KLD.js → mcp-R4ZVPY23.js} +17 -16
- package/dist/chunks/mcp-R4ZVPY23.js.map +6 -0
- package/dist/chunks/{message-command-JOQ24TAL.js → message-command-PHYRUQCA.js} +37 -32
- package/dist/chunks/message-command-PHYRUQCA.js.map +6 -0
- package/dist/chunks/{operator-tools-O2MDVMJP.js → operator-tools-VBLGZWBL.js} +13 -12
- package/dist/chunks/operator-tools-VBLGZWBL.js.map +6 -0
- package/dist/chunks/{output-schema-LKM35JS4.js → output-schema-4H5YYW34.js} +3 -3
- package/dist/chunks/{pal-N56IUOUP.js → pal-7LGE7ORS.js} +11 -11
- package/dist/chunks/{providers-B352G4OM.js → providers-APLUKR7Z.js} +6 -6
- package/dist/chunks/{resident-SMWDKMJP.js → resident-COJTHT7K.js} +50 -335
- package/dist/chunks/resident-COJTHT7K.js.map +6 -0
- package/dist/chunks/resume-DL73LUH6.js +23 -0
- package/dist/chunks/{resume-command-OHQBIY5P.js → resume-command-CCEBJXTF.js} +4 -4
- package/dist/chunks/{schedule-VHP2VGEF.js → schedule-3MVCIZZS.js} +8 -8
- package/dist/chunks/{service-RHWPRJJO.js → service-OAKQZBBF.js} +31 -29
- package/dist/chunks/service-OAKQZBBF.js.map +6 -0
- package/dist/chunks/session-step-HOLKYCG2.js +30 -0
- package/dist/chunks/{skills-JS3FQPHU.js → skills-ZXEEIGHF.js} +8 -8
- package/dist/chunks/{state-A56X2FGB.js → state-ETXYDF3L.js} +2 -2
- package/dist/chunks/{store-IMV6NZTT.js → store-HJFAIW4G.js} +10 -9
- package/dist/chunks/{store-WJEK5ZI2.js → store-MKUMQQBF.js} +6 -6
- package/dist/chunks/{store-SEPPZ7H6.js → store-ODVHN3VE.js} +4 -4
- package/dist/chunks/{tui-BP7MYQG2.js → tui-WTLNGZ3U.js} +115 -68
- package/dist/chunks/tui-WTLNGZ3U.js.map +6 -0
- package/dist/chunks/{upgrade-2A7CIVAY.js → upgrade-OV2AFIZR.js} +2 -2
- package/dist/chunks/{worktree-ERUU4NVZ.js → worktree-3QCDPF3N.js} +12 -11
- package/dist/chunks/worktree-3QCDPF3N.js.map +6 -0
- package/dist/cli.d.ts.map +1 -1
- package/dist/commands/exec-json.d.ts.map +1 -1
- package/dist/commands/exec.d.ts.map +1 -1
- package/dist/commands/learn-builtin.d.ts +8 -0
- package/dist/commands/learn-builtin.d.ts.map +1 -0
- package/dist/commands/learn.d.ts +9 -0
- package/dist/commands/learn.d.ts.map +1 -0
- package/dist/commands/learning.d.ts +6 -0
- package/dist/commands/learning.d.ts.map +1 -0
- package/dist/commands/manifest.d.ts +2 -0
- package/dist/commands/manifest.d.ts.map +1 -1
- package/dist/commands/resident.d.ts +2 -0
- package/dist/commands/resident.d.ts.map +1 -1
- package/dist/config/learning-generator.d.ts +13 -0
- package/dist/config/learning-generator.d.ts.map +1 -0
- package/dist/config/load.d.ts.map +1 -1
- package/dist/config/schema.d.ts +23 -0
- package/dist/config/schema.d.ts.map +1 -1
- package/dist/context/doctrine.d.ts.map +1 -1
- package/dist/context/environment.d.ts.map +1 -1
- package/dist/index.js +14 -13
- package/dist/integrations/learning/generator-run.d.ts +43 -0
- package/dist/integrations/learning/generator-run.d.ts.map +1 -0
- package/dist/integrations/learning/generator-settings.d.ts +25 -0
- package/dist/integrations/learning/generator-settings.d.ts.map +1 -0
- package/dist/integrations/learning/generator-state.d.ts +28 -0
- package/dist/integrations/learning/generator-state.d.ts.map +1 -0
- package/dist/integrations/learning/generator-trigger.d.ts +58 -0
- package/dist/integrations/learning/generator-trigger.d.ts.map +1 -0
- package/dist/integrations/learning/guidance-history.d.ts +45 -0
- package/dist/integrations/learning/guidance-history.d.ts.map +1 -0
- package/dist/integrations/learning/learned-notice.d.ts +11 -0
- package/dist/integrations/learning/learned-notice.d.ts.map +1 -0
- package/dist/integrations/learning/learning-model.d.ts +26 -0
- package/dist/integrations/learning/learning-model.d.ts.map +1 -0
- package/dist/integrations/learning/project-guidance.d.ts +11 -0
- package/dist/integrations/learning/project-guidance.d.ts.map +1 -0
- package/dist/integrations/learning/scenario-evaluator.d.ts +84 -0
- package/dist/integrations/learning/scenario-evaluator.d.ts.map +1 -0
- package/dist/integrations/learning/scenarios.d.ts +42 -0
- package/dist/integrations/learning/scenarios.d.ts.map +1 -0
- package/dist/integrations/learning/session-feed.d.ts +110 -0
- package/dist/integrations/learning/session-feed.d.ts.map +1 -0
- package/dist/integrations/learning/session-store.d.ts +22 -0
- package/dist/integrations/learning/session-store.d.ts.map +1 -0
- package/dist/integrations/learning/sources.d.ts +4 -0
- package/dist/integrations/learning/sources.d.ts.map +1 -0
- package/dist/integrations/resident/learning-storage.d.ts +2 -2
- package/dist/integrations/resident/learning-storage.d.ts.map +1 -1
- package/dist/integrations/resident/runner-worker.js +22 -19
- package/dist/integrations/resident/runner-worker.js.map +1 -1
- package/dist/integrations/resident/session-step.d.ts.map +1 -1
- package/dist/integrations/subagents/runtime.d.ts.map +1 -1
- package/dist/integrations/workflows/offering.d.ts.map +1 -1
- package/dist/reminders/index.d.ts.map +1 -1
- package/dist/reminders/mode.d.ts +8 -1
- package/dist/reminders/mode.d.ts.map +1 -1
- package/dist/tui/App.d.ts.map +1 -1
- package/dist/tui/agent.d.ts +31 -0
- package/dist/tui/agent.d.ts.map +1 -1
- package/dist/tui/types.d.ts +5 -0
- package/dist/tui/types.d.ts.map +1 -1
- package/package.json +5 -5
- package/dist/chunks/acp-CLFVQCFH.js.map +0 -6
- package/dist/chunks/activity-command-XULXEUGH.js.map +0 -6
- package/dist/chunks/add-BALM5DGZ.js.map +0 -6
- package/dist/chunks/agent-session-2MVAYKJC.js +0 -54
- package/dist/chunks/archive-FWXFWMZJ.js.map +0 -6
- package/dist/chunks/chat-NOXE5RTE.js.map +0 -6
- package/dist/chunks/chunk-37S7MY2T.js.map +0 -6
- package/dist/chunks/chunk-HE7K6IZ2.js.map +0 -6
- package/dist/chunks/chunk-IR3AZZFJ.js.map +0 -6
- package/dist/chunks/chunk-K5OXOYM5.js.map +0 -6
- package/dist/chunks/chunk-MZI4TLFB.js.map +0 -6
- package/dist/chunks/chunk-PDZZ64IH.js.map +0 -6
- package/dist/chunks/chunk-V2NG7LLL.js.map +0 -6
- package/dist/chunks/chunk-YXZBHG5N.js.map +0 -6
- package/dist/chunks/cli-runtime-5H7CTXF2.js.map +0 -6
- package/dist/chunks/exec-K3LRQU6R.js.map +0 -6
- package/dist/chunks/host-queries-TV3XH3YV.js.map +0 -6
- package/dist/chunks/list-L5QFDBPX.js.map +0 -6
- package/dist/chunks/mcp-7H3G3KLD.js.map +0 -6
- package/dist/chunks/message-command-JOQ24TAL.js.map +0 -6
- package/dist/chunks/operator-tools-O2MDVMJP.js.map +0 -6
- package/dist/chunks/resident-SMWDKMJP.js.map +0 -6
- package/dist/chunks/resume-EXHKGQII.js +0 -22
- package/dist/chunks/service-RHWPRJJO.js.map +0 -6
- package/dist/chunks/session-step-NJRR3Q2L.js +0 -30
- package/dist/chunks/tui-BP7MYQG2.js.map +0 -6
- package/dist/chunks/worktree-ERUU4NVZ.js.map +0 -6
- package/dist/commands/resident-learning.d.ts +0 -6
- package/dist/commands/resident-learning.d.ts.map +0 -1
- package/dist/integrations/resident/learning-sources.d.ts +0 -4
- package/dist/integrations/resident/learning-sources.d.ts.map +0 -1
- /package/dist/chunks/{agent-CLYE4KWV.js.map → agent-5MAZW7PD.js.map} +0 -0
- /package/dist/chunks/{agent-session-2MVAYKJC.js.map → agent-session-SY5BWKNS.js.map} +0 -0
- /package/dist/chunks/{bin-main-HO4CMSMY.js.map → bin-main-YJBHUBGV.js.map} +0 -0
- /package/dist/chunks/{browser-Z46YPGWH.js.map → browser-DYA5FWWB.js.map} +0 -0
- /package/dist/chunks/{chunk-BPRT5LV7.js.map → chunk-24CZYMWP.js.map} +0 -0
- /package/dist/chunks/{chunk-V4PHIKLW.js.map → chunk-2F4BARJH.js.map} +0 -0
- /package/dist/chunks/{chunk-SPZWLMZY.js.map → chunk-2X5QU773.js.map} +0 -0
- /package/dist/chunks/{chunk-PKLBJMCY.js.map → chunk-3RSNEZOX.js.map} +0 -0
- /package/dist/chunks/{chunk-B2RMIYPZ.js.map → chunk-4OHKGKUE.js.map} +0 -0
- /package/dist/chunks/{chunk-NQGMYAXK.js.map → chunk-56MTJMCE.js.map} +0 -0
- /package/dist/chunks/{chunk-AX4Z3H7N.js.map → chunk-5CF5NKWH.js.map} +0 -0
- /package/dist/chunks/{chunk-WV7XGYNQ.js.map → chunk-64BXKXCY.js.map} +0 -0
- /package/dist/chunks/{chunk-B6BQ5ULO.js.map → chunk-72SF2UK7.js.map} +0 -0
- /package/dist/chunks/{chunk-KD4Q2INM.js.map → chunk-7Y6IIRSM.js.map} +0 -0
- /package/dist/chunks/{chunk-5OVI35QS.js.map → chunk-ABTQVE2K.js.map} +0 -0
- /package/dist/chunks/{chunk-4JQUY3DT.js.map → chunk-BO4VL25F.js.map} +0 -0
- /package/dist/chunks/{chunk-SEYEOYMT.js.map → chunk-BPLY6HCD.js.map} +0 -0
- /package/dist/chunks/{chunk-O6FOUL5S.js.map → chunk-DSW5QXUB.js.map} +0 -0
- /package/dist/chunks/{chunk-YGV3VBYL.js.map → chunk-E5FAPPFH.js.map} +0 -0
- /package/dist/chunks/{chunk-AGN45S6D.js.map → chunk-EAQJSEKA.js.map} +0 -0
- /package/dist/chunks/{chunk-OUQEMJ26.js.map → chunk-ELVAEMBF.js.map} +0 -0
- /package/dist/chunks/{chunk-XWLQH2NW.js.map → chunk-FTBXHPCM.js.map} +0 -0
- /package/dist/chunks/{chunk-3WAQN6DX.js.map → chunk-G5747QGU.js.map} +0 -0
- /package/dist/chunks/{chunk-MNDFPZVQ.js.map → chunk-GFBEQZGH.js.map} +0 -0
- /package/dist/chunks/{chunk-XRX3DHEW.js.map → chunk-GR7FEYP5.js.map} +0 -0
- /package/dist/chunks/{chunk-EL6GXINV.js.map → chunk-HPBQLE3Y.js.map} +0 -0
- /package/dist/chunks/{chunk-SMR6TQN2.js.map → chunk-KSWPRDI2.js.map} +0 -0
- /package/dist/chunks/{chunk-MDG3THRR.js.map → chunk-L3NHCRUZ.js.map} +0 -0
- /package/dist/chunks/{chunk-M5RW7JBV.js.map → chunk-LXGH4QBJ.js.map} +0 -0
- /package/dist/chunks/{chunk-FLYE25VX.js.map → chunk-M7TGNC4F.js.map} +0 -0
- /package/dist/chunks/{chunk-6RNVFKSZ.js.map → chunk-MIPMLOJ4.js.map} +0 -0
- /package/dist/chunks/{chunk-QSDPQR3F.js.map → chunk-MOUJITK2.js.map} +0 -0
- /package/dist/chunks/{chunk-G4LCCGQR.js.map → chunk-OS33YOPX.js.map} +0 -0
- /package/dist/chunks/{chunk-65CAAE7I.js.map → chunk-P4BH5CLU.js.map} +0 -0
- /package/dist/chunks/{chunk-CBL2FUHG.js.map → chunk-P7PEG3T2.js.map} +0 -0
- /package/dist/chunks/{chunk-SE5UKEXD.js.map → chunk-PJQJZFYF.js.map} +0 -0
- /package/dist/chunks/{chunk-VUZYMKPD.js.map → chunk-PUXPTJMD.js.map} +0 -0
- /package/dist/chunks/{chunk-QY77MJS4.js.map → chunk-R5FI7ST2.js.map} +0 -0
- /package/dist/chunks/{chunk-PSZ44BRO.js.map → chunk-RT7XM57Q.js.map} +0 -0
- /package/dist/chunks/{chunk-PPZKCA6K.js.map → chunk-RVEF2EUC.js.map} +0 -0
- /package/dist/chunks/{chunk-WZPN6PWE.js.map → chunk-S7L7KHGT.js.map} +0 -0
- /package/dist/chunks/{chunk-WQRBEQ2P.js.map → chunk-TBQRTGCQ.js.map} +0 -0
- /package/dist/chunks/{chunk-RWOPUQNS.js.map → chunk-TRX6W6TD.js.map} +0 -0
- /package/dist/chunks/{chunk-V2ZSQXYQ.js.map → chunk-TTEKFLTN.js.map} +0 -0
- /package/dist/chunks/{chunk-DMPPM3IA.js.map → chunk-UJVN6557.js.map} +0 -0
- /package/dist/chunks/{chunk-AOHJCFG3.js.map → chunk-VEB3EYJK.js.map} +0 -0
- /package/dist/chunks/{chunk-P3JHLZH4.js.map → chunk-VHSRFBTI.js.map} +0 -0
- /package/dist/chunks/{chunk-6CCX6DPQ.js.map → chunk-VJZ4NHWX.js.map} +0 -0
- /package/dist/chunks/{chunk-AUZB4LKS.js.map → chunk-VXJFOQIO.js.map} +0 -0
- /package/dist/chunks/{chunk-JSGZ4V7Y.js.map → chunk-VYJUJQ4H.js.map} +0 -0
- /package/dist/chunks/{chunk-O6JILDEY.js.map → chunk-XBEW7SQB.js.map} +0 -0
- /package/dist/chunks/{chunk-PTJI2QA4.js.map → chunk-XKFG3473.js.map} +0 -0
- /package/dist/chunks/{chunk-WLAVNIFG.js.map → chunk-YL2SBQDK.js.map} +0 -0
- /package/dist/chunks/{commands-XC67PG6L.js.map → commands-7KVEJYKS.js.map} +0 -0
- /package/dist/chunks/{crash-report-UE423ET4.js.map → crash-report-NXFD4VH5.js.map} +0 -0
- /package/dist/chunks/{dist-SY7OYS74.js.map → dist-6LIEN5YB.js.map} +0 -0
- /package/dist/chunks/{dist-DSK2VZQB.js.map → dist-CUCXA33N.js.map} +0 -0
- /package/dist/chunks/{dist-YZRXSX7C.js.map → dist-FRHHWOOW.js.map} +0 -0
- /package/dist/chunks/{dist-DCOPEJDN.js.map → dist-HTMWZWBC.js.map} +0 -0
- /package/dist/chunks/{dist-SN7QXPO2.js.map → dist-JZXBY5D3.js.map} +0 -0
- /package/dist/chunks/{dist-4ACX6FL7.js.map → dist-KURG5KLO.js.map} +0 -0
- /package/dist/chunks/{dist-OXUHOXCU.js.map → dist-VQIK2TS3.js.map} +0 -0
- /package/dist/chunks/{doctor-VCCIYKNL.js.map → doctor-B3TR2C6U.js.map} +0 -0
- /package/dist/chunks/{drain-QKEXEMCO.js.map → drain-YWRSLFBO.js.map} +0 -0
- /package/dist/chunks/{eval-K47YMZVT.js.map → eval-BP6U5TEX.js.map} +0 -0
- /package/dist/chunks/{home-OSHELFKX.js.map → home-HVHU4PVC.js.map} +0 -0
- /package/dist/chunks/{lifecycle-R3QWZ664.js.map → lifecycle-SHRBIHQV.js.map} +0 -0
- /package/dist/chunks/{login-N4EO2F45.js.map → login-PDYMJ6JR.js.map} +0 -0
- /package/dist/chunks/{logs-264INNUN.js.map → logs-5X7RTN2P.js.map} +0 -0
- /package/dist/chunks/{output-schema-LKM35JS4.js.map → output-schema-4H5YYW34.js.map} +0 -0
- /package/dist/chunks/{pal-N56IUOUP.js.map → pal-7LGE7ORS.js.map} +0 -0
- /package/dist/chunks/{providers-B352G4OM.js.map → providers-APLUKR7Z.js.map} +0 -0
- /package/dist/chunks/{resume-EXHKGQII.js.map → resume-DL73LUH6.js.map} +0 -0
- /package/dist/chunks/{resume-command-OHQBIY5P.js.map → resume-command-CCEBJXTF.js.map} +0 -0
- /package/dist/chunks/{schedule-VHP2VGEF.js.map → schedule-3MVCIZZS.js.map} +0 -0
- /package/dist/chunks/{session-step-NJRR3Q2L.js.map → session-step-HOLKYCG2.js.map} +0 -0
- /package/dist/chunks/{skills-JS3FQPHU.js.map → skills-ZXEEIGHF.js.map} +0 -0
- /package/dist/chunks/{state-A56X2FGB.js.map → state-ETXYDF3L.js.map} +0 -0
- /package/dist/chunks/{store-IMV6NZTT.js.map → store-HJFAIW4G.js.map} +0 -0
- /package/dist/chunks/{store-SEPPZ7H6.js.map → store-MKUMQQBF.js.map} +0 -0
- /package/dist/chunks/{store-WJEK5ZI2.js.map → store-ODVHN3VE.js.map} +0 -0
- /package/dist/chunks/{upgrade-2A7CIVAY.js.map → upgrade-OV2AFIZR.js.map} +0 -0
|
@@ -0,0 +1,403 @@
|
|
|
1
|
+
import { createRequire as __namzuCreateRequire } from 'node:module';
|
|
2
|
+
const require = __namzuCreateRequire(import.meta.url);
|
|
3
|
+
import {
|
|
4
|
+
decideHeadlessTrust
|
|
5
|
+
} from "./chunk-TBQRTGCQ.js";
|
|
6
|
+
import {
|
|
7
|
+
SESSION_AGENT_KEY,
|
|
8
|
+
openProjectGuidance,
|
|
9
|
+
sessionLearningStore
|
|
10
|
+
} from "./chunk-7AAONVMX.js";
|
|
11
|
+
import {
|
|
12
|
+
Command
|
|
13
|
+
} from "./chunk-MZP6SH3M.js";
|
|
14
|
+
import {
|
|
15
|
+
EXIT_UNTRUSTED,
|
|
16
|
+
EXIT_USAGE
|
|
17
|
+
} from "./chunk-Y7B67G22.js";
|
|
18
|
+
import {
|
|
19
|
+
resolveWorkingDirectory
|
|
20
|
+
} from "./chunk-GFBEQZGH.js";
|
|
21
|
+
import {
|
|
22
|
+
lookupResident,
|
|
23
|
+
residentDirectoryFor
|
|
24
|
+
} from "./chunk-ITSVWCSR.js";
|
|
25
|
+
import {
|
|
26
|
+
ensurePrivateStateDirectory
|
|
27
|
+
} from "./chunk-2F4BARJH.js";
|
|
28
|
+
import {
|
|
29
|
+
SqliteLearningStore,
|
|
30
|
+
runStoredLearningCycle,
|
|
31
|
+
runStoredLearningFromObservations
|
|
32
|
+
} from "./chunk-NWTFQJZI.js";
|
|
33
|
+
import {
|
|
34
|
+
__name
|
|
35
|
+
} from "./chunk-76FLAFCG.js";
|
|
36
|
+
|
|
37
|
+
// src/commands/learning.ts
|
|
38
|
+
import { lstatSync as lstatSync2 } from "node:fs";
|
|
39
|
+
import { realpath } from "node:fs/promises";
|
|
40
|
+
import { resolve } from "node:path";
|
|
41
|
+
import { pathToFileURL } from "node:url";
|
|
42
|
+
import { stripVTControlCharacters } from "node:util";
|
|
43
|
+
|
|
44
|
+
// src/integrations/resident/learning-storage.ts
|
|
45
|
+
import { existsSync, lstatSync } from "node:fs";
|
|
46
|
+
import { join } from "node:path";
|
|
47
|
+
function residentLearningStore(resident, readOnly = false) {
|
|
48
|
+
const agentRoot = residentDirectoryFor(resident.root, resident.slug, resident.agentKey);
|
|
49
|
+
const databasePath = join(agentRoot, "learning.sqlite");
|
|
50
|
+
const artifactsPath = join(agentRoot, "artifacts");
|
|
51
|
+
if (readOnly) {
|
|
52
|
+
for (const directory of [agentRoot, artifactsPath]) {
|
|
53
|
+
if (!existsSync(directory)) continue;
|
|
54
|
+
const entry = lstatSync(directory);
|
|
55
|
+
if (!entry.isDirectory() || entry.isSymbolicLink())
|
|
56
|
+
throw new Error(`Learning state requires a real directory: ${directory}`);
|
|
57
|
+
}
|
|
58
|
+
if (!existsSync(databasePath)) return null;
|
|
59
|
+
} else {
|
|
60
|
+
ensurePrivateStateDirectory(agentRoot, "artifacts");
|
|
61
|
+
}
|
|
62
|
+
for (const file of [
|
|
63
|
+
databasePath,
|
|
64
|
+
`${databasePath}-journal`,
|
|
65
|
+
`${databasePath}-wal`,
|
|
66
|
+
`${databasePath}-shm`
|
|
67
|
+
]) {
|
|
68
|
+
let entry;
|
|
69
|
+
try {
|
|
70
|
+
entry = lstatSync(file);
|
|
71
|
+
} catch (error) {
|
|
72
|
+
if (error.code === "ENOENT") continue;
|
|
73
|
+
throw error;
|
|
74
|
+
}
|
|
75
|
+
if (!entry.isFile() || entry.isSymbolicLink() || entry.nlink !== 1)
|
|
76
|
+
throw new Error(`Learning database requires a private regular file: ${file}`);
|
|
77
|
+
}
|
|
78
|
+
return new SqliteLearningStore({
|
|
79
|
+
databasePath,
|
|
80
|
+
artifactsPath,
|
|
81
|
+
scope: resident,
|
|
82
|
+
readOnly
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
__name(residentLearningStore, "residentLearningStore");
|
|
86
|
+
|
|
87
|
+
// src/commands/learning.ts
|
|
88
|
+
var line = /* @__PURE__ */ __name((value) => stripVTControlCharacters(value).replace(/[\p{Cc}\p{Cf}]/gu, " "), "line");
|
|
89
|
+
var preview = /* @__PURE__ */ __name((value) => {
|
|
90
|
+
const chars = Array.from(line(value));
|
|
91
|
+
return chars.length > 240 ? `${chars.slice(0, 240).join("")}\u2026 (full text: --format json)` : chars.join("");
|
|
92
|
+
}, "preview");
|
|
93
|
+
var integer = /* @__PURE__ */ __name((value) => {
|
|
94
|
+
if (!/^\d+$/.test(value) || !Number.isSafeInteger(Number(value)))
|
|
95
|
+
throw new Error("Expected a nonnegative safe integer.");
|
|
96
|
+
return Number(value);
|
|
97
|
+
}, "integer");
|
|
98
|
+
function learningSummary(row) {
|
|
99
|
+
const usage = row.result?.consumption ?? {
|
|
100
|
+
...row.recordedUsage,
|
|
101
|
+
unfinishedStages: 1
|
|
102
|
+
};
|
|
103
|
+
const review = row.result?.review;
|
|
104
|
+
const comparisons = [
|
|
105
|
+
["Verification", review?.verification],
|
|
106
|
+
["Confirmation", review?.confirmation]
|
|
107
|
+
].flatMap(([label, round]) => {
|
|
108
|
+
if (!round?.tasks.length) return [];
|
|
109
|
+
const total = round.tasks.reduce((n, t) => n + t.trials, 0);
|
|
110
|
+
const baseline = round.tasks.reduce((n, t) => n + t.baselinePasses, 0);
|
|
111
|
+
const candidate = round.tasks.reduce((n, t) => n + t.candidatePasses, 0);
|
|
112
|
+
const protection = review?.protection?.[label === "Verification" ? "verification" : "confirmation"];
|
|
113
|
+
return [
|
|
114
|
+
` ${label}: baseline ${baseline}/${total} \u2192 candidate ${candidate}/${total}`,
|
|
115
|
+
...protection ? [
|
|
116
|
+
` Protected tasks: ${protection.status}${protection.missingTasks.length ? ` \xB7 ${protection.missingTasks.length} missing` : ""}${protection.unprovenTasks.length ? ` \xB7 ${protection.unprovenTasks.length} unproven` : ""}${protection.regressedTasks.length ? ` \xB7 ${protection.regressedTasks.length} regressed` : ""}`
|
|
117
|
+
] : []
|
|
118
|
+
];
|
|
119
|
+
});
|
|
120
|
+
return [
|
|
121
|
+
`${row.cycleId} \xB7 ${row.status} \xB7 ${line(row.skillName ?? "preflight")}`,
|
|
122
|
+
` ${usage.tokens} recorded tokens${usage.unknownTokens || usage.unfinishedStages ? " \xB7 incomplete" : ""} \xB7 ${usage.unknownCosts || usage.unfinishedStages ? "price incomplete or unknown" : `$${usage.costUsd.toFixed(4)}`}`,
|
|
123
|
+
...!row.result ? [" No final receipt; recorded state does not establish a live executor."] : [],
|
|
124
|
+
...row.result ? [` ${line(row.result.reason)}`] : [],
|
|
125
|
+
...comparisons
|
|
126
|
+
].join("\n");
|
|
127
|
+
}
|
|
128
|
+
__name(learningSummary, "learningSummary");
|
|
129
|
+
function observationText(observations) {
|
|
130
|
+
return observations.map(
|
|
131
|
+
(o) => [
|
|
132
|
+
`${o.ordinal} \xB7 ${line(o.skillName)} \xB7 ${o.outcome}${o.usageComplete ? "" : " \xB7 usage unresolved"}`,
|
|
133
|
+
` ${line(o.taskKey)} \xB7 ${line(o.evaluatorRevision)}`,
|
|
134
|
+
` ${preview(o.evidence.reason)}`,
|
|
135
|
+
` ${o.attemptedCycleId ? `Experiment: ${o.attemptedCycleId}` : "No experiment claimed"}`
|
|
136
|
+
].join("\n")
|
|
137
|
+
).join("\n\n");
|
|
138
|
+
}
|
|
139
|
+
__name(observationText, "observationText");
|
|
140
|
+
var residentSubject = /* @__PURE__ */ __name((resident) => ({
|
|
141
|
+
cwd: resident.cwd,
|
|
142
|
+
tenantId: resident.tenantId,
|
|
143
|
+
projectId: resident.projectId,
|
|
144
|
+
agentKey: resident.agentKey,
|
|
145
|
+
agenda: resident.agenda,
|
|
146
|
+
openStore: /* @__PURE__ */ __name(() => residentLearningStore(resident), "openStore")
|
|
147
|
+
}), "residentSubject");
|
|
148
|
+
async function openSessionSubject(cwd) {
|
|
149
|
+
const store = await sessionLearningStore(cwd, false);
|
|
150
|
+
if (!store) return null;
|
|
151
|
+
const { paths, tenantId, projectId } = store.target;
|
|
152
|
+
return {
|
|
153
|
+
cwd: await realpath(resolve(cwd)),
|
|
154
|
+
tenantId,
|
|
155
|
+
projectId,
|
|
156
|
+
agentKey: SESSION_AGENT_KEY,
|
|
157
|
+
agenda: await openProjectGuidance(paths, tenantId),
|
|
158
|
+
openStore: /* @__PURE__ */ __name(() => store, "openStore")
|
|
159
|
+
};
|
|
160
|
+
}
|
|
161
|
+
__name(openSessionSubject, "openSessionSubject");
|
|
162
|
+
async function runLearningCommand({ ctx, rawArgs }) {
|
|
163
|
+
const execute = rawArgs[0] === "learn";
|
|
164
|
+
const parser = new Command().exitOverride().configureOutput({ writeOut: /* @__PURE__ */ __name(() => {
|
|
165
|
+
}, "writeOut"), writeErr: /* @__PURE__ */ __name(() => {
|
|
166
|
+
}, "writeErr") }).allowExcessArguments(false).argument(execute ? "[experiment.learning.js]" : "[cycle-id]").option("--cwd <path>").option("--agent <name>", "Resident name", "default");
|
|
167
|
+
if (execute)
|
|
168
|
+
parser.option("--trust").option("--list", "List what Namzu learned for this folder's guidance").option("--undo [cycle-id]", "Restore the guidance an activation replaced").option(
|
|
169
|
+
"--sessions",
|
|
170
|
+
"Learn from the failures conversations in this folder kept, into this project's own guidance (no resident needed)"
|
|
171
|
+
);
|
|
172
|
+
else
|
|
173
|
+
parser.option("--events").option("--observations", "Inspect a resident's host-scored learning observations").option(
|
|
174
|
+
"--sessions",
|
|
175
|
+
"Inspect the failures conversations in this folder kept (no resident needed)"
|
|
176
|
+
).option("--after <sequence>", "", integer).option("--before <ordinal>", "", integer).option("--limit <count>", "", integer);
|
|
177
|
+
try {
|
|
178
|
+
parser.parse(rawArgs.slice(1), { from: "user" });
|
|
179
|
+
} catch (error) {
|
|
180
|
+
ctx.formatter.error({ message: String(error) });
|
|
181
|
+
return EXIT_USAGE;
|
|
182
|
+
}
|
|
183
|
+
const flags = parser.opts();
|
|
184
|
+
const target = resolveWorkingDirectory(flags.cwd ?? null);
|
|
185
|
+
if ("error" in target) {
|
|
186
|
+
ctx.formatter.error({ message: target.error });
|
|
187
|
+
return EXIT_USAGE;
|
|
188
|
+
}
|
|
189
|
+
if (execute && !parser.args[0]) {
|
|
190
|
+
const misuse = flags.sessions || flags.trust || flags.agent !== "default" ? "--sessions, --trust and --agent apply to a learning module; none was given." : flags.list && flags.undo !== void 0 ? "Choose --list or --undo, not both." : null;
|
|
191
|
+
if (misuse) {
|
|
192
|
+
ctx.formatter.error({ message: misuse });
|
|
193
|
+
return EXIT_USAGE;
|
|
194
|
+
}
|
|
195
|
+
const { learnNow, listLearned, undoLearned } = await import("./learn-builtin-RXNSBTBC.js");
|
|
196
|
+
if (flags.list) return listLearned(ctx, target.cwd);
|
|
197
|
+
if (flags.undo !== void 0)
|
|
198
|
+
return undoLearned(ctx, target.cwd, typeof flags.undo === "string" ? flags.undo : void 0);
|
|
199
|
+
return learnNow(ctx, target.cwd);
|
|
200
|
+
}
|
|
201
|
+
if (flags.list || flags.undo !== void 0) {
|
|
202
|
+
ctx.formatter.error({ message: "--list and --undo apply to `namzu learn` without a module." });
|
|
203
|
+
return EXIT_USAGE;
|
|
204
|
+
}
|
|
205
|
+
const controller = new AbortController();
|
|
206
|
+
const interrupt = /* @__PURE__ */ __name(() => controller.abort(new Error("Learning experiment interrupted by the operator.")), "interrupt");
|
|
207
|
+
try {
|
|
208
|
+
if (!execute && flags.sessions) {
|
|
209
|
+
if (parser.args[0] || flags.events || flags.before !== void 0 || flags.observations)
|
|
210
|
+
throw new Error(
|
|
211
|
+
"--sessions uses --after and --limit, without a cycle ID, --events, --before or --observations."
|
|
212
|
+
);
|
|
213
|
+
const store2 = await sessionLearningStore(target.cwd);
|
|
214
|
+
const observations = store2 ? await store2.observations({ after: flags.after, limit: flags.limit }) : [];
|
|
215
|
+
ctx.formatter.print({
|
|
216
|
+
text: observations.length ? observationText(observations) : "No conversation observations recorded.",
|
|
217
|
+
observations,
|
|
218
|
+
nextAfter: observations.at(-1)?.ordinal ?? flags.after ?? 0
|
|
219
|
+
});
|
|
220
|
+
return 0;
|
|
221
|
+
}
|
|
222
|
+
const sessionSubject = execute && flags.sessions ? await openSessionSubject(target.cwd) : null;
|
|
223
|
+
if (execute && flags.sessions && !sessionSubject) {
|
|
224
|
+
ctx.formatter.print({
|
|
225
|
+
text: "No conversation observations are recorded for this folder yet, so there is nothing to learn from.",
|
|
226
|
+
result: null
|
|
227
|
+
});
|
|
228
|
+
return EXIT_USAGE;
|
|
229
|
+
}
|
|
230
|
+
const resident = sessionSubject ? null : await lookupResident(target.cwd, flags.agent);
|
|
231
|
+
if (!sessionSubject && !resident) {
|
|
232
|
+
ctx.formatter.print({
|
|
233
|
+
text: "No resident exists here. Use namzu resident add <objective> first.",
|
|
234
|
+
cycles: []
|
|
235
|
+
});
|
|
236
|
+
return execute ? EXIT_USAGE : 0;
|
|
237
|
+
}
|
|
238
|
+
if (!execute) {
|
|
239
|
+
if (!resident) throw new Error("A resident is required to inspect its experiments.");
|
|
240
|
+
const id = parser.args[0];
|
|
241
|
+
if (flags.observations) {
|
|
242
|
+
if (id || flags.events || flags.before !== void 0)
|
|
243
|
+
throw new Error(
|
|
244
|
+
"--observations uses --after and --limit, without a cycle ID, --events or --before."
|
|
245
|
+
);
|
|
246
|
+
const store3 = residentLearningStore(resident, true);
|
|
247
|
+
const observations = store3 ? await store3.observations({ after: flags.after, limit: flags.limit }) : [];
|
|
248
|
+
ctx.formatter.print({
|
|
249
|
+
text: observations.length ? observationText(observations) : "No learning observations recorded.",
|
|
250
|
+
observations,
|
|
251
|
+
nextAfter: observations.at(-1)?.ordinal ?? flags.after ?? 0
|
|
252
|
+
});
|
|
253
|
+
return 0;
|
|
254
|
+
}
|
|
255
|
+
if ((flags.events || flags.after !== void 0) && !id)
|
|
256
|
+
throw new Error("--events and --after require a cycle ID.");
|
|
257
|
+
if (flags.after !== void 0 && !flags.events) throw new Error("--after requires --events.");
|
|
258
|
+
if (id && flags.before !== void 0) throw new Error("--before applies to the cycle list.");
|
|
259
|
+
const store2 = residentLearningStore(resident, true);
|
|
260
|
+
if (!store2) {
|
|
261
|
+
ctx.formatter.print({
|
|
262
|
+
text: "No learning experiments recorded.",
|
|
263
|
+
cycles: []
|
|
264
|
+
});
|
|
265
|
+
return 0;
|
|
266
|
+
}
|
|
267
|
+
if (id) {
|
|
268
|
+
const cycle = await store2.get(id);
|
|
269
|
+
if (!cycle) throw new Error("Learning cycle is not retained here.");
|
|
270
|
+
const artifacts = await store2.artifacts(id);
|
|
271
|
+
const events = flags.events ? await store2.events(id, { after: flags.after, limit: flags.limit }) : void 0;
|
|
272
|
+
ctx.formatter.print({
|
|
273
|
+
text: [
|
|
274
|
+
learningSummary(cycle),
|
|
275
|
+
...artifacts.map((a) => ` ${line(a.name)} \xB7 ${a.bytes} bytes \xB7 ${a.hash}`),
|
|
276
|
+
...events?.map(
|
|
277
|
+
(e) => ` ${e.sequence} \xB7 ${e.kind}${e.stage ? ` \xB7 ${e.stage}` : ""}`
|
|
278
|
+
) ?? []
|
|
279
|
+
].join("\n"),
|
|
280
|
+
cycle,
|
|
281
|
+
artifacts,
|
|
282
|
+
...events ? { events, nextAfter: events.at(-1)?.sequence ?? flags.after ?? 0 } : {}
|
|
283
|
+
});
|
|
284
|
+
} else {
|
|
285
|
+
const cycles = await store2.list({
|
|
286
|
+
before: flags.before,
|
|
287
|
+
limit: flags.limit
|
|
288
|
+
});
|
|
289
|
+
ctx.formatter.print({
|
|
290
|
+
text: cycles.length ? cycles.map(learningSummary).join("\n\n") : "No learning experiments recorded.",
|
|
291
|
+
cycles,
|
|
292
|
+
nextBefore: cycles.at(-1)?.ordinal ?? null
|
|
293
|
+
});
|
|
294
|
+
}
|
|
295
|
+
return 0;
|
|
296
|
+
}
|
|
297
|
+
const subject = sessionSubject ?? (resident ? residentSubject(resident) : null);
|
|
298
|
+
if (!subject) throw new Error("Nothing to learn into.");
|
|
299
|
+
const trust = decideHeadlessTrust({
|
|
300
|
+
cwd: subject.cwd,
|
|
301
|
+
trustFlag: flags.trust === true
|
|
302
|
+
});
|
|
303
|
+
if (!trust.allowed) {
|
|
304
|
+
ctx.formatter.error({
|
|
305
|
+
message: trust.message ?? "Resident directory is not trusted."
|
|
306
|
+
});
|
|
307
|
+
return EXIT_UNTRUSTED;
|
|
308
|
+
}
|
|
309
|
+
if (trust.cwd !== subject.cwd)
|
|
310
|
+
throw new Error("Execution directory changed its canonical path.");
|
|
311
|
+
const agenda = await subject.agenda.read();
|
|
312
|
+
if (!agenda || agenda.paused || agenda.pursuits.some((p) => p.state.phase === "running"))
|
|
313
|
+
throw new Error("Learning requires an unpaused resident with no running pursuits.");
|
|
314
|
+
const file = resolve(target.cwd, parser.args[0]);
|
|
315
|
+
if (!file.endsWith(".learning.js") && !file.endsWith(".learning.mjs"))
|
|
316
|
+
throw new Error("Choose an explicit .learning.js or .learning.mjs host module.");
|
|
317
|
+
const entry = lstatSync2(file);
|
|
318
|
+
if (!entry.isFile() || entry.isSymbolicLink())
|
|
319
|
+
throw new Error("Learning experiment must be a regular host module, without a symbolic link.");
|
|
320
|
+
process.on("SIGINT", interrupt);
|
|
321
|
+
process.on("SIGTERM", interrupt);
|
|
322
|
+
controller.signal.throwIfAborted();
|
|
323
|
+
ctx.formatter.info(`Learning experiment: ${line(file)}`);
|
|
324
|
+
const module = await import(pathToFileURL(file).href);
|
|
325
|
+
if (typeof module.default !== "function")
|
|
326
|
+
throw new Error("Learning module must default-export a host factory.");
|
|
327
|
+
const store = subject.openStore();
|
|
328
|
+
if (!store) throw new Error("Learning storage is unavailable.");
|
|
329
|
+
const options = await module.default({
|
|
330
|
+
cwd: subject.cwd,
|
|
331
|
+
tenantId: subject.tenantId,
|
|
332
|
+
projectId: subject.projectId,
|
|
333
|
+
agentKey: subject.agentKey,
|
|
334
|
+
signal: controller.signal,
|
|
335
|
+
store
|
|
336
|
+
});
|
|
337
|
+
controller.signal.throwIfAborted();
|
|
338
|
+
const explore = options.explore;
|
|
339
|
+
const execution = {
|
|
340
|
+
...options,
|
|
341
|
+
agenda: subject.agenda,
|
|
342
|
+
signal: controller.signal,
|
|
343
|
+
...explore ? {
|
|
344
|
+
explore: /* @__PURE__ */ __name(async (context) => {
|
|
345
|
+
ctx.formatter.info(`Learning \xB7 ${line(context.skillName)} \xB7 exploring environment`);
|
|
346
|
+
return explore(context);
|
|
347
|
+
}, "explore")
|
|
348
|
+
} : {},
|
|
349
|
+
generate: /* @__PURE__ */ __name(async (context) => {
|
|
350
|
+
ctx.formatter.info(`Learning \xB7 ${line(context.skillName)} \xB7 generating guidance`);
|
|
351
|
+
return options.generate(context);
|
|
352
|
+
}, "generate"),
|
|
353
|
+
evaluate: /* @__PURE__ */ __name(async (context) => {
|
|
354
|
+
ctx.formatter.info(`Learning \xB7 ${context.stage}`);
|
|
355
|
+
return options.evaluate(context);
|
|
356
|
+
}, "evaluate")
|
|
357
|
+
};
|
|
358
|
+
const discovery = "evaluators" in execution ? await runStoredLearningFromObservations(store, execution) : null;
|
|
359
|
+
const result = "evaluators" in execution ? discovery?.cycle : await runStoredLearningCycle(store, execution);
|
|
360
|
+
if (!result) {
|
|
361
|
+
ctx.formatter.print({
|
|
362
|
+
text: "No eligible unattempted learning observation for the current skills and evaluators.",
|
|
363
|
+
result: null
|
|
364
|
+
});
|
|
365
|
+
return 0;
|
|
366
|
+
}
|
|
367
|
+
let saved = null;
|
|
368
|
+
try {
|
|
369
|
+
saved = await store.get(result.cycleId);
|
|
370
|
+
} catch (error) {
|
|
371
|
+
ctx.formatter.error({
|
|
372
|
+
message: `Result received; journal inspection failed: ${String(error)}`
|
|
373
|
+
});
|
|
374
|
+
}
|
|
375
|
+
ctx.formatter.print({
|
|
376
|
+
text: [
|
|
377
|
+
saved ? learningSummary({ ...saved, status: result.status, result }) : `${result.cycleId} \xB7 ${result.status}: ${line(result.reason)}`,
|
|
378
|
+
...!result.auditComplete ? [
|
|
379
|
+
"The journal is incomplete. Inspect the exact skill evidence before retrying; do not replay the experiment automatically."
|
|
380
|
+
] : []
|
|
381
|
+
].join("\n"),
|
|
382
|
+
result,
|
|
383
|
+
journal: saved,
|
|
384
|
+
databasePath: store.databasePath
|
|
385
|
+
});
|
|
386
|
+
return result.status === "activated" && result.auditComplete ? 0 : result.status === "cancelled" ? 130 : ["rejected", "inconclusive"].includes(result.status) ? 2 : 1;
|
|
387
|
+
} catch (error) {
|
|
388
|
+
ctx.formatter.error({
|
|
389
|
+
message: error instanceof Error ? error.message : String(error)
|
|
390
|
+
});
|
|
391
|
+
return controller.signal.aborted ? 130 : 1;
|
|
392
|
+
} finally {
|
|
393
|
+
process.off("SIGINT", interrupt);
|
|
394
|
+
process.off("SIGTERM", interrupt);
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
__name(runLearningCommand, "runLearningCommand");
|
|
398
|
+
|
|
399
|
+
export {
|
|
400
|
+
learningSummary,
|
|
401
|
+
runLearningCommand
|
|
402
|
+
};
|
|
403
|
+
//# sourceMappingURL=chunk-FVHJPEJU.js.map
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/commands/learning.ts", "../../src/integrations/resident/learning-storage.ts"],
|
|
4
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAS,aAAAA,kBAAiB;AAC1B,SAAS,gBAAgB;AACzB,SAAS,eAAe;AACxB,SAAS,qBAAqB;AAC9B,SAAS,gCAAgC;;;ACJzC,SAAS,YAAY,iBAAiB;AACtC,SAAS,YAAY;AAWd,SAAS,sBACf,UACA,WAAW,OACkB;AAC7B,QAAM,YAAY,qBAAqB,SAAS,MAAM,SAAS,MAAM,SAAS,QAAQ;AACtF,QAAM,eAAe,KAAK,WAAW,iBAAiB;AACtD,QAAM,gBAAgB,KAAK,WAAW,WAAW;AACjD,MAAI,UAAU;AACb,eAAW,aAAa,CAAC,WAAW,aAAa,GAAG;AACnD,UAAI,CAAC,WAAW,SAAS,EAAG;AAC5B,YAAM,QAAQ,UAAU,SAAS;AACjC,UAAI,CAAC,MAAM,YAAY,KAAK,MAAM,eAAe;AAChD,cAAM,IAAI,MAAM,6CAA6C,SAAS,EAAE;AAAA,IAC1E;AACA,QAAI,CAAC,WAAW,YAAY,EAAG,QAAO;AAAA,EACvC,OAAO;AACN,gCAA4B,WAAW,WAAW;AAAA,EACnD;AACA,aAAW,QAAQ;AAAA,IAClB;AAAA,IACA,GAAG,YAAY;AAAA,IACf,GAAG,YA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iB,QAAQ,MAAM,UAAU,OAAO,KAAK;AAAA,IAC/D,CAAC;AACD,WAAO,WAAW,OAAO,UAAU,MAAM;AAAA,EAC1C,UAAE;AACD,YAAQ,IAAI,UAAU,SAAS;AAC/B,YAAQ,IAAI,WAAW,SAAS;AAAA,EACjC;AACD;AAzSsB;",
|
|
5
|
+
"names": ["lstatSync", "store", "lstatSync"]
|
|
6
|
+
}
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
bypassAvailable,
|
|
5
5
|
permissionModeFromName,
|
|
6
6
|
unknownPermissionModeMessage
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-TRX6W6TD.js";
|
|
8
8
|
import {
|
|
9
9
|
__name
|
|
10
10
|
} from "./chunk-76FLAFCG.js";
|
|
@@ -83,4 +83,4 @@ export {
|
|
|
83
83
|
launchRefusal,
|
|
84
84
|
planLaunchMode
|
|
85
85
|
};
|
|
86
|
-
//# sourceMappingURL=chunk-
|
|
86
|
+
//# sourceMappingURL=chunk-G5747QGU.js.map
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
import {
|
|
10
10
|
DEFAULT_GATE_MAX_RETRIES,
|
|
11
11
|
createCommandGate
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-NWTFQJZI.js";
|
|
13
13
|
import {
|
|
14
14
|
__name
|
|
15
15
|
} from "./chunk-76FLAFCG.js";
|
|
@@ -238,7 +238,7 @@ __name(resolveWorkingDirectory, "resolveWorkingDirectory");
|
|
|
238
238
|
async function loadSkillsContext(cwd, names, config) {
|
|
239
239
|
if (names.length === 0) return void 0;
|
|
240
240
|
try {
|
|
241
|
-
const { discoverSkills, loadSkillBody, composeSkillsPrompt } = await import("./store-
|
|
241
|
+
const { discoverSkills, loadSkillBody, composeSkillsPrompt } = await import("./store-ODVHN3VE.js");
|
|
242
242
|
const wanted = new Set(names);
|
|
243
243
|
const active = discoverSkills({ cwd, ...config ? { config } : {} }).filter((s) => wanted.has(s.name) && s.problem === void 0).map((s) => ({ name: s.name, body: loadSkillBody(s) }));
|
|
244
244
|
return composeSkillsPrompt(active) ?? void 0;
|
|
@@ -300,4 +300,4 @@ export {
|
|
|
300
300
|
unknownOptionMessage,
|
|
301
301
|
applyProviderFlags
|
|
302
302
|
};
|
|
303
|
-
//# sourceMappingURL=chunk-
|
|
303
|
+
//# sourceMappingURL=chunk-GFBEQZGH.js.map
|
|
@@ -2,14 +2,14 @@ import { createRequire as __namzuCreateRequire } from 'node:module';
|
|
|
2
2
|
const require = __namzuCreateRequire(import.meta.url);
|
|
3
3
|
import {
|
|
4
4
|
trustDir
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-E5FAPPFH.js";
|
|
6
6
|
import {
|
|
7
7
|
restrictToOwner
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-M7TGNC4F.js";
|
|
9
9
|
import {
|
|
10
10
|
DiskPalStore,
|
|
11
11
|
resolveNamzuHome
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-NWTFQJZI.js";
|
|
13
13
|
import {
|
|
14
14
|
__name
|
|
15
15
|
} from "./chunk-76FLAFCG.js";
|
|
@@ -124,4 +124,4 @@ export {
|
|
|
124
124
|
deletePal,
|
|
125
125
|
palAtWorkspace
|
|
126
126
|
};
|
|
127
|
-
//# sourceMappingURL=chunk-
|
|
127
|
+
//# sourceMappingURL=chunk-GR7FEYP5.js.map
|
|
@@ -5,47 +5,47 @@ import {
|
|
|
5
5
|
residentClaimVerifier,
|
|
6
6
|
residentToolEvidence,
|
|
7
7
|
verificationInstructions
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-MOUJITK2.js";
|
|
9
9
|
import {
|
|
10
10
|
applyProviderFlags,
|
|
11
11
|
buildGate,
|
|
12
12
|
loadSkillsContext,
|
|
13
13
|
unknownOptionMessage
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-GFBEQZGH.js";
|
|
15
15
|
import {
|
|
16
16
|
launchRefusal
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-G5747QGU.js";
|
|
18
18
|
import {
|
|
19
19
|
describeTurnInterruption
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-OS33YOPX.js";
|
|
21
21
|
import {
|
|
22
22
|
resolvePermissionMode
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-TRX6W6TD.js";
|
|
24
24
|
import {
|
|
25
25
|
publishPrivateJsonIfAbsent
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-BO4VL25F.js";
|
|
27
27
|
import {
|
|
28
28
|
compilePermissionLayers,
|
|
29
29
|
permissionLayersOf,
|
|
30
30
|
warnLegacyMcpPermissionNames
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-ABTQVE2K.js";
|
|
32
32
|
import {
|
|
33
33
|
cliLogger
|
|
34
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-L3NHCRUZ.js";
|
|
35
35
|
import {
|
|
36
36
|
attachSessionExport
|
|
37
37
|
} from "./chunk-FTMTO72X.js";
|
|
38
38
|
import {
|
|
39
39
|
ensurePrivateStateDirectory
|
|
40
|
-
} from "./chunk-
|
|
40
|
+
} from "./chunk-2F4BARJH.js";
|
|
41
41
|
import {
|
|
42
42
|
BOOT_EVENT_NAMES,
|
|
43
43
|
EVENT_NAME_ATTRIBUTE,
|
|
44
44
|
createResidentEvidenceRecallStep,
|
|
45
45
|
generateSessionId,
|
|
46
46
|
generateTurnId,
|
|
47
|
-
|
|
48
|
-
} from "./chunk-
|
|
47
|
+
projectLearning
|
|
48
|
+
} from "./chunk-NWTFQJZI.js";
|
|
49
49
|
import {
|
|
50
50
|
__name
|
|
51
51
|
} from "./chunk-76FLAFCG.js";
|
|
@@ -56,7 +56,7 @@ import { readFileSync } from "node:fs";
|
|
|
56
56
|
import { basename, dirname, join, relative as relative2, resolve as resolve2 } from "node:path";
|
|
57
57
|
import { isDeepStrictEqual } from "node:util";
|
|
58
58
|
|
|
59
|
-
// src/integrations/
|
|
59
|
+
// src/integrations/learning/sources.ts
|
|
60
60
|
import { createHash } from "node:crypto";
|
|
61
61
|
import {
|
|
62
62
|
constants,
|
|
@@ -71,7 +71,7 @@ import { isAbsolute, relative, resolve, sep } from "node:path";
|
|
|
71
71
|
var PREFIX = "workspace-file:";
|
|
72
72
|
var MAX_BYTES = 256 * 1024;
|
|
73
73
|
var MAX_TOTAL_BYTES = 1024 * 1024;
|
|
74
|
-
function
|
|
74
|
+
function learningSources(cwd, learning) {
|
|
75
75
|
const keys = [
|
|
76
76
|
...new Set(
|
|
77
77
|
learning?.skills.flatMap((skill) => skill.sources?.map((source) => source.key) ?? []) ?? []
|
|
@@ -125,7 +125,7 @@ function residentLearningSources(cwd, learning) {
|
|
|
125
125
|
return observations;
|
|
126
126
|
};
|
|
127
127
|
}
|
|
128
|
-
__name(
|
|
128
|
+
__name(learningSources, "learningSources");
|
|
129
129
|
|
|
130
130
|
// src/integrations/resident/session-step.ts
|
|
131
131
|
var MAX_DECISION_CHARS = 32e3;
|
|
@@ -199,7 +199,7 @@ function residentSystemContext(history, outputInstructions = DECISION_CONTRACT)
|
|
|
199
199
|
__name(residentSystemContext, "residentSystemContext");
|
|
200
200
|
function residentSnapshotContext(pursuit, context, skills, history) {
|
|
201
201
|
const { state } = pursuit;
|
|
202
|
-
const learning =
|
|
202
|
+
const learning = projectLearning(context.learning, {
|
|
203
203
|
maxChars: 12e3,
|
|
204
204
|
skillNames: context.learning?.skills.map((skill) => skill.name) ?? []
|
|
205
205
|
});
|
|
@@ -284,7 +284,7 @@ function createResidentSessionStep(options) {
|
|
|
284
284
|
started = true;
|
|
285
285
|
}, "start");
|
|
286
286
|
try {
|
|
287
|
-
const { probeAgentSession, createAgentSession } = await import("./agent-
|
|
287
|
+
const { probeAgentSession, createAgentSession } = await import("./agent-5MAZW7PD.js");
|
|
288
288
|
signal.throwIfAborted();
|
|
289
289
|
const probe = await probeAgentSession();
|
|
290
290
|
const configured = probe.preferences ?? defaultPrefs(probe.detected);
|
|
@@ -437,7 +437,7 @@ ${outputInstructions}` };
|
|
|
437
437
|
residentContext: {
|
|
438
438
|
state: pursuit.state,
|
|
439
439
|
learning: context.learning,
|
|
440
|
-
resolveLearningSources:
|
|
440
|
+
resolveLearningSources: learningSources(cwd, context.learning),
|
|
441
441
|
history: history?.scope,
|
|
442
442
|
toolEvidence: !!toolEvidence,
|
|
443
443
|
readOnly: mode.mode === "plan",
|
|
@@ -531,4 +531,4 @@ __name(createResidentSessionStep, "createResidentSessionStep");
|
|
|
531
531
|
export {
|
|
532
532
|
createResidentSessionStep
|
|
533
533
|
};
|
|
534
|
-
//# sourceMappingURL=chunk-
|
|
534
|
+
//# sourceMappingURL=chunk-HKY44MS7.js.map
|