@coda-console/plugin-check 0.5.18 → 0.5.20

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.
@@ -1365,14 +1365,14 @@
1365
1365
  "id": "review",
1366
1366
  "displayName": "PR 生命流程",
1367
1367
  "description": "会话开的 PR 从开出来起一条流程:每个新版本先跑项目声明的检查,再请另一家 Agent 评审,要求修改时交给开 PR 的会话处理、有分歧时交给你仲裁;通过后请你批准合并,跑过项目的合并前检查再合并,合并后按你的选择删除远程分支、调用项目的部署和发布流程,PR 合并或关闭时结束。",
1368
- "version": "2.8.1",
1368
+ "version": "2.9.0",
1369
1369
  "category": "工作流程",
1370
1370
  "source": {
1371
1371
  "kind": "builtin",
1372
1372
  "package": "@coda-console/review",
1373
1373
  "tag": "latest",
1374
- "version": "2.8.1",
1375
- "integrity": "sha512-E66oq5q8uSHo/n5LFHdUuFMimLYJ15hbBae3PdBol/N6ccR0m9OQXcztvNyEVywlppvJYh+o4w+b0b5vdEQ2SQ==",
1374
+ "version": "2.9.0",
1375
+ "integrity": "sha512-lFc7bipZ48OBkVU2Eknfsq4BNFshE2FgfE+oLZn/HsNsbMHPldyXepLJQTs6aW03cl7KUdMWTn+BkoDz8VwMiw==",
1376
1376
  "repo": "https://github.com/coda-console/coda-plugins.git",
1377
1377
  "path": "plugins/review"
1378
1378
  },
@@ -1479,6 +1479,43 @@
1479
1479
  "title": "合并方式",
1480
1480
  "order": 5,
1481
1481
  "default": "squash"
1482
+ },
1483
+ "review.mergeOptions": {
1484
+ "type": "array",
1485
+ "description": "合并卡片初始勾选这些选项,直接点「合并」也按此执行。每次合并前可以调整;目录可以覆盖,且只显示该目录可用的选项。",
1486
+ "title": "合并时默认勾选",
1487
+ "order": 6,
1488
+ "options": [
1489
+ {
1490
+ "value": "deleteBranch",
1491
+ "title": "合并后删除远程分支",
1492
+ "description": "删除这个 PR 的远程源分支,本地分支和工作树保留"
1493
+ },
1494
+ {
1495
+ "value": "deploy",
1496
+ "title": "部署",
1497
+ "description": "调用项目里的部署流程",
1498
+ "workflowKind": "deploy"
1499
+ },
1500
+ {
1501
+ "value": "preview",
1502
+ "title": "发布预览版",
1503
+ "description": "调用项目里的预览发布流程",
1504
+ "workflowKind": "preview"
1505
+ },
1506
+ {
1507
+ "value": "release",
1508
+ "title": "发布正式版",
1509
+ "description": "调用项目里的正式发布流程",
1510
+ "workflowKind": "release"
1511
+ },
1512
+ {
1513
+ "value": "notify",
1514
+ "title": "全部完成后通知 Agent",
1515
+ "description": "合并及所选删除分支、部署、发布结束后通知"
1516
+ }
1517
+ ],
1518
+ "default": []
1482
1519
  }
1483
1520
  },
1484
1521
  "workflows": [
@@ -4,7 +4,7 @@
4
4
  // is the extended plugin's own contract, which Coda neither reads nor shapes. A point may instead take what any plugin
5
5
  // writes under a key of its `contributes` (`contributes` there, as the resources plugin's `panels`): of the schema the point
6
6
  // declares, kept as written, for the declaring plugin to read, only the commands in it listed where installing confirms them.
7
- import { pointProblem } from '@coda-console/protocol/validate';
7
+ import { pointProblem, valueProblem } from '@coda-console/protocol/validate';
8
8
  import { requireCondition as check } from '../../domain/errors.mjs';
9
9
 
10
10
  const code = 'invalid_plugin';
@@ -80,6 +80,25 @@ export function withDependencies(catalog, id) {
80
80
  visit(id);
81
81
  return order;
82
82
  }
83
+ // A channel restriction is the target backend's, never the client's. An unknown channel cannot satisfy an explicit list.
84
+ // The store reads registry metadata; installation reads the package itself. Both use the same schema and rule.
85
+ export function pluginChannelProblem(plugin, channel) {
86
+ if (plugin.coda === undefined) return null;
87
+ const problem = valueProblem('plugin.json#/properties/coda', plugin.coda, 'coda');
88
+ if (problem) return problem;
89
+ const channels = plugin.coda.channels;
90
+ if (!channels || channels.includes(channel)) return null;
91
+ const names = channels.map(value => value === 'preview' ? '预览版' : '正式版').join('或');
92
+ return `此插件仅支持 Coda ${names}后端${channel ? '' : ',当前后端没有发布通道记录'}`;
93
+ }
94
+ // The same dependency closure used by installation, after resolving each dependency to its actual local or source version.
95
+ export function catalogChannelProblem(catalog, id, channel) {
96
+ for (const each of withDependencies(catalog, id)) {
97
+ const plugin = catalog.get(each), problem = plugin && pluginChannelProblem(plugin, channel);
98
+ if (problem) return each === id ? problem : `${each}:${problem}`;
99
+ }
100
+ return null;
101
+ }
83
102
  // The installed plugins that need this one, directly or through another, by ID.
84
103
  export function dependents(catalog, installed, id) {
85
104
  const found = new Set();
@@ -132,6 +132,7 @@ export function readPlugin(dir, source) {
132
132
  const offers = Object.fromEntries(Object.entries(contributes).filter(([key]) => !TYPES.includes(key)));
133
133
  return { id, displayName, description: typeof manifest.description === 'string' ? manifest.description : '', version: String(manifest.version ?? ''),
134
134
  category: manifestCategory(manifest), source, dir, title: typeof configuration.title === 'string' ? configuration.title : displayName, properties,
135
+ ...(manifest.coda !== undefined ? { coda: manifest.coda } : {}),
135
136
  ...(manifest.main ? { main: posix.normalize(manifest.main) } : {}), ...(activation.includes('onStartupFinished') ? { startup: true } : {}),
136
137
  ...(required.length ? { required: [...required] } : {}), workflows: files('.coda/workflows'),
137
138
  capabilities: [...(contributes.capabilities ?? [])].sort(), services: [...(contributes.services ?? [])],
@@ -7,7 +7,7 @@
7
7
  import { createHash } from 'node:crypto';
8
8
  import { normalize } from 'node:path';
9
9
  import { requireCondition as check } from '../../domain/errors.mjs';
10
- import { offerPoint, offeredCommands, offerProblem, withDependencies } from './plugin-extensions.mjs';
10
+ import { catalogChannelProblem, offerPoint, offeredCommands, offerProblem, withDependencies } from './plugin-extensions.mjs';
11
11
 
12
12
  export const COMMIT = /^[0-9a-f]{40}$/;
13
13
  const ID = /^[a-z][a-z0-9-]{0,39}$/;
@@ -168,7 +168,7 @@ export function npmManifest(id, own, skills) {
168
168
  }
169
169
  if (!Object.keys(contributes).length) return { problem: '这个 npm 包读不成插件:package.json 没有 contributes,没有 Skill 目录,也不是写了 mcpName 的 MCP 服务器' };
170
170
  return { manifest: { name: id, displayName: own.name, description: typeof own.description === 'string' ? own.description.slice(0, 500) : '',
171
- version: String(own.version ?? ''), contributes } };
171
+ version: String(own.version ?? ''), ...(own.coda !== undefined ? { coda: own.coda } : {}), contributes } };
172
172
  }
173
173
  // The packages npm installs for a package from npm, by name with the range it asks for: its dependencies are not pinned
174
174
  // (docs/plugins.md「从 npm 安装」), unless it brings an `npm-shrinkwrap.json`, whose versions they then are. Among them the
@@ -352,7 +352,7 @@ export const manifestId = manifest => manifest?.id ?? manifest?.name;
352
352
  // rows, the built-in plugins): what it is, the one of its ID installed here, why it cannot be installed, what comes along
353
353
  // with it (`siblings`: the other plugins of the same commit, by ID) and what it brings. `manifest`: what is known of it
354
354
  // when it does not read as a plugin, its ID `fallback` without a name.
355
- export function candidate({ path, manifest, plugin, problem, fallback }, { catalog, installed, builtin }, siblings) {
355
+ export function candidate({ path, manifest, plugin, problem, fallback }, { catalog, installed, builtin, channel }, siblings) {
356
356
  const id = plugin?.id ?? (typeof manifestId(manifest) === 'string' ? manifestId(manifest) : fallback);
357
357
  const row = installed.get(id), along = plugin ? together(plugin, { catalog, installed, siblings }) : [];
358
358
  const missing = along.filter(each => each.from === 'missing').map(each => each.id);
@@ -361,7 +361,7 @@ export function candidate({ path, manifest, plugin, problem, fallback }, { catal
361
361
  return { path, id, displayName: plugin?.displayName ?? (typeof manifest?.displayName === 'string' ? manifest.displayName : id),
362
362
  description: plugin?.description ?? (typeof manifest?.description === 'string' ? manifest.description : ''), version: plugin?.version ?? '',
363
363
  installed: row ? row.source ?? builtin.get(id)?.source ?? { kind: 'builtin' } : null,
364
- problem: problem ?? (plugin ? catalogProblem(plugin, catalog, builtin, installed) ?? offerProblem(plugin, after) : null)
364
+ problem: problem ?? (plugin ? catalogChannelProblem(after, id, channel) ?? catalogProblem(plugin, catalog, builtin, installed) ?? offerProblem(plugin, after) : null)
365
365
  ?? (missing.length ? `要一起装的 ${missing.join('、')} 不在这台机器上${plugin.source?.kind === 'npm' ? '' : ',也不在这个提交里'}` : null),
366
366
  together: along.filter(each => each.from !== 'missing'),
367
367
  ...(plugin ? { contributes: contributions(plugin, after) } : {}) };
@@ -1,16 +1,16 @@
1
1
  {
2
- "commit": "7a6850681534da5b80d166865fbc2f5ba356b3b6",
2
+ "commit": "8305da8be0fd3109785e00d3acbb3e24de852a78",
3
3
  "packages": {
4
4
  "@0dep/piso": "5.2.0",
5
5
  "@agentclientprotocol/sdk": "1.4.0",
6
- "@coda-console/protocol": "1.4.0",
6
+ "@coda-console/protocol": "1.5.0",
7
7
  "yaml": "2.9.1"
8
8
  },
9
9
  "files": {
10
10
  "check/coda/components/plugins/agent-plugins.mjs": "d117702f83c988aa89c2e5ae26aafd6ae3e8ba0829adaeedf9e8640f5f8282be",
11
- "check/coda/components/plugins/plugin-extensions.mjs": "91badae3de3c5a015d83d425def2593ffcd451576fb5f07309888f09d3157b52",
12
- "check/coda/components/plugins/plugin-rules.mjs": "eb4ba82ea871c03116a4edfe84ef6e423d15a17bcd66c56e732af6255f9624dd",
13
- "check/coda/components/plugins/plugin-source-rules.mjs": "4eedfd024c0824b1fed78be106f1a2827ffc3dd35ac0c69b8b0c61a59af42efd",
11
+ "check/coda/components/plugins/plugin-extensions.mjs": "4d7963185195ba6d21a4e49a66987613d5892210b1eb1dc02cffb7b816407776",
12
+ "check/coda/components/plugins/plugin-rules.mjs": "bf2eecafaf3a3c3a8b4719c3252db30a582fce5f11946926cd6a2bc03920c702",
13
+ "check/coda/components/plugins/plugin-source-rules.mjs": "d894d55a3272df5ef3b108b68820c64aefdf6b69346404b58954f2a3503cb4a5",
14
14
  "check/coda/components/plugins/skill-document.mjs": "c5b5e815c42cd836572f7b60e22a46af6ac607fd9df0170fa36f955825636ce6",
15
15
  "check/coda/components/prompt-recovery/prompt-recovery.mjs": "f43f21d24c19a58113d3304f9248225b12080ab00ed15eab74bf7b94642732de",
16
16
  "check/coda/components/session-config/commands.mjs": "be07377c153f812a648deb60f023269c1f0a49b91cf2e4516f05b7eac09c28de",
@@ -24,6 +24,6 @@
24
24
  "check/coda/resources/plugins/resources/panels/panels.mjs": "9e25cfbc16ed9f68101fc7bfc34b8056c13a29d2368c5561e65e333233eb921e",
25
25
  "check/coda/resources/plugins/resources/panels/rules.mjs": "8418ed83b796f18047c154d8dea8dca7d98244af8ddfe3ddf188520c59324ee8",
26
26
  "check/coda/resources/plugins/resources/panels/sign-in.mjs": "1271a24e33b1b882a1fb9bee03b8e240db8b9bee1b5208f0e1c84499cfb1be7e",
27
- "check/coda/builtin.json": "65375d1d8bd394ff5ffb6c3f803b53dffa3c9e17bfdc35b44daefd5dcf9e1790"
27
+ "check/coda/builtin.json": "33ef1ee3612117b0684484ab819dd9afbe4bd7d43f4b391b925f3018e0192e20"
28
28
  }
29
29
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coda-console/plugin-check",
3
- "version": "0.5.18",
3
+ "version": "0.5.20",
4
4
  "description": "Coda 插件的契约检查:扮演 Coda 读清单、启动 Agent 讲 ACP 与 _coda/wait、读面板。",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -24,7 +24,7 @@
24
24
  "dependencies": {
25
25
  "@0dep/piso": "5.2.0",
26
26
  "@agentclientprotocol/sdk": "1.4.0",
27
- "@coda-console/protocol": "1.4.0",
27
+ "@coda-console/protocol": "1.5.0",
28
28
  "ajv": "8.20.0",
29
29
  "yaml": "2.9.1"
30
30
  },