@lesliechan721/aw-plugin-core 0.1.0-beta.7 → 0.1.0-beta.8
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.
- package/dist/aw-capabilities.d.ts +27 -0
- package/dist/aw-capabilities.js +105 -0
- package/dist/aw-capabilities.js.map +1 -0
- package/dist/catalog-workspace-resolution.d.ts +10 -0
- package/dist/catalog-workspace-resolution.js +103 -0
- package/dist/catalog-workspace-resolution.js.map +1 -0
- package/dist/generated/{plugin-manifest-v1.d.ts → plugin-manifest-v2.d.ts} +31 -31
- package/dist/generated/{plugin-manifest-v1.js → plugin-manifest-v2.js} +1 -1
- package/dist/generated/plugin-manifest-v2.js.map +1 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/manifest-contract.d.ts +3 -6
- package/dist/manifest-contract.js +34 -62
- package/dist/manifest-contract.js.map +1 -1
- package/dist/manifest-type-contract.d.ts +2 -2
- package/dist/manifest.d.ts +8 -8
- package/dist/manifest.js +9 -7
- package/dist/manifest.js.map +1 -1
- package/dist/plugin-authoring-capabilities.js +2 -2
- package/dist/plugin-authoring-capabilities.js.map +1 -1
- package/dist/plugin-release.d.ts +3 -3
- package/dist/plugin-requirements.d.ts +33 -0
- package/dist/plugin-requirements.js +388 -0
- package/dist/plugin-requirements.js.map +1 -0
- package/dist/plugin-script-contract.d.ts +8 -0
- package/dist/plugin-script-contract.js +38 -1
- package/dist/plugin-script-contract.js.map +1 -1
- package/dist/types.d.ts +18 -19
- package/dist/workspace.d.ts +20 -4
- package/dist/workspace.js +352 -58
- package/dist/workspace.js.map +1 -1
- package/package.json +2 -2
- package/schemas/{plugin-manifest-v1.json → plugin-manifest-v2.json} +14 -8
- package/dist/generated/plugin-manifest-v1.js.map +0 -1
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export declare const AW_CAPABILITY_IDS: readonly ["aw.plugin-manifest.v2", "aw.plugin-skills.v1", "aw.plugin-build-config.v1", "aw.plugin-config.v1", "aw.plugin-lifecycle.v1", "aw.dynamic-artifacts.v2", "aw.portable-skills.v1", "aw.runtime-imports.v1", "aw.skill-validation.v1", "aw.plugin-authoring.v1", "aw.catalog-context.v1", "aw.catalog-authoring.v1", "aw.catalog-source.v2", "aw.catalog-dev-source.v1", "aw.catalog-publication.v1", "aw.catalog-snapshot.v5", "aw.self-check.v1"];
|
|
2
|
+
export type RegisteredAwCapabilityId = typeof AW_CAPABILITY_IDS[number];
|
|
3
|
+
export type AwCapabilityId = string;
|
|
4
|
+
export interface AwCapabilitySupport {
|
|
5
|
+
supported: boolean;
|
|
6
|
+
missing: AwCapabilityId[];
|
|
7
|
+
}
|
|
8
|
+
export declare function assertAwCapabilityId(value: unknown, fieldName?: string): asserts value is AwCapabilityId;
|
|
9
|
+
export declare function normalizeAwCapabilities(values: readonly unknown[], fieldName?: string): AwCapabilityId[];
|
|
10
|
+
export declare function getAwCapabilityRegistry(): readonly RegisteredAwCapabilityId[];
|
|
11
|
+
export declare function computeAwCapabilitySetDigest(values: readonly unknown[]): string;
|
|
12
|
+
export declare function checkAwCapabilitySupport(required: readonly unknown[], implemented: readonly unknown[]): AwCapabilitySupport;
|
|
13
|
+
export interface AwPluginRequirementsReceiptV1 {
|
|
14
|
+
schemaVersion: 1;
|
|
15
|
+
kind: 'aw-plugin-requirements';
|
|
16
|
+
plugin: {
|
|
17
|
+
name: string;
|
|
18
|
+
version: string;
|
|
19
|
+
};
|
|
20
|
+
requiredCapabilities: AwCapabilityId[];
|
|
21
|
+
digest: string;
|
|
22
|
+
}
|
|
23
|
+
export declare function createAwPluginRequirementsReceipt(plugin: {
|
|
24
|
+
name: string;
|
|
25
|
+
version: string;
|
|
26
|
+
}, requiredCapabilities: readonly unknown[]): AwPluginRequirementsReceiptV1;
|
|
27
|
+
export declare function parseAwPluginRequirementsReceipt(value: unknown): AwPluginRequirementsReceiptV1;
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { createHash } from 'node:crypto';
|
|
2
|
+
export const AW_CAPABILITY_IDS = [
|
|
3
|
+
'aw.plugin-manifest.v2',
|
|
4
|
+
'aw.plugin-skills.v1',
|
|
5
|
+
'aw.plugin-build-config.v1',
|
|
6
|
+
'aw.plugin-config.v1',
|
|
7
|
+
'aw.plugin-lifecycle.v1',
|
|
8
|
+
'aw.dynamic-artifacts.v2',
|
|
9
|
+
'aw.portable-skills.v1',
|
|
10
|
+
'aw.runtime-imports.v1',
|
|
11
|
+
'aw.skill-validation.v1',
|
|
12
|
+
'aw.plugin-authoring.v1',
|
|
13
|
+
'aw.catalog-context.v1',
|
|
14
|
+
'aw.catalog-authoring.v1',
|
|
15
|
+
'aw.catalog-source.v2',
|
|
16
|
+
'aw.catalog-dev-source.v1',
|
|
17
|
+
'aw.catalog-publication.v1',
|
|
18
|
+
'aw.catalog-snapshot.v5',
|
|
19
|
+
'aw.self-check.v1',
|
|
20
|
+
];
|
|
21
|
+
const CAPABILITY_ID_PATTERN = /^aw\.[a-z0-9]+(?:-[a-z0-9]+)*(?:\.[a-z0-9]+(?:-[a-z0-9]+)*)*\.v[1-9][0-9]*$/u;
|
|
22
|
+
const CAPABILITY_SET_DIGEST_DOMAIN = 'aw-capability-set-v1\0';
|
|
23
|
+
const PLUGIN_NAME_PATTERN = /^[a-z0-9]+(?:-[a-z0-9]+)*$/u;
|
|
24
|
+
const STRICT_SEMVER_PATTERN = /^(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)(?:-((?:0|[1-9][0-9]*|(?:[0-9A-Za-z-]*[A-Za-z-][0-9A-Za-z-]*))(?:\.(?:0|[1-9][0-9]*|(?:[0-9A-Za-z-]*[A-Za-z-][0-9A-Za-z-]*)))*))?(?:\+([0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*))?$/u;
|
|
25
|
+
export function assertAwCapabilityId(value, fieldName = 'capability') {
|
|
26
|
+
if (typeof value !== 'string' || !CAPABILITY_ID_PATTERN.test(value)) {
|
|
27
|
+
throw new Error(`Invalid ${fieldName}: expected an AW capability ID.`);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
export function normalizeAwCapabilities(values, fieldName = 'capabilities') {
|
|
31
|
+
const normalized = new Set();
|
|
32
|
+
values.forEach((value, index) => {
|
|
33
|
+
assertAwCapabilityId(value, `${fieldName}[${index}]`);
|
|
34
|
+
normalized.add(value);
|
|
35
|
+
});
|
|
36
|
+
return [...normalized].sort((left, right) => left < right ? -1 : left > right ? 1 : 0);
|
|
37
|
+
}
|
|
38
|
+
export function getAwCapabilityRegistry() {
|
|
39
|
+
const normalized = normalizeAwCapabilities(AW_CAPABILITY_IDS);
|
|
40
|
+
if (normalized.length !== AW_CAPABILITY_IDS.length) {
|
|
41
|
+
throw new Error('Invalid AW capability registry: capability IDs must be unique.');
|
|
42
|
+
}
|
|
43
|
+
return AW_CAPABILITY_IDS;
|
|
44
|
+
}
|
|
45
|
+
export function computeAwCapabilitySetDigest(values) {
|
|
46
|
+
const canonical = JSON.stringify(normalizeAwCapabilities(values));
|
|
47
|
+
return `sha256:${createHash('sha256').update(CAPABILITY_SET_DIGEST_DOMAIN).update(canonical).digest('hex')}`;
|
|
48
|
+
}
|
|
49
|
+
export function checkAwCapabilitySupport(required, implemented) {
|
|
50
|
+
const supported = new Set(normalizeAwCapabilities(implemented, 'implementedCapabilities'));
|
|
51
|
+
const missing = normalizeAwCapabilities(required, 'requiredCapabilities')
|
|
52
|
+
.filter((capability) => !supported.has(capability));
|
|
53
|
+
return { supported: missing.length === 0, missing };
|
|
54
|
+
}
|
|
55
|
+
export function createAwPluginRequirementsReceipt(plugin, requiredCapabilities) {
|
|
56
|
+
const normalized = normalizeAwCapabilities(requiredCapabilities);
|
|
57
|
+
return {
|
|
58
|
+
schemaVersion: 1,
|
|
59
|
+
kind: 'aw-plugin-requirements',
|
|
60
|
+
plugin,
|
|
61
|
+
requiredCapabilities: normalized,
|
|
62
|
+
digest: computeAwCapabilitySetDigest(normalized),
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
function assertRecord(value, fieldName) {
|
|
66
|
+
if (!value || typeof value !== 'object' || Array.isArray(value)) {
|
|
67
|
+
throw new Error(`Invalid ${fieldName}: expected an object.`);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
function assertExactKeys(value, keys, fieldName) {
|
|
71
|
+
const extras = Object.keys(value).filter((key) => !keys.includes(key));
|
|
72
|
+
if (extras.length > 0)
|
|
73
|
+
throw new Error(`Invalid ${fieldName}: unknown field ${JSON.stringify(extras[0])}.`);
|
|
74
|
+
}
|
|
75
|
+
export function parseAwPluginRequirementsReceipt(value) {
|
|
76
|
+
assertRecord(value, 'AW plugin requirements receipt');
|
|
77
|
+
assertExactKeys(value, ['schemaVersion', 'kind', 'plugin', 'requiredCapabilities', 'digest'], 'AW plugin requirements receipt');
|
|
78
|
+
if (value.schemaVersion !== 1)
|
|
79
|
+
throw new Error('Invalid AW plugin requirements receipt.schemaVersion: expected 1.');
|
|
80
|
+
if (value.kind !== 'aw-plugin-requirements')
|
|
81
|
+
throw new Error('Invalid AW plugin requirements receipt.kind.');
|
|
82
|
+
assertRecord(value.plugin, 'AW plugin requirements receipt.plugin');
|
|
83
|
+
assertExactKeys(value.plugin, ['name', 'version'], 'AW plugin requirements receipt.plugin');
|
|
84
|
+
if (typeof value.plugin.name !== 'string' || !PLUGIN_NAME_PATTERN.test(value.plugin.name)) {
|
|
85
|
+
throw new Error('Invalid AW plugin requirements receipt.plugin.name.');
|
|
86
|
+
}
|
|
87
|
+
if (typeof value.plugin.version !== 'string' || !STRICT_SEMVER_PATTERN.test(value.plugin.version)) {
|
|
88
|
+
throw new Error('Invalid AW plugin requirements receipt.plugin.version.');
|
|
89
|
+
}
|
|
90
|
+
if (!Array.isArray(value.requiredCapabilities)) {
|
|
91
|
+
throw new Error('Invalid AW plugin requirements receipt.requiredCapabilities: expected an array.');
|
|
92
|
+
}
|
|
93
|
+
const requiredCapabilities = normalizeAwCapabilities(value.requiredCapabilities, 'AW plugin requirements receipt.requiredCapabilities');
|
|
94
|
+
if (typeof value.digest !== 'string' || value.digest !== computeAwCapabilitySetDigest(requiredCapabilities)) {
|
|
95
|
+
throw new Error('Invalid AW plugin requirements receipt.digest.');
|
|
96
|
+
}
|
|
97
|
+
return {
|
|
98
|
+
schemaVersion: 1,
|
|
99
|
+
kind: 'aw-plugin-requirements',
|
|
100
|
+
plugin: { name: value.plugin.name, version: value.plugin.version },
|
|
101
|
+
requiredCapabilities,
|
|
102
|
+
digest: value.digest,
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
//# sourceMappingURL=aw-capabilities.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"aw-capabilities.js","sourceRoot":"","sources":["../src/aw-capabilities.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAExC,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B,uBAAuB;IACvB,qBAAqB;IACrB,2BAA2B;IAC3B,qBAAqB;IACrB,wBAAwB;IACxB,yBAAyB;IACzB,uBAAuB;IACvB,uBAAuB;IACvB,wBAAwB;IACxB,wBAAwB;IACxB,uBAAuB;IACvB,yBAAyB;IACzB,sBAAsB;IACtB,0BAA0B;IAC1B,2BAA2B;IAC3B,wBAAwB;IACxB,kBAAkB;CACV,CAAA;AAUV,MAAM,qBAAqB,GAAG,8EAA8E,CAAA;AAC5G,MAAM,4BAA4B,GAAG,wBAAwB,CAAA;AAC7D,MAAM,mBAAmB,GAAG,6BAA6B,CAAA;AACzD,MAAM,qBAAqB,GAAG,iOAAiO,CAAA;AAE/P,MAAM,UAAU,oBAAoB,CAAC,KAAc,EAAE,SAAS,GAAG,YAAY;IAC3E,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,CAAC,qBAAqB,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;QACpE,MAAM,IAAI,KAAK,CAAC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oBAAoB,EAC1B,qDAAqD,CACtD,CAAA;IACD,IAAI,OAAO,KAAK,CAAC,MAAM,KAAK,QAAQ,IAAI,KAAK,CAAC,MAAM,KAAK,4BAA4B,CAAC,oBAAoB,CAAC,EAAE,CAAC;QAC5G,MAAM,IAAI,KAAK,CAAC,gDAAgD,CAAC,CAAA;IACnE,CAAC;IACD,OAAO;QACL,aAAa,EAAE,CAAC;QAChB,IAAI,EAAE,wBAAwB;QAC9B,MAAM,EAAE,EAAE,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC,IAAI,EAAE,OAAO,EAAE,KAAK,CAAC,MAAM,CAAC,OAAO,EAAE;QAClE,oBAAoB;QACpB,MAAM,EAAE,KAAK,CAAC,MAAM;KACrB,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export type CatalogWorkspaceResolvedFrom = 'explicit' | 'workspace-marker' | 'git-worktree' | 'cwd';
|
|
2
|
+
export interface CatalogWorkspaceResolution {
|
|
3
|
+
workspaceRoot: string;
|
|
4
|
+
workspaceRootResolvedFrom: CatalogWorkspaceResolvedFrom;
|
|
5
|
+
}
|
|
6
|
+
export declare function resolveCatalogWorkspaceRoot(options: {
|
|
7
|
+
cwd: string;
|
|
8
|
+
explicitRoot?: string;
|
|
9
|
+
mode: 'existing' | 'initialize';
|
|
10
|
+
}): Promise<CatalogWorkspaceResolution>;
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { execFile } from 'node:child_process';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
import { promisify } from 'node:util';
|
|
4
|
+
import fs from 'fs-extra';
|
|
5
|
+
import { CATALOG_WORKSPACE_MARKER_FILENAME } from './workspace.js';
|
|
6
|
+
const execFileAsync = promisify(execFile);
|
|
7
|
+
async function startDirectory(value) {
|
|
8
|
+
const resolved = path.resolve(value);
|
|
9
|
+
const stat = await fs.lstat(resolved).catch((error) => {
|
|
10
|
+
if (error.code === 'ENOENT')
|
|
11
|
+
return null;
|
|
12
|
+
throw error;
|
|
13
|
+
});
|
|
14
|
+
if (stat?.isSymbolicLink())
|
|
15
|
+
throw new Error(`Catalog Workspace discovery path must not be a symbolic link: ${resolved}`);
|
|
16
|
+
return stat?.isFile() ? path.dirname(resolved) : resolved;
|
|
17
|
+
}
|
|
18
|
+
async function validateMarker(root) {
|
|
19
|
+
const markerPath = path.join(root, CATALOG_WORKSPACE_MARKER_FILENAME);
|
|
20
|
+
const stat = await fs.lstat(markerPath).catch((error) => {
|
|
21
|
+
if (error.code === 'ENOENT')
|
|
22
|
+
return null;
|
|
23
|
+
throw error;
|
|
24
|
+
});
|
|
25
|
+
if (!stat?.isFile() || stat.isSymbolicLink()) {
|
|
26
|
+
throw new Error(`Invalid Catalog Workspace marker: ${markerPath}`);
|
|
27
|
+
}
|
|
28
|
+
let marker;
|
|
29
|
+
try {
|
|
30
|
+
marker = await fs.readJson(markerPath);
|
|
31
|
+
}
|
|
32
|
+
catch {
|
|
33
|
+
throw new Error(`Invalid Catalog Workspace marker: ${markerPath}`);
|
|
34
|
+
}
|
|
35
|
+
const record = marker;
|
|
36
|
+
if (!record
|
|
37
|
+
|| typeof record !== 'object'
|
|
38
|
+
|| Array.isArray(record)
|
|
39
|
+
|| Object.keys(record).sort().join('\0') !== ['kind', 'schemaVersion', 'workspaceIdentity'].join('\0')
|
|
40
|
+
|| record.schemaVersion !== 1
|
|
41
|
+
|| record.kind !== 'aw-catalog-workspace'
|
|
42
|
+
|| typeof record.workspaceIdentity !== 'string'
|
|
43
|
+
|| record.workspaceIdentity.trim() === '') {
|
|
44
|
+
throw new Error(`Invalid Catalog Workspace marker: ${markerPath}`);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
async function findAncestorWorkspace(from) {
|
|
48
|
+
let current = await startDirectory(from);
|
|
49
|
+
for (;;) {
|
|
50
|
+
const markerPath = path.join(current, CATALOG_WORKSPACE_MARKER_FILENAME);
|
|
51
|
+
const markerStat = await fs.lstat(markerPath).catch((error) => {
|
|
52
|
+
if (error.code === 'ENOENT')
|
|
53
|
+
return null;
|
|
54
|
+
throw error;
|
|
55
|
+
});
|
|
56
|
+
if (markerStat) {
|
|
57
|
+
await validateMarker(current);
|
|
58
|
+
return fs.realpath(current);
|
|
59
|
+
}
|
|
60
|
+
const parent = path.dirname(current);
|
|
61
|
+
if (parent === current)
|
|
62
|
+
return null;
|
|
63
|
+
current = parent;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
async function findGitWorktreeRoot(cwd) {
|
|
67
|
+
try {
|
|
68
|
+
const env = { ...process.env };
|
|
69
|
+
delete env.GIT_DIR;
|
|
70
|
+
delete env.GIT_WORK_TREE;
|
|
71
|
+
delete env.GIT_COMMON_DIR;
|
|
72
|
+
env.GIT_OPTIONAL_LOCKS = '0';
|
|
73
|
+
const result = await execFileAsync('git', ['rev-parse', '--show-toplevel'], {
|
|
74
|
+
cwd: await startDirectory(cwd),
|
|
75
|
+
env,
|
|
76
|
+
encoding: 'utf8',
|
|
77
|
+
});
|
|
78
|
+
return fs.realpath(result.stdout.trim());
|
|
79
|
+
}
|
|
80
|
+
catch {
|
|
81
|
+
return null;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
export async function resolveCatalogWorkspaceRoot(options) {
|
|
85
|
+
if (options.explicitRoot !== undefined) {
|
|
86
|
+
const workspaceRoot = path.resolve(options.cwd, options.explicitRoot);
|
|
87
|
+
if (options.mode === 'existing')
|
|
88
|
+
await validateMarker(workspaceRoot);
|
|
89
|
+
return { workspaceRoot, workspaceRootResolvedFrom: 'explicit' };
|
|
90
|
+
}
|
|
91
|
+
const ancestor = await findAncestorWorkspace(options.cwd);
|
|
92
|
+
if (ancestor) {
|
|
93
|
+
return { workspaceRoot: ancestor, workspaceRootResolvedFrom: 'workspace-marker' };
|
|
94
|
+
}
|
|
95
|
+
if (options.mode === 'existing') {
|
|
96
|
+
throw new Error(`Catalog Workspace marker not found from: ${path.resolve(options.cwd)}`);
|
|
97
|
+
}
|
|
98
|
+
const gitRoot = await findGitWorktreeRoot(options.cwd);
|
|
99
|
+
if (gitRoot)
|
|
100
|
+
return { workspaceRoot: gitRoot, workspaceRootResolvedFrom: 'git-worktree' };
|
|
101
|
+
return { workspaceRoot: await startDirectory(options.cwd), workspaceRootResolvedFrom: 'cwd' };
|
|
102
|
+
}
|
|
103
|
+
//# sourceMappingURL=catalog-workspace-resolution.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"catalog-workspace-resolution.js","sourceRoot":"","sources":["../src/catalog-workspace-resolution.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAA;AAC7C,OAAO,IAAI,MAAM,WAAW,CAAA;AAC5B,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAA;AAErC,OAAO,EAAE,MAAM,UAAU,CAAA;AAEzB,OAAO,EAAE,iCAAiC,EAAE,MAAM,gBAAgB,CAAA;AAElE,MAAM,aAAa,GAAG,SAAS,CAAC,QAAQ,CAAC,CAAA;AASzC,KAAK,UAAU,cAAc,CAAC,KAAa;IACzC,MAAM,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAA;IACpC,MAAM,IAAI,GAAG,MAAM,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,KAAK,CAAC,CAAC,KAA4B,EAAE,EAAE;QAC3E,IAAI,KAAK,CAAC,IAAI,KAAK,QAAQ;YAAE,OAAO,IAAI,CAAA;QACxC,MAAM,KAAK,CAAA;IACb,CAAC,CAAC,CAAA;IACF,IAAI,IAAI,EAAE,cAAc,EAAE;QAAE,MAAM,IAAI,KAAK,CAAC,iEAAiE,QAAQ,EAAE,CAAC,CAAA;IACxH,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAA;AAC3D,CAAC;AAED,KAAK,UAAU,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1
|
/**
|
|
2
|
-
* This interface was referenced by `
|
|
2
|
+
* This interface was referenced by `PluginManifestSourceV2`'s JSON-Schema
|
|
3
3
|
* via the `definition` "semver".
|
|
4
4
|
*/
|
|
5
5
|
export type Semver = string;
|
|
6
6
|
/**
|
|
7
|
-
* This interface was referenced by `
|
|
7
|
+
* This interface was referenced by `PluginManifestSourceV2`'s JSON-Schema
|
|
8
8
|
* via the `definition` "pluginPath".
|
|
9
9
|
*/
|
|
10
10
|
export type PluginPath = string;
|
|
11
11
|
/**
|
|
12
|
-
* This interface was referenced by `
|
|
12
|
+
* This interface was referenced by `PluginManifestSourceV2`'s JSON-Schema
|
|
13
13
|
* via the `definition` "stringArray".
|
|
14
14
|
*/
|
|
15
15
|
export type StringArray = string[];
|
|
16
16
|
/**
|
|
17
|
-
* This interface was referenced by `
|
|
17
|
+
* This interface was referenced by `PluginManifestSourceV2`'s JSON-Schema
|
|
18
18
|
* via the `definition` "lifecycleDefinition".
|
|
19
19
|
*/
|
|
20
20
|
export type LifecycleDefinition = (string | {
|
|
@@ -25,8 +25,8 @@ export type LifecycleDefinition = (string | {
|
|
|
25
25
|
darwin?: ScriptEntry;
|
|
26
26
|
win32?: ScriptEntry;
|
|
27
27
|
});
|
|
28
|
-
export interface
|
|
29
|
-
schemaVersion
|
|
28
|
+
export interface PluginManifestSourceV2 {
|
|
29
|
+
schemaVersion: 2;
|
|
30
30
|
name: string;
|
|
31
31
|
version: Semver;
|
|
32
32
|
description: string;
|
|
@@ -34,7 +34,7 @@ export interface PluginManifestSourceV1 {
|
|
|
34
34
|
* @maxItems 64
|
|
35
35
|
*/
|
|
36
36
|
dependencies?: string[];
|
|
37
|
-
|
|
37
|
+
requires?: Requires;
|
|
38
38
|
skills?: PluginPath;
|
|
39
39
|
slashCommands?: PluginPath;
|
|
40
40
|
mcpServers?: PluginPath;
|
|
@@ -49,16 +49,16 @@ export interface PluginManifestSourceV1 {
|
|
|
49
49
|
config?: Config;
|
|
50
50
|
}
|
|
51
51
|
/**
|
|
52
|
-
* This interface was referenced by `
|
|
53
|
-
* via the `definition` "
|
|
52
|
+
* This interface was referenced by `PluginManifestSourceV2`'s JSON-Schema
|
|
53
|
+
* via the `definition` "requires".
|
|
54
54
|
*/
|
|
55
|
-
export interface
|
|
55
|
+
export interface Requires {
|
|
56
56
|
aw: {
|
|
57
|
-
|
|
57
|
+
capabilities?: string[];
|
|
58
58
|
};
|
|
59
59
|
}
|
|
60
60
|
/**
|
|
61
|
-
* This interface was referenced by `
|
|
61
|
+
* This interface was referenced by `PluginManifestSourceV2`'s JSON-Schema
|
|
62
62
|
* via the `definition` "distributions".
|
|
63
63
|
*/
|
|
64
64
|
export interface Distributions {
|
|
@@ -67,7 +67,7 @@ export interface Distributions {
|
|
|
67
67
|
};
|
|
68
68
|
}
|
|
69
69
|
/**
|
|
70
|
-
* This interface was referenced by `
|
|
70
|
+
* This interface was referenced by `PluginManifestSourceV2`'s JSON-Schema
|
|
71
71
|
* via the `definition` "marketplace".
|
|
72
72
|
*/
|
|
73
73
|
export interface Marketplace {
|
|
@@ -81,7 +81,7 @@ export interface Marketplace {
|
|
|
81
81
|
};
|
|
82
82
|
}
|
|
83
83
|
/**
|
|
84
|
-
* This interface was referenced by `
|
|
84
|
+
* This interface was referenced by `PluginManifestSourceV2`'s JSON-Schema
|
|
85
85
|
* via the `definition` "interface".
|
|
86
86
|
*/
|
|
87
87
|
export interface Interface {
|
|
@@ -90,7 +90,7 @@ export interface Interface {
|
|
|
90
90
|
capabilities?: string[];
|
|
91
91
|
}
|
|
92
92
|
/**
|
|
93
|
-
* This interface was referenced by `
|
|
93
|
+
* This interface was referenced by `PluginManifestSourceV2`'s JSON-Schema
|
|
94
94
|
* via the `definition` "extensions".
|
|
95
95
|
*/
|
|
96
96
|
export interface Extensions {
|
|
@@ -104,7 +104,7 @@ export interface Extensions {
|
|
|
104
104
|
agents?: Agent[];
|
|
105
105
|
}
|
|
106
106
|
/**
|
|
107
|
-
* This interface was referenced by `
|
|
107
|
+
* This interface was referenced by `PluginManifestSourceV2`'s JSON-Schema
|
|
108
108
|
* via the `definition` "instruction".
|
|
109
109
|
*/
|
|
110
110
|
export interface Instruction {
|
|
@@ -115,7 +115,7 @@ export interface Instruction {
|
|
|
115
115
|
agentOverrides?: PlatformOverrides;
|
|
116
116
|
}
|
|
117
117
|
/**
|
|
118
|
-
* This interface was referenced by `
|
|
118
|
+
* This interface was referenced by `PluginManifestSourceV2`'s JSON-Schema
|
|
119
119
|
* via the `definition` "platformOverrides".
|
|
120
120
|
*/
|
|
121
121
|
export interface PlatformOverrides {
|
|
@@ -127,7 +127,7 @@ export interface PlatformOverrides {
|
|
|
127
127
|
} | null);
|
|
128
128
|
}
|
|
129
129
|
/**
|
|
130
|
-
* This interface was referenced by `
|
|
130
|
+
* This interface was referenced by `PluginManifestSourceV2`'s JSON-Schema
|
|
131
131
|
* via the `definition` "permission".
|
|
132
132
|
*/
|
|
133
133
|
export interface Permission {
|
|
@@ -138,7 +138,7 @@ export interface Permission {
|
|
|
138
138
|
agentOverrides?: PlatformOverrides;
|
|
139
139
|
}
|
|
140
140
|
/**
|
|
141
|
-
* This interface was referenced by `
|
|
141
|
+
* This interface was referenced by `PluginManifestSourceV2`'s JSON-Schema
|
|
142
142
|
* via the `definition` "hook".
|
|
143
143
|
*/
|
|
144
144
|
export interface Hook {
|
|
@@ -148,7 +148,7 @@ export interface Hook {
|
|
|
148
148
|
agentOverrides?: PlatformOverrides;
|
|
149
149
|
}
|
|
150
150
|
/**
|
|
151
|
-
* This interface was referenced by `
|
|
151
|
+
* This interface was referenced by `PluginManifestSourceV2`'s JSON-Schema
|
|
152
152
|
* via the `definition` "nativeHook".
|
|
153
153
|
*/
|
|
154
154
|
export interface NativeHook {
|
|
@@ -157,7 +157,7 @@ export interface NativeHook {
|
|
|
157
157
|
command: string;
|
|
158
158
|
}
|
|
159
159
|
/**
|
|
160
|
-
* This interface was referenced by `
|
|
160
|
+
* This interface was referenced by `PluginManifestSourceV2`'s JSON-Schema
|
|
161
161
|
* via the `definition` "agent".
|
|
162
162
|
*/
|
|
163
163
|
export interface Agent {
|
|
@@ -168,14 +168,14 @@ export interface Agent {
|
|
|
168
168
|
agentOverrides?: PlatformOverrides;
|
|
169
169
|
}
|
|
170
170
|
/**
|
|
171
|
-
* This interface was referenced by `
|
|
171
|
+
* This interface was referenced by `PluginManifestSourceV2`'s JSON-Schema
|
|
172
172
|
* via the `definition` "artifacts".
|
|
173
173
|
*/
|
|
174
174
|
export interface Artifacts {
|
|
175
175
|
targets?: ArtifactTarget[];
|
|
176
176
|
}
|
|
177
177
|
/**
|
|
178
|
-
* This interface was referenced by `
|
|
178
|
+
* This interface was referenced by `PluginManifestSourceV2`'s JSON-Schema
|
|
179
179
|
* via the `definition` "artifactTarget".
|
|
180
180
|
*/
|
|
181
181
|
export interface ArtifactTarget {
|
|
@@ -206,7 +206,7 @@ export interface ArtifactTarget {
|
|
|
206
206
|
}[];
|
|
207
207
|
}
|
|
208
208
|
/**
|
|
209
|
-
* This interface was referenced by `
|
|
209
|
+
* This interface was referenced by `PluginManifestSourceV2`'s JSON-Schema
|
|
210
210
|
* via the `definition` "buildConfig".
|
|
211
211
|
*/
|
|
212
212
|
export interface BuildConfig {
|
|
@@ -257,7 +257,7 @@ export interface BuildConfig {
|
|
|
257
257
|
}[];
|
|
258
258
|
}
|
|
259
259
|
/**
|
|
260
|
-
* This interface was referenced by `
|
|
260
|
+
* This interface was referenced by `PluginManifestSourceV2`'s JSON-Schema
|
|
261
261
|
* via the `definition` "platformTemplateValue".
|
|
262
262
|
*/
|
|
263
263
|
export interface PlatformTemplateValue {
|
|
@@ -265,7 +265,7 @@ export interface PlatformTemplateValue {
|
|
|
265
265
|
codex: (string | boolean);
|
|
266
266
|
}
|
|
267
267
|
/**
|
|
268
|
-
* This interface was referenced by `
|
|
268
|
+
* This interface was referenced by `PluginManifestSourceV2`'s JSON-Schema
|
|
269
269
|
* via the `definition` "fileRules".
|
|
270
270
|
*/
|
|
271
271
|
export interface FileRules {
|
|
@@ -273,7 +273,7 @@ export interface FileRules {
|
|
|
273
273
|
exclude: StringArray;
|
|
274
274
|
}
|
|
275
275
|
/**
|
|
276
|
-
* This interface was referenced by `
|
|
276
|
+
* This interface was referenced by `PluginManifestSourceV2`'s JSON-Schema
|
|
277
277
|
* via the `definition` "importReference".
|
|
278
278
|
*/
|
|
279
279
|
export interface ImportReference {
|
|
@@ -281,7 +281,7 @@ export interface ImportReference {
|
|
|
281
281
|
export: string;
|
|
282
282
|
}
|
|
283
283
|
/**
|
|
284
|
-
* This interface was referenced by `
|
|
284
|
+
* This interface was referenced by `PluginManifestSourceV2`'s JSON-Schema
|
|
285
285
|
* via the `definition` "scripts".
|
|
286
286
|
*/
|
|
287
287
|
export interface Scripts {
|
|
@@ -306,7 +306,7 @@ export interface Scripts {
|
|
|
306
306
|
};
|
|
307
307
|
}
|
|
308
308
|
/**
|
|
309
|
-
* This interface was referenced by `
|
|
309
|
+
* This interface was referenced by `PluginManifestSourceV2`'s JSON-Schema
|
|
310
310
|
* via the `definition` "scriptEntry".
|
|
311
311
|
*/
|
|
312
312
|
export interface ScriptEntry {
|
|
@@ -315,7 +315,7 @@ export interface ScriptEntry {
|
|
|
315
315
|
args?: StringArray;
|
|
316
316
|
}
|
|
317
317
|
/**
|
|
318
|
-
* This interface was referenced by `
|
|
318
|
+
* This interface was referenced by `PluginManifestSourceV2`'s JSON-Schema
|
|
319
319
|
* via the `definition` "config".
|
|
320
320
|
*/
|
|
321
321
|
export interface Config {
|
|
@@ -352,7 +352,7 @@ export interface Config {
|
|
|
352
352
|
};
|
|
353
353
|
}
|
|
354
354
|
/**
|
|
355
|
-
* This interface was referenced by `
|
|
355
|
+
* This interface was referenced by `PluginManifestSourceV2`'s JSON-Schema
|
|
356
356
|
* via the `definition` "configField".
|
|
357
357
|
*/
|
|
358
358
|
export interface ConfigField {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin-manifest-v2.js","sourceRoot":"","sources":["../../src/generated/plugin-manifest-v2.ts"],"names":[],"mappings":"AAAA,uFAAuF"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export * from './manifest.js';
|
|
2
|
-
export type {
|
|
2
|
+
export type { PluginManifestSourceV2 } from './generated/plugin-manifest-v2.js';
|
|
3
3
|
export * from './workspace.js';
|
|
4
|
+
export * from './catalog-workspace-resolution.js';
|
|
4
5
|
export * from './plugin-release.js';
|
package/dist/index.js
CHANGED
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAA;AAE7B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,qBAAqB,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAA;AAE7B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,mCAAmC,CAAA;AACjD,cAAc,qBAAqB,CAAA"}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { SOURCE_PLUGIN_MANIFEST_CONTRACT_VERSION } from './manifest.js';
|
|
2
|
-
import type { CatalogMarketplaceIdentity, CatalogChannel, CatalogManifestEntry, MarketplaceManifest, MarketplaceSourceMeta, PlatformName, PlatformPluginManifest,
|
|
2
|
+
import type { CatalogMarketplaceIdentity, CatalogChannel, CatalogManifestEntry, MarketplaceManifest, MarketplaceSourceMeta, PlatformName, PlatformPluginManifest, PluginRequirements, PluginManifestSource, NormalizedPluginManifest, PluginMeta } from './types.js';
|
|
3
3
|
export declare const SOURCE_MANIFEST_PATH: string;
|
|
4
4
|
export { SOURCE_PLUGIN_MANIFEST_CONTRACT_VERSION };
|
|
5
5
|
export declare const MARKETPLACE_SOURCE_PATH: string;
|
|
6
|
-
export declare const DEFAULT_SOURCE_PLUGIN_AW_MIN_VERSION = "0.0.0";
|
|
7
6
|
export interface StrictSemVer {
|
|
8
7
|
raw: string;
|
|
9
8
|
major: number;
|
|
@@ -64,8 +63,6 @@ export declare function validateMarketplaceSourceMeta(rawValue: unknown): Market
|
|
|
64
63
|
export declare function normalizeCatalogMarketplaceIdentity(rawValue: unknown, fieldName?: string): CatalogMarketplaceIdentity;
|
|
65
64
|
export declare function readMarketplaceSourceMeta(repoRoot: string): Promise<MarketplaceSourceMeta>;
|
|
66
65
|
export interface ValidatePluginManifestOptions {
|
|
67
|
-
compatibilityMode?: 'defaulted' | 'required';
|
|
68
|
-
defaultMinVersion?: string;
|
|
69
66
|
reservedImports?: ReservedImportRegistry;
|
|
70
67
|
}
|
|
71
68
|
export type ReservedImportRegistry = Readonly<Record<string, readonly string[]>>;
|
|
@@ -87,10 +84,10 @@ export declare function normalizeManifestDigestInput(value: PluginManifestSource
|
|
|
87
84
|
export interface NormalizedCatalogManifestBase {
|
|
88
85
|
catalogVersion: string;
|
|
89
86
|
channel: CatalogChannel;
|
|
90
|
-
|
|
87
|
+
requires: PluginRequirements;
|
|
91
88
|
}
|
|
92
89
|
export declare function normalizeCatalogManifestBase(input: Record<string, unknown>, fieldName: string): NormalizedCatalogManifestBase;
|
|
93
90
|
export declare function normalizeCatalogManifestEntries(rawEntries: unknown, base: NormalizedCatalogManifestBase, fieldName: string): CatalogManifestEntry[];
|
|
94
|
-
export declare function createBundleSourceManifest(plugin: PluginMeta): NormalizedPluginManifest;
|
|
91
|
+
export declare function createBundleSourceManifest(plugin: PluginMeta, requiredCapabilities?: readonly string[]): NormalizedPluginManifest;
|
|
95
92
|
export declare function createPlatformManifestBase(plugin: PluginMeta): PlatformPluginManifest;
|
|
96
93
|
export declare function validatePlatformManifestProjection(plugin: PluginMeta, platform: PlatformName, rawManifest: unknown): Promise<PlatformPluginManifest>;
|