rulesync 43.10.1 → 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.
- package/README.md +2 -2
- package/dist/cli/index.cjs +4 -4
- package/dist/cli/index.js +4 -4
- package/dist/cli/index.js.map +1 -1
- package/dist/{import-DT6BSklJ.cjs → import-1cdCo1uU.cjs} +335 -77
- package/dist/{import-fiaj0fDK.js → import-BVWVIY-6.js} +320 -62
- package/dist/{import-fiaj0fDK.js.map → import-BVWVIY-6.js.map} +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
|
@@ -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$
|
|
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$
|
|
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$
|
|
398
|
-
const RULESYNC_RULES_RELATIVE_DIR_PATH = join$
|
|
399
|
-
const RULESYNC_CURATED_RULES_RELATIVE_DIR_PATH = join$
|
|
400
|
-
const RULESYNC_COMMANDS_RELATIVE_DIR_PATH = join$
|
|
401
|
-
const RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH = join$
|
|
402
|
-
const RULESYNC_CHECKS_RELATIVE_DIR_PATH = join$
|
|
403
|
-
const RULESYNC_MCP_RELATIVE_FILE_PATH = join$
|
|
404
|
-
const RULESYNC_HOOKS_RELATIVE_FILE_PATH = join$
|
|
405
|
-
const RULESYNC_PERMISSIONS_RELATIVE_FILE_PATH = join$
|
|
406
|
-
join$
|
|
407
|
-
const RULESYNC_HOOKS_LEGACY_RELATIVE_FILE_PATH = join$
|
|
408
|
-
const RULESYNC_PERMISSIONS_LEGACY_RELATIVE_FILE_PATH = join$
|
|
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$
|
|
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$
|
|
414
|
-
const RULESYNC_CURATED_SKILLS_RELATIVE_DIR_PATH = join$
|
|
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
|
|
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`,
|
|
8732
|
-
* `
|
|
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
|
]
|
|
@@ -27742,6 +27751,8 @@ const MUSECODE_RULE_FILE_NAME = "AGENTS.md";
|
|
|
27742
27751
|
const MUSECODE_SKILLS_DIR_PATH = AGENTSMD_SKILLS_DIR_PATH;
|
|
27743
27752
|
const MUSECODE_GLOBAL_CONFIG_DIR_PATH = (0, node_path.join)(".config", "muse");
|
|
27744
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");
|
|
27745
27756
|
const MUSECODE_SETTINGS_FILE_NAME = "settings.json";
|
|
27746
27757
|
// src/features/skills/musecode-skill.ts
|
|
27747
27758
|
const MusecodeSkillFrontmatterSchema = zod_mini.z.looseObject({
|
|
@@ -30733,6 +30744,17 @@ const AntigravitySubagentFrontmatterSchema = zod_mini.z.looseObject({
|
|
|
30733
30744
|
*/
|
|
30734
30745
|
const ANTIGRAVITY_SHARED_SUBAGENT_SECTION_KEYS = ["antigravity-ide", "antigravity-cli"];
|
|
30735
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
|
+
/**
|
|
30736
30758
|
* Build the frontmatter an `.agents/agents/<name>.md` file carries.
|
|
30737
30759
|
*
|
|
30738
30760
|
* That path is shared: every Antigravity target writes it, and so does the
|
|
@@ -30830,11 +30852,13 @@ var AntigravitySharedSubagent = class extends ToolSubagent {
|
|
|
30830
30852
|
* therefore merges the shared `antigravity-ide` → `antigravity-cli` sections
|
|
30831
30853
|
* (the CLI block wins, matching the fixed order the MCP feature already uses
|
|
30832
30854
|
* for the same shared-output reason), and the plugin target layers its own
|
|
30833
|
-
* section on top of that.
|
|
30834
|
-
*
|
|
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.
|
|
30835
30859
|
*/
|
|
30836
|
-
static getReadSectionKeys() {
|
|
30837
|
-
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];
|
|
30838
30862
|
}
|
|
30839
30863
|
static getSettablePaths({ global = false } = {}) {
|
|
30840
30864
|
return { relativeDirPath: global ? ANTIGRAVITY_GLOBAL_AGENTS_DIR_PATH : ANTIGRAVITY_AGENTS_DIR_PATH };
|
|
@@ -30864,7 +30888,7 @@ var AntigravitySharedSubagent = class extends ToolSubagent {
|
|
|
30864
30888
|
static fromRulesyncSubagent({ outputRoot = process.cwd(), rulesyncSubagent, validate = true, global = false }) {
|
|
30865
30889
|
const frontmatter = toAntigravitySubagentFrontmatter({
|
|
30866
30890
|
rulesyncSubagent,
|
|
30867
|
-
sectionKeys: this.getReadSectionKeys(),
|
|
30891
|
+
sectionKeys: this.getReadSectionKeys({ global }),
|
|
30868
30892
|
toolTarget: this.getToolTarget()
|
|
30869
30893
|
});
|
|
30870
30894
|
const body = rulesyncSubagent.getBody();
|
|
@@ -31054,7 +31078,7 @@ var AgentsmdSubagent = class AgentsmdSubagent extends SimulatedSubagent {
|
|
|
31054
31078
|
const defaults = this.fromRulesyncSubagentDefault(params);
|
|
31055
31079
|
const frontmatter = toAntigravitySubagentFrontmatter({
|
|
31056
31080
|
rulesyncSubagent: params.rulesyncSubagent,
|
|
31057
|
-
sectionKeys:
|
|
31081
|
+
sectionKeys: AGENTS_DIR_SHARED_SUBAGENT_SECTION_KEYS,
|
|
31058
31082
|
toolTarget: "agentsmd"
|
|
31059
31083
|
});
|
|
31060
31084
|
return new AgentsmdSubagent({
|
|
@@ -31117,7 +31141,7 @@ var AntigravityPluginSubagent = class extends AntigravitySharedSubagent {
|
|
|
31117
31141
|
return "antigravity-plugin";
|
|
31118
31142
|
}
|
|
31119
31143
|
static getReadSectionKeys() {
|
|
31120
|
-
return [...
|
|
31144
|
+
return [...ANTIGRAVITY_SHARED_SUBAGENT_SECTION_KEYS, "antigravity-plugin"];
|
|
31121
31145
|
}
|
|
31122
31146
|
static getSettablePaths() {
|
|
31123
31147
|
return { relativeDirPath: ANTIGRAVITY_PLUGIN_AGENTS_DIR };
|
|
@@ -31461,7 +31485,7 @@ var RooSubagent = class extends ToolSubagent {
|
|
|
31461
31485
|
* Aggregate every targeted rulesync subagent into a single `.roomodes` file.
|
|
31462
31486
|
* Modes are de-duplicated by `slug` (last one wins) to keep the array unique.
|
|
31463
31487
|
*/
|
|
31464
|
-
static fromRulesyncSubagents({ outputRoot = process.cwd(), rulesyncSubagents, validate = true }) {
|
|
31488
|
+
static fromRulesyncSubagents({ outputRoot = process.cwd(), rulesyncSubagents, validate = true, global = false }) {
|
|
31465
31489
|
const bySlug = /* @__PURE__ */ new Map();
|
|
31466
31490
|
for (const rulesyncSubagent of rulesyncSubagents) {
|
|
31467
31491
|
const mode = this.toRooMode(rulesyncSubagent);
|
|
@@ -31469,17 +31493,19 @@ var RooSubagent = class extends ToolSubagent {
|
|
|
31469
31493
|
}
|
|
31470
31494
|
return new this({
|
|
31471
31495
|
outputRoot,
|
|
31472
|
-
relativeDirPath: this.getSettablePaths().relativeDirPath,
|
|
31496
|
+
relativeDirPath: this.getSettablePaths({ global }).relativeDirPath,
|
|
31473
31497
|
relativeFilePath: this.modesFileName,
|
|
31474
31498
|
modes: [...bySlug.values()],
|
|
31475
|
-
validate
|
|
31499
|
+
validate,
|
|
31500
|
+
global
|
|
31476
31501
|
});
|
|
31477
31502
|
}
|
|
31478
|
-
static fromRulesyncSubagent({ outputRoot = process.cwd(), rulesyncSubagent, validate = true }) {
|
|
31503
|
+
static fromRulesyncSubagent({ outputRoot = process.cwd(), rulesyncSubagent, validate = true, global = false }) {
|
|
31479
31504
|
return this.fromRulesyncSubagents({
|
|
31480
31505
|
outputRoot,
|
|
31481
31506
|
rulesyncSubagents: [rulesyncSubagent],
|
|
31482
|
-
validate
|
|
31507
|
+
validate,
|
|
31508
|
+
global
|
|
31483
31509
|
});
|
|
31484
31510
|
}
|
|
31485
31511
|
/**
|
|
@@ -31535,8 +31561,8 @@ var RooSubagent = class extends ToolSubagent {
|
|
|
31535
31561
|
toolTarget: "roo"
|
|
31536
31562
|
});
|
|
31537
31563
|
}
|
|
31538
|
-
static async fromFile({ outputRoot = process.cwd(), relativeFilePath, validate = true }) {
|
|
31539
|
-
const paths = this.getSettablePaths();
|
|
31564
|
+
static async fromFile({ outputRoot = process.cwd(), relativeFilePath, validate = true, global = false }) {
|
|
31565
|
+
const paths = this.getSettablePaths({ global });
|
|
31540
31566
|
const filePath = (0, node_path.join)(outputRoot, paths.relativeDirPath, relativeFilePath);
|
|
31541
31567
|
const fileContent = await readFileContent(filePath);
|
|
31542
31568
|
let parsed;
|
|
@@ -31552,16 +31578,18 @@ var RooSubagent = class extends ToolSubagent {
|
|
|
31552
31578
|
relativeDirPath: paths.relativeDirPath,
|
|
31553
31579
|
relativeFilePath: (0, node_path.basename)(relativeFilePath),
|
|
31554
31580
|
modes: result.data.customModes,
|
|
31555
|
-
validate
|
|
31581
|
+
validate,
|
|
31582
|
+
global
|
|
31556
31583
|
});
|
|
31557
31584
|
}
|
|
31558
|
-
static forDeletion({ outputRoot = process.cwd(), relativeDirPath, relativeFilePath }) {
|
|
31585
|
+
static forDeletion({ outputRoot = process.cwd(), relativeDirPath, relativeFilePath, global = false }) {
|
|
31559
31586
|
return new this({
|
|
31560
31587
|
outputRoot,
|
|
31561
31588
|
relativeDirPath,
|
|
31562
31589
|
relativeFilePath,
|
|
31563
31590
|
modes: [],
|
|
31564
|
-
validate: false
|
|
31591
|
+
validate: false,
|
|
31592
|
+
global
|
|
31565
31593
|
});
|
|
31566
31594
|
}
|
|
31567
31595
|
};
|
|
@@ -31573,8 +31601,13 @@ var RooSubagent = class extends ToolSubagent {
|
|
|
31573
31601
|
* presets `explore` and `general` — but it reads custom modes from an
|
|
31574
31602
|
* aggregated `customModes` YAML file in Roo's format, so every targeted rulesync
|
|
31575
31603
|
* subagent becomes one mode in `.bob/custom_modes.yaml`, exactly as the `roo`
|
|
31576
|
-
* target fills `.roomodes`.
|
|
31577
|
-
*
|
|
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`.
|
|
31578
31611
|
*
|
|
31579
31612
|
* The mode fields ride a `bob:` frontmatter section rather than Roo's `roo:`
|
|
31580
31613
|
* one, because Bob's tool groups are spelled differently (`execute` where Roo
|
|
@@ -31591,7 +31624,7 @@ var RooSubagent = class extends ToolSubagent {
|
|
|
31591
31624
|
* @see https://bob.ibm.com/docs/shell/configuration/custom-modes-bobshell
|
|
31592
31625
|
* @see https://bob.ibm.com/docs/ide/features/subagents
|
|
31593
31626
|
*/
|
|
31594
|
-
var BobSubagent = class extends RooSubagent {
|
|
31627
|
+
var BobSubagent = class BobSubagent extends RooSubagent {
|
|
31595
31628
|
static modesFileName = BOB_CUSTOM_MODES_FILE_NAME;
|
|
31596
31629
|
static modeSectionKey = "bob";
|
|
31597
31630
|
static defaultGroups = [
|
|
@@ -31601,12 +31634,74 @@ var BobSubagent = class extends RooSubagent {
|
|
|
31601
31634
|
"mcp"
|
|
31602
31635
|
];
|
|
31603
31636
|
static importTarget = "bob";
|
|
31604
|
-
static getSettablePaths(
|
|
31637
|
+
static getSettablePaths({ global = false } = {}) {
|
|
31605
31638
|
return {
|
|
31606
|
-
relativeDirPath: BOB_DIR,
|
|
31639
|
+
relativeDirPath: global ? BOB_GLOBAL_SETTINGS_DIR_PATH : BOB_DIR,
|
|
31607
31640
|
relativeFilePath: BOB_CUSTOM_MODES_FILE_NAME
|
|
31608
31641
|
};
|
|
31609
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
|
+
}
|
|
31610
31705
|
static isTargetedByRulesyncSubagent(rulesyncSubagent) {
|
|
31611
31706
|
return this.isTargetedByRulesyncSubagentDefault({
|
|
31612
31707
|
rulesyncSubagent,
|
|
@@ -35684,6 +35779,87 @@ var OpenCodeSubagent = class extends OpenCodeStyleSubagent {
|
|
|
35684
35779
|
var MimocodeSubagent = class extends OpenCodeSubagent {
|
|
35685
35780
|
static layout = MIMOCODE_LAYOUT;
|
|
35686
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
|
+
};
|
|
35687
35863
|
// src/features/subagents/omp-subagent.ts
|
|
35688
35864
|
/**
|
|
35689
35865
|
* Frontmatter of an oh-my-pi agent definition (`parseAgentFields` in
|
|
@@ -37457,7 +37633,7 @@ const toolSubagentFactories = /* @__PURE__ */ new Map([
|
|
|
37457
37633
|
meta: {
|
|
37458
37634
|
supportsProject: true,
|
|
37459
37635
|
supportsSimulated: false,
|
|
37460
|
-
supportsGlobal:
|
|
37636
|
+
supportsGlobal: true,
|
|
37461
37637
|
filePattern: "custom_modes.yaml"
|
|
37462
37638
|
}
|
|
37463
37639
|
}],
|
|
@@ -37735,6 +37911,15 @@ const toolSubagentFactories = /* @__PURE__ */ new Map([
|
|
|
37735
37911
|
filePattern: "*.md"
|
|
37736
37912
|
}
|
|
37737
37913
|
}],
|
|
37914
|
+
["musecode", {
|
|
37915
|
+
class: MusecodeSubagent,
|
|
37916
|
+
meta: {
|
|
37917
|
+
supportsProject: true,
|
|
37918
|
+
supportsSimulated: false,
|
|
37919
|
+
supportsGlobal: true,
|
|
37920
|
+
filePattern: "*.md"
|
|
37921
|
+
}
|
|
37922
|
+
}],
|
|
37738
37923
|
["omp", {
|
|
37739
37924
|
class: OmpSubagent,
|
|
37740
37925
|
meta: {
|
|
@@ -53921,13 +54106,29 @@ function isEventApplicable({ events, eventName }) {
|
|
|
53921
54106
|
function describeEvents(names) {
|
|
53922
54107
|
return [...names].map((name) => `"${name}"`).join(", ");
|
|
53923
54108
|
}
|
|
54109
|
+
const COMMAND_HOOK_TYPES = /* @__PURE__ */ new Set(["command"]);
|
|
53924
54110
|
/**
|
|
53925
|
-
*
|
|
53926
|
-
*
|
|
53927
|
-
* 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.
|
|
53928
54113
|
*/
|
|
53929
|
-
function
|
|
53930
|
-
return commandOnly
|
|
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;
|
|
53931
54132
|
}
|
|
53932
54133
|
/**
|
|
53933
54134
|
* Emit the configured passthrough fields on the tool side, mapping each
|
|
@@ -53942,14 +54143,18 @@ function isFieldApplicable({ commandOnly, hookType }) {
|
|
|
53942
54143
|
* silence — the mirror of the import side.
|
|
53943
54144
|
*/
|
|
53944
54145
|
function emitPassthroughFields({ def, hookType, eventName, fields, isValid, warn }) {
|
|
53945
|
-
for (const { canonical, tool, commandOnly, maxLength, collapseWhitespaceForLength, onlyWithFlag, events } of fields) {
|
|
54146
|
+
for (const { canonical, tool, commandOnly, hookTypes, maxLength, collapseWhitespaceForLength, onlyWithFlag, events } of fields) {
|
|
53946
54147
|
const value = def[canonical];
|
|
53947
54148
|
if (value === void 0) continue;
|
|
53948
54149
|
if (!isFieldApplicable({
|
|
53949
54150
|
commandOnly,
|
|
54151
|
+
hookTypes,
|
|
53950
54152
|
hookType
|
|
53951
54153
|
})) {
|
|
53952
|
-
warn?.(`Dropping "${canonical}" from a "${hookType}" hook on "${eventName}": this tool documents "${tool}" on
|
|
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.`);
|
|
53953
54158
|
continue;
|
|
53954
54159
|
}
|
|
53955
54160
|
if (events !== void 0 && !isEventApplicable({
|
|
@@ -53972,8 +54177,9 @@ function emitPassthroughFields({ def, hookType, eventName, fields, isValid, warn
|
|
|
53972
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.`);
|
|
53973
54178
|
}
|
|
53974
54179
|
}
|
|
53975
|
-
return Object.fromEntries(fields.filter(({ canonical, commandOnly, events }) => isFieldApplicable({
|
|
54180
|
+
return Object.fromEntries(fields.filter(({ canonical, commandOnly, hookTypes, events }) => isFieldApplicable({
|
|
53976
54181
|
commandOnly,
|
|
54182
|
+
hookTypes,
|
|
53977
54183
|
hookType
|
|
53978
54184
|
}) && isEventApplicable({
|
|
53979
54185
|
events,
|
|
@@ -53991,19 +54197,24 @@ function emitPassthroughFields({ def, hookType, eventName, fields, isValid, warn
|
|
|
53991
54197
|
* value into a warning instead of a silent drop.
|
|
53992
54198
|
*/
|
|
53993
54199
|
function importPassthroughFields({ h, hookType, eventName, fields, isValid, describeInvalid, warn }) {
|
|
53994
|
-
const typeApplicable = fields.filter(({ commandOnly }) => isFieldApplicable({
|
|
54200
|
+
const typeApplicable = fields.filter(({ commandOnly, hookTypes }) => isFieldApplicable({
|
|
53995
54201
|
commandOnly,
|
|
54202
|
+
hookTypes,
|
|
53996
54203
|
hookType
|
|
53997
54204
|
}));
|
|
53998
54205
|
const applicable = typeApplicable.filter(({ events }) => isEventApplicable({
|
|
53999
54206
|
events,
|
|
54000
54207
|
eventName
|
|
54001
54208
|
}));
|
|
54002
|
-
const skipped = fields.filter(({ commandOnly }) => !isFieldApplicable({
|
|
54209
|
+
const skipped = fields.filter(({ commandOnly, hookTypes }) => !isFieldApplicable({
|
|
54003
54210
|
commandOnly,
|
|
54211
|
+
hookTypes,
|
|
54004
54212
|
hookType
|
|
54005
54213
|
}));
|
|
54006
|
-
for (const { tool } of skipped) if (h[tool] !== void 0) warn?.(`Dropping "${tool}" from an imported "${hookType}" hook: this tool documents it on
|
|
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.`);
|
|
54007
54218
|
for (const { tool, events } of typeApplicable) if (events !== void 0 && !isEventApplicable({
|
|
54008
54219
|
events,
|
|
54009
54220
|
eventName
|
|
@@ -54177,13 +54388,13 @@ function isKeywordFieldApplicable({ spec, hookType, eventName, flags, direction,
|
|
|
54177
54388
|
const field = direction === "generated" ? canonical : tool;
|
|
54178
54389
|
if (!isFieldApplicable({
|
|
54179
54390
|
commandOnly,
|
|
54391
|
+
hookTypes,
|
|
54180
54392
|
hookType
|
|
54181
54393
|
})) {
|
|
54182
|
-
warn?.(`Dropping "${field}" from a "${hookType}" hook on "${eventName}": this tool documents "${tool}" on
|
|
54183
|
-
|
|
54184
|
-
|
|
54185
|
-
|
|
54186
|
-
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}.`);
|
|
54187
54398
|
return false;
|
|
54188
54399
|
}
|
|
54189
54400
|
if (events !== void 0 && !events.has(eventName)) {
|
|
@@ -59130,6 +59341,18 @@ const FACTORYDROID_CONVERTER_CONFIG = {
|
|
|
59130
59341
|
tool: "commandRegex",
|
|
59131
59342
|
valueType: "string",
|
|
59132
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
|
+
])
|
|
59133
59356
|
}]
|
|
59134
59357
|
};
|
|
59135
59358
|
/** Droid's nine event names, the keys a standalone `hooks.json` is made of. */
|
|
@@ -62502,6 +62725,17 @@ var PoolHooks = class PoolHooks extends ToolHooks {
|
|
|
62502
62725
|
}
|
|
62503
62726
|
};
|
|
62504
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"]);
|
|
62505
62739
|
const QODER_SPEC = {
|
|
62506
62740
|
displayName: "Qoder",
|
|
62507
62741
|
overrideKey: "qoder",
|
|
@@ -62511,16 +62745,7 @@ const QODER_SPEC = {
|
|
|
62511
62745
|
toolToCanonicalEventNames: QODER_TO_CANONICAL_EVENT_NAMES,
|
|
62512
62746
|
projectDirVar: "$QODER_PROJECT_DIR",
|
|
62513
62747
|
prefixDotRelativeCommandsOnly: true,
|
|
62514
|
-
noMatcherEvents:
|
|
62515
|
-
"beforeSubmitPrompt",
|
|
62516
|
-
"stop",
|
|
62517
|
-
"cwdChanged",
|
|
62518
|
-
"worktreeCreate",
|
|
62519
|
-
"worktreeRemove",
|
|
62520
|
-
"taskCreated",
|
|
62521
|
-
"taskCompleted",
|
|
62522
|
-
"teammateIdle"
|
|
62523
|
-
]),
|
|
62748
|
+
noMatcherEvents: QODER_NO_MATCHER_EVENTS,
|
|
62524
62749
|
supportedHookTypes: /* @__PURE__ */ new Set([
|
|
62525
62750
|
"command",
|
|
62526
62751
|
"http",
|
|
@@ -62577,6 +62802,15 @@ const QODER_SPEC = {
|
|
|
62577
62802
|
canonical: "args",
|
|
62578
62803
|
tool: "args",
|
|
62579
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
|
|
62580
62814
|
}],
|
|
62581
62815
|
recordPassthroughFields: [{
|
|
62582
62816
|
canonical: "env",
|
|
@@ -82111,6 +82345,22 @@ const ANTIGRAVITY_CLI_OVERRIDE_KEYS = [
|
|
|
82111
82345
|
];
|
|
82112
82346
|
const moduleLogger$4 = fallbackLogger;
|
|
82113
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
|
+
/**
|
|
82114
82364
|
* Narrow an imported `settings.json` value to one of the documented values of
|
|
82115
82365
|
* an enum-typed override key. The override schema declares `toolPermission`,
|
|
82116
82366
|
* `artifactReviewPolicy` and `agentMode` as `z.enum`, so carrying an
|
|
@@ -82247,7 +82497,7 @@ var AntigravityCliPermissions = class AntigravityCliPermissions extends ToolPerm
|
|
|
82247
82497
|
const override = config["antigravity-cli"];
|
|
82248
82498
|
for (const key of ANTIGRAVITY_CLI_OVERRIDE_KEYS) {
|
|
82249
82499
|
const value = override?.[key];
|
|
82250
|
-
if (value !== void 0) merged[key] = value;
|
|
82500
|
+
if (value !== void 0) merged[key] = key === "agentMode" ? toStoredAgentMode(value) : value;
|
|
82251
82501
|
}
|
|
82252
82502
|
const fileContent = JSON.stringify(merged, null, 2);
|
|
82253
82503
|
return new AntigravityCliPermissions({
|
|
@@ -82291,7 +82541,7 @@ var AntigravityCliPermissions = class AntigravityCliPermissions extends ToolPerm
|
|
|
82291
82541
|
});
|
|
82292
82542
|
if (artifactReviewPolicy !== void 0) override.artifactReviewPolicy = artifactReviewPolicy;
|
|
82293
82543
|
if (typeof settings.allowNonWorkspaceAccess === "boolean") override.allowNonWorkspaceAccess = settings.allowNonWorkspaceAccess;
|
|
82294
|
-
const agentMode = pickDocumentedValue({
|
|
82544
|
+
const agentMode = settings.agentMode === ANTIGRAVITY_CLI_STORED_DEFAULT_AGENT_MODE ? "default" : pickDocumentedValue({
|
|
82295
82545
|
key: "agentMode",
|
|
82296
82546
|
value: settings.agentMode,
|
|
82297
82547
|
documented: ANTIGRAVITY_CLI_AGENT_MODES
|
|
@@ -96893,7 +97143,8 @@ const QODER_OVERRIDE_GROUP_KEYS = {
|
|
|
96893
97143
|
"enabledProjectMcpServers",
|
|
96894
97144
|
"lazyLoad"
|
|
96895
97145
|
],
|
|
96896
|
-
agents: ["overrides"]
|
|
97146
|
+
agents: ["overrides"],
|
|
97147
|
+
security: ["disableYoloMode"]
|
|
96897
97148
|
};
|
|
96898
97149
|
const QODER_OVERRIDE_GROUPS = Object.keys(QODER_OVERRIDE_GROUP_KEYS);
|
|
96899
97150
|
/**
|
|
@@ -97156,7 +97407,8 @@ function isLiftableQoderValue(key, value) {
|
|
|
97156
97407
|
switch (key) {
|
|
97157
97408
|
case "defaultPermissionMode": return typeof value === "string" && value.trim() !== "";
|
|
97158
97409
|
case "enableAllProjectMcpServers":
|
|
97159
|
-
case "lazyLoad":
|
|
97410
|
+
case "lazyLoad":
|
|
97411
|
+
case "disableYoloMode": return typeof value === "boolean";
|
|
97160
97412
|
case "overrides": return isRecord(value) && Object.values(value).every(isRecord);
|
|
97161
97413
|
default: return isStringArray(value);
|
|
97162
97414
|
}
|
|
@@ -97417,7 +97669,8 @@ const QWEN_OVERRIDE_TOOLS_KEYS = [
|
|
|
97417
97669
|
"freeform",
|
|
97418
97670
|
"workflowsEnabled",
|
|
97419
97671
|
"workflowNameOnly",
|
|
97420
|
-
"executionSandbox"
|
|
97672
|
+
"executionSandbox",
|
|
97673
|
+
"lspEnabled"
|
|
97421
97674
|
];
|
|
97422
97675
|
const QWEN_OVERRIDE_SECURITY_KEYS = [
|
|
97423
97676
|
"folderTrust",
|
|
@@ -97495,6 +97748,11 @@ const QWEN_SCOPED_TOOLS_KEYS = {
|
|
|
97495
97748
|
grants: () => true,
|
|
97496
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)."
|
|
97497
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
|
+
},
|
|
97498
97756
|
workflowNameOnly: {
|
|
97499
97757
|
rule: "global-machine-wide",
|
|
97500
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.`,
|