@chatcode/chatcode-cli-test 1.0.10 → 1.0.11
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/dist/cli.js +1 -1
- package/package.json +8 -10
- package/scripts/npm-preinstall.mjs +106 -4
package/dist/cli.js
CHANGED
|
@@ -9317,4 +9317,4 @@ Usage: chatcode-cli --remote "your task description"`,()=>A4(1));l("tengu_remote
|
|
|
9317
9317
|
`));await SMq();let{teleportWithProgress:A$}=await Promise.resolve().then(() => (op_(),rp_)),W4=await A$(c8,Z6);ok6({sessionId:Z6}),HK=W4.messages}catch(Y7){if(Y7 instanceof jJ)process.stderr.write(Y7.formattedMessage+`
|
|
9318
9318
|
`);else O6(Y7),process.stderr.write(f8.red(`Error: ${Q6(Y7)}
|
|
9319
9319
|
`));await A4(1)}}}if(E_){let Y7=E_;try{let B_=performance.now(),A$=await ga(y_??Y7,void 0);if(!A$)return l("tengu_session_resumed",{entrypoint:"cli_flag",success:!1}),await bL(c8,`No conversation found with session ID: ${Y7}`);let W4=y_?.fullPath??A$.fullPath;if(Z7=await ZLq(A$,{forkSession:!!M.forkSession,sessionIdOverride:Y7,transcriptPath:W4},y3),Z7.restoredAgentDef)P8=Z7.restoredAgentDef;l("tengu_session_resumed",{entrypoint:"cli_flag",success:!0,resume_duration_ms:Math.round(performance.now()-B_)})}catch(B_){l("tengu_session_resumed",{entrypoint:"cli_flag",success:!1}),O6(B_),await bL(c8,`Failed to resume session ${Y7}`)}}if(p)try{let Y7=await p,B_=KK(Y7,(A$)=>!A$.success);if(B_>0)process.stderr.write(f8.yellow(`Warning: ${B_}/${Y7.length} file(s) failed to download.
|
|
9320
|
-
`))}catch(Y7){return await bL(c8,`Error downloading files: ${Q6(Y7)}`)}let b4=Z7??(Array.isArray(HK)?{messages:HK,fileHistorySnapshots:void 0,agentName:void 0,agentColor:void 0,restoredAgentDef:P8,initialState:Gz,contentReplacements:void 0}:void 0);if(b4)Z08(M),G08(M),await qd6(c8,{getFpsMetrics:_K,stats:xK,initialState:b4.initialState},{...MY,mainThreadAgentDefinition:b4.restoredAgentDef??P8,initialMessages:b4.messages,initialFileHistorySnapshots:b4.fileHistorySnapshots,initialContentReplacements:b4.contentReplacements,initialAgentName:b4.agentName,initialAgentColor:b4.agentColor},XY6);else await Hx_(c8,{getFpsMetrics:_K,stats:xK,initialState:Gz},hm(mq()),{...MY,initialSearchQuery:s7,forkSession:M.forkSession,filterByPr:i4})}else{let r8=V3&&qz.length===0?V3:void 0;j_("action_after_hooks"),Z08(M),G08(M);let HK=null,Z7=HK?[HK,...qz]:qz.length>0?qz:void 0;await hA8(),await qd6(c8,{getFpsMetrics:_K,stats:xK,initialState:Gz},{...MY,initialMessages:Z7,pendingHookMessages:r8},XY6)}}).version(`${MACRO.VERSION} (ChatCode CLI)`,"-v, --version","Output the version number"),B7("chromeIntegration"))K.option("--chrome","Enable browser integration"),K.option("--no-chrome","Disable browser integration");if(K.option("-w, --worktree [name]","Create a new git worktree for this session (optionally specify a name)"),K.option("--tmux","Create a tmux session for the worktree (requires --worktree). Uses iTerm2 native panes when available; use --tmux=classic for traditional tmux."),ao())K.addOption(new u$("--advisor <model>","Enable the server-side advisor tool with the specified model (alias or full ID).").hideHelp());if(K.addOption(new u$("--agent-id <id>","Teammate agent ID").hideHelp()),K.addOption(new u$("--agent-name <name>","Teammate display name").hideHelp()),K.addOption(new u$("--team-name <name>","Team name for swarm coordination").hideHelp()),K.addOption(new u$("--agent-color <color>","Teammate UI color").hideHelp()),K.addOption(new u$("--plan-mode-required","Require plan mode before implementation").hideHelp()),K.addOption(new u$("--parent-session-id <id>","Parent session ID for analytics correlation").hideHelp()),K.addOption(new u$("--teammate-mode <mode>",'How to spawn teammates: "tmux", "in-process", or "auto"').choices(["auto","tmux","in-process"]).hideHelp()),K.addOption(new u$("--agent-type <type>","Custom agent type for this teammate").hideHelp()),K.addOption(new u$("--sdk-url <url>","Use remote WebSocket endpoint for SDK I/O streaming (only with -p and stream-json format)").hideHelp()),B7("remoteControl"))K.addOption(new u$("--teleport [session]","Resume a teleport session, optionally specify session ID").hideHelp()),K.addOption(new u$("--remote [description]","Create a remote session with the given description").hideHelp());B7("remoteControl"),j_("run_main_options_built");let _=process.argv.includes("-p")||process.argv.includes("--print"),$=process.argv.some((j)=>j.startsWith("cc://")||j.startsWith("cc+unix://"));if(_&&!$)return j_("run_before_parse"),await K.parseAsync(process.argv),j_("run_after_parse"),K;let z=K.command("mcp").description("Configure and manage MCP servers").configureHelp(q()).enablePositionalOptions();if(z.command("serve").description("Start the ChatCode CLI MCP server").option("-d, --debug","Enable debug mode",()=>!0).option("--verbose","Override verbose mode setting from config",()=>!0).action(async({debug:j,verbose:M})=>{let{mcpServeHandler:J}=await Promise.resolve().then(() => (tt(),st));await J({debug:j,verbose:M})}),Xu_(z),XU())fu_(z);if(z.command("remove <name>").description("Remove an MCP server").option("-s, --scope <scope>","Configuration scope (local, user, or project) - if not specified, removes from whichever scope it exists in").action(async(j,M)=>{let{mcpRemoveHandler:J}=await Promise.resolve().then(() => (tt(),st));await J(j,M)}),z.command("list").description("List configured MCP servers. Note: The workspace trust dialog is skipped and stdio servers from .mcp.json are spawned for health checks. Only use this command in directories you trust.").action(async()=>{let{mcpListHandler:j}=await Promise.resolve().then(() => (tt(),st));await j()}),z.command("get <name>").description("Get details about an MCP server. Note: The workspace trust dialog is skipped and stdio servers from .mcp.json are spawned for health checks. Only use this command in directories you trust.").action(async(j)=>{let{mcpGetHandler:M}=await Promise.resolve().then(() => (tt(),st));await M(j)}),z.command("add-json <name> <json>").description("Add an MCP server (stdio or SSE) with a JSON string").option("-s, --scope <scope>","Configuration scope (local, user, or project)","local").option("--client-secret","Prompt for OAuth client secret (or set MCP_CLIENT_SECRET env var)").action(async(j,M,J)=>{let{mcpAddJsonHandler:X}=await Promise.resolve().then(() => (tt(),st));await X(j,M,J)}),B7("desktopHandoff"))z.command("add-from-claude-desktop").description("Import MCP servers from desktop configuration (Mac and WSL only)").option("-s, --scope <scope>","Configuration scope (local, user, or project)","local").action(async(j)=>{let{mcpAddFromDesktopHandler:M}=await Promise.resolve().then(() => (tt(),st));await M(j)});z.command("reset-project-choices").description("Reset all approved and rejected project-scoped (.mcp.json) servers within this project").action(async()=>{let{mcpResetChoicesHandler:j}=await Promise.resolve().then(() => (tt(),st));await j()});let Y=K.command("auth").description("Manage authentication").configureHelp(q()),A=Y.command("login").description("Sign in to your ChatCode account").option("--email <email>","Pre-populate email address on the login page").option("--sso","Force SSO login flow").option("--console","Use ChatCode Console (API usage billing)");if(B7("consumerSubscription"))A.option("--claudeai","Use hosted subscription plan (default)");A.action(async({email:j,sso:M,console:J,claudeai:X})=>{let{authLogin:P}=await Promise.resolve().then(() => (eP6(),wj8));await P({email:j,sso:M,console:J,claudeai:X})}),Y.command("status").description("Show authentication status").option("--json","Output as JSON (default)").option("--text","Output as human-readable text").action(async(j)=>{let{authStatus:M}=await Promise.resolve().then(() => (eP6(),wj8));await M(j)}),Y.command("logout").description("Log out from your ChatCode account").action(async()=>{let{authLogout:j}=await Promise.resolve().then(() => (eP6(),wj8));await j()});let O=()=>new u$("--cowork","Use cowork_plugins directory").hideHelp(),w=K.command("plugin").alias("plugins").description("Manage ChatCode CLI plugins").configureHelp(q());w.command("validate <path>").description("Validate a plugin or marketplace manifest").addOption(O()).action(async(j,M)=>{let{pluginValidateHandler:J}=await Promise.resolve().then(() => (xL(),IL));await J(j,M)}),w.command("list").description("List installed plugins").option("--json","Output as JSON").option("--available","Include available plugins from marketplaces (requires --json)").addOption(O()).action(async(j)=>{let{pluginListHandler:M}=await Promise.resolve().then(() => (xL(),IL));await M(j)});let H=w.command("marketplace").description("Manage ChatCode CLI marketplaces").configureHelp(q());if(H.command("add <source>").description("Add a marketplace from a URL, path, or GitHub repo").addOption(O()).option("--sparse <paths...>","Limit checkout to specific directories via git sparse-checkout (for monorepos). Example: --sparse .chatcode-cli-plugin plugins").option("--scope <scope>","Where to declare the marketplace: user (default), project, or local").action(async(j,M)=>{let{marketplaceAddHandler:J}=await Promise.resolve().then(() => (xL(),IL));await J(j,M)}),H.command("list").description("List all configured marketplaces").option("--json","Output as JSON").addOption(O()).action(async(j)=>{let{marketplaceListHandler:M}=await Promise.resolve().then(() => (xL(),IL));await M(j)}),H.command("remove <name>").alias("rm").description("Remove a configured marketplace").addOption(O()).action(async(j,M)=>{let{marketplaceRemoveHandler:J}=await Promise.resolve().then(() => (xL(),IL));await J(j,M)}),H.command("update [name]").description("Update marketplace(s) from their source - updates all if no name specified").addOption(O()).action(async(j,M)=>{let{marketplaceUpdateHandler:J}=await Promise.resolve().then(() => (xL(),IL));await J(j,M)}),w.command("install <plugin>").alias("i").description("Install a plugin from available marketplaces (use plugin@marketplace for specific marketplace)").option("-s, --scope <scope>","Installation scope: user, project, or local","user").addOption(O()).action(async(j,M)=>{let{pluginInstallHandler:J}=await Promise.resolve().then(() => (xL(),IL));await J(j,M)}),w.command("uninstall <plugin>").alias("remove").alias("rm").description("Uninstall an installed plugin").option("-s, --scope <scope>","Uninstall from scope: user, project, or local","user").option("--keep-data","Preserve the plugin's persistent data directory (~/.chatcode-cli/plugins/data/{id}/)").addOption(O()).action(async(j,M)=>{let{pluginUninstallHandler:J}=await Promise.resolve().then(() => (xL(),IL));await J(j,M)}),w.command("enable <plugin>").description("Enable a disabled plugin").option("-s, --scope <scope>",`Installation scope: ${Wf.join(", ")} (default: auto-detect)`).addOption(O()).action(async(j,M)=>{let{pluginEnableHandler:J}=await Promise.resolve().then(() => (xL(),IL));await J(j,M)}),w.command("disable [plugin]").description("Disable an enabled plugin").option("-a, --all","Disable all enabled plugins").option("-s, --scope <scope>",`Installation scope: ${Wf.join(", ")} (default: auto-detect)`).addOption(O()).action(async(j,M)=>{let{pluginDisableHandler:J}=await Promise.resolve().then(() => (xL(),IL));await J(j,M)}),w.command("update <plugin>").description("Update a plugin to the latest version (restart required to apply)").option("-s, --scope <scope>",`Installation scope: ${Yz6.join(", ")} (default: user)`).addOption(O()).action(async(j,M)=>{let{pluginUpdateHandler:J}=await Promise.resolve().then(() => (xL(),IL));await J(j,M)}),B7("consumerSubscription"))K.command("setup-token").description("Set up a long-lived authentication token (requires hosted subscription)").action(async()=>{let[{setupTokenHandler:j},{createRoot:M}]=await Promise.all([Promise.resolve().then(() => (W08(),f08)),Promise.resolve().then(() => (r6(),oS6))]),J=await M(Iz6(!1));await j(J)});return K.command("agents").description("List configured agents").option("--setting-sources <sources>","Comma-separated list of setting sources to load (user, project, local).").action(async()=>{let{agentsHandler:j}=await Promise.resolve().then(() => (Gg_(),Zg_));await j(),process.exit(0)}),B7("remoteControl"),K.command("doctor").description("Check the health of your ChatCode CLI auto-updater. Note: The workspace trust dialog is skipped and stdio servers from .mcp.json are spawned for health checks. Only use this command in directories you trust.").action(async()=>{let[{doctorHandler:j},{createRoot:M}]=await Promise.all([Promise.resolve().then(() => (W08(),f08)),Promise.resolve().then(() => (r6(),oS6))]),J=await M(Iz6(!1));await j(J)}),K.command("update").alias("upgrade").description("Check for updates and install if available").action(async()=>{let{update:j}=await Promise.resolve().then(() => (Dg_(),vg_));await j()}),K.command("install [target]").description("Install ChatCode CLI native build. Use [target] to specify version (stable, latest, or specific version)").option("--force","Force installation even if already installed").action(async(j,M)=>{let{installHandler:J}=await Promise.resolve().then(() => (W08(),f08));await J(j,M)}),j_("run_before_parse"),await K.parseAsync(process.argv),j_("run_after_parse"),j_("main_after_run"),eT6(),K}async function duz({hasInitialPrompt:q,hasStdin:K,verbose:_,debug:$,debugToStderr:z,print:Y,outputFormat:A,inputFormat:O,numAllowedTools:w,numDisallowedTools:H,mcpClientCount:j,worktreeEnabled:M,skipWebFetchPreflight:J,githubActionInputs:X,dangerouslySkipPermissionsPassed:P,permissionMode:f,modeIsBypass:W,allowDangerouslySkipPermissionsPassed:Z,systemPromptFlag:v,appendSystemPromptFlag:D,thinkingConfig:N,assistantActivationPath:V}){try{l("tengu_init",{entrypoint:"claude",hasInitialPrompt:q,hasStdin:K,verbose:_,debug:$,debugToStderr:z,print:Y,outputFormat:A,inputFormat:O,numAllowedTools:w,numDisallowedTools:H,mcpClientCount:j,worktree:M,skipWebFetchPreflight:J,...X&&{githubActionInputs:X},dangerouslySkipPermissionsPassed:P,permissionMode:f,modeIsBypass:W,inProtectedNamespace:r36(),allowDangerouslySkipPermissionsPassed:Z,thinkingType:N.type,...v&&{systemPromptFlag:v},...D&&{appendSystemPromptFlag:D},is_simple:W$()||void 0,is_coordinator:void 0,...V&&{assistantActivationPath:V},autoUpdatesChannel:NK().autoUpdatesChannel??"latest",...{}})}catch(L){O6(L)}}function Z08(q){}function G08(q){return}function Quz(){(process.stderr.isTTY?process.stderr:process.stdout.isTTY?process.stdout:void 0)?.write(MS)}function luz(q){if(typeof q!=="object"||q===null)return{};let K=q,_=K.teammateMode;return{agentId:typeof K.agentId==="string"?K.agentId:void 0,agentName:typeof K.agentName==="string"?K.agentName:void 0,teamName:typeof K.teamName==="string"?K.teamName:void 0,agentColor:typeof K.agentColor==="string"?K.agentColor:void 0,planModeRequired:typeof K.planModeRequired==="boolean"?K.planModeRequired:void 0,parentSessionId:typeof K.parentSessionId==="string"?K.parentSessionId:void 0,teammateMode:_==="auto"||_==="tmux"||_==="in-process"?_:void 0,agentType:typeof K.agentType==="string"?K.agentType:void 0}}var kg_=()=>(rY(),fY(ss8)),yuz=()=>fY(Yx7),Luz=()=>(Z56(),fY(PHq)),huz=null,HSq=11;var Phq=h(()=>{Wb();lB8();ao8();IVq();o5();Px6();lu8();iS();A5();WD();BVq();KL();Sb_();rq();Cb_();sJ8();jz6();ns8();mN();uP6();Qx();MP();so();XA();Ic6();fK();Dq();YS6();_G();Y2();cU6();uq();o_();Pk8();vy();tI();nT8();o8();YLq();Ib_();PK6();rq();y8();R_8();V8();fA();jx_();Si();Xhq();Ux();sX();Whq();Ou_();EJ();Pu();Tz6();kJ();Mf6();wu_();I8();GD();h9();dyq();aF6();d5();ju_();A9();L8();FLq();h7();AB();NX();LJ();Ok();lJ();gB6();Wg6();zD();CR();pa();T_();Rt6();xq();Bp();O1();$f6();Ju_();tJ8();vE();Pu_();Wu_();KWq();cX6();sX();yW();uH();mx6();LLq();I$6();SA8();Gy();F$();cx();tu();GK();z8();h8();pK();U9();kB6();No8();sD();pc6();I9();V8();Gu_();Du_();Tu_();Nu_();Ru_();Lu_();Su_();Cu_();Iu_();qm_();Km_();$m_();iyq();Ym_();Bu();x_6();cJ6();Gv6();g2();OW();s3();xN8();_1();lF6();KA();bM();cE();HN();nq6();QW();j_("main_tsx_entry");hqK();_NK();j_("main_tsx_imports_loaded");if(Euz())process.exit(1)});var ruz={};function nuz(){if(process.title="chatcode-cli",process.stdout.isTTY)process.stdout.write("\x1B]0;ChatCode CLI\x07")}async function iuz(){let q=process.argv.slice(2);if(q.length===1&&(q[0]==="--version"||q[0]==="-v"||q[0]==="-V")){console.log(`${MACRO.VERSION} (ChatCode CLI)`);return}let{profileCheckpoint:K}=await Promise.resolve().then(() => (Wb(),Ogq));if(K("cli_entry"),!Bpq(q)){console.error("This ChatCode capability is not enabled in this build."),process.exitCode=1;return}if(process.argv[2]==="--claude-in-chrome-mcp"){K("cli_claude_in_chrome_mcp_path");let{runClaudeInChromeMcpServer:Y}=await Promise.resolve().then(() => (i9q(),n9q));await Y();return}else if(process.argv[2]==="--chrome-native-host"){K("cli_chrome_native_host_path");let{runChromeNativeHost:Y}=await Promise.resolve().then(() => (MD_(),jD_));await Y();return}if(!1)switch(q[0]){case"ps":case"logs":case"attach":case"kill":default:}if((q.includes("--tmux")||q.includes("--tmux=classic"))&&(q.includes("-w")||q.includes("--worktree")||q.some((Y)=>Y.startsWith("--worktree=")))){K("cli_tmux_worktree_fast_path");let{enableConfigs:Y}=await Promise.resolve().then(() => (Dq(),fBK));Y();let{isWorktreeModeEnabled:A}=await Promise.resolve().then(() => ja7);if(A()){let{execIntoTmuxWorktree:O}=await Promise.resolve().then(() => (QW(),uv_)),w=await O(q);if(w.handled)return;if(w.error){let{exitWithError:H}=await Promise.resolve().then(() => Vpq);H(w.error)}}}if(q.length===1&&(q[0]==="--update"||q[0]==="--upgrade"))process.argv=[process.argv[0],process.argv[1],"update"];if(q.includes("--bare"))process.env.CHATCODE_CLI_SIMPLE="1";let{startCapturingEarlyInput:$}=await Promise.resolve().then(() => (YS6(),SFK));$(),K("cli_before_main_import");let{main:z}=await Promise.resolve().then(() => (Phq(),Ng_));K("cli_after_main_import"),await z(),K("cli_after_main_complete")}var Vg_=h(()=>{ppq();Fpq();mpq();nuz();process.env.COREPACK_ENABLE_AUTO_PIN="0";if(process.env.CHATCODE_CLI_REMOTE==="true"){let q=process.env.NODE_OPTIONS||"";process.env.NODE_OPTIONS=q?`${q} --max-old-space-size=8192`:"--max-old-space-size=8192"}iuz()});var Mk6={name:"@chatcode/chatcode-cli-test",version:"1.0.10",description:"ChatCode CLI command-line coding assistant.",license:"SEE LICENSE IN LICENSE.md",type:"module",packageManager:"bun@1.3.5",repository:{type:"git",url:"http://gitlab.tianti.tg.unicom.local/kubernetesAMP/visualDesignPlatform/chatcode-cli.git"},engines:{node:">=18.0.0"},scripts:{dev:"bun run --feature BUDDY --feature AGENT_TRIGGERS ./src/dev-entry.ts",start:"bun run --feature BUDDY --feature AGENT_TRIGGERS ./src/dev-entry.ts",version:"bun run --feature BUDDY --feature AGENT_TRIGGERS ./src/dev-entry.ts --version",test:"bun test scripts/tests","scan:public-surface":"bun run scripts/public-surface-scan.mjs --fail-on-match","verify:public-surface":"bun run scripts/verify-public-surface-release.mjs",build:"bun run scripts/build.mjs","build:native":"bun run scripts/build.mjs --compile","build:native:all":"bun run scripts/build.mjs --compile --all","build:native:win":"bun run scripts/build.mjs --compile --targets=win32-x64","build:native:pack":"node scripts/pack-native.mjs",preinstall:"node ./scripts/npm-preinstall.mjs",prepublishOnly:"bun run build"},files:["bin/","dist/cli.js","dist/vendor/","scripts/npm-preinstall.mjs","README.md"],publishConfig:{access:"public"},devDependencies:{"@alcalzone/ansi-tokenize":"0.3.0","adm-zip":"0.5.16","@ant/claude-for-chrome-mcp":"file:./shims/ant-claude-for-chrome-mcp","@ant/computer-use-input":"file:./shims/ant-computer-use-input","@ant/computer-use-mcp":"file:./shims/ant-computer-use-mcp","@ant/computer-use-swift":"file:./shims/ant-computer-use-swift","@anthropic-ai/claude-agent-sdk":"0.2.90","@anthropic-ai/mcpb":"2.1.2","@anthropic-ai/sandbox-runtime":"0.0.44","@anthropic-ai/sdk":"0.80.0","@aws-sdk/client-bedrock-runtime":"3.1020.0","@commander-js/extra-typings":"14.0.0","@growthbook/growthbook":"1.6.5","@modelcontextprotocol/sdk":"1.29.0","@opentelemetry/api":"1.9.1","@opentelemetry/api-logs":"0.214.0","@opentelemetry/core":"2.6.1","@opentelemetry/resources":"2.6.1","@opentelemetry/sdk-logs":"0.214.0","@opentelemetry/sdk-metrics":"2.6.1","@opentelemetry/sdk-trace-base":"2.6.1","@opentelemetry/semantic-conventions":"1.40.0",ajv:"8.18.0",asciichart:"1.5.25","auto-bind":"5.0.1",axios:"1.14.0","bidi-js":"1.0.3",chalk:"5.6.2",chokidar:"5.0.0","cli-boxes":"4.0.1","code-excerpt":"4.0.0",diff:"8.0.4","emoji-regex":"10.6.0","env-paths":"4.0.0",execa:"9.6.1",figures:"6.1.0","fuse.js":"7.1.0","get-east-asian-width":"1.5.0","google-auth-library":"10.6.2","highlight.js":"11.11.1","https-proxy-agent":"8.0.0",ignore:"7.0.5","indent-string":"5.0.0",ink:"6.8.0","jsonc-parser":"3.3.1","lodash-es":"4.17.23","lru-cache":"11.2.7",marked:"17.0.5","p-map":"7.0.4",picomatch:"4.0.4","proper-lockfile":"4.1.2",qrcode:"1.5.4",react:"19.2.4","react-reconciler":"0.33.0",semver:"7.7.4","shell-quote":"1.8.3","signal-exit":"4.1.0","stack-utils":"2.0.6","strip-ansi":"7.2.0","supports-hyperlinks":"4.4.0","tree-kill":"1.2.2","type-fest":"5.5.0",undici:"7.24.6","usehooks-ts":"3.1.1",uuid:"^11.1.0","vscode-jsonrpc":"8.2.1","vscode-languageserver-protocol":"3.17.5","vscode-languageserver-types":"3.17.5","wrap-ansi":"10.0.0",ws:"8.20.0",xss:"1.0.15",yaml:"2.8.3",zod:"4.3.6","color-diff-napi":"file:./shims/color-diff-napi","modifiers-napi":"file:./shims/modifiers-napi","url-handler-napi":"file:./shims/url-handler-napi"},optionalDependencies:{"@chatcode/chatcode-cli-test-darwin-arm64":"1.0.10","@chatcode/chatcode-cli-test-darwin-x64":"1.0.10","@chatcode/chatcode-cli-test-linux-x64":"1.0.10","@chatcode/chatcode-cli-test-linux-arm64":"1.0.10","@chatcode/chatcode-cli-test-win32-x64":"1.0.10"},bin:{"chatcode-cli":"bin/cli.js",cco:"bin/cli.js"}};z8();import{existsSync as XSq,readdirSync as ouz,readFileSync as auz}from"fs";import{dirname as Lg_,extname as suz,join as DY6,resolve as Rg_}from"path";import{fileURLToPath as tuz}from"url";if(process.platform!=="win32"&&process.platform!=="darwin")process.env.CHATCODE_CLI_NO_FLICKER??="1";process.env.CLAUDE_CODE_DISABLE_MOUSE??="0";var yg_=Lg_(tuz(import.meta.url)),euz={VERSION:Mk6.version,BUILD_TIME:"",PACKAGE_URL:Mk6.name,NATIVE_PACKAGE_URL:Mk6.name,VERSION_CHANGELOG:"",ISSUES_EXPLAINER:"contact support at https://yuanjing.chinaunicom.com",FEEDBACK_CHANNEL:"github"};if(!("MACRO"in globalThis))globalThis.MACRO=euz;function JSq(q,K){if(!XSq(q))return;for(let _ of ouz(q,{withFileTypes:!0})){let $=DY6(q,_.name);if(_.isDirectory()){JSq($,K);continue}if([".ts",".tsx",".js",".jsx",".mjs",".cjs"].includes(suz(_.name)))K.push($)}}function qmz(q){let K=q.replace(/\.js$/u,"");return[K,`${K}.ts`,`${K}.tsx`,`${K}.js`,`${K}.jsx`,`${K}.mjs`,`${K}.cjs`,DY6(K,"index.ts"),DY6(K,"index.tsx"),DY6(K,"index.js")].some(($)=>XSq($))}function Kmz(){let q=[],K=Rg_(yg_,"..");if(R(`cliRoot: ${K}`,{level:"warn"}),R(`_runtimeDir: ${yg_}`),!XSq(DY6(K,"src")))return[];JSq(DY6(K,"src"),q),JSq(DY6(K,"vendor"),q);let _=[],$=new Set,z=/(?:import|export)\s+[\s\S]*?from\s+['"](\.\.?\/[^'"]+)['"]|require\(\s*['"](\.\.?\/[^'"]+)['"]\s*\)/g;for(let Y of q){let A=auz(Y,"utf8");for(let O of A.matchAll(z)){let w=O[1]??O[2];if(!w)continue;let H=Rg_(Lg_(Y),w);if(qmz(H))continue;let j=`${Y} -> ${w}`;if($.has(j))continue;$.add(j),_.push({importer:Y,specifier:w})}}return _.sort((Y,A)=>`${Y.importer}:${Y.specifier}`.localeCompare(`${A.importer}:${A.specifier}`))}var oXw=process.argv.slice(2),MSq=Kmz();if(MSq.length>0){console.log("Wanma-CLI restored development workspace"),console.log(`version: ${Mk6.version}`),console.log(`missing relative imports: ${MSq.length}`),console.log(""),console.log("Top missing modules:");for(let q of MSq.slice(0,20))console.log(`- ${q.importer.replace(`${process.cwd()}/`,"")} -> ${q.specifier}`);console.log(""),console.log("The original app entry is still blocked by missing restored sources."),console.log("Use this workspace to continue restoration; once missing imports reach 0, this launcher will forward to src/main.tsx automatically."),process.exit(0)}await Promise.resolve().then(() => (Vg_(),ruz));
|
|
9320
|
+
`))}catch(Y7){return await bL(c8,`Error downloading files: ${Q6(Y7)}`)}let b4=Z7??(Array.isArray(HK)?{messages:HK,fileHistorySnapshots:void 0,agentName:void 0,agentColor:void 0,restoredAgentDef:P8,initialState:Gz,contentReplacements:void 0}:void 0);if(b4)Z08(M),G08(M),await qd6(c8,{getFpsMetrics:_K,stats:xK,initialState:b4.initialState},{...MY,mainThreadAgentDefinition:b4.restoredAgentDef??P8,initialMessages:b4.messages,initialFileHistorySnapshots:b4.fileHistorySnapshots,initialContentReplacements:b4.contentReplacements,initialAgentName:b4.agentName,initialAgentColor:b4.agentColor},XY6);else await Hx_(c8,{getFpsMetrics:_K,stats:xK,initialState:Gz},hm(mq()),{...MY,initialSearchQuery:s7,forkSession:M.forkSession,filterByPr:i4})}else{let r8=V3&&qz.length===0?V3:void 0;j_("action_after_hooks"),Z08(M),G08(M);let HK=null,Z7=HK?[HK,...qz]:qz.length>0?qz:void 0;await hA8(),await qd6(c8,{getFpsMetrics:_K,stats:xK,initialState:Gz},{...MY,initialMessages:Z7,pendingHookMessages:r8},XY6)}}).version(`${MACRO.VERSION} (ChatCode CLI)`,"-v, --version","Output the version number"),B7("chromeIntegration"))K.option("--chrome","Enable browser integration"),K.option("--no-chrome","Disable browser integration");if(K.option("-w, --worktree [name]","Create a new git worktree for this session (optionally specify a name)"),K.option("--tmux","Create a tmux session for the worktree (requires --worktree). Uses iTerm2 native panes when available; use --tmux=classic for traditional tmux."),ao())K.addOption(new u$("--advisor <model>","Enable the server-side advisor tool with the specified model (alias or full ID).").hideHelp());if(K.addOption(new u$("--agent-id <id>","Teammate agent ID").hideHelp()),K.addOption(new u$("--agent-name <name>","Teammate display name").hideHelp()),K.addOption(new u$("--team-name <name>","Team name for swarm coordination").hideHelp()),K.addOption(new u$("--agent-color <color>","Teammate UI color").hideHelp()),K.addOption(new u$("--plan-mode-required","Require plan mode before implementation").hideHelp()),K.addOption(new u$("--parent-session-id <id>","Parent session ID for analytics correlation").hideHelp()),K.addOption(new u$("--teammate-mode <mode>",'How to spawn teammates: "tmux", "in-process", or "auto"').choices(["auto","tmux","in-process"]).hideHelp()),K.addOption(new u$("--agent-type <type>","Custom agent type for this teammate").hideHelp()),K.addOption(new u$("--sdk-url <url>","Use remote WebSocket endpoint for SDK I/O streaming (only with -p and stream-json format)").hideHelp()),B7("remoteControl"))K.addOption(new u$("--teleport [session]","Resume a teleport session, optionally specify session ID").hideHelp()),K.addOption(new u$("--remote [description]","Create a remote session with the given description").hideHelp());B7("remoteControl"),j_("run_main_options_built");let _=process.argv.includes("-p")||process.argv.includes("--print"),$=process.argv.some((j)=>j.startsWith("cc://")||j.startsWith("cc+unix://"));if(_&&!$)return j_("run_before_parse"),await K.parseAsync(process.argv),j_("run_after_parse"),K;let z=K.command("mcp").description("Configure and manage MCP servers").configureHelp(q()).enablePositionalOptions();if(z.command("serve").description("Start the ChatCode CLI MCP server").option("-d, --debug","Enable debug mode",()=>!0).option("--verbose","Override verbose mode setting from config",()=>!0).action(async({debug:j,verbose:M})=>{let{mcpServeHandler:J}=await Promise.resolve().then(() => (tt(),st));await J({debug:j,verbose:M})}),Xu_(z),XU())fu_(z);if(z.command("remove <name>").description("Remove an MCP server").option("-s, --scope <scope>","Configuration scope (local, user, or project) - if not specified, removes from whichever scope it exists in").action(async(j,M)=>{let{mcpRemoveHandler:J}=await Promise.resolve().then(() => (tt(),st));await J(j,M)}),z.command("list").description("List configured MCP servers. Note: The workspace trust dialog is skipped and stdio servers from .mcp.json are spawned for health checks. Only use this command in directories you trust.").action(async()=>{let{mcpListHandler:j}=await Promise.resolve().then(() => (tt(),st));await j()}),z.command("get <name>").description("Get details about an MCP server. Note: The workspace trust dialog is skipped and stdio servers from .mcp.json are spawned for health checks. Only use this command in directories you trust.").action(async(j)=>{let{mcpGetHandler:M}=await Promise.resolve().then(() => (tt(),st));await M(j)}),z.command("add-json <name> <json>").description("Add an MCP server (stdio or SSE) with a JSON string").option("-s, --scope <scope>","Configuration scope (local, user, or project)","local").option("--client-secret","Prompt for OAuth client secret (or set MCP_CLIENT_SECRET env var)").action(async(j,M,J)=>{let{mcpAddJsonHandler:X}=await Promise.resolve().then(() => (tt(),st));await X(j,M,J)}),B7("desktopHandoff"))z.command("add-from-claude-desktop").description("Import MCP servers from desktop configuration (Mac and WSL only)").option("-s, --scope <scope>","Configuration scope (local, user, or project)","local").action(async(j)=>{let{mcpAddFromDesktopHandler:M}=await Promise.resolve().then(() => (tt(),st));await M(j)});z.command("reset-project-choices").description("Reset all approved and rejected project-scoped (.mcp.json) servers within this project").action(async()=>{let{mcpResetChoicesHandler:j}=await Promise.resolve().then(() => (tt(),st));await j()});let Y=K.command("auth").description("Manage authentication").configureHelp(q()),A=Y.command("login").description("Sign in to your ChatCode account").option("--email <email>","Pre-populate email address on the login page").option("--sso","Force SSO login flow").option("--console","Use ChatCode Console (API usage billing)");if(B7("consumerSubscription"))A.option("--claudeai","Use hosted subscription plan (default)");A.action(async({email:j,sso:M,console:J,claudeai:X})=>{let{authLogin:P}=await Promise.resolve().then(() => (eP6(),wj8));await P({email:j,sso:M,console:J,claudeai:X})}),Y.command("status").description("Show authentication status").option("--json","Output as JSON (default)").option("--text","Output as human-readable text").action(async(j)=>{let{authStatus:M}=await Promise.resolve().then(() => (eP6(),wj8));await M(j)}),Y.command("logout").description("Log out from your ChatCode account").action(async()=>{let{authLogout:j}=await Promise.resolve().then(() => (eP6(),wj8));await j()});let O=()=>new u$("--cowork","Use cowork_plugins directory").hideHelp(),w=K.command("plugin").alias("plugins").description("Manage ChatCode CLI plugins").configureHelp(q());w.command("validate <path>").description("Validate a plugin or marketplace manifest").addOption(O()).action(async(j,M)=>{let{pluginValidateHandler:J}=await Promise.resolve().then(() => (xL(),IL));await J(j,M)}),w.command("list").description("List installed plugins").option("--json","Output as JSON").option("--available","Include available plugins from marketplaces (requires --json)").addOption(O()).action(async(j)=>{let{pluginListHandler:M}=await Promise.resolve().then(() => (xL(),IL));await M(j)});let H=w.command("marketplace").description("Manage ChatCode CLI marketplaces").configureHelp(q());if(H.command("add <source>").description("Add a marketplace from a URL, path, or GitHub repo").addOption(O()).option("--sparse <paths...>","Limit checkout to specific directories via git sparse-checkout (for monorepos). Example: --sparse .chatcode-cli-plugin plugins").option("--scope <scope>","Where to declare the marketplace: user (default), project, or local").action(async(j,M)=>{let{marketplaceAddHandler:J}=await Promise.resolve().then(() => (xL(),IL));await J(j,M)}),H.command("list").description("List all configured marketplaces").option("--json","Output as JSON").addOption(O()).action(async(j)=>{let{marketplaceListHandler:M}=await Promise.resolve().then(() => (xL(),IL));await M(j)}),H.command("remove <name>").alias("rm").description("Remove a configured marketplace").addOption(O()).action(async(j,M)=>{let{marketplaceRemoveHandler:J}=await Promise.resolve().then(() => (xL(),IL));await J(j,M)}),H.command("update [name]").description("Update marketplace(s) from their source - updates all if no name specified").addOption(O()).action(async(j,M)=>{let{marketplaceUpdateHandler:J}=await Promise.resolve().then(() => (xL(),IL));await J(j,M)}),w.command("install <plugin>").alias("i").description("Install a plugin from available marketplaces (use plugin@marketplace for specific marketplace)").option("-s, --scope <scope>","Installation scope: user, project, or local","user").addOption(O()).action(async(j,M)=>{let{pluginInstallHandler:J}=await Promise.resolve().then(() => (xL(),IL));await J(j,M)}),w.command("uninstall <plugin>").alias("remove").alias("rm").description("Uninstall an installed plugin").option("-s, --scope <scope>","Uninstall from scope: user, project, or local","user").option("--keep-data","Preserve the plugin's persistent data directory (~/.chatcode-cli/plugins/data/{id}/)").addOption(O()).action(async(j,M)=>{let{pluginUninstallHandler:J}=await Promise.resolve().then(() => (xL(),IL));await J(j,M)}),w.command("enable <plugin>").description("Enable a disabled plugin").option("-s, --scope <scope>",`Installation scope: ${Wf.join(", ")} (default: auto-detect)`).addOption(O()).action(async(j,M)=>{let{pluginEnableHandler:J}=await Promise.resolve().then(() => (xL(),IL));await J(j,M)}),w.command("disable [plugin]").description("Disable an enabled plugin").option("-a, --all","Disable all enabled plugins").option("-s, --scope <scope>",`Installation scope: ${Wf.join(", ")} (default: auto-detect)`).addOption(O()).action(async(j,M)=>{let{pluginDisableHandler:J}=await Promise.resolve().then(() => (xL(),IL));await J(j,M)}),w.command("update <plugin>").description("Update a plugin to the latest version (restart required to apply)").option("-s, --scope <scope>",`Installation scope: ${Yz6.join(", ")} (default: user)`).addOption(O()).action(async(j,M)=>{let{pluginUpdateHandler:J}=await Promise.resolve().then(() => (xL(),IL));await J(j,M)}),B7("consumerSubscription"))K.command("setup-token").description("Set up a long-lived authentication token (requires hosted subscription)").action(async()=>{let[{setupTokenHandler:j},{createRoot:M}]=await Promise.all([Promise.resolve().then(() => (W08(),f08)),Promise.resolve().then(() => (r6(),oS6))]),J=await M(Iz6(!1));await j(J)});return K.command("agents").description("List configured agents").option("--setting-sources <sources>","Comma-separated list of setting sources to load (user, project, local).").action(async()=>{let{agentsHandler:j}=await Promise.resolve().then(() => (Gg_(),Zg_));await j(),process.exit(0)}),B7("remoteControl"),K.command("doctor").description("Check the health of your ChatCode CLI auto-updater. Note: The workspace trust dialog is skipped and stdio servers from .mcp.json are spawned for health checks. Only use this command in directories you trust.").action(async()=>{let[{doctorHandler:j},{createRoot:M}]=await Promise.all([Promise.resolve().then(() => (W08(),f08)),Promise.resolve().then(() => (r6(),oS6))]),J=await M(Iz6(!1));await j(J)}),K.command("update").alias("upgrade").description("Check for updates and install if available").action(async()=>{let{update:j}=await Promise.resolve().then(() => (Dg_(),vg_));await j()}),K.command("install [target]").description("Install ChatCode CLI native build. Use [target] to specify version (stable, latest, or specific version)").option("--force","Force installation even if already installed").action(async(j,M)=>{let{installHandler:J}=await Promise.resolve().then(() => (W08(),f08));await J(j,M)}),j_("run_before_parse"),await K.parseAsync(process.argv),j_("run_after_parse"),j_("main_after_run"),eT6(),K}async function duz({hasInitialPrompt:q,hasStdin:K,verbose:_,debug:$,debugToStderr:z,print:Y,outputFormat:A,inputFormat:O,numAllowedTools:w,numDisallowedTools:H,mcpClientCount:j,worktreeEnabled:M,skipWebFetchPreflight:J,githubActionInputs:X,dangerouslySkipPermissionsPassed:P,permissionMode:f,modeIsBypass:W,allowDangerouslySkipPermissionsPassed:Z,systemPromptFlag:v,appendSystemPromptFlag:D,thinkingConfig:N,assistantActivationPath:V}){try{l("tengu_init",{entrypoint:"claude",hasInitialPrompt:q,hasStdin:K,verbose:_,debug:$,debugToStderr:z,print:Y,outputFormat:A,inputFormat:O,numAllowedTools:w,numDisallowedTools:H,mcpClientCount:j,worktree:M,skipWebFetchPreflight:J,...X&&{githubActionInputs:X},dangerouslySkipPermissionsPassed:P,permissionMode:f,modeIsBypass:W,inProtectedNamespace:r36(),allowDangerouslySkipPermissionsPassed:Z,thinkingType:N.type,...v&&{systemPromptFlag:v},...D&&{appendSystemPromptFlag:D},is_simple:W$()||void 0,is_coordinator:void 0,...V&&{assistantActivationPath:V},autoUpdatesChannel:NK().autoUpdatesChannel??"latest",...{}})}catch(L){O6(L)}}function Z08(q){}function G08(q){return}function Quz(){(process.stderr.isTTY?process.stderr:process.stdout.isTTY?process.stdout:void 0)?.write(MS)}function luz(q){if(typeof q!=="object"||q===null)return{};let K=q,_=K.teammateMode;return{agentId:typeof K.agentId==="string"?K.agentId:void 0,agentName:typeof K.agentName==="string"?K.agentName:void 0,teamName:typeof K.teamName==="string"?K.teamName:void 0,agentColor:typeof K.agentColor==="string"?K.agentColor:void 0,planModeRequired:typeof K.planModeRequired==="boolean"?K.planModeRequired:void 0,parentSessionId:typeof K.parentSessionId==="string"?K.parentSessionId:void 0,teammateMode:_==="auto"||_==="tmux"||_==="in-process"?_:void 0,agentType:typeof K.agentType==="string"?K.agentType:void 0}}var kg_=()=>(rY(),fY(ss8)),yuz=()=>fY(Yx7),Luz=()=>(Z56(),fY(PHq)),huz=null,HSq=11;var Phq=h(()=>{Wb();lB8();ao8();IVq();o5();Px6();lu8();iS();A5();WD();BVq();KL();Sb_();rq();Cb_();sJ8();jz6();ns8();mN();uP6();Qx();MP();so();XA();Ic6();fK();Dq();YS6();_G();Y2();cU6();uq();o_();Pk8();vy();tI();nT8();o8();YLq();Ib_();PK6();rq();y8();R_8();V8();fA();jx_();Si();Xhq();Ux();sX();Whq();Ou_();EJ();Pu();Tz6();kJ();Mf6();wu_();I8();GD();h9();dyq();aF6();d5();ju_();A9();L8();FLq();h7();AB();NX();LJ();Ok();lJ();gB6();Wg6();zD();CR();pa();T_();Rt6();xq();Bp();O1();$f6();Ju_();tJ8();vE();Pu_();Wu_();KWq();cX6();sX();yW();uH();mx6();LLq();I$6();SA8();Gy();F$();cx();tu();GK();z8();h8();pK();U9();kB6();No8();sD();pc6();I9();V8();Gu_();Du_();Tu_();Nu_();Ru_();Lu_();Su_();Cu_();Iu_();qm_();Km_();$m_();iyq();Ym_();Bu();x_6();cJ6();Gv6();g2();OW();s3();xN8();_1();lF6();KA();bM();cE();HN();nq6();QW();j_("main_tsx_entry");hqK();_NK();j_("main_tsx_imports_loaded");if(Euz())process.exit(1)});var ruz={};function nuz(){if(process.title="chatcode-cli",process.stdout.isTTY)process.stdout.write("\x1B]0;ChatCode CLI\x07")}async function iuz(){let q=process.argv.slice(2);if(q.length===1&&(q[0]==="--version"||q[0]==="-v"||q[0]==="-V")){console.log(`${MACRO.VERSION} (ChatCode CLI)`);return}let{profileCheckpoint:K}=await Promise.resolve().then(() => (Wb(),Ogq));if(K("cli_entry"),!Bpq(q)){console.error("This ChatCode capability is not enabled in this build."),process.exitCode=1;return}if(process.argv[2]==="--claude-in-chrome-mcp"){K("cli_claude_in_chrome_mcp_path");let{runClaudeInChromeMcpServer:Y}=await Promise.resolve().then(() => (i9q(),n9q));await Y();return}else if(process.argv[2]==="--chrome-native-host"){K("cli_chrome_native_host_path");let{runChromeNativeHost:Y}=await Promise.resolve().then(() => (MD_(),jD_));await Y();return}if(!1)switch(q[0]){case"ps":case"logs":case"attach":case"kill":default:}if((q.includes("--tmux")||q.includes("--tmux=classic"))&&(q.includes("-w")||q.includes("--worktree")||q.some((Y)=>Y.startsWith("--worktree=")))){K("cli_tmux_worktree_fast_path");let{enableConfigs:Y}=await Promise.resolve().then(() => (Dq(),fBK));Y();let{isWorktreeModeEnabled:A}=await Promise.resolve().then(() => ja7);if(A()){let{execIntoTmuxWorktree:O}=await Promise.resolve().then(() => (QW(),uv_)),w=await O(q);if(w.handled)return;if(w.error){let{exitWithError:H}=await Promise.resolve().then(() => Vpq);H(w.error)}}}if(q.length===1&&(q[0]==="--update"||q[0]==="--upgrade"))process.argv=[process.argv[0],process.argv[1],"update"];if(q.includes("--bare"))process.env.CHATCODE_CLI_SIMPLE="1";let{startCapturingEarlyInput:$}=await Promise.resolve().then(() => (YS6(),SFK));$(),K("cli_before_main_import");let{main:z}=await Promise.resolve().then(() => (Phq(),Ng_));K("cli_after_main_import"),await z(),K("cli_after_main_complete")}var Vg_=h(()=>{ppq();Fpq();mpq();nuz();process.env.COREPACK_ENABLE_AUTO_PIN="0";if(process.env.CHATCODE_CLI_REMOTE==="true"){let q=process.env.NODE_OPTIONS||"";process.env.NODE_OPTIONS=q?`${q} --max-old-space-size=8192`:"--max-old-space-size=8192"}iuz()});var Mk6={name:"@chatcode/chatcode-cli-test",version:"1.0.11",description:"ChatCode CLI command-line coding assistant.",license:"SEE LICENSE IN LICENSE.md",type:"module",packageManager:"bun@1.3.5",repository:{type:"git",url:"http://gitlab.tianti.tg.unicom.local/kubernetesAMP/visualDesignPlatform/chatcode-cli.git"},engines:{node:">=18.0.0"},scripts:{dev:"bun run --feature BUDDY --feature AGENT_TRIGGERS ./src/dev-entry.ts",start:"bun run --feature BUDDY --feature AGENT_TRIGGERS ./src/dev-entry.ts",version:"bun run --feature BUDDY --feature AGENT_TRIGGERS ./src/dev-entry.ts --version",test:"bun test scripts/tests","scan:public-surface":"bun run scripts/public-surface-scan.mjs --fail-on-match","verify:public-surface":"bun run scripts/verify-public-surface-release.mjs",build:"bun run scripts/build.mjs","build:native":"bun run scripts/build.mjs --compile","build:native:all":"bun run scripts/build.mjs --compile --all","build:native:win":"bun run scripts/build.mjs --compile --targets=win32-x64","build:native:pack":"node scripts/pack-native.mjs",preinstall:"node ./scripts/npm-preinstall.mjs",postinstall:"node ./scripts/npm-preinstall.mjs install-shims",preuninstall:"node ./scripts/npm-preinstall.mjs uninstall-shims",prepublishOnly:"bun run build"},files:["bin/","dist/cli.js","dist/vendor/","scripts/npm-preinstall.mjs","README.md"],publishConfig:{access:"public"},devDependencies:{"@alcalzone/ansi-tokenize":"0.3.0","adm-zip":"0.5.16","@ant/claude-for-chrome-mcp":"file:./shims/ant-claude-for-chrome-mcp","@ant/computer-use-input":"file:./shims/ant-computer-use-input","@ant/computer-use-mcp":"file:./shims/ant-computer-use-mcp","@ant/computer-use-swift":"file:./shims/ant-computer-use-swift","@anthropic-ai/claude-agent-sdk":"0.2.90","@anthropic-ai/mcpb":"2.1.2","@anthropic-ai/sandbox-runtime":"0.0.44","@anthropic-ai/sdk":"0.80.0","@aws-sdk/client-bedrock-runtime":"3.1020.0","@commander-js/extra-typings":"14.0.0","@growthbook/growthbook":"1.6.5","@modelcontextprotocol/sdk":"1.29.0","@opentelemetry/api":"1.9.1","@opentelemetry/api-logs":"0.214.0","@opentelemetry/core":"2.6.1","@opentelemetry/resources":"2.6.1","@opentelemetry/sdk-logs":"0.214.0","@opentelemetry/sdk-metrics":"2.6.1","@opentelemetry/sdk-trace-base":"2.6.1","@opentelemetry/semantic-conventions":"1.40.0",ajv:"8.18.0",asciichart:"1.5.25","auto-bind":"5.0.1",axios:"1.14.0","bidi-js":"1.0.3",chalk:"5.6.2",chokidar:"5.0.0","cli-boxes":"4.0.1","code-excerpt":"4.0.0",diff:"8.0.4","emoji-regex":"10.6.0","env-paths":"4.0.0",execa:"9.6.1",figures:"6.1.0","fuse.js":"7.1.0","get-east-asian-width":"1.5.0","google-auth-library":"10.6.2","highlight.js":"11.11.1","https-proxy-agent":"8.0.0",ignore:"7.0.5","indent-string":"5.0.0",ink:"6.8.0","jsonc-parser":"3.3.1","lodash-es":"4.17.23","lru-cache":"11.2.7",marked:"17.0.5","p-map":"7.0.4",picomatch:"4.0.4","proper-lockfile":"4.1.2",qrcode:"1.5.4",react:"19.2.4","react-reconciler":"0.33.0",semver:"7.7.4","shell-quote":"1.8.3","signal-exit":"4.1.0","stack-utils":"2.0.6","strip-ansi":"7.2.0","supports-hyperlinks":"4.4.0","tree-kill":"1.2.2","type-fest":"5.5.0",undici:"7.24.6","usehooks-ts":"3.1.1",uuid:"^11.1.0","vscode-jsonrpc":"8.2.1","vscode-languageserver-protocol":"3.17.5","vscode-languageserver-types":"3.17.5","wrap-ansi":"10.0.0",ws:"8.20.0",xss:"1.0.15",yaml:"2.8.3",zod:"4.3.6","color-diff-napi":"file:./shims/color-diff-napi","modifiers-napi":"file:./shims/modifiers-napi","url-handler-napi":"file:./shims/url-handler-napi"},optionalDependencies:{"@chatcode/chatcode-cli-test-darwin-arm64":"1.0.11","@chatcode/chatcode-cli-test-darwin-x64":"1.0.11","@chatcode/chatcode-cli-test-linux-x64":"1.0.11","@chatcode/chatcode-cli-test-linux-arm64":"1.0.11","@chatcode/chatcode-cli-test-win32-x64":"1.0.11"}};z8();import{existsSync as XSq,readdirSync as ouz,readFileSync as auz}from"fs";import{dirname as Lg_,extname as suz,join as DY6,resolve as Rg_}from"path";import{fileURLToPath as tuz}from"url";if(process.platform!=="win32"&&process.platform!=="darwin")process.env.CHATCODE_CLI_NO_FLICKER??="1";process.env.CLAUDE_CODE_DISABLE_MOUSE??="0";var yg_=Lg_(tuz(import.meta.url)),euz={VERSION:Mk6.version,BUILD_TIME:"",PACKAGE_URL:Mk6.name,NATIVE_PACKAGE_URL:Mk6.name,VERSION_CHANGELOG:"",ISSUES_EXPLAINER:"contact support at https://yuanjing.chinaunicom.com",FEEDBACK_CHANNEL:"github"};if(!("MACRO"in globalThis))globalThis.MACRO=euz;function JSq(q,K){if(!XSq(q))return;for(let _ of ouz(q,{withFileTypes:!0})){let $=DY6(q,_.name);if(_.isDirectory()){JSq($,K);continue}if([".ts",".tsx",".js",".jsx",".mjs",".cjs"].includes(suz(_.name)))K.push($)}}function qmz(q){let K=q.replace(/\.js$/u,"");return[K,`${K}.ts`,`${K}.tsx`,`${K}.js`,`${K}.jsx`,`${K}.mjs`,`${K}.cjs`,DY6(K,"index.ts"),DY6(K,"index.tsx"),DY6(K,"index.js")].some(($)=>XSq($))}function Kmz(){let q=[],K=Rg_(yg_,"..");if(R(`cliRoot: ${K}`,{level:"warn"}),R(`_runtimeDir: ${yg_}`),!XSq(DY6(K,"src")))return[];JSq(DY6(K,"src"),q),JSq(DY6(K,"vendor"),q);let _=[],$=new Set,z=/(?:import|export)\s+[\s\S]*?from\s+['"](\.\.?\/[^'"]+)['"]|require\(\s*['"](\.\.?\/[^'"]+)['"]\s*\)/g;for(let Y of q){let A=auz(Y,"utf8");for(let O of A.matchAll(z)){let w=O[1]??O[2];if(!w)continue;let H=Rg_(Lg_(Y),w);if(qmz(H))continue;let j=`${Y} -> ${w}`;if($.has(j))continue;$.add(j),_.push({importer:Y,specifier:w})}}return _.sort((Y,A)=>`${Y.importer}:${Y.specifier}`.localeCompare(`${A.importer}:${A.specifier}`))}var oXw=process.argv.slice(2),MSq=Kmz();if(MSq.length>0){console.log("Wanma-CLI restored development workspace"),console.log(`version: ${Mk6.version}`),console.log(`missing relative imports: ${MSq.length}`),console.log(""),console.log("Top missing modules:");for(let q of MSq.slice(0,20))console.log(`- ${q.importer.replace(`${process.cwd()}/`,"")} -> ${q.specifier}`);console.log(""),console.log("The original app entry is still blocked by missing restored sources."),console.log("Use this workspace to continue restoration; once missing imports reach 0, this launcher will forward to src/main.tsx automatically."),process.exit(0)}await Promise.resolve().then(() => (Vg_(),ruz));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@chatcode/chatcode-cli-test",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.11",
|
|
4
4
|
"description": "ChatCode CLI command-line coding assistant.",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
6
6
|
"type": "module",
|
|
@@ -25,6 +25,8 @@
|
|
|
25
25
|
"build:native:win": "bun run scripts/build.mjs --compile --targets=win32-x64",
|
|
26
26
|
"build:native:pack": "node scripts/pack-native.mjs",
|
|
27
27
|
"preinstall": "node ./scripts/npm-preinstall.mjs",
|
|
28
|
+
"postinstall": "node ./scripts/npm-preinstall.mjs install-shims",
|
|
29
|
+
"preuninstall": "node ./scripts/npm-preinstall.mjs uninstall-shims",
|
|
28
30
|
"prepublishOnly": "bun run build"
|
|
29
31
|
},
|
|
30
32
|
"files": [
|
|
@@ -116,14 +118,10 @@
|
|
|
116
118
|
"url-handler-napi": "file:./shims/url-handler-napi"
|
|
117
119
|
},
|
|
118
120
|
"optionalDependencies": {
|
|
119
|
-
"@chatcode/chatcode-cli-test-darwin-arm64": "1.0.
|
|
120
|
-
"@chatcode/chatcode-cli-test-darwin-x64": "1.0.
|
|
121
|
-
"@chatcode/chatcode-cli-test-linux-x64": "1.0.
|
|
122
|
-
"@chatcode/chatcode-cli-test-linux-arm64": "1.0.
|
|
123
|
-
"@chatcode/chatcode-cli-test-win32-x64": "1.0.
|
|
124
|
-
},
|
|
125
|
-
"bin": {
|
|
126
|
-
"chatcode-cli": "bin/cli.js",
|
|
127
|
-
"cco": "bin/cli.js"
|
|
121
|
+
"@chatcode/chatcode-cli-test-darwin-arm64": "1.0.11",
|
|
122
|
+
"@chatcode/chatcode-cli-test-darwin-x64": "1.0.11",
|
|
123
|
+
"@chatcode/chatcode-cli-test-linux-x64": "1.0.11",
|
|
124
|
+
"@chatcode/chatcode-cli-test-linux-arm64": "1.0.11",
|
|
125
|
+
"@chatcode/chatcode-cli-test-win32-x64": "1.0.11"
|
|
128
126
|
}
|
|
129
127
|
}
|
|
@@ -2,13 +2,16 @@
|
|
|
2
2
|
import {
|
|
3
3
|
existsSync,
|
|
4
4
|
lstatSync,
|
|
5
|
+
chmodSync,
|
|
6
|
+
mkdirSync,
|
|
5
7
|
readFileSync,
|
|
6
8
|
readdirSync,
|
|
7
9
|
readlinkSync,
|
|
8
10
|
rmSync,
|
|
11
|
+
writeFileSync,
|
|
9
12
|
} from 'node:fs'
|
|
10
|
-
import { join } from 'node:path'
|
|
11
|
-
import { pathToFileURL } from 'node:url'
|
|
13
|
+
import { dirname, join } from 'node:path'
|
|
14
|
+
import { fileURLToPath, pathToFileURL } from 'node:url'
|
|
12
15
|
|
|
13
16
|
const COMMANDS = ['chatcode-cli', 'cco']
|
|
14
17
|
const WINDOWS_SHIM_SUFFIXES = ['', '.cmd', '.ps1']
|
|
@@ -27,6 +30,15 @@ function isGlobalNpmInstall(env = process.env) {
|
|
|
27
30
|
return env.npm_config_global === 'true' || env.npm_config_global === '1'
|
|
28
31
|
}
|
|
29
32
|
|
|
33
|
+
function packageRoot() {
|
|
34
|
+
return join(dirname(fileURLToPath(import.meta.url)), '..')
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
function globalBinDir(prefix = process.env.npm_config_prefix) {
|
|
38
|
+
if (!prefix) return null
|
|
39
|
+
return process.platform === 'win32' ? prefix : join(prefix, 'bin')
|
|
40
|
+
}
|
|
41
|
+
|
|
30
42
|
function mentionsChatCodePackage(value) {
|
|
31
43
|
return CHATCODE_PACKAGE_MARKERS.some(marker => value.includes(marker))
|
|
32
44
|
}
|
|
@@ -85,7 +97,7 @@ function shouldRemoveCandidate(candidate) {
|
|
|
85
97
|
}
|
|
86
98
|
|
|
87
99
|
export function cleanLegacyGlobalShims({
|
|
88
|
-
prefix =
|
|
100
|
+
prefix = globalBinDir(),
|
|
89
101
|
commands = COMMANDS,
|
|
90
102
|
log = () => {},
|
|
91
103
|
} = {}) {
|
|
@@ -106,9 +118,99 @@ export function cleanLegacyGlobalShims({
|
|
|
106
118
|
return removed
|
|
107
119
|
}
|
|
108
120
|
|
|
121
|
+
function shellQuote(value) {
|
|
122
|
+
return `'${value.replaceAll("'", "'\\''")}'`
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
function powershellQuote(value) {
|
|
126
|
+
return `'${value.replaceAll("'", "''")}'`
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
function writePosixShim(file, launcher) {
|
|
130
|
+
writeFileSync(
|
|
131
|
+
file,
|
|
132
|
+
`#!/bin/sh\nexec node ${shellQuote(launcher)} "$@"\n`,
|
|
133
|
+
{ mode: 0o755 },
|
|
134
|
+
)
|
|
135
|
+
try {
|
|
136
|
+
chmodSync(file, 0o755)
|
|
137
|
+
} catch (_) {}
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
function writeWindowsShims(binDir, command, launcher) {
|
|
141
|
+
const unixLauncher = launcher.replaceAll('\\', '/')
|
|
142
|
+
writeFileSync(
|
|
143
|
+
join(binDir, command),
|
|
144
|
+
`#!/bin/sh\nexec node ${shellQuote(unixLauncher)} "$@"\n`,
|
|
145
|
+
{ mode: 0o755 },
|
|
146
|
+
)
|
|
147
|
+
try {
|
|
148
|
+
chmodSync(join(binDir, command), 0o755)
|
|
149
|
+
} catch (_) {}
|
|
150
|
+
|
|
151
|
+
writeFileSync(
|
|
152
|
+
join(binDir, `${command}.cmd`),
|
|
153
|
+
`@ECHO off\r\nSETLOCAL\r\nnode "${launcher}" %*\r\n`,
|
|
154
|
+
)
|
|
155
|
+
writeFileSync(
|
|
156
|
+
join(binDir, `${command}.ps1`),
|
|
157
|
+
`#!/usr/bin/env pwsh\n& node ${powershellQuote(launcher)} @args\nexit $LASTEXITCODE\n`,
|
|
158
|
+
)
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
export function installGlobalShims({
|
|
162
|
+
prefix = process.env.npm_config_prefix,
|
|
163
|
+
root = packageRoot(),
|
|
164
|
+
commands = COMMANDS,
|
|
165
|
+
log = () => {},
|
|
166
|
+
} = {}) {
|
|
167
|
+
const binDir = globalBinDir(prefix)
|
|
168
|
+
if (!binDir) return []
|
|
169
|
+
|
|
170
|
+
mkdirSync(binDir, { recursive: true })
|
|
171
|
+
cleanLegacyGlobalShims({ prefix: binDir, commands, log })
|
|
172
|
+
|
|
173
|
+
const launcher = join(root, 'bin', 'cli.js')
|
|
174
|
+
const installed = []
|
|
175
|
+
for (const command of commands) {
|
|
176
|
+
const primary = join(binDir, process.platform === 'win32' ? `${command}.cmd` : command)
|
|
177
|
+
if (existsSync(primary) && !shouldRemoveCandidate(primary)) {
|
|
178
|
+
log(`Skipped existing non-ChatCode command shim: ${primary}`)
|
|
179
|
+
continue
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
if (process.platform === 'win32') {
|
|
183
|
+
writeWindowsShims(binDir, command, launcher)
|
|
184
|
+
installed.push(join(binDir, command), join(binDir, `${command}.cmd`), join(binDir, `${command}.ps1`))
|
|
185
|
+
} else {
|
|
186
|
+
writePosixShim(join(binDir, command), launcher)
|
|
187
|
+
installed.push(join(binDir, command))
|
|
188
|
+
}
|
|
189
|
+
log(`Installed ChatCode CLI npm shim: ${primary}`)
|
|
190
|
+
}
|
|
191
|
+
return installed
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
export function uninstallGlobalShims({
|
|
195
|
+
prefix = process.env.npm_config_prefix,
|
|
196
|
+
commands = COMMANDS,
|
|
197
|
+
log = () => {},
|
|
198
|
+
} = {}) {
|
|
199
|
+
return cleanLegacyGlobalShims({ prefix: globalBinDir(prefix), commands, log })
|
|
200
|
+
}
|
|
201
|
+
|
|
109
202
|
function main() {
|
|
110
|
-
if (process.platform !== 'win32') return
|
|
111
203
|
if (!isGlobalNpmInstall()) return
|
|
204
|
+
|
|
205
|
+
const action = process.argv[2] ?? 'clean'
|
|
206
|
+
if (action === 'install-shims') {
|
|
207
|
+
installGlobalShims({ log: message => console.log(message) })
|
|
208
|
+
return
|
|
209
|
+
}
|
|
210
|
+
if (action === 'uninstall-shims') {
|
|
211
|
+
uninstallGlobalShims({ log: message => console.log(message) })
|
|
212
|
+
return
|
|
213
|
+
}
|
|
112
214
|
cleanLegacyGlobalShims({ log: message => console.log(message) })
|
|
113
215
|
}
|
|
114
216
|
|