chainlesschain 0.162.101 → 0.162.103
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/README.md +1 -1
- package/package.json +2 -2
- package/scripts/postinstall.mjs +33 -3
- package/src/assets/web-panel/assets/{AIOps-NeD6mA1O.js → AIOps-BpJ5yCcV.js} +1 -1
- package/src/assets/web-panel/assets/{ActionButton-Bhp7A7vO.js → ActionButton-B1uBfxnA.js} +1 -1
- package/src/assets/web-panel/assets/{Analytics-DgdI84Jy.js → Analytics-0ubw5quf.js} +3 -3
- package/src/assets/web-panel/assets/{AppLayout-Qw29caa7.js → AppLayout-go-GyyM_.js} +4 -4
- package/src/assets/web-panel/assets/{Audit-DgkzhBjz.js → Audit-CdUfoUnM.js} +1 -1
- package/src/assets/web-panel/assets/{Backup-CiWEQoW5.js → Backup-CBn0xtsa.js} +1 -1
- package/src/assets/web-panel/assets/{BaseInput-BWNbkeDF.js → BaseInput-a9fqTkvL.js} +1 -1
- package/src/assets/web-panel/assets/{Chat-CUcj4Vyd.js → Chat-D-d_IatD.js} +6 -6
- package/src/assets/web-panel/assets/{ChatBubbleRenderer-bAMNCgEj.js → ChatBubbleRenderer-Co9h0SbA.js} +1 -1
- package/src/assets/web-panel/assets/{Checkbox-B0uZTW8f.js → Checkbox-CiKEjtXm.js} +1 -1
- package/src/assets/web-panel/assets/{Codegen-BPk7b-Xa.js → Codegen-OQxW_9Z2.js} +1 -1
- package/src/assets/web-panel/assets/{Col-C2cV_dw4.js → Col-BZHXUEnZ.js} +1 -1
- package/src/assets/web-panel/assets/{Community-CDN6Yggb.js → Community-D3xno9fj.js} +1 -1
- package/src/assets/web-panel/assets/{Compact-C4WPtW_V.js → Compact-D62jpZk_.js} +1 -1
- package/src/assets/web-panel/assets/{Compliance-BGUfeH-3.js → Compliance-D4jFTAcQ.js} +1 -1
- package/src/assets/web-panel/assets/{Cowork-CsnVgF-o.js → Cowork-BOU_wir4.js} +3 -3
- package/src/assets/web-panel/assets/{Cron--rGanASk.js → Cron-Cr9BlJA7.js} +2 -2
- package/src/assets/web-panel/assets/{Crosschain-D_CLrd-0.js → Crosschain-L9M--CXb.js} +1 -1
- package/src/assets/web-panel/assets/{DID-iYkbVc8W.js → DID-xFu3-VWT.js} +2 -2
- package/src/assets/web-panel/assets/{Dashboard-CuFMU98t.js → Dashboard--ax48T3j.js} +2 -2
- package/src/assets/web-panel/assets/{Dropdown-BPSjv_Ye.js → Dropdown-CTOS8daR.js} +1 -1
- package/src/assets/web-panel/assets/{EmailListRenderer-DBmk7czO.js → EmailListRenderer-CNLSX81U.js} +1 -1
- package/src/assets/web-panel/assets/{FamilyGuardDashboard-BaCArN11.js → FamilyGuardDashboard-5EjFynBc.js} +1 -1
- package/src/assets/web-panel/assets/{Federation-DsTV-8Ca.js → Federation-CoPyIWIu.js} +1 -1
- package/src/assets/web-panel/assets/{FormItemContext-C6fRr_6F.js → FormItemContext-BbzCNbYy.js} +1 -1
- package/src/assets/web-panel/assets/{GenericCardRenderer-AfuZCfyv.js → GenericCardRenderer-8_9_uXY0.js} +1 -1
- package/src/assets/web-panel/assets/{Git-CAFIrGhb.js → Git-Bz_qlVPg.js} +2 -2
- package/src/assets/web-panel/assets/{Governance-C-NaxDs4.js → Governance-7eepNCeD.js} +1 -1
- package/src/assets/web-panel/assets/{Inference-BPfeNZP7.js → Inference-DlBx5l1g.js} +1 -1
- package/src/assets/web-panel/assets/{KnowledgeGraph-DDUBte_m.js → KnowledgeGraph-BPkc--rM.js} +1 -1
- package/src/assets/web-panel/assets/{Logs-DWysA6JP.js → Logs-BQw4nPvS.js} +2 -2
- package/src/assets/web-panel/assets/{Marketplace-CAK68hXc.js → Marketplace-Cil3SdgN.js} +1 -1
- package/src/assets/web-panel/assets/{McpTools-CNmmoDAk.js → McpTools-Bnch7KrG.js} +3 -3
- package/src/assets/web-panel/assets/{Memory-D_KmFoui.js → Memory-assQ3Suc.js} +2 -2
- package/src/assets/web-panel/assets/{MobileBridge-CaY-6kjj.js → MobileBridge-D5mE8c-z.js} +2 -2
- package/src/assets/web-panel/assets/MobileProjects-C4MiDXw1.js +1 -0
- package/src/assets/web-panel/assets/{Mtc-YnLrtuXT.js → Mtc-CumojeLk.js} +5 -5
- package/src/assets/web-panel/assets/{MtcAudit-D38v836u.js → MtcAudit-3tTBc_fw.js} +4 -4
- package/src/assets/web-panel/assets/{Multisig-Dv3ad9S4.js → Multisig-Dl4IJBsl.js} +3 -3
- package/src/assets/web-panel/assets/{NLProgramming-MYTh2eWC.js → NLProgramming-DHN_cV9x.js} +1 -1
- package/src/assets/web-panel/assets/{Notes-DYO-0Hva.js → Notes-DeyTvwYk.js} +3 -3
- package/src/assets/web-panel/assets/{NotificationSettings-D39gOb3h.js → NotificationSettings-BUkj8mTj.js} +1 -1
- package/src/assets/web-panel/assets/{OrderTableRenderer-CXdO0z3I.js → OrderTableRenderer-BMpEXTki.js} +1 -1
- package/src/assets/web-panel/assets/{Organization-DOYTwQwt.js → Organization-B6Ogmkpz.js} +4 -4
- package/src/assets/web-panel/assets/{Overflow-Cm-go0yU.js → Overflow-DRUE-2Wz.js} +1 -1
- package/src/assets/web-panel/assets/{P2P-CakGtorw.js → P2P-CnMUkd64.js} +2 -2
- package/src/assets/web-panel/assets/{PdhVaultBrowser-BlmbHJnb.js → PdhVaultBrowser-B3nFxT3b.js} +4 -4
- package/src/assets/web-panel/assets/{Permissions-C_podo04.js → Permissions-CyG1FR7v.js} +4 -4
- package/src/assets/web-panel/assets/{PersonalDataHub-nBbehIKp.js → PersonalDataHub-BmN6YMb5.js} +3 -3
- package/src/assets/web-panel/assets/{Pipeline-CGzQUoKv.js → Pipeline-BZcamAnH.js} +1 -1
- package/src/assets/web-panel/assets/{Privacy-BuD-Dd9m.js → Privacy-D7_zsaY3.js} +1 -1
- package/src/assets/web-panel/assets/{ProjectInit-CLcFmGXU.js → ProjectInit-DNa7XQjg.js} +2 -2
- package/src/assets/web-panel/assets/{ProjectSettings-BxXTR0dH.js → ProjectSettings-KH2Dm09G.js} +2 -2
- package/src/assets/web-panel/assets/{Projects-DkpBjAfd.js → Projects-T-WqR3D6.js} +1 -1
- package/src/assets/web-panel/assets/{Providers-DwHK42ht.js → Providers-8GtQ6GgR.js} +1 -1
- package/src/assets/web-panel/assets/{QuickAsk-idJPKErk.js → QuickAsk-BuBM5Zpg.js} +1 -1
- package/src/assets/web-panel/assets/{Recommend-BvJj0Nu2.js → Recommend-DvH95W1b.js} +1 -1
- package/src/assets/web-panel/assets/{Reputation-BK9l4Rcf.js → Reputation-BHCpMEP6.js} +1 -1
- package/src/assets/web-panel/assets/{Row-rLxg7xk5.js → Row-BnMPysBm.js} +1 -1
- package/src/assets/web-panel/assets/{RssFeed-Cw6ZcHBY.js → RssFeed-C-T8B5VU.js} +3 -3
- package/src/assets/web-panel/assets/{Search-D8mKp506.js → Search-CioiZGkX.js} +1 -1
- package/src/assets/web-panel/assets/{Security-CXunojmQ.js → Security-zSApKqdd.js} +4 -4
- package/src/assets/web-panel/assets/{Services-BE5DgmPl.js → Services-CQh0UDXC.js} +2 -2
- package/src/assets/web-panel/assets/{Skeleton-CssL5wmE.js → Skeleton-C0dRaEVG.js} +1 -1
- package/src/assets/web-panel/assets/{Skills-zyS_1YrT.js → Skills-BgQRArsa.js} +1 -1
- package/src/assets/web-panel/assets/{Sla-DIVn2Roa.js → Sla-BNn7F3jc.js} +1 -1
- package/src/assets/web-panel/assets/{SpeechSettings-CjNdZWdj.js → SpeechSettings-kvVfKfqv.js} +1 -1
- package/src/assets/web-panel/assets/{SyncSettings-BCbu5WQT.js → SyncSettings-BwIkkX1E.js} +2 -2
- package/src/assets/web-panel/assets/{Tasks-BjFrgXge.js → Tasks-BkcvhBZw.js} +1 -1
- package/src/assets/web-panel/assets/{Templates-Cl4Y3lKN.js → Templates-COK0o2pL.js} +1 -1
- package/src/assets/web-panel/assets/{Tenant-k1T0F_eH.js → Tenant-DpK87fqo.js} +1 -1
- package/src/assets/web-panel/assets/{Terminal-i0tHF8fy.js → Terminal-2g2-XPT_.js} +2 -2
- package/src/assets/web-panel/assets/{TimelineRenderer-FmPaNyqK.js → TimelineRenderer-B4SJqyqf.js} +1 -1
- package/src/assets/web-panel/assets/{Tokens-BUWEiyab.js → Tokens-C3iSR8fH.js} +1 -1
- package/src/assets/web-panel/assets/{Trigger-9srMXwpo.js → Trigger-D1Oo58Yo.js} +1 -1
- package/src/assets/web-panel/assets/{Trust-hmGor_R2.js → Trust-CUhy4DDc.js} +1 -1
- package/src/assets/web-panel/assets/{UkeySign-Dst7K10a.js → UkeySign-r-kTqSw8.js} +1 -1
- package/src/assets/web-panel/assets/{VideoEditing-D_utUv1u.js → VideoEditing-B8MyBfCX.js} +1 -1
- package/src/assets/web-panel/assets/{Wallet-BpYTTseI.js → Wallet-CquTfSv0.js} +4 -4
- package/src/assets/web-panel/assets/{WebAuthn-CEIw8QrF.js → WebAuthn-BC7TP1H3.js} +5 -5
- package/src/assets/web-panel/assets/{WorkflowEditor-Bkb4bUZ_.js → WorkflowEditor-CELBSNbP.js} +1 -1
- package/src/assets/web-panel/assets/{chat-CTqDgGRH.js → chat-d66mbO2i.js} +1 -1
- package/src/assets/web-panel/assets/{colors-CnJHVFLk.js → colors-D0WRCg20.js} +1 -1
- package/src/assets/web-panel/assets/{compact-item-D4-v0ahl.js → compact-item-4__-8TIi.js} +1 -1
- package/src/assets/web-panel/assets/{createContext-CYDbnHZX.js → createContext-Dqsf52js.js} +1 -1
- package/src/assets/web-panel/assets/devWarning-DUAmX0aE.js +1 -0
- package/src/assets/web-panel/assets/{hasIn-CbYwlEz5.js → hasIn-ClTZOS8I.js} +1 -1
- package/src/assets/web-panel/assets/{index-DVKfa-z4.js → index-0Axwx1nN.js} +1 -1
- package/src/assets/web-panel/assets/{index-Cl7-mbsb.js → index-81SaeU6t.js} +1 -1
- package/src/assets/web-panel/assets/{index-CK8nROWH.js → index-B1TGSkBt.js} +1 -1
- package/src/assets/web-panel/assets/{index-BygyTsjr.js → index-B3vrmn5v.js} +1 -1
- package/src/assets/web-panel/assets/{index-B78d_-pR.js → index-BCOpbfAH.js} +1 -1
- package/src/assets/web-panel/assets/index-BLCwqv8j.js +1 -0
- package/src/assets/web-panel/assets/{index-YuO8gxKb.js → index-BNKECBZm.js} +1 -1
- package/src/assets/web-panel/assets/{index-tmNsJzQU.js → index-BwozLU75.js} +1 -1
- package/src/assets/web-panel/assets/{index-dKpwhR5x.js → index-C4_XhCJS.js} +1 -1
- package/src/assets/web-panel/assets/{index-BNz3yht2.js → index-C5l6tSky.js} +1 -1
- package/src/assets/web-panel/assets/{index-4767GEls.js → index-CFwkeSun.js} +1 -1
- package/src/assets/web-panel/assets/{index-BCQ4kcL3.js → index-CGf3oqM0.js} +1 -1
- package/src/assets/web-panel/assets/{index-xDe5BkjU.js → index-CJKyF-y8.js} +1 -1
- package/src/assets/web-panel/assets/{index-DjFQuno4.js → index-Cg8Qw3Jw.js} +1 -1
- package/src/assets/web-panel/assets/{index-Dl_NdY39.js → index-Cops66s2.js} +3 -3
- package/src/assets/web-panel/assets/{index-D8MYVsVB.js → index-Ct5SJenr.js} +1 -1
- package/src/assets/web-panel/assets/{index-CY971z_9.js → index-CxoWS8hl.js} +1 -1
- package/src/assets/web-panel/assets/{index-CVc_5aBF.js → index-D-ya3Ohe.js} +1 -1
- package/src/assets/web-panel/assets/{index-C4chfOjw.js → index-D68tyHYa.js} +1 -1
- package/src/assets/web-panel/assets/{index-BR4facv0.js → index-D9x6i7iV.js} +1 -1
- package/src/assets/web-panel/assets/{index-CxKdSB-p.js → index-DDLjwgva.js} +1 -1
- package/src/assets/web-panel/assets/{index-B-hiXmVK.js → index-DORg0Hps.js} +1 -1
- package/src/assets/web-panel/assets/{index-BR0FfrCL.js → index-DQaGurrQ.js} +1 -1
- package/src/assets/web-panel/assets/index-Db5JRQ6E.js +1 -0
- package/src/assets/web-panel/assets/{index-5NXdAIZK.js → index-DbY1lv1z.js} +1 -1
- package/src/assets/web-panel/assets/{index-BOUSaCsn.js → index-Dm7CYK3j.js} +1 -1
- package/src/assets/web-panel/assets/{index-DxvFrsxl.js → index-DpLhC0nx.js} +1 -1
- package/src/assets/web-panel/assets/{index-qNwkSspX.js → index-P4X9zSF2.js} +1 -1
- package/src/assets/web-panel/assets/{index-OqmUv5QO.js → index-PAiWA2un.js} +1 -1
- package/src/assets/web-panel/assets/{index-B8uhiRML.js → index-PMJ4tBAA.js} +1 -1
- package/src/assets/web-panel/assets/{index-CfshMjFN.js → index-Yi5Lr63I.js} +1 -1
- package/src/assets/web-panel/assets/{index-wxz2s6uW.js → index-ZZpfHd4J.js} +1 -1
- package/src/assets/web-panel/assets/{index-DdRtpQFq.js → index-b7a5aEX9.js} +1 -1
- package/src/assets/web-panel/assets/{index-C2fICr5d.js → index-e5zJLrJQ.js} +1 -1
- package/src/assets/web-panel/assets/{index-BGUOVPjO.js → index-fi2ikHoc.js} +1 -1
- package/src/assets/web-panel/assets/{index-8cmtr1jC.js → index-jAPphbJL.js} +1 -1
- package/src/assets/web-panel/assets/{index-DMKNVIqJ.js → index-leuwRsbf.js} +1 -1
- package/src/assets/web-panel/assets/{index-CP-UKwu8.js → index-luisYDBz.js} +1 -1
- package/src/assets/web-panel/assets/{index-DaCCLe7i.js → index-we9-1IbF.js} +1 -1
- package/src/assets/web-panel/assets/{initDefaultProps-qCQgpAty.js → initDefaultProps-zqDf7qWv.js} +1 -1
- package/src/assets/web-panel/assets/{motion-SkVSGdwu.js → motion-DRqTooll.js} +1 -1
- package/src/assets/web-panel/assets/{move-BpWxaW_x.js → move-N8tkRqS4.js} +1 -1
- package/src/assets/web-panel/assets/{omit-DlZWM2H4.js → omit-Cy01f2vw.js} +1 -1
- package/src/assets/web-panel/assets/{pickAttrs-DobtUnVe.js → pickAttrs-C2ycNXNi.js} +1 -1
- package/src/assets/web-panel/assets/{placementArrow-CD6mYRZi.js → placementArrow-D60Xb1j9.js} +1 -1
- package/src/assets/web-panel/assets/{responsiveObserve-DvIIMTD_.js → responsiveObserve-BF8Y-1HQ.js} +1 -1
- package/src/assets/web-panel/assets/{slide-CVgyUfaA.js → slide-DDi6zYZf.js} +1 -1
- package/src/assets/web-panel/assets/{statusUtils-DrUDnjy_.js → statusUtils-CWPq6UzA.js} +1 -1
- package/src/assets/web-panel/assets/{styleChecker-BNYQS60m.js → styleChecker-D4zVyb4w.js} +1 -1
- package/src/assets/web-panel/assets/{useFlexGapSupport-DYv7Tvk0.js → useFlexGapSupport-BEMNO3oR.js} +1 -1
- package/src/assets/web-panel/assets/{useFs-DmAD2atJ.js → useFs-DBLO8VR7.js} +1 -1
- package/src/assets/web-panel/assets/{usePersonalDataHub-DbLVKA3I.js → usePersonalDataHub-C83ZIrPY.js} +1 -1
- package/src/assets/web-panel/assets/{vnode-C3WEt6_P.js → vnode-Dcfyve-7.js} +1 -1
- package/src/assets/web-panel/assets/{zoom-CRoSX_oZ.js → zoom-Dg6uoWSc.js} +1 -1
- package/src/assets/web-panel/index.html +1 -1
- package/src/commands/__tests__/hub-health.test.js +105 -0
- package/src/commands/__tests__/hub-stats.test.js +106 -0
- package/src/commands/a2a.js +2 -1
- package/src/commands/bi.js +4 -3
- package/src/commands/browse.js +3 -2
- package/src/commands/codegen.js +7 -6
- package/src/commands/collab.js +2 -1
- package/src/commands/crosschain.js +5 -4
- package/src/commands/dao.js +10 -10
- package/src/commands/dbevo.js +3 -2
- package/src/commands/economy.js +8 -6
- package/src/commands/evolution.js +10 -8
- package/src/commands/export.js +2 -1
- package/src/commands/federation.js +8 -7
- package/src/commands/fusion.js +4 -3
- package/src/commands/git.js +2 -1
- package/src/commands/governance.js +6 -5
- package/src/commands/hardening.js +3 -2
- package/src/commands/hmemory.js +2 -1
- package/src/commands/hub.js +111 -32
- package/src/commands/inference.js +9 -8
- package/src/commands/infra.js +9 -8
- package/src/commands/instinct.js +66 -0
- package/src/commands/learning.js +66 -0
- package/src/commands/marketplace.js +5 -4
- package/src/commands/matrix.js +2 -1
- package/src/commands/memory.js +66 -0
- package/src/commands/nlprog.js +4 -3
- package/src/commands/nostr.js +4 -3
- package/src/commands/note.js +2 -1
- package/src/commands/ops.js +3 -2
- package/src/commands/perception.js +6 -5
- package/src/commands/privacy.js +13 -12
- package/src/commands/quantization.js +3 -2
- package/src/commands/recommend.js +8 -7
- package/src/commands/reputation.js +4 -3
- package/src/commands/runtime.js +6 -5
- package/src/commands/sandbox.js +5 -4
- package/src/commands/session.js +2 -1
- package/src/commands/sla.js +6 -5
- package/src/commands/social.js +6 -5
- package/src/commands/stress.js +7 -6
- package/src/commands/sync.js +2 -1
- package/src/commands/tenant.js +3 -2
- package/src/commands/trust.js +7 -6
- package/src/commands/wallet.js +2 -1
- package/src/gateways/ws/personal-data-hub-protocol.js +16 -3
- package/src/lib/__tests__/agents.test.js +225 -0
- package/src/lib/__tests__/cowork-observe-html.test.js +141 -0
- package/src/lib/__tests__/logger.test.js +110 -0
- package/src/lib/__tests__/project-inventory.test.js +280 -0
- package/src/lib/__tests__/project-root.test.js +96 -0
- package/src/lib/__tests__/provider-stream.test.js +190 -0
- package/src/lib/cli-arg.js +41 -0
- package/src/lib/cli-numeric.js +12 -3
- package/src/lib/instinct-manager.js +64 -0
- package/src/lib/learning/learning-tables.js +83 -0
- package/src/lib/mcp-oauth.js +10 -2
- package/src/lib/memory-manager.js +67 -0
- package/src/lib/personal-data-hub-wiring.js +135 -7
- package/src/lib/plan-mode.js +3 -2
- package/src/repl/__tests__/mcp-prompt.test.js +155 -0
- package/src/repl/__tests__/slash-macro.test.js +81 -0
- package/src/runtime/__tests__/coding-agent-contract-shared.test.js +136 -0
- package/src/runtime/__tests__/coding-agent-events.test.js +263 -0
- package/src/assets/web-panel/assets/MobileProjects-DhDxrWze.js +0 -1
- package/src/assets/web-panel/assets/devWarning-OhxeajH6.js +0 -1
- package/src/assets/web-panel/assets/index-Bbtoi_47.js +0 -1
- package/src/assets/web-panel/assets/index-Cb8RWwaB.js +0 -1
package/src/commands/learning.js
CHANGED
|
@@ -109,6 +109,72 @@ export function registerLearningCommand(program) {
|
|
|
109
109
|
}
|
|
110
110
|
});
|
|
111
111
|
|
|
112
|
+
// learning export — §8.3 cross-device backup: full dump of learning_trajectories
|
|
113
|
+
learning
|
|
114
|
+
.command("export")
|
|
115
|
+
.description("Export all learning trajectories as JSON (module 101 §8.3 backup)")
|
|
116
|
+
.option("--output <file>", "Write JSON array to file (default: stdout)")
|
|
117
|
+
.option("--json", "Output JSON ({ok,count} with --output; array otherwise)")
|
|
118
|
+
.action(async (options) => {
|
|
119
|
+
try {
|
|
120
|
+
const ctx = await bootstrap({ verbose: program.opts().verbose });
|
|
121
|
+
if (!ctx.db) {
|
|
122
|
+
logger.error("Database not available");
|
|
123
|
+
process.exit(1);
|
|
124
|
+
}
|
|
125
|
+
const { exportTrajectories } = await import("../lib/learning/learning-tables.js");
|
|
126
|
+
const rows = exportTrajectories(ctx.db.getDatabase());
|
|
127
|
+
if (options.output) {
|
|
128
|
+
const fs = await import("fs");
|
|
129
|
+
fs.writeFileSync(options.output, JSON.stringify(rows), "utf-8");
|
|
130
|
+
if (options.json) {
|
|
131
|
+
console.log(JSON.stringify({ ok: true, count: rows.length, output: options.output }));
|
|
132
|
+
} else {
|
|
133
|
+
logger.log(`exported ${rows.length} trajectories → ${options.output}`);
|
|
134
|
+
}
|
|
135
|
+
} else {
|
|
136
|
+
console.log(JSON.stringify(rows));
|
|
137
|
+
}
|
|
138
|
+
await shutdown();
|
|
139
|
+
} catch (err) {
|
|
140
|
+
logger.error(`learning export failed: ${err.message}`);
|
|
141
|
+
process.exit(1);
|
|
142
|
+
}
|
|
143
|
+
});
|
|
144
|
+
|
|
145
|
+
// learning import — §8.3 restore: idempotent upsert by id from a JSON-array file
|
|
146
|
+
learning
|
|
147
|
+
.command("import")
|
|
148
|
+
.description("Import learning trajectories from a JSON array file (idempotent upsert by id; §8.3)")
|
|
149
|
+
.requiredOption("--input <file>", "JSON array of trajectories to import")
|
|
150
|
+
.option("--json", "Output JSON result")
|
|
151
|
+
.action(async (options) => {
|
|
152
|
+
try {
|
|
153
|
+
const fs = await import("fs");
|
|
154
|
+
const rows = JSON.parse(fs.readFileSync(options.input, "utf-8"));
|
|
155
|
+
if (!Array.isArray(rows)) {
|
|
156
|
+
throw new Error("import: expected a JSON array of trajectories");
|
|
157
|
+
}
|
|
158
|
+
const ctx = await bootstrap({ verbose: program.opts().verbose });
|
|
159
|
+
if (!ctx.db) {
|
|
160
|
+
logger.error("Database not available");
|
|
161
|
+
process.exit(1);
|
|
162
|
+
}
|
|
163
|
+
const { importTrajectories } = await import("../lib/learning/learning-tables.js");
|
|
164
|
+
const result = importTrajectories(ctx.db.getDatabase(), rows);
|
|
165
|
+
if (options.json) {
|
|
166
|
+
console.log(JSON.stringify(result));
|
|
167
|
+
} else {
|
|
168
|
+
logger.log(`imported ${result.imported}, failed ${result.failed}`);
|
|
169
|
+
}
|
|
170
|
+
await shutdown();
|
|
171
|
+
if (!result.ok) process.exitCode = 1;
|
|
172
|
+
} catch (err) {
|
|
173
|
+
logger.error(`learning import failed: ${err.message}`);
|
|
174
|
+
process.exit(1);
|
|
175
|
+
}
|
|
176
|
+
});
|
|
177
|
+
|
|
112
178
|
// learning reflect
|
|
113
179
|
learning
|
|
114
180
|
.command("reflect")
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import chalk from "chalk";
|
|
8
|
+
import { intArg, floatArg } from "../lib/cli-arg.js";
|
|
8
9
|
import { logger } from "../lib/logger.js";
|
|
9
10
|
import { parseJsonOption } from "../lib/parse-json-option.js";
|
|
10
11
|
import { bootstrap, shutdown } from "../runtime/bootstrap.js";
|
|
@@ -240,7 +241,7 @@ export function registerMarketplaceCommand(program) {
|
|
|
240
241
|
"Status (pending|running|success|failed|timeout)",
|
|
241
242
|
"success",
|
|
242
243
|
)
|
|
243
|
-
.option("-d, --duration-ms <n>", "Duration in ms",
|
|
244
|
+
.option("-d, --duration-ms <n>", "Duration in ms", intArg("--duration-ms"))
|
|
244
245
|
.option("-e, --error <text>", "Error message when failed")
|
|
245
246
|
.option("--json", "Output as JSON")
|
|
246
247
|
.action(async (serviceId, options) => {
|
|
@@ -466,7 +467,7 @@ export function registerMarketplaceCommand(program) {
|
|
|
466
467
|
mp.command("complete-invocation <invocation-id>")
|
|
467
468
|
.description("Complete a V2 invocation (RUNNING → SUCCESS)")
|
|
468
469
|
.option("-o, --output <json>", "JSON-encoded output")
|
|
469
|
-
.option("-d, --duration-ms <n>", "Duration in milliseconds",
|
|
470
|
+
.option("-d, --duration-ms <n>", "Duration in milliseconds", intArg("--duration-ms"))
|
|
470
471
|
.option("--json", "Output as JSON")
|
|
471
472
|
.action(async (invocationId, options) => {
|
|
472
473
|
try {
|
|
@@ -496,7 +497,7 @@ export function registerMarketplaceCommand(program) {
|
|
|
496
497
|
mp.command("fail-invocation <invocation-id>")
|
|
497
498
|
.description("Fail a V2 invocation")
|
|
498
499
|
.option("-m, --message <msg>", "Error message")
|
|
499
|
-
.option("-d, --duration-ms <n>", "Duration in milliseconds",
|
|
500
|
+
.option("-d, --duration-ms <n>", "Duration in milliseconds", intArg("--duration-ms"))
|
|
500
501
|
.action(async (invocationId, options) => {
|
|
501
502
|
try {
|
|
502
503
|
const ctx = await bootstrap({ verbose: program.opts().verbose });
|
|
@@ -515,7 +516,7 @@ export function registerMarketplaceCommand(program) {
|
|
|
515
516
|
|
|
516
517
|
mp.command("timeout-invocation <invocation-id>")
|
|
517
518
|
.description("Timeout a V2 invocation")
|
|
518
|
-
.option("-d, --duration-ms <n>", "Duration in milliseconds",
|
|
519
|
+
.option("-d, --duration-ms <n>", "Duration in milliseconds", intArg("--duration-ms"))
|
|
519
520
|
.action(async (invocationId, options) => {
|
|
520
521
|
try {
|
|
521
522
|
const ctx = await bootstrap({ verbose: program.opts().verbose });
|
package/src/commands/matrix.js
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import chalk from "chalk";
|
|
7
|
+
import { numericOption } from "../lib/cli-numeric.js";
|
|
7
8
|
import { logger } from "../lib/logger.js";
|
|
8
9
|
import { bootstrap, shutdown } from "../runtime/bootstrap.js";
|
|
9
10
|
import {
|
|
@@ -134,7 +135,7 @@ export function registerMatrixCommand(program) {
|
|
|
134
135
|
ensureMatrixTables(db);
|
|
135
136
|
|
|
136
137
|
const messages = getMessages(roomId, {
|
|
137
|
-
limit:
|
|
138
|
+
limit: numericOption(options.limit, { name: "--limit", integer: true, min: 1, fallback: 50 }),
|
|
138
139
|
});
|
|
139
140
|
if (options.json) {
|
|
140
141
|
console.log(JSON.stringify(messages, null, 2));
|
package/src/commands/memory.js
CHANGED
|
@@ -11,6 +11,8 @@ import {
|
|
|
11
11
|
addMemory,
|
|
12
12
|
searchMemory,
|
|
13
13
|
listMemory,
|
|
14
|
+
exportMemory,
|
|
15
|
+
importMemory,
|
|
14
16
|
deleteMemory,
|
|
15
17
|
appendDailyNote,
|
|
16
18
|
getDailyNote,
|
|
@@ -160,6 +162,70 @@ export function registerMemoryCommand(program) {
|
|
|
160
162
|
}
|
|
161
163
|
});
|
|
162
164
|
|
|
165
|
+
// memory export — §8.3 cross-device backup: full dump of memory_entries
|
|
166
|
+
memory
|
|
167
|
+
.command("export")
|
|
168
|
+
.description("Export all memory entries as JSON (module 101 §8.3 backup)")
|
|
169
|
+
.option("--output <file>", "Write JSON array to file (default: stdout)")
|
|
170
|
+
.option("--json", "Output JSON ({ok,count} with --output; array otherwise)")
|
|
171
|
+
.action(async (options) => {
|
|
172
|
+
try {
|
|
173
|
+
const ctx = await bootstrap({ verbose: program.opts().verbose });
|
|
174
|
+
if (!ctx.db) {
|
|
175
|
+
logger.error("Database not available");
|
|
176
|
+
process.exit(1);
|
|
177
|
+
}
|
|
178
|
+
const entries = exportMemory(ctx.db.getDatabase());
|
|
179
|
+
if (options.output) {
|
|
180
|
+
const fs = await import("fs");
|
|
181
|
+
fs.writeFileSync(options.output, JSON.stringify(entries), "utf-8");
|
|
182
|
+
if (options.json) {
|
|
183
|
+
console.log(JSON.stringify({ ok: true, count: entries.length, output: options.output }));
|
|
184
|
+
} else {
|
|
185
|
+
logger.log(`exported ${entries.length} memory entries → ${options.output}`);
|
|
186
|
+
}
|
|
187
|
+
} else {
|
|
188
|
+
console.log(JSON.stringify(entries)); // data command: emit the array
|
|
189
|
+
}
|
|
190
|
+
await shutdown();
|
|
191
|
+
} catch (err) {
|
|
192
|
+
logger.error(`memory export failed: ${err.message}`);
|
|
193
|
+
process.exit(1);
|
|
194
|
+
}
|
|
195
|
+
});
|
|
196
|
+
|
|
197
|
+
// memory import — §8.3 restore: idempotent upsert by id from a JSON-array file
|
|
198
|
+
memory
|
|
199
|
+
.command("import")
|
|
200
|
+
.description("Import memory entries from a JSON array file (idempotent upsert by id; §8.3)")
|
|
201
|
+
.requiredOption("--input <file>", "JSON array of memory entries to import")
|
|
202
|
+
.option("--json", "Output JSON result")
|
|
203
|
+
.action(async (options) => {
|
|
204
|
+
try {
|
|
205
|
+
const fs = await import("fs");
|
|
206
|
+
const entries = JSON.parse(fs.readFileSync(options.input, "utf-8"));
|
|
207
|
+
if (!Array.isArray(entries)) {
|
|
208
|
+
throw new Error("import: expected a JSON array of memory entries");
|
|
209
|
+
}
|
|
210
|
+
const ctx = await bootstrap({ verbose: program.opts().verbose });
|
|
211
|
+
if (!ctx.db) {
|
|
212
|
+
logger.error("Database not available");
|
|
213
|
+
process.exit(1);
|
|
214
|
+
}
|
|
215
|
+
const result = importMemory(ctx.db.getDatabase(), entries);
|
|
216
|
+
if (options.json) {
|
|
217
|
+
console.log(JSON.stringify(result));
|
|
218
|
+
} else {
|
|
219
|
+
logger.log(`imported ${result.imported}, failed ${result.failed}`);
|
|
220
|
+
}
|
|
221
|
+
await shutdown();
|
|
222
|
+
if (!result.ok) process.exitCode = 1;
|
|
223
|
+
} catch (err) {
|
|
224
|
+
logger.error(`memory import failed: ${err.message}`);
|
|
225
|
+
process.exit(1);
|
|
226
|
+
}
|
|
227
|
+
});
|
|
228
|
+
|
|
163
229
|
// memory add
|
|
164
230
|
memory
|
|
165
231
|
.command("add")
|
package/src/commands/nlprog.js
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
import { Command } from "commander";
|
|
6
|
+
import { intArg, floatArg } from "../lib/cli-arg.js";
|
|
6
7
|
|
|
7
8
|
import {
|
|
8
9
|
INTENT,
|
|
@@ -214,7 +215,7 @@ export function registerNlProgCommand(program) {
|
|
|
214
215
|
.description("List translations")
|
|
215
216
|
.option("-i, --intent <intent>", "Filter by intent")
|
|
216
217
|
.option("-s, --status <status>", "Filter by status")
|
|
217
|
-
.option("--limit <n>", "Max results",
|
|
218
|
+
.option("--limit <n>", "Max results", intArg("--limit"))
|
|
218
219
|
.option("--json", "JSON output")
|
|
219
220
|
.action((opts) => {
|
|
220
221
|
const db = _requireDb(nlp);
|
|
@@ -289,7 +290,7 @@ export function registerNlProgCommand(program) {
|
|
|
289
290
|
)
|
|
290
291
|
.requiredOption("-p, --pattern <text>", "Pattern description")
|
|
291
292
|
.option("-e, --examples <json>", "Examples JSON")
|
|
292
|
-
.option("-f, --confidence <n>", "Confidence (0-1)",
|
|
293
|
+
.option("-f, --confidence <n>", "Confidence (0-1)", floatArg("--confidence"))
|
|
293
294
|
.option("-s, --source-files <json>", "Source files JSON")
|
|
294
295
|
.option("--json", "JSON output")
|
|
295
296
|
.action((opts) => {
|
|
@@ -326,7 +327,7 @@ export function registerNlProgCommand(program) {
|
|
|
326
327
|
.command("conventions")
|
|
327
328
|
.description("List project conventions")
|
|
328
329
|
.option("-c, --category <cat>", "Filter by category")
|
|
329
|
-
.option("--limit <n>", "Max results",
|
|
330
|
+
.option("--limit <n>", "Max results", intArg("--limit"))
|
|
330
331
|
.option("--json", "JSON output")
|
|
331
332
|
.action((opts) => {
|
|
332
333
|
const db = _requireDb(nlp);
|
package/src/commands/nostr.js
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import chalk from "chalk";
|
|
7
|
+
import { numericOption } from "../lib/cli-numeric.js";
|
|
7
8
|
import { logger } from "../lib/logger.js";
|
|
8
9
|
import { bootstrap, shutdown } from "../runtime/bootstrap.js";
|
|
9
10
|
import {
|
|
@@ -103,7 +104,7 @@ export function registerNostrCommand(program) {
|
|
|
103
104
|
|
|
104
105
|
const result = publishEvent(
|
|
105
106
|
db,
|
|
106
|
-
|
|
107
|
+
numericOption(options.kind, { name: "--kind", integer: true, min: 0 }),
|
|
107
108
|
content,
|
|
108
109
|
options.pubkey,
|
|
109
110
|
[],
|
|
@@ -140,8 +141,8 @@ export function registerNostrCommand(program) {
|
|
|
140
141
|
const db = ctx.db.getDatabase();
|
|
141
142
|
ensureNostrTables(db);
|
|
142
143
|
|
|
143
|
-
const filter = { limit:
|
|
144
|
-
if (options.kind) filter.kinds = [
|
|
144
|
+
const filter = { limit: numericOption(options.limit, { name: "--limit", integer: true, min: 1, fallback: 50 }) };
|
|
145
|
+
if (options.kind) filter.kinds = [numericOption(options.kind, { name: "--kind", integer: true, min: 0 })];
|
|
145
146
|
const events = getEvents(filter);
|
|
146
147
|
if (options.json) {
|
|
147
148
|
console.log(JSON.stringify(events, null, 2));
|
package/src/commands/note.js
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import chalk from "chalk";
|
|
7
|
+
import { numericOption } from "../lib/cli-numeric.js";
|
|
7
8
|
import { logger } from "../lib/logger.js";
|
|
8
9
|
import { bootstrap, shutdown } from "../runtime/bootstrap.js";
|
|
9
10
|
import {
|
|
@@ -151,7 +152,7 @@ export function registerNoteCommand(program) {
|
|
|
151
152
|
}
|
|
152
153
|
|
|
153
154
|
sql += " ORDER BY created_at DESC LIMIT ?";
|
|
154
|
-
params.push(
|
|
155
|
+
params.push(numericOption(options.limit, { name: "--limit", integer: true, min: 1, fallback: 20 }));
|
|
155
156
|
|
|
156
157
|
let notes = rawDb.prepare(sql).all(...params);
|
|
157
158
|
|
package/src/commands/ops.js
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
import { Command } from "commander";
|
|
6
|
+
import { intArg, floatArg } from "../lib/cli-arg.js";
|
|
6
7
|
|
|
7
8
|
import {
|
|
8
9
|
SEVERITY,
|
|
@@ -288,7 +289,7 @@ export function registerOpsCommand(program) {
|
|
|
288
289
|
.description("List incidents")
|
|
289
290
|
.option("-s, --severity <P0-P3>", "Filter by severity")
|
|
290
291
|
.option("-S, --status <status>", "Filter by status")
|
|
291
|
-
.option("--limit <n>", "Max results",
|
|
292
|
+
.option("--limit <n>", "Max results", intArg("--limit"))
|
|
292
293
|
.option("--json", "JSON output")
|
|
293
294
|
.action((opts) => {
|
|
294
295
|
const db = _dbFromCtx(ops);
|
|
@@ -380,7 +381,7 @@ export function registerOpsCommand(program) {
|
|
|
380
381
|
.description("List playbooks")
|
|
381
382
|
.option("-e, --enabled", "Only enabled")
|
|
382
383
|
.option("-d, --disabled", "Only disabled")
|
|
383
|
-
.option("--limit <n>", "Max results",
|
|
384
|
+
.option("--limit <n>", "Max results", intArg("--limit"))
|
|
384
385
|
.option("--json", "JSON output")
|
|
385
386
|
.action((opts) => {
|
|
386
387
|
const db = _dbFromCtx(ops);
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
import { Command } from "commander";
|
|
6
|
+
import { intArg, floatArg } from "../lib/cli-arg.js";
|
|
6
7
|
|
|
7
8
|
import {
|
|
8
9
|
MODALITY,
|
|
@@ -131,7 +132,7 @@ export function registerPerceptionCommand(program) {
|
|
|
131
132
|
)
|
|
132
133
|
.option("-i, --input <source>", "Input source (file path or session id)")
|
|
133
134
|
.option("-r, --result <json>", "Result data JSON")
|
|
134
|
-
.option("-c, --confidence <n>", "Confidence score (0-1)",
|
|
135
|
+
.option("-c, --confidence <n>", "Confidence score (0-1)", floatArg("--confidence"))
|
|
135
136
|
.option("--metadata <json>", "Metadata JSON")
|
|
136
137
|
.option("--json", "JSON output")
|
|
137
138
|
.action((opts) => {
|
|
@@ -173,7 +174,7 @@ export function registerPerceptionCommand(program) {
|
|
|
173
174
|
.description("List perception results")
|
|
174
175
|
.option("-m, --modality <type>", "Filter by modality")
|
|
175
176
|
.option("-a, --analysis <type>", "Filter by analysis type")
|
|
176
|
-
.option("--limit <n>", "Max results",
|
|
177
|
+
.option("--limit <n>", "Max results", intArg("--limit"))
|
|
177
178
|
.option("--json", "JSON output")
|
|
178
179
|
.action((opts) => {
|
|
179
180
|
const db = _dbFromCtx(perc);
|
|
@@ -262,7 +263,7 @@ export function registerPerceptionCommand(program) {
|
|
|
262
263
|
.description("List voice sessions")
|
|
263
264
|
.option("-s, --status <status>", "Filter by status")
|
|
264
265
|
.option("-l, --language <lang>", "Filter by language")
|
|
265
|
-
.option("--limit <n>", "Max results",
|
|
266
|
+
.option("--limit <n>", "Max results", intArg("--limit"))
|
|
266
267
|
.option("--json", "JSON output")
|
|
267
268
|
.action((opts) => {
|
|
268
269
|
const db = _dbFromCtx(perc);
|
|
@@ -329,7 +330,7 @@ export function registerPerceptionCommand(program) {
|
|
|
329
330
|
.command("index-list")
|
|
330
331
|
.description("List index entries")
|
|
331
332
|
.option("-m, --modality <type>", "Filter by modality")
|
|
332
|
-
.option("--limit <n>", "Max results",
|
|
333
|
+
.option("--limit <n>", "Max results", intArg("--limit"))
|
|
333
334
|
.option("--json", "JSON output")
|
|
334
335
|
.action((opts) => {
|
|
335
336
|
const db = _dbFromCtx(perc);
|
|
@@ -365,7 +366,7 @@ export function registerPerceptionCommand(program) {
|
|
|
365
366
|
.command("query <text>")
|
|
366
367
|
.description("Cross-modal search across index entries")
|
|
367
368
|
.option("-m, --modalities <csv>", "Filter modalities (comma-separated)")
|
|
368
|
-
.option("--limit <n>", "Max results",
|
|
369
|
+
.option("--limit <n>", "Max results", intArg("--limit"))
|
|
369
370
|
.option("--json", "JSON output")
|
|
370
371
|
.action((text, opts) => {
|
|
371
372
|
const db = _dbFromCtx(perc);
|
package/src/commands/privacy.js
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
import { Command } from "commander";
|
|
6
|
+
import { intArg, floatArg } from "../lib/cli-arg.js";
|
|
6
7
|
|
|
7
8
|
import {
|
|
8
9
|
FL_STATUS,
|
|
@@ -117,9 +118,9 @@ export function registerPrivacyCommand(program) {
|
|
|
117
118
|
.description("Create federated learning model")
|
|
118
119
|
.option("-t, --type <type>", "Model type", "neural_network")
|
|
119
120
|
.option("-a, --arch <architecture>", "Architecture", "mlp")
|
|
120
|
-
.option("-r, --rounds <n>", "Total training rounds",
|
|
121
|
-
.option("-l, --lr <rate>", "Learning rate",
|
|
122
|
-
.option("-p, --participants <n>", "Participant count",
|
|
121
|
+
.option("-r, --rounds <n>", "Total training rounds", intArg("--rounds"))
|
|
122
|
+
.option("-l, --lr <rate>", "Learning rate", floatArg("--lr"))
|
|
123
|
+
.option("-p, --participants <n>", "Participant count", intArg("--participants"))
|
|
123
124
|
.option("--json", "JSON output")
|
|
124
125
|
.action((name, opts) => {
|
|
125
126
|
const db = _dbFromCtx(pc);
|
|
@@ -183,7 +184,7 @@ export function registerPrivacyCommand(program) {
|
|
|
183
184
|
pc.command("models")
|
|
184
185
|
.description("List federated learning models")
|
|
185
186
|
.option("-s, --status <status>", "Filter by status")
|
|
186
|
-
.option("--limit <n>", "Max results",
|
|
187
|
+
.option("--limit <n>", "Max results", intArg("--limit"))
|
|
187
188
|
.option("--json", "JSON output")
|
|
188
189
|
.action((opts) => {
|
|
189
190
|
const db = _dbFromCtx(pc);
|
|
@@ -206,7 +207,7 @@ export function registerPrivacyCommand(program) {
|
|
|
206
207
|
.description("Create MPC computation")
|
|
207
208
|
.option("-p, --protocol <proto>", "Protocol (shamir/beaver/gmw)", "shamir")
|
|
208
209
|
.option("-i, --participants <ids>", "Comma-separated participant IDs")
|
|
209
|
-
.option("-t, --threshold <n>", "Shares required",
|
|
210
|
+
.option("-t, --threshold <n>", "Shares required", intArg("--threshold"))
|
|
210
211
|
.option("--json", "JSON output")
|
|
211
212
|
.action((type, opts) => {
|
|
212
213
|
const db = _dbFromCtx(pc);
|
|
@@ -258,7 +259,7 @@ export function registerPrivacyCommand(program) {
|
|
|
258
259
|
.description("List MPC computations")
|
|
259
260
|
.option("-p, --protocol <proto>", "Filter by protocol")
|
|
260
261
|
.option("-s, --status <status>", "Filter by status")
|
|
261
|
-
.option("--limit <n>", "Max results",
|
|
262
|
+
.option("--limit <n>", "Max results", intArg("--limit"))
|
|
262
263
|
.option("--json", "JSON output")
|
|
263
264
|
.action((opts) => {
|
|
264
265
|
const db = _dbFromCtx(pc);
|
|
@@ -281,13 +282,13 @@ export function registerPrivacyCommand(program) {
|
|
|
281
282
|
pc.command("dp-publish")
|
|
282
283
|
.description("Publish data with differential privacy noise")
|
|
283
284
|
.option("-d, --data <json>", "Data (number or JSON array)")
|
|
284
|
-
.option("-e, --epsilon <n>", "Privacy parameter epsilon",
|
|
285
|
-
.option("--delta <n>", "Privacy parameter delta",
|
|
285
|
+
.option("-e, --epsilon <n>", "Privacy parameter epsilon", floatArg("--epsilon"))
|
|
286
|
+
.option("--delta <n>", "Privacy parameter delta", floatArg("--delta"))
|
|
286
287
|
.option(
|
|
287
288
|
"-m, --mechanism <type>",
|
|
288
289
|
"Noise mechanism (laplace/gaussian/exponential)",
|
|
289
290
|
)
|
|
290
|
-
.option("-s, --sensitivity <n>", "Sensitivity",
|
|
291
|
+
.option("-s, --sensitivity <n>", "Sensitivity", floatArg("--sensitivity"))
|
|
291
292
|
.option("--json", "JSON output")
|
|
292
293
|
.action((opts) => {
|
|
293
294
|
const db = _dbFromCtx(pc);
|
|
@@ -598,10 +599,10 @@ export function registerPrivacyCommand(program) {
|
|
|
598
599
|
pc.command("dp-publish-v2")
|
|
599
600
|
.description("V2 DP publish (throws on invalid input / exceeded budget)")
|
|
600
601
|
.requiredOption("-d, --data <n>", "Data value", Number)
|
|
601
|
-
.option("-e, --epsilon <n>", "Epsilon",
|
|
602
|
-
.option("--delta <n>", "Delta",
|
|
602
|
+
.option("-e, --epsilon <n>", "Epsilon", floatArg("--epsilon"))
|
|
603
|
+
.option("--delta <n>", "Delta", floatArg("--delta"))
|
|
603
604
|
.option("-m, --mechanism <mech>", "Mechanism")
|
|
604
|
-
.option("-s, --sensitivity <n>", "Sensitivity",
|
|
605
|
+
.option("-s, --sensitivity <n>", "Sensitivity", floatArg("--sensitivity"))
|
|
605
606
|
.option("--json", "JSON output")
|
|
606
607
|
.action((opts) => {
|
|
607
608
|
const db = _dbFromCtx(pc);
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
import { Command } from "commander";
|
|
6
|
+
import { intArg, floatArg } from "../lib/cli-arg.js";
|
|
6
7
|
|
|
7
8
|
import {
|
|
8
9
|
JOB_STATUS,
|
|
@@ -190,7 +191,7 @@ export function registerQuantizationCommand(program) {
|
|
|
190
191
|
.command("complete <id>")
|
|
191
192
|
.description("Mark a running job as completed")
|
|
192
193
|
.option("-o, --output <path>", "Output file path")
|
|
193
|
-
.option("-s, --size <bytes>", "Output file size in bytes",
|
|
194
|
+
.option("-s, --size <bytes>", "Output file size in bytes", intArg("--size"))
|
|
194
195
|
.option("--json", "JSON output")
|
|
195
196
|
.action((id, opts) => {
|
|
196
197
|
const db = _dbFromCtx(quant);
|
|
@@ -271,7 +272,7 @@ export function registerQuantizationCommand(program) {
|
|
|
271
272
|
.description("List quantization jobs")
|
|
272
273
|
.option("-s, --status <status>", "Filter by status")
|
|
273
274
|
.option("-t, --type <type>", "Filter by quant type (gguf/gptq)")
|
|
274
|
-
.option("--limit <n>", "Max results",
|
|
275
|
+
.option("--limit <n>", "Max results", intArg("--limit"))
|
|
275
276
|
.option("--json", "JSON output")
|
|
276
277
|
.action((opts) => {
|
|
277
278
|
const db = _dbFromCtx(quant);
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
import { Command } from "commander";
|
|
6
|
+
import { intArg, floatArg } from "../lib/cli-arg.js";
|
|
6
7
|
|
|
7
8
|
import {
|
|
8
9
|
CONTENT_TYPES,
|
|
@@ -154,7 +155,7 @@ export function registerRecommendCommand(program) {
|
|
|
154
155
|
.description("Update interest profile")
|
|
155
156
|
.option("-t, --topics <json>", "Topic weights JSON")
|
|
156
157
|
.option("-w, --weights <json>", "Interaction weights JSON")
|
|
157
|
-
.option("-d, --decay <factor>", "Decay factor",
|
|
158
|
+
.option("-d, --decay <factor>", "Decay factor", floatArg("--decay"))
|
|
158
159
|
.option("--json", "JSON output")
|
|
159
160
|
.action((userId, opts) => {
|
|
160
161
|
const db = _dbFromCtx(rec);
|
|
@@ -186,7 +187,7 @@ export function registerRecommendCommand(program) {
|
|
|
186
187
|
rec
|
|
187
188
|
.command("profiles")
|
|
188
189
|
.description("List all interest profiles")
|
|
189
|
-
.option("--limit <n>", "Max results",
|
|
190
|
+
.option("--limit <n>", "Max results", intArg("--limit"))
|
|
190
191
|
.option("--json", "JSON output")
|
|
191
192
|
.action((opts) => {
|
|
192
193
|
const db = _dbFromCtx(rec);
|
|
@@ -222,8 +223,8 @@ export function registerRecommendCommand(program) {
|
|
|
222
223
|
"Generate recommendations from content pool (JSON stdin or --pool)",
|
|
223
224
|
)
|
|
224
225
|
.option("-p, --pool <json>", "Content pool as JSON array")
|
|
225
|
-
.option("-l, --limit <n>", "Max recommendations",
|
|
226
|
-
.option("-m, --min-score <n>", "Minimum score",
|
|
226
|
+
.option("-l, --limit <n>", "Max recommendations", intArg("--limit"))
|
|
227
|
+
.option("-m, --min-score <n>", "Minimum score", floatArg("--min-score"))
|
|
227
228
|
.option("--json", "JSON output")
|
|
228
229
|
.action((userId, opts) => {
|
|
229
230
|
const db = _dbFromCtx(rec);
|
|
@@ -266,8 +267,8 @@ export function registerRecommendCommand(program) {
|
|
|
266
267
|
.description("List recommendations for a user")
|
|
267
268
|
.option("-s, --status <status>", "Filter by status")
|
|
268
269
|
.option("-t, --type <type>", "Filter by content type")
|
|
269
|
-
.option("-m, --min-score <n>", "Minimum score",
|
|
270
|
-
.option("--limit <n>", "Max results",
|
|
270
|
+
.option("-m, --min-score <n>", "Minimum score", floatArg("--min-score"))
|
|
271
|
+
.option("--limit <n>", "Max results", intArg("--limit"))
|
|
271
272
|
.option("--json", "JSON output")
|
|
272
273
|
.action((userId, opts) => {
|
|
273
274
|
const db = _dbFromCtx(rec);
|
|
@@ -347,7 +348,7 @@ export function registerRecommendCommand(program) {
|
|
|
347
348
|
rec
|
|
348
349
|
.command("top-interests <user-id>")
|
|
349
350
|
.description("Show top interests from profile")
|
|
350
|
-
.option("--limit <n>", "Max results",
|
|
351
|
+
.option("--limit <n>", "Max results", intArg("--limit"))
|
|
351
352
|
.option("--json", "JSON output")
|
|
352
353
|
.action((userId, opts) => {
|
|
353
354
|
const db = _dbFromCtx(rec);
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import chalk from "chalk";
|
|
7
|
+
import { intArg, floatArg } from "../lib/cli-arg.js";
|
|
7
8
|
import { logger } from "../lib/logger.js";
|
|
8
9
|
import { bootstrap, shutdown } from "../runtime/bootstrap.js";
|
|
9
10
|
import {
|
|
@@ -95,8 +96,8 @@ export function registerReputationCommand(program) {
|
|
|
95
96
|
"Decay model (none|exponential|linear|step)",
|
|
96
97
|
"none",
|
|
97
98
|
)
|
|
98
|
-
.option("--lambda <n>", "Exponential decay lambda",
|
|
99
|
-
.option("--alpha <n>", "Linear decay alpha",
|
|
99
|
+
.option("--lambda <n>", "Exponential decay lambda", floatArg("--lambda"))
|
|
100
|
+
.option("--alpha <n>", "Linear decay alpha", floatArg("--alpha"))
|
|
100
101
|
.option("--json", "Output as JSON")
|
|
101
102
|
.action(async (did, options) => {
|
|
102
103
|
try {
|
|
@@ -164,7 +165,7 @@ export function registerReputationCommand(program) {
|
|
|
164
165
|
"Detection method (z_score|iqr)",
|
|
165
166
|
"z_score",
|
|
166
167
|
)
|
|
167
|
-
.option("-t, --threshold <n>", "Detection threshold",
|
|
168
|
+
.option("-t, --threshold <n>", "Detection threshold", floatArg("--threshold"))
|
|
168
169
|
.option(
|
|
169
170
|
"-d, --decay <model>",
|
|
170
171
|
"Decay model applied before detection",
|
package/src/commands/runtime.js
CHANGED
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
import { Command } from "commander";
|
|
9
|
+
import { intArg, floatArg } from "../lib/cli-arg.js";
|
|
9
10
|
|
|
10
11
|
import {
|
|
11
12
|
PLUGIN_STATUS,
|
|
@@ -222,7 +223,7 @@ export function registerRuntimeCommand(program) {
|
|
|
222
223
|
.command("plugins")
|
|
223
224
|
.description("List plugins")
|
|
224
225
|
.option("-s, --status <status>", "Filter by status")
|
|
225
|
-
.option("--limit <n>", "Max results",
|
|
226
|
+
.option("--limit <n>", "Max results", intArg("--limit"))
|
|
226
227
|
.option("--json", "JSON output")
|
|
227
228
|
.action((opts) => {
|
|
228
229
|
const db = _dbFromCtx(runtime);
|
|
@@ -282,7 +283,7 @@ export function registerRuntimeCommand(program) {
|
|
|
282
283
|
.command("updates")
|
|
283
284
|
.description("List updates")
|
|
284
285
|
.option("-p, --plugin <id>", "Filter by plugin id")
|
|
285
|
-
.option("--limit <n>", "Max results",
|
|
286
|
+
.option("--limit <n>", "Max results", intArg("--limit"))
|
|
286
287
|
.option("--json", "JSON output")
|
|
287
288
|
.action((opts) => {
|
|
288
289
|
const db = _dbFromCtx(runtime);
|
|
@@ -305,7 +306,7 @@ export function registerRuntimeCommand(program) {
|
|
|
305
306
|
.command("profile")
|
|
306
307
|
.description("Take a runtime profile sample")
|
|
307
308
|
.option("-t, --type <type>", "Profile type (cpu/memory/flamegraph)", "cpu")
|
|
308
|
-
.option("-d, --duration <ms>", "Duration in ms",
|
|
309
|
+
.option("-d, --duration <ms>", "Duration in ms", intArg("--duration"))
|
|
309
310
|
.option("--json", "JSON output")
|
|
310
311
|
.action((opts) => {
|
|
311
312
|
const db = _dbFromCtx(runtime);
|
|
@@ -344,7 +345,7 @@ export function registerRuntimeCommand(program) {
|
|
|
344
345
|
.command("profiles")
|
|
345
346
|
.description("List profiles")
|
|
346
347
|
.option("-t, --type <type>", "Filter by profile type")
|
|
347
|
-
.option("--limit <n>", "Max results",
|
|
348
|
+
.option("--limit <n>", "Max results", intArg("--limit"))
|
|
348
349
|
.option("--json", "JSON output")
|
|
349
350
|
.action((opts) => {
|
|
350
351
|
const db = _dbFromCtx(runtime);
|
|
@@ -391,7 +392,7 @@ export function registerRuntimeCommand(program) {
|
|
|
391
392
|
runtime
|
|
392
393
|
.command("state-list")
|
|
393
394
|
.description("List synced state keys")
|
|
394
|
-
.option("--limit <n>", "Max results",
|
|
395
|
+
.option("--limit <n>", "Max results", intArg("--limit"))
|
|
395
396
|
.option("--json", "JSON output")
|
|
396
397
|
.action((opts) => {
|
|
397
398
|
const db = _dbFromCtx(runtime);
|
package/src/commands/sandbox.js
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import chalk from "chalk";
|
|
7
|
+
import { intArg, floatArg } from "../lib/cli-arg.js";
|
|
7
8
|
import ora from "ora";
|
|
8
9
|
import { logger } from "../lib/logger.js";
|
|
9
10
|
import { bootstrap, shutdown } from "../runtime/bootstrap.js";
|
|
@@ -252,7 +253,7 @@ export function registerSandboxCommand(program) {
|
|
|
252
253
|
.description("Show audit log for sandboxes")
|
|
253
254
|
.argument("[sandbox-id]", "Optional sandbox ID to filter")
|
|
254
255
|
.option("--action <name>", "Filter by action type")
|
|
255
|
-
.option("--limit <n>", "Limit entries",
|
|
256
|
+
.option("--limit <n>", "Limit entries", intArg("--limit"))
|
|
256
257
|
.option("--json", "Output as JSON")
|
|
257
258
|
.action(async (sandboxId, options) => {
|
|
258
259
|
try {
|
|
@@ -293,8 +294,8 @@ export function registerSandboxCommand(program) {
|
|
|
293
294
|
.command("quota")
|
|
294
295
|
.description("Show or set sandbox quota")
|
|
295
296
|
.argument("<sandbox-id>", "Sandbox ID")
|
|
296
|
-
.option("--cpu <n>", "Set CPU quota",
|
|
297
|
-
.option("--memory <n>", "Set memory quota in MB",
|
|
297
|
+
.option("--cpu <n>", "Set CPU quota", intArg("--cpu"))
|
|
298
|
+
.option("--memory <n>", "Set memory quota in MB", intArg("--memory"))
|
|
298
299
|
.option("--json", "Output as JSON")
|
|
299
300
|
.action(async (sandboxId, options) => {
|
|
300
301
|
try {
|
|
@@ -780,7 +781,7 @@ export function registerSandboxCommand(program) {
|
|
|
780
781
|
.option("-e, --events <types>", "Comma-separated event types")
|
|
781
782
|
.option("--from <iso>", "ISO timestamp lower bound")
|
|
782
783
|
.option("--to <iso>", "ISO timestamp upper bound")
|
|
783
|
-
.option("-l, --limit <n>", "Max entries to return",
|
|
784
|
+
.option("-l, --limit <n>", "Max entries to return", intArg("--limit"))
|
|
784
785
|
.option("--json", "Output as JSON")
|
|
785
786
|
.action(async (id, options) => {
|
|
786
787
|
try {
|