release-skill 0.2.4 → 0.2.5

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.
Files changed (40) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/.claude-plugin/plugin.json +1 -1
  3. package/.codebuddy-plugin/plugin.json +1 -1
  4. package/.codex-plugin/plugin.json +2 -2
  5. package/.kimi-plugin/plugin.json +1 -1
  6. package/CHANGELOG.md +24 -0
  7. package/INSTALL.md +4 -4
  8. package/INSTALL.zh-CN.md +4 -4
  9. package/README.md +16 -14
  10. package/README.zh-CN.md +16 -14
  11. package/adapters/claude/.claude-plugin/marketplace.json +1 -1
  12. package/adapters/claude/.claude-plugin/plugin.json +1 -1
  13. package/adapters/claude/bin/release-skill.bundle.mjs +1375 -607
  14. package/adapters/claude/schemas/release-plan.schema.json +91 -0
  15. package/adapters/claude/schemas/release-run.schema.json +85 -0
  16. package/adapters/codex/.codex-plugin/plugin.json +2 -2
  17. package/adapters/codex/bin/release-skill.bundle.mjs +1375 -607
  18. package/adapters/codex/schemas/release-plan.schema.json +91 -0
  19. package/adapters/codex/schemas/release-run.schema.json +85 -0
  20. package/adapters/kimi/.kimi-plugin/plugin.json +1 -1
  21. package/adapters/kimi/bin/release-skill.bundle.mjs +1375 -607
  22. package/adapters/kimi/schemas/release-plan.schema.json +91 -0
  23. package/adapters/kimi/schemas/release-run.schema.json +85 -0
  24. package/adapters/workbuddy/.codebuddy-plugin/plugin.json +1 -1
  25. package/adapters/workbuddy/bin/release-skill.bundle.mjs +1375 -607
  26. package/adapters/workbuddy/schemas/release-plan.schema.json +91 -0
  27. package/adapters/workbuddy/schemas/release-run.schema.json +85 -0
  28. package/bin/release-skill.bundle.mjs +1375 -607
  29. package/package.json +1 -1
  30. package/schemas/release-plan.schema.json +91 -0
  31. package/schemas/release-run.schema.json +85 -0
  32. package/scripts/sync-public-files.mjs +20 -9
  33. package/src/adapters/plugin-marketplace.mjs +82 -3
  34. package/src/commands/prepare.mjs +74 -0
  35. package/src/commands/publish.mjs +62 -0
  36. package/src/commands/verify.mjs +151 -1
  37. package/src/core/plan.mjs +29 -0
  38. package/src/core/skill-resource-closure.mjs +425 -0
  39. package/src/platforms/codebuddy.mjs +16 -3
  40. package/src/platforms/kimi.mjs +36 -9
@@ -183,16 +183,22 @@ export function codebuddyAuthorityDir(context, planDigest, plugin) {
183
183
  /**
184
184
  * 统一人工安装说明:面向 CodeBuddy / WorkBuddy 的人工结果流程。
185
185
  *
186
- * @param {{plugin:string, version:string, ref:string, attestationDir:string}} p
186
+ * @param {{plugin:string, version:string, ref:string, attestationDir:string, requiresInstalledClosure:boolean}} p
187
187
  * @returns {string[]}
188
188
  */
189
- function buildCodeBuddyManualInstructions({ plugin, version, ref, attestationDir }) {
189
+ function buildCodeBuddyManualInstructions({
190
+ plugin,
191
+ version,
192
+ ref,
193
+ attestationDir,
194
+ requiresInstalledClosure,
195
+ }) {
190
196
  return [
191
197
  `CodeBuddy/WorkBuddy 插件安装无法锁定冻结 ref(codebuddy CLI marketplace add/install 没有 ref 选项,跟踪默认分支),因此安装是需要人工结果证明的手动步骤。`,
192
198
  `1) publish 完成所有远端写入后进入 PUBLISHED 状态(自动化 Git 分支/标签、npm 和 GitHub Release 写入已完成)。此 codebuddy 检查点标记为需要人工安装。`,
193
199
  `2) 从统一市场 "${CODEBUDDY_MARKETPLACE_NAME}" (${CODEBUDDY_MARKETPLACE_SOURCE}) 安装 release-skill。确认安装的插件版本等于冻结版本 ${version}。`,
194
200
  `3) 将人工结果 JSON 写入: ${attestationDir}/${CODEBUDDY_ATTESTATION_FILE}`,
195
- ` 必填字段: platform="codebuddy", version, planDigest(冻结计划摘要), result("passed" 或 "failed"), actor(确认人), confirmedAt(ISO 8601 时间戳)`,
201
+ ` 必填字段: platform="codebuddy", version, planDigest(冻结计划摘要), result("passed" 或 "failed"), actor(确认人), confirmedAt(ISO 8601 时间戳)${requiresInstalledClosure ? ',installChannel("desktop" 或 "cli"),installPath(实际安装后的插件目录)' : ''}`,
196
202
  ` 可选字段: note(备注)`,
197
203
  `4) 运行 release-skill verify(从同一个计划摘要索引的权威目录读取结果,成功后 -> VERIFIED)。`,
198
204
  ];
@@ -464,6 +470,7 @@ export async function executeCodeBuddyManualRequirement(action, context) {
464
470
  version: action.version,
465
471
  ref,
466
472
  attestationDir,
473
+ requiresInstalledClosure: Boolean(context.plan?.skillResourceClosure),
467
474
  });
468
475
 
469
476
  // 统一 requirement 结构:不再包含隔离目录信息
@@ -485,6 +492,12 @@ export async function executeCodeBuddyManualRequirement(action, context) {
485
492
  result: '<"passed" or "failed">',
486
493
  actor: '<person who confirmed the install>',
487
494
  confirmedAt: '<ISO 8601 timestamp>',
495
+ ...(context.plan?.skillResourceClosure
496
+ ? {
497
+ installChannel: '<"desktop" or "cli">',
498
+ installPath: `<actual .workbuddy/plugins/marketplaces/${CODEBUDDY_MARKETPLACE_NAME}/plugins/${action.plugin} directory>`,
499
+ }
500
+ : {}),
488
501
  note: '<optional note>',
489
502
  },
490
503
  instructions,
@@ -187,16 +187,24 @@ function buildKimiInstallUrl(repo, ref) {
187
187
  /**
188
188
  * 统一人工安装说明:面向 Kimi Code 的人工结果流程。
189
189
  *
190
- * @param {{installUrl:string, plugin:string, version:string, ref:string, attestationDir:string}} p
190
+ * @param {{installUrl:string, plugin:string, version:string, ref:string, attestationDir:string, requiresInstalledClosure:boolean, managedRoot:string|null}} p
191
191
  * @returns {string[]}
192
192
  */
193
- function buildKimiManualInstructions({ installUrl, plugin, version, ref, attestationDir }) {
193
+ function buildKimiManualInstructions({
194
+ installUrl,
195
+ plugin,
196
+ version,
197
+ ref,
198
+ attestationDir,
199
+ requiresInstalledClosure,
200
+ managedRoot,
201
+ }) {
194
202
  return [
195
203
  `Kimi Code 没有可脚本化的插件安装命令行工具;安装是手动交互步骤。`,
196
204
  `1) publish 完成所有远端写入后进入 PUBLISHED 状态(自动化 Git 分支/标签、npm 和 GitHub Release 写入已完成)。此 kimi 检查点标记为需要人工安装。`,
197
- `2) 在 Kimi Code 中运行: /plugins install ${installUrl}(锁定到冻结 ref "${ref}",版本 ${version})。确认插件 "${plugin}" 的信任提示,然后运行 /plugins reload(或 /new)。`,
205
+ `2) ${requiresInstalledClosure ? `以 KIMI_CODE_HOME="${resolve(managedRoot, '..', '..')}" 启动 Kimi Code,然后` : '在 Kimi Code 中'}运行: /plugins install ${installUrl}(锁定到冻结 ref "${ref}",版本 ${version})。确认插件 "${plugin}" 的信任提示,然后运行 /plugins reload(或 /new)。`,
198
206
  `3) 将人工结果 JSON 写入: ${attestationDir}/${KIMI_ATTESTATION_FILE}`,
199
- ` 必填字段: platform="kimi", version, planDigest(冻结计划摘要), result("passed" 或 "failed"), actor(确认人), confirmedAt(ISO 8601 时间戳)`,
207
+ ` 必填字段: platform="kimi", version, planDigest(冻结计划摘要), result("passed" 或 "failed"), actor(确认人), confirmedAt(ISO 8601 时间戳)${requiresInstalledClosure ? ',installPath(实际安装后的插件目录,必须位于该证明目录的 kimi-home/plugins/managed/ 内)' : ''}`,
200
208
  ` 可选字段: note(备注)`,
201
209
  `4) 运行 release-skill reconcile(对账远端状态并跳过已完成步骤),然后 release-skill verify(从同一个计划摘要索引的权威目录读取结果,成功后 -> VERIFIED)。`,
202
210
  ];
@@ -438,12 +446,18 @@ export async function executeKimiManualRequirement(action, context) {
438
446
  });
439
447
  }
440
448
 
449
+ const requiresInstalledClosure = Boolean(context.plan?.skillResourceClosure);
450
+ const managedRoot = requiresInstalledClosure
451
+ ? resolve(attestationDir, 'kimi-home', 'plugins', 'managed')
452
+ : null;
441
453
  const instructions = buildKimiManualInstructions({
442
454
  installUrl,
443
455
  plugin: action.plugin,
444
456
  version: action.version,
445
457
  ref,
446
458
  attestationDir,
459
+ requiresInstalledClosure,
460
+ managedRoot,
447
461
  });
448
462
 
449
463
  // 统一 requirement 结构:不再包含隔离目录信息
@@ -466,6 +480,9 @@ export async function executeKimiManualRequirement(action, context) {
466
480
  result: '<"passed" or "failed">',
467
481
  actor: '<person who confirmed the install>',
468
482
  confirmedAt: '<ISO 8601 timestamp>',
483
+ ...(requiresInstalledClosure
484
+ ? { installPath: resolve(managedRoot, action.plugin) }
485
+ : {}),
469
486
  note: '<optional note>',
470
487
  },
471
488
  instructions,
@@ -486,11 +503,21 @@ export async function executeKimiManualRequirement(action, context) {
486
503
  }
487
504
  }
488
505
 
489
- // New manual format: execute only writes the requirement file.
490
- // The managed home directory (kimi-home/plugins/managed) is NOT created here.
491
- // Only old-format attestations with installPath trigger managed home verification
492
- // in the observe path. Creating it unconditionally would violate the invariant
493
- // that new-format receipts do not create isolated installation artifacts.
506
+ // New closure plans must scan an actual installed consumer tree. Create only
507
+ // the isolated KIMI_CODE_HOME container; the interactive host remains the
508
+ // sole owner of managed/<plugin>. Legacy plans retain the previous no-home
509
+ // behavior byte-for-byte.
510
+ if (requiresInstalledClosure) {
511
+ try {
512
+ await mkdir(managedRoot, { recursive: true, mode: 0o700 });
513
+ } catch (mkdirErr) {
514
+ return createResult({
515
+ actionType,
516
+ status: ActionStatus.EXECUTE_FAILED,
517
+ error: `cannot create kimi resource-closure managed root: ${mkdirErr.message}`,
518
+ });
519
+ }
520
+ }
494
521
 
495
522
  // Idempotent requirement write: an identical existing requirement is left
496
523
  // untouched; a divergent existing requirement fails closed (never silently