@lesliechan721/aw 0.1.0-beta.4 → 0.1.0-beta.6

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 (99) hide show
  1. package/dist/authoring/scripts/lib/plugin-version-check.d.mts +14 -0
  2. package/dist/authoring/scripts/lib/plugin-version-check.mjs +10 -224
  3. package/dist/authoring/scripts/lib/plugin-version-check.mjs.map +1 -1
  4. package/dist/authoring/scripts/remove-plugin.d.mts +2 -0
  5. package/dist/authoring/scripts/remove-plugin.mjs +366 -0
  6. package/dist/authoring/scripts/remove-plugin.mjs.map +1 -0
  7. package/dist/authoring/scripts/validate-plugin.mjs +9 -46
  8. package/dist/authoring/scripts/validate-plugin.mjs.map +1 -1
  9. package/dist/scripts/bundle-plugins.d.ts +0 -2
  10. package/dist/scripts/bundle-plugins.js +4 -2
  11. package/dist/scripts/bundle-plugins.js.map +1 -1
  12. package/dist/scripts/plugin-staging.d.ts +1 -16
  13. package/dist/scripts/plugin-staging.js +8 -115
  14. package/dist/scripts/plugin-staging.js.map +1 -1
  15. package/dist/src/authoring/workspace-commands.d.ts +9 -1
  16. package/dist/src/authoring/workspace-commands.js +24 -16
  17. package/dist/src/authoring/workspace-commands.js.map +1 -1
  18. package/dist/src/commands/catalog-publication-inspection.d.ts +106 -0
  19. package/dist/src/commands/catalog-publication-inspection.js +444 -0
  20. package/dist/src/commands/catalog-publication-inspection.js.map +1 -0
  21. package/dist/src/commands/catalog-publish.d.ts +18 -2
  22. package/dist/src/commands/catalog-publish.js +261 -316
  23. package/dist/src/commands/catalog-publish.js.map +1 -1
  24. package/dist/src/commands/catalog-status.d.ts +60 -0
  25. package/dist/src/commands/catalog-status.js +251 -0
  26. package/dist/src/commands/catalog-status.js.map +1 -0
  27. package/dist/src/commands/plugin-capabilities.d.ts +22 -0
  28. package/dist/src/commands/plugin-capabilities.js +143 -0
  29. package/dist/src/commands/plugin-capabilities.js.map +1 -0
  30. package/dist/src/commands/rebuild-command.d.ts +2 -0
  31. package/dist/src/commands/rebuild-command.js +37 -6
  32. package/dist/src/commands/rebuild-command.js.map +1 -1
  33. package/dist/src/commands/rebuild-integration.d.ts +1 -0
  34. package/dist/src/commands/rebuild-integration.js +55 -57
  35. package/dist/src/commands/rebuild-integration.js.map +1 -1
  36. package/dist/src/commands/status-v4.d.ts +21 -0
  37. package/dist/src/commands/status-v4.js +63 -2
  38. package/dist/src/commands/status-v4.js.map +1 -1
  39. package/dist/src/index.js +79 -18
  40. package/dist/src/index.js.map +1 -1
  41. package/dist/src/tui/components.d.ts +70 -0
  42. package/dist/src/tui/components.js +149 -6
  43. package/dist/src/tui/components.js.map +1 -1
  44. package/dist/src/tui/console-app-v4.js +1660 -628
  45. package/dist/src/tui/console-app-v4.js.map +1 -1
  46. package/dist/src/tui/controller-runtime.d.ts +5 -1
  47. package/dist/src/tui/controller-runtime.js +184 -33
  48. package/dist/src/tui/controller-runtime.js.map +1 -1
  49. package/dist/src/tui/controller.d.ts +35 -2
  50. package/dist/src/tui/controller.js +300 -39
  51. package/dist/src/tui/controller.js.map +1 -1
  52. package/dist/src/tui/diagnostics.d.ts +31 -0
  53. package/dist/src/tui/diagnostics.js +71 -0
  54. package/dist/src/tui/diagnostics.js.map +1 -0
  55. package/dist/src/tui/index.d.ts +5 -3
  56. package/dist/src/tui/index.js +3 -1
  57. package/dist/src/tui/index.js.map +1 -1
  58. package/dist/src/tui/model.d.ts +33 -4
  59. package/dist/src/tui/model.js +252 -17
  60. package/dist/src/tui/model.js.map +1 -1
  61. package/dist/src/tui/router.d.ts +15 -9
  62. package/dist/src/tui/router.js +35 -0
  63. package/dist/src/tui/router.js.map +1 -1
  64. package/dist/src/tui/theme.d.ts +18 -10
  65. package/dist/src/tui/theme.js +18 -10
  66. package/dist/src/tui/theme.js.map +1 -1
  67. package/dist/src/tui/viewport.d.ts +20 -0
  68. package/dist/src/tui/viewport.js +29 -0
  69. package/dist/src/tui/viewport.js.map +1 -0
  70. package/dist/src/utils/catalog-runtime-projection.d.ts +1 -7
  71. package/dist/src/utils/catalog-runtime-projection.js +2 -62
  72. package/dist/src/utils/catalog-runtime-projection.js.map +1 -1
  73. package/dist/src/utils/catalog-source-cache.d.ts +12 -11
  74. package/dist/src/utils/catalog-source-cache.js +20 -0
  75. package/dist/src/utils/catalog-source-cache.js.map +1 -1
  76. package/dist/src/utils/dynamic-skill-tree.js +1 -1
  77. package/dist/src/utils/dynamic-skill-tree.js.map +1 -1
  78. package/dist/src/utils/git-catalog-provider.js +1 -1
  79. package/dist/src/utils/git-catalog-provider.js.map +1 -1
  80. package/dist/src/utils/manifest.d.ts +0 -1
  81. package/dist/src/utils/manifest.js +0 -1
  82. package/dist/src/utils/manifest.js.map +1 -1
  83. package/dist/src/utils/plugin-config.js +28 -30
  84. package/dist/src/utils/plugin-config.js.map +1 -1
  85. package/dist/src/utils/skill-validation.d.ts +1 -1
  86. package/dist/src/utils/skill-validation.js +1 -1
  87. package/dist/src/utils/skill-validation.js.map +1 -1
  88. package/dist/src/utils/state-paths.d.ts +1 -0
  89. package/dist/src/utils/state-paths.js +5 -0
  90. package/dist/src/utils/state-paths.js.map +1 -1
  91. package/package.json +3 -4
  92. package/dist/src/utils/plugin-authoring-capabilities.d.ts +0 -23
  93. package/dist/src/utils/plugin-authoring-capabilities.js +0 -37
  94. package/dist/src/utils/plugin-authoring-capabilities.js.map +0 -1
  95. package/dist/src/utils/plugin-authoring-capabilities.json +0 -92
  96. package/dist/src/utils/skill-frontmatter-capabilities.d.ts +0 -201
  97. package/dist/src/utils/skill-frontmatter-capabilities.js +0 -5
  98. package/dist/src/utils/skill-frontmatter-capabilities.js.map +0 -1
  99. package/dist/src/utils/skill-frontmatter-capabilities.json +0 -200
@@ -0,0 +1,366 @@
1
+ #!/usr/bin/env node
2
+ import * as fs from 'node:fs/promises';
3
+ import * as path from 'node:path';
4
+ import { readCatalogWorkspace } from '@lesliechan721/aw-plugin-core';
5
+ import { parseStablePluginVersion, readManifestDocument, resolveBaseCommit, runGit, } from './lib/plugin-version-check.mjs';
6
+ import { assertCanonicalAuthoringPluginRoot } from './lib/plugin-root.mjs';
7
+ import { CLI_RESERVED_IMPORTS } from '../../src/utils/manifest.js';
8
+ const PLUGIN_NAME_PATTERN = /^[a-z0-9]+(?:-[a-z0-9]+)*$/;
9
+ class PluginRemovalError extends Error {
10
+ constructor(code, message, recoveryCommand) {
11
+ super(message);
12
+ this.name = 'PluginRemovalError';
13
+ this.code = code;
14
+ this.recoveryCommand = recoveryCommand;
15
+ }
16
+ }
17
+ function fail(code, message, recoveryCommand) {
18
+ throw new PluginRemovalError(code, message, recoveryCommand);
19
+ }
20
+ function readOptionValue(args, index, flag) {
21
+ const current = args[index];
22
+ const eqIndex = current.indexOf('=');
23
+ if (eqIndex >= 0)
24
+ return { value: current.slice(eqIndex + 1), nextIndex: index };
25
+ const value = args[index + 1];
26
+ if (!value || value.startsWith('--'))
27
+ fail('invalidArguments', `${flag} requires a value.`);
28
+ return { value, nextIndex: index + 1 };
29
+ }
30
+ function printUsage() {
31
+ console.log(`Usage:
32
+ aw plugin remove <plugin-name> --workspace-root <path> --yes [--json]
33
+
34
+ Options:
35
+ --workspace-root <path> Catalog Workspace root. Required.
36
+ --yes Confirm deletion of the committed, unchanged plugin tree.
37
+ --json Emit one schema 1 JSON object.
38
+ -h, --help Show this help message.
39
+
40
+ The command deletes only the canonical plugins/<plugin-name> source root.
41
+ It does not change the Catalog version, commit, build, or publish.
42
+ `);
43
+ }
44
+ function parseArgs(argv) {
45
+ const args = argv.slice(2);
46
+ const options = { json: false, yes: false };
47
+ for (let index = 0; index < args.length; index += 1) {
48
+ const arg = args[index];
49
+ if (arg === '-h' || arg === '--help') {
50
+ printUsage();
51
+ process.exit(0);
52
+ }
53
+ if (arg === '--')
54
+ continue;
55
+ if (arg === '--json') {
56
+ options.json = true;
57
+ continue;
58
+ }
59
+ if (arg === '--yes') {
60
+ options.yes = true;
61
+ continue;
62
+ }
63
+ if (!arg.startsWith('--')) {
64
+ if (options.pluginName === undefined) {
65
+ options.pluginName = arg;
66
+ continue;
67
+ }
68
+ fail('invalidArguments', `Unexpected positional argument: ${arg}`);
69
+ }
70
+ const flag = arg.includes('=') ? arg.slice(0, arg.indexOf('=')) : arg;
71
+ const { value, nextIndex } = readOptionValue(args, index, flag);
72
+ index = nextIndex;
73
+ if (flag === '--workspace-root')
74
+ options.workspaceRoot = value;
75
+ else
76
+ fail('invalidArguments', `Unknown option: ${flag}`);
77
+ }
78
+ if (!options.pluginName)
79
+ fail('invalidArguments', 'Provide one plugin name.');
80
+ if (!PLUGIN_NAME_PATTERN.test(options.pluginName)) {
81
+ fail('invalidPluginName', `Plugin name must use lowercase hyphen-case: ${JSON.stringify(options.pluginName)}.`);
82
+ }
83
+ if (!options.workspaceRoot)
84
+ fail('invalidArguments', '--workspace-root is required.');
85
+ return options;
86
+ }
87
+ async function lstatOrNull(filePath) {
88
+ return fs.lstat(filePath).catch((error) => {
89
+ if (error?.code === 'ENOENT')
90
+ return null;
91
+ throw error;
92
+ });
93
+ }
94
+ async function assertWorkspaceInputPathHasNoSymlinks(workspaceRoot) {
95
+ const absoluteRoot = path.resolve(workspaceRoot);
96
+ const parsed = path.parse(absoluteRoot);
97
+ const segments = absoluteRoot.slice(parsed.root.length).split(path.sep).filter(Boolean);
98
+ let currentPath = parsed.root;
99
+ for (const segment of segments) {
100
+ currentPath = path.join(currentPath, segment);
101
+ const stat = await lstatOrNull(currentPath);
102
+ if (!stat)
103
+ return absoluteRoot;
104
+ if (stat.isSymbolicLink()) {
105
+ fail('unsafePluginPath', `Workspace root path must not contain symbolic links: ${currentPath}`);
106
+ }
107
+ if (!stat.isDirectory()) {
108
+ fail('unsafePluginPath', `Workspace root path component is not a directory: ${currentPath}`);
109
+ }
110
+ }
111
+ return absoluteRoot;
112
+ }
113
+ function parseTreeRecord(record) {
114
+ const tabIndex = record.indexOf('\t');
115
+ if (tabIndex < 0)
116
+ fail('gitInspectionFailed', `Invalid Git tree record: ${JSON.stringify(record)}.`);
117
+ const metadata = record.slice(0, tabIndex).split(' ');
118
+ return {
119
+ mode: metadata[0],
120
+ type: metadata[1],
121
+ objectId: metadata[2],
122
+ filePath: record.slice(tabIndex + 1),
123
+ };
124
+ }
125
+ function isInside(root, candidate) {
126
+ const relative = path.relative(root, candidate);
127
+ return relative === '' || (relative !== '..'
128
+ && !relative.startsWith(`..${path.sep}`)
129
+ && !path.isAbsolute(relative));
130
+ }
131
+ async function resolveGitWorkspace(workspaceRoot) {
132
+ let repoRoot;
133
+ let baseCommit;
134
+ try {
135
+ repoRoot = path.resolve((await runGit(workspaceRoot, ['rev-parse', '--show-toplevel'], {
136
+ code: 'gitWorkspaceInvalid',
137
+ label: 'Git repository discovery',
138
+ })).trim());
139
+ baseCommit = await resolveBaseCommit(repoRoot, 'HEAD');
140
+ }
141
+ catch (error) {
142
+ const code = error?.code === 'invalidBase' ? 'sourceHeadMissing' : (error?.code ?? 'gitWorkspaceInvalid');
143
+ fail(code, error.message);
144
+ }
145
+ if (!isInside(repoRoot, workspaceRoot)) {
146
+ fail('workspaceOutsideRepository', 'Catalog Workspace must stay inside its Git worktree root.');
147
+ }
148
+ return { repoRoot, baseCommit };
149
+ }
150
+ async function scanCurrentTree(root) {
151
+ const entries = new Map();
152
+ async function visit(currentRoot, prefix = '') {
153
+ const children = await fs.readdir(currentRoot, { withFileTypes: true });
154
+ for (const child of children) {
155
+ const relativePath = prefix ? `${prefix}/${child.name}` : child.name;
156
+ const absolutePath = path.join(currentRoot, child.name);
157
+ const stat = await fs.lstat(absolutePath);
158
+ if (stat.isSymbolicLink()) {
159
+ fail('unsafePluginTree', `Plugin tree must not contain symbolic links: ${absolutePath}`);
160
+ }
161
+ if (stat.isDirectory()) {
162
+ entries.set(relativePath, { mode: '040000', type: 'tree', absolutePath });
163
+ await visit(absolutePath, relativePath);
164
+ continue;
165
+ }
166
+ if (!stat.isFile()) {
167
+ fail('unsafePluginTree', `Plugin tree node must be a regular file or directory: ${absolutePath}`);
168
+ }
169
+ entries.set(relativePath, {
170
+ mode: (stat.mode & 0o111) === 0 ? '100644' : '100755',
171
+ type: 'blob',
172
+ absolutePath,
173
+ });
174
+ }
175
+ }
176
+ await visit(root);
177
+ return entries;
178
+ }
179
+ async function assertTreeMatchesHead(options) {
180
+ const { repoRoot, baseCommit, relativePluginRoot, pluginRoot } = options;
181
+ const rootOutput = await runGit(repoRoot, [
182
+ '--literal-pathspecs', 'ls-tree', '-z', baseCommit, '--', relativePluginRoot,
183
+ ], { buffer: true, label: 'Git plugin root tree' });
184
+ const rootRecords = rootOutput.toString('utf8').split('\0').filter(Boolean).map(parseTreeRecord);
185
+ if (rootRecords.length !== 1 || rootRecords[0].filePath !== relativePluginRoot) {
186
+ fail('pluginNotCommitted', `Plugin is not present in HEAD: ${relativePluginRoot}`);
187
+ }
188
+ if (rootRecords[0].mode !== '040000' || rootRecords[0].type !== 'tree') {
189
+ fail('pluginNotCommitted', `Plugin path in HEAD is not a directory tree: ${relativePluginRoot}`);
190
+ }
191
+ const status = await runGit(repoRoot, [
192
+ '--literal-pathspecs', 'status', '--porcelain=v1', '-z', '--ignored=matching', '--untracked-files=all',
193
+ '--', relativePluginRoot,
194
+ ], { buffer: true, label: 'Git plugin worktree status' });
195
+ const statusEntries = status.toString('utf8').split('\0').filter(Boolean);
196
+ if (statusEntries.length > 0) {
197
+ fail('pluginTreeDirty', `Plugin tree differs from HEAD: ${statusEntries.slice(0, 10).join(', ')}`);
198
+ }
199
+ const treeOutput = await runGit(repoRoot, [
200
+ '--literal-pathspecs', 'ls-tree', '-r', '-t', '-z', '--full-tree', baseCommit, '--', relativePluginRoot,
201
+ ], { buffer: true, label: 'Git plugin tree inventory' });
202
+ const headEntries = new Map();
203
+ for (const record of treeOutput.toString('utf8').split('\0').filter(Boolean).map(parseTreeRecord)) {
204
+ if (record.filePath === relativePluginRoot)
205
+ continue;
206
+ if (relativePluginRoot.startsWith(`${record.filePath}/`))
207
+ continue;
208
+ const prefix = `${relativePluginRoot}/`;
209
+ if (!record.filePath.startsWith(prefix)) {
210
+ fail('gitInspectionFailed', `Git returned a path outside the plugin tree: ${record.filePath}`);
211
+ }
212
+ headEntries.set(record.filePath.slice(prefix.length), record);
213
+ }
214
+ const currentEntries = await scanCurrentTree(pluginRoot);
215
+ const inventory = new Set([...headEntries.keys(), ...currentEntries.keys()]);
216
+ const mismatches = [];
217
+ for (const relativePath of [...inventory].sort()) {
218
+ const head = headEntries.get(relativePath);
219
+ const current = currentEntries.get(relativePath);
220
+ if (!head || !current || head.mode !== current.mode || head.type !== current.type) {
221
+ mismatches.push(relativePath);
222
+ continue;
223
+ }
224
+ if (head.type === 'blob') {
225
+ const headBytes = await runGit(repoRoot, ['cat-file', 'blob', head.objectId], {
226
+ buffer: true,
227
+ label: `Git blob ${head.objectId}`,
228
+ });
229
+ const currentBytes = await fs.readFile(current.absolutePath);
230
+ if (!headBytes.equals(currentBytes))
231
+ mismatches.push(relativePath);
232
+ }
233
+ }
234
+ if (mismatches.length > 0) {
235
+ fail('pluginTreeMismatch', `Plugin tree inventory, bytes, or modes differ from HEAD: ${mismatches.slice(0, 10).join(', ')}`);
236
+ }
237
+ }
238
+ function findReverseDependencies(plugins, targetName) {
239
+ return plugins
240
+ .filter((plugin) => (plugin.manifest.name !== targetName
241
+ && plugin.manifest.dependencies.includes(targetName)))
242
+ .map((plugin) => plugin.manifest.name)
243
+ .sort();
244
+ }
245
+ function shellQuote(value) {
246
+ return `'${String(value).replaceAll("'", "'\\''")}'`;
247
+ }
248
+ function createReceipt(options = {}) {
249
+ return {
250
+ schemaVersion: 1,
251
+ command: 'plugin:remove',
252
+ ok: options.ok ?? false,
253
+ workspaceRoot: options.workspaceRoot ?? null,
254
+ baseCommit: options.baseCommit ?? null,
255
+ plugin: options.plugin ?? null,
256
+ removed: options.removed ?? false,
257
+ errors: options.errors ?? [],
258
+ };
259
+ }
260
+ async function removePlugin(options, state) {
261
+ const requestedWorkspaceRoot = await assertWorkspaceInputPathHasNoSymlinks(options.workspaceRoot);
262
+ const pluginRoot = path.join(requestedWorkspaceRoot, 'plugins', options.pluginName);
263
+ state.workspaceRoot = requestedWorkspaceRoot;
264
+ state.plugin = { name: options.pluginName, version: null, root: pluginRoot };
265
+ let fenced;
266
+ try {
267
+ fenced = assertCanonicalAuthoringPluginRoot({
268
+ workspaceRoot: requestedWorkspaceRoot,
269
+ pluginRoot,
270
+ pluginName: options.pluginName,
271
+ requirePluginRoot: true,
272
+ requireManifest: true,
273
+ });
274
+ }
275
+ catch (error) {
276
+ fail((await lstatOrNull(pluginRoot)) ? 'unsafePluginPath' : 'pluginNotFound', error.message);
277
+ }
278
+ state.workspaceRoot = fenced.repoRoot;
279
+ state.plugin.root = fenced.pluginRoot;
280
+ const git = await resolveGitWorkspace(fenced.repoRoot);
281
+ state.baseCommit = git.baseCommit;
282
+ const relativePluginRoot = path.relative(git.repoRoot, fenced.pluginRoot).split(path.sep).join('/');
283
+ let document;
284
+ try {
285
+ document = await readManifestDocument(fenced.pluginRoot);
286
+ if (document.manifest.name !== options.pluginName) {
287
+ fail('manifestNameMismatch', `Manifest name ${JSON.stringify(document.manifest.name)} does not match ${JSON.stringify(options.pluginName)}.`);
288
+ }
289
+ state.plugin.version = parseStablePluginVersion(document.manifest.version, 'plugin version').raw;
290
+ }
291
+ catch (error) {
292
+ if (error instanceof PluginRemovalError)
293
+ throw error;
294
+ fail('invalidPlugin', error.message);
295
+ }
296
+ let workspace;
297
+ try {
298
+ workspace = await readCatalogWorkspace(fenced.repoRoot, {
299
+ reservedImports: CLI_RESERVED_IMPORTS,
300
+ });
301
+ }
302
+ catch (error) {
303
+ fail('workspaceInvalid', error.message);
304
+ }
305
+ await assertTreeMatchesHead({
306
+ repoRoot: git.repoRoot,
307
+ baseCommit: git.baseCommit,
308
+ relativePluginRoot,
309
+ pluginRoot: fenced.pluginRoot,
310
+ });
311
+ const dependents = findReverseDependencies(workspace.plugins, options.pluginName);
312
+ if (dependents.length > 0) {
313
+ fail('reverseDependencies', `Cannot remove ${JSON.stringify(options.pluginName)}; required by: ${dependents.join(', ')}.`);
314
+ }
315
+ if (!options.yes) {
316
+ fail('confirmationRequired', 'Plugin removal requires --yes.');
317
+ }
318
+ const recoveryCommand = `git --literal-pathspecs -C ${shellQuote(git.repoRoot)} restore --source=${git.baseCommit} -- ${shellQuote(relativePluginRoot)}`;
319
+ try {
320
+ await fs.rm(fenced.pluginRoot, { recursive: true });
321
+ }
322
+ catch (error) {
323
+ fail('removalFailed', `Could not remove plugin root ${fenced.pluginRoot}: ${error.message}. Restore it from HEAD with: ${recoveryCommand}`, recoveryCommand);
324
+ }
325
+ return createReceipt({
326
+ ok: true,
327
+ workspaceRoot: state.workspaceRoot,
328
+ baseCommit: state.baseCommit,
329
+ plugin: state.plugin,
330
+ removed: true,
331
+ });
332
+ }
333
+ async function main() {
334
+ const jsonRequested = process.argv.slice(2).includes('--json')
335
+ || process.argv.slice(2).some((arg) => arg.startsWith('--json='));
336
+ const state = { workspaceRoot: null, baseCommit: null, plugin: null };
337
+ try {
338
+ const options = parseArgs(process.argv);
339
+ const receipt = await removePlugin(options, state);
340
+ if (options.json)
341
+ console.log(JSON.stringify(receipt));
342
+ else
343
+ console.log(`[OK] Removed plugin source ${JSON.stringify(receipt.plugin.name)}: ${receipt.plugin.root}`);
344
+ }
345
+ catch (error) {
346
+ const code = error?.code ?? 'unexpectedError';
347
+ const message = error instanceof Error ? error.message : String(error);
348
+ const diagnostic = `[ERROR] ${message}`;
349
+ if (jsonRequested) {
350
+ console.log(JSON.stringify(createReceipt({
351
+ workspaceRoot: state.workspaceRoot,
352
+ baseCommit: state.baseCommit,
353
+ plugin: state.plugin,
354
+ errors: [{
355
+ code,
356
+ message,
357
+ ...(error?.recoveryCommand ? { recoveryCommand: error.recoveryCommand } : {}),
358
+ }],
359
+ })));
360
+ }
361
+ console.error(diagnostic);
362
+ process.exitCode = 1;
363
+ }
364
+ }
365
+ await main();
366
+ //# sourceMappingURL=remove-plugin.mjs.map
@@ -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;gBACpB,MAAM,EAAE,CAAC;wBACP,IAAI;wBACJ,OAAO;wBACP,GAAG,CAAC,KAAK,EAAE,eAAe,CAAC,CAAC,CAAC,EAAE,eAAe,EAAE,KAAK,CAAC,eAAe,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;qBAC9E,CAAC;aACH,CAAC,CAAC,CAAC,CAAC;QACP,CAAC;QACD,OAAO,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;QAC1B,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;IACvB,CAAC;AACH,CAAC;AAED,MAAM,IAAI,EAAE,CAAC"}
@@ -6,6 +6,7 @@ import { createRequire } from 'node:module';
6
6
  import * as os from 'node:os';
7
7
  import * as path from 'node:path';
8
8
  import { fileURLToPath, pathToFileURL } from 'node:url';
9
+ import { getPluginAuthoringAcceptedValues as getCorePluginAuthoringAcceptedValues, getSkillFrontmatterCapabilityRegistry, } from '@lesliechan721/aw-plugin-core/manifest';
9
10
  import { checkPluginVersions } from './lib/plugin-version-check.mjs';
10
11
  import { scanJavaScriptImportSpecifiers } from './lib/javascript-import-scanner.mjs';
11
12
  import { assertAuthoringPluginPathFence, assertCanonicalAuthoringPluginRoot, } from './lib/plugin-root.mjs';
@@ -17,7 +18,6 @@ const CLI_PACKAGE_ROOT = path.basename(authoringRuntimeRoot) === 'dist'
17
18
  : authoringRuntimeRoot;
18
19
  const errors = [];
19
20
  const warnings = [];
20
- let pluginAuthoringCapabilityRegistry = null;
21
21
  const SOURCE_PLUGIN_MANIFEST_CONTRACT_VERSION = 7;
22
22
  const MAX_SKILL_NAME_LEN = 64;
23
23
  const MAX_SKILL_DESCRIPTION_LEN = 1024;
@@ -50,9 +50,9 @@ const CODEX_POLICY_PRODUCTS = new Set([
50
50
  'codex',
51
51
  'CODEX',
52
52
  ]);
53
- const MANIFEST_POLICY_PRODUCTS = new Set(getPluginAuthoringAcceptedValues('plugin-manifest', 'marketplace.policy.products'));
54
- const MARKETPLACE_AUTHENTICATION_POLICIES = new Set(getPluginAuthoringAcceptedValues('plugin-manifest', 'marketplace.policy.authentication'));
55
- const MARKETPLACE_INSTALLATION_POLICIES = new Set(getPluginAuthoringAcceptedValues('plugin-manifest', 'marketplace.policy.installation'));
53
+ const MANIFEST_POLICY_PRODUCTS = new Set(getPluginAuthoringAcceptedValues('manifest', 'marketplace.policy.products'));
54
+ const MARKETPLACE_AUTHENTICATION_POLICIES = new Set(getPluginAuthoringAcceptedValues('manifest', 'marketplace.policy.authentication'));
55
+ const MARKETPLACE_INSTALLATION_POLICIES = new Set(getPluginAuthoringAcceptedValues('manifest', 'marketplace.policy.installation'));
56
56
  const PUBLIC_HOOK_EVENTS = new Set(['before_tool', 'after_tool', 'session_start']);
57
57
  const PUBLIC_SESSION_START_SOURCES = new Set(['startup', 'resume', 'clear']);
58
58
  const PUBLIC_SESSION_START_DEFAULT_MATCHER = 'startup|resume|clear';
@@ -130,9 +130,9 @@ const SCRIPT_OS_SELECTORS = new Set(['default', 'unix', 'windows', 'linux', 'dar
130
130
  const SCRIPT_LIFECYCLE_EVENTS = new Set(['install', 'upgrade', 'uninstall']);
131
131
  const SCRIPT_TIMEOUT_MIN_MS = 1000;
132
132
  const SCRIPT_TIMEOUT_MAX_MS = 300000;
133
- const CONFIG_FIELD_TYPES = new Set(getPluginAuthoringAcceptedValues('config-lifecycle-artifact', 'config.schema.<key>.type'));
134
- const ARTIFACT_TARGETS = new Set(getPluginAuthoringAcceptedValues('config-lifecycle-artifact', 'artifacts.targets[].target'));
135
- const ARTIFACT_STATES = new Set(getPluginAuthoringAcceptedValues('config-lifecycle-artifact', 'ArtifactPlan.artifacts[].state'));
133
+ const CONFIG_FIELD_TYPES = new Set(getPluginAuthoringAcceptedValues('config', 'config.schema.<key>.type'));
134
+ const ARTIFACT_TARGETS = new Set(getPluginAuthoringAcceptedValues('artifacts', 'artifacts.targets[].target'));
135
+ const ARTIFACT_STATES = new Set(getPluginAuthoringAcceptedValues('artifacts', 'artifacts.targets[].states'));
136
136
  const ARTIFACT_SCOPES = new Set(['user', 'project']);
137
137
  const ARTIFACT_KINDS = new Set(['instruction', 'codexRole', 'skill']);
138
138
  const ARTIFACT_PROJECT_MANAGED_KINDS = new Set(['instruction', 'agent', 'skill']);
@@ -164,7 +164,6 @@ const PLUGIN_EVAL_COMMAND_SUPPORTS = new Set([
164
164
  'allowEnvironmentSkips',
165
165
  ]);
166
166
  let yamlParser = null;
167
- let skillFrontmatterCapabilityRegistry = null;
168
167
  let pluginVersionCheckResult = null;
169
168
  function error(msg) {
170
169
  errors.push(msg);
@@ -323,47 +322,11 @@ function parseFrontmatter(content, sourceName) {
323
322
  return null;
324
323
  return parseYaml(match[1], sourceName);
325
324
  }
326
- function loadPluginAuthoringCapabilityRegistry() {
327
- if (pluginAuthoringCapabilityRegistry)
328
- return pluginAuthoringCapabilityRegistry;
329
- const registryPath = [
330
- path.join(CLI_PACKAGE_ROOT, 'dist', 'src', 'utils', 'plugin-authoring-capabilities.json'),
331
- path.resolve(__dirname, '..', '..', 'dist', 'src', 'utils', 'plugin-authoring-capabilities.json'),
332
- ].find((candidate) => fs.existsSync(candidate));
333
- if (!registryPath) {
334
- throw new Error('Plugin authoring capability registry not found in the built CLI.');
335
- }
336
- const registry = JSON.parse(fs.readFileSync(registryPath, 'utf8'));
337
- if (!registry || registry.schemaVersion !== 1 || !registry.surfaces) {
338
- throw new Error(`Invalid plugin authoring capability registry: ${registryPath}`);
339
- }
340
- pluginAuthoringCapabilityRegistry = registry;
341
- return registry;
342
- }
343
325
  function getPluginAuthoringAcceptedValues(surface, field) {
344
- const entry = loadPluginAuthoringCapabilityRegistry().surfaces[surface]?.entries
345
- ?.find((candidate) => candidate.field === field);
346
- if (!entry || !Array.isArray(entry.acceptedValues)) {
347
- throw new Error(`Plugin authoring capability ${surface}.${field} has no accepted values.`);
348
- }
349
- return entry.acceptedValues;
326
+ return getCorePluginAuthoringAcceptedValues(surface, field);
350
327
  }
351
328
  function loadSkillFrontmatterCapabilityRegistry() {
352
- if (skillFrontmatterCapabilityRegistry)
353
- return skillFrontmatterCapabilityRegistry;
354
- const registryPath = path.join(CLI_PACKAGE_ROOT, 'dist', 'src', 'utils', 'skill-frontmatter-capabilities.json');
355
- if (!fs.existsSync(registryPath)) {
356
- throw new Error(`Skill frontmatter capability registry not found: ${registryPath}`);
357
- }
358
- const registry = JSON.parse(fs.readFileSync(registryPath, 'utf8'));
359
- if (!registry ||
360
- registry.schemaVersion !== 1 ||
361
- !registry.profiles ||
362
- !registry.fields) {
363
- throw new Error(`Invalid Skill frontmatter capability registry: ${registryPath}`);
364
- }
365
- skillFrontmatterCapabilityRegistry = registry;
366
- return registry;
329
+ return getSkillFrontmatterCapabilityRegistry();
367
330
  }
368
331
  async function tryLoadCliManifestTools() {
369
332
  const manifestModulePath = path.join(CLI_PACKAGE_ROOT, 'dist', 'src', 'utils', 'manifest.js');