@namzu/cli 40.0.0 → 41.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +77 -0
- package/dist/bin.js +1 -1
- package/dist/chunks/{acp-E7XNZWFV.js → acp-PHHX4X7I.js} +40 -35
- package/dist/chunks/acp-PHHX4X7I.js.map +6 -0
- package/dist/chunks/{activity-command-QANVT2PA.js → activity-command-VZYEOBGH.js} +12 -11
- package/dist/chunks/activity-command-VZYEOBGH.js.map +6 -0
- package/dist/chunks/{add-VDRMBSNZ.js → add-7C455H4M.js} +20 -19
- package/dist/chunks/add-7C455H4M.js.map +6 -0
- package/dist/chunks/{agent-PPQJZWBO.js → agent-DWDNEJ4O.js} +33 -26
- package/dist/chunks/agent-session-6VKAI3MW.js +59 -0
- package/dist/chunks/{archive-SH4IG6KC.js → archive-64TMFN4V.js} +10 -9
- package/dist/chunks/archive-64TMFN4V.js.map +6 -0
- package/dist/chunks/{bin-main-D45Q7FMM.js → bin-main-FHIEKDBH.js} +3 -3
- package/dist/chunks/{browser-EUFWHKYD.js → browser-S5FSWWNV.js} +6 -6
- package/dist/chunks/{chat-QDWGHEEL.js → chat-DNBIXT2D.js} +15 -14
- package/dist/chunks/chat-DNBIXT2D.js.map +6 -0
- package/dist/chunks/{chunk-6UDJ3PVE.js → chunk-3K52E4DA.js} +26 -201
- package/dist/chunks/chunk-3K52E4DA.js.map +6 -0
- package/dist/chunks/{chunk-BZ4U5L7N.js → chunk-3SODK62W.js} +9 -9
- package/dist/chunks/{chunk-C3ZJQLUX.js → chunk-42I6K42A.js} +2 -2
- package/dist/chunks/{chunk-5HSG2XFD.js → chunk-44B2CZ55.js} +2 -2
- package/dist/chunks/{chunk-C723P7SP.js → chunk-52R5A75N.js} +6 -6
- package/dist/chunks/{chunk-ZPIHARMI.js → chunk-57ECSVZJ.js} +4 -4
- package/dist/chunks/{chunk-DWSATEAY.js → chunk-5U7CJV4T.js} +2 -2
- package/dist/chunks/{chunk-T6INV7EZ.js → chunk-6WWEY6KW.js} +19 -19
- package/dist/chunks/{chunk-RAS4ZA5C.js → chunk-75FRF5SV.js} +5 -5
- package/dist/chunks/{chunk-KOYEUNX7.js → chunk-75XGHRMM.js} +4 -4
- package/dist/chunks/{chunk-R7XQP4PZ.js → chunk-76XQC54X.js} +3 -3
- package/dist/chunks/{chunk-BQ7PN64G.js → chunk-7QKWJGLX.js} +9 -50
- package/dist/chunks/chunk-7QKWJGLX.js.map +6 -0
- package/dist/chunks/{chunk-BJNHDKU6.js → chunk-AN5NBDDK.js} +2 -2
- package/dist/chunks/{chunk-YTEGBYGL.js → chunk-ARZVX6H7.js} +4 -4
- package/dist/chunks/{chunk-RVNLS4BN.js → chunk-ATB6MDK6.js} +2 -2
- package/dist/chunks/{chunk-O3L5C2WT.js → chunk-BL6HR7T6.js} +2 -2
- package/dist/chunks/{chunk-XDGIOXTU.js → chunk-CRZSMG4A.js} +5 -5
- package/dist/chunks/{chunk-WYULBUCG.js → chunk-DFBRAOJJ.js} +4 -4
- package/dist/chunks/{chunk-HPLVGTBH.js → chunk-DFOMCWXC.js} +2 -2
- package/dist/chunks/{chunk-AQL5A442.js → chunk-DVAUMW53.js} +3 -3
- package/dist/chunks/{chunk-AHPIP5IE.js → chunk-DZQ5B6TK.js} +2 -2
- package/dist/chunks/{chunk-KWRJTEV5.js → chunk-FFZEVYXE.js} +3 -3
- package/dist/chunks/chunk-GDQZHSMZ.js +403 -0
- package/dist/chunks/chunk-GDQZHSMZ.js.map +6 -0
- package/dist/chunks/{chunk-TTDBVPB2.js → chunk-GZCTJ23H.js} +2625 -1992
- package/dist/chunks/chunk-GZCTJ23H.js.map +6 -0
- package/dist/chunks/{chunk-U5KONGAN.js → chunk-HV4AV3CS.js} +3 -3
- package/dist/chunks/{chunk-GDVYFXOR.js → chunk-HXB37QQT.js} +18 -18
- package/dist/chunks/{chunk-GDVYFXOR.js.map → chunk-HXB37QQT.js.map} +2 -2
- package/dist/chunks/{chunk-RVSGU3JS.js → chunk-IBYZTDHR.js} +2 -2
- package/dist/chunks/{chunk-KKYIGLKI.js → chunk-JBAEWQ5I.js} +4 -4
- package/dist/chunks/{chunk-BZJNXGWW.js → chunk-KHWP5BUX.js} +3 -3
- package/dist/chunks/chunk-KV6EVTR7.js +406 -0
- package/dist/chunks/chunk-KV6EVTR7.js.map +6 -0
- package/dist/chunks/chunk-L7T37IYT.js +197 -0
- package/dist/chunks/chunk-L7T37IYT.js.map +6 -0
- package/dist/chunks/chunk-LCGXWCVU.js +28 -0
- package/dist/chunks/chunk-LCGXWCVU.js.map +6 -0
- package/dist/chunks/{chunk-U5PL5D27.js → chunk-LJIEV5UP.js} +2 -2
- package/dist/chunks/{chunk-XLGTH7JD.js → chunk-LQGQJMT7.js} +4 -4
- package/dist/chunks/{chunk-QPEGCKRA.js → chunk-LZHSDCZS.js} +2 -2
- package/dist/chunks/{chunk-HBDBVQ3R.js → chunk-MCZVTGKV.js} +22 -20
- package/dist/chunks/chunk-MCZVTGKV.js.map +6 -0
- package/dist/chunks/{chunk-I7LUF577.js → chunk-MIKVWIFY.js} +3 -3
- package/dist/chunks/{chunk-2I3Z65TV.js → chunk-NU4R7BC5.js} +60 -22
- package/dist/chunks/chunk-NU4R7BC5.js.map +6 -0
- package/dist/chunks/{chunk-53GEER6F.js → chunk-OP6TJ65Q.js} +3 -3
- package/dist/chunks/{chunk-ILTHOMHL.js → chunk-OZ7SAUC5.js} +7 -7
- package/dist/chunks/{chunk-7M6IZGAK.js → chunk-Q3M7HIXS.js} +77 -6
- package/dist/chunks/chunk-Q3M7HIXS.js.map +6 -0
- package/dist/chunks/{chunk-PXKXXNFU.js → chunk-Q56NJHND.js} +2 -2
- package/dist/chunks/{chunk-G6LK7V7F.js → chunk-QE4S3AAB.js} +2 -2
- package/dist/chunks/{chunk-4HUZHYCY.js → chunk-QW2UWIGL.js} +4 -4
- package/dist/chunks/{chunk-73G5WDGM.js → chunk-S4MAWWPH.js} +3 -3
- package/dist/chunks/{chunk-D63T5UQN.js → chunk-S6DQAA2W.js} +15627 -14034
- package/dist/chunks/chunk-S6DQAA2W.js.map +6 -0
- package/dist/chunks/{chunk-X54VNEWE.js → chunk-SAIL2BFW.js} +2 -2
- package/dist/chunks/chunk-TK24NCDI.js +609 -0
- package/dist/chunks/chunk-TK24NCDI.js.map +6 -0
- package/dist/chunks/{chunk-LM3W6AEK.js → chunk-UAW426OS.js} +2 -2
- package/dist/chunks/chunk-UOM2WQWT.js +56 -0
- package/dist/chunks/chunk-UOM2WQWT.js.map +6 -0
- package/dist/chunks/{chunk-C3APHRQB.js → chunk-VJEJ4MDH.js} +2 -2
- package/dist/chunks/{chunk-HLYTSH5W.js → chunk-VP7VGACS.js} +2 -2
- package/dist/chunks/{chunk-GTWNJ7GL.js → chunk-W7Z6CXGV.js} +4 -4
- package/dist/chunks/{chunk-L2GX4GAQ.js → chunk-X5FPHIJV.js} +2 -2
- package/dist/chunks/{chunk-IAL3F2OI.js → chunk-XD6I2JWS.js} +8 -8
- package/dist/chunks/{chunk-SOE4Q55L.js → chunk-XEAQL6XT.js} +2 -2
- package/dist/chunks/{chunk-JAHVXTO4.js → chunk-XXJTG3PY.js} +2 -2
- package/dist/chunks/{chunk-RLMKDLGK.js → chunk-Y7XE2FKY.js} +7 -7
- package/dist/chunks/{chunk-DGV5W2BU.js → chunk-YCZU2AAH.js} +2 -2
- package/dist/chunks/{chunk-AUFSSABF.js → chunk-YEM2A2EP.js} +3 -3
- package/dist/chunks/{chunk-EKFNDKPO.js → chunk-YGGGLNOK.js} +2 -2
- package/dist/chunks/{chunk-SUDXOGE6.js → chunk-YRYBG2IN.js} +50 -30
- package/dist/chunks/chunk-YRYBG2IN.js.map +6 -0
- package/dist/chunks/{chunk-6PAE7AWD.js → chunk-ZGLV3FQF.js} +2 -2
- package/dist/chunks/{chunk-FBY4LGL7.js → chunk-ZR7NIUZ5.js} +3 -3
- package/dist/chunks/{cli-runtime-YD7OZGEU.js → cli-runtime-TFMBNVCM.js} +11 -10
- package/dist/chunks/cli-runtime-TFMBNVCM.js.map +6 -0
- package/dist/chunks/{commands-5P4RLRXG.js → commands-D63UCDXO.js} +5 -5
- package/dist/chunks/{crash-report-F5G32A7S.js → crash-report-DA6SPZFQ.js} +6 -6
- package/dist/chunks/{dist-WB355CNL.js → dist-2S22UD3L.js} +2 -2
- package/dist/chunks/{dist-ZAGIMP7N.js → dist-BX53YVW2.js} +2 -2
- package/dist/chunks/{dist-SX66KAH4.js → dist-CIOAMQ5V.js} +2 -2
- package/dist/chunks/{dist-6O3HSFZP.js → dist-CS6PGGNY.js} +2 -2
- package/dist/chunks/{dist-DFLFYX3A.js → dist-YMNLOZFF.js} +2 -2
- package/dist/chunks/{dist-7B6PZO7C.js → dist-ZOXEFXEG.js} +2 -2
- package/dist/chunks/{dist-Y6SGSSMO.js → dist-ZQNCDMNT.js} +2 -2
- package/dist/chunks/{doctor-2AOB47IO.js → doctor-NXTO5W7O.js} +9 -9
- package/dist/chunks/{drain-M6AGCMJX.js → drain-AN6TSG5Z.js} +10 -10
- package/dist/chunks/{eval-YHY3VO7B.js → eval-IQVUB53L.js} +2 -2
- package/dist/chunks/{exec-KCISQ4M7.js → exec-A24HU7YF.js} +30 -27
- package/dist/chunks/exec-A24HU7YF.js.map +6 -0
- package/dist/chunks/{home-AC5LQKDR.js → home-OHK7HIRS.js} +3 -3
- package/dist/chunks/{host-queries-YQVRKUWC.js → host-queries-2MVXFXFU.js} +15 -14
- package/dist/chunks/host-queries-2MVXFXFU.js.map +6 -0
- package/dist/chunks/learn-F6SCIXWV.js +92 -0
- package/dist/chunks/learn-F6SCIXWV.js.map +6 -0
- package/dist/chunks/learn-builtin-K6MBTXBD.js +235 -0
- package/dist/chunks/learn-builtin-K6MBTXBD.js.map +6 -0
- package/dist/chunks/{lifecycle-CQXCTLAZ.js → lifecycle-SZCCUZSZ.js} +26 -24
- package/dist/chunks/{list-LNKKJZSZ.js → list-JN6UR3ZE.js} +21 -20
- package/dist/chunks/list-JN6UR3ZE.js.map +6 -0
- package/dist/chunks/{login-YA652CIL.js → login-6OWXZOWM.js} +8 -8
- package/dist/chunks/{logs-2PREHSOD.js → logs-DHUCKQZI.js} +4 -4
- package/dist/chunks/{mcp-WJB2UVQW.js → mcp-RBFXGNP4.js} +17 -16
- package/dist/chunks/mcp-RBFXGNP4.js.map +6 -0
- package/dist/chunks/{message-command-IXUASFZO.js → message-command-N4X3OTTG.js} +37 -32
- package/dist/chunks/message-command-N4X3OTTG.js.map +6 -0
- package/dist/chunks/{operator-tools-QOZZZVEC.js → operator-tools-P6GFP2RK.js} +13 -12
- package/dist/chunks/operator-tools-P6GFP2RK.js.map +6 -0
- package/dist/chunks/{output-schema-JTPOC3NL.js → output-schema-JKO3QUVC.js} +3 -3
- package/dist/chunks/{pal-FNSNP47Q.js → pal-5GFCH4E5.js} +11 -11
- package/dist/chunks/{providers-M5HWW7DH.js → providers-22W6AUTI.js} +6 -6
- package/dist/chunks/{resident-R2RCAHYR.js → resident-G6R4DZLL.js} +50 -335
- package/dist/chunks/resident-G6R4DZLL.js.map +6 -0
- package/dist/chunks/resume-MGFWNJ6Q.js +23 -0
- package/dist/chunks/{resume-command-LPN33FIF.js → resume-command-R6QPISLR.js} +4 -4
- package/dist/chunks/{schedule-J2IY3SVE.js → schedule-QDEIY4QB.js} +8 -8
- package/dist/chunks/{service-LEAVOYGP.js → service-ZF3TPBH5.js} +31 -29
- package/dist/chunks/service-ZF3TPBH5.js.map +6 -0
- package/dist/chunks/session-step-X6LLEFHX.js +30 -0
- package/dist/chunks/{skills-X2V3TNTK.js → skills-YAMIRCHY.js} +8 -8
- package/dist/chunks/{state-VDTYWZ5S.js → state-3ACU54IM.js} +2 -2
- package/dist/chunks/{store-DRPRQLDD.js → store-7RLXPZE2.js} +10 -9
- package/dist/chunks/{store-S4QRR5DH.js → store-AR4ZFSJ4.js} +6 -6
- package/dist/chunks/{store-C27Q22UV.js → store-OXXJMFPP.js} +4 -4
- package/dist/chunks/{tui-RU6CRMLX.js → tui-3NJA6ZKY.js} +1745 -1248
- package/dist/chunks/tui-3NJA6ZKY.js.map +6 -0
- package/dist/chunks/{upgrade-I2GMLDWZ.js → upgrade-IEU2FN3F.js} +2 -2
- package/dist/chunks/{worktree-F632OJNE.js → worktree-R7GZ3TZV.js} +12 -11
- package/dist/chunks/worktree-R7GZ3TZV.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 +2 -1
- package/dist/context/doctrine.d.ts.map +1 -1
- package/dist/context/environment.d.ts +37 -1
- package/dist/context/environment.d.ts.map +1 -1
- package/dist/context/identity.d.ts +27 -0
- package/dist/context/identity.d.ts.map +1 -0
- package/dist/context/project-tracker.d.ts.map +1 -1
- package/dist/context/system-prompt.d.ts +99 -0
- package/dist/context/system-prompt.d.ts.map +1 -0
- 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/sessions/conversation-search.d.ts +1 -1
- package/dist/integrations/sessions/conversation-search.d.ts.map +1 -1
- package/dist/integrations/subagents/runtime.d.ts +2 -0
- package/dist/integrations/subagents/runtime.d.ts.map +1 -1
- package/dist/integrations/workflows/doctrine.d.ts.map +1 -1
- package/dist/integrations/workflows/host.d.ts +0 -5
- package/dist/integrations/workflows/host.d.ts.map +1 -1
- package/dist/integrations/workflows/offering.d.ts +0 -2
- package/dist/integrations/workflows/offering.d.ts.map +1 -1
- package/dist/integrations/workflows/size.d.ts +9 -1
- package/dist/integrations/workflows/size.d.ts.map +1 -1
- package/dist/permissions/session-allow.d.ts +10 -0
- package/dist/permissions/session-allow.d.ts.map +1 -1
- package/dist/reminders/environment.d.ts +20 -0
- package/dist/reminders/environment.d.ts.map +1 -0
- package/dist/reminders/frame.d.ts +1 -1
- package/dist/reminders/frame.d.ts.map +1 -1
- package/dist/reminders/index.d.ts +11 -1
- package/dist/reminders/index.d.ts.map +1 -1
- package/dist/reminders/mode.d.ts +11 -0
- package/dist/reminders/mode.d.ts.map +1 -0
- package/dist/tui/App.d.ts.map +1 -1
- package/dist/tui/LiveActivity.d.ts +2 -0
- package/dist/tui/LiveActivity.d.ts.map +1 -1
- package/dist/tui/PermissionOverlay.d.ts +25 -4
- package/dist/tui/PermissionOverlay.d.ts.map +1 -1
- package/dist/tui/agent.d.ts +53 -2
- package/dist/tui/agent.d.ts.map +1 -1
- package/dist/tui/connector-label.d.ts +19 -0
- package/dist/tui/connector-label.d.ts.map +1 -0
- package/dist/tui/per-call-review.d.ts +50 -0
- package/dist/tui/per-call-review.d.ts.map +1 -0
- package/dist/tui/permission-asks.d.ts +68 -0
- package/dist/tui/permission-asks.d.ts.map +1 -0
- package/dist/tui/queued-calls.d.ts +47 -0
- package/dist/tui/queued-calls.d.ts.map +1 -0
- package/dist/tui/tidy-tool-output.d.ts +5 -0
- package/dist/tui/tidy-tool-output.d.ts.map +1 -1
- package/dist/tui/tool-end-rows.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 +6 -6
- package/skills/schedule-task/SKILL.md +6 -34
- package/dist/chunks/acp-E7XNZWFV.js.map +0 -6
- package/dist/chunks/activity-command-QANVT2PA.js.map +0 -6
- package/dist/chunks/add-VDRMBSNZ.js.map +0 -6
- package/dist/chunks/agent-session-PISYPFO2.js +0 -54
- package/dist/chunks/archive-SH4IG6KC.js.map +0 -6
- package/dist/chunks/chat-QDWGHEEL.js.map +0 -6
- package/dist/chunks/chunk-2I3Z65TV.js.map +0 -6
- package/dist/chunks/chunk-6UDJ3PVE.js.map +0 -6
- package/dist/chunks/chunk-7M6IZGAK.js.map +0 -6
- package/dist/chunks/chunk-BQ7PN64G.js.map +0 -6
- package/dist/chunks/chunk-D63T5UQN.js.map +0 -6
- package/dist/chunks/chunk-HBDBVQ3R.js.map +0 -6
- package/dist/chunks/chunk-SUDXOGE6.js.map +0 -6
- package/dist/chunks/chunk-TTDBVPB2.js.map +0 -6
- package/dist/chunks/cli-runtime-YD7OZGEU.js.map +0 -6
- package/dist/chunks/exec-KCISQ4M7.js.map +0 -6
- package/dist/chunks/host-queries-YQVRKUWC.js.map +0 -6
- package/dist/chunks/list-LNKKJZSZ.js.map +0 -6
- package/dist/chunks/mcp-WJB2UVQW.js.map +0 -6
- package/dist/chunks/message-command-IXUASFZO.js.map +0 -6
- package/dist/chunks/operator-tools-QOZZZVEC.js.map +0 -6
- package/dist/chunks/resident-R2RCAHYR.js.map +0 -6
- package/dist/chunks/resume-UKK4HVCO.js +0 -22
- package/dist/chunks/service-LEAVOYGP.js.map +0 -6
- package/dist/chunks/session-step-2B46NVE7.js +0 -30
- package/dist/chunks/tui-RU6CRMLX.js.map +0 -6
- package/dist/chunks/worktree-F632OJNE.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-PPQJZWBO.js.map → agent-DWDNEJ4O.js.map} +0 -0
- /package/dist/chunks/{agent-session-PISYPFO2.js.map → agent-session-6VKAI3MW.js.map} +0 -0
- /package/dist/chunks/{bin-main-D45Q7FMM.js.map → bin-main-FHIEKDBH.js.map} +0 -0
- /package/dist/chunks/{browser-EUFWHKYD.js.map → browser-S5FSWWNV.js.map} +0 -0
- /package/dist/chunks/{chunk-BZ4U5L7N.js.map → chunk-3SODK62W.js.map} +0 -0
- /package/dist/chunks/{chunk-C3ZJQLUX.js.map → chunk-42I6K42A.js.map} +0 -0
- /package/dist/chunks/{chunk-5HSG2XFD.js.map → chunk-44B2CZ55.js.map} +0 -0
- /package/dist/chunks/{chunk-C723P7SP.js.map → chunk-52R5A75N.js.map} +0 -0
- /package/dist/chunks/{chunk-ZPIHARMI.js.map → chunk-57ECSVZJ.js.map} +0 -0
- /package/dist/chunks/{chunk-DWSATEAY.js.map → chunk-5U7CJV4T.js.map} +0 -0
- /package/dist/chunks/{chunk-T6INV7EZ.js.map → chunk-6WWEY6KW.js.map} +0 -0
- /package/dist/chunks/{chunk-RAS4ZA5C.js.map → chunk-75FRF5SV.js.map} +0 -0
- /package/dist/chunks/{chunk-KOYEUNX7.js.map → chunk-75XGHRMM.js.map} +0 -0
- /package/dist/chunks/{chunk-R7XQP4PZ.js.map → chunk-76XQC54X.js.map} +0 -0
- /package/dist/chunks/{chunk-BJNHDKU6.js.map → chunk-AN5NBDDK.js.map} +0 -0
- /package/dist/chunks/{chunk-YTEGBYGL.js.map → chunk-ARZVX6H7.js.map} +0 -0
- /package/dist/chunks/{chunk-RVNLS4BN.js.map → chunk-ATB6MDK6.js.map} +0 -0
- /package/dist/chunks/{chunk-O3L5C2WT.js.map → chunk-BL6HR7T6.js.map} +0 -0
- /package/dist/chunks/{chunk-XDGIOXTU.js.map → chunk-CRZSMG4A.js.map} +0 -0
- /package/dist/chunks/{chunk-WYULBUCG.js.map → chunk-DFBRAOJJ.js.map} +0 -0
- /package/dist/chunks/{chunk-HPLVGTBH.js.map → chunk-DFOMCWXC.js.map} +0 -0
- /package/dist/chunks/{chunk-AQL5A442.js.map → chunk-DVAUMW53.js.map} +0 -0
- /package/dist/chunks/{chunk-AHPIP5IE.js.map → chunk-DZQ5B6TK.js.map} +0 -0
- /package/dist/chunks/{chunk-KWRJTEV5.js.map → chunk-FFZEVYXE.js.map} +0 -0
- /package/dist/chunks/{chunk-U5KONGAN.js.map → chunk-HV4AV3CS.js.map} +0 -0
- /package/dist/chunks/{chunk-RVSGU3JS.js.map → chunk-IBYZTDHR.js.map} +0 -0
- /package/dist/chunks/{chunk-KKYIGLKI.js.map → chunk-JBAEWQ5I.js.map} +0 -0
- /package/dist/chunks/{chunk-BZJNXGWW.js.map → chunk-KHWP5BUX.js.map} +0 -0
- /package/dist/chunks/{chunk-U5PL5D27.js.map → chunk-LJIEV5UP.js.map} +0 -0
- /package/dist/chunks/{chunk-XLGTH7JD.js.map → chunk-LQGQJMT7.js.map} +0 -0
- /package/dist/chunks/{chunk-QPEGCKRA.js.map → chunk-LZHSDCZS.js.map} +0 -0
- /package/dist/chunks/{chunk-I7LUF577.js.map → chunk-MIKVWIFY.js.map} +0 -0
- /package/dist/chunks/{chunk-53GEER6F.js.map → chunk-OP6TJ65Q.js.map} +0 -0
- /package/dist/chunks/{chunk-ILTHOMHL.js.map → chunk-OZ7SAUC5.js.map} +0 -0
- /package/dist/chunks/{chunk-PXKXXNFU.js.map → chunk-Q56NJHND.js.map} +0 -0
- /package/dist/chunks/{chunk-G6LK7V7F.js.map → chunk-QE4S3AAB.js.map} +0 -0
- /package/dist/chunks/{chunk-4HUZHYCY.js.map → chunk-QW2UWIGL.js.map} +0 -0
- /package/dist/chunks/{chunk-73G5WDGM.js.map → chunk-S4MAWWPH.js.map} +0 -0
- /package/dist/chunks/{chunk-X54VNEWE.js.map → chunk-SAIL2BFW.js.map} +0 -0
- /package/dist/chunks/{chunk-LM3W6AEK.js.map → chunk-UAW426OS.js.map} +0 -0
- /package/dist/chunks/{chunk-C3APHRQB.js.map → chunk-VJEJ4MDH.js.map} +0 -0
- /package/dist/chunks/{chunk-HLYTSH5W.js.map → chunk-VP7VGACS.js.map} +0 -0
- /package/dist/chunks/{chunk-GTWNJ7GL.js.map → chunk-W7Z6CXGV.js.map} +0 -0
- /package/dist/chunks/{chunk-L2GX4GAQ.js.map → chunk-X5FPHIJV.js.map} +0 -0
- /package/dist/chunks/{chunk-IAL3F2OI.js.map → chunk-XD6I2JWS.js.map} +0 -0
- /package/dist/chunks/{chunk-SOE4Q55L.js.map → chunk-XEAQL6XT.js.map} +0 -0
- /package/dist/chunks/{chunk-JAHVXTO4.js.map → chunk-XXJTG3PY.js.map} +0 -0
- /package/dist/chunks/{chunk-RLMKDLGK.js.map → chunk-Y7XE2FKY.js.map} +0 -0
- /package/dist/chunks/{chunk-DGV5W2BU.js.map → chunk-YCZU2AAH.js.map} +0 -0
- /package/dist/chunks/{chunk-AUFSSABF.js.map → chunk-YEM2A2EP.js.map} +0 -0
- /package/dist/chunks/{chunk-EKFNDKPO.js.map → chunk-YGGGLNOK.js.map} +0 -0
- /package/dist/chunks/{chunk-6PAE7AWD.js.map → chunk-ZGLV3FQF.js.map} +0 -0
- /package/dist/chunks/{chunk-FBY4LGL7.js.map → chunk-ZR7NIUZ5.js.map} +0 -0
- /package/dist/chunks/{commands-5P4RLRXG.js.map → commands-D63UCDXO.js.map} +0 -0
- /package/dist/chunks/{crash-report-F5G32A7S.js.map → crash-report-DA6SPZFQ.js.map} +0 -0
- /package/dist/chunks/{dist-WB355CNL.js.map → dist-2S22UD3L.js.map} +0 -0
- /package/dist/chunks/{dist-ZAGIMP7N.js.map → dist-BX53YVW2.js.map} +0 -0
- /package/dist/chunks/{dist-SX66KAH4.js.map → dist-CIOAMQ5V.js.map} +0 -0
- /package/dist/chunks/{dist-6O3HSFZP.js.map → dist-CS6PGGNY.js.map} +0 -0
- /package/dist/chunks/{dist-DFLFYX3A.js.map → dist-YMNLOZFF.js.map} +0 -0
- /package/dist/chunks/{dist-7B6PZO7C.js.map → dist-ZOXEFXEG.js.map} +0 -0
- /package/dist/chunks/{dist-Y6SGSSMO.js.map → dist-ZQNCDMNT.js.map} +0 -0
- /package/dist/chunks/{doctor-2AOB47IO.js.map → doctor-NXTO5W7O.js.map} +0 -0
- /package/dist/chunks/{drain-M6AGCMJX.js.map → drain-AN6TSG5Z.js.map} +0 -0
- /package/dist/chunks/{eval-YHY3VO7B.js.map → eval-IQVUB53L.js.map} +0 -0
- /package/dist/chunks/{home-AC5LQKDR.js.map → home-OHK7HIRS.js.map} +0 -0
- /package/dist/chunks/{lifecycle-CQXCTLAZ.js.map → lifecycle-SZCCUZSZ.js.map} +0 -0
- /package/dist/chunks/{login-YA652CIL.js.map → login-6OWXZOWM.js.map} +0 -0
- /package/dist/chunks/{logs-2PREHSOD.js.map → logs-DHUCKQZI.js.map} +0 -0
- /package/dist/chunks/{output-schema-JTPOC3NL.js.map → output-schema-JKO3QUVC.js.map} +0 -0
- /package/dist/chunks/{pal-FNSNP47Q.js.map → pal-5GFCH4E5.js.map} +0 -0
- /package/dist/chunks/{providers-M5HWW7DH.js.map → providers-22W6AUTI.js.map} +0 -0
- /package/dist/chunks/{resume-UKK4HVCO.js.map → resume-MGFWNJ6Q.js.map} +0 -0
- /package/dist/chunks/{resume-command-LPN33FIF.js.map → resume-command-R6QPISLR.js.map} +0 -0
- /package/dist/chunks/{schedule-J2IY3SVE.js.map → schedule-QDEIY4QB.js.map} +0 -0
- /package/dist/chunks/{session-step-2B46NVE7.js.map → session-step-X6LLEFHX.js.map} +0 -0
- /package/dist/chunks/{skills-X2V3TNTK.js.map → skills-YAMIRCHY.js.map} +0 -0
- /package/dist/chunks/{state-VDTYWZ5S.js.map → state-3ACU54IM.js.map} +0 -0
- /package/dist/chunks/{store-C27Q22UV.js.map → store-7RLXPZE2.js.map} +0 -0
- /package/dist/chunks/{store-DRPRQLDD.js.map → store-AR4ZFSJ4.js.map} +0 -0
- /package/dist/chunks/{store-S4QRR5DH.js.map → store-OXXJMFPP.js.map} +0 -0
- /package/dist/chunks/{upgrade-I2GMLDWZ.js.map → upgrade-IEU2FN3F.js.map} +0 -0
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { type LearningCycleResult, type LearningModel, type LearningProposal } from '@namzu/sdk';
|
|
2
|
+
import { type LearningGeneratorSettings } from './generator-settings.js';
|
|
3
|
+
import type { SessionLearningTarget } from './session-store.js';
|
|
4
|
+
/** The kind of task the experience library groups cycles by. */
|
|
5
|
+
export declare const GENERATOR_DOMAIN = "session-guidance";
|
|
6
|
+
export type GeneratorSkip = 'disabled' | 'no-observations' | 'few-observations' | 'cooldown' | 'daily-cap' | 'busy';
|
|
7
|
+
export type GeneratorOutcome = {
|
|
8
|
+
readonly status: 'skipped';
|
|
9
|
+
readonly reason: GeneratorSkip;
|
|
10
|
+
} | {
|
|
11
|
+
readonly status: 'ran';
|
|
12
|
+
readonly cycle: LearningCycleResult;
|
|
13
|
+
readonly proposal: LearningProposal | null;
|
|
14
|
+
readonly tokens: number;
|
|
15
|
+
};
|
|
16
|
+
export interface GeneratorRunOptions {
|
|
17
|
+
readonly target: SessionLearningTarget;
|
|
18
|
+
readonly model: LearningModel;
|
|
19
|
+
/**
|
|
20
|
+
* Names the model route, so a change of route is a change of evaluation
|
|
21
|
+
* conditions. A function is called only once a cycle is going to run, so a
|
|
22
|
+
* check that starts nothing never looks the route up.
|
|
23
|
+
*/
|
|
24
|
+
readonly route: string | (() => Promise<string>);
|
|
25
|
+
readonly settings: LearningGeneratorSettings;
|
|
26
|
+
/** `automatic` honours the thresholds and the cooldown; `manual` is one cycle on request. */
|
|
27
|
+
readonly mode: 'automatic' | 'manual';
|
|
28
|
+
readonly signal: AbortSignal;
|
|
29
|
+
readonly now?: () => number;
|
|
30
|
+
readonly progress?: (message: string) => void;
|
|
31
|
+
}
|
|
32
|
+
/** Plain wording for a cycle that did not start. */
|
|
33
|
+
export declare function describeSkip(reason: GeneratorSkip): string;
|
|
34
|
+
/**
|
|
35
|
+
* One built-in learning cycle for this project. The generator proposes one
|
|
36
|
+
* revision of the project's guidance from what conversations kept and from
|
|
37
|
+
* earlier cycles of the same domain; the cycle checks it with the scenario
|
|
38
|
+
* evaluation (paired verification, protection, a fresh confirmation round) and
|
|
39
|
+
* activates it by exact revision only when both rounds pass. Everything it
|
|
40
|
+
* spends is counted against the cycle allowance and the daily allowance.
|
|
41
|
+
*/
|
|
42
|
+
export declare function runGeneratorCycle(options: GeneratorRunOptions): Promise<GeneratorOutcome>;
|
|
43
|
+
//# sourceMappingURL=generator-run.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generator-run.d.ts","sourceRoot":"","sources":["../../../src/integrations/learning/generator-run.ts"],"names":[],"mappings":"AACA,OAAO,EACN,KAAK,mBAAmB,EACxB,KAAK,aAAa,EAElB,KAAK,gBAAgB,EAKrB,MAAM,YAAY,CAAA;AACnB,OAAO,EAEN,KAAK,yBAAyB,EAE9B,MAAM,yBAAyB,CAAA;AAgBhC,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAA;AAE/D,gEAAgE;AAChE,eAAO,MAAM,gBAAgB,qBAAqB,CAAA;AAIlD,MAAM,MAAM,aAAa,GACtB,UAAU,GACV,iBAAiB,GACjB,kBAAkB,GAClB,UAAU,GACV,WAAW,GACX,MAAM,CAAA;AAET,MAAM,MAAM,gBAAgB,GACzB;IAAE,QAAQ,CAAC,MAAM,EAAE,SAAS,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,aAAa,CAAA;CAAE,GAC9D;IACA,QAAQ,CAAC,MAAM,EAAE,KAAK,CAAA;IACtB,QAAQ,CAAC,KAAK,EAAE,mBAAmB,CAAA;IACnC,QAAQ,CAAC,QAAQ,EAAE,gBAAgB,GAAG,IAAI,CAAA;IAC1C,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;CACtB,CAAA;AAEJ,MAAM,WAAW,mBAAmB;IACnC,QAAQ,CAAC,MAAM,EAAE,qBAAqB,CAAA;IACtC,QAAQ,CAAC,KAAK,EAAE,aAAa,CAAA;IAC7B;;;;OAIG;IACH,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,CAAC,MAAM,OAAO,CAAC,MAAM,CAAC,CAAC,CAAA;IAChD,QAAQ,CAAC,QAAQ,EAAE,yBAAyB,CAAA;IAC5C,6FAA6F;IAC7F,QAAQ,CAAC,IAAI,EAAE,WAAW,GAAG,QAAQ,CAAA;IACrC,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAA;IAC5B,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,MAAM,CAAA;IAC3B,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAA;CAC7C;AAED,oDAAoD;AACpD,wBAAgB,YAAY,CAAC,MAAM,EAAE,aAAa,GAAG,MAAM,CAe1D;AAeD;;;;;;;GAOG;AACH,wBAAsB,iBAAiB,CAAC,OAAO,EAAE,mBAAmB,GAAG,OAAO,CAAC,gBAAgB,CAAC,CA+H/F"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Settings for the built-in learning generator. It is on unless the person
|
|
3
|
+
* turns it off, and what it may spend is bounded twice: one cycle, and one day.
|
|
4
|
+
*/
|
|
5
|
+
/** Tokens one cycle may record before it stops. A full cycle is about 60 model calls. */
|
|
6
|
+
export declare const DEFAULT_CYCLE_TOKENS = 120000;
|
|
7
|
+
/** Tokens all cycles together may record in one local calendar day. */
|
|
8
|
+
export declare const DEFAULT_DAILY_TOKENS = 300000;
|
|
9
|
+
/** New observations needed before a cycle starts by itself. */
|
|
10
|
+
export declare const MIN_OBSERVATIONS = 5;
|
|
11
|
+
/** The pause between two automatic cycles, whatever their outcome. */
|
|
12
|
+
export declare const COOLDOWN_MS: number;
|
|
13
|
+
export interface LearningGeneratorSettings {
|
|
14
|
+
readonly enabled: boolean;
|
|
15
|
+
readonly cycleTokens: number;
|
|
16
|
+
readonly dailyTokens: number;
|
|
17
|
+
}
|
|
18
|
+
/** The shape of the `learningGenerator` config key: a switch, or a mapping. */
|
|
19
|
+
export type LearningGeneratorConfig = boolean | {
|
|
20
|
+
readonly enabled?: boolean;
|
|
21
|
+
readonly cycleTokens?: number;
|
|
22
|
+
readonly dailyTokens?: number;
|
|
23
|
+
};
|
|
24
|
+
export declare function resolveGeneratorSettings(config: LearningGeneratorConfig | undefined): LearningGeneratorSettings;
|
|
25
|
+
//# sourceMappingURL=generator-settings.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generator-settings.d.ts","sourceRoot":"","sources":["../../../src/integrations/learning/generator-settings.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,yFAAyF;AACzF,eAAO,MAAM,oBAAoB,SAAU,CAAA;AAC3C,uEAAuE;AACvE,eAAO,MAAM,oBAAoB,SAAU,CAAA;AAC3C,+DAA+D;AAC/D,eAAO,MAAM,gBAAgB,IAAI,CAAA;AACjC,sEAAsE;AACtE,eAAO,MAAM,WAAW,QAAqB,CAAA;AAE7C,MAAM,WAAW,yBAAyB;IACzC,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAA;IACzB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAA;IAC5B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAA;CAC5B;AAED,+EAA+E;AAC/E,MAAM,MAAM,uBAAuB,GAChC,OAAO,GACP;IACA,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAA;IAC1B,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAA;IAC7B,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAA;CAC5B,CAAA;AAEJ,wBAAgB,wBAAwB,CACvC,MAAM,EAAE,uBAAuB,GAAG,SAAS,GACzC,yBAAyB,CAQ3B"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What the generator remembers between cycles: how far into the observations it
|
|
3
|
+
* has read, when it last ran, and what it spent today. A plain file beside the
|
|
4
|
+
* learning database, private to the project, never uploaded. A file that cannot
|
|
5
|
+
* be read is treated as empty, which can only make a cycle start sooner, never
|
|
6
|
+
* spend past the cap, because the cap is re-derived from the recorded cycles.
|
|
7
|
+
*/
|
|
8
|
+
export interface GeneratorState {
|
|
9
|
+
readonly version: 1;
|
|
10
|
+
/** The highest observation ordinal a finished cycle has read. */
|
|
11
|
+
readonly lastOrdinal: number;
|
|
12
|
+
readonly lastCycleAt: number | null;
|
|
13
|
+
/** The local calendar day the spend below belongs to, as YYYY-MM-DD. */
|
|
14
|
+
readonly day: string;
|
|
15
|
+
readonly dayTokens: number;
|
|
16
|
+
}
|
|
17
|
+
export declare function localDay(now: number): string;
|
|
18
|
+
export declare function readGeneratorState(dir: string): GeneratorState;
|
|
19
|
+
export declare function writeGeneratorState(dir: string, state: GeneratorState): void;
|
|
20
|
+
/** Tokens still available today under `cap`, given what the state recorded. */
|
|
21
|
+
export declare function dailyTokensLeft(state: GeneratorState, cap: number, now: number): number;
|
|
22
|
+
/**
|
|
23
|
+
* One cycle at a time per project. A lock older than half an hour belongs to a
|
|
24
|
+
* process that died and is taken over. Returns the release function, or null
|
|
25
|
+
* when another cycle holds the lock.
|
|
26
|
+
*/
|
|
27
|
+
export declare function acquireGeneratorLock(dir: string, now: number): (() => void) | null;
|
|
28
|
+
//# sourceMappingURL=generator-state.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generator-state.d.ts","sourceRoot":"","sources":["../../../src/integrations/learning/generator-state.ts"],"names":[],"mappings":"AAaA;;;;;;GAMG;AACH,MAAM,WAAW,cAAc;IAC9B,QAAQ,CAAC,OAAO,EAAE,CAAC,CAAA;IACnB,iEAAiE;IACjE,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAA;IAC5B,QAAQ,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,CAAA;IACnC,wEAAwE;IACxE,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAA;IACpB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;CAC1B;AAWD,wBAAgB,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAI5C;AAED,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,MAAM,GAAG,cAAc,CAgB9D;AAED,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,cAAc,GAAG,IAAI,CAM5E;AAED,+EAA+E;AAC/E,wBAAgB,eAAe,CAAC,KAAK,EAAE,cAAc,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAEvF;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,CAAC,MAAM,IAAI,CAAC,GAAG,IAAI,CAuBlF"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import type { LearningModel } from '@namzu/sdk';
|
|
2
|
+
import { type GeneratorOutcome, type GeneratorRunOptions } from './generator-run.js';
|
|
3
|
+
import type { LearningGeneratorSettings } from './generator-settings.js';
|
|
4
|
+
import type { SessionLearningTarget } from './session-store.js';
|
|
5
|
+
/**
|
|
6
|
+
* Learning that happens by itself. After a turn ends, and while no turn is in
|
|
7
|
+
* progress, the project's kept observations are checked; when enough new ones
|
|
8
|
+
* have accumulated and the pause and the daily allowance allow it, one cycle
|
|
9
|
+
* runs in the background of the session. It waits for an idle conversation
|
|
10
|
+
* before every model call, so it never competes with the person's own turn,
|
|
11
|
+
* and a session that closes stops it.
|
|
12
|
+
*/
|
|
13
|
+
/**
|
|
14
|
+
* Whether a question to the person is open. The background cycle never starts,
|
|
15
|
+
* and never makes a model call, while one is: the person is deciding something
|
|
16
|
+
* and the conversation, not a side job, has their attention.
|
|
17
|
+
*/
|
|
18
|
+
export interface QuestionGate {
|
|
19
|
+
isOpen(): boolean;
|
|
20
|
+
set(open: boolean): void;
|
|
21
|
+
subscribe(listener: () => void): () => void;
|
|
22
|
+
}
|
|
23
|
+
export declare function createQuestionGate(): QuestionGate;
|
|
24
|
+
export interface BackgroundLearningOptions {
|
|
25
|
+
readonly settings: LearningGeneratorSettings;
|
|
26
|
+
/** The observation store of this project, opened for writing, or null when it has none yet. */
|
|
27
|
+
readonly openTarget: () => SessionLearningTarget | null;
|
|
28
|
+
readonly learning: {
|
|
29
|
+
readonly model: LearningModel;
|
|
30
|
+
readonly route: (signal: AbortSignal) => Promise<string>;
|
|
31
|
+
};
|
|
32
|
+
/** Resolves once every observation offered so far is on disk. */
|
|
33
|
+
readonly flushObservations: () => Promise<void>;
|
|
34
|
+
/** Open while a per-call or approval question waits on the person. */
|
|
35
|
+
readonly questions?: QuestionGate;
|
|
36
|
+
readonly now?: () => number;
|
|
37
|
+
readonly run?: (options: GeneratorRunOptions) => Promise<GeneratorOutcome>;
|
|
38
|
+
/** Told after a cycle that reached a verdict, for a plain line the host may show. */
|
|
39
|
+
readonly onOutcome?: (outcome: Extract<GeneratorOutcome, {
|
|
40
|
+
status: 'ran';
|
|
41
|
+
}>) => void;
|
|
42
|
+
}
|
|
43
|
+
export interface BackgroundLearning {
|
|
44
|
+
turnStarted(): void;
|
|
45
|
+
turnEnded(): void;
|
|
46
|
+
/** Aborts a running cycle and resolves when it has settled. */
|
|
47
|
+
stop(): Promise<void>;
|
|
48
|
+
}
|
|
49
|
+
export declare function createBackgroundLearning(options: BackgroundLearningOptions): BackgroundLearning;
|
|
50
|
+
interface TurnSession {
|
|
51
|
+
send(...args: never[]): AsyncIterable<unknown>;
|
|
52
|
+
resumePaused(...args: never[]): AsyncIterable<unknown>;
|
|
53
|
+
close?(...args: never[]): unknown;
|
|
54
|
+
}
|
|
55
|
+
/** The same session with its turns counted for `learning`; every event passes through unchanged. */
|
|
56
|
+
export declare function withBackgroundLearning<T extends TurnSession>(session: T, learning: BackgroundLearning): T;
|
|
57
|
+
export {};
|
|
58
|
+
//# sourceMappingURL=generator-trigger.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generator-trigger.d.ts","sourceRoot":"","sources":["../../../src/integrations/learning/generator-trigger.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AAC/C,OAAO,EACN,KAAK,gBAAgB,EACrB,KAAK,mBAAmB,EAExB,MAAM,oBAAoB,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I,IAAI,CAAA;IACnB,SAAS,IAAI,IAAI,CAAA;IACjB,+DAA+D;IAC/D,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAAA;CACrB;AAED,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,yBAAyB,GAAG,kBAAkB,CAmF/F;AAED,UAAU,WAAW;IACpB,IAAI,CAAC,GAAG,IAAI,EAAE,KAAK,EAAE,GAAG,aAAa,CAAC,OAAO,CAAC,CAAA;IAC9C,YAAY,CAAC,GAAG,IAAI,EAAE,KAAK,EAAE,GAAG,aAAa,CAAC,OAAO,CAAC,CAAA;IACtD,KAAK,CAAC,CAAC,GAAG,IAAI,EAAE,KAAK,EAAE,GAAG,OAAO,CAAA;CACjC;AAED,oGAAoG;AACpG,wBAAgB,sBAAsB,CAAC,CAAC,SAAS,WAAW,EAC3D,OAAO,EAAE,CAAC,EACV,QAAQ,EAAE,kBAAkB,GAC1B,CAAC,CA8BH"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { DiskResidentAgenda, SqliteLearningStore } from '@namzu/sdk';
|
|
2
|
+
/**
|
|
3
|
+
* What the built-in generator activated into a project's guidance, and the one
|
|
4
|
+
* way back: restoring the revision that was active before a given activation,
|
|
5
|
+
* by exact revision. Nothing here deletes history; an undo is itself a new
|
|
6
|
+
* revision, so it can be inspected and is never silent.
|
|
7
|
+
*/
|
|
8
|
+
export interface LearnedRevision {
|
|
9
|
+
readonly cycleId: string;
|
|
10
|
+
readonly at: number;
|
|
11
|
+
readonly revision: string;
|
|
12
|
+
readonly description: string;
|
|
13
|
+
readonly body: string;
|
|
14
|
+
/** The guidance this activation replaced, or `none`. */
|
|
15
|
+
readonly replaced: string;
|
|
16
|
+
/** True for the revision conversations start with now. */
|
|
17
|
+
readonly active: boolean;
|
|
18
|
+
/** The agenda revision this activation created, which an undo restores from. */
|
|
19
|
+
readonly agendaRevision: number;
|
|
20
|
+
}
|
|
21
|
+
/** Activations of this project's guidance, newest first. */
|
|
22
|
+
export declare function listLearnedGuidance(store: SqliteLearningStore, agenda: Pick<DiskResidentAgenda, 'read'>): Promise<{
|
|
23
|
+
readonly active: string | null;
|
|
24
|
+
readonly revisions: readonly LearnedRevision[];
|
|
25
|
+
}>;
|
|
26
|
+
export type UndoOutcome = {
|
|
27
|
+
readonly status: 'undone';
|
|
28
|
+
readonly revision: LearnedRevision;
|
|
29
|
+
readonly restored: string;
|
|
30
|
+
} | {
|
|
31
|
+
readonly status: 'refused';
|
|
32
|
+
readonly reason: 'nothing-active' | 'unknown-cycle' | 'not-active' | 'history-missing';
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* Undo an activation. Without a cycle id, the newest activation that is still
|
|
36
|
+
* active. A revision that a later one replaced, or that is no longer active,
|
|
37
|
+
* is refused rather than guessed at: undoing it by restoring an old snapshot
|
|
38
|
+
* would also drop whatever came after.
|
|
39
|
+
*/
|
|
40
|
+
export declare function undoLearnedGuidance(store: SqliteLearningStore, agenda: Pick<DiskResidentAgenda, 'read' | 'readRevision' | 'rollbackSkill'>, cycleId?: string): Promise<UndoOutcome>;
|
|
41
|
+
/** Plain words for a refused undo. */
|
|
42
|
+
export declare function describeUndoRefusal(reason: Extract<UndoOutcome, {
|
|
43
|
+
status: 'refused';
|
|
44
|
+
}>['reason']): string;
|
|
45
|
+
//# sourceMappingURL=guidance-history.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"guidance-history.d.ts","sourceRoot":"","sources":["../../../src/integrations/learning/guidance-history.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAA;AAGzE;;;;;GAKG;AACH,MAAM,WAAW,eAAe;IAC/B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACxB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;IACnB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;IACzB,QAAQ,CAAC,WAAW,EAA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|
|
1
|
+
import type { GeneratorOutcome } from './generator-run.js';
|
|
2
|
+
/**
|
|
3
|
+
* The one plain line shown when learning by itself changed the folder's
|
|
4
|
+
* guidance: what it learned, and how to take it back. Only an activated
|
|
5
|
+
* revision is announced; a rejected or inconclusive cycle changes nothing, so
|
|
6
|
+
* it says nothing.
|
|
7
|
+
*/
|
|
8
|
+
export declare function describeLearned(outcome: Extract<GeneratorOutcome, {
|
|
9
|
+
status: 'ran';
|
|
10
|
+
}>): string | null;
|
|
11
|
+
//# sourceMappingURL=learned-notice.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"learned-notice.d.ts","sourceRoot":"","sources":["../../../src/integrations/learning/learned-notice.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAI1D;;;;;GAKG;AACH,wBAAgB,eAAe,CAC9B,OAAO,EAAE,OAAO,CAAC,gBAAgB,EAAE;IAAE,MAAM,EAAE,KAAK,CAAA;CAAE,CAAC,GACnD,MAAM,GAAG,IAAI,CAkBf"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { LearningModel, SessionId, TokenUsage } from '@namzu/sdk';
|
|
2
|
+
import type { SideLedger, SideModel } from '../small-model/side-model.js';
|
|
3
|
+
/**
|
|
4
|
+
* The model the built-in generator uses: the same route a side request takes
|
|
5
|
+
* (the configured small model, else the cheapest text model, else the
|
|
6
|
+
* conversation's own), through the configured provider. It counts what each
|
|
7
|
+
* call used, because the learning cycle's allowance is spent from those counts.
|
|
8
|
+
*
|
|
9
|
+
* Calls run one at a time. The counted usage of a call is read straight after
|
|
10
|
+
* the call, so two calls in flight at once could swap their counts.
|
|
11
|
+
*/
|
|
12
|
+
export interface SideLearningModel {
|
|
13
|
+
readonly model: LearningModel;
|
|
14
|
+
/** `provider/model` of the route a call would take now, for the evaluation's conditions. */
|
|
15
|
+
readonly route: (signal: AbortSignal) => Promise<string>;
|
|
16
|
+
}
|
|
17
|
+
/** The ledger a learning side model hands to `createSideModel`: it runs the request and keeps its usage. */
|
|
18
|
+
export declare function createLearningLedger(): SideLedger & {
|
|
19
|
+
take(): TokenUsage | undefined;
|
|
20
|
+
};
|
|
21
|
+
export declare function createSideLearningModel(options: {
|
|
22
|
+
readonly side: SideModel;
|
|
23
|
+
readonly ledger: ReturnType<typeof createLearningLedger>;
|
|
24
|
+
readonly sessionId: SessionId;
|
|
25
|
+
}): SideLearningModel;
|
|
26
|
+
//# sourceMappingURL=learning-model.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"learning-model.d.ts","sourceRoot":"","sources":["../../../src/integrations/learning/learning-model.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,UAAU,EAAU,MAAM,YAAY,CAAA;AAE9E,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAA;AAEzE;;;;;;;;GAQG;AACH,MAAM,WAAW,iBAAiB;IACjC,QAAQ,CAAC,KAAK,EAAE,aAAa,CAAA;IAC7B,4FAA4F;IAC5F,QAAQ,CAAC,KAAK,EAAE,CAAC,MAAM,EAAE,WAAW,KAAK,OAAO,CAAC,MAAM,CAAC,CAAA;CACxD;AAED,4GAA4G;AAC5G,wBAAgB,oBAAoB,IAAI,UAAU,GAAG;IAAE,IAAI,IAAI,UAAU,GAAG,SAAS,CAAA;CAAE,CAetF;AAED,wBAAgB,uBAAuB,CAAC,OAAO,EAAE;IAChD,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAA;IACxB,QAAQ,CAAC,MAAM,EAAE,UAAU,CAAC,OAAO,oBAAoB,CAAC,CAAA;IACxD,QAAQ,CAAC,SAAS,EAAE,SAAS,CAAA;CAC7B,GAAG,iBAAiB,CAgCpB"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { DiskResidentAgenda, type SessionPaths } from '@namzu/sdk';
|
|
2
|
+
/** The store `namzu learn --sessions` activates into. Created on first use. */
|
|
3
|
+
export declare function openProjectGuidance(paths: SessionPaths, tenantId: string): Promise<DiskResidentAgenda>;
|
|
4
|
+
/**
|
|
5
|
+
* The text a conversation in this project starts with: the active guidance,
|
|
6
|
+
* newest revision, within a fixed size. Null when nothing has been activated,
|
|
7
|
+
* and never creates anything. A guidance store that cannot be read is skipped
|
|
8
|
+
* rather than failing the conversation.
|
|
9
|
+
*/
|
|
10
|
+
export declare function readProjectGuidance(paths: SessionPaths, tenantId: string): Promise<string | null>;
|
|
11
|
+
//# sourceMappingURL=project-guidance.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"project-guidance.d.ts","sourceRoot":"","sources":["../../../src/integrations/learning/project-guidance.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,kBAAkB,EAAE,KAAK,YAAY,EAAmB,MAAM,YAAY,CAAA;AAoBnF,+EAA+E;AAC/E,wBAAsB,mBAAmB,CACxC,KAAK,EAAE,YAAY,EACnB,QAAQ,EAAE,MAAM,GACd,OAAO,CAAC,kBAAkB,CAAC,CAY7B;AAED;;;;;GAKG;AACH,wBAAsB,mBAAmB,CACxC,KAAK,EAAE,YAAY,EACnB,QAAQ,EAAE,MAAM,GACd,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CA8BxB"}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import type { LearningEvaluationContext, LearningModel } from '@namzu/sdk';
|
|
2
|
+
import type { ScenarioPlan } from './scenarios.js';
|
|
3
|
+
export interface ScenarioEvaluatorOptions {
|
|
4
|
+
readonly plan: ScenarioPlan;
|
|
5
|
+
readonly model: LearningModel;
|
|
6
|
+
/** Names the model route in the trial conditions, so a change of route is a change of condition. */
|
|
7
|
+
readonly route: string;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Build the `evaluate` callback for one cycle. Every model call is counted
|
|
11
|
+
* through the stage's own receipts; a stage that would pass the cycle's
|
|
12
|
+
* allowance stops before the next call and says so.
|
|
13
|
+
*/
|
|
14
|
+
export declare function createScenarioEvaluator(options: ScenarioEvaluatorOptions): (context: LearningEvaluationContext) => Promise<{
|
|
15
|
+
batch: {
|
|
16
|
+
baselineRevision: string;
|
|
17
|
+
candidateRevision: string;
|
|
18
|
+
baseline: {
|
|
19
|
+
taskId: string;
|
|
20
|
+
trial: number;
|
|
21
|
+
conditions: string;
|
|
22
|
+
trajectoryId: string;
|
|
23
|
+
result: {
|
|
24
|
+
case: string;
|
|
25
|
+
turn: {
|
|
26
|
+
output: string;
|
|
27
|
+
steps: never[];
|
|
28
|
+
toolCalls: never[];
|
|
29
|
+
stopReason: string;
|
|
30
|
+
totalTokens: number;
|
|
31
|
+
totalCostUsd: number;
|
|
32
|
+
durationMs: number;
|
|
33
|
+
};
|
|
34
|
+
scores: {
|
|
35
|
+
rubric: {
|
|
36
|
+
unavailable?: boolean | undefined;
|
|
37
|
+
score: number;
|
|
38
|
+
reason: string;
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
mean: number;
|
|
42
|
+
status: "failed" | "inconclusive" | "passed";
|
|
43
|
+
passed: boolean;
|
|
44
|
+
};
|
|
45
|
+
}[];
|
|
46
|
+
candidate: {
|
|
47
|
+
taskId: string;
|
|
48
|
+
trial: number;
|
|
49
|
+
conditions: string;
|
|
50
|
+
trajectoryId: string;
|
|
51
|
+
result: {
|
|
52
|
+
case: string;
|
|
53
|
+
turn: {
|
|
54
|
+
output: string;
|
|
55
|
+
steps: never[];
|
|
56
|
+
toolCalls: never[];
|
|
57
|
+
stopReason: string;
|
|
58
|
+
totalTokens: number;
|
|
59
|
+
totalCostUsd: number;
|
|
60
|
+
durationMs: number;
|
|
61
|
+
};
|
|
62
|
+
scores: {
|
|
63
|
+
rubric: {
|
|
64
|
+
unavailable?: boolean | undefined;
|
|
65
|
+
score: number;
|
|
66
|
+
reason: string;
|
|
67
|
+
};
|
|
68
|
+
};
|
|
69
|
+
mean: number;
|
|
70
|
+
status: "failed" | "inconclusive" | "passed";
|
|
71
|
+
passed: boolean;
|
|
72
|
+
};
|
|
73
|
+
}[];
|
|
74
|
+
attributions: {
|
|
75
|
+
taskId: string;
|
|
76
|
+
effect: "improvement" | "regression";
|
|
77
|
+
reason: string;
|
|
78
|
+
baselineTrajectories: string[];
|
|
79
|
+
candidateTrajectories: string[];
|
|
80
|
+
}[];
|
|
81
|
+
};
|
|
82
|
+
usageComplete: boolean;
|
|
83
|
+
}>;
|
|
84
|
+
//# sourceMappingURL=scenario-evaluator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scenario-evaluator.d.ts","sourceRoot":"","sources":["../../../src/integrations/learning/scenario-evaluator.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACX,yBAAyB,EACzB,aAAa,EAGb,MAAM,YAAY,CAAA;AACnB,OAAO,KAAK,EAAY,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAwE5D,MAAM,WAAW,wBAAwB;IACxC,QAAQ,CAAC,IAAI,EAAE,YAAY,CAAA;IAC3B,QAAQ,CAAC,KAAK,EAAE,aAAa,CAAA;IAC7B,oGAAoG;IACpG,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;CACtB;AAED;;;;GAIG;AACH,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,wBAAwB,IAC1D,SAAS,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgJhD"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The scenarios the built-in learning evaluation replays. They belong to the
|
|
3
|
+
* evaluator: the generator never sees them, and the leak tripwire refuses a
|
|
4
|
+
* candidate that repeats one. Each scenario has two phrasings (two trials of
|
|
5
|
+
* one task, run under different conditions) and a rubric the judge applies.
|
|
6
|
+
*
|
|
7
|
+
* Target scenarios ask how a conversation recovers from trouble, which is what
|
|
8
|
+
* the observations are about. Protection scenarios are plain tasks a revision
|
|
9
|
+
* of the guidance must not make worse. Verification and confirmation use
|
|
10
|
+
* different tasks, so a revision cannot pass the second round on what it saw
|
|
11
|
+
* in the first.
|
|
12
|
+
*/
|
|
13
|
+
export interface ScenarioTrial {
|
|
14
|
+
readonly prompt: string;
|
|
15
|
+
readonly rubric: string;
|
|
16
|
+
}
|
|
17
|
+
export interface Scenario {
|
|
18
|
+
readonly id: string;
|
|
19
|
+
readonly kind: 'target' | 'protection';
|
|
20
|
+
readonly trials: readonly [ScenarioTrial, ScenarioTrial];
|
|
21
|
+
}
|
|
22
|
+
export declare const SCENARIOS: readonly Scenario[];
|
|
23
|
+
export interface ScenarioPlan {
|
|
24
|
+
readonly verification: readonly Scenario[];
|
|
25
|
+
readonly confirmation: readonly Scenario[];
|
|
26
|
+
/** Task ids the protection plan names, disjoint across the two rounds. */
|
|
27
|
+
readonly protection: {
|
|
28
|
+
readonly verification: readonly string[];
|
|
29
|
+
readonly confirmation: readonly string[];
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Five tasks per round: three target and two protection, none shared between
|
|
34
|
+
* the rounds. The split is fixed so that a result can be compared across
|
|
35
|
+
* cycles; a change to it is a change of the evaluator revision.
|
|
36
|
+
*/
|
|
37
|
+
export declare function scenarioPlan(): ScenarioPlan;
|
|
38
|
+
/** The text a candidate must not repeat: every prompt and rubric the evaluation holds. */
|
|
39
|
+
export declare function scenarioProtectedContents(plan: ScenarioPlan): string[];
|
|
40
|
+
/** Names the evaluation as a whole; bump it when the scenarios, rubrics or judge change. */
|
|
41
|
+
export declare const SCENARIO_EVALUATOR_REVISION = "scenario-replay-v1";
|
|
42
|
+
//# sourceMappingURL=scenarios.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scenarios.d.ts","sourceRoot":"","sources":["../../../src/integrations/learning/scenarios.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,MAAM,WAAW,aAAa;IAC7B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;IACvB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;CACvB;AAED,MAAM,WAAW,QAAQ;IACxB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;IACnB,QAAQ,CAAC,IAAI,EAAE,QAAQ,GAAG,YAAY,CAAA;IACtC,QAAQ,CAAC,MAAM,EAAE,SAAS,CAAC,aAAa,EAAE,aAAa,CAAC,CAAA;CACxD;AA0BD,eAAO,MAAM,SAAS,EAAE,SAAS,QAAQ,EA2HxC,CAAA;AAED,MAAM,WAAW,YAAY;IAC5B,QAAQ,CAAC,YAAY,EAAE,SAAS,QAAQ,EAAE,CAAA;IAC1C,QAAQ,CAAC,YAAY,EAAE,SAAS,QAAQ,EAAE,CAAA;IAC1C,0EAA0E;IAC1E,QAAQ,CAAC,UAAU,EAAE;QACpB,QAAQ,CAAC,YAAY,EAAE,SAAS,MAAM,EAAE,CAAA;QACxC,QAAQ,CAAC,YAAY,EAAE,SAAS,MAAM,EAAE,CAAA;KACxC,CAAA;CACD;AAQD;;;;GAIG;AACH,wBAAgB,YAAY,IAAI,YAAY,CAuB3C;AAED,0FAA0F;AAC1F,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,YAAY,GAAG,MAAM,EAAE,CAItE;AAED,4FAA4F;AAC5F,eAAO,MAAM,2BAA2B,uBAAuB,CAAA"}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { type ProjectId, type SessionPaths, type TenantId } from '@namzu/sdk';
|
|
2
|
+
/**
|
|
3
|
+
* Failures and recoveries an ordinary conversation already classifies, kept as
|
|
4
|
+
* learning observations so a later `namzu learn` has something real to work
|
|
5
|
+
* from. A conversation needs no resident for this.
|
|
6
|
+
*
|
|
7
|
+
* What is kept: a reference to the conversation and turn, the kind of failure,
|
|
8
|
+
* and one short redacted sentence. Never the prompt, the model's answer or a
|
|
9
|
+
* tool's output. It stays in the project's own state directory, is never
|
|
10
|
+
* uploaded, and is dropped after {@link RETENTION_DAYS} days. The
|
|
11
|
+
* `learningObservations` config key turns it off.
|
|
12
|
+
*/
|
|
13
|
+
export declare const RETENTION_DAYS = 30;
|
|
14
|
+
/** One standing target: guidance for how conversations are run in this project. */
|
|
15
|
+
export declare const SESSION_SKILL = "session-guidance";
|
|
16
|
+
export declare const SESSION_AGENT_KEY = "sessions";
|
|
17
|
+
/** The events this module reads; the conversation's own event stream satisfies it. */
|
|
18
|
+
export type FeedEvent = {
|
|
19
|
+
readonly kind: 'tool-end';
|
|
20
|
+
readonly turnId?: string;
|
|
21
|
+
readonly toolName: string;
|
|
22
|
+
readonly isError: boolean;
|
|
23
|
+
/** What the tool answered; read only to tell a refused call from a failed one, never kept. */
|
|
24
|
+
readonly output?: string;
|
|
25
|
+
readonly summary: string;
|
|
26
|
+
readonly plainFailure?: string;
|
|
27
|
+
/** `muted` marks advice (the read-first guard), not a fault. */
|
|
28
|
+
readonly plainFailureTone?: 'muted';
|
|
29
|
+
readonly declined?: unknown;
|
|
30
|
+
readonly cancelled?: boolean;
|
|
31
|
+
} | {
|
|
32
|
+
readonly kind: 'done';
|
|
33
|
+
readonly turnId?: string;
|
|
34
|
+
readonly stopReason?: string;
|
|
35
|
+
} | {
|
|
36
|
+
readonly kind: 'paused';
|
|
37
|
+
readonly turnId: string;
|
|
38
|
+
readonly reason: string;
|
|
39
|
+
readonly failure?: unknown;
|
|
40
|
+
readonly providerError?: unknown;
|
|
41
|
+
} | {
|
|
42
|
+
readonly kind: 'provider-wait';
|
|
43
|
+
readonly turnId?: string;
|
|
44
|
+
readonly code: string;
|
|
45
|
+
readonly attempt: number;
|
|
46
|
+
readonly maxRetries: number;
|
|
47
|
+
} | {
|
|
48
|
+
readonly kind: 'provider-fallback';
|
|
49
|
+
} | {
|
|
50
|
+
readonly kind: 'history-repair';
|
|
51
|
+
readonly duplicateResults: number;
|
|
52
|
+
readonly orphanedResults: number;
|
|
53
|
+
readonly interruptedCalls: number;
|
|
54
|
+
readonly rejectedImages?: number;
|
|
55
|
+
} | {
|
|
56
|
+
readonly kind: 'context';
|
|
57
|
+
readonly row?: string;
|
|
58
|
+
readonly shed: boolean;
|
|
59
|
+
} | {
|
|
60
|
+
readonly kind: 'error';
|
|
61
|
+
readonly message: string;
|
|
62
|
+
readonly failure?: unknown;
|
|
63
|
+
readonly providerError?: unknown;
|
|
64
|
+
readonly turnInProgress?: unknown;
|
|
65
|
+
} | {
|
|
66
|
+
readonly kind: string;
|
|
67
|
+
};
|
|
68
|
+
export interface SessionLearningFeedOptions {
|
|
69
|
+
readonly paths: SessionPaths;
|
|
70
|
+
readonly tenantId: TenantId;
|
|
71
|
+
readonly projectId: ProjectId;
|
|
72
|
+
readonly sessionId: string;
|
|
73
|
+
/** For retention only; defaults to the wall clock. */
|
|
74
|
+
readonly now?: () => number;
|
|
75
|
+
}
|
|
76
|
+
export interface SessionLearningFeed {
|
|
77
|
+
/** Offer one event. Never throws and never waits for the disk. */
|
|
78
|
+
observe(event: FeedEvent): void;
|
|
79
|
+
/** Resolves when every offered event has been written or dropped. */
|
|
80
|
+
flush(): Promise<void>;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* A short masked excerpt of free text (used for tool names and codes, never
|
|
84
|
+
* for a failure message, whose words cannot be masked reliably): home folders, absolute paths,
|
|
85
|
+
* links, email addresses, `key=value` secrets, bearer credentials and long
|
|
86
|
+
* token-like strings are replaced. Other words in the message are kept, so it
|
|
87
|
+
* is an excerpt, not a guarantee that no sensitive word survives.
|
|
88
|
+
*/
|
|
89
|
+
export declare function redactSummary(text: string, home?: string): string;
|
|
90
|
+
/** The moment a version-7 UUID was minted, or null for any other id. */
|
|
91
|
+
export declare function uuidTime(id: string): number | null;
|
|
92
|
+
/** When the record was written: its own stamp, else the session id's clock, else unknown. */
|
|
93
|
+
export declare function observedTime(record: {
|
|
94
|
+
trace: string;
|
|
95
|
+
sessionId: string;
|
|
96
|
+
}): number | null;
|
|
97
|
+
export declare function createSessionLearningFeed(options: SessionLearningFeedOptions): SessionLearningFeed;
|
|
98
|
+
/** The streams a conversation hands out, passed through unchanged while the feed watches them. */
|
|
99
|
+
interface FeedableSession {
|
|
100
|
+
send(...args: never[]): AsyncIterable<unknown>;
|
|
101
|
+
resumePaused(...args: never[]): AsyncIterable<unknown>;
|
|
102
|
+
close?(...args: never[]): unknown;
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* The same session with `send` and `resumePaused` watched by `feed`. Every
|
|
106
|
+
* other member, and every event, is exactly what the session produced.
|
|
107
|
+
*/
|
|
108
|
+
export declare function withSessionLearningFeed<T extends FeedableSession>(session: T, feed: SessionLearningFeed): T;
|
|
109
|
+
export {};
|
|
110
|
+
//# sourceMappingURL=session-feed.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"session-feed.d.ts","sourceRoot":"","sources":["../../../src/integrations/learning/session-feed.ts"],"names":[],"mappings":"AAGA,OAAO,EAEN,KAAK,SAAS,EACd,KAAK,YAAY,EAEjB,KAAK,QAAQ,EAEb,MAAM,YAAY,CAAA;AAGnB;;;;;;;;;;GAUG;AACH,eAAO,MAAM,cAAc,KAAK,CAAA;AAEhC,mFAAmF;AACnF,eAAO,MAAM,aAAa,qBAAqB,CAAA;AAC/C,eAAO,MAAM,iBAAiB,aAAa,CAAA;AAK3C,sFAAsF;AACtF,MAAM,MAAM,SAAS,GAClB;IACA,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAA;IACzB,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAA;IACxB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;IACzB,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAA;IACzB,8FAA8F;IAC9F,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAA;IACxB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACxB,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAA;IA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AAC,GAAG,IAAI,EAAE,KAAK,EAAE,GAAG,aAAa,CAAC,OAAO,CAAC,CAAA;IAC9C,YAAY,CAAC,GAAG,IAAI,EAAE,KAAK,EAAE,GAAG,aAAa,CAAC,OAAO,CAAC,CAAA;IACtD,KAAK,CAAC,CAAC,GAAG,IAAI,EAAE,KAAK,EAAE,GAAG,OAAO,CAAA;CACjC;AAED;;;GAGG;AACH,wBAAgB,uBAAuB,CAAC,CAAC,SAAS,eAAe,EAChE,OAAO,EAAE,CAAC,EACV,IAAI,EAAE,mBAAmB,GACvB,CAAC,CA8BH"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { SessionPaths, SqliteLearningStore } from '@namzu/sdk';
|
|
2
|
+
/**
|
|
3
|
+
* The project's conversation observations, opened read-only unless `readOnly` is false. Null when this
|
|
4
|
+
* folder has no project, no identity, or nothing has been recorded. Needs no
|
|
5
|
+
* resident.
|
|
6
|
+
*/
|
|
7
|
+
export declare function sessionLearningStore(cwd: string, readOnly?: boolean): Promise<SessionLearningTarget | null>;
|
|
8
|
+
/** What a caller needs besides the store to activate guidance for this project. */
|
|
9
|
+
export interface SessionLearningTarget extends SqliteLearningStore {
|
|
10
|
+
readonly target: {
|
|
11
|
+
readonly paths: SessionPaths;
|
|
12
|
+
readonly tenantId: string;
|
|
13
|
+
readonly projectId: string;
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* The observation store of a project the caller already knows, opened for
|
|
18
|
+
* writing. Null when nothing has been recorded there yet. A conversation uses
|
|
19
|
+
* this to learn from its own project without looking the project up again.
|
|
20
|
+
*/
|
|
21
|
+
export declare function openLearningTarget(paths: SessionPaths, tenantId: string, projectId: string): SessionLearningTarget | null;
|
|
22
|
+
//# sourceMappingURL=session-store.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"session-store.d.ts","sourceRoot":"","sources":["../../../src/integrations/learning/session-store.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAA;AAO9D;;;;GAIG;AACH,wBAAsB,oBAAoB,CACzC,GAAG,EAAE,MAAM,EACX,QAAQ,UAAO,GACb,OAAO,CAAC,qBAAqB,GAAG,IAAI,CAAC,CA+BvC;AAED,mFAAmF;AACnF,MAAM,WAAW,qBAAsB,SAAQ,mBAAmB;IACjE,QAAQ,CAAC,MAAM,EAAE;QAChB,QAAQ,CAAC,KAAK,EAAE,YAAY,CAAA;QAC5B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;QACzB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;KAC1B,CAAA;CACD;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CACjC,KAAK,EAAE,YAAY,EACnB,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,MAAM,GACf,qBAAqB,GAAG,IAAI,CAqB9B"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { LearningSource, LearningState } from '@namzu/sdk';
|
|
2
|
+
/** Resolve only declared local file dependencies; no credentials, network or model calls. */
|
|
3
|
+
export declare function learningSources(cwd: string, learning?: LearningState): () => readonly LearningSource[];
|
|
4
|
+
//# sourceMappingURL=sources.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sources.d.ts","sourceRoot":"","sources":["../../../src/integrations/learning/sources.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AAM/D,6FAA6F;AAC7F,wBAAgB,eAAe,CAC9B,GAAG,EAAE,MAAM,EACX,QAAQ,CAAC,EAAE,aAAa,GACtB,MAAM,SAAS,cAAc,EAAE,CA4EjC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { SqliteLearningStore } from '@namzu/sdk';
|
|
2
2
|
import { type CliResident } from './storage.js';
|
|
3
3
|
/**
|
|
4
4
|
* One database per resident agent, beside its runner state:
|
|
@@ -6,5 +6,5 @@ import { type CliResident } from './storage.js';
|
|
|
6
6
|
* it references in `artifacts/`. A database from the old installation-wide
|
|
7
7
|
* location is never opened; the SDK refuses one at an older schema version.
|
|
8
8
|
*/
|
|
9
|
-
export declare function residentLearningStore(resident: CliResident, readOnly?: boolean):
|
|
9
|
+
export declare function residentLearningStore(resident: CliResident, readOnly?: boolean): SqliteLearningStore | null;
|
|
10
10
|
//# sourceMappingURL=learning-storage.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"learning-storage.d.ts","sourceRoot":"","sources":["../../../src/integrations/resident/learning-storage.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"learning-storage.d.ts","sourceRoot":"","sources":["../../../src/integrations/resident/learning-storage.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAA;AAEhD,OAAO,EAAE,KAAK,WAAW,EAAwB,MAAM,cAAc,CAAA;AAErE;;;;;GAKG;AACH,wBAAgB,qBAAqB,CACpC,QAAQ,EAAE,WAAW,EACrB,QAAQ,UAAQ,GACd,mBAAmB,GAAG,IAAI,CAqC5B"}
|