@cnwenf/occ 2.1.280 → 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.
Files changed (2) hide show
  1. package/dist/cli.js +82 -5
  2. 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.280","BUILD_TIME":"2026-07-24T09:01:43.886Z","FEEDBACK_CHANNEL":"","ISSUES_EXPLAINER":"","NATIVE_PACKAGE_URL":"","PACKAGE_URL":"@cnwenf/occ","VERSION_CHANGELOG":""};
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;
@@ -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 readline5 from "readline/promises";
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 = readline5.createInterface({
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();
@@ -825124,18 +825189,30 @@ Usage: claude --remote "your task description"`, () => gracefulShutdown(1));
825124
825189
  } = await Promise.resolve().then(() => (init_mcp5(), exports_mcp3));
825125
825190
  await mcpRemoveHandler2(name3, options);
825126
825191
  });
825127
- mcp2.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 () => {
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 () => {
825128
825193
  const {
825129
825194
  mcpListHandler: mcpListHandler2
825130
825195
  } = await Promise.resolve().then(() => (init_mcp5(), exports_mcp3));
825131
825196
  await mcpListHandler2();
825132
825197
  });
825133
- mcp2.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 (name3) => {
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) => {
825134
825199
  const {
825135
825200
  mcpGetHandler: mcpGetHandler2
825136
825201
  } = await Promise.resolve().then(() => (init_mcp5(), exports_mcp3));
825137
825202
  await mcpGetHandler2(name3);
825138
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
+ });
825139
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) => {
825140
825217
  const {
825141
825218
  mcpAddJsonHandler: mcpAddJsonHandler2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cnwenf/occ",
3
- "version": "2.1.280",
3
+ "version": "2.1.281",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "bin": {