rulesync 7.22.0 → 7.23.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
@@ -274,6 +274,7 @@ var ALL_TOOL_TARGETS = [
274
274
  "copilot",
275
275
  "copilotcli",
276
276
  "cursor",
277
+ "deepagents",
277
278
  "factorydroid",
278
279
  "geminicli",
279
280
  "goose",
@@ -608,7 +609,7 @@ function getBaseDirsInLightOfGlobal({
608
609
  }
609
610
 
610
611
  // src/lib/generate.ts
611
- var import_node_path120 = require("path");
612
+ var import_node_path125 = require("path");
612
613
  var import_es_toolkit4 = require("es-toolkit");
613
614
 
614
615
  // src/features/commands/commands-processor.ts
@@ -3292,6 +3293,15 @@ var FACTORYDROID_HOOK_EVENTS = [
3292
3293
  "notification",
3293
3294
  "setup"
3294
3295
  ];
3296
+ var DEEPAGENTS_HOOK_EVENTS = [
3297
+ "sessionStart",
3298
+ "sessionEnd",
3299
+ "beforeSubmitPrompt",
3300
+ "permissionRequest",
3301
+ "postToolUseFailure",
3302
+ "stop",
3303
+ "preCompact"
3304
+ ];
3295
3305
  var GEMINICLI_HOOK_EVENTS = [
3296
3306
  "sessionStart",
3297
3307
  "sessionEnd",
@@ -3314,7 +3324,8 @@ var HooksConfigSchema = import_mini15.z.looseObject({
3314
3324
  copilot: import_mini15.z.optional(import_mini15.z.looseObject({ hooks: import_mini15.z.optional(hooksRecordSchema) })),
3315
3325
  opencode: import_mini15.z.optional(import_mini15.z.looseObject({ hooks: import_mini15.z.optional(hooksRecordSchema) })),
3316
3326
  factorydroid: import_mini15.z.optional(import_mini15.z.looseObject({ hooks: import_mini15.z.optional(hooksRecordSchema) })),
3317
- geminicli: import_mini15.z.optional(import_mini15.z.looseObject({ hooks: import_mini15.z.optional(hooksRecordSchema) }))
3327
+ geminicli: import_mini15.z.optional(import_mini15.z.looseObject({ hooks: import_mini15.z.optional(hooksRecordSchema) })),
3328
+ deepagents: import_mini15.z.optional(import_mini15.z.looseObject({ hooks: import_mini15.z.optional(hooksRecordSchema) }))
3318
3329
  });
3319
3330
  var CANONICAL_TO_CLAUDE_EVENT_NAMES = {
3320
3331
  sessionStart: "SessionStart",
@@ -3411,6 +3422,18 @@ var CANONICAL_TO_GEMINICLI_EVENT_NAMES = {
3411
3422
  var GEMINICLI_TO_CANONICAL_EVENT_NAMES = Object.fromEntries(
3412
3423
  Object.entries(CANONICAL_TO_GEMINICLI_EVENT_NAMES).map(([k, v]) => [v, k])
3413
3424
  );
3425
+ var CANONICAL_TO_DEEPAGENTS_EVENT_NAMES = {
3426
+ sessionStart: "session.start",
3427
+ sessionEnd: "session.end",
3428
+ beforeSubmitPrompt: "user.prompt",
3429
+ permissionRequest: "permission.request",
3430
+ postToolUseFailure: "tool.error",
3431
+ stop: "task.complete",
3432
+ preCompact: "context.compact"
3433
+ };
3434
+ var DEEPAGENTS_TO_CANONICAL_EVENT_NAMES = Object.fromEntries(
3435
+ Object.entries(CANONICAL_TO_DEEPAGENTS_EVENT_NAMES).map(([k, v]) => [v, k])
3436
+ );
3414
3437
 
3415
3438
  // src/features/hooks/claudecode-hooks.ts
3416
3439
  var import_node_path24 = require("path");
@@ -4013,8 +4036,145 @@ var CursorHooks = class _CursorHooks extends ToolHooks {
4013
4036
  }
4014
4037
  };
4015
4038
 
4016
- // src/features/hooks/factorydroid-hooks.ts
4039
+ // src/features/hooks/deepagents-hooks.ts
4017
4040
  var import_node_path27 = require("path");
4041
+ function isDeepagentsHooksFile(val) {
4042
+ if (typeof val !== "object" || val === null || !("hooks" in val)) return false;
4043
+ return Array.isArray(val.hooks);
4044
+ }
4045
+ function canonicalToDeepagentsHooks(config) {
4046
+ const supported = new Set(DEEPAGENTS_HOOK_EVENTS);
4047
+ const effectiveHooks = {
4048
+ ...config.hooks,
4049
+ ...config.deepagents?.hooks
4050
+ };
4051
+ const entries = [];
4052
+ for (const [canonicalEvent, definitions] of Object.entries(effectiveHooks)) {
4053
+ if (!supported.has(canonicalEvent)) continue;
4054
+ const deepagentsEvent = CANONICAL_TO_DEEPAGENTS_EVENT_NAMES[canonicalEvent];
4055
+ if (!deepagentsEvent) continue;
4056
+ for (const def of definitions) {
4057
+ if (def.type === "prompt") continue;
4058
+ if (!def.command) continue;
4059
+ if (def.matcher) continue;
4060
+ entries.push({
4061
+ command: ["bash", "-c", def.command],
4062
+ events: [deepagentsEvent]
4063
+ });
4064
+ }
4065
+ }
4066
+ return entries;
4067
+ }
4068
+ function deepagentsToCanonicalHooks(hooksEntries) {
4069
+ const canonical = {};
4070
+ for (const entry of hooksEntries) {
4071
+ if (!Array.isArray(entry.command) || entry.command.length === 0) continue;
4072
+ let command;
4073
+ if (entry.command.length === 3 && entry.command[0] === "bash" && entry.command[1] === "-c") {
4074
+ command = entry.command[2] ?? "";
4075
+ } else {
4076
+ command = entry.command.join(" ");
4077
+ }
4078
+ const events = entry.events ?? [];
4079
+ for (const deepagentsEvent of events) {
4080
+ const canonicalEvent = DEEPAGENTS_TO_CANONICAL_EVENT_NAMES[deepagentsEvent];
4081
+ if (!canonicalEvent) continue;
4082
+ const existing = canonical[canonicalEvent];
4083
+ if (existing) {
4084
+ existing.push({ type: "command", command });
4085
+ } else {
4086
+ canonical[canonicalEvent] = [{ type: "command", command }];
4087
+ }
4088
+ }
4089
+ }
4090
+ return canonical;
4091
+ }
4092
+ var DeepagentsHooks = class _DeepagentsHooks extends ToolHooks {
4093
+ constructor(params) {
4094
+ super({
4095
+ ...params,
4096
+ fileContent: params.fileContent ?? JSON.stringify({ hooks: [] }, null, 2)
4097
+ });
4098
+ }
4099
+ isDeletable() {
4100
+ return true;
4101
+ }
4102
+ static getSettablePaths(_options = {}) {
4103
+ return {
4104
+ relativeDirPath: ".deepagents",
4105
+ relativeFilePath: "hooks.json"
4106
+ };
4107
+ }
4108
+ static async fromFile({
4109
+ baseDir = process.cwd(),
4110
+ validate = true,
4111
+ global = false
4112
+ }) {
4113
+ const paths = _DeepagentsHooks.getSettablePaths({ global });
4114
+ const filePath = (0, import_node_path27.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath);
4115
+ const fileContent = await readFileContentOrNull(filePath) ?? JSON.stringify({ hooks: [] }, null, 2);
4116
+ return new _DeepagentsHooks({
4117
+ baseDir,
4118
+ relativeDirPath: paths.relativeDirPath,
4119
+ relativeFilePath: paths.relativeFilePath,
4120
+ fileContent,
4121
+ validate
4122
+ });
4123
+ }
4124
+ static fromRulesyncHooks({
4125
+ baseDir = process.cwd(),
4126
+ rulesyncHooks,
4127
+ validate = true,
4128
+ global = false
4129
+ }) {
4130
+ const config = rulesyncHooks.getJson();
4131
+ const hooks = canonicalToDeepagentsHooks(config);
4132
+ const fileContent = JSON.stringify({ hooks }, null, 2);
4133
+ const paths = _DeepagentsHooks.getSettablePaths({ global });
4134
+ return new _DeepagentsHooks({
4135
+ baseDir,
4136
+ relativeDirPath: paths.relativeDirPath,
4137
+ relativeFilePath: paths.relativeFilePath,
4138
+ fileContent,
4139
+ validate
4140
+ });
4141
+ }
4142
+ toRulesyncHooks() {
4143
+ let parsed;
4144
+ try {
4145
+ parsed = JSON.parse(this.getFileContent());
4146
+ } catch (error) {
4147
+ throw new Error(
4148
+ `Failed to parse deepagents hooks content in ${(0, import_node_path27.join)(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${formatError(error)}`,
4149
+ { cause: error }
4150
+ );
4151
+ }
4152
+ const hooksEntries = isDeepagentsHooksFile(parsed) ? parsed.hooks : [];
4153
+ const hooks = deepagentsToCanonicalHooks(hooksEntries);
4154
+ return this.toRulesyncHooksDefault({
4155
+ fileContent: JSON.stringify({ version: 1, hooks }, null, 2)
4156
+ });
4157
+ }
4158
+ validate() {
4159
+ return { success: true, error: null };
4160
+ }
4161
+ static forDeletion({
4162
+ baseDir = process.cwd(),
4163
+ relativeDirPath,
4164
+ relativeFilePath
4165
+ }) {
4166
+ return new _DeepagentsHooks({
4167
+ baseDir,
4168
+ relativeDirPath,
4169
+ relativeFilePath,
4170
+ fileContent: JSON.stringify({ hooks: [] }, null, 2),
4171
+ validate: false
4172
+ });
4173
+ }
4174
+ };
4175
+
4176
+ // src/features/hooks/factorydroid-hooks.ts
4177
+ var import_node_path28 = require("path");
4018
4178
  var FACTORYDROID_CONVERTER_CONFIG = {
4019
4179
  supportedEvents: FACTORYDROID_HOOK_EVENTS,
4020
4180
  canonicalToToolEventNames: CANONICAL_TO_FACTORYDROID_EVENT_NAMES,
@@ -4040,7 +4200,7 @@ var FactorydroidHooks = class _FactorydroidHooks extends ToolHooks {
4040
4200
  global = false
4041
4201
  }) {
4042
4202
  const paths = _FactorydroidHooks.getSettablePaths({ global });
4043
- const filePath = (0, import_node_path27.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath);
4203
+ const filePath = (0, import_node_path28.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath);
4044
4204
  const fileContent = await readFileContentOrNull(filePath) ?? '{"hooks":{}}';
4045
4205
  return new _FactorydroidHooks({
4046
4206
  baseDir,
@@ -4058,7 +4218,7 @@ var FactorydroidHooks = class _FactorydroidHooks extends ToolHooks {
4058
4218
  logger
4059
4219
  }) {
4060
4220
  const paths = _FactorydroidHooks.getSettablePaths({ global });
4061
- const filePath = (0, import_node_path27.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath);
4221
+ const filePath = (0, import_node_path28.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath);
4062
4222
  const existingContent = await readOrInitializeFileContent(
4063
4223
  filePath,
4064
4224
  JSON.stringify({}, null, 2)
@@ -4095,7 +4255,7 @@ var FactorydroidHooks = class _FactorydroidHooks extends ToolHooks {
4095
4255
  settings = JSON.parse(this.getFileContent());
4096
4256
  } catch (error) {
4097
4257
  throw new Error(
4098
- `Failed to parse Factory Droid hooks content in ${(0, import_node_path27.join)(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${formatError(error)}`,
4258
+ `Failed to parse Factory Droid hooks content in ${(0, import_node_path28.join)(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${formatError(error)}`,
4099
4259
  {
4100
4260
  cause: error
4101
4261
  }
@@ -4128,7 +4288,7 @@ var FactorydroidHooks = class _FactorydroidHooks extends ToolHooks {
4128
4288
  };
4129
4289
 
4130
4290
  // src/features/hooks/geminicli-hooks.ts
4131
- var import_node_path28 = require("path");
4291
+ var import_node_path29 = require("path");
4132
4292
  var import_mini17 = require("zod/mini");
4133
4293
  function canonicalToGeminicliHooks(config) {
4134
4294
  const geminiSupported = new Set(GEMINICLI_HOOK_EVENTS);
@@ -4237,7 +4397,7 @@ var GeminicliHooks = class _GeminicliHooks extends ToolHooks {
4237
4397
  global = false
4238
4398
  }) {
4239
4399
  const paths = _GeminicliHooks.getSettablePaths({ global });
4240
- const filePath = (0, import_node_path28.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath);
4400
+ const filePath = (0, import_node_path29.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath);
4241
4401
  const fileContent = await readFileContentOrNull(filePath) ?? '{"hooks":{}}';
4242
4402
  return new _GeminicliHooks({
4243
4403
  baseDir,
@@ -4254,7 +4414,7 @@ var GeminicliHooks = class _GeminicliHooks extends ToolHooks {
4254
4414
  global = false
4255
4415
  }) {
4256
4416
  const paths = _GeminicliHooks.getSettablePaths({ global });
4257
- const filePath = (0, import_node_path28.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath);
4417
+ const filePath = (0, import_node_path29.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath);
4258
4418
  const existingContent = await readOrInitializeFileContent(
4259
4419
  filePath,
4260
4420
  JSON.stringify({}, null, 2)
@@ -4286,7 +4446,7 @@ var GeminicliHooks = class _GeminicliHooks extends ToolHooks {
4286
4446
  settings = JSON.parse(this.getFileContent());
4287
4447
  } catch (error) {
4288
4448
  throw new Error(
4289
- `Failed to parse Gemini CLI hooks content in ${(0, import_node_path28.join)(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${formatError(error)}`,
4449
+ `Failed to parse Gemini CLI hooks content in ${(0, import_node_path29.join)(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${formatError(error)}`,
4290
4450
  {
4291
4451
  cause: error
4292
4452
  }
@@ -4316,7 +4476,7 @@ var GeminicliHooks = class _GeminicliHooks extends ToolHooks {
4316
4476
  };
4317
4477
 
4318
4478
  // src/features/hooks/opencode-hooks.ts
4319
- var import_node_path29 = require("path");
4479
+ var import_node_path30 = require("path");
4320
4480
  var NAMED_HOOKS = /* @__PURE__ */ new Set(["tool.execute.before", "tool.execute.after"]);
4321
4481
  function escapeForTemplateLiteral(command) {
4322
4482
  return command.replace(/\\/g, "\\\\").replace(/`/g, "\\`").replace(/\$\{/g, "\\${");
@@ -4414,7 +4574,7 @@ var OpencodeHooks = class _OpencodeHooks extends ToolHooks {
4414
4574
  }
4415
4575
  static getSettablePaths(options) {
4416
4576
  return {
4417
- relativeDirPath: options?.global ? (0, import_node_path29.join)(".config", "opencode", "plugins") : (0, import_node_path29.join)(".opencode", "plugins"),
4577
+ relativeDirPath: options?.global ? (0, import_node_path30.join)(".config", "opencode", "plugins") : (0, import_node_path30.join)(".opencode", "plugins"),
4418
4578
  relativeFilePath: "rulesync-hooks.js"
4419
4579
  };
4420
4580
  }
@@ -4425,7 +4585,7 @@ var OpencodeHooks = class _OpencodeHooks extends ToolHooks {
4425
4585
  }) {
4426
4586
  const paths = _OpencodeHooks.getSettablePaths({ global });
4427
4587
  const fileContent = await readFileContent(
4428
- (0, import_node_path29.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath)
4588
+ (0, import_node_path30.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath)
4429
4589
  );
4430
4590
  return new _OpencodeHooks({
4431
4591
  baseDir,
@@ -4480,7 +4640,8 @@ var hooksProcessorToolTargetTuple = [
4480
4640
  "copilot",
4481
4641
  "opencode",
4482
4642
  "factorydroid",
4483
- "geminicli"
4643
+ "geminicli",
4644
+ "deepagents"
4484
4645
  ];
4485
4646
  var HooksProcessorToolTargetSchema = import_mini18.z.enum(hooksProcessorToolTargetTuple);
4486
4647
  var toolHooksFactories = /* @__PURE__ */ new Map([
@@ -4563,11 +4724,21 @@ var toolHooksFactories = /* @__PURE__ */ new Map([
4563
4724
  supportedHookTypes: ["command"],
4564
4725
  supportsMatcher: true
4565
4726
  }
4727
+ ],
4728
+ [
4729
+ "deepagents",
4730
+ {
4731
+ class: DeepagentsHooks,
4732
+ meta: { supportsProject: false, supportsGlobal: true, supportsImport: true },
4733
+ supportedEvents: DEEPAGENTS_HOOK_EVENTS,
4734
+ supportedHookTypes: ["command"],
4735
+ supportsMatcher: false
4736
+ }
4566
4737
  ]
4567
4738
  ]);
4568
- var hooksProcessorToolTargets = [...toolHooksFactories.keys()];
4739
+ var hooksProcessorToolTargets = [...toolHooksFactories.entries()].filter(([, f]) => f.meta.supportsProject).map(([t]) => t);
4569
4740
  var hooksProcessorToolTargetsGlobal = [...toolHooksFactories.entries()].filter(([, f]) => f.meta.supportsGlobal).map(([t]) => t);
4570
- var hooksProcessorToolTargetsImportable = [...toolHooksFactories.entries()].filter(([, f]) => f.meta.supportsImport).map(([t]) => t);
4741
+ var hooksProcessorToolTargetsImportable = [...toolHooksFactories.entries()].filter(([, f]) => f.meta.supportsProject && f.meta.supportsImport).map(([t]) => t);
4571
4742
  var hooksProcessorToolTargetsGlobalImportable = [...toolHooksFactories.entries()].filter(([, f]) => f.meta.supportsGlobal && f.meta.supportsImport).map(([t]) => t);
4572
4743
  var HooksProcessor = class extends FeatureProcessor {
4573
4744
  toolTarget;
@@ -4721,10 +4892,10 @@ var HooksProcessor = class extends FeatureProcessor {
4721
4892
  var import_mini19 = require("zod/mini");
4722
4893
 
4723
4894
  // src/features/ignore/augmentcode-ignore.ts
4724
- var import_node_path31 = require("path");
4895
+ var import_node_path32 = require("path");
4725
4896
 
4726
4897
  // src/features/ignore/rulesync-ignore.ts
4727
- var import_node_path30 = require("path");
4898
+ var import_node_path31 = require("path");
4728
4899
  var RulesyncIgnore = class _RulesyncIgnore extends RulesyncFile {
4729
4900
  validate() {
4730
4901
  return { success: true, error: null };
@@ -4744,12 +4915,12 @@ var RulesyncIgnore = class _RulesyncIgnore extends RulesyncFile {
4744
4915
  static async fromFile() {
4745
4916
  const baseDir = process.cwd();
4746
4917
  const paths = this.getSettablePaths();
4747
- const recommendedPath = (0, import_node_path30.join)(
4918
+ const recommendedPath = (0, import_node_path31.join)(
4748
4919
  baseDir,
4749
4920
  paths.recommended.relativeDirPath,
4750
4921
  paths.recommended.relativeFilePath
4751
4922
  );
4752
- const legacyPath = (0, import_node_path30.join)(baseDir, paths.legacy.relativeDirPath, paths.legacy.relativeFilePath);
4923
+ const legacyPath = (0, import_node_path31.join)(baseDir, paths.legacy.relativeDirPath, paths.legacy.relativeFilePath);
4753
4924
  if (await fileExists(recommendedPath)) {
4754
4925
  const fileContent2 = await readFileContent(recommendedPath);
4755
4926
  return new _RulesyncIgnore({
@@ -4865,7 +5036,7 @@ var AugmentcodeIgnore = class _AugmentcodeIgnore extends ToolIgnore {
4865
5036
  validate = true
4866
5037
  }) {
4867
5038
  const fileContent = await readFileContent(
4868
- (0, import_node_path31.join)(
5039
+ (0, import_node_path32.join)(
4869
5040
  baseDir,
4870
5041
  this.getSettablePaths().relativeDirPath,
4871
5042
  this.getSettablePaths().relativeFilePath
@@ -4895,7 +5066,7 @@ var AugmentcodeIgnore = class _AugmentcodeIgnore extends ToolIgnore {
4895
5066
  };
4896
5067
 
4897
5068
  // src/features/ignore/claudecode-ignore.ts
4898
- var import_node_path32 = require("path");
5069
+ var import_node_path33 = require("path");
4899
5070
  var import_es_toolkit2 = require("es-toolkit");
4900
5071
  var ClaudecodeIgnore = class _ClaudecodeIgnore extends ToolIgnore {
4901
5072
  constructor(params) {
@@ -4938,7 +5109,7 @@ var ClaudecodeIgnore = class _ClaudecodeIgnore extends ToolIgnore {
4938
5109
  const fileContent = rulesyncIgnore.getFileContent();
4939
5110
  const patterns = fileContent.split(/\r?\n|\r/).map((line) => line.trim()).filter((line) => line.length > 0 && !line.startsWith("#"));
4940
5111
  const deniedValues = patterns.map((pattern) => `Read(${pattern})`);
4941
- const filePath = (0, import_node_path32.join)(
5112
+ const filePath = (0, import_node_path33.join)(
4942
5113
  baseDir,
4943
5114
  this.getSettablePaths().relativeDirPath,
4944
5115
  this.getSettablePaths().relativeFilePath
@@ -4974,7 +5145,7 @@ var ClaudecodeIgnore = class _ClaudecodeIgnore extends ToolIgnore {
4974
5145
  validate = true
4975
5146
  }) {
4976
5147
  const fileContent = await readFileContent(
4977
- (0, import_node_path32.join)(
5148
+ (0, import_node_path33.join)(
4978
5149
  baseDir,
4979
5150
  this.getSettablePaths().relativeDirPath,
4980
5151
  this.getSettablePaths().relativeFilePath
@@ -5004,7 +5175,7 @@ var ClaudecodeIgnore = class _ClaudecodeIgnore extends ToolIgnore {
5004
5175
  };
5005
5176
 
5006
5177
  // src/features/ignore/cline-ignore.ts
5007
- var import_node_path33 = require("path");
5178
+ var import_node_path34 = require("path");
5008
5179
  var ClineIgnore = class _ClineIgnore extends ToolIgnore {
5009
5180
  static getSettablePaths() {
5010
5181
  return {
@@ -5041,7 +5212,7 @@ var ClineIgnore = class _ClineIgnore extends ToolIgnore {
5041
5212
  validate = true
5042
5213
  }) {
5043
5214
  const fileContent = await readFileContent(
5044
- (0, import_node_path33.join)(
5215
+ (0, import_node_path34.join)(
5045
5216
  baseDir,
5046
5217
  this.getSettablePaths().relativeDirPath,
5047
5218
  this.getSettablePaths().relativeFilePath
@@ -5071,7 +5242,7 @@ var ClineIgnore = class _ClineIgnore extends ToolIgnore {
5071
5242
  };
5072
5243
 
5073
5244
  // src/features/ignore/cursor-ignore.ts
5074
- var import_node_path34 = require("path");
5245
+ var import_node_path35 = require("path");
5075
5246
  var CursorIgnore = class _CursorIgnore extends ToolIgnore {
5076
5247
  static getSettablePaths() {
5077
5248
  return {
@@ -5104,7 +5275,7 @@ var CursorIgnore = class _CursorIgnore extends ToolIgnore {
5104
5275
  validate = true
5105
5276
  }) {
5106
5277
  const fileContent = await readFileContent(
5107
- (0, import_node_path34.join)(
5278
+ (0, import_node_path35.join)(
5108
5279
  baseDir,
5109
5280
  this.getSettablePaths().relativeDirPath,
5110
5281
  this.getSettablePaths().relativeFilePath
@@ -5134,7 +5305,7 @@ var CursorIgnore = class _CursorIgnore extends ToolIgnore {
5134
5305
  };
5135
5306
 
5136
5307
  // src/features/ignore/geminicli-ignore.ts
5137
- var import_node_path35 = require("path");
5308
+ var import_node_path36 = require("path");
5138
5309
  var GeminiCliIgnore = class _GeminiCliIgnore extends ToolIgnore {
5139
5310
  static getSettablePaths() {
5140
5311
  return {
@@ -5161,7 +5332,7 @@ var GeminiCliIgnore = class _GeminiCliIgnore extends ToolIgnore {
5161
5332
  validate = true
5162
5333
  }) {
5163
5334
  const fileContent = await readFileContent(
5164
- (0, import_node_path35.join)(
5335
+ (0, import_node_path36.join)(
5165
5336
  baseDir,
5166
5337
  this.getSettablePaths().relativeDirPath,
5167
5338
  this.getSettablePaths().relativeFilePath
@@ -5191,7 +5362,7 @@ var GeminiCliIgnore = class _GeminiCliIgnore extends ToolIgnore {
5191
5362
  };
5192
5363
 
5193
5364
  // src/features/ignore/goose-ignore.ts
5194
- var import_node_path36 = require("path");
5365
+ var import_node_path37 = require("path");
5195
5366
  var GooseIgnore = class _GooseIgnore extends ToolIgnore {
5196
5367
  static getSettablePaths() {
5197
5368
  return {
@@ -5228,7 +5399,7 @@ var GooseIgnore = class _GooseIgnore extends ToolIgnore {
5228
5399
  validate = true
5229
5400
  }) {
5230
5401
  const fileContent = await readFileContent(
5231
- (0, import_node_path36.join)(
5402
+ (0, import_node_path37.join)(
5232
5403
  baseDir,
5233
5404
  this.getSettablePaths().relativeDirPath,
5234
5405
  this.getSettablePaths().relativeFilePath
@@ -5258,7 +5429,7 @@ var GooseIgnore = class _GooseIgnore extends ToolIgnore {
5258
5429
  };
5259
5430
 
5260
5431
  // src/features/ignore/junie-ignore.ts
5261
- var import_node_path37 = require("path");
5432
+ var import_node_path38 = require("path");
5262
5433
  var JunieIgnore = class _JunieIgnore extends ToolIgnore {
5263
5434
  static getSettablePaths() {
5264
5435
  return {
@@ -5285,7 +5456,7 @@ var JunieIgnore = class _JunieIgnore extends ToolIgnore {
5285
5456
  validate = true
5286
5457
  }) {
5287
5458
  const fileContent = await readFileContent(
5288
- (0, import_node_path37.join)(
5459
+ (0, import_node_path38.join)(
5289
5460
  baseDir,
5290
5461
  this.getSettablePaths().relativeDirPath,
5291
5462
  this.getSettablePaths().relativeFilePath
@@ -5315,7 +5486,7 @@ var JunieIgnore = class _JunieIgnore extends ToolIgnore {
5315
5486
  };
5316
5487
 
5317
5488
  // src/features/ignore/kilo-ignore.ts
5318
- var import_node_path38 = require("path");
5489
+ var import_node_path39 = require("path");
5319
5490
  var KiloIgnore = class _KiloIgnore extends ToolIgnore {
5320
5491
  static getSettablePaths() {
5321
5492
  return {
@@ -5352,7 +5523,7 @@ var KiloIgnore = class _KiloIgnore extends ToolIgnore {
5352
5523
  validate = true
5353
5524
  }) {
5354
5525
  const fileContent = await readFileContent(
5355
- (0, import_node_path38.join)(
5526
+ (0, import_node_path39.join)(
5356
5527
  baseDir,
5357
5528
  this.getSettablePaths().relativeDirPath,
5358
5529
  this.getSettablePaths().relativeFilePath
@@ -5382,7 +5553,7 @@ var KiloIgnore = class _KiloIgnore extends ToolIgnore {
5382
5553
  };
5383
5554
 
5384
5555
  // src/features/ignore/kiro-ignore.ts
5385
- var import_node_path39 = require("path");
5556
+ var import_node_path40 = require("path");
5386
5557
  var KiroIgnore = class _KiroIgnore extends ToolIgnore {
5387
5558
  static getSettablePaths() {
5388
5559
  return {
@@ -5409,7 +5580,7 @@ var KiroIgnore = class _KiroIgnore extends ToolIgnore {
5409
5580
  validate = true
5410
5581
  }) {
5411
5582
  const fileContent = await readFileContent(
5412
- (0, import_node_path39.join)(
5583
+ (0, import_node_path40.join)(
5413
5584
  baseDir,
5414
5585
  this.getSettablePaths().relativeDirPath,
5415
5586
  this.getSettablePaths().relativeFilePath
@@ -5439,7 +5610,7 @@ var KiroIgnore = class _KiroIgnore extends ToolIgnore {
5439
5610
  };
5440
5611
 
5441
5612
  // src/features/ignore/qwencode-ignore.ts
5442
- var import_node_path40 = require("path");
5613
+ var import_node_path41 = require("path");
5443
5614
  var QwencodeIgnore = class _QwencodeIgnore extends ToolIgnore {
5444
5615
  static getSettablePaths() {
5445
5616
  return {
@@ -5466,7 +5637,7 @@ var QwencodeIgnore = class _QwencodeIgnore extends ToolIgnore {
5466
5637
  validate = true
5467
5638
  }) {
5468
5639
  const fileContent = await readFileContent(
5469
- (0, import_node_path40.join)(
5640
+ (0, import_node_path41.join)(
5470
5641
  baseDir,
5471
5642
  this.getSettablePaths().relativeDirPath,
5472
5643
  this.getSettablePaths().relativeFilePath
@@ -5496,7 +5667,7 @@ var QwencodeIgnore = class _QwencodeIgnore extends ToolIgnore {
5496
5667
  };
5497
5668
 
5498
5669
  // src/features/ignore/roo-ignore.ts
5499
- var import_node_path41 = require("path");
5670
+ var import_node_path42 = require("path");
5500
5671
  var RooIgnore = class _RooIgnore extends ToolIgnore {
5501
5672
  static getSettablePaths() {
5502
5673
  return {
@@ -5523,7 +5694,7 @@ var RooIgnore = class _RooIgnore extends ToolIgnore {
5523
5694
  validate = true
5524
5695
  }) {
5525
5696
  const fileContent = await readFileContent(
5526
- (0, import_node_path41.join)(
5697
+ (0, import_node_path42.join)(
5527
5698
  baseDir,
5528
5699
  this.getSettablePaths().relativeDirPath,
5529
5700
  this.getSettablePaths().relativeFilePath
@@ -5553,7 +5724,7 @@ var RooIgnore = class _RooIgnore extends ToolIgnore {
5553
5724
  };
5554
5725
 
5555
5726
  // src/features/ignore/windsurf-ignore.ts
5556
- var import_node_path42 = require("path");
5727
+ var import_node_path43 = require("path");
5557
5728
  var WindsurfIgnore = class _WindsurfIgnore extends ToolIgnore {
5558
5729
  static getSettablePaths() {
5559
5730
  return {
@@ -5580,7 +5751,7 @@ var WindsurfIgnore = class _WindsurfIgnore extends ToolIgnore {
5580
5751
  validate = true
5581
5752
  }) {
5582
5753
  const fileContent = await readFileContent(
5583
- (0, import_node_path42.join)(
5754
+ (0, import_node_path43.join)(
5584
5755
  baseDir,
5585
5756
  this.getSettablePaths().relativeDirPath,
5586
5757
  this.getSettablePaths().relativeFilePath
@@ -5610,7 +5781,7 @@ var WindsurfIgnore = class _WindsurfIgnore extends ToolIgnore {
5610
5781
  };
5611
5782
 
5612
5783
  // src/features/ignore/zed-ignore.ts
5613
- var import_node_path43 = require("path");
5784
+ var import_node_path44 = require("path");
5614
5785
  var import_es_toolkit3 = require("es-toolkit");
5615
5786
  var ZedIgnore = class _ZedIgnore extends ToolIgnore {
5616
5787
  constructor(params) {
@@ -5647,7 +5818,7 @@ var ZedIgnore = class _ZedIgnore extends ToolIgnore {
5647
5818
  }) {
5648
5819
  const fileContent = rulesyncIgnore.getFileContent();
5649
5820
  const patterns = fileContent.split(/\r?\n|\r/).map((line) => line.trim()).filter((line) => line.length > 0 && !line.startsWith("#"));
5650
- const filePath = (0, import_node_path43.join)(
5821
+ const filePath = (0, import_node_path44.join)(
5651
5822
  baseDir,
5652
5823
  this.getSettablePaths().relativeDirPath,
5653
5824
  this.getSettablePaths().relativeFilePath
@@ -5674,7 +5845,7 @@ var ZedIgnore = class _ZedIgnore extends ToolIgnore {
5674
5845
  validate = true
5675
5846
  }) {
5676
5847
  const fileContent = await readFileContent(
5677
- (0, import_node_path43.join)(
5848
+ (0, import_node_path44.join)(
5678
5849
  baseDir,
5679
5850
  this.getSettablePaths().relativeDirPath,
5680
5851
  this.getSettablePaths().relativeFilePath
@@ -5862,10 +6033,10 @@ var IgnoreProcessor = class extends FeatureProcessor {
5862
6033
  var import_mini23 = require("zod/mini");
5863
6034
 
5864
6035
  // src/features/mcp/claudecode-mcp.ts
5865
- var import_node_path45 = require("path");
6036
+ var import_node_path46 = require("path");
5866
6037
 
5867
6038
  // src/features/mcp/rulesync-mcp.ts
5868
- var import_node_path44 = require("path");
6039
+ var import_node_path45 = require("path");
5869
6040
  var import_object = require("es-toolkit/object");
5870
6041
  var import_mini21 = require("zod/mini");
5871
6042
 
@@ -5944,12 +6115,12 @@ var RulesyncMcp = class _RulesyncMcp extends RulesyncFile {
5944
6115
  }) {
5945
6116
  const baseDir = process.cwd();
5946
6117
  const paths = this.getSettablePaths();
5947
- const recommendedPath = (0, import_node_path44.join)(
6118
+ const recommendedPath = (0, import_node_path45.join)(
5948
6119
  baseDir,
5949
6120
  paths.recommended.relativeDirPath,
5950
6121
  paths.recommended.relativeFilePath
5951
6122
  );
5952
- const legacyPath = (0, import_node_path44.join)(baseDir, paths.legacy.relativeDirPath, paths.legacy.relativeFilePath);
6123
+ const legacyPath = (0, import_node_path45.join)(baseDir, paths.legacy.relativeDirPath, paths.legacy.relativeFilePath);
5953
6124
  if (await fileExists(recommendedPath)) {
5954
6125
  const fileContent2 = await readFileContent(recommendedPath);
5955
6126
  return new _RulesyncMcp({
@@ -6103,7 +6274,7 @@ var ClaudecodeMcp = class _ClaudecodeMcp extends ToolMcp {
6103
6274
  global = false
6104
6275
  }) {
6105
6276
  const paths = this.getSettablePaths({ global });
6106
- const fileContent = await readFileContentOrNull((0, import_node_path45.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath)) ?? '{"mcpServers":{}}';
6277
+ const fileContent = await readFileContentOrNull((0, import_node_path46.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath)) ?? '{"mcpServers":{}}';
6107
6278
  const json = JSON.parse(fileContent);
6108
6279
  const newJson = { ...json, mcpServers: json.mcpServers ?? {} };
6109
6280
  return new _ClaudecodeMcp({
@@ -6122,7 +6293,7 @@ var ClaudecodeMcp = class _ClaudecodeMcp extends ToolMcp {
6122
6293
  }) {
6123
6294
  const paths = this.getSettablePaths({ global });
6124
6295
  const fileContent = await readOrInitializeFileContent(
6125
- (0, import_node_path45.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath),
6296
+ (0, import_node_path46.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath),
6126
6297
  JSON.stringify({ mcpServers: {} }, null, 2)
6127
6298
  );
6128
6299
  const json = JSON.parse(fileContent);
@@ -6161,7 +6332,7 @@ var ClaudecodeMcp = class _ClaudecodeMcp extends ToolMcp {
6161
6332
  };
6162
6333
 
6163
6334
  // src/features/mcp/cline-mcp.ts
6164
- var import_node_path46 = require("path");
6335
+ var import_node_path47 = require("path");
6165
6336
  var ClineMcp = class _ClineMcp extends ToolMcp {
6166
6337
  json;
6167
6338
  constructor(params) {
@@ -6182,7 +6353,7 @@ var ClineMcp = class _ClineMcp extends ToolMcp {
6182
6353
  validate = true
6183
6354
  }) {
6184
6355
  const fileContent = await readFileContent(
6185
- (0, import_node_path46.join)(
6356
+ (0, import_node_path47.join)(
6186
6357
  baseDir,
6187
6358
  this.getSettablePaths().relativeDirPath,
6188
6359
  this.getSettablePaths().relativeFilePath
@@ -6231,7 +6402,7 @@ var ClineMcp = class _ClineMcp extends ToolMcp {
6231
6402
  };
6232
6403
 
6233
6404
  // src/features/mcp/codexcli-mcp.ts
6234
- var import_node_path47 = require("path");
6405
+ var import_node_path48 = require("path");
6235
6406
  var smolToml = __toESM(require("smol-toml"), 1);
6236
6407
  function convertFromCodexFormat(codexMcp) {
6237
6408
  const result = {};
@@ -6314,7 +6485,7 @@ var CodexcliMcp = class _CodexcliMcp extends ToolMcp {
6314
6485
  global = false
6315
6486
  }) {
6316
6487
  const paths = this.getSettablePaths({ global });
6317
- const fileContent = await readFileContentOrNull((0, import_node_path47.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath)) ?? smolToml.stringify({});
6488
+ const fileContent = await readFileContentOrNull((0, import_node_path48.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath)) ?? smolToml.stringify({});
6318
6489
  return new _CodexcliMcp({
6319
6490
  baseDir,
6320
6491
  relativeDirPath: paths.relativeDirPath,
@@ -6330,7 +6501,7 @@ var CodexcliMcp = class _CodexcliMcp extends ToolMcp {
6330
6501
  global = false
6331
6502
  }) {
6332
6503
  const paths = this.getSettablePaths({ global });
6333
- const configTomlFilePath = (0, import_node_path47.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath);
6504
+ const configTomlFilePath = (0, import_node_path48.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath);
6334
6505
  const configTomlFileContent = await readOrInitializeFileContent(
6335
6506
  configTomlFilePath,
6336
6507
  smolToml.stringify({})
@@ -6384,7 +6555,7 @@ var CodexcliMcp = class _CodexcliMcp extends ToolMcp {
6384
6555
  };
6385
6556
 
6386
6557
  // src/features/mcp/copilot-mcp.ts
6387
- var import_node_path48 = require("path");
6558
+ var import_node_path49 = require("path");
6388
6559
  function convertToCopilotFormat(mcpServers) {
6389
6560
  return { servers: mcpServers };
6390
6561
  }
@@ -6411,7 +6582,7 @@ var CopilotMcp = class _CopilotMcp extends ToolMcp {
6411
6582
  validate = true
6412
6583
  }) {
6413
6584
  const fileContent = await readFileContent(
6414
- (0, import_node_path48.join)(
6585
+ (0, import_node_path49.join)(
6415
6586
  baseDir,
6416
6587
  this.getSettablePaths().relativeDirPath,
6417
6588
  this.getSettablePaths().relativeFilePath
@@ -6464,7 +6635,7 @@ var CopilotMcp = class _CopilotMcp extends ToolMcp {
6464
6635
  };
6465
6636
 
6466
6637
  // src/features/mcp/copilotcli-mcp.ts
6467
- var import_node_path49 = require("path");
6638
+ var import_node_path50 = require("path");
6468
6639
  function addTypeField(mcpServers) {
6469
6640
  const result = {};
6470
6641
  for (const [name, server] of Object.entries(mcpServers)) {
@@ -6539,7 +6710,7 @@ var CopilotcliMcp = class _CopilotcliMcp extends ToolMcp {
6539
6710
  global = false
6540
6711
  }) {
6541
6712
  const paths = this.getSettablePaths({ global });
6542
- const fileContent = await readFileContentOrNull((0, import_node_path49.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath)) ?? '{"mcpServers":{}}';
6713
+ const fileContent = await readFileContentOrNull((0, import_node_path50.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath)) ?? '{"mcpServers":{}}';
6543
6714
  const json = JSON.parse(fileContent);
6544
6715
  const newJson = { ...json, mcpServers: json.mcpServers ?? {} };
6545
6716
  return new _CopilotcliMcp({
@@ -6559,7 +6730,7 @@ var CopilotcliMcp = class _CopilotcliMcp extends ToolMcp {
6559
6730
  }) {
6560
6731
  const paths = this.getSettablePaths({ global });
6561
6732
  const fileContent = await readOrInitializeFileContent(
6562
- (0, import_node_path49.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath),
6733
+ (0, import_node_path50.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath),
6563
6734
  JSON.stringify({ mcpServers: {} }, null, 2)
6564
6735
  );
6565
6736
  const json = JSON.parse(fileContent);
@@ -6601,7 +6772,7 @@ var CopilotcliMcp = class _CopilotcliMcp extends ToolMcp {
6601
6772
  };
6602
6773
 
6603
6774
  // src/features/mcp/cursor-mcp.ts
6604
- var import_node_path50 = require("path");
6775
+ var import_node_path51 = require("path");
6605
6776
  var CURSOR_ENV_VAR_PATTERN = /\$\{env:([^}]+)\}/g;
6606
6777
  function isMcpServers(value) {
6607
6778
  return value !== void 0 && value !== null && typeof value === "object";
@@ -6651,7 +6822,7 @@ var CursorMcp = class _CursorMcp extends ToolMcp {
6651
6822
  this.json = JSON.parse(this.fileContent);
6652
6823
  } catch (error) {
6653
6824
  throw new Error(
6654
- `Failed to parse Cursor MCP config at ${(0, import_node_path50.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(error)}`,
6825
+ `Failed to parse Cursor MCP config at ${(0, import_node_path51.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(error)}`,
6655
6826
  { cause: error }
6656
6827
  );
6657
6828
  }
@@ -6677,14 +6848,14 @@ var CursorMcp = class _CursorMcp extends ToolMcp {
6677
6848
  global = false
6678
6849
  }) {
6679
6850
  const paths = this.getSettablePaths({ global });
6680
- const filePath = (0, import_node_path50.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath);
6851
+ const filePath = (0, import_node_path51.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath);
6681
6852
  const fileContent = await readFileContentOrNull(filePath) ?? '{"mcpServers":{}}';
6682
6853
  let json;
6683
6854
  try {
6684
6855
  json = JSON.parse(fileContent);
6685
6856
  } catch (error) {
6686
6857
  throw new Error(
6687
- `Failed to parse Cursor MCP config at ${(0, import_node_path50.join)(paths.relativeDirPath, paths.relativeFilePath)}: ${formatError(error)}`,
6858
+ `Failed to parse Cursor MCP config at ${(0, import_node_path51.join)(paths.relativeDirPath, paths.relativeFilePath)}: ${formatError(error)}`,
6688
6859
  { cause: error }
6689
6860
  );
6690
6861
  }
@@ -6706,7 +6877,7 @@ var CursorMcp = class _CursorMcp extends ToolMcp {
6706
6877
  }) {
6707
6878
  const paths = this.getSettablePaths({ global });
6708
6879
  const fileContent = await readOrInitializeFileContent(
6709
- (0, import_node_path50.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath),
6880
+ (0, import_node_path51.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath),
6710
6881
  JSON.stringify({ mcpServers: {} }, null, 2)
6711
6882
  );
6712
6883
  let json;
@@ -6714,7 +6885,7 @@ var CursorMcp = class _CursorMcp extends ToolMcp {
6714
6885
  json = JSON.parse(fileContent);
6715
6886
  } catch (error) {
6716
6887
  throw new Error(
6717
- `Failed to parse Cursor MCP config at ${(0, import_node_path50.join)(paths.relativeDirPath, paths.relativeFilePath)}: ${formatError(error)}`,
6888
+ `Failed to parse Cursor MCP config at ${(0, import_node_path51.join)(paths.relativeDirPath, paths.relativeFilePath)}: ${formatError(error)}`,
6718
6889
  { cause: error }
6719
6890
  );
6720
6891
  }
@@ -6762,62 +6933,68 @@ var CursorMcp = class _CursorMcp extends ToolMcp {
6762
6933
  }
6763
6934
  };
6764
6935
 
6765
- // src/features/mcp/factorydroid-mcp.ts
6766
- var import_node_path51 = require("path");
6767
- var FactorydroidMcp = class _FactorydroidMcp extends ToolMcp {
6936
+ // src/features/mcp/deepagents-mcp.ts
6937
+ var import_node_path52 = require("path");
6938
+ var DeepagentsMcp = class _DeepagentsMcp extends ToolMcp {
6768
6939
  json;
6769
6940
  constructor(params) {
6770
6941
  super(params);
6771
- this.json = this.fileContent !== void 0 ? JSON.parse(this.fileContent) : {};
6942
+ this.json = JSON.parse(this.fileContent || "{}");
6772
6943
  }
6773
6944
  getJson() {
6774
6945
  return this.json;
6775
6946
  }
6776
- static getSettablePaths() {
6947
+ isDeletable() {
6948
+ return !this.global;
6949
+ }
6950
+ static getSettablePaths(_options = {}) {
6777
6951
  return {
6778
- relativeDirPath: ".factory",
6779
- relativeFilePath: "mcp.json"
6952
+ relativeDirPath: ".deepagents",
6953
+ relativeFilePath: ".mcp.json"
6780
6954
  };
6781
6955
  }
6782
6956
  static async fromFile({
6783
6957
  baseDir = process.cwd(),
6784
- validate = true
6958
+ validate = true,
6959
+ global = false
6785
6960
  }) {
6786
- const fileContent = await readFileContent(
6787
- (0, import_node_path51.join)(
6788
- baseDir,
6789
- this.getSettablePaths().relativeDirPath,
6790
- this.getSettablePaths().relativeFilePath
6791
- )
6792
- );
6793
- return new _FactorydroidMcp({
6961
+ const paths = this.getSettablePaths({ global });
6962
+ const fileContent = await readFileContentOrNull((0, import_node_path52.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath)) ?? '{"mcpServers":{}}';
6963
+ const json = JSON.parse(fileContent);
6964
+ const newJson = { ...json, mcpServers: json.mcpServers ?? {} };
6965
+ return new _DeepagentsMcp({
6794
6966
  baseDir,
6795
- relativeDirPath: this.getSettablePaths().relativeDirPath,
6796
- relativeFilePath: this.getSettablePaths().relativeFilePath,
6797
- fileContent,
6967
+ relativeDirPath: paths.relativeDirPath,
6968
+ relativeFilePath: paths.relativeFilePath,
6969
+ fileContent: JSON.stringify(newJson, null, 2),
6798
6970
  validate
6799
6971
  });
6800
6972
  }
6801
- static fromRulesyncMcp({
6973
+ static async fromRulesyncMcp({
6802
6974
  baseDir = process.cwd(),
6803
6975
  rulesyncMcp,
6804
- validate = true
6976
+ validate = true,
6977
+ global = false
6805
6978
  }) {
6806
- const json = rulesyncMcp.getJson();
6807
- const factorydroidConfig = {
6808
- mcpServers: json.mcpServers || {}
6809
- };
6810
- const fileContent = JSON.stringify(factorydroidConfig, null, 2);
6811
- return new _FactorydroidMcp({
6979
+ const paths = this.getSettablePaths({ global });
6980
+ const fileContent = await readOrInitializeFileContent(
6981
+ (0, import_node_path52.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath),
6982
+ JSON.stringify({ mcpServers: {} }, null, 2)
6983
+ );
6984
+ const json = JSON.parse(fileContent);
6985
+ const mcpJson = { ...json, mcpServers: rulesyncMcp.getMcpServers() };
6986
+ return new _DeepagentsMcp({
6812
6987
  baseDir,
6813
- relativeDirPath: this.getSettablePaths().relativeDirPath,
6814
- relativeFilePath: this.getSettablePaths().relativeFilePath,
6815
- fileContent,
6988
+ relativeDirPath: paths.relativeDirPath,
6989
+ relativeFilePath: paths.relativeFilePath,
6990
+ fileContent: JSON.stringify(mcpJson, null, 2),
6816
6991
  validate
6817
6992
  });
6818
6993
  }
6819
6994
  toRulesyncMcp() {
6820
- return this.toRulesyncMcpDefault();
6995
+ return this.toRulesyncMcpDefault({
6996
+ fileContent: JSON.stringify({ mcpServers: this.json.mcpServers }, null, 2)
6997
+ });
6821
6998
  }
6822
6999
  validate() {
6823
7000
  return { success: true, error: null };
@@ -6825,7 +7002,84 @@ var FactorydroidMcp = class _FactorydroidMcp extends ToolMcp {
6825
7002
  static forDeletion({
6826
7003
  baseDir = process.cwd(),
6827
7004
  relativeDirPath,
6828
- relativeFilePath
7005
+ relativeFilePath,
7006
+ global = false
7007
+ }) {
7008
+ return new _DeepagentsMcp({
7009
+ baseDir,
7010
+ relativeDirPath,
7011
+ relativeFilePath,
7012
+ fileContent: "{}",
7013
+ validate: false,
7014
+ global
7015
+ });
7016
+ }
7017
+ };
7018
+
7019
+ // src/features/mcp/factorydroid-mcp.ts
7020
+ var import_node_path53 = require("path");
7021
+ var FactorydroidMcp = class _FactorydroidMcp extends ToolMcp {
7022
+ json;
7023
+ constructor(params) {
7024
+ super(params);
7025
+ this.json = this.fileContent !== void 0 ? JSON.parse(this.fileContent) : {};
7026
+ }
7027
+ getJson() {
7028
+ return this.json;
7029
+ }
7030
+ static getSettablePaths() {
7031
+ return {
7032
+ relativeDirPath: ".factory",
7033
+ relativeFilePath: "mcp.json"
7034
+ };
7035
+ }
7036
+ static async fromFile({
7037
+ baseDir = process.cwd(),
7038
+ validate = true
7039
+ }) {
7040
+ const fileContent = await readFileContent(
7041
+ (0, import_node_path53.join)(
7042
+ baseDir,
7043
+ this.getSettablePaths().relativeDirPath,
7044
+ this.getSettablePaths().relativeFilePath
7045
+ )
7046
+ );
7047
+ return new _FactorydroidMcp({
7048
+ baseDir,
7049
+ relativeDirPath: this.getSettablePaths().relativeDirPath,
7050
+ relativeFilePath: this.getSettablePaths().relativeFilePath,
7051
+ fileContent,
7052
+ validate
7053
+ });
7054
+ }
7055
+ static fromRulesyncMcp({
7056
+ baseDir = process.cwd(),
7057
+ rulesyncMcp,
7058
+ validate = true
7059
+ }) {
7060
+ const json = rulesyncMcp.getJson();
7061
+ const factorydroidConfig = {
7062
+ mcpServers: json.mcpServers || {}
7063
+ };
7064
+ const fileContent = JSON.stringify(factorydroidConfig, null, 2);
7065
+ return new _FactorydroidMcp({
7066
+ baseDir,
7067
+ relativeDirPath: this.getSettablePaths().relativeDirPath,
7068
+ relativeFilePath: this.getSettablePaths().relativeFilePath,
7069
+ fileContent,
7070
+ validate
7071
+ });
7072
+ }
7073
+ toRulesyncMcp() {
7074
+ return this.toRulesyncMcpDefault();
7075
+ }
7076
+ validate() {
7077
+ return { success: true, error: null };
7078
+ }
7079
+ static forDeletion({
7080
+ baseDir = process.cwd(),
7081
+ relativeDirPath,
7082
+ relativeFilePath
6829
7083
  }) {
6830
7084
  return new _FactorydroidMcp({
6831
7085
  baseDir,
@@ -6838,7 +7092,7 @@ var FactorydroidMcp = class _FactorydroidMcp extends ToolMcp {
6838
7092
  };
6839
7093
 
6840
7094
  // src/features/mcp/geminicli-mcp.ts
6841
- var import_node_path52 = require("path");
7095
+ var import_node_path54 = require("path");
6842
7096
  var GeminiCliMcp = class _GeminiCliMcp extends ToolMcp {
6843
7097
  json;
6844
7098
  constructor(params) {
@@ -6866,7 +7120,7 @@ var GeminiCliMcp = class _GeminiCliMcp extends ToolMcp {
6866
7120
  global = false
6867
7121
  }) {
6868
7122
  const paths = this.getSettablePaths({ global });
6869
- const fileContent = await readFileContentOrNull((0, import_node_path52.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath)) ?? '{"mcpServers":{}}';
7123
+ const fileContent = await readFileContentOrNull((0, import_node_path54.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath)) ?? '{"mcpServers":{}}';
6870
7124
  const json = JSON.parse(fileContent);
6871
7125
  const newJson = { ...json, mcpServers: json.mcpServers ?? {} };
6872
7126
  return new _GeminiCliMcp({
@@ -6885,7 +7139,7 @@ var GeminiCliMcp = class _GeminiCliMcp extends ToolMcp {
6885
7139
  }) {
6886
7140
  const paths = this.getSettablePaths({ global });
6887
7141
  const fileContent = await readOrInitializeFileContent(
6888
- (0, import_node_path52.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath),
7142
+ (0, import_node_path54.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath),
6889
7143
  JSON.stringify({ mcpServers: {} }, null, 2)
6890
7144
  );
6891
7145
  const json = JSON.parse(fileContent);
@@ -6930,7 +7184,7 @@ var GeminiCliMcp = class _GeminiCliMcp extends ToolMcp {
6930
7184
  };
6931
7185
 
6932
7186
  // src/features/mcp/junie-mcp.ts
6933
- var import_node_path53 = require("path");
7187
+ var import_node_path55 = require("path");
6934
7188
  var JunieMcp = class _JunieMcp extends ToolMcp {
6935
7189
  json;
6936
7190
  constructor(params) {
@@ -6942,7 +7196,7 @@ var JunieMcp = class _JunieMcp extends ToolMcp {
6942
7196
  }
6943
7197
  static getSettablePaths() {
6944
7198
  return {
6945
- relativeDirPath: (0, import_node_path53.join)(".junie", "mcp"),
7199
+ relativeDirPath: (0, import_node_path55.join)(".junie", "mcp"),
6946
7200
  relativeFilePath: "mcp.json"
6947
7201
  };
6948
7202
  }
@@ -6951,7 +7205,7 @@ var JunieMcp = class _JunieMcp extends ToolMcp {
6951
7205
  validate = true
6952
7206
  }) {
6953
7207
  const fileContent = await readFileContent(
6954
- (0, import_node_path53.join)(
7208
+ (0, import_node_path55.join)(
6955
7209
  baseDir,
6956
7210
  this.getSettablePaths().relativeDirPath,
6957
7211
  this.getSettablePaths().relativeFilePath
@@ -7000,7 +7254,7 @@ var JunieMcp = class _JunieMcp extends ToolMcp {
7000
7254
  };
7001
7255
 
7002
7256
  // src/features/mcp/kilo-mcp.ts
7003
- var import_node_path54 = require("path");
7257
+ var import_node_path56 = require("path");
7004
7258
  var KiloMcp = class _KiloMcp extends ToolMcp {
7005
7259
  json;
7006
7260
  constructor(params) {
@@ -7021,7 +7275,7 @@ var KiloMcp = class _KiloMcp extends ToolMcp {
7021
7275
  validate = true
7022
7276
  }) {
7023
7277
  const paths = this.getSettablePaths();
7024
- const fileContent = await readFileContentOrNull((0, import_node_path54.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath)) ?? '{"mcpServers":{}}';
7278
+ const fileContent = await readFileContentOrNull((0, import_node_path56.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath)) ?? '{"mcpServers":{}}';
7025
7279
  return new _KiloMcp({
7026
7280
  baseDir,
7027
7281
  relativeDirPath: paths.relativeDirPath,
@@ -7069,7 +7323,7 @@ var KiloMcp = class _KiloMcp extends ToolMcp {
7069
7323
  };
7070
7324
 
7071
7325
  // src/features/mcp/kiro-mcp.ts
7072
- var import_node_path55 = require("path");
7326
+ var import_node_path57 = require("path");
7073
7327
  var KiroMcp = class _KiroMcp extends ToolMcp {
7074
7328
  json;
7075
7329
  constructor(params) {
@@ -7081,7 +7335,7 @@ var KiroMcp = class _KiroMcp extends ToolMcp {
7081
7335
  }
7082
7336
  static getSettablePaths() {
7083
7337
  return {
7084
- relativeDirPath: (0, import_node_path55.join)(".kiro", "settings"),
7338
+ relativeDirPath: (0, import_node_path57.join)(".kiro", "settings"),
7085
7339
  relativeFilePath: "mcp.json"
7086
7340
  };
7087
7341
  }
@@ -7090,7 +7344,7 @@ var KiroMcp = class _KiroMcp extends ToolMcp {
7090
7344
  validate = true
7091
7345
  }) {
7092
7346
  const paths = this.getSettablePaths();
7093
- const fileContent = await readFileContentOrNull((0, import_node_path55.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath)) ?? '{"mcpServers":{}}';
7347
+ const fileContent = await readFileContentOrNull((0, import_node_path57.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath)) ?? '{"mcpServers":{}}';
7094
7348
  return new _KiroMcp({
7095
7349
  baseDir,
7096
7350
  relativeDirPath: paths.relativeDirPath,
@@ -7138,7 +7392,7 @@ var KiroMcp = class _KiroMcp extends ToolMcp {
7138
7392
  };
7139
7393
 
7140
7394
  // src/features/mcp/opencode-mcp.ts
7141
- var import_node_path56 = require("path");
7395
+ var import_node_path58 = require("path");
7142
7396
  var import_jsonc_parser2 = require("jsonc-parser");
7143
7397
  var import_mini22 = require("zod/mini");
7144
7398
  var OpencodeMcpLocalServerSchema = import_mini22.z.object({
@@ -7279,7 +7533,7 @@ var OpencodeMcp = class _OpencodeMcp extends ToolMcp {
7279
7533
  static getSettablePaths({ global } = {}) {
7280
7534
  if (global) {
7281
7535
  return {
7282
- relativeDirPath: (0, import_node_path56.join)(".config", "opencode"),
7536
+ relativeDirPath: (0, import_node_path58.join)(".config", "opencode"),
7283
7537
  relativeFilePath: "opencode.json"
7284
7538
  };
7285
7539
  }
@@ -7294,11 +7548,11 @@ var OpencodeMcp = class _OpencodeMcp extends ToolMcp {
7294
7548
  global = false
7295
7549
  }) {
7296
7550
  const basePaths = this.getSettablePaths({ global });
7297
- const jsonDir = (0, import_node_path56.join)(baseDir, basePaths.relativeDirPath);
7551
+ const jsonDir = (0, import_node_path58.join)(baseDir, basePaths.relativeDirPath);
7298
7552
  let fileContent = null;
7299
7553
  let relativeFilePath = "opencode.jsonc";
7300
- const jsoncPath = (0, import_node_path56.join)(jsonDir, "opencode.jsonc");
7301
- const jsonPath = (0, import_node_path56.join)(jsonDir, "opencode.json");
7554
+ const jsoncPath = (0, import_node_path58.join)(jsonDir, "opencode.jsonc");
7555
+ const jsonPath = (0, import_node_path58.join)(jsonDir, "opencode.json");
7302
7556
  fileContent = await readFileContentOrNull(jsoncPath);
7303
7557
  if (!fileContent) {
7304
7558
  fileContent = await readFileContentOrNull(jsonPath);
@@ -7324,11 +7578,11 @@ var OpencodeMcp = class _OpencodeMcp extends ToolMcp {
7324
7578
  global = false
7325
7579
  }) {
7326
7580
  const basePaths = this.getSettablePaths({ global });
7327
- const jsonDir = (0, import_node_path56.join)(baseDir, basePaths.relativeDirPath);
7581
+ const jsonDir = (0, import_node_path58.join)(baseDir, basePaths.relativeDirPath);
7328
7582
  let fileContent = null;
7329
7583
  let relativeFilePath = "opencode.jsonc";
7330
- const jsoncPath = (0, import_node_path56.join)(jsonDir, "opencode.jsonc");
7331
- const jsonPath = (0, import_node_path56.join)(jsonDir, "opencode.json");
7584
+ const jsoncPath = (0, import_node_path58.join)(jsonDir, "opencode.jsonc");
7585
+ const jsonPath = (0, import_node_path58.join)(jsonDir, "opencode.json");
7332
7586
  fileContent = await readFileContentOrNull(jsoncPath);
7333
7587
  if (!fileContent) {
7334
7588
  fileContent = await readFileContentOrNull(jsonPath);
@@ -7389,7 +7643,7 @@ var OpencodeMcp = class _OpencodeMcp extends ToolMcp {
7389
7643
  };
7390
7644
 
7391
7645
  // src/features/mcp/roo-mcp.ts
7392
- var import_node_path57 = require("path");
7646
+ var import_node_path59 = require("path");
7393
7647
  function isRooMcpServers(value) {
7394
7648
  return value !== void 0 && value !== null && typeof value === "object";
7395
7649
  }
@@ -7441,7 +7695,7 @@ var RooMcp = class _RooMcp extends ToolMcp {
7441
7695
  validate = true
7442
7696
  }) {
7443
7697
  const fileContent = await readFileContent(
7444
- (0, import_node_path57.join)(
7698
+ (0, import_node_path59.join)(
7445
7699
  baseDir,
7446
7700
  this.getSettablePaths().relativeDirPath,
7447
7701
  this.getSettablePaths().relativeFilePath
@@ -7505,6 +7759,7 @@ var mcpProcessorToolTargetTuple = [
7505
7759
  "copilot",
7506
7760
  "copilotcli",
7507
7761
  "cursor",
7762
+ "deepagents",
7508
7763
  "factorydroid",
7509
7764
  "geminicli",
7510
7765
  "kilo",
@@ -7599,6 +7854,18 @@ var toolMcpFactories = /* @__PURE__ */ new Map([
7599
7854
  }
7600
7855
  }
7601
7856
  ],
7857
+ [
7858
+ "deepagents",
7859
+ {
7860
+ class: DeepagentsMcp,
7861
+ meta: {
7862
+ supportsProject: true,
7863
+ supportsGlobal: true,
7864
+ supportsEnabledTools: false,
7865
+ supportsDisabledTools: false
7866
+ }
7867
+ }
7868
+ ],
7602
7869
  [
7603
7870
  "factorydroid",
7604
7871
  {
@@ -7828,25 +8095,25 @@ var McpProcessor = class extends FeatureProcessor {
7828
8095
  };
7829
8096
 
7830
8097
  // src/features/rules/rules-processor.ts
7831
- var import_node_path119 = require("path");
8098
+ var import_node_path124 = require("path");
7832
8099
  var import_toon = require("@toon-format/toon");
7833
- var import_mini57 = require("zod/mini");
8100
+ var import_mini59 = require("zod/mini");
7834
8101
 
7835
8102
  // src/constants/general.ts
7836
8103
  var SKILL_FILE_NAME = "SKILL.md";
7837
8104
 
7838
8105
  // src/features/skills/agentsmd-skill.ts
7839
- var import_node_path61 = require("path");
8106
+ var import_node_path63 = require("path");
7840
8107
 
7841
8108
  // src/features/skills/simulated-skill.ts
7842
- var import_node_path60 = require("path");
8109
+ var import_node_path62 = require("path");
7843
8110
  var import_mini24 = require("zod/mini");
7844
8111
 
7845
8112
  // src/features/skills/tool-skill.ts
7846
- var import_node_path59 = require("path");
8113
+ var import_node_path61 = require("path");
7847
8114
 
7848
8115
  // src/types/ai-dir.ts
7849
- var import_node_path58 = __toESM(require("path"), 1);
8116
+ var import_node_path60 = __toESM(require("path"), 1);
7850
8117
  var AiDir = class {
7851
8118
  /**
7852
8119
  * @example "."
@@ -7880,7 +8147,7 @@ var AiDir = class {
7880
8147
  otherFiles = [],
7881
8148
  global = false
7882
8149
  }) {
7883
- if (dirName.includes(import_node_path58.default.sep) || dirName.includes("/") || dirName.includes("\\")) {
8150
+ if (dirName.includes(import_node_path60.default.sep) || dirName.includes("/") || dirName.includes("\\")) {
7884
8151
  throw new Error(`Directory name cannot contain path separators: dirName="${dirName}"`);
7885
8152
  }
7886
8153
  this.baseDir = baseDir;
@@ -7903,11 +8170,11 @@ var AiDir = class {
7903
8170
  return this.dirName;
7904
8171
  }
7905
8172
  getDirPath() {
7906
- const fullPath = import_node_path58.default.join(this.baseDir, this.relativeDirPath, this.dirName);
7907
- const resolvedFull = (0, import_node_path58.resolve)(fullPath);
7908
- const resolvedBase = (0, import_node_path58.resolve)(this.baseDir);
7909
- const rel = (0, import_node_path58.relative)(resolvedBase, resolvedFull);
7910
- if (rel.startsWith("..") || import_node_path58.default.isAbsolute(rel)) {
8173
+ const fullPath = import_node_path60.default.join(this.baseDir, this.relativeDirPath, this.dirName);
8174
+ const resolvedFull = (0, import_node_path60.resolve)(fullPath);
8175
+ const resolvedBase = (0, import_node_path60.resolve)(this.baseDir);
8176
+ const rel = (0, import_node_path60.relative)(resolvedBase, resolvedFull);
8177
+ if (rel.startsWith("..") || import_node_path60.default.isAbsolute(rel)) {
7911
8178
  throw new Error(
7912
8179
  `Path traversal detected: Final path escapes baseDir. baseDir="${this.baseDir}", relativeDirPath="${this.relativeDirPath}", dirName="${this.dirName}"`
7913
8180
  );
@@ -7921,7 +8188,7 @@ var AiDir = class {
7921
8188
  return this.otherFiles;
7922
8189
  }
7923
8190
  getRelativePathFromCwd() {
7924
- return import_node_path58.default.join(this.relativeDirPath, this.dirName);
8191
+ return import_node_path60.default.join(this.relativeDirPath, this.dirName);
7925
8192
  }
7926
8193
  getGlobal() {
7927
8194
  return this.global;
@@ -7940,15 +8207,15 @@ var AiDir = class {
7940
8207
  * @returns Array of files with their relative paths and buffers
7941
8208
  */
7942
8209
  static async collectOtherFiles(baseDir, relativeDirPath, dirName, excludeFileName) {
7943
- const dirPath = (0, import_node_path58.join)(baseDir, relativeDirPath, dirName);
7944
- const glob = (0, import_node_path58.join)(dirPath, "**", "*");
8210
+ const dirPath = (0, import_node_path60.join)(baseDir, relativeDirPath, dirName);
8211
+ const glob = (0, import_node_path60.join)(dirPath, "**", "*");
7945
8212
  const filePaths = await findFilesByGlobs(glob, { type: "file" });
7946
- const filteredPaths = filePaths.filter((filePath) => (0, import_node_path58.basename)(filePath) !== excludeFileName);
8213
+ const filteredPaths = filePaths.filter((filePath) => (0, import_node_path60.basename)(filePath) !== excludeFileName);
7947
8214
  const files = await Promise.all(
7948
8215
  filteredPaths.map(async (filePath) => {
7949
8216
  const fileBuffer = await readFileBuffer(filePath);
7950
8217
  return {
7951
- relativeFilePathToDirPath: (0, import_node_path58.relative)(dirPath, filePath),
8218
+ relativeFilePathToDirPath: (0, import_node_path60.relative)(dirPath, filePath),
7952
8219
  fileBuffer
7953
8220
  };
7954
8221
  })
@@ -8039,8 +8306,8 @@ var ToolSkill = class extends AiDir {
8039
8306
  }) {
8040
8307
  const settablePaths = getSettablePaths({ global });
8041
8308
  const actualRelativeDirPath = relativeDirPath ?? settablePaths.relativeDirPath;
8042
- const skillDirPath = (0, import_node_path59.join)(baseDir, actualRelativeDirPath, dirName);
8043
- const skillFilePath = (0, import_node_path59.join)(skillDirPath, SKILL_FILE_NAME);
8309
+ const skillDirPath = (0, import_node_path61.join)(baseDir, actualRelativeDirPath, dirName);
8310
+ const skillFilePath = (0, import_node_path61.join)(skillDirPath, SKILL_FILE_NAME);
8044
8311
  if (!await fileExists(skillFilePath)) {
8045
8312
  throw new Error(`${SKILL_FILE_NAME} not found in ${skillDirPath}`);
8046
8313
  }
@@ -8064,7 +8331,7 @@ var ToolSkill = class extends AiDir {
8064
8331
  }
8065
8332
  requireMainFileFrontmatter() {
8066
8333
  if (!this.mainFile?.frontmatter) {
8067
- throw new Error(`Frontmatter is not defined in ${(0, import_node_path59.join)(this.relativeDirPath, this.dirName)}`);
8334
+ throw new Error(`Frontmatter is not defined in ${(0, import_node_path61.join)(this.relativeDirPath, this.dirName)}`);
8068
8335
  }
8069
8336
  return this.mainFile.frontmatter;
8070
8337
  }
@@ -8104,7 +8371,7 @@ var SimulatedSkill = class extends ToolSkill {
8104
8371
  const result = SimulatedSkillFrontmatterSchema.safeParse(frontmatter);
8105
8372
  if (!result.success) {
8106
8373
  throw new Error(
8107
- `Invalid frontmatter in ${(0, import_node_path60.join)(relativeDirPath, dirName)}: ${formatError(result.error)}`
8374
+ `Invalid frontmatter in ${(0, import_node_path62.join)(relativeDirPath, dirName)}: ${formatError(result.error)}`
8108
8375
  );
8109
8376
  }
8110
8377
  }
@@ -8163,8 +8430,8 @@ var SimulatedSkill = class extends ToolSkill {
8163
8430
  }) {
8164
8431
  const settablePaths = this.getSettablePaths();
8165
8432
  const actualRelativeDirPath = relativeDirPath ?? settablePaths.relativeDirPath;
8166
- const skillDirPath = (0, import_node_path60.join)(baseDir, actualRelativeDirPath, dirName);
8167
- const skillFilePath = (0, import_node_path60.join)(skillDirPath, SKILL_FILE_NAME);
8433
+ const skillDirPath = (0, import_node_path62.join)(baseDir, actualRelativeDirPath, dirName);
8434
+ const skillFilePath = (0, import_node_path62.join)(skillDirPath, SKILL_FILE_NAME);
8168
8435
  if (!await fileExists(skillFilePath)) {
8169
8436
  throw new Error(`${SKILL_FILE_NAME} not found in ${skillDirPath}`);
8170
8437
  }
@@ -8241,7 +8508,7 @@ var AgentsmdSkill = class _AgentsmdSkill extends SimulatedSkill {
8241
8508
  throw new Error("AgentsmdSkill does not support global mode.");
8242
8509
  }
8243
8510
  return {
8244
- relativeDirPath: (0, import_node_path61.join)(".agents", "skills")
8511
+ relativeDirPath: (0, import_node_path63.join)(".agents", "skills")
8245
8512
  };
8246
8513
  }
8247
8514
  static async fromDir(params) {
@@ -8268,11 +8535,11 @@ var AgentsmdSkill = class _AgentsmdSkill extends SimulatedSkill {
8268
8535
  };
8269
8536
 
8270
8537
  // src/features/skills/factorydroid-skill.ts
8271
- var import_node_path62 = require("path");
8538
+ var import_node_path64 = require("path");
8272
8539
  var FactorydroidSkill = class _FactorydroidSkill extends SimulatedSkill {
8273
8540
  static getSettablePaths(_options) {
8274
8541
  return {
8275
- relativeDirPath: (0, import_node_path62.join)(".factory", "skills")
8542
+ relativeDirPath: (0, import_node_path64.join)(".factory", "skills")
8276
8543
  };
8277
8544
  }
8278
8545
  static async fromDir(params) {
@@ -8299,11 +8566,11 @@ var FactorydroidSkill = class _FactorydroidSkill extends SimulatedSkill {
8299
8566
  };
8300
8567
 
8301
8568
  // src/features/skills/skills-processor.ts
8302
- var import_node_path80 = require("path");
8303
- var import_mini40 = require("zod/mini");
8569
+ var import_node_path83 = require("path");
8570
+ var import_mini41 = require("zod/mini");
8304
8571
 
8305
8572
  // src/types/dir-feature-processor.ts
8306
- var import_node_path63 = require("path");
8573
+ var import_node_path65 = require("path");
8307
8574
  var DirFeatureProcessor = class {
8308
8575
  baseDir;
8309
8576
  dryRun;
@@ -8343,7 +8610,7 @@ var DirFeatureProcessor = class {
8343
8610
  const mainFile = aiDir.getMainFile();
8344
8611
  let mainFileContent;
8345
8612
  if (mainFile) {
8346
- const mainFilePath = (0, import_node_path63.join)(dirPath, mainFile.name);
8613
+ const mainFilePath = (0, import_node_path65.join)(dirPath, mainFile.name);
8347
8614
  const content = stringifyFrontmatter(mainFile.body, mainFile.frontmatter, {
8348
8615
  avoidBlockScalars: this.avoidBlockScalars
8349
8616
  });
@@ -8359,7 +8626,7 @@ var DirFeatureProcessor = class {
8359
8626
  const contentWithNewline = addTrailingNewline(file.fileBuffer.toString("utf-8"));
8360
8627
  otherFileContents.push(contentWithNewline);
8361
8628
  if (!dirHasChanges) {
8362
- const filePath = (0, import_node_path63.join)(dirPath, file.relativeFilePathToDirPath);
8629
+ const filePath = (0, import_node_path65.join)(dirPath, file.relativeFilePathToDirPath);
8363
8630
  const existingContent = await readFileContentOrNull(filePath);
8364
8631
  if (existingContent !== contentWithNewline) {
8365
8632
  dirHasChanges = true;
@@ -8373,24 +8640,24 @@ var DirFeatureProcessor = class {
8373
8640
  if (this.dryRun) {
8374
8641
  this.logger.info(`[DRY RUN] Would create directory: ${dirPath}`);
8375
8642
  if (mainFile) {
8376
- this.logger.info(`[DRY RUN] Would write: ${(0, import_node_path63.join)(dirPath, mainFile.name)}`);
8377
- changedPaths.push((0, import_node_path63.join)(relativeDir, mainFile.name));
8643
+ this.logger.info(`[DRY RUN] Would write: ${(0, import_node_path65.join)(dirPath, mainFile.name)}`);
8644
+ changedPaths.push((0, import_node_path65.join)(relativeDir, mainFile.name));
8378
8645
  }
8379
8646
  for (const file of otherFiles) {
8380
8647
  this.logger.info(
8381
- `[DRY RUN] Would write: ${(0, import_node_path63.join)(dirPath, file.relativeFilePathToDirPath)}`
8648
+ `[DRY RUN] Would write: ${(0, import_node_path65.join)(dirPath, file.relativeFilePathToDirPath)}`
8382
8649
  );
8383
- changedPaths.push((0, import_node_path63.join)(relativeDir, file.relativeFilePathToDirPath));
8650
+ changedPaths.push((0, import_node_path65.join)(relativeDir, file.relativeFilePathToDirPath));
8384
8651
  }
8385
8652
  } else {
8386
8653
  await ensureDir(dirPath);
8387
8654
  if (mainFile && mainFileContent) {
8388
- const mainFilePath = (0, import_node_path63.join)(dirPath, mainFile.name);
8655
+ const mainFilePath = (0, import_node_path65.join)(dirPath, mainFile.name);
8389
8656
  await writeFileContent(mainFilePath, mainFileContent);
8390
- changedPaths.push((0, import_node_path63.join)(relativeDir, mainFile.name));
8657
+ changedPaths.push((0, import_node_path65.join)(relativeDir, mainFile.name));
8391
8658
  }
8392
8659
  for (const [i, file] of otherFiles.entries()) {
8393
- const filePath = (0, import_node_path63.join)(dirPath, file.relativeFilePathToDirPath);
8660
+ const filePath = (0, import_node_path65.join)(dirPath, file.relativeFilePathToDirPath);
8394
8661
  const content = otherFileContents[i];
8395
8662
  if (content === void 0) {
8396
8663
  throw new Error(
@@ -8398,7 +8665,7 @@ var DirFeatureProcessor = class {
8398
8665
  );
8399
8666
  }
8400
8667
  await writeFileContent(filePath, content);
8401
- changedPaths.push((0, import_node_path63.join)(relativeDir, file.relativeFilePathToDirPath));
8668
+ changedPaths.push((0, import_node_path65.join)(relativeDir, file.relativeFilePathToDirPath));
8402
8669
  }
8403
8670
  }
8404
8671
  changedCount++;
@@ -8430,11 +8697,11 @@ var DirFeatureProcessor = class {
8430
8697
  };
8431
8698
 
8432
8699
  // src/features/skills/agentsskills-skill.ts
8433
- var import_node_path65 = require("path");
8700
+ var import_node_path67 = require("path");
8434
8701
  var import_mini26 = require("zod/mini");
8435
8702
 
8436
8703
  // src/features/skills/rulesync-skill.ts
8437
- var import_node_path64 = require("path");
8704
+ var import_node_path66 = require("path");
8438
8705
  var import_mini25 = require("zod/mini");
8439
8706
  var RulesyncSkillFrontmatterSchemaInternal = import_mini25.z.looseObject({
8440
8707
  name: import_mini25.z.string(),
@@ -8457,6 +8724,11 @@ var RulesyncSkillFrontmatterSchemaInternal = import_mini25.z.looseObject({
8457
8724
  "allowed-tools": import_mini25.z.optional(import_mini25.z.array(import_mini25.z.string()))
8458
8725
  })
8459
8726
  ),
8727
+ deepagents: import_mini25.z.optional(
8728
+ import_mini25.z.looseObject({
8729
+ "allowed-tools": import_mini25.z.optional(import_mini25.z.array(import_mini25.z.string()))
8730
+ })
8731
+ ),
8460
8732
  copilot: import_mini25.z.optional(
8461
8733
  import_mini25.z.looseObject({
8462
8734
  license: import_mini25.z.optional(import_mini25.z.string())
@@ -8503,7 +8775,7 @@ var RulesyncSkill = class _RulesyncSkill extends AiDir {
8503
8775
  }
8504
8776
  getFrontmatter() {
8505
8777
  if (!this.mainFile?.frontmatter) {
8506
- throw new Error(`Frontmatter is not defined in ${(0, import_node_path64.join)(this.relativeDirPath, this.dirName)}`);
8778
+ throw new Error(`Frontmatter is not defined in ${(0, import_node_path66.join)(this.relativeDirPath, this.dirName)}`);
8507
8779
  }
8508
8780
  const result = RulesyncSkillFrontmatterSchema.parse(this.mainFile.frontmatter);
8509
8781
  return result;
@@ -8529,8 +8801,8 @@ var RulesyncSkill = class _RulesyncSkill extends AiDir {
8529
8801
  dirName,
8530
8802
  global = false
8531
8803
  }) {
8532
- const skillDirPath = (0, import_node_path64.join)(baseDir, relativeDirPath, dirName);
8533
- const skillFilePath = (0, import_node_path64.join)(skillDirPath, SKILL_FILE_NAME);
8804
+ const skillDirPath = (0, import_node_path66.join)(baseDir, relativeDirPath, dirName);
8805
+ const skillFilePath = (0, import_node_path66.join)(skillDirPath, SKILL_FILE_NAME);
8534
8806
  if (!await fileExists(skillFilePath)) {
8535
8807
  throw new Error(`${SKILL_FILE_NAME} not found in ${skillDirPath}`);
8536
8808
  }
@@ -8567,7 +8839,7 @@ var AgentsSkillsSkillFrontmatterSchema = import_mini26.z.looseObject({
8567
8839
  var AgentsSkillsSkill = class _AgentsSkillsSkill extends ToolSkill {
8568
8840
  constructor({
8569
8841
  baseDir = process.cwd(),
8570
- relativeDirPath = (0, import_node_path65.join)(".agents", "skills"),
8842
+ relativeDirPath = (0, import_node_path67.join)(".agents", "skills"),
8571
8843
  dirName,
8572
8844
  frontmatter,
8573
8845
  body,
@@ -8599,7 +8871,7 @@ var AgentsSkillsSkill = class _AgentsSkillsSkill extends ToolSkill {
8599
8871
  throw new Error("AgentsSkillsSkill does not support global mode.");
8600
8872
  }
8601
8873
  return {
8602
- relativeDirPath: (0, import_node_path65.join)(".agents", "skills")
8874
+ relativeDirPath: (0, import_node_path67.join)(".agents", "skills")
8603
8875
  };
8604
8876
  }
8605
8877
  getFrontmatter() {
@@ -8679,9 +8951,9 @@ var AgentsSkillsSkill = class _AgentsSkillsSkill extends ToolSkill {
8679
8951
  });
8680
8952
  const result = AgentsSkillsSkillFrontmatterSchema.safeParse(loaded.frontmatter);
8681
8953
  if (!result.success) {
8682
- const skillDirPath = (0, import_node_path65.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
8954
+ const skillDirPath = (0, import_node_path67.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
8683
8955
  throw new Error(
8684
- `Invalid frontmatter in ${(0, import_node_path65.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
8956
+ `Invalid frontmatter in ${(0, import_node_path67.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
8685
8957
  );
8686
8958
  }
8687
8959
  return new _AgentsSkillsSkill({
@@ -8716,7 +8988,7 @@ var AgentsSkillsSkill = class _AgentsSkillsSkill extends ToolSkill {
8716
8988
  };
8717
8989
 
8718
8990
  // src/features/skills/antigravity-skill.ts
8719
- var import_node_path66 = require("path");
8991
+ var import_node_path68 = require("path");
8720
8992
  var import_mini27 = require("zod/mini");
8721
8993
  var AntigravitySkillFrontmatterSchema = import_mini27.z.looseObject({
8722
8994
  name: import_mini27.z.string(),
@@ -8725,7 +8997,7 @@ var AntigravitySkillFrontmatterSchema = import_mini27.z.looseObject({
8725
8997
  var AntigravitySkill = class _AntigravitySkill extends ToolSkill {
8726
8998
  constructor({
8727
8999
  baseDir = process.cwd(),
8728
- relativeDirPath = (0, import_node_path66.join)(".agent", "skills"),
9000
+ relativeDirPath = (0, import_node_path68.join)(".agent", "skills"),
8729
9001
  dirName,
8730
9002
  frontmatter,
8731
9003
  body,
@@ -8757,11 +9029,11 @@ var AntigravitySkill = class _AntigravitySkill extends ToolSkill {
8757
9029
  } = {}) {
8758
9030
  if (global) {
8759
9031
  return {
8760
- relativeDirPath: (0, import_node_path66.join)(".gemini", "antigravity", "skills")
9032
+ relativeDirPath: (0, import_node_path68.join)(".gemini", "antigravity", "skills")
8761
9033
  };
8762
9034
  }
8763
9035
  return {
8764
- relativeDirPath: (0, import_node_path66.join)(".agent", "skills")
9036
+ relativeDirPath: (0, import_node_path68.join)(".agent", "skills")
8765
9037
  };
8766
9038
  }
8767
9039
  getFrontmatter() {
@@ -8841,9 +9113,9 @@ var AntigravitySkill = class _AntigravitySkill extends ToolSkill {
8841
9113
  });
8842
9114
  const result = AntigravitySkillFrontmatterSchema.safeParse(loaded.frontmatter);
8843
9115
  if (!result.success) {
8844
- const skillDirPath = (0, import_node_path66.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
9116
+ const skillDirPath = (0, import_node_path68.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
8845
9117
  throw new Error(
8846
- `Invalid frontmatter in ${(0, import_node_path66.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
9118
+ `Invalid frontmatter in ${(0, import_node_path68.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
8847
9119
  );
8848
9120
  }
8849
9121
  return new _AntigravitySkill({
@@ -8877,7 +9149,7 @@ var AntigravitySkill = class _AntigravitySkill extends ToolSkill {
8877
9149
  };
8878
9150
 
8879
9151
  // src/features/skills/claudecode-skill.ts
8880
- var import_node_path67 = require("path");
9152
+ var import_node_path69 = require("path");
8881
9153
  var import_mini28 = require("zod/mini");
8882
9154
  var ClaudecodeSkillFrontmatterSchema = import_mini28.z.looseObject({
8883
9155
  name: import_mini28.z.string(),
@@ -8889,7 +9161,7 @@ var ClaudecodeSkillFrontmatterSchema = import_mini28.z.looseObject({
8889
9161
  var ClaudecodeSkill = class _ClaudecodeSkill extends ToolSkill {
8890
9162
  constructor({
8891
9163
  baseDir = process.cwd(),
8892
- relativeDirPath = (0, import_node_path67.join)(".claude", "skills"),
9164
+ relativeDirPath = (0, import_node_path69.join)(".claude", "skills"),
8893
9165
  dirName,
8894
9166
  frontmatter,
8895
9167
  body,
@@ -8920,7 +9192,7 @@ var ClaudecodeSkill = class _ClaudecodeSkill extends ToolSkill {
8920
9192
  global: _global = false
8921
9193
  } = {}) {
8922
9194
  return {
8923
- relativeDirPath: (0, import_node_path67.join)(".claude", "skills")
9195
+ relativeDirPath: (0, import_node_path69.join)(".claude", "skills")
8924
9196
  };
8925
9197
  }
8926
9198
  getFrontmatter() {
@@ -9017,9 +9289,9 @@ var ClaudecodeSkill = class _ClaudecodeSkill extends ToolSkill {
9017
9289
  });
9018
9290
  const result = ClaudecodeSkillFrontmatterSchema.safeParse(loaded.frontmatter);
9019
9291
  if (!result.success) {
9020
- const skillDirPath = (0, import_node_path67.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
9292
+ const skillDirPath = (0, import_node_path69.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
9021
9293
  throw new Error(
9022
- `Invalid frontmatter in ${(0, import_node_path67.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
9294
+ `Invalid frontmatter in ${(0, import_node_path69.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
9023
9295
  );
9024
9296
  }
9025
9297
  return new _ClaudecodeSkill({
@@ -9053,7 +9325,7 @@ var ClaudecodeSkill = class _ClaudecodeSkill extends ToolSkill {
9053
9325
  };
9054
9326
 
9055
9327
  // src/features/skills/cline-skill.ts
9056
- var import_node_path68 = require("path");
9328
+ var import_node_path70 = require("path");
9057
9329
  var import_mini29 = require("zod/mini");
9058
9330
  var ClineSkillFrontmatterSchema = import_mini29.z.looseObject({
9059
9331
  name: import_mini29.z.string(),
@@ -9062,7 +9334,7 @@ var ClineSkillFrontmatterSchema = import_mini29.z.looseObject({
9062
9334
  var ClineSkill = class _ClineSkill extends ToolSkill {
9063
9335
  constructor({
9064
9336
  baseDir = process.cwd(),
9065
- relativeDirPath = (0, import_node_path68.join)(".cline", "skills"),
9337
+ relativeDirPath = (0, import_node_path70.join)(".cline", "skills"),
9066
9338
  dirName,
9067
9339
  frontmatter,
9068
9340
  body,
@@ -9091,7 +9363,7 @@ var ClineSkill = class _ClineSkill extends ToolSkill {
9091
9363
  }
9092
9364
  static getSettablePaths(_options = {}) {
9093
9365
  return {
9094
- relativeDirPath: (0, import_node_path68.join)(".cline", "skills")
9366
+ relativeDirPath: (0, import_node_path70.join)(".cline", "skills")
9095
9367
  };
9096
9368
  }
9097
9369
  getFrontmatter() {
@@ -9179,13 +9451,13 @@ var ClineSkill = class _ClineSkill extends ToolSkill {
9179
9451
  });
9180
9452
  const result = ClineSkillFrontmatterSchema.safeParse(loaded.frontmatter);
9181
9453
  if (!result.success) {
9182
- const skillDirPath = (0, import_node_path68.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
9454
+ const skillDirPath = (0, import_node_path70.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
9183
9455
  throw new Error(
9184
- `Invalid frontmatter in ${(0, import_node_path68.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
9456
+ `Invalid frontmatter in ${(0, import_node_path70.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
9185
9457
  );
9186
9458
  }
9187
9459
  if (result.data.name !== loaded.dirName) {
9188
- const skillFilePath = (0, import_node_path68.join)(
9460
+ const skillFilePath = (0, import_node_path70.join)(
9189
9461
  loaded.baseDir,
9190
9462
  loaded.relativeDirPath,
9191
9463
  loaded.dirName,
@@ -9226,7 +9498,7 @@ var ClineSkill = class _ClineSkill extends ToolSkill {
9226
9498
  };
9227
9499
 
9228
9500
  // src/features/skills/codexcli-skill.ts
9229
- var import_node_path69 = require("path");
9501
+ var import_node_path71 = require("path");
9230
9502
  var import_mini30 = require("zod/mini");
9231
9503
  var CodexCliSkillFrontmatterSchema = import_mini30.z.looseObject({
9232
9504
  name: import_mini30.z.string(),
@@ -9240,7 +9512,7 @@ var CodexCliSkillFrontmatterSchema = import_mini30.z.looseObject({
9240
9512
  var CodexCliSkill = class _CodexCliSkill extends ToolSkill {
9241
9513
  constructor({
9242
9514
  baseDir = process.cwd(),
9243
- relativeDirPath = (0, import_node_path69.join)(".codex", "skills"),
9515
+ relativeDirPath = (0, import_node_path71.join)(".codex", "skills"),
9244
9516
  dirName,
9245
9517
  frontmatter,
9246
9518
  body,
@@ -9271,7 +9543,7 @@ var CodexCliSkill = class _CodexCliSkill extends ToolSkill {
9271
9543
  global: _global = false
9272
9544
  } = {}) {
9273
9545
  return {
9274
- relativeDirPath: (0, import_node_path69.join)(".codex", "skills")
9546
+ relativeDirPath: (0, import_node_path71.join)(".codex", "skills")
9275
9547
  };
9276
9548
  }
9277
9549
  getFrontmatter() {
@@ -9361,9 +9633,9 @@ var CodexCliSkill = class _CodexCliSkill extends ToolSkill {
9361
9633
  });
9362
9634
  const result = CodexCliSkillFrontmatterSchema.safeParse(loaded.frontmatter);
9363
9635
  if (!result.success) {
9364
- const skillDirPath = (0, import_node_path69.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
9636
+ const skillDirPath = (0, import_node_path71.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
9365
9637
  throw new Error(
9366
- `Invalid frontmatter in ${(0, import_node_path69.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
9638
+ `Invalid frontmatter in ${(0, import_node_path71.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
9367
9639
  );
9368
9640
  }
9369
9641
  return new _CodexCliSkill({
@@ -9397,7 +9669,7 @@ var CodexCliSkill = class _CodexCliSkill extends ToolSkill {
9397
9669
  };
9398
9670
 
9399
9671
  // src/features/skills/copilot-skill.ts
9400
- var import_node_path70 = require("path");
9672
+ var import_node_path72 = require("path");
9401
9673
  var import_mini31 = require("zod/mini");
9402
9674
  var CopilotSkillFrontmatterSchema = import_mini31.z.looseObject({
9403
9675
  name: import_mini31.z.string(),
@@ -9407,7 +9679,7 @@ var CopilotSkillFrontmatterSchema = import_mini31.z.looseObject({
9407
9679
  var CopilotSkill = class _CopilotSkill extends ToolSkill {
9408
9680
  constructor({
9409
9681
  baseDir = process.cwd(),
9410
- relativeDirPath = (0, import_node_path70.join)(".github", "skills"),
9682
+ relativeDirPath = (0, import_node_path72.join)(".github", "skills"),
9411
9683
  dirName,
9412
9684
  frontmatter,
9413
9685
  body,
@@ -9439,7 +9711,7 @@ var CopilotSkill = class _CopilotSkill extends ToolSkill {
9439
9711
  throw new Error("CopilotSkill does not support global mode.");
9440
9712
  }
9441
9713
  return {
9442
- relativeDirPath: (0, import_node_path70.join)(".github", "skills")
9714
+ relativeDirPath: (0, import_node_path72.join)(".github", "skills")
9443
9715
  };
9444
9716
  }
9445
9717
  getFrontmatter() {
@@ -9525,9 +9797,9 @@ var CopilotSkill = class _CopilotSkill extends ToolSkill {
9525
9797
  });
9526
9798
  const result = CopilotSkillFrontmatterSchema.safeParse(loaded.frontmatter);
9527
9799
  if (!result.success) {
9528
- const skillDirPath = (0, import_node_path70.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
9800
+ const skillDirPath = (0, import_node_path72.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
9529
9801
  throw new Error(
9530
- `Invalid frontmatter in ${(0, import_node_path70.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
9802
+ `Invalid frontmatter in ${(0, import_node_path72.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
9531
9803
  );
9532
9804
  }
9533
9805
  return new _CopilotSkill({
@@ -9562,7 +9834,7 @@ var CopilotSkill = class _CopilotSkill extends ToolSkill {
9562
9834
  };
9563
9835
 
9564
9836
  // src/features/skills/cursor-skill.ts
9565
- var import_node_path71 = require("path");
9837
+ var import_node_path73 = require("path");
9566
9838
  var import_mini32 = require("zod/mini");
9567
9839
  var CursorSkillFrontmatterSchema = import_mini32.z.looseObject({
9568
9840
  name: import_mini32.z.string(),
@@ -9571,7 +9843,7 @@ var CursorSkillFrontmatterSchema = import_mini32.z.looseObject({
9571
9843
  var CursorSkill = class _CursorSkill extends ToolSkill {
9572
9844
  constructor({
9573
9845
  baseDir = process.cwd(),
9574
- relativeDirPath = (0, import_node_path71.join)(".cursor", "skills"),
9846
+ relativeDirPath = (0, import_node_path73.join)(".cursor", "skills"),
9575
9847
  dirName,
9576
9848
  frontmatter,
9577
9849
  body,
@@ -9600,7 +9872,7 @@ var CursorSkill = class _CursorSkill extends ToolSkill {
9600
9872
  }
9601
9873
  static getSettablePaths(_options) {
9602
9874
  return {
9603
- relativeDirPath: (0, import_node_path71.join)(".cursor", "skills")
9875
+ relativeDirPath: (0, import_node_path73.join)(".cursor", "skills")
9604
9876
  };
9605
9877
  }
9606
9878
  getFrontmatter() {
@@ -9680,9 +9952,9 @@ var CursorSkill = class _CursorSkill extends ToolSkill {
9680
9952
  });
9681
9953
  const result = CursorSkillFrontmatterSchema.safeParse(loaded.frontmatter);
9682
9954
  if (!result.success) {
9683
- const skillDirPath = (0, import_node_path71.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
9955
+ const skillDirPath = (0, import_node_path73.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
9684
9956
  throw new Error(
9685
- `Invalid frontmatter in ${(0, import_node_path71.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
9957
+ `Invalid frontmatter in ${(0, import_node_path73.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
9686
9958
  );
9687
9959
  }
9688
9960
  return new _CursorSkill({
@@ -9716,17 +9988,18 @@ var CursorSkill = class _CursorSkill extends ToolSkill {
9716
9988
  }
9717
9989
  };
9718
9990
 
9719
- // src/features/skills/geminicli-skill.ts
9720
- var import_node_path72 = require("path");
9991
+ // src/features/skills/deepagents-skill.ts
9992
+ var import_node_path74 = require("path");
9721
9993
  var import_mini33 = require("zod/mini");
9722
- var GeminiCliSkillFrontmatterSchema = import_mini33.z.looseObject({
9994
+ var DeepagentsSkillFrontmatterSchema = import_mini33.z.looseObject({
9723
9995
  name: import_mini33.z.string(),
9724
- description: import_mini33.z.string()
9996
+ description: import_mini33.z.string(),
9997
+ "allowed-tools": import_mini33.z.optional(import_mini33.z.array(import_mini33.z.string()))
9725
9998
  });
9726
- var GeminiCliSkill = class _GeminiCliSkill extends ToolSkill {
9999
+ var DeepagentsSkill = class _DeepagentsSkill extends ToolSkill {
9727
10000
  constructor({
9728
10001
  baseDir = process.cwd(),
9729
- relativeDirPath = _GeminiCliSkill.getSettablePaths().relativeDirPath,
10002
+ relativeDirPath = (0, import_node_path74.join)(".deepagents", "skills"),
9730
10003
  dirName,
9731
10004
  frontmatter,
9732
10005
  body,
@@ -9753,28 +10026,29 @@ var GeminiCliSkill = class _GeminiCliSkill extends ToolSkill {
9753
10026
  }
9754
10027
  }
9755
10028
  }
9756
- static getSettablePaths({
9757
- global: _global = false
9758
- } = {}) {
10029
+ static getSettablePaths(options) {
10030
+ if (options?.global) {
10031
+ throw new Error("DeepagentsSkill does not support global mode.");
10032
+ }
9759
10033
  return {
9760
- relativeDirPath: (0, import_node_path72.join)(".gemini", "skills")
10034
+ relativeDirPath: (0, import_node_path74.join)(".deepagents", "skills")
9761
10035
  };
9762
10036
  }
9763
10037
  getFrontmatter() {
9764
- const result = GeminiCliSkillFrontmatterSchema.parse(this.requireMainFileFrontmatter());
10038
+ const result = DeepagentsSkillFrontmatterSchema.parse(this.requireMainFileFrontmatter());
9765
10039
  return result;
9766
10040
  }
9767
10041
  getBody() {
9768
10042
  return this.mainFile?.body ?? "";
9769
10043
  }
9770
10044
  validate() {
9771
- if (this.mainFile === void 0) {
10045
+ if (!this.mainFile) {
9772
10046
  return {
9773
10047
  success: false,
9774
10048
  error: new Error(`${this.getDirPath()}: ${SKILL_FILE_NAME} file does not exist`)
9775
10049
  };
9776
10050
  }
9777
- const result = GeminiCliSkillFrontmatterSchema.safeParse(this.mainFile.frontmatter);
10051
+ const result = DeepagentsSkillFrontmatterSchema.safeParse(this.mainFile.frontmatter);
9778
10052
  if (!result.success) {
9779
10053
  return {
9780
10054
  success: false,
@@ -9790,7 +10064,10 @@ var GeminiCliSkill = class _GeminiCliSkill extends ToolSkill {
9790
10064
  const rulesyncFrontmatter = {
9791
10065
  name: frontmatter.name,
9792
10066
  description: frontmatter.description,
9793
- targets: ["*"]
10067
+ targets: ["*"],
10068
+ ...frontmatter["allowed-tools"] && {
10069
+ deepagents: { "allowed-tools": frontmatter["allowed-tools"] }
10070
+ }
9794
10071
  };
9795
10072
  return new RulesyncSkill({
9796
10073
  baseDir: this.baseDir,
@@ -9809,17 +10086,18 @@ var GeminiCliSkill = class _GeminiCliSkill extends ToolSkill {
9809
10086
  validate = true,
9810
10087
  global = false
9811
10088
  }) {
9812
- const settablePaths = _GeminiCliSkill.getSettablePaths({ global });
10089
+ const settablePaths = _DeepagentsSkill.getSettablePaths({ global });
9813
10090
  const rulesyncFrontmatter = rulesyncSkill.getFrontmatter();
9814
- const geminiCliFrontmatter = {
10091
+ const deepagentsFrontmatter = {
9815
10092
  name: rulesyncFrontmatter.name,
9816
- description: rulesyncFrontmatter.description
10093
+ description: rulesyncFrontmatter.description,
10094
+ "allowed-tools": rulesyncFrontmatter.deepagents?.["allowed-tools"]
9817
10095
  };
9818
- return new _GeminiCliSkill({
10096
+ return new _DeepagentsSkill({
9819
10097
  baseDir,
9820
10098
  relativeDirPath: settablePaths.relativeDirPath,
9821
10099
  dirName: rulesyncSkill.getDirName(),
9822
- frontmatter: geminiCliFrontmatter,
10100
+ frontmatter: deepagentsFrontmatter,
9823
10101
  body: rulesyncSkill.getBody(),
9824
10102
  otherFiles: rulesyncSkill.getOtherFiles(),
9825
10103
  validate,
@@ -9828,21 +10106,21 @@ var GeminiCliSkill = class _GeminiCliSkill extends ToolSkill {
9828
10106
  }
9829
10107
  static isTargetedByRulesyncSkill(rulesyncSkill) {
9830
10108
  const targets = rulesyncSkill.getFrontmatter().targets;
9831
- return targets.includes("*") || targets.includes("geminicli");
10109
+ return targets.includes("*") || targets.includes("deepagents");
9832
10110
  }
9833
10111
  static async fromDir(params) {
9834
10112
  const loaded = await this.loadSkillDirContent({
9835
10113
  ...params,
9836
- getSettablePaths: _GeminiCliSkill.getSettablePaths
10114
+ getSettablePaths: _DeepagentsSkill.getSettablePaths
9837
10115
  });
9838
- const result = GeminiCliSkillFrontmatterSchema.safeParse(loaded.frontmatter);
10116
+ const result = DeepagentsSkillFrontmatterSchema.safeParse(loaded.frontmatter);
9839
10117
  if (!result.success) {
9840
- const skillDirPath = (0, import_node_path72.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
10118
+ const skillDirPath = (0, import_node_path74.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
9841
10119
  throw new Error(
9842
- `Invalid frontmatter in ${(0, import_node_path72.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
10120
+ `Invalid frontmatter in ${(0, import_node_path74.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
9843
10121
  );
9844
10122
  }
9845
- return new _GeminiCliSkill({
10123
+ return new _DeepagentsSkill({
9846
10124
  baseDir: loaded.baseDir,
9847
10125
  relativeDirPath: loaded.relativeDirPath,
9848
10126
  dirName: loaded.dirName,
@@ -9859,8 +10137,8 @@ var GeminiCliSkill = class _GeminiCliSkill extends ToolSkill {
9859
10137
  dirName,
9860
10138
  global = false
9861
10139
  }) {
9862
- const settablePaths = _GeminiCliSkill.getSettablePaths({ global });
9863
- return new _GeminiCliSkill({
10140
+ const settablePaths = _DeepagentsSkill.getSettablePaths({ global });
10141
+ return new _DeepagentsSkill({
9864
10142
  baseDir,
9865
10143
  relativeDirPath: relativeDirPath ?? settablePaths.relativeDirPath,
9866
10144
  dirName,
@@ -9873,17 +10151,17 @@ var GeminiCliSkill = class _GeminiCliSkill extends ToolSkill {
9873
10151
  }
9874
10152
  };
9875
10153
 
9876
- // src/features/skills/junie-skill.ts
9877
- var import_node_path73 = require("path");
10154
+ // src/features/skills/geminicli-skill.ts
10155
+ var import_node_path75 = require("path");
9878
10156
  var import_mini34 = require("zod/mini");
9879
- var JunieSkillFrontmatterSchema = import_mini34.z.looseObject({
10157
+ var GeminiCliSkillFrontmatterSchema = import_mini34.z.looseObject({
9880
10158
  name: import_mini34.z.string(),
9881
10159
  description: import_mini34.z.string()
9882
10160
  });
9883
- var JunieSkill = class _JunieSkill extends ToolSkill {
10161
+ var GeminiCliSkill = class _GeminiCliSkill extends ToolSkill {
9884
10162
  constructor({
9885
10163
  baseDir = process.cwd(),
9886
- relativeDirPath = (0, import_node_path73.join)(".junie", "skills"),
10164
+ relativeDirPath = _GeminiCliSkill.getSettablePaths().relativeDirPath,
9887
10165
  dirName,
9888
10166
  frontmatter,
9889
10167
  body,
@@ -9910,29 +10188,28 @@ var JunieSkill = class _JunieSkill extends ToolSkill {
9910
10188
  }
9911
10189
  }
9912
10190
  }
9913
- static getSettablePaths(options) {
9914
- if (options?.global) {
9915
- throw new Error("JunieSkill does not support global mode.");
9916
- }
10191
+ static getSettablePaths({
10192
+ global: _global = false
10193
+ } = {}) {
9917
10194
  return {
9918
- relativeDirPath: (0, import_node_path73.join)(".junie", "skills")
10195
+ relativeDirPath: (0, import_node_path75.join)(".gemini", "skills")
9919
10196
  };
9920
10197
  }
9921
10198
  getFrontmatter() {
9922
- const result = JunieSkillFrontmatterSchema.parse(this.requireMainFileFrontmatter());
10199
+ const result = GeminiCliSkillFrontmatterSchema.parse(this.requireMainFileFrontmatter());
9923
10200
  return result;
9924
10201
  }
9925
10202
  getBody() {
9926
10203
  return this.mainFile?.body ?? "";
9927
10204
  }
9928
10205
  validate() {
9929
- if (!this.mainFile) {
10206
+ if (this.mainFile === void 0) {
9930
10207
  return {
9931
10208
  success: false,
9932
10209
  error: new Error(`${this.getDirPath()}: ${SKILL_FILE_NAME} file does not exist`)
9933
10210
  };
9934
10211
  }
9935
- const result = JunieSkillFrontmatterSchema.safeParse(this.mainFile.frontmatter);
10212
+ const result = GeminiCliSkillFrontmatterSchema.safeParse(this.mainFile.frontmatter);
9936
10213
  if (!result.success) {
9937
10214
  return {
9938
10215
  success: false,
@@ -9941,14 +10218,6 @@ var JunieSkill = class _JunieSkill extends ToolSkill {
9941
10218
  )
9942
10219
  };
9943
10220
  }
9944
- if (result.data.name !== this.getDirName()) {
9945
- return {
9946
- success: false,
9947
- error: new Error(
9948
- `${this.getDirPath()}: frontmatter name (${result.data.name}) must match directory name (${this.getDirName()})`
9949
- )
9950
- };
9951
- }
9952
10221
  return { success: true, error: null };
9953
10222
  }
9954
10223
  toRulesyncSkill() {
@@ -9970,21 +10239,22 @@ var JunieSkill = class _JunieSkill extends ToolSkill {
9970
10239
  });
9971
10240
  }
9972
10241
  static fromRulesyncSkill({
10242
+ baseDir = process.cwd(),
9973
10243
  rulesyncSkill,
9974
10244
  validate = true,
9975
10245
  global = false
9976
10246
  }) {
9977
- const settablePaths = _JunieSkill.getSettablePaths({ global });
10247
+ const settablePaths = _GeminiCliSkill.getSettablePaths({ global });
9978
10248
  const rulesyncFrontmatter = rulesyncSkill.getFrontmatter();
9979
- const junieFrontmatter = {
10249
+ const geminiCliFrontmatter = {
9980
10250
  name: rulesyncFrontmatter.name,
9981
10251
  description: rulesyncFrontmatter.description
9982
10252
  };
9983
- return new _JunieSkill({
9984
- baseDir: rulesyncSkill.getBaseDir(),
10253
+ return new _GeminiCliSkill({
10254
+ baseDir,
9985
10255
  relativeDirPath: settablePaths.relativeDirPath,
9986
- dirName: junieFrontmatter.name,
9987
- frontmatter: junieFrontmatter,
10256
+ dirName: rulesyncSkill.getDirName(),
10257
+ frontmatter: geminiCliFrontmatter,
9988
10258
  body: rulesyncSkill.getBody(),
9989
10259
  otherFiles: rulesyncSkill.getOtherFiles(),
9990
10260
  validate,
@@ -9993,29 +10263,194 @@ var JunieSkill = class _JunieSkill extends ToolSkill {
9993
10263
  }
9994
10264
  static isTargetedByRulesyncSkill(rulesyncSkill) {
9995
10265
  const targets = rulesyncSkill.getFrontmatter().targets;
9996
- return targets.includes("*") || targets.includes("junie");
10266
+ return targets.includes("*") || targets.includes("geminicli");
9997
10267
  }
9998
10268
  static async fromDir(params) {
9999
10269
  const loaded = await this.loadSkillDirContent({
10000
10270
  ...params,
10001
- getSettablePaths: _JunieSkill.getSettablePaths
10271
+ getSettablePaths: _GeminiCliSkill.getSettablePaths
10002
10272
  });
10003
- const result = JunieSkillFrontmatterSchema.safeParse(loaded.frontmatter);
10273
+ const result = GeminiCliSkillFrontmatterSchema.safeParse(loaded.frontmatter);
10004
10274
  if (!result.success) {
10005
- const skillDirPath = (0, import_node_path73.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
10006
- throw new Error(
10007
- `Invalid frontmatter in ${(0, import_node_path73.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
10008
- );
10009
- }
10010
- if (result.data.name !== loaded.dirName) {
10011
- const skillFilePath = (0, import_node_path73.join)(
10012
- loaded.baseDir,
10013
- loaded.relativeDirPath,
10014
- loaded.dirName,
10015
- SKILL_FILE_NAME
10016
- );
10275
+ const skillDirPath = (0, import_node_path75.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
10017
10276
  throw new Error(
10018
- `Frontmatter name (${result.data.name}) must match directory name (${loaded.dirName}) in ${skillFilePath}`
10277
+ `Invalid frontmatter in ${(0, import_node_path75.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
10278
+ );
10279
+ }
10280
+ return new _GeminiCliSkill({
10281
+ baseDir: loaded.baseDir,
10282
+ relativeDirPath: loaded.relativeDirPath,
10283
+ dirName: loaded.dirName,
10284
+ frontmatter: result.data,
10285
+ body: loaded.body,
10286
+ otherFiles: loaded.otherFiles,
10287
+ validate: true,
10288
+ global: loaded.global
10289
+ });
10290
+ }
10291
+ static forDeletion({
10292
+ baseDir = process.cwd(),
10293
+ relativeDirPath,
10294
+ dirName,
10295
+ global = false
10296
+ }) {
10297
+ const settablePaths = _GeminiCliSkill.getSettablePaths({ global });
10298
+ return new _GeminiCliSkill({
10299
+ baseDir,
10300
+ relativeDirPath: relativeDirPath ?? settablePaths.relativeDirPath,
10301
+ dirName,
10302
+ frontmatter: { name: "", description: "" },
10303
+ body: "",
10304
+ otherFiles: [],
10305
+ validate: false,
10306
+ global
10307
+ });
10308
+ }
10309
+ };
10310
+
10311
+ // src/features/skills/junie-skill.ts
10312
+ var import_node_path76 = require("path");
10313
+ var import_mini35 = require("zod/mini");
10314
+ var JunieSkillFrontmatterSchema = import_mini35.z.looseObject({
10315
+ name: import_mini35.z.string(),
10316
+ description: import_mini35.z.string()
10317
+ });
10318
+ var JunieSkill = class _JunieSkill extends ToolSkill {
10319
+ constructor({
10320
+ baseDir = process.cwd(),
10321
+ relativeDirPath = (0, import_node_path76.join)(".junie", "skills"),
10322
+ dirName,
10323
+ frontmatter,
10324
+ body,
10325
+ otherFiles = [],
10326
+ validate = true,
10327
+ global = false
10328
+ }) {
10329
+ super({
10330
+ baseDir,
10331
+ relativeDirPath,
10332
+ dirName,
10333
+ mainFile: {
10334
+ name: SKILL_FILE_NAME,
10335
+ body,
10336
+ frontmatter: { ...frontmatter }
10337
+ },
10338
+ otherFiles,
10339
+ global
10340
+ });
10341
+ if (validate) {
10342
+ const result = this.validate();
10343
+ if (!result.success) {
10344
+ throw result.error;
10345
+ }
10346
+ }
10347
+ }
10348
+ static getSettablePaths(options) {
10349
+ if (options?.global) {
10350
+ throw new Error("JunieSkill does not support global mode.");
10351
+ }
10352
+ return {
10353
+ relativeDirPath: (0, import_node_path76.join)(".junie", "skills")
10354
+ };
10355
+ }
10356
+ getFrontmatter() {
10357
+ const result = JunieSkillFrontmatterSchema.parse(this.requireMainFileFrontmatter());
10358
+ return result;
10359
+ }
10360
+ getBody() {
10361
+ return this.mainFile?.body ?? "";
10362
+ }
10363
+ validate() {
10364
+ if (!this.mainFile) {
10365
+ return {
10366
+ success: false,
10367
+ error: new Error(`${this.getDirPath()}: ${SKILL_FILE_NAME} file does not exist`)
10368
+ };
10369
+ }
10370
+ const result = JunieSkillFrontmatterSchema.safeParse(this.mainFile.frontmatter);
10371
+ if (!result.success) {
10372
+ return {
10373
+ success: false,
10374
+ error: new Error(
10375
+ `Invalid frontmatter in ${this.getDirPath()}: ${formatError(result.error)}`
10376
+ )
10377
+ };
10378
+ }
10379
+ if (result.data.name !== this.getDirName()) {
10380
+ return {
10381
+ success: false,
10382
+ error: new Error(
10383
+ `${this.getDirPath()}: frontmatter name (${result.data.name}) must match directory name (${this.getDirName()})`
10384
+ )
10385
+ };
10386
+ }
10387
+ return { success: true, error: null };
10388
+ }
10389
+ toRulesyncSkill() {
10390
+ const frontmatter = this.getFrontmatter();
10391
+ const rulesyncFrontmatter = {
10392
+ name: frontmatter.name,
10393
+ description: frontmatter.description,
10394
+ targets: ["*"]
10395
+ };
10396
+ return new RulesyncSkill({
10397
+ baseDir: this.baseDir,
10398
+ relativeDirPath: RULESYNC_SKILLS_RELATIVE_DIR_PATH,
10399
+ dirName: this.getDirName(),
10400
+ frontmatter: rulesyncFrontmatter,
10401
+ body: this.getBody(),
10402
+ otherFiles: this.getOtherFiles(),
10403
+ validate: true,
10404
+ global: this.global
10405
+ });
10406
+ }
10407
+ static fromRulesyncSkill({
10408
+ rulesyncSkill,
10409
+ validate = true,
10410
+ global = false
10411
+ }) {
10412
+ const settablePaths = _JunieSkill.getSettablePaths({ global });
10413
+ const rulesyncFrontmatter = rulesyncSkill.getFrontmatter();
10414
+ const junieFrontmatter = {
10415
+ name: rulesyncFrontmatter.name,
10416
+ description: rulesyncFrontmatter.description
10417
+ };
10418
+ return new _JunieSkill({
10419
+ baseDir: rulesyncSkill.getBaseDir(),
10420
+ relativeDirPath: settablePaths.relativeDirPath,
10421
+ dirName: junieFrontmatter.name,
10422
+ frontmatter: junieFrontmatter,
10423
+ body: rulesyncSkill.getBody(),
10424
+ otherFiles: rulesyncSkill.getOtherFiles(),
10425
+ validate,
10426
+ global
10427
+ });
10428
+ }
10429
+ static isTargetedByRulesyncSkill(rulesyncSkill) {
10430
+ const targets = rulesyncSkill.getFrontmatter().targets;
10431
+ return targets.includes("*") || targets.includes("junie");
10432
+ }
10433
+ static async fromDir(params) {
10434
+ const loaded = await this.loadSkillDirContent({
10435
+ ...params,
10436
+ getSettablePaths: _JunieSkill.getSettablePaths
10437
+ });
10438
+ const result = JunieSkillFrontmatterSchema.safeParse(loaded.frontmatter);
10439
+ if (!result.success) {
10440
+ const skillDirPath = (0, import_node_path76.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
10441
+ throw new Error(
10442
+ `Invalid frontmatter in ${(0, import_node_path76.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
10443
+ );
10444
+ }
10445
+ if (result.data.name !== loaded.dirName) {
10446
+ const skillFilePath = (0, import_node_path76.join)(
10447
+ loaded.baseDir,
10448
+ loaded.relativeDirPath,
10449
+ loaded.dirName,
10450
+ SKILL_FILE_NAME
10451
+ );
10452
+ throw new Error(
10453
+ `Frontmatter name (${result.data.name}) must match directory name (${loaded.dirName}) in ${skillFilePath}`
10019
10454
  );
10020
10455
  }
10021
10456
  return new _JunieSkill({
@@ -10050,16 +10485,16 @@ var JunieSkill = class _JunieSkill extends ToolSkill {
10050
10485
  };
10051
10486
 
10052
10487
  // src/features/skills/kilo-skill.ts
10053
- var import_node_path74 = require("path");
10054
- var import_mini35 = require("zod/mini");
10055
- var KiloSkillFrontmatterSchema = import_mini35.z.looseObject({
10056
- name: import_mini35.z.string(),
10057
- description: import_mini35.z.string()
10488
+ var import_node_path77 = require("path");
10489
+ var import_mini36 = require("zod/mini");
10490
+ var KiloSkillFrontmatterSchema = import_mini36.z.looseObject({
10491
+ name: import_mini36.z.string(),
10492
+ description: import_mini36.z.string()
10058
10493
  });
10059
10494
  var KiloSkill = class _KiloSkill extends ToolSkill {
10060
10495
  constructor({
10061
10496
  baseDir = process.cwd(),
10062
- relativeDirPath = (0, import_node_path74.join)(".kilocode", "skills"),
10497
+ relativeDirPath = (0, import_node_path77.join)(".kilocode", "skills"),
10063
10498
  dirName,
10064
10499
  frontmatter,
10065
10500
  body,
@@ -10090,7 +10525,7 @@ var KiloSkill = class _KiloSkill extends ToolSkill {
10090
10525
  global: _global = false
10091
10526
  } = {}) {
10092
10527
  return {
10093
- relativeDirPath: (0, import_node_path74.join)(".kilocode", "skills")
10528
+ relativeDirPath: (0, import_node_path77.join)(".kilocode", "skills")
10094
10529
  };
10095
10530
  }
10096
10531
  getFrontmatter() {
@@ -10178,13 +10613,13 @@ var KiloSkill = class _KiloSkill extends ToolSkill {
10178
10613
  });
10179
10614
  const result = KiloSkillFrontmatterSchema.safeParse(loaded.frontmatter);
10180
10615
  if (!result.success) {
10181
- const skillDirPath = (0, import_node_path74.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
10616
+ const skillDirPath = (0, import_node_path77.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
10182
10617
  throw new Error(
10183
- `Invalid frontmatter in ${(0, import_node_path74.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
10618
+ `Invalid frontmatter in ${(0, import_node_path77.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
10184
10619
  );
10185
10620
  }
10186
10621
  if (result.data.name !== loaded.dirName) {
10187
- const skillFilePath = (0, import_node_path74.join)(
10622
+ const skillFilePath = (0, import_node_path77.join)(
10188
10623
  loaded.baseDir,
10189
10624
  loaded.relativeDirPath,
10190
10625
  loaded.dirName,
@@ -10225,16 +10660,16 @@ var KiloSkill = class _KiloSkill extends ToolSkill {
10225
10660
  };
10226
10661
 
10227
10662
  // src/features/skills/kiro-skill.ts
10228
- var import_node_path75 = require("path");
10229
- var import_mini36 = require("zod/mini");
10230
- var KiroSkillFrontmatterSchema = import_mini36.z.looseObject({
10231
- name: import_mini36.z.string(),
10232
- description: import_mini36.z.string()
10663
+ var import_node_path78 = require("path");
10664
+ var import_mini37 = require("zod/mini");
10665
+ var KiroSkillFrontmatterSchema = import_mini37.z.looseObject({
10666
+ name: import_mini37.z.string(),
10667
+ description: import_mini37.z.string()
10233
10668
  });
10234
10669
  var KiroSkill = class _KiroSkill extends ToolSkill {
10235
10670
  constructor({
10236
10671
  baseDir = process.cwd(),
10237
- relativeDirPath = (0, import_node_path75.join)(".kiro", "skills"),
10672
+ relativeDirPath = (0, import_node_path78.join)(".kiro", "skills"),
10238
10673
  dirName,
10239
10674
  frontmatter,
10240
10675
  body,
@@ -10266,7 +10701,7 @@ var KiroSkill = class _KiroSkill extends ToolSkill {
10266
10701
  throw new Error("KiroSkill does not support global mode.");
10267
10702
  }
10268
10703
  return {
10269
- relativeDirPath: (0, import_node_path75.join)(".kiro", "skills")
10704
+ relativeDirPath: (0, import_node_path78.join)(".kiro", "skills")
10270
10705
  };
10271
10706
  }
10272
10707
  getFrontmatter() {
@@ -10354,13 +10789,13 @@ var KiroSkill = class _KiroSkill extends ToolSkill {
10354
10789
  });
10355
10790
  const result = KiroSkillFrontmatterSchema.safeParse(loaded.frontmatter);
10356
10791
  if (!result.success) {
10357
- const skillDirPath = (0, import_node_path75.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
10792
+ const skillDirPath = (0, import_node_path78.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
10358
10793
  throw new Error(
10359
- `Invalid frontmatter in ${(0, import_node_path75.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
10794
+ `Invalid frontmatter in ${(0, import_node_path78.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
10360
10795
  );
10361
10796
  }
10362
10797
  if (result.data.name !== loaded.dirName) {
10363
- const skillFilePath = (0, import_node_path75.join)(
10798
+ const skillFilePath = (0, import_node_path78.join)(
10364
10799
  loaded.baseDir,
10365
10800
  loaded.relativeDirPath,
10366
10801
  loaded.dirName,
@@ -10402,17 +10837,17 @@ var KiroSkill = class _KiroSkill extends ToolSkill {
10402
10837
  };
10403
10838
 
10404
10839
  // src/features/skills/opencode-skill.ts
10405
- var import_node_path76 = require("path");
10406
- var import_mini37 = require("zod/mini");
10407
- var OpenCodeSkillFrontmatterSchema = import_mini37.z.looseObject({
10408
- name: import_mini37.z.string(),
10409
- description: import_mini37.z.string(),
10410
- "allowed-tools": import_mini37.z.optional(import_mini37.z.array(import_mini37.z.string()))
10840
+ var import_node_path79 = require("path");
10841
+ var import_mini38 = require("zod/mini");
10842
+ var OpenCodeSkillFrontmatterSchema = import_mini38.z.looseObject({
10843
+ name: import_mini38.z.string(),
10844
+ description: import_mini38.z.string(),
10845
+ "allowed-tools": import_mini38.z.optional(import_mini38.z.array(import_mini38.z.string()))
10411
10846
  });
10412
10847
  var OpenCodeSkill = class _OpenCodeSkill extends ToolSkill {
10413
10848
  constructor({
10414
10849
  baseDir = process.cwd(),
10415
- relativeDirPath = (0, import_node_path76.join)(".opencode", "skill"),
10850
+ relativeDirPath = (0, import_node_path79.join)(".opencode", "skill"),
10416
10851
  dirName,
10417
10852
  frontmatter,
10418
10853
  body,
@@ -10441,7 +10876,7 @@ var OpenCodeSkill = class _OpenCodeSkill extends ToolSkill {
10441
10876
  }
10442
10877
  static getSettablePaths({ global = false } = {}) {
10443
10878
  return {
10444
- relativeDirPath: global ? (0, import_node_path76.join)(".config", "opencode", "skill") : (0, import_node_path76.join)(".opencode", "skill")
10879
+ relativeDirPath: global ? (0, import_node_path79.join)(".config", "opencode", "skill") : (0, import_node_path79.join)(".opencode", "skill")
10445
10880
  };
10446
10881
  }
10447
10882
  getFrontmatter() {
@@ -10527,9 +10962,9 @@ var OpenCodeSkill = class _OpenCodeSkill extends ToolSkill {
10527
10962
  });
10528
10963
  const result = OpenCodeSkillFrontmatterSchema.safeParse(loaded.frontmatter);
10529
10964
  if (!result.success) {
10530
- const skillDirPath = (0, import_node_path76.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
10965
+ const skillDirPath = (0, import_node_path79.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
10531
10966
  throw new Error(
10532
- `Invalid frontmatter in ${(0, import_node_path76.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
10967
+ `Invalid frontmatter in ${(0, import_node_path79.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
10533
10968
  );
10534
10969
  }
10535
10970
  return new _OpenCodeSkill({
@@ -10563,16 +10998,16 @@ var OpenCodeSkill = class _OpenCodeSkill extends ToolSkill {
10563
10998
  };
10564
10999
 
10565
11000
  // src/features/skills/replit-skill.ts
10566
- var import_node_path77 = require("path");
10567
- var import_mini38 = require("zod/mini");
10568
- var ReplitSkillFrontmatterSchema = import_mini38.z.looseObject({
10569
- name: import_mini38.z.string(),
10570
- description: import_mini38.z.string()
11001
+ var import_node_path80 = require("path");
11002
+ var import_mini39 = require("zod/mini");
11003
+ var ReplitSkillFrontmatterSchema = import_mini39.z.looseObject({
11004
+ name: import_mini39.z.string(),
11005
+ description: import_mini39.z.string()
10571
11006
  });
10572
11007
  var ReplitSkill = class _ReplitSkill extends ToolSkill {
10573
11008
  constructor({
10574
11009
  baseDir = process.cwd(),
10575
- relativeDirPath = (0, import_node_path77.join)(".agents", "skills"),
11010
+ relativeDirPath = (0, import_node_path80.join)(".agents", "skills"),
10576
11011
  dirName,
10577
11012
  frontmatter,
10578
11013
  body,
@@ -10604,7 +11039,7 @@ var ReplitSkill = class _ReplitSkill extends ToolSkill {
10604
11039
  throw new Error("ReplitSkill does not support global mode.");
10605
11040
  }
10606
11041
  return {
10607
- relativeDirPath: (0, import_node_path77.join)(".agents", "skills")
11042
+ relativeDirPath: (0, import_node_path80.join)(".agents", "skills")
10608
11043
  };
10609
11044
  }
10610
11045
  getFrontmatter() {
@@ -10684,9 +11119,9 @@ var ReplitSkill = class _ReplitSkill extends ToolSkill {
10684
11119
  });
10685
11120
  const result = ReplitSkillFrontmatterSchema.safeParse(loaded.frontmatter);
10686
11121
  if (!result.success) {
10687
- const skillDirPath = (0, import_node_path77.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
11122
+ const skillDirPath = (0, import_node_path80.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
10688
11123
  throw new Error(
10689
- `Invalid frontmatter in ${(0, import_node_path77.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
11124
+ `Invalid frontmatter in ${(0, import_node_path80.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
10690
11125
  );
10691
11126
  }
10692
11127
  return new _ReplitSkill({
@@ -10721,16 +11156,16 @@ var ReplitSkill = class _ReplitSkill extends ToolSkill {
10721
11156
  };
10722
11157
 
10723
11158
  // src/features/skills/roo-skill.ts
10724
- var import_node_path78 = require("path");
10725
- var import_mini39 = require("zod/mini");
10726
- var RooSkillFrontmatterSchema = import_mini39.z.looseObject({
10727
- name: import_mini39.z.string(),
10728
- description: import_mini39.z.string()
11159
+ var import_node_path81 = require("path");
11160
+ var import_mini40 = require("zod/mini");
11161
+ var RooSkillFrontmatterSchema = import_mini40.z.looseObject({
11162
+ name: import_mini40.z.string(),
11163
+ description: import_mini40.z.string()
10729
11164
  });
10730
11165
  var RooSkill = class _RooSkill extends ToolSkill {
10731
11166
  constructor({
10732
11167
  baseDir = process.cwd(),
10733
- relativeDirPath = (0, import_node_path78.join)(".roo", "skills"),
11168
+ relativeDirPath = (0, import_node_path81.join)(".roo", "skills"),
10734
11169
  dirName,
10735
11170
  frontmatter,
10736
11171
  body,
@@ -10761,7 +11196,7 @@ var RooSkill = class _RooSkill extends ToolSkill {
10761
11196
  global: _global = false
10762
11197
  } = {}) {
10763
11198
  return {
10764
- relativeDirPath: (0, import_node_path78.join)(".roo", "skills")
11199
+ relativeDirPath: (0, import_node_path81.join)(".roo", "skills")
10765
11200
  };
10766
11201
  }
10767
11202
  getFrontmatter() {
@@ -10849,13 +11284,13 @@ var RooSkill = class _RooSkill extends ToolSkill {
10849
11284
  });
10850
11285
  const result = RooSkillFrontmatterSchema.safeParse(loaded.frontmatter);
10851
11286
  if (!result.success) {
10852
- const skillDirPath = (0, import_node_path78.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
11287
+ const skillDirPath = (0, import_node_path81.join)(loaded.baseDir, loaded.relativeDirPath, loaded.dirName);
10853
11288
  throw new Error(
10854
- `Invalid frontmatter in ${(0, import_node_path78.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
11289
+ `Invalid frontmatter in ${(0, import_node_path81.join)(skillDirPath, SKILL_FILE_NAME)}: ${formatError(result.error)}`
10855
11290
  );
10856
11291
  }
10857
11292
  if (result.data.name !== loaded.dirName) {
10858
- const skillFilePath = (0, import_node_path78.join)(
11293
+ const skillFilePath = (0, import_node_path81.join)(
10859
11294
  loaded.baseDir,
10860
11295
  loaded.relativeDirPath,
10861
11296
  loaded.dirName,
@@ -10896,17 +11331,17 @@ var RooSkill = class _RooSkill extends ToolSkill {
10896
11331
  };
10897
11332
 
10898
11333
  // src/features/skills/skills-utils.ts
10899
- var import_node_path79 = require("path");
11334
+ var import_node_path82 = require("path");
10900
11335
  async function getLocalSkillDirNames(baseDir) {
10901
- const skillsDir = (0, import_node_path79.join)(baseDir, RULESYNC_SKILLS_RELATIVE_DIR_PATH);
11336
+ const skillsDir = (0, import_node_path82.join)(baseDir, RULESYNC_SKILLS_RELATIVE_DIR_PATH);
10902
11337
  const names = /* @__PURE__ */ new Set();
10903
11338
  if (!await directoryExists(skillsDir)) {
10904
11339
  return names;
10905
11340
  }
10906
- const dirPaths = await findFilesByGlobs((0, import_node_path79.join)(skillsDir, "*"), { type: "dir" });
11341
+ const dirPaths = await findFilesByGlobs((0, import_node_path82.join)(skillsDir, "*"), { type: "dir" });
10907
11342
  for (const dirPath of dirPaths) {
10908
- const name = (0, import_node_path79.basename)(dirPath);
10909
- if (name === (0, import_node_path79.basename)(RULESYNC_CURATED_SKILLS_RELATIVE_DIR_PATH)) continue;
11343
+ const name = (0, import_node_path82.basename)(dirPath);
11344
+ if (name === (0, import_node_path82.basename)(RULESYNC_CURATED_SKILLS_RELATIVE_DIR_PATH)) continue;
10910
11345
  names.add(name);
10911
11346
  }
10912
11347
  return names;
@@ -10923,6 +11358,7 @@ var skillsProcessorToolTargetTuple = [
10923
11358
  "codexcli",
10924
11359
  "copilot",
10925
11360
  "cursor",
11361
+ "deepagents",
10926
11362
  "factorydroid",
10927
11363
  "geminicli",
10928
11364
  "junie",
@@ -10932,7 +11368,7 @@ var skillsProcessorToolTargetTuple = [
10932
11368
  "replit",
10933
11369
  "roo"
10934
11370
  ];
10935
- var SkillsProcessorToolTargetSchema = import_mini40.z.enum(skillsProcessorToolTargetTuple);
11371
+ var SkillsProcessorToolTargetSchema = import_mini41.z.enum(skillsProcessorToolTargetTuple);
10936
11372
  var toolSkillFactories = /* @__PURE__ */ new Map([
10937
11373
  [
10938
11374
  "agentsmd",
@@ -10997,6 +11433,13 @@ var toolSkillFactories = /* @__PURE__ */ new Map([
10997
11433
  meta: { supportsProject: true, supportsSimulated: false, supportsGlobal: true }
10998
11434
  }
10999
11435
  ],
11436
+ [
11437
+ "deepagents",
11438
+ {
11439
+ class: DeepagentsSkill,
11440
+ meta: { supportsProject: true, supportsSimulated: false, supportsGlobal: false }
11441
+ }
11442
+ ],
11000
11443
  [
11001
11444
  "factorydroid",
11002
11445
  {
@@ -11142,11 +11585,11 @@ var SkillsProcessor = class extends DirFeatureProcessor {
11142
11585
  )
11143
11586
  );
11144
11587
  const localSkillNames = new Set(localDirNames);
11145
- const curatedDirPath = (0, import_node_path80.join)(process.cwd(), RULESYNC_CURATED_SKILLS_RELATIVE_DIR_PATH);
11588
+ const curatedDirPath = (0, import_node_path83.join)(process.cwd(), RULESYNC_CURATED_SKILLS_RELATIVE_DIR_PATH);
11146
11589
  let curatedSkills = [];
11147
11590
  if (await directoryExists(curatedDirPath)) {
11148
- const curatedDirPaths = await findFilesByGlobs((0, import_node_path80.join)(curatedDirPath, "*"), { type: "dir" });
11149
- const curatedDirNames = curatedDirPaths.map((path3) => (0, import_node_path80.basename)(path3));
11591
+ const curatedDirPaths = await findFilesByGlobs((0, import_node_path83.join)(curatedDirPath, "*"), { type: "dir" });
11592
+ const curatedDirNames = curatedDirPaths.map((path3) => (0, import_node_path83.basename)(path3));
11150
11593
  const nonConflicting = curatedDirNames.filter((name) => {
11151
11594
  if (localSkillNames.has(name)) {
11152
11595
  this.logger.debug(`Skipping curated skill "${name}": local skill takes precedence.`);
@@ -11179,9 +11622,9 @@ var SkillsProcessor = class extends DirFeatureProcessor {
11179
11622
  async loadToolDirs() {
11180
11623
  const factory = this.getFactory(this.toolTarget);
11181
11624
  const paths = factory.class.getSettablePaths({ global: this.global });
11182
- const skillsDirPath = (0, import_node_path80.join)(this.baseDir, paths.relativeDirPath);
11183
- const dirPaths = await findFilesByGlobs((0, import_node_path80.join)(skillsDirPath, "*"), { type: "dir" });
11184
- const dirNames = dirPaths.map((path3) => (0, import_node_path80.basename)(path3));
11625
+ const skillsDirPath = (0, import_node_path83.join)(this.baseDir, paths.relativeDirPath);
11626
+ const dirPaths = await findFilesByGlobs((0, import_node_path83.join)(skillsDirPath, "*"), { type: "dir" });
11627
+ const dirNames = dirPaths.map((path3) => (0, import_node_path83.basename)(path3));
11185
11628
  const toolSkills = await Promise.all(
11186
11629
  dirNames.map(
11187
11630
  (dirName) => factory.class.fromDir({
@@ -11197,9 +11640,9 @@ var SkillsProcessor = class extends DirFeatureProcessor {
11197
11640
  async loadToolDirsToDelete() {
11198
11641
  const factory = this.getFactory(this.toolTarget);
11199
11642
  const paths = factory.class.getSettablePaths({ global: this.global });
11200
- const skillsDirPath = (0, import_node_path80.join)(this.baseDir, paths.relativeDirPath);
11201
- const dirPaths = await findFilesByGlobs((0, import_node_path80.join)(skillsDirPath, "*"), { type: "dir" });
11202
- const dirNames = dirPaths.map((path3) => (0, import_node_path80.basename)(path3));
11643
+ const skillsDirPath = (0, import_node_path83.join)(this.baseDir, paths.relativeDirPath);
11644
+ const dirPaths = await findFilesByGlobs((0, import_node_path83.join)(skillsDirPath, "*"), { type: "dir" });
11645
+ const dirNames = dirPaths.map((path3) => (0, import_node_path83.basename)(path3));
11203
11646
  const toolSkills = dirNames.map(
11204
11647
  (dirName) => factory.class.forDeletion({
11205
11648
  baseDir: this.baseDir,
@@ -11260,11 +11703,11 @@ var SkillsProcessor = class extends DirFeatureProcessor {
11260
11703
  };
11261
11704
 
11262
11705
  // src/features/subagents/agentsmd-subagent.ts
11263
- var import_node_path82 = require("path");
11706
+ var import_node_path85 = require("path");
11264
11707
 
11265
11708
  // src/features/subagents/simulated-subagent.ts
11266
- var import_node_path81 = require("path");
11267
- var import_mini41 = require("zod/mini");
11709
+ var import_node_path84 = require("path");
11710
+ var import_mini42 = require("zod/mini");
11268
11711
 
11269
11712
  // src/features/subagents/tool-subagent.ts
11270
11713
  var ToolSubagent = class extends ToolFile {
@@ -11316,9 +11759,9 @@ var ToolSubagent = class extends ToolFile {
11316
11759
  };
11317
11760
 
11318
11761
  // src/features/subagents/simulated-subagent.ts
11319
- var SimulatedSubagentFrontmatterSchema = import_mini41.z.object({
11320
- name: import_mini41.z.string(),
11321
- description: import_mini41.z.optional(import_mini41.z.string())
11762
+ var SimulatedSubagentFrontmatterSchema = import_mini42.z.object({
11763
+ name: import_mini42.z.string(),
11764
+ description: import_mini42.z.optional(import_mini42.z.string())
11322
11765
  });
11323
11766
  var SimulatedSubagent = class extends ToolSubagent {
11324
11767
  frontmatter;
@@ -11328,7 +11771,7 @@ var SimulatedSubagent = class extends ToolSubagent {
11328
11771
  const result = SimulatedSubagentFrontmatterSchema.safeParse(frontmatter);
11329
11772
  if (!result.success) {
11330
11773
  throw new Error(
11331
- `Invalid frontmatter in ${(0, import_node_path81.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
11774
+ `Invalid frontmatter in ${(0, import_node_path84.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
11332
11775
  );
11333
11776
  }
11334
11777
  }
@@ -11379,7 +11822,7 @@ var SimulatedSubagent = class extends ToolSubagent {
11379
11822
  return {
11380
11823
  success: false,
11381
11824
  error: new Error(
11382
- `Invalid frontmatter in ${(0, import_node_path81.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
11825
+ `Invalid frontmatter in ${(0, import_node_path84.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
11383
11826
  )
11384
11827
  };
11385
11828
  }
@@ -11389,7 +11832,7 @@ var SimulatedSubagent = class extends ToolSubagent {
11389
11832
  relativeFilePath,
11390
11833
  validate = true
11391
11834
  }) {
11392
- const filePath = (0, import_node_path81.join)(baseDir, this.getSettablePaths().relativeDirPath, relativeFilePath);
11835
+ const filePath = (0, import_node_path84.join)(baseDir, this.getSettablePaths().relativeDirPath, relativeFilePath);
11393
11836
  const fileContent = await readFileContent(filePath);
11394
11837
  const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
11395
11838
  const result = SimulatedSubagentFrontmatterSchema.safeParse(frontmatter);
@@ -11399,7 +11842,7 @@ var SimulatedSubagent = class extends ToolSubagent {
11399
11842
  return {
11400
11843
  baseDir,
11401
11844
  relativeDirPath: this.getSettablePaths().relativeDirPath,
11402
- relativeFilePath: (0, import_node_path81.basename)(relativeFilePath),
11845
+ relativeFilePath: (0, import_node_path84.basename)(relativeFilePath),
11403
11846
  frontmatter: result.data,
11404
11847
  body: content.trim(),
11405
11848
  validate
@@ -11425,7 +11868,7 @@ var SimulatedSubagent = class extends ToolSubagent {
11425
11868
  var AgentsmdSubagent = class _AgentsmdSubagent extends SimulatedSubagent {
11426
11869
  static getSettablePaths() {
11427
11870
  return {
11428
- relativeDirPath: (0, import_node_path82.join)(".agents", "subagents")
11871
+ relativeDirPath: (0, import_node_path85.join)(".agents", "subagents")
11429
11872
  };
11430
11873
  }
11431
11874
  static async fromFile(params) {
@@ -11448,11 +11891,11 @@ var AgentsmdSubagent = class _AgentsmdSubagent extends SimulatedSubagent {
11448
11891
  };
11449
11892
 
11450
11893
  // src/features/subagents/factorydroid-subagent.ts
11451
- var import_node_path83 = require("path");
11894
+ var import_node_path86 = require("path");
11452
11895
  var FactorydroidSubagent = class _FactorydroidSubagent extends SimulatedSubagent {
11453
11896
  static getSettablePaths(_options) {
11454
11897
  return {
11455
- relativeDirPath: (0, import_node_path83.join)(".factory", "droids")
11898
+ relativeDirPath: (0, import_node_path86.join)(".factory", "droids")
11456
11899
  };
11457
11900
  }
11458
11901
  static async fromFile(params) {
@@ -11475,11 +11918,11 @@ var FactorydroidSubagent = class _FactorydroidSubagent extends SimulatedSubagent
11475
11918
  };
11476
11919
 
11477
11920
  // src/features/subagents/geminicli-subagent.ts
11478
- var import_node_path84 = require("path");
11921
+ var import_node_path87 = require("path");
11479
11922
  var GeminiCliSubagent = class _GeminiCliSubagent extends SimulatedSubagent {
11480
11923
  static getSettablePaths() {
11481
11924
  return {
11482
- relativeDirPath: (0, import_node_path84.join)(".gemini", "subagents")
11925
+ relativeDirPath: (0, import_node_path87.join)(".gemini", "subagents")
11483
11926
  };
11484
11927
  }
11485
11928
  static async fromFile(params) {
@@ -11502,11 +11945,11 @@ var GeminiCliSubagent = class _GeminiCliSubagent extends SimulatedSubagent {
11502
11945
  };
11503
11946
 
11504
11947
  // src/features/subagents/roo-subagent.ts
11505
- var import_node_path85 = require("path");
11948
+ var import_node_path88 = require("path");
11506
11949
  var RooSubagent = class _RooSubagent extends SimulatedSubagent {
11507
11950
  static getSettablePaths() {
11508
11951
  return {
11509
- relativeDirPath: (0, import_node_path85.join)(".roo", "subagents")
11952
+ relativeDirPath: (0, import_node_path88.join)(".roo", "subagents")
11510
11953
  };
11511
11954
  }
11512
11955
  static async fromFile(params) {
@@ -11529,20 +11972,20 @@ var RooSubagent = class _RooSubagent extends SimulatedSubagent {
11529
11972
  };
11530
11973
 
11531
11974
  // src/features/subagents/subagents-processor.ts
11532
- var import_node_path94 = require("path");
11533
- var import_mini50 = require("zod/mini");
11975
+ var import_node_path98 = require("path");
11976
+ var import_mini52 = require("zod/mini");
11534
11977
 
11535
11978
  // src/features/subagents/claudecode-subagent.ts
11536
- var import_node_path87 = require("path");
11537
- var import_mini43 = require("zod/mini");
11979
+ var import_node_path90 = require("path");
11980
+ var import_mini44 = require("zod/mini");
11538
11981
 
11539
11982
  // src/features/subagents/rulesync-subagent.ts
11540
- var import_node_path86 = require("path");
11541
- var import_mini42 = require("zod/mini");
11542
- var RulesyncSubagentFrontmatterSchema = import_mini42.z.looseObject({
11543
- targets: import_mini42.z._default(RulesyncTargetsSchema, ["*"]),
11544
- name: import_mini42.z.string(),
11545
- description: import_mini42.z.optional(import_mini42.z.string())
11983
+ var import_node_path89 = require("path");
11984
+ var import_mini43 = require("zod/mini");
11985
+ var RulesyncSubagentFrontmatterSchema = import_mini43.z.looseObject({
11986
+ targets: import_mini43.z._default(RulesyncTargetsSchema, ["*"]),
11987
+ name: import_mini43.z.string(),
11988
+ description: import_mini43.z.optional(import_mini43.z.string())
11546
11989
  });
11547
11990
  var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
11548
11991
  frontmatter;
@@ -11551,7 +11994,7 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
11551
11994
  const parseResult = RulesyncSubagentFrontmatterSchema.safeParse(frontmatter);
11552
11995
  if (!parseResult.success && rest.validate !== false) {
11553
11996
  throw new Error(
11554
- `Invalid frontmatter in ${(0, import_node_path86.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(parseResult.error)}`
11997
+ `Invalid frontmatter in ${(0, import_node_path89.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(parseResult.error)}`
11555
11998
  );
11556
11999
  }
11557
12000
  const parsedFrontmatter = parseResult.success ? { ...frontmatter, ...parseResult.data } : { ...frontmatter, targets: frontmatter?.targets ?? ["*"] };
@@ -11584,7 +12027,7 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
11584
12027
  return {
11585
12028
  success: false,
11586
12029
  error: new Error(
11587
- `Invalid frontmatter in ${(0, import_node_path86.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
12030
+ `Invalid frontmatter in ${(0, import_node_path89.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
11588
12031
  )
11589
12032
  };
11590
12033
  }
@@ -11592,14 +12035,14 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
11592
12035
  static async fromFile({
11593
12036
  relativeFilePath
11594
12037
  }) {
11595
- const filePath = (0, import_node_path86.join)(process.cwd(), RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, relativeFilePath);
12038
+ const filePath = (0, import_node_path89.join)(process.cwd(), RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, relativeFilePath);
11596
12039
  const fileContent = await readFileContent(filePath);
11597
12040
  const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
11598
12041
  const result = RulesyncSubagentFrontmatterSchema.safeParse(frontmatter);
11599
12042
  if (!result.success) {
11600
12043
  throw new Error(`Invalid frontmatter in ${relativeFilePath}: ${formatError(result.error)}`);
11601
12044
  }
11602
- const filename = (0, import_node_path86.basename)(relativeFilePath);
12045
+ const filename = (0, import_node_path89.basename)(relativeFilePath);
11603
12046
  return new _RulesyncSubagent({
11604
12047
  baseDir: process.cwd(),
11605
12048
  relativeDirPath: this.getSettablePaths().relativeDirPath,
@@ -11611,13 +12054,13 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
11611
12054
  };
11612
12055
 
11613
12056
  // src/features/subagents/claudecode-subagent.ts
11614
- var ClaudecodeSubagentFrontmatterSchema = import_mini43.z.looseObject({
11615
- name: import_mini43.z.string(),
11616
- description: import_mini43.z.optional(import_mini43.z.string()),
11617
- model: import_mini43.z.optional(import_mini43.z.string()),
11618
- tools: import_mini43.z.optional(import_mini43.z.union([import_mini43.z.string(), import_mini43.z.array(import_mini43.z.string())])),
11619
- permissionMode: import_mini43.z.optional(import_mini43.z.string()),
11620
- skills: import_mini43.z.optional(import_mini43.z.union([import_mini43.z.string(), import_mini43.z.array(import_mini43.z.string())]))
12057
+ var ClaudecodeSubagentFrontmatterSchema = import_mini44.z.looseObject({
12058
+ name: import_mini44.z.string(),
12059
+ description: import_mini44.z.optional(import_mini44.z.string()),
12060
+ model: import_mini44.z.optional(import_mini44.z.string()),
12061
+ tools: import_mini44.z.optional(import_mini44.z.union([import_mini44.z.string(), import_mini44.z.array(import_mini44.z.string())])),
12062
+ permissionMode: import_mini44.z.optional(import_mini44.z.string()),
12063
+ skills: import_mini44.z.optional(import_mini44.z.union([import_mini44.z.string(), import_mini44.z.array(import_mini44.z.string())]))
11621
12064
  });
11622
12065
  var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
11623
12066
  frontmatter;
@@ -11627,7 +12070,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
11627
12070
  const result = ClaudecodeSubagentFrontmatterSchema.safeParse(frontmatter);
11628
12071
  if (!result.success) {
11629
12072
  throw new Error(
11630
- `Invalid frontmatter in ${(0, import_node_path87.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
12073
+ `Invalid frontmatter in ${(0, import_node_path90.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
11631
12074
  );
11632
12075
  }
11633
12076
  }
@@ -11639,7 +12082,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
11639
12082
  }
11640
12083
  static getSettablePaths(_options = {}) {
11641
12084
  return {
11642
- relativeDirPath: (0, import_node_path87.join)(".claude", "agents")
12085
+ relativeDirPath: (0, import_node_path90.join)(".claude", "agents")
11643
12086
  };
11644
12087
  }
11645
12088
  getFrontmatter() {
@@ -11718,7 +12161,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
11718
12161
  return {
11719
12162
  success: false,
11720
12163
  error: new Error(
11721
- `Invalid frontmatter in ${(0, import_node_path87.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
12164
+ `Invalid frontmatter in ${(0, import_node_path90.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
11722
12165
  )
11723
12166
  };
11724
12167
  }
@@ -11736,7 +12179,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
11736
12179
  global = false
11737
12180
  }) {
11738
12181
  const paths = this.getSettablePaths({ global });
11739
- const filePath = (0, import_node_path87.join)(baseDir, paths.relativeDirPath, relativeFilePath);
12182
+ const filePath = (0, import_node_path90.join)(baseDir, paths.relativeDirPath, relativeFilePath);
11740
12183
  const fileContent = await readFileContent(filePath);
11741
12184
  const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
11742
12185
  const result = ClaudecodeSubagentFrontmatterSchema.safeParse(frontmatter);
@@ -11771,16 +12214,16 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
11771
12214
  };
11772
12215
 
11773
12216
  // src/features/subagents/codexcli-subagent.ts
11774
- var import_node_path88 = require("path");
12217
+ var import_node_path91 = require("path");
11775
12218
  var smolToml2 = __toESM(require("smol-toml"), 1);
11776
- var import_mini44 = require("zod/mini");
11777
- var CodexCliSubagentTomlSchema = import_mini44.z.looseObject({
11778
- name: import_mini44.z.string(),
11779
- description: import_mini44.z.optional(import_mini44.z.string()),
11780
- developer_instructions: import_mini44.z.optional(import_mini44.z.string()),
11781
- model: import_mini44.z.optional(import_mini44.z.string()),
11782
- model_reasoning_effort: import_mini44.z.optional(import_mini44.z.string()),
11783
- sandbox_mode: import_mini44.z.optional(import_mini44.z.string())
12219
+ var import_mini45 = require("zod/mini");
12220
+ var CodexCliSubagentTomlSchema = import_mini45.z.looseObject({
12221
+ name: import_mini45.z.string(),
12222
+ description: import_mini45.z.optional(import_mini45.z.string()),
12223
+ developer_instructions: import_mini45.z.optional(import_mini45.z.string()),
12224
+ model: import_mini45.z.optional(import_mini45.z.string()),
12225
+ model_reasoning_effort: import_mini45.z.optional(import_mini45.z.string()),
12226
+ sandbox_mode: import_mini45.z.optional(import_mini45.z.string())
11784
12227
  });
11785
12228
  var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
11786
12229
  body;
@@ -11791,7 +12234,7 @@ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
11791
12234
  CodexCliSubagentTomlSchema.parse(parsed);
11792
12235
  } catch (error) {
11793
12236
  throw new Error(
11794
- `Invalid TOML in ${(0, import_node_path88.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${error instanceof Error ? error.message : String(error)}`,
12237
+ `Invalid TOML in ${(0, import_node_path91.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${error instanceof Error ? error.message : String(error)}`,
11795
12238
  { cause: error }
11796
12239
  );
11797
12240
  }
@@ -11803,7 +12246,7 @@ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
11803
12246
  }
11804
12247
  static getSettablePaths(_options = {}) {
11805
12248
  return {
11806
- relativeDirPath: (0, import_node_path88.join)(".codex", "agents")
12249
+ relativeDirPath: (0, import_node_path91.join)(".codex", "agents")
11807
12250
  };
11808
12251
  }
11809
12252
  getBody() {
@@ -11815,7 +12258,7 @@ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
11815
12258
  parsed = CodexCliSubagentTomlSchema.parse(smolToml2.parse(this.body));
11816
12259
  } catch (error) {
11817
12260
  throw new Error(
11818
- `Failed to parse TOML in ${(0, import_node_path88.join)(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${error instanceof Error ? error.message : String(error)}`,
12261
+ `Failed to parse TOML in ${(0, import_node_path91.join)(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${error instanceof Error ? error.message : String(error)}`,
11819
12262
  { cause: error }
11820
12263
  );
11821
12264
  }
@@ -11896,7 +12339,7 @@ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
11896
12339
  global = false
11897
12340
  }) {
11898
12341
  const paths = this.getSettablePaths({ global });
11899
- const filePath = (0, import_node_path88.join)(baseDir, paths.relativeDirPath, relativeFilePath);
12342
+ const filePath = (0, import_node_path91.join)(baseDir, paths.relativeDirPath, relativeFilePath);
11900
12343
  const fileContent = await readFileContent(filePath);
11901
12344
  const subagent = new _CodexCliSubagent({
11902
12345
  baseDir,
@@ -11934,13 +12377,13 @@ var CodexCliSubagent = class _CodexCliSubagent extends ToolSubagent {
11934
12377
  };
11935
12378
 
11936
12379
  // src/features/subagents/copilot-subagent.ts
11937
- var import_node_path89 = require("path");
11938
- var import_mini45 = require("zod/mini");
12380
+ var import_node_path92 = require("path");
12381
+ var import_mini46 = require("zod/mini");
11939
12382
  var REQUIRED_TOOL = "agent/runSubagent";
11940
- var CopilotSubagentFrontmatterSchema = import_mini45.z.looseObject({
11941
- name: import_mini45.z.string(),
11942
- description: import_mini45.z.optional(import_mini45.z.string()),
11943
- tools: import_mini45.z.optional(import_mini45.z.union([import_mini45.z.string(), import_mini45.z.array(import_mini45.z.string())]))
12383
+ var CopilotSubagentFrontmatterSchema = import_mini46.z.looseObject({
12384
+ name: import_mini46.z.string(),
12385
+ description: import_mini46.z.optional(import_mini46.z.string()),
12386
+ tools: import_mini46.z.optional(import_mini46.z.union([import_mini46.z.string(), import_mini46.z.array(import_mini46.z.string())]))
11944
12387
  });
11945
12388
  var normalizeTools = (tools) => {
11946
12389
  if (!tools) {
@@ -11960,7 +12403,7 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
11960
12403
  const result = CopilotSubagentFrontmatterSchema.safeParse(frontmatter);
11961
12404
  if (!result.success) {
11962
12405
  throw new Error(
11963
- `Invalid frontmatter in ${(0, import_node_path89.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
12406
+ `Invalid frontmatter in ${(0, import_node_path92.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
11964
12407
  );
11965
12408
  }
11966
12409
  }
@@ -11972,7 +12415,7 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
11972
12415
  }
11973
12416
  static getSettablePaths(_options = {}) {
11974
12417
  return {
11975
- relativeDirPath: (0, import_node_path89.join)(".github", "agents")
12418
+ relativeDirPath: (0, import_node_path92.join)(".github", "agents")
11976
12419
  };
11977
12420
  }
11978
12421
  getFrontmatter() {
@@ -12022,11 +12465,158 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
12022
12465
  ...mergedTools.length > 0 && { tools: mergedTools }
12023
12466
  };
12024
12467
  const body = rulesyncSubagent.getBody();
12025
- const fileContent = stringifyFrontmatter(body, copilotFrontmatter);
12468
+ const fileContent = stringifyFrontmatter(body, copilotFrontmatter);
12469
+ const paths = this.getSettablePaths({ global });
12470
+ return new _CopilotSubagent({
12471
+ baseDir,
12472
+ frontmatter: copilotFrontmatter,
12473
+ body,
12474
+ relativeDirPath: paths.relativeDirPath,
12475
+ relativeFilePath: rulesyncSubagent.getRelativeFilePath(),
12476
+ fileContent,
12477
+ validate,
12478
+ global
12479
+ });
12480
+ }
12481
+ validate() {
12482
+ if (!this.frontmatter) {
12483
+ return { success: true, error: null };
12484
+ }
12485
+ const result = CopilotSubagentFrontmatterSchema.safeParse(this.frontmatter);
12486
+ if (result.success) {
12487
+ return { success: true, error: null };
12488
+ } else {
12489
+ return {
12490
+ success: false,
12491
+ error: new Error(
12492
+ `Invalid frontmatter in ${(0, import_node_path92.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
12493
+ )
12494
+ };
12495
+ }
12496
+ }
12497
+ static isTargetedByRulesyncSubagent(rulesyncSubagent) {
12498
+ return this.isTargetedByRulesyncSubagentDefault({
12499
+ rulesyncSubagent,
12500
+ toolTarget: "copilot"
12501
+ });
12502
+ }
12503
+ static async fromFile({
12504
+ baseDir = process.cwd(),
12505
+ relativeFilePath,
12506
+ validate = true,
12507
+ global = false
12508
+ }) {
12509
+ const paths = this.getSettablePaths({ global });
12510
+ const filePath = (0, import_node_path92.join)(baseDir, paths.relativeDirPath, relativeFilePath);
12511
+ const fileContent = await readFileContent(filePath);
12512
+ const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
12513
+ const result = CopilotSubagentFrontmatterSchema.safeParse(frontmatter);
12514
+ if (!result.success) {
12515
+ throw new Error(`Invalid frontmatter in ${filePath}: ${formatError(result.error)}`);
12516
+ }
12517
+ return new _CopilotSubagent({
12518
+ baseDir,
12519
+ relativeDirPath: paths.relativeDirPath,
12520
+ relativeFilePath,
12521
+ frontmatter: result.data,
12522
+ body: content.trim(),
12523
+ fileContent,
12524
+ validate,
12525
+ global
12526
+ });
12527
+ }
12528
+ static forDeletion({
12529
+ baseDir = process.cwd(),
12530
+ relativeDirPath,
12531
+ relativeFilePath
12532
+ }) {
12533
+ return new _CopilotSubagent({
12534
+ baseDir,
12535
+ relativeDirPath,
12536
+ relativeFilePath,
12537
+ frontmatter: { name: "", description: "" },
12538
+ body: "",
12539
+ fileContent: "",
12540
+ validate: false
12541
+ });
12542
+ }
12543
+ };
12544
+
12545
+ // src/features/subagents/cursor-subagent.ts
12546
+ var import_node_path93 = require("path");
12547
+ var import_mini47 = require("zod/mini");
12548
+ var CursorSubagentFrontmatterSchema = import_mini47.z.looseObject({
12549
+ name: import_mini47.z.string(),
12550
+ description: import_mini47.z.optional(import_mini47.z.string())
12551
+ });
12552
+ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
12553
+ frontmatter;
12554
+ body;
12555
+ constructor({ frontmatter, body, ...rest }) {
12556
+ if (rest.validate !== false) {
12557
+ const result = CursorSubagentFrontmatterSchema.safeParse(frontmatter);
12558
+ if (!result.success) {
12559
+ throw new Error(
12560
+ `Invalid frontmatter in ${(0, import_node_path93.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
12561
+ );
12562
+ }
12563
+ }
12564
+ super({
12565
+ ...rest
12566
+ });
12567
+ this.frontmatter = frontmatter;
12568
+ this.body = body;
12569
+ }
12570
+ static getSettablePaths(_options = {}) {
12571
+ return {
12572
+ relativeDirPath: (0, import_node_path93.join)(".cursor", "agents")
12573
+ };
12574
+ }
12575
+ getFrontmatter() {
12576
+ return this.frontmatter;
12577
+ }
12578
+ getBody() {
12579
+ return this.body;
12580
+ }
12581
+ toRulesyncSubagent() {
12582
+ const { name, description, ...rest } = this.frontmatter;
12583
+ const rulesyncFrontmatter = {
12584
+ targets: ["*"],
12585
+ name,
12586
+ description,
12587
+ cursor: {
12588
+ ...rest
12589
+ }
12590
+ };
12591
+ return new RulesyncSubagent({
12592
+ baseDir: ".",
12593
+ // RulesyncSubagent baseDir is always the project root directory
12594
+ frontmatter: rulesyncFrontmatter,
12595
+ body: this.body,
12596
+ relativeDirPath: RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH,
12597
+ relativeFilePath: this.getRelativeFilePath(),
12598
+ validate: true
12599
+ });
12600
+ }
12601
+ static fromRulesyncSubagent({
12602
+ baseDir = process.cwd(),
12603
+ rulesyncSubagent,
12604
+ validate = true,
12605
+ global = false
12606
+ }) {
12607
+ const rulesyncFrontmatter = rulesyncSubagent.getFrontmatter();
12608
+ const cursorSection = rulesyncFrontmatter.cursor ?? {};
12609
+ const cursorFrontmatter = {
12610
+ name: rulesyncFrontmatter.name,
12611
+ description: rulesyncFrontmatter.description,
12612
+ ...cursorSection
12613
+ };
12614
+ const body = rulesyncSubagent.getBody();
12615
+ const fileContent = stringifyFrontmatter(body, cursorFrontmatter, { avoidBlockScalars: true });
12026
12616
  const paths = this.getSettablePaths({ global });
12027
- return new _CopilotSubagent({
12617
+ return new _CursorSubagent({
12028
12618
  baseDir,
12029
- frontmatter: copilotFrontmatter,
12619
+ frontmatter: cursorFrontmatter,
12030
12620
  body,
12031
12621
  relativeDirPath: paths.relativeDirPath,
12032
12622
  relativeFilePath: rulesyncSubagent.getRelativeFilePath(),
@@ -12039,14 +12629,14 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
12039
12629
  if (!this.frontmatter) {
12040
12630
  return { success: true, error: null };
12041
12631
  }
12042
- const result = CopilotSubagentFrontmatterSchema.safeParse(this.frontmatter);
12632
+ const result = CursorSubagentFrontmatterSchema.safeParse(this.frontmatter);
12043
12633
  if (result.success) {
12044
12634
  return { success: true, error: null };
12045
12635
  } else {
12046
12636
  return {
12047
12637
  success: false,
12048
12638
  error: new Error(
12049
- `Invalid frontmatter in ${(0, import_node_path89.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
12639
+ `Invalid frontmatter in ${(0, import_node_path93.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
12050
12640
  )
12051
12641
  };
12052
12642
  }
@@ -12054,7 +12644,7 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
12054
12644
  static isTargetedByRulesyncSubagent(rulesyncSubagent) {
12055
12645
  return this.isTargetedByRulesyncSubagentDefault({
12056
12646
  rulesyncSubagent,
12057
- toolTarget: "copilot"
12647
+ toolTarget: "cursor"
12058
12648
  });
12059
12649
  }
12060
12650
  static async fromFile({
@@ -12064,14 +12654,14 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
12064
12654
  global = false
12065
12655
  }) {
12066
12656
  const paths = this.getSettablePaths({ global });
12067
- const filePath = (0, import_node_path89.join)(baseDir, paths.relativeDirPath, relativeFilePath);
12657
+ const filePath = (0, import_node_path93.join)(baseDir, paths.relativeDirPath, relativeFilePath);
12068
12658
  const fileContent = await readFileContent(filePath);
12069
12659
  const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
12070
- const result = CopilotSubagentFrontmatterSchema.safeParse(frontmatter);
12660
+ const result = CursorSubagentFrontmatterSchema.safeParse(frontmatter);
12071
12661
  if (!result.success) {
12072
12662
  throw new Error(`Invalid frontmatter in ${filePath}: ${formatError(result.error)}`);
12073
12663
  }
12074
- return new _CopilotSubagent({
12664
+ return new _CursorSubagent({
12075
12665
  baseDir,
12076
12666
  relativeDirPath: paths.relativeDirPath,
12077
12667
  relativeFilePath,
@@ -12087,7 +12677,7 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
12087
12677
  relativeDirPath,
12088
12678
  relativeFilePath
12089
12679
  }) {
12090
- return new _CopilotSubagent({
12680
+ return new _CursorSubagent({
12091
12681
  baseDir,
12092
12682
  relativeDirPath,
12093
12683
  relativeFilePath,
@@ -12099,34 +12689,33 @@ var CopilotSubagent = class _CopilotSubagent extends ToolSubagent {
12099
12689
  }
12100
12690
  };
12101
12691
 
12102
- // src/features/subagents/cursor-subagent.ts
12103
- var import_node_path90 = require("path");
12104
- var import_mini46 = require("zod/mini");
12105
- var CursorSubagentFrontmatterSchema = import_mini46.z.looseObject({
12106
- name: import_mini46.z.string(),
12107
- description: import_mini46.z.optional(import_mini46.z.string())
12692
+ // src/features/subagents/deepagents-subagent.ts
12693
+ var import_node_path94 = require("path");
12694
+ var import_mini48 = require("zod/mini");
12695
+ var DeepagentsSubagentFrontmatterSchema = import_mini48.z.looseObject({
12696
+ name: import_mini48.z.string(),
12697
+ description: import_mini48.z.optional(import_mini48.z.string()),
12698
+ model: import_mini48.z.optional(import_mini48.z.string())
12108
12699
  });
12109
- var CursorSubagent = class _CursorSubagent extends ToolSubagent {
12700
+ var DeepagentsSubagent = class _DeepagentsSubagent extends ToolSubagent {
12110
12701
  frontmatter;
12111
12702
  body;
12112
12703
  constructor({ frontmatter, body, ...rest }) {
12113
12704
  if (rest.validate !== false) {
12114
- const result = CursorSubagentFrontmatterSchema.safeParse(frontmatter);
12705
+ const result = DeepagentsSubagentFrontmatterSchema.safeParse(frontmatter);
12115
12706
  if (!result.success) {
12116
12707
  throw new Error(
12117
- `Invalid frontmatter in ${(0, import_node_path90.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
12708
+ `Invalid frontmatter in ${(0, import_node_path94.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
12118
12709
  );
12119
12710
  }
12120
12711
  }
12121
- super({
12122
- ...rest
12123
- });
12712
+ super({ ...rest });
12124
12713
  this.frontmatter = frontmatter;
12125
12714
  this.body = body;
12126
12715
  }
12127
12716
  static getSettablePaths(_options = {}) {
12128
12717
  return {
12129
- relativeDirPath: (0, import_node_path90.join)(".cursor", "agents")
12718
+ relativeDirPath: (0, import_node_path94.join)(".deepagents", "agents")
12130
12719
  };
12131
12720
  }
12132
12721
  getFrontmatter() {
@@ -12136,18 +12725,17 @@ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
12136
12725
  return this.body;
12137
12726
  }
12138
12727
  toRulesyncSubagent() {
12139
- const { name, description, ...rest } = this.frontmatter;
12728
+ const { name, description, model } = this.frontmatter;
12729
+ const deepagentsSection = {};
12730
+ if (model) deepagentsSection.model = model;
12140
12731
  const rulesyncFrontmatter = {
12141
12732
  targets: ["*"],
12142
12733
  name,
12143
12734
  description,
12144
- cursor: {
12145
- ...rest
12146
- }
12735
+ ...Object.keys(deepagentsSection).length > 0 && { deepagents: deepagentsSection }
12147
12736
  };
12148
12737
  return new RulesyncSubagent({
12149
- baseDir: ".",
12150
- // RulesyncSubagent baseDir is always the project root directory
12738
+ baseDir: this.getBaseDir(),
12151
12739
  frontmatter: rulesyncFrontmatter,
12152
12740
  body: this.body,
12153
12741
  relativeDirPath: RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH,
@@ -12162,38 +12750,47 @@ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
12162
12750
  global = false
12163
12751
  }) {
12164
12752
  const rulesyncFrontmatter = rulesyncSubagent.getFrontmatter();
12165
- const cursorSection = rulesyncFrontmatter.cursor ?? {};
12166
- const cursorFrontmatter = {
12753
+ const deepagentsSection = this.filterToolSpecificSection(rulesyncFrontmatter.deepagents ?? {}, [
12754
+ "name",
12755
+ "description"
12756
+ ]);
12757
+ const rawFrontmatter = {
12167
12758
  name: rulesyncFrontmatter.name,
12168
12759
  description: rulesyncFrontmatter.description,
12169
- ...cursorSection
12760
+ ...deepagentsSection
12170
12761
  };
12762
+ const result = DeepagentsSubagentFrontmatterSchema.safeParse(rawFrontmatter);
12763
+ if (!result.success) {
12764
+ throw new Error(
12765
+ `Invalid deepagents subagent frontmatter in ${rulesyncSubagent.getRelativeFilePath()}: ${formatError(result.error)}`
12766
+ );
12767
+ }
12768
+ const deepagentsFrontmatter = result.data;
12171
12769
  const body = rulesyncSubagent.getBody();
12172
- const fileContent = stringifyFrontmatter(body, cursorFrontmatter, { avoidBlockScalars: true });
12770
+ const fileContent = stringifyFrontmatter(body, deepagentsFrontmatter);
12173
12771
  const paths = this.getSettablePaths({ global });
12174
- return new _CursorSubagent({
12772
+ return new _DeepagentsSubagent({
12175
12773
  baseDir,
12176
- frontmatter: cursorFrontmatter,
12774
+ frontmatter: deepagentsFrontmatter,
12177
12775
  body,
12178
12776
  relativeDirPath: paths.relativeDirPath,
12179
12777
  relativeFilePath: rulesyncSubagent.getRelativeFilePath(),
12180
12778
  fileContent,
12181
- validate,
12182
- global
12779
+ validate
12183
12780
  });
12184
12781
  }
12185
12782
  validate() {
12186
12783
  if (!this.frontmatter) {
12187
12784
  return { success: true, error: null };
12188
12785
  }
12189
- const result = CursorSubagentFrontmatterSchema.safeParse(this.frontmatter);
12786
+ const result = DeepagentsSubagentFrontmatterSchema.safeParse(this.frontmatter);
12190
12787
  if (result.success) {
12191
12788
  return { success: true, error: null };
12192
12789
  } else {
12193
12790
  return {
12194
12791
  success: false,
12195
12792
  error: new Error(
12196
- `Invalid frontmatter in ${(0, import_node_path90.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
12793
+ `Invalid frontmatter in ${(0, import_node_path94.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
12197
12794
  )
12198
12795
  };
12199
12796
  }
@@ -12201,7 +12798,7 @@ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
12201
12798
  static isTargetedByRulesyncSubagent(rulesyncSubagent) {
12202
12799
  return this.isTargetedByRulesyncSubagentDefault({
12203
12800
  rulesyncSubagent,
12204
- toolTarget: "cursor"
12801
+ toolTarget: "deepagents"
12205
12802
  });
12206
12803
  }
12207
12804
  static async fromFile({
@@ -12211,22 +12808,21 @@ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
12211
12808
  global = false
12212
12809
  }) {
12213
12810
  const paths = this.getSettablePaths({ global });
12214
- const filePath = (0, import_node_path90.join)(baseDir, paths.relativeDirPath, relativeFilePath);
12811
+ const filePath = (0, import_node_path94.join)(baseDir, paths.relativeDirPath, relativeFilePath);
12215
12812
  const fileContent = await readFileContent(filePath);
12216
12813
  const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
12217
- const result = CursorSubagentFrontmatterSchema.safeParse(frontmatter);
12814
+ const result = DeepagentsSubagentFrontmatterSchema.safeParse(frontmatter);
12218
12815
  if (!result.success) {
12219
12816
  throw new Error(`Invalid frontmatter in ${filePath}: ${formatError(result.error)}`);
12220
12817
  }
12221
- return new _CursorSubagent({
12818
+ return new _DeepagentsSubagent({
12222
12819
  baseDir,
12223
12820
  relativeDirPath: paths.relativeDirPath,
12224
12821
  relativeFilePath,
12225
12822
  frontmatter: result.data,
12226
12823
  body: content.trim(),
12227
12824
  fileContent,
12228
- validate,
12229
- global
12825
+ validate
12230
12826
  });
12231
12827
  }
12232
12828
  static forDeletion({
@@ -12234,7 +12830,7 @@ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
12234
12830
  relativeDirPath,
12235
12831
  relativeFilePath
12236
12832
  }) {
12237
- return new _CursorSubagent({
12833
+ return new _DeepagentsSubagent({
12238
12834
  baseDir,
12239
12835
  relativeDirPath,
12240
12836
  relativeFilePath,
@@ -12247,11 +12843,11 @@ var CursorSubagent = class _CursorSubagent extends ToolSubagent {
12247
12843
  };
12248
12844
 
12249
12845
  // src/features/subagents/junie-subagent.ts
12250
- var import_node_path91 = require("path");
12251
- var import_mini47 = require("zod/mini");
12252
- var JunieSubagentFrontmatterSchema = import_mini47.z.looseObject({
12253
- name: import_mini47.z.optional(import_mini47.z.string()),
12254
- description: import_mini47.z.string()
12846
+ var import_node_path95 = require("path");
12847
+ var import_mini49 = require("zod/mini");
12848
+ var JunieSubagentFrontmatterSchema = import_mini49.z.looseObject({
12849
+ name: import_mini49.z.optional(import_mini49.z.string()),
12850
+ description: import_mini49.z.string()
12255
12851
  });
12256
12852
  var JunieSubagent = class _JunieSubagent extends ToolSubagent {
12257
12853
  frontmatter;
@@ -12261,7 +12857,7 @@ var JunieSubagent = class _JunieSubagent extends ToolSubagent {
12261
12857
  const result = JunieSubagentFrontmatterSchema.safeParse(frontmatter);
12262
12858
  if (!result.success) {
12263
12859
  throw new Error(
12264
- `Invalid frontmatter in ${(0, import_node_path91.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
12860
+ `Invalid frontmatter in ${(0, import_node_path95.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
12265
12861
  );
12266
12862
  }
12267
12863
  }
@@ -12276,7 +12872,7 @@ var JunieSubagent = class _JunieSubagent extends ToolSubagent {
12276
12872
  throw new Error("JunieSubagent does not support global mode.");
12277
12873
  }
12278
12874
  return {
12279
- relativeDirPath: (0, import_node_path91.join)(".junie", "agents")
12875
+ relativeDirPath: (0, import_node_path95.join)(".junie", "agents")
12280
12876
  };
12281
12877
  }
12282
12878
  getFrontmatter() {
@@ -12352,7 +12948,7 @@ var JunieSubagent = class _JunieSubagent extends ToolSubagent {
12352
12948
  return {
12353
12949
  success: false,
12354
12950
  error: new Error(
12355
- `Invalid frontmatter in ${(0, import_node_path91.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
12951
+ `Invalid frontmatter in ${(0, import_node_path95.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
12356
12952
  )
12357
12953
  };
12358
12954
  }
@@ -12370,7 +12966,7 @@ var JunieSubagent = class _JunieSubagent extends ToolSubagent {
12370
12966
  global = false
12371
12967
  }) {
12372
12968
  const paths = this.getSettablePaths({ global });
12373
- const filePath = (0, import_node_path91.join)(baseDir, paths.relativeDirPath, relativeFilePath);
12969
+ const filePath = (0, import_node_path95.join)(baseDir, paths.relativeDirPath, relativeFilePath);
12374
12970
  const fileContent = await readFileContent(filePath);
12375
12971
  const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
12376
12972
  const result = JunieSubagentFrontmatterSchema.safeParse(frontmatter);
@@ -12405,23 +13001,23 @@ var JunieSubagent = class _JunieSubagent extends ToolSubagent {
12405
13001
  };
12406
13002
 
12407
13003
  // src/features/subagents/kiro-subagent.ts
12408
- var import_node_path92 = require("path");
12409
- var import_mini48 = require("zod/mini");
12410
- var KiroCliSubagentJsonSchema = import_mini48.z.looseObject({
12411
- name: import_mini48.z.string(),
12412
- description: import_mini48.z.optional(import_mini48.z.nullable(import_mini48.z.string())),
12413
- prompt: import_mini48.z.optional(import_mini48.z.nullable(import_mini48.z.string())),
12414
- tools: import_mini48.z.optional(import_mini48.z.nullable(import_mini48.z.array(import_mini48.z.string()))),
12415
- toolAliases: import_mini48.z.optional(import_mini48.z.nullable(import_mini48.z.record(import_mini48.z.string(), import_mini48.z.string()))),
12416
- toolSettings: import_mini48.z.optional(import_mini48.z.nullable(import_mini48.z.unknown())),
12417
- toolSchema: import_mini48.z.optional(import_mini48.z.nullable(import_mini48.z.unknown())),
12418
- hooks: import_mini48.z.optional(import_mini48.z.nullable(import_mini48.z.record(import_mini48.z.string(), import_mini48.z.array(import_mini48.z.unknown())))),
12419
- model: import_mini48.z.optional(import_mini48.z.nullable(import_mini48.z.string())),
12420
- mcpServers: import_mini48.z.optional(import_mini48.z.nullable(import_mini48.z.record(import_mini48.z.string(), import_mini48.z.unknown()))),
12421
- useLegacyMcpJson: import_mini48.z.optional(import_mini48.z.nullable(import_mini48.z.boolean())),
12422
- resources: import_mini48.z.optional(import_mini48.z.nullable(import_mini48.z.array(import_mini48.z.string()))),
12423
- allowedTools: import_mini48.z.optional(import_mini48.z.nullable(import_mini48.z.array(import_mini48.z.string()))),
12424
- includeMcpJson: import_mini48.z.optional(import_mini48.z.nullable(import_mini48.z.boolean()))
13004
+ var import_node_path96 = require("path");
13005
+ var import_mini50 = require("zod/mini");
13006
+ var KiroCliSubagentJsonSchema = import_mini50.z.looseObject({
13007
+ name: import_mini50.z.string(),
13008
+ description: import_mini50.z.optional(import_mini50.z.nullable(import_mini50.z.string())),
13009
+ prompt: import_mini50.z.optional(import_mini50.z.nullable(import_mini50.z.string())),
13010
+ tools: import_mini50.z.optional(import_mini50.z.nullable(import_mini50.z.array(import_mini50.z.string()))),
13011
+ toolAliases: import_mini50.z.optional(import_mini50.z.nullable(import_mini50.z.record(import_mini50.z.string(), import_mini50.z.string()))),
13012
+ toolSettings: import_mini50.z.optional(import_mini50.z.nullable(import_mini50.z.unknown())),
13013
+ toolSchema: import_mini50.z.optional(import_mini50.z.nullable(import_mini50.z.unknown())),
13014
+ hooks: import_mini50.z.optional(import_mini50.z.nullable(import_mini50.z.record(import_mini50.z.string(), import_mini50.z.array(import_mini50.z.unknown())))),
13015
+ model: import_mini50.z.optional(import_mini50.z.nullable(import_mini50.z.string())),
13016
+ mcpServers: import_mini50.z.optional(import_mini50.z.nullable(import_mini50.z.record(import_mini50.z.string(), import_mini50.z.unknown()))),
13017
+ useLegacyMcpJson: import_mini50.z.optional(import_mini50.z.nullable(import_mini50.z.boolean())),
13018
+ resources: import_mini50.z.optional(import_mini50.z.nullable(import_mini50.z.array(import_mini50.z.string()))),
13019
+ allowedTools: import_mini50.z.optional(import_mini50.z.nullable(import_mini50.z.array(import_mini50.z.string()))),
13020
+ includeMcpJson: import_mini50.z.optional(import_mini50.z.nullable(import_mini50.z.boolean()))
12425
13021
  });
12426
13022
  var KiroSubagent = class _KiroSubagent extends ToolSubagent {
12427
13023
  body;
@@ -12432,7 +13028,7 @@ var KiroSubagent = class _KiroSubagent extends ToolSubagent {
12432
13028
  KiroCliSubagentJsonSchema.parse(parsed);
12433
13029
  } catch (error) {
12434
13030
  throw new Error(
12435
- `Invalid JSON in ${(0, import_node_path92.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${error instanceof Error ? error.message : String(error)}`,
13031
+ `Invalid JSON in ${(0, import_node_path96.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${error instanceof Error ? error.message : String(error)}`,
12436
13032
  { cause: error }
12437
13033
  );
12438
13034
  }
@@ -12444,7 +13040,7 @@ var KiroSubagent = class _KiroSubagent extends ToolSubagent {
12444
13040
  }
12445
13041
  static getSettablePaths(_options = {}) {
12446
13042
  return {
12447
- relativeDirPath: (0, import_node_path92.join)(".kiro", "agents")
13043
+ relativeDirPath: (0, import_node_path96.join)(".kiro", "agents")
12448
13044
  };
12449
13045
  }
12450
13046
  getBody() {
@@ -12456,7 +13052,7 @@ var KiroSubagent = class _KiroSubagent extends ToolSubagent {
12456
13052
  parsed = JSON.parse(this.body);
12457
13053
  } catch (error) {
12458
13054
  throw new Error(
12459
- `Failed to parse JSON in ${(0, import_node_path92.join)(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${error instanceof Error ? error.message : String(error)}`,
13055
+ `Failed to parse JSON in ${(0, import_node_path96.join)(this.getRelativeDirPath(), this.getRelativeFilePath())}: ${error instanceof Error ? error.message : String(error)}`,
12460
13056
  { cause: error }
12461
13057
  );
12462
13058
  }
@@ -12537,7 +13133,7 @@ var KiroSubagent = class _KiroSubagent extends ToolSubagent {
12537
13133
  global = false
12538
13134
  }) {
12539
13135
  const paths = this.getSettablePaths({ global });
12540
- const filePath = (0, import_node_path92.join)(baseDir, paths.relativeDirPath, relativeFilePath);
13136
+ const filePath = (0, import_node_path96.join)(baseDir, paths.relativeDirPath, relativeFilePath);
12541
13137
  const fileContent = await readFileContent(filePath);
12542
13138
  const subagent = new _KiroSubagent({
12543
13139
  baseDir,
@@ -12575,12 +13171,12 @@ var KiroSubagent = class _KiroSubagent extends ToolSubagent {
12575
13171
  };
12576
13172
 
12577
13173
  // src/features/subagents/opencode-subagent.ts
12578
- var import_node_path93 = require("path");
12579
- var import_mini49 = require("zod/mini");
12580
- var OpenCodeSubagentFrontmatterSchema = import_mini49.z.looseObject({
12581
- description: import_mini49.z.optional(import_mini49.z.string()),
12582
- mode: import_mini49.z._default(import_mini49.z.string(), "subagent"),
12583
- name: import_mini49.z.optional(import_mini49.z.string())
13174
+ var import_node_path97 = require("path");
13175
+ var import_mini51 = require("zod/mini");
13176
+ var OpenCodeSubagentFrontmatterSchema = import_mini51.z.looseObject({
13177
+ description: import_mini51.z.optional(import_mini51.z.string()),
13178
+ mode: import_mini51.z._default(import_mini51.z.string(), "subagent"),
13179
+ name: import_mini51.z.optional(import_mini51.z.string())
12584
13180
  });
12585
13181
  var OpenCodeSubagent = class _OpenCodeSubagent extends ToolSubagent {
12586
13182
  frontmatter;
@@ -12590,7 +13186,7 @@ var OpenCodeSubagent = class _OpenCodeSubagent extends ToolSubagent {
12590
13186
  const result = OpenCodeSubagentFrontmatterSchema.safeParse(frontmatter);
12591
13187
  if (!result.success) {
12592
13188
  throw new Error(
12593
- `Invalid frontmatter in ${(0, import_node_path93.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
13189
+ `Invalid frontmatter in ${(0, import_node_path97.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
12594
13190
  );
12595
13191
  }
12596
13192
  }
@@ -12604,7 +13200,7 @@ var OpenCodeSubagent = class _OpenCodeSubagent extends ToolSubagent {
12604
13200
  global = false
12605
13201
  } = {}) {
12606
13202
  return {
12607
- relativeDirPath: global ? (0, import_node_path93.join)(".config", "opencode", "agent") : (0, import_node_path93.join)(".opencode", "agent")
13203
+ relativeDirPath: global ? (0, import_node_path97.join)(".config", "opencode", "agent") : (0, import_node_path97.join)(".opencode", "agent")
12608
13204
  };
12609
13205
  }
12610
13206
  getFrontmatter() {
@@ -12617,7 +13213,7 @@ var OpenCodeSubagent = class _OpenCodeSubagent extends ToolSubagent {
12617
13213
  const { description, mode, name, ...opencodeSection } = this.frontmatter;
12618
13214
  const rulesyncFrontmatter = {
12619
13215
  targets: ["*"],
12620
- name: name ?? (0, import_node_path93.basename)(this.getRelativeFilePath(), ".md"),
13216
+ name: name ?? (0, import_node_path97.basename)(this.getRelativeFilePath(), ".md"),
12621
13217
  description,
12622
13218
  opencode: { mode, ...opencodeSection }
12623
13219
  };
@@ -12670,7 +13266,7 @@ var OpenCodeSubagent = class _OpenCodeSubagent extends ToolSubagent {
12670
13266
  return {
12671
13267
  success: false,
12672
13268
  error: new Error(
12673
- `Invalid frontmatter in ${(0, import_node_path93.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
13269
+ `Invalid frontmatter in ${(0, import_node_path97.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
12674
13270
  )
12675
13271
  };
12676
13272
  }
@@ -12687,7 +13283,7 @@ var OpenCodeSubagent = class _OpenCodeSubagent extends ToolSubagent {
12687
13283
  global = false
12688
13284
  }) {
12689
13285
  const paths = this.getSettablePaths({ global });
12690
- const filePath = (0, import_node_path93.join)(baseDir, paths.relativeDirPath, relativeFilePath);
13286
+ const filePath = (0, import_node_path97.join)(baseDir, paths.relativeDirPath, relativeFilePath);
12691
13287
  const fileContent = await readFileContent(filePath);
12692
13288
  const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
12693
13289
  const result = OpenCodeSubagentFrontmatterSchema.safeParse(frontmatter);
@@ -12730,6 +13326,7 @@ var subagentsProcessorToolTargetTuple = [
12730
13326
  "codexcli",
12731
13327
  "copilot",
12732
13328
  "cursor",
13329
+ "deepagents",
12733
13330
  "factorydroid",
12734
13331
  "geminicli",
12735
13332
  "junie",
@@ -12737,7 +13334,7 @@ var subagentsProcessorToolTargetTuple = [
12737
13334
  "opencode",
12738
13335
  "roo"
12739
13336
  ];
12740
- var SubagentsProcessorToolTargetSchema = import_mini50.z.enum(subagentsProcessorToolTargetTuple);
13337
+ var SubagentsProcessorToolTargetSchema = import_mini52.z.enum(subagentsProcessorToolTargetTuple);
12741
13338
  var toolSubagentFactories = /* @__PURE__ */ new Map([
12742
13339
  [
12743
13340
  "agentsmd",
@@ -12781,6 +13378,13 @@ var toolSubagentFactories = /* @__PURE__ */ new Map([
12781
13378
  meta: { supportsSimulated: false, supportsGlobal: true, filePattern: "*.md" }
12782
13379
  }
12783
13380
  ],
13381
+ [
13382
+ "deepagents",
13383
+ {
13384
+ class: DeepagentsSubagent,
13385
+ meta: { supportsSimulated: false, supportsGlobal: false, filePattern: "*.md" }
13386
+ }
13387
+ ],
12784
13388
  [
12785
13389
  "factorydroid",
12786
13390
  {
@@ -12907,7 +13511,7 @@ var SubagentsProcessor = class extends FeatureProcessor {
12907
13511
  * Load and parse rulesync subagent files from .rulesync/subagents/ directory
12908
13512
  */
12909
13513
  async loadRulesyncFiles() {
12910
- const subagentsDir = (0, import_node_path94.join)(process.cwd(), RulesyncSubagent.getSettablePaths().relativeDirPath);
13514
+ const subagentsDir = (0, import_node_path98.join)(process.cwd(), RulesyncSubagent.getSettablePaths().relativeDirPath);
12911
13515
  const dirExists = await directoryExists(subagentsDir);
12912
13516
  if (!dirExists) {
12913
13517
  this.logger.debug(`Rulesync subagents directory not found: ${subagentsDir}`);
@@ -12922,7 +13526,7 @@ var SubagentsProcessor = class extends FeatureProcessor {
12922
13526
  this.logger.debug(`Found ${mdFiles.length} subagent files in ${subagentsDir}`);
12923
13527
  const rulesyncSubagents = [];
12924
13528
  for (const mdFile of mdFiles) {
12925
- const filepath = (0, import_node_path94.join)(subagentsDir, mdFile);
13529
+ const filepath = (0, import_node_path98.join)(subagentsDir, mdFile);
12926
13530
  try {
12927
13531
  const rulesyncSubagent = await RulesyncSubagent.fromFile({
12928
13532
  relativeFilePath: mdFile,
@@ -12952,14 +13556,14 @@ var SubagentsProcessor = class extends FeatureProcessor {
12952
13556
  const factory = this.getFactory(this.toolTarget);
12953
13557
  const paths = factory.class.getSettablePaths({ global: this.global });
12954
13558
  const subagentFilePaths = await findFilesByGlobs(
12955
- (0, import_node_path94.join)(this.baseDir, paths.relativeDirPath, factory.meta.filePattern)
13559
+ (0, import_node_path98.join)(this.baseDir, paths.relativeDirPath, factory.meta.filePattern)
12956
13560
  );
12957
13561
  if (forDeletion) {
12958
13562
  const toolSubagents2 = subagentFilePaths.map(
12959
13563
  (path3) => factory.class.forDeletion({
12960
13564
  baseDir: this.baseDir,
12961
13565
  relativeDirPath: paths.relativeDirPath,
12962
- relativeFilePath: (0, import_node_path94.basename)(path3),
13566
+ relativeFilePath: (0, import_node_path98.basename)(path3),
12963
13567
  global: this.global
12964
13568
  })
12965
13569
  ).filter((subagent) => subagent.isDeletable());
@@ -12972,7 +13576,7 @@ var SubagentsProcessor = class extends FeatureProcessor {
12972
13576
  subagentFilePaths.map(
12973
13577
  (path3) => factory.class.fromFile({
12974
13578
  baseDir: this.baseDir,
12975
- relativeFilePath: (0, import_node_path94.basename)(path3),
13579
+ relativeFilePath: (0, import_node_path98.basename)(path3),
12976
13580
  global: this.global
12977
13581
  })
12978
13582
  )
@@ -13019,49 +13623,49 @@ var SubagentsProcessor = class extends FeatureProcessor {
13019
13623
  };
13020
13624
 
13021
13625
  // src/features/rules/agentsmd-rule.ts
13022
- var import_node_path97 = require("path");
13626
+ var import_node_path101 = require("path");
13023
13627
 
13024
13628
  // src/features/rules/tool-rule.ts
13025
- var import_node_path96 = require("path");
13629
+ var import_node_path100 = require("path");
13026
13630
 
13027
13631
  // src/features/rules/rulesync-rule.ts
13028
- var import_node_path95 = require("path");
13029
- var import_mini51 = require("zod/mini");
13030
- var RulesyncRuleFrontmatterSchema = import_mini51.z.object({
13031
- root: import_mini51.z.optional(import_mini51.z.boolean()),
13032
- localRoot: import_mini51.z.optional(import_mini51.z.boolean()),
13033
- targets: import_mini51.z._default(RulesyncTargetsSchema, ["*"]),
13034
- description: import_mini51.z.optional(import_mini51.z.string()),
13035
- globs: import_mini51.z.optional(import_mini51.z.array(import_mini51.z.string())),
13036
- agentsmd: import_mini51.z.optional(
13037
- import_mini51.z.object({
13632
+ var import_node_path99 = require("path");
13633
+ var import_mini53 = require("zod/mini");
13634
+ var RulesyncRuleFrontmatterSchema = import_mini53.z.object({
13635
+ root: import_mini53.z.optional(import_mini53.z.boolean()),
13636
+ localRoot: import_mini53.z.optional(import_mini53.z.boolean()),
13637
+ targets: import_mini53.z._default(RulesyncTargetsSchema, ["*"]),
13638
+ description: import_mini53.z.optional(import_mini53.z.string()),
13639
+ globs: import_mini53.z.optional(import_mini53.z.array(import_mini53.z.string())),
13640
+ agentsmd: import_mini53.z.optional(
13641
+ import_mini53.z.object({
13038
13642
  // @example "path/to/subproject"
13039
- subprojectPath: import_mini51.z.optional(import_mini51.z.string())
13643
+ subprojectPath: import_mini53.z.optional(import_mini53.z.string())
13040
13644
  })
13041
13645
  ),
13042
- claudecode: import_mini51.z.optional(
13043
- import_mini51.z.object({
13646
+ claudecode: import_mini53.z.optional(
13647
+ import_mini53.z.object({
13044
13648
  // Glob patterns for conditional rules (takes precedence over globs)
13045
13649
  // @example ["src/**/*.ts", "tests/**/*.test.ts"]
13046
- paths: import_mini51.z.optional(import_mini51.z.array(import_mini51.z.string()))
13650
+ paths: import_mini53.z.optional(import_mini53.z.array(import_mini53.z.string()))
13047
13651
  })
13048
13652
  ),
13049
- cursor: import_mini51.z.optional(
13050
- import_mini51.z.object({
13051
- alwaysApply: import_mini51.z.optional(import_mini51.z.boolean()),
13052
- description: import_mini51.z.optional(import_mini51.z.string()),
13053
- globs: import_mini51.z.optional(import_mini51.z.array(import_mini51.z.string()))
13653
+ cursor: import_mini53.z.optional(
13654
+ import_mini53.z.object({
13655
+ alwaysApply: import_mini53.z.optional(import_mini53.z.boolean()),
13656
+ description: import_mini53.z.optional(import_mini53.z.string()),
13657
+ globs: import_mini53.z.optional(import_mini53.z.array(import_mini53.z.string()))
13054
13658
  })
13055
13659
  ),
13056
- copilot: import_mini51.z.optional(
13057
- import_mini51.z.object({
13058
- excludeAgent: import_mini51.z.optional(import_mini51.z.union([import_mini51.z.literal("code-review"), import_mini51.z.literal("coding-agent")]))
13660
+ copilot: import_mini53.z.optional(
13661
+ import_mini53.z.object({
13662
+ excludeAgent: import_mini53.z.optional(import_mini53.z.union([import_mini53.z.literal("code-review"), import_mini53.z.literal("coding-agent")]))
13059
13663
  })
13060
13664
  ),
13061
- antigravity: import_mini51.z.optional(
13062
- import_mini51.z.looseObject({
13063
- trigger: import_mini51.z.optional(import_mini51.z.string()),
13064
- globs: import_mini51.z.optional(import_mini51.z.array(import_mini51.z.string()))
13665
+ antigravity: import_mini53.z.optional(
13666
+ import_mini53.z.looseObject({
13667
+ trigger: import_mini53.z.optional(import_mini53.z.string()),
13668
+ globs: import_mini53.z.optional(import_mini53.z.array(import_mini53.z.string()))
13065
13669
  })
13066
13670
  )
13067
13671
  });
@@ -13072,7 +13676,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
13072
13676
  const parseResult = RulesyncRuleFrontmatterSchema.safeParse(frontmatter);
13073
13677
  if (!parseResult.success && rest.validate !== false) {
13074
13678
  throw new Error(
13075
- `Invalid frontmatter in ${(0, import_node_path95.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(parseResult.error)}`
13679
+ `Invalid frontmatter in ${(0, import_node_path99.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(parseResult.error)}`
13076
13680
  );
13077
13681
  }
13078
13682
  const parsedFrontmatter = parseResult.success ? parseResult.data : { ...frontmatter, targets: frontmatter.targets ?? ["*"] };
@@ -13107,7 +13711,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
13107
13711
  return {
13108
13712
  success: false,
13109
13713
  error: new Error(
13110
- `Invalid frontmatter in ${(0, import_node_path95.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
13714
+ `Invalid frontmatter in ${(0, import_node_path99.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
13111
13715
  )
13112
13716
  };
13113
13717
  }
@@ -13116,7 +13720,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
13116
13720
  relativeFilePath,
13117
13721
  validate = true
13118
13722
  }) {
13119
- const filePath = (0, import_node_path95.join)(
13723
+ const filePath = (0, import_node_path99.join)(
13120
13724
  process.cwd(),
13121
13725
  this.getSettablePaths().recommended.relativeDirPath,
13122
13726
  relativeFilePath
@@ -13134,7 +13738,10 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
13134
13738
  description: result.data.description,
13135
13739
  globs: result.data.globs ?? [],
13136
13740
  agentsmd: result.data.agentsmd,
13137
- cursor: result.data.cursor
13741
+ claudecode: result.data.claudecode,
13742
+ cursor: result.data.cursor,
13743
+ copilot: result.data.copilot,
13744
+ antigravity: result.data.antigravity
13138
13745
  };
13139
13746
  return new _RulesyncRule({
13140
13747
  baseDir: process.cwd(),
@@ -13218,7 +13825,7 @@ var ToolRule = class extends ToolFile {
13218
13825
  rulesyncRule,
13219
13826
  validate = true,
13220
13827
  rootPath = { relativeDirPath: ".", relativeFilePath: "AGENTS.md" },
13221
- nonRootPath = { relativeDirPath: (0, import_node_path96.join)(".agents", "memories") }
13828
+ nonRootPath = { relativeDirPath: (0, import_node_path100.join)(".agents", "memories") }
13222
13829
  }) {
13223
13830
  const params = this.buildToolRuleParamsDefault({
13224
13831
  baseDir,
@@ -13229,7 +13836,7 @@ var ToolRule = class extends ToolFile {
13229
13836
  });
13230
13837
  const rulesyncFrontmatter = rulesyncRule.getFrontmatter();
13231
13838
  if (!rulesyncFrontmatter.root && rulesyncFrontmatter.agentsmd?.subprojectPath) {
13232
- params.relativeDirPath = (0, import_node_path96.join)(rulesyncFrontmatter.agentsmd.subprojectPath);
13839
+ params.relativeDirPath = (0, import_node_path100.join)(rulesyncFrontmatter.agentsmd.subprojectPath);
13233
13840
  params.relativeFilePath = "AGENTS.md";
13234
13841
  }
13235
13842
  return params;
@@ -13278,7 +13885,7 @@ var ToolRule = class extends ToolFile {
13278
13885
  }
13279
13886
  };
13280
13887
  function buildToolPath(toolDir, subDir, excludeToolDir) {
13281
- return excludeToolDir ? subDir : (0, import_node_path96.join)(toolDir, subDir);
13888
+ return excludeToolDir ? subDir : (0, import_node_path100.join)(toolDir, subDir);
13282
13889
  }
13283
13890
 
13284
13891
  // src/features/rules/agentsmd-rule.ts
@@ -13307,8 +13914,8 @@ var AgentsMdRule = class _AgentsMdRule extends ToolRule {
13307
13914
  validate = true
13308
13915
  }) {
13309
13916
  const isRoot = relativeFilePath === "AGENTS.md";
13310
- const relativePath = isRoot ? "AGENTS.md" : (0, import_node_path97.join)(".agents", "memories", relativeFilePath);
13311
- const fileContent = await readFileContent((0, import_node_path97.join)(baseDir, relativePath));
13917
+ const relativePath = isRoot ? "AGENTS.md" : (0, import_node_path101.join)(".agents", "memories", relativeFilePath);
13918
+ const fileContent = await readFileContent((0, import_node_path101.join)(baseDir, relativePath));
13312
13919
  return new _AgentsMdRule({
13313
13920
  baseDir,
13314
13921
  relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : this.getSettablePaths().nonRoot.relativeDirPath,
@@ -13363,21 +13970,21 @@ var AgentsMdRule = class _AgentsMdRule extends ToolRule {
13363
13970
  };
13364
13971
 
13365
13972
  // src/features/rules/antigravity-rule.ts
13366
- var import_node_path98 = require("path");
13367
- var import_mini52 = require("zod/mini");
13368
- var AntigravityRuleFrontmatterSchema = import_mini52.z.looseObject({
13369
- trigger: import_mini52.z.optional(
13370
- import_mini52.z.union([
13371
- import_mini52.z.literal("always_on"),
13372
- import_mini52.z.literal("glob"),
13373
- import_mini52.z.literal("manual"),
13374
- import_mini52.z.literal("model_decision"),
13375
- import_mini52.z.string()
13973
+ var import_node_path102 = require("path");
13974
+ var import_mini54 = require("zod/mini");
13975
+ var AntigravityRuleFrontmatterSchema = import_mini54.z.looseObject({
13976
+ trigger: import_mini54.z.optional(
13977
+ import_mini54.z.union([
13978
+ import_mini54.z.literal("always_on"),
13979
+ import_mini54.z.literal("glob"),
13980
+ import_mini54.z.literal("manual"),
13981
+ import_mini54.z.literal("model_decision"),
13982
+ import_mini54.z.string()
13376
13983
  // accepts any string for forward compatibility
13377
13984
  ])
13378
13985
  ),
13379
- globs: import_mini52.z.optional(import_mini52.z.string()),
13380
- description: import_mini52.z.optional(import_mini52.z.string())
13986
+ globs: import_mini54.z.optional(import_mini54.z.string()),
13987
+ description: import_mini54.z.optional(import_mini54.z.string())
13381
13988
  });
13382
13989
  function parseGlobsString(globs) {
13383
13990
  if (!globs) {
@@ -13522,7 +14129,7 @@ var AntigravityRule = class _AntigravityRule extends ToolRule {
13522
14129
  const result = AntigravityRuleFrontmatterSchema.safeParse(frontmatter);
13523
14130
  if (!result.success) {
13524
14131
  throw new Error(
13525
- `Invalid frontmatter in ${(0, import_node_path98.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
14132
+ `Invalid frontmatter in ${(0, import_node_path102.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
13526
14133
  );
13527
14134
  }
13528
14135
  }
@@ -13546,7 +14153,7 @@ var AntigravityRule = class _AntigravityRule extends ToolRule {
13546
14153
  relativeFilePath,
13547
14154
  validate = true
13548
14155
  }) {
13549
- const filePath = (0, import_node_path98.join)(
14156
+ const filePath = (0, import_node_path102.join)(
13550
14157
  baseDir,
13551
14158
  this.getSettablePaths().nonRoot.relativeDirPath,
13552
14159
  relativeFilePath
@@ -13686,7 +14293,7 @@ var AntigravityRule = class _AntigravityRule extends ToolRule {
13686
14293
  };
13687
14294
 
13688
14295
  // src/features/rules/augmentcode-legacy-rule.ts
13689
- var import_node_path99 = require("path");
14296
+ var import_node_path103 = require("path");
13690
14297
  var AugmentcodeLegacyRule = class _AugmentcodeLegacyRule extends ToolRule {
13691
14298
  toRulesyncRule() {
13692
14299
  const rulesyncFrontmatter = {
@@ -13746,8 +14353,8 @@ var AugmentcodeLegacyRule = class _AugmentcodeLegacyRule extends ToolRule {
13746
14353
  }) {
13747
14354
  const settablePaths = this.getSettablePaths();
13748
14355
  const isRoot = relativeFilePath === settablePaths.root.relativeFilePath;
13749
- const relativePath = isRoot ? settablePaths.root.relativeFilePath : (0, import_node_path99.join)(settablePaths.nonRoot.relativeDirPath, relativeFilePath);
13750
- const fileContent = await readFileContent((0, import_node_path99.join)(baseDir, relativePath));
14356
+ const relativePath = isRoot ? settablePaths.root.relativeFilePath : (0, import_node_path103.join)(settablePaths.nonRoot.relativeDirPath, relativeFilePath);
14357
+ const fileContent = await readFileContent((0, import_node_path103.join)(baseDir, relativePath));
13751
14358
  return new _AugmentcodeLegacyRule({
13752
14359
  baseDir,
13753
14360
  relativeDirPath: isRoot ? settablePaths.root.relativeDirPath : settablePaths.nonRoot.relativeDirPath,
@@ -13776,7 +14383,7 @@ var AugmentcodeLegacyRule = class _AugmentcodeLegacyRule extends ToolRule {
13776
14383
  };
13777
14384
 
13778
14385
  // src/features/rules/augmentcode-rule.ts
13779
- var import_node_path100 = require("path");
14386
+ var import_node_path104 = require("path");
13780
14387
  var AugmentcodeRule = class _AugmentcodeRule extends ToolRule {
13781
14388
  toRulesyncRule() {
13782
14389
  return this.toRulesyncRuleDefault();
@@ -13807,7 +14414,7 @@ var AugmentcodeRule = class _AugmentcodeRule extends ToolRule {
13807
14414
  relativeFilePath,
13808
14415
  validate = true
13809
14416
  }) {
13810
- const filePath = (0, import_node_path100.join)(
14417
+ const filePath = (0, import_node_path104.join)(
13811
14418
  baseDir,
13812
14419
  this.getSettablePaths().nonRoot.relativeDirPath,
13813
14420
  relativeFilePath
@@ -13847,7 +14454,7 @@ var AugmentcodeRule = class _AugmentcodeRule extends ToolRule {
13847
14454
  };
13848
14455
 
13849
14456
  // src/features/rules/claudecode-legacy-rule.ts
13850
- var import_node_path101 = require("path");
14457
+ var import_node_path105 = require("path");
13851
14458
  var ClaudecodeLegacyRule = class _ClaudecodeLegacyRule extends ToolRule {
13852
14459
  static getSettablePaths({
13853
14460
  global,
@@ -13889,7 +14496,7 @@ var ClaudecodeLegacyRule = class _ClaudecodeLegacyRule extends ToolRule {
13889
14496
  if (isRoot) {
13890
14497
  const rootDirPath = overrideDirPath ?? paths.root.relativeDirPath;
13891
14498
  const fileContent2 = await readFileContent(
13892
- (0, import_node_path101.join)(baseDir, rootDirPath, paths.root.relativeFilePath)
14499
+ (0, import_node_path105.join)(baseDir, rootDirPath, paths.root.relativeFilePath)
13893
14500
  );
13894
14501
  return new _ClaudecodeLegacyRule({
13895
14502
  baseDir,
@@ -13903,8 +14510,8 @@ var ClaudecodeLegacyRule = class _ClaudecodeLegacyRule extends ToolRule {
13903
14510
  if (!paths.nonRoot) {
13904
14511
  throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
13905
14512
  }
13906
- const relativePath = (0, import_node_path101.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
13907
- const fileContent = await readFileContent((0, import_node_path101.join)(baseDir, relativePath));
14513
+ const relativePath = (0, import_node_path105.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
14514
+ const fileContent = await readFileContent((0, import_node_path105.join)(baseDir, relativePath));
13908
14515
  return new _ClaudecodeLegacyRule({
13909
14516
  baseDir,
13910
14517
  relativeDirPath: paths.nonRoot.relativeDirPath,
@@ -13963,10 +14570,10 @@ var ClaudecodeLegacyRule = class _ClaudecodeLegacyRule extends ToolRule {
13963
14570
  };
13964
14571
 
13965
14572
  // src/features/rules/claudecode-rule.ts
13966
- var import_node_path102 = require("path");
13967
- var import_mini53 = require("zod/mini");
13968
- var ClaudecodeRuleFrontmatterSchema = import_mini53.z.object({
13969
- paths: import_mini53.z.optional(import_mini53.z.array(import_mini53.z.string()))
14573
+ var import_node_path106 = require("path");
14574
+ var import_mini55 = require("zod/mini");
14575
+ var ClaudecodeRuleFrontmatterSchema = import_mini55.z.object({
14576
+ paths: import_mini55.z.optional(import_mini55.z.array(import_mini55.z.string()))
13970
14577
  });
13971
14578
  var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
13972
14579
  frontmatter;
@@ -14004,7 +14611,7 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
14004
14611
  const result = ClaudecodeRuleFrontmatterSchema.safeParse(frontmatter);
14005
14612
  if (!result.success) {
14006
14613
  throw new Error(
14007
- `Invalid frontmatter in ${(0, import_node_path102.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
14614
+ `Invalid frontmatter in ${(0, import_node_path106.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
14008
14615
  );
14009
14616
  }
14010
14617
  }
@@ -14034,7 +14641,7 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
14034
14641
  if (isRoot) {
14035
14642
  const rootDirPath = overrideDirPath ?? paths.root.relativeDirPath;
14036
14643
  const fileContent2 = await readFileContent(
14037
- (0, import_node_path102.join)(baseDir, rootDirPath, paths.root.relativeFilePath)
14644
+ (0, import_node_path106.join)(baseDir, rootDirPath, paths.root.relativeFilePath)
14038
14645
  );
14039
14646
  return new _ClaudecodeRule({
14040
14647
  baseDir,
@@ -14049,8 +14656,8 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
14049
14656
  if (!paths.nonRoot) {
14050
14657
  throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
14051
14658
  }
14052
- const relativePath = (0, import_node_path102.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
14053
- const filePath = (0, import_node_path102.join)(baseDir, relativePath);
14659
+ const relativePath = (0, import_node_path106.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
14660
+ const filePath = (0, import_node_path106.join)(baseDir, relativePath);
14054
14661
  const fileContent = await readFileContent(filePath);
14055
14662
  const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
14056
14663
  const result = ClaudecodeRuleFrontmatterSchema.safeParse(frontmatter);
@@ -14161,7 +14768,7 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
14161
14768
  return {
14162
14769
  success: false,
14163
14770
  error: new Error(
14164
- `Invalid frontmatter in ${(0, import_node_path102.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
14771
+ `Invalid frontmatter in ${(0, import_node_path106.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
14165
14772
  )
14166
14773
  };
14167
14774
  }
@@ -14181,10 +14788,10 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
14181
14788
  };
14182
14789
 
14183
14790
  // src/features/rules/cline-rule.ts
14184
- var import_node_path103 = require("path");
14185
- var import_mini54 = require("zod/mini");
14186
- var ClineRuleFrontmatterSchema = import_mini54.z.object({
14187
- description: import_mini54.z.string()
14791
+ var import_node_path107 = require("path");
14792
+ var import_mini56 = require("zod/mini");
14793
+ var ClineRuleFrontmatterSchema = import_mini56.z.object({
14794
+ description: import_mini56.z.string()
14188
14795
  });
14189
14796
  var ClineRule = class _ClineRule extends ToolRule {
14190
14797
  static getSettablePaths(_options = {}) {
@@ -14227,7 +14834,7 @@ var ClineRule = class _ClineRule extends ToolRule {
14227
14834
  validate = true
14228
14835
  }) {
14229
14836
  const fileContent = await readFileContent(
14230
- (0, import_node_path103.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
14837
+ (0, import_node_path107.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
14231
14838
  );
14232
14839
  return new _ClineRule({
14233
14840
  baseDir,
@@ -14253,7 +14860,7 @@ var ClineRule = class _ClineRule extends ToolRule {
14253
14860
  };
14254
14861
 
14255
14862
  // src/features/rules/codexcli-rule.ts
14256
- var import_node_path104 = require("path");
14863
+ var import_node_path108 = require("path");
14257
14864
  var CodexcliRule = class _CodexcliRule extends ToolRule {
14258
14865
  static getSettablePaths({
14259
14866
  global,
@@ -14288,7 +14895,7 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
14288
14895
  if (isRoot) {
14289
14896
  const relativePath2 = paths.root.relativeFilePath;
14290
14897
  const fileContent2 = await readFileContent(
14291
- (0, import_node_path104.join)(baseDir, paths.root.relativeDirPath, relativePath2)
14898
+ (0, import_node_path108.join)(baseDir, paths.root.relativeDirPath, relativePath2)
14292
14899
  );
14293
14900
  return new _CodexcliRule({
14294
14901
  baseDir,
@@ -14302,8 +14909,8 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
14302
14909
  if (!paths.nonRoot) {
14303
14910
  throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
14304
14911
  }
14305
- const relativePath = (0, import_node_path104.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
14306
- const fileContent = await readFileContent((0, import_node_path104.join)(baseDir, relativePath));
14912
+ const relativePath = (0, import_node_path108.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
14913
+ const fileContent = await readFileContent((0, import_node_path108.join)(baseDir, relativePath));
14307
14914
  return new _CodexcliRule({
14308
14915
  baseDir,
14309
14916
  relativeDirPath: paths.nonRoot.relativeDirPath,
@@ -14362,12 +14969,12 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
14362
14969
  };
14363
14970
 
14364
14971
  // src/features/rules/copilot-rule.ts
14365
- var import_node_path105 = require("path");
14366
- var import_mini55 = require("zod/mini");
14367
- var CopilotRuleFrontmatterSchema = import_mini55.z.object({
14368
- description: import_mini55.z.optional(import_mini55.z.string()),
14369
- applyTo: import_mini55.z.optional(import_mini55.z.string()),
14370
- excludeAgent: import_mini55.z.optional(import_mini55.z.union([import_mini55.z.literal("code-review"), import_mini55.z.literal("coding-agent")]))
14972
+ var import_node_path109 = require("path");
14973
+ var import_mini57 = require("zod/mini");
14974
+ var CopilotRuleFrontmatterSchema = import_mini57.z.object({
14975
+ description: import_mini57.z.optional(import_mini57.z.string()),
14976
+ applyTo: import_mini57.z.optional(import_mini57.z.string()),
14977
+ excludeAgent: import_mini57.z.optional(import_mini57.z.union([import_mini57.z.literal("code-review"), import_mini57.z.literal("coding-agent")]))
14371
14978
  });
14372
14979
  var CopilotRule = class _CopilotRule extends ToolRule {
14373
14980
  frontmatter;
@@ -14399,7 +15006,7 @@ var CopilotRule = class _CopilotRule extends ToolRule {
14399
15006
  const result = CopilotRuleFrontmatterSchema.safeParse(frontmatter);
14400
15007
  if (!result.success) {
14401
15008
  throw new Error(
14402
- `Invalid frontmatter in ${(0, import_node_path105.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
15009
+ `Invalid frontmatter in ${(0, import_node_path109.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
14403
15010
  );
14404
15011
  }
14405
15012
  }
@@ -14489,8 +15096,8 @@ var CopilotRule = class _CopilotRule extends ToolRule {
14489
15096
  const paths = this.getSettablePaths({ global });
14490
15097
  const isRoot = relativeFilePath === paths.root.relativeFilePath;
14491
15098
  if (isRoot) {
14492
- const relativePath2 = (0, import_node_path105.join)(paths.root.relativeDirPath, paths.root.relativeFilePath);
14493
- const filePath2 = (0, import_node_path105.join)(baseDir, relativePath2);
15099
+ const relativePath2 = (0, import_node_path109.join)(paths.root.relativeDirPath, paths.root.relativeFilePath);
15100
+ const filePath2 = (0, import_node_path109.join)(baseDir, relativePath2);
14494
15101
  const fileContent2 = await readFileContent(filePath2);
14495
15102
  return new _CopilotRule({
14496
15103
  baseDir,
@@ -14505,8 +15112,8 @@ var CopilotRule = class _CopilotRule extends ToolRule {
14505
15112
  if (!paths.nonRoot) {
14506
15113
  throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
14507
15114
  }
14508
- const relativePath = (0, import_node_path105.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
14509
- const filePath = (0, import_node_path105.join)(baseDir, relativePath);
15115
+ const relativePath = (0, import_node_path109.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
15116
+ const filePath = (0, import_node_path109.join)(baseDir, relativePath);
14510
15117
  const fileContent = await readFileContent(filePath);
14511
15118
  const { frontmatter, body: content } = parseFrontmatter(fileContent, filePath);
14512
15119
  const result = CopilotRuleFrontmatterSchema.safeParse(frontmatter);
@@ -14552,7 +15159,7 @@ var CopilotRule = class _CopilotRule extends ToolRule {
14552
15159
  return {
14553
15160
  success: false,
14554
15161
  error: new Error(
14555
- `Invalid frontmatter in ${(0, import_node_path105.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
15162
+ `Invalid frontmatter in ${(0, import_node_path109.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
14556
15163
  )
14557
15164
  };
14558
15165
  }
@@ -14572,12 +15179,12 @@ var CopilotRule = class _CopilotRule extends ToolRule {
14572
15179
  };
14573
15180
 
14574
15181
  // src/features/rules/cursor-rule.ts
14575
- var import_node_path106 = require("path");
14576
- var import_mini56 = require("zod/mini");
14577
- var CursorRuleFrontmatterSchema = import_mini56.z.object({
14578
- description: import_mini56.z.optional(import_mini56.z.string()),
14579
- globs: import_mini56.z.optional(import_mini56.z.string()),
14580
- alwaysApply: import_mini56.z.optional(import_mini56.z.boolean())
15182
+ var import_node_path110 = require("path");
15183
+ var import_mini58 = require("zod/mini");
15184
+ var CursorRuleFrontmatterSchema = import_mini58.z.object({
15185
+ description: import_mini58.z.optional(import_mini58.z.string()),
15186
+ globs: import_mini58.z.optional(import_mini58.z.string()),
15187
+ alwaysApply: import_mini58.z.optional(import_mini58.z.boolean())
14581
15188
  });
14582
15189
  var CursorRule = class _CursorRule extends ToolRule {
14583
15190
  frontmatter;
@@ -14594,7 +15201,7 @@ var CursorRule = class _CursorRule extends ToolRule {
14594
15201
  const result = CursorRuleFrontmatterSchema.safeParse(frontmatter);
14595
15202
  if (!result.success) {
14596
15203
  throw new Error(
14597
- `Invalid frontmatter in ${(0, import_node_path106.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
15204
+ `Invalid frontmatter in ${(0, import_node_path110.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
14598
15205
  );
14599
15206
  }
14600
15207
  }
@@ -14710,7 +15317,7 @@ var CursorRule = class _CursorRule extends ToolRule {
14710
15317
  relativeFilePath,
14711
15318
  validate = true
14712
15319
  }) {
14713
- const filePath = (0, import_node_path106.join)(
15320
+ const filePath = (0, import_node_path110.join)(
14714
15321
  baseDir,
14715
15322
  this.getSettablePaths().nonRoot.relativeDirPath,
14716
15323
  relativeFilePath
@@ -14720,7 +15327,7 @@ var CursorRule = class _CursorRule extends ToolRule {
14720
15327
  const result = CursorRuleFrontmatterSchema.safeParse(frontmatter);
14721
15328
  if (!result.success) {
14722
15329
  throw new Error(
14723
- `Invalid frontmatter in ${(0, import_node_path106.join)(baseDir, relativeFilePath)}: ${formatError(result.error)}`
15330
+ `Invalid frontmatter in ${(0, import_node_path110.join)(baseDir, relativeFilePath)}: ${formatError(result.error)}`
14724
15331
  );
14725
15332
  }
14726
15333
  return new _CursorRule({
@@ -14757,7 +15364,7 @@ var CursorRule = class _CursorRule extends ToolRule {
14757
15364
  return {
14758
15365
  success: false,
14759
15366
  error: new Error(
14760
- `Invalid frontmatter in ${(0, import_node_path106.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
15367
+ `Invalid frontmatter in ${(0, import_node_path110.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
14761
15368
  )
14762
15369
  };
14763
15370
  }
@@ -14776,8 +15383,90 @@ var CursorRule = class _CursorRule extends ToolRule {
14776
15383
  }
14777
15384
  };
14778
15385
 
15386
+ // src/features/rules/deepagents-rule.ts
15387
+ var import_node_path111 = require("path");
15388
+ var DeepagentsRule = class _DeepagentsRule extends ToolRule {
15389
+ constructor({ fileContent, root, ...rest }) {
15390
+ super({
15391
+ ...rest,
15392
+ fileContent,
15393
+ root: root ?? false
15394
+ });
15395
+ }
15396
+ static getSettablePaths(_options = {}) {
15397
+ return {
15398
+ root: {
15399
+ relativeDirPath: ".deepagents",
15400
+ relativeFilePath: "AGENTS.md"
15401
+ },
15402
+ nonRoot: {
15403
+ relativeDirPath: buildToolPath(".deepagents", "memories", _options.excludeToolDir)
15404
+ }
15405
+ };
15406
+ }
15407
+ static async fromFile({
15408
+ baseDir = process.cwd(),
15409
+ relativeFilePath,
15410
+ validate = true
15411
+ }) {
15412
+ const isRoot = relativeFilePath === "AGENTS.md";
15413
+ const relativePath = isRoot ? (0, import_node_path111.join)(".deepagents", "AGENTS.md") : (0, import_node_path111.join)(".deepagents", "memories", relativeFilePath);
15414
+ const fileContent = await readFileContent((0, import_node_path111.join)(baseDir, relativePath));
15415
+ return new _DeepagentsRule({
15416
+ baseDir,
15417
+ relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : this.getSettablePaths().nonRoot.relativeDirPath,
15418
+ relativeFilePath: isRoot ? "AGENTS.md" : relativeFilePath,
15419
+ fileContent,
15420
+ validate,
15421
+ root: isRoot
15422
+ });
15423
+ }
15424
+ static forDeletion({
15425
+ baseDir = process.cwd(),
15426
+ relativeDirPath,
15427
+ relativeFilePath
15428
+ }) {
15429
+ const isRoot = relativeFilePath === "AGENTS.md" && relativeDirPath === ".deepagents";
15430
+ return new _DeepagentsRule({
15431
+ baseDir,
15432
+ relativeDirPath,
15433
+ relativeFilePath,
15434
+ fileContent: "",
15435
+ validate: false,
15436
+ root: isRoot
15437
+ });
15438
+ }
15439
+ static fromRulesyncRule({
15440
+ baseDir = process.cwd(),
15441
+ rulesyncRule,
15442
+ validate = true
15443
+ }) {
15444
+ return new _DeepagentsRule(
15445
+ this.buildToolRuleParamsAgentsmd({
15446
+ baseDir,
15447
+ rulesyncRule,
15448
+ validate,
15449
+ rootPath: this.getSettablePaths().root,
15450
+ nonRootPath: this.getSettablePaths().nonRoot
15451
+ })
15452
+ );
15453
+ }
15454
+ toRulesyncRule() {
15455
+ return this.toRulesyncRuleDefault();
15456
+ }
15457
+ validate() {
15458
+ return { success: true, error: null };
15459
+ }
15460
+ static isTargetedByRulesyncRule(rulesyncRule) {
15461
+ return this.isTargetedByRulesyncRuleDefault({
15462
+ rulesyncRule,
15463
+ toolTarget: "deepagents"
15464
+ });
15465
+ }
15466
+ };
15467
+
14779
15468
  // src/features/rules/factorydroid-rule.ts
14780
- var import_node_path107 = require("path");
15469
+ var import_node_path112 = require("path");
14781
15470
  var FactorydroidRule = class _FactorydroidRule extends ToolRule {
14782
15471
  constructor({ fileContent, root, ...rest }) {
14783
15472
  super({
@@ -14817,8 +15506,8 @@ var FactorydroidRule = class _FactorydroidRule extends ToolRule {
14817
15506
  const paths = this.getSettablePaths({ global });
14818
15507
  const isRoot = relativeFilePath === paths.root.relativeFilePath;
14819
15508
  if (isRoot) {
14820
- const relativePath2 = (0, import_node_path107.join)(paths.root.relativeDirPath, paths.root.relativeFilePath);
14821
- const fileContent2 = await readFileContent((0, import_node_path107.join)(baseDir, relativePath2));
15509
+ const relativePath2 = (0, import_node_path112.join)(paths.root.relativeDirPath, paths.root.relativeFilePath);
15510
+ const fileContent2 = await readFileContent((0, import_node_path112.join)(baseDir, relativePath2));
14822
15511
  return new _FactorydroidRule({
14823
15512
  baseDir,
14824
15513
  relativeDirPath: paths.root.relativeDirPath,
@@ -14831,8 +15520,8 @@ var FactorydroidRule = class _FactorydroidRule extends ToolRule {
14831
15520
  if (!paths.nonRoot) {
14832
15521
  throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
14833
15522
  }
14834
- const relativePath = (0, import_node_path107.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
14835
- const fileContent = await readFileContent((0, import_node_path107.join)(baseDir, relativePath));
15523
+ const relativePath = (0, import_node_path112.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
15524
+ const fileContent = await readFileContent((0, import_node_path112.join)(baseDir, relativePath));
14836
15525
  return new _FactorydroidRule({
14837
15526
  baseDir,
14838
15527
  relativeDirPath: paths.nonRoot.relativeDirPath,
@@ -14891,7 +15580,7 @@ var FactorydroidRule = class _FactorydroidRule extends ToolRule {
14891
15580
  };
14892
15581
 
14893
15582
  // src/features/rules/geminicli-rule.ts
14894
- var import_node_path108 = require("path");
15583
+ var import_node_path113 = require("path");
14895
15584
  var GeminiCliRule = class _GeminiCliRule extends ToolRule {
14896
15585
  static getSettablePaths({
14897
15586
  global,
@@ -14926,7 +15615,7 @@ var GeminiCliRule = class _GeminiCliRule extends ToolRule {
14926
15615
  if (isRoot) {
14927
15616
  const relativePath2 = paths.root.relativeFilePath;
14928
15617
  const fileContent2 = await readFileContent(
14929
- (0, import_node_path108.join)(baseDir, paths.root.relativeDirPath, relativePath2)
15618
+ (0, import_node_path113.join)(baseDir, paths.root.relativeDirPath, relativePath2)
14930
15619
  );
14931
15620
  return new _GeminiCliRule({
14932
15621
  baseDir,
@@ -14940,8 +15629,8 @@ var GeminiCliRule = class _GeminiCliRule extends ToolRule {
14940
15629
  if (!paths.nonRoot) {
14941
15630
  throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
14942
15631
  }
14943
- const relativePath = (0, import_node_path108.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
14944
- const fileContent = await readFileContent((0, import_node_path108.join)(baseDir, relativePath));
15632
+ const relativePath = (0, import_node_path113.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
15633
+ const fileContent = await readFileContent((0, import_node_path113.join)(baseDir, relativePath));
14945
15634
  return new _GeminiCliRule({
14946
15635
  baseDir,
14947
15636
  relativeDirPath: paths.nonRoot.relativeDirPath,
@@ -15000,7 +15689,7 @@ var GeminiCliRule = class _GeminiCliRule extends ToolRule {
15000
15689
  };
15001
15690
 
15002
15691
  // src/features/rules/goose-rule.ts
15003
- var import_node_path109 = require("path");
15692
+ var import_node_path114 = require("path");
15004
15693
  var GooseRule = class _GooseRule extends ToolRule {
15005
15694
  static getSettablePaths({
15006
15695
  global,
@@ -15035,7 +15724,7 @@ var GooseRule = class _GooseRule extends ToolRule {
15035
15724
  if (isRoot) {
15036
15725
  const relativePath2 = paths.root.relativeFilePath;
15037
15726
  const fileContent2 = await readFileContent(
15038
- (0, import_node_path109.join)(baseDir, paths.root.relativeDirPath, relativePath2)
15727
+ (0, import_node_path114.join)(baseDir, paths.root.relativeDirPath, relativePath2)
15039
15728
  );
15040
15729
  return new _GooseRule({
15041
15730
  baseDir,
@@ -15049,8 +15738,8 @@ var GooseRule = class _GooseRule extends ToolRule {
15049
15738
  if (!paths.nonRoot) {
15050
15739
  throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
15051
15740
  }
15052
- const relativePath = (0, import_node_path109.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
15053
- const fileContent = await readFileContent((0, import_node_path109.join)(baseDir, relativePath));
15741
+ const relativePath = (0, import_node_path114.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
15742
+ const fileContent = await readFileContent((0, import_node_path114.join)(baseDir, relativePath));
15054
15743
  return new _GooseRule({
15055
15744
  baseDir,
15056
15745
  relativeDirPath: paths.nonRoot.relativeDirPath,
@@ -15109,7 +15798,7 @@ var GooseRule = class _GooseRule extends ToolRule {
15109
15798
  };
15110
15799
 
15111
15800
  // src/features/rules/junie-rule.ts
15112
- var import_node_path110 = require("path");
15801
+ var import_node_path115 = require("path");
15113
15802
  var JunieRule = class _JunieRule extends ToolRule {
15114
15803
  static getSettablePaths(_options = {}) {
15115
15804
  return {
@@ -15128,8 +15817,8 @@ var JunieRule = class _JunieRule extends ToolRule {
15128
15817
  validate = true
15129
15818
  }) {
15130
15819
  const isRoot = relativeFilePath === "guidelines.md";
15131
- const relativePath = isRoot ? "guidelines.md" : (0, import_node_path110.join)(".junie", "memories", relativeFilePath);
15132
- const fileContent = await readFileContent((0, import_node_path110.join)(baseDir, relativePath));
15820
+ const relativePath = isRoot ? "guidelines.md" : (0, import_node_path115.join)(".junie", "memories", relativeFilePath);
15821
+ const fileContent = await readFileContent((0, import_node_path115.join)(baseDir, relativePath));
15133
15822
  return new _JunieRule({
15134
15823
  baseDir,
15135
15824
  relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : this.getSettablePaths().nonRoot.relativeDirPath,
@@ -15184,7 +15873,7 @@ var JunieRule = class _JunieRule extends ToolRule {
15184
15873
  };
15185
15874
 
15186
15875
  // src/features/rules/kilo-rule.ts
15187
- var import_node_path111 = require("path");
15876
+ var import_node_path116 = require("path");
15188
15877
  var KiloRule = class _KiloRule extends ToolRule {
15189
15878
  static getSettablePaths(_options = {}) {
15190
15879
  return {
@@ -15199,7 +15888,7 @@ var KiloRule = class _KiloRule extends ToolRule {
15199
15888
  validate = true
15200
15889
  }) {
15201
15890
  const fileContent = await readFileContent(
15202
- (0, import_node_path111.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
15891
+ (0, import_node_path116.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
15203
15892
  );
15204
15893
  return new _KiloRule({
15205
15894
  baseDir,
@@ -15251,7 +15940,7 @@ var KiloRule = class _KiloRule extends ToolRule {
15251
15940
  };
15252
15941
 
15253
15942
  // src/features/rules/kiro-rule.ts
15254
- var import_node_path112 = require("path");
15943
+ var import_node_path117 = require("path");
15255
15944
  var KiroRule = class _KiroRule extends ToolRule {
15256
15945
  static getSettablePaths(_options = {}) {
15257
15946
  return {
@@ -15266,7 +15955,7 @@ var KiroRule = class _KiroRule extends ToolRule {
15266
15955
  validate = true
15267
15956
  }) {
15268
15957
  const fileContent = await readFileContent(
15269
- (0, import_node_path112.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
15958
+ (0, import_node_path117.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
15270
15959
  );
15271
15960
  return new _KiroRule({
15272
15961
  baseDir,
@@ -15320,7 +16009,7 @@ var KiroRule = class _KiroRule extends ToolRule {
15320
16009
  };
15321
16010
 
15322
16011
  // src/features/rules/opencode-rule.ts
15323
- var import_node_path113 = require("path");
16012
+ var import_node_path118 = require("path");
15324
16013
  var OpenCodeRule = class _OpenCodeRule extends ToolRule {
15325
16014
  static getSettablePaths({
15326
16015
  global,
@@ -15355,7 +16044,7 @@ var OpenCodeRule = class _OpenCodeRule extends ToolRule {
15355
16044
  if (isRoot) {
15356
16045
  const relativePath2 = paths.root.relativeFilePath;
15357
16046
  const fileContent2 = await readFileContent(
15358
- (0, import_node_path113.join)(baseDir, paths.root.relativeDirPath, relativePath2)
16047
+ (0, import_node_path118.join)(baseDir, paths.root.relativeDirPath, relativePath2)
15359
16048
  );
15360
16049
  return new _OpenCodeRule({
15361
16050
  baseDir,
@@ -15369,8 +16058,8 @@ var OpenCodeRule = class _OpenCodeRule extends ToolRule {
15369
16058
  if (!paths.nonRoot) {
15370
16059
  throw new Error(`nonRoot path is not set for ${relativeFilePath}`);
15371
16060
  }
15372
- const relativePath = (0, import_node_path113.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
15373
- const fileContent = await readFileContent((0, import_node_path113.join)(baseDir, relativePath));
16061
+ const relativePath = (0, import_node_path118.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
16062
+ const fileContent = await readFileContent((0, import_node_path118.join)(baseDir, relativePath));
15374
16063
  return new _OpenCodeRule({
15375
16064
  baseDir,
15376
16065
  relativeDirPath: paths.nonRoot.relativeDirPath,
@@ -15429,7 +16118,7 @@ var OpenCodeRule = class _OpenCodeRule extends ToolRule {
15429
16118
  };
15430
16119
 
15431
16120
  // src/features/rules/qwencode-rule.ts
15432
- var import_node_path114 = require("path");
16121
+ var import_node_path119 = require("path");
15433
16122
  var QwencodeRule = class _QwencodeRule extends ToolRule {
15434
16123
  static getSettablePaths(_options = {}) {
15435
16124
  return {
@@ -15448,8 +16137,8 @@ var QwencodeRule = class _QwencodeRule extends ToolRule {
15448
16137
  validate = true
15449
16138
  }) {
15450
16139
  const isRoot = relativeFilePath === "QWEN.md";
15451
- const relativePath = isRoot ? "QWEN.md" : (0, import_node_path114.join)(".qwen", "memories", relativeFilePath);
15452
- const fileContent = await readFileContent((0, import_node_path114.join)(baseDir, relativePath));
16140
+ const relativePath = isRoot ? "QWEN.md" : (0, import_node_path119.join)(".qwen", "memories", relativeFilePath);
16141
+ const fileContent = await readFileContent((0, import_node_path119.join)(baseDir, relativePath));
15453
16142
  return new _QwencodeRule({
15454
16143
  baseDir,
15455
16144
  relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : this.getSettablePaths().nonRoot.relativeDirPath,
@@ -15501,7 +16190,7 @@ var QwencodeRule = class _QwencodeRule extends ToolRule {
15501
16190
  };
15502
16191
 
15503
16192
  // src/features/rules/replit-rule.ts
15504
- var import_node_path115 = require("path");
16193
+ var import_node_path120 = require("path");
15505
16194
  var ReplitRule = class _ReplitRule extends ToolRule {
15506
16195
  static getSettablePaths(_options = {}) {
15507
16196
  return {
@@ -15523,7 +16212,7 @@ var ReplitRule = class _ReplitRule extends ToolRule {
15523
16212
  }
15524
16213
  const relativePath = paths.root.relativeFilePath;
15525
16214
  const fileContent = await readFileContent(
15526
- (0, import_node_path115.join)(baseDir, paths.root.relativeDirPath, relativePath)
16215
+ (0, import_node_path120.join)(baseDir, paths.root.relativeDirPath, relativePath)
15527
16216
  );
15528
16217
  return new _ReplitRule({
15529
16218
  baseDir,
@@ -15589,7 +16278,7 @@ var ReplitRule = class _ReplitRule extends ToolRule {
15589
16278
  };
15590
16279
 
15591
16280
  // src/features/rules/roo-rule.ts
15592
- var import_node_path116 = require("path");
16281
+ var import_node_path121 = require("path");
15593
16282
  var RooRule = class _RooRule extends ToolRule {
15594
16283
  static getSettablePaths(_options = {}) {
15595
16284
  return {
@@ -15604,7 +16293,7 @@ var RooRule = class _RooRule extends ToolRule {
15604
16293
  validate = true
15605
16294
  }) {
15606
16295
  const fileContent = await readFileContent(
15607
- (0, import_node_path116.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
16296
+ (0, import_node_path121.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
15608
16297
  );
15609
16298
  return new _RooRule({
15610
16299
  baseDir,
@@ -15673,7 +16362,7 @@ var RooRule = class _RooRule extends ToolRule {
15673
16362
  };
15674
16363
 
15675
16364
  // src/features/rules/warp-rule.ts
15676
- var import_node_path117 = require("path");
16365
+ var import_node_path122 = require("path");
15677
16366
  var WarpRule = class _WarpRule extends ToolRule {
15678
16367
  constructor({ fileContent, root, ...rest }) {
15679
16368
  super({
@@ -15699,8 +16388,8 @@ var WarpRule = class _WarpRule extends ToolRule {
15699
16388
  validate = true
15700
16389
  }) {
15701
16390
  const isRoot = relativeFilePath === this.getSettablePaths().root.relativeFilePath;
15702
- const relativePath = isRoot ? this.getSettablePaths().root.relativeFilePath : (0, import_node_path117.join)(this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath);
15703
- const fileContent = await readFileContent((0, import_node_path117.join)(baseDir, relativePath));
16391
+ const relativePath = isRoot ? this.getSettablePaths().root.relativeFilePath : (0, import_node_path122.join)(this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath);
16392
+ const fileContent = await readFileContent((0, import_node_path122.join)(baseDir, relativePath));
15704
16393
  return new _WarpRule({
15705
16394
  baseDir,
15706
16395
  relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : ".warp",
@@ -15755,7 +16444,7 @@ var WarpRule = class _WarpRule extends ToolRule {
15755
16444
  };
15756
16445
 
15757
16446
  // src/features/rules/windsurf-rule.ts
15758
- var import_node_path118 = require("path");
16447
+ var import_node_path123 = require("path");
15759
16448
  var WindsurfRule = class _WindsurfRule extends ToolRule {
15760
16449
  static getSettablePaths(_options = {}) {
15761
16450
  return {
@@ -15770,7 +16459,7 @@ var WindsurfRule = class _WindsurfRule extends ToolRule {
15770
16459
  validate = true
15771
16460
  }) {
15772
16461
  const fileContent = await readFileContent(
15773
- (0, import_node_path118.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
16462
+ (0, import_node_path123.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
15774
16463
  );
15775
16464
  return new _WindsurfRule({
15776
16465
  baseDir,
@@ -15833,6 +16522,7 @@ var rulesProcessorToolTargets = [
15833
16522
  "codexcli",
15834
16523
  "copilot",
15835
16524
  "cursor",
16525
+ "deepagents",
15836
16526
  "factorydroid",
15837
16527
  "geminicli",
15838
16528
  "goose",
@@ -15846,8 +16536,8 @@ var rulesProcessorToolTargets = [
15846
16536
  "warp",
15847
16537
  "windsurf"
15848
16538
  ];
15849
- var RulesProcessorToolTargetSchema = import_mini57.z.enum(rulesProcessorToolTargets);
15850
- var formatRulePaths = (rules) => rules.map((r) => (0, import_node_path119.join)(r.getRelativeDirPath(), r.getRelativeFilePath())).join(", ");
16539
+ var RulesProcessorToolTargetSchema = import_mini59.z.enum(rulesProcessorToolTargets);
16540
+ var formatRulePaths = (rules) => rules.map((r) => (0, import_node_path124.join)(r.getRelativeDirPath(), r.getRelativeFilePath())).join(", ");
15851
16541
  var toolRuleFactories = /* @__PURE__ */ new Map([
15852
16542
  [
15853
16543
  "agentsmd",
@@ -15964,6 +16654,17 @@ var toolRuleFactories = /* @__PURE__ */ new Map([
15964
16654
  }
15965
16655
  }
15966
16656
  ],
16657
+ [
16658
+ "deepagents",
16659
+ {
16660
+ class: DeepagentsRule,
16661
+ meta: {
16662
+ extension: "md",
16663
+ supportsGlobal: false,
16664
+ ruleDiscoveryMode: "auto"
16665
+ }
16666
+ }
16667
+ ],
15967
16668
  [
15968
16669
  "factorydroid",
15969
16670
  {
@@ -16223,7 +16924,7 @@ var RulesProcessor = class extends FeatureProcessor {
16223
16924
  }).relativeDirPath;
16224
16925
  return this.skills.filter((skill) => skillClass.isTargetedByRulesyncSkill(skill)).map((skill) => {
16225
16926
  const frontmatter = skill.getFrontmatter();
16226
- const relativePath = (0, import_node_path119.join)(toolRelativeDirPath, skill.getDirName(), SKILL_FILE_NAME);
16927
+ const relativePath = (0, import_node_path124.join)(toolRelativeDirPath, skill.getDirName(), SKILL_FILE_NAME);
16227
16928
  return {
16228
16929
  name: frontmatter.name,
16229
16930
  description: frontmatter.description,
@@ -16336,12 +17037,12 @@ var RulesProcessor = class extends FeatureProcessor {
16336
17037
  * Load and parse rulesync rule files from .rulesync/rules/ directory
16337
17038
  */
16338
17039
  async loadRulesyncFiles() {
16339
- const rulesyncBaseDir = (0, import_node_path119.join)(process.cwd(), RULESYNC_RULES_RELATIVE_DIR_PATH);
16340
- const files = await findFilesByGlobs((0, import_node_path119.join)(rulesyncBaseDir, "**", "*.md"));
17040
+ const rulesyncBaseDir = (0, import_node_path124.join)(process.cwd(), RULESYNC_RULES_RELATIVE_DIR_PATH);
17041
+ const files = await findFilesByGlobs((0, import_node_path124.join)(rulesyncBaseDir, "**", "*.md"));
16341
17042
  this.logger.debug(`Found ${files.length} rulesync files`);
16342
17043
  const rulesyncRules = await Promise.all(
16343
17044
  files.map((file) => {
16344
- const relativeFilePath = (0, import_node_path119.relative)(rulesyncBaseDir, file);
17045
+ const relativeFilePath = (0, import_node_path124.relative)(rulesyncBaseDir, file);
16345
17046
  checkPathTraversal({
16346
17047
  relativePath: relativeFilePath,
16347
17048
  intendedRootDir: rulesyncBaseDir
@@ -16416,7 +17117,7 @@ var RulesProcessor = class extends FeatureProcessor {
16416
17117
  global: this.global
16417
17118
  });
16418
17119
  const resolveRelativeDirPath = (filePath) => {
16419
- const dirName = (0, import_node_path119.dirname)((0, import_node_path119.relative)(this.baseDir, filePath));
17120
+ const dirName = (0, import_node_path124.dirname)((0, import_node_path124.relative)(this.baseDir, filePath));
16420
17121
  return dirName === "" ? "." : dirName;
16421
17122
  };
16422
17123
  const findFilesWithFallback = async (primaryGlob, alternativeRoots, buildAltGlob) => {
@@ -16434,13 +17135,13 @@ var RulesProcessor = class extends FeatureProcessor {
16434
17135
  return [];
16435
17136
  }
16436
17137
  const uniqueRootFilePaths = await findFilesWithFallback(
16437
- (0, import_node_path119.join)(
17138
+ (0, import_node_path124.join)(
16438
17139
  this.baseDir,
16439
17140
  settablePaths.root.relativeDirPath ?? ".",
16440
17141
  settablePaths.root.relativeFilePath
16441
17142
  ),
16442
17143
  settablePaths.alternativeRoots,
16443
- (alt) => (0, import_node_path119.join)(this.baseDir, alt.relativeDirPath, alt.relativeFilePath)
17144
+ (alt) => (0, import_node_path124.join)(this.baseDir, alt.relativeDirPath, alt.relativeFilePath)
16444
17145
  );
16445
17146
  if (forDeletion) {
16446
17147
  return uniqueRootFilePaths.map((filePath) => {
@@ -16452,7 +17153,7 @@ var RulesProcessor = class extends FeatureProcessor {
16452
17153
  return factory.class.forDeletion({
16453
17154
  baseDir: this.baseDir,
16454
17155
  relativeDirPath,
16455
- relativeFilePath: (0, import_node_path119.basename)(filePath),
17156
+ relativeFilePath: (0, import_node_path124.basename)(filePath),
16456
17157
  global: this.global
16457
17158
  });
16458
17159
  }).filter((rule) => rule.isDeletable());
@@ -16466,7 +17167,7 @@ var RulesProcessor = class extends FeatureProcessor {
16466
17167
  });
16467
17168
  return factory.class.fromFile({
16468
17169
  baseDir: this.baseDir,
16469
- relativeFilePath: (0, import_node_path119.basename)(filePath),
17170
+ relativeFilePath: (0, import_node_path124.basename)(filePath),
16470
17171
  relativeDirPath,
16471
17172
  global: this.global
16472
17173
  });
@@ -16485,9 +17186,9 @@ var RulesProcessor = class extends FeatureProcessor {
16485
17186
  return [];
16486
17187
  }
16487
17188
  const uniqueLocalRootFilePaths = await findFilesWithFallback(
16488
- (0, import_node_path119.join)(this.baseDir, settablePaths.root.relativeDirPath ?? ".", "CLAUDE.local.md"),
17189
+ (0, import_node_path124.join)(this.baseDir, settablePaths.root.relativeDirPath ?? ".", "CLAUDE.local.md"),
16489
17190
  settablePaths.alternativeRoots,
16490
- (alt) => (0, import_node_path119.join)(this.baseDir, alt.relativeDirPath, "CLAUDE.local.md")
17191
+ (alt) => (0, import_node_path124.join)(this.baseDir, alt.relativeDirPath, "CLAUDE.local.md")
16491
17192
  );
16492
17193
  return uniqueLocalRootFilePaths.map((filePath) => {
16493
17194
  const relativeDirPath = resolveRelativeDirPath(filePath);
@@ -16498,7 +17199,7 @@ var RulesProcessor = class extends FeatureProcessor {
16498
17199
  return factory.class.forDeletion({
16499
17200
  baseDir: this.baseDir,
16500
17201
  relativeDirPath,
16501
- relativeFilePath: (0, import_node_path119.basename)(filePath),
17202
+ relativeFilePath: (0, import_node_path124.basename)(filePath),
16502
17203
  global: this.global
16503
17204
  });
16504
17205
  }).filter((rule) => rule.isDeletable());
@@ -16510,13 +17211,13 @@ var RulesProcessor = class extends FeatureProcessor {
16510
17211
  if (!settablePaths.nonRoot) {
16511
17212
  return [];
16512
17213
  }
16513
- const nonRootBaseDir = (0, import_node_path119.join)(this.baseDir, settablePaths.nonRoot.relativeDirPath);
17214
+ const nonRootBaseDir = (0, import_node_path124.join)(this.baseDir, settablePaths.nonRoot.relativeDirPath);
16514
17215
  const nonRootFilePaths = await findFilesByGlobs(
16515
- (0, import_node_path119.join)(nonRootBaseDir, "**", `*.${factory.meta.extension}`)
17216
+ (0, import_node_path124.join)(nonRootBaseDir, "**", `*.${factory.meta.extension}`)
16516
17217
  );
16517
17218
  if (forDeletion) {
16518
17219
  return nonRootFilePaths.map((filePath) => {
16519
- const relativeFilePath = (0, import_node_path119.relative)(nonRootBaseDir, filePath);
17220
+ const relativeFilePath = (0, import_node_path124.relative)(nonRootBaseDir, filePath);
16520
17221
  checkPathTraversal({
16521
17222
  relativePath: relativeFilePath,
16522
17223
  intendedRootDir: nonRootBaseDir
@@ -16531,7 +17232,7 @@ var RulesProcessor = class extends FeatureProcessor {
16531
17232
  }
16532
17233
  return await Promise.all(
16533
17234
  nonRootFilePaths.map((filePath) => {
16534
- const relativeFilePath = (0, import_node_path119.relative)(nonRootBaseDir, filePath);
17235
+ const relativeFilePath = (0, import_node_path124.relative)(nonRootBaseDir, filePath);
16535
17236
  checkPathTraversal({
16536
17237
  relativePath: relativeFilePath,
16537
17238
  intendedRootDir: nonRootBaseDir
@@ -16644,14 +17345,14 @@ s/<command> [arguments]
16644
17345
  This syntax employs a double slash (\`s/\`) to prevent conflicts with built-in slash commands.
16645
17346
  The \`s\` in \`s/\` stands for *simulate*. Because custom slash commands are not built-in, this syntax provides a pseudo way to invoke them.
16646
17347
 
16647
- When users call a custom slash command, you have to look for the markdown file, \`${(0, import_node_path119.join)(RULESYNC_COMMANDS_RELATIVE_DIR_PATH, "{command}.md")}\`, then execute the contents of that file as the block of operations.` : "";
17348
+ When users call a custom slash command, you have to look for the markdown file, \`${(0, import_node_path124.join)(RULESYNC_COMMANDS_RELATIVE_DIR_PATH, "{command}.md")}\`, then execute the contents of that file as the block of operations.` : "";
16648
17349
  const subagentsSection = subagents ? `## Simulated Subagents
16649
17350
 
16650
17351
  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.
16651
17352
 
16652
- When users call a simulated subagent, it will look for the corresponding markdown file, \`${(0, import_node_path119.join)(RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, "{subagent}.md")}\`, and execute its contents as the block of operations.
17353
+ When users call a simulated subagent, it will look for the corresponding markdown file, \`${(0, import_node_path124.join)(RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, "{subagent}.md")}\`, and execute its contents as the block of operations.
16653
17354
 
16654
- For example, if the user instructs \`Call planner subagent to plan the refactoring\`, you have to look for the markdown file, \`${(0, import_node_path119.join)(RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, "planner.md")}\`, and execute its contents as the block of operations.` : "";
17355
+ For example, if the user instructs \`Call planner subagent to plan the refactoring\`, you have to look for the markdown file, \`${(0, import_node_path124.join)(RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, "planner.md")}\`, and execute its contents as the block of operations.` : "";
16655
17356
  const skillsSection = skills ? this.generateSkillsSection(skills) : "";
16656
17357
  const result = [
16657
17358
  overview,
@@ -16743,7 +17444,7 @@ function warnUnsupportedTargets(params) {
16743
17444
  }
16744
17445
  }
16745
17446
  async function checkRulesyncDirExists(params) {
16746
- return fileExists((0, import_node_path120.join)(params.baseDir, RULESYNC_RELATIVE_DIR_PATH));
17447
+ return fileExists((0, import_node_path125.join)(params.baseDir, RULESYNC_RELATIVE_DIR_PATH));
16747
17448
  }
16748
17449
  async function generate(params) {
16749
17450
  const { config, logger } = params;