rulesync 7.5.0 → 7.6.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/dist/index.cjs CHANGED
@@ -321,6 +321,7 @@ var ALL_TOOL_TARGETS = [
321
321
  "cursor",
322
322
  "factorydroid",
323
323
  "geminicli",
324
+ "goose",
324
325
  "junie",
325
326
  "kilo",
326
327
  "kiro",
@@ -630,7 +631,7 @@ function getBaseDirsInLightOfGlobal({
630
631
 
631
632
  // src/lib/generate.ts
632
633
  var import_es_toolkit4 = require("es-toolkit");
633
- var import_node_path110 = require("path");
634
+ var import_node_path111 = require("path");
634
635
 
635
636
  // src/features/commands/commands-processor.ts
636
637
  var import_node_path20 = require("path");
@@ -5476,24 +5477,25 @@ var CodexcliMcp = class _CodexcliMcp extends ToolMcp {
5476
5477
  getToml() {
5477
5478
  return this.toml;
5478
5479
  }
5479
- static getSettablePaths({ global } = {}) {
5480
- if (!global) {
5481
- throw new Error("CodexcliMcp only supports global mode. Please pass { global: true }.");
5482
- }
5480
+ static getSettablePaths(_options = {}) {
5483
5481
  return {
5484
5482
  relativeDirPath: ".codex",
5485
5483
  relativeFilePath: "config.toml"
5486
5484
  };
5487
5485
  }
5486
+ /**
5487
+ * config.toml may contain other Codex settings, so it should not be deleted.
5488
+ */
5489
+ isDeletable() {
5490
+ return false;
5491
+ }
5488
5492
  static async fromFile({
5489
5493
  baseDir = process.cwd(),
5490
5494
  validate = true,
5491
5495
  global = false
5492
5496
  }) {
5493
5497
  const paths = this.getSettablePaths({ global });
5494
- const fileContent = await readFileContent(
5495
- (0, import_node_path42.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath)
5496
- );
5498
+ const fileContent = await readFileContentOrNull((0, import_node_path42.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath)) ?? smolToml.stringify({});
5497
5499
  return new _CodexcliMcp({
5498
5500
  baseDir,
5499
5501
  relativeDirPath: paths.relativeDirPath,
@@ -6549,7 +6551,7 @@ var toolMcpFactories = /* @__PURE__ */ new Map([
6549
6551
  {
6550
6552
  class: CodexcliMcp,
6551
6553
  meta: {
6552
- supportsProject: false,
6554
+ supportsProject: true,
6553
6555
  supportsGlobal: true,
6554
6556
  supportsEnabledTools: true,
6555
6557
  supportsDisabledTools: true
@@ -6809,8 +6811,8 @@ var McpProcessor = class extends FeatureProcessor {
6809
6811
 
6810
6812
  // src/features/rules/rules-processor.ts
6811
6813
  var import_toon = require("@toon-format/toon");
6812
- var import_node_path109 = require("path");
6813
- var import_mini49 = require("zod/mini");
6814
+ var import_node_path110 = require("path");
6815
+ var import_mini50 = require("zod/mini");
6814
6816
 
6815
6817
  // src/constants/general.ts
6816
6818
  var SKILL_FILE_NAME = "SKILL.md";
@@ -10009,39 +10011,12 @@ var AgentsmdSubagent = class _AgentsmdSubagent extends SimulatedSubagent {
10009
10011
  }
10010
10012
  };
10011
10013
 
10012
- // src/features/subagents/codexcli-subagent.ts
10013
- var import_node_path75 = require("path");
10014
- var CodexCliSubagent = class _CodexCliSubagent extends SimulatedSubagent {
10015
- static getSettablePaths() {
10016
- return {
10017
- relativeDirPath: (0, import_node_path75.join)(".codex", "subagents")
10018
- };
10019
- }
10020
- static async fromFile(params) {
10021
- const baseParams = await this.fromFileDefault(params);
10022
- return new _CodexCliSubagent(baseParams);
10023
- }
10024
- static fromRulesyncSubagent(params) {
10025
- const baseParams = this.fromRulesyncSubagentDefault(params);
10026
- return new _CodexCliSubagent(baseParams);
10027
- }
10028
- static isTargetedByRulesyncSubagent(rulesyncSubagent) {
10029
- return this.isTargetedByRulesyncSubagentDefault({
10030
- rulesyncSubagent,
10031
- toolTarget: "codexcli"
10032
- });
10033
- }
10034
- static forDeletion(params) {
10035
- return new _CodexCliSubagent(this.forDeletionDefault(params));
10036
- }
10037
- };
10038
-
10039
10014
  // src/features/subagents/factorydroid-subagent.ts
10040
- var import_node_path76 = require("path");
10015
+ var import_node_path75 = require("path");
10041
10016
  var FactorydroidSubagent = class _FactorydroidSubagent extends SimulatedSubagent {
10042
10017
  static getSettablePaths(_options) {
10043
10018
  return {
10044
- relativeDirPath: (0, import_node_path76.join)(".factory", "droids")
10019
+ relativeDirPath: (0, import_node_path75.join)(".factory", "droids")
10045
10020
  };
10046
10021
  }
10047
10022
  static async fromFile(params) {
@@ -10064,11 +10039,11 @@ var FactorydroidSubagent = class _FactorydroidSubagent extends SimulatedSubagent
10064
10039
  };
10065
10040
 
10066
10041
  // src/features/subagents/geminicli-subagent.ts
10067
- var import_node_path77 = require("path");
10042
+ var import_node_path76 = require("path");
10068
10043
  var GeminiCliSubagent = class _GeminiCliSubagent extends SimulatedSubagent {
10069
10044
  static getSettablePaths() {
10070
10045
  return {
10071
- relativeDirPath: (0, import_node_path77.join)(".gemini", "subagents")
10046
+ relativeDirPath: (0, import_node_path76.join)(".gemini", "subagents")
10072
10047
  };
10073
10048
  }
10074
10049
  static async fromFile(params) {
@@ -10091,11 +10066,11 @@ var GeminiCliSubagent = class _GeminiCliSubagent extends SimulatedSubagent {
10091
10066
  };
10092
10067
 
10093
10068
  // src/features/subagents/roo-subagent.ts
10094
- var import_node_path78 = require("path");
10069
+ var import_node_path77 = require("path");
10095
10070
  var RooSubagent = class _RooSubagent extends SimulatedSubagent {
10096
10071
  static getSettablePaths() {
10097
10072
  return {
10098
- relativeDirPath: (0, import_node_path78.join)(".roo", "subagents")
10073
+ relativeDirPath: (0, import_node_path77.join)(".roo", "subagents")
10099
10074
  };
10100
10075
  }
10101
10076
  static async fromFile(params) {
@@ -10119,14 +10094,14 @@ var RooSubagent = class _RooSubagent extends SimulatedSubagent {
10119
10094
 
10120
10095
  // src/features/subagents/subagents-processor.ts
10121
10096
  var import_node_path85 = require("path");
10122
- var import_mini42 = require("zod/mini");
10097
+ var import_mini43 = require("zod/mini");
10123
10098
 
10124
10099
  // src/features/subagents/claudecode-subagent.ts
10125
- var import_node_path80 = require("path");
10100
+ var import_node_path79 = require("path");
10126
10101
  var import_mini37 = require("zod/mini");
10127
10102
 
10128
10103
  // src/features/subagents/rulesync-subagent.ts
10129
- var import_node_path79 = require("path");
10104
+ var import_node_path78 = require("path");
10130
10105
  var import_mini36 = require("zod/mini");
10131
10106
  var RulesyncSubagentFrontmatterSchema = import_mini36.z.looseObject({
10132
10107
  targets: import_mini36.z._default(RulesyncTargetsSchema, ["*"]),
@@ -10140,7 +10115,7 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
10140
10115
  const parseResult = RulesyncSubagentFrontmatterSchema.safeParse(frontmatter);
10141
10116
  if (!parseResult.success && rest.validate !== false) {
10142
10117
  throw new Error(
10143
- `Invalid frontmatter in ${(0, import_node_path79.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(parseResult.error)}`
10118
+ `Invalid frontmatter in ${(0, import_node_path78.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(parseResult.error)}`
10144
10119
  );
10145
10120
  }
10146
10121
  const parsedFrontmatter = parseResult.success ? { ...frontmatter, ...parseResult.data } : { ...frontmatter, targets: frontmatter?.targets ?? ["*"] };
@@ -10173,7 +10148,7 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
10173
10148
  return {
10174
10149
  success: false,
10175
10150
  error: new Error(
10176
- `Invalid frontmatter in ${(0, import_node_path79.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
10151
+ `Invalid frontmatter in ${(0, import_node_path78.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
10177
10152
  )
10178
10153
  };
10179
10154
  }
@@ -10182,14 +10157,14 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
10182
10157
  relativeFilePath
10183
10158
  }) {
10184
10159
  const fileContent = await readFileContent(
10185
- (0, import_node_path79.join)(process.cwd(), RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, relativeFilePath)
10160
+ (0, import_node_path78.join)(process.cwd(), RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, relativeFilePath)
10186
10161
  );
10187
10162
  const { frontmatter, body: content } = parseFrontmatter(fileContent);
10188
10163
  const result = RulesyncSubagentFrontmatterSchema.safeParse(frontmatter);
10189
10164
  if (!result.success) {
10190
10165
  throw new Error(`Invalid frontmatter in ${relativeFilePath}: ${formatError(result.error)}`);
10191
10166
  }
10192
- const filename = (0, import_node_path79.basename)(relativeFilePath);
10167
+ const filename = (0, import_node_path78.basename)(relativeFilePath);
10193
10168
  return new _RulesyncSubagent({
10194
10169
  baseDir: process.cwd(),
10195
10170
  relativeDirPath: this.getSettablePaths().relativeDirPath,
@@ -10217,7 +10192,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
10217
10192
  const result = ClaudecodeSubagentFrontmatterSchema.safeParse(frontmatter);
10218
10193
  if (!result.success) {
10219
10194
  throw new Error(
10220
- `Invalid frontmatter in ${(0, import_node_path80.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
10195
+ `Invalid frontmatter in ${(0, import_node_path79.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
10221
10196
  );
10222
10197
  }
10223
10198
  }
@@ -10229,7 +10204,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
10229
10204
  }
10230
10205
  static getSettablePaths(_options = {}) {
10231
10206
  return {
10232
- relativeDirPath: (0, import_node_path80.join)(".claude", "agents")
10207
+ relativeDirPath: (0, import_node_path79.join)(".claude", "agents")
10233
10208
  };
10234
10209
  }
10235
10210
  getFrontmatter() {
@@ -10305,7 +10280,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
10305
10280
  return {
10306
10281
  success: false,
10307
10282
  error: new Error(
10308
- `Invalid frontmatter in ${(0, import_node_path80.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
10283
+ `Invalid frontmatter in ${(0, import_node_path79.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
10309
10284
  )
10310
10285
  };
10311
10286
  }
@@ -10323,7 +10298,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
10323
10298
  global = false
10324
10299
  }) {
10325
10300
  const paths = this.getSettablePaths({ global });
10326
- const filePath = (0, import_node_path80.join)(baseDir, paths.relativeDirPath, relativeFilePath);
10301
+ const filePath = (0, import_node_path79.join)(baseDir, paths.relativeDirPath, relativeFilePath);
10327
10302
  const fileContent = await readFileContent(filePath);
10328
10303
  const { frontmatter, body: content } = parseFrontmatter(fileContent);
10329
10304
  const result = ClaudecodeSubagentFrontmatterSchema.safeParse(frontmatter);
@@ -10357,14 +10332,158 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
10357
10332
  }
10358
10333
  };
10359
10334
 
10335
+ // src/features/subagents/codexcli-subagent.ts
10336
+ var import_node_path80 = require("path");
10337
+ var smolToml2 = __toESM(require("smol-toml"), 1);
10338
+ var import_mini38 = require("zod/mini");
10339
+ var CodexCliSubagentTomlSchema = import_mini38.z.looseObject({
10340
+ name: import_mini38.z.string(),
10341
+ description: import_mini38.z.optional(import_mini38.z.string()),
10342
+ developer_instructions: import_mini38.z.optional(import_mini38.z.string()),
10343
+ model: import_mini38.z.optional(import_mini38.z.string()),
10344
+ model_reasoning_effort: import_mini38.z.optional(import_mini38.z.string()),
10345
+ sandbox_mode: import_mini38.z.optional(import_mini38.z.string())
10346
+ });
10347
+ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
10348
+ body;
10349
+ constructor({ body, ...rest }) {
10350
+ super({
10351
+ ...rest
10352
+ });
10353
+ this.body = body;
10354
+ }
10355
+ static getSettablePaths(_options = {}) {
10356
+ return {
10357
+ relativeDirPath: (0, import_node_path80.join)(".codex", "agents")
10358
+ };
10359
+ }
10360
+ getBody() {
10361
+ return this.body;
10362
+ }
10363
+ toRulesyncSubagent() {
10364
+ let parsed;
10365
+ try {
10366
+ parsed = CodexCliSubagentTomlSchema.parse(smolToml2.parse(this.body));
10367
+ } catch (error) {
10368
+ throw new Error(
10369
+ `Failed to parse TOML in ${(0, import_node_path80.join)(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${error instanceof Error ? error.message : String(error)}`,
10370
+ { cause: error }
10371
+ );
10372
+ }
10373
+ const { name, description, developer_instructions, ...restFields } = parsed;
10374
+ const codexcliSection = {
10375
+ ...restFields
10376
+ };
10377
+ const rulesyncFrontmatter = {
10378
+ targets: ["codexcli"],
10379
+ name,
10380
+ description: description ?? "",
10381
+ // Only include codexcli section if there are fields
10382
+ ...Object.keys(codexcliSection).length > 0 && { codexcli: codexcliSection }
10383
+ };
10384
+ return new RulesyncSubagent({
10385
+ baseDir: ".",
10386
+ frontmatter: rulesyncFrontmatter,
10387
+ body: developer_instructions ?? "",
10388
+ relativeDirPath: RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH,
10389
+ relativeFilePath: this.getRelativeFilePath().replace(/\.toml$/, ".md"),
10390
+ validate: true
10391
+ });
10392
+ }
10393
+ static fromRulesyncSubagent({
10394
+ baseDir = process.cwd(),
10395
+ rulesyncSubagent,
10396
+ validate = true,
10397
+ global = false
10398
+ }) {
10399
+ const frontmatter = rulesyncSubagent.getFrontmatter();
10400
+ const rawSection = frontmatter.codexcli ?? {};
10401
+ const {
10402
+ name: _n,
10403
+ description: _d,
10404
+ developer_instructions: _di,
10405
+ ...codexcliSection
10406
+ } = rawSection;
10407
+ const tomlObj = {
10408
+ name: frontmatter.name,
10409
+ ...frontmatter.description ? { description: frontmatter.description } : {},
10410
+ ...rulesyncSubagent.getBody() ? { developer_instructions: rulesyncSubagent.getBody() } : {},
10411
+ ...codexcliSection
10412
+ };
10413
+ const body = smolToml2.stringify(tomlObj);
10414
+ const paths = this.getSettablePaths({ global });
10415
+ const relativeFilePath = rulesyncSubagent.getRelativeFilePath().replace(/\.md$/, ".toml");
10416
+ return new _CodexCliSubagent({
10417
+ baseDir,
10418
+ body,
10419
+ relativeDirPath: paths.relativeDirPath,
10420
+ relativeFilePath,
10421
+ fileContent: body,
10422
+ validate,
10423
+ global
10424
+ });
10425
+ }
10426
+ validate() {
10427
+ try {
10428
+ const parsed = smolToml2.parse(this.body);
10429
+ CodexCliSubagentTomlSchema.parse(parsed);
10430
+ return { success: true, error: null };
10431
+ } catch (error) {
10432
+ return {
10433
+ success: false,
10434
+ error: error instanceof Error ? error : new Error(String(error))
10435
+ };
10436
+ }
10437
+ }
10438
+ static isTargetedByRulesyncSubagent(rulesyncSubagent) {
10439
+ return this.isTargetedByRulesyncSubagentDefault({
10440
+ rulesyncSubagent,
10441
+ toolTarget: "codexcli"
10442
+ });
10443
+ }
10444
+ static async fromFile({
10445
+ baseDir = process.cwd(),
10446
+ relativeFilePath,
10447
+ validate = true,
10448
+ global = false
10449
+ }) {
10450
+ const paths = this.getSettablePaths({ global });
10451
+ const filePath = (0, import_node_path80.join)(baseDir, paths.relativeDirPath, relativeFilePath);
10452
+ const fileContent = await readFileContent(filePath);
10453
+ return new _CodexCliSubagent({
10454
+ baseDir,
10455
+ relativeDirPath: paths.relativeDirPath,
10456
+ relativeFilePath,
10457
+ body: fileContent.trim(),
10458
+ fileContent,
10459
+ validate,
10460
+ global
10461
+ });
10462
+ }
10463
+ static forDeletion({
10464
+ baseDir = process.cwd(),
10465
+ relativeDirPath,
10466
+ relativeFilePath
10467
+ }) {
10468
+ return new _CodexCliSubagent({
10469
+ baseDir,
10470
+ relativeDirPath,
10471
+ relativeFilePath,
10472
+ body: "",
10473
+ fileContent: "",
10474
+ validate: false
10475
+ });
10476
+ }
10477
+ };
10478
+
10360
10479
  // src/features/subagents/copilot-subagent.ts
10361
10480
  var import_node_path81 = require("path");
10362
- var import_mini38 = require("zod/mini");
10481
+ var import_mini39 = require("zod/mini");
10363
10482
  var REQUIRED_TOOL = "agent/runSubagent";
10364
- var CopilotSubagentFrontmatterSchema = import_mini38.z.looseObject({
10365
- name: import_mini38.z.string(),
10366
- description: import_mini38.z.string(),
10367
- tools: import_mini38.z.optional(import_mini38.z.union([import_mini38.z.string(), import_mini38.z.array(import_mini38.z.string())]))
10483
+ var CopilotSubagentFrontmatterSchema = import_mini39.z.looseObject({
10484
+ name: import_mini39.z.string(),
10485
+ description: import_mini39.z.string(),
10486
+ tools: import_mini39.z.optional(import_mini39.z.union([import_mini39.z.string(), import_mini39.z.array(import_mini39.z.string())]))
10368
10487
  });
10369
10488
  var normalizeTools = (tools) => {
10370
10489
  if (!tools) {
@@ -10525,10 +10644,10 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
10525
10644
 
10526
10645
  // src/features/subagents/cursor-subagent.ts
10527
10646
  var import_node_path82 = require("path");
10528
- var import_mini39 = require("zod/mini");
10529
- var CursorSubagentFrontmatterSchema = import_mini39.z.looseObject({
10530
- name: import_mini39.z.string(),
10531
- description: import_mini39.z.string()
10647
+ var import_mini40 = require("zod/mini");
10648
+ var CursorSubagentFrontmatterSchema = import_mini40.z.looseObject({
10649
+ name: import_mini40.z.string(),
10650
+ description: import_mini40.z.string()
10532
10651
  });
10533
10652
  var CursorSubagent = class _CursorSubagent extends ToolSubagent {
10534
10653
  frontmatter;
@@ -10672,22 +10791,22 @@ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
10672
10791
 
10673
10792
  // src/features/subagents/kiro-subagent.ts
10674
10793
  var import_node_path83 = require("path");
10675
- var import_mini40 = require("zod/mini");
10676
- var KiroCliSubagentJsonSchema = import_mini40.z.looseObject({
10677
- name: import_mini40.z.string(),
10678
- description: import_mini40.z.optional(import_mini40.z.nullable(import_mini40.z.string())),
10679
- prompt: import_mini40.z.optional(import_mini40.z.nullable(import_mini40.z.string())),
10680
- tools: import_mini40.z.optional(import_mini40.z.nullable(import_mini40.z.array(import_mini40.z.string()))),
10681
- toolAliases: import_mini40.z.optional(import_mini40.z.nullable(import_mini40.z.record(import_mini40.z.string(), import_mini40.z.string()))),
10682
- toolSettings: import_mini40.z.optional(import_mini40.z.nullable(import_mini40.z.unknown())),
10683
- toolSchema: import_mini40.z.optional(import_mini40.z.nullable(import_mini40.z.unknown())),
10684
- hooks: import_mini40.z.optional(import_mini40.z.nullable(import_mini40.z.record(import_mini40.z.string(), import_mini40.z.array(import_mini40.z.unknown())))),
10685
- model: import_mini40.z.optional(import_mini40.z.nullable(import_mini40.z.string())),
10686
- mcpServers: import_mini40.z.optional(import_mini40.z.nullable(import_mini40.z.record(import_mini40.z.string(), import_mini40.z.unknown()))),
10687
- useLegacyMcpJson: import_mini40.z.optional(import_mini40.z.nullable(import_mini40.z.boolean())),
10688
- resources: import_mini40.z.optional(import_mini40.z.nullable(import_mini40.z.array(import_mini40.z.string()))),
10689
- allowedTools: import_mini40.z.optional(import_mini40.z.nullable(import_mini40.z.array(import_mini40.z.string()))),
10690
- includeMcpJson: import_mini40.z.optional(import_mini40.z.nullable(import_mini40.z.boolean()))
10794
+ var import_mini41 = require("zod/mini");
10795
+ var KiroCliSubagentJsonSchema = import_mini41.z.looseObject({
10796
+ name: import_mini41.z.string(),
10797
+ description: import_mini41.z.optional(import_mini41.z.nullable(import_mini41.z.string())),
10798
+ prompt: import_mini41.z.optional(import_mini41.z.nullable(import_mini41.z.string())),
10799
+ tools: import_mini41.z.optional(import_mini41.z.nullable(import_mini41.z.array(import_mini41.z.string()))),
10800
+ toolAliases: import_mini41.z.optional(import_mini41.z.nullable(import_mini41.z.record(import_mini41.z.string(), import_mini41.z.string()))),
10801
+ toolSettings: import_mini41.z.optional(import_mini41.z.nullable(import_mini41.z.unknown())),
10802
+ toolSchema: import_mini41.z.optional(import_mini41.z.nullable(import_mini41.z.unknown())),
10803
+ hooks: import_mini41.z.optional(import_mini41.z.nullable(import_mini41.z.record(import_mini41.z.string(), import_mini41.z.array(import_mini41.z.unknown())))),
10804
+ model: import_mini41.z.optional(import_mini41.z.nullable(import_mini41.z.string())),
10805
+ mcpServers: import_mini41.z.optional(import_mini41.z.nullable(import_mini41.z.record(import_mini41.z.string(), import_mini41.z.unknown()))),
10806
+ useLegacyMcpJson: import_mini41.z.optional(import_mini41.z.nullable(import_mini41.z.boolean())),
10807
+ resources: import_mini41.z.optional(import_mini41.z.nullable(import_mini41.z.array(import_mini41.z.string()))),
10808
+ allowedTools: import_mini41.z.optional(import_mini41.z.nullable(import_mini41.z.array(import_mini41.z.string()))),
10809
+ includeMcpJson: import_mini41.z.optional(import_mini41.z.nullable(import_mini41.z.boolean()))
10691
10810
  });
10692
10811
  var KiroSubagent = class _KiroSubagent extends ToolSubagent {
10693
10812
  body;
@@ -10809,11 +10928,11 @@ var KiroSubagent = class _KiroSubagent extends ToolSubagent {
10809
10928
 
10810
10929
  // src/features/subagents/opencode-subagent.ts
10811
10930
  var import_node_path84 = require("path");
10812
- var import_mini41 = require("zod/mini");
10813
- var OpenCodeSubagentFrontmatterSchema = import_mini41.z.looseObject({
10814
- description: import_mini41.z.string(),
10815
- mode: import_mini41.z._default(import_mini41.z.string(), "subagent"),
10816
- name: import_mini41.z.optional(import_mini41.z.string())
10931
+ var import_mini42 = require("zod/mini");
10932
+ var OpenCodeSubagentFrontmatterSchema = import_mini42.z.looseObject({
10933
+ description: import_mini42.z.string(),
10934
+ mode: import_mini42.z._default(import_mini42.z.string(), "subagent"),
10935
+ name: import_mini42.z.optional(import_mini42.z.string())
10817
10936
  });
10818
10937
  var OpenCodeSubagent = class _OpenCodeSubagent extends ToolSubagent {
10819
10938
  frontmatter;
@@ -10969,7 +11088,7 @@ var subagentsProcessorToolTargetTuple = [
10969
11088
  "opencode",
10970
11089
  "roo"
10971
11090
  ];
10972
- var SubagentsProcessorToolTargetSchema = import_mini42.z.enum(subagentsProcessorToolTargetTuple);
11091
+ var SubagentsProcessorToolTargetSchema = import_mini43.z.enum(subagentsProcessorToolTargetTuple);
10973
11092
  var toolSubagentFactories = /* @__PURE__ */ new Map([
10974
11093
  [
10975
11094
  "agentsmd",
@@ -10996,7 +11115,7 @@ var toolSubagentFactories = /* @__PURE__ */ new Map([
10996
11115
  "codexcli",
10997
11116
  {
10998
11117
  class: CodexCliSubagent,
10999
- meta: { supportsSimulated: true, supportsGlobal: false, filePattern: "*.md" }
11118
+ meta: { supportsSimulated: false, supportsGlobal: false, filePattern: "*.toml" }
11000
11119
  }
11001
11120
  ],
11002
11121
  [
@@ -11248,42 +11367,42 @@ var import_node_path87 = require("path");
11248
11367
 
11249
11368
  // src/features/rules/rulesync-rule.ts
11250
11369
  var import_node_path86 = require("path");
11251
- var import_mini43 = require("zod/mini");
11252
- var RulesyncRuleFrontmatterSchema = import_mini43.z.object({
11253
- root: import_mini43.z.optional(import_mini43.z.boolean()),
11254
- localRoot: import_mini43.z.optional(import_mini43.z.boolean()),
11255
- targets: import_mini43.z._default(RulesyncTargetsSchema, ["*"]),
11256
- description: import_mini43.z.optional(import_mini43.z.string()),
11257
- globs: import_mini43.z.optional(import_mini43.z.array(import_mini43.z.string())),
11258
- agentsmd: import_mini43.z.optional(
11259
- import_mini43.z.object({
11370
+ var import_mini44 = require("zod/mini");
11371
+ var RulesyncRuleFrontmatterSchema = import_mini44.z.object({
11372
+ root: import_mini44.z.optional(import_mini44.z.boolean()),
11373
+ localRoot: import_mini44.z.optional(import_mini44.z.boolean()),
11374
+ targets: import_mini44.z._default(RulesyncTargetsSchema, ["*"]),
11375
+ description: import_mini44.z.optional(import_mini44.z.string()),
11376
+ globs: import_mini44.z.optional(import_mini44.z.array(import_mini44.z.string())),
11377
+ agentsmd: import_mini44.z.optional(
11378
+ import_mini44.z.object({
11260
11379
  // @example "path/to/subproject"
11261
- subprojectPath: import_mini43.z.optional(import_mini43.z.string())
11380
+ subprojectPath: import_mini44.z.optional(import_mini44.z.string())
11262
11381
  })
11263
11382
  ),
11264
- claudecode: import_mini43.z.optional(
11265
- import_mini43.z.object({
11383
+ claudecode: import_mini44.z.optional(
11384
+ import_mini44.z.object({
11266
11385
  // Glob patterns for conditional rules (takes precedence over globs)
11267
11386
  // @example ["src/**/*.ts", "tests/**/*.test.ts"]
11268
- paths: import_mini43.z.optional(import_mini43.z.array(import_mini43.z.string()))
11387
+ paths: import_mini44.z.optional(import_mini44.z.array(import_mini44.z.string()))
11269
11388
  })
11270
11389
  ),
11271
- cursor: import_mini43.z.optional(
11272
- import_mini43.z.object({
11273
- alwaysApply: import_mini43.z.optional(import_mini43.z.boolean()),
11274
- description: import_mini43.z.optional(import_mini43.z.string()),
11275
- globs: import_mini43.z.optional(import_mini43.z.array(import_mini43.z.string()))
11390
+ cursor: import_mini44.z.optional(
11391
+ import_mini44.z.object({
11392
+ alwaysApply: import_mini44.z.optional(import_mini44.z.boolean()),
11393
+ description: import_mini44.z.optional(import_mini44.z.string()),
11394
+ globs: import_mini44.z.optional(import_mini44.z.array(import_mini44.z.string()))
11276
11395
  })
11277
11396
  ),
11278
- copilot: import_mini43.z.optional(
11279
- import_mini43.z.object({
11280
- excludeAgent: import_mini43.z.optional(import_mini43.z.union([import_mini43.z.literal("code-review"), import_mini43.z.literal("coding-agent")]))
11397
+ copilot: import_mini44.z.optional(
11398
+ import_mini44.z.object({
11399
+ excludeAgent: import_mini44.z.optional(import_mini44.z.union([import_mini44.z.literal("code-review"), import_mini44.z.literal("coding-agent")]))
11281
11400
  })
11282
11401
  ),
11283
- antigravity: import_mini43.z.optional(
11284
- import_mini43.z.looseObject({
11285
- trigger: import_mini43.z.optional(import_mini43.z.string()),
11286
- globs: import_mini43.z.optional(import_mini43.z.array(import_mini43.z.string()))
11402
+ antigravity: import_mini44.z.optional(
11403
+ import_mini44.z.looseObject({
11404
+ trigger: import_mini44.z.optional(import_mini44.z.string()),
11405
+ globs: import_mini44.z.optional(import_mini44.z.array(import_mini44.z.string()))
11287
11406
  })
11288
11407
  )
11289
11408
  });
@@ -11586,20 +11705,20 @@ var AgentsMdRule = class _AgentsMdRule extends ToolRule {
11586
11705
 
11587
11706
  // src/features/rules/antigravity-rule.ts
11588
11707
  var import_node_path89 = require("path");
11589
- var import_mini44 = require("zod/mini");
11590
- var AntigravityRuleFrontmatterSchema = import_mini44.z.looseObject({
11591
- trigger: import_mini44.z.optional(
11592
- import_mini44.z.union([
11593
- import_mini44.z.literal("always_on"),
11594
- import_mini44.z.literal("glob"),
11595
- import_mini44.z.literal("manual"),
11596
- import_mini44.z.literal("model_decision"),
11597
- import_mini44.z.string()
11708
+ var import_mini45 = require("zod/mini");
11709
+ var AntigravityRuleFrontmatterSchema = import_mini45.z.looseObject({
11710
+ trigger: import_mini45.z.optional(
11711
+ import_mini45.z.union([
11712
+ import_mini45.z.literal("always_on"),
11713
+ import_mini45.z.literal("glob"),
11714
+ import_mini45.z.literal("manual"),
11715
+ import_mini45.z.literal("model_decision"),
11716
+ import_mini45.z.string()
11598
11717
  // accepts any string for forward compatibility
11599
11718
  ])
11600
11719
  ),
11601
- globs: import_mini44.z.optional(import_mini44.z.string()),
11602
- description: import_mini44.z.optional(import_mini44.z.string())
11720
+ globs: import_mini45.z.optional(import_mini45.z.string()),
11721
+ description: import_mini45.z.optional(import_mini45.z.string())
11603
11722
  });
11604
11723
  function parseGlobsString(globs) {
11605
11724
  if (!globs) {
@@ -12178,9 +12297,9 @@ var ClaudecodeLegacyRule = class _ClaudecodeLegacyRule extends ToolRule {
12178
12297
 
12179
12298
  // src/features/rules/claudecode-rule.ts
12180
12299
  var import_node_path93 = require("path");
12181
- var import_mini45 = require("zod/mini");
12182
- var ClaudecodeRuleFrontmatterSchema = import_mini45.z.object({
12183
- paths: import_mini45.z.optional(import_mini45.z.array(import_mini45.z.string()))
12300
+ var import_mini46 = require("zod/mini");
12301
+ var ClaudecodeRuleFrontmatterSchema = import_mini46.z.object({
12302
+ paths: import_mini46.z.optional(import_mini46.z.array(import_mini46.z.string()))
12184
12303
  });
12185
12304
  var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
12186
12305
  frontmatter;
@@ -12389,9 +12508,9 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
12389
12508
 
12390
12509
  // src/features/rules/cline-rule.ts
12391
12510
  var import_node_path94 = require("path");
12392
- var import_mini46 = require("zod/mini");
12393
- var ClineRuleFrontmatterSchema = import_mini46.z.object({
12394
- description: import_mini46.z.string()
12511
+ var import_mini47 = require("zod/mini");
12512
+ var ClineRuleFrontmatterSchema = import_mini47.z.object({
12513
+ description: import_mini47.z.string()
12395
12514
  });
12396
12515
  var ClineRule = class _ClineRule extends ToolRule {
12397
12516
  static getSettablePaths(_options = {}) {
@@ -12570,11 +12689,11 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
12570
12689
 
12571
12690
  // src/features/rules/copilot-rule.ts
12572
12691
  var import_node_path96 = require("path");
12573
- var import_mini47 = require("zod/mini");
12574
- var CopilotRuleFrontmatterSchema = import_mini47.z.object({
12575
- description: import_mini47.z.optional(import_mini47.z.string()),
12576
- applyTo: import_mini47.z.optional(import_mini47.z.string()),
12577
- excludeAgent: import_mini47.z.optional(import_mini47.z.union([import_mini47.z.literal("code-review"), import_mini47.z.literal("coding-agent")]))
12692
+ var import_mini48 = require("zod/mini");
12693
+ var CopilotRuleFrontmatterSchema = import_mini48.z.object({
12694
+ description: import_mini48.z.optional(import_mini48.z.string()),
12695
+ applyTo: import_mini48.z.optional(import_mini48.z.string()),
12696
+ excludeAgent: import_mini48.z.optional(import_mini48.z.union([import_mini48.z.literal("code-review"), import_mini48.z.literal("coding-agent")]))
12578
12697
  });
12579
12698
  var CopilotRule = class _CopilotRule extends ToolRule {
12580
12699
  frontmatter;
@@ -12777,11 +12896,11 @@ var CopilotRule = class _CopilotRule extends ToolRule {
12777
12896
 
12778
12897
  // src/features/rules/cursor-rule.ts
12779
12898
  var import_node_path97 = require("path");
12780
- var import_mini48 = require("zod/mini");
12781
- var CursorRuleFrontmatterSchema = import_mini48.z.object({
12782
- description: import_mini48.z.optional(import_mini48.z.string()),
12783
- globs: import_mini48.z.optional(import_mini48.z.string()),
12784
- alwaysApply: import_mini48.z.optional(import_mini48.z.boolean())
12899
+ var import_mini49 = require("zod/mini");
12900
+ var CursorRuleFrontmatterSchema = import_mini49.z.object({
12901
+ description: import_mini49.z.optional(import_mini49.z.string()),
12902
+ globs: import_mini49.z.optional(import_mini49.z.string()),
12903
+ alwaysApply: import_mini49.z.optional(import_mini49.z.boolean())
12785
12904
  });
12786
12905
  var CursorRule = class _CursorRule extends ToolRule {
12787
12906
  frontmatter;
@@ -13200,8 +13319,117 @@ var GeminiCliRule = class _GeminiCliRule extends ToolRule {
13200
13319
  }
13201
13320
  };
13202
13321
 
13203
- // src/features/rules/junie-rule.ts
13322
+ // src/features/rules/goose-rule.ts
13204
13323
  var import_node_path100 = require("path");
13324
+ var GooseRule = class _GooseRule extends ToolRule {
13325
+ static getSettablePaths({
13326
+ global,
13327
+ excludeToolDir
13328
+ } = {}) {
13329
+ if (global) {
13330
+ return {
13331
+ root: {
13332
+ relativeDirPath: ".",
13333
+ relativeFilePath: ".goosehints"
13334
+ }
13335
+ };
13336
+ }
13337
+ return {
13338
+ root: {
13339
+ relativeDirPath: ".",
13340
+ relativeFilePath: ".goosehints"
13341
+ },
13342
+ nonRoot: {
13343
+ relativeDirPath: buildToolPath(".goose", "memories", excludeToolDir)
13344
+ }
13345
+ };
13346
+ }
13347
+ static async fromFile({
13348
+ baseDir = process.cwd(),
13349
+ relativeFilePath,
13350
+ validate = true,
13351
+ global = false
13352
+ }) {
13353
+ const paths = this.getSettablePaths({ global });
13354
+ const isRoot = relativeFilePath === paths.root.relativeFilePath;
13355
+ if (isRoot) {
13356
+ const relativePath2 = paths.root.relativeFilePath;
13357
+ const fileContent2 = await readFileContent(
13358
+ (0, import_node_path100.join)(baseDir, paths.root.relativeDirPath, relativePath2)
13359
+ );
13360
+ return new _GooseRule({
13361
+ baseDir,
13362
+ relativeDirPath: paths.root.relativeDirPath,
13363
+ relativeFilePath: paths.root.relativeFilePath,
13364
+ fileContent: fileContent2,
13365
+ validate,
13366
+ root: true
13367
+ });
13368
+ }
13369
+ if (!paths.nonRoot) {
13370
+ throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
13371
+ }
13372
+ const relativePath = (0, import_node_path100.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
13373
+ const fileContent = await readFileContent((0, import_node_path100.join)(baseDir, relativePath));
13374
+ return new _GooseRule({
13375
+ baseDir,
13376
+ relativeDirPath: paths.nonRoot.relativeDirPath,
13377
+ relativeFilePath,
13378
+ fileContent,
13379
+ validate,
13380
+ root: false
13381
+ });
13382
+ }
13383
+ static fromRulesyncRule({
13384
+ baseDir = process.cwd(),
13385
+ rulesyncRule,
13386
+ validate = true,
13387
+ global = false
13388
+ }) {
13389
+ const paths = this.getSettablePaths({ global });
13390
+ return new _GooseRule(
13391
+ this.buildToolRuleParamsDefault({
13392
+ baseDir,
13393
+ rulesyncRule,
13394
+ validate,
13395
+ rootPath: paths.root,
13396
+ nonRootPath: paths.nonRoot
13397
+ })
13398
+ );
13399
+ }
13400
+ toRulesyncRule() {
13401
+ return this.toRulesyncRuleDefault();
13402
+ }
13403
+ validate() {
13404
+ return { success: true, error: null };
13405
+ }
13406
+ static forDeletion({
13407
+ baseDir = process.cwd(),
13408
+ relativeDirPath,
13409
+ relativeFilePath,
13410
+ global = false
13411
+ }) {
13412
+ const paths = this.getSettablePaths({ global });
13413
+ const isRoot = relativeFilePath === paths.root.relativeFilePath;
13414
+ return new _GooseRule({
13415
+ baseDir,
13416
+ relativeDirPath,
13417
+ relativeFilePath,
13418
+ fileContent: "",
13419
+ validate: false,
13420
+ root: isRoot
13421
+ });
13422
+ }
13423
+ static isTargetedByRulesyncRule(rulesyncRule) {
13424
+ return this.isTargetedByRulesyncRuleDefault({
13425
+ rulesyncRule,
13426
+ toolTarget: "goose"
13427
+ });
13428
+ }
13429
+ };
13430
+
13431
+ // src/features/rules/junie-rule.ts
13432
+ var import_node_path101 = require("path");
13205
13433
  var JunieRule = class _JunieRule extends ToolRule {
13206
13434
  static getSettablePaths(_options = {}) {
13207
13435
  return {
@@ -13220,8 +13448,8 @@ var JunieRule = class _JunieRule extends ToolRule {
13220
13448
  validate = true
13221
13449
  }) {
13222
13450
  const isRoot = relativeFilePath === "guidelines.md";
13223
- const relativePath = isRoot ? "guidelines.md" : (0, import_node_path100.join)(".junie", "memories", relativeFilePath);
13224
- const fileContent = await readFileContent((0, import_node_path100.join)(baseDir, relativePath));
13451
+ const relativePath = isRoot ? "guidelines.md" : (0, import_node_path101.join)(".junie", "memories", relativeFilePath);
13452
+ const fileContent = await readFileContent((0, import_node_path101.join)(baseDir, relativePath));
13225
13453
  return new _JunieRule({
13226
13454
  baseDir,
13227
13455
  relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : this.getSettablePaths().nonRoot.relativeDirPath,
@@ -13276,7 +13504,7 @@ var JunieRule = class _JunieRule extends ToolRule {
13276
13504
  };
13277
13505
 
13278
13506
  // src/features/rules/kilo-rule.ts
13279
- var import_node_path101 = require("path");
13507
+ var import_node_path102 = require("path");
13280
13508
  var KiloRule = class _KiloRule extends ToolRule {
13281
13509
  static getSettablePaths(_options = {}) {
13282
13510
  return {
@@ -13291,7 +13519,7 @@ var KiloRule = class _KiloRule extends ToolRule {
13291
13519
  validate = true
13292
13520
  }) {
13293
13521
  const fileContent = await readFileContent(
13294
- (0, import_node_path101.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
13522
+ (0, import_node_path102.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
13295
13523
  );
13296
13524
  return new _KiloRule({
13297
13525
  baseDir,
@@ -13343,7 +13571,7 @@ var KiloRule = class _KiloRule extends ToolRule {
13343
13571
  };
13344
13572
 
13345
13573
  // src/features/rules/kiro-rule.ts
13346
- var import_node_path102 = require("path");
13574
+ var import_node_path103 = require("path");
13347
13575
  var KiroRule = class _KiroRule extends ToolRule {
13348
13576
  static getSettablePaths(_options = {}) {
13349
13577
  return {
@@ -13358,7 +13586,7 @@ var KiroRule = class _KiroRule extends ToolRule {
13358
13586
  validate = true
13359
13587
  }) {
13360
13588
  const fileContent = await readFileContent(
13361
- (0, import_node_path102.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
13589
+ (0, import_node_path103.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
13362
13590
  );
13363
13591
  return new _KiroRule({
13364
13592
  baseDir,
@@ -13412,7 +13640,7 @@ var KiroRule = class _KiroRule extends ToolRule {
13412
13640
  };
13413
13641
 
13414
13642
  // src/features/rules/opencode-rule.ts
13415
- var import_node_path103 = require("path");
13643
+ var import_node_path104 = require("path");
13416
13644
  var OpenCodeRule = class _OpenCodeRule extends ToolRule {
13417
13645
  static getSettablePaths({
13418
13646
  global,
@@ -13447,7 +13675,7 @@ var OpenCodeRule = class _OpenCodeRule extends ToolRule {
13447
13675
  if (isRoot) {
13448
13676
  const relativePath2 = paths.root.relativeFilePath;
13449
13677
  const fileContent2 = await readFileContent(
13450
- (0, import_node_path103.join)(baseDir, paths.root.relativeDirPath, relativePath2)
13678
+ (0, import_node_path104.join)(baseDir, paths.root.relativeDirPath, relativePath2)
13451
13679
  );
13452
13680
  return new _OpenCodeRule({
13453
13681
  baseDir,
@@ -13461,8 +13689,8 @@ var OpenCodeRule = class _OpenCodeRule extends ToolRule {
13461
13689
  if (!paths.nonRoot) {
13462
13690
  throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
13463
13691
  }
13464
- const relativePath = (0, import_node_path103.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
13465
- const fileContent = await readFileContent((0, import_node_path103.join)(baseDir, relativePath));
13692
+ const relativePath = (0, import_node_path104.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
13693
+ const fileContent = await readFileContent((0, import_node_path104.join)(baseDir, relativePath));
13466
13694
  return new _OpenCodeRule({
13467
13695
  baseDir,
13468
13696
  relativeDirPath: paths.nonRoot.relativeDirPath,
@@ -13521,7 +13749,7 @@ var OpenCodeRule = class _OpenCodeRule extends ToolRule {
13521
13749
  };
13522
13750
 
13523
13751
  // src/features/rules/qwencode-rule.ts
13524
- var import_node_path104 = require("path");
13752
+ var import_node_path105 = require("path");
13525
13753
  var QwencodeRule = class _QwencodeRule extends ToolRule {
13526
13754
  static getSettablePaths(_options = {}) {
13527
13755
  return {
@@ -13540,8 +13768,8 @@ var QwencodeRule = class _QwencodeRule extends ToolRule {
13540
13768
  validate = true
13541
13769
  }) {
13542
13770
  const isRoot = relativeFilePath === "QWEN.md";
13543
- const relativePath = isRoot ? "QWEN.md" : (0, import_node_path104.join)(".qwen", "memories", relativeFilePath);
13544
- const fileContent = await readFileContent((0, import_node_path104.join)(baseDir, relativePath));
13771
+ const relativePath = isRoot ? "QWEN.md" : (0, import_node_path105.join)(".qwen", "memories", relativeFilePath);
13772
+ const fileContent = await readFileContent((0, import_node_path105.join)(baseDir, relativePath));
13545
13773
  return new _QwencodeRule({
13546
13774
  baseDir,
13547
13775
  relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : this.getSettablePaths().nonRoot.relativeDirPath,
@@ -13593,7 +13821,7 @@ var QwencodeRule = class _QwencodeRule extends ToolRule {
13593
13821
  };
13594
13822
 
13595
13823
  // src/features/rules/replit-rule.ts
13596
- var import_node_path105 = require("path");
13824
+ var import_node_path106 = require("path");
13597
13825
  var ReplitRule = class _ReplitRule extends ToolRule {
13598
13826
  static getSettablePaths(_options = {}) {
13599
13827
  return {
@@ -13615,7 +13843,7 @@ var ReplitRule = class _ReplitRule extends ToolRule {
13615
13843
  }
13616
13844
  const relativePath = paths.root.relativeFilePath;
13617
13845
  const fileContent = await readFileContent(
13618
- (0, import_node_path105.join)(baseDir, paths.root.relativeDirPath, relativePath)
13846
+ (0, import_node_path106.join)(baseDir, paths.root.relativeDirPath, relativePath)
13619
13847
  );
13620
13848
  return new _ReplitRule({
13621
13849
  baseDir,
@@ -13681,7 +13909,7 @@ var ReplitRule = class _ReplitRule extends ToolRule {
13681
13909
  };
13682
13910
 
13683
13911
  // src/features/rules/roo-rule.ts
13684
- var import_node_path106 = require("path");
13912
+ var import_node_path107 = require("path");
13685
13913
  var RooRule = class _RooRule extends ToolRule {
13686
13914
  static getSettablePaths(_options = {}) {
13687
13915
  return {
@@ -13696,7 +13924,7 @@ var RooRule = class _RooRule extends ToolRule {
13696
13924
  validate = true
13697
13925
  }) {
13698
13926
  const fileContent = await readFileContent(
13699
- (0, import_node_path106.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
13927
+ (0, import_node_path107.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
13700
13928
  );
13701
13929
  return new _RooRule({
13702
13930
  baseDir,
@@ -13765,7 +13993,7 @@ var RooRule = class _RooRule extends ToolRule {
13765
13993
  };
13766
13994
 
13767
13995
  // src/features/rules/warp-rule.ts
13768
- var import_node_path107 = require("path");
13996
+ var import_node_path108 = require("path");
13769
13997
  var WarpRule = class _WarpRule extends ToolRule {
13770
13998
  constructor({ fileContent, root, ...rest }) {
13771
13999
  super({
@@ -13791,8 +14019,8 @@ var WarpRule = class _WarpRule extends ToolRule {
13791
14019
  validate = true
13792
14020
  }) {
13793
14021
  const isRoot = relativeFilePath === this.getSettablePaths().root.relativeFilePath;
13794
- const relativePath = isRoot ? this.getSettablePaths().root.relativeFilePath : (0, import_node_path107.join)(this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath);
13795
- const fileContent = await readFileContent((0, import_node_path107.join)(baseDir, relativePath));
14022
+ const relativePath = isRoot ? this.getSettablePaths().root.relativeFilePath : (0, import_node_path108.join)(this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath);
14023
+ const fileContent = await readFileContent((0, import_node_path108.join)(baseDir, relativePath));
13796
14024
  return new _WarpRule({
13797
14025
  baseDir,
13798
14026
  relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : ".warp",
@@ -13847,7 +14075,7 @@ var WarpRule = class _WarpRule extends ToolRule {
13847
14075
  };
13848
14076
 
13849
14077
  // src/features/rules/windsurf-rule.ts
13850
- var import_node_path108 = require("path");
14078
+ var import_node_path109 = require("path");
13851
14079
  var WindsurfRule = class _WindsurfRule extends ToolRule {
13852
14080
  static getSettablePaths(_options = {}) {
13853
14081
  return {
@@ -13862,7 +14090,7 @@ var WindsurfRule = class _WindsurfRule extends ToolRule {
13862
14090
  validate = true
13863
14091
  }) {
13864
14092
  const fileContent = await readFileContent(
13865
- (0, import_node_path108.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
14093
+ (0, import_node_path109.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
13866
14094
  );
13867
14095
  return new _WindsurfRule({
13868
14096
  baseDir,
@@ -13927,6 +14155,7 @@ var rulesProcessorToolTargets = [
13927
14155
  "cursor",
13928
14156
  "factorydroid",
13929
14157
  "geminicli",
14158
+ "goose",
13930
14159
  "junie",
13931
14160
  "kilo",
13932
14161
  "kiro",
@@ -13937,8 +14166,8 @@ var rulesProcessorToolTargets = [
13937
14166
  "warp",
13938
14167
  "windsurf"
13939
14168
  ];
13940
- var RulesProcessorToolTargetSchema = import_mini49.z.enum(rulesProcessorToolTargets);
13941
- var formatRulePaths = (rules) => rules.map((r) => (0, import_node_path109.join)(r.getRelativeDirPath(), r.getRelativeFilePath())).join(", ");
14169
+ var RulesProcessorToolTargetSchema = import_mini50.z.enum(rulesProcessorToolTargets);
14170
+ var formatRulePaths = (rules) => rules.map((r) => (0, import_node_path110.join)(r.getRelativeDirPath(), r.getRelativeFilePath())).join(", ");
13942
14171
  var toolRuleFactories = /* @__PURE__ */ new Map([
13943
14172
  [
13944
14173
  "agentsmd",
@@ -14029,10 +14258,7 @@ var toolRuleFactories = /* @__PURE__ */ new Map([
14029
14258
  meta: {
14030
14259
  extension: "md",
14031
14260
  supportsGlobal: true,
14032
- ruleDiscoveryMode: "toon",
14033
- additionalConventions: {
14034
- subagents: { subagentClass: CodexCliSubagent }
14035
- }
14261
+ ruleDiscoveryMode: "toon"
14036
14262
  }
14037
14263
  }
14038
14264
  ],
@@ -14088,6 +14314,17 @@ var toolRuleFactories = /* @__PURE__ */ new Map([
14088
14314
  }
14089
14315
  }
14090
14316
  ],
14317
+ [
14318
+ "goose",
14319
+ {
14320
+ class: GooseRule,
14321
+ meta: {
14322
+ extension: "md",
14323
+ supportsGlobal: true,
14324
+ ruleDiscoveryMode: "toon"
14325
+ }
14326
+ }
14327
+ ],
14091
14328
  [
14092
14329
  "junie",
14093
14330
  {
@@ -14305,7 +14542,7 @@ var RulesProcessor = class extends FeatureProcessor {
14305
14542
  }).relativeDirPath;
14306
14543
  return this.skills.filter((skill) => skillClass.isTargetedByRulesyncSkill(skill)).map((skill) => {
14307
14544
  const frontmatter = skill.getFrontmatter();
14308
- const relativePath = (0, import_node_path109.join)(toolRelativeDirPath, skill.getDirName(), SKILL_FILE_NAME);
14545
+ const relativePath = (0, import_node_path110.join)(toolRelativeDirPath, skill.getDirName(), SKILL_FILE_NAME);
14309
14546
  return {
14310
14547
  name: frontmatter.name,
14311
14548
  description: frontmatter.description,
@@ -14418,12 +14655,12 @@ var RulesProcessor = class extends FeatureProcessor {
14418
14655
  * Load and parse rulesync rule files from .rulesync/rules/ directory
14419
14656
  */
14420
14657
  async loadRulesyncFiles() {
14421
- const rulesyncBaseDir = (0, import_node_path109.join)(this.baseDir, RULESYNC_RULES_RELATIVE_DIR_PATH);
14422
- const files = await findFilesByGlobs((0, import_node_path109.join)(rulesyncBaseDir, "**", "*.md"));
14658
+ const rulesyncBaseDir = (0, import_node_path110.join)(this.baseDir, RULESYNC_RULES_RELATIVE_DIR_PATH);
14659
+ const files = await findFilesByGlobs((0, import_node_path110.join)(rulesyncBaseDir, "**", "*.md"));
14423
14660
  logger.debug(`Found ${files.length} rulesync files`);
14424
14661
  const rulesyncRules = await Promise.all(
14425
14662
  files.map((file) => {
14426
- const relativeFilePath = (0, import_node_path109.relative)(rulesyncBaseDir, file);
14663
+ const relativeFilePath = (0, import_node_path110.relative)(rulesyncBaseDir, file);
14427
14664
  checkPathTraversal({
14428
14665
  relativePath: relativeFilePath,
14429
14666
  intendedRootDir: rulesyncBaseDir
@@ -14486,7 +14723,7 @@ var RulesProcessor = class extends FeatureProcessor {
14486
14723
  return [];
14487
14724
  }
14488
14725
  const rootFilePaths = await findFilesByGlobs(
14489
- (0, import_node_path109.join)(
14726
+ (0, import_node_path110.join)(
14490
14727
  this.baseDir,
14491
14728
  settablePaths.root.relativeDirPath ?? ".",
14492
14729
  settablePaths.root.relativeFilePath
@@ -14497,7 +14734,7 @@ var RulesProcessor = class extends FeatureProcessor {
14497
14734
  (filePath) => factory.class.forDeletion({
14498
14735
  baseDir: this.baseDir,
14499
14736
  relativeDirPath: settablePaths.root?.relativeDirPath ?? ".",
14500
- relativeFilePath: (0, import_node_path109.basename)(filePath),
14737
+ relativeFilePath: (0, import_node_path110.basename)(filePath),
14501
14738
  global: this.global
14502
14739
  })
14503
14740
  ).filter((rule) => rule.isDeletable());
@@ -14506,7 +14743,7 @@ var RulesProcessor = class extends FeatureProcessor {
14506
14743
  rootFilePaths.map(
14507
14744
  (filePath) => factory.class.fromFile({
14508
14745
  baseDir: this.baseDir,
14509
- relativeFilePath: (0, import_node_path109.basename)(filePath),
14746
+ relativeFilePath: (0, import_node_path110.basename)(filePath),
14510
14747
  global: this.global
14511
14748
  })
14512
14749
  )
@@ -14524,13 +14761,13 @@ var RulesProcessor = class extends FeatureProcessor {
14524
14761
  return [];
14525
14762
  }
14526
14763
  const localRootFilePaths = await findFilesByGlobs(
14527
- (0, import_node_path109.join)(this.baseDir, settablePaths.root.relativeDirPath ?? ".", "CLAUDE.local.md")
14764
+ (0, import_node_path110.join)(this.baseDir, settablePaths.root.relativeDirPath ?? ".", "CLAUDE.local.md")
14528
14765
  );
14529
14766
  return localRootFilePaths.map(
14530
14767
  (filePath) => factory.class.forDeletion({
14531
14768
  baseDir: this.baseDir,
14532
14769
  relativeDirPath: settablePaths.root?.relativeDirPath ?? ".",
14533
- relativeFilePath: (0, import_node_path109.basename)(filePath),
14770
+ relativeFilePath: (0, import_node_path110.basename)(filePath),
14534
14771
  global: this.global
14535
14772
  })
14536
14773
  ).filter((rule) => rule.isDeletable());
@@ -14540,13 +14777,13 @@ var RulesProcessor = class extends FeatureProcessor {
14540
14777
  if (!settablePaths.nonRoot) {
14541
14778
  return [];
14542
14779
  }
14543
- const nonRootBaseDir = (0, import_node_path109.join)(this.baseDir, settablePaths.nonRoot.relativeDirPath);
14780
+ const nonRootBaseDir = (0, import_node_path110.join)(this.baseDir, settablePaths.nonRoot.relativeDirPath);
14544
14781
  const nonRootFilePaths = await findFilesByGlobs(
14545
- (0, import_node_path109.join)(nonRootBaseDir, "**", `*.${factory.meta.extension}`)
14782
+ (0, import_node_path110.join)(nonRootBaseDir, "**", `*.${factory.meta.extension}`)
14546
14783
  );
14547
14784
  if (forDeletion) {
14548
14785
  return nonRootFilePaths.map((filePath) => {
14549
- const relativeFilePath = (0, import_node_path109.relative)(nonRootBaseDir, filePath);
14786
+ const relativeFilePath = (0, import_node_path110.relative)(nonRootBaseDir, filePath);
14550
14787
  checkPathTraversal({
14551
14788
  relativePath: relativeFilePath,
14552
14789
  intendedRootDir: nonRootBaseDir
@@ -14561,7 +14798,7 @@ var RulesProcessor = class extends FeatureProcessor {
14561
14798
  }
14562
14799
  return await Promise.all(
14563
14800
  nonRootFilePaths.map((filePath) => {
14564
- const relativeFilePath = (0, import_node_path109.relative)(nonRootBaseDir, filePath);
14801
+ const relativeFilePath = (0, import_node_path110.relative)(nonRootBaseDir, filePath);
14565
14802
  checkPathTraversal({
14566
14803
  relativePath: relativeFilePath,
14567
14804
  intendedRootDir: nonRootBaseDir
@@ -14674,14 +14911,14 @@ s/<command> [arguments]
14674
14911
  This syntax employs a double slash (\`s/\`) to prevent conflicts with built-in slash commands.
14675
14912
  The \`s\` in \`s/\` stands for *simulate*. Because custom slash commands are not built-in, this syntax provides a pseudo way to invoke them.
14676
14913
 
14677
- When users call a custom slash command, you have to look for the markdown file, \`${(0, import_node_path109.join)(RULESYNC_COMMANDS_RELATIVE_DIR_PATH, "{command}.md")}\`, then execute the contents of that file as the block of operations.` : "";
14914
+ When users call a custom slash command, you have to look for the markdown file, \`${(0, import_node_path110.join)(RULESYNC_COMMANDS_RELATIVE_DIR_PATH, "{command}.md")}\`, then execute the contents of that file as the block of operations.` : "";
14678
14915
  const subagentsSection = subagents ? `## Simulated Subagents
14679
14916
 
14680
14917
  Simulated subagents are specialized AI assistants that can be invoked to handle specific types of tasks. In this case, it can be appear something like custom slash commands simply. Simulated subagents can be called by custom slash commands.
14681
14918
 
14682
- When users call a simulated subagent, it will look for the corresponding markdown file, \`${(0, import_node_path109.join)(RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, "{subagent}.md")}\`, and execute its contents as the block of operations.
14919
+ When users call a simulated subagent, it will look for the corresponding markdown file, \`${(0, import_node_path110.join)(RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, "{subagent}.md")}\`, and execute its contents as the block of operations.
14683
14920
 
14684
- For example, if the user instructs \`Call planner subagent to plan the refactoring\`, you have to look for the markdown file, \`${(0, import_node_path109.join)(RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, "planner.md")}\`, and execute its contents as the block of operations.` : "";
14921
+ For example, if the user instructs \`Call planner subagent to plan the refactoring\`, you have to look for the markdown file, \`${(0, import_node_path110.join)(RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, "planner.md")}\`, and execute its contents as the block of operations.` : "";
14685
14922
  const skillsSection = skills ? this.generateSkillsSection(skills) : "";
14686
14923
  const result = [
14687
14924
  overview,
@@ -14753,7 +14990,7 @@ async function processEmptyFeatureGeneration(params) {
14753
14990
  return { count: totalCount, paths: [], hasDiff };
14754
14991
  }
14755
14992
  async function checkRulesyncDirExists(params) {
14756
- return fileExists((0, import_node_path110.join)(params.baseDir, RULESYNC_RELATIVE_DIR_PATH));
14993
+ return fileExists((0, import_node_path111.join)(params.baseDir, RULESYNC_RELATIVE_DIR_PATH));
14757
14994
  }
14758
14995
  async function generate(params) {
14759
14996
  const { config } = params;