@funnycode/myclaude 0.1.270 → 0.1.275

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/myclaude.js CHANGED
@@ -4,8 +4,8 @@
4
4
  // MACRO - build-time constants (injected by build.ts)
5
5
  // MACRO injected by build script
6
6
  globalThis.MACRO = {
7
- VERSION: "0.1.270",
8
- BUILD_TIME: "2026-08-17T03:53:05.312Z",
7
+ VERSION: "0.1.275",
8
+ BUILD_TIME: "2026-08-18T07:41:26.160Z",
9
9
  PACKAGE_URL: "@funnycode/myclaude",
10
10
  NATIVE_PACKAGE_URL: "@funnycode/myclaude",
11
11
  VERSION_CHANGELOG: '',
@@ -120027,7 +120027,7 @@ var package_default;
120027
120027
  var init_package = __esm(() => {
120028
120028
  package_default = {
120029
120029
  name: "@funnycode/myclaude",
120030
- version: "0.1.270",
120030
+ version: "0.1.275",
120031
120031
  private: false,
120032
120032
  description: "An open-source AI coding assistant in your terminal - powered by Claude",
120033
120033
  license: "MIT",
@@ -282571,15 +282571,21 @@ __export(exports_sessionIdCompat, {
282571
282571
  toInfraSessionId: () => toInfraSessionId,
282572
282572
  toCompatSessionId: () => toCompatSessionId,
282573
282573
  setCseShimGate: () => setCseShimGate,
282574
- resetCseShimGateForTesting: () => resetCseShimGateForTesting
282574
+ resetCseShimGateForTesting: () => resetCseShimGateForTesting,
282575
+ getCseShimGate: () => getCseShimGate
282575
282576
  });
282576
282577
  function setCseShimGate(gate) {
282577
- if (_isCseShimEnabled === undefined) {
282578
- _isCseShimEnabled = gate;
282579
- }
282578
+ if (_gateLocked)
282579
+ return;
282580
+ _gateLocked = true;
282581
+ _isCseShimEnabled = gate;
282582
+ }
282583
+ function getCseShimGate() {
282584
+ return _isCseShimEnabled;
282580
282585
  }
282581
282586
  function resetCseShimGateForTesting() {
282582
282587
  _isCseShimEnabled = undefined;
282588
+ _gateLocked = false;
282583
282589
  }
282584
282590
  function toCompatSessionId(id) {
282585
282591
  if (!id.startsWith("cse_"))
@@ -282595,7 +282601,7 @@ function toInfraSessionId(id) {
282595
282601
  return id;
282596
282602
  return "cse_" + id.slice("session_".length);
282597
282603
  }
282598
- var _isCseShimEnabled;
282604
+ var _isCseShimEnabled, _gateLocked = false;
282599
282605
 
282600
282606
  // src/constants/product.ts
282601
282607
  function isRemoteSessionStaging(sessionId, ingressUrl) {
@@ -480175,6 +480181,35 @@ var init_definitions = __esm(() => {
480175
480181
  });
480176
480182
 
480177
480183
  // src/flows/executor.ts
480184
+ function sanitizeCommand(command6) {
480185
+ if (typeof command6 !== "string" || command6.trim().length === 0) {
480186
+ throw new Error("Invalid command: empty or non-string command");
480187
+ }
480188
+ const parsed = import_shell_quote4.parse(command6);
480189
+ const argv = [];
480190
+ for (const node of parsed) {
480191
+ if (typeof node === "string") {
480192
+ if (/[`$<>|;&\\\n\r]/.test(node)) {
480193
+ throw new Error(`Invalid command: shell metacharacter in token "${node}" is not allowed: "${command6}"`);
480194
+ }
480195
+ argv.push(node);
480196
+ continue;
480197
+ }
480198
+ if (node && typeof node === "object") {
480199
+ const kind = node.op || node.pattern || "shell metacharacter";
480200
+ throw new Error(`Invalid command: shell metacharacter/operator (${kind}) is not allowed: "${command6}"`);
480201
+ }
480202
+ throw new Error(`Invalid command: unexpected token in command: "${command6}"`);
480203
+ }
480204
+ if (argv.length === 0) {
480205
+ throw new Error("Invalid command: no program specified");
480206
+ }
480207
+ const program = argv[0];
480208
+ if (!ALLOWED_COMMANDS.has(program)) {
480209
+ throw new Error(`Invalid command: program "${program}" is not on the allowlist of permitted commands`);
480210
+ }
480211
+ return argv;
480212
+ }
480178
480213
  async function executeFlow(flow, context2, onStepStart, onStepComplete, onStepFail, onComplete) {
480179
480214
  const state = {
480180
480215
  currentStepIndex: 0,
@@ -480209,7 +480244,11 @@ async function executeFlow(flow, context2, onStepStart, onStepComplete, onStepFa
480209
480244
  } catch (error52) {
480210
480245
  state.failedSteps.push(step.id);
480211
480246
  if (onStepFail) {
480212
- await onStepFail(step, state, error52);
480247
+ try {
480248
+ await onStepFail(step, state, error52);
480249
+ } catch (callbackError) {
480250
+ console.error(`onStepFail callback failed for step "${step.id}":`, callbackError);
480251
+ }
480213
480252
  }
480214
480253
  const shouldContinue = await shouldContinueOnError(error52, step);
480215
480254
  if (!shouldContinue) {
@@ -480218,13 +480257,18 @@ async function executeFlow(flow, context2, onStepStart, onStepComplete, onStepFa
480218
480257
  }
480219
480258
  }
480220
480259
  if (onComplete) {
480221
- await onComplete(state);
480260
+ try {
480261
+ await onComplete(state);
480262
+ } catch (callbackError) {
480263
+ console.error("onComplete callback failed:", callbackError);
480264
+ }
480222
480265
  }
480223
480266
  return state;
480224
480267
  }
480225
480268
  async function executeCommand(command6, context2) {
480269
+ const argv = sanitizeCommand(command6);
480226
480270
  if (context2?.bridge?.runCommand) {
480227
- await context2.bridge.runCommand(command6);
480271
+ await context2.bridge.runCommand(argv);
480228
480272
  return;
480229
480273
  }
480230
480274
  throw new Error("No bridge.runCommand available to execute: " + command6);
@@ -480237,13 +480281,39 @@ async function executeFileOperation(file2, context2) {
480237
480281
  throw new Error("No bridge.editFile available to edit: " + file2);
480238
480282
  }
480239
480283
  async function shouldContinueOnError(error52, step) {
480240
- const errorMessages2 = [
480241
- "EACCES",
480242
- "ENOENT",
480243
- "ETIMEDOUT"
480244
- ];
480245
- return errorMessages2.some((msg) => error52.message.includes(msg));
480284
+ const transientCodes = ["ETIMEDOUT"];
480285
+ const err2 = error52;
480286
+ if (err2.code && transientCodes.includes(err2.code)) {
480287
+ return true;
480288
+ }
480289
+ if (transientCodes.some((code) => error52.message.includes(code))) {
480290
+ return true;
480291
+ }
480292
+ if (error52.message.includes("No bridge")) {
480293
+ return true;
480294
+ }
480295
+ return false;
480246
480296
  }
480297
+ var import_shell_quote4, ALLOWED_COMMANDS;
480298
+ var init_executor = __esm(() => {
480299
+ import_shell_quote4 = __toESM(require_shell_quote(), 1);
480300
+ ALLOWED_COMMANDS = new Set([
480301
+ "npm",
480302
+ "npx",
480303
+ "node",
480304
+ "bun",
480305
+ "yarn",
480306
+ "pnpm",
480307
+ "mkdir",
480308
+ "touch",
480309
+ "cp",
480310
+ "mv",
480311
+ "echo",
480312
+ "git",
480313
+ "tsc",
480314
+ "vitest"
480315
+ ]);
480316
+ });
480247
480317
 
480248
480318
  // src/commands/flow.ts
480249
480319
  function getPromptContent3(args) {
@@ -480301,6 +480371,7 @@ var ALLOWED_TOOLS3, command6, flow_default;
480301
480371
  var init_flow = __esm(() => {
480302
480372
  init_attribution();
480303
480373
  init_definitions();
480374
+ init_executor();
480304
480375
  ALLOWED_TOOLS3 = [
480305
480376
  "Bash(*)",
480306
480377
  "Edit(*)",
@@ -540704,7 +540775,7 @@ function createSearcher(pattern, options) {
540704
540775
  }
540705
540776
  return new BitapSearch(pattern, options);
540706
540777
  }
540707
- function parse14(query3, options, { auto = true } = {}) {
540778
+ function parse15(query3, options, { auto = true } = {}) {
540708
540779
  const next = (query4) => {
540709
540780
  let keys2 = Object.keys(query4);
540710
540781
  const isQueryPath = isPath(query4);
@@ -540891,7 +540962,7 @@ class Fuse {
540891
540962
  return results;
540892
540963
  }
540893
540964
  _searchLogical(query3) {
540894
- const expression = parse14(query3, this.options);
540965
+ const expression = parse15(query3, this.options);
540895
540966
  const evaluate = (node, item, idx) => {
540896
540967
  if (!node.children) {
540897
540968
  const { keyId, searcher } = node;
@@ -541269,7 +541340,7 @@ var init_fuse = __esm(() => {
541269
541340
  Fuse.parseIndex = parseIndex;
541270
541341
  Fuse.config = Config2;
541271
541342
  {
541272
- Fuse.parseQuery = parse14;
541343
+ Fuse.parseQuery = parse15;
541273
541344
  }
541274
541345
  {
541275
541346
  register(ExtendedSearch);
@@ -582788,7 +582859,7 @@ async function initReplBridge(options) {
582788
582859
  if (generated && gen === genSeq && lastBridgeSessionId === bridgeSessionId && !getCurrentSessionTitle(getSessionId())) {
582789
582860
  patch2(generated, bridgeSessionId, atCount);
582790
582861
  }
582791
- });
582862
+ }).catch(() => {});
582792
582863
  };
582793
582864
  const onUserMessage = (text2, bridgeSessionId) => {
582794
582865
  if (hasExplicitTitle || getCurrentSessionTitle(getSessionId())) {
package/dist/myclaude.mjs CHANGED
@@ -4,8 +4,8 @@
4
4
  // MACRO - build-time constants (injected by build.ts)
5
5
  // MACRO injected by build script
6
6
  globalThis.MACRO = {
7
- VERSION: "0.1.270",
8
- BUILD_TIME: "2026-08-17T03:53:05.312Z",
7
+ VERSION: "0.1.275",
8
+ BUILD_TIME: "2026-08-18T07:41:26.160Z",
9
9
  PACKAGE_URL: "@funnycode/myclaude",
10
10
  NATIVE_PACKAGE_URL: "@funnycode/myclaude",
11
11
  VERSION_CHANGELOG: '',
@@ -120027,7 +120027,7 @@ var package_default;
120027
120027
  var init_package = __esm(() => {
120028
120028
  package_default = {
120029
120029
  name: "@funnycode/myclaude",
120030
- version: "0.1.270",
120030
+ version: "0.1.275",
120031
120031
  private: false,
120032
120032
  description: "An open-source AI coding assistant in your terminal - powered by Claude",
120033
120033
  license: "MIT",
@@ -282571,15 +282571,21 @@ __export(exports_sessionIdCompat, {
282571
282571
  toInfraSessionId: () => toInfraSessionId,
282572
282572
  toCompatSessionId: () => toCompatSessionId,
282573
282573
  setCseShimGate: () => setCseShimGate,
282574
- resetCseShimGateForTesting: () => resetCseShimGateForTesting
282574
+ resetCseShimGateForTesting: () => resetCseShimGateForTesting,
282575
+ getCseShimGate: () => getCseShimGate
282575
282576
  });
282576
282577
  function setCseShimGate(gate) {
282577
- if (_isCseShimEnabled === undefined) {
282578
- _isCseShimEnabled = gate;
282579
- }
282578
+ if (_gateLocked)
282579
+ return;
282580
+ _gateLocked = true;
282581
+ _isCseShimEnabled = gate;
282582
+ }
282583
+ function getCseShimGate() {
282584
+ return _isCseShimEnabled;
282580
282585
  }
282581
282586
  function resetCseShimGateForTesting() {
282582
282587
  _isCseShimEnabled = undefined;
282588
+ _gateLocked = false;
282583
282589
  }
282584
282590
  function toCompatSessionId(id) {
282585
282591
  if (!id.startsWith("cse_"))
@@ -282595,7 +282601,7 @@ function toInfraSessionId(id) {
282595
282601
  return id;
282596
282602
  return "cse_" + id.slice("session_".length);
282597
282603
  }
282598
- var _isCseShimEnabled;
282604
+ var _isCseShimEnabled, _gateLocked = false;
282599
282605
 
282600
282606
  // src/constants/product.ts
282601
282607
  function isRemoteSessionStaging(sessionId, ingressUrl) {
@@ -480175,6 +480181,35 @@ var init_definitions = __esm(() => {
480175
480181
  });
480176
480182
 
480177
480183
  // src/flows/executor.ts
480184
+ function sanitizeCommand(command6) {
480185
+ if (typeof command6 !== "string" || command6.trim().length === 0) {
480186
+ throw new Error("Invalid command: empty or non-string command");
480187
+ }
480188
+ const parsed = import_shell_quote4.parse(command6);
480189
+ const argv = [];
480190
+ for (const node of parsed) {
480191
+ if (typeof node === "string") {
480192
+ if (/[`$<>|;&\\\n\r]/.test(node)) {
480193
+ throw new Error(`Invalid command: shell metacharacter in token "${node}" is not allowed: "${command6}"`);
480194
+ }
480195
+ argv.push(node);
480196
+ continue;
480197
+ }
480198
+ if (node && typeof node === "object") {
480199
+ const kind = node.op || node.pattern || "shell metacharacter";
480200
+ throw new Error(`Invalid command: shell metacharacter/operator (${kind}) is not allowed: "${command6}"`);
480201
+ }
480202
+ throw new Error(`Invalid command: unexpected token in command: "${command6}"`);
480203
+ }
480204
+ if (argv.length === 0) {
480205
+ throw new Error("Invalid command: no program specified");
480206
+ }
480207
+ const program = argv[0];
480208
+ if (!ALLOWED_COMMANDS.has(program)) {
480209
+ throw new Error(`Invalid command: program "${program}" is not on the allowlist of permitted commands`);
480210
+ }
480211
+ return argv;
480212
+ }
480178
480213
  async function executeFlow(flow, context2, onStepStart, onStepComplete, onStepFail, onComplete) {
480179
480214
  const state = {
480180
480215
  currentStepIndex: 0,
@@ -480209,7 +480244,11 @@ async function executeFlow(flow, context2, onStepStart, onStepComplete, onStepFa
480209
480244
  } catch (error52) {
480210
480245
  state.failedSteps.push(step.id);
480211
480246
  if (onStepFail) {
480212
- await onStepFail(step, state, error52);
480247
+ try {
480248
+ await onStepFail(step, state, error52);
480249
+ } catch (callbackError) {
480250
+ console.error(`onStepFail callback failed for step "${step.id}":`, callbackError);
480251
+ }
480213
480252
  }
480214
480253
  const shouldContinue = await shouldContinueOnError(error52, step);
480215
480254
  if (!shouldContinue) {
@@ -480218,13 +480257,18 @@ async function executeFlow(flow, context2, onStepStart, onStepComplete, onStepFa
480218
480257
  }
480219
480258
  }
480220
480259
  if (onComplete) {
480221
- await onComplete(state);
480260
+ try {
480261
+ await onComplete(state);
480262
+ } catch (callbackError) {
480263
+ console.error("onComplete callback failed:", callbackError);
480264
+ }
480222
480265
  }
480223
480266
  return state;
480224
480267
  }
480225
480268
  async function executeCommand(command6, context2) {
480269
+ const argv = sanitizeCommand(command6);
480226
480270
  if (context2?.bridge?.runCommand) {
480227
- await context2.bridge.runCommand(command6);
480271
+ await context2.bridge.runCommand(argv);
480228
480272
  return;
480229
480273
  }
480230
480274
  throw new Error("No bridge.runCommand available to execute: " + command6);
@@ -480237,13 +480281,39 @@ async function executeFileOperation(file2, context2) {
480237
480281
  throw new Error("No bridge.editFile available to edit: " + file2);
480238
480282
  }
480239
480283
  async function shouldContinueOnError(error52, step) {
480240
- const errorMessages2 = [
480241
- "EACCES",
480242
- "ENOENT",
480243
- "ETIMEDOUT"
480244
- ];
480245
- return errorMessages2.some((msg) => error52.message.includes(msg));
480284
+ const transientCodes = ["ETIMEDOUT"];
480285
+ const err2 = error52;
480286
+ if (err2.code && transientCodes.includes(err2.code)) {
480287
+ return true;
480288
+ }
480289
+ if (transientCodes.some((code) => error52.message.includes(code))) {
480290
+ return true;
480291
+ }
480292
+ if (error52.message.includes("No bridge")) {
480293
+ return true;
480294
+ }
480295
+ return false;
480246
480296
  }
480297
+ var import_shell_quote4, ALLOWED_COMMANDS;
480298
+ var init_executor = __esm(() => {
480299
+ import_shell_quote4 = __toESM(require_shell_quote(), 1);
480300
+ ALLOWED_COMMANDS = new Set([
480301
+ "npm",
480302
+ "npx",
480303
+ "node",
480304
+ "bun",
480305
+ "yarn",
480306
+ "pnpm",
480307
+ "mkdir",
480308
+ "touch",
480309
+ "cp",
480310
+ "mv",
480311
+ "echo",
480312
+ "git",
480313
+ "tsc",
480314
+ "vitest"
480315
+ ]);
480316
+ });
480247
480317
 
480248
480318
  // src/commands/flow.ts
480249
480319
  function getPromptContent3(args) {
@@ -480301,6 +480371,7 @@ var ALLOWED_TOOLS3, command6, flow_default;
480301
480371
  var init_flow = __esm(() => {
480302
480372
  init_attribution();
480303
480373
  init_definitions();
480374
+ init_executor();
480304
480375
  ALLOWED_TOOLS3 = [
480305
480376
  "Bash(*)",
480306
480377
  "Edit(*)",
@@ -540704,7 +540775,7 @@ function createSearcher(pattern, options) {
540704
540775
  }
540705
540776
  return new BitapSearch(pattern, options);
540706
540777
  }
540707
- function parse14(query3, options, { auto = true } = {}) {
540778
+ function parse15(query3, options, { auto = true } = {}) {
540708
540779
  const next = (query4) => {
540709
540780
  let keys2 = Object.keys(query4);
540710
540781
  const isQueryPath = isPath(query4);
@@ -540891,7 +540962,7 @@ class Fuse {
540891
540962
  return results;
540892
540963
  }
540893
540964
  _searchLogical(query3) {
540894
- const expression = parse14(query3, this.options);
540965
+ const expression = parse15(query3, this.options);
540895
540966
  const evaluate = (node, item, idx) => {
540896
540967
  if (!node.children) {
540897
540968
  const { keyId, searcher } = node;
@@ -541269,7 +541340,7 @@ var init_fuse = __esm(() => {
541269
541340
  Fuse.parseIndex = parseIndex;
541270
541341
  Fuse.config = Config2;
541271
541342
  {
541272
- Fuse.parseQuery = parse14;
541343
+ Fuse.parseQuery = parse15;
541273
541344
  }
541274
541345
  {
541275
541346
  register(ExtendedSearch);
@@ -582788,7 +582859,7 @@ async function initReplBridge(options) {
582788
582859
  if (generated && gen === genSeq && lastBridgeSessionId === bridgeSessionId && !getCurrentSessionTitle(getSessionId())) {
582789
582860
  patch2(generated, bridgeSessionId, atCount);
582790
582861
  }
582791
- });
582862
+ }).catch(() => {});
582792
582863
  };
582793
582864
  const onUserMessage = (text2, bridgeSessionId) => {
582794
582865
  if (hasExplicitTitle || getCurrentSessionTitle(getSessionId())) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@funnycode/myclaude",
3
- "version": "0.1.270",
3
+ "version": "0.1.275",
4
4
  "private": false,
5
5
  "description": "An open-source AI coding assistant in your terminal - powered by Claude",
6
6
  "license": "MIT",