release-skill 0.9.7 → 0.9.9

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 (34) hide show
  1. package/.agents/plugins/marketplace.json +9 -0
  2. package/.claude-plugin/marketplace.json +11 -1
  3. package/.claude-plugin/plugin.json +1 -1
  4. package/.codebuddy-plugin/plugin.json +1 -1
  5. package/.codex-plugin/plugin.json +2 -2
  6. package/.kimi-plugin/plugin.json +1 -1
  7. package/CHANGELOG.md +52 -0
  8. package/INSTALL.md +17 -9
  9. package/INSTALL.zh-CN.md +15 -9
  10. package/README.md +31 -28
  11. package/README.zh-CN.md +26 -26
  12. package/adapters/claude/.claude-plugin/marketplace.json +1 -1
  13. package/adapters/claude/.claude-plugin/plugin.json +1 -1
  14. package/adapters/claude/bin/release-skill.bundle.mjs +298 -45
  15. package/adapters/claude/skills/release-finish/SKILL.md +12 -4
  16. package/adapters/codex/.codex-plugin/plugin.json +2 -2
  17. package/adapters/codex/bin/release-skill.bundle.mjs +298 -45
  18. package/adapters/codex/skills/release-finish/SKILL.md +12 -4
  19. package/adapters/kimi/.kimi-plugin/plugin.json +1 -1
  20. package/adapters/kimi/bin/release-skill.bundle.mjs +298 -45
  21. package/adapters/kimi/skills/release-finish/SKILL.md +12 -4
  22. package/adapters/workbuddy/.codebuddy-plugin/plugin.json +1 -1
  23. package/adapters/workbuddy/bin/release-skill.bundle.mjs +298 -45
  24. package/adapters/workbuddy/skills/release-finish/SKILL.md +12 -4
  25. package/bin/release-skill.bundle.mjs +298 -45
  26. package/package.json +1 -1
  27. package/platform-manifest.json +4 -4
  28. package/skills/release-finish/SKILL.md +12 -4
  29. package/skills-src/release-finish/SKILL.md +12 -4
  30. package/src/commands/post-release-local.mjs +292 -39
  31. package/src/commands/ship.mjs +4 -6
  32. package/src/commands/verify.mjs +8 -8
  33. package/src/core/postpublish.mjs +24 -0
  34. package/src/core/recovery.mjs +8 -6
@@ -9,9 +9,9 @@ const __bundlePkgRoot = __bundleResolve(__bundleDirname(__bundleFileURLToPath(im
9
9
  // Provide a real require() for CJS packages bundled into ESM (e.g. yaml, ajv).
10
10
  const __bundleRealRequire = __bundleCreateRequire(import.meta.url);
11
11
  // Package identity injected at build time — closure-independent --version probe.
12
- const __bundlePkg = Object.freeze({"name":"release-skill","version":"0.9.7"});
12
+ const __bundlePkg = Object.freeze({"name":"release-skill","version":"0.9.9"});
13
13
  // Build-time source digest for the BUNDLE_STALE freshness gate (see above).
14
- const __bundleSourceDigest = "938bc6828f17e2248a4fe167bcd3353b43848ec1a494dc17dc663d390847150c";
14
+ const __bundleSourceDigest = "ef2ec274a982afcf48acdbccdf32439d199dd1d79b4a39b1aeaef23195fadbfb";
15
15
 
16
16
  var __create = Object.create;
17
17
  var __defProp = Object.defineProperty;
@@ -45592,6 +45592,9 @@ function normalizePostPublishView(plan) {
45592
45592
  { planVersion: version }
45593
45593
  );
45594
45594
  }
45595
+ function requiresPostPublishDistribution(plan) {
45596
+ return normalizePostPublishView(plan).some((declaration) => (declaration.targets?.length ?? 0) > 0 || (declaration.hooks ?? []).some((hook) => hook.phase === void 0 || hook.phase === "distribute"));
45597
+ }
45595
45598
  function validatePostPublishHookIdUniqueness(declarations) {
45596
45599
  const explicitHookIdOwner = /* @__PURE__ */ new Map();
45597
45600
  for (const declaration of declarations ?? []) {
@@ -45759,6 +45762,7 @@ var init_postpublish = __esm({
45759
45762
  __name(validatePostPublishHookEntry, "validatePostPublishHookEntry");
45760
45763
  __name(validatePostPublishDeclaration, "validatePostPublishDeclaration");
45761
45764
  __name(normalizePostPublishView, "normalizePostPublishView");
45765
+ __name(requiresPostPublishDistribution, "requiresPostPublishDistribution");
45762
45766
  __name(validatePostPublishHookIdUniqueness, "validatePostPublishHookIdUniqueness");
45763
45767
  __name(postPublishActionId, "postPublishActionId");
45764
45768
  __name(orderTargetsByDependency, "orderTargetsByDependency");
@@ -113357,8 +113361,7 @@ async function verifyRelease(options) {
113357
113361
  { sourceRunStatus: sourceRun.status }
113358
113362
  );
113359
113363
  }
113360
- const postPublishDeclarations = normalizePostPublishView(plan);
113361
- const requiresDistribution = postPublishDeclarations.some((declaration) => (declaration.targets?.length ?? 0) > 0 || (declaration.hooks?.length ?? 0) > 0);
113364
+ const requiresDistribution = requiresPostPublishDistribution(plan);
113362
113365
  if (requiresDistribution) {
113363
113366
  await evidence.append({ phase: "verify", step: "distribute-run-discovery", status: "started" });
113364
113367
  const distributeCandidates = await discoverDistributeRuns({ planPath, plan }) ?? [];
@@ -114547,7 +114550,7 @@ async function readRunRecovery(runPath, options = {}) {
114547
114550
  }
114548
114551
  } else if (["publish", "reconcile"].includes(command2)) {
114549
114552
  if (run6.status === "PUBLISHED") {
114550
- const needsDistribution = normalizePostPublishView(plan).some((declaration) => (declaration.targets?.length ?? 0) > 0 || (declaration.hooks?.length ?? 0) > 0);
114553
+ const needsDistribution = requiresPostPublishDistribution(plan);
114551
114554
  code = needsDistribution ? "DISTRIBUTE" : "VERIFY";
114552
114555
  } else if (run6.status === "PARTIAL") {
114553
114556
  code = "RECONCILE";
@@ -131814,7 +131817,7 @@ function hostEnvironment(host, { kimiHome } = {}) {
131814
131817
  env.CODEBUDDY_CONFIG_DIR = join27(env.HOME, ".workbuddy");
131815
131818
  env.WORKBUDDY_CONFIG_DIR = join27(env.HOME, ".workbuddy");
131816
131819
  }
131817
- if (host === "kimi" && kimiHome) env.KIMI_CONFIG_DIR = kimiHome;
131820
+ if (host === "kimi" && kimiHome) env.KIMI_CODE_HOME = kimiHome;
131818
131821
  return env;
131819
131822
  }
131820
131823
  async function defaultRun(command2, args2, options = {}) {
@@ -131991,6 +131994,64 @@ function exactPluginObservation(target, stdout) {
131991
131994
  function normalizeGitSource(source) {
131992
131995
  return String(source ?? "").replace(/^git\+/, "").replace(/^https:\/\/github\.com\//, "").replace(/^git@github\.com:/, "").replace(/\.git$/u, "").replace(/\/$/u, "");
131993
131996
  }
131997
+ function parseFrozenRemoteRef(target, stdout) {
131998
+ const directRefs = /* @__PURE__ */ new Map();
131999
+ const peeledRefs = /* @__PURE__ */ new Map();
132000
+ const expected = target.marketplaceRef;
132001
+ const allowedDirect = expected.startsWith("refs/") ? /* @__PURE__ */ new Set([expected]) : /* @__PURE__ */ new Set([`refs/heads/${expected}`, `refs/tags/${expected}`]);
132002
+ for (const line of String(stdout ?? "").split(/\r?\n/u)) {
132003
+ if (line.length === 0) continue;
132004
+ const match = /^([a-f0-9]{40})\t([^\s]+)$/u.exec(line);
132005
+ if (!match) throw new Error("git ls-remote returned an invalid line");
132006
+ const [, commit, remoteRef] = match;
132007
+ const peeled = remoteRef.endsWith("^{}");
132008
+ const direct = peeled ? remoteRef.slice(0, -3) : remoteRef;
132009
+ if (!allowedDirect.has(direct)) {
132010
+ throw new Error(`git ls-remote returned an unexpected ref ${remoteRef}`);
132011
+ }
132012
+ const destination = peeled ? peeledRefs : directRefs;
132013
+ const previous = destination.get(direct);
132014
+ if (previous && previous !== commit) {
132015
+ throw new Error(`git ls-remote returned conflicting values for ${remoteRef}`);
132016
+ }
132017
+ destination.set(direct, commit);
132018
+ }
132019
+ const resolved = [...allowedDirect].filter((remoteRef) => directRefs.has(remoteRef) || peeledRefs.has(remoteRef)).map((remoteRef) => peeledRefs.get(remoteRef) ?? directRefs.get(remoteRef));
132020
+ return {
132021
+ found: resolved.length > 0,
132022
+ exact: resolved.length > 0 && resolved.every((commit) => commit === target.marketplaceCommit)
132023
+ };
132024
+ }
132025
+ async function preflightStructuredMarketplace(target, env, run6) {
132026
+ try {
132027
+ const observed = await run6("git", [
132028
+ "ls-remote",
132029
+ "--exit-code",
132030
+ `https://${target.githubHost}/${target.marketplaceRepo}.git`,
132031
+ target.marketplaceRef,
132032
+ `${target.marketplaceRef}^{}`
132033
+ ], { env, timeout: 3e4 });
132034
+ const remote = parseFrozenRemoteRef(target, observed.stdout);
132035
+ if (!remote.found) {
132036
+ return {
132037
+ ok: false,
132038
+ reason: `${target.host} frozen marketplace ref ${target.marketplaceRef} is missing`
132039
+ };
132040
+ }
132041
+ if (!remote.exact) {
132042
+ return {
132043
+ ok: false,
132044
+ reason: `${target.host} frozen marketplace ref ${target.marketplaceRef} does not resolve to ${target.marketplaceCommit}`
132045
+ };
132046
+ }
132047
+ return { ok: true };
132048
+ } catch (error) {
132049
+ return {
132050
+ ok: false,
132051
+ reason: `${target.host} could not prove the frozen marketplace ref: ${error?.message ?? String(error)}`
132052
+ };
132053
+ }
132054
+ }
131994
132055
  async function observeMarketplace(target, command2, env, run6) {
131995
132056
  const listed = await run6(command2, ["plugin", "marketplace", "list", "--json"], { env });
131996
132057
  const parsed = parseJson2(listed.stdout, `${target.host} marketplace list`);
@@ -132176,6 +132237,10 @@ async function runStructuredUpdate(target, detected, run6, {
132176
132237
  });
132177
132238
  return { status: "ALREADY_CURRENT", version: target.version };
132178
132239
  }
132240
+ if (!before.marketplace.exact) {
132241
+ const preflight = await preflightStructuredMarketplace(target, env, run6);
132242
+ if (!preflight.ok) return { status: "MANUAL_REQUIRED", reason: preflight.reason };
132243
+ }
132179
132244
  const marketplaceRebound = await bindStructuredMarketplace(target, command2, env, run6, before);
132180
132245
  const current = target.host === "claude" && marketplaceRebound ? await observeStructuredTarget(target, command2, env, run6) : before;
132181
132246
  const platform = getPlatform(target.host);
@@ -132229,48 +132294,222 @@ function parseCodeBuddyRemoteObservation(target, stdout) {
132229
132294
  };
132230
132295
  }
132231
132296
  function kimiExpectProgram({ removePlugin } = {}) {
132232
- const removeCommand = removePlugin ? `send -- "/plugins remove $removePlugin\\r"
132297
+ const removeCommand = removePlugin ? `submitCommand "/plugins remove $removePlugin"
132233
132298
  expect {
132234
132299
  -nocase -re {(remove|delete|uninstall).*(confirm|sure)|(confirm|sure).*(remove|delete|uninstall)} {
132235
132300
  expect {
132236
- -ex $removePlugin { send -- "\\033\\[B\\r" }
132237
- timeout { exit 95 }
132238
- eof { exit 96 }
132301
+ -ex $removePlugin {
132302
+ send -- "\\033\\[B"
132303
+ send -- "\\033\\[13u"
132304
+ }
132305
+ timeout { failTimeout remove-confirmation 125 127 }
132306
+ eof { failEof remove-confirmation 126 }
132307
+ }
132308
+ expect {
132309
+ -nocase -re {Trust this folder\\?} { directoryTrust }
132310
+ -re $promptPattern {}
132311
+ timeout { failTimeout remove-prompt 128 130 }
132312
+ eof { failEof remove-prompt 129 }
132239
132313
  }
132240
- expect -re $promptPattern
132241
132314
  }
132242
132315
  -re $promptPattern {}
132243
- timeout { exit 93 }
132244
- eof { exit 94 }
132316
+ -nocase -re {Trust this folder\\?} { directoryTrust }
132317
+ timeout { failTimeout remove-dialog 122 124 }
132318
+ eof { failEof remove-dialog 123 }
132245
132319
  }
132246
132320
  ` : "";
132247
- return `set timeout 180
132248
- foreach variable {RELEASE_SKILL_KIMI_COMMAND RELEASE_SKILL_KIMI_INSTALL_URL RELEASE_SKILL_KIMI_REMOVE_PLUGIN} {
132321
+ return `set timeout 240
132322
+ foreach variable {RELEASE_SKILL_KIMI_COMMAND RELEASE_SKILL_KIMI_INSTALL_URL RELEASE_SKILL_KIMI_REMOVE_PLUGIN RELEASE_SKILL_KIMI_EXPECTED_REPO RELEASE_SKILL_KIMI_EXPECTED_TAG} {
132249
132323
  if {![info exists env($variable)]} { exit 90 }
132250
132324
  }
132251
132325
  set kimiCommand $env(RELEASE_SKILL_KIMI_COMMAND)
132252
132326
  set installUrl $env(RELEASE_SKILL_KIMI_INSTALL_URL)
132253
132327
  set removePlugin $env(RELEASE_SKILL_KIMI_REMOVE_PLUGIN)
132254
- set promptPattern {(?:(?:^|\\r|\\n)> |(?:^|\\r|\\n)(?:\\033\\[[0-9;?]*[ -/]*[@-~])*\u2502[ \\t]*>[ \\t]*\u2502(?:\\033\\[[0-9;?]*[ -/]*[@-~])*)(?![^\\n]|\\n)}
132328
+ set expectedRepo $env(RELEASE_SKILL_KIMI_EXPECTED_REPO)
132329
+ set expectedTag $env(RELEASE_SKILL_KIMI_EXPECTED_TAG)
132330
+ set promptPattern {(?:(?:^|\\r|\\n)> (?:\\r*\\n|$)|(?:^|\\r|\\n)(?:(?:\\033\\[[0-9;?]*[ -/]*[@-~])|\\033\\][^\\x07]*\\x07|[ \\t])*\u2502[^\\r\\n]*>[^\\r\\n]*\u2502(?:(?:\\033\\[[0-9;?]*[ -/]*[@-~])|\\033\\][^\\x07]*\\x07|[ \\t])*(?:\\r*\\n|$))}
132331
+
132332
+ proc cleanScreen {value} {
132333
+ regsub -all {\\033\\[[0-9;?]*[ -/]*[@-~]} $value {} value
132334
+ regsub -all {\\033\\][^\\x07]*\\x07} $value {} value
132335
+ regsub -all {\\r} $value {} value
132336
+ return $value
132337
+ }
132338
+
132339
+ proc compactScreen {value} {
132340
+ set value [cleanScreen $value]
132341
+ regsub -all {[[:space:]]+} $value {} value
132342
+ return $value
132343
+ }
132344
+
132345
+ proc extractPluginTrustDialog {value} {
132346
+ set cleaned [cleanScreen $value]
132347
+ set lowered [string tolower $cleaned]
132348
+ set dialogStart -1
132349
+ foreach marker {"install third-party plugin " "trust and install from "} {
132350
+ set markerStart [string last $marker $lowered]
132351
+ if {$markerStart > $dialogStart} { set dialogStart $markerStart }
132352
+ }
132353
+ if {$dialogStart < 0} { return "" }
132354
+ return [string range $cleaned $dialogStart end]
132355
+ }
132356
+
132357
+ proc extractPluginTrustIdentity {value} {
132358
+ set cleaned [cleanScreen $value]
132359
+ set lowered [string tolower $cleaned]
132360
+ set identityStart -1
132361
+ foreach marker {"install third-party plugin " "trust and install from "} {
132362
+ set markerStart [string last $marker $lowered]
132363
+ if {$markerStart >= 0 && $markerStart + [string length $marker] > $identityStart} {
132364
+ set identityStart [expr {$markerStart + [string length $marker]}]
132365
+ }
132366
+ }
132367
+ if {$identityStart < 0} { return "" }
132368
+ set identityEnd [string first "?" $cleaned $identityStart]
132369
+ if {$identityEnd < 0} { return "" }
132370
+ return [string range $cleaned $identityStart [expr {$identityEnd - 1}]]
132371
+ }
132372
+
132373
+ proc failTimeout {state timeoutCode unknownCode} {
132374
+ global expect_out
132375
+ set buffer ""
132376
+ if {[info exists expect_out(buffer)]} { set buffer [string trim [cleanScreen $expect_out(buffer)]] }
132377
+ if {$buffer ne ""} {
132378
+ puts stderr "KIMI_TUI_STATE:$state:unknown"
132379
+ exit $unknownCode
132380
+ }
132381
+ puts stderr "KIMI_TUI_STATE:$state:timeout"
132382
+ exit $timeoutCode
132383
+ }
132384
+
132385
+ proc failEof {state code} {
132386
+ puts stderr "KIMI_TUI_STATE:$state:eof"
132387
+ exit $code
132388
+ }
132389
+
132390
+ proc directoryTrust {} {
132391
+ puts stderr "KIMI_TUI_STATE:directory-trust:manual-required"
132392
+ exit 80
132393
+ }
132394
+
132395
+ proc submitCommand {command} {
132396
+ send -- "\\033\\[200~"
132397
+ send -- $command
132398
+ send -- "\\033\\[201~"
132399
+ send -- "\\033\\[13u"
132400
+ }
132401
+
132255
132402
  spawn $kimiCommand
132256
- expect -re $promptPattern
132257
- ${removeCommand}send -- "/plugins install $installUrl\\r"
132403
+ if {[catch {exec stty columns 240 rows 60 < $spawn_out(slave,name)} resizeError]} {
132404
+ puts stderr "KIMI_TUI_STATE:terminal-size:failed"
132405
+ exit 131
132406
+ }
132258
132407
  expect {
132259
- -nocase -re {trust and install} {
132260
- expect {
132261
- -ex $installUrl { send -- "\\033\\[B\\r" }
132262
- timeout { exit 97 }
132263
- eof { exit 98 }
132408
+ -nocase -re {Trust this folder\\?} { directoryTrust }
132409
+ -re $promptPattern {}
132410
+ timeout { failTimeout initial-prompt 101 103 }
132411
+ eof { failEof initial-prompt 102 }
132412
+ }
132413
+ ${removeCommand}submitCommand "/plugins install $installUrl"
132414
+ set dialogBuffer ""
132415
+ expect {
132416
+ -nocase -re {Trust this folder\\?} { directoryTrust }
132417
+ -nocase -re {(?:Install third-party plugin|Trust and install from)[ \\t]} {
132418
+ append dialogBuffer $expect_out(buffer)
132419
+ }
132420
+ timeout { failTimeout plugin-trust-anchor 104 106 }
132421
+ eof { failEof plugin-trust-anchor 105 }
132422
+ }
132423
+ expect {
132424
+ -nocase -re {Trust this folder\\?} { directoryTrust }
132425
+ -nocase -re {\u276F[^\\r\\n]*(?:Exit|Cancel|Trust and install)} {
132426
+ append dialogBuffer $expect_out(buffer)
132427
+ }
132428
+ -re {\u276F[^\\r\\n]*\\r*\\n} {
132429
+ puts stderr "KIMI_TUI_STATE:plugin-trust-selected-row:unknown"
132430
+ exit 134
132431
+ }
132432
+ timeout {
132433
+ puts stderr "KIMI_TUI_STATE:plugin-trust-selected-row:timeout"
132434
+ exit 132
132435
+ }
132436
+ eof { failEof plugin-trust-selected-row 133 }
132437
+ }
132438
+
132439
+ set dialog [extractPluginTrustDialog $dialogBuffer]
132440
+ if {$dialog eq ""} {
132441
+ puts stderr "KIMI_TUI_STATE:plugin-trust:dialog-unknown"
132442
+ exit 113
132443
+ }
132444
+ set identity [extractPluginTrustIdentity $dialog]
132445
+ set compactIdentity [compactScreen $identity]
132446
+ if {$identity eq "" || $compactIdentity ne [compactScreen $installUrl]} {
132447
+ set expectedRepoPrefix "[compactScreen $expectedRepo]/releases/tag/"
132448
+ if {[string first $expectedRepoPrefix $compactIdentity] != 0} {
132449
+ puts stderr "KIMI_TUI_STATE:plugin-trust:repo-mismatch"
132450
+ exit 111
132451
+ }
132452
+ puts stderr "KIMI_TUI_STATE:plugin-trust:tag-mismatch"
132453
+ exit 112
132454
+ }
132455
+ if {[regexp -nocase {(^|\\n)[^\\n]*\u276F[^\\n]*trust and install} $dialog]} {
132456
+ send -- "\\033\\[13u"
132457
+ } elseif {[regexp -nocase {(^|\\n)[^\\n]*\u276F[^\\n]*(cancel|exit)} $dialog]} {
132458
+ send -- "\\033\\[B"
132459
+ expect {
132460
+ -nocase -re {Trust this folder\\?} { directoryTrust }
132461
+ -nocase -re {\u276F[^\\r\\n]*Trust and install} {}
132462
+ -re {\u276F[^\\r\\n]*\\r*\\n} {
132463
+ puts stderr "KIMI_TUI_STATE:plugin-trust-confirm-selection:unknown"
132464
+ exit 109
132264
132465
  }
132466
+ timeout { failTimeout plugin-trust-confirm-selection 107 109 }
132467
+ eof { failEof plugin-trust-confirm-selection 108 }
132265
132468
  }
132266
- timeout { exit 91 }
132267
- eof { exit 92 }
132469
+ send -- "\\033\\[13u"
132470
+ } else {
132471
+ puts stderr "KIMI_TUI_STATE:plugin-trust:selection-unknown"
132472
+ exit 113
132473
+ }
132474
+
132475
+ expect {
132476
+ -nocase -re {Trust this folder\\?} { directoryTrust }
132477
+ -nocase -re {Install finished[^\\r\\n]*see details below\\.} {}
132478
+ -nocase -re {Installing plugin from[^\\r\\n]*(?:\\r|\\n)} {
132479
+ exp_continue -continue_timer
132480
+ }
132481
+ -nocase -re {Install failed:[^\\r\\n]*} {
132482
+ puts stderr "KIMI_TUI_STATE:install-result:failed"
132483
+ exit 135
132484
+ }
132485
+ -nocase -re {(^|\\r|\\n)Install[^\\r\\n]*\\r*\\n} {
132486
+ puts stderr "KIMI_TUI_STATE:install-result:unknown"
132487
+ exit 138
132488
+ }
132489
+ timeout {
132490
+ puts stderr "KIMI_TUI_STATE:install-result:timeout"
132491
+ exit 136
132492
+ }
132493
+ eof { failEof install-result 137 }
132494
+ }
132495
+ expect {
132496
+ -nocase -re {Trust this folder\\?} { directoryTrust }
132497
+ -re $promptPattern {}
132498
+ timeout { failTimeout post-install-prompt 114 116 }
132499
+ eof { failEof post-install-prompt 115 }
132500
+ }
132501
+ submitCommand "/reload"
132502
+ expect {
132503
+ -nocase -re {Trust this folder\\?} { directoryTrust }
132504
+ -re $promptPattern {}
132505
+ timeout { failTimeout reload-prompt 117 119 }
132506
+ eof { failEof reload-prompt 118 }
132507
+ }
132508
+ submitCommand "/exit"
132509
+ expect {
132510
+ eof { puts stderr "KIMI_TUI_STATE:exit-eof:eof" }
132511
+ timeout { failTimeout exit-eof 120 121 }
132268
132512
  }
132269
- expect -re $promptPattern
132270
- send -- "/reload\\r"
132271
- expect -re $promptPattern
132272
- send -- "/exit\\r"
132273
- expect eof
132274
132513
  `;
132275
132514
  }
132276
132515
  async function observeKimiTarget(target, kimiHome, run6) {
@@ -132338,7 +132577,7 @@ async function runKimiUpdate(target, detected, run6, kimiHome, {
132338
132577
  });
132339
132578
  return { status: "ALREADY_CURRENT", version: target.version };
132340
132579
  }
132341
- await withTemporaryWorkspace(async (workspace) => {
132580
+ const tuiOutcome = await withTemporaryWorkspace(async (workspace) => {
132342
132581
  const checkout = join27(workspace.root, "plugin");
132343
132582
  await run6("git", [
132344
132583
  "clone",
@@ -132359,18 +132598,31 @@ async function runKimiUpdate(target, detected, run6, kimiHome, {
132359
132598
  }
132360
132599
  const installUrl = `https://github.com/${target.pluginRepo}/releases/tag/${target.pluginTag}`;
132361
132600
  const removePlugin = before.source === "legacy" ? target.plugin : "";
132362
- await run6(detected.expectCommand, ["-c", kimiExpectProgram({
132363
- ...removePlugin ? { removePlugin } : {}
132364
- })], {
132365
- timeout: 24e4,
132366
- env: {
132367
- ...env,
132368
- RELEASE_SKILL_KIMI_COMMAND: detected.command,
132369
- RELEASE_SKILL_KIMI_INSTALL_URL: installUrl,
132370
- RELEASE_SKILL_KIMI_REMOVE_PLUGIN: removePlugin
132601
+ try {
132602
+ await run6(detected.expectCommand, ["-c", kimiExpectProgram({
132603
+ ...removePlugin ? { removePlugin } : {}
132604
+ })], {
132605
+ timeout: Math.max(3e5, target.timeoutMs),
132606
+ env: {
132607
+ ...env,
132608
+ RELEASE_SKILL_KIMI_COMMAND: detected.command,
132609
+ RELEASE_SKILL_KIMI_INSTALL_URL: installUrl,
132610
+ RELEASE_SKILL_KIMI_REMOVE_PLUGIN: removePlugin,
132611
+ RELEASE_SKILL_KIMI_EXPECTED_REPO: `https://github.com/${target.pluginRepo}`,
132612
+ RELEASE_SKILL_KIMI_EXPECTED_TAG: target.pluginTag
132613
+ }
132614
+ });
132615
+ } catch (error) {
132616
+ if (error?.exitStatus === 80) {
132617
+ return {
132618
+ status: "MANUAL_REQUIRED",
132619
+ reason: "Kimi requires folder trust; release-finish did not confirm the folder or continue installation"
132620
+ };
132371
132621
  }
132372
- });
132622
+ throw error;
132623
+ }
132373
132624
  }, { prefix: "release-skill-kimi-update-" });
132625
+ if (tuiOutcome) return tuiOutcome;
132374
132626
  const after = await observeKimiTarget(target, kimiHome, run6);
132375
132627
  if (!after.exact) throw new Error("Kimi did not report the frozen plugin identity after TUI installation");
132376
132628
  await verifyStructuredInstalledPayload({
@@ -132417,7 +132669,7 @@ async function updateLocalHostPluginsInternal({
132417
132669
  kimiHome,
132418
132670
  verifyInstalledPayload = verifyInstalledMarketplacePayload
132419
132671
  } = {}) {
132420
- const effectiveKimiHome = kimiHome ?? process.env.KIMI_CONFIG_DIR ?? join27(homedir(), ".kimi-code");
132672
+ const effectiveKimiHome = kimiHome ?? process.env.KIMI_CODE_HOME ?? join27(homedir(), ".kimi-code");
132421
132673
  const checklist = derivePostReleaseChecklist(plan, { postVerifyComplete: true });
132422
132674
  if (confirmPlanDigest !== plan.digest) {
132423
132675
  throw new Error("plan digest confirmation does not match the frozen release plan");
@@ -132506,7 +132758,7 @@ var init_post_release_local = __esm({
132506
132758
  "NODE_EXTRA_CA_CERTS",
132507
132759
  "CLAUDE_CONFIG_DIR",
132508
132760
  "CODEX_HOME",
132509
- "KIMI_CONFIG_DIR",
132761
+ "KIMI_CODE_HOME",
132510
132762
  "CODEBUDDY_CONFIG_DIR",
132511
132763
  "WORKBUDDY_CONFIG_DIR"
132512
132764
  ]);
@@ -132539,6 +132791,8 @@ var init_post_release_local = __esm({
132539
132791
  __name(observeCodeBuddyMarketplaceAfterResidual, "observeCodeBuddyMarketplaceAfterResidual");
132540
132792
  __name(exactPluginObservation, "exactPluginObservation");
132541
132793
  __name(normalizeGitSource, "normalizeGitSource");
132794
+ __name(parseFrozenRemoteRef, "parseFrozenRemoteRef");
132795
+ __name(preflightStructuredMarketplace, "preflightStructuredMarketplace");
132542
132796
  __name(observeMarketplace, "observeMarketplace");
132543
132797
  __name(observeStructuredTarget, "observeStructuredTarget");
132544
132798
  __name(bindStructuredMarketplace, "bindStructuredMarketplace");
@@ -139872,8 +140126,7 @@ async function advanceShip(options = {}, injected = {}) {
139872
140126
  let postVerifyRanThisCall = false;
139873
140127
  if (state.status === "PUBLISHED" || state.status === "NEEDS_MANUAL_ATTESTATIONS") {
139874
140128
  const plan = JSON.parse(await readFile46(state.planPath, "utf8"));
139875
- const hasDistributeWork = normalizePostPublishView(plan).some((declaration) => (declaration.targets?.length ?? 0) > 0 || (declaration.hooks?.length ?? 0) > 0);
139876
- const needsDistribution = hasDistributeWork;
140129
+ const needsDistribution = requiresPostPublishDistribution(plan);
139877
140130
  if (needsDistribution && deps.distributeRelease) {
139878
140131
  state.status = "DISTRIBUTING";
139879
140132
  await writeJsonAtomic(statePath, state);
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: release-finish
3
- description: 发布达到 VERIFIED 后处理可选的本地收尾:按发布分支策略决定是否询问合并,并在用户确认后更新本机 Claude、Codex、Kimi、CodeBuddy/WorkBuddy 插件
3
+ description: 发布达到 VERIFIED 后处理发布收尾:确认 postVerify 提案送达边界,按发布分支策略决定是否询问合并,并在用户确认后更新本机 Claude、Codex、Kimi、CodeBuddy/WorkBuddy 插件
4
4
  ---
5
5
 
6
6
  # release-finish
@@ -13,7 +13,7 @@ description: 发布达到 VERIFIED 后处理可选的本地收尾:按发布分
13
13
 
14
14
  这是发布后的独立收尾,不属于 `prepare → approve → publish → verify` 状态机。它不能把本机更新结果写成新的发布状态,也不能因为本机更新失败而降低 `VERIFIED`。
15
15
 
16
- 默认只读取冻结计划和 verify 或 postVerify run。没有用户明确同意,不合并分支,不更新插件,不接受 Kimi 的安装信任提示。
16
+ 默认只读取冻结计划和 verify 或 postVerify run。没有用户明确同意,不合并分支,不更新插件。Kimi 只在插件信任界面中的仓库和标签都与冻结目标一致时确认安装;目录信任不自动确认。
17
17
 
18
18
  ## 先生成收尾清单
19
19
 
@@ -37,6 +37,14 @@ node "${CODEBUDDY_PLUGIN_ROOT}/bin/release-skill-local-finish.mjs" \
37
37
  2. `merge.promptRequired=true` 时,向用户说明尚未覆盖的发布分支,并询问是否需要合并。用户同意后,先只读核对源分支、目标分支、工作区状态和项目既有合并方式,再用明确的分支名执行;本脚本不猜分支,也不自动推送。
38
38
  3. `localHostUpdate.promptRequired=true` 时,列出计划覆盖的宿主,询问是否更新本机插件。两个问题可以一次问完。
39
39
 
40
+ ## postVerify 提案送达边界
41
+
42
+ `proposal-inbox` postVerify hook 只负责把冻结提案送到配置的接收端,并在 hook checkpoint 中记录送达结果。送达成功不表示提案已经应用,也不表示接收端完成了渲染或公开同步。
43
+
44
+ 接收端按照自己的 runbook 和治理要求审阅、应用、渲染并公开同步。release-finish 不内置某个接收端的仓库、命令或推送步骤,也不增加另一套收据、账本、Schema、状态机或 hook。
45
+
46
+ 本机宿主是否依赖某个市场,只根据冻结计划记录的真实安装来源判断。提案送达或某个接收端的处理结果不是所有宿主更新的统一前置条件;只有宿主的冻结安装来源确实指向该接收端产物时,才按接收端自己的 runbook 完成必要处理。
47
+
40
48
  ## 用户同意更新本机宿主
41
49
 
42
50
  把用户选择的宿主和清单返回的精确 `planDigest` 传回脚本:
@@ -54,8 +62,8 @@ node "${CODEBUDDY_PLUGIN_ROOT}/bin/release-skill-local-finish.mjs" \
54
62
 
55
63
  只传用户选择且计划声明的宿主。宿主 CLI 不存在时返回 `SKIPPED_NOT_INSTALLED`。各宿主按以下规则处理:
56
64
 
57
- - Claude 先重新绑定冻结市场,再重新观察安装状态;旧插件若仍存在,才调用正式更新命令。Codex 继续按正式市场协议移除并安装冻结的 Git 引用。两者都在安装后核对插件、市场、版本和市场检出提交。
58
- - Kimi 的精确当前安装会在返回 `ALREADY_CURRENT` 前核对真实载荷;发生安装或迁移时,只在操作完成后核对结果。包名、版本、发布标签、已安装修订号和受管安装根必须与冻结计划一致;`.git` 只提供附加诊断,不是通过条件。旧的本地路径安装会在同一个受控终端交互界面(TUI)会话中先移除,再按发布标签安装、确认信任并重新加载。
65
+ - Claude Codex 只有在市场需要重绑时,才会在该宿主第一条写命令之前只读查询冻结的市场仓库、引用和提交。远端不可达、引用缺失或提交不一致时返回 `MANUAL_REQUIRED`,该宿主不执行市场或插件写入;其他已选宿主继续处理。精确当前安装仍核对真实载荷,但不强制联网。
66
+ - Kimi 的精确当前安装会在返回 `ALREADY_CURRENT` 前核对真实载荷;发生安装或迁移时,只在操作完成后核对结果。配置根依次取显式 `kimiHome`、`KIMI_CODE_HOME`、用户主目录下的 `.kimi-code`,TUI 与安装后观察使用同一根。release-finish 当前只采用并验证 Kimi Code 的受控终端交互界面(TUI)路径:清理 ANSI/OSC 控制序列和软换行后,在插件信任对话框内分别核对冻结仓库与标签,确认选中 `Trust and install` 后才提交,再重新加载。出现 `Trust this folder?`、未知界面、超时、提前退出,或无法确认身份和选中项时返回 `MANUAL_REQUIRED` 或失败结果,不确认目录信任,也不继续安装。包名、版本、发布标签、已安装修订号和受管安装根必须与冻结计划一致;`.git` 只提供附加诊断,不是通过条件。旧的本地路径安装会在同一 TUI 会话中先移除,再按发布标签安装。
59
67
  - CodeBuddy/WorkBuddy 只处理同一 bundled-family 插件和市场。CodeBuddy 仅探测全局 `codebuddy`/`cbc`,由收尾脚本把 `CODEBUDDY_CONFIG_DIR` 固定为有效 `HOME`(环境未提供时取操作系统用户主目录)下名为 `.codebuddy` 的目录;WorkBuddy 仅在 macOS 探测 WorkBuddy 应用内嵌 CLI,由收尾脚本把 `CODEBUDDY_CONFIG_DIR` 与 `WORKBUDDY_CONFIG_DIR` 同时固定为有效 `HOME` 下名为 `.workbuddy` 的目录,绝不把两者互作回退。只有冻结标签与计划声明的可变分支都从同一远端解析到冻结提交时,才调用正式市场更新和插件更新命令;完成后重新读取安装列表,并精确核对唯一条目的市场、版本和修订号。目标未安装、来源不符、远端不可访问或身份不一致时返回 `MANUAL_REQUIRED`,不修改宿主。非 macOS 的 WorkBuddy 返回 `SKIPPED_UNSUPPORTED_PLATFORM`。
60
68
 
61
69
  任何宿主失败都保留其他宿主的实际结果,不回滚,也不把失败冒充成功。