@coda-console/plugin-check 0.8.20 → 0.8.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.
Files changed (38) hide show
  1. package/README.md +3 -3
  2. package/check/agent.mjs +2 -1
  3. package/check/coda/adapters/call-limit.mjs +56 -0
  4. package/check/coda/adapters/clock.mjs +48 -0
  5. package/check/coda/adapters/plugin-command.mjs +171 -0
  6. package/check/coda/adapters/plugin-modules.mjs +505 -0
  7. package/check/coda/adapters/plugin-stream-services.mjs +53 -0
  8. package/check/coda/adapters/plugin-test-host.d.mts +316 -0
  9. package/check/coda/adapters/plugin-test-host.mjs +404 -0
  10. package/check/coda/adapters/process-relay.mjs +74 -0
  11. package/check/coda/adapters/provider-api.mjs +147 -40
  12. package/check/coda/application/contributions.mjs +1 -0
  13. package/check/coda/builtin.json +66 -67
  14. package/check/coda/components/composers/schemas.mjs +4 -2
  15. package/check/coda/components/concurrency-groups/schemas.mjs +102 -0
  16. package/check/coda/components/plugins/plugin-extensions.mjs +104 -10
  17. package/check/coda/components/plugins/plugin-rules.mjs +19 -1
  18. package/check/coda/components/plugins/plugin-source-rules.mjs +34 -14
  19. package/check/coda/components/plugins/process-contributions.mjs +9 -0
  20. package/check/coda/components/prompt-recovery/prompt-recovery.mjs +2 -49
  21. package/check/coda/components/protocols/record-rules.mjs +70 -0
  22. package/check/coda/components/protocols/types.mjs +22 -4
  23. package/check/coda/components/workflows/contributions.mjs +2 -6
  24. package/check/coda/contract.json +29 -21
  25. package/check/coda/domain/errors.mjs +5 -1
  26. package/check/coda/domain/resume-prompt.mjs +93 -0
  27. package/check/coda/domain/session-env.mjs +1 -1
  28. package/check/coda/resources/plugins/resources/panels/panels.mjs +26 -17
  29. package/check/coda/resources/plugins/resources/panels/rules.mjs +0 -4
  30. package/check/coda/resources/plugins/resources/panels/sign-in.mjs +32 -41
  31. package/check/manifest.mjs +0 -1
  32. package/check/panel.mjs +6 -5
  33. package/package.json +2 -2
  34. package/check/coda/adapters/admission-api.mjs +0 -22
  35. package/check/coda/components/protocols/creation.mjs +0 -19
  36. package/check/coda/domain/resource-admission.mjs +0 -15
  37. package/check/coda/resources/plugins/resources/panels/command.mjs +0 -46
  38. package/check/command.mjs +0 -48
@@ -4,6 +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 { CORE_PROTOCOLS } from '@coda-console/protocol/protocol';
7
8
  import { pointProblem, valueProblem } from '@coda-console/protocol/validate';
8
9
  import { requireCondition as check } from '../../domain/errors.mjs';
9
10
 
@@ -35,12 +36,15 @@ export function offeredCommands(raw, declared) {
35
36
  return { count: items.length, commands };
36
37
  }
37
38
  // The catalog as a whole: every plugin needed is there, nothing needs itself round about, every point plugged into is
38
- // one its plugin declares, and what is written under a key of `contributes` not Coda's own a point takes.
39
+ // one its plugin declares, what is written under a key of `contributes` not Coda's own a point takes, and every operation a
40
+ // plugin's commands implement is one of its protocol's definition, Coda's own or a plugin's here.
39
41
  export function checkCatalog(plugins) {
40
42
  for (const plugin of plugins.values()) {
41
43
  for (const id of plugin.dependencies) check(plugins.has(id), code, `插件 ${plugin.id} 依赖的 ${id} 不在 Coda 里`);
42
44
  for (const e of plugin.extensions) check(Object.hasOwn(plugins.get(e.plugin).extensionPoints, e.point), code,
43
45
  `插件 ${plugin.id} 接的 ${e.plugin}/${e.point} 不是 ${e.plugin} 声明的扩展点`);
46
+ const operation = operationProblem(plugin, plugins);
47
+ check(!operation, code, operation);
44
48
  const problem = offerProblem(plugin, plugins);
45
49
  check(!problem, code, `插件 ${plugin.id}:${problem}`);
46
50
  }
@@ -55,6 +59,104 @@ export function checkCatalog(plugins) {
55
59
  for (const id of plugins.keys()) visit(id, []);
56
60
  return plugins;
57
61
  }
62
+ // Why an operation a plugin's commands implement is not of its protocol's definition, Coda's own or a plugin's in
63
+ // `plugins` (the catalog beside it), or null.
64
+ export function operationProblem(plugin, plugins) {
65
+ for (const { kind, commands } of plugin.protocolImplementations ?? []) {
66
+ const definition = Object.values(CORE_PROTOCOLS).find(one => one.name === kind)
67
+ ?? [...plugins.values()].flatMap(other => other.protocols ?? []).find(one => one.name === kind);
68
+ const missing = Object.keys(commands).find(operation => !Object.hasOwn(definition?.operations ?? {}, operation));
69
+ if (missing) return `插件 ${plugin.id} 用命令实现的 ${kind} 没有操作 ${missing}`;
70
+ }
71
+ return null;
72
+ }
73
+ // A protocol's definition as this machine has it with `plugins` (the catalog): one of Coda's (namespace coda), a core
74
+ // protocol of the protocol package or one of Coda's own (`defined`: kind → its definition, application/host-protocols.mjs),
75
+ // else the one a plugin of the catalog defines; none without one.
76
+ export function protocolDefinition(kind, plugins, defined) {
77
+ if (kind.startsWith('coda/')) return CORE_PROTOCOLS[kind] ?? defined(kind);
78
+ return [...plugins.values()].flatMap(plugin => plugin.protocols ?? []).find(one => one.name === kind);
79
+ }
80
+ // What of the protocols a plugin uses (docs/plugins.md「用到的权限」) neither its definition in `plugins` (the catalog beside
81
+ // it) nor Coda's (`defined`) has: the protocol (`{ protocol }`), or one of its permission groups (`{ protocol, group }`);
82
+ // null when they have all of it.
83
+ export function usesMissing(plugin, plugins, defined) {
84
+ for (const [kind, groups] of Object.entries(plugin.uses ?? {})) {
85
+ const definition = protocolDefinition(kind, plugins, defined);
86
+ if (!definition) return { protocol: kind };
87
+ const group = groups.find(each => !Object.hasOwn(definition.permissions ?? {}, each));
88
+ if (group) return { protocol: kind, group };
89
+ }
90
+ return null;
91
+ }
92
+ // The first protocol a plugin implements (`protocolImplementations`) that neither it, `plugins` (the catalog beside it) nor
93
+ // Coda (`defined`) defines, as `{ protocol }`; null when all are here.
94
+ export function implementsMissing(plugin, plugins, defined) {
95
+ const found = (plugin.protocolImplementations ?? []).find(({ kind }) => !(plugin.protocols ?? []).some(one => one.name === kind) && !protocolDefinition(kind, plugins, defined));
96
+ return found ? { protocol: found.kind } : null;
97
+ }
98
+ // This Coda's API Level (docs/plugins.md「兼容」): what it offers plugins, counted. A manifest's `engines.coda` names the least
99
+ // a plugin needs; one naming none needs 0, which any Coda has.
100
+ export const API_LEVEL = 1;
101
+ // The API Level a package's registry metadata asks for in its `engines`: a positive integer, or its digits as text (what
102
+ // npm's registry may make of one); undefined when it asks for none, null when it is anything else. A manifest read from
103
+ // its directory has the schema's shape (plugin-rules.mjs readPlugin).
104
+ export function wantedLevel(engines) {
105
+ const value = engines?.coda;
106
+ if (value === undefined) return undefined;
107
+ if (Number.isInteger(value) && value >= 1) return value;
108
+ return typeof value === 'string' && /^[1-9][0-9]{0,8}$/.test(value) ? Number(value) : null;
109
+ }
110
+ // Whether a plugin runs on this machine (docs/plugins.md「兼容」): the one judgment reading a source, installing, the store and
111
+ // the catalog take. Null when it does; else what it needs (`need`), what is missing (`missing`) and why, as the user is
112
+ // told (`error`). `host`: this machine — its API Level (`level`), its backend's channel, the catalog beside the plugin and
113
+ // Coda's own protocols (`defined`, as usesMissing takes them). A Level above this Coda's is Coda's to catch up with
114
+ // (`coda`); short of that, a channel it is not for, or a protocol or permission group it uses or a protocol it implements
115
+ // that is not here, is the plugin's to update (`update`): Coda no longer offers what it was made for.
116
+ export function compatibility(plugin, { catalog = new Map(), defined = () => null, ...here }) {
117
+ const own = ownIncompatibility(plugin, here);
118
+ if (own) return own;
119
+ const used = usesMissing(plugin, catalog, defined), missing = used ?? implementsMissing(plugin, catalog, defined);
120
+ if (!missing) return null;
121
+ const { protocol, group } = missing, coda = protocol.startsWith('coda/');
122
+ const error = group ? (coda ? `本机的 Coda 已不提供 ${protocol} 的权限组 ${group},插件需要更新` : `协议 ${protocol} 已没有权限组 ${group},插件需要更新`)
123
+ : coda ? `本机的 Coda 已不提供协议 ${protocol},插件需要更新` : `${used ? '用到' : '实现'}的协议 ${protocol} 不在这台机器上,也不随它一起装`;
124
+ return { need: 'update', missing, error };
125
+ }
126
+ // What of that a plugin answers by itself, whatever else is here: the API Level it needs, the channels it is for.
127
+ export function ownIncompatibility(plugin, { level = API_LEVEL, channel = null }) {
128
+ const wanted = plugin.engines?.coda ?? 0;
129
+ if (wanted > level) return { need: 'coda', missing: { level: wanted }, error: `这个版本要 Coda API Level ≥ ${wanted}(本机 ${level}),请先升级 Coda` };
130
+ const channelProblem = pluginChannelProblem(plugin, channel);
131
+ return channelProblem ? { need: 'update', missing: { channel }, error: channelProblem } : null;
132
+ }
133
+ // The same for installing `id`, `here` this machine but for the catalog (`catalog`: the catalog once it and what comes along are installed; `installed`: the
134
+ // installed rows by ID): it, and what it needs that this machine has not installed, that one named. Those installed
135
+ // already are the catalog's to judge (components/plugins/plugins.mjs refresh). One needed and nowhere is said missing, not here.
136
+ export function installingIncompatibility(catalog, installed, id, here) {
137
+ for (const each of withDependencies(catalog, id)) {
138
+ if ((each !== id && installed.has(each)) || !catalog.has(each)) continue;
139
+ const found = compatibility(catalog.get(each), { ...here, catalog });
140
+ if (found) return each === id ? found : { ...found, error: `${each}:${found.error}` };
141
+ }
142
+ return null;
143
+ }
144
+ // Why plugin `plugin` (its catalog entry) may not reach kind `kind` as `need` says — an operation of it (`{ operation }`),
145
+ // a stream of its records (`{ stream }`), or reading its records (`'read'`; writing them is the implementer's alone) —
146
+ // `definition` its protocol's (`protocolDefinition`), or null (docs/plugins.md「用到的权限」). The plugin that implements or
147
+ // defines the kind may; any other, a built-in one too, only by a group of the kind's it uses that has the operation or the
148
+ // stream, or reads its records. An operation or a stream in no group is open to no plugin.
149
+ export function usesRefusal(plugin, kind, need, definition) {
150
+ if ((plugin.protocols ?? []).some(one => one.name === kind) || (plugin.protocolImplementations ?? []).some(one => one.kind === kind)) return null;
151
+ const groups = Object.entries(definition?.permissions ?? {}), used = new Set(plugin.uses?.[kind] ?? []);
152
+ const covers = ([, group]) => typeof need === 'string' ? group[need] === true
153
+ : need.stream !== undefined ? (group.streams ?? []).includes(need.stream) : (group.operations ?? []).includes(need.operation);
154
+ if (groups.some(entry => used.has(entry[0]) && covers(entry))) return null;
155
+ const what = typeof need === 'string' ? `读 ${kind} 的记录` : need.stream !== undefined ? `读 ${kind} 的流 ${need.stream}` : `调 ${kind} 的操作 ${need.operation}`;
156
+ const group = groups.find(covers)?.[0];
157
+ return group ? `插件 ${plugin.id} 要${what},须在清单的 uses 里写 ${kind} 的权限组 ${group}`
158
+ : `插件 ${plugin.id} 不能${what}:它不在 ${kind} 的任何权限组里,不对插件开放`;
159
+ }
58
160
  // Why what a plugin writes under the keys of `contributes` not Coda's own cannot be taken here (`plugins`: the catalog
59
161
  // beside it), or null: no point takes one of them, or what it writes is not of the schema the point declares.
60
162
  export function offerProblem(plugin, plugins) {
@@ -81,7 +183,7 @@ export function withDependencies(catalog, id) {
81
183
  return order;
82
184
  }
83
185
  // 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.
186
+ // The store reads registry metadata; installation reads the package itself. Both judge it so (compatibility).
85
187
  export function pluginChannelProblem(plugin, channel) {
86
188
  if (plugin.coda === undefined) return null;
87
189
  const problem = valueProblem('plugin.json#/properties/coda', plugin.coda, 'coda');
@@ -91,14 +193,6 @@ export function pluginChannelProblem(plugin, channel) {
91
193
  const names = channels.map(value => value === 'preview' ? '预览版' : '正式版').join('或');
92
194
  return `此插件仅支持 Coda ${names}后端${channel ? '' : ',当前后端没有发布通道记录'}`;
93
195
  }
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
- }
102
196
  // The installed plugins that need this one, directly or through another, by ID.
103
197
  export function dependents(catalog, installed, id) {
104
198
  const found = new Set();
@@ -131,6 +131,11 @@ export function readPlugin(dir, source, points = CONTRIBUTION_POINTS) {
131
131
  category: manifestCategory(manifest), ...(icon ? { icon } : {}), ...(readmeFile(dir) ? { readme: true } : {}),
132
132
  source, dir, title: typeof configuration.title === 'string' ? configuration.title : displayName, properties,
133
133
  ...(manifest.coda !== undefined ? { coda: manifest.coda } : {}),
134
+ // The API Level it needs (plugin-extensions.mjs compatibility).
135
+ ...(manifest.engines?.coda !== undefined ? { engines: { coda: manifest.engines.coda } } : {}),
136
+ // The permission groups of others' protocols it uses (docs/plugins.md「用到的权限」), by protocol: checked against the
137
+ // catalog it is installed into, and whenever the catalog is read (plugin-extensions.mjs compatibility).
138
+ ...(manifest.uses && Object.keys(manifest.uses).length ? { uses: structuredClone(manifest.uses) } : {}),
134
139
  ...(manifest.main ? { main: posix.normalize(manifest.main) } : {}), ...(activation.includes('onStartupFinished') ? { startup: true } : {}),
135
140
  ...(required.length ? { required: [...required] } : {}), workflows: files('.coda/workflows'),
136
141
  services: [...(contributes.services ?? [])],
@@ -141,7 +146,7 @@ export function readPlugin(dir, source, points = CONTRIBUTION_POINTS) {
141
146
  ...(v.icon ? { icon: v.icon } : {}), ...(v.handles?.length ? { handles: [...v.handles] } : {}), ...(v.readout ? { readout: v.readout } : {}),
142
147
  ...(v.checkout ? { checkout: v.checkout } : {}), ...(v.frame ? { frame: v.frame } : {}), ...(v.provides?.length ? { provides: [...v.provides] } : {}) })),
143
148
  ...(contributes.protocols?.length ? { protocols: structuredClone(contributes.protocols) } : {}),
144
- ...(contributes.protocolImplementations?.length ? { protocolImplementations: [...contributes.protocolImplementations] } : {}),
149
+ ...(contributes.protocolImplementations?.length ? { protocolImplementations: implementations(contributes.protocolImplementations) } : {}),
145
150
  ...(Object.keys(offers).length ? { offers } : {}),
146
151
  dependencies: [...dependencies], extensionPoints: extensionPoints(contributes.extensionPoints, dir),
147
152
  extensions: Object.entries(contributes.extensions ?? {}).map(([key, value]) => { const [plugin, point] = key.split('/'); return { plugin, point, command: value.command }; }),
@@ -282,6 +287,19 @@ export function pluginEnv({ catalog, installed, id, stateDir = () => null, setti
282
287
  ...(plugin.dependencies.length ? { CODA_PLUGIN_DEPENDENCIES: JSON.stringify(Object.fromEntries(plugin.dependencies.map(d => [d, catalog.get(d).dir]))) } : {}),
283
288
  ...(arbiter ? { CODA_ARBITER: '1' } : {}) };
284
289
  }
290
+ // A manifest's `contributes.protocolImplementations` as Coda keeps it, each `{ kind, commands }`: the operations its commands
291
+ // implement, by the file of each in its directory; the rest are its module's, all of them for a protocol named alone
292
+ // (docs/plugins.md「用命令实现操作」). The test host (adapters/plugin-test-host.mjs) reads a manifest's with it too.
293
+ export const implementations = entries => entries
294
+ .map(entry => typeof entry === 'string' ? { kind: entry, commands: {} } : { kind: entry.kind, commands: { ...entry.commands } });
295
+ // The file in its directory that implements an operation of a protocol the plugin implements (`protocolImplementations`'
296
+ // `commands`), or null: its module's, or not the plugin's at all.
297
+ export function commandOf(plugin, kind, operation) {
298
+ const commands = plugin?.protocolImplementations?.find(entry => entry.kind === kind)?.commands;
299
+ return commands && Object.hasOwn(commands, operation) ? commands[operation] : null;
300
+ }
301
+ // Whether any operation of the plugin's is a command's.
302
+ export const hasCommands = plugin => !!plugin?.protocolImplementations?.some(entry => Object.keys(entry.commands).length);
285
303
  // What such a process inherits, cleared of what Coda gives it as a plugin's: it never takes another plugin's for its own.
286
304
  // Nor the session it was started from (THREAD_ENV) or that session's or the step's token (TOKEN_ENV), which are only ever the
287
305
  // process's own.
@@ -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 { catalogChannelProblem, offerPoint, offeredCommands, offerProblem, withDependencies } from './plugin-extensions.mjs';
10
+ import { installingIncompatibility, offerPoint, offeredCommands, offerProblem, protocolDefinition, withDependencies } from './plugin-extensions.mjs';
11
11
  import { CONTRIBUTION_POINTS } from './contribution-points.mjs';
12
12
 
13
13
  export const COMMIT = /^[0-9a-f]{40}$/;
@@ -169,7 +169,8 @@ export function npmManifest(id, own, skills) {
169
169
  }
170
170
  if (!Object.keys(contributes).length) return { problem: '这个 npm 包读不成插件:package.json 没有 contributes,没有 Skill 目录,也不是写了 mcpName 的 MCP 服务器' };
171
171
  return { manifest: { name: id, displayName: own.name, description: typeof own.description === 'string' ? own.description.slice(0, 500) : '',
172
- version: String(own.version ?? ''), ...(own.coda !== undefined ? { coda: own.coda } : {}), contributes } };
172
+ version: String(own.version ?? ''), ...(own.coda !== undefined ? { coda: own.coda } : {}),
173
+ ...(own.engines?.coda !== undefined ? { engines: { coda: own.engines.coda } } : {}), contributes } };
173
174
  }
174
175
  // The packages npm installs for a package from npm, by name with the range it asks for: its dependencies are not pinned
175
176
  // (docs/plugins.md「从 npm 安装」), unless it brings an `npm-shrinkwrap.json`, whose versions they then are. Among them the
@@ -290,11 +291,11 @@ export function catalogProblem(plugin, catalog, builtin, installed) {
290
291
  // withDependencies, as components/plugins/plugins.mjs installFrom): what this version of it needs, directly or through another,
291
292
  // and this machine has not installed; each found among this machine's plugins (`builtin`: one Coda ships, not installed),
292
293
  // else in another directory of the same commit (`source`, `siblings`: ID → { path, plugin }), else nowhere (`missing`).
293
- // What each found one brings is confirmed with it.
294
- export function together(plugin, { catalog, installed, siblings }) {
294
+ // What each found one brings is confirmed with it (`defined`: the protocols Coda defines, as contributions takes them).
295
+ export function together(plugin, { catalog, installed, siblings, defined = () => null }) {
295
296
  const id = plugin.id, known = new Map([...[...siblings].map(([sibling, at]) => [sibling, at.plugin]), ...catalog, [id, plugin]]);
296
297
  const after = catalogAfter(plugin, { catalog, siblings });
297
- const shown = plugin => ({ displayName: plugin.displayName, contributes: contributions(plugin, after) });
298
+ const shown = plugin => ({ displayName: plugin.displayName, contributes: contributions(plugin, after, defined) });
298
299
  return withDependencies(known, id).filter(each => each !== id && !(installed.has(each) && catalog.has(each)))
299
300
  .map(each => catalog.has(each) ? { id: each, from: 'builtin', ...shown(catalog.get(each)) }
300
301
  : siblings.has(each) ? { id: each, from: 'source', path: siblings.get(each).path, ...shown(siblings.get(each).plugin) } : { id: each, from: 'missing' });
@@ -310,12 +311,13 @@ export function catalogAfter(plugin, { catalog, siblings }) {
310
311
  // What installing it brings, as the confirmation lists it: every command it runs, word for word (those it plugs into
311
312
  // another plugin's points too, which that plugin runs — those it writes for a point under a key of `contributes`, where
312
313
  // the point says, the catalog beside it (`catalog`) declaring it —, those it puts on every session's PATH, those
313
- // answering clients' requests, and the one that makes each
314
+ // answering clients' requests, those implementing operations of its protocols (by kind, operation and file), and the one that makes each
314
315
  // machine ready for it, run as it is installed or updated), what a component's contribution point confirms (its
315
316
  // `confirm`: its agents and the commands it puts on sessions' PATH, the Agent Skills it lays into projects, the MCP
316
317
  // servers their agents start and what it tells every agent; the groups it brings, what it calls its capabilities; the
317
- // modes it puts the composer in), what it calls its workflows and how many settings.
318
- export function contributions(plugin, catalog = new Map()) {
318
+ // modes it puts the composer in), what it calls its workflows and how many settings; and the permission groups it uses of
319
+ // others' protocols, as those define them in the catalog beside it or Coda does (`defined`: plugin-extensions.mjs protocolDefinition).
320
+ export function contributions(plugin, catalog = new Map(), defined = () => null) {
319
321
  const offers = Object.entries(plugin.offers ?? {}).flatMap(([key, raw]) => {
320
322
  const found = offerPoint(new Map([...catalog, [plugin.id, plugin]]), key);
321
323
  return found ? [{ plugin: found.plugin.id, point: found.point, title: found.declared.title, ...offeredCommands(raw, found.declared) }] : [];
@@ -326,6 +328,8 @@ export function contributions(plugin, catalog = new Map()) {
326
328
  ...(plugin.environment?.length ? { environment: plugin.environment.map(({ name, value }) => ({ name, value })) } : {}),
327
329
  ...(plugin.path?.length ? { path: plugin.path } : {}),
328
330
  ...(plugin.endpoints?.length ? { endpoints: plugin.endpoints.map(e => ({ id: e.id, command: e.command })) } : {}),
331
+ // The files in its directory the backend runs as Coda calls an operation of a protocol it implements (docs/plugins.md「用命令实现操作」).
332
+ ...(operationCommands(plugin).length ? { operations: operationCommands(plugin) } : {}),
329
333
  // Its module the plugin host runs (docs/plugins.md「插件宿主」): code of its own in Coda's Node on this machine.
330
334
  ...(plugin.main ? { main: plugin.main } : {}),
331
335
  // The pages it opens in the clients, by name, with where they stay and their icon there: they run in the client's
@@ -341,26 +345,42 @@ export function contributions(plugin, catalog = new Map()) {
341
345
  workflows: plugin.workflows, settings: Object.keys(plugin.properties).length,
342
346
  // What each machine installs for it from npm, as read from its repository (components/plugins/plugin-sources.mjs inspect).
343
347
  ...(plugin.npm?.length ? { npm: plugin.npm } : {}),
348
+ ...(permissions(plugin, catalog, defined).length ? { permissions: permissions(plugin, catalog, defined) } : {}),
344
349
  };
345
350
  }
351
+ // Each permission group it uses (docs/plugins.md「用到的权限」): its protocol, by the definition's title (its name without
352
+ // one), and what the group lets it do, whether on trial; by protocol, then group. One its protocol does not define is
353
+ // why it cannot be installed (plugin-extensions.mjs compatibility), not listed.
354
+ function permissions(plugin, catalog, defined) {
355
+ return Object.entries(plugin.uses ?? {}).flatMap(([kind, groups]) => {
356
+ const definition = protocolDefinition(kind, catalog, defined), declared = definition?.permissions ?? {};
357
+ return groups.filter(group => Object.hasOwn(declared, group)).map(group =>
358
+ ({ kind, protocol: definition.title ?? kind, group, title: declared[group].title, trial: declared[group].trial === true }));
359
+ }).sort((a, b) => a.kind < b.kind ? -1 : a.kind > b.kind ? 1 : a.group < b.group ? -1 : a.group > b.group ? 1 : 0);
360
+ }
361
+ const operationCommands = plugin => (plugin.protocolImplementations ?? [])
362
+ .flatMap(({ kind, commands }) => Object.entries(commands).map(([operation, command]) => ({ kind, operation, command })));
346
363
  // The ID a manifest says its plugin has, as readPlugin takes it (not checked): its `id`, or its package name.
347
364
  export const manifestId = manifest => manifest?.id ?? manifest?.name;
348
365
 
349
366
  // One plugin of a source as its reading lists it, said against what this machine has (`known`: the catalog, the installed
350
367
  // rows, the built-in plugins): what it is, the one of its ID installed here, why it cannot be installed, what comes along
351
368
  // with it (`siblings`: the other plugins of the same commit, by ID) and what it brings. `manifest`: what is known of it
352
- // when it does not read as a plugin, its ID `fallback` without a name.
353
- export function candidate({ path, manifest, plugin, problem, fallback }, { catalog, installed, builtin, channel }, siblings) {
369
+ // when it does not read as a plugin, its ID `fallback` without a name. `channel`, `level` and `defined` (the protocols
370
+ // Coda defines): this machine, which it and what comes along are judged against (plugin-extensions.mjs compatibility);
371
+ // one that does not run here says why in `incompatible`, as installing it and the store say.
372
+ export function candidate({ path, manifest, plugin, problem, fallback }, { catalog, installed, builtin, channel, level, defined = () => null }, siblings) {
354
373
  const id = plugin?.id ?? (typeof manifestId(manifest) === 'string' ? manifestId(manifest) : fallback);
355
- const row = installed.get(id), along = plugin ? together(plugin, { catalog, installed, siblings }) : [];
374
+ const row = installed.get(id), along = plugin ? together(plugin, { catalog, installed, siblings, defined }) : [];
356
375
  const missing = along.filter(each => each.from === 'missing').map(each => each.id);
357
376
  // What this machine has once it is installed, those installed with it among them: the points it may write for.
358
377
  const after = plugin ? catalogAfter(plugin, { catalog, siblings }) : catalog;
378
+ const incompatible = plugin ? installingIncompatibility(after, installed, id, { channel, level, defined }) : null;
359
379
  return { path, id, displayName: plugin?.displayName ?? (typeof manifest?.displayName === 'string' ? manifest.displayName : id),
360
380
  description: plugin?.description ?? (typeof manifest?.description === 'string' ? manifest.description : ''), version: plugin?.version ?? '',
361
381
  installed: row ? row.source ?? builtin.get(id)?.source ?? { kind: 'builtin' } : null,
362
- problem: problem ?? (plugin ? catalogChannelProblem(after, id, channel) ?? catalogProblem(plugin, catalog, builtin, installed) ?? offerProblem(plugin, after) : null)
382
+ problem: problem ?? incompatible?.error ?? (plugin ? catalogProblem(plugin, catalog, builtin, installed) ?? offerProblem(plugin, after) : null)
363
383
  ?? (missing.length ? `要一起装的 ${missing.join('、')} 不在这台机器上${plugin.source?.kind === 'npm' ? '' : ',也不在这个提交里'}` : null),
364
- together: along.filter(each => each.from !== 'missing'),
365
- ...(plugin ? { contributes: contributions(plugin, after) } : {}) };
384
+ ...(!problem && incompatible ? { incompatible } : {}), together: along.filter(each => each.from !== 'missing'),
385
+ ...(plugin ? { contributes: contributions(plugin, after, defined) } : {}) };
366
386
  }
@@ -0,0 +1,9 @@
1
+ // What the plugin host takes of plugins (components/plugins/contribution-points.mjs): the processes a plugin's module
2
+ // starts to outlive the call or the module that started them (docs/plugins.md「起进程」), each by a name its `spawn`
3
+ // gives (`{ name }`), defined as this module loads. Descriptions only: nothing here imports a component.
4
+ import { defineContributionPoint } from './contribution-points.mjs';
5
+
6
+ defineContributionPoint({ key: 'processes',
7
+ schema: { description: '模块起的、比起它的调用或模块活得久的进程,各一个名字;spawn 时用 { name } 对上', type: 'array', uniqueItems: true,
8
+ items: { description: '进程名:小写字母、数字和「-」,以字母开头,至多 40 个字符', type: 'string', pattern: '^[a-z][a-z0-9-]{0,39}$' } },
9
+ read: (raw = []) => raw.length ? { processes: [...raw] } : {} });
@@ -1,7 +1,7 @@
1
- import { randomUUID } from 'node:crypto';
2
- import { ContractError } from '../../domain/errors.mjs';
3
1
  import { agentFailure } from '../../kernel/agent-failures.mjs';
4
2
 
3
+ // The rules of a service failure, and only them: the plugin contract check reads this file, so nothing of the runtime
4
+ // (recovery.mjs) is imported here.
5
5
  // Plugins report facts about a failed request; Coda owns the policy. No provider names or error-text matching here.
6
6
  export function serviceFailure(error) {
7
7
  const failure = agentFailure(error);
@@ -9,50 +9,3 @@ export function serviceFailure(error) {
9
9
  }
10
10
  // The former capacity/model-unavailable policy, shared by every agent that reports a service failure.
11
11
  export const RETRY_DELAYS = [15_000, 30_000, 60_000];
12
- export const continuationPrompt = '继续完成当前任务,沿用已有上下文和已完成的工作,从尚未完成的部分接着执行。';
13
-
14
- export class PromptRecovery {
15
- constructor(kernel, { clock, prompt, delays = RETRY_DELAYS }) {
16
- this.kernel = kernel; this.store = kernel.store; this.clock = clock;
17
- this.prompt = prompt; this.delays = delays; this.retries = new Map();
18
- }
19
- pending(run) { return this.retries.get(run)?.waiting === true; }
20
- schedule(run, error) {
21
- const failure = serviceFailure(error);
22
- if (!failure || run.commandInput || run.autonomous || !run.turn || this.kernel.closing || this.kernel.sessions.adopting) return false;
23
- // The plugin supplies the upstream wait as a fact; Coda keeps its one-minute retry budget.
24
- if ((failure.retryAfterMs ?? 0) > RETRY_DELAYS.at(-1)) return false;
25
- const retry = this.retries.get(run) ?? { attempt: 0 };
26
- if (this.store.turn(run.turn.id).stopRequestedAt !== null || retry.attempt === this.delays.length) return false;
27
- retry.delay = Math.max(this.delays[retry.attempt++], failure.retryAfterMs ?? 0); retry.waiting = true;
28
- this.retries.set(run, retry);
29
- if (failure.input === 'accepted') this.store.markRunning(run.turn.id);
30
- this.store.expireRequests(run.turn.id);
31
- return true;
32
- }
33
- wake(run) { this.retries.get(run)?.wake?.(); }
34
- wakeAll() { for (const run of this.retries.keys()) this.wake(run); }
35
- async finish(run, waiting) {
36
- try {
37
- for (;;) {
38
- try { await waiting; }
39
- catch (error) { if (error.code !== 'agent_error' || !this.pending(run)) throw error; }
40
- if (!run.requestId || !this.pending(run)) return;
41
- const retry = this.retries.get(run), { kernel } = this;
42
- if (kernel.closing || run.stopped) throw new ContractError('connection_lost', 'Agent 执行连接中断');
43
- await new Promise(resolve => {
44
- const cancel = this.clock.at(kernel.now() + retry.delay, () => this.wake(run));
45
- retry.wake = () => { cancel(); retry.wake = null; resolve(); };
46
- });
47
- if (!run.requestId) return; // Stopped while waiting.
48
- if (kernel.closing || run.stopped) throw new ContractError('connection_lost', 'Agent 执行连接中断');
49
- retry.waiting = false;
50
- const input = this.store.input(this.store.operation(run.requestId).inputId), promptId = randomUUID();
51
- this.store.run('UPDATE operations SET prompt_id = ?, updated_at = ? WHERE request_id = ?', promptId, kernel.now(), run.requestId);
52
- run.feed.beginPrompt();
53
- // The persisted original receipt survives a rejected continuation, including after machine recovery.
54
- waiting = run.prompt(input.state === 'delivered' ? continuationPrompt : this.prompt(run.requestId), promptId);
55
- }
56
- } finally { this.wake(run); this.retries.delete(run); }
57
- }
58
- }
@@ -0,0 +1,70 @@
1
+ // What a plugin's reads and writes of the records (coda#2749 3.7, `coda.get`, `list`, `put`, `replace`) are held to,
2
+ // wherever they are answered: by the backend (./mirror.mjs, ./providers.mjs, ./protocols.mjs) and by a plugin's test host
3
+ // (adapters/plugin-test-host.mjs).
4
+ import { requireCondition as check } from '../../domain/errors.mjs';
5
+ import { derivedUUID } from '../../domain/values.mjs';
6
+
7
+ // Where a kind's records are, said once for every kind (Protocols `register` reads it). The kinds only this machine keeps:
8
+ // Coda's composers and what is submitted through them, the runs of its posts to sessions, and the kinds it serves whole
9
+ // from its own tables: `coda/thread@1`, `coda/project@1`, `coda/card@1`, `coda/plugin@1` and the workflows' `coda/workflow@1`
10
+ // and `coda/workflow-run@1` (one of another backend is found by asking the space: mirror.mjs `place`). `coda/session@1` is shared (Coda's sessions are served beside
11
+ // it, a plugin's external sessions are written in the record directory). They are never in the record directory, and no
12
+ // plugin writes one. Every other kind, every one a plugin defines among them, is shared: its records are this machine's rows of
13
+ // the record directory, which the other backends of a space copy.
14
+ export const LOCAL_KINDS = new Set(['coda/composer@1', 'coda/submission@1', 'coda/run@1', 'coda/thread@1', 'coda/project@1', 'coda/card@1',
15
+ 'coda/plugin@1', 'coda/workflow@1', 'coda/workflow-run@1']);
16
+ // `list(kind, { scope?, id?, labels? })`: this machine's records (`local`) or this machine's and the others' (`available`,
17
+ // unsaid), all of them, those of an ID, or those whose labels have each of these values (`labels`, as Kubernetes' equality
18
+ // selector: nothing but equality).
19
+ export function readFilter(filter) {
20
+ check(filter == null || (typeof filter === 'object' && !Array.isArray(filter)), 'invalid_input', '筛选须为对象');
21
+ const { scope = 'available', id, labels, ...rest } = filter ?? {};
22
+ check(['local', 'available'].includes(scope) && !Object.keys(rest).length && (id === undefined || (typeof id === 'string' && id)),
23
+ 'invalid_input', '筛选只认 scope(local 或 available)、id 和 labels');
24
+ check(labels === undefined || (labels && typeof labels === 'object' && !Array.isArray(labels) && Object.values(labels).every(value => typeof value === 'string')),
25
+ 'invalid_input', '筛选的 labels 须为文本键值对象');
26
+ return { scope, id, labels };
27
+ }
28
+ // Whether a record's labels have each value a filter's `labels` asks for (none asked, any record has).
29
+ export const labelled = (labels, asked) => asked === undefined || Object.entries(asked).every(([name, value]) => labels?.[name] === value);
30
+ // `get({ kind, id })`.
31
+ export function readRef(ref) {
32
+ const { kind, id, ...rest } = ref ?? {};
33
+ check(typeof id === 'string' && id && !Object.keys(rest).length, 'invalid_input', 'get 须为 { kind, id }');
34
+ return { kind, id };
35
+ }
36
+ // Of the entries of a record's ID (`entries`, a record's ID is the space's one), the one `get` gives: this machine's, else
37
+ // the record directory's; null for none.
38
+ export const picked = entries => entries.find(({ local }) => local) ?? entries[0] ?? null;
39
+ // A record's labels, when it has any: names each with a text.
40
+ export const checkLabels = labels => check(labels === null || (labels && typeof labels === 'object' && !Array.isArray(labels)
41
+ && Object.values(labels).every(value => typeof value === 'string')), 'invalid_input', 'labels 须为文本键值对象');
42
+ // A record a plugin writes is named by it with a key of its own (`{ kind, key }`, a device's udid, `account:group`, a
43
+ // source's name): a non-empty text of at most 256 characters without NUL (a command is given it in its environment),
44
+ // nothing else; its ID is the host's (`recordId`), never the plugin's.
45
+ export function checkKey(key) {
46
+ check(typeof key === 'string' && key.length > 0 && key.length <= 256 && !key.includes('\0'), 'invalid_input',
47
+ `记录 key 须为 1–256 个字符、不含 NUL 的文本,不是 ${JSON.stringify(key)}`);
48
+ return key;
49
+ }
50
+ export function writeRef(ref) {
51
+ const { kind, key, ...rest } = ref ?? {};
52
+ check(!Object.hasOwn(rest, 'id'), 'invalid_input', '插件写记录只给 key,id 由宿主派生');
53
+ check(!Object.keys(rest).length, 'invalid_input', '写记录须为 { kind, key }');
54
+ return { kind, key: checkKey(key) };
55
+ }
56
+ // A plugin's record's ID, the space's one: the same for the same backend (`owner`), plugin, kind and key, another for any
57
+ // other, a lowercase UUID; derived as the host's other IDs are (domain/values.mjs `derivedUUID`).
58
+ export const recordId = (owner, plugin, kind, key) => derivedUUID(owner, plugin, kind, key);
59
+ // What `put` writes of a record, and `replace` of each (`{ key, …value }`): its spec, its status and its labels, nothing else.
60
+ export function checkWrite(value) {
61
+ check(value && typeof value === 'object' && Object.keys(value).every(key => ['spec', 'status', 'labels'].includes(key)), 'invalid_input', '记录只写 { spec, status?, labels? }');
62
+ }
63
+ // `replace(kind, entries)`: every record the plugin holds of the kind, each once, by its key.
64
+ export function checkReplace(entries) {
65
+ check(Array.isArray(entries) && entries.every(entry => entry && typeof entry === 'object'), 'invalid_input', 'replace 的记录须为 [{ key, spec, status?, labels? }]');
66
+ check(entries.every(entry => !Object.hasOwn(entry, 'id')), 'invalid_input', '插件写记录只给 key,id 由宿主派生');
67
+ const keys = entries.map(entry => checkKey(entry.key));
68
+ check(new Set(keys).size === keys.length, 'invalid_input', 'replace 的记录 key 重复');
69
+ return keys;
70
+ }
@@ -21,14 +21,19 @@ export function validate(check, value, who) {
21
21
 
22
22
  export class ProtocolTypes {
23
23
  constructor() { this.types = new Map(); }
24
- register({ kind, spec, status, operations = {}, contributions = {}, participants = () => [] }, registered = () => {}, replace = false) {
24
+ // `side`: for one of Coda's own protocols, the side of the call kernel on each backend that does its doing operations
25
+ // (`<backend ID>/<side>`, components/plugins/plugin-callers.mjs `route`); none for one a plugin implements.
26
+ register({ kind, title, spec, status, operations = {}, streams = {}, contributions = {}, participants = () => [], side }, registered = () => {}, replace = false) {
25
27
  if (!parseProtocolName(kind) || (this.types.has(kind) && !replace)) throw new TypeError(`协议名无效或已登记:${kind}`);
26
28
  if (spec?.type !== 'object' || status?.type !== 'object') throw new TypeError(`${kind}: spec 与 status 须为对象 schema`);
27
29
  if (typeof participants !== 'function' || !object(contributions)) throw new TypeError(`${kind}: 需要 participants 与 contributions`);
28
30
  // Each operation is an input and either an immediate result or a run reference, as the protocol package defines them.
29
31
  // `join` names an input field holding the run of an open call that the operation adds to instead of opening one;
30
32
  // `safe`, one that only reads and answers at once, whose request and answer neither side keeps; `idempotent`, one that
31
- // may change what it acts on but does the same again when sent again, kept by neither side as `safe` is.
33
+ // may change what it acts on but does the same again when sent again, kept by neither side as `safe` is; `timeout`, how
34
+ // many milliseconds a call of it is given when the caller gives it less than that or nothing (components/protocols/calls.mjs);
35
+ // `codaOnly`, one of Coda's own protocols that only Coda calls, never a plugin, implementing the protocol or not
36
+ // (components/plugins/plugin-callers.mjs `call`) — Coda's mark, not the protocol package's, as `side` is.
32
37
  if (!object(operations)) throw new TypeError(`${kind}: operations 须为对象`);
33
38
  const compiled = new Map();
34
39
  for (const [name, operation] of Object.entries(operations)) {
@@ -36,8 +41,18 @@ export class ProtocolTypes {
36
41
  const run = operation.run === true, join = operation.join;
37
42
  if (run === Object.hasOwn(operation, 'result') || !operation.input) throw new TypeError(`${kind}.${name}: 操作要写 input,并恰写 result 或 run`);
38
43
  if (join !== undefined && (!run || typeof join !== 'string' || !join)) throw new TypeError(`${kind}.${name}: join 只能用于运行,并写出输入里的字段`);
44
+ if (operation.timeout !== undefined && !(Number.isInteger(operation.timeout) && operation.timeout > 0)) throw new TypeError(`${kind}.${name}: timeout 须为正整数毫秒`);
39
45
  compiled.set(name, { input: compile(operation.input), ...(run ? { run } : { result: compile(operation.result) }), ...(join ? { join } : {}),
40
- ...(operation.safe === true ? { safe: true } : {}), ...(operation.idempotent === true ? { idempotent: true } : {}) });
46
+ ...(operation.safe === true ? { safe: true } : {}), ...(operation.idempotent === true ? { idempotent: true } : {}),
47
+ ...(operation.timeout ? { timeout: operation.timeout } : {}), ...(operation.codaOnly === true ? { codaOnly: true } : {}) });
48
+ }
49
+ // Each stream (a record's read-only bytes, transport/record-streams.mjs) by its name, its parameters' schema: they come
50
+ // from the query string, all strings. A stream and an operation may share a name; each is its own.
51
+ if (!object(streams)) throw new TypeError(`${kind}: streams 须为对象`);
52
+ const readable = new Map();
53
+ for (const [name, stream] of Object.entries(streams)) {
54
+ if (!/^[a-z][a-z0-9-]{0,63}$/.test(name) || !object(stream) || !stream.input) throw new TypeError(`${kind}.${name}: 流名或定义无效`);
55
+ readable.set(name, { input: compile(stream.input) });
41
56
  }
42
57
  const properties = {};
43
58
  for (const [field, { merge, schema }] of Object.entries(contributions)) {
@@ -47,7 +62,10 @@ export class ProtocolTypes {
47
62
  }
48
63
  Object.defineProperty(properties, field, { value: schema, enumerable: true });
49
64
  }
50
- const type = { kind, participants, contributions: structuredClone(contributions), operations: compiled,
65
+ // Its title as defined (@coda-console/protocol definition.json). Its permission groups are judged as defined, not as
66
+ // registered (components/plugins/plugin-extensions.mjs compatibility).
67
+ const type = { kind, ...(title ? { title } : {}), ...(side ? { side } : {}),
68
+ participants, contributions: structuredClone(contributions), operations: compiled, streams: readable,
51
69
  spec: compile(spec, defaults), status: compile(status, defaults),
52
70
  // Before supplementation only merge operands must be shaped correctly. Required fields and counts apply to the
53
71
  // complete spec, so a participant can supply a required list that the initial object does not have yet.
@@ -1,14 +1,10 @@
1
1
  // What workflows take of plugins (components/plugins/contribution-points.mjs): the capabilities a plugin's workflows
2
- // stand for (schemas/capabilities.json), its concurrency groups (schemas/groups.json) and the events it publishes
3
- // (schemas/events.json), defined as this module loads.
2
+ // stand for (schemas/capabilities.json) and the events it publishes (schemas/events.json), defined as this module loads.
3
+ // Its concurrency groups are its coda/group@1 records (components/concurrency-groups/schemas.mjs), not of its manifest.
4
4
  // Descriptions only: nothing here imports a component, for the plugins read with them are read before any is made.
5
5
  import { defineContributionPoint } from '../plugins/contribution-points.mjs';
6
6
  import { SCHEMAS } from '@coda-console/protocol/validate';
7
7
 
8
8
  defineContributionPoint({ key: 'capabilities', schema: SCHEMAS['capabilities.json'], read: (raw = []) => ({ capabilities: [...raw].sort() }),
9
9
  confirm: plugin => ({ capabilities: plugin.capabilities }) });
10
- // A group is one plugin's: any process takes it by its name.
11
- defineContributionPoint({ key: 'groups', schema: SCHEMAS['groups.json'], read: (raw = []) => ({ groups: raw.map(g => ({ name: g.name, capacity: g.capacity })) }),
12
- claim: plugin => plugin.groups.map(g => `组 ${g.name}`),
13
- confirm: plugin => ({ groups: plugin.groups.map(g => ({ name: g.name, capacity: g.capacity })) }) });
14
10
  defineContributionPoint({ key: 'events', schema: SCHEMAS['events.json'], read: raw => raw?.length ? { events: raw.map(e => ({ name: e.name, starts: e.starts !== false, ...(e.ends ? { ends: true } : {}) })) } : {} });
@@ -1,44 +1,52 @@
1
1
  {
2
- "commit": "0275e21adcd2e12818b6e638ae3002474f748ecd",
2
+ "commit": "8ff481af89b9da86e09a5af2134884c78da0a011",
3
3
  "packages": {
4
4
  "@0dep/piso": "5.2.0",
5
5
  "@agentclientprotocol/sdk": "2.6.0",
6
- "@coda-console/protocol": "6.6.0",
6
+ "@coda-console/protocol": "6.13.0",
7
7
  "ajv": "8.20.0",
8
8
  "yaml": "2.9.1"
9
9
  },
10
10
  "files": {
11
- "check/coda/application/contributions.mjs": "2796b02e92c7ba0805d1d1d83afd08c6f8beeab92d026381736c7d54b39b455f",
12
- "check/coda/components/protocols/creation.mjs": "2b4a400d3064af4b5106077dc783c567910fef3c47b2d52af3f0d838c5accf19",
13
- "check/coda/components/protocols/types.mjs": "6876689142866bd45fc085951f6ea9e1fc303334e3657e97cc9cf5e277311248",
14
- "check/coda/adapters/provider-api.mjs": "2b0802b52ae4d894e92f1fa7647cf727556f4008ad5e63c14e6400dc24bb3a6e",
15
- "check/coda/adapters/admission-api.mjs": "f19706eb66e598fceb1a72ac81c51e48f4dc0179a18a73edaccb4d68ca629f56",
11
+ "check/coda/application/contributions.mjs": "861c363d06cdabfc4ce15435126fbc7ad7dafd3c93ca2ad9e9534a6f5a237942",
12
+ "check/coda/components/protocols/record-rules.mjs": "116bd103102afb94589d1df69786a780d2745165f46b878ddd48ac6d630694b1",
13
+ "check/coda/components/protocols/types.mjs": "283cd0f4516f10637d6fe257fe645ead87912219d471c06408d56617f244e1d1",
14
+ "check/coda/adapters/provider-api.mjs": "70441ea2a417ede13e04113ec254496883be3186f291ef5ee65834f35009eb9e",
15
+ "check/coda/adapters/call-limit.mjs": "7e86d95ff7b0a88955015904ec91ae55e78fad816d06f710d6e62af53ccbdeab",
16
+ "check/coda/adapters/clock.mjs": "79733b9ac3807b3da147fe8b782318a1cb42d1d51b9c8b81a507c13c7a8025fd",
17
+ "check/coda/adapters/plugin-command.mjs": "526b4f57a549d9f74bac508f5803a592210cbf24ab67148260262f02d2bc75b5",
18
+ "check/coda/adapters/plugin-modules.mjs": "5b02f9fd8eab68fb1564ab3640d137e383b59576e90a8d41f9a7feb804e13ff5",
19
+ "check/coda/adapters/plugin-stream-services.mjs": "1e92eb3dd9d844d4f2773a60bc2941aae3c9cda10d9e96e31de9f09f51e672e5",
20
+ "check/coda/adapters/plugin-test-host.d.mts": "71d10d545761a2013b87f29815f42d779722e211484d70e0a732de31c5972c7d",
21
+ "check/coda/adapters/plugin-test-host.mjs": "314ce4af2d0cdd1d3076f3e5af551ee3d3759ae01b6f670d2b84735e54fdfdac",
22
+ "check/coda/adapters/process-relay.mjs": "5d379bd7ad07138d69c7accbe769d71294843399539bdf1fab8b6a1ddf13b9d8",
16
23
  "check/coda/components/composers/contributions.mjs": "43d3e15fb1f63b7b5c20716030d9537613809ed5cc2fb466a3678bfa308f9f92",
17
- "check/coda/components/composers/schemas.mjs": "6d497f58147756e789f9a566b2366f2fe36c0c72310421fb02508bf24a04f2c0",
24
+ "check/coda/components/concurrency-groups/schemas.mjs": "3c422044c637dee10565fb1b8bdc75b9c6a31e3b600ed223b7e5e345e1baf092",
25
+ "check/coda/components/composers/schemas.mjs": "31656d6534fbfcb1e325bc551aefad4abbb867325872acea1ce9274eb9787c23",
18
26
  "check/coda/components/plugins/contribution-points.mjs": "2dade9fe4f3fa2b4e89f49a1ac4378ab2621e5ac542eb175967091f04568b45c",
19
27
  "check/coda/components/plugins/git-contributions.mjs": "532917cd3ec45e12535e9e6c206ae14fa598bebc789ab0c8f15609d1699fa1cd",
20
28
  "check/coda/components/plugins/model-contributions.mjs": "018a7157954b2326887ba1a780b37d3beb33338e41a28936b313562c2939d563",
21
- "check/coda/components/plugins/plugin-extensions.mjs": "4d7963185195ba6d21a4e49a66987613d5892210b1eb1dc02cffb7b816407776",
29
+ "check/coda/components/plugins/plugin-extensions.mjs": "64089e6f0c58b60f922d93ac49cf5fa20d4541b39995e5170671d8a3d03f556f",
22
30
  "check/coda/components/plugins/plugin-icons.mjs": "ec29cadce4948ecacabfe911a2ceb45414b96e28971358acbc4e952bedc78e1a",
23
- "check/coda/components/plugins/plugin-rules.mjs": "8709c797c14c6dc99a378a9d907ca804e3a025da910723378161af40fafeaa8a",
24
- "check/coda/components/plugins/plugin-source-rules.mjs": "1b6c0fb1868481627f09b7227bc64ef07fe669dcc344dad353e6743adf6c9c5d",
31
+ "check/coda/components/plugins/plugin-rules.mjs": "ee2d9fef03d5e82050114840444601b7f7d2e8b9645ea388cba0d6e3dede3432",
32
+ "check/coda/components/plugins/plugin-source-rules.mjs": "099a2250cca737722c32524e40fc975c73abcfd4b99be7a9e5abcd5a68c211af",
33
+ "check/coda/components/plugins/process-contributions.mjs": "6d39a904f52956b87c04351398f79a4fc34981fa01453195bd7a3b9f2c5d237b",
25
34
  "check/coda/components/plugins/skill-document.mjs": "153ad3c096c7c9b7774bcf7dcc0ba603c962ee1ac8697c8a71e3f2c9ba9c92e6",
26
- "check/coda/components/prompt-recovery/prompt-recovery.mjs": "f43f21d24c19a58113d3304f9248225b12080ab00ed15eab74bf7b94642732de",
35
+ "check/coda/components/prompt-recovery/prompt-recovery.mjs": "25477742af8a9134ae343af6ab702926692bdd8dd07844f3cba47e8b702c0e49",
27
36
  "check/coda/components/session-config/commands.mjs": "5276f81fc430a6eef7d7a0dbdecfffdb4a77f8c192cb0238ed73b7722641ce17",
28
37
  "check/coda/components/session-config/contributions.mjs": "74d52d65dc7b6f13ef301a211bdf50cc91ae468c462cbe201f5dc34f7437b97b",
29
- "check/coda/components/workflows/contributions.mjs": "43e656a2d502b851679d8da11e74a6fb843c47a1502bfc948da719855ca7b438",
38
+ "check/coda/components/workflows/contributions.mjs": "e0cc743ed9bb382d00c0d65a99c8f8e601556b8396e7840cfc0bfb84ed2a4243",
30
39
  "check/coda/domain/agent-protocol.mjs": "f1d7c939c240664b773c04d9a1c1e9457cc8396fd8f99f1d5b6b6964150843c0",
31
40
  "check/coda/domain/duration.mjs": "3f07411812362adcacfc288b1513f10e7d0ea1addcdc1b47ae553561f1d3430b",
32
- "check/coda/domain/errors.mjs": "8319c6759c5b16b692f5e0a6208d066e43882c571da1075bff8698761020daef",
33
- "check/coda/domain/resource-admission.mjs": "775b1d7067f9d8487a3504d737f3f4bea31adf77af3357ed42e313805e5188e7",
41
+ "check/coda/domain/errors.mjs": "15ad3348ea0e173a1a8602ec72766592cb41c0221420d9e5884bd68090ecc84b",
42
+ "check/coda/domain/resume-prompt.mjs": "9895ccf235808b9bf3f4836999c65ddd6d764fcaa6e8a9a9647612faf0c9629a",
34
43
  "check/coda/domain/plugin-services.mjs": "940a72a14da980188a32c790c7f341d3ec0062a6e87ef1ebc9ef051798ea0a75",
35
- "check/coda/domain/session-env.mjs": "e6717b7fb02e0175a25a00765919fa058182433beed6dcb22bf1745b4591749f",
44
+ "check/coda/domain/session-env.mjs": "283bbc2e8ae9ea22b53747865a651a4dac9c6cfc242f27612e0c82e6e9cc151a",
36
45
  "check/coda/domain/values.mjs": "afb8bf30e374bed27fe41ee4b6d8c3c0b4dbe1dcfb6b62dad9d3d53b966706a1",
37
46
  "check/coda/kernel/agent-failures.mjs": "cbc215e2403d86f0acc765c2077197e0b529fc01e213db465c388361238ea8ce",
38
- "check/coda/resources/plugins/resources/panels/command.mjs": "606f28bf87f87dded9df2db892bc7624c770d795ffab88f2409998346920ae42",
39
- "check/coda/resources/plugins/resources/panels/panels.mjs": "452860c6b1b39dd9a67a8dadf4dac8f7773741b3608274494a8ac518a01f5b33",
40
- "check/coda/resources/plugins/resources/panels/rules.mjs": "80da2709985c3866fff1698ea4d1c1afdf59cac2cc955605d3ec6c35f181eec6",
41
- "check/coda/resources/plugins/resources/panels/sign-in.mjs": "1271a24e33b1b882a1fb9bee03b8e240db8b9bee1b5208f0e1c84499cfb1be7e",
42
- "check/coda/builtin.json": "00124de57b1ec74c5913d8ab662fbd53805fdc54e0164d6cf3f6da8e34499083"
47
+ "check/coda/resources/plugins/resources/panels/panels.mjs": "37ffc6a4ede3e4612cd13cf1a973a90892f8ce7e8a0f055e7cfe86313aae5224",
48
+ "check/coda/resources/plugins/resources/panels/rules.mjs": "a433d4e84138937297ec31a8912aab7bd48bba4b66da3a10978edb1367613c96",
49
+ "check/coda/resources/plugins/resources/panels/sign-in.mjs": "6eb016ef9a7f8aa03e0f4b2fa35ce139b8b1ff0deb4ec6e6a34139aed4f2841a",
50
+ "check/coda/builtin.json": "6d8a803dc3503ea1fb68d526b2785fd73c7564d2ecd0cf24299055d0dda674dc"
43
51
  }
44
52
  }