@cnwenf/occ 2.1.279 → 2.1.281
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 +99 -23
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env bun
|
|
2
|
-
globalThis.MACRO={"VERSION":"2.1.
|
|
2
|
+
globalThis.MACRO={"VERSION":"2.1.281","BUILD_TIME":"2026-07-24T09:21:36.637Z","FEEDBACK_CHANNEL":"","ISSUES_EXPLAINER":"","NATIVE_PACKAGE_URL":"","PACKAGE_URL":"@cnwenf/occ","VERSION_CHANGELOG":""};
|
|
3
3
|
// @bun
|
|
4
4
|
var __create = Object.create;
|
|
5
5
|
var __getProtoOf = Object.getPrototypeOf;
|
|
@@ -684818,22 +684818,22 @@ var init_OccWelcome = __esm(() => {
|
|
|
684818
684818
|
jsx_runtime263 = __toESM(require_jsx_runtime(), 1);
|
|
684819
684819
|
OCC_LOGOS = {
|
|
684820
684820
|
wide: normalizeLogo([
|
|
684821
|
-
"
|
|
684822
|
-
"
|
|
684823
|
-
"
|
|
684824
|
-
"
|
|
684825
|
-
"
|
|
684826
|
-
"
|
|
684827
|
-
"
|
|
684821
|
+
"\u259F\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2599",
|
|
684822
|
+
"\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u259B",
|
|
684823
|
+
"\u2588\u2588 ",
|
|
684824
|
+
"\u2588\u2588 ",
|
|
684825
|
+
"\u2588\u2588 ",
|
|
684826
|
+
"\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u259C",
|
|
684827
|
+
"\u259C\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u259B"
|
|
684828
684828
|
]),
|
|
684829
684829
|
compact: normalizeLogo([
|
|
684830
|
-
"
|
|
684831
|
-
"
|
|
684832
|
-
"\
|
|
684833
|
-
"
|
|
684834
|
-
"
|
|
684830
|
+
"\u259F\u2588\u2588\u2588\u2588\u2588\u2588\u2599",
|
|
684831
|
+
"\u2588\u2588 ",
|
|
684832
|
+
"\u2588\u2588 ",
|
|
684833
|
+
"\u2588\u2588 ",
|
|
684834
|
+
"\u259C\u2588\u2588\u2588\u2588\u2588\u2588\u259B"
|
|
684835
684835
|
]),
|
|
684836
|
-
plain: normalizeLogo(["
|
|
684836
|
+
plain: normalizeLogo(["\u259F\u2588\u2588\u2588\u2588\u2599", "\u2588\u2588 ", "\u259C\u2588\u2588\u2588\u2588\u259B"])
|
|
684837
684837
|
};
|
|
684838
684838
|
});
|
|
684839
684839
|
|
|
@@ -812143,7 +812143,7 @@ function registerMcpAddCommand(mcp2) {
|
|
|
812143
812143
|
` + ` claude mcp add --transport http corridor https://app.corridor.dev/api/mcp --header "Authorization: Bearer ..."
|
|
812144
812144
|
|
|
812145
812145
|
` + ` # Add stdio server with environment variables:
|
|
812146
|
-
` + ` claude mcp add -e API_KEY=xxx
|
|
812146
|
+
` + ` claude mcp add my-server -e API_KEY=xxx -- npx my-mcp-server
|
|
812147
812147
|
|
|
812148
812148
|
` + ` # Add stdio server with subprocess flags:
|
|
812149
812149
|
` + " claude mcp add my-server -- my-command --some-flag arg1").option("-s, --scope <scope>", "Configuration scope (local, user, or project)", "local").option("-t, --transport <transport>", "Transport type (stdio, sse, http). Defaults to stdio if not specified.").option("-e, --env <env...>", "Set environment variables (e.g. -e KEY=value)").option("-H, --header <header...>", 'Set WebSocket headers (e.g. -H "X-Api-Key: abc123" -H "X-Custom: value")').option("--client-id <clientId>", "OAuth client ID for HTTP/SSE servers").option("--client-secret", "Prompt for OAuth client secret (or set MCP_CLIENT_SECRET env var)").option("--callback-port <port>", "Fixed port for OAuth callback (for servers requiring pre-registered redirect URIs)").helpOption("-h, --help", "Display help for command").addOption(new Option("--xaa", "Enable XAA (SEP-990) for this server. Requires 'claude mcp xaa setup' first. Also requires --client-id and --client-secret (for the MCP server's AS).").hideHelp(!isXaaEnabled())).action(async (name3, commandOrUrl, args, options) => {
|
|
@@ -819935,6 +819935,8 @@ __export(exports_mcp3, {
|
|
|
819935
819935
|
mcpServeHandler: () => mcpServeHandler,
|
|
819936
819936
|
mcpResetChoicesHandler: () => mcpResetChoicesHandler,
|
|
819937
819937
|
mcpRemoveHandler: () => mcpRemoveHandler,
|
|
819938
|
+
mcpLogoutHandler: () => mcpLogoutHandler,
|
|
819939
|
+
mcpLoginHandler: () => mcpLoginHandler,
|
|
819938
819940
|
mcpListHandler: () => mcpListHandler,
|
|
819939
819941
|
mcpGetHandler: () => mcpGetHandler,
|
|
819940
819942
|
mcpAddJsonHandler: () => mcpAddJsonHandler,
|
|
@@ -819942,6 +819944,7 @@ __export(exports_mcp3, {
|
|
|
819942
819944
|
});
|
|
819943
819945
|
import { stat as stat57 } from "fs/promises";
|
|
819944
819946
|
import { cwd as cwd3 } from "process";
|
|
819947
|
+
import readline5 from "readline";
|
|
819945
819948
|
async function checkMcpServerHealth(name3, server) {
|
|
819946
819949
|
try {
|
|
819947
819950
|
const result = await connectToServer(name3, server);
|
|
@@ -820239,6 +820242,66 @@ async function mcpResetChoicesHandler() {
|
|
|
820239
820242
|
cliOk(`All project-scoped (.mcp.json) server approvals and rejections have been reset.
|
|
820240
820243
|
You will be prompted for approval next time you start Claude Code.`);
|
|
820241
820244
|
}
|
|
820245
|
+
async function mcpLoginHandler(name3, options) {
|
|
820246
|
+
logEvent2("tengu_mcp_oauth_login", {
|
|
820247
|
+
name: name3
|
|
820248
|
+
});
|
|
820249
|
+
const server = getMcpConfigByName(name3);
|
|
820250
|
+
if (!server) {
|
|
820251
|
+
const { servers } = await getAllMcpConfigs();
|
|
820252
|
+
cliError(`No MCP server named "${name3}". Configured servers: ${Object.keys(servers).join(", ")}`);
|
|
820253
|
+
}
|
|
820254
|
+
if (server.type === "claudeai-proxy") {
|
|
820255
|
+
cliError(`"${name3}" is a claude.ai connector \u2014 it authenticates via your Anthropic account. Run \`claude auth login\` instead.`);
|
|
820256
|
+
}
|
|
820257
|
+
if (server.type !== "http" && server.type !== "sse") {
|
|
820258
|
+
cliError(`"${name3}" doesn't support OAuth login \u2014 it's only available for HTTP and SSE servers.`);
|
|
820259
|
+
}
|
|
820260
|
+
const noBrowser = options.noBrowser === true;
|
|
820261
|
+
const onAuthorizationUrl = (url3) => {
|
|
820262
|
+
console.log(noBrowser ? `Open this URL in a browser to authorize:
|
|
820263
|
+
${url3}` : `Opening browser to authorize MCP server "${name3}"\u2026
|
|
820264
|
+
${url3}`);
|
|
820265
|
+
};
|
|
820266
|
+
const onWaitingForCallback = noBrowser ? (submit) => {
|
|
820267
|
+
console.log(`
|
|
820268
|
+
After authorizing, paste the full redirect URL here and press Enter:`);
|
|
820269
|
+
const rl = readline5.createInterface({ input: process.stdin });
|
|
820270
|
+
rl.question("> ", (answer) => {
|
|
820271
|
+
rl.close();
|
|
820272
|
+
submit(answer.trim());
|
|
820273
|
+
});
|
|
820274
|
+
} : undefined;
|
|
820275
|
+
try {
|
|
820276
|
+
await performMCPOAuthFlow(name3, server, onAuthorizationUrl, undefined, {
|
|
820277
|
+
skipBrowserOpen: noBrowser,
|
|
820278
|
+
onWaitingForCallback
|
|
820279
|
+
});
|
|
820280
|
+
cliOk(`Successfully authenticated with MCP server "${name3}".`);
|
|
820281
|
+
} catch (error52) {
|
|
820282
|
+
cliError(`Failed to authenticate with MCP server "${name3}": ${error52.message}`);
|
|
820283
|
+
}
|
|
820284
|
+
}
|
|
820285
|
+
async function mcpLogoutHandler(name3) {
|
|
820286
|
+
logEvent2("tengu_mcp_oauth_logout", {
|
|
820287
|
+
name: name3
|
|
820288
|
+
});
|
|
820289
|
+
const server = getMcpConfigByName(name3);
|
|
820290
|
+
if (!server) {
|
|
820291
|
+
const { servers } = await getAllMcpConfigs();
|
|
820292
|
+
cliError(`No MCP server named "${name3}". Configured servers: ${Object.keys(servers).join(", ")}`);
|
|
820293
|
+
}
|
|
820294
|
+
if (server.type !== "http" && server.type !== "sse") {
|
|
820295
|
+
cliError(`"${name3}" doesn't use OAuth \u2014 there are no stored credentials to clear.`);
|
|
820296
|
+
}
|
|
820297
|
+
try {
|
|
820298
|
+
await revokeServerTokens(name3, server, {});
|
|
820299
|
+
clearMcpClientConfig(name3, server);
|
|
820300
|
+
cliOk(`Cleared stored OAuth credentials for MCP server "${name3}".`);
|
|
820301
|
+
} catch (error52) {
|
|
820302
|
+
cliError(`Failed to clear credentials for MCP server "${name3}": ${error52.message}`);
|
|
820303
|
+
}
|
|
820304
|
+
}
|
|
820242
820305
|
var jsx_runtime500;
|
|
820243
820306
|
var init_mcp5 = __esm(() => {
|
|
820244
820307
|
init_p_map();
|
|
@@ -821808,7 +821871,7 @@ __export(exports_autoMode, {
|
|
|
821808
821871
|
autoModeConfigHandler: () => autoModeConfigHandler
|
|
821809
821872
|
});
|
|
821810
821873
|
import { readFileSync as readFileSync37 } from "fs";
|
|
821811
|
-
import * as
|
|
821874
|
+
import * as readline6 from "readline/promises";
|
|
821812
821875
|
function writeRules(rules2) {
|
|
821813
821876
|
process.stdout.write(jsonStringify(rules2, null, 2) + `
|
|
821814
821877
|
`);
|
|
@@ -821947,7 +822010,7 @@ function readUserSettingsRaw(path43) {
|
|
|
821947
822010
|
async function defaultConfirm(message) {
|
|
821948
822011
|
if (!process.stdin.isTTY)
|
|
821949
822012
|
return false;
|
|
821950
|
-
const rl =
|
|
822013
|
+
const rl = readline6.createInterface({
|
|
821951
822014
|
input: process.stdin,
|
|
821952
822015
|
output: process.stdout
|
|
821953
822016
|
});
|
|
@@ -822903,6 +822966,8 @@ async function run() {
|
|
|
822903
822966
|
sortOptions: true
|
|
822904
822967
|
}, {
|
|
822905
822968
|
compareOptions: (a6, b6) => getOptionSortKey(a6).localeCompare(getOptionSortKey(b6))
|
|
822969
|
+
}, process.stdout.isTTY ? {} : {
|
|
822970
|
+
helpWidth: 80
|
|
822906
822971
|
});
|
|
822907
822972
|
}
|
|
822908
822973
|
const program3 = new Command().configureHelp(createSortedHelpConfig()).enablePositionalOptions();
|
|
@@ -825063,9 +825128,7 @@ Usage: claude --remote "your task description"`, () => gracefulShutdown(1));
|
|
|
825063
825128
|
if (feature("UDS_INBOX")) {
|
|
825064
825129
|
program3.addOption(new Option("--messaging-socket-path <path>", "Unix domain socket path for the UDS messaging server (defaults to a tmp path)"));
|
|
825065
825130
|
}
|
|
825066
|
-
|
|
825067
|
-
program3.addOption(new Option("--brief", "Enable SendUserMessage tool for agent-to-user communication"));
|
|
825068
|
-
}
|
|
825131
|
+
program3.addOption(new Option("--brief", "Enable SendUserMessage tool for agent-to-user communication"));
|
|
825069
825132
|
if (feature("KAIROS")) {
|
|
825070
825133
|
program3.addOption(new Option("--assistant", "Force assistant mode (Agent SDK daemon use)").hideHelp());
|
|
825071
825134
|
}
|
|
@@ -825086,8 +825149,9 @@ Usage: claude --remote "your task description"`, () => gracefulShutdown(1));
|
|
|
825086
825149
|
program3.addOption(new Option("--daemon-worker <kind>", "Run as a B daemon worker of the given kind (internal)").hideHelp());
|
|
825087
825150
|
program3.addOption(new Option("--teleport [session]", "Resume a teleport session, optionally specify session ID").hideHelp());
|
|
825088
825151
|
program3.addOption(new Option("--remote [description]", "Create a remote session with the given description").hideHelp());
|
|
825152
|
+
program3.addOption(new Option("--remote-control [name]", "Start an interactive session with Remote Control enabled (optionally named)").argParser((value) => value || true));
|
|
825153
|
+
program3.addOption(new Option("--remote-control-session-name-prefix <prefix>", "Prefix for auto-generated Remote Control session names (default: hostname)"));
|
|
825089
825154
|
if (feature("BRIDGE_MODE")) {
|
|
825090
|
-
program3.addOption(new Option("--remote-control [name]", "Start an interactive session with Remote Control enabled (optionally named)").argParser((value) => value || true).hideHelp());
|
|
825091
825155
|
program3.addOption(new Option("--rc [name]", "Alias for --remote-control").argParser((value) => value || true).hideHelp());
|
|
825092
825156
|
}
|
|
825093
825157
|
if (feature("HARD_FAIL")) {
|
|
@@ -825125,18 +825189,30 @@ Usage: claude --remote "your task description"`, () => gracefulShutdown(1));
|
|
|
825125
825189
|
} = await Promise.resolve().then(() => (init_mcp5(), exports_mcp3));
|
|
825126
825190
|
await mcpRemoveHandler2(name3, options);
|
|
825127
825191
|
});
|
|
825128
|
-
mcp2.command("list").description("List configured MCP servers.
|
|
825192
|
+
mcp2.command("list").description("List configured MCP servers. Unapproved .mcp.json servers are shown as \u23F8 Pending approval and not connected to; approved servers are health-checked.").action(async () => {
|
|
825129
825193
|
const {
|
|
825130
825194
|
mcpListHandler: mcpListHandler2
|
|
825131
825195
|
} = await Promise.resolve().then(() => (init_mcp5(), exports_mcp3));
|
|
825132
825196
|
await mcpListHandler2();
|
|
825133
825197
|
});
|
|
825134
|
-
mcp2.command("get <name>").description("Get details about an MCP server.
|
|
825198
|
+
mcp2.command("get <name>").description("Get details about an MCP server. Unapproved .mcp.json servers are shown as \u23F8 Pending approval and not connected to; approved servers are health-checked.").action(async (name3) => {
|
|
825135
825199
|
const {
|
|
825136
825200
|
mcpGetHandler: mcpGetHandler2
|
|
825137
825201
|
} = await Promise.resolve().then(() => (init_mcp5(), exports_mcp3));
|
|
825138
825202
|
await mcpGetHandler2(name3);
|
|
825139
825203
|
});
|
|
825204
|
+
mcp2.command("login <name>").description("Authenticate with an MCP server (HTTP, SSE, or claude.ai connector)").option("--no-browser", "Print the authorization URL instead of opening a browser (for SSH/headless sessions \u2014 paste the redirect URL back when prompted)").action(async (name3, options) => {
|
|
825205
|
+
const {
|
|
825206
|
+
mcpLoginHandler: mcpLoginHandler2
|
|
825207
|
+
} = await Promise.resolve().then(() => (init_mcp5(), exports_mcp3));
|
|
825208
|
+
await mcpLoginHandler2(name3, options);
|
|
825209
|
+
});
|
|
825210
|
+
mcp2.command("logout <name>").description("Clear stored OAuth credentials for an MCP server").action(async (name3) => {
|
|
825211
|
+
const {
|
|
825212
|
+
mcpLogoutHandler: mcpLogoutHandler2
|
|
825213
|
+
} = await Promise.resolve().then(() => (init_mcp5(), exports_mcp3));
|
|
825214
|
+
await mcpLogoutHandler2(name3);
|
|
825215
|
+
});
|
|
825140
825216
|
mcp2.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 (name3, json2, options) => {
|
|
825141
825217
|
const {
|
|
825142
825218
|
mcpAddJsonHandler: mcpAddJsonHandler2
|