mano-coding 0.1.20 → 0.1.22

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/bin.js CHANGED
@@ -31959,6 +31959,8 @@ function interpolateString(template, ctx) {
31959
31959
  if (varName === "projectDir") return ctx.projectDir;
31960
31960
  if (varName === "projectParentDir") return ctx.projectParentDir;
31961
31961
  if (varName === "templateDir") return ctx.templateDir;
31962
+ if (varName === "target" || varName === "ide") return ctx.target ?? "";
31963
+ if (varName === "targets") return ctx.targets ? ctx.targets.join(",") : ctx.target ?? "";
31962
31964
  if (varName.startsWith("inputs.")) {
31963
31965
  const inputKey = varName.slice("inputs.".length);
31964
31966
  return ctx.inputs[inputKey] ?? "";
@@ -32015,20 +32017,35 @@ async function executeTasks(tasks, ctx, options = {}) {
32015
32017
  for (let i = 0; i < tasks.length; i++) {
32016
32018
  const task = tasks[i];
32017
32019
  const command = interpolateString(task.command, ctx);
32018
- const args = (task.args ?? []).map((arg) => interpolateString(arg, ctx));
32020
+ const rawArgs = (task.args ?? []).map((arg) => interpolateString(arg, ctx));
32019
32021
  const cwd = task.cwd ? interpolateString(task.cwd, ctx) : ctx.projectDir;
32022
+ const effectiveArgs = [...rawArgs];
32023
+ const isInstallMcpScript = command && command.includes("install-farris-vue-mcp") || effectiveArgs.some((arg) => typeof arg === "string" && arg.includes("install-farris-vue-mcp"));
32024
+ if (isInstallMcpScript && !effectiveArgs.includes("--ide")) {
32025
+ const targetIde = ctx.target ?? "codebuddy";
32026
+ effectiveArgs.push("--ide", targetIde);
32027
+ }
32020
32028
  const env = { ...process.env };
32029
+ if (ctx.target) {
32030
+ env.MANO_TARGET = ctx.target;
32031
+ env.MANO_IDE = ctx.target;
32032
+ env.TARGET = ctx.target;
32033
+ env.IDE = ctx.target;
32034
+ }
32035
+ if (ctx.targets) {
32036
+ env.MANO_TARGETS = ctx.targets.join(",");
32037
+ }
32021
32038
  if (task.env) {
32022
32039
  for (const [k2, v2] of Object.entries(task.env)) {
32023
32040
  env[k2] = interpolateString(v2, ctx);
32024
32041
  }
32025
32042
  }
32026
32043
  if (options.onProgress) {
32027
- options.onProgress(`\u6B63\u5728\u6267\u884C\u4EFB\u52A1 [${i + 1}/${tasks.length}] (${task.id}): ${command} ${args.join(" ")}`);
32044
+ options.onProgress(`\u6B63\u5728\u6267\u884C\u4EFB\u52A1 [${i + 1}/${tasks.length}] (${task.id}): ${command} ${effectiveArgs.join(" ")}`);
32028
32045
  }
32029
32046
  const executable = resolveTaskExecutable(command, process.platform, env.PATH);
32030
32047
  await new Promise((resolve22, reject) => {
32031
- const child = spawn(executable, args, {
32048
+ const child = spawn(executable, effectiveArgs, {
32032
32049
  cwd,
32033
32050
  env,
32034
32051
  stdio,
@@ -32113,6 +32130,85 @@ function validateMcpConfig(rawConfig) {
32113
32130
  }
32114
32131
  return validatedServers;
32115
32132
  }
32133
+ function getTargetSkillPath(target, skillId, relFile) {
32134
+ const normalizedRel = relFile.replaceAll("\\", "/");
32135
+ switch (target) {
32136
+ case "cursor":
32137
+ return `.cursor/skills/${skillId}/${normalizedRel}`;
32138
+ case "codebuddy":
32139
+ return `.codebuddy/skills/${skillId}/${normalizedRel}`;
32140
+ case "claude-code":
32141
+ return `.claude/skills/${skillId}/${normalizedRel}`;
32142
+ case "trae":
32143
+ return `.trae/skills/${skillId}/${normalizedRel}`;
32144
+ case "opencode":
32145
+ return `.opencode/skills/${skillId}/${normalizedRel}`;
32146
+ case "codex":
32147
+ return `.agents/skills/${skillId}/${normalizedRel}`;
32148
+ case "deepseek-harness":
32149
+ return `.dsh/skills/${skillId}/${normalizedRel}`;
32150
+ default:
32151
+ return `.${target}/skills/${skillId}/${normalizedRel}`;
32152
+ }
32153
+ }
32154
+ function getTargetRulePath(target, relFile) {
32155
+ const normalizedRel = relFile.replaceAll("\\", "/");
32156
+ switch (target) {
32157
+ case "cursor":
32158
+ return `.cursor/rules/${normalizedRel}`;
32159
+ case "claude-code":
32160
+ return `.claude/rules/${normalizedRel}`;
32161
+ case "trae":
32162
+ return `.trae/rules/${normalizedRel}`;
32163
+ case "codebuddy":
32164
+ return `.codebuddy/rules/${normalizedRel}`;
32165
+ case "opencode":
32166
+ return `.opencode/rules/${normalizedRel}`;
32167
+ case "deepseek-harness":
32168
+ return `.dsh/rules/${normalizedRel}`;
32169
+ default:
32170
+ return `.${target}/rules/${normalizedRel}`;
32171
+ }
32172
+ }
32173
+ function getTargetSubagentPath(target, relFile) {
32174
+ const normalizedRel = relFile.replaceAll("\\", "/");
32175
+ switch (target) {
32176
+ case "cursor":
32177
+ return `.cursor/agents/${normalizedRel}`;
32178
+ case "claude-code":
32179
+ return `.claude/agents/${normalizedRel}`;
32180
+ case "codex":
32181
+ return `.codex/agents/${normalizedRel}`;
32182
+ case "opencode":
32183
+ return `.opencode/agents/${normalizedRel}`;
32184
+ case "codebuddy":
32185
+ return `.codebuddy/agents/${normalizedRel}`;
32186
+ case "trae":
32187
+ return `.trae/agents/${normalizedRel}`;
32188
+ case "deepseek-harness":
32189
+ return `.dsh/agents/${normalizedRel}`;
32190
+ default:
32191
+ return `.${target}/agents/${normalizedRel}`;
32192
+ }
32193
+ }
32194
+ function getTargetMcpPath(target) {
32195
+ switch (target) {
32196
+ case "cursor":
32197
+ return ".cursor/mcp.json";
32198
+ case "trae":
32199
+ return ".trae/mcp.json";
32200
+ case "codebuddy":
32201
+ return ".mcp.json";
32202
+ case "claude-code":
32203
+ return ".mcp.json";
32204
+ case "opencode":
32205
+ return "opencode.json";
32206
+ case "deepseek-harness":
32207
+ return ".dsh/mcp.json";
32208
+ default:
32209
+ return `.${target}/mcp.json`;
32210
+ }
32211
+ }
32116
32212
  async function scanTemplateDirectoryContract(options) {
32117
32213
  const { templateDir, targets } = options;
32118
32214
  const intents = [];
@@ -32137,21 +32233,15 @@ async function scanTemplateDirectoryContract(options) {
32137
32233
  const allSkillFiles = await listAllFilesRecursive(singleSkillDir);
32138
32234
  for (const relFile of allSkillFiles) {
32139
32235
  const fileContent = await readFile17(join12(singleSkillDir, relFile));
32140
- intents.push({
32141
- action: "upsert",
32142
- type: "file",
32143
- path: `.agents/skills/${skillId}/${relFile.replaceAll("\\", "/")}`,
32144
- content: fileContent
32145
- });
32236
+ const normalizedRel = relFile.replaceAll("\\", "/");
32146
32237
  for (const target of targets) {
32147
- if (target === "cursor") {
32148
- intents.push({
32149
- action: "upsert",
32150
- type: "file",
32151
- path: `.cursor/skills/${skillId}/${relFile.replaceAll("\\", "/")}`,
32152
- content: fileContent
32153
- });
32154
- }
32238
+ intents.push({
32239
+ action: "upsert",
32240
+ type: "file",
32241
+ path: getTargetSkillPath(target, skillId, normalizedRel),
32242
+ content: fileContent,
32243
+ target
32244
+ });
32155
32245
  }
32156
32246
  }
32157
32247
  }
@@ -32169,28 +32259,33 @@ async function scanTemplateDirectoryContract(options) {
32169
32259
  for (const relFile of allRuleFiles) {
32170
32260
  const fileContent = await readFile17(join12(singleRuleDir, relFile));
32171
32261
  const normalizedRel = relFile.replaceAll("\\", "/");
32172
- let targetDestPath;
32173
- switch (ide) {
32174
- case "cursor":
32175
- targetDestPath = `.cursor/rules/${normalizedRel}`;
32176
- break;
32177
- case "claude-code":
32178
- targetDestPath = `.claude/rules/${normalizedRel}`;
32179
- break;
32180
- case "trae":
32181
- targetDestPath = `.trae/rules/${normalizedRel}`;
32182
- break;
32183
- case "codebuddy":
32184
- targetDestPath = `.codebuddy/rules/${normalizedRel}`;
32185
- break;
32186
- default:
32187
- targetDestPath = `.${ide}/rules/${normalizedRel}`;
32188
- break;
32189
- }
32190
32262
  intents.push({
32191
32263
  action: "upsert",
32192
32264
  type: "file",
32193
- path: targetDestPath,
32265
+ path: getTargetRulePath(ide, normalizedRel),
32266
+ content: fileContent,
32267
+ target: ide
32268
+ });
32269
+ }
32270
+ }
32271
+ } catch {
32272
+ }
32273
+ const subagentsDir = join12(templateDir, "subagents");
32274
+ try {
32275
+ const agentIdeEntries = await readdir4(subagentsDir, { withFileTypes: true });
32276
+ for (const ideEntry of agentIdeEntries) {
32277
+ if (!ideEntry.isDirectory()) continue;
32278
+ const ide = ideEntry.name;
32279
+ if (!targets.includes(ide)) continue;
32280
+ const singleAgentDir = join12(subagentsDir, ide);
32281
+ const allAgentFiles = await listAllFilesRecursive(singleAgentDir);
32282
+ for (const relFile of allAgentFiles) {
32283
+ const fileContent = await readFile17(join12(singleAgentDir, relFile));
32284
+ const normalizedRel = relFile.replaceAll("\\", "/");
32285
+ intents.push({
32286
+ action: "upsert",
32287
+ type: "file",
32288
+ path: getTargetSubagentPath(ide, normalizedRel),
32194
32289
  content: fileContent,
32195
32290
  target: ide
32196
32291
  });
@@ -32204,25 +32299,10 @@ async function scanTemplateDirectoryContract(options) {
32204
32299
  const mcpServers = validateMcpConfig(JSON.parse(mcpRaw));
32205
32300
  for (const [serverName, serverConfig] of Object.entries(mcpServers)) {
32206
32301
  for (const target of targets) {
32207
- let mcpConfigPath;
32208
- switch (target) {
32209
- case "cursor":
32210
- mcpConfigPath = ".cursor/mcp.json";
32211
- break;
32212
- case "trae":
32213
- mcpConfigPath = ".trae/mcp.json";
32214
- break;
32215
- case "codebuddy":
32216
- mcpConfigPath = ".codebuddy/mcp.json";
32217
- break;
32218
- default:
32219
- mcpConfigPath = `.${target}/mcp.json`;
32220
- break;
32221
- }
32222
32302
  intents.push({
32223
32303
  action: "upsert",
32224
32304
  type: "config-entry",
32225
- path: mcpConfigPath,
32305
+ path: getTargetMcpPath(target),
32226
32306
  selector: `/mcpServers/${serverName}`,
32227
32307
  value: serverConfig,
32228
32308
  format: "json",
@@ -33525,6 +33605,10 @@ __export(src_exports, {
33525
33605
  getOfficialTargets: () => getOfficialTargets,
33526
33606
  getPlanIntents: () => getPlanIntents,
33527
33607
  getPluginDeliveryDriver: () => getPluginDeliveryDriver,
33608
+ getTargetMcpPath: () => getTargetMcpPath,
33609
+ getTargetRulePath: () => getTargetRulePath,
33610
+ getTargetSkillPath: () => getTargetSkillPath,
33611
+ getTargetSubagentPath: () => getTargetSubagentPath,
33528
33612
  getUserInstallCommands: () => getUserInstallCommands,
33529
33613
  getUserInstallEnvChanges: () => getUserInstallEnvChanges,
33530
33614
  hasActiveLease: () => hasActiveLease,
@@ -38608,13 +38692,13 @@ async function buildLock(_operation, templateResolution, addonResolutions, proje
38608
38692
  id: templateResolution.packageId,
38609
38693
  version: templateResolution.resolvedVersion,
38610
38694
  source: templateResolution.source,
38611
- integrity: templateResolution.integrity ?? ""
38695
+ ...templateResolution.integrity ? { integrity: templateResolution.integrity } : {}
38612
38696
  } : void 0;
38613
38697
  const resolvedAddons = addonResolutions.map((r) => ({
38614
38698
  id: r.packageId,
38615
38699
  version: r.resolvedVersion,
38616
38700
  source: r.source,
38617
- integrity: r.integrity ?? ""
38701
+ ...r.integrity ? { integrity: r.integrity } : {}
38618
38702
  }));
38619
38703
  const allResolutions = [...templateResolution ? [templateResolution] : [], ...addonResolutions];
38620
38704
  const activeTargetIds = new Set(projectTargets.map((target) => target.id));
@@ -38629,7 +38713,7 @@ async function buildLock(_operation, templateResolution, addonResolutions, proje
38629
38713
  id: r.packageId,
38630
38714
  version: r.resolvedVersion,
38631
38715
  source: r.source,
38632
- integrity: r.integrity ?? ""
38716
+ ...r.integrity ? { integrity: r.integrity } : {}
38633
38717
  }));
38634
38718
  for (const intent of intents) {
38635
38719
  if (intent.action === "remove") continue;
@@ -39198,7 +39282,9 @@ ${taskValidation.missingInputs.map((k2) => `--set ${k2}=<value>`).join("\n")}`,
39198
39282
  projectDir: service.projectRoot,
39199
39283
  projectParentDir: dirname15(service.projectRoot),
39200
39284
  templateDir,
39201
- inputs: inputValues
39285
+ inputs: inputValues,
39286
+ target: projectTargets[0]?.id,
39287
+ targets: projectTargets.map((t2) => t2.id)
39202
39288
  };
39203
39289
  if (!output.json && i === 0) {
39204
39290
  writeHumanOutput("\n\u6B63\u5728\u6267\u884C\u524D\u7F6E\u521B\u5EFA\u4EFB\u52A1 (before:create):\n");
@@ -39312,7 +39398,9 @@ ${taskValidation.missingInputs.map((k2) => `--set ${k2}=<value>`).join("\n")}`,
39312
39398
  projectDir: service.projectRoot,
39313
39399
  projectParentDir: dirname15(service.projectRoot),
39314
39400
  templateDir,
39315
- inputs: inputValues
39401
+ inputs: inputValues,
39402
+ target: projectTargets[0]?.id,
39403
+ targets: projectTargets.map((t2) => t2.id)
39316
39404
  };
39317
39405
  if (!output.json && i === 0) {
39318
39406
  writeHumanOutput("\n\u6B63\u5728\u6267\u884C\u540E\u7F6E\u521D\u59CB\u5316\u4EFB\u52A1 (after:create):\n");
@@ -39624,7 +39712,9 @@ async function executeApply(packageSpec, options, cliVersion, events) {
39624
39712
  projectDir: service.projectRoot,
39625
39713
  projectParentDir: dirname15(service.projectRoot),
39626
39714
  templateDir,
39627
- inputs: inputValues
39715
+ inputs: inputValues,
39716
+ target: projectTargets[0]?.id,
39717
+ targets: projectTargets.map((t2) => t2.id)
39628
39718
  };
39629
39719
  if (!output.json && i === 0) {
39630
39720
  writeHumanOutput("\n\u6B63\u5728\u6267\u884C\u524D\u7F6E\u5E94\u7528\u4EFB\u52A1 (before:apply):\n");
@@ -39713,7 +39803,9 @@ async function executeApply(packageSpec, options, cliVersion, events) {
39713
39803
  projectDir: service.projectRoot,
39714
39804
  projectParentDir: dirname15(service.projectRoot),
39715
39805
  templateDir,
39716
- inputs: inputValues
39806
+ inputs: inputValues,
39807
+ target: projectTargets[0]?.id,
39808
+ targets: projectTargets.map((t2) => t2.id)
39717
39809
  };
39718
39810
  if (!output.json && i === 0) {
39719
39811
  writeHumanOutput("\n\u6B63\u5728\u6267\u884C\u540E\u7F6E\u5E94\u7528\u4EFB\u52A1 (after:apply):\n");
@@ -42009,7 +42101,7 @@ import { createRequire as createRequire2 } from "node:module";
42009
42101
  import { readFileSync as readFileSync4 } from "node:fs";
42010
42102
  import { fileURLToPath as fileURLToPath5 } from "node:url";
42011
42103
  function resolveVersion() {
42012
- if (true) return "0.1.20";
42104
+ if (true) return "0.1.22";
42013
42105
  const candidates = [
42014
42106
  new URL("../package.json", import.meta.url),
42015
42107
  new URL("../../package.json", import.meta.url),
@@ -18,8 +18,8 @@
18
18
  "$defs": {
19
19
  "packageName": {
20
20
  "type": "string",
21
- "pattern": "^(?:@[a-z0-9][a-z0-9._-]*/)?[a-z0-9][a-z0-9._-]*$",
22
- "maxLength": 214
21
+ "pattern": "^(?:(?:gitlab|github):[a-zA-Z0-9_.-]+(?:/[a-zA-Z0-9_.-]+)+|(?:@[a-z0-9][a-z0-9._-]*/)?[a-z0-9][a-z0-9._-]*)$",
22
+ "maxLength": 256
23
23
  },
24
24
  "localId": {
25
25
  "type": "string",
@@ -18,8 +18,8 @@
18
18
  "$defs": {
19
19
  "packageName": {
20
20
  "type": "string",
21
- "pattern": "^(?:@[a-z0-9][a-z0-9._-]*/)?[a-z0-9][a-z0-9._-]*$",
22
- "maxLength": 214
21
+ "pattern": "^(?:(?:gitlab|github):[a-zA-Z0-9_.-]+(?:/[a-zA-Z0-9_.-]+)+|(?:@[a-z0-9][a-z0-9._-]*/)?[a-z0-9][a-z0-9._-]*)$",
22
+ "maxLength": 256
23
23
  },
24
24
  "localId": {
25
25
  "type": "string",
@@ -221,7 +221,7 @@
221
221
  },
222
222
  "resolvedPackage": {
223
223
  "type": "object",
224
- "required": ["id", "version", "source", "integrity"],
224
+ "required": ["id", "version", "source"],
225
225
  "properties": {
226
226
  "id": { "$ref": "#/$defs/packageName" },
227
227
  "version": { "$ref": "#/$defs/semver" },
@@ -17,7 +17,7 @@
17
17
  "$defs": {
18
18
  "packageName": {
19
19
  "type": "string",
20
- "pattern": "^(?:@[a-z0-9][a-z0-9._-]*/)?[a-z0-9][a-z0-9._-]*$"
20
+ "pattern": "^(?:(?:gitlab|github):[a-zA-Z0-9_.-]+(?:/[a-zA-Z0-9_.-]+)+|(?:@[a-z0-9][a-z0-9._-]*/)?[a-z0-9][a-z0-9._-]*)$"
21
21
  },
22
22
  "semver": {
23
23
  "type": "string",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mano-coding",
3
- "version": "0.1.20",
3
+ "version": "0.1.22",
4
4
  "description": "Mano Coding CLI and toolchain",
5
5
  "type": "module",
6
6
  "main": "index.js",
@@ -18,8 +18,8 @@
18
18
  "$defs": {
19
19
  "packageName": {
20
20
  "type": "string",
21
- "pattern": "^(?:@[a-z0-9][a-z0-9._-]*/)?[a-z0-9][a-z0-9._-]*$",
22
- "maxLength": 214
21
+ "pattern": "^(?:(?:gitlab|github):[a-zA-Z0-9_.-]+(?:/[a-zA-Z0-9_.-]+)+|(?:@[a-z0-9][a-z0-9._-]*/)?[a-z0-9][a-z0-9._-]*)$",
22
+ "maxLength": 256
23
23
  },
24
24
  "localId": {
25
25
  "type": "string",
@@ -18,8 +18,8 @@
18
18
  "$defs": {
19
19
  "packageName": {
20
20
  "type": "string",
21
- "pattern": "^(?:@[a-z0-9][a-z0-9._-]*/)?[a-z0-9][a-z0-9._-]*$",
22
- "maxLength": 214
21
+ "pattern": "^(?:(?:gitlab|github):[a-zA-Z0-9_.-]+(?:/[a-zA-Z0-9_.-]+)+|(?:@[a-z0-9][a-z0-9._-]*/)?[a-z0-9][a-z0-9._-]*)$",
22
+ "maxLength": 256
23
23
  },
24
24
  "localId": {
25
25
  "type": "string",
@@ -221,7 +221,7 @@
221
221
  },
222
222
  "resolvedPackage": {
223
223
  "type": "object",
224
- "required": ["id", "version", "source", "integrity"],
224
+ "required": ["id", "version", "source"],
225
225
  "properties": {
226
226
  "id": { "$ref": "#/$defs/packageName" },
227
227
  "version": { "$ref": "#/$defs/semver" },
@@ -17,7 +17,7 @@
17
17
  "$defs": {
18
18
  "packageName": {
19
19
  "type": "string",
20
- "pattern": "^(?:@[a-z0-9][a-z0-9._-]*/)?[a-z0-9][a-z0-9._-]*$"
20
+ "pattern": "^(?:(?:gitlab|github):[a-zA-Z0-9_.-]+(?:/[a-zA-Z0-9_.-]+)+|(?:@[a-z0-9][a-z0-9._-]*/)?[a-z0-9][a-z0-9._-]*)$"
21
21
  },
22
22
  "semver": {
23
23
  "type": "string",