@lesliechan721/aw 0.1.0-beta.83 → 0.1.0-beta.85
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 +1 -1
- package/dist/authoring/assets/aw-runtime-config.mjs.map +1 -1
- package/dist/index.js +2 -6
- package/dist/index.js.map +1 -1
- package/dist/src/commands/console.js +1 -0
- package/dist/src/commands/console.js.map +1 -1
- package/dist/src/commands/intent-command.d.ts +1 -0
- package/dist/src/commands/intent-command.js +6 -2
- package/dist/src/commands/intent-command.js.map +1 -1
- package/dist/src/commands/plugin-capabilities.js +3 -3
- package/dist/src/commands/plugin-capabilities.js.map +1 -1
- package/dist/src/commands/public-lifecycle-result.d.ts +14 -13
- package/dist/src/commands/public-lifecycle-result.js +204 -64
- package/dist/src/commands/public-lifecycle-result.js.map +1 -1
- package/dist/src/commands/public-lifecycle.d.ts +1 -2
- package/dist/src/commands/public-lifecycle.js +56 -34
- package/dist/src/commands/public-lifecycle.js.map +1 -1
- package/dist/src/commands/public-plugin-query.js +44 -11
- package/dist/src/commands/public-plugin-query.js.map +1 -1
- package/dist/src/commands/rebuild-command.d.ts +13 -3
- package/dist/src/commands/rebuild-command.js +665 -288
- package/dist/src/commands/rebuild-command.js.map +1 -1
- package/dist/src/commands/rebuild-integration.d.ts +6 -2
- package/dist/src/commands/rebuild-integration.js +60 -29
- package/dist/src/commands/rebuild-integration.js.map +1 -1
- package/dist/src/commands/rebuild-operations.d.ts +1 -0
- package/dist/src/commands/rebuild-operations.js +28 -6
- package/dist/src/commands/rebuild-operations.js.map +1 -1
- package/dist/src/commands/rebuild-platform-integration.d.ts +20 -5
- package/dist/src/commands/rebuild-platform-integration.js +752 -182
- package/dist/src/commands/rebuild-platform-integration.js.map +1 -1
- package/dist/src/generators/permissions.d.ts +7 -1
- package/dist/src/generators/permissions.js +56 -0
- package/dist/src/generators/permissions.js.map +1 -1
- package/dist/src/index.d.ts +1 -0
- package/dist/src/index.js +112 -54
- package/dist/src/index.js.map +1 -1
- package/dist/src/intent/scope-context.d.ts +4 -2
- package/dist/src/intent/scope-context.js +37 -7
- package/dist/src/intent/scope-context.js.map +1 -1
- package/dist/src/output/component-delivery.d.ts +21 -0
- package/dist/src/output/component-delivery.js +82 -0
- package/dist/src/output/component-delivery.js.map +1 -0
- package/dist/src/output/public-result.d.ts +4 -0
- package/dist/src/output/public-result.js +85 -15
- package/dist/src/output/public-result.js.map +1 -1
- package/dist/src/output/rebuild-progress.d.ts +3 -0
- package/dist/src/output/rebuild-progress.js +12 -2
- package/dist/src/output/rebuild-progress.js.map +1 -1
- package/dist/src/output/receipt-projection.js +64 -19
- package/dist/src/output/receipt-projection.js.map +1 -1
- package/dist/src/output/skill-invocation-notices.d.ts +18 -0
- package/dist/src/output/skill-invocation-notices.js +84 -0
- package/dist/src/output/skill-invocation-notices.js.map +1 -0
- package/dist/src/platforms/capabilities.d.ts +6 -1
- package/dist/src/platforms/capabilities.js +161 -38
- package/dist/src/platforms/capabilities.js.map +1 -1
- package/dist/src/platforms/contracts.d.ts +45 -10
- package/dist/src/platforms/discovery.d.ts +11 -7
- package/dist/src/platforms/discovery.js +176 -76
- package/dist/src/platforms/discovery.js.map +1 -1
- package/dist/src/platforms/inspection-grok.js +121 -9
- package/dist/src/platforms/inspection-grok.js.map +1 -1
- package/dist/src/platforms/inspection-native.js +53 -97
- package/dist/src/platforms/inspection-native.js.map +1 -1
- package/dist/src/platforms/inspection-pi.d.ts +7 -1
- package/dist/src/platforms/inspection-pi.js +295 -95
- package/dist/src/platforms/inspection-pi.js.map +1 -1
- package/dist/src/platforms/inspection-query.d.ts +6 -5
- package/dist/src/platforms/inspection-query.js +30 -25
- package/dist/src/platforms/inspection-query.js.map +1 -1
- package/dist/src/platforms/inspection.d.ts +4 -1
- package/dist/src/platforms/inspection.js +38 -6
- package/dist/src/platforms/inspection.js.map +1 -1
- package/dist/src/platforms/layout.d.ts +6 -0
- package/dist/src/platforms/layout.js +45 -12
- package/dist/src/platforms/layout.js.map +1 -1
- package/dist/src/platforms/lifecycle-native-services.d.ts +1 -1
- package/dist/src/platforms/lifecycle-native-services.js +14 -14
- package/dist/src/platforms/lifecycle-native-services.js.map +1 -1
- package/dist/src/platforms/lifecycle-native.d.ts +1 -0
- package/dist/src/platforms/lifecycle-native.js +29 -89
- package/dist/src/platforms/lifecycle-native.js.map +1 -1
- package/dist/src/platforms/lifecycle.d.ts +2 -0
- package/dist/src/platforms/lifecycle.js +120 -69
- package/dist/src/platforms/lifecycle.js.map +1 -1
- package/dist/src/platforms/projection-code-extension.js +9 -4
- package/dist/src/platforms/projection-code-extension.js.map +1 -1
- package/dist/src/platforms/projection.d.ts +3 -0
- package/dist/src/platforms/projection.js +152 -72
- package/dist/src/platforms/projection.js.map +1 -1
- package/dist/src/platforms/supplement-layout.d.ts +5 -1
- package/dist/src/platforms/supplement-layout.js +23 -1
- package/dist/src/platforms/supplement-layout.js.map +1 -1
- package/dist/src/platforms/supplement-state.d.ts +1 -1
- package/dist/src/platforms/supplement-state.js +18 -7
- package/dist/src/platforms/supplement-state.js.map +1 -1
- package/dist/src/portable/commands.js +1 -1
- package/dist/src/portable/commands.js.map +1 -1
- package/dist/src/portable/materializer.d.ts +4 -0
- package/dist/src/portable/materializer.js +9 -2
- package/dist/src/portable/materializer.js.map +1 -1
- package/dist/src/portable/recovery.d.ts +31 -3
- package/dist/src/portable/recovery.js +261 -82
- package/dist/src/portable/recovery.js.map +1 -1
- package/dist/src/recovery/coordinator.d.ts +19 -5
- package/dist/src/recovery/coordinator.js +433 -174
- package/dist/src/recovery/coordinator.js.map +1 -1
- package/dist/src/recovery/install-concurrency.d.ts +48 -0
- package/dist/src/recovery/install-concurrency.js +196 -0
- package/dist/src/recovery/install-concurrency.js.map +1 -0
- package/dist/src/recovery/interruption.d.ts +19 -0
- package/dist/src/recovery/interruption.js +43 -0
- package/dist/src/recovery/interruption.js.map +1 -0
- package/dist/src/recovery/joint-coordinator.d.ts +18 -4
- package/dist/src/recovery/joint-coordinator.js +829 -341
- package/dist/src/recovery/joint-coordinator.js.map +1 -1
- package/dist/src/recovery/joint-demand.d.ts +22 -2
- package/dist/src/recovery/joint-demand.js +104 -6
- package/dist/src/recovery/joint-demand.js.map +1 -1
- package/dist/src/recovery/joint-install-execution.d.ts +19 -0
- package/dist/src/recovery/joint-install-execution.js +307 -0
- package/dist/src/recovery/joint-install-execution.js.map +1 -0
- package/dist/src/recovery/joint-install-native-rebase.d.ts +4 -0
- package/dist/src/recovery/joint-install-native-rebase.js +67 -0
- package/dist/src/recovery/joint-install-native-rebase.js.map +1 -0
- package/dist/src/recovery/receipt.d.ts +35 -4
- package/dist/src/recovery/receipt.js +90 -1
- package/dist/src/recovery/receipt.js.map +1 -1
- package/dist/src/recovery/retirement.js +1 -1
- package/dist/src/recovery/retirement.js.map +1 -1
- package/dist/src/recovery/status.d.ts +20 -8
- package/dist/src/recovery/status.js +405 -116
- package/dist/src/recovery/status.js.map +1 -1
- package/dist/src/review/platform-profile.d.ts +4 -1
- package/dist/src/review/platform-profile.js +14 -4
- package/dist/src/review/platform-profile.js.map +1 -1
- package/dist/src/review/skill-materialization.d.ts +2 -0
- package/dist/src/review/skill-materialization.js +68 -50
- package/dist/src/review/skill-materialization.js.map +1 -1
- package/dist/src/review/source-binding.js +11 -5
- package/dist/src/review/source-binding.js.map +1 -1
- package/dist/src/tui/console-app-v4.d.ts +1 -1
- package/dist/src/tui/console-app-v4.js +180 -63
- package/dist/src/tui/console-app-v4.js.map +1 -1
- package/dist/src/tui/controller-runtime.js +46 -10
- package/dist/src/tui/controller-runtime.js.map +1 -1
- package/dist/src/tui/controller.d.ts +15 -5
- package/dist/src/tui/controller.js +246 -102
- package/dist/src/tui/controller.js.map +1 -1
- package/dist/src/tui/deployment-view.d.ts +6 -3
- package/dist/src/tui/deployment-view.js +43 -9
- package/dist/src/tui/deployment-view.js.map +1 -1
- package/dist/src/tui/diagnostic-projection.d.ts +11 -3
- package/dist/src/tui/diagnostic-projection.js +85 -4
- package/dist/src/tui/diagnostic-projection.js.map +1 -1
- package/dist/src/tui/entity-cards.d.ts +2 -1
- package/dist/src/tui/entity-cards.js +34 -11
- package/dist/src/tui/entity-cards.js.map +1 -1
- package/dist/src/tui/glossary.js +5 -0
- package/dist/src/tui/glossary.js.map +1 -1
- package/dist/src/tui/model.js +2 -1
- package/dist/src/tui/model.js.map +1 -1
- package/dist/src/tui/operation-diagnostic-screens.d.ts +1 -1
- package/dist/src/tui/operation-diagnostic-screens.js +6 -2
- package/dist/src/tui/operation-diagnostic-screens.js.map +1 -1
- package/dist/src/tui/operation-history.d.ts +12 -3
- package/dist/src/tui/operation-history.js +34 -3
- package/dist/src/tui/operation-history.js.map +1 -1
- package/dist/src/tui/plugin-detail.d.ts +4 -1
- package/dist/src/tui/plugin-detail.js +9 -2
- package/dist/src/tui/plugin-detail.js.map +1 -1
- package/dist/src/tui/scoped-flow.d.ts +3 -1
- package/dist/src/tui/scoped-flow.js +117 -1
- package/dist/src/tui/scoped-flow.js.map +1 -1
- package/dist/src/tui/scoped-inventory.d.ts +6 -2
- package/dist/src/tui/scoped-inventory.js +29 -7
- package/dist/src/tui/scoped-inventory.js.map +1 -1
- package/dist/src/tui/session-console-app.d.ts +2 -0
- package/dist/src/tui/session-console-app.js +11 -0
- package/dist/src/tui/session-console-app.js.map +1 -1
- package/dist/src/types.d.ts +10 -2
- package/dist/src/types.js.map +1 -1
- package/dist/src/utils/artifact-plan.js +5 -1
- package/dist/src/utils/artifact-plan.js.map +1 -1
- package/dist/src/utils/artifact-renderer.d.ts +1 -1
- package/dist/src/utils/artifact-renderer.js +29 -8
- package/dist/src/utils/artifact-renderer.js.map +1 -1
- package/dist/src/utils/aw-home-mutation-lock.js +2 -1
- package/dist/src/utils/aw-home-mutation-lock.js.map +1 -1
- package/dist/src/utils/catalog-source-references.js +14 -17
- package/dist/src/utils/catalog-source-references.js.map +1 -1
- package/dist/src/utils/codex-native-observation.d.ts +6 -0
- package/dist/src/utils/codex-native-observation.js +32 -3
- package/dist/src/utils/codex-native-observation.js.map +1 -1
- package/dist/src/utils/component-command-preparation.d.ts +2 -0
- package/dist/src/utils/component-command-preparation.js +23 -4
- package/dist/src/utils/component-command-preparation.js.map +1 -1
- package/dist/src/utils/component-gap.d.ts +4 -0
- package/dist/src/utils/component-gap.js +20 -0
- package/dist/src/utils/component-gap.js.map +1 -0
- package/dist/src/utils/component-resources.js +2 -4
- package/dist/src/utils/component-resources.js.map +1 -1
- package/dist/src/utils/dynamic-skill-tree.js +2 -32
- package/dist/src/utils/dynamic-skill-tree.js.map +1 -1
- package/dist/src/utils/managed-command-materialization.d.ts +2 -1
- package/dist/src/utils/managed-command-materialization.js +3 -3
- package/dist/src/utils/managed-command-materialization.js.map +1 -1
- package/dist/src/utils/managed-command-store.d.ts +6 -0
- package/dist/src/utils/managed-command-store.js +90 -18
- package/dist/src/utils/managed-command-store.js.map +1 -1
- package/dist/src/utils/multi-source-catalog.d.ts +2 -0
- package/dist/src/utils/multi-source-catalog.js +3 -2
- package/dist/src/utils/multi-source-catalog.js.map +1 -1
- package/dist/src/utils/native-cli-interruption.d.ts +8 -0
- package/dist/src/utils/native-cli-interruption.js +65 -0
- package/dist/src/utils/native-cli-interruption.js.map +1 -0
- package/dist/src/utils/native-cli.d.ts +5 -19
- package/dist/src/utils/native-cli.js +168 -95
- package/dist/src/utils/native-cli.js.map +1 -1
- package/dist/src/utils/ownership.d.ts +1 -0
- package/dist/src/utils/ownership.js +18 -4
- package/dist/src/utils/ownership.js.map +1 -1
- package/dist/src/utils/package-content.d.ts +7 -0
- package/dist/src/utils/package-content.js +70 -0
- package/dist/src/utils/package-content.js.map +1 -0
- package/dist/src/utils/platform-empty-state.d.ts +32 -9
- package/dist/src/utils/platform-empty-state.js +135 -70
- package/dist/src/utils/platform-empty-state.js.map +1 -1
- package/dist/src/utils/plugin-config-write.d.ts +8 -0
- package/dist/src/utils/plugin-config-write.js +93 -25
- package/dist/src/utils/plugin-config-write.js.map +1 -1
- package/dist/src/utils/plugin-scripts.js +24 -8
- package/dist/src/utils/plugin-scripts.js.map +1 -1
- package/dist/src/utils/process-tree.d.ts +1 -1
- package/dist/src/utils/process-tree.js +1 -1
- package/dist/src/utils/process-tree.js.map +1 -1
- package/dist/src/utils/skill-invocation-warning.d.ts +20 -0
- package/dist/src/utils/skill-invocation-warning.js +68 -0
- package/dist/src/utils/skill-invocation-warning.js.map +1 -0
- package/package.json +3 -3
- package/dist/src/output/native-consent.d.ts +0 -2
- package/dist/src/output/native-consent.js +0 -5
- package/dist/src/output/native-consent.js.map +0 -1
- package/dist/src/platforms/gemini-activation.d.ts +0 -36
- package/dist/src/platforms/gemini-activation.js +0 -331
- package/dist/src/platforms/gemini-activation.js.map +0 -1
- package/dist/src/platforms/gemini-consent.d.ts +0 -8
- package/dist/src/platforms/gemini-consent.js +0 -81
- package/dist/src/platforms/gemini-consent.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"permissions.js","sourceRoot":"","sources":["../../../src/generators/permissions.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAEzD,OAAO,EACL,kBAAkB,EAClB,iCAAiC,EACjC,sBAAsB,
|
|
1
|
+
{"version":3,"file":"permissions.js","sourceRoot":"","sources":["../../../src/generators/permissions.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,6BAA6B,EAAE,kBAAkB,EAAyB,MAAM,iCAAiC,CAAC;AAElJ,OAAO,EAAE,kBAAkB,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAEzD,OAAO,EACL,kBAAkB,EAClB,iCAAiC,EACjC,sBAAsB,GAIvB,MAAM,wCAAwC,CAAC;AAEhD,OAAO,EAAE,sBAAsB,EAAE,MAAM,wCAAwC,CAAC;AAEhF,8EAA8E;AAC9E,MAAM,UAAU,8BAA8B,CAAC,MAAgC,EAAE,OAA8B,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EAAE,CAAC,qBAAqB,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE;YACzG,GAAG,MAAM,CAAC,CAAC,UAAU,CAAC,GAAG,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,qBAAqB,CAAC,KAAK,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE;YACxG,GAAG,MAAM,CAAC,CAAC,UAAU,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,qBAAqB,CAAC,KAAK,EAAE,WAAW,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE;YAC5G,EAAE;SACH,CAAC;QAEF,OAAO;YACL,YAAY,EAAE,SAAS,aAAa,QAAQ;YAC5C,WAAW,EAAE,aAAa;YAC1B,OAAO,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC;SAC1B,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC"}
|
package/dist/src/index.d.ts
CHANGED
|
@@ -7,3 +7,4 @@ export type CliRuntimeOptions = CliExecutionContextInput;
|
|
|
7
7
|
export declare function buildProgram(options?: CliRuntimeOptions): Command;
|
|
8
8
|
export declare function runCli(argv: string[], options?: CliRuntimeOptions): Promise<number>;
|
|
9
9
|
export declare function main(argv?: string[], options?: CliRuntimeOptions): Promise<number>;
|
|
10
|
+
export declare function runExecutableCli(): void;
|
package/dist/src/index.js
CHANGED
|
@@ -4,13 +4,14 @@ import { preparePublicConfigConfirmation } from './commands/public-config-confir
|
|
|
4
4
|
import { createPublicCommandInterruption } from './commands/public-interruption.js';
|
|
5
5
|
import { CLI_OUTPUT_SCHEMA_VERSION, commandResult, publicExitCode, renderPublicResult, safePublicMessage } from './output/public-result.js';
|
|
6
6
|
import { projectReceipt } from './output/receipt-projection.js';
|
|
7
|
-
import {
|
|
7
|
+
import { SKILL_INVOCATION_NOTICE } from './utils/skill-invocation-warning.js';
|
|
8
8
|
import { runPublicLifecycle } from './commands/public-lifecycle.js';
|
|
9
9
|
import { runPublicPluginList, runPublicPluginShow, runPublicPluginStatus } from './commands/public-plugin-query.js';
|
|
10
10
|
import fs from 'node:fs';
|
|
11
11
|
import path from 'node:path';
|
|
12
12
|
import { defaultPluginProcessRunner } from './utils/plugin-scripts.js';
|
|
13
13
|
import { fileURLToPath } from 'node:url';
|
|
14
|
+
import { withNativeCliInterruption } from './utils/native-cli-interruption.js';
|
|
14
15
|
import { Command, CommanderError, InvalidArgumentError, Option } from 'commander';
|
|
15
16
|
import { doctorEvalProviders } from '@lesliechan721/agent-skill-eval';
|
|
16
17
|
import { compilePluginConfigDefinition, selectPluginConfigProfile, PLATFORM_TARGETS } from '@lesliechan721/aw-plugin-core/manifest';
|
|
@@ -25,14 +26,15 @@ import { createNoopReporter, formatWarnings } from './output/reporter.js';
|
|
|
25
26
|
import { redactString, redactValue } from './output/redact.js';
|
|
26
27
|
import { resolveCliPackageRoot } from './utils/paths.js';
|
|
27
28
|
import { coercePluginConfigUpdates, assertPluginConfigMutationCandidate, findConfigFieldEntry, formatPluginConfigSetRecoveryCommand, listNamespacedPluginConfigStores, readPluginConfigStore, renderPluginConfigValueForDisplay, resolveConfigRead, } from './utils/plugin-config.js';
|
|
28
|
-
import { applyPluginConfigWrite, applyPluginConfig, buildConfigMutationReceipt, configWriteStateForError, resetPluginConfigWithHelper, } from './utils/plugin-config-write.js';
|
|
29
|
+
import { applyPluginConfigWrite, ConfigApplyInterruptedError, applyPluginConfig, buildConfigMutationReceipt, configWriteStateForError, resetPluginConfigWithHelper, } from './utils/plugin-config-write.js';
|
|
29
30
|
import { assertStrictSemVer } from './utils/manifest.js';
|
|
30
31
|
import { assertCatalogSourceReferencesSupported, inventoryLegacyConfigReferences, } from './utils/catalog-source-references.js';
|
|
31
|
-
import { parsePluginId, withResolvedCatalogPlugin, withResolvedMultiSourceCatalog, } from './utils/multi-source-catalog.js';
|
|
32
|
+
import { CatalogLeaseEscapeError, parsePluginId, withResolvedCatalogPlugin, withResolvedMultiSourceCatalog, } from './utils/multi-source-catalog.js';
|
|
32
33
|
import { sanitizeCatalogSourceError, sanitizeCatalogSourceErrorMessage, } from './utils/catalog-public-error.js';
|
|
33
34
|
import { catalogGenerationErrorCode } from './utils/catalog-generation-error.js';
|
|
34
35
|
import { resolveCatalogOperationContext, } from './utils/catalog-operation-context.js';
|
|
35
36
|
import { withAwHomeMutationLock, } from './utils/aw-home-mutation-lock.js';
|
|
37
|
+
import { recoveryInterruptionCode } from './recovery/interruption.js';
|
|
36
38
|
import { materializePortableSkillsToDirectory, PortableCommandError } from './portable/commands.js';
|
|
37
39
|
import { createReviewInspectionFailure, getReviewInspectionExitCode, inspectReviewTarget, } from './commands/review-inspection.js';
|
|
38
40
|
import { prepareReviewTarget, } from './commands/review-preparation.js';
|
|
@@ -116,6 +118,9 @@ function normalizeWriteRequest(normalize) {
|
|
|
116
118
|
}
|
|
117
119
|
}
|
|
118
120
|
function configMutationFailure(error, env, cwd) {
|
|
121
|
+
if (error instanceof ConfigApplyInterruptedError)
|
|
122
|
+
return { code: error.code, message: error.operationDiagnostic.safeMessage,
|
|
123
|
+
configWrite: error.configWrite, apply: error.apply };
|
|
119
124
|
const configWrite = error?.configWrite === 'succeeded' ? 'succeeded' : configWriteStateForError(error);
|
|
120
125
|
if (error instanceof CommanderError) {
|
|
121
126
|
return {
|
|
@@ -167,10 +172,11 @@ function writeConfigMutationFailureReceipt(write, request, failure) {
|
|
|
167
172
|
}
|
|
168
173
|
writeJsonReceipt(write, buildConfigMutationReceipt(request.command, {
|
|
169
174
|
ok: false,
|
|
170
|
-
overallState: 'failed',
|
|
175
|
+
overallState: failure.apply ? 'partial' : 'failed',
|
|
171
176
|
configWrite: failure.configWrite,
|
|
177
|
+
...(failure.apply ? { apply: failure.apply } : {}),
|
|
172
178
|
...(plugin ? { plugin } : {}),
|
|
173
|
-
errors: [failure],
|
|
179
|
+
errors: [{ code: failure.code, message: failure.message }],
|
|
174
180
|
}));
|
|
175
181
|
}
|
|
176
182
|
async function runAuthoringScript(options) {
|
|
@@ -492,8 +498,6 @@ function writeJsonReceipt(write, payload) {
|
|
|
492
498
|
writeLine(write, JSON.stringify(payload, null, 2));
|
|
493
499
|
}
|
|
494
500
|
function writeConfigApplyNotice(write, receipt) {
|
|
495
|
-
if (receipt.nativeConsent)
|
|
496
|
-
writeLine(write, geminiNativeConsentDiagnostic().message);
|
|
497
501
|
const sanitizeMessage = (message) => redactString(message)
|
|
498
502
|
.replace(/https?:\/\/\S+/giu, '[REDACTED URL]')
|
|
499
503
|
.replace(/file:\/\/\S+/giu, '[REDACTED PATH]')
|
|
@@ -507,15 +511,17 @@ function writeConfigApplyNotice(write, receipt) {
|
|
|
507
511
|
? `失败原因:${entry.errorCode}。`
|
|
508
512
|
: '未提供安全失败原因。';
|
|
509
513
|
const command = `aw plugin sync ${receipt.plugin} --rebuild --target ${entry.target.platform} --context ${entry.target.scope}`;
|
|
510
|
-
const recovery = entry.
|
|
511
|
-
?
|
|
512
|
-
: entry.errorCode === '
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
? `
|
|
518
|
-
: ''
|
|
514
|
+
const recovery = entry.partialDelivery
|
|
515
|
+
? ' 部分输出已验证。请检查尚未完成的输出后再重新准备应用。'
|
|
516
|
+
: entry.errorCode === 'invalidConfig'
|
|
517
|
+
? ` 请修复无效配置后运行 ${command}。`
|
|
518
|
+
: entry.errorCode === 'preApplyAuthorizationRequired'
|
|
519
|
+
|| entry.errorCode === 'sharedNativeConfigApplyConfirmationRequired'
|
|
520
|
+
|| entry.errorCode === 'sharedNativeImpactAuthorizationRequired'
|
|
521
|
+
? ` 请运行 ${command} --yes 重试。`
|
|
522
|
+
: entry.state === 'failed'
|
|
523
|
+
? ` 请在解决失败原因后运行 ${command}。`
|
|
524
|
+
: '';
|
|
519
525
|
writeLine(write, `${entry.target.platform}/${entry.target.scope}:${reason}${recovery}`);
|
|
520
526
|
}
|
|
521
527
|
};
|
|
@@ -553,9 +559,11 @@ function writeConfigApplyNotice(write, receipt) {
|
|
|
553
559
|
}
|
|
554
560
|
else {
|
|
555
561
|
const completed = targetResults.filter((entry) => entry.state === 'completed').length;
|
|
556
|
-
const
|
|
562
|
+
const partiallyDelivered = targetResults.filter((entry) => entry.partialDelivery).length;
|
|
563
|
+
const failed = targetResults.filter((entry) => entry.state === 'failed' && !entry.partialDelivery).length;
|
|
557
564
|
const skipped = targetResults.filter((entry) => entry.state === 'skipped').length;
|
|
558
|
-
|
|
565
|
+
const partialSummary = partiallyDelivered > 0 ? `部分完成 ${partiallyDelivered} 个;` : '';
|
|
566
|
+
writeLine(write, `配置已保存。已刷新 ${completed} 个当前可见目标;${partialSummary}失败 ${failed} 个;跳过 ${skipped} 个。`);
|
|
559
567
|
writeTargetFailures();
|
|
560
568
|
}
|
|
561
569
|
writeWarnings(write, receipt.warnings);
|
|
@@ -1459,20 +1467,24 @@ export function buildProgram(options = {}) {
|
|
|
1459
1467
|
writeLine(io.stderr, message);
|
|
1460
1468
|
commandExitState.exitCode = failure.code === 'invalidArguments' ? 2 : 1;
|
|
1461
1469
|
};
|
|
1462
|
-
const withResolvedConfigMutationPlugin = (context, selector, consume,
|
|
1470
|
+
const withResolvedConfigMutationPlugin = (context, selector, consume, options) => (async () => {
|
|
1463
1471
|
const parsed = parsePluginId(selector);
|
|
1464
1472
|
return withAwHomeMutationLock({
|
|
1465
1473
|
env: context.env,
|
|
1474
|
+
signal: context.signal,
|
|
1466
1475
|
action: async (awHomeMutationToken) => {
|
|
1467
1476
|
const catalogOperationContext = await resolveCatalogOperationContext({
|
|
1468
1477
|
...(parsed.sourceId ? { sourceIds: [parsed.sourceId] } : {}),
|
|
1469
1478
|
env: context.env,
|
|
1479
|
+
signal: context.signal,
|
|
1470
1480
|
});
|
|
1471
1481
|
return withResolvedCatalogPlugin({
|
|
1472
1482
|
selector,
|
|
1473
1483
|
cliVersion: resolveCliVersion(),
|
|
1474
1484
|
operationContext: catalogOperationContext,
|
|
1475
1485
|
env: context.env,
|
|
1486
|
+
signal: context.signal,
|
|
1487
|
+
retainCompletedResultOnAbort: options?.retainCompletedResultOnAbort,
|
|
1476
1488
|
consume: (resolution) => consume(resolution, awHomeMutationToken, catalogOperationContext),
|
|
1477
1489
|
});
|
|
1478
1490
|
},
|
|
@@ -1898,12 +1910,9 @@ export function buildProgram(options = {}) {
|
|
|
1898
1910
|
.option('--log-file <path>', 'write debug diagnostics to the specified file');
|
|
1899
1911
|
const configMutation = (command) => configCommand(command)
|
|
1900
1912
|
.option('--apply', 'refresh existing affected outputs after saving', false)
|
|
1901
|
-
.option('--native-consent', 'authorize this Gemini operation; may persist source-folder and current-workspace trust', false)
|
|
1902
1913
|
.option('--script-timeout <ms>', 'override plugin preApply timeout in milliseconds')
|
|
1903
1914
|
.option('-y, --yes', 'confirm reviewed output changes', false);
|
|
1904
1915
|
const configContext = async (context, rawOptions, apply = rawOptions.apply === true) => {
|
|
1905
|
-
if (rawOptions.nativeConsent && !apply)
|
|
1906
|
-
throw new WriteCommandRequestError('--native-consent requires --apply or config apply.');
|
|
1907
1916
|
const requested = rawOptions.context === undefined ? apply ? undefined : 'user'
|
|
1908
1917
|
: normalizeWriteRequest(() => parseContextValue(rawOptions.context));
|
|
1909
1918
|
const work = await resolveWorkContext({ cwd: context.cwd, context: requested });
|
|
@@ -2073,20 +2082,20 @@ export function buildProgram(options = {}) {
|
|
|
2073
2082
|
const confirmation = rawOptions.apply ? await preparePublicConfigConfirmation({ plugin, scope: work.context,
|
|
2074
2083
|
context: work.context, platform, cwd: context.cwd, env: context.env, cliVersion: resolveCliVersion(),
|
|
2075
2084
|
nativeCliRunner: context.nativeCliRunner, awHomeMutationToken, yes: rawOptions.yes, mutation,
|
|
2076
|
-
rebuildRuntime: { ...context,
|
|
2085
|
+
rebuildRuntime: { ...context, awHomeMutationToken, catalogOperationContext,
|
|
2077
2086
|
expectedGenerationSetDigest: catalogOperationContext.generationSetDigest } })
|
|
2078
2087
|
: { required: false, provided: rawOptions.yes === true, effects: [] };
|
|
2079
2088
|
const writeReceipt = await applyPluginConfigWrite({ plugin, pluginName: plugin.manifest.name,
|
|
2080
2089
|
scope: work.context, context: work.context, platform, cliVersion: resolveCliVersion(),
|
|
2081
2090
|
cwd: context.cwd, env: context.env, nativeCliRunner: context.nativeCliRunner,
|
|
2082
|
-
rebuildRuntime: { ...context,
|
|
2091
|
+
rebuildRuntime: { ...context, awHomeMutationToken, catalogOperationContext,
|
|
2083
2092
|
expectedGenerationSetDigest: catalogOperationContext.generationSetDigest,
|
|
2084
2093
|
...(scriptTimeoutMs === undefined ? {} : { scriptTimeoutMs }) },
|
|
2085
2094
|
awHomeMutationToken, request: command === 'unset' ? { removeKeys: [key] } : { updates: { [key]: inputValue } },
|
|
2086
2095
|
apply: rawOptions.apply === true, sharedNativeApplyConfirmed: rawOptions.yes === true,
|
|
2087
2096
|
preApplyConfirmed: rawOptions.yes === true });
|
|
2088
2097
|
return buildConfigMutationReceipt(`config:${command}`, {
|
|
2089
|
-
...writeReceipt, confirmation,
|
|
2098
|
+
...writeReceipt, confirmation, ok: writeReceipt.overallState === 'succeeded', plugin: plugin.manifest.name,
|
|
2090
2099
|
pluginName: plugin.manifest.name, pluginId, sourceId: source.sourceId, sourceIdentity: source.sourceIdentity,
|
|
2091
2100
|
context: work, platform: platform ?? 'common',
|
|
2092
2101
|
...(command === 'unset' ? { removedKey: key, existed: true } : {}),
|
|
@@ -2094,7 +2103,7 @@ export function buildProgram(options = {}) {
|
|
|
2094
2103
|
action: command === 'unset' ? 'unset' : 'set', scope: 'user',
|
|
2095
2104
|
...(writeReceipt.staleRemovedKeys?.includes(key) ? { stale: true } : {}) }],
|
|
2096
2105
|
});
|
|
2097
|
-
}
|
|
2106
|
+
}));
|
|
2098
2107
|
if (!receipt)
|
|
2099
2108
|
return;
|
|
2100
2109
|
if (rawOptions.json)
|
|
@@ -2132,7 +2141,7 @@ export function buildProgram(options = {}) {
|
|
|
2132
2141
|
const receipt = await resetPluginConfigWithHelper({ ...located, plugin, pluginError, platform, scope: work.context,
|
|
2133
2142
|
context: work.context, cliVersion: resolveCliVersion(), cwd: context.cwd, env: context.env, awHomeMutationToken,
|
|
2134
2143
|
nativeCliRunner: context.nativeCliRunner, apply: rawOptions.apply === true,
|
|
2135
|
-
rebuildRuntime: { ...context,
|
|
2144
|
+
rebuildRuntime: { ...context, awHomeMutationToken, scriptTimeoutMs: resolveScriptTimeoutMs(rawOptions) },
|
|
2136
2145
|
sharedNativeApplyConfirmed: true, preApplyConfirmed: rawOptions.yes === true });
|
|
2137
2146
|
return { ...receipt, confirmation };
|
|
2138
2147
|
} });
|
|
@@ -2148,7 +2157,7 @@ export function buildProgram(options = {}) {
|
|
|
2148
2157
|
return resetStore(null, error instanceof Error ? error : new Error(String(error)));
|
|
2149
2158
|
}
|
|
2150
2159
|
});
|
|
2151
|
-
const receipt = buildConfigMutationReceipt('config:reset', { ...resetReceipt,
|
|
2160
|
+
const receipt = buildConfigMutationReceipt('config:reset', { ...resetReceipt,
|
|
2152
2161
|
ok: resetReceipt.overallState === 'succeeded', ...located, plugin: located.pluginName,
|
|
2153
2162
|
context: work, platform: platform ?? 'common' });
|
|
2154
2163
|
if (rawOptions.json)
|
|
@@ -2165,30 +2174,59 @@ export function buildProgram(options = {}) {
|
|
|
2165
2174
|
});
|
|
2166
2175
|
contextualCommand(config.command('apply').argument('<plugin>'))
|
|
2167
2176
|
.option('--target <target>', 'limit existing-output refresh to this platform target', collectUniqueOption)
|
|
2168
|
-
.option('--native-consent', 'authorize this Gemini operation; may persist source-folder and current-workspace trust', false)
|
|
2169
2177
|
.option('-y, --yes', 'confirm reviewed output changes', false)
|
|
2170
2178
|
.option('--script-timeout <ms>', 'override plugin preApply timeout in milliseconds')
|
|
2171
2179
|
.action(async (selector, rawOptions) => {
|
|
2172
2180
|
const context = createActionContext('config:apply', rawOptions);
|
|
2173
2181
|
const work = await configContext(context, rawOptions, true);
|
|
2174
2182
|
const targets = rawOptions.target?.map((target) => normalizeWriteRequest(() => parsePlatformTargetValue(target)));
|
|
2183
|
+
let resolved;
|
|
2184
|
+
let confirmed;
|
|
2175
2185
|
const receipt = await runActionWithContext(context, () => withResolvedConfigMutationPlugin(context, selector, async ({ plugin, pluginId, source }, awHomeMutationToken) => {
|
|
2186
|
+
const identity = { plugin: plugin.manifest.name, pluginId, sourceId: source.sourceId };
|
|
2187
|
+
resolved = identity;
|
|
2176
2188
|
const confirmation = await preparePublicConfigConfirmation({ plugin, scope: work.context, context: work.context, targets, cwd: context.cwd, env: context.env, cliVersion: resolveCliVersion(), nativeCliRunner: context.nativeCliRunner, awHomeMutationToken, yes: rawOptions.yes, rebuildRuntime: context });
|
|
2177
|
-
|
|
2178
|
-
|
|
2179
|
-
|
|
2180
|
-
|
|
2181
|
-
|
|
2182
|
-
|
|
2183
|
-
|
|
2184
|
-
|
|
2185
|
-
|
|
2189
|
+
confirmed = confirmation;
|
|
2190
|
+
const applied = await applyPluginConfig({ plugin, scope: work.context, context: work.context, targets,
|
|
2191
|
+
cliVersion: resolveCliVersion(), cwd: context.cwd, env: context.env, awHomeMutationToken,
|
|
2192
|
+
nativeCliRunner: context.nativeCliRunner, sharedNativeApplyConfirmed: rawOptions.yes === true,
|
|
2193
|
+
preApplyConfirmed: rawOptions.yes === true, rebuildRuntime: { ...context, scriptTimeoutMs: resolveScriptTimeoutMs(rawOptions) },
|
|
2194
|
+
}).catch((error) => {
|
|
2195
|
+
if (!(error instanceof ConfigApplyInterruptedError))
|
|
2196
|
+
throw error;
|
|
2197
|
+
const { code, message } = configMutationFailure(error, context.env, context.cwd);
|
|
2198
|
+
return { configWrite: error.configWrite, overallState: 'partial',
|
|
2199
|
+
apply: error.apply, errors: [{ code, message }] };
|
|
2200
|
+
});
|
|
2201
|
+
return { ...applied, ...identity, confirmation, context: work };
|
|
2202
|
+
}, { retainCompletedResultOnAbort: true })).catch((error) => {
|
|
2203
|
+
if (error instanceof CatalogLeaseEscapeError)
|
|
2204
|
+
throw error;
|
|
2205
|
+
const code = recoveryInterruptionCode(error, context.signal);
|
|
2206
|
+
if (!code)
|
|
2207
|
+
throw error;
|
|
2208
|
+
if (!resolved)
|
|
2209
|
+
parsePluginId(selector);
|
|
2210
|
+
const message = code === 'processCleanupUnconfirmed' ? 'Process cleanup could not be confirmed.'
|
|
2211
|
+
: 'The command was interrupted before configuration apply completed.';
|
|
2212
|
+
return { ...(resolved ?? { plugin: selector }), confirmation: confirmed ?? null,
|
|
2213
|
+
context: work, configWrite: 'notStarted',
|
|
2214
|
+
overallState: 'failed', errors: [{ code, message }] };
|
|
2215
|
+
});
|
|
2216
|
+
const result = buildConfigMutationReceipt('config:apply', { ...receipt,
|
|
2186
2217
|
ok: receipt.overallState === 'succeeded' });
|
|
2187
2218
|
if (rawOptions.json)
|
|
2188
2219
|
writeJsonReceipt(io.stdout, result);
|
|
2189
2220
|
else {
|
|
2190
|
-
|
|
2191
|
-
|
|
2221
|
+
const outcome = result.ok ? '完成' : result.overallState === 'partial' ? '部分失败' : '失败';
|
|
2222
|
+
writeLine(io.stdout, `配置应用:${outcome}。`);
|
|
2223
|
+
if ('apply' in result && result.apply) {
|
|
2224
|
+
writeConfigApplyNotice(io.stderr, { ...result, apply: result.apply, warnings: [] });
|
|
2225
|
+
}
|
|
2226
|
+
else if ('errors' in result) {
|
|
2227
|
+
for (const error of result.errors ?? [])
|
|
2228
|
+
writeLine(io.stderr, error.message);
|
|
2229
|
+
}
|
|
2192
2230
|
}
|
|
2193
2231
|
commandExitState.exitCode = result.ok ? 0 : 1;
|
|
2194
2232
|
});
|
|
@@ -2333,8 +2371,7 @@ function configurePublicCommands(program, options, io, exit) {
|
|
|
2333
2371
|
.option('--keep-dependencies', 'Keep orphan dependency output during normal removal')
|
|
2334
2372
|
.option('--force', 'Bypass the dependency guard; with --only outputs, recover provably owned damaged output');
|
|
2335
2373
|
if (name !== 'remove')
|
|
2336
|
-
cmd.option('--script-timeout <ms>', 'Plugin script timeout')
|
|
2337
|
-
.option('--native-consent', 'Authorize this Gemini operation; may persist source-folder and current-workspace trust');
|
|
2374
|
+
cmd.option('--script-timeout <ms>', 'Plugin script timeout');
|
|
2338
2375
|
if (name === 'sync')
|
|
2339
2376
|
cmd.option('--rebuild', 'Rebuild selected owned output').option('--refresh', 'Refresh required Catalog sources');
|
|
2340
2377
|
cmd.action(async (plugins, raw) => {
|
|
@@ -2526,12 +2563,13 @@ export async function runCli(argv, options = {}) {
|
|
|
2526
2563
|
const resolvedCommand = resolveRegisteredCommand(program, awArgs);
|
|
2527
2564
|
const selected = resolvedCommand.command;
|
|
2528
2565
|
const id = selected && selected !== program ? commandId(selected) : null;
|
|
2529
|
-
const controlledInterrupt = ['plugin.install', 'plugin.remove', 'plugin.sync',
|
|
2566
|
+
const controlledInterrupt = ['plugin.install', 'plugin.remove', 'plugin.sync', 'plugin.config.apply',
|
|
2530
2567
|
'dev.plugin.create', 'dev.plugin.validate', 'dev.plugin.remove', 'dev.plugin.status',
|
|
2531
2568
|
'dev.skill.create', 'dev.skill.validate'].includes(id ?? '');
|
|
2532
2569
|
if (controlledInterrupt) {
|
|
2533
2570
|
commandOptions.interruption = interruption;
|
|
2534
|
-
commandOptions.signal =
|
|
2571
|
+
commandOptions.signal = id === 'plugin.config.apply' && options.signal
|
|
2572
|
+
? AbortSignal.any([options.signal, interruption.signal]) : interruption.signal;
|
|
2535
2573
|
}
|
|
2536
2574
|
if (id === 'command.run' && !presentation.help)
|
|
2537
2575
|
return runManagedCommandCli(['run', ...argv.slice(resolvedCommand.index + 1)], { ...context, interactive: false }, { cliEntry: fileURLToPath(import.meta.url), cliVersion: resolveCliVersion() });
|
|
@@ -2545,13 +2583,23 @@ export async function runCli(argv, options = {}) {
|
|
|
2545
2583
|
argv: ['aw', 'dev', 'catalog', 'create', ...(typeof workspaceRoot === 'string' ? ['--workspace-root', workspaceRoot] : [])],
|
|
2546
2584
|
reason: 'Create a Catalog Workspace explicitly before running authoring commands.', requiresConfirmation: false });
|
|
2547
2585
|
}
|
|
2586
|
+
interruption.cleanupFailed ||= result.diagnostics.some((entry) => entry.code === 'processCleanupUnconfirmed');
|
|
2587
|
+
if (interruption.exitCode || interruption.cleanupFailed) {
|
|
2588
|
+
const code = interruption.cleanupFailed ? 'processCleanupUnconfirmed' : 'operationInterrupted';
|
|
2589
|
+
if (!result.diagnostics.some((entry) => entry.code === code && !entry.subject)) {
|
|
2590
|
+
result.diagnostics.push({ code, severity: 'error', message: interruption.cleanupFailed
|
|
2591
|
+
? 'Process cleanup could not be confirmed.'
|
|
2592
|
+
: 'The command was interrupted. Completed changes are retained in the result.' });
|
|
2593
|
+
}
|
|
2594
|
+
}
|
|
2548
2595
|
io.stdout(json ? `${JSON.stringify(result)}\n` : renderPublicResult(result, awArgs.includes('--verbose') || awArgs.includes('-v')));
|
|
2549
2596
|
for (const diagnostic of result.diagnostics)
|
|
2550
|
-
|
|
2597
|
+
if (json || diagnostic.code !== SKILL_INVOCATION_NOTICE)
|
|
2598
|
+
io.stderr(`${diagnostic.code}: ${diagnostic.message}\n`);
|
|
2551
2599
|
if (options.diagnostics?.verbose || awArgs.includes('--verbose'))
|
|
2552
2600
|
for (const line of stderr)
|
|
2553
2601
|
io.stderr(`${safePublicMessage(line.trim())}\n`);
|
|
2554
|
-
return interruption.
|
|
2602
|
+
return interruption.cleanupFailed ? 1 : interruption.exitCode ?? publicExitCode(result, invalid);
|
|
2555
2603
|
};
|
|
2556
2604
|
if (presentation.version)
|
|
2557
2605
|
return emit(commandResult('version', { version: resolveCliVersion(), resultSchemaVersion: CLI_OUTPUT_SCHEMA_VERSION }));
|
|
@@ -2584,16 +2632,26 @@ export async function runCli(argv, options = {}) {
|
|
|
2584
2632
|
return emit(commandResult('tui', {}, { status: 'failed', diagnostics: [{ code: 'invalidOptionCombination', severity: 'error', message: 'tui cannot use --json.' }] }), true);
|
|
2585
2633
|
if (!context.interactive)
|
|
2586
2634
|
return emit(commandResult('tui', {}, { status: 'blocked', diagnostics: [{ code: 'interactiveTerminalRequired', severity: 'error', message: 'The TUI requires an interactive terminal.' }] }));
|
|
2587
|
-
const tuiContext = createCliExecutionContext({ ...options, io,
|
|
2635
|
+
const tuiContext = createCliExecutionContext({ ...options, io, interruption,
|
|
2636
|
+
signal: options.signal ? AbortSignal.any([options.signal, interruption.signal]) : interruption.signal, diagnostics: toCliDiagnosticsOptions('console', bareOptions ?? {}, options.diagnostics) });
|
|
2637
|
+
const stopListening = interruption.listen();
|
|
2588
2638
|
try {
|
|
2589
2639
|
return await runActionWithContext(tuiContext, async () => {
|
|
2590
2640
|
const { runConsoleController } = await import('./commands/console.js');
|
|
2591
|
-
|
|
2641
|
+
const code = await runConsoleController(tuiContext);
|
|
2642
|
+
if (interruption.cleanupFailed) {
|
|
2643
|
+
io.stderr('processCleanupUnconfirmed: Process cleanup could not be confirmed.\n');
|
|
2644
|
+
return 1;
|
|
2645
|
+
}
|
|
2646
|
+
return interruption.exitCode ?? code;
|
|
2592
2647
|
});
|
|
2593
2648
|
}
|
|
2594
2649
|
catch (error) {
|
|
2595
2650
|
return emit(commandResult('tui', {}, { status: 'failed', diagnostics: [{ code: 'tuiFailed', severity: 'error', message: safePublicMessage(error instanceof Error ? error.message : String(error)) }] }));
|
|
2596
2651
|
}
|
|
2652
|
+
finally {
|
|
2653
|
+
stopListening();
|
|
2654
|
+
}
|
|
2597
2655
|
}
|
|
2598
2656
|
// Only these adapters carry cancellation through every long-running child.
|
|
2599
2657
|
// Other routes retain Node's normal signal termination until their domain
|
|
@@ -2659,8 +2717,6 @@ export async function runCli(argv, options = {}) {
|
|
|
2659
2717
|
io.stderr(redactString(logs.stderr));
|
|
2660
2718
|
}
|
|
2661
2719
|
const result = projectReceipt(id, receipt, { yes: awArgs.includes('--yes') || awArgs.includes('-y'), exitCode, confirmation });
|
|
2662
|
-
if (interruption.exitCode)
|
|
2663
|
-
result.diagnostics.push({ code: interruption.cleanupFailed ? 'processCleanupUnconfirmed' : 'operationInterrupted', severity: 'error', message: interruption.cleanupFailed ? 'Process cleanup could not be confirmed after interruption.' : 'The command was interrupted. Completed changes are retained in the result.' });
|
|
2664
2720
|
if (result.status === 'success' && ['dev.plugin.create', 'dev.skill.create'].includes(id)) {
|
|
2665
2721
|
const data = result.data;
|
|
2666
2722
|
const name = typeof data.pluginName === 'string' ? data.pluginName : selected?.args[0];
|
|
@@ -2709,13 +2765,15 @@ export async function runCli(argv, options = {}) {
|
|
|
2709
2765
|
export async function main(argv = process.argv.slice(2), options = {}) {
|
|
2710
2766
|
return runCli(argv, options);
|
|
2711
2767
|
}
|
|
2712
|
-
|
|
2713
|
-
|
|
2714
|
-
if (invokedPath === currentEntryPath) {
|
|
2715
|
-
void main().then((exitCode) => {
|
|
2768
|
+
export function runExecutableCli() {
|
|
2769
|
+
void withNativeCliInterruption(() => main()).then((exitCode) => {
|
|
2716
2770
|
if (exitCode !== 0) {
|
|
2717
2771
|
process.exitCode = exitCode;
|
|
2718
2772
|
}
|
|
2719
2773
|
});
|
|
2720
2774
|
}
|
|
2775
|
+
const currentEntryPath = fileURLToPath(import.meta.url);
|
|
2776
|
+
const invokedPath = process.argv[1] ? path.resolve(process.argv[1]) : null;
|
|
2777
|
+
if (invokedPath === currentEntryPath)
|
|
2778
|
+
runExecutableCli();
|
|
2721
2779
|
//# sourceMappingURL=index.js.map
|