@lesliechan721/aw 0.1.0-beta.8 → 0.1.0-beta.9
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/add-skill.mjs +4 -4
- package/dist/authoring/scripts/add-skill.mjs.map +1 -1
- package/dist/authoring/scripts/init-plugin.mjs +4 -4
- 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 +77 -90
- package/dist/authoring/scripts/lib/skill-scaffold.mjs +99 -120
- package/dist/authoring/scripts/lib/skill-scaffold.mjs.map +1 -1
- package/dist/authoring/scripts/remove-plugin.mjs +1 -1
- package/dist/authoring/scripts/remove-plugin.mjs.map +1 -1
- package/dist/authoring/scripts/validate-plugin.mjs +34 -778
- package/dist/authoring/scripts/validate-plugin.mjs.map +1 -1
- package/dist/scripts/aw-skill-eval-materializer.d.ts +24 -0
- package/dist/scripts/{plugin-eval-materializer.js → aw-skill-eval-materializer.js} +34 -145
- package/dist/scripts/aw-skill-eval-materializer.js.map +1 -0
- package/dist/scripts/bundle-plugins.d.ts +1 -0
- package/dist/scripts/bundle-plugins.js +2 -1
- package/dist/scripts/bundle-plugins.js.map +1 -1
- package/dist/scripts/plugin-staging.d.ts +5 -6
- package/dist/scripts/plugin-staging.js +12 -13
- package/dist/scripts/plugin-staging.js.map +1 -1
- package/dist/src/authoring/workspace-commands.d.ts +2 -1
- package/dist/src/authoring/workspace-commands.js.map +1 -1
- package/dist/src/commands/aw-capabilities.d.ts +2 -2
- package/dist/src/commands/aw-capabilities.js +6 -11
- package/dist/src/commands/aw-capabilities.js.map +1 -1
- package/dist/src/commands/catalog-dev-source.d.ts +18 -12
- package/dist/src/commands/catalog-dev-source.js +241 -305
- package/dist/src/commands/catalog-dev-source.js.map +1 -1
- package/dist/src/commands/catalog-generation.d.ts +6 -19
- package/dist/src/commands/catalog-generation.js +10 -11
- package/dist/src/commands/catalog-generation.js.map +1 -1
- package/dist/src/commands/catalog-publication-inspection.d.ts +28 -27
- package/dist/src/commands/catalog-publication-inspection.js +139 -50
- package/dist/src/commands/catalog-publication-inspection.js.map +1 -1
- package/dist/src/commands/catalog-publication-journal.d.ts +49 -0
- package/dist/src/commands/catalog-publication-journal.js +147 -0
- package/dist/src/commands/catalog-publication-journal.js.map +1 -0
- package/dist/src/commands/catalog-publication-target.d.ts +2 -1
- package/dist/src/commands/catalog-publication-target.js +37 -2
- package/dist/src/commands/catalog-publication-target.js.map +1 -1
- package/dist/src/commands/catalog-publish.d.ts +51 -15
- package/dist/src/commands/catalog-publish.js +576 -219
- package/dist/src/commands/catalog-publish.js.map +1 -1
- package/dist/src/commands/catalog-source.d.ts +3 -28
- package/dist/src/commands/catalog-source.js +29 -140
- package/dist/src/commands/catalog-source.js.map +1 -1
- package/dist/src/commands/catalog-status.d.ts +6 -26
- package/dist/src/commands/catalog-status.js +8 -146
- package/dist/src/commands/catalog-status.js.map +1 -1
- package/dist/src/commands/catalog-workspace-resolution.d.ts +13 -0
- package/dist/src/commands/catalog-workspace-resolution.js +42 -0
- package/dist/src/commands/catalog-workspace-resolution.js.map +1 -0
- package/dist/src/commands/dependency-operation-plan.d.ts +88 -9
- package/dist/src/commands/dependency-operation-plan.js +331 -6
- package/dist/src/commands/dependency-operation-plan.js.map +1 -1
- package/dist/src/commands/init.d.ts +5 -11
- package/dist/src/commands/init.js +30 -51
- package/dist/src/commands/init.js.map +1 -1
- package/dist/src/commands/offline-cleanup-evidence.d.ts +20 -0
- package/dist/src/commands/offline-cleanup-evidence.js +87 -9
- package/dist/src/commands/offline-cleanup-evidence.js.map +1 -1
- package/dist/src/commands/options.d.ts +6 -1
- package/dist/src/commands/options.js +64 -6
- package/dist/src/commands/options.js.map +1 -1
- package/dist/src/commands/plugin-capabilities.js +4 -0
- package/dist/src/commands/plugin-capabilities.js.map +1 -1
- package/dist/src/commands/rebuild-command.d.ts +10 -8
- package/dist/src/commands/rebuild-command.js +1217 -426
- package/dist/src/commands/rebuild-command.js.map +1 -1
- package/dist/src/commands/rebuild-integration.d.ts +54 -6
- package/dist/src/commands/rebuild-integration.js +691 -364
- package/dist/src/commands/rebuild-integration.js.map +1 -1
- package/dist/src/commands/rebuild-operations.d.ts +2 -0
- package/dist/src/commands/rebuild-operations.js +31 -17
- package/dist/src/commands/rebuild-operations.js.map +1 -1
- package/dist/src/commands/skill-eval.d.ts +33 -0
- package/dist/src/commands/skill-eval.js +363 -0
- package/dist/src/commands/skill-eval.js.map +1 -0
- package/dist/src/commands/{status-v5.d.ts → status-v6.d.ts} +59 -26
- package/dist/src/commands/{status-v5.js → status-v6.js} +882 -79
- package/dist/src/commands/status-v6.js.map +1 -0
- package/dist/src/commands/sync-command.d.ts +21 -0
- package/dist/src/commands/sync-command.js +206 -0
- package/dist/src/commands/sync-command.js.map +1 -0
- package/dist/src/commands/wizard.d.ts +2 -2
- package/dist/src/commands/write-commands.js +1 -43
- package/dist/src/commands/write-commands.js.map +1 -1
- package/dist/src/constants.d.ts +5 -4
- package/dist/src/constants.js +5 -4
- package/dist/src/constants.js.map +1 -1
- package/dist/src/eval/manifest-v1.d.ts +66 -0
- package/dist/src/eval/manifest-v1.js +326 -0
- package/dist/src/eval/manifest-v1.js.map +1 -0
- package/dist/src/generators/local-plugin.d.ts +3 -0
- package/dist/src/generators/local-plugin.js +123 -55
- package/dist/src/generators/local-plugin.js.map +1 -1
- package/dist/src/index.d.ts +2 -0
- package/dist/src/index.js +412 -152
- package/dist/src/index.js.map +1 -1
- package/dist/src/output/command-receipt.d.ts +58 -8
- package/dist/src/output/command-receipt.js +141 -11
- package/dist/src/output/command-receipt.js.map +1 -1
- package/dist/src/output/model.d.ts +3 -11
- package/dist/src/portable/commands.d.ts +2 -2
- package/dist/src/portable/commands.js +2 -8
- package/dist/src/portable/commands.js.map +1 -1
- package/dist/src/portable/materializer.d.ts +1 -4
- package/dist/src/portable/materializer.js +0 -2
- package/dist/src/portable/materializer.js.map +1 -1
- package/dist/src/tui/catalog-generation.d.ts +20 -41
- package/dist/src/tui/catalog-generation.js +65 -224
- package/dist/src/tui/catalog-generation.js.map +1 -1
- package/dist/src/tui/components.js +1 -2
- package/dist/src/tui/components.js.map +1 -1
- package/dist/src/tui/console-app-v4.js +461 -330
- package/dist/src/tui/console-app-v4.js.map +1 -1
- package/dist/src/tui/controller-runtime.d.ts +3 -5
- package/dist/src/tui/controller-runtime.js +182 -187
- package/dist/src/tui/controller-runtime.js.map +1 -1
- package/dist/src/tui/controller.d.ts +42 -45
- package/dist/src/tui/controller.js +454 -407
- package/dist/src/tui/controller.js.map +1 -1
- package/dist/src/tui/diagnostics.d.ts +1 -2
- package/dist/src/tui/diagnostics.js.map +1 -1
- package/dist/src/tui/index.d.ts +1 -1
- package/dist/src/tui/index.js +1 -1
- package/dist/src/tui/index.js.map +1 -1
- package/dist/src/tui/model.d.ts +81 -13
- package/dist/src/tui/model.js +378 -95
- package/dist/src/tui/model.js.map +1 -1
- package/dist/src/tui/router.d.ts +9 -0
- package/dist/src/tui/router.js.map +1 -1
- package/dist/src/types.d.ts +54 -47
- package/dist/src/types.js.map +1 -1
- package/dist/src/utils/agent-version.d.ts +4 -1
- package/dist/src/utils/agent-version.js +28 -3
- package/dist/src/utils/agent-version.js.map +1 -1
- package/dist/src/utils/catalog-digests.d.ts +7 -0
- package/dist/src/utils/catalog-digests.js +27 -0
- package/dist/src/utils/catalog-digests.js.map +1 -1
- package/dist/src/utils/catalog-generation-control-snapshot.d.ts +11 -0
- package/dist/src/utils/catalog-generation-control-snapshot.js +45 -0
- package/dist/src/utils/catalog-generation-control-snapshot.js.map +1 -0
- package/dist/src/utils/catalog-generation-error.d.ts +2 -1
- package/dist/src/utils/catalog-generation-error.js +12 -0
- package/dist/src/utils/catalog-generation-error.js.map +1 -1
- package/dist/src/utils/catalog-generation-resolver.d.ts +10 -3
- package/dist/src/utils/catalog-generation-resolver.js +90 -76
- package/dist/src/utils/catalog-generation-resolver.js.map +1 -1
- package/dist/src/utils/catalog-generation-service.d.ts +24 -33
- package/dist/src/utils/catalog-generation-service.js +253 -567
- package/dist/src/utils/catalog-generation-service.js.map +1 -1
- package/dist/src/utils/catalog-generation-state.d.ts +4 -0
- package/dist/src/utils/catalog-generation-state.js +73 -106
- package/dist/src/utils/catalog-generation-state.js.map +1 -1
- package/dist/src/utils/catalog-generation-store.d.ts +16 -26
- package/dist/src/utils/catalog-generation-store.js +154 -290
- package/dist/src/utils/catalog-generation-store.js.map +1 -1
- package/dist/src/utils/catalog-manifest-v6.d.ts +5 -0
- package/dist/src/utils/{catalog-manifest-v5.js → catalog-manifest-v6.js} +23 -35
- package/dist/src/utils/catalog-manifest-v6.js.map +1 -0
- package/dist/src/utils/catalog-operation-context.d.ts +6 -14
- package/dist/src/utils/catalog-operation-context.js +68 -169
- package/dist/src/utils/catalog-operation-context.js.map +1 -1
- package/dist/src/utils/catalog-public-error.js +1 -4
- package/dist/src/utils/catalog-public-error.js.map +1 -1
- package/dist/src/utils/catalog-runtime-projection.d.ts +3 -0
- package/dist/src/utils/catalog-runtime-projection.js +5 -40
- package/dist/src/utils/catalog-runtime-projection.js.map +1 -1
- package/dist/src/utils/catalog-snapshot.d.ts +2 -2
- package/dist/src/utils/catalog-source-references.d.ts +7 -0
- package/dist/src/utils/catalog-source-references.js +44 -55
- package/dist/src/utils/catalog-source-references.js.map +1 -1
- package/dist/src/utils/catalog-sources.js +25 -9
- package/dist/src/utils/catalog-sources.js.map +1 -1
- package/dist/src/utils/codex-config.d.ts +2 -0
- package/dist/src/utils/codex-config.js +22 -1
- package/dist/src/utils/codex-config.js.map +1 -1
- package/dist/src/utils/codex-manager.d.ts +50 -2
- package/dist/src/utils/codex-manager.js +160 -6
- package/dist/src/utils/codex-manager.js.map +1 -1
- package/dist/src/utils/codex-reconciler.d.ts +131 -0
- package/dist/src/utils/codex-reconciler.js +327 -0
- package/dist/src/utils/codex-reconciler.js.map +1 -0
- package/dist/src/utils/codex-shared-native.d.ts +56 -0
- package/dist/src/utils/codex-shared-native.js +87 -0
- package/dist/src/utils/codex-shared-native.js.map +1 -0
- package/dist/src/utils/codex-surface-analysis.d.ts +44 -0
- package/dist/src/utils/codex-surface-analysis.js +247 -0
- package/dist/src/utils/codex-surface-analysis.js.map +1 -0
- package/dist/src/utils/git-catalog-provider.js +56 -115
- package/dist/src/utils/git-catalog-provider.js.map +1 -1
- package/dist/src/utils/manifest.d.ts +1 -3
- package/dist/src/utils/manifest.js +1 -3
- package/dist/src/utils/manifest.js.map +1 -1
- package/dist/src/utils/multi-source-catalog.d.ts +1 -10
- package/dist/src/utils/multi-source-catalog.js +8 -175
- package/dist/src/utils/multi-source-catalog.js.map +1 -1
- package/dist/src/utils/native-cli.d.ts +34 -0
- package/dist/src/utils/native-cli.js +91 -0
- package/dist/src/utils/native-cli.js.map +1 -1
- package/dist/src/utils/orphan-marketplace-cleanup.js +1 -0
- package/dist/src/utils/orphan-marketplace-cleanup.js.map +1 -1
- package/dist/src/utils/ownership.d.ts +0 -10
- package/dist/src/utils/ownership.js +3 -88
- package/dist/src/utils/ownership.js.map +1 -1
- package/dist/src/utils/path-catalog-provider.d.ts +1 -1
- package/dist/src/utils/path-catalog-provider.js +45 -62
- package/dist/src/utils/path-catalog-provider.js.map +1 -1
- package/dist/src/utils/paths.d.ts +0 -1
- package/dist/src/utils/paths.js +0 -1
- package/dist/src/utils/paths.js.map +1 -1
- package/dist/src/utils/plugin-config-write.js +0 -5
- package/dist/src/utils/plugin-config-write.js.map +1 -1
- package/dist/src/utils/plugin-intent-state.d.ts +39 -0
- package/dist/src/utils/plugin-intent-state.js +325 -0
- package/dist/src/utils/plugin-intent-state.js.map +1 -0
- package/dist/src/utils/target-eligibility.d.ts +3 -2
- package/dist/src/utils/target-eligibility.js +4 -3
- package/dist/src/utils/target-eligibility.js.map +1 -1
- package/package.json +5 -4
- package/dist/scripts/aw-skill-eval-engine.d.ts +0 -13
- package/dist/scripts/aw-skill-eval-engine.js +0 -31
- package/dist/scripts/aw-skill-eval-engine.js.map +0 -1
- package/dist/scripts/codex-eval-app-server.d.ts +0 -91
- package/dist/scripts/codex-eval-app-server.js +0 -1334
- package/dist/scripts/codex-eval-app-server.js.map +0 -1
- package/dist/scripts/codex-eval-isolation.d.ts +0 -61
- package/dist/scripts/codex-eval-isolation.js +0 -318
- package/dist/scripts/codex-eval-isolation.js.map +0 -1
- package/dist/scripts/codex-eval-process-management.d.ts +0 -8
- package/dist/scripts/codex-eval-process-management.js +0 -69
- package/dist/scripts/codex-eval-process-management.js.map +0 -1
- package/dist/scripts/codex-eval-process-tree.d.ts +0 -38
- package/dist/scripts/codex-eval-process-tree.js +0 -803
- package/dist/scripts/codex-eval-process-tree.js.map +0 -1
- package/dist/scripts/codex-eval-runtime-config.d.ts +0 -62
- package/dist/scripts/codex-eval-runtime-config.js +0 -843
- package/dist/scripts/codex-eval-runtime-config.js.map +0 -1
- package/dist/scripts/codex-trigger-eval.d.ts +0 -84
- package/dist/scripts/codex-trigger-eval.js +0 -968
- package/dist/scripts/codex-trigger-eval.js.map +0 -1
- package/dist/scripts/eval-plugin-skills-audited.d.ts +0 -6
- package/dist/scripts/eval-plugin-skills-audited.js +0 -261
- package/dist/scripts/eval-plugin-skills-audited.js.map +0 -1
- package/dist/scripts/eval-plugin-skills.d.ts +0 -45
- package/dist/scripts/eval-plugin-skills.js +0 -1589
- package/dist/scripts/eval-plugin-skills.js.map +0 -1
- package/dist/scripts/eval-run-layout.d.ts +0 -17
- package/dist/scripts/eval-run-layout.js +0 -26
- package/dist/scripts/eval-run-layout.js.map +0 -1
- package/dist/scripts/plugin-eval-contract.d.ts +0 -189
- package/dist/scripts/plugin-eval-contract.js +0 -745
- package/dist/scripts/plugin-eval-contract.js.map +0 -1
- package/dist/scripts/plugin-eval-materializer.d.ts +0 -13
- package/dist/scripts/plugin-eval-materializer.js.map +0 -1
- package/dist/scripts/skill-reporting.d.ts +0 -212
- package/dist/scripts/skill-reporting.js +0 -922
- package/dist/scripts/skill-reporting.js.map +0 -1
- package/dist/src/commands/catalog-context.d.ts +0 -52
- package/dist/src/commands/catalog-context.js +0 -156
- package/dist/src/commands/catalog-context.js.map +0 -1
- package/dist/src/commands/status-v5.js.map +0 -1
- package/dist/src/utils/catalog-manifest-v5.d.ts +0 -5
- package/dist/src/utils/catalog-manifest-v5.js.map +0 -1
- package/dist/src/utils/catalog-source-cache.d.ts +0 -62
- package/dist/src/utils/catalog-source-cache.js +0 -321
- package/dist/src/utils/catalog-source-cache.js.map +0 -1
- package/dist/src/utils/codex-project-surface.d.ts +0 -3
- package/dist/src/utils/codex-project-surface.js +0 -49
- package/dist/src/utils/codex-project-surface.js.map +0 -1
- package/dist/src/utils/plugin-release.d.ts +0 -2
- package/dist/src/utils/plugin-release.js +0 -2
- package/dist/src/utils/plugin-release.js.map +0 -1
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { DependencyScopeOverride, PlatformName, Scope } from '../types.js';
|
|
2
|
+
export declare const PLUGIN_INTENT_SCHEMA_VERSION = 1;
|
|
3
|
+
export declare const PLUGIN_INTENT_KIND = "aw-plugin-intents";
|
|
4
|
+
export interface PluginIntentRoot {
|
|
5
|
+
pluginId: string;
|
|
6
|
+
platforms: PlatformName[];
|
|
7
|
+
}
|
|
8
|
+
export type PluginIntentDependencyScopeOverride = DependencyScopeOverride;
|
|
9
|
+
export interface PluginIntentState {
|
|
10
|
+
schemaVersion: 1;
|
|
11
|
+
kind: 'aw-plugin-intents';
|
|
12
|
+
roots: PluginIntentRoot[];
|
|
13
|
+
dependencyScopeOverrides: PluginIntentDependencyScopeOverride[];
|
|
14
|
+
managed: {
|
|
15
|
+
codexPluginIds: string[];
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
export interface PluginIntentStateLocation {
|
|
19
|
+
scope: Scope;
|
|
20
|
+
cwd: string;
|
|
21
|
+
env?: NodeJS.ProcessEnv;
|
|
22
|
+
}
|
|
23
|
+
type PluginIntentPathAccess = 'read' | 'write';
|
|
24
|
+
export declare function createEmptyPluginIntentState(): PluginIntentState;
|
|
25
|
+
export declare function canonicalizePluginIntentState(state: PluginIntentState): PluginIntentState;
|
|
26
|
+
export declare function parsePluginIntentState(value: unknown): PluginIntentState;
|
|
27
|
+
export declare function serializePluginIntentState(state: PluginIntentState): string;
|
|
28
|
+
export declare function calculatePluginIntentDigest(state: PluginIntentState): string;
|
|
29
|
+
export declare function upsertPluginIntentRoot(state: PluginIntentState, root: PluginIntentRoot): PluginIntentState;
|
|
30
|
+
export declare function mergePluginIntentRootPlatforms(state: PluginIntentState, root: PluginIntentRoot): PluginIntentState;
|
|
31
|
+
export declare function addPluginIntentRoot(state: PluginIntentState, root: PluginIntentRoot): PluginIntentState;
|
|
32
|
+
export declare function removePluginIntentRoot(state: PluginIntentState, pluginId: string): PluginIntentState;
|
|
33
|
+
export declare function removePluginIntentRootPlatforms(state: PluginIntentState, root: PluginIntentRoot): PluginIntentState;
|
|
34
|
+
export declare function widenPluginIntentManagedCodexOwnership(state: PluginIntentState, desiredCodexPluginIds: readonly string[]): PluginIntentState;
|
|
35
|
+
export declare function convergePluginIntentManagedCodexOwnership(state: PluginIntentState, desiredCodexPluginIds: readonly string[]): PluginIntentState;
|
|
36
|
+
export declare function resolvePluginIntentStatePath(location: PluginIntentStateLocation, access?: PluginIntentPathAccess): string;
|
|
37
|
+
export declare function readPluginIntentState(location: PluginIntentStateLocation): Promise<PluginIntentState>;
|
|
38
|
+
export declare function writePluginIntentState(location: PluginIntentStateLocation, state: PluginIntentState): Promise<PluginIntentState>;
|
|
39
|
+
export {};
|
|
@@ -0,0 +1,325 @@
|
|
|
1
|
+
import crypto from 'node:crypto';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
import fs from 'fs-extra';
|
|
4
|
+
import { parsePluginId } from './multi-source-catalog.js';
|
|
5
|
+
import { atomicReplaceConfigFile, resolveAwProjectRoot, } from './plugin-config.js';
|
|
6
|
+
import { assertCanonicalProjectManagedRoots, assertProjectSharedConfigPathVisible, } from './project-boundary.js';
|
|
7
|
+
import { resolveAwHome } from './state-paths.js';
|
|
8
|
+
import { assertTestReadablePath, assertTestWritablePath, } from './test-path-fence.js';
|
|
9
|
+
export const PLUGIN_INTENT_SCHEMA_VERSION = 1;
|
|
10
|
+
export const PLUGIN_INTENT_KIND = 'aw-plugin-intents';
|
|
11
|
+
function compareText(left, right) {
|
|
12
|
+
return left < right ? -1 : left > right ? 1 : 0;
|
|
13
|
+
}
|
|
14
|
+
function isRecord(value) {
|
|
15
|
+
return typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
16
|
+
}
|
|
17
|
+
function assertExactKeys(value, expected, fieldName) {
|
|
18
|
+
const allowed = new Set(expected);
|
|
19
|
+
const unknown = Object.keys(value).filter((key) => !allowed.has(key));
|
|
20
|
+
const missing = expected.filter((key) => !(key in value));
|
|
21
|
+
if (unknown.length > 0 || missing.length > 0) {
|
|
22
|
+
throw new Error(`Invalid ${fieldName}: expected exactly ${expected.join(', ')}.`
|
|
23
|
+
+ `${unknown.length > 0 ? ` Unknown: ${unknown.sort(compareText).join(', ')}.` : ''}`
|
|
24
|
+
+ `${missing.length > 0 ? ` Missing: ${missing.join(', ')}.` : ''}`);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
function parseCanonicalPluginId(value, fieldName) {
|
|
28
|
+
if (typeof value !== 'string') {
|
|
29
|
+
throw new Error(`Invalid ${fieldName}: expected a source-qualified plugin ID.`);
|
|
30
|
+
}
|
|
31
|
+
const parsed = parsePluginId(value);
|
|
32
|
+
if (!parsed.sourceId) {
|
|
33
|
+
throw new Error(`Invalid ${fieldName}: expected a source-qualified plugin ID.`);
|
|
34
|
+
}
|
|
35
|
+
return `${parsed.sourceId}/${parsed.pluginName}`;
|
|
36
|
+
}
|
|
37
|
+
function parsePlatform(value, fieldName) {
|
|
38
|
+
if (value !== 'codex' && value !== 'claude') {
|
|
39
|
+
throw new Error(`Invalid ${fieldName}: expected codex or claude.`);
|
|
40
|
+
}
|
|
41
|
+
return value;
|
|
42
|
+
}
|
|
43
|
+
function parseScope(value, fieldName) {
|
|
44
|
+
if (value !== 'project' && value !== 'user') {
|
|
45
|
+
throw new Error(`Invalid ${fieldName}: expected project or user.`);
|
|
46
|
+
}
|
|
47
|
+
return value;
|
|
48
|
+
}
|
|
49
|
+
function parseCodexPluginId(value, fieldName) {
|
|
50
|
+
if (typeof value !== 'string' || value.trim() === '' || value !== value.trim()) {
|
|
51
|
+
throw new Error(`Invalid ${fieldName}: expected a non-empty canonical Codex plugin ID.`);
|
|
52
|
+
}
|
|
53
|
+
return value;
|
|
54
|
+
}
|
|
55
|
+
function canonicalPlatforms(platforms) {
|
|
56
|
+
return [...new Set(platforms)].sort(compareText);
|
|
57
|
+
}
|
|
58
|
+
export function createEmptyPluginIntentState() {
|
|
59
|
+
return {
|
|
60
|
+
schemaVersion: PLUGIN_INTENT_SCHEMA_VERSION,
|
|
61
|
+
kind: PLUGIN_INTENT_KIND,
|
|
62
|
+
roots: [],
|
|
63
|
+
dependencyScopeOverrides: [],
|
|
64
|
+
managed: { codexPluginIds: [] },
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
export function canonicalizePluginIntentState(state) {
|
|
68
|
+
const roots = state.roots.map((root) => ({
|
|
69
|
+
pluginId: parseCanonicalPluginId(root.pluginId, 'roots[].pluginId'),
|
|
70
|
+
platforms: canonicalPlatforms(root.platforms.map((platform) => parsePlatform(platform, 'roots[].platforms[]'))),
|
|
71
|
+
}));
|
|
72
|
+
if (roots.some((root) => root.platforms.length === 0)) {
|
|
73
|
+
throw new Error('Invalid roots[].platforms: expected at least one platform.');
|
|
74
|
+
}
|
|
75
|
+
if (new Set(roots.map((root) => root.pluginId)).size !== roots.length) {
|
|
76
|
+
throw new Error('Invalid roots: duplicate pluginId.');
|
|
77
|
+
}
|
|
78
|
+
const dependencyScopeOverrides = state.dependencyScopeOverrides.map((override) => ({
|
|
79
|
+
pluginId: parseCanonicalPluginId(override.pluginId, 'dependencyScopeOverrides[].pluginId'),
|
|
80
|
+
platform: parsePlatform(override.platform, 'dependencyScopeOverrides[].platform'),
|
|
81
|
+
scope: parseScope(override.scope, 'dependencyScopeOverrides[].scope'),
|
|
82
|
+
}));
|
|
83
|
+
const overrideKeys = dependencyScopeOverrides.map((override) => `${override.pluginId}\0${override.platform}`);
|
|
84
|
+
if (new Set(overrideKeys).size !== overrideKeys.length) {
|
|
85
|
+
throw new Error('Invalid dependencyScopeOverrides: duplicate pluginId/platform target.');
|
|
86
|
+
}
|
|
87
|
+
return {
|
|
88
|
+
schemaVersion: PLUGIN_INTENT_SCHEMA_VERSION,
|
|
89
|
+
kind: PLUGIN_INTENT_KIND,
|
|
90
|
+
roots: roots.sort((left, right) => compareText(left.pluginId, right.pluginId)),
|
|
91
|
+
dependencyScopeOverrides: dependencyScopeOverrides.sort((left, right) => compareText(`${left.pluginId}\0${left.platform}`, `${right.pluginId}\0${right.platform}`)),
|
|
92
|
+
managed: {
|
|
93
|
+
codexPluginIds: [...new Set(state.managed.codexPluginIds.map((pluginId) => parseCodexPluginId(pluginId, 'managed.codexPluginIds[]')))].sort(compareText),
|
|
94
|
+
},
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
export function parsePluginIntentState(value) {
|
|
98
|
+
if (!isRecord(value))
|
|
99
|
+
throw new Error('Invalid plugin intent state: expected an object.');
|
|
100
|
+
assertExactKeys(value, ['schemaVersion', 'kind', 'roots', 'dependencyScopeOverrides', 'managed'], 'plugin intent state');
|
|
101
|
+
if (value.schemaVersion !== PLUGIN_INTENT_SCHEMA_VERSION) {
|
|
102
|
+
throw new Error('Invalid plugin intent state schemaVersion: expected 1.');
|
|
103
|
+
}
|
|
104
|
+
if (value.kind !== PLUGIN_INTENT_KIND) {
|
|
105
|
+
throw new Error(`Invalid plugin intent state kind: expected ${PLUGIN_INTENT_KIND}.`);
|
|
106
|
+
}
|
|
107
|
+
if (!Array.isArray(value.roots))
|
|
108
|
+
throw new Error('Invalid roots: expected an array.');
|
|
109
|
+
if (!Array.isArray(value.dependencyScopeOverrides)) {
|
|
110
|
+
throw new Error('Invalid dependencyScopeOverrides: expected an array.');
|
|
111
|
+
}
|
|
112
|
+
if (!isRecord(value.managed))
|
|
113
|
+
throw new Error('Invalid managed: expected an object.');
|
|
114
|
+
assertExactKeys(value.managed, ['codexPluginIds'], 'managed');
|
|
115
|
+
if (!Array.isArray(value.managed.codexPluginIds)) {
|
|
116
|
+
throw new Error('Invalid managed.codexPluginIds: expected an array.');
|
|
117
|
+
}
|
|
118
|
+
const roots = value.roots.map((entry, index) => {
|
|
119
|
+
if (!isRecord(entry))
|
|
120
|
+
throw new Error(`Invalid roots[${index}]: expected an object.`);
|
|
121
|
+
assertExactKeys(entry, ['pluginId', 'platforms'], `roots[${index}]`);
|
|
122
|
+
if (!Array.isArray(entry.platforms)) {
|
|
123
|
+
throw new Error(`Invalid roots[${index}].platforms: expected an array.`);
|
|
124
|
+
}
|
|
125
|
+
return {
|
|
126
|
+
pluginId: parseCanonicalPluginId(entry.pluginId, `roots[${index}].pluginId`),
|
|
127
|
+
platforms: entry.platforms.map((platform, platformIndex) => parsePlatform(platform, `roots[${index}].platforms[${platformIndex}]`)),
|
|
128
|
+
};
|
|
129
|
+
});
|
|
130
|
+
const dependencyScopeOverrides = value.dependencyScopeOverrides.map((entry, index) => {
|
|
131
|
+
if (!isRecord(entry)) {
|
|
132
|
+
throw new Error(`Invalid dependencyScopeOverrides[${index}]: expected an object.`);
|
|
133
|
+
}
|
|
134
|
+
assertExactKeys(entry, ['pluginId', 'platform', 'scope'], `dependencyScopeOverrides[${index}]`);
|
|
135
|
+
return {
|
|
136
|
+
pluginId: parseCanonicalPluginId(entry.pluginId, `dependencyScopeOverrides[${index}].pluginId`),
|
|
137
|
+
platform: parsePlatform(entry.platform, `dependencyScopeOverrides[${index}].platform`),
|
|
138
|
+
scope: parseScope(entry.scope, `dependencyScopeOverrides[${index}].scope`),
|
|
139
|
+
};
|
|
140
|
+
});
|
|
141
|
+
return canonicalizePluginIntentState({
|
|
142
|
+
schemaVersion: PLUGIN_INTENT_SCHEMA_VERSION,
|
|
143
|
+
kind: PLUGIN_INTENT_KIND,
|
|
144
|
+
roots,
|
|
145
|
+
dependencyScopeOverrides,
|
|
146
|
+
managed: {
|
|
147
|
+
codexPluginIds: value.managed.codexPluginIds.map((pluginId, index) => parseCodexPluginId(pluginId, `managed.codexPluginIds[${index}]`)),
|
|
148
|
+
},
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
export function serializePluginIntentState(state) {
|
|
152
|
+
return `${JSON.stringify(canonicalizePluginIntentState(state), null, 2)}\n`;
|
|
153
|
+
}
|
|
154
|
+
export function calculatePluginIntentDigest(state) {
|
|
155
|
+
const canonical = canonicalizePluginIntentState(state);
|
|
156
|
+
const digest = crypto.createHash('sha256').update(JSON.stringify(canonical)).digest('hex');
|
|
157
|
+
return `sha256:${digest}`;
|
|
158
|
+
}
|
|
159
|
+
export function upsertPluginIntentRoot(state, root) {
|
|
160
|
+
const pluginId = parseCanonicalPluginId(root.pluginId, 'root.pluginId');
|
|
161
|
+
return canonicalizePluginIntentState({
|
|
162
|
+
...state,
|
|
163
|
+
roots: [
|
|
164
|
+
...state.roots.filter((entry) => entry.pluginId !== pluginId),
|
|
165
|
+
{ pluginId, platforms: [...root.platforms] },
|
|
166
|
+
],
|
|
167
|
+
});
|
|
168
|
+
}
|
|
169
|
+
export function mergePluginIntentRootPlatforms(state, root) {
|
|
170
|
+
const pluginId = parseCanonicalPluginId(root.pluginId, 'root.pluginId');
|
|
171
|
+
const current = state.roots.find((entry) => entry.pluginId === pluginId);
|
|
172
|
+
return upsertPluginIntentRoot(state, {
|
|
173
|
+
pluginId,
|
|
174
|
+
platforms: [...(current?.platforms ?? []), ...root.platforms],
|
|
175
|
+
});
|
|
176
|
+
}
|
|
177
|
+
export function addPluginIntentRoot(state, root) {
|
|
178
|
+
const pluginId = parseCanonicalPluginId(root.pluginId, 'root.pluginId');
|
|
179
|
+
if (state.roots.some((entry) => entry.pluginId === pluginId)) {
|
|
180
|
+
throw new Error(`Plugin intent root already exists: ${pluginId}`);
|
|
181
|
+
}
|
|
182
|
+
return upsertPluginIntentRoot(state, { ...root, pluginId });
|
|
183
|
+
}
|
|
184
|
+
export function removePluginIntentRoot(state, pluginId) {
|
|
185
|
+
const canonicalPluginId = parseCanonicalPluginId(pluginId, 'pluginId');
|
|
186
|
+
return canonicalizePluginIntentState({
|
|
187
|
+
...state,
|
|
188
|
+
roots: state.roots.filter((entry) => entry.pluginId !== canonicalPluginId),
|
|
189
|
+
});
|
|
190
|
+
}
|
|
191
|
+
export function removePluginIntentRootPlatforms(state, root) {
|
|
192
|
+
const pluginId = parseCanonicalPluginId(root.pluginId, 'root.pluginId');
|
|
193
|
+
const removed = new Set(root.platforms.map((platform) => parsePlatform(platform, 'root.platforms[]')));
|
|
194
|
+
const current = state.roots.find((entry) => entry.pluginId === pluginId);
|
|
195
|
+
if (!current)
|
|
196
|
+
return state;
|
|
197
|
+
const platforms = current.platforms.filter((platform) => !removed.has(platform));
|
|
198
|
+
return platforms.length === 0
|
|
199
|
+
? removePluginIntentRoot(state, pluginId)
|
|
200
|
+
: upsertPluginIntentRoot(state, { pluginId, platforms });
|
|
201
|
+
}
|
|
202
|
+
export function widenPluginIntentManagedCodexOwnership(state, desiredCodexPluginIds) {
|
|
203
|
+
return canonicalizePluginIntentState({
|
|
204
|
+
...state,
|
|
205
|
+
managed: {
|
|
206
|
+
codexPluginIds: [
|
|
207
|
+
...state.managed.codexPluginIds,
|
|
208
|
+
...desiredCodexPluginIds,
|
|
209
|
+
],
|
|
210
|
+
},
|
|
211
|
+
});
|
|
212
|
+
}
|
|
213
|
+
export function convergePluginIntentManagedCodexOwnership(state, desiredCodexPluginIds) {
|
|
214
|
+
return canonicalizePluginIntentState({
|
|
215
|
+
...state,
|
|
216
|
+
managed: { codexPluginIds: [...desiredCodexPluginIds] },
|
|
217
|
+
});
|
|
218
|
+
}
|
|
219
|
+
export function resolvePluginIntentStatePath(location, access) {
|
|
220
|
+
const filePath = location.scope === 'user'
|
|
221
|
+
? path.join(resolveAwHome(location.env), 'plugin-intents.json')
|
|
222
|
+
: path.join(resolveAwProjectRoot(location.cwd), '.agent-workflows', 'plugin-intents.json');
|
|
223
|
+
if (access === 'read') {
|
|
224
|
+
return assertTestReadablePath(filePath, `${location.scope} plugin intent state`, '用测试隔离环境登记可读 project 或 AW_HOME 根。');
|
|
225
|
+
}
|
|
226
|
+
if (access === 'write') {
|
|
227
|
+
return assertTestWritablePath(filePath, `${location.scope} plugin intent state`, '用 createIsolatedTestEnv() 或 withSafeTestCwd() 登记可写根。');
|
|
228
|
+
}
|
|
229
|
+
return filePath;
|
|
230
|
+
}
|
|
231
|
+
function assertPathInsideRoot(allowedRoot, filePath) {
|
|
232
|
+
const relative = path.relative(path.resolve(allowedRoot), path.resolve(filePath));
|
|
233
|
+
if (relative === ''
|
|
234
|
+
|| relative === '..'
|
|
235
|
+
|| relative.startsWith(`..${path.sep}`)
|
|
236
|
+
|| path.isAbsolute(relative)) {
|
|
237
|
+
throw new Error('Plugin intent path escapes its allowed root.');
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
async function assertReadableIntentPath(allowedRoot, filePath) {
|
|
241
|
+
assertPathInsideRoot(allowedRoot, filePath);
|
|
242
|
+
const root = path.resolve(allowedRoot);
|
|
243
|
+
const rootStats = await fs.lstat(root).catch((error) => {
|
|
244
|
+
if (error.code === 'ENOENT')
|
|
245
|
+
return null;
|
|
246
|
+
throw error;
|
|
247
|
+
});
|
|
248
|
+
if (!rootStats)
|
|
249
|
+
return false;
|
|
250
|
+
if (rootStats.isSymbolicLink() || !rootStats.isDirectory()) {
|
|
251
|
+
throw new Error(`Plugin intent root must be a regular directory: ${root}`);
|
|
252
|
+
}
|
|
253
|
+
let current = root;
|
|
254
|
+
for (const segment of path.relative(root, path.resolve(filePath)).split(path.sep).filter(Boolean)) {
|
|
255
|
+
current = path.join(current, segment);
|
|
256
|
+
const stats = await fs.lstat(current).catch((error) => {
|
|
257
|
+
if (error.code === 'ENOENT')
|
|
258
|
+
return null;
|
|
259
|
+
throw error;
|
|
260
|
+
});
|
|
261
|
+
if (!stats)
|
|
262
|
+
return false;
|
|
263
|
+
if (stats.isSymbolicLink()) {
|
|
264
|
+
throw new Error(`Plugin intent path cannot contain a symbolic link: ${current}`);
|
|
265
|
+
}
|
|
266
|
+
if (current === path.resolve(filePath) && !stats.isFile()) {
|
|
267
|
+
throw new Error(`Plugin intent target must be a regular file: ${filePath}`);
|
|
268
|
+
}
|
|
269
|
+
if (current !== path.resolve(filePath) && !stats.isDirectory()) {
|
|
270
|
+
throw new Error(`Plugin intent path parent must be a directory: ${current}`);
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
return true;
|
|
274
|
+
}
|
|
275
|
+
async function resolveIntentLocation(location) {
|
|
276
|
+
if (location.scope === 'user') {
|
|
277
|
+
const allowedRoot = resolveAwHome(location.env);
|
|
278
|
+
return {
|
|
279
|
+
allowedRoot,
|
|
280
|
+
filePath: resolvePluginIntentStatePath(location),
|
|
281
|
+
};
|
|
282
|
+
}
|
|
283
|
+
const allowedRoot = await assertCanonicalProjectManagedRoots({
|
|
284
|
+
cwd: location.cwd,
|
|
285
|
+
rootNames: [],
|
|
286
|
+
managedPaths: ['.agent-workflows'],
|
|
287
|
+
});
|
|
288
|
+
return {
|
|
289
|
+
allowedRoot,
|
|
290
|
+
filePath: path.join(allowedRoot, '.agent-workflows', 'plugin-intents.json'),
|
|
291
|
+
};
|
|
292
|
+
}
|
|
293
|
+
export async function readPluginIntentState(location) {
|
|
294
|
+
resolvePluginIntentStatePath(location, 'read');
|
|
295
|
+
const { allowedRoot, filePath } = await resolveIntentLocation(location);
|
|
296
|
+
if (!await assertReadableIntentPath(allowedRoot, filePath)) {
|
|
297
|
+
return createEmptyPluginIntentState();
|
|
298
|
+
}
|
|
299
|
+
let value;
|
|
300
|
+
try {
|
|
301
|
+
value = JSON.parse(await fs.readFile(filePath, 'utf8'));
|
|
302
|
+
}
|
|
303
|
+
catch (error) {
|
|
304
|
+
if (error instanceof SyntaxError) {
|
|
305
|
+
throw new Error('Invalid plugin intent state JSON.');
|
|
306
|
+
}
|
|
307
|
+
throw error;
|
|
308
|
+
}
|
|
309
|
+
return parsePluginIntentState(value);
|
|
310
|
+
}
|
|
311
|
+
export async function writePluginIntentState(location, state) {
|
|
312
|
+
const requestedPath = resolvePluginIntentStatePath(location, 'write');
|
|
313
|
+
if (location.scope === 'project') {
|
|
314
|
+
await assertProjectSharedConfigPathVisible({ cwd: location.cwd, targetPath: requestedPath });
|
|
315
|
+
}
|
|
316
|
+
const { allowedRoot, filePath } = await resolveIntentLocation(location);
|
|
317
|
+
const canonical = canonicalizePluginIntentState(state);
|
|
318
|
+
await atomicReplaceConfigFile({
|
|
319
|
+
filePath,
|
|
320
|
+
allowedRoot,
|
|
321
|
+
content: serializePluginIntentState(canonical),
|
|
322
|
+
});
|
|
323
|
+
return canonical;
|
|
324
|
+
}
|
|
325
|
+
//# sourceMappingURL=plugin-intent-state.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin-intent-state.js","sourceRoot":"","sources":["../../../src/utils/plugin-intent-state.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,aAAa,CAAC;AACjC,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,MAAM,UAAU,CAAC;AAG1B,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,EACL,uBAAuB,EACvB,oBAAoB,GACrB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,kCAAkC,EAClC,oCAAoC,GACrC,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EACL,sBAAsB,EACtB,sBAAsB,GACvB,MAAM,sBAAsB,CAAC;AAE9B,MA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
|
-
import type {
|
|
1
|
+
import type { StatusV6Target } from '../commands/status-v6.js';
|
|
2
2
|
import type { CommandWizardCommand, CommandWizardPluginCandidate, CommandWizardSelection } from '../commands/wizard.js';
|
|
3
|
-
export declare function targetCanBeUninstalled(state:
|
|
3
|
+
export declare function targetCanBeUninstalled(state: StatusV6Target['state']): boolean;
|
|
4
4
|
export declare function targetHasArtifactCollision(target: {
|
|
5
5
|
errors: ReadonlyArray<{
|
|
6
6
|
code: string;
|
|
7
|
+
severity: 'warning' | 'blocking';
|
|
7
8
|
}>;
|
|
8
9
|
}): boolean;
|
|
9
10
|
export declare function writeCandidateEligibility(command: CommandWizardCommand, candidate: CommandWizardPluginCandidate, selection: CommandWizardSelection): {
|
|
@@ -2,7 +2,7 @@ export function targetCanBeUninstalled(state) {
|
|
|
2
2
|
return state === 'present' || state === 'partial';
|
|
3
3
|
}
|
|
4
4
|
export function targetHasArtifactCollision(target) {
|
|
5
|
-
return target.errors.some((error) => error.code === 'artifactCollision');
|
|
5
|
+
return target.errors.some((error) => error.code === 'artifactCollision' && error.severity === 'blocking');
|
|
6
6
|
}
|
|
7
7
|
export function writeCandidateEligibility(command, candidate, selection) {
|
|
8
8
|
const targets = candidate.targets.filter((target) => target.scope === (selection.scope ?? 'user')
|
|
@@ -12,8 +12,9 @@ export function writeCandidateEligibility(command, candidate, selection) {
|
|
|
12
12
|
}
|
|
13
13
|
const selectable = targets.every((target) => ({
|
|
14
14
|
install: target.state === 'absent' && !targetHasArtifactCollision(target),
|
|
15
|
-
reinstall: target.state === 'present' || target.state === 'partial'
|
|
16
|
-
|
|
15
|
+
reinstall: (target.state === 'present' || target.state === 'partial')
|
|
16
|
+
&& !targetHasArtifactCollision(target),
|
|
17
|
+
upgrade: target.state === 'present' && !targetHasArtifactCollision(target),
|
|
17
18
|
uninstall: targetCanBeUninstalled(target.state),
|
|
18
19
|
cleanup: target.state !== 'absent',
|
|
19
20
|
'config:list': false,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"target-eligibility.js","sourceRoot":"","sources":["../../../src/utils/target-eligibility.ts"],"names":[],"mappings":"AAOA,MAAM,UAAU,sBAAsB,CAAC,KAA8B;IACnE,OAAO,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,SAAS,CAAC;AACpD,CAAC;AAED,MAAM,UAAU,0BAA0B,CAAC,MAE1C;IACC,OAAO,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,
|
|
1
|
+
{"version":3,"file":"target-eligibility.js","sourceRoot":"","sources":["../../../src/utils/target-eligibility.ts"],"names":[],"mappings":"AAOA,MAAM,UAAU,sBAAsB,CAAC,KAA8B;IACnE,OAAO,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,SAAS,CAAC;AACpD,CAAC;AAED,MAAM,UAAU,0BAA0B,CAAC,MAE1C;IACC,OAAO,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAClC,KAAK,CAAC,IAAI,KAAK,mBAAmB,IAAI,KAAK,CAAC,QAAQ,KAAK,UAAU,CAAC,CAAC;AACzE,CAAC;AAED,MAAM,UAAU,yBAAyB,CACvC,OAA6B,EAC7B,SAAuC,EACvC,SAAiC;IAEjC,MAAM,OAAO,GAAG,SAAS,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,MAAM,EAAE,EAAE,CAClD,MAAM,CAAC,KAAK,KAAK,CAAC,SAAS,CAAC,KAAK,IAAI,MAAM,CAAC;WACzC,CAAC,SAAS,CAAC,QAAQ,KAAK,MAAM,IAAI,MAAM,CAAC,QAAQ,KAAK,SAAS,CAAC,QAAQ,CAAC,CAAC,CAAC;IAChF,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACzB,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,EAAE,2BAA2B,EAAE,CAAC;IACpE,CAAC;IACD,MAAM,UAAU,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;QAC5C,OAAO,EAAE,MAAM,CAAC,KAAK,KAAK,QAAQ,IAAI,CAAC,0BAA0B,CAAC,MAAM,CAAC;QACzE,SAAS,EAAE,CAAC,MAAM,CAAC,KAAK,KAAK,SAAS,IAAI,MAAM,CAAC,KAAK,KAAK,SAAS,CAAC;eAChE,CAAC,0BAA0B,CAAC,MAAM,CAAC;QACxC,OAAO,EAAE,MAAM,CAAC,KAAK,KAAK,SAAS,IAAI,CAAC,0BAA0B,CAAC,MAAM,CAAC;QAC1E,SAAS,EAAE,sBAAsB,CAAC,MAAM,CAAC,KAAK,CAAC;QAC/C,OAAO,EAAE,MAAM,CAAC,KAAK,KAAK,QAAQ;QAClC,aAAa,EAAE,KAAK;QACpB,YAAY,EAAE,KAAK;QACnB,YAAY,EAAE,KAAK;QACnB,cAAc,EAAE,KAAK;QACrB,cAAc,EAAE,KAAK;KACtB,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;IACb,OAAO,UAAU;QACf,CAAC,CAAC,EAAE,UAAU,EAAE,IAAI,EAAE;QACtB,CAAC,CAAC,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,EAAE,mBAAmB,OAAO,EAAE,EAAE,CAAC;AAClE,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lesliechan721/aw",
|
|
3
|
-
"version": "0.1.0-beta.
|
|
3
|
+
"version": "0.1.0-beta.9",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": ">=22"
|
|
@@ -17,8 +17,8 @@
|
|
|
17
17
|
],
|
|
18
18
|
"dependencies": {
|
|
19
19
|
"@inkjs/ui": "^2.0.0",
|
|
20
|
-
"@lesliechan721/agent-skill-eval": "0.1.0-beta.
|
|
21
|
-
"@lesliechan721/aw-plugin-core": "0.1.0-beta.
|
|
20
|
+
"@lesliechan721/agent-skill-eval": "0.1.0-beta.9",
|
|
21
|
+
"@lesliechan721/aw-plugin-core": "0.1.0-beta.9",
|
|
22
22
|
"commander": "^14.0.1",
|
|
23
23
|
"fs-extra": "^11.3.0",
|
|
24
24
|
"ink": "^7.1.1",
|
|
@@ -35,6 +35,7 @@
|
|
|
35
35
|
"@types/react": "^19.2.18",
|
|
36
36
|
"@vitest/coverage-v8": "^3.2.4",
|
|
37
37
|
"ink-testing-library": "^4.0.0",
|
|
38
|
+
"playwright": "^1.62.1",
|
|
38
39
|
"typescript": "^5.9.3",
|
|
39
40
|
"vitest": "^3.2.4"
|
|
40
41
|
},
|
|
@@ -54,8 +55,8 @@
|
|
|
54
55
|
"test:smoke:publish:release": "vitest run --config vitest.smoke.config.ts tests/smoke/release-publish-entry-smoke.test.ts",
|
|
55
56
|
"test:smoke:bootstrap:catalog": "vitest run --config vitest.smoke.config.ts tests/smoke/catalog-bootstrap-smoke.test.ts",
|
|
56
57
|
"test:smoke:fetch": "pnpm run test:smoke:publish:catalog",
|
|
58
|
+
"test:smoke:ask-me-browser": "vitest run --config vitest.smoke.config.ts tests/smoke/ask-me-prototype-review-browser.test.ts",
|
|
57
59
|
"plugin:test": "tsc -p tsconfig.json && node dist/scripts/test-plugin-scripts.js",
|
|
58
|
-
"plugin:eval": "tsc -p tsconfig.json && node dist/scripts/eval-plugin-skills-audited.js",
|
|
59
60
|
"test:smoke:plugin-scripts": "vitest run --config vitest.smoke.config.ts tests/smoke/plugin-scripts-staging-smoke.test.ts"
|
|
60
61
|
}
|
|
61
62
|
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { validateRunBundle, type RunExecutionPlanOptions, type RunExecutionResult } from '@lesliechan721/agent-skill-eval';
|
|
2
|
-
export interface AwSkillEvalExecutionResult extends RunExecutionResult {
|
|
3
|
-
engine: {
|
|
4
|
-
provider: string;
|
|
5
|
-
version: string;
|
|
6
|
-
};
|
|
7
|
-
bundleValidation: Awaited<ReturnType<typeof validateRunBundle>>;
|
|
8
|
-
}
|
|
9
|
-
export declare function getAwSkillEvalExecutionOwner(): {
|
|
10
|
-
provider: string;
|
|
11
|
-
version: string;
|
|
12
|
-
};
|
|
13
|
-
export declare function runAwSkillEvalExecutionPlan(planPath: string, options?: RunExecutionPlanOptions): Promise<AwSkillEvalExecutionResult>;
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import path from 'node:path';
|
|
2
|
-
import { getRuntimeCapabilities, runExecutionPlan, validateExecutionPlan, validateRunBundle, } from '@lesliechan721/agent-skill-eval';
|
|
3
|
-
export function getAwSkillEvalExecutionOwner() {
|
|
4
|
-
const capabilities = getRuntimeCapabilities();
|
|
5
|
-
return {
|
|
6
|
-
provider: capabilities.provider,
|
|
7
|
-
version: capabilities.providerVersion,
|
|
8
|
-
};
|
|
9
|
-
}
|
|
10
|
-
// AW owns only the high-level dispatch here. The shared package owns its plan validation,
|
|
11
|
-
// provider execution, evidence capture, bundle construction, and bundle validation. AW-native
|
|
12
|
-
// command, trigger, and conversation suites keep their separate suite/report contracts and must
|
|
13
|
-
// not be translated into an AwSkillEvalExecutionPlan.
|
|
14
|
-
export async function runAwSkillEvalExecutionPlan(planPath, options = {}) {
|
|
15
|
-
const absolutePlanPath = path.resolve(planPath);
|
|
16
|
-
const planValidation = await validateExecutionPlan(absolutePlanPath);
|
|
17
|
-
if (!planValidation.valid) {
|
|
18
|
-
throw new Error(`AwSkillEvalExecutionPlan is invalid:\n${planValidation.errors.join('\n')}`);
|
|
19
|
-
}
|
|
20
|
-
const execution = await runExecutionPlan(absolutePlanPath, options);
|
|
21
|
-
const bundleValidation = await validateRunBundle(execution.bundlePath);
|
|
22
|
-
if (!bundleValidation.valid) {
|
|
23
|
-
throw new Error(`EvalRunBundle is invalid:\n${bundleValidation.errors.join('\n')}`);
|
|
24
|
-
}
|
|
25
|
-
return {
|
|
26
|
-
...execution,
|
|
27
|
-
engine: getAwSkillEvalExecutionOwner(),
|
|
28
|
-
bundleValidation,
|
|
29
|
-
};
|
|
30
|
-
}
|
|
31
|
-
//# sourceMappingURL=aw-skill-eval-engine.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"aw-skill-eval-engine.js","sourceRoot":"","sources":["../../scripts/aw-skill-eval-engine.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EACL,sBAAsB,EACtB,gBAAgB,EAChB,qBAAqB,EACrB,iBAAiB,GAGlB,MAAM,iCAAiC,CAAC;AAOzC,MAAM,UAAU,4BAA4B;IAC1C,MAAM,YAAY,GAAG,sBAAsB,EAAE,CAAC;IAC9C,OAAO;QACL,QAAQ,EAAE,YAAY,CAAC,QAAQ;QAC/B,OAAO,EAAE,YAAY,CAAC,eAAe;KACtC,CAAC;AACJ,CAAC;AAED,0FAA0F;AAC1F,8FAA8F;AAC9F,gGAAgG;AAChG,sDAAsD;AACtD,MAAM,CAAC,KAAK,UAAU,2BAA2B,CAC/C,QAAgB,EAChB,UAAmC,EAAE;IAErC,MAAM,gBAAgB,GAAG,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;IAChD,MAAM,cAAc,GAAG,MAAM,qBAAqB,CAAC,gBAAgB,CAAC,CAAC;IACrE,IAAI,CAAC,cAAc,CAAC,KAAK,EAAE,CAAC;QAC1B,MAAM,IAAI,KAAK,CAAC,yCAAyC,cAAc,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAC/F,CAAC;IACD,MAAM,SAAS,GAAG,MAAM,gBAAgB,CAAC,gBAAgB,EAAE,OAAO,CAAC,CAAC;IACpE,MAAM,gBAAgB,GAAG,MAAM,iBAAiB,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;IACvE,IAAI,CAAC,gBAAgB,CAAC,KAAK,EAAE,CAAC;QAC5B,MAAM,IAAI,KAAK,CAAC,8BAA8B,gBAAgB,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACtF,CAAC;IACD,OAAO;QACL,GAAG,SAAS;QACZ,MAAM,EAAE,4BAA4B,EAAE;QACtC,gBAAgB;KACjB,CAAC;AACJ,CAAC"}
|
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
import { type ChildProcess } from 'node:child_process';
|
|
2
|
-
import { type ChildProcessTreeMonitor } from './codex-eval-process-tree.js';
|
|
3
|
-
import { type CodexEvalRuntimeConfig } from './codex-eval-runtime-config.js';
|
|
4
|
-
import { type CodexEvalRpcIsolationEvidence } from './codex-eval-isolation.js';
|
|
5
|
-
import { type PluginEvalCaseCheckpoint, type PluginEvalIsolation, type PluginEvalProcessManagementEvidence, type PluginEvalSuiteReport } from './plugin-eval-contract.js';
|
|
6
|
-
interface AppServerFrameHandler {
|
|
7
|
-
(frame: Record<string, unknown>): Promise<void> | void;
|
|
8
|
-
}
|
|
9
|
-
export declare function settleAppServerProcessCleanup(options: {
|
|
10
|
-
child: ChildProcess;
|
|
11
|
-
processTreeMonitor: ChildProcessTreeMonitor;
|
|
12
|
-
waitForClose: (timeoutMs: number) => Promise<boolean>;
|
|
13
|
-
}): Promise<void>;
|
|
14
|
-
export declare function inspectAppServerConfigWarning(frame: Record<string, unknown>): string | null;
|
|
15
|
-
export declare class EvalAppServerSession {
|
|
16
|
-
private readonly process;
|
|
17
|
-
private readonly processTreeId;
|
|
18
|
-
private readonly processTreeMonitor;
|
|
19
|
-
private readonly pending;
|
|
20
|
-
private readonly handlers;
|
|
21
|
-
private readonly failureHandlers;
|
|
22
|
-
private stdoutBuffer;
|
|
23
|
-
private stderrBuffer;
|
|
24
|
-
private nextId;
|
|
25
|
-
private terminalError?;
|
|
26
|
-
private closing;
|
|
27
|
-
private readonly closed;
|
|
28
|
-
private resolveClosed?;
|
|
29
|
-
private cleanupPromise?;
|
|
30
|
-
private unregisterSignalCleanup;
|
|
31
|
-
constructor(options: {
|
|
32
|
-
codexBin: string;
|
|
33
|
-
cwd: string;
|
|
34
|
-
env: NodeJS.ProcessEnv;
|
|
35
|
-
modelProvider: string;
|
|
36
|
-
sensitiveEnvironmentNames: string[];
|
|
37
|
-
isolation: PluginEvalIsolation;
|
|
38
|
-
processManagement?: PluginEvalProcessManagementEvidence;
|
|
39
|
-
configOverrides?: readonly string[];
|
|
40
|
-
});
|
|
41
|
-
onFrame(handler: AppServerFrameHandler): () => void;
|
|
42
|
-
onFailure(handler: (error: Error) => void): () => void;
|
|
43
|
-
initialize(): Promise<void>;
|
|
44
|
-
sendRequest(method: string, params: unknown, timeoutMs?: number): Promise<unknown>;
|
|
45
|
-
respond(id: string | number, result: unknown): Promise<void>;
|
|
46
|
-
cleanup(): Promise<void>;
|
|
47
|
-
private cleanupProcess;
|
|
48
|
-
get stderr(): string;
|
|
49
|
-
scrub<T>(value: T): T;
|
|
50
|
-
private waitForClose;
|
|
51
|
-
private write;
|
|
52
|
-
private handleChunk;
|
|
53
|
-
private handleLine;
|
|
54
|
-
private fail;
|
|
55
|
-
}
|
|
56
|
-
export declare function extractAppServerThreadId(result: unknown): string;
|
|
57
|
-
export declare function runCodexEvalIsolationProbe(options: {
|
|
58
|
-
subjectRoot: string;
|
|
59
|
-
skillName: string;
|
|
60
|
-
skillNames?: string[];
|
|
61
|
-
codexBin: string;
|
|
62
|
-
codexRuntime: CodexEvalRuntimeConfig;
|
|
63
|
-
sourceEnv?: NodeJS.ProcessEnv;
|
|
64
|
-
processManagement?: PluginEvalProcessManagementEvidence;
|
|
65
|
-
}): Promise<CodexEvalRpcIsolationEvidence>;
|
|
66
|
-
export declare function runCodexConversationSuite(options: {
|
|
67
|
-
suiteId: string;
|
|
68
|
-
skillName: string;
|
|
69
|
-
skillNames?: string[];
|
|
70
|
-
casesPath: string;
|
|
71
|
-
subjectRoot: string;
|
|
72
|
-
profile: string;
|
|
73
|
-
runs: number;
|
|
74
|
-
caseId?: string;
|
|
75
|
-
caseIds?: string[];
|
|
76
|
-
codexBin: string;
|
|
77
|
-
model?: string;
|
|
78
|
-
codexRuntime?: CodexEvalRuntimeConfig;
|
|
79
|
-
timeoutMs: number;
|
|
80
|
-
isolation?: PluginEvalIsolation;
|
|
81
|
-
sourceEnv?: NodeJS.ProcessEnv;
|
|
82
|
-
reportPath?: string;
|
|
83
|
-
processManagement?: PluginEvalProcessManagementEvidence;
|
|
84
|
-
forbiddenHostRoots?: string[];
|
|
85
|
-
workRoot?: string;
|
|
86
|
-
environmentPathPrepend?: string[];
|
|
87
|
-
environmentFixtureRoot?: string;
|
|
88
|
-
onCaseCompleted?: (checkpoint: PluginEvalCaseCheckpoint) => Promise<void>;
|
|
89
|
-
stopOnIncomplete?: boolean;
|
|
90
|
-
}): Promise<PluginEvalSuiteReport>;
|
|
91
|
-
export {};
|