@detergent-software/atk 9.5.0 → 9.6.0-dev.10
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/CHANGELOG.md +82 -0
- package/README.md +10 -7
- package/build/command-manifest.json +151 -26
- package/build/commands/browse.d.ts +1 -0
- package/build/commands/browse.d.ts.map +1 -1
- package/build/commands/browse.js +12 -7
- package/build/commands/browse.js.map +1 -1
- package/build/commands/deprecate.d.ts +6 -5
- package/build/commands/deprecate.d.ts.map +1 -1
- package/build/commands/deprecate.js +31 -43
- package/build/commands/deprecate.js.map +1 -1
- package/build/commands/freeze.d.ts +1 -0
- package/build/commands/freeze.d.ts.map +1 -1
- package/build/commands/info.d.ts +1 -0
- package/build/commands/info.d.ts.map +1 -1
- package/build/commands/info.js +20 -39
- package/build/commands/info.js.map +1 -1
- package/build/commands/init.js +1 -1
- package/build/commands/init.js.map +1 -1
- package/build/commands/install.d.ts.map +1 -1
- package/build/commands/install.js +65 -12
- package/build/commands/install.js.map +1 -1
- package/build/commands/list.d.ts +1 -0
- package/build/commands/list.d.ts.map +1 -1
- package/build/commands/list.js +7 -7
- package/build/commands/list.js.map +1 -1
- package/build/commands/move.d.ts +6 -4
- package/build/commands/move.d.ts.map +1 -1
- package/build/commands/move.js +219 -89
- package/build/commands/move.js.map +1 -1
- package/build/commands/outdated.d.ts +1 -0
- package/build/commands/outdated.d.ts.map +1 -1
- package/build/commands/outdated.js +6 -4
- package/build/commands/outdated.js.map +1 -1
- package/build/commands/pin.d.ts +1 -0
- package/build/commands/pin.d.ts.map +1 -1
- package/build/commands/promote.d.ts +4 -3
- package/build/commands/promote.d.ts.map +1 -1
- package/build/commands/promote.js +19 -16
- package/build/commands/promote.js.map +1 -1
- package/build/commands/register.d.ts +1 -0
- package/build/commands/register.d.ts.map +1 -1
- package/build/commands/schema.d.ts +1 -0
- package/build/commands/schema.d.ts.map +1 -1
- package/build/commands/schema.js +3 -2
- package/build/commands/schema.js.map +1 -1
- package/build/commands/search.d.ts +1 -0
- package/build/commands/search.d.ts.map +1 -1
- package/build/commands/search.js +9 -5
- package/build/commands/search.js.map +1 -1
- package/build/commands/star.d.ts +23 -0
- package/build/commands/star.d.ts.map +1 -0
- package/build/commands/star.js +36 -0
- package/build/commands/star.js.map +1 -0
- package/build/commands/stars.d.ts +11 -0
- package/build/commands/stars.d.ts.map +1 -0
- package/build/commands/stars.js +57 -0
- package/build/commands/stars.js.map +1 -0
- package/build/commands/sync.d.ts +1 -0
- package/build/commands/sync.d.ts.map +1 -1
- package/build/commands/thaw.d.ts +1 -0
- package/build/commands/thaw.d.ts.map +1 -1
- package/build/commands/uninstall.d.ts +1 -0
- package/build/commands/uninstall.d.ts.map +1 -1
- package/build/commands/unpin.d.ts +1 -0
- package/build/commands/unpin.d.ts.map +1 -1
- package/build/commands/unpublish.d.ts +4 -3
- package/build/commands/unpublish.d.ts.map +1 -1
- package/build/commands/unpublish.js +20 -37
- package/build/commands/unpublish.js.map +1 -1
- package/build/commands/unstar.d.ts +23 -0
- package/build/commands/unstar.d.ts.map +1 -0
- package/build/commands/unstar.js +36 -0
- package/build/commands/unstar.js.map +1 -0
- package/build/commands/update.d.ts +2 -0
- package/build/commands/update.d.ts.map +1 -1
- package/build/commands/update.js +82 -4
- package/build/commands/update.js.map +1 -1
- package/build/commands/why.d.ts +1 -0
- package/build/commands/why.d.ts.map +1 -1
- package/build/components/AssetTable.d.ts +3 -1
- package/build/components/AssetTable.d.ts.map +1 -1
- package/build/components/AssetTable.js +11 -4
- package/build/components/AssetTable.js.map +1 -1
- package/build/components/BrowseExpandedRow.d.ts.map +1 -1
- package/build/components/BrowseExpandedRow.js +1 -1
- package/build/components/BrowseExpandedRow.js.map +1 -1
- package/build/components/BrowseList.d.ts +1 -1
- package/build/components/BrowseList.d.ts.map +1 -1
- package/build/components/BrowseList.js +10 -7
- package/build/components/BrowseList.js.map +1 -1
- package/build/components/DeprecationSummary.d.ts.map +1 -1
- package/build/components/DeprecationSummary.js +22 -5
- package/build/components/DeprecationSummary.js.map +1 -1
- package/build/components/InstallSummary.d.ts +4 -2
- package/build/components/InstallSummary.d.ts.map +1 -1
- package/build/components/InstallSummary.js +13 -4
- package/build/components/InstallSummary.js.map +1 -1
- package/build/components/ListBrowseList.d.ts +7 -6
- package/build/components/ListBrowseList.d.ts.map +1 -1
- package/build/components/ListBrowseList.js +15 -11
- package/build/components/ListBrowseList.js.map +1 -1
- package/build/components/PluginReviewQuestion.d.ts +22 -0
- package/build/components/PluginReviewQuestion.d.ts.map +1 -0
- package/build/components/PluginReviewQuestion.js +30 -0
- package/build/components/PluginReviewQuestion.js.map +1 -0
- package/build/components/RegistryChangeSummary.d.ts +6 -0
- package/build/components/RegistryChangeSummary.d.ts.map +1 -1
- package/build/components/RegistryChangeSummary.js +19 -1
- package/build/components/RegistryChangeSummary.js.map +1 -1
- package/build/components/StarCommand.d.ts +17 -0
- package/build/components/StarCommand.d.ts.map +1 -0
- package/build/components/StarCommand.js +53 -0
- package/build/components/StarCommand.js.map +1 -0
- package/build/components/StarResult.d.ts +7 -0
- package/build/components/StarResult.d.ts.map +1 -0
- package/build/components/StarResult.js +24 -0
- package/build/components/StarResult.js.map +1 -0
- package/build/components/UsageFields.d.ts +1 -1
- package/build/components/UsageFields.d.ts.map +1 -1
- package/build/components/UsageFields.js +2 -2
- package/build/components/UsageFields.js.map +1 -1
- package/build/hooks/useBrowseState.d.ts +4 -2
- package/build/hooks/useBrowseState.d.ts.map +1 -1
- package/build/hooks/useBrowseState.js +18 -11
- package/build/hooks/useBrowseState.js.map +1 -1
- package/build/hooks/useInitState.js +2 -2
- package/build/hooks/useInitState.js.map +1 -1
- package/build/hooks/useListState.d.ts.map +1 -1
- package/build/hooks/useListState.js +1 -0
- package/build/hooks/useListState.js.map +1 -1
- package/build/lib/adapter.d.ts.map +1 -1
- package/build/lib/adapter.js +1 -0
- package/build/lib/adapter.js.map +1 -1
- package/build/lib/atk-api/client.d.ts +65 -13
- package/build/lib/atk-api/client.d.ts.map +1 -1
- package/build/lib/atk-api/client.js +82 -32
- package/build/lib/atk-api/client.js.map +1 -1
- package/build/lib/atk-api/domain.d.ts +23 -2
- package/build/lib/atk-api/domain.d.ts.map +1 -1
- package/build/lib/atk-api/domain.js.map +1 -1
- package/build/lib/atk-api/errors.d.ts +9 -1
- package/build/lib/atk-api/errors.d.ts.map +1 -1
- package/build/lib/atk-api/errors.js +8 -1
- package/build/lib/atk-api/errors.js.map +1 -1
- package/build/lib/atk-api/generated/index.d.ts +2 -2
- package/build/lib/atk-api/generated/index.d.ts.map +1 -1
- package/build/lib/atk-api/generated/index.js +1 -1
- package/build/lib/atk-api/generated/index.js.map +1 -1
- package/build/lib/atk-api/generated/sdk.gen.d.ts +20 -8
- package/build/lib/atk-api/generated/sdk.gen.d.ts.map +1 -1
- package/build/lib/atk-api/generated/sdk.gen.js +31 -7
- package/build/lib/atk-api/generated/sdk.gen.js.map +1 -1
- package/build/lib/atk-api/generated/types.gen.d.ts +391 -39
- package/build/lib/atk-api/generated/types.gen.d.ts.map +1 -1
- package/build/lib/atk-api/index.d.ts +4 -4
- package/build/lib/atk-api/index.d.ts.map +1 -1
- package/build/lib/atk-api/index.js +1 -1
- package/build/lib/atk-api/index.js.map +1 -1
- package/build/lib/atk-api/testing.d.ts +6 -1
- package/build/lib/atk-api/testing.d.ts.map +1 -1
- package/build/lib/atk-api/testing.js +31 -1
- package/build/lib/atk-api/testing.js.map +1 -1
- package/build/lib/atk-api/web-routes.d.ts +17 -4
- package/build/lib/atk-api/web-routes.d.ts.map +1 -1
- package/build/lib/atk-api/web-routes.js +15 -1
- package/build/lib/atk-api/web-routes.js.map +1 -1
- package/build/lib/atk-schemas/bundle.d.ts +2 -0
- package/build/lib/atk-schemas/bundle.d.ts.map +1 -1
- package/build/lib/atk-schemas/index.d.ts +3 -0
- package/build/lib/atk-schemas/index.d.ts.map +1 -1
- package/build/lib/atk-schemas/index.js +3 -0
- package/build/lib/atk-schemas/index.js.map +1 -1
- package/build/lib/atk-schemas/manifest.d.ts +13 -0
- package/build/lib/atk-schemas/manifest.d.ts.map +1 -1
- package/build/lib/atk-schemas/manifest.js +8 -1
- package/build/lib/atk-schemas/manifest.js.map +1 -1
- package/build/lib/atk-schemas/registry.d.ts +30 -0
- package/build/lib/atk-schemas/registry.d.ts.map +1 -1
- package/build/lib/atk-schemas/registry.js +10 -0
- package/build/lib/atk-schemas/registry.js.map +1 -1
- package/build/lib/atk-schemas/unknown-types.d.ts +27 -0
- package/build/lib/atk-schemas/unknown-types.d.ts.map +1 -0
- package/build/lib/atk-schemas/unknown-types.js +116 -0
- package/build/lib/atk-schemas/unknown-types.js.map +1 -0
- package/build/lib/checksum.d.ts +4 -3
- package/build/lib/checksum.d.ts.map +1 -1
- package/build/lib/checksum.js +5 -4
- package/build/lib/checksum.js.map +1 -1
- package/build/lib/claude-code-version.d.ts +37 -0
- package/build/lib/claude-code-version.d.ts.map +1 -0
- package/build/lib/claude-code-version.js +75 -0
- package/build/lib/claude-code-version.js.map +1 -0
- package/build/lib/cross-scope.d.ts +2 -0
- package/build/lib/cross-scope.d.ts.map +1 -1
- package/build/lib/cross-scope.js +4 -3
- package/build/lib/cross-scope.js.map +1 -1
- package/build/lib/diagnostics.d.ts.map +1 -1
- package/build/lib/diagnostics.js +19 -9
- package/build/lib/diagnostics.js.map +1 -1
- package/build/lib/init.d.ts +4 -2
- package/build/lib/init.d.ts.map +1 -1
- package/build/lib/init.js +15 -1
- package/build/lib/init.js.map +1 -1
- package/build/lib/mover.d.ts +50 -0
- package/build/lib/mover.d.ts.map +1 -1
- package/build/lib/mover.js +207 -54
- package/build/lib/mover.js.map +1 -1
- package/build/lib/multi-tool-install.d.ts +5 -2
- package/build/lib/multi-tool-install.d.ts.map +1 -1
- package/build/lib/multi-tool-install.js +8 -5
- package/build/lib/multi-tool-install.js.map +1 -1
- package/build/lib/owned-paths.d.ts +5 -0
- package/build/lib/owned-paths.d.ts.map +1 -1
- package/build/lib/owned-paths.js +8 -0
- package/build/lib/owned-paths.js.map +1 -1
- package/build/lib/plugin-review.d.ts +77 -0
- package/build/lib/plugin-review.d.ts.map +1 -0
- package/build/lib/plugin-review.js +124 -0
- package/build/lib/plugin-review.js.map +1 -0
- package/build/lib/publisher.d.ts.map +1 -1
- package/build/lib/publisher.js +23 -16
- package/build/lib/publisher.js.map +1 -1
- package/build/lib/registry-change-json.d.ts +95 -4
- package/build/lib/registry-change-json.d.ts.map +1 -1
- package/build/lib/registry-change-json.js +76 -7
- package/build/lib/registry-change-json.js.map +1 -1
- package/build/lib/registry-mutate.d.ts +41 -1
- package/build/lib/registry-mutate.d.ts.map +1 -1
- package/build/lib/registry-mutate.js +178 -6
- package/build/lib/registry-mutate.js.map +1 -1
- package/build/lib/registry.d.ts.map +1 -1
- package/build/lib/registry.js +10 -3
- package/build/lib/registry.js.map +1 -1
- package/build/lib/schemas/adapter.d.ts +3 -0
- package/build/lib/schemas/adapter.d.ts.map +1 -1
- package/build/lib/schemas/config.d.ts +2 -0
- package/build/lib/schemas/config.d.ts.map +1 -1
- package/build/lib/schemas/index.d.ts +1 -1
- package/build/lib/schemas/index.d.ts.map +1 -1
- package/build/lib/schemas/index.js +1 -1
- package/build/lib/schemas/index.js.map +1 -1
- package/build/lib/schemas/lockfile.d.ts +8 -0
- package/build/lib/schemas/lockfile.d.ts.map +1 -1
- package/build/lib/search.d.ts +4 -4
- package/build/lib/search.d.ts.map +1 -1
- package/build/lib/search.js +7 -7
- package/build/lib/search.js.map +1 -1
- package/build/lib/stars.d.ts +46 -0
- package/build/lib/stars.d.ts.map +1 -0
- package/build/lib/stars.js +100 -0
- package/build/lib/stars.js.map +1 -0
- package/build/lib/subject.d.ts +52 -0
- package/build/lib/subject.d.ts.map +1 -0
- package/build/lib/subject.js +51 -0
- package/build/lib/subject.js.map +1 -0
- package/build/lib/usage.d.ts +11 -2
- package/build/lib/usage.d.ts.map +1 -1
- package/build/lib/usage.js +24 -8
- package/build/lib/usage.js.map +1 -1
- package/package.json +1 -1
- package/tool-adapters/claude-code.json +10 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"uninstall.d.ts","sourceRoot":"","sources":["../../src/commands/uninstall.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAiBxB,eAAO,MAAM,WAAW,iCAAiC,CAAC;AAE1D,eAAO,MAAM,OAAO
|
|
1
|
+
{"version":3,"file":"uninstall.d.ts","sourceRoot":"","sources":["../../src/commands/uninstall.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAiBxB,eAAO,MAAM,WAAW,iCAAiC,CAAC;AAE1D,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;;;;;iBAwFlB,CAAC;AAEH,eAAO,MAAM,IAAI,wCAed,CAAC;AAkBJ,KAAK,KAAK,GAAG;IACX,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,IAAI,CAAC,CAAC;IAC3B,OAAO,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,OAAO,CAAC,CAAC;CAClC,CAAC;AAUF,MAAM,CAAC,OAAO,UAAU,SAAS,CAAC,EAChC,IAAI,EAAE,CAAC,IAAI,EAAE,GAAG,IAAI,CAAC,EACrB,OAAO,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE,WAAW,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,GACrF,EAAE,KAAK,sCAujBP"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"unpin.d.ts","sourceRoot":"","sources":["../../src/commands/unpin.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAoBxB,eAAO,MAAM,WAAW,iDAAiD,CAAC;AAE1E,eAAO,MAAM,OAAO
|
|
1
|
+
{"version":3,"file":"unpin.d.ts","sourceRoot":"","sources":["../../src/commands/unpin.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAoBxB,eAAO,MAAM,WAAW,iDAAiD,CAAC;AAE1E,eAAO,MAAM,OAAO;;;;;;;;;;;;;iBAiClB,CAAC;AAEH,eAAO,MAAM,IAAI,wCAQd,CAAC;AAKJ,KAAK,KAAK,GAAG;IACX,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,IAAI,CAAC,CAAC;IAC3B,OAAO,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,OAAO,CAAC,CAAC;CAClC,CAAC;AAQF,MAAM,CAAC,OAAO,UAAU,KAAK,CAAC,EAAE,IAAI,EAAE,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,EAAE,KAAK,+BAoG5G"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
export declare const description = "Unpublish
|
|
2
|
+
export declare const description = "Unpublish one or more assets or bundles from the registry via one PR";
|
|
3
3
|
export declare const options: z.ZodObject<{
|
|
4
4
|
dryRun: z.ZodDefault<z.ZodBoolean>;
|
|
5
5
|
json: z.ZodDefault<z.ZodBoolean>;
|
|
@@ -12,15 +12,16 @@ export declare const options: z.ZodObject<{
|
|
|
12
12
|
hook: "hook";
|
|
13
13
|
"memory-template": "memory-template";
|
|
14
14
|
"mcp-config": "mcp-config";
|
|
15
|
+
plugin: "plugin";
|
|
15
16
|
bundle: "bundle";
|
|
16
17
|
}>>;
|
|
17
18
|
yes: z.ZodDefault<z.ZodBoolean>;
|
|
18
19
|
}, z.core.$strip>;
|
|
19
|
-
export declare const args: z.ZodTuple<[z.ZodString],
|
|
20
|
+
export declare const args: z.ZodTuple<[z.ZodString], z.ZodString>;
|
|
20
21
|
type Props = {
|
|
21
22
|
args: z.infer<typeof args>;
|
|
22
23
|
options: z.infer<typeof options>;
|
|
23
24
|
};
|
|
24
|
-
export default function Unpublish({ args: [
|
|
25
|
+
export default function Unpublish({ args: [first, ...more], options: { dryRun, json: jsonFlag, projectRoot, type, yes }, }: Props): import("react").JSX.Element | null;
|
|
25
26
|
export {};
|
|
26
27
|
//# sourceMappingURL=unpublish.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"unpublish.d.ts","sourceRoot":"","sources":["../../src/commands/unpublish.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"unpublish.d.ts","sourceRoot":"","sources":["../../src/commands/unpublish.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAYxB,eAAO,MAAM,WAAW,yEAAyE,CAAC;AAElG,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;;iBAuDlB,CAAC;AAEH,eAAO,MAAM,IAAI,wCAgBd,CAAC;AAEJ,KAAK,KAAK,GAAG;IACX,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,IAAI,CAAC,CAAC;IAC3B,OAAO,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,OAAO,CAAC,CAAC;CAClC,CAAC;AAIF,MAAM,CAAC,OAAO,UAAU,SAAS,CAAC,EAChC,IAAI,EAAE,CAAC,KAAK,EAAE,GAAG,IAAI,CAAC,EACtB,OAAO,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,IAAI,EAAE,GAAG,EAAE,GAC5D,EAAE,KAAK,sCAoGP"}
|
|
@@ -6,13 +6,12 @@ import { ErrorView, RegistryChangeResult, RegistryChangeSummary, Spinner } from
|
|
|
6
6
|
import { useConfirmation } from '../hooks/useConfirmation.js';
|
|
7
7
|
import { useRegistryChangeState } from '../hooks/useRegistryChangeState.js';
|
|
8
8
|
import { ConfirmationRequiredError } from '../lib/confirmation-required.js';
|
|
9
|
-
import { parseOrgFromName } from '../lib/org.js';
|
|
10
9
|
import { errorStateJson, renderJson, useNonInteractive } from '../lib/output.js';
|
|
11
10
|
import { argument, option } from '../lib/pastel/index.js';
|
|
12
11
|
import { registryChangeOpenedJson, registryChangePlanJson } from '../lib/registry-change-json.js';
|
|
13
|
-
import {
|
|
12
|
+
import { executeUnpublish, planUnpublish, tooManyNames, unpublishRequest } from '../lib/registry-mutate.js';
|
|
14
13
|
import { AssetType } from '../lib/schemas/index.js';
|
|
15
|
-
export const description = 'Unpublish
|
|
14
|
+
export const description = 'Unpublish one or more assets or bundles from the registry via one PR';
|
|
16
15
|
export const options = z.object({
|
|
17
16
|
dryRun: z
|
|
18
17
|
.boolean()
|
|
@@ -57,32 +56,34 @@ export const options = z.object({
|
|
|
57
56
|
description: 'Skip confirmation prompt',
|
|
58
57
|
})),
|
|
59
58
|
});
|
|
60
|
-
export const args = z
|
|
59
|
+
export const args = z
|
|
60
|
+
.tuple([
|
|
61
61
|
z.string().describe(argument({
|
|
62
62
|
description: 'Asset or bundle name; accepts @org/name and optional @version (e.g. my-skill@1.0.0)',
|
|
63
63
|
name: 'name',
|
|
64
64
|
})),
|
|
65
|
-
])
|
|
65
|
+
])
|
|
66
|
+
.rest(z.string().describe(argument({
|
|
67
|
+
description: 'More to unpublish in the same pull request (each may carry @org/ and @version)',
|
|
68
|
+
name: 'names',
|
|
69
|
+
})));
|
|
66
70
|
const CANCELLED_MESSAGE = 'Unpublish cancelled.';
|
|
67
|
-
export default function Unpublish({ args: [
|
|
71
|
+
export default function Unpublish({ args: [first, ...more], options: { dryRun, json: jsonFlag, projectRoot, type, yes }, }) {
|
|
68
72
|
const { exit } = useApp();
|
|
69
73
|
const { json } = useNonInteractive(jsonFlag);
|
|
70
|
-
const
|
|
71
|
-
const
|
|
72
|
-
const
|
|
73
|
-
name,
|
|
74
|
-
...(org ? { org } : {}),
|
|
75
|
-
...(version ? { version } : {}),
|
|
76
|
-
...changeTargetFields(type),
|
|
77
|
-
};
|
|
74
|
+
const specs = [first, ...more];
|
|
75
|
+
const request = unpublishRequest(specs, type);
|
|
76
|
+
const usage = tooManyNames(specs, 'unpublish');
|
|
78
77
|
const [state, dispatch] = useRegistryChangeState({
|
|
79
78
|
cancelledMessage: CANCELLED_MESSAGE,
|
|
80
79
|
dryRun,
|
|
81
80
|
execute: (progress) => executeUnpublish(request, progress),
|
|
82
81
|
plan: async () => {
|
|
82
|
+
if (usage)
|
|
83
|
+
throw usage;
|
|
83
84
|
const plan = await planUnpublish(request);
|
|
84
85
|
if (!dryRun && !yes && json) {
|
|
85
|
-
throw new ConfirmationRequiredError(unpublishCommand(
|
|
86
|
+
throw new ConfirmationRequiredError(unpublishCommand(specs, { json: jsonFlag, projectRoot, type }, '--yes'));
|
|
86
87
|
}
|
|
87
88
|
return plan;
|
|
88
89
|
},
|
|
@@ -129,7 +130,7 @@ export default function Unpublish({ args: [rawArg], options: { dryRun, json: jso
|
|
|
129
130
|
if (state.phase === 'dry-run-result' && state.plan)
|
|
130
131
|
return renderJson(registryChangePlanJson(state.plan));
|
|
131
132
|
if (state.phase === 'done' && state.result)
|
|
132
|
-
return renderJson(registryChangeOpenedJson(
|
|
133
|
+
return renderJson(registryChangeOpenedJson(request, state.result));
|
|
133
134
|
if (state.phase === 'error')
|
|
134
135
|
return renderJson(errorStateJson(state));
|
|
135
136
|
return null;
|
|
@@ -157,29 +158,11 @@ export default function Unpublish({ args: [rawArg], options: { dryRun, json: jso
|
|
|
157
158
|
}
|
|
158
159
|
return null;
|
|
159
160
|
}
|
|
160
|
-
/**
|
|
161
|
-
|
|
162
|
-
* Recognises `name@version`, `@org/name@version`, or bare `name`/`@org/name`.
|
|
163
|
-
*/
|
|
164
|
-
function splitVersion(input) {
|
|
165
|
-
// Find the LAST '@' — avoids confusion with a leading @org prefix.
|
|
166
|
-
const lastAt = input.lastIndexOf('@');
|
|
167
|
-
if (lastAt <= 0) {
|
|
168
|
-
// No @ at all, or only a leading @ (which belongs to @org/name)
|
|
169
|
-
return { base: input };
|
|
170
|
-
}
|
|
171
|
-
const base = input.slice(0, lastAt);
|
|
172
|
-
const version = input.slice(lastAt + 1);
|
|
173
|
-
if (!version) {
|
|
174
|
-
return { base: input };
|
|
175
|
-
}
|
|
176
|
-
return { base, version };
|
|
177
|
-
}
|
|
178
|
-
/** `atk unpublish` with the run's flags, followed by `extra`. */
|
|
179
|
-
function unpublishCommand(spec, { json, projectRoot, type }, ...extra) {
|
|
161
|
+
/** `atk unpublish` with the run's names and flags, followed by `extra`. */
|
|
162
|
+
function unpublishCommand(specs, { json, projectRoot, type }, ...extra) {
|
|
180
163
|
return [
|
|
181
164
|
'atk unpublish',
|
|
182
|
-
|
|
165
|
+
...specs,
|
|
183
166
|
...(type ? ['--type', type] : []),
|
|
184
167
|
...(projectRoot ? ['--project-root', JSON.stringify(projectRoot)] : []),
|
|
185
168
|
...(json ? ['--json'] : []),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"unpublish.js","sourceRoot":"","sources":["../../src/commands/unpublish.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,KAAK,CAAC;AACnC,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAClC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,SAAS,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACzG,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,EAAE,sBAAsB,EAAE,MAAM,oCAAoC,CAAC;AAC5E,OAAO,EAAE,yBAAyB,EAAE,MAAM,iCAAiC,CAAC;AAC5E,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"unpublish.js","sourceRoot":"","sources":["../../src/commands/unpublish.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MA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C/C,OAAO,KAAC,qBAAqB,IAAC,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE,OAAO,EAAC,SAAS,GAAG,CAAC;IACvE,CAAC;IAED,IAAI,KAAK,CAAC,KAAK,KAAK,WAAW,EAAE,CAAC;QAChC,OAAO,KAAC,OAAO,IAAC,OAAO,EAAE,KAAK,CAAC,eAAe,IAAI,iBAAiB,GAAI,CAAC;IAC1E,CAAC;IAED,IAAI,KAAK,CAAC,KAAK,KAAK,MAAM,IAAI,KAAK,CAAC,MAAM,EAAE,CAAC;QAC3C,OAAO,KAAC,oBAAoB,IAAC,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,CAAC,MAAM,GAAI,CAAC;IAC1E,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC;AAED,2EAA2E;AAC3E,SAAS,gBAAgB,CACvB,KAAY,EACZ,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,EAA2D,EACpF,GAAG,KAAe;IAElB,OAAO;QACL,eAAe;QACf,GAAG,KAAK;QACR,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QACjC,GAAG,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,gBAAgB,EAAE,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QACvE,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QAC3B,GAAG,KAAK;KACT,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACd,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const description = "Remove your star from an asset or bundle";
|
|
3
|
+
export declare const options: z.ZodObject<{
|
|
4
|
+
json: z.ZodDefault<z.ZodBoolean>;
|
|
5
|
+
org: z.ZodOptional<z.ZodString>;
|
|
6
|
+
type: z.ZodOptional<z.ZodEnum<{
|
|
7
|
+
skill: "skill";
|
|
8
|
+
agent: "agent";
|
|
9
|
+
rule: "rule";
|
|
10
|
+
hook: "hook";
|
|
11
|
+
"memory-template": "memory-template";
|
|
12
|
+
"mcp-config": "mcp-config";
|
|
13
|
+
plugin: "plugin";
|
|
14
|
+
}>>;
|
|
15
|
+
}, z.core.$strip>;
|
|
16
|
+
export declare const args: z.ZodTuple<[z.ZodString], null>;
|
|
17
|
+
type Props = {
|
|
18
|
+
args: z.infer<typeof args>;
|
|
19
|
+
options: z.infer<typeof options>;
|
|
20
|
+
};
|
|
21
|
+
export default function Unstar({ args: [name], options: { json, org, type } }: Props): import("react").JSX.Element;
|
|
22
|
+
export {};
|
|
23
|
+
//# sourceMappingURL=unstar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unstar.d.ts","sourceRoot":"","sources":["../../src/commands/unstar.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,eAAO,MAAM,WAAW,6CAA6C,CAAC;AAEtE,eAAO,MAAM,OAAO;;;;;;;;;;;;iBAyBlB,CAAC;AAEH,eAAO,MAAM,IAAI,iCAOf,CAAC;AAEH,KAAK,KAAK,GAAG;IACX,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,IAAI,CAAC,CAAC;IAC3B,OAAO,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,OAAO,CAAC,CAAC;CAClC,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,EAAE,IAAI,EAAE,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,EAAE,EAAE,KAAK,+BAEnF"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import StarCommand from '../components/StarCommand.js';
|
|
4
|
+
import { argument, option } from '../lib/pastel/index.js';
|
|
5
|
+
import { AssetType } from '../lib/schemas/index.js';
|
|
6
|
+
export const description = 'Remove your star from an asset or bundle';
|
|
7
|
+
export const options = z.object({
|
|
8
|
+
json: z
|
|
9
|
+
.boolean()
|
|
10
|
+
.default(false)
|
|
11
|
+
.describe(option({
|
|
12
|
+
alias: 'j',
|
|
13
|
+
description: 'Output raw JSON (for scripting and CI)',
|
|
14
|
+
})),
|
|
15
|
+
org: z
|
|
16
|
+
.string()
|
|
17
|
+
.optional()
|
|
18
|
+
.describe(option({
|
|
19
|
+
alias: 'o',
|
|
20
|
+
description: "The asset's or bundle's org, as @org/name gives it",
|
|
21
|
+
})),
|
|
22
|
+
type: AssetType.optional().describe(option({
|
|
23
|
+
alias: 't',
|
|
24
|
+
description: 'The asset of that type, rather than a bundle of the name (skill, agent, rule, hook, ...)',
|
|
25
|
+
})),
|
|
26
|
+
});
|
|
27
|
+
export const args = z.tuple([
|
|
28
|
+
z.string().describe(argument({
|
|
29
|
+
description: 'Asset or bundle name (supports @org/name and global:name), resolved as atk info resolves it',
|
|
30
|
+
name: 'name',
|
|
31
|
+
})),
|
|
32
|
+
]);
|
|
33
|
+
export default function Unstar({ args: [name], options: { json, org, type } }) {
|
|
34
|
+
return _jsx(StarCommand, { json: json, name: name, org: org, starred: false, type: type });
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=unstar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unstar.js","sourceRoot":"","sources":["../../src/commands/unstar.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,WAAW,MAAM,8BAA8B,CAAC;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAEpD,MAAM,CAAC,MAAM,WAAW,GAAG,0CAA0C,CAAC;AAEtE,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,CAAC,MAAM,CAAC;IAC9B,IAAI,EAAE,CAAC;SACJ,OAAO,EAAE;SACT,OAAO,CAAC,KAAK,CAAC;SACd,QAAQ,CACP,MAAM,CAAC;QACL,KAAK,EAAE,GAAG;QACV,WAAW,EAAE,wCAAwC;KACtD,CAAC,CACH;IACH,GAAG,EAAE,CAAC;SACH,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,CACP,MAAM,CAAC;QACL,KAAK,EAAE,GAAG;QACV,WAAW,EAAE,oDAAoD;KAClE,CAAC,CACH;IACH,IAAI,EAAE,SAAS,CAAC,QAAQ,EAAE,CAAC,QAAQ,CACjC,MAAM,CAAC;QACL,KAAK,EAAE,GAAG;QACV,WAAW,EAAE,0FAA0F;KACxG,CAAC,CACH;CACF,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,IAAI,GAAG,CAAC,CAAC,KAAK,CAAC;IAC1B,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CACjB,QAAQ,CAAC;QACP,WAAW,EAAE,6FAA6F;QAC1G,IAAI,EAAE,MAAM;KACb,CAAC,CACH;CACF,CAAC,CAAC;AAOH,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,EAAE,IAAI,EAAE,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,EAAS;IAClF,OAAO,KAAC,WAAW,IAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,GAAI,CAAC;AACvF,CAAC"}
|
|
@@ -15,8 +15,10 @@ export declare const options: z.ZodObject<{
|
|
|
15
15
|
hook: "hook";
|
|
16
16
|
"memory-template": "memory-template";
|
|
17
17
|
"mcp-config": "mcp-config";
|
|
18
|
+
plugin: "plugin";
|
|
18
19
|
}>>;
|
|
19
20
|
user: z.ZodOptional<z.ZodBoolean>;
|
|
21
|
+
yes: z.ZodOptional<z.ZodBoolean>;
|
|
20
22
|
}, z.core.$strip>;
|
|
21
23
|
export declare const args: z.ZodTuple<[z.ZodOptional<z.ZodString>], z.ZodString>;
|
|
22
24
|
type Props = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update.d.ts","sourceRoot":"","sources":["../../src/commands/update.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"update.d.ts","sourceRoot":"","sources":["../../src/commands/update.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAmDxB,eAAO,MAAM,WAAW,yEAAyE,CAAC;AAElG,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;;;;;iBAwFlB,CAAC;AAEH,eAAO,MAAM,IAAI,uDAcd,CAAC;AAUJ,KAAK,KAAK,GAAG;IACX,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,IAAI,CAAC,CAAC;IAC3B,OAAO,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,OAAO,CAAC,CAAC;CAClC,CAAC;AAsDF,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,EAAE,IAAI,EAAE,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,EAAE,OAAO,EAAE,EAAE,KAAK,+BAI1E"}
|
package/build/commands/update.js
CHANGED
|
@@ -3,14 +3,17 @@ import { Box, Text, useApp } from 'ink';
|
|
|
3
3
|
import { useCallback, useEffect, useMemo, useState } from 'react';
|
|
4
4
|
import { z } from 'zod';
|
|
5
5
|
import { assetCount, AssetVersionLine, DryRunBanner, ErrorView, LocalEditsHint, MultiSelectList, RunStoppedHint, SkippedAssetSection, Spinner, UndeclaredRemovedHint, } from '../components/index.js';
|
|
6
|
+
import PluginReviewQuestion, { PluginCapabilities } from '../components/PluginReviewQuestion.js';
|
|
6
7
|
import { useCommand } from '../hooks/useCommand.js';
|
|
7
8
|
import { useResolvedScope } from '../hooks/useResolvedScope.js';
|
|
9
|
+
import { ConfirmationRequiredError } from '../lib/confirmation-required.js';
|
|
8
10
|
import { installReport, sendInstallReport } from '../lib/install-report.js';
|
|
9
11
|
import { findLocalEdits, isDependedOn } from '../lib/local-edits.js';
|
|
10
12
|
import { identityKey, readLockfile, withLockfileErrorHandling } from '../lib/lockfile.js';
|
|
11
13
|
import { formatOrgName } from '../lib/org.js';
|
|
12
14
|
import { renderJson, useNonInteractive } from '../lib/output.js';
|
|
13
15
|
import { argument, option } from '../lib/pastel/index.js';
|
|
16
|
+
import { pluginUpdateReviews, reviewKey, unconfirmedReviews } from '../lib/plugin-review.js';
|
|
14
17
|
import { fetchRegistry } from '../lib/registry.js';
|
|
15
18
|
import { AssetType } from '../lib/schemas/index.js';
|
|
16
19
|
import { loadScopeConfig, scopedCommand, scopeLabel } from '../lib/scope.js';
|
|
@@ -79,6 +82,13 @@ export const options = z.object({
|
|
|
79
82
|
.describe(option({
|
|
80
83
|
description: 'Use the user scope (the user root, ~ by default) instead of the project',
|
|
81
84
|
})),
|
|
85
|
+
yes: z
|
|
86
|
+
.boolean()
|
|
87
|
+
.optional()
|
|
88
|
+
.describe(option({
|
|
89
|
+
alias: 'y',
|
|
90
|
+
description: "Update plugins without confirming their capabilities (a run that can't prompt needs it)",
|
|
91
|
+
})),
|
|
82
92
|
});
|
|
83
93
|
export const args = z
|
|
84
94
|
.tuple([
|
|
@@ -95,7 +105,7 @@ export default function Update({ args: [rawName, ...more], options }) {
|
|
|
95
105
|
const specs = rawName ? [rawName, ...more] : more;
|
|
96
106
|
if (options.interactive)
|
|
97
107
|
return _jsx(UpdatePicker, { options: options, specs: specs });
|
|
98
|
-
return _jsx(
|
|
108
|
+
return _jsx(ConfirmedUpdateRun, { options: options, specs: specs });
|
|
99
109
|
}
|
|
100
110
|
/** The outdated assets a run that names them all would leave alone, apart from those it updates. */
|
|
101
111
|
function byUpdatability(outdated, localEdits, { force, named }) {
|
|
@@ -126,6 +136,19 @@ function byUpdatability(outdated, localEdits, { force, named }) {
|
|
|
126
136
|
}
|
|
127
137
|
return { skippedEdited, skippedFrozen, skippedPinned, updatable };
|
|
128
138
|
}
|
|
139
|
+
/**
|
|
140
|
+
* The update, asking first to confirm the plugins it moves (unless --yes): it runs again once they are
|
|
141
|
+
* confirmed, and updates nothing when they aren't.
|
|
142
|
+
*/
|
|
143
|
+
function ConfirmedUpdateRun(props) {
|
|
144
|
+
// The plugin versions confirmed so far; false once a review is declined.
|
|
145
|
+
const [confirmed, setConfirmed] = useState([]);
|
|
146
|
+
if (confirmed === false)
|
|
147
|
+
return _jsx(Text, { children: "Nothing updated: the plugins were not confirmed." });
|
|
148
|
+
return (_jsx(UpdateRun, { confirmedPlugins: confirmed, ...props, onPluginAnswer: (answer, reviews) => setConfirmed((current) => current === false || reviews.every((r) => current.includes(reviewKey(r)))
|
|
149
|
+
? current
|
|
150
|
+
: answer && [...current, ...reviews.map(reviewKey)]) }, `confirmed:${confirmed.join(',')}`));
|
|
151
|
+
}
|
|
129
152
|
/** The outdated assets an update would leave alone because their files were edited. */
|
|
130
153
|
function EditedSkipped({ dryRun = false, items, scope, showSpacer, }) {
|
|
131
154
|
if (items.length === 0)
|
|
@@ -184,6 +207,19 @@ function namedTargets(lockfile, targets, { root, scope }) {
|
|
|
184
207
|
}
|
|
185
208
|
return [...found.values()];
|
|
186
209
|
}
|
|
210
|
+
/** The same update with --yes and the run's flags, for a run that can't ask to confirm its plugins. */
|
|
211
|
+
function updateCommandFor(specs, { force, projectRoot, tool, type, user, }) {
|
|
212
|
+
return [
|
|
213
|
+
'atk update',
|
|
214
|
+
...specs,
|
|
215
|
+
'--yes',
|
|
216
|
+
...(type ? ['--type', type] : []),
|
|
217
|
+
...(force ? ['--force'] : []),
|
|
218
|
+
...(tool ? ['--tool', tool] : []),
|
|
219
|
+
...(projectRoot ? ['--project-root', JSON.stringify(projectRoot)] : []),
|
|
220
|
+
...(user ? ['--user'] : []),
|
|
221
|
+
].join(' ');
|
|
222
|
+
}
|
|
187
223
|
/** `atk update -i`: the outdated assets as a multi-select, then the update of the chosen ones. */
|
|
188
224
|
function UpdatePicker({ options, specs }) {
|
|
189
225
|
const { exit } = useApp();
|
|
@@ -257,7 +293,7 @@ function UpdatePicker({ options, specs }) {
|
|
|
257
293
|
setSelected([...next]);
|
|
258
294
|
}, [selectedKeys]);
|
|
259
295
|
if (chosen)
|
|
260
|
-
return _jsx(
|
|
296
|
+
return _jsx(ConfirmedUpdateRun, { options: options, picked: chosen, specs: [] });
|
|
261
297
|
if (state.status === 'loading') {
|
|
262
298
|
return _jsx(Spinner, { message: state.message });
|
|
263
299
|
}
|
|
@@ -293,7 +329,7 @@ function UpdatePicker({ options, specs }) {
|
|
|
293
329
|
* The update itself: every outdated asset (no `specs`), one named asset as before, or several
|
|
294
330
|
* (`specs`, or the assets `picked`), which update to their latest versions.
|
|
295
331
|
*/
|
|
296
|
-
function UpdateRun({ options: { dryRun, force, json, projectRoot, tool, type, user }, picked, specs, }) {
|
|
332
|
+
function UpdateRun({ confirmedPlugins, onPluginAnswer, options: { dryRun, force, json, projectRoot, tool, type, user, yes }, picked, specs, }) {
|
|
297
333
|
const parsed = specs.length === 1 ? parseNameVersion(specs[0]) : undefined;
|
|
298
334
|
const name = parsed?.name;
|
|
299
335
|
const requestedVersion = parsed?.version;
|
|
@@ -326,6 +362,26 @@ function UpdateRun({ options: { dryRun, force, json, projectRoot, tool, type, us
|
|
|
326
362
|
const current = (targets ?? []).filter((t) => !outdated.some((o) => identityKey(o) === identityKey(t)));
|
|
327
363
|
return current.length > 0 ? { upToDate: current.map(upToDateAsset) } : {};
|
|
328
364
|
};
|
|
365
|
+
// What the update moves, each to the version it goes to, for the plugin review. A named version
|
|
366
|
+
// the registry doesn't count as newer (a pre-release, an older one) moves the asset all the same.
|
|
367
|
+
const updateTargets = (updatable) => {
|
|
368
|
+
const moved = updatable.map(({ latestVersion, name: n, org, type: t }) => ({
|
|
369
|
+
name: n,
|
|
370
|
+
...(org ? { org } : {}),
|
|
371
|
+
type: t,
|
|
372
|
+
version: requestedVersion ?? latestVersion,
|
|
373
|
+
}));
|
|
374
|
+
const pinnedTo = target && requestedVersion && target.version !== requestedVersion;
|
|
375
|
+
if (pinnedTo && !moved.some((o) => identityKey(o) === identityKey(target))) {
|
|
376
|
+
moved.push({
|
|
377
|
+
name: target.name,
|
|
378
|
+
...(target.org ? { org: target.org } : {}),
|
|
379
|
+
type: target.type,
|
|
380
|
+
version: requestedVersion,
|
|
381
|
+
});
|
|
382
|
+
}
|
|
383
|
+
return moved;
|
|
384
|
+
};
|
|
329
385
|
// Dry-run: check outdated, return plan
|
|
330
386
|
if (dryRun) {
|
|
331
387
|
const lockfile = preCheckLockfile;
|
|
@@ -352,9 +408,11 @@ function UpdateRun({ options: { dryRun, force, json, projectRoot, tool, type, us
|
|
|
352
408
|
skippedEdited.length === 0) {
|
|
353
409
|
return { outcome: 'up-to-date', tools: toolNames, ...upToDate };
|
|
354
410
|
}
|
|
411
|
+
const plugins = pluginUpdateReviews(updateTargets(updatable), registry, lockfile, tools.map((t) => t.adapter));
|
|
355
412
|
return {
|
|
356
413
|
outcome: 'dry-run',
|
|
357
414
|
outdated: updatable,
|
|
415
|
+
...(plugins.length > 0 ? { plugins } : {}),
|
|
358
416
|
scope,
|
|
359
417
|
skippedEdited,
|
|
360
418
|
skippedFrozen,
|
|
@@ -397,6 +455,23 @@ function UpdateRun({ options: { dryRun, force, json, projectRoot, tool, type, us
|
|
|
397
455
|
// dependency is kept only when every tool had it, so the tools never split over its version.
|
|
398
456
|
const notInPlace = notInPlaceOf(lockfile);
|
|
399
457
|
const localEdits = force ? undefined : await localEditsOf(lockfile, candidates, notInPlace);
|
|
458
|
+
// A plugin runs its code in every Claude Code session: a terminal run shows what each one the
|
|
459
|
+
// update moves declares it can do, and what changed, and asks first, unless --yes; a run that
|
|
460
|
+
// can't ask updates none unseen, and fails naming --yes.
|
|
461
|
+
// Each update's plan counts, dependencies included; a version confirmed already isn't asked again.
|
|
462
|
+
if (!yes) {
|
|
463
|
+
const { updatable } = byUpdatability(candidates, localEdits ?? new Map(), {
|
|
464
|
+
force,
|
|
465
|
+
named: !!name || !!targets,
|
|
466
|
+
});
|
|
467
|
+
const reviews = pluginUpdateReviews(updateTargets(updatable), registry, lockfile, tools.map((t) => t.adapter));
|
|
468
|
+
if (unconfirmedReviews(reviews, confirmedPlugins).length > 0) {
|
|
469
|
+
if (effectiveJson) {
|
|
470
|
+
throw new ConfirmationRequiredError(updateCommandFor(specs, { force, projectRoot, tool, type, user }));
|
|
471
|
+
}
|
|
472
|
+
return { outcome: 'confirm-plugins', reviews };
|
|
473
|
+
}
|
|
474
|
+
}
|
|
400
475
|
const updatedFor = new Set();
|
|
401
476
|
const toolResults = [];
|
|
402
477
|
// What each tool's updates placed, dependencies included: the install report, not the output.
|
|
@@ -504,6 +579,9 @@ function UpdateRun({ options: { dryRun, force, json, projectRoot, tool, type, us
|
|
|
504
579
|
}
|
|
505
580
|
const { data } = state;
|
|
506
581
|
const where = resolved ? ` in ${scopeLabel(resolved)}` : '';
|
|
582
|
+
if (data.outcome === 'confirm-plugins') {
|
|
583
|
+
return (_jsx(PluginReviewQuestion, { action: 'update', onAnswer: (confirmed) => onPluginAnswer(confirmed, data.reviews), reviews: data.reviews }));
|
|
584
|
+
}
|
|
507
585
|
if (data.outcome === 'failed' || data.outcome === 'partial') {
|
|
508
586
|
process.exitCode = 1;
|
|
509
587
|
}
|
|
@@ -517,7 +595,7 @@ function UpdateRun({ options: { dryRun, force, json, projectRoot, tool, type, us
|
|
|
517
595
|
}
|
|
518
596
|
if (data.outcome === 'dry-run') {
|
|
519
597
|
const hasUpdatable = data.outdated.length > 0;
|
|
520
|
-
return (_jsxs(Box, { flexDirection: 'column', children: [hasUpdatable && (_jsxs(_Fragment, { children: [_jsx(DryRunBanner, { action: 'update', count: data.outdated.length, tools: data.tools, where: resolved && scopeLabel(resolved) }), _jsx(Box, { flexDirection: 'column', marginTop: 1, children: data.outdated.map((o) => (_jsx(AssetVersionLine, { installedVersion: o.installedVersion, latestVersion: o.latestVersion, name: o.name, type: o.type }, `${o.type}/${o.org ?? ''}/${o.name}`))) })] })), _jsx(SkippedAssetSection, { badgeText: 'frozen', color: 'cyan', hint: `use ${scopedCommand('atk thaw', data.scope)} to unfreeze`, icon: '\u2744', items: data.skippedFrozen, label: 'frozen', showSpacer: hasUpdatable }), _jsx(SkippedAssetSection, { badgeText: 'pinned', color: 'yellow', hint: 'update by name with --force to override', icon: '\u2298', items: data.skippedPinned, label: 'pinned', showSpacer: hasUpdatable || data.skippedFrozen.length > 0 }), _jsx(EditedSkipped, { dryRun: true, items: data.skippedEdited, scope: data.scope, showSpacer: hasUpdatable || data.skippedFrozen.length > 0 || data.skippedPinned.length > 0 }), data.upToDate && (_jsx(Box, { marginTop: 1, children: _jsx(UpToDateLine, { assets: data.upToDate, where: where }) }))] }));
|
|
598
|
+
return (_jsxs(Box, { flexDirection: 'column', children: [hasUpdatable && (_jsxs(_Fragment, { children: [_jsx(DryRunBanner, { action: 'update', count: data.outdated.length, tools: data.tools, where: resolved && scopeLabel(resolved) }), _jsx(Box, { flexDirection: 'column', marginTop: 1, children: data.outdated.map((o) => (_jsx(AssetVersionLine, { installedVersion: o.installedVersion, latestVersion: o.latestVersion, name: o.name, type: o.type }, `${o.type}/${o.org ?? ''}/${o.name}`))) }), data.plugins?.map((review) => (_jsx(PluginCapabilities, { review: review }, formatOrgName(review.org, review.name))))] })), _jsx(SkippedAssetSection, { badgeText: 'frozen', color: 'cyan', hint: `use ${scopedCommand('atk thaw', data.scope)} to unfreeze`, icon: '\u2744', items: data.skippedFrozen, label: 'frozen', showSpacer: hasUpdatable }), _jsx(SkippedAssetSection, { badgeText: 'pinned', color: 'yellow', hint: 'update by name with --force to override', icon: '\u2298', items: data.skippedPinned, label: 'pinned', showSpacer: hasUpdatable || data.skippedFrozen.length > 0 }), _jsx(EditedSkipped, { dryRun: true, items: data.skippedEdited, scope: data.scope, showSpacer: hasUpdatable || data.skippedFrozen.length > 0 || data.skippedPinned.length > 0 }), data.upToDate && (_jsx(Box, { marginTop: 1, children: _jsx(UpToDateLine, { assets: data.upToDate, where: where }) }))] }));
|
|
521
599
|
}
|
|
522
600
|
const stoppedAt = data.toolResults.find((tr) => tr.notAttempted);
|
|
523
601
|
return (_jsxs(Box, { flexDirection: 'column', children: [data.toolResults.map(({ editedSkipped, excludedSkipped, failures, frozenSkipped, removedUndeclared, removeFailures, results, skipped, tool: resolvedTool, }) => (_jsxs(Box, { flexDirection: 'column', children: [results.length > 0 && (_jsxs(_Fragment, { children: [_jsxs(Text, { color: 'green', children: ["\u2713 Updated ", results.length, " asset", results.length !== 1 ? 's' : '', " for ", resolvedTool, where] }), _jsx(Box, { flexDirection: 'column', marginTop: 1, children: results.map((r) => (_jsxs(Box, { flexDirection: 'column', children: [_jsx(AssetVersionLine, { installedVersion: r.fromVersion, latestVersion: r.toVersion, name: r.name, type: r.type }), r.installResult.filesPlaced.map((f) => (_jsxs(Text, { dimColor: true, wrap: 'truncate', children: [' ', "\u2192 ", f.destination] }, f.destination))), (r.warnings ?? []).map((w, i) => (_jsxs(Box, { flexDirection: 'column', children: [_jsxs(Text, { color: 'yellow', children: [' ', "\u26A0 ", w.message] }), _jsxs(Text, { dimColor: true, children: [' ', w.command] })] }, i)))] }, `${r.type}/${r.org ?? ''}/${r.name}`))) })] })), failures.length > 0 && (_jsxs(Box, { flexDirection: 'column', marginTop: results.length > 0 ? 1 : 0, children: [_jsxs(Text, { color: 'red', children: ["\u2717 Failed to update ", failures.length, " asset", failures.length !== 1 ? 's' : ''] }), _jsx(Box, { flexDirection: 'column', paddingLeft: 2, children: failures.map((f) => (_jsx(ErrorView, { command: f.command, hint: f.hint, message: f.error }, `${f.type}/${f.org ?? ''}/${f.name}`))) })] })), _jsx(SkippedAssetSection, { badgeText: 'frozen', color: 'cyan', hint: `use ${scopedCommand('atk thaw', data.scope)} to unfreeze`, icon: '\u2744', items: frozenSkipped ?? [], label: 'frozen', showSpacer: results.length > 0 || failures.length > 0 }), _jsx(SkippedAssetSection, { badgeText: 'pinned', color: 'yellow', hint: 'update by name with --force to override', icon: '\u2298', items: skipped ?? [], label: 'pinned', showSpacer: results.length > 0 || failures.length > 0 || (frozenSkipped ?? []).length > 0 }), _jsx(EditedSkipped, { items: editedSkipped ?? [], scope: data.scope, showSpacer: results.length > 0 ||
|