rulesync 43.10.0 → 43.11.0

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.
@@ -382,36 +382,36 @@ function formatError(error) {
382
382
  return boundErrorMessage(String(error));
383
383
  }
384
384
  // src/constants/rulesync-paths.ts
385
- const { join: join$358 } = node_path.posix;
385
+ const { join: join$359 } = node_path.posix;
386
386
  const RULESYNC_CONFIG_RELATIVE_FILE_PATH = "rulesync.jsonc";
387
387
  const RULESYNC_LOCAL_CONFIG_RELATIVE_FILE_PATH = "rulesync.local.jsonc";
388
388
  const RULESYNC_USER_CONFIG_DIR_NAME = "rulesync";
389
389
  const RULESYNC_XDG_CONFIG_HOME_DEFAULT_DIR_NAME = ".config";
390
390
  const RULESYNC_RELATIVE_DIR_PATH = ".rulesync";
391
391
  const RULES_FEATURE_SUBDIR = "rules";
392
- const CURATED_RULES_FEATURE_SUBDIR = join$358(RULES_FEATURE_SUBDIR, ".curated");
392
+ const CURATED_RULES_FEATURE_SUBDIR = join$359(RULES_FEATURE_SUBDIR, ".curated");
393
393
  const COMMANDS_FEATURE_SUBDIR = "commands";
394
394
  const SUBAGENTS_FEATURE_SUBDIR = "subagents";
395
395
  const CHECKS_FEATURE_SUBDIR = "checks";
396
396
  const SKILLS_FEATURE_SUBDIR = "skills";
397
- const CURATED_SKILLS_FEATURE_SUBDIR = join$358(SKILLS_FEATURE_SUBDIR, ".curated");
398
- const RULESYNC_RULES_RELATIVE_DIR_PATH = join$358(RULESYNC_RELATIVE_DIR_PATH, RULES_FEATURE_SUBDIR);
399
- const RULESYNC_CURATED_RULES_RELATIVE_DIR_PATH = join$358(RULESYNC_RELATIVE_DIR_PATH, CURATED_RULES_FEATURE_SUBDIR);
400
- const RULESYNC_COMMANDS_RELATIVE_DIR_PATH = join$358(RULESYNC_RELATIVE_DIR_PATH, COMMANDS_FEATURE_SUBDIR);
401
- const RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH = join$358(RULESYNC_RELATIVE_DIR_PATH, SUBAGENTS_FEATURE_SUBDIR);
402
- const RULESYNC_CHECKS_RELATIVE_DIR_PATH = join$358(RULESYNC_RELATIVE_DIR_PATH, CHECKS_FEATURE_SUBDIR);
403
- const RULESYNC_MCP_RELATIVE_FILE_PATH = join$358(RULESYNC_RELATIVE_DIR_PATH, "mcp.jsonc");
404
- const RULESYNC_HOOKS_RELATIVE_FILE_PATH = join$358(RULESYNC_RELATIVE_DIR_PATH, "hooks.jsonc");
405
- const RULESYNC_PERMISSIONS_RELATIVE_FILE_PATH = join$358(RULESYNC_RELATIVE_DIR_PATH, "permissions.jsonc");
406
- join$358(RULESYNC_RELATIVE_DIR_PATH, "mcp.json");
407
- const RULESYNC_HOOKS_LEGACY_RELATIVE_FILE_PATH = join$358(RULESYNC_RELATIVE_DIR_PATH, "hooks.json");
408
- const RULESYNC_PERMISSIONS_LEGACY_RELATIVE_FILE_PATH = join$358(RULESYNC_RELATIVE_DIR_PATH, "permissions.json");
397
+ const CURATED_SKILLS_FEATURE_SUBDIR = join$359(SKILLS_FEATURE_SUBDIR, ".curated");
398
+ const RULESYNC_RULES_RELATIVE_DIR_PATH = join$359(RULESYNC_RELATIVE_DIR_PATH, RULES_FEATURE_SUBDIR);
399
+ const RULESYNC_CURATED_RULES_RELATIVE_DIR_PATH = join$359(RULESYNC_RELATIVE_DIR_PATH, CURATED_RULES_FEATURE_SUBDIR);
400
+ const RULESYNC_COMMANDS_RELATIVE_DIR_PATH = join$359(RULESYNC_RELATIVE_DIR_PATH, COMMANDS_FEATURE_SUBDIR);
401
+ const RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH = join$359(RULESYNC_RELATIVE_DIR_PATH, SUBAGENTS_FEATURE_SUBDIR);
402
+ const RULESYNC_CHECKS_RELATIVE_DIR_PATH = join$359(RULESYNC_RELATIVE_DIR_PATH, CHECKS_FEATURE_SUBDIR);
403
+ const RULESYNC_MCP_RELATIVE_FILE_PATH = join$359(RULESYNC_RELATIVE_DIR_PATH, "mcp.jsonc");
404
+ const RULESYNC_HOOKS_RELATIVE_FILE_PATH = join$359(RULESYNC_RELATIVE_DIR_PATH, "hooks.jsonc");
405
+ const RULESYNC_PERMISSIONS_RELATIVE_FILE_PATH = join$359(RULESYNC_RELATIVE_DIR_PATH, "permissions.jsonc");
406
+ join$359(RULESYNC_RELATIVE_DIR_PATH, "mcp.json");
407
+ const RULESYNC_HOOKS_LEGACY_RELATIVE_FILE_PATH = join$359(RULESYNC_RELATIVE_DIR_PATH, "hooks.json");
408
+ const RULESYNC_PERMISSIONS_LEGACY_RELATIVE_FILE_PATH = join$359(RULESYNC_RELATIVE_DIR_PATH, "permissions.json");
409
409
  const RULESYNC_AIIGNORE_FILE_NAME = ".aiignore";
410
- const RULESYNC_AIIGNORE_RELATIVE_FILE_PATH = join$358(RULESYNC_RELATIVE_DIR_PATH, ".aiignore");
410
+ const RULESYNC_AIIGNORE_RELATIVE_FILE_PATH = join$359(RULESYNC_RELATIVE_DIR_PATH, ".aiignore");
411
411
  const RULESYNC_IGNORE_RELATIVE_FILE_PATH = ".rulesyncignore";
412
412
  const RULESYNC_OVERVIEW_FILE_NAME = "overview.md";
413
- const RULESYNC_SKILLS_RELATIVE_DIR_PATH = join$358(RULESYNC_RELATIVE_DIR_PATH, SKILLS_FEATURE_SUBDIR);
414
- const RULESYNC_CURATED_SKILLS_RELATIVE_DIR_PATH = join$358(RULESYNC_RELATIVE_DIR_PATH, CURATED_SKILLS_FEATURE_SUBDIR);
413
+ const RULESYNC_SKILLS_RELATIVE_DIR_PATH = join$359(RULESYNC_RELATIVE_DIR_PATH, SKILLS_FEATURE_SUBDIR);
414
+ const RULESYNC_CURATED_SKILLS_RELATIVE_DIR_PATH = join$359(RULESYNC_RELATIVE_DIR_PATH, CURATED_SKILLS_FEATURE_SUBDIR);
415
415
  const RULESYNC_SOURCES_LOCK_RELATIVE_FILE_PATH = "rulesync.lock";
416
416
  const RULESYNC_NPM_SOURCES_LOCK_RELATIVE_FILE_PATH = "rulesync-npm.lock.json";
417
417
  const RULESYNC_MCP_FILE_NAME = "mcp.jsonc";
@@ -764,6 +764,7 @@ const subagentsProcessorToolTargetTuple = [
764
764
  "kiro-ide",
765
765
  "lettacode",
766
766
  "mimocode",
767
+ "musecode",
767
768
  "omp",
768
769
  "opencode",
769
770
  "opencodev1",
@@ -5194,6 +5195,8 @@ const HookDefinitionSchema = zod_mini.z.looseObject({
5194
5195
  tool: zod_mini.z.optional(safeString),
5195
5196
  input: zod_mini.z.optional(zod_mini.z.looseObject({})),
5196
5197
  model: zod_mini.z.optional(safeString),
5198
+ tools: zod_mini.z.optional(zod_mini.z.array(safeString)),
5199
+ maxTurns: zod_mini.z.optional(zod_mini.z.int().check((0, zod_mini.positive)())),
5197
5200
  args: zod_mini.z.optional(zod_mini.z.array(safeString)),
5198
5201
  metadata: zod_mini.z.optional(zod_mini.z.looseObject({})),
5199
5202
  source: zod_mini.z.optional(zod_mini.z.looseObject({
@@ -8553,15 +8556,15 @@ const CursorPermissionsOverrideSchema = zod_mini.z.looseObject({
8553
8556
  * `tools` (`approvalMode` = plan/default/auto-edit/auto/yolo, `autoAccept`,
8554
8557
  * `sandbox`, `sandboxImage`, `disabled`, `visible`, `eager`, `listDirectory`,
8555
8558
  * `todoWrite`, `codeModeOnly`, `freeform`, `workflowsEnabled`, `workflowNameOnly`,
8556
- * `executionSandbox`) and
8559
+ * `executionSandbox`, `lspEnabled`) and
8557
8560
  * `security` (`folderTrust`, `allowedHttpHookUrls`, `allowPrivateNetworkHooks`,
8558
8561
  * `allowedInsecureVoiceBaseUrls`) and `skills` (the skill kill-switches
8559
8562
  * `disabled`, `defaultDisabled`, `enabled`, `disabledLevels`, each a list Qwen
8560
8563
  * Code unions across scopes) and `general` (`outputStyle`, the output style
8561
8564
  * that reshapes how responses are written). Qwen Code strips `tools.workflowsEnabled`,
8562
- * `tools.executionSandbox`, `security.allowPrivateNetworkHooks` and
8565
+ * `tools.executionSandbox`, `tools.lspEnabled`, `security.allowPrivateNetworkHooks` and
8563
8566
  * `security.allowedInsecureVoiceBaseUrls` out of workspace settings, so generate
8564
- * skips those four in project scope and announces a granting value in global
8567
+ * skips those five in project scope and announces a granting value in global
8565
8568
  * scope (any `executionSandbox` change counts). `tools.workflowNameOnly` is
8566
8569
  * written in both scopes, but a workspace may only turn it on, which the
8567
8570
  * project-scope note says. `security.allowedHttpHookUrls` (honored in a workspace only while no
@@ -8728,8 +8731,10 @@ const ReasonixPermissionsOverrideSchema = zod_mini.z.looseObject({
8728
8731
  * holds: `general.defaultPermissionMode`, `tools.core` / `tools.exclude`, the
8729
8732
  * MCP approval and loading keys under `mcp` (`allowed`, `excluded`,
8730
8733
  * `enableAllProjectMcpServers`, `enabledProjectMcpServers`, `lazyLoad`),
8731
- * `agents.overrides`, the top-level `agentsMdExcludes` and the top-level
8732
- * `autoMode` classifier guidance (`allow` / `soft_deny` / `environment`).
8734
+ * `agents.overrides`, `security.disableYoloMode` (turns off the
8735
+ * `bypass_permissions` / YOLO mode; it only hardens, so it is not announced),
8736
+ * the top-level `agentsMdExcludes` and the top-level `autoMode` classifier
8737
+ * guidance (`allow` / `soft_deny` / `environment`).
8733
8738
  * Qoder reads `autoMode` from the user settings only, so it is written by
8734
8739
  * `--global` generate alone. Only the keys listed here are written; any other
8735
8740
  * key of these groups or of `autoMode` (`tools.shell.pager`,
@@ -8763,6 +8768,7 @@ const QoderPermissionsOverrideSchema = zod_mini.z.looseObject({
8763
8768
  lazyLoad: zod_mini.z.optional(zod_mini.z.boolean())
8764
8769
  })),
8765
8770
  agents: zod_mini.z.optional(zod_mini.z.looseObject({ overrides: zod_mini.z.optional(zod_mini.z.record(zod_mini.z.string(), zod_mini.z.looseObject({}))) })),
8771
+ security: zod_mini.z.optional(zod_mini.z.looseObject({ disableYoloMode: zod_mini.z.optional(zod_mini.z.boolean()) })),
8766
8772
  autoMode: zod_mini.z.optional(zod_mini.z.looseObject({
8767
8773
  allow: zod_mini.z.optional(zod_mini.z.array(zod_mini.z.string())),
8768
8774
  soft_deny: zod_mini.z.optional(zod_mini.z.array(zod_mini.z.string())),
@@ -9239,7 +9245,9 @@ const ANTIGRAVITY_CLI_ARTIFACT_REVIEW_POLICIES = [
9239
9245
  * import filter for the same reason as {@link ANTIGRAVITY_CLI_TOOL_PERMISSIONS}.
9240
9246
  * `auto` (Preview) requires the terminal sandbox (`enableTerminalSandbox`), is
9241
9247
  * not offered to business or enterprise accounts, and falls back to `default`
9242
- * when unavailable.
9248
+ * when unavailable. Canonical `default` is stored by the CLI as `""` (the
9249
+ * translation lives in `antigravity-cli-permissions.ts`), and since CLI 1.5.7
9250
+ * an omitted `agentMode` starts in `auto` where available.
9243
9251
  * @see https://antigravity.google/docs/cli/modes
9244
9252
  */
9245
9253
  const ANTIGRAVITY_CLI_AGENT_MODES = [
@@ -14263,6 +14271,7 @@ const SHARED_CONFIG_OWNERSHIP = {
14263
14271
  "tools",
14264
14272
  "mcp",
14265
14273
  "agents",
14274
+ "security",
14266
14275
  "autoMode",
14267
14276
  "agentsMdExcludes"
14268
14277
  ]
@@ -21077,12 +21086,25 @@ function raiseOpencodeAgentToV2(fields) {
21077
21086
  }
21078
21087
  const OPENCODE_FILE_TEMPLATE_PATTERN = /^\s*\{file:(.+?)\}\s*$/;
21079
21088
  /**
21089
+ * Resolves the path of a `{file:...}` reference the way OpenCode does: relative
21090
+ * to the config file's directory, absolute as written, or from the home
21091
+ * directory when it starts with `~/`.
21092
+ *
21093
+ * @see https://opencode.ai/docs/config/#files
21094
+ */
21095
+ function resolveOpencodeFileTemplatePath({ referencedPath, configDir }) {
21096
+ if (referencedPath.startsWith("~/")) return (0, node_path.join)(getHomeDirectory(), referencedPath.slice(2));
21097
+ if ((0, node_path.isAbsolute)(referencedPath)) return referencedPath;
21098
+ return (0, node_path.join)(configDir, referencedPath);
21099
+ }
21100
+ /**
21080
21101
  * Resolves an OpenCode `{file:./path}` string reference into the referenced
21081
21102
  * file's contents. OpenCode resolves these paths relative to the config file's
21082
21103
  * location, so `configDir` must be the directory holding `opencode.json`. When
21083
21104
  * the value is not a whole-value file reference it is returned unchanged; when
21084
21105
  * the referenced file cannot be read the literal value is preserved (so the
21085
- * reference is not silently lost).
21106
+ * reference is not silently lost). As in OpenCode, an absolute path is used as
21107
+ * written and a path starting with `~/` is taken from the home directory.
21086
21108
  *
21087
21109
  * When `containmentRoot` is given (project scope), a reference whose real
21088
21110
  * location — every `..` segment and symbolic link resolved — lies outside it is
@@ -21100,7 +21122,10 @@ async function resolveOpencodeFileTemplate({ value, configDir, containmentRoot,
21100
21122
  if (!match) return value;
21101
21123
  const referencedPath = match[1]?.trim().replace(/^\.\//, "");
21102
21124
  if (!referencedPath) return value;
21103
- const targetPath = (0, node_path.join)(configDir, referencedPath);
21125
+ const targetPath = resolveOpencodeFileTemplatePath({
21126
+ referencedPath,
21127
+ configDir
21128
+ });
21104
21129
  if (containmentRoot === void 0) return await readFileContentOrNull(targetPath) ?? value;
21105
21130
  const relativePath = await resolvedRelativePath({
21106
21131
  rootPath: containmentRoot,
@@ -27726,6 +27751,8 @@ const MUSECODE_RULE_FILE_NAME = "AGENTS.md";
27726
27751
  const MUSECODE_SKILLS_DIR_PATH = AGENTSMD_SKILLS_DIR_PATH;
27727
27752
  const MUSECODE_GLOBAL_CONFIG_DIR_PATH = (0, node_path.join)(".config", "muse");
27728
27753
  const MUSECODE_GLOBAL_SKILLS_DIR_PATH = (0, node_path.join)(MUSECODE_GLOBAL_CONFIG_DIR_PATH, "skills");
27754
+ const MUSECODE_SUBAGENTS_DIR_PATH = AGENTSMD_SUBAGENTS_DIR_PATH;
27755
+ const MUSECODE_GLOBAL_SUBAGENTS_DIR_PATH = (0, node_path.join)(MUSECODE_GLOBAL_CONFIG_DIR_PATH, "agents");
27729
27756
  const MUSECODE_SETTINGS_FILE_NAME = "settings.json";
27730
27757
  // src/features/skills/musecode-skill.ts
27731
27758
  const MusecodeSkillFrontmatterSchema = zod_mini.z.looseObject({
@@ -30717,6 +30744,17 @@ const AntigravitySubagentFrontmatterSchema = zod_mini.z.looseObject({
30717
30744
  */
30718
30745
  const ANTIGRAVITY_SHARED_SUBAGENT_SECTION_KEYS = ["antigravity-ide", "antigravity-cli"];
30719
30746
  /**
30747
+ * Tool-specific rulesync sections every writer of the project
30748
+ * `.agents/agents/<name>.md` file merges, in increasing precedence order.
30749
+ *
30750
+ * Muse Code loads its project agents from the same directory, so its section
30751
+ * is merged into the shared file too, below the Antigravity blocks: a key both
30752
+ * set keeps the Antigravity value the file carried before Muse Code joined.
30753
+ * Global agents live in per-tool directories, so this list applies to the
30754
+ * project file only.
30755
+ */
30756
+ const AGENTS_DIR_SHARED_SUBAGENT_SECTION_KEYS = ["musecode", ...ANTIGRAVITY_SHARED_SUBAGENT_SECTION_KEYS];
30757
+ /**
30720
30758
  * Build the frontmatter an `.agents/agents/<name>.md` file carries.
30721
30759
  *
30722
30760
  * That path is shared: every Antigravity target writes it, and so does the
@@ -30814,11 +30852,13 @@ var AntigravitySharedSubagent = class extends ToolSubagent {
30814
30852
  * therefore merges the shared `antigravity-ide` → `antigravity-cli` sections
30815
30853
  * (the CLI block wins, matching the fixed order the MCP feature already uses
30816
30854
  * for the same shared-output reason), and the plugin target layers its own
30817
- * section on top of that. Only `getToolTarget()` decides which section an
30818
- * import writes back into.
30855
+ * section on top of that. The project file is also read by Muse Code, so in
30856
+ * project scope the `musecode` section is merged underneath (see
30857
+ * {@link AGENTS_DIR_SHARED_SUBAGENT_SECTION_KEYS}). Only `getToolTarget()`
30858
+ * decides which section an import writes back into.
30819
30859
  */
30820
- static getReadSectionKeys() {
30821
- return [...ANTIGRAVITY_SHARED_SUBAGENT_SECTION_KEYS];
30860
+ static getReadSectionKeys({ global = false } = {}) {
30861
+ return global ? [...ANTIGRAVITY_SHARED_SUBAGENT_SECTION_KEYS] : [...AGENTS_DIR_SHARED_SUBAGENT_SECTION_KEYS];
30822
30862
  }
30823
30863
  static getSettablePaths({ global = false } = {}) {
30824
30864
  return { relativeDirPath: global ? ANTIGRAVITY_GLOBAL_AGENTS_DIR_PATH : ANTIGRAVITY_AGENTS_DIR_PATH };
@@ -30848,7 +30888,7 @@ var AntigravitySharedSubagent = class extends ToolSubagent {
30848
30888
  static fromRulesyncSubagent({ outputRoot = process.cwd(), rulesyncSubagent, validate = true, global = false }) {
30849
30889
  const frontmatter = toAntigravitySubagentFrontmatter({
30850
30890
  rulesyncSubagent,
30851
- sectionKeys: this.getReadSectionKeys(),
30891
+ sectionKeys: this.getReadSectionKeys({ global }),
30852
30892
  toolTarget: this.getToolTarget()
30853
30893
  });
30854
30894
  const body = rulesyncSubagent.getBody();
@@ -31038,7 +31078,7 @@ var AgentsmdSubagent = class AgentsmdSubagent extends SimulatedSubagent {
31038
31078
  const defaults = this.fromRulesyncSubagentDefault(params);
31039
31079
  const frontmatter = toAntigravitySubagentFrontmatter({
31040
31080
  rulesyncSubagent: params.rulesyncSubagent,
31041
- sectionKeys: ANTIGRAVITY_SHARED_SUBAGENT_SECTION_KEYS,
31081
+ sectionKeys: AGENTS_DIR_SHARED_SUBAGENT_SECTION_KEYS,
31042
31082
  toolTarget: "agentsmd"
31043
31083
  });
31044
31084
  return new AgentsmdSubagent({
@@ -31101,7 +31141,7 @@ var AntigravityPluginSubagent = class extends AntigravitySharedSubagent {
31101
31141
  return "antigravity-plugin";
31102
31142
  }
31103
31143
  static getReadSectionKeys() {
31104
- return [...super.getReadSectionKeys(), "antigravity-plugin"];
31144
+ return [...ANTIGRAVITY_SHARED_SUBAGENT_SECTION_KEYS, "antigravity-plugin"];
31105
31145
  }
31106
31146
  static getSettablePaths() {
31107
31147
  return { relativeDirPath: ANTIGRAVITY_PLUGIN_AGENTS_DIR };
@@ -31445,7 +31485,7 @@ var RooSubagent = class extends ToolSubagent {
31445
31485
  * Aggregate every targeted rulesync subagent into a single `.roomodes` file.
31446
31486
  * Modes are de-duplicated by `slug` (last one wins) to keep the array unique.
31447
31487
  */
31448
- static fromRulesyncSubagents({ outputRoot = process.cwd(), rulesyncSubagents, validate = true }) {
31488
+ static fromRulesyncSubagents({ outputRoot = process.cwd(), rulesyncSubagents, validate = true, global = false }) {
31449
31489
  const bySlug = /* @__PURE__ */ new Map();
31450
31490
  for (const rulesyncSubagent of rulesyncSubagents) {
31451
31491
  const mode = this.toRooMode(rulesyncSubagent);
@@ -31453,17 +31493,19 @@ var RooSubagent = class extends ToolSubagent {
31453
31493
  }
31454
31494
  return new this({
31455
31495
  outputRoot,
31456
- relativeDirPath: this.getSettablePaths().relativeDirPath,
31496
+ relativeDirPath: this.getSettablePaths({ global }).relativeDirPath,
31457
31497
  relativeFilePath: this.modesFileName,
31458
31498
  modes: [...bySlug.values()],
31459
- validate
31499
+ validate,
31500
+ global
31460
31501
  });
31461
31502
  }
31462
- static fromRulesyncSubagent({ outputRoot = process.cwd(), rulesyncSubagent, validate = true }) {
31503
+ static fromRulesyncSubagent({ outputRoot = process.cwd(), rulesyncSubagent, validate = true, global = false }) {
31463
31504
  return this.fromRulesyncSubagents({
31464
31505
  outputRoot,
31465
31506
  rulesyncSubagents: [rulesyncSubagent],
31466
- validate
31507
+ validate,
31508
+ global
31467
31509
  });
31468
31510
  }
31469
31511
  /**
@@ -31519,8 +31561,8 @@ var RooSubagent = class extends ToolSubagent {
31519
31561
  toolTarget: "roo"
31520
31562
  });
31521
31563
  }
31522
- static async fromFile({ outputRoot = process.cwd(), relativeFilePath, validate = true }) {
31523
- const paths = this.getSettablePaths();
31564
+ static async fromFile({ outputRoot = process.cwd(), relativeFilePath, validate = true, global = false }) {
31565
+ const paths = this.getSettablePaths({ global });
31524
31566
  const filePath = (0, node_path.join)(outputRoot, paths.relativeDirPath, relativeFilePath);
31525
31567
  const fileContent = await readFileContent(filePath);
31526
31568
  let parsed;
@@ -31536,16 +31578,18 @@ var RooSubagent = class extends ToolSubagent {
31536
31578
  relativeDirPath: paths.relativeDirPath,
31537
31579
  relativeFilePath: (0, node_path.basename)(relativeFilePath),
31538
31580
  modes: result.data.customModes,
31539
- validate
31581
+ validate,
31582
+ global
31540
31583
  });
31541
31584
  }
31542
- static forDeletion({ outputRoot = process.cwd(), relativeDirPath, relativeFilePath }) {
31585
+ static forDeletion({ outputRoot = process.cwd(), relativeDirPath, relativeFilePath, global = false }) {
31543
31586
  return new this({
31544
31587
  outputRoot,
31545
31588
  relativeDirPath,
31546
31589
  relativeFilePath,
31547
31590
  modes: [],
31548
- validate: false
31591
+ validate: false,
31592
+ global
31549
31593
  });
31550
31594
  }
31551
31595
  };
@@ -31557,8 +31601,13 @@ var RooSubagent = class extends ToolSubagent {
31557
31601
  * presets `explore` and `general` — but it reads custom modes from an
31558
31602
  * aggregated `customModes` YAML file in Roo's format, so every targeted rulesync
31559
31603
  * subagent becomes one mode in `.bob/custom_modes.yaml`, exactly as the `roo`
31560
- * target fills `.roomodes`. Only the project file is emitted: the Bob IDE and
31561
- * Bob Shell docs name different global files.
31604
+ * target fills `.roomodes`. In global mode the same array goes to
31605
+ * `~/.bob/settings/custom_modes.yaml`, the user file both the Bob IDE and Bob
31606
+ * Shell custom-modes pages name. That file is unversioned and Bob IDE's "Edit
31607
+ * Global Modes" setting writes it too, so rulesync does not own it: a global
31608
+ * generate merges the generated modes into it by `slug`, keeps every other
31609
+ * mode, and the file is never deleted. The project file stays wholly owned by
31610
+ * rulesync, like Roo's `.roomodes`.
31562
31611
  *
31563
31612
  * The mode fields ride a `bob:` frontmatter section rather than Roo's `roo:`
31564
31613
  * one, because Bob's tool groups are spelled differently (`execute` where Roo
@@ -31575,7 +31624,7 @@ var RooSubagent = class extends ToolSubagent {
31575
31624
  * @see https://bob.ibm.com/docs/shell/configuration/custom-modes-bobshell
31576
31625
  * @see https://bob.ibm.com/docs/ide/features/subagents
31577
31626
  */
31578
- var BobSubagent = class extends RooSubagent {
31627
+ var BobSubagent = class BobSubagent extends RooSubagent {
31579
31628
  static modesFileName = BOB_CUSTOM_MODES_FILE_NAME;
31580
31629
  static modeSectionKey = "bob";
31581
31630
  static defaultGroups = [
@@ -31585,12 +31634,74 @@ var BobSubagent = class extends RooSubagent {
31585
31634
  "mcp"
31586
31635
  ];
31587
31636
  static importTarget = "bob";
31588
- static getSettablePaths(_options = {}) {
31637
+ static getSettablePaths({ global = false } = {}) {
31589
31638
  return {
31590
- relativeDirPath: BOB_DIR,
31639
+ relativeDirPath: global ? BOB_GLOBAL_SETTINGS_DIR_PATH : BOB_DIR,
31591
31640
  relativeFilePath: BOB_CUSTOM_MODES_FILE_NAME
31592
31641
  };
31593
31642
  }
31643
+ /** Receives the merge warnings; set by {@link BobSubagent.fromRulesyncSubagents}. */
31644
+ bobLogger;
31645
+ static fromRulesyncSubagents(params) {
31646
+ const subagent = super.fromRulesyncSubagents(params);
31647
+ if (subagent instanceof BobSubagent) subagent.bobLogger = params.logger;
31648
+ return subagent;
31649
+ }
31650
+ isDeletable() {
31651
+ return !this.global;
31652
+ }
31653
+ shouldMergeExistingFileContent() {
31654
+ return this.global;
31655
+ }
31656
+ /**
31657
+ * Merge the generated modes into the existing global file: a mode whose
31658
+ * `slug` rulesync generates is replaced in place, every other entry is kept
31659
+ * as written, and new modes are appended. A file that cannot be read as a
31660
+ * `customModes` document is an error rather than something to overwrite.
31661
+ */
31662
+ setFileContent(existingContent) {
31663
+ if (!this.global) {
31664
+ super.setFileContent(existingContent);
31665
+ return;
31666
+ }
31667
+ const filePath = (0, node_path.join)(this.getOutputRoot(), this.getRelativeDirPath(), this.getRelativeFilePath());
31668
+ let parsed;
31669
+ try {
31670
+ parsed = loadYaml(existingContent);
31671
+ } catch (error) {
31672
+ throw new Error(`Failed to parse custom modes (${filePath}); not overwriting it: ${formatError(error)}`, { cause: error });
31673
+ }
31674
+ const existingModes = isRecord(parsed) ? parsed.customModes : void 0;
31675
+ if (!(parsed === null || parsed === void 0 || isRecord(parsed)) || !(existingModes === null || existingModes === void 0 || Array.isArray(existingModes))) throw new Error(`Invalid custom modes in ${filePath}; not overwriting it: expected a "customModes" list.`);
31676
+ const generatedModes = this.getModes();
31677
+ const generatedSlugs = new Set(generatedModes.map((mode) => mode.slug));
31678
+ const pending = new Map(generatedModes.map((mode) => [mode.slug, mode]));
31679
+ const duplicateSlugs = /* @__PURE__ */ new Set();
31680
+ const merged = [];
31681
+ for (const entry of Array.isArray(existingModes) ? existingModes : []) {
31682
+ const slug = isRecord(entry) ? entry.slug : void 0;
31683
+ if (typeof slug !== "string" || !generatedSlugs.has(slug)) {
31684
+ merged.push(entry);
31685
+ continue;
31686
+ }
31687
+ const mode = pending.get(slug);
31688
+ if (mode === void 0) {
31689
+ duplicateSlugs.add(slug);
31690
+ continue;
31691
+ }
31692
+ merged.push(mode);
31693
+ pending.delete(slug);
31694
+ }
31695
+ merged.push(...pending.values());
31696
+ if (duplicateSlugs.size > 0) this.bobLogger?.warn(`Removed duplicate Bob custom mode(s) ${[...duplicateSlugs].map(quoteValueForWarning).join(", ")} from ${filePath}: rulesync generates these slugs and keeps only one entry for each.`);
31697
+ super.setFileContent((0, js_yaml.dump)({
31698
+ ...isRecord(parsed) ? parsed : {},
31699
+ customModes: merged
31700
+ }, {
31701
+ lineWidth: -1,
31702
+ noRefs: true
31703
+ }));
31704
+ }
31594
31705
  static isTargetedByRulesyncSubagent(rulesyncSubagent) {
31595
31706
  return this.isTargetedByRulesyncSubagentDefault({
31596
31707
  rulesyncSubagent,
@@ -35234,11 +35345,19 @@ const LettacodeSubagentFrontmatterSchema = zod_mini.z.looseObject({
35234
35345
  */
35235
35346
  const LETTACODE_AGENT_NAME_PATTERN = /^[a-z][a-z0-9-]*$/;
35236
35347
  /**
35237
- * Names Letta Code keeps for its external-agent launchers: a custom subagent
35238
- * by one of these names is skipped when agents are loaded
35239
- * (`RESERVED_EXTERNAL_SUBAGENT_NAMES` in `src/agent/subagents/index.ts`).
35348
+ * Names a custom subagent cannot take: Letta Code skips it when agents are
35349
+ * loaded. These are the external-agent launcher names
35350
+ * (`RESERVED_EXTERNAL_SUBAGENT_NAMES` in `src/agent/subagents/index.ts`)
35351
+ * plus `memory`, which the same loader also skips (as of letta-code v0.34.66).
35240
35352
  */
35241
- const LETTACODE_RESERVED_AGENT_NAMES = /* @__PURE__ */ new Set(["claude-code", "codex"]);
35353
+ const LETTACODE_RESERVED_AGENT_NAMES = /* @__PURE__ */ new Set([
35354
+ "letta",
35355
+ "claude-code",
35356
+ "codex",
35357
+ "opencode",
35358
+ "cursor",
35359
+ "memory"
35360
+ ]);
35242
35361
  /**
35243
35362
  * The subagent is still generated as authored — the name is the user's to
35244
35363
  * change, and a rename here would make it diverge from the other targets —
@@ -35660,6 +35779,87 @@ var OpenCodeSubagent = class extends OpenCodeStyleSubagent {
35660
35779
  var MimocodeSubagent = class extends OpenCodeSubagent {
35661
35780
  static layout = MIMOCODE_LAYOUT;
35662
35781
  };
35782
+ // src/features/subagents/musecode-subagent.ts
35783
+ /**
35784
+ * Muse Code agent names are lowercase words joined by single hyphens
35785
+ * (`test-writer`).
35786
+ *
35787
+ * @see https://dev.meta.ai/docs/muse-code/agents
35788
+ */
35789
+ const MUSECODE_AGENT_NAME_PATTERN = /^[a-z]+(?:-[a-z]+)*$/;
35790
+ /**
35791
+ * The frontmatter keys the Muse Code agents page documents.
35792
+ *
35793
+ * @see https://dev.meta.ai/docs/muse-code/agents
35794
+ */
35795
+ const MUSECODE_DOCUMENTED_FRONTMATTER_KEYS = /* @__PURE__ */ new Set([
35796
+ "name",
35797
+ "description",
35798
+ "model",
35799
+ "effort",
35800
+ "tools",
35801
+ "disallowedTools"
35802
+ ]);
35803
+ /**
35804
+ * Meta Muse Code custom agent (subagent): a Markdown file with YAML
35805
+ * frontmatter (`name`, `description`, and optionally `model`, `effort`,
35806
+ * `tools`, `disallowedTools`) whose body is the agent's prompt.
35807
+ *
35808
+ * Project agents load from `.agents/agents/`, the directory the Antigravity
35809
+ * targets and the simulated `agentsmd` writer already generate into, so the
35810
+ * project file is rendered exactly like theirs (the `musecode` section is part
35811
+ * of the merge every writer of that file performs) and the file on disk does
35812
+ * not depend on which target ran last. User agents load from
35813
+ * `~/.config/muse/agents/`, which only this target writes, so only the
35814
+ * `musecode` section is merged there.
35815
+ *
35816
+ * @see https://dev.meta.ai/docs/muse-code/agents
35817
+ */
35818
+ var MusecodeSubagent = class extends AntigravitySharedSubagent {
35819
+ static getToolTarget() {
35820
+ return "musecode";
35821
+ }
35822
+ static getReadSectionKeys({ global = false } = {}) {
35823
+ return global ? ["musecode"] : super.getReadSectionKeys({ global });
35824
+ }
35825
+ static getSettablePaths({ global = false } = {}) {
35826
+ return { relativeDirPath: global ? MUSECODE_GLOBAL_SUBAGENTS_DIR_PATH : MUSECODE_SUBAGENTS_DIR_PATH };
35827
+ }
35828
+ static fromRulesyncSubagent(params) {
35829
+ const name = params.rulesyncSubagent.getFrontmatter().name;
35830
+ if (!MUSECODE_AGENT_NAME_PATTERN.test(name)) params.logger?.warn(`Muse Code subagent name '${name}' in ${params.rulesyncSubagent.getRelativeFilePath()} is not lowercase words joined by single hyphens (e.g. 'test-writer'); Muse Code may not load it.`);
35831
+ const subagent = super.fromRulesyncSubagent(params);
35832
+ if (!params.global && subagent instanceof AntigravitySharedSubagent) this.warnAboutSharedProjectFile({
35833
+ params,
35834
+ subagent
35835
+ });
35836
+ return subagent;
35837
+ }
35838
+ /**
35839
+ * The project file is shared with the Antigravity writers, so its content
35840
+ * cannot be narrowed to what Muse Code documents. Say so instead when the
35841
+ * merged file differs from what the `musecode` block alone would produce.
35842
+ */
35843
+ static warnAboutSharedProjectFile({ params, subagent }) {
35844
+ const { logger, rulesyncSubagent } = params;
35845
+ const relativeFilePath = rulesyncSubagent.getRelativeFilePath();
35846
+ const undocumentedKeys = Object.keys(subagent.getFrontmatter()).filter((key) => !MUSECODE_DOCUMENTED_FRONTMATTER_KEYS.has(key));
35847
+ if (undocumentedKeys.length > 0) logger?.warn(`Muse Code subagent ${relativeFilePath}: the shared .agents/agents/ file carries keys Muse Code does not document (${undocumentedKeys.join(", ")}), set in a musecode or antigravity-* block; Muse Code may refuse to load the agent.`);
35848
+ const rulesyncFrontmatter = rulesyncSubagent.getFrontmatter();
35849
+ const musecodeSection = rulesyncFrontmatter.musecode;
35850
+ if (!isPlainObject(musecodeSection)) return;
35851
+ for (const key of Object.keys(musecodeSection)) {
35852
+ if (key === "name" || key === "description") continue;
35853
+ const overridingSection = ANTIGRAVITY_SHARED_SUBAGENT_SECTION_KEYS.toReversed().find((sectionKey) => {
35854
+ const section = rulesyncFrontmatter[sectionKey];
35855
+ return isPlainObject(section) && section[key] !== void 0;
35856
+ });
35857
+ if (overridingSection === void 0) continue;
35858
+ const overridingValue = rulesyncFrontmatter[overridingSection][key];
35859
+ if (!(0, node_util.isDeepStrictEqual)(overridingValue, musecodeSection[key])) logger?.warn(`Muse Code subagent ${relativeFilePath}: '${key}' from the musecode block is overridden by the ${overridingSection} block in the shared .agents/agents/ file.`);
35860
+ }
35861
+ }
35862
+ };
35663
35863
  // src/features/subagents/omp-subagent.ts
35664
35864
  /**
35665
35865
  * Frontmatter of an oh-my-pi agent definition (`parseAgentFields` in
@@ -37433,7 +37633,7 @@ const toolSubagentFactories = /* @__PURE__ */ new Map([
37433
37633
  meta: {
37434
37634
  supportsProject: true,
37435
37635
  supportsSimulated: false,
37436
- supportsGlobal: false,
37636
+ supportsGlobal: true,
37437
37637
  filePattern: "custom_modes.yaml"
37438
37638
  }
37439
37639
  }],
@@ -37711,6 +37911,15 @@ const toolSubagentFactories = /* @__PURE__ */ new Map([
37711
37911
  filePattern: "*.md"
37712
37912
  }
37713
37913
  }],
37914
+ ["musecode", {
37915
+ class: MusecodeSubagent,
37916
+ meta: {
37917
+ supportsProject: true,
37918
+ supportsSimulated: false,
37919
+ supportsGlobal: true,
37920
+ filePattern: "*.md"
37921
+ }
37922
+ }],
37714
37923
  ["omp", {
37715
37924
  class: OmpSubagent,
37716
37925
  meta: {
@@ -41761,18 +41970,20 @@ var AugmentcodePluginRule = class extends AugmentcodeRule {
41761
41970
  return { nonRoot: { relativeDirPath: AUGMENTCODE_PLUGIN_RULES_DIR } };
41762
41971
  }
41763
41972
  /**
41764
- * Auggie 1.x (still a prerelease on npm at the time of writing; the stable
41765
- * line is 0.36.0) no longer loads `rules/` from plugins: "Rules shipped in
41766
- * plugins (`rules/` in a plugin)" is listed among the removed features, while
41767
- * commands, agents, skills, hooks and MCP servers still load. The rule files
41768
- * are still written, because the stable 0.x CLI reads them, but under 1.x the
41769
- * bundle silently loses them, so say so.
41973
+ * Auggie 1.x (the stable line on npm `latest` since 1.2.0; 0.x is kept only
41974
+ * on the `v0-release` tag with auto-update turned off) no longer loads
41975
+ * `rules/` from plugins: "Rules shipped in plugins (`rules/` in a plugin)" is
41976
+ * listed among the removed features, while commands, agents, skills, hooks
41977
+ * and MCP servers still load. The rule files are still written for users
41978
+ * pinned to 0.x, which reads them, but under 1.x the bundle silently loses
41979
+ * them, so say so.
41770
41980
  * @see https://docs.augmentcode.com/cli/whats-new
41981
+ * @see https://www.augmentcode.com/changelog
41771
41982
  * @see https://docs.augmentcode.com/cli/v0/plugins
41772
41983
  */
41773
41984
  static async getGenerationWarnings({ toolRules }) {
41774
41985
  if (toolRules.length === 0) return [];
41775
- return [`augmentcode-plugin: plugin rules (rules/*.md) are loaded by Auggie 0.x only; Auggie 1.x no longer reads rules/ from plugins, so these ${toolRules.length} rule file(s) have no effect there. Ship instructions that must reach Auggie 1.x users as a skill, or have them generate the augmentcode target in their project.`];
41986
+ return [`augmentcode-plugin: plugin rules (rules/*.md) are loaded by Auggie 0.x only; Auggie 1.x no longer reads rules/ from plugins, so these ${toolRules.length} rule file(s) reach only users pinned to Auggie 0.x (1.x is the stable CLI since 1.2.0). Ship instructions that must reach Auggie 1.x users as a skill, or have them generate the augmentcode target in their project.`];
41776
41987
  }
41777
41988
  };
41778
41989
  // src/features/rules/bob-rule.ts
@@ -53895,13 +54106,29 @@ function isEventApplicable({ events, eventName }) {
53895
54106
  function describeEvents(names) {
53896
54107
  return [...names].map((name) => `"${name}"`).join(", ");
53897
54108
  }
54109
+ const COMMAND_HOOK_TYPES = /* @__PURE__ */ new Set(["command"]);
53898
54110
  /**
53899
- * Whether a field registered for `command` hooks only applies to this hook.
53900
- * Applied on both export and import: a value imported into a canonical field
53901
- * the exporter would then drop is silently deleted on the next generate.
54111
+ * The hook types a field is documented on, or `undefined` when unrestricted.
54112
+ * `commandOnly` is shorthand for `command` alone.
53902
54113
  */
53903
- function isFieldApplicable({ commandOnly, hookType }) {
53904
- return commandOnly !== true || hookType === "command";
54114
+ function documentedHookTypes({ commandOnly, hookTypes }) {
54115
+ return commandOnly === true ? COMMAND_HOOK_TYPES : hookTypes;
54116
+ }
54117
+ /** Quote the hook types a restricted field is documented on, for a warning. */
54118
+ function describeDocumentedHookTypes(spec) {
54119
+ return describeEvents(documentedHookTypes(spec) ?? COMMAND_HOOK_TYPES);
54120
+ }
54121
+ /**
54122
+ * Whether a field registered for some hook types only (`command` hooks, or
54123
+ * the listed `hookTypes`) applies to this hook. Applied on both export and
54124
+ * import: a value imported into a canonical field the exporter would then
54125
+ * drop is silently deleted on the next generate.
54126
+ */
54127
+ function isFieldApplicable({ commandOnly, hookTypes, hookType }) {
54128
+ return documentedHookTypes({
54129
+ commandOnly,
54130
+ hookTypes
54131
+ })?.has(hookType) ?? true;
53905
54132
  }
53906
54133
  /**
53907
54134
  * Emit the configured passthrough fields on the tool side, mapping each
@@ -53916,14 +54143,18 @@ function isFieldApplicable({ commandOnly, hookType }) {
53916
54143
  * silence — the mirror of the import side.
53917
54144
  */
53918
54145
  function emitPassthroughFields({ def, hookType, eventName, fields, isValid, warn }) {
53919
- for (const { canonical, tool, commandOnly, maxLength, collapseWhitespaceForLength, onlyWithFlag, events } of fields) {
54146
+ for (const { canonical, tool, commandOnly, hookTypes, maxLength, collapseWhitespaceForLength, onlyWithFlag, events } of fields) {
53920
54147
  const value = def[canonical];
53921
54148
  if (value === void 0) continue;
53922
54149
  if (!isFieldApplicable({
53923
54150
  commandOnly,
54151
+ hookTypes,
53924
54152
  hookType
53925
54153
  })) {
53926
- warn?.(`Dropping "${canonical}" from a "${hookType}" hook on "${eventName}": this tool documents "${tool}" on "command" hooks only, so it is not generated.`);
54154
+ warn?.(`Dropping "${canonical}" from a "${hookType}" hook on "${eventName}": this tool documents "${tool}" on ${describeDocumentedHookTypes({
54155
+ commandOnly,
54156
+ hookTypes
54157
+ })} hooks only, so it is not generated.`);
53927
54158
  continue;
53928
54159
  }
53929
54160
  if (events !== void 0 && !isEventApplicable({
@@ -53946,8 +54177,9 @@ function emitPassthroughFields({ def, hookType, eventName, fields, isValid, warn
53946
54177
  if (length > maxLength) warn?.(`"${canonical}" on a "${hookType}" hook on "${eventName}" is ${length} characters long${collapseWhitespaceForLength ? " after collapsing whitespace" : ""}; this tool caps "${tool}" at ${maxLength} characters and will shorten it.`);
53947
54178
  }
53948
54179
  }
53949
- return Object.fromEntries(fields.filter(({ canonical, commandOnly, events }) => isFieldApplicable({
54180
+ return Object.fromEntries(fields.filter(({ canonical, commandOnly, hookTypes, events }) => isFieldApplicable({
53950
54181
  commandOnly,
54182
+ hookTypes,
53951
54183
  hookType
53952
54184
  }) && isEventApplicable({
53953
54185
  events,
@@ -53965,19 +54197,24 @@ function emitPassthroughFields({ def, hookType, eventName, fields, isValid, warn
53965
54197
  * value into a warning instead of a silent drop.
53966
54198
  */
53967
54199
  function importPassthroughFields({ h, hookType, eventName, fields, isValid, describeInvalid, warn }) {
53968
- const typeApplicable = fields.filter(({ commandOnly }) => isFieldApplicable({
54200
+ const typeApplicable = fields.filter(({ commandOnly, hookTypes }) => isFieldApplicable({
53969
54201
  commandOnly,
54202
+ hookTypes,
53970
54203
  hookType
53971
54204
  }));
53972
54205
  const applicable = typeApplicable.filter(({ events }) => isEventApplicable({
53973
54206
  events,
53974
54207
  eventName
53975
54208
  }));
53976
- const skipped = fields.filter(({ commandOnly }) => !isFieldApplicable({
54209
+ const skipped = fields.filter(({ commandOnly, hookTypes }) => !isFieldApplicable({
53977
54210
  commandOnly,
54211
+ hookTypes,
53978
54212
  hookType
53979
54213
  }));
53980
- for (const { tool } of skipped) if (h[tool] !== void 0) warn?.(`Dropping "${tool}" from an imported "${hookType}" hook: this tool documents it on "command" hooks only, so it is not imported.`);
54214
+ for (const { tool, commandOnly, hookTypes } of skipped) if (h[tool] !== void 0) warn?.(`Dropping "${tool}" from an imported "${hookType}" hook: this tool documents it on ${describeDocumentedHookTypes({
54215
+ commandOnly,
54216
+ hookTypes
54217
+ })} hooks only, so it is not imported.`);
53981
54218
  for (const { tool, events } of typeApplicable) if (events !== void 0 && !isEventApplicable({
53982
54219
  events,
53983
54220
  eventName
@@ -54151,13 +54388,13 @@ function isKeywordFieldApplicable({ spec, hookType, eventName, flags, direction,
54151
54388
  const field = direction === "generated" ? canonical : tool;
54152
54389
  if (!isFieldApplicable({
54153
54390
  commandOnly,
54391
+ hookTypes,
54154
54392
  hookType
54155
54393
  })) {
54156
- warn?.(`Dropping "${field}" from a "${hookType}" hook on "${eventName}": this tool documents "${tool}" on "command" hooks only, so it is not ${direction}.`);
54157
- return false;
54158
- }
54159
- if (hookTypes !== void 0 && !hookTypes.has(hookType)) {
54160
- warn?.(`Dropping "${field}" from a "${hookType}" hook on "${eventName}": this tool documents "${tool}" on ${describeEvents(hookTypes)} hooks only, so it is not ${direction}.`);
54394
+ warn?.(`Dropping "${field}" from a "${hookType}" hook on "${eventName}": this tool documents "${tool}" on ${describeDocumentedHookTypes({
54395
+ commandOnly,
54396
+ hookTypes
54397
+ })} hooks only, so it is not ${direction}.`);
54161
54398
  return false;
54162
54399
  }
54163
54400
  if (events !== void 0 && !events.has(eventName)) {
@@ -58304,6 +58541,15 @@ function normalizeCrushEventName(event) {
58304
58541
  /** Crush tool events, by normalized spelling, on which a `matcher` is valid. */
58305
58542
  const NORMALIZED_CRUSH_TOOL_EVENTS = new Set(CRUSH_TOOL_EVENTS.map((event) => normalizeCrushEventName(event)));
58306
58543
  /**
58544
+ * Every event Crush fires, by normalized spelling: the twelve with a canonical
58545
+ * counterpart plus `PermissionResult`, which is a tool event. Crush refuses to
58546
+ * load the whole config when a `hooks` key names any other event
58547
+ * ("hook <key>: unknown event").
58548
+ * @see https://github.com/charmbracelet/crush/blob/v0.102.0/internal/hooks/events.go
58549
+ * @see https://github.com/charmbracelet/crush/blob/v0.102.0/internal/config/hooks.go
58550
+ */
58551
+ const NORMALIZED_KNOWN_CRUSH_EVENTS = new Set([...Object.values(CANONICAL_TO_CRUSH_EVENT_NAMES), ...CRUSH_TOOL_EVENTS].map((event) => normalizeCrushEventName(event)));
58552
+ /**
58307
58553
  * Resolve a `crush.hooks` override key to the canonical event it names, or
58308
58554
  * null when it names no canonical event. The key may be spelled the canonical
58309
58555
  * way (`stop`) or in any spelling Crush accepts for the event (`TurnEnd`,
@@ -58332,11 +58578,13 @@ function resolveOverrideCanonicalEvent(key) {
58332
58578
  * spelling it uses: the override replaces the shared entries of that event
58333
58579
  * (as for every other tool's override), and override keys that name the same
58334
58580
  * event are concatenated in order, the way Crush itself merges them. A key
58335
- * that names no canonical event — such as `PermissionResult`, or one an
58336
- * import filed there — is written verbatim so it round-trips; keys of that
58337
- * kind that Crush reads as the same event are concatenated under the first
58338
- * spelling. A `matcher` is only written on a tool event: Crush rejects the
58339
- * whole config when one appears anywhere else.
58581
+ * that names a Crush event with no canonical counterpart (`PermissionResult`)
58582
+ * is written verbatim so it round-trips; keys of that kind that Crush reads as
58583
+ * the same event are concatenated under the first spelling. A key that names
58584
+ * no Crush event at all (such as the Claude Code spelling `Stop`) is skipped
58585
+ * with a warning, since Crush would refuse to load the whole config. A
58586
+ * `matcher` is only written on a tool event: Crush rejects the whole config
58587
+ * when one appears anywhere else.
58340
58588
  */
58341
58589
  function canonicalToCrushHooks({ config, toolOverride, logger }) {
58342
58590
  const shared = /* @__PURE__ */ new Map();
@@ -58359,6 +58607,10 @@ function canonicalToCrushHooks({ config, toolOverride, logger }) {
58359
58607
  }) ?? key;
58360
58608
  else {
58361
58609
  const normalized = normalizeCrushEventName(key);
58610
+ if (!NORMALIZED_KNOWN_CRUSH_EVENTS.has(normalized)) {
58611
+ logger?.warn(`crush.hooks event ${quoteValueForWarning(key)} is not a Crush hook event, so it was skipped — Crush refuses to load a config with an unknown hook event.`);
58612
+ continue;
58613
+ }
58362
58614
  crushEvent = verbatimSpellings.get(normalized) ?? key;
58363
58615
  verbatimSpellings.set(normalized, crushEvent);
58364
58616
  }
@@ -59089,6 +59341,18 @@ const FACTORYDROID_CONVERTER_CONFIG = {
59089
59341
  tool: "commandRegex",
59090
59342
  valueType: "string",
59091
59343
  subdividesGroup: true
59344
+ }],
59345
+ keywordPassthroughFields: [{
59346
+ canonical: "failClosed",
59347
+ tool: "onFailure",
59348
+ trueValue: "block",
59349
+ falseValue: "continue",
59350
+ events: /* @__PURE__ */ new Set([
59351
+ "preToolUse",
59352
+ "postToolUse",
59353
+ "beforeSubmitPrompt",
59354
+ "preCompact"
59355
+ ])
59092
59356
  }]
59093
59357
  };
59094
59358
  /** Droid's nine event names, the keys a standalone `hooks.json` is made of. */
@@ -62461,6 +62725,17 @@ var PoolHooks = class PoolHooks extends ToolHooks {
62461
62725
  }
62462
62726
  };
62463
62727
  // src/features/hooks/qoder-hooks.ts
62728
+ const QODER_NO_MATCHER_EVENTS = /* @__PURE__ */ new Set([
62729
+ "beforeSubmitPrompt",
62730
+ "stop",
62731
+ "cwdChanged",
62732
+ "worktreeCreate",
62733
+ "worktreeRemove",
62734
+ "taskCreated",
62735
+ "taskCompleted",
62736
+ "teammateIdle"
62737
+ ]);
62738
+ const QODER_AGENT_HOOK_TYPES = /* @__PURE__ */ new Set(["agent"]);
62464
62739
  const QODER_SPEC = {
62465
62740
  displayName: "Qoder",
62466
62741
  overrideKey: "qoder",
@@ -62470,16 +62745,7 @@ const QODER_SPEC = {
62470
62745
  toolToCanonicalEventNames: QODER_TO_CANONICAL_EVENT_NAMES,
62471
62746
  projectDirVar: "$QODER_PROJECT_DIR",
62472
62747
  prefixDotRelativeCommandsOnly: true,
62473
- noMatcherEvents: /* @__PURE__ */ new Set([
62474
- "beforeSubmitPrompt",
62475
- "stop",
62476
- "cwdChanged",
62477
- "worktreeCreate",
62478
- "worktreeRemove",
62479
- "taskCreated",
62480
- "taskCompleted",
62481
- "teammateIdle"
62482
- ]),
62748
+ noMatcherEvents: QODER_NO_MATCHER_EVENTS,
62483
62749
  supportedHookTypes: /* @__PURE__ */ new Set([
62484
62750
  "command",
62485
62751
  "http",
@@ -62536,6 +62802,15 @@ const QODER_SPEC = {
62536
62802
  canonical: "args",
62537
62803
  tool: "args",
62538
62804
  commandOnly: true
62805
+ }, {
62806
+ canonical: "tools",
62807
+ tool: "tools",
62808
+ hookTypes: QODER_AGENT_HOOK_TYPES
62809
+ }],
62810
+ numberPassthroughFields: [{
62811
+ canonical: "maxTurns",
62812
+ tool: "maxTurns",
62813
+ hookTypes: QODER_AGENT_HOOK_TYPES
62539
62814
  }],
62540
62815
  recordPassthroughFields: [{
62541
62816
  canonical: "env",
@@ -82070,6 +82345,22 @@ const ANTIGRAVITY_CLI_OVERRIDE_KEYS = [
82070
82345
  ];
82071
82346
  const moduleLogger$4 = fallbackLogger;
82072
82347
  /**
82348
+ * The value the CLI stores in `agentMode` for its Default mode. Since CLI 1.5.7
82349
+ * an omitted `agentMode` starts the CLI in `auto` where available, and the
82350
+ * documented stored values are `""` (Default), `"accept-edits"`, `"auto"` and
82351
+ * `"plan"` — there is no `"default"` string.
82352
+ * @see https://antigravity.google/docs/cli/modes
82353
+ * @see https://github.com/google-antigravity/antigravity-cli/releases/tag/1.5.7
82354
+ */
82355
+ const ANTIGRAVITY_CLI_STORED_DEFAULT_AGENT_MODE = "";
82356
+ /**
82357
+ * Translate the canonical `agentMode` override value to the value the CLI
82358
+ * stores: canonical `default` becomes `""`, other modes pass through.
82359
+ */
82360
+ function toStoredAgentMode(value) {
82361
+ return value === "default" ? ANTIGRAVITY_CLI_STORED_DEFAULT_AGENT_MODE : value;
82362
+ }
82363
+ /**
82073
82364
  * Narrow an imported `settings.json` value to one of the documented values of
82074
82365
  * an enum-typed override key. The override schema declares `toolPermission`,
82075
82366
  * `artifactReviewPolicy` and `agentMode` as `z.enum`, so carrying an
@@ -82206,7 +82497,7 @@ var AntigravityCliPermissions = class AntigravityCliPermissions extends ToolPerm
82206
82497
  const override = config["antigravity-cli"];
82207
82498
  for (const key of ANTIGRAVITY_CLI_OVERRIDE_KEYS) {
82208
82499
  const value = override?.[key];
82209
- if (value !== void 0) merged[key] = value;
82500
+ if (value !== void 0) merged[key] = key === "agentMode" ? toStoredAgentMode(value) : value;
82210
82501
  }
82211
82502
  const fileContent = JSON.stringify(merged, null, 2);
82212
82503
  return new AntigravityCliPermissions({
@@ -82250,7 +82541,7 @@ var AntigravityCliPermissions = class AntigravityCliPermissions extends ToolPerm
82250
82541
  });
82251
82542
  if (artifactReviewPolicy !== void 0) override.artifactReviewPolicy = artifactReviewPolicy;
82252
82543
  if (typeof settings.allowNonWorkspaceAccess === "boolean") override.allowNonWorkspaceAccess = settings.allowNonWorkspaceAccess;
82253
- const agentMode = pickDocumentedValue({
82544
+ const agentMode = settings.agentMode === ANTIGRAVITY_CLI_STORED_DEFAULT_AGENT_MODE ? "default" : pickDocumentedValue({
82254
82545
  key: "agentMode",
82255
82546
  value: settings.agentMode,
82256
82547
  documented: ANTIGRAVITY_CLI_AGENT_MODES
@@ -82819,8 +83110,11 @@ var AugmentcodePermissions = class AugmentcodePermissions extends ToolPermission
82819
83110
  * does nothing.
82820
83111
  *
82821
83112
  * Only Auggie 0.x reads `recommendedMarketplaces`: the 1.x plugin settings
82822
- * reference lists `enabledPlugins` alone. The key is still written because the
82823
- * stable CLI is 0.x, and the write warning says it is 0.x-only.
83113
+ * reference lists `enabledPlugins` alone, and the 1.x settings loader never
83114
+ * reads the key. 1.x is the stable CLI since 1.2.0, so the key now reaches only
83115
+ * users pinned to 0.x (npm `v0-release` with auto-update off). It is still
83116
+ * written for them, and the write warning says so.
83117
+ * @see https://www.augmentcode.com/changelog
82824
83118
  *
82825
83119
  * Both make Auggie load code the repository did not ship — a recommended
82826
83120
  * marketplace is one prompt away from being cloned, and an enabled plugin can
@@ -82841,7 +83135,7 @@ function buildPluginConsumptionPatch({ override, existing, global, logger }) {
82841
83135
  else {
82842
83136
  patch.recommendedMarketplaces = recommendedMarketplaces;
82843
83137
  const existingMarketplaces = existingKeys.recommendedMarketplaces;
82844
- if (recommendedMarketplaces.length > 0 && !(0, node_util.isDeepStrictEqual)(recommendedMarketplaces, existingMarketplaces)) logger?.warn(`Writing AugmentCode \`recommendedMarketplaces\` (${recommendedMarketplaces.map(quoteValueForWarning).join(", ")}): Auggie 0.x prompts everyone who opens this workspace to install these plugin marketplaces (Auggie 1.x no longer reads this key).`);
83138
+ if (recommendedMarketplaces.length > 0 && !(0, node_util.isDeepStrictEqual)(recommendedMarketplaces, existingMarketplaces)) logger?.warn(`Writing AugmentCode \`recommendedMarketplaces\` (${recommendedMarketplaces.map(quoteValueForWarning).join(", ")}): Auggie 0.x prompts everyone who opens this workspace to install these plugin marketplaces (Auggie 1.x no longer reads this key, so only users pinned to Auggie 0.x see the prompt).`);
82845
83139
  warnAboutRemovedPluginIds({
82846
83140
  key: "recommendedMarketplaces",
82847
83141
  removed: (existingMarketplaces ?? []).filter((marketplace) => !recommendedMarketplaces.includes(marketplace)),
@@ -96849,7 +97143,8 @@ const QODER_OVERRIDE_GROUP_KEYS = {
96849
97143
  "enabledProjectMcpServers",
96850
97144
  "lazyLoad"
96851
97145
  ],
96852
- agents: ["overrides"]
97146
+ agents: ["overrides"],
97147
+ security: ["disableYoloMode"]
96853
97148
  };
96854
97149
  const QODER_OVERRIDE_GROUPS = Object.keys(QODER_OVERRIDE_GROUP_KEYS);
96855
97150
  /**
@@ -97112,7 +97407,8 @@ function isLiftableQoderValue(key, value) {
97112
97407
  switch (key) {
97113
97408
  case "defaultPermissionMode": return typeof value === "string" && value.trim() !== "";
97114
97409
  case "enableAllProjectMcpServers":
97115
- case "lazyLoad": return typeof value === "boolean";
97410
+ case "lazyLoad":
97411
+ case "disableYoloMode": return typeof value === "boolean";
97116
97412
  case "overrides": return isRecord(value) && Object.values(value).every(isRecord);
97117
97413
  default: return isStringArray(value);
97118
97414
  }
@@ -97373,7 +97669,8 @@ const QWEN_OVERRIDE_TOOLS_KEYS = [
97373
97669
  "freeform",
97374
97670
  "workflowsEnabled",
97375
97671
  "workflowNameOnly",
97376
- "executionSandbox"
97672
+ "executionSandbox",
97673
+ "lspEnabled"
97377
97674
  ];
97378
97675
  const QWEN_OVERRIDE_SECURITY_KEYS = [
97379
97676
  "folderTrust",
@@ -97451,6 +97748,11 @@ const QWEN_SCOPED_TOOLS_KEYS = {
97451
97748
  grants: () => true,
97452
97749
  globalNote: "Qwen Code ignores this key in workspace settings so a repository cannot choose its own sandbox; in the global scope it sets the filesystem and network policy every tool command runs under for every project on this machine (a System value still replaces it, and Qwen Code needs a restart to pick it up)."
97453
97750
  },
97751
+ lspEnabled: {
97752
+ rule: "workspace-stripped",
97753
+ grants: (value) => value === true,
97754
+ globalNote: "Qwen Code ignores this key in workspace settings so a repository cannot start language servers on its own behalf; in the global scope it turns on LSP code intelligence for every project on this machine, and the servers run with your permissions. A server declared in a workspace `.lsp.json` still needs an explicitly trusted folder, LSP is refused at startup when `tools.executionSandbox` is set, and the `QWEN_CODE_ENABLE_LSP` / `QWEN_CODE_DISABLE_LSP` environment variables override this setting (disable wins)."
97755
+ },
97454
97756
  workflowNameOnly: {
97455
97757
  rule: "global-machine-wide",
97456
97758
  projectNote: ({ qualifiedKey, quotedValue, filePath }) => `${qualifiedKey} = ${quotedValue} was written to the project-scoped ${filePath}. Qwen Code lets a workspace only turn this key on: \`true\` restricts the model to named workflows in this repository, while any other value cannot lift a restriction set in user or system settings.`,