@useorgx/wizard 0.1.61 → 0.1.63

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 CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  // src/cli.ts
4
4
 
5
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="25afe0bb-abb4-54b0-9963-05fbafee7372")}catch(e){}}();
5
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="d41747ca-7c63-5e0b-83ef-90af38ff9921")}catch(e){}}();
6
6
  import * as clack from "@clack/prompts";
7
7
  import { spawnSync as spawnSync5 } from "child_process";
8
8
  import { readFileSync as readFileSync10 } from "fs";
@@ -6354,7 +6354,7 @@ function initializeWizardSentry() {
6354
6354
  Sentry.init({
6355
6355
  dsn,
6356
6356
  environment: process.env.ORGX_SENTRY_ENVIRONMENT || "production",
6357
- release: "useorgx-wizard@0.1.61",
6357
+ release: "useorgx-wizard@0.1.63",
6358
6358
  tracesSampleRate: sampleRate(process.env.ORGX_SENTRY_TRACES_SAMPLE_RATE),
6359
6359
  enableLogs: true,
6360
6360
  sendDefaultPii: false,
@@ -14560,7 +14560,7 @@ function hasOrgxHook(raw) {
14560
14560
  return Boolean(raw?.includes(HOOK_MARKER));
14561
14561
  }
14562
14562
  function codexHooksEnabled(raw) {
14563
- return Boolean(raw && /^\s*codex_hooks\s*=\s*true\s*$/m.test(raw));
14563
+ return Boolean(raw && /^\s*hooks\s*=\s*true\s*$/m.test(raw));
14564
14564
  }
14565
14565
  function codexHasNotify(raw) {
14566
14566
  return Boolean(raw && /^\s*notify\s*=/m.test(raw));
@@ -14885,11 +14885,6 @@ function mergeCodexHooks(raw, paths) {
14885
14885
  outboxPath: paths.outboxPath,
14886
14886
  sourceClient: "codex"
14887
14887
  });
14888
- const already = existing.some(
14889
- (entry) => isRecord(entry) && typeof entry.command === "string" && entry.command.includes(HOOK_MARKER)
14890
- );
14891
- const next = already ? [...existing] : [...existing, { command }];
14892
- if (!already) changed = true;
14893
14888
  const desiredSummaryCommand = buildSummaryHookCommand({
14894
14889
  deliveryCliPath: paths.deliveryCliPath,
14895
14890
  deliveryNodePath: paths.deliveryNodePath,
@@ -14899,20 +14894,74 @@ function mergeCodexHooks(raw, paths) {
14899
14894
  sourceClient: "codex",
14900
14895
  summaryHookScriptPath: paths.summaryHookScriptPath
14901
14896
  });
14902
- const summaryEntries = next.filter(
14903
- (entry) => isRecord(entry) && typeof entry.command === "string" && entry.command.includes(SUMMARY_HOOK_MARKER)
14897
+ let universal = existing.find(
14898
+ (entry) => isRecord(entry) && Array.isArray(entry.hooks) && (entry.matcher === void 0 || entry.matcher === "")
14904
14899
  );
14905
- const summaryCurrent = summaryEntries.length === 1 && isRecord(summaryEntries[0]) && summaryEntries[0].command === desiredSummaryCommand;
14906
- if (!summaryCurrent) {
14907
- const withoutStaleSummary = next.filter(
14908
- (entry) => !(isRecord(entry) && typeof entry.command === "string" && entry.command.includes(SUMMARY_HOOK_MARKER))
14909
- );
14910
- withoutStaleSummary.push({ command: desiredSummaryCommand });
14911
- hooks[event] = withoutStaleSummary;
14900
+ if (!isRecord(universal)) {
14901
+ universal = { matcher: "", hooks: [] };
14902
+ existing.push(universal);
14912
14903
  changed = true;
14913
- continue;
14914
14904
  }
14915
- hooks[event] = next;
14905
+ const universalGroup = universal;
14906
+ const desired = [
14907
+ { marker: HOOK_MARKER, command },
14908
+ { marker: SUMMARY_HOOK_MARKER, command: desiredSummaryCommand }
14909
+ ];
14910
+ const kept = /* @__PURE__ */ new Set();
14911
+ const normalized = [];
14912
+ for (const entry of existing) {
14913
+ if (!isRecord(entry)) {
14914
+ normalized.push(entry);
14915
+ continue;
14916
+ }
14917
+ const legacyCommand = entry.command;
14918
+ if (typeof legacyCommand === "string") {
14919
+ if (desired.some(({ marker }) => legacyCommand.includes(marker))) {
14920
+ changed = true;
14921
+ continue;
14922
+ }
14923
+ normalized.push(entry);
14924
+ continue;
14925
+ }
14926
+ if (!Array.isArray(entry.hooks)) {
14927
+ normalized.push(entry);
14928
+ continue;
14929
+ }
14930
+ const nextHandlers = [];
14931
+ for (const handler of entry.hooks) {
14932
+ if (!isRecord(handler)) {
14933
+ nextHandlers.push(handler);
14934
+ continue;
14935
+ }
14936
+ const handlerCommand = handler.command;
14937
+ if (typeof handlerCommand !== "string") {
14938
+ nextHandlers.push(handler);
14939
+ continue;
14940
+ }
14941
+ const target = desired.find(
14942
+ ({ marker }) => handlerCommand.includes(marker)
14943
+ );
14944
+ if (!target) {
14945
+ nextHandlers.push(handler);
14946
+ continue;
14947
+ }
14948
+ if (entry === universalGroup && handler.type === "command" && handlerCommand === target.command && !kept.has(target.marker)) {
14949
+ nextHandlers.push(handler);
14950
+ kept.add(target.marker);
14951
+ } else {
14952
+ changed = true;
14953
+ }
14954
+ }
14955
+ entry.hooks = nextHandlers;
14956
+ normalized.push(entry);
14957
+ }
14958
+ const universalHandlers = universalGroup.hooks;
14959
+ for (const target of desired) {
14960
+ if (kept.has(target.marker)) continue;
14961
+ universalHandlers.push({ type: "command", command: target.command });
14962
+ changed = true;
14963
+ }
14964
+ hooks[event] = normalized;
14916
14965
  }
14917
14966
  value.hooks = hooks;
14918
14967
  return { changed: changed || !raw, value };
@@ -14970,26 +15019,40 @@ function mergeClaudeHooks(raw, paths) {
14970
15019
  }
14971
15020
  function ensureCodexHooksFeature(raw) {
14972
15021
  const current = raw ?? "";
14973
- if (codexHooksEnabled(current)) {
14974
- return { changed: false, value: current };
15022
+ const withoutDeprecatedFlag = current.replace(
15023
+ /^\s*codex_hooks\s*=\s*(?:true|false)\s*(?:\r?\n|$)/gm,
15024
+ ""
15025
+ );
15026
+ const removedDeprecatedFlag = withoutDeprecatedFlag !== current;
15027
+ if (codexHooksEnabled(withoutDeprecatedFlag)) {
15028
+ return {
15029
+ changed: removedDeprecatedFlag,
15030
+ value: withoutDeprecatedFlag
15031
+ };
14975
15032
  }
14976
- if (/^\s*codex_hooks\s*=\s*false\s*$/m.test(current)) {
15033
+ if (/^\s*hooks\s*=\s*false\s*$/m.test(withoutDeprecatedFlag)) {
14977
15034
  return {
14978
15035
  changed: true,
14979
- value: current.replace(/^\s*codex_hooks\s*=\s*false\s*$/m, "codex_hooks = true")
15036
+ value: withoutDeprecatedFlag.replace(
15037
+ /^\s*hooks\s*=\s*false\s*$/m,
15038
+ "hooks = true"
15039
+ )
14980
15040
  };
14981
15041
  }
14982
- if (/^\s*\[features\]\s*$/m.test(current)) {
15042
+ if (/^\s*\[features\]\s*$/m.test(withoutDeprecatedFlag)) {
14983
15043
  return {
14984
15044
  changed: true,
14985
- value: current.replace(/^(\s*\[features\]\s*)$/m, "$1\ncodex_hooks = true")
15045
+ value: withoutDeprecatedFlag.replace(
15046
+ /^(\s*\[features\]\s*)$/m,
15047
+ "$1\nhooks = true"
15048
+ )
14986
15049
  };
14987
15050
  }
14988
- const suffix = current.trimEnd().length > 0 ? "\n\n" : "";
15051
+ const suffix = withoutDeprecatedFlag.trimEnd().length > 0 ? "\n\n" : "";
14989
15052
  return {
14990
15053
  changed: true,
14991
- value: `${current.trimEnd()}${suffix}[features]
14992
- codex_hooks = true
15054
+ value: `${withoutDeprecatedFlag.trimEnd()}${suffix}[features]
15055
+ hooks = true
14993
15056
  `
14994
15057
  };
14995
15058
  }
@@ -18385,7 +18448,7 @@ async function main() {
18385
18448
  initializeWizardSentry();
18386
18449
  const program = new Command();
18387
18450
  program.name("orgx-wizard").description("Add OrgX MCP configs, skills/rules, and companion plugins to your local AI tools.").showHelpAfterError();
18388
- const pkgVersion = true ? "0.1.61" : void 0;
18451
+ const pkgVersion = true ? "0.1.63" : void 0;
18389
18452
  program.version(pkgVersion ?? "unknown", "-V, --version");
18390
18453
  program.hook("preAction", (_thisCommand, actionCommand) => {
18391
18454
  if (Boolean(actionCommand.optsWithGlobals().json)) return;
@@ -19429,4 +19492,4 @@ main().catch(async (error) => {
19429
19492
  process.exitCode = 1;
19430
19493
  });
19431
19494
  //# sourceMappingURL=cli.js.map
19432
- //# debugId=25afe0bb-abb4-54b0-9963-05fbafee7372
19495
+ //# debugId=d41747ca-7c63-5e0b-83ef-90af38ff9921