@lesliechan721/aw 0.1.0-beta.14 → 0.1.0-beta.16
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/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/review-inspection.d.ts +169 -0
- package/dist/src/commands/review-inspection.js +916 -0
- package/dist/src/commands/review-inspection.js.map +1 -0
- package/dist/src/commands/skill-eval.d.ts +5 -0
- package/dist/src/commands/skill-eval.js +86 -63
- package/dist/src/commands/skill-eval.js.map +1 -1
- package/dist/src/commands/status-v6.d.ts +2 -1
- package/dist/src/commands/status-v6.js +7 -1
- package/dist/src/commands/status-v6.js.map +1 -1
- package/dist/src/eval/manifest-v1.js +0 -5
- package/dist/src/eval/manifest-v1.js.map +1 -1
- package/dist/src/index.js +39 -6
- package/dist/src/index.js.map +1 -1
- package/dist/src/portable/commands.d.ts +1 -0
- package/dist/src/portable/commands.js +43 -1
- package/dist/src/portable/commands.js.map +1 -1
- package/dist/src/portable/materializer.d.ts +12 -0
- package/dist/src/portable/materializer.js +67 -41
- package/dist/src/portable/materializer.js.map +1 -1
- package/dist/src/review/eval-source-input.d.ts +43 -0
- package/dist/src/review/eval-source-input.js +207 -0
- package/dist/src/review/eval-source-input.js.map +1 -0
- package/dist/src/review/source-binding.d.ts +170 -0
- package/dist/src/review/source-binding.js +622 -0
- package/dist/src/review/source-binding.js.map +1 -0
- package/dist/src/tui/console-app-v4.js +523 -133
- package/dist/src/tui/console-app-v4.js.map +1 -1
- package/dist/src/tui/controller-runtime.js +59 -37
- package/dist/src/tui/controller-runtime.js.map +1 -1
- package/dist/src/tui/controller.d.ts +15 -1
- package/dist/src/tui/controller.js +86 -3
- package/dist/src/tui/controller.js.map +1 -1
- package/dist/src/tui/model.js +2 -3
- package/dist/src/tui/model.js.map +1 -1
- package/dist/src/tui/operation-review-planner.js +22 -1
- package/dist/src/tui/operation-review-planner.js.map +1 -1
- package/dist/src/tui/plugin-write-task.d.ts +2 -1
- package/dist/src/tui/plugin-write-task.js +17 -0
- package/dist/src/tui/plugin-write-task.js.map +1 -1
- package/dist/src/tui/router.d.ts +1 -0
- package/dist/src/tui/router.js +13 -5
- package/dist/src/tui/router.js.map +1 -1
- package/dist/src/tui/screen-registry.d.ts +21 -1
- package/dist/src/tui/screen-registry.js +5 -1
- package/dist/src/tui/screen-registry.js.map +1 -1
- package/package.json +3 -3
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import crypto from 'node:crypto';
|
|
2
2
|
import path from 'node:path';
|
|
3
|
-
import { statusCommandV7, statusTargetIntent, } from '../commands/status-v6.js';
|
|
3
|
+
import { statusCommandV7, statusTargetActivation, statusTargetIntent, statusTargetOwnershipState, } from '../commands/status-v6.js';
|
|
4
4
|
import { addCatalogSourceCommand, listCatalogSources, preflightCatalogSourceMutation, removeCatalogSourceCommand, setPrimaryCatalogSourceCommand, updateCatalogSourceCommand, } from '../commands/catalog-source.js';
|
|
5
5
|
import { cleanupWriteCommand, failedWriteCommandResult, installWriteCommand, mergeWriteCommandResults, reinstallWriteCommand, syncWriteCommand, taskWriteCommand, uninstallWriteCommand, } from '../commands/write-commands.js';
|
|
6
6
|
import { resolveSyncIntentSelection } from '../commands/sync-command.js';
|
|
@@ -369,40 +369,6 @@ async function loadDependencyOverviews(options) {
|
|
|
369
369
|
const unsupportedPluginIds = new Set(options.status.pluginSummaries
|
|
370
370
|
.filter((summary) => (summary.missingCapabilities?.length ?? 0) > 0)
|
|
371
371
|
.map((summary) => summary.pluginId));
|
|
372
|
-
const placementReferences = new Map();
|
|
373
|
-
for (const consumer of options.status.payload.targets.filter((target) => target.state !== 'absent')) {
|
|
374
|
-
const consumerNode = nodes.get(consumer.pluginId);
|
|
375
|
-
if (!consumerNode)
|
|
376
|
-
continue;
|
|
377
|
-
for (const dependencyPluginId of consumerNode.dependencies) {
|
|
378
|
-
const dependencyTargets = (targetsByPlugin.get(dependencyPluginId) ?? [])
|
|
379
|
-
.filter((target) => target.platform === consumer.platform);
|
|
380
|
-
const projectTarget = dependencyTargets.find((target) => target.scope === 'project');
|
|
381
|
-
const userTarget = dependencyTargets.find((target) => target.scope === 'user');
|
|
382
|
-
const dependencyScope = consumer.scope === 'user'
|
|
383
|
-
? 'user'
|
|
384
|
-
: userTarget && (!projectTarget
|
|
385
|
-
|| (userTarget.state !== 'absent' && projectTarget.state === 'absent'))
|
|
386
|
-
? 'user'
|
|
387
|
-
: 'project';
|
|
388
|
-
const reference = {
|
|
389
|
-
consumer: {
|
|
390
|
-
pluginId: consumer.pluginId,
|
|
391
|
-
platform: consumer.platform,
|
|
392
|
-
scope: consumer.scope,
|
|
393
|
-
project: consumer.scope === 'project' ? 'current' : null,
|
|
394
|
-
},
|
|
395
|
-
dependency: {
|
|
396
|
-
pluginId: dependencyPluginId,
|
|
397
|
-
platform: consumer.platform,
|
|
398
|
-
scope: dependencyScope,
|
|
399
|
-
project: dependencyScope === 'project' ? 'current' : null,
|
|
400
|
-
},
|
|
401
|
-
};
|
|
402
|
-
const key = `${consumer.pluginId}\0${dependencyPluginId}`;
|
|
403
|
-
placementReferences.set(key, [...(placementReferences.get(key) ?? []), reference]);
|
|
404
|
-
}
|
|
405
|
-
}
|
|
406
372
|
const placementsFor = (pluginId) => {
|
|
407
373
|
const targets = targetsByPlugin.get(pluginId) ?? [];
|
|
408
374
|
if (targets.length > 0) {
|
|
@@ -474,7 +440,7 @@ async function loadDependencyOverviews(options) {
|
|
|
474
440
|
})),
|
|
475
441
|
placements,
|
|
476
442
|
aggregateStatus: aggregateFor(dependency.pluginId, placements),
|
|
477
|
-
placementReferences:
|
|
443
|
+
placementReferences: [],
|
|
478
444
|
};
|
|
479
445
|
});
|
|
480
446
|
const dependentIds = [...new Set(reverse.get(pluginId) ?? [])].sort();
|
|
@@ -488,7 +454,7 @@ async function loadDependencyOverviews(options) {
|
|
|
488
454
|
requiredBy: [],
|
|
489
455
|
placements,
|
|
490
456
|
aggregateStatus: aggregateFor(dependentId, placements),
|
|
491
|
-
placementReferences:
|
|
457
|
+
placementReferences: [],
|
|
492
458
|
};
|
|
493
459
|
});
|
|
494
460
|
const targetBlockers = (targetsByPlugin.get(pluginId) ?? []).flatMap((target) => target.reasons.filter((error) => error.code.startsWith('dependency') || error.code === 'sourceChanged')
|
|
@@ -683,6 +649,7 @@ export function createTuiControllerDependencies(context, progressFeed, options =
|
|
|
683
649
|
const result = await statusCommandV7({
|
|
684
650
|
cwd: context.cwd,
|
|
685
651
|
env: context.env,
|
|
652
|
+
nativeCliRunner: context.nativeCliRunner,
|
|
686
653
|
cliVersion: packageInfo.version,
|
|
687
654
|
verbose: context.diagnostics.verbose,
|
|
688
655
|
...(catalogOperationContext ? { catalogOperationContext } : {}),
|
|
@@ -775,6 +742,23 @@ export function createTuiControllerDependencies(context, progressFeed, options =
|
|
|
775
742
|
};
|
|
776
743
|
const captureEvidence = async (intent, signal, preparation, operationInventory = createOperationInventoryReader(), freshCatalog = false, reusableCandidate, codexObservationSession, frozenBatchEvidence) => {
|
|
777
744
|
reviewedScriptTimeoutMs(intent);
|
|
745
|
+
if ((intent.kind === 'pluginWrite'
|
|
746
|
+
&& (intent.platform === 'codex' || intent.platform === 'both')
|
|
747
|
+
|| intent.kind === 'pluginWriteTask'
|
|
748
|
+
&& intent.targets.some((target) => target.platform === 'codex'))
|
|
749
|
+
&& !codexObservationSession) {
|
|
750
|
+
const observationSession = await createCodexNativeObservationSession({
|
|
751
|
+
exactCwd: context.cwd,
|
|
752
|
+
env: context.env,
|
|
753
|
+
runner: context.nativeCliRunner,
|
|
754
|
+
});
|
|
755
|
+
try {
|
|
756
|
+
return await captureEvidence(intent, signal, preparation, operationInventory, freshCatalog, reusableCandidate, observationSession, frozenBatchEvidence);
|
|
757
|
+
}
|
|
758
|
+
finally {
|
|
759
|
+
await observationSession.dispose();
|
|
760
|
+
}
|
|
761
|
+
}
|
|
778
762
|
if (intent.kind === 'catalogManagement') {
|
|
779
763
|
signal?.throwIfAborted();
|
|
780
764
|
await preparation?.reporter.emit('validate');
|
|
@@ -1236,6 +1220,8 @@ export function createTuiControllerDependencies(context, progressFeed, options =
|
|
|
1236
1220
|
plugins: [...new Set(requestedTargets.map((target) => target.pluginId))],
|
|
1237
1221
|
cwd: context.cwd,
|
|
1238
1222
|
env: context.env,
|
|
1223
|
+
nativeCliRunner: context.nativeCliRunner,
|
|
1224
|
+
...(codexObservationSession ? { codexObservationSession } : {}),
|
|
1239
1225
|
cliVersion: packageInfo.version,
|
|
1240
1226
|
catalogOperationContext: catalogOperation,
|
|
1241
1227
|
inventoryCatalogSourceReferences: operationInventory,
|
|
@@ -1635,6 +1621,33 @@ export function createTuiControllerDependencies(context, progressFeed, options =
|
|
|
1635
1621
|
await preparation?.reporter.emit('evidence');
|
|
1636
1622
|
signal?.throwIfAborted();
|
|
1637
1623
|
const merged = mergeWriteCommandResults(groups.map((group) => group.preview));
|
|
1624
|
+
const targetVersions = groups.flatMap((group) => {
|
|
1625
|
+
if (group.platform === 'both')
|
|
1626
|
+
return [];
|
|
1627
|
+
const platform = group.platform;
|
|
1628
|
+
return group.requestedPluginIds.map((pluginId) => {
|
|
1629
|
+
const live = sessionStatusResult?.payload.targets.find((target) => target.pluginId === pluginId && target.platform === platform
|
|
1630
|
+
&& (target.scope === group.scope || statusTargetIntent(target).scopes.includes(group.scope)
|
|
1631
|
+
|| platform === 'codex' && statusTargetActivation(target)?.[group.scope] === true));
|
|
1632
|
+
const revision = sessionStatusResult?.targetRevisions?.find((target) => target.pluginId === pluginId && target.platform === platform
|
|
1633
|
+
&& target.scope === group.scope)?.revision;
|
|
1634
|
+
const activation = live ? statusTargetActivation(live) : undefined;
|
|
1635
|
+
const ownership = live && live.scope === group.scope
|
|
1636
|
+
? statusTargetOwnershipState(live) : 'absent';
|
|
1637
|
+
const present = ownership === 'present' || ownership === 'partial'
|
|
1638
|
+
|| platform === 'codex' && activation?.[group.scope] === true;
|
|
1639
|
+
const planned = live ? statusTargetIntent(live).scopes.includes(group.scope) : false;
|
|
1640
|
+
return {
|
|
1641
|
+
pluginId,
|
|
1642
|
+
platform,
|
|
1643
|
+
scope: group.scope,
|
|
1644
|
+
presence: present ? 'installed'
|
|
1645
|
+
: ownership === 'absent' && planned ? 'new' : 'unknown',
|
|
1646
|
+
...(revision?.installedVersion ? { installedVersion: revision.installedVersion } : {}),
|
|
1647
|
+
...(revision?.availableVersion ? { availableVersion: revision.availableVersion } : {}),
|
|
1648
|
+
};
|
|
1649
|
+
});
|
|
1650
|
+
});
|
|
1638
1651
|
const evidence = {
|
|
1639
1652
|
catalog: {
|
|
1640
1653
|
configDigest: configSnapshot.digest,
|
|
@@ -1643,6 +1656,13 @@ export function createTuiControllerDependencies(context, progressFeed, options =
|
|
|
1643
1656
|
},
|
|
1644
1657
|
requestedPluginIds: selection.requestedPluginIds,
|
|
1645
1658
|
groups,
|
|
1659
|
+
targetVersions: [...new Map(targetVersions.map((target) => [[
|
|
1660
|
+
target.pluginId, target.platform, target.scope,
|
|
1661
|
+
].join('\0'), target])).values()].sort((left, right) => [
|
|
1662
|
+
left.pluginId, left.platform, left.scope,
|
|
1663
|
+
].join('\0').localeCompare([
|
|
1664
|
+
right.pluginId, right.platform, right.scope,
|
|
1665
|
+
].join('\0'), 'en')),
|
|
1646
1666
|
...(merged.dependencyPlan ? { dependencyPlan: merged.dependencyPlan } : {}),
|
|
1647
1667
|
...(merged.codexReconcilePlans ? { codexReconcilePlans: merged.codexReconcilePlans } : {}),
|
|
1648
1668
|
...(merged.operationPlan ? { operationPlan: merged.operationPlan } : {}),
|
|
@@ -1843,6 +1863,8 @@ export function createTuiControllerDependencies(context, progressFeed, options =
|
|
|
1843
1863
|
: {}),
|
|
1844
1864
|
cwd: context.cwd,
|
|
1845
1865
|
env: context.env,
|
|
1866
|
+
nativeCliRunner: context.nativeCliRunner,
|
|
1867
|
+
...(codexObservationSession ? { codexObservationSession } : {}),
|
|
1846
1868
|
cliVersion: packageInfo.version,
|
|
1847
1869
|
...(statusCatalogOperation ? { catalogOperationContext: statusCatalogOperation } : {}),
|
|
1848
1870
|
inventoryCatalogSourceReferences: operationInventory,
|