@cnwenf/occ 2.1.302 → 2.1.303

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 +26 -14
  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.302","BINARY_NAME":"occ","BUILD_TIME":"2026-08-15T18:40:50.843Z","FEEDBACK_CHANNEL":"","ISSUES_EXPLAINER":"","NATIVE_PACKAGE_URL":"","PACKAGE_URL":"@cnwenf/occ","VERSION_CHANGELOG":""};
2
+ globalThis.MACRO={"VERSION":"2.1.303","BINARY_NAME":"occ","BUILD_TIME":"2026-08-16T18:17:52.609Z","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;
@@ -230980,7 +230980,7 @@ function substituteUserConfigVariables(value, userConfig) {
230980
230980
  return String(configValue);
230981
230981
  });
230982
230982
  }
230983
- function substituteUserConfigInContent(content, options, schema) {
230983
+ function substituteUserConfigInContent(content, options, schema, valueTransform) {
230984
230984
  return content.replace(/\$\{user_config\.([^}]+)\}/g, (match, key2) => {
230985
230985
  if (schema[key2]?.sensitive === true) {
230986
230986
  return `[sensitive option '${key2}' not available in skill content]`;
@@ -230989,7 +230989,7 @@ function substituteUserConfigInContent(content, options, schema) {
230989
230989
  if (value === undefined) {
230990
230990
  return match;
230991
230991
  }
230992
- return String(value);
230992
+ return valueTransform ? valueTransform(String(value)) : String(value);
230993
230993
  });
230994
230994
  }
230995
230995
  var loadPluginOptions;
@@ -607154,14 +607154,15 @@ function generateProgressiveArgumentHint(argNames, typedArgs) {
607154
607154
  return;
607155
607155
  return remaining.map((name3) => `[${name3}]`).join(" ");
607156
607156
  }
607157
- function substituteArguments(content, args, appendIfNoPlaceholder = true, argumentNames = []) {
607157
+ function substituteArguments(content, args, appendIfNoPlaceholder = true, argumentNames = [], valueTransform) {
607158
607158
  if (args === undefined || args === null) {
607159
607159
  return content;
607160
607160
  }
607161
607161
  let work = content.replaceAll(SHIELDED_DOLLAR, SENTINEL_REPLACEMENT).replaceAll(VALUE_BOUNDARY, SENTINEL_REPLACEMENT);
607162
607162
  const insertValue = (value) => {
607163
607163
  const sanitized = (value ?? "").replaceAll(SHIELDED_DOLLAR, SENTINEL_REPLACEMENT).replaceAll(VALUE_BOUNDARY, SENTINEL_REPLACEMENT);
607164
- return VALUE_BOUNDARY + sanitized.replaceAll("$", SHIELDED_DOLLAR) + VALUE_BOUNDARY;
607164
+ const transformed = valueTransform ? valueTransform(sanitized) : sanitized;
607165
+ return VALUE_BOUNDARY + transformed.replaceAll("$", SHIELDED_DOLLAR) + VALUE_BOUNDARY;
607165
607166
  };
607166
607167
  const parsedArgs = parseArguments2(args);
607167
607168
  const namedArgs = argumentNames.map((name3, index2) => ({ name: name3, index: index2 })).filter((entry) => Boolean(entry.name)).sort((left2, right2) => right2.name.length - left2.name.length);
@@ -607212,6 +607213,15 @@ var init_argumentSubstitution = __esm(() => {
607212
607213
 
607213
607214
  // src/utils/promptShellExecution.ts
607214
607215
  import { randomUUID as randomUUID30 } from "crypto";
607216
+ function escapeShellExecutionMarkers(value) {
607217
+ return value.replace(/`!/g, "` !").replace(/!`/g, "! `").replace(/(^|\s)!/gm, "$1\\!");
607218
+ }
607219
+ function escapeAngleBrackets(value) {
607220
+ return value.replaceAll("<", "&lt;").replaceAll(">", "&gt;");
607221
+ }
607222
+ function sanitizeUsername(value) {
607223
+ return value.replace(/[^a-zA-Z0-9._-]/g, "");
607224
+ }
607215
607225
  function isSkillShellExecutionDisabled() {
607216
607226
  if (getSettingsForSource("policySettings")?.disableSkillShellExecution === true) {
607217
607227
  return true;
@@ -607543,7 +607553,7 @@ function createSkillCommand({
607543
607553
  let finalContent = baseDir ? `Base directory for this skill: ${baseDir}
607544
607554
 
607545
607555
  ${markdownContent}` : markdownContent;
607546
- finalContent = substituteArguments(finalContent, args, true, argumentNames);
607556
+ finalContent = substituteArguments(finalContent, args, true, argumentNames, loadedFrom === "mcp" ? (value) => escapeAngleBrackets(escapeShellExecutionMarkers(value)) : escapeShellExecutionMarkers);
607547
607557
  if (baseDir) {
607548
607558
  const skillDir = process.platform === "win32" ? baseDir.replace(/\\/g, "/") : baseDir;
607549
607559
  finalContent = finalContent.replace(/\$\{CLAUDE_SKILL_DIR\}/g, skillDir);
@@ -608299,13 +608309,13 @@ function createPluginCommand(commandName, file2, sourceName, pluginManifest, plu
608299
608309
  let finalContent = config7.isSkillMode ? `Base directory for this skill: ${dirname51(file2.filePath)}
608300
608310
 
608301
608311
  ${content}` : content;
608302
- finalContent = substituteArguments(finalContent, args, true, argumentNames);
608312
+ finalContent = substituteArguments(finalContent, args, true, argumentNames, escapeShellExecutionMarkers);
608303
608313
  finalContent = substitutePluginVariables(finalContent, {
608304
608314
  path: pluginPath,
608305
608315
  source: sourceName
608306
608316
  });
608307
608317
  if (pluginManifest.userConfig) {
608308
- finalContent = substituteUserConfigInContent(finalContent, loadPluginOptions(sourceName), pluginManifest.userConfig);
608318
+ finalContent = substituteUserConfigInContent(finalContent, loadPluginOptions(sourceName), pluginManifest.userConfig, escapeShellExecutionMarkers);
608309
608319
  }
608310
608320
  if (config7.isSkillMode) {
608311
608321
  const rawSkillDir = dirname51(file2.filePath);
@@ -644881,7 +644891,8 @@ var init_color3 = __esm(() => {
644881
644891
 
644882
644892
  // src/commands/commit.ts
644883
644893
  function getPromptContent() {
644884
- const { commit: commitAttribution } = getAttributionTexts();
644894
+ const { commit: rawCommitAttribution } = getAttributionTexts();
644895
+ const commitAttribution = escapeShellExecutionMarkers(rawCommitAttribution);
644885
644896
  let prefix = "";
644886
644897
  if (process.env.USER_TYPE === "ant" && isUndercover()) {
644887
644898
  prefix = getUndercoverInstructions() + `
@@ -645881,10 +645892,11 @@ var init_desktop2 = __esm(() => {
645881
645892
 
645882
645893
  // src/commands/commit-push-pr.ts
645883
645894
  function getPromptContent2(defaultBranch, prAttribution) {
645884
- const { commit: commitAttribution, pr: defaultPrAttribution } = getAttributionTexts();
645885
- const effectivePrAttribution = prAttribution ?? defaultPrAttribution;
645886
- const safeUser = process.env.SAFEUSER || "";
645887
- const username = process.env.USER || "";
645895
+ const { commit: rawCommitAttribution, pr: defaultPrAttribution } = getAttributionTexts();
645896
+ const commitAttribution = escapeShellExecutionMarkers(rawCommitAttribution);
645897
+ const effectivePrAttribution = escapeShellExecutionMarkers(prAttribution ?? defaultPrAttribution);
645898
+ const safeUser = sanitizeUsername(process.env.SAFEUSER || "");
645899
+ const username = sanitizeUsername(process.env.USER || "");
645888
645900
  let prefix = "";
645889
645901
  let reviewerArg = " and `--reviewer anthropics/claude-code`";
645890
645902
  let addReviewerArg = " (and add `--add-reviewer anthropics/claude-code`)";
@@ -646002,7 +646014,7 @@ var init_commit_push_pr = __esm(() => {
646002
646014
 
646003
646015
  ## Additional instructions from user
646004
646016
 
646005
- ${trimmedArgs}`;
646017
+ ${escapeShellExecutionMarkers(trimmedArgs)}`;
646006
646018
  }
646007
646019
  const finalContent = await executeShellCommandsInPrompt(promptContent, {
646008
646020
  ...context7,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cnwenf/occ",
3
- "version": "2.1.302",
3
+ "version": "2.1.303",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "bin": {