chainlesschain 0.162.49 → 0.162.61
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/bin/chainlesschain.js +1 -1
- package/package.json +2 -2
- package/src/assets/web-panel/assets/{AIOps-DmdtNmWd.js → AIOps-BiB8WfIz.js} +1 -1
- package/src/assets/web-panel/assets/{ActionButton-DkuYVafg.js → ActionButton-NLBhC6jG.js} +1 -1
- package/src/assets/web-panel/assets/{Analytics-Ba_h8Tub.js → Analytics-k62j-xiL.js} +3 -3
- package/src/assets/web-panel/assets/{AppLayout-yb8Zm9MX.js → AppLayout-spr0Sm6J.js} +3 -3
- package/src/assets/web-panel/assets/{Audit-BGjex2fm.js → Audit-C3NHJos3.js} +1 -1
- package/src/assets/web-panel/assets/{Backup-IFQ2hOF2.js → Backup-C2V9tGqF.js} +1 -1
- package/src/assets/web-panel/assets/{BaseInput-W8AkPkrV.js → BaseInput-DeKm11mH.js} +1 -1
- package/src/assets/web-panel/assets/{Chat-BgI7t-iW.js → Chat-CHZ2CU7x.js} +6 -6
- package/src/assets/web-panel/assets/ChatBubbleRenderer-DEXSa7tC.js +1 -0
- package/src/assets/web-panel/assets/{Checkbox-DuWsZP4g.js → Checkbox-q6E9VeLr.js} +1 -1
- package/src/assets/web-panel/assets/{Codegen-DyoTNmYg.js → Codegen--4w4QpUI.js} +1 -1
- package/src/assets/web-panel/assets/{Col-DttmlDRk.js → Col-DLOkwTsj.js} +1 -1
- package/src/assets/web-panel/assets/{Community-D9nnIdKn.js → Community-B1LxJGfE.js} +1 -1
- package/src/assets/web-panel/assets/{Compact-C8KVQaHb.js → Compact-C_769oQZ.js} +1 -1
- package/src/assets/web-panel/assets/{Compliance-R2owqgjj.js → Compliance-zsI0s7vB.js} +1 -1
- package/src/assets/web-panel/assets/{Cowork-DwGMMjRn.js → Cowork-A1WA6whF.js} +2 -2
- package/src/assets/web-panel/assets/{Cron-BSTcN_lK.js → Cron-C3JDTyyd.js} +2 -2
- package/src/assets/web-panel/assets/{Crosschain-CTNuIbFD.js → Crosschain-D8O6uB86.js} +1 -1
- package/src/assets/web-panel/assets/{DID-CgApGsFP.js → DID-BpOebm5d.js} +2 -2
- package/src/assets/web-panel/assets/{Dashboard-D_OJ3UN5.js → Dashboard-Defso6kA.js} +2 -2
- package/src/assets/web-panel/assets/{Dropdown-B84Jwra_.js → Dropdown-Cv9BrwT_.js} +1 -1
- package/src/assets/web-panel/assets/{EmailListRenderer-Bv-YO-6y.js → EmailListRenderer-BWKHbh4C.js} +1 -1
- package/src/assets/web-panel/assets/{FamilyGuardDashboard-drgZ408Y.js → FamilyGuardDashboard--m_Ru7Ci.js} +1 -1
- package/src/assets/web-panel/assets/{Federation-CtzFkdW2.js → Federation-Bs6ZcAP0.js} +1 -1
- package/src/assets/web-panel/assets/{FormItemContext-BFAvNhl9.js → FormItemContext-CcAs3Acx.js} +1 -1
- package/src/assets/web-panel/assets/{GenericCardRenderer-DnuEyz_l.js → GenericCardRenderer-DI1oL4pK.js} +1 -1
- package/src/assets/web-panel/assets/{Git-jlHajmRJ.js → Git-C27t3-fW.js} +2 -2
- package/src/assets/web-panel/assets/{Governance-DmJC7PGL.js → Governance-Dr_syXc_.js} +1 -1
- package/src/assets/web-panel/assets/{Inference-B-u7xD2n.js → Inference-CWM8dIbA.js} +1 -1
- package/src/assets/web-panel/assets/{KnowledgeGraph-BaYCA2Cd.js → KnowledgeGraph--cFDUZv3.js} +1 -1
- package/src/assets/web-panel/assets/{Logs-DTNYQWfp.js → Logs-Cnn2_Onf.js} +2 -2
- package/src/assets/web-panel/assets/{Marketplace-CUu1xYvo.js → Marketplace-4T9ok3Gz.js} +1 -1
- package/src/assets/web-panel/assets/{McpTools-BmoeTyrC.js → McpTools-BQvZwqcN.js} +5 -5
- package/src/assets/web-panel/assets/{Memory-DxTU3QU7.js → Memory-BE9rPkM_.js} +2 -2
- package/src/assets/web-panel/assets/{MobileBridge-CpcOlKAD.js → MobileBridge-DJ3j5lXC.js} +2 -2
- package/src/assets/web-panel/assets/{MobileProjects-Bjh_z16l.js → MobileProjects-qasLvYdb.js} +1 -1
- package/src/assets/web-panel/assets/{Mtc-LfxwOm0x.js → Mtc-D3CSPTD9.js} +2 -2
- package/src/assets/web-panel/assets/{MtcAudit-D6A9Gjkh.js → MtcAudit-DaYVGCN5.js} +2 -2
- package/src/assets/web-panel/assets/{Multisig-Ch_jofPV.js → Multisig-Dz1c5r5w.js} +3 -3
- package/src/assets/web-panel/assets/{NLProgramming-Bkvogg0I.js → NLProgramming-BIKV_K-a.js} +1 -1
- package/src/assets/web-panel/assets/{Notes-C5t5Xihm.js → Notes-f6t-rmOa.js} +3 -3
- package/src/assets/web-panel/assets/{NotificationSettings-CTpDUNCb.js → NotificationSettings-DHLQh8Fy.js} +1 -1
- package/src/assets/web-panel/assets/OrderTableRenderer-CDMZ3o6i.js +1 -0
- package/src/assets/web-panel/assets/{Organization-Dr37BaXa.js → Organization-DIsL758p.js} +4 -4
- package/src/assets/web-panel/assets/{Overflow-ZGjsdP7N.js → Overflow-BMM7apnZ.js} +1 -1
- package/src/assets/web-panel/assets/{P2P-bWJU5Vxd.js → P2P-CTGMmTvi.js} +2 -2
- package/src/assets/web-panel/assets/{PdhVaultBrowser-BRVoW-ye.js → PdhVaultBrowser-DWwmm0k1.js} +3 -3
- package/src/assets/web-panel/assets/{Permissions-BOSnFZaC.js → Permissions-Bed5JxMx.js} +4 -4
- package/src/assets/web-panel/assets/{PersonalDataHub-X4SgjP6P.js → PersonalDataHub-CIiZhSM5.js} +4 -4
- package/src/assets/web-panel/assets/{Pipeline-DoJhB9bj.js → Pipeline-CtirPodz.js} +1 -1
- package/src/assets/web-panel/assets/{Privacy-OM9lDj-R.js → Privacy-DuXhXhE7.js} +1 -1
- package/src/assets/web-panel/assets/{ProjectInit-BXQEOmLn.js → ProjectInit-DZrnguBl.js} +2 -2
- package/src/assets/web-panel/assets/{ProjectSettings-DBXo3K5u.js → ProjectSettings-HIltqsJ1.js} +2 -2
- package/src/assets/web-panel/assets/{Projects-CJ4DBJlS.js → Projects-BWFkePg4.js} +1 -1
- package/src/assets/web-panel/assets/{Providers-Tk9SawmO.js → Providers-DEP0Jdvl.js} +1 -1
- package/src/assets/web-panel/assets/{QuickAsk-DRI1-nTC.js → QuickAsk-T2THoHNx.js} +1 -1
- package/src/assets/web-panel/assets/{Recommend-DtrIVTu9.js → Recommend-CvbxaSwm.js} +1 -1
- package/src/assets/web-panel/assets/{Reputation-DkH8ImwZ.js → Reputation-6Afy6tfp.js} +1 -1
- package/src/assets/web-panel/assets/{Row-DpA9dlvi.js → Row-DY8OPWaO.js} +1 -1
- package/src/assets/web-panel/assets/{RssFeed-DV3OhxWd.js → RssFeed-wDGWb9pZ.js} +3 -3
- package/src/assets/web-panel/assets/{Search-QxdntiQx.js → Search-D_zHAwZY.js} +1 -1
- package/src/assets/web-panel/assets/{Security-CGuEnrD2.js → Security-Czq7AlGG.js} +4 -4
- package/src/assets/web-panel/assets/{Services-BvwSSD8b.js → Services-Ac1g0ZcG.js} +2 -2
- package/src/assets/web-panel/assets/{Skeleton-sx_8L3-5.js → Skeleton-DXQ3eeSW.js} +1 -1
- package/src/assets/web-panel/assets/{Skills-dWOwxRsu.js → Skills-CWRioX4u.js} +1 -1
- package/src/assets/web-panel/assets/{Sla-zxXnfKrT.js → Sla-BlHthzfs.js} +1 -1
- package/src/assets/web-panel/assets/{SpeechSettings-CmFlcNjr.js → SpeechSettings-Ct240JmL.js} +1 -1
- package/src/assets/web-panel/assets/{SyncSettings-BeXeqURL.js → SyncSettings-BgDIt8Q-.js} +2 -2
- package/src/assets/web-panel/assets/Tasks-3PTmatJP.js +1 -0
- package/src/assets/web-panel/assets/{Templates-DlgR3XFH.js → Templates-Dp9QhyIw.js} +1 -1
- package/src/assets/web-panel/assets/{Tenant-0P8HgQaM.js → Tenant-CHTYMxzY.js} +1 -1
- package/src/assets/web-panel/assets/Terminal-X-NGwLpv.js +3 -0
- package/src/assets/web-panel/assets/{TimelineRenderer-hbO7agZs.js → TimelineRenderer-Bh8jA18j.js} +1 -1
- package/src/assets/web-panel/assets/{Tokens-CsmhgTBO.js → Tokens-DWkTd5dv.js} +1 -1
- package/src/assets/web-panel/assets/{Trigger-DnaF_2PP.js → Trigger-CRgVg6sd.js} +1 -1
- package/src/assets/web-panel/assets/{Trust-C1oafGj1.js → Trust-BgWOXd0W.js} +1 -1
- package/src/assets/web-panel/assets/{UkeySign-eLL4DOmC.js → UkeySign-BlTUB9Y-.js} +1 -1
- package/src/assets/web-panel/assets/{VideoEditing-CX45sVq7.js → VideoEditing-DI64XgNb.js} +1 -1
- package/src/assets/web-panel/assets/{Wallet-aWPqpHdQ.js → Wallet-CJ3TNGiG.js} +4 -4
- package/src/assets/web-panel/assets/{WebAuthn-DMYV1MAo.js → WebAuthn-B2-rWWoV.js} +4 -4
- package/src/assets/web-panel/assets/{WorkflowEditor-D9uRIJvH.js → WorkflowEditor-VI9otbaH.js} +1 -1
- package/src/assets/web-panel/assets/{chat-BmWYfCxG.js → chat-CgYfiaVh.js} +1 -1
- package/src/assets/web-panel/assets/{colors-DqvTCkBe.js → colors-B9EhRTky.js} +1 -1
- package/src/assets/web-panel/assets/{compact-item-Bh0L0ejI.js → compact-item-Cb7bjraa.js} +1 -1
- package/src/assets/web-panel/assets/{createContext-r2qgp1mn.js → createContext-DlXPeXuj.js} +1 -1
- package/src/assets/web-panel/assets/devWarning-D-Hp8s_8.js +1 -0
- package/src/assets/web-panel/assets/{hasIn-BcffXa-S.js → hasIn-BbgRfrdf.js} +1 -1
- package/src/assets/web-panel/assets/{index-DxajFkK2.js → index-1iUK_kAw.js} +1 -1
- package/src/assets/web-panel/assets/{index-BCBqTRWH.js → index-2ts5iOIB.js} +1 -1
- package/src/assets/web-panel/assets/{index-CDR3GmaO.js → index-5CrFMQjt.js} +1 -1
- package/src/assets/web-panel/assets/{index-B7z0qK1W.js → index-AR-QpAkP.js} +1 -1
- package/src/assets/web-panel/assets/{index-BLN-neIf.js → index-BD2W-qsS.js} +1 -1
- package/src/assets/web-panel/assets/{index-De36_UgR.js → index-BU8hEUyq.js} +1 -1
- package/src/assets/web-panel/assets/{index-Bma_yHcC.js → index-BfSS-U5o.js} +1 -1
- package/src/assets/web-panel/assets/{index-Dcjol7ot.js → index-Bk7r1a9x.js} +1 -1
- package/src/assets/web-panel/assets/{index-BbMox24t.js → index-BoEFFKn3.js} +1 -1
- package/src/assets/web-panel/assets/{index-C2-02rrp.js → index-Bt-lPYpq.js} +1 -1
- package/src/assets/web-panel/assets/index-BvnHuxVM.js +1 -0
- package/src/assets/web-panel/assets/{index-DPFT7J7I.js → index-C73WgOc2.js} +1 -1
- package/src/assets/web-panel/assets/{index-BXXxkeij.js → index-C8DB27uJ.js} +1 -1
- package/src/assets/web-panel/assets/{index-XwbSqOB2.js → index-C95qWAh4.js} +1 -1
- package/src/assets/web-panel/assets/{index-CAlxkpnv.js → index-CGx8aO_Y.js} +1 -1
- package/src/assets/web-panel/assets/{index-B3mmDuOv.js → index-CHR47Q5B.js} +1 -1
- package/src/assets/web-panel/assets/{index-CJt0iuep.js → index-CMyzmvtJ.js} +1 -1
- package/src/assets/web-panel/assets/{index-S4E77Aer.js → index-Caiu2avX.js} +1 -1
- package/src/assets/web-panel/assets/{index-BtyXyl3t.js → index-Cf9zwbk-.js} +1 -1
- package/src/assets/web-panel/assets/{index-CCyB-RK5.js → index-Cmr31VCO.js} +3 -3
- package/src/assets/web-panel/assets/{index-CKnEtlZD.js → index-D-Zz9PvD.js} +1 -1
- package/src/assets/web-panel/assets/{index-DWlDSE0F.js → index-D6t-Shqr.js} +1 -1
- package/src/assets/web-panel/assets/{index-h4O0AcBt.js → index-D8kB0k3E.js} +1 -1
- package/src/assets/web-panel/assets/{index-Cbj6C3pA.js → index-DDzNdZcX.js} +1 -1
- package/src/assets/web-panel/assets/{index-DutDlDUF.js → index-DPaffcT8.js} +1 -1
- package/src/assets/web-panel/assets/{index-BXae4ZyX.js → index-DUU9DY4J.js} +1 -1
- package/src/assets/web-panel/assets/{index-U86pxDyR.js → index-DXxa7PR8.js} +1 -1
- package/src/assets/web-panel/assets/{index-DRXcGa5y.js → index-DbLJShJB.js} +1 -1
- package/src/assets/web-panel/assets/{index-BMn_luHQ.js → index-De59Xat-.js} +1 -1
- package/src/assets/web-panel/assets/{index-Ct8qhPZe.js → index-Dh6qWb1v.js} +1 -1
- package/src/assets/web-panel/assets/{index-CY8RXaZR.js → index-DkQIyK-V.js} +1 -1
- package/src/assets/web-panel/assets/index-Dkm5IGwX.js +1 -0
- package/src/assets/web-panel/assets/{index-585fuGAN.js → index-Dx4sm6dm.js} +1 -1
- package/src/assets/web-panel/assets/{index-COrfHebA.js → index-Ira0HLPr.js} +1 -1
- package/src/assets/web-panel/assets/{index-BeV-KoQl.js → index-OVrh8wTN.js} +1 -1
- package/src/assets/web-panel/assets/{index-DW1y18GR.js → index-c7-Jd6WB.js} +1 -1
- package/src/assets/web-panel/assets/{index-C9nh3ANl.js → index-fG-1gXy0.js} +1 -1
- package/src/assets/web-panel/assets/{index-BQlAPNSU.js → index-ojRAd7Nq.js} +1 -1
- package/src/assets/web-panel/assets/{index-B6pAm1iJ.js → index-p03wNqiP.js} +1 -1
- package/src/assets/web-panel/assets/{initDefaultProps-C1d8I-BX.js → initDefaultProps-JT674ACa.js} +1 -1
- package/src/assets/web-panel/assets/{motion-Dq7fiy4Y.js → motion-CokflrA9.js} +1 -1
- package/src/assets/web-panel/assets/{move-Bqb2dySM.js → move-CfMhRpyC.js} +1 -1
- package/src/assets/web-panel/assets/{omit-BUYqb4My.js → omit-ClYc5II5.js} +1 -1
- package/src/assets/web-panel/assets/{pickAttrs-DeytiKlZ.js → pickAttrs-CTwEb_8h.js} +1 -1
- package/src/assets/web-panel/assets/{placementArrow-xrXZWCqG.js → placementArrow-Cb3StU_t.js} +1 -1
- package/src/assets/web-panel/assets/{responsiveObserve-CcL2K-YY.js → responsiveObserve-uIxkx5M1.js} +1 -1
- package/src/assets/web-panel/assets/{slide-DmCWaic7.js → slide-B9HZBQ7i.js} +1 -1
- package/src/assets/web-panel/assets/{statusUtils-CqNrFif7.js → statusUtils-C72bwYl0.js} +1 -1
- package/src/assets/web-panel/assets/{styleChecker-C436m5Xy.js → styleChecker-BFTtaQb8.js} +1 -1
- package/src/assets/web-panel/assets/{useFlexGapSupport-CVhutCN8.js → useFlexGapSupport-DKl5j41_.js} +1 -1
- package/src/assets/web-panel/assets/{useFs-DUd49Bui.js → useFs-BUHS6bo3.js} +1 -1
- package/src/assets/web-panel/assets/{usePersonalDataHub-fuS9raic.js → usePersonalDataHub-D8KrYSq4.js} +1 -1
- package/src/assets/web-panel/assets/{vnode-C3kmDmk-.js → vnode-JYP-aZDj.js} +1 -1
- package/src/assets/web-panel/assets/{zoom-hX-F1dT-.js → zoom-BFusdxdH.js} +1 -1
- package/src/assets/web-panel/index.html +1 -1
- package/src/commands/agent.js +67 -29
- package/src/commands/terminal-setup.js +127 -0
- package/src/harness/mcp-client.js +48 -2
- package/src/index.js +2 -0
- package/src/lib/image-input.js +8 -2
- package/src/lib/llm-pricing.js +15 -0
- package/src/lib/permission-rules.cjs +11 -1
- package/src/lib/personal-data-hub-wiring.js +24 -0
- package/src/lib/repl-multiline.js +64 -0
- package/src/lib/repl-rewind.js +65 -2
- package/src/lib/repl-vim.js +445 -0
- package/src/lib/safe-mode.js +17 -3
- package/src/lib/skill-loader.js +45 -1
- package/src/lib/slash-commands.js +13 -3
- package/src/lib/status-line.cjs +33 -3
- package/src/lib/terminal-setup.js +209 -0
- package/src/repl/agent-repl.js +274 -27
- package/src/repl/session-cost.js +98 -1
- package/src/runtime/agent-core.js +23 -8
- package/src/runtime/fallback-model.js +125 -30
- package/src/runtime/headless-runner.js +2 -0
- package/src/runtime/headless-stream.js +2 -0
- package/src/runtime/mcp-config.js +14 -3
- package/src/assets/web-panel/assets/ChatBubbleRenderer-CfpKEQUF.js +0 -1
- package/src/assets/web-panel/assets/OrderTableRenderer-ST2lr-Bi.js +0 -1
- package/src/assets/web-panel/assets/Tasks-iImd8xSO.js +0 -1
- package/src/assets/web-panel/assets/Terminal-B5VDEEHD.js +0 -3
- package/src/assets/web-panel/assets/devWarning-CusWDjWW.js +0 -1
- package/src/assets/web-panel/assets/index-BhYltBvN.js +0 -1
- package/src/assets/web-panel/assets/index-CZiIHw4e.js +0 -1
package/src/index.js
CHANGED
|
@@ -67,6 +67,7 @@ import { registerLoopCommand } from "./commands/loop.js";
|
|
|
67
67
|
import { registerPermissionsCommand } from "./commands/permissions.js";
|
|
68
68
|
import { registerOutputStyleCommand } from "./commands/output-style.js";
|
|
69
69
|
import { registerStatuslineCommand } from "./commands/statusline.js";
|
|
70
|
+
import { registerTerminalSetupCommand } from "./commands/terminal-setup.js";
|
|
70
71
|
import { registerIdeCommand } from "./commands/ide.js";
|
|
71
72
|
import { registerConsolCommand } from "./commands/consol.js";
|
|
72
73
|
import { registerImportCommand } from "./commands/import.js";
|
|
@@ -479,6 +480,7 @@ export function createProgram(opts = {}) {
|
|
|
479
480
|
registerPermissionsCommand(program);
|
|
480
481
|
registerOutputStyleCommand(program);
|
|
481
482
|
registerStatuslineCommand(program);
|
|
483
|
+
registerTerminalSetupCommand(program);
|
|
482
484
|
registerIdeCommand(program);
|
|
483
485
|
registerConsolCommand(program);
|
|
484
486
|
|
package/src/lib/image-input.js
CHANGED
|
@@ -115,8 +115,14 @@ export function imageUrlBlockToAnthropic(block) {
|
|
|
115
115
|
};
|
|
116
116
|
}
|
|
117
117
|
|
|
118
|
-
/**
|
|
119
|
-
|
|
118
|
+
/**
|
|
119
|
+
* Default vision model when none is configured — Volcengine Ark
|
|
120
|
+
* Doubao-Seed-2.0-lite (id `doubao-seed-2-0-lite-260215`, dated YYMMDD =
|
|
121
|
+
* 2026-02-15), a natively multimodal model (text/image/video; 2.0 has no
|
|
122
|
+
* separate "-vision-" SKU). Override via --vision-model or config.llm.visionModel
|
|
123
|
+
* to pin a different snapshot.
|
|
124
|
+
*/
|
|
125
|
+
export const DEFAULT_VISION_MODEL = "doubao-seed-2-0-lite-260215";
|
|
120
126
|
|
|
121
127
|
/**
|
|
122
128
|
* Resolve the effective LLM config for a run. When an image is attached, default
|
package/src/lib/llm-pricing.js
CHANGED
|
@@ -35,6 +35,15 @@ export const PRICE_TABLE = Object.freeze({
|
|
|
35
35
|
{ match: "haiku", in: 1, out: 5 },
|
|
36
36
|
],
|
|
37
37
|
openai: [
|
|
38
|
+
// GPT-5 family (2026). Matching is longest-pattern-first, so dated/variant
|
|
39
|
+
// ids (gpt-5.5, gpt-5.5-pro, gpt-5.5-instant, …) resolve to the most
|
|
40
|
+
// specific rate; bare "gpt-5" is the catch-all base rate.
|
|
41
|
+
{ match: "gpt-5.5-pro", in: 30, out: 180 },
|
|
42
|
+
{ match: "gpt-5.5", in: 5, out: 30 },
|
|
43
|
+
{ match: "gpt-5.4", in: 2.5, out: 15 },
|
|
44
|
+
{ match: "gpt-5-mini", in: 0.25, out: 2 },
|
|
45
|
+
{ match: "gpt-5-nano", in: 0.05, out: 0.4 },
|
|
46
|
+
{ match: "gpt-5", in: 1.25, out: 10 },
|
|
38
47
|
{ match: "gpt-4o-mini", in: 0.15, out: 0.6 },
|
|
39
48
|
{ match: "gpt-4o", in: 2.5, out: 10 },
|
|
40
49
|
{ match: "gpt-4-turbo", in: 10, out: 30 },
|
|
@@ -49,6 +58,12 @@ export const PRICE_TABLE = Object.freeze({
|
|
|
49
58
|
],
|
|
50
59
|
// Volcengine Doubao — rough USD conversion of public RMB list pricing.
|
|
51
60
|
volcengine: [
|
|
61
|
+
// Doubao Seed 2.0 family (2026, e.g. doubao-seed-2-0-lite-260215) is
|
|
62
|
+
// natively multimodal. Rates ≈ official CNY ÷ ~7.2 (lite ≤32k is 0.6/3.6
|
|
63
|
+
// CNY → $0.08/$0.50); the generic "seed" rate below underprices 2.0 output.
|
|
64
|
+
{ match: "seed-2-0-pro", in: 0.5, out: 2.5 },
|
|
65
|
+
{ match: "seed-2-0-lite", in: 0.08, out: 0.5 },
|
|
66
|
+
{ match: "seed-2-0-mini", in: 0.03, out: 0.3 },
|
|
52
67
|
{ match: "seed-1-6", in: 0.11, out: 0.28 },
|
|
53
68
|
{ match: "seed", in: 0.11, out: 0.28 },
|
|
54
69
|
{ match: "pro", in: 0.11, out: 0.28 },
|
|
@@ -14,6 +14,8 @@
|
|
|
14
14
|
* Edit(//etc/**) → edit_file on an absolute path under /etc
|
|
15
15
|
* WebFetch(domain:example.com) → web_fetch of https://example.com/…
|
|
16
16
|
* Bash → every run_shell call
|
|
17
|
+
* * → every tool call (Claude-Code deny-all idiom)
|
|
18
|
+
* Bash(*) → every run_shell call (lone-`*` pattern = match-all)
|
|
17
19
|
*
|
|
18
20
|
* Pure + self-contained (no glob dependency — `globToRegExp` is built in, the
|
|
19
21
|
* repo avoids pulling minimatch/picomatch). Decision precedence is
|
|
@@ -75,6 +77,8 @@ const URL_TOOLS = new Set(["web_fetch"]);
|
|
|
75
77
|
function toolMatches(ruleTool, actualTool) {
|
|
76
78
|
const r = String(ruleTool || "").toLowerCase();
|
|
77
79
|
const a = String(actualTool || "");
|
|
80
|
+
// Claude-Code `*` deny-all: a bare-`*` tool token matches every tool.
|
|
81
|
+
if (r === "*") return true;
|
|
78
82
|
if (Object.prototype.hasOwnProperty.call(TOOL_GROUPS, r)) {
|
|
79
83
|
return TOOL_GROUPS[r].includes(a);
|
|
80
84
|
}
|
|
@@ -88,7 +92,8 @@ function toolMatches(ruleTool, actualTool) {
|
|
|
88
92
|
function parseRule(rule) {
|
|
89
93
|
const raw = String(rule || "").trim();
|
|
90
94
|
if (!raw) return null;
|
|
91
|
-
|
|
95
|
+
// Tool token is an umbrella/CLI name OR a bare `*` (Claude-Code deny-all).
|
|
96
|
+
const m = raw.match(/^(\*|[A-Za-z_][\w-]*)\s*(?:\(([\s\S]*)\))?$/);
|
|
92
97
|
if (!m) return null;
|
|
93
98
|
const tool = m[1];
|
|
94
99
|
const pattern = m[2] === undefined ? null : m[2].trim();
|
|
@@ -198,6 +203,11 @@ function matchUrl(pattern, url) {
|
|
|
198
203
|
*/
|
|
199
204
|
function matchPattern(pattern, actualTool, args, cwd) {
|
|
200
205
|
if (pattern === null) return true;
|
|
206
|
+
// A lone `*` / `**` pattern matches any target regardless of slashes — covers
|
|
207
|
+
// `Bash(*)`, `Read(**)`, `WebFetch(*)`, etc. Done before the glob path so a
|
|
208
|
+
// command/url/path containing `/` can't slip past a deny-all (globToRegExp's
|
|
209
|
+
// `*` → `[^/]*` otherwise excludes slashes).
|
|
210
|
+
if (pattern === "*" || pattern === "**") return true;
|
|
201
211
|
const target = extractTarget(actualTool, args, cwd);
|
|
202
212
|
if (target.kind === "command") {
|
|
203
213
|
return target.value ? matchCommand(pattern, target.value) : false;
|
|
@@ -54,6 +54,9 @@ const {
|
|
|
54
54
|
LocalFilesAdapter,
|
|
55
55
|
BilibiliAdapter,
|
|
56
56
|
WeiboAdapter,
|
|
57
|
+
ZhihuAdapter,
|
|
58
|
+
BossZhipinAdapter,
|
|
59
|
+
CsdnAdapter,
|
|
57
60
|
DouyinAdapter,
|
|
58
61
|
XiaohongshuAdapter,
|
|
59
62
|
ToutiaoAdapter,
|
|
@@ -68,7 +71,13 @@ const {
|
|
|
68
71
|
QQPcAdapter,
|
|
69
72
|
AppleHealthAdapter,
|
|
70
73
|
NeteaseMusicAdapter,
|
|
74
|
+
KugouMusicAdapter,
|
|
75
|
+
IqiyiVideoAdapter,
|
|
76
|
+
TencentVideoAdapter,
|
|
71
77
|
WeReadAdapter,
|
|
78
|
+
WpsDocAdapter,
|
|
79
|
+
TencentDocsAdapter,
|
|
80
|
+
BaiduNetdiskAdapter,
|
|
72
81
|
DingTalkPcAdapter,
|
|
73
82
|
FeishuPcAdapter,
|
|
74
83
|
BaiduMapAdapter,
|
|
@@ -76,9 +85,12 @@ const {
|
|
|
76
85
|
JdAdapter,
|
|
77
86
|
MeituanAdapter,
|
|
78
87
|
PinduoduoAdapter,
|
|
88
|
+
DianpingAdapter,
|
|
79
89
|
Train12306Adapter,
|
|
80
90
|
TaobaoAdapter,
|
|
81
91
|
CtripAdapter,
|
|
92
|
+
TongchengAdapter,
|
|
93
|
+
DidiAdapter,
|
|
82
94
|
AmapAdapter,
|
|
83
95
|
TelegramAdapter,
|
|
84
96
|
WhatsAppAdapter,
|
|
@@ -514,6 +526,9 @@ async function initHub() {
|
|
|
514
526
|
// accurate.
|
|
515
527
|
for (const Cls of [
|
|
516
528
|
WeiboAdapter,
|
|
529
|
+
ZhihuAdapter,
|
|
530
|
+
BossZhipinAdapter,
|
|
531
|
+
CsdnAdapter,
|
|
517
532
|
DouyinAdapter,
|
|
518
533
|
XiaohongshuAdapter,
|
|
519
534
|
ToutiaoAdapter,
|
|
@@ -528,7 +543,13 @@ async function initHub() {
|
|
|
528
543
|
QQPcAdapter,
|
|
529
544
|
AppleHealthAdapter,
|
|
530
545
|
NeteaseMusicAdapter,
|
|
546
|
+
KugouMusicAdapter,
|
|
547
|
+
IqiyiVideoAdapter,
|
|
548
|
+
TencentVideoAdapter,
|
|
531
549
|
WeReadAdapter,
|
|
550
|
+
WpsDocAdapter,
|
|
551
|
+
TencentDocsAdapter,
|
|
552
|
+
BaiduNetdiskAdapter,
|
|
532
553
|
DingTalkPcAdapter,
|
|
533
554
|
FeishuPcAdapter,
|
|
534
555
|
BaiduMapAdapter,
|
|
@@ -536,9 +557,12 @@ async function initHub() {
|
|
|
536
557
|
JdAdapter,
|
|
537
558
|
MeituanAdapter,
|
|
538
559
|
PinduoduoAdapter,
|
|
560
|
+
DianpingAdapter,
|
|
539
561
|
Train12306Adapter,
|
|
540
562
|
TaobaoAdapter,
|
|
541
563
|
CtripAdapter,
|
|
564
|
+
TongchengAdapter,
|
|
565
|
+
DidiAdapter,
|
|
542
566
|
AmapAdapter,
|
|
543
567
|
TelegramAdapter,
|
|
544
568
|
WhatsAppAdapter,
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Multiline REPL input via backslash continuation (Claude-Code multiline parity).
|
|
3
|
+
*
|
|
4
|
+
* Node's readline submits on every Enter, so a single prompt is one line. This
|
|
5
|
+
* pure helper lets the REPL accumulate a multi-line prompt: a physical line that
|
|
6
|
+
* ends with a continuation backslash keeps the prompt open and the next line is
|
|
7
|
+
* appended (joined with "\n"), so code blocks / multi-paragraph prompts can be
|
|
8
|
+
* entered without a turn firing per line.
|
|
9
|
+
*
|
|
10
|
+
* The rule is shell-like but Windows-path-safe: a trailing backslash continues
|
|
11
|
+
* the line ONLY when it is a lone `\` or the backslash run is preceded by
|
|
12
|
+
* whitespace, and the run length is odd (so `\\` stays a literal backslash).
|
|
13
|
+
* That keeps a stray path like `dir C:\` from being swallowed as a continuation.
|
|
14
|
+
*
|
|
15
|
+
* analyzeContinuation("write a function \\") → { continued:true, text:"write a function" }
|
|
16
|
+
* analyzeContinuation("dir C:\\") → { continued:false, text:"dir C:\\" }
|
|
17
|
+
* analyzeContinuation("plain line") → { continued:false, text:"plain line" }
|
|
18
|
+
*
|
|
19
|
+
* The REPL keeps an array of `text` pieces and `joinContinuation()` stitches the
|
|
20
|
+
* final submission.
|
|
21
|
+
*/
|
|
22
|
+
|
|
23
|
+
/** Count the run of backslashes at the very end of a string. */
|
|
24
|
+
function trailingBackslashes(s) {
|
|
25
|
+
let n = 0;
|
|
26
|
+
for (let i = s.length - 1; i >= 0 && s[i] === "\\"; i--) n++;
|
|
27
|
+
return n;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Decide whether a physical input line continues onto the next one.
|
|
32
|
+
*
|
|
33
|
+
* @param {string} line the raw line as readline delivered it
|
|
34
|
+
* @returns {{ continued:boolean, text:string }}
|
|
35
|
+
* continued → drop the trailing backslash (+ the space before it) and wait for
|
|
36
|
+
* more; not continued → the line stands as typed (text === line).
|
|
37
|
+
*/
|
|
38
|
+
export function analyzeContinuation(line) {
|
|
39
|
+
const s = typeof line === "string" ? line : "";
|
|
40
|
+
const n = trailingBackslashes(s);
|
|
41
|
+
if (n === 0 || n % 2 === 0) return { continued: false, text: s };
|
|
42
|
+
// Odd trailing backslashes: gate on what precedes the run so Windows paths
|
|
43
|
+
// (no preceding whitespace) are not treated as continuations.
|
|
44
|
+
const before = s[s.length - n - 1]; // undefined when the run is the whole line
|
|
45
|
+
const gated = before === undefined || /\s/.test(before);
|
|
46
|
+
if (!gated) return { continued: false, text: s };
|
|
47
|
+
// Strip exactly one trailing backslash, then trim the now-trailing whitespace
|
|
48
|
+
// so the join reads cleanly.
|
|
49
|
+
const text = s.slice(0, s.length - 1).replace(/\s+$/, "");
|
|
50
|
+
return { continued: true, text };
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Stitch accumulated continuation pieces plus the final line into one prompt.
|
|
55
|
+
*
|
|
56
|
+
* @param {string[]} pieces prior `text` values from continued lines
|
|
57
|
+
* @param {string} finalLine the line that ended the continuation (raw)
|
|
58
|
+
* @returns {string}
|
|
59
|
+
*/
|
|
60
|
+
export function joinContinuation(pieces, finalLine) {
|
|
61
|
+
const parts = Array.isArray(pieces) ? pieces.slice() : [];
|
|
62
|
+
parts.push(typeof finalLine === "string" ? finalLine : "");
|
|
63
|
+
return parts.join("\n");
|
|
64
|
+
}
|
package/src/lib/repl-rewind.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* REPL conversation rewind — Claude-Code double-Esc parity
|
|
3
|
-
*
|
|
2
|
+
* REPL conversation rewind — Claude-Code double-Esc parity. Conversation state
|
|
3
|
+
* AND, when auto-checkpointing is on (git work tree), the file tree are rewound
|
|
4
|
+
* together — matching Claude Code's rewind, which restores code + conversation
|
|
5
|
+
* in one step instead of leaving files on a separate `cc checkpoint restore`.
|
|
4
6
|
*
|
|
5
7
|
* Pure helpers over the REPL's live `messages` array so the picker logic is
|
|
6
8
|
* unit-testable without readline:
|
|
@@ -8,9 +10,19 @@
|
|
|
8
10
|
* - rewindToTurn(): truncate the conversation BACK TO BEFORE turn #n and
|
|
9
11
|
* return the original text so the caller can prefill the input line
|
|
10
12
|
* (edit-and-resend, like Claude Code's rewind).
|
|
13
|
+
* - pickCheckpointForTurn(): map a rewound turn to the file checkpoint that
|
|
14
|
+
* captured the work tree just before that turn first mutated it.
|
|
15
|
+
* - pruneMarksAfter(): drop checkpoint marks for the turns that were dropped.
|
|
11
16
|
*
|
|
12
17
|
* Trigger surfaces (wired in agent-repl): `/rewind` lists, `/rewind <n>`
|
|
13
18
|
* rewinds, and a double-Esc while idle prints the same list as a shortcut.
|
|
19
|
+
*
|
|
20
|
+
* Checkpoint marks: the REPL records `{ atMessageCount, id, tool }` for every
|
|
21
|
+
* `checkpoint` event the agent loop emits — `atMessageCount` is `messages.length`
|
|
22
|
+
* at the instant the snapshot was taken (always just AFTER the turn's user
|
|
23
|
+
* message was appended, so it is strictly greater than that turn's message
|
|
24
|
+
* index, and not-greater than any later turn's). That ordering is what lets a
|
|
25
|
+
* turn be matched to its pre-mutation snapshot purely from the count.
|
|
14
26
|
*/
|
|
15
27
|
|
|
16
28
|
export const DEFAULT_LIST_LIMIT = 10;
|
|
@@ -64,10 +76,61 @@ export function rewindToTurn(messages, n) {
|
|
|
64
76
|
messages.splice(turn.index);
|
|
65
77
|
return {
|
|
66
78
|
removed,
|
|
79
|
+
index: turn.index,
|
|
67
80
|
text: typeof turn.content === "string" ? turn.content : null,
|
|
68
81
|
};
|
|
69
82
|
}
|
|
70
83
|
|
|
84
|
+
/**
|
|
85
|
+
* Map a rewound turn to the checkpoint that captured the work tree right BEFORE
|
|
86
|
+
* that turn first changed a file.
|
|
87
|
+
*
|
|
88
|
+
* A turn's auto-checkpoints are all taken with `atMessageCount` strictly greater
|
|
89
|
+
* than the turn's message index (the user message is appended first), while the
|
|
90
|
+
* previous turn's checkpoints have `atMessageCount <= turnIndex`. So the snapshot
|
|
91
|
+
* representing "state before turn N" is the one with the SMALLEST atMessageCount
|
|
92
|
+
* still greater than turnIndex.
|
|
93
|
+
*
|
|
94
|
+
* @param {Array<{atMessageCount:number,id:string,tool?:string}>} marks
|
|
95
|
+
* @param {number} turnIndex message index returned by rewindToTurn
|
|
96
|
+
* @returns {{atMessageCount:number,id:string,tool?:string}|null}
|
|
97
|
+
*/
|
|
98
|
+
export function pickCheckpointForTurn(marks, turnIndex) {
|
|
99
|
+
if (!Array.isArray(marks) || marks.length === 0) return null;
|
|
100
|
+
const idx = Number(turnIndex);
|
|
101
|
+
if (!Number.isFinite(idx)) return null;
|
|
102
|
+
let best = null;
|
|
103
|
+
for (const m of marks) {
|
|
104
|
+
if (!m || typeof m.id !== "string") continue;
|
|
105
|
+
const c = Number(m.atMessageCount);
|
|
106
|
+
if (!Number.isFinite(c) || c <= idx) continue;
|
|
107
|
+
if (best === null || c < Number(best.atMessageCount)) best = m;
|
|
108
|
+
}
|
|
109
|
+
return best;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* Drop checkpoint marks belonging to turns that were just rewound away (those
|
|
114
|
+
* with `atMessageCount` greater than the surviving message count). Mutates the
|
|
115
|
+
* array in place so the REPL's `const` marks array keeps its identity.
|
|
116
|
+
*
|
|
117
|
+
* @returns {number} how many marks were removed
|
|
118
|
+
*/
|
|
119
|
+
export function pruneMarksAfter(marks, turnIndex) {
|
|
120
|
+
if (!Array.isArray(marks)) return 0;
|
|
121
|
+
const idx = Number(turnIndex);
|
|
122
|
+
if (!Number.isFinite(idx)) return 0;
|
|
123
|
+
let removed = 0;
|
|
124
|
+
for (let i = marks.length - 1; i >= 0; i--) {
|
|
125
|
+
const c = Number(marks[i]?.atMessageCount);
|
|
126
|
+
if (!Number.isFinite(c) || c > idx) {
|
|
127
|
+
marks.splice(i, 1);
|
|
128
|
+
removed += 1;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
return removed;
|
|
132
|
+
}
|
|
133
|
+
|
|
71
134
|
/**
|
|
72
135
|
* Offline extractive recap for a resumed conversation ("where were we") —
|
|
73
136
|
* no LLM call: turn counts + last ask + last reply previews.
|