@lesliechan721/aw 0.1.0-beta.64 → 0.1.0-beta.66
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/authoring/assets/aw-runtime-config.mjs +3 -3
- package/dist/authoring/assets/aw-runtime-config.mjs.map +1 -1
- package/dist/authoring/scripts/add-skill.mjs +3 -17
- package/dist/authoring/scripts/add-skill.mjs.map +1 -1
- package/dist/authoring/scripts/init-plugin.mjs +1 -0
- package/dist/authoring/scripts/init-plugin.mjs.map +1 -1
- package/dist/authoring/scripts/lib/plugin-version-check.mjs +1 -1
- package/dist/authoring/scripts/lib/skill-scaffold.d.mts +2 -0
- package/dist/authoring/scripts/lib/skill-scaffold.mjs +2 -0
- package/dist/authoring/scripts/lib/skill-scaffold.mjs.map +1 -1
- package/dist/authoring/scripts/validate-plugin.mjs +95 -698
- package/dist/authoring/scripts/validate-plugin.mjs.map +1 -1
- package/dist/scripts/aw-skill-eval-materializer.d.ts +2 -0
- package/dist/scripts/aw-skill-eval-materializer.js +74 -44
- package/dist/scripts/aw-skill-eval-materializer.js.map +1 -1
- package/dist/scripts/bundle-plugins.js +10 -2
- package/dist/scripts/bundle-plugins.js.map +1 -1
- package/dist/scripts/plugin-staging.d.ts +1 -1
- package/dist/scripts/plugin-staging.js +1 -1
- package/dist/scripts/plugin-staging.js.map +1 -1
- package/dist/scripts/test-plugin-scripts.js +31 -31
- package/dist/scripts/test-plugin-scripts.js.map +1 -1
- package/dist/src/commands/aw-capabilities.d.ts +1 -1
- package/dist/src/commands/aw-capabilities.js +2 -0
- package/dist/src/commands/aw-capabilities.js.map +1 -1
- package/dist/src/commands/catalog-publication-inspection.js +2 -2
- package/dist/src/commands/catalog-publication-inspection.js.map +1 -1
- package/dist/src/commands/console.js +4 -3
- package/dist/src/commands/console.js.map +1 -1
- package/dist/src/commands/intent-command.d.ts +30 -0
- package/dist/src/commands/intent-command.js +164 -0
- package/dist/src/commands/intent-command.js.map +1 -0
- package/dist/src/commands/operation-plan.d.ts +2 -0
- package/dist/src/commands/operation-plan.js +2 -1
- package/dist/src/commands/operation-plan.js.map +1 -1
- package/dist/src/commands/options.d.ts +3 -11
- package/dist/src/commands/options.js +11 -17
- package/dist/src/commands/options.js.map +1 -1
- package/dist/src/commands/plugin-capabilities.js +27 -33
- package/dist/src/commands/plugin-capabilities.js.map +1 -1
- package/dist/src/commands/rebuild-command.d.ts +108 -6
- package/dist/src/commands/rebuild-command.js +617 -1549
- package/dist/src/commands/rebuild-command.js.map +1 -1
- package/dist/src/commands/rebuild-integration.d.ts +19 -3
- package/dist/src/commands/rebuild-integration.js +500 -459
- package/dist/src/commands/rebuild-integration.js.map +1 -1
- package/dist/src/commands/rebuild-operations.js +1 -2
- package/dist/src/commands/rebuild-operations.js.map +1 -1
- package/dist/src/commands/review-inspection.d.ts +2 -2
- package/dist/src/commands/review-inspection.js +30 -86
- package/dist/src/commands/review-inspection.js.map +1 -1
- package/dist/src/commands/review-preparation.js +16 -7
- package/dist/src/commands/review-preparation.js.map +1 -1
- package/dist/src/commands/skill-eval.d.ts +2 -0
- package/dist/src/commands/skill-eval.js +15 -9
- package/dist/src/commands/skill-eval.js.map +1 -1
- package/dist/src/commands/status-v6.d.ts +38 -5
- package/dist/src/commands/status-v6.js +269 -102
- package/dist/src/commands/status-v6.js.map +1 -1
- package/dist/src/commands/targets-command.d.ts +27 -0
- package/dist/src/commands/targets-command.js +77 -0
- package/dist/src/commands/targets-command.js.map +1 -0
- package/dist/src/commands/write-commands.js +5 -5
- package/dist/src/commands/write-commands.js.map +1 -1
- package/dist/src/eval/manifest-v1.d.ts +2 -0
- package/dist/src/eval/manifest-v1.js +7 -2
- package/dist/src/eval/manifest-v1.js.map +1 -1
- package/dist/src/generators/local-plugin.d.ts +2 -1
- package/dist/src/generators/local-plugin.js +111 -108
- package/dist/src/generators/local-plugin.js.map +1 -1
- package/dist/src/index.d.ts +10 -17
- package/dist/src/index.js +585 -1349
- package/dist/src/index.js.map +1 -1
- package/dist/src/intent/deployment-preferences.d.ts +63 -0
- package/dist/src/intent/deployment-preferences.js +170 -0
- package/dist/src/intent/deployment-preferences.js.map +1 -0
- package/dist/src/intent/diagnostics.d.ts +11 -0
- package/dist/src/intent/diagnostics.js +14 -0
- package/dist/src/intent/diagnostics.js.map +1 -0
- package/dist/src/intent/intent-codec.d.ts +19 -0
- package/dist/src/intent/intent-codec.js +117 -0
- package/dist/src/intent/intent-codec.js.map +1 -0
- package/dist/src/intent/intent-store.d.ts +43 -0
- package/dist/src/intent/intent-store.js +118 -0
- package/dist/src/intent/intent-store.js.map +1 -0
- package/dist/src/intent/scope-context.d.ts +33 -0
- package/dist/src/intent/scope-context.js +145 -0
- package/dist/src/intent/scope-context.js.map +1 -0
- package/dist/src/intent/work-context.d.ts +13 -0
- package/dist/src/intent/work-context.js +22 -0
- package/dist/src/intent/work-context.js.map +1 -0
- package/dist/src/output/command-receipt.js +16 -9
- package/dist/src/output/command-receipt.js.map +1 -1
- package/dist/src/portable/commands.d.ts +18 -8
- package/dist/src/portable/commands.js +46 -562
- package/dist/src/portable/commands.js.map +1 -1
- package/dist/src/portable/historical-materialization.d.ts +22 -0
- package/dist/src/portable/historical-materialization.js +124 -0
- package/dist/src/portable/historical-materialization.js.map +1 -0
- package/dist/src/portable/materializer.d.ts +8 -0
- package/dist/src/portable/materializer.js +75 -44
- package/dist/src/portable/materializer.js.map +1 -1
- package/dist/src/portable/recovery-layout.d.ts +17 -0
- package/dist/src/portable/recovery-layout.js +55 -0
- package/dist/src/portable/recovery-layout.js.map +1 -0
- package/dist/src/portable/recovery.d.ts +143 -0
- package/dist/src/portable/recovery.js +339 -0
- package/dist/src/portable/recovery.js.map +1 -0
- package/dist/src/portable/writer.d.ts +64 -0
- package/dist/src/portable/writer.js +316 -0
- package/dist/src/portable/writer.js.map +1 -0
- package/dist/src/recovery/coordinator.d.ts +137 -0
- package/dist/src/recovery/coordinator.js +1198 -0
- package/dist/src/recovery/coordinator.js.map +1 -0
- package/dist/src/recovery/demand.d.ts +44 -0
- package/dist/src/recovery/demand.js +178 -0
- package/dist/src/recovery/demand.js.map +1 -0
- package/dist/src/recovery/joint-coordinator.d.ts +24 -0
- package/dist/src/recovery/joint-coordinator.js +770 -0
- package/dist/src/recovery/joint-coordinator.js.map +1 -0
- package/dist/src/recovery/joint-demand.d.ts +68 -0
- package/dist/src/recovery/joint-demand.js +166 -0
- package/dist/src/recovery/joint-demand.js.map +1 -0
- package/dist/src/recovery/receipt.d.ts +81 -0
- package/dist/src/recovery/receipt.js +2 -0
- package/dist/src/recovery/receipt.js.map +1 -0
- package/dist/src/recovery/retirement.d.ts +45 -0
- package/dist/src/recovery/retirement.js +366 -0
- package/dist/src/recovery/retirement.js.map +1 -0
- package/dist/src/recovery/status.d.ts +108 -0
- package/dist/src/recovery/status.js +417 -0
- package/dist/src/recovery/status.js.map +1 -0
- package/dist/src/recovery/types.d.ts +86 -0
- package/dist/src/recovery/types.js +2 -0
- package/dist/src/recovery/types.js.map +1 -0
- package/dist/src/review/review-profile.d.ts +2 -1
- package/dist/src/review/review-profile.js +15 -15
- package/dist/src/review/review-profile.js.map +1 -1
- package/dist/src/review/review-selection.d.ts +1 -2
- package/dist/src/review/review-selection.js +40 -114
- package/dist/src/review/review-selection.js.map +1 -1
- package/dist/src/review/review-types.d.ts +4 -4
- package/dist/src/review/review-types.js.map +1 -1
- package/dist/src/review/skill-materialization.js +15 -6
- package/dist/src/review/skill-materialization.js.map +1 -1
- package/dist/src/review/source-binding.d.ts +14 -4
- package/dist/src/review/source-binding.js +62 -117
- package/dist/src/review/source-binding.js.map +1 -1
- package/dist/src/tui/agent-management.d.ts +23 -0
- package/dist/src/tui/agent-management.js +217 -0
- package/dist/src/tui/agent-management.js.map +1 -0
- package/dist/src/tui/agent-settings.d.ts +44 -0
- package/dist/src/tui/agent-settings.js +98 -0
- package/dist/src/tui/agent-settings.js.map +1 -0
- package/dist/src/tui/components.d.ts +3 -0
- package/dist/src/tui/components.js +10 -1
- package/dist/src/tui/components.js.map +1 -1
- package/dist/src/tui/config-references.d.ts +6 -3
- package/dist/src/tui/config-references.js +17 -12
- package/dist/src/tui/config-references.js.map +1 -1
- package/dist/src/tui/console-app-v4.d.ts +1 -2
- package/dist/src/tui/console-app-v4.js +1533 -1047
- package/dist/src/tui/console-app-v4.js.map +1 -1
- package/dist/src/tui/controller-runtime.d.ts +2 -1
- package/dist/src/tui/controller-runtime.js +405 -1626
- package/dist/src/tui/controller-runtime.js.map +1 -1
- package/dist/src/tui/controller.d.ts +131 -81
- package/dist/src/tui/controller.js +307 -227
- package/dist/src/tui/controller.js.map +1 -1
- package/dist/src/tui/entity-cards.d.ts +2 -2
- package/dist/src/tui/entity-cards.js +98 -20
- package/dist/src/tui/entity-cards.js.map +1 -1
- package/dist/src/tui/glossary.d.ts +2 -0
- package/dist/src/tui/glossary.js +20 -0
- package/dist/src/tui/glossary.js.map +1 -1
- package/dist/src/tui/model.d.ts +28 -10
- package/dist/src/tui/model.js +41 -41
- package/dist/src/tui/model.js.map +1 -1
- package/dist/src/tui/operation-review-planner.d.ts +2 -0
- package/dist/src/tui/operation-review-planner.js +58 -122
- package/dist/src/tui/operation-review-planner.js.map +1 -1
- package/dist/src/tui/plugin-content.js +7 -4
- package/dist/src/tui/plugin-content.js.map +1 -1
- package/dist/src/tui/plugin-detail.d.ts +22 -3
- package/dist/src/tui/plugin-detail.js +113 -26
- package/dist/src/tui/plugin-detail.js.map +1 -1
- package/dist/src/tui/reader.d.ts +1 -0
- package/dist/src/tui/reader.js +3 -1
- package/dist/src/tui/reader.js.map +1 -1
- package/dist/src/tui/router.d.ts +23 -33
- package/dist/src/tui/router.js.map +1 -1
- package/dist/src/tui/scoped-flow.d.ts +45 -0
- package/dist/src/tui/scoped-flow.js +96 -0
- package/dist/src/tui/scoped-flow.js.map +1 -0
- package/dist/src/tui/scoped-inventory.d.ts +122 -0
- package/dist/src/tui/scoped-inventory.js +225 -0
- package/dist/src/tui/scoped-inventory.js.map +1 -0
- package/dist/src/tui/screen-registry.d.ts +25 -25
- package/dist/src/tui/screen-registry.js +3 -7
- package/dist/src/tui/screen-registry.js.map +1 -1
- package/dist/src/tui/session-console-app.js +1 -1
- package/dist/src/tui/session-console-app.js.map +1 -1
- package/dist/src/tui/session-host.js +12 -2
- package/dist/src/tui/session-host.js.map +1 -1
- package/dist/src/types.d.ts +15 -12
- package/dist/src/types.js.map +1 -1
- package/dist/src/utils/agent-version.js +2 -0
- package/dist/src/utils/agent-version.js.map +1 -1
- package/dist/src/utils/artifact-plan.js +13 -6
- package/dist/src/utils/artifact-plan.js.map +1 -1
- package/dist/src/utils/artifact-renderer.d.ts +6 -3
- package/dist/src/utils/artifact-renderer.js +27 -32
- package/dist/src/utils/artifact-renderer.js.map +1 -1
- package/dist/src/utils/artifact-request.d.ts +1 -0
- package/dist/src/utils/artifact-request.js +22 -12
- package/dist/src/utils/artifact-request.js.map +1 -1
- package/dist/src/utils/artifact-sources.d.ts +2 -2
- package/dist/src/utils/bundle-layout.js +18 -16
- package/dist/src/utils/bundle-layout.js.map +1 -1
- package/dist/src/utils/catalog-digests.js +2 -0
- package/dist/src/utils/catalog-digests.js.map +1 -1
- package/dist/src/utils/catalog-runtime-projection.d.ts +4 -3
- package/dist/src/utils/catalog-runtime-projection.js.map +1 -1
- package/dist/src/utils/catalog-source-references.d.ts +5 -0
- package/dist/src/utils/catalog-source-references.js +42 -57
- package/dist/src/utils/catalog-source-references.js.map +1 -1
- package/dist/src/utils/claude-native-render-receipt.d.ts +14 -0
- package/dist/src/utils/claude-native-render-receipt.js +26 -0
- package/dist/src/utils/claude-native-render-receipt.js.map +1 -0
- package/dist/src/utils/claude-skills-root.js +14 -3
- package/dist/src/utils/claude-skills-root.js.map +1 -1
- package/dist/src/utils/codex-manager.js +6 -12
- package/dist/src/utils/codex-manager.js.map +1 -1
- package/dist/src/utils/codex-native-observation.js +29 -13
- package/dist/src/utils/codex-native-observation.js.map +1 -1
- package/dist/src/utils/codex-reconciler.d.ts +2 -5
- package/dist/src/utils/codex-reconciler.js +25 -1
- package/dist/src/utils/codex-reconciler.js.map +1 -1
- package/dist/src/utils/codex-surface-analysis.js +5 -3
- package/dist/src/utils/codex-surface-analysis.js.map +1 -1
- package/dist/src/utils/local-marketplace.d.ts +14 -2
- package/dist/src/utils/local-marketplace.js +209 -42
- package/dist/src/utils/local-marketplace.js.map +1 -1
- package/dist/src/utils/managed-command-evidence.js +1 -1
- package/dist/src/utils/managed-command-evidence.js.map +1 -1
- package/dist/src/utils/managed-command-materialization.d.ts +4 -0
- package/dist/src/utils/managed-command-materialization.js +15 -6
- package/dist/src/utils/managed-command-materialization.js.map +1 -1
- package/dist/src/utils/managed-command-store.d.ts +15 -0
- package/dist/src/utils/managed-command-store.js +73 -8
- package/dist/src/utils/managed-command-store.js.map +1 -1
- package/dist/src/utils/native-cli.d.ts +2 -0
- package/dist/src/utils/native-cli.js +22 -0
- package/dist/src/utils/native-cli.js.map +1 -1
- package/dist/src/utils/native-demand.d.ts +10 -0
- package/dist/src/utils/native-demand.js +4 -0
- package/dist/src/utils/native-demand.js.map +1 -0
- package/dist/src/utils/ownership.js +2 -0
- package/dist/src/utils/ownership.js.map +1 -1
- package/dist/src/utils/paths.js +1 -1
- package/dist/src/utils/paths.js.map +1 -1
- package/dist/src/utils/platform-support.d.ts +1 -1
- package/dist/src/utils/platform-support.js +1 -1
- package/dist/src/utils/platform-support.js.map +1 -1
- package/dist/src/utils/plugin-config-impact.d.ts +3 -0
- package/dist/src/utils/plugin-config-impact.js +115 -273
- package/dist/src/utils/plugin-config-impact.js.map +1 -1
- package/dist/src/utils/plugin-config-references.d.ts +9 -2
- package/dist/src/utils/plugin-config-references.js +75 -85
- package/dist/src/utils/plugin-config-references.js.map +1 -1
- package/dist/src/utils/plugin-config-write.d.ts +58 -1
- package/dist/src/utils/plugin-config-write.js +756 -809
- package/dist/src/utils/plugin-config-write.js.map +1 -1
- package/dist/src/utils/plugin-config.d.ts +47 -46
- package/dist/src/utils/plugin-config.js +292 -833
- package/dist/src/utils/plugin-config.js.map +1 -1
- package/dist/src/utils/plugin-scripts.d.ts +11 -6
- package/dist/src/utils/plugin-scripts.js +52 -35
- package/dist/src/utils/plugin-scripts.js.map +1 -1
- package/dist/src/utils/runtime-config.js +5 -4
- package/dist/src/utils/runtime-config.js.map +1 -1
- package/dist/src/utils/runtime-skill-closure.d.ts +2 -2
- package/dist/src/utils/runtime-skill-closure.js.map +1 -1
- package/dist/src/utils/state-paths.d.ts +8 -3
- package/dist/src/utils/state-paths.js +53 -16
- package/dist/src/utils/state-paths.js.map +1 -1
- package/dist/src/utils/windows-npm-shim.d.ts +2 -0
- package/dist/src/utils/windows-npm-shim.js +5 -7
- package/dist/src/utils/windows-npm-shim.js.map +1 -1
- package/dist/vitest.config.js +1 -0
- package/dist/vitest.config.js.map +1 -1
- package/package.json +3 -3
- package/dist/src/commands/sync-command.d.ts +0 -40
- package/dist/src/commands/sync-command.js +0 -254
- package/dist/src/commands/sync-command.js.map +0 -1
- package/dist/src/portable/skills-cli.d.ts +0 -51
- package/dist/src/portable/skills-cli.js +0 -202
- package/dist/src/portable/skills-cli.js.map +0 -1
- package/dist/src/tui/project-inventory.d.ts +0 -68
- package/dist/src/tui/project-inventory.js +0 -203
- package/dist/src/tui/project-inventory.js.map +0 -1
- package/dist/src/utils/plugin-intent-state.d.ts +0 -49
- package/dist/src/utils/plugin-intent-state.js +0 -320
- package/dist/src/utils/plugin-intent-state.js.map +0 -1
|
@@ -4,7 +4,7 @@ import os from 'node:os';
|
|
|
4
4
|
import path from 'node:path';
|
|
5
5
|
import { promisify } from 'node:util';
|
|
6
6
|
import fs from 'fs-extra';
|
|
7
|
-
import { preparePluginNativeTools, validateManagedCommandSources } from '@lesliechan721/aw-plugin-core/manifest';
|
|
7
|
+
import { preparePluginNativeTools, validateManagedCommandSources, PLATFORM_TARGETS } from '@lesliechan721/aw-plugin-core/manifest';
|
|
8
8
|
import { renderResolvedHooksArtifact } from './hooks.js';
|
|
9
9
|
import { buildGeneratedName } from './shared.js';
|
|
10
10
|
import { applyFileRules } from '../utils/file-rules.js';
|
|
@@ -23,8 +23,8 @@ import { scanNodeImportContract } from '../utils/plugin-script-contract.js';
|
|
|
23
23
|
import { isSkillAuthorOnlyPath, isSkillCollectionAuthorOnlyPath, } from '../utils/skill-authoring.js';
|
|
24
24
|
import { assertTestWritablePath } from '../utils/test-path-fence.js';
|
|
25
25
|
import { resolveCliPackageRoot } from '../utils/paths.js';
|
|
26
|
-
import {
|
|
27
|
-
import { AW_PLUGIN_REQUIREMENTS_RECEIPT_PATH,
|
|
26
|
+
import { validateRuntimeSkillClosure, validateSkillRuntimeProjectionFreshness, } from '../utils/runtime-skill-closure.js';
|
|
27
|
+
import { AW_PLUGIN_REQUIREMENTS_RECEIPT_PATH, validatePortableSkillDirectory, } from '../utils/dynamic-skill-tree.js';
|
|
28
28
|
import { renderClaudeSlashCommand, renderCodexSlashCommandOpenAiYaml, renderCodexSlashCommandSkillMarkdown, resolveSlashCommands, } from '../utils/slash-commands.js';
|
|
29
29
|
const execFileAsync = promisify(execFile);
|
|
30
30
|
const requireFromCli = createRequire(import.meta.url);
|
|
@@ -268,17 +268,27 @@ async function copyArtifactSourceDirectories(plugin, outputRoot) {
|
|
|
268
268
|
for (const [sourceIndex, sourceDir] of (target.sourceDirs ?? []).entries()) {
|
|
269
269
|
const sourcePath = path.join(plugin.rootDir, stripDotSlash(sourceDir));
|
|
270
270
|
await assertArtifactSourceTreePortable(sourcePath, `artifacts.targets[${targetIndex}].sourceDirs[${sourceIndex}]`);
|
|
271
|
-
|
|
272
|
-
platform: target.platform,
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
271
|
+
const targetRoot = path.join(outputRoot, getArtifactSourceBundleRelativePath({
|
|
272
|
+
platform: target.platform, distribution: target.distribution, artifactId: target.id, index: sourceIndex,
|
|
273
|
+
}));
|
|
274
|
+
await fs.ensureDir(targetRoot);
|
|
275
|
+
for (const relativePath of await listFilesRecursively(sourcePath)) {
|
|
276
|
+
if (isSkillAuthorOnlyPath(relativePath))
|
|
277
|
+
continue;
|
|
278
|
+
const sourceRelativePath = path.posix.join(stripDotSlash(sourceDir), relativePath);
|
|
279
|
+
const excluded = plugin.manifest.buildConfig?.fileRules?.[target.platform]?.exclude ?? [];
|
|
280
|
+
if (applyFileRules([sourceRelativePath], ['**/*'], excluded).length === 0)
|
|
281
|
+
continue;
|
|
282
|
+
const destination = path.join(targetRoot, relativePath);
|
|
283
|
+
await fs.ensureDir(path.dirname(destination));
|
|
284
|
+
const templates = plugin.manifest.buildConfig?.templates;
|
|
285
|
+
if (isTextFile(relativePath) && applyFileRules([sourceRelativePath], templates?.include ?? [], []).length > 0) {
|
|
286
|
+
await fs.writeFile(destination, renderTemplate(await fs.readFile(path.join(sourcePath, relativePath), 'utf8'), templates?.vars ?? {}, target.platform));
|
|
287
|
+
}
|
|
288
|
+
else {
|
|
289
|
+
await fs.copyFile(path.join(sourcePath, relativePath), destination);
|
|
290
|
+
}
|
|
291
|
+
}
|
|
282
292
|
}
|
|
283
293
|
}
|
|
284
294
|
}
|
|
@@ -295,22 +305,6 @@ async function copyManagedCommandPackages(plugin, outputRoot) {
|
|
|
295
305
|
}
|
|
296
306
|
await validateManagedCommandSources(outputRoot, plugin.manifest);
|
|
297
307
|
}
|
|
298
|
-
async function copyPortableStaticSkills(plugin, outputRoot) {
|
|
299
|
-
const skillsPath = plugin.manifest.distributions?.agentSkills?.skills;
|
|
300
|
-
if (!skillsPath)
|
|
301
|
-
return;
|
|
302
|
-
const sourceRoot = path.join(plugin.rootDir, stripDotSlash(skillsPath));
|
|
303
|
-
const targetRoot = path.join(outputRoot, 'agent-skills', 'skills');
|
|
304
|
-
await assertArtifactSourceTreePortable(sourceRoot, 'distributions.agentSkills.skills');
|
|
305
|
-
await fs.copy(sourceRoot, targetRoot, {
|
|
306
|
-
dereference: false,
|
|
307
|
-
filter: (source) => {
|
|
308
|
-
const relative = path.relative(sourceRoot, source).split(path.sep).join('/');
|
|
309
|
-
return !isMacOsMetadataName(path.basename(source))
|
|
310
|
-
&& !isSkillCollectionAuthorOnlyPath(relative);
|
|
311
|
-
},
|
|
312
|
-
});
|
|
313
|
-
}
|
|
314
308
|
async function resolveArtifactRuntimeImports(options) {
|
|
315
309
|
const manifest = createBundleSourceManifest(options.plugin);
|
|
316
310
|
const requiredCapabilities = [];
|
|
@@ -346,9 +340,6 @@ async function resolveArtifactRuntimeImports(options) {
|
|
|
346
340
|
};
|
|
347
341
|
}
|
|
348
342
|
}
|
|
349
|
-
if (manifest.distributions?.agentSkills?.skills) {
|
|
350
|
-
manifest.distributions.agentSkills.skills = './agent-skills/skills';
|
|
351
|
-
}
|
|
352
343
|
return {
|
|
353
344
|
manifest,
|
|
354
345
|
requiredCapabilities: normalizeAwCapabilities(requiredCapabilities),
|
|
@@ -366,7 +357,7 @@ async function materializeArtifactRuntimeImports(projections) {
|
|
|
366
357
|
}
|
|
367
358
|
async function injectRequirementsReceipts(options) {
|
|
368
359
|
const receipt = createAwPluginRequirementsReceipt({ name: options.plugin.manifest.name, version: options.plugin.manifest.version }, options.requiredCapabilities);
|
|
369
|
-
for (const relativeRoot of
|
|
360
|
+
for (const relativeRoot of PLATFORM_TARGETS.map((platform) => `${platform}/skills`)) {
|
|
370
361
|
const skillsRoot = path.join(options.outputRoot, relativeRoot);
|
|
371
362
|
if (!(await fs.pathExists(skillsRoot)))
|
|
372
363
|
continue;
|
|
@@ -406,7 +397,7 @@ async function addDeclaredSkillPathFiles(plugin, platform, relativePath, targetF
|
|
|
406
397
|
const root = stripDotSlash(relativePath);
|
|
407
398
|
const dynamicSkillKeys = new Set((plugin.manifest.artifacts?.targets ?? [])
|
|
408
399
|
.filter((target) => target.platform === platform &&
|
|
409
|
-
(target.target === 'codex.skill' || target.target === 'claude.skill') &&
|
|
400
|
+
(target.target === 'codex.skill' || target.target === 'claude.skill' || target.target === 'agent-skills.skill') &&
|
|
410
401
|
target.skillKey)
|
|
411
402
|
.map((target) => target.skillKey));
|
|
412
403
|
const files = await collectFilesForPath(plugin.rootDir, relativePath);
|
|
@@ -440,7 +431,7 @@ function isDeclaredSkillAuthorOnlyFile(plugin, filePath) {
|
|
|
440
431
|
return true;
|
|
441
432
|
}
|
|
442
433
|
for (const target of plugin.manifest.artifacts?.targets ?? []) {
|
|
443
|
-
if ((target.target !== 'codex.skill' && target.target !== 'claude.skill') ||
|
|
434
|
+
if ((target.target !== 'codex.skill' && target.target !== 'claude.skill' && target.target !== 'agent-skills.skill') ||
|
|
444
435
|
!target.skillKey)
|
|
445
436
|
continue;
|
|
446
437
|
const dynamicRoot = `skills/${target.skillKey}`;
|
|
@@ -459,7 +450,7 @@ function isDynamicSkillSourceFile(plugin, platform, filePath) {
|
|
|
459
450
|
const normalizedFile = filePath.split(path.sep).join('/');
|
|
460
451
|
return (plugin.manifest.artifacts?.targets ?? []).some((target) => {
|
|
461
452
|
if (target.platform !== platform ||
|
|
462
|
-
(target.target !== 'codex.skill' && target.target !== 'claude.skill') ||
|
|
453
|
+
(target.target !== 'codex.skill' && target.target !== 'claude.skill' && target.target !== 'agent-skills.skill') ||
|
|
463
454
|
!target.skillKey)
|
|
464
455
|
return false;
|
|
465
456
|
return relativePathInside(`skills/${target.skillKey}`, normalizedFile) !== null;
|
|
@@ -813,19 +804,14 @@ async function assertSkillRuntimeTargetAbsent(skillRoot, target, fieldName) {
|
|
|
813
804
|
}
|
|
814
805
|
async function assertSkillRuntimeProjectionTargets(plugin) {
|
|
815
806
|
for (const [index, entry] of (plugin.manifest.buildConfig?.skillRuntimeFiles ?? []).entries()) {
|
|
816
|
-
const roots = [];
|
|
817
|
-
if (entry.platforms !== undefined || entry.distributions === undefined) {
|
|
818
|
-
roots.push(path.join(plugin.rootDir, 'skills', entry.skill));
|
|
819
|
-
}
|
|
820
|
-
if (entry.distributions?.includes('agent-skills')) {
|
|
821
|
-
const portableRoot = plugin.manifest.distributions?.agentSkills?.skills;
|
|
822
|
-
if (!portableRoot) {
|
|
823
|
-
throw new Error(`Invalid buildConfig.skillRuntimeFiles[${index}].distributions: agent-skills is not declared.`);
|
|
824
|
-
}
|
|
825
|
-
roots.push(path.join(plugin.rootDir, stripDotSlash(portableRoot), entry.skill));
|
|
826
|
-
}
|
|
807
|
+
const roots = [path.join(plugin.rootDir, stripDotSlash(plugin.manifest.skills ?? './skills'), entry.skill)];
|
|
827
808
|
for (const skillRoot of roots) {
|
|
828
809
|
const skillRootStats = await fs.lstat(skillRoot).catch(() => undefined);
|
|
810
|
+
if (!skillRootStats) {
|
|
811
|
+
const platforms = entry.platforms?.length ? entry.platforms : [...resolveSupportedPlatforms(plugin.manifest)];
|
|
812
|
+
if (platforms.every((platform) => (plugin.manifest.artifacts?.targets ?? []).some((target) => target.platform === platform && target.target === 'agent-skills.skill' && target.skillKey === entry.skill)))
|
|
813
|
+
continue;
|
|
814
|
+
}
|
|
829
815
|
if (!skillRootStats?.isDirectory() || skillRootStats.isSymbolicLink()) {
|
|
830
816
|
throw new Error(`Invalid buildConfig.skillRuntimeFiles[${index}].skill: "${entry.skill}" is not a declared static Skill key.`);
|
|
831
817
|
}
|
|
@@ -833,13 +819,31 @@ async function assertSkillRuntimeProjectionTargets(plugin) {
|
|
|
833
819
|
}
|
|
834
820
|
}
|
|
835
821
|
}
|
|
836
|
-
async function
|
|
822
|
+
async function materializeGeneratedPortableSkillRuntimeFiles(plugin, outputRoot, supportedPlatforms) {
|
|
823
|
+
const projections = [];
|
|
837
824
|
for (const [index, entry] of (plugin.manifest.buildConfig?.generatedSkillRuntimeFiles ?? []).entries()) {
|
|
838
|
-
const
|
|
839
|
-
|
|
840
|
-
|
|
825
|
+
for (const platform of entry.platforms?.length ? entry.platforms : supportedPlatforms) {
|
|
826
|
+
const dynamicTarget = (plugin.manifest.artifacts?.targets ?? []).find((target) => target.platform === platform && target.target === 'agent-skills.skill' && target.skillKey === entry.skill);
|
|
827
|
+
if (!dynamicTarget)
|
|
828
|
+
continue;
|
|
829
|
+
const relativePath = path.posix.join('skills', entry.skill, entry.target);
|
|
830
|
+
const source = await resolveCanonicalRuntimeSourceIdentity(plugin.rootDir, `./${relativePath}`, `buildConfig.generatedSkillRuntimeFiles[${index}]`);
|
|
831
|
+
const stats = await fs.lstat(source.sourceRealPath);
|
|
832
|
+
if (!stats.isFile() || stats.isSymbolicLink()) {
|
|
833
|
+
throw new Error(`Invalid buildConfig.generatedSkillRuntimeFiles[${index}]: build did not create regular source "${relativePath}".`);
|
|
834
|
+
}
|
|
835
|
+
await copyFileWithTemplateSupport(plugin.rootDir, outputRoot, relativePath, platform, plugin.manifest.buildConfig?.templates?.include ?? [], plugin.manifest.buildConfig?.templates?.vars ?? {});
|
|
836
|
+
projections.push({
|
|
837
|
+
platform, skill: entry.skill, target: entry.target, path: `./${platform}/${relativePath}`,
|
|
838
|
+
digest: await calculateFileDigest(path.join(outputRoot, platform, relativePath)),
|
|
839
|
+
});
|
|
841
840
|
}
|
|
842
|
-
|
|
841
|
+
}
|
|
842
|
+
return projections;
|
|
843
|
+
}
|
|
844
|
+
async function validateGeneratedSkillRuntimeFiles(plugin, outputRoot, supportedPlatforms) {
|
|
845
|
+
for (const [index, entry] of (plugin.manifest.buildConfig?.generatedSkillRuntimeFiles ?? []).entries()) {
|
|
846
|
+
const surfaces = entry.platforms?.length ? entry.platforms : [...supportedPlatforms];
|
|
843
847
|
for (const surface of surfaces) {
|
|
844
848
|
const targetPath = path.join(outputRoot, surface, 'skills', entry.skill, ...entry.target.split('/'));
|
|
845
849
|
const stats = await fs.lstat(targetPath).catch(() => undefined);
|
|
@@ -853,19 +857,12 @@ async function projectSkillRuntimeFiles(options) {
|
|
|
853
857
|
const projections = [];
|
|
854
858
|
const claims = new Set();
|
|
855
859
|
for (const [index, entry] of (options.plugin.manifest.buildConfig?.skillRuntimeFiles ?? []).entries()) {
|
|
856
|
-
const
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
}
|
|
860
|
-
surfaces.push(...(entry.distributions ?? []).map((distribution) => ({ distribution })));
|
|
861
|
-
for (const surface of surfaces) {
|
|
862
|
-
const { platform, distribution } = surface;
|
|
863
|
-
if (platform) {
|
|
864
|
-
if (!options.supportedPlatforms.has(platform)) {
|
|
865
|
-
throw new Error(`Invalid buildConfig.skillRuntimeFiles[${index}].platforms: plugin does not support "${platform}".`);
|
|
866
|
-
}
|
|
860
|
+
for (const platform of entry.platforms?.length ? entry.platforms : [...options.supportedPlatforms]) {
|
|
861
|
+
if (!options.supportedPlatforms.has(platform)) {
|
|
862
|
+
throw new Error(`Invalid buildConfig.skillRuntimeFiles[${index}].platforms: plugin does not support "${platform}".`);
|
|
867
863
|
}
|
|
868
|
-
const
|
|
864
|
+
const distribution = platform === 'codex' || platform === 'claude' ? undefined : 'agent-skills';
|
|
865
|
+
const claim = `${platform}:${entry.skill}/${entry.target}`;
|
|
869
866
|
if (claims.has(claim)) {
|
|
870
867
|
throw new Error(`Invalid buildConfig.skillRuntimeFiles: target collision at "${claim}".`);
|
|
871
868
|
}
|
|
@@ -907,7 +904,7 @@ async function projectSkillRuntimeFiles(options) {
|
|
|
907
904
|
bindingKey = `import:${entry.import.plugin}/${entry.import.export}`;
|
|
908
905
|
runtimeProvenance = toRuntimeImportProvenance(resolution);
|
|
909
906
|
}
|
|
910
|
-
const targetPath = path.join(options.outputRoot, platform
|
|
907
|
+
const targetPath = path.join(options.outputRoot, platform, 'skills', entry.skill, ...entry.target.split('/'));
|
|
911
908
|
projections.push({
|
|
912
909
|
bindingKey,
|
|
913
910
|
canonicalSource,
|
|
@@ -929,7 +926,7 @@ async function projectSkillRuntimeFiles(options) {
|
|
|
929
926
|
async function materializeSkillRuntimeFiles(projections) {
|
|
930
927
|
for (const projection of projections) {
|
|
931
928
|
if (await fs.pathExists(projection.targetPath)) {
|
|
932
|
-
const surface = projection.provenance.platform
|
|
929
|
+
const surface = projection.provenance.platform;
|
|
933
930
|
throw new Error(`Invalid buildConfig.skillRuntimeFiles: bundle target already exists at "${surface}:${projection.provenance.skill}/${projection.provenance.target}".`);
|
|
934
931
|
}
|
|
935
932
|
await fs.ensureDir(path.dirname(projection.targetPath));
|
|
@@ -1215,7 +1212,8 @@ export async function bundleLocalPlugin(plugin, outputRoot, options = {}) {
|
|
|
1215
1212
|
.map((entry) => ({
|
|
1216
1213
|
skill: entry.skill,
|
|
1217
1214
|
target: entry.target,
|
|
1218
|
-
|
|
1215
|
+
platform: entry.platform,
|
|
1216
|
+
path: `./${entry.platform}/skills/${entry.skill}/${entry.target}`,
|
|
1219
1217
|
digest: entry.targetDigest,
|
|
1220
1218
|
provider: entry.provider,
|
|
1221
1219
|
providerVersion: entry.providerVersion,
|
|
@@ -1249,7 +1247,7 @@ export async function bundleLocalPlugin(plugin, outputRoot, options = {}) {
|
|
|
1249
1247
|
const templatePatterns = buildConfig?.templates?.include ?? [];
|
|
1250
1248
|
const templateVars = buildConfig?.templates?.vars ?? {};
|
|
1251
1249
|
const resolvedSlashCommands = await resolveSlashCommands(plugin.rootDir, plugin.manifest, {
|
|
1252
|
-
targetPlatforms: supportedPlatforms,
|
|
1250
|
+
targetPlatforms: new Set([...supportedPlatforms].filter((platform) => platform === 'codex' || platform === 'claude')),
|
|
1253
1251
|
});
|
|
1254
1252
|
for (const platform of PLATFORM_ORDER) {
|
|
1255
1253
|
if (!supportedPlatforms.has(platform)) {
|
|
@@ -1267,6 +1265,21 @@ export async function bundleLocalPlugin(plugin, outputRoot, options = {}) {
|
|
|
1267
1265
|
manifest.skills = await addDeclaredSkillPathFiles(plugin, platform, plugin.manifest.skills, files);
|
|
1268
1266
|
manifest.mcpServers = await addDeclaredPathFiles(plugin, platform, plugin.manifest.mcpServers, files);
|
|
1269
1267
|
}
|
|
1268
|
+
for (const platform of supportedPlatforms) {
|
|
1269
|
+
if (platform === 'codex' || platform === 'claude') {
|
|
1270
|
+
const manifest = platformManifests[platform];
|
|
1271
|
+
if ((plugin.manifest.artifacts?.targets ?? []).some((target) => target.platform === platform && (target.target === 'codex.skill' || target.target === 'claude.skill'))) {
|
|
1272
|
+
manifest.skills = `./${platform}/skills`;
|
|
1273
|
+
await fs.ensureDir(path.join(outputRoot, platform, 'skills'));
|
|
1274
|
+
}
|
|
1275
|
+
continue;
|
|
1276
|
+
}
|
|
1277
|
+
const files = new Set();
|
|
1278
|
+
platformFiles[platform] = files;
|
|
1279
|
+
if (plugin.manifest.skills)
|
|
1280
|
+
await fs.ensureDir(path.join(outputRoot, platform, 'skills'));
|
|
1281
|
+
await addDeclaredSkillPathFiles(plugin, platform, plugin.manifest.skills, files);
|
|
1282
|
+
}
|
|
1270
1283
|
const codexManifest = platformManifests.codex;
|
|
1271
1284
|
const codexFiles = platformFiles.codex;
|
|
1272
1285
|
if (codexManifest && codexFiles) {
|
|
@@ -1302,36 +1315,22 @@ export async function bundleLocalPlugin(plugin, outputRoot, options = {}) {
|
|
|
1302
1315
|
}
|
|
1303
1316
|
}
|
|
1304
1317
|
const sourceFiles = (await listFilesRecursively(plugin.rootDir)).filter((filePath) => !isDeclaredSkillAuthorOnlyFile(plugin, filePath));
|
|
1305
|
-
|
|
1306
|
-
for (const filePath of applyFileRules(sourceFiles.filter((filePath) => !isDynamicSkillSourceFile(plugin, 'claude', filePath)), buildConfig.fileRules.claude.include, buildConfig.fileRules.claude.exclude)) {
|
|
1307
|
-
if (resolvedSlashCommands &&
|
|
1308
|
-
filePath === stripDotSlash(resolvedSlashCommands.rootRelativePath)) {
|
|
1309
|
-
continue;
|
|
1310
|
-
}
|
|
1311
|
-
if (resolvedSlashCommands &&
|
|
1312
|
-
filePath.startsWith(`${stripDotSlash(resolvedSlashCommands.rootRelativePath)}/`)) {
|
|
1313
|
-
continue;
|
|
1314
|
-
}
|
|
1315
|
-
claudeFiles.add(filePath);
|
|
1316
|
-
}
|
|
1317
|
-
}
|
|
1318
|
-
if (codexFiles && buildConfig?.fileRules?.codex) {
|
|
1319
|
-
for (const filePath of applyFileRules(sourceFiles.filter((filePath) => !isDynamicSkillSourceFile(plugin, 'codex', filePath)), buildConfig.fileRules.codex.include, buildConfig.fileRules.codex.exclude)) {
|
|
1320
|
-
if (resolvedSlashCommands &&
|
|
1321
|
-
filePath === stripDotSlash(resolvedSlashCommands.rootRelativePath)) {
|
|
1322
|
-
continue;
|
|
1323
|
-
}
|
|
1324
|
-
if (resolvedSlashCommands &&
|
|
1325
|
-
filePath.startsWith(`${stripDotSlash(resolvedSlashCommands.rootRelativePath)}/`)) {
|
|
1326
|
-
continue;
|
|
1327
|
-
}
|
|
1328
|
-
codexFiles.add(filePath);
|
|
1329
|
-
}
|
|
1330
|
-
}
|
|
1331
|
-
for (const platform of PLATFORM_ORDER) {
|
|
1318
|
+
for (const platform of supportedPlatforms) {
|
|
1332
1319
|
const files = platformFiles[platform];
|
|
1333
|
-
if (!files)
|
|
1320
|
+
if (!files)
|
|
1334
1321
|
continue;
|
|
1322
|
+
const rules = buildConfig?.fileRules?.[platform];
|
|
1323
|
+
if (rules) {
|
|
1324
|
+
for (const filePath of applyFileRules(sourceFiles.filter((filePath) => !isDynamicSkillSourceFile(plugin, platform, filePath)), rules.include, rules.exclude)) {
|
|
1325
|
+
const commandsRoot = resolvedSlashCommands && stripDotSlash(resolvedSlashCommands.rootRelativePath);
|
|
1326
|
+
if (commandsRoot && (filePath === commandsRoot || filePath.startsWith(`${commandsRoot}/`)))
|
|
1327
|
+
continue;
|
|
1328
|
+
files.add(filePath);
|
|
1329
|
+
}
|
|
1330
|
+
for (const filePath of [...files]) {
|
|
1331
|
+
if (applyFileRules([filePath], ['**/*'], rules.exclude).length === 0)
|
|
1332
|
+
files.delete(filePath);
|
|
1333
|
+
}
|
|
1335
1334
|
}
|
|
1336
1335
|
for (const filePath of files) {
|
|
1337
1336
|
await copyFileWithTemplateSupport(plugin.rootDir, outputRoot, filePath, platform, templatePatterns, templateVars);
|
|
@@ -1358,7 +1357,6 @@ export async function bundleLocalPlugin(plugin, outputRoot, options = {}) {
|
|
|
1358
1357
|
}
|
|
1359
1358
|
}
|
|
1360
1359
|
await materializeSkillRuntimeFiles(skillRuntimeFileProjections);
|
|
1361
|
-
await copyPortableStaticSkills(plugin, outputRoot);
|
|
1362
1360
|
if (await fs.pathExists(path.join(plugin.rootDir, 'README.md'))) {
|
|
1363
1361
|
await copyBundleRootFile(plugin.rootDir, outputRoot, 'README.md');
|
|
1364
1362
|
}
|
|
@@ -1366,6 +1364,7 @@ export async function bundleLocalPlugin(plugin, outputRoot, options = {}) {
|
|
|
1366
1364
|
await copyBundleRootFile(plugin.rootDir, outputRoot, filePath);
|
|
1367
1365
|
}
|
|
1368
1366
|
await copyArtifactSourceDirectories(plugin, outputRoot);
|
|
1367
|
+
portableRuntimeFiles.push(...await materializeGeneratedPortableSkillRuntimeFiles(plugin, outputRoot, supportedPlatforms));
|
|
1369
1368
|
await copyManagedCommandPackages(plugin, outputRoot);
|
|
1370
1369
|
await copyProductionPackageRoot(plugin, outputRoot);
|
|
1371
1370
|
await materializeArtifactRuntimeImports(artifactRuntimeProjection.projections);
|
|
@@ -1386,18 +1385,22 @@ export async function bundleLocalPlugin(plugin, outputRoot, options = {}) {
|
|
|
1386
1385
|
requiredCapabilities: finalEffective,
|
|
1387
1386
|
});
|
|
1388
1387
|
await validateSkillRuntimeProjectionSources(skillRuntimeFileProjections);
|
|
1389
|
-
await validateSkillRuntimeProjectionFreshness(outputRoot, skillRuntimeFiles
|
|
1388
|
+
await validateSkillRuntimeProjectionFreshness(outputRoot, skillRuntimeFiles);
|
|
1390
1389
|
await validateGeneratedSkillRuntimeFiles(plugin, outputRoot, supportedPlatforms);
|
|
1391
1390
|
if ((options.runtimeSkillClosureValidation ?? 'current') === 'current') {
|
|
1392
|
-
for (const platform of
|
|
1393
|
-
const
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1391
|
+
for (const platform of supportedPlatforms) {
|
|
1392
|
+
const root = path.join(outputRoot, platform, 'skills');
|
|
1393
|
+
const dynamicKeys = new Set((plugin.manifest.artifacts?.targets ?? [])
|
|
1394
|
+
.filter((target) => target.platform === platform && target.skillKey !== undefined)
|
|
1395
|
+
.map((target) => target.skillKey));
|
|
1396
|
+
for (const entry of await fs.readdir(root, { withFileTypes: true }).catch(() => [])) {
|
|
1397
|
+
if (dynamicKeys.has(entry.name))
|
|
1398
|
+
continue;
|
|
1399
|
+
const skillRoot = path.join(root, entry.name);
|
|
1400
|
+
if (platform !== 'codex' && platform !== 'claude')
|
|
1401
|
+
await validatePortableSkillDirectory(skillRoot);
|
|
1402
|
+
await validateRuntimeSkillClosure(skillRoot);
|
|
1403
|
+
}
|
|
1401
1404
|
}
|
|
1402
1405
|
}
|
|
1403
1406
|
await validateBuildImportProjectionSources(preparedBuildImportProjections.get(buildPlugin.runtimeContext) ?? []);
|