@lesliechan721/aw-plugin-core 0.1.0-beta.10 → 0.1.0-beta.12
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 +1 -1
- package/dist/aw-capabilities.js +1 -1
- package/dist/aw-capabilities.js.map +1 -1
- package/dist/generated/plugin-manifest-v3.d.ts +33 -16
- package/dist/manifest-contract.js +78 -5
- package/dist/manifest-contract.js.map +1 -1
- package/dist/manifest.d.ts +1 -1
- package/dist/manifest.js +1 -1
- package/dist/plugin-authoring-capabilities.d.ts +1 -1
- package/dist/plugin-authoring-capabilities.js +11 -7
- package/dist/plugin-authoring-capabilities.js.map +1 -1
- package/dist/plugin-config.js +43 -17
- package/dist/plugin-config.js.map +1 -1
- package/dist/plugin-requirements.js +2 -2
- package/dist/plugin-requirements.js.map +1 -1
- package/dist/plugin-script-contract.d.ts +2 -2
- package/dist/plugin-script-contract.js +2 -2
- package/dist/plugin-script-contract.js.map +1 -1
- package/dist/types.d.ts +21 -6
- package/package.json +6 -3
- package/schemas/plugin-manifest-v3.json +33 -17
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const AW_CAPABILITY_IDS: readonly ["aw.plugin-manifest.v3", "aw.plugin-skills.v1", "aw.plugin-build-config.v1", "aw.plugin-config.v2", "aw.plugin-
|
|
1
|
+
export declare const AW_CAPABILITY_IDS: readonly ["aw.plugin-manifest.v3", "aw.plugin-skills.v1", "aw.plugin-build-config.v1", "aw.plugin-config.v2", "aw.plugin-pre-apply.v1", "aw.dynamic-artifacts.v2", "aw.portable-skills.v1", "aw.runtime-imports.v1", "aw.skill-validation.v1", "aw.skill-eval.v2", "aw.plugin-authoring.v1", "aw.catalog-authoring.v1", "aw.catalog-source.v2", "aw.catalog-dev-source.v1", "aw.catalog-publication.v1", "aw.review-publication.v1", "aw.catalog-snapshot.v7", "aw.self-check.v1"];
|
|
2
2
|
export type RegisteredAwCapabilityId = typeof AW_CAPABILITY_IDS[number];
|
|
3
3
|
export type AwCapabilityId = string;
|
|
4
4
|
export interface AwCapabilitySupport {
|
package/dist/aw-capabilities.js
CHANGED
|
@@ -1 +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,
|
|
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,kBAAkB;IAClB,wBAAwB;IACxB,yBAAyB;IACzB,sBAAsB;IACtB,0BAA0B;IAC1B,2BAA2B;IAC3B,0BAA0B;IAC1B,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,WAAW,SAAS,iCAAiC,CAAC,CAAA;IACxE,CAAC;AACH,CAAC;AAED,MAAM,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AM,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"}
|
|
@@ -84,6 +84,11 @@ export type ArtifactRuntimeImports = {
|
|
|
84
84
|
* via the `definition` "configField".
|
|
85
85
|
*/
|
|
86
86
|
export type ConfigField = (ConfigStringField | ConfigNumberField | ConfigBooleanField | ConfigObjectField);
|
|
87
|
+
/**
|
|
88
|
+
* This interface was referenced by `PluginManifestSourceV3`'s JSON-Schema
|
|
89
|
+
* via the `definition` "configStringField".
|
|
90
|
+
*/
|
|
91
|
+
export type ConfigStringField = (ConfigPlainStringField | ConfigSensitiveStringField);
|
|
87
92
|
/**
|
|
88
93
|
* This interface was referenced by `PluginManifestSourceV3`'s JSON-Schema
|
|
89
94
|
* via the `definition` "configObjectField".
|
|
@@ -348,7 +353,7 @@ export interface ImportReference {
|
|
|
348
353
|
* via the `definition` "scripts".
|
|
349
354
|
*/
|
|
350
355
|
export interface Scripts {
|
|
351
|
-
|
|
356
|
+
preApply?: PreApply;
|
|
352
357
|
helpers?: {
|
|
353
358
|
config: string;
|
|
354
359
|
};
|
|
@@ -365,9 +370,9 @@ export interface Scripts {
|
|
|
365
370
|
}
|
|
366
371
|
/**
|
|
367
372
|
* This interface was referenced by `PluginManifestSourceV3`'s JSON-Schema
|
|
368
|
-
* via the `definition` "
|
|
373
|
+
* via the `definition` "preApply".
|
|
369
374
|
*/
|
|
370
|
-
export interface
|
|
375
|
+
export interface PreApply {
|
|
371
376
|
path: PluginPath;
|
|
372
377
|
timeoutMs?: number;
|
|
373
378
|
}
|
|
@@ -400,15 +405,15 @@ export interface Config {
|
|
|
400
405
|
}
|
|
401
406
|
/**
|
|
402
407
|
* This interface was referenced by `PluginManifestSourceV3`'s JSON-Schema
|
|
403
|
-
* via the `definition` "
|
|
408
|
+
* via the `definition` "configPlainStringField".
|
|
404
409
|
*/
|
|
405
|
-
export interface
|
|
410
|
+
export interface ConfigPlainStringField {
|
|
406
411
|
type: "string";
|
|
407
412
|
title?: string;
|
|
408
413
|
description?: string;
|
|
409
414
|
default?: string;
|
|
410
415
|
required?: boolean;
|
|
411
|
-
sensitive?:
|
|
416
|
+
sensitive?: false;
|
|
412
417
|
choices?: ConfigStringChoices;
|
|
413
418
|
validation?: ConfigStringValidation;
|
|
414
419
|
}
|
|
@@ -441,6 +446,18 @@ export interface ConfigStringValidation {
|
|
|
441
446
|
pattern?: string;
|
|
442
447
|
format?: ("identifier" | "slug" | "semver" | "url" | "hostname" | "email");
|
|
443
448
|
}
|
|
449
|
+
/**
|
|
450
|
+
* This interface was referenced by `PluginManifestSourceV3`'s JSON-Schema
|
|
451
|
+
* via the `definition` "configSensitiveStringField".
|
|
452
|
+
*/
|
|
453
|
+
export interface ConfigSensitiveStringField {
|
|
454
|
+
type: "string";
|
|
455
|
+
title?: string;
|
|
456
|
+
description?: string;
|
|
457
|
+
required?: boolean;
|
|
458
|
+
sensitive: true;
|
|
459
|
+
validation?: ConfigStringValidation;
|
|
460
|
+
}
|
|
444
461
|
/**
|
|
445
462
|
* This interface was referenced by `PluginManifestSourceV3`'s JSON-Schema
|
|
446
463
|
* via the `definition` "configNumberField".
|
|
@@ -451,7 +468,7 @@ export interface ConfigNumberField {
|
|
|
451
468
|
description?: string;
|
|
452
469
|
default?: number;
|
|
453
470
|
required?: boolean;
|
|
454
|
-
sensitive?:
|
|
471
|
+
sensitive?: never;
|
|
455
472
|
choices?: ConfigNumberChoices;
|
|
456
473
|
validation?: ConfigNumberValidation;
|
|
457
474
|
}
|
|
@@ -494,7 +511,7 @@ export interface ConfigBooleanField {
|
|
|
494
511
|
description?: string;
|
|
495
512
|
default?: boolean;
|
|
496
513
|
required?: boolean;
|
|
497
|
-
sensitive?:
|
|
514
|
+
sensitive?: never;
|
|
498
515
|
choices?: ConfigBooleanChoices;
|
|
499
516
|
}
|
|
500
517
|
/**
|
|
@@ -528,7 +545,7 @@ export interface ConfigFixedObjectField {
|
|
|
528
545
|
[k: string]: ConfigScalar;
|
|
529
546
|
};
|
|
530
547
|
required?: boolean;
|
|
531
|
-
sensitive?:
|
|
548
|
+
sensitive?: never;
|
|
532
549
|
choices?: ConfigObjectChoices;
|
|
533
550
|
properties: {
|
|
534
551
|
[k: string]: ConfigScalarChildField;
|
|
@@ -566,7 +583,7 @@ export interface ConfigStringChildField {
|
|
|
566
583
|
title?: string;
|
|
567
584
|
description?: string;
|
|
568
585
|
required?: boolean;
|
|
569
|
-
sensitive?:
|
|
586
|
+
sensitive?: never;
|
|
570
587
|
choices?: ConfigStringChoices;
|
|
571
588
|
validation?: ConfigStringValidation;
|
|
572
589
|
}
|
|
@@ -579,7 +596,7 @@ export interface ConfigNumberChildField {
|
|
|
579
596
|
title?: string;
|
|
580
597
|
description?: string;
|
|
581
598
|
required?: boolean;
|
|
582
|
-
sensitive?:
|
|
599
|
+
sensitive?: never;
|
|
583
600
|
choices?: ConfigNumberChoices;
|
|
584
601
|
validation?: ConfigNumberValidation;
|
|
585
602
|
}
|
|
@@ -592,7 +609,7 @@ export interface ConfigBooleanChildField {
|
|
|
592
609
|
title?: string;
|
|
593
610
|
description?: string;
|
|
594
611
|
required?: boolean;
|
|
595
|
-
sensitive?:
|
|
612
|
+
sensitive?: never;
|
|
596
613
|
choices?: ConfigBooleanChoices;
|
|
597
614
|
}
|
|
598
615
|
/**
|
|
@@ -616,7 +633,7 @@ export interface ConfigKeyValueObjectField {
|
|
|
616
633
|
[k: string]: ConfigScalar;
|
|
617
634
|
};
|
|
618
635
|
required?: boolean;
|
|
619
|
-
sensitive?:
|
|
636
|
+
sensitive?: never;
|
|
620
637
|
choices?: ConfigObjectChoices;
|
|
621
638
|
additionalProperties: ConfigScalarDynamicField;
|
|
622
639
|
validation?: ConfigObjectValidation;
|
|
@@ -629,7 +646,7 @@ export interface ConfigStringDynamicField {
|
|
|
629
646
|
type: "string";
|
|
630
647
|
title?: string;
|
|
631
648
|
description?: string;
|
|
632
|
-
sensitive?:
|
|
649
|
+
sensitive?: never;
|
|
633
650
|
choices?: ConfigStringChoices;
|
|
634
651
|
validation?: ConfigStringValidation;
|
|
635
652
|
}
|
|
@@ -641,7 +658,7 @@ export interface ConfigNumberDynamicField {
|
|
|
641
658
|
type: "number";
|
|
642
659
|
title?: string;
|
|
643
660
|
description?: string;
|
|
644
|
-
sensitive?:
|
|
661
|
+
sensitive?: never;
|
|
645
662
|
choices?: ConfigNumberChoices;
|
|
646
663
|
validation?: ConfigNumberValidation;
|
|
647
664
|
}
|
|
@@ -653,6 +670,6 @@ export interface ConfigBooleanDynamicField {
|
|
|
653
670
|
type: "boolean";
|
|
654
671
|
title?: string;
|
|
655
672
|
description?: string;
|
|
656
|
-
sensitive?:
|
|
673
|
+
sensitive?: never;
|
|
657
674
|
choices?: ConfigBooleanChoices;
|
|
658
675
|
}
|
|
@@ -887,7 +887,7 @@ function normalizeScriptEntry(pluginRoot, value, fieldName) {
|
|
|
887
887
|
: ensureStringArray(input.args, `${fieldName}.args`),
|
|
888
888
|
};
|
|
889
889
|
}
|
|
890
|
-
function
|
|
890
|
+
function normalizePreApplyScript(pluginRoot, value, fieldName) {
|
|
891
891
|
const input = assertObject(value, fieldName);
|
|
892
892
|
assertAllowedKeys(input, fieldName, ['path', 'timeoutMs']);
|
|
893
893
|
const scriptPath = normalizePluginScriptPath(pluginRoot, input.path, `${fieldName}.path`);
|
|
@@ -1028,10 +1028,10 @@ function normalizeArtifactScripts(pluginRoot, value, fieldName) {
|
|
|
1028
1028
|
}
|
|
1029
1029
|
function normalizePluginScripts(pluginRoot, value, fieldName) {
|
|
1030
1030
|
const input = assertObject(value, fieldName);
|
|
1031
|
-
assertAllowedKeys(input, fieldName, ['
|
|
1031
|
+
assertAllowedKeys(input, fieldName, ['preApply', 'helpers', 'node', 'artifacts', 'tests']);
|
|
1032
1032
|
const output = {};
|
|
1033
|
-
if (input.
|
|
1034
|
-
output.
|
|
1033
|
+
if (input.preApply !== undefined) {
|
|
1034
|
+
output.preApply = normalizePreApplyScript(pluginRoot, input.preApply, `${fieldName}.preApply`);
|
|
1035
1035
|
}
|
|
1036
1036
|
if (input.helpers !== undefined) {
|
|
1037
1037
|
output.helpers = normalizeScriptHelpers(pluginRoot, input.helpers, `${fieldName}.helpers`);
|
|
@@ -1176,6 +1176,32 @@ function normalizeArtifactRefreshKeys(value, fieldName, schema) {
|
|
|
1176
1176
|
}
|
|
1177
1177
|
return normalized;
|
|
1178
1178
|
}
|
|
1179
|
+
function configFieldContainsSensitiveValue(field) {
|
|
1180
|
+
if (field.sensitive === true)
|
|
1181
|
+
return true;
|
|
1182
|
+
if (field.type !== 'object')
|
|
1183
|
+
return false;
|
|
1184
|
+
return ((field.properties
|
|
1185
|
+
? Object.values(field.properties).some((child) => child.sensitive === true)
|
|
1186
|
+
: false)
|
|
1187
|
+
|| (field.additionalProperties !== false && field.additionalProperties?.sensitive === true));
|
|
1188
|
+
}
|
|
1189
|
+
function assertSkillRefreshKeysAreNotSensitive(options) {
|
|
1190
|
+
const skillTarget = options.target === 'codex.skill'
|
|
1191
|
+
|| options.target === 'claude.skill'
|
|
1192
|
+
|| options.target === 'agent-skills.skill';
|
|
1193
|
+
if (!skillTarget)
|
|
1194
|
+
return;
|
|
1195
|
+
for (const [index, key] of options.refreshKeys.entries()) {
|
|
1196
|
+
const field = options.schema?.fields[key];
|
|
1197
|
+
if (field && configFieldContainsSensitiveValue(field)) {
|
|
1198
|
+
const native = options.delivery?.mode === 'codex-native';
|
|
1199
|
+
throw new Error(`${native ? 'codexNativeRenderSensitiveRefreshKey' : 'skillRenderSensitiveRefreshKey'}: ` +
|
|
1200
|
+
`Invalid ${options.fieldName}[${index}]: ` +
|
|
1201
|
+
`${native ? 'codex-native renderers' : 'Skill renderers'} cannot read sensitive config field "${key}".`);
|
|
1202
|
+
}
|
|
1203
|
+
}
|
|
1204
|
+
}
|
|
1179
1205
|
function normalizeCodexSkillDelivery(value, fieldName) {
|
|
1180
1206
|
const input = assertObject(value, fieldName);
|
|
1181
1207
|
const mode = ensureString(input.mode, `${fieldName}.mode`);
|
|
@@ -1347,6 +1373,14 @@ function normalizeArtifactTargetEntry(pluginRoot, entry, fieldName, schema, rese
|
|
|
1347
1373
|
if (!portable && input.runtimeImports !== undefined) {
|
|
1348
1374
|
throw new Error(`Invalid ${fieldName}.runtimeImports: runtimeImports are only supported for agent-skills.skill targets.`);
|
|
1349
1375
|
}
|
|
1376
|
+
const refreshKeys = normalizeArtifactRefreshKeys(input.refreshKeys, `${fieldName}.refreshKeys`, schema);
|
|
1377
|
+
assertSkillRefreshKeysAreNotSensitive({
|
|
1378
|
+
target,
|
|
1379
|
+
delivery,
|
|
1380
|
+
refreshKeys,
|
|
1381
|
+
schema,
|
|
1382
|
+
fieldName: `${fieldName}.refreshKeys`,
|
|
1383
|
+
});
|
|
1350
1384
|
return {
|
|
1351
1385
|
id,
|
|
1352
1386
|
platform,
|
|
@@ -1356,7 +1390,7 @@ function normalizeArtifactTargetEntry(pluginRoot, entry, fieldName, schema, rese
|
|
|
1356
1390
|
kind,
|
|
1357
1391
|
projectManagedKind,
|
|
1358
1392
|
states: normalizeArtifactStates(input.states, `${fieldName}.states`),
|
|
1359
|
-
refreshKeys
|
|
1393
|
+
refreshKeys,
|
|
1360
1394
|
delivery,
|
|
1361
1395
|
requiresCodexProjectConfig: input.requiresCodexProjectConfig === undefined
|
|
1362
1396
|
? undefined
|
|
@@ -1415,6 +1449,44 @@ function normalizeArtifacts(pluginRoot, value, fieldName, schema, reservedImport
|
|
|
1415
1449
|
})();
|
|
1416
1450
|
return { targets };
|
|
1417
1451
|
}
|
|
1452
|
+
function canonicalScopeSet(scopes) {
|
|
1453
|
+
return [...scopes].sort().join(',');
|
|
1454
|
+
}
|
|
1455
|
+
function assertCodexSharedNativeScopeConsistency(manifest) {
|
|
1456
|
+
if (!supportsPlatform(manifest, 'codex'))
|
|
1457
|
+
return;
|
|
1458
|
+
const nativeComponents = [];
|
|
1459
|
+
if (manifest.skills) {
|
|
1460
|
+
nativeComponents.push({ key: 'skills', scopes: ['project', 'user'] });
|
|
1461
|
+
}
|
|
1462
|
+
if (manifest.mcpServers) {
|
|
1463
|
+
nativeComponents.push({ key: 'mcpServers', scopes: ['project', 'user'] });
|
|
1464
|
+
}
|
|
1465
|
+
if (resolvePlatformHookDefinitions(manifest, 'codex').length > 0) {
|
|
1466
|
+
nativeComponents.push({ key: 'hooks', scopes: ['project', 'user'] });
|
|
1467
|
+
}
|
|
1468
|
+
if (manifest.apps) {
|
|
1469
|
+
nativeComponents.push({ key: 'apps', scopes: ['project', 'user'] });
|
|
1470
|
+
}
|
|
1471
|
+
for (const [index, target] of (manifest.artifacts?.targets ?? []).entries()) {
|
|
1472
|
+
if (target.delivery?.mode === 'codex-native') {
|
|
1473
|
+
nativeComponents.push({
|
|
1474
|
+
key: `artifacts.targets[${index}]`,
|
|
1475
|
+
scopes: [...target.scopes],
|
|
1476
|
+
});
|
|
1477
|
+
}
|
|
1478
|
+
}
|
|
1479
|
+
const expected = nativeComponents[0];
|
|
1480
|
+
if (!expected)
|
|
1481
|
+
return;
|
|
1482
|
+
const expectedScopes = canonicalScopeSet(expected.scopes);
|
|
1483
|
+
const mismatch = nativeComponents.find((component) => canonicalScopeSet(component.scopes) !== expectedScopes);
|
|
1484
|
+
if (mismatch) {
|
|
1485
|
+
throw new Error(`codexSharedNativeScopeMismatch: Codex native component scope sets must match exactly; ` +
|
|
1486
|
+
`${expected.key} has {${expectedScopes}} but ${mismatch.key} has ` +
|
|
1487
|
+
`{${canonicalScopeSet(mismatch.scopes)}}.`);
|
|
1488
|
+
}
|
|
1489
|
+
}
|
|
1418
1490
|
function normalizePlatformAgentOverrides(value, fieldName, normalizer) {
|
|
1419
1491
|
const input = assertObject(value, fieldName);
|
|
1420
1492
|
assertAllowedKeys(input, fieldName, ['claude', 'codex']);
|
|
@@ -1872,6 +1944,7 @@ export function validatePluginManifest(pluginRoot, rawManifest, options = {}) {
|
|
|
1872
1944
|
throw new Error('Invalid artifacts.targets: agent-skills targets require distributions.agentSkills declaration.');
|
|
1873
1945
|
}
|
|
1874
1946
|
assertManifestPlatformSupport(manifest.name, manifest);
|
|
1947
|
+
assertCodexSharedNativeScopeConsistency(manifest);
|
|
1875
1948
|
return manifest;
|
|
1876
1949
|
}
|
|
1877
1950
|
async function validateDeclaredNativeAssets(pluginRoot, manifest) {
|