tianshu-harness 3.23.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/LICENSE +189 -0
- package/README.en.md +1066 -0
- package/README.ja.md +1214 -0
- package/README.ko.md +1216 -0
- package/README.md +309 -0
- package/completions/rivet.bash +118 -0
- package/completions/rivet.fish +110 -0
- package/completions/rivet.ps1 +230 -0
- package/completions/rivet.zsh +187 -0
- package/dist/account-OAEKORZE.js +47 -0
- package/dist/account-login-V6FOLHJR.js +65 -0
- package/dist/account-status-KHNPPAFL.js +23 -0
- package/dist/agent/worker-process/child.js +407 -0
- package/dist/browser-cli-FLNY5ZHI.js +19 -0
- package/dist/browser-readiness-LWVGSBD5.js +12 -0
- package/dist/build-backends-5KXKR2S4.js +13 -0
- package/dist/build-options-66Y4ZE7C.js +9 -0
- package/dist/bundled-skills/brainstorming/SKILL.md +139 -0
- package/dist/bundled-skills/visual-acceptance/SKILL.md +64 -0
- package/dist/chain-7MAMFXZ3.js +10 -0
- package/dist/checkpoint-MND4DUIX.js +33 -0
- package/dist/chunk-2E6CK2RC.js +392 -0
- package/dist/chunk-2EBWGAXD.js +51 -0
- package/dist/chunk-2HDP7RMR.js +119 -0
- package/dist/chunk-2HKD2UFM.js +1000 -0
- package/dist/chunk-2VYRLULP.js +51 -0
- package/dist/chunk-2XN7PM4N.js +125 -0
- package/dist/chunk-35H7GVNR.js +66 -0
- package/dist/chunk-3C3R7JXY.js +77 -0
- package/dist/chunk-3VGD2FXB.js +118 -0
- package/dist/chunk-424AP7FM.js +534 -0
- package/dist/chunk-4J5TZGOE.js +3707 -0
- package/dist/chunk-4QJ3Y5JM.js +898 -0
- package/dist/chunk-4U2ET7ZY.js +1326 -0
- package/dist/chunk-4XPFLICE.js +876 -0
- package/dist/chunk-5B2OCU5P.js +31707 -0
- package/dist/chunk-5GGOGLSN.js +73 -0
- package/dist/chunk-5JRZPLI6.js +251 -0
- package/dist/chunk-5TQ3JYBU.js +397 -0
- package/dist/chunk-66JPZSGX.js +55 -0
- package/dist/chunk-6HSVXHCZ.js +764 -0
- package/dist/chunk-6S5FPUS7.js +21 -0
- package/dist/chunk-722LQO64.js +131 -0
- package/dist/chunk-73NJ7IT7.js +354 -0
- package/dist/chunk-7FW3I7WC.js +95 -0
- package/dist/chunk-7KUCBNLB.js +173 -0
- package/dist/chunk-7RDOV3DF.js +201 -0
- package/dist/chunk-A5MNH4ER.js +79 -0
- package/dist/chunk-ADIVZ2D5.js +15 -0
- package/dist/chunk-AE3P3F6W.js +366 -0
- package/dist/chunk-AERM3VGP.js +280 -0
- package/dist/chunk-AEWHC4WM.js +246 -0
- package/dist/chunk-AOVQ7VIF.js +169 -0
- package/dist/chunk-AOYHP3WI.js +12411 -0
- package/dist/chunk-B3YEBABJ.js +7160 -0
- package/dist/chunk-BCQXEZPJ.js +154 -0
- package/dist/chunk-BKTQAYO2.js +418 -0
- package/dist/chunk-BSECIPAQ.js +80 -0
- package/dist/chunk-BUIMGNDD.js +52 -0
- package/dist/chunk-BXHV3GSB.js +10320 -0
- package/dist/chunk-C6ZVZCPP.js +139 -0
- package/dist/chunk-CEZNQVWM.js +82 -0
- package/dist/chunk-CGFZGR7G.js +1492 -0
- package/dist/chunk-CGOADM2X.js +337 -0
- package/dist/chunk-CI4R6P2B.js +24 -0
- package/dist/chunk-D2TCGRSX.js +73 -0
- package/dist/chunk-D4PTYFOG.js +154 -0
- package/dist/chunk-D54ZWG4T.js +717 -0
- package/dist/chunk-DEBI37QB.js +145 -0
- package/dist/chunk-DWROHPXP.js +1051 -0
- package/dist/chunk-DZ6UOJ5D.js +92 -0
- package/dist/chunk-EBJTVRQN.js +81 -0
- package/dist/chunk-EGEI2RQA.js +1167 -0
- package/dist/chunk-EHHUASO5.js +1305 -0
- package/dist/chunk-EPKTIOED.js +41 -0
- package/dist/chunk-ER5JW2QZ.js +5681 -0
- package/dist/chunk-ETHFACAB.js +315 -0
- package/dist/chunk-EXUE5W2F.js +112 -0
- package/dist/chunk-EXXICUIW.js +73 -0
- package/dist/chunk-FFQSZJOO.js +169 -0
- package/dist/chunk-FHFKPGDO.js +85 -0
- package/dist/chunk-FW3QKMFX.js +158 -0
- package/dist/chunk-GD4ZNZ7W.js +30 -0
- package/dist/chunk-GHVMWF2I.js +581 -0
- package/dist/chunk-GMKAXSYQ.js +297 -0
- package/dist/chunk-HBVF6BWO.js +325 -0
- package/dist/chunk-HV4YGVMS.js +379 -0
- package/dist/chunk-ILBCKAV6.js +89 -0
- package/dist/chunk-J4U4AW46.js +440 -0
- package/dist/chunk-J6ESSM47.js +1791 -0
- package/dist/chunk-JBZHIC6T.js +2309 -0
- package/dist/chunk-JCFWOULR.js +245 -0
- package/dist/chunk-JRF5L6OD.js +131 -0
- package/dist/chunk-JSS75KCG.js +2014 -0
- package/dist/chunk-JSXWIWWJ.js +225 -0
- package/dist/chunk-JYV7I2QH.js +98 -0
- package/dist/chunk-KIOXTQQL.js +1596 -0
- package/dist/chunk-KWVTXT5B.js +89 -0
- package/dist/chunk-KX22RD6R.js +33 -0
- package/dist/chunk-LA6IPTGH.js +709 -0
- package/dist/chunk-LH5VCGLB.js +1796 -0
- package/dist/chunk-LQQ6XJ2Y.js +269 -0
- package/dist/chunk-MJQ55WZZ.js +65 -0
- package/dist/chunk-ML3UKMH3.js +40 -0
- package/dist/chunk-MOZPLHSU.js +5526 -0
- package/dist/chunk-NGEWJ4DF.js +89 -0
- package/dist/chunk-NH6VIOAR.js +211 -0
- package/dist/chunk-O5VZQKCB.js +26106 -0
- package/dist/chunk-OHSV42QB.js +748 -0
- package/dist/chunk-OO3TAHO5.js +4070 -0
- package/dist/chunk-OTNHSAGN.js +38282 -0
- package/dist/chunk-OUWAC7AQ.js +442 -0
- package/dist/chunk-OXMIV4WE.js +270 -0
- package/dist/chunk-P5KJURUR.js +229 -0
- package/dist/chunk-P6GJOVO6.js +307 -0
- package/dist/chunk-QARAGUXX.js +23 -0
- package/dist/chunk-R43HJCDX.js +2711 -0
- package/dist/chunk-RAXBAWRN.js +210 -0
- package/dist/chunk-RK3JHWPT.js +39 -0
- package/dist/chunk-RWA23GMM.js +24 -0
- package/dist/chunk-S4K4L6IM.js +179 -0
- package/dist/chunk-SAXK6LVF.js +124 -0
- package/dist/chunk-SEPGEJNK.js +1607 -0
- package/dist/chunk-SUJERP5I.js +285 -0
- package/dist/chunk-T3ED6BY2.js +913 -0
- package/dist/chunk-THKDVSEC.js +90 -0
- package/dist/chunk-TI4GSEL5.js +52 -0
- package/dist/chunk-TPI73L57.js +164 -0
- package/dist/chunk-TVHW77C7.js +338 -0
- package/dist/chunk-TWNHOSDT.js +1073 -0
- package/dist/chunk-UFMN76QD.js +347 -0
- package/dist/chunk-UHGLFRZE.js +205 -0
- package/dist/chunk-UTZYPKBF.js +15231 -0
- package/dist/chunk-UXNLELW6.js +25 -0
- package/dist/chunk-UXXS53EA.js +166 -0
- package/dist/chunk-V5DHFGI7.js +171 -0
- package/dist/chunk-V5YIPMHV.js +2353 -0
- package/dist/chunk-WMUWEO2C.js +754 -0
- package/dist/chunk-WOE3D7JM.js +945 -0
- package/dist/chunk-X2IK5LVR.js +2592 -0
- package/dist/chunk-XU2YXCDL.js +459 -0
- package/dist/chunk-YJG5HIX5.js +203 -0
- package/dist/chunk-Z3QE7TZM.js +72 -0
- package/dist/chunk-Z5Z3JHJY.js +64 -0
- package/dist/chunk-ZDIFBJFT.js +168 -0
- package/dist/chunk-ZGGCEXDC.js +176 -0
- package/dist/chunk-ZMZCZNKU.js +263 -0
- package/dist/chunk-ZNC5T65N.js +17 -0
- package/dist/chunk-ZO3I3A7O.js +308 -0
- package/dist/chunk-ZQKXBUB7.js +217 -0
- package/dist/chunk-ZTRINFM2.js +78 -0
- package/dist/chunk-ZU7JZCVP.js +193 -0
- package/dist/chunk-ZZAWNALS.js +350 -0
- package/dist/cli/entry.js +54 -0
- package/dist/connector-L5QQTR6Y.js +26 -0
- package/dist/context-62DC6EC3.js +31 -0
- package/dist/council-convene-NJWPNBDU.js +46 -0
- package/dist/create-agent-config-ODSQWNVC.js +55 -0
- package/dist/default-registry-2PU3BTAU.js +68 -0
- package/dist/deliver-task-KONV4C4M.js +57 -0
- package/dist/delivery-gate-v2-F2YVMVGK.js +27 -0
- package/dist/domain-knowledge-store-DDZ3F4J7.js +11 -0
- package/dist/fetch-core-ZPPYDSZH.js +14 -0
- package/dist/galaxy-K72BBDQN.js +91 -0
- package/dist/goal-criteria-SCALAU2D.js +141 -0
- package/dist/goal-persist-XWY2GDQX.js +19 -0
- package/dist/goal-tracker-FXMJ2GVK.js +11 -0
- package/dist/headless-LSB6I7PT.js +162 -0
- package/dist/headless-coordinator-VDPDMVUT.js +90 -0
- package/dist/inject-U55SMB6A.js +39 -0
- package/dist/login-flow-CD4ZGXOC.js +59 -0
- package/dist/logs-cli-SQVYFMMN.js +283 -0
- package/dist/loop-ULZYBDA3.js +76 -0
- package/dist/main.js +4064 -0
- package/dist/manager-ROZBCWPA.js +171 -0
- package/dist/manager-Z7XFFUOM.js +10670 -0
- package/dist/meridian-indexer-ZIW363L7.js +21 -0
- package/dist/native-resolver-PN34UIVV.js +13 -0
- package/dist/node_modules/better-sqlite3/lib/database.js +90 -0
- package/dist/node_modules/better-sqlite3/lib/index.js +3 -0
- package/dist/node_modules/better-sqlite3/lib/methods/aggregate.js +43 -0
- package/dist/node_modules/better-sqlite3/lib/methods/backup.js +67 -0
- package/dist/node_modules/better-sqlite3/lib/methods/function.js +31 -0
- package/dist/node_modules/better-sqlite3/lib/methods/inspect.js +7 -0
- package/dist/node_modules/better-sqlite3/lib/methods/pragma.js +12 -0
- package/dist/node_modules/better-sqlite3/lib/methods/serialize.js +16 -0
- package/dist/node_modules/better-sqlite3/lib/methods/table.js +189 -0
- package/dist/node_modules/better-sqlite3/lib/methods/transaction.js +78 -0
- package/dist/node_modules/better-sqlite3/lib/methods/wrappers.js +54 -0
- package/dist/node_modules/better-sqlite3/lib/sqlite-error.js +20 -0
- package/dist/node_modules/better-sqlite3/lib/util.js +12 -0
- package/dist/node_modules/better-sqlite3/package.json +59 -0
- package/dist/ownership-ledger-E3WIEKPL.js +9 -0
- package/dist/package.json +3 -0
- package/dist/path-grants-XRRXHXG7.js +40 -0
- package/dist/paths-LVV5IMQN.js +49 -0
- package/dist/plan-fact-anchors-LMVQZCW5.js +13 -0
- package/dist/plan-store-ODLTTPFB.js +17 -0
- package/dist/plan-templates-5FPFBOL6.js +109 -0
- package/dist/plugin-loader-ZZKX7ZE6.js +22 -0
- package/dist/prefix-budget-62OV5HQC.js +13 -0
- package/dist/project-trust-5WS5MOMU.js +31 -0
- package/dist/provider-cli-ALDQXIT7.js +37 -0
- package/dist/providers-XQYTAVPK.js +11 -0
- package/dist/proxy-resolver-V2Y6534D.js +15 -0
- package/dist/recovery-cli-KPGY6FY3.js +106 -0
- package/dist/review-discipline-MNSYCST5.js +55 -0
- package/dist/review-router-BVQZW3MX.js +18 -0
- package/dist/seed-capsules/seed-capsule-attack-methodology.md +62 -0
- package/dist/seed-capsules/seed-capsule-changgeng.md +31 -0
- package/dist/seed-capsules/seed-capsule-design-aesthetics.md +38 -0
- package/dist/seed-capsules/seed-capsule-diagnostic-ladder.md +54 -0
- package/dist/seed-capsules/seed-capsule-fu.md +39 -0
- package/dist/seed-capsules/seed-capsule-huagai.md +73 -0
- package/dist/seed-capsules/seed-capsule-kaiyang.md +65 -0
- package/dist/seed-capsules/seed-capsule-knowledge-work.md +40 -0
- package/dist/seed-capsules/seed-capsule-tanlang.md +47 -0
- package/dist/seed-capsules/seed-capsule-tianfu.md +23 -0
- package/dist/seed-capsules/seed-capsule-tianliang.md +63 -0
- package/dist/seed-capsules/seed-capsule-tianquan.md +32 -0
- package/dist/seed-capsules/seed-capsule-tianxuan-ccr.md +22 -0
- package/dist/seed-capsules/seed-capsule-tianxuan.md +64 -0
- package/dist/seed-capsules/seed-capsule-yaoguang.md +87 -0
- package/dist/serve-X2R2UTLF.js +170 -0
- package/dist/serve-agent-KHSU6RVV.js +965 -0
- package/dist/session-persist-HUUC772H.js +37 -0
- package/dist/session-registry-6XUD5C4Y.js +15 -0
- package/dist/skill-loader-CK3RMO47.js +48 -0
- package/dist/skills/cli-harness-sop.md +207 -0
- package/dist/spawn-git-4HFU65AH.js +29 -0
- package/dist/sse-EYUTBWUK.js +512 -0
- package/dist/starflow-NOFBMPFU.js +30 -0
- package/dist/streamableHttp-V67CNJMO.js +447 -0
- package/dist/task-contract-6XHBNJQK.js +32 -0
- package/dist/task-ledger-3K4TJIER.js +9 -0
- package/dist/team-orchestrate-S6NHZP7X.js +64 -0
- package/dist/title-extract-QX4XGCYN.js +50 -0
- package/dist/todo-QDXGRZZP.js +31 -0
- package/dist/todo-store-V3TTO5AH.js +12 -0
- package/dist/tool-preset-LU5BYEDZ.js +23 -0
- package/dist/tool-tiers-GD742YBN.js +23 -0
- package/dist/turndown.es-OI55K6C3.js +17373 -0
- package/dist/verification-attribution-EKG4CNUV.js +13 -0
- package/dist/volatile-git-MBTST7RA.js +15 -0
- package/dist/wave-checkpoint-XLIIHXQA.js +30 -0
- package/dist/web-cli-DUG4I35O.js +233 -0
- package/dist/web-search-3IK542AA.js +34 -0
- package/dist/workers/cpu-worker.js +45 -0
- package/dist/workflow-runner-HX7UBAYG.js +297 -0
- package/dist/worktree-baseline-O5NCU6M2.js +9 -0
- package/package.json +122 -0
- package/scripts/check-mobile-env.mjs +76 -0
- package/scripts/fetch-native-sqlite.js +392 -0
- package/scripts/prune-installed-wasms.js +45 -0
- package/scripts/tree-sitter-wasm-keep.js +40 -0
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
#!/usr/bin/env -S node --expose-gc --max-old-space-size=4096
|
|
2
|
+
import { createRequire as __rivetCreateRequire } from 'node:module'; const require = __rivetCreateRequire(import.meta.url);
|
|
3
|
+
import {
|
|
4
|
+
init_esm_shims
|
|
5
|
+
} from "./chunk-5GGOGLSN.js";
|
|
6
|
+
|
|
7
|
+
// src/cli/help-text.ts
|
|
8
|
+
init_esm_shims();
|
|
9
|
+
var HELP_TEXT = `rivet \u2014 \u5929\u67A2 Tianshu terminal coding agent
|
|
10
|
+
|
|
11
|
+
Usage:
|
|
12
|
+
rivet [options] interactive TUI (requires TTY)
|
|
13
|
+
rivet -p "<prompt>" [--json] [--stream-json] headless one-shot
|
|
14
|
+
rivet --goal "<task>" [--budget N] [--json] [--stream-json] headless goal mode
|
|
15
|
+
rivet sessions list sessions and exit
|
|
16
|
+
rivet logs list log locations and exit
|
|
17
|
+
|
|
18
|
+
Options:
|
|
19
|
+
--model <name> use a specific model (e.g. deepseek-v4-pro)
|
|
20
|
+
--provider <name> use a specific provider
|
|
21
|
+
--profile <name> boot with a named config profile (RIVET_HOME/profiles/<name>.json or built-in lean)
|
|
22
|
+
-c, --continue resume the most recent session for this cwd
|
|
23
|
+
-r, --resume [id|prefix] resume a specific session (bare = open picker)
|
|
24
|
+
--new force a brand-new session
|
|
25
|
+
--list list sessions and exit
|
|
26
|
+
-p, --print "<prompt>" headless: answer one prompt, then exit
|
|
27
|
+
--goal "<task>" headless goal autonomy (--budget N caps turns)
|
|
28
|
+
--json | --stream-json headless output format
|
|
29
|
+
--stream-events <path> mirror the run as NDJSON SessionEvents to a file (TUI + -p/--goal)
|
|
30
|
+
--skip-welcome skip the welcome page
|
|
31
|
+
--screen-reader screen-reader mode
|
|
32
|
+
--dangerously-skip-permissions skip permission prompts (high risk)
|
|
33
|
+
-h, --help show this help and exit
|
|
34
|
+
-v, --version print version and exit
|
|
35
|
+
`;
|
|
36
|
+
|
|
37
|
+
// src/cli/early-routing.ts
|
|
38
|
+
init_esm_shims();
|
|
39
|
+
function createEarlyCliHandlers(cwd = process.cwd()) {
|
|
40
|
+
return {
|
|
41
|
+
config: async (args) => {
|
|
42
|
+
const { runConfigCLI } = await import("./manager-ROZBCWPA.js");
|
|
43
|
+
await runConfigCLI(args);
|
|
44
|
+
},
|
|
45
|
+
provider: async (args) => {
|
|
46
|
+
const { runProviderCLI } = await import("./provider-cli-ALDQXIT7.js");
|
|
47
|
+
await runProviderCLI(args);
|
|
48
|
+
},
|
|
49
|
+
serve: async (args) => {
|
|
50
|
+
const { serveCommand } = await import("./serve-X2R2UTLF.js");
|
|
51
|
+
await serveCommand(args);
|
|
52
|
+
},
|
|
53
|
+
sessions: async () => {
|
|
54
|
+
const { SessionPersist } = await import("./session-persist-HUUC772H.js");
|
|
55
|
+
return SessionPersist.formatSessionList(cwd);
|
|
56
|
+
},
|
|
57
|
+
browser: async (args) => {
|
|
58
|
+
const { runBrowserCLI } = await import("./browser-cli-FLNY5ZHI.js");
|
|
59
|
+
return runBrowserCLI(args);
|
|
60
|
+
},
|
|
61
|
+
logs: async (args) => {
|
|
62
|
+
const { runLogsCLI } = await import("./logs-cli-SQVYFMMN.js");
|
|
63
|
+
return runLogsCLI(args, { cwd });
|
|
64
|
+
},
|
|
65
|
+
web: async (args) => {
|
|
66
|
+
const { runWebCLI } = await import("./web-cli-DUG4I35O.js");
|
|
67
|
+
return runWebCLI(args);
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
async function applyEarlyCliEnv(args, hooks = {}) {
|
|
72
|
+
const profileIdx = args.indexOf("--profile");
|
|
73
|
+
const profile = profileIdx >= 0 ? args[profileIdx + 1] : void 0;
|
|
74
|
+
if (profile !== void 0 && !profile.startsWith("-")) {
|
|
75
|
+
process.env.RIVET_PROFILE = profile;
|
|
76
|
+
}
|
|
77
|
+
const wantTrust = args.includes("--trust");
|
|
78
|
+
const wantUntrust = args.includes("--untrust");
|
|
79
|
+
if (!wantTrust && !wantUntrust) return;
|
|
80
|
+
const trustFn = hooks.trustProject ?? (await import("./project-trust-5WS5MOMU.js")).trustProject;
|
|
81
|
+
const untrustFn = hooks.untrustProject ?? (await import("./project-trust-5WS5MOMU.js")).untrustProject;
|
|
82
|
+
if (wantTrust) trustFn(process.cwd());
|
|
83
|
+
if (wantUntrust) untrustFn(process.cwd());
|
|
84
|
+
}
|
|
85
|
+
async function routeEarlyCli(rawArgs, options = {}) {
|
|
86
|
+
const args = [...rawArgs];
|
|
87
|
+
const handlers = { ...createEarlyCliHandlers(options.cwd), ...options.handlers };
|
|
88
|
+
const io = {
|
|
89
|
+
stdout: (text) => {
|
|
90
|
+
process.stdout.write(text);
|
|
91
|
+
},
|
|
92
|
+
stderr: (text) => {
|
|
93
|
+
process.stderr.write(text);
|
|
94
|
+
},
|
|
95
|
+
exit: (code) => {
|
|
96
|
+
process.exit(code);
|
|
97
|
+
},
|
|
98
|
+
...options.io
|
|
99
|
+
};
|
|
100
|
+
if (args[0] === "config") {
|
|
101
|
+
await handlers.config(args.slice(1));
|
|
102
|
+
return true;
|
|
103
|
+
}
|
|
104
|
+
if (args[0] === "provider") {
|
|
105
|
+
await handlers.provider(args.slice(1));
|
|
106
|
+
return true;
|
|
107
|
+
}
|
|
108
|
+
if (args[0] === "serve") {
|
|
109
|
+
await handlers.serve(args.slice(1));
|
|
110
|
+
return true;
|
|
111
|
+
}
|
|
112
|
+
if (args[0] === "sessions" || args.includes("--list")) {
|
|
113
|
+
io.stdout(await handlers.sessions() + "\n");
|
|
114
|
+
return true;
|
|
115
|
+
}
|
|
116
|
+
if (args[0] === "browser") {
|
|
117
|
+
const code = await handlers.browser(args.slice(1));
|
|
118
|
+
if (code !== 0) io.exit(code);
|
|
119
|
+
return true;
|
|
120
|
+
}
|
|
121
|
+
if (args[0] === "logs") {
|
|
122
|
+
const { output, exitCode } = await handlers.logs(args.slice(1));
|
|
123
|
+
(exitCode === 0 ? io.stdout : io.stderr)(output + "\n");
|
|
124
|
+
if (exitCode !== 0) io.exit(exitCode);
|
|
125
|
+
return true;
|
|
126
|
+
}
|
|
127
|
+
if (args[0] === "web") {
|
|
128
|
+
const code = await handlers.web(args.slice(1));
|
|
129
|
+
if (code !== 0) io.exit(code);
|
|
130
|
+
return true;
|
|
131
|
+
}
|
|
132
|
+
return false;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
export {
|
|
136
|
+
HELP_TEXT,
|
|
137
|
+
applyEarlyCliEnv,
|
|
138
|
+
routeEarlyCli
|
|
139
|
+
};
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
#!/usr/bin/env -S node --expose-gc --max-old-space-size=4096
|
|
2
|
+
import { createRequire as __rivetCreateRequire } from 'node:module'; const require = __rivetCreateRequire(import.meta.url);
|
|
3
|
+
import {
|
|
4
|
+
init_esm_shims
|
|
5
|
+
} from "./chunk-5GGOGLSN.js";
|
|
6
|
+
|
|
7
|
+
// src/utils/sanitize.ts
|
|
8
|
+
init_esm_shims();
|
|
9
|
+
var nfNormalize = (s) => s.normalize("NFC");
|
|
10
|
+
var MAX_JSON_BODY_BYTES = 4 * 1024 * 1024;
|
|
11
|
+
function sanitizeForJsonTransport(input) {
|
|
12
|
+
if (input.length === 0) return input;
|
|
13
|
+
let needsWork = false;
|
|
14
|
+
for (let i = 0; i < input.length; i++) {
|
|
15
|
+
const cp = input.charCodeAt(i);
|
|
16
|
+
if (cp < 32 && cp !== 9 && cp !== 10 && cp !== 13) {
|
|
17
|
+
needsWork = true;
|
|
18
|
+
break;
|
|
19
|
+
}
|
|
20
|
+
if (cp >= 128 && cp <= 159) {
|
|
21
|
+
needsWork = true;
|
|
22
|
+
break;
|
|
23
|
+
}
|
|
24
|
+
if (cp >= 55296 && cp <= 56319) {
|
|
25
|
+
const next = input.charCodeAt(i + 1);
|
|
26
|
+
if (!(next >= 56320 && next <= 57343)) {
|
|
27
|
+
needsWork = true;
|
|
28
|
+
break;
|
|
29
|
+
}
|
|
30
|
+
i++;
|
|
31
|
+
} else if (cp >= 56320 && cp <= 57343) {
|
|
32
|
+
needsWork = true;
|
|
33
|
+
break;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
if (!needsWork) return nfNormalize(input);
|
|
37
|
+
const chars = [];
|
|
38
|
+
for (let i = 0; i < input.length; i++) {
|
|
39
|
+
const cp = input.charCodeAt(i);
|
|
40
|
+
if (cp < 32 && cp !== 9 && cp !== 10 && cp !== 13) {
|
|
41
|
+
chars.push(" ");
|
|
42
|
+
continue;
|
|
43
|
+
}
|
|
44
|
+
if (cp >= 128 && cp <= 159) {
|
|
45
|
+
chars.push(" ");
|
|
46
|
+
continue;
|
|
47
|
+
}
|
|
48
|
+
if (cp >= 55296 && cp <= 56319) {
|
|
49
|
+
const next = input.charCodeAt(i + 1);
|
|
50
|
+
if (next >= 56320 && next <= 57343) {
|
|
51
|
+
chars.push(input[i], input[i + 1]);
|
|
52
|
+
i++;
|
|
53
|
+
} else {
|
|
54
|
+
chars.push("\uFFFD");
|
|
55
|
+
}
|
|
56
|
+
continue;
|
|
57
|
+
}
|
|
58
|
+
if (cp >= 56320 && cp <= 57343) {
|
|
59
|
+
chars.push("\uFFFD");
|
|
60
|
+
continue;
|
|
61
|
+
}
|
|
62
|
+
chars.push(input[i]);
|
|
63
|
+
}
|
|
64
|
+
return nfNormalize(chars.join(""));
|
|
65
|
+
}
|
|
66
|
+
function sanitizeMessageContent(value) {
|
|
67
|
+
if (typeof value === "string") return sanitizeForJsonTransport(value);
|
|
68
|
+
if (Array.isArray(value)) return value.map(sanitizeMessageContent);
|
|
69
|
+
if (value && typeof value === "object") {
|
|
70
|
+
const result = {};
|
|
71
|
+
for (const [key, child] of Object.entries(value)) {
|
|
72
|
+
result[key] = sanitizeMessageContent(child);
|
|
73
|
+
}
|
|
74
|
+
return result;
|
|
75
|
+
}
|
|
76
|
+
return value;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export {
|
|
80
|
+
sanitizeForJsonTransport,
|
|
81
|
+
sanitizeMessageContent
|
|
82
|
+
};
|