@lesliechan721/aw 0.1.0-beta.58 → 0.1.0-beta.60
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/scripts/lib/plugin-version-check.mjs +1 -1
- package/dist/authoring/scripts/validate-plugin.mjs +22 -4
- package/dist/authoring/scripts/validate-plugin.mjs.map +1 -1
- package/dist/native-runtime/reader-runtime.mjs +34 -0
- package/dist/native-runtime/reader.d.mts +6 -0
- package/dist/native-runtime/reader.mjs +11 -0
- package/dist/scripts/bundle-plugins.js +4 -13
- package/dist/scripts/bundle-plugins.js.map +1 -1
- package/dist/scripts/test-plugin-scripts.d.ts +3 -0
- package/dist/scripts/test-plugin-scripts.js +89 -10
- package/dist/scripts/test-plugin-scripts.js.map +1 -1
- package/dist/src/authoring/workspace-commands.d.ts +2 -0
- package/dist/src/authoring/workspace-commands.js +3 -1
- package/dist/src/authoring/workspace-commands.js.map +1 -1
- package/dist/src/commands/aw-capabilities.d.ts +1 -1
- package/dist/src/commands/aw-capabilities.js +1 -0
- package/dist/src/commands/aw-capabilities.js.map +1 -1
- package/dist/src/commands/managed-commands.d.ts +2 -0
- package/dist/src/commands/managed-commands.js +41 -3
- package/dist/src/commands/managed-commands.js.map +1 -1
- package/dist/src/commands/operation-plan.d.ts +8 -1
- package/dist/src/commands/operation-plan.js.map +1 -1
- package/dist/src/commands/plugin-capabilities.js +13 -0
- package/dist/src/commands/plugin-capabilities.js.map +1 -1
- package/dist/src/commands/rebuild-command.js +67 -21
- package/dist/src/commands/rebuild-command.js.map +1 -1
- package/dist/src/commands/rebuild-integration.js +33 -6
- package/dist/src/commands/rebuild-integration.js.map +1 -1
- package/dist/src/commands/runtime.js +3 -3
- package/dist/src/commands/runtime.js.map +1 -1
- package/dist/src/commands/sync-command.js +4 -0
- package/dist/src/commands/sync-command.js.map +1 -1
- package/dist/src/commands/write-commands.js +17 -8
- package/dist/src/commands/write-commands.js.map +1 -1
- package/dist/src/generators/local-plugin.js +10 -1
- package/dist/src/generators/local-plugin.js.map +1 -1
- package/dist/src/index.js +14 -4
- package/dist/src/index.js.map +1 -1
- package/dist/src/output/command-receipt.d.ts +2 -0
- package/dist/src/output/command-receipt.js +5 -0
- package/dist/src/output/command-receipt.js.map +1 -1
- package/dist/src/portable/materializer.js +4 -0
- package/dist/src/portable/materializer.js.map +1 -1
- package/dist/src/review/skill-materialization.js +4 -0
- package/dist/src/review/skill-materialization.js.map +1 -1
- package/dist/src/tui/controller-runtime.js +7 -0
- package/dist/src/tui/controller-runtime.js.map +1 -1
- package/dist/src/tui/operation-review-planner.js +12 -1
- package/dist/src/tui/operation-review-planner.js.map +1 -1
- package/dist/src/utils/managed-command-materialization.d.ts +10 -1
- package/dist/src/utils/managed-command-materialization.js +56 -4
- package/dist/src/utils/managed-command-materialization.js.map +1 -1
- package/dist/src/utils/managed-command-runtime.d.ts +10 -9
- package/dist/src/utils/managed-command-runtime.js +19 -8
- package/dist/src/utils/managed-command-runtime.js.map +1 -1
- package/dist/src/utils/managed-command-store.d.ts +6 -2
- package/dist/src/utils/managed-command-store.js +20 -7
- package/dist/src/utils/managed-command-store.js.map +1 -1
- package/dist/src/utils/native-cli.d.ts +6 -0
- package/dist/src/utils/native-cli.js +32 -6
- package/dist/src/utils/native-cli.js.map +1 -1
- package/dist/src/utils/native-tool-context.d.ts +14 -0
- package/dist/src/utils/native-tool-context.js +38 -0
- package/dist/src/utils/native-tool-context.js.map +1 -0
- package/dist/src/utils/native-tool-review.d.ts +21 -0
- package/dist/src/utils/native-tool-review.js +102 -0
- package/dist/src/utils/native-tool-review.js.map +1 -0
- package/dist/src/utils/plugin-config-write.js +30 -2
- package/dist/src/utils/plugin-config-write.js.map +1 -1
- package/dist/src/utils/plugin-scripts.js +14 -7
- package/dist/src/utils/plugin-scripts.js.map +1 -1
- package/dist/src/utils/process-lock.js +3 -1
- package/dist/src/utils/process-lock.js.map +1 -1
- package/dist/src/utils/process-tree.d.ts +2 -2
- package/dist/src/utils/process-tree.js +1 -1
- package/dist/src/utils/process-tree.js.map +1 -1
- package/dist/vitest.config.js +10 -1
- package/dist/vitest.config.js.map +1 -1
- package/package.json +8 -7
|
@@ -10,7 +10,7 @@ import { fileURLToPath, pathToFileURL } from 'node:url';
|
|
|
10
10
|
import { compareStrictSemVer, parseStrictSemVer } from './semver.mjs';
|
|
11
11
|
import { assertAuthoringPluginPathFence, resolveAuthoringPluginRoot, } from './plugin-root.mjs';
|
|
12
12
|
const execFileAsync = promisify(execFile);
|
|
13
|
-
const EXPECTED_MANIFEST_CONTRACT_VERSION =
|
|
13
|
+
const EXPECTED_MANIFEST_CONTRACT_VERSION = 18;
|
|
14
14
|
const PLUGIN_NAME_PATTERN = /^[a-z0-9]+(?:-[a-z0-9]+)*$/;
|
|
15
15
|
const GIT_OBJECT_ID_PATTERN = /^(?:[0-9a-f]{40}|[0-9a-f]{64})$/u;
|
|
16
16
|
const MAX_GIT_BLOB_BYTES = 50 * 1024 * 1024;
|
|
@@ -6,7 +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 { AW_RUNTIME_CONFIG_READER_PATH, createRuntimeConfigSnapshot, getPluginAuthoringAcceptedValues as getCorePluginAuthoringAcceptedValues, getSkillFrontmatterCapabilityRegistry, getManagedCommandArtifactTargets, normalizePluginConfigDefinition, parseManagedCommandPlaceholders, replaceManagedCommandPlaceholders, validateCommandEntryFiles, } from '@lesliechan721/aw-plugin-core/manifest';
|
|
9
|
+
import { AW_RUNTIME_CONFIG_READER_PATH, createNativeToolReaderSource, createRuntimeConfigSnapshot, getPluginAuthoringAcceptedValues as getCorePluginAuthoringAcceptedValues, getSkillFrontmatterCapabilityRegistry, getManagedCommandArtifactTargets, normalizePluginConfigDefinition, parseManagedCommandPlaceholders, replaceManagedCommandPlaceholders, validateCommandEntryFiles, } from '@lesliechan721/aw-plugin-core/manifest';
|
|
10
10
|
import { checkPluginVersions } from './lib/plugin-version-check.mjs';
|
|
11
11
|
import { scanJavaScriptImportSpecifiers } from './lib/javascript-import-scanner.mjs';
|
|
12
12
|
import { assertAuthoringPluginPathFence, assertCanonicalAuthoringPluginRoot, } from './lib/plugin-root.mjs';
|
|
@@ -18,7 +18,7 @@ const CLI_PACKAGE_ROOT = path.basename(authoringRuntimeRoot) === 'dist'
|
|
|
18
18
|
: authoringRuntimeRoot;
|
|
19
19
|
const errors = [];
|
|
20
20
|
const warnings = [];
|
|
21
|
-
const SOURCE_PLUGIN_MANIFEST_CONTRACT_VERSION =
|
|
21
|
+
const SOURCE_PLUGIN_MANIFEST_CONTRACT_VERSION = 18;
|
|
22
22
|
let capabilityDiagnostic = null;
|
|
23
23
|
const MAX_SKILL_NAME_LEN = 64;
|
|
24
24
|
const MAX_SKILL_DESCRIPTION_LEN = 1024;
|
|
@@ -1645,6 +1645,8 @@ function scanNodeImportContract(pluginDir, entryPaths, options) {
|
|
|
1645
1645
|
}
|
|
1646
1646
|
if (!resolved.path) {
|
|
1647
1647
|
const requested = path.posix.normalize(path.posix.join(path.posix.dirname(relativePath), specifier));
|
|
1648
|
+
if (options.nativeToolReader && requested === options.nativeToolReader)
|
|
1649
|
+
continue;
|
|
1648
1650
|
if ((options.runtimeConfigSkillRoots ?? []).some((root) => (relativePath.startsWith(`${root}/`)
|
|
1649
1651
|
&& requested === path.posix.join(root, AW_RUNTIME_CONFIG_READER_PATH))))
|
|
1650
1652
|
continue;
|
|
@@ -2918,8 +2920,20 @@ async function validateAuthorManagedCommands(pluginDir, manifest, rendered, cont
|
|
|
2918
2920
|
const sets = (manifest.managedCommands?.sets ?? [])
|
|
2919
2921
|
.filter((set) => set.producer.kind === 'package' && set.producer.packageKey === commandPackage.key)
|
|
2920
2922
|
.map((set) => setOutputs(set, 'managed-commands', commandPackage.scope));
|
|
2921
|
-
const
|
|
2922
|
-
const
|
|
2923
|
+
const sourceRoot = path.join(pluginDir, normalizeRelativePath(commandPackage.sourceDir));
|
|
2924
|
+
const files = { ...(rendered.find((entry) => entry.artifact.id === `command-package.${commandPackage.key}`)?.artifact.files ?? {}) };
|
|
2925
|
+
if (manifest.nativeTools) {
|
|
2926
|
+
const readerPath = path.join(pluginDir, normalizeRelativePath(manifest.nativeTools.reader));
|
|
2927
|
+
const relativeReader = path.relative(sourceRoot, readerPath);
|
|
2928
|
+
if (relativeReader && relativeReader !== '..' && !relativeReader.startsWith(`..${path.sep}`) && !path.isAbsolute(relativeReader) && !fs.existsSync(readerPath)) {
|
|
2929
|
+
const readerFile = relativeReader.split(path.sep).join('/');
|
|
2930
|
+
const readerSource = createNativeToolReaderSource();
|
|
2931
|
+
if (Object.hasOwn(files, readerFile) && files[readerFile] !== readerSource)
|
|
2932
|
+
throw new Error('nativeToolReaderMismatch');
|
|
2933
|
+
files[readerFile] = readerSource;
|
|
2934
|
+
}
|
|
2935
|
+
}
|
|
2936
|
+
const prepared = await tools.prepareManagedCommandPackageFiles({ sourceRoot, files, entries: sets.flatMap((set) => set.entries) });
|
|
2923
2937
|
cleanups.push(prepared.cleanup);
|
|
2924
2938
|
candidates.push({ producer: await tools.managedCommandProducerIdentity({ plugin, producer: { kind: 'package', packageKey: commandPackage.key }, scope: commandPackage.scope, cwd: pluginDir }), sets });
|
|
2925
2939
|
}
|
|
@@ -2994,6 +3008,7 @@ function validateScriptsLightweight(pluginDir, manifest) {
|
|
|
2994
3008
|
const runtimeNodeEntries = [];
|
|
2995
3009
|
let artifactRenderEntry = null;
|
|
2996
3010
|
let packageMeta = null;
|
|
3011
|
+
const nativeToolReader = manifest.nativeTools ? normalizeRelativePath(manifest.nativeTools.reader ?? './.aw/native-tool-reader.mjs') : undefined;
|
|
2997
3012
|
const runtimeConfigSkillRoots = (manifest.artifacts?.targets ?? [])
|
|
2998
3013
|
.filter((target) => target.runtimeConfig !== undefined)
|
|
2999
3014
|
.flatMap((target) => target.sourceDirs ?? [])
|
|
@@ -3046,6 +3061,7 @@ function validateScriptsLightweight(pluginDir, manifest) {
|
|
|
3046
3061
|
packageMeta,
|
|
3047
3062
|
allowDevDependencies: true,
|
|
3048
3063
|
runtimeConfigSkillRoots,
|
|
3064
|
+
nativeToolReader,
|
|
3049
3065
|
});
|
|
3050
3066
|
}
|
|
3051
3067
|
}
|
|
@@ -3096,6 +3112,7 @@ function validateScriptsLightweight(pluginDir, manifest) {
|
|
|
3096
3112
|
packageMeta,
|
|
3097
3113
|
allowDevDependencies: true,
|
|
3098
3114
|
runtimeConfigSkillRoots,
|
|
3115
|
+
nativeToolReader,
|
|
3099
3116
|
});
|
|
3100
3117
|
}
|
|
3101
3118
|
}
|
|
@@ -3106,6 +3123,7 @@ function validateScriptsLightweight(pluginDir, manifest) {
|
|
|
3106
3123
|
packageMeta,
|
|
3107
3124
|
allowDevDependencies: false,
|
|
3108
3125
|
runtimeConfigSkillRoots,
|
|
3126
|
+
nativeToolReader,
|
|
3109
3127
|
});
|
|
3110
3128
|
return artifactRenderEntry;
|
|
3111
3129
|
}
|