@detergent-software/atk 9.2.0-dev.2 → 9.2.0-dev.4
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 +22 -0
- package/README.md +2 -2
- package/build/command-manifest.json +8 -3
- package/build/commands/diff.d.ts +3 -2
- package/build/commands/diff.d.ts.map +1 -1
- package/build/commands/diff.js +48 -13
- package/build/commands/diff.js.map +1 -1
- package/build/commands/info.d.ts.map +1 -1
- package/build/commands/info.js +18 -2
- package/build/commands/info.js.map +1 -1
- package/build/commands/schema.d.ts +1 -1
- package/build/components/BundleDetail.d.ts +3 -1
- package/build/components/BundleDetail.d.ts.map +1 -1
- package/build/components/BundleDetail.js +4 -2
- package/build/components/BundleDetail.js.map +1 -1
- package/build/components/DiffView.d.ts +11 -5
- package/build/components/DiffView.d.ts.map +1 -1
- package/build/components/DiffView.js +7 -5
- package/build/components/DiffView.js.map +1 -1
- package/build/components/Field.js +1 -1
- package/build/components/Field.js.map +1 -1
- package/build/lib/atk-api/generated/types.gen.d.ts +8 -8
- package/build/lib/atk-schemas/claude-plugin.d.ts +56 -0
- package/build/lib/atk-schemas/claude-plugin.d.ts.map +1 -0
- package/build/lib/atk-schemas/claude-plugin.js +199 -0
- package/build/lib/atk-schemas/claude-plugin.js.map +1 -0
- 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/diff-command.d.ts +27 -2
- package/build/lib/diff-command.d.ts.map +1 -1
- package/build/lib/diff-command.js +39 -7
- package/build/lib/diff-command.js.map +1 -1
- package/package.json +1 -1
|
@@ -1458,7 +1458,7 @@ export type PublishPlanErrors = {
|
|
|
1458
1458
|
*/
|
|
1459
1459
|
426: ApiError;
|
|
1460
1460
|
/**
|
|
1461
|
-
* The API's GitHub
|
|
1461
|
+
* The API's GitHub credentials for registry writes are missing or rejected (`server_misconfigured`)
|
|
1462
1462
|
*/
|
|
1463
1463
|
500: ApiError;
|
|
1464
1464
|
/**
|
|
@@ -1506,7 +1506,7 @@ export type PublishErrors = {
|
|
|
1506
1506
|
*/
|
|
1507
1507
|
426: ApiError;
|
|
1508
1508
|
/**
|
|
1509
|
-
* The API's GitHub
|
|
1509
|
+
* The API's GitHub credentials for registry writes are missing or rejected (`server_misconfigured`)
|
|
1510
1510
|
*/
|
|
1511
1511
|
500: ApiError;
|
|
1512
1512
|
/**
|
|
@@ -1554,7 +1554,7 @@ export type UnpublishPlanErrors = {
|
|
|
1554
1554
|
*/
|
|
1555
1555
|
426: ApiError;
|
|
1556
1556
|
/**
|
|
1557
|
-
* The API's GitHub
|
|
1557
|
+
* The API's GitHub credentials for registry writes are missing or rejected (`server_misconfigured`)
|
|
1558
1558
|
*/
|
|
1559
1559
|
500: ApiError;
|
|
1560
1560
|
/**
|
|
@@ -1602,7 +1602,7 @@ export type UnpublishErrors = {
|
|
|
1602
1602
|
*/
|
|
1603
1603
|
426: ApiError;
|
|
1604
1604
|
/**
|
|
1605
|
-
* The API's GitHub
|
|
1605
|
+
* The API's GitHub credentials for registry writes are missing or rejected (`server_misconfigured`)
|
|
1606
1606
|
*/
|
|
1607
1607
|
500: ApiError;
|
|
1608
1608
|
/**
|
|
@@ -1650,7 +1650,7 @@ export type PromotePlanErrors = {
|
|
|
1650
1650
|
*/
|
|
1651
1651
|
426: ApiError;
|
|
1652
1652
|
/**
|
|
1653
|
-
* The API's GitHub
|
|
1653
|
+
* The API's GitHub credentials for registry writes are missing or rejected (`server_misconfigured`)
|
|
1654
1654
|
*/
|
|
1655
1655
|
500: ApiError;
|
|
1656
1656
|
/**
|
|
@@ -1698,7 +1698,7 @@ export type PromoteErrors = {
|
|
|
1698
1698
|
*/
|
|
1699
1699
|
426: ApiError;
|
|
1700
1700
|
/**
|
|
1701
|
-
* The API's GitHub
|
|
1701
|
+
* The API's GitHub credentials for registry writes are missing or rejected (`server_misconfigured`)
|
|
1702
1702
|
*/
|
|
1703
1703
|
500: ApiError;
|
|
1704
1704
|
/**
|
|
@@ -1746,7 +1746,7 @@ export type DeprecatePlanErrors = {
|
|
|
1746
1746
|
*/
|
|
1747
1747
|
426: ApiError;
|
|
1748
1748
|
/**
|
|
1749
|
-
* The API's GitHub
|
|
1749
|
+
* The API's GitHub credentials for registry writes are missing or rejected (`server_misconfigured`)
|
|
1750
1750
|
*/
|
|
1751
1751
|
500: ApiError;
|
|
1752
1752
|
/**
|
|
@@ -1794,7 +1794,7 @@ export type DeprecateErrors = {
|
|
|
1794
1794
|
*/
|
|
1795
1795
|
426: ApiError;
|
|
1796
1796
|
/**
|
|
1797
|
-
* The API's GitHub
|
|
1797
|
+
* The API's GitHub credentials for registry writes are missing or rejected (`server_misconfigured`)
|
|
1798
1798
|
*/
|
|
1799
1799
|
500: ApiError;
|
|
1800
1800
|
/**
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import type { Bundle } from './bundle.ts';
|
|
2
|
+
import type { Manifest } from './manifest.ts';
|
|
3
|
+
/**
|
|
4
|
+
* The rules a bundle flagged `metadata.claudePlugin` must meet to become a claude.ai plugin, and what the plugin holds
|
|
5
|
+
* when it does (ATK-538). One source for both readers of the registry: `@atk/claude-plugins` checks a registry
|
|
6
|
+
* checkout before it generates the plugins, and the API checks its snapshot before a flagged bundle's publish
|
|
7
|
+
* (ATK-747). Every problem names the bundle and the asset. No I/O and no `node:path`, since the CLI vendors this
|
|
8
|
+
* package: the {@link ClaudePluginRegistry} reads, and paths are compared as plain strings.
|
|
9
|
+
*/
|
|
10
|
+
/** The asset types a plugin can hold, and their directories under `assets/`. */
|
|
11
|
+
export declare const CLAUDE_PLUGIN_TYPE_DIRS: {
|
|
12
|
+
readonly 'mcp-config': "mcp-configs";
|
|
13
|
+
readonly skill: "skills";
|
|
14
|
+
};
|
|
15
|
+
export interface ClaudePlugin {
|
|
16
|
+
mcpServers: Record<string, Record<string, unknown>>;
|
|
17
|
+
skills: ClaudePluginSkill[];
|
|
18
|
+
}
|
|
19
|
+
export type ClaudePluginAssetType = keyof typeof CLAUDE_PLUGIN_TYPE_DIRS;
|
|
20
|
+
export interface ClaudePluginProblem {
|
|
21
|
+
/** The index in the bundle's `assets` of the asset it is about; absent for the bundle itself. */
|
|
22
|
+
asset?: number;
|
|
23
|
+
message: string;
|
|
24
|
+
}
|
|
25
|
+
/** A global asset version of the registry, read from a checkout or a snapshot. */
|
|
26
|
+
export interface ClaudePluginRegistry {
|
|
27
|
+
/** Whether the version's directory has `file`, a normalized path relative to it (with /). */
|
|
28
|
+
isFile(type: ClaudePluginAssetType, name: string, version: string, file: string): Promise<boolean>;
|
|
29
|
+
/** The names of the files at the top of the version's directory. */
|
|
30
|
+
listFiles(type: ClaudePluginAssetType, name: string, version: string): Promise<string[]>;
|
|
31
|
+
/** The version's `manifest.json`, or undefined when the registry has no such version. */
|
|
32
|
+
manifest(type: ClaudePluginAssetType, name: string, version: string): Promise<Manifest | undefined>;
|
|
33
|
+
/** A file of the version's directory (a normalized path relative to it), or undefined when it has none. */
|
|
34
|
+
readText(type: ClaudePluginAssetType, name: string, version: string, file: string): Promise<string | undefined>;
|
|
35
|
+
}
|
|
36
|
+
export interface ClaudePluginSkill {
|
|
37
|
+
entrypoint: string;
|
|
38
|
+
/** The files besides the entrypoint, which the plugin places as SKILL.md. */
|
|
39
|
+
files: string[];
|
|
40
|
+
name: string;
|
|
41
|
+
version: string;
|
|
42
|
+
}
|
|
43
|
+
export type ResolvedClaudePlugin = {
|
|
44
|
+
plugin: ClaudePlugin;
|
|
45
|
+
problems: [];
|
|
46
|
+
} | {
|
|
47
|
+
plugin?: undefined;
|
|
48
|
+
problems: ClaudePluginProblem[];
|
|
49
|
+
};
|
|
50
|
+
/** True when the bundle asks to become a claude.ai plugin. */
|
|
51
|
+
export declare function isClaudePlugin(bundle: Pick<Bundle, 'metadata'>): boolean;
|
|
52
|
+
/** Checks the bundle against the plugin rules; `org` is its scope (the bundle's own, or its `bundles/@<org>/` directory). */
|
|
53
|
+
export declare function resolveClaudePlugin(bundle: Pick<Bundle, 'assets' | 'name' | 'version'>, { org }: {
|
|
54
|
+
org: string | undefined;
|
|
55
|
+
}, registry: ClaudePluginRegistry): Promise<ResolvedClaudePlugin>;
|
|
56
|
+
//# sourceMappingURL=claude-plugin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"claude-plugin.d.ts","sourceRoot":"","sources":["../../../src/lib/atk-schemas/claude-plugin.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,MAAM,EAAkB,MAAM,aAAa,CAAC;AAC1D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAE9C;;;;;;GAMG;AAEH,gFAAgF;AAChF,eAAO,MAAM,uBAAuB;;;CAA4D,CAAC;AACjG,MAAM,WAAW,YAAY;IAC3B,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IACpD,MAAM,EAAE,iBAAiB,EAAE,CAAC;CAC7B;AAED,MAAM,MAAM,qBAAqB,GAAG,MAAM,OAAO,uBAAuB,CAAC;AAEzE,MAAM,WAAW,mBAAmB;IAClC,iGAAiG;IACjG,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,kFAAkF;AAClF,MAAM,WAAW,oBAAoB;IACnC,6FAA6F;IAC7F,MAAM,CAAC,IAAI,EAAE,qBAAqB,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IACnG,oEAAoE;IACpE,SAAS,CAAC,IAAI,EAAE,qBAAqB,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;IACzF,yFAAyF;IACzF,QAAQ,CAAC,IAAI,EAAE,qBAAqB,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,GAAG,SAAS,CAAC,CAAC;IACpG,2GAA2G;IAC3G,QAAQ,CAAC,IAAI,EAAE,qBAAqB,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;CACjH;AAED,MAAM,WAAW,iBAAiB;IAChC,UAAU,EAAE,MAAM,CAAC;IACnB,6EAA6E;IAC7E,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,MAAM,oBAAoB,GAC9B;IAAE,MAAM,EAAE,YAAY,CAAC;IAAC,QAAQ,EAAE,EAAE,CAAA;CAAE,GAAG;IAAE,MAAM,CAAC,EAAE,SAAS,CAAC;IAAC,QAAQ,EAAE,mBAAmB,EAAE,CAAA;CAAE,CAAC;AAMnG,8DAA8D;AAC9D,wBAAgB,cAAc,CAAC,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,UAAU,CAAC,GAAG,OAAO,CAExE;AAED,6HAA6H;AAC7H,wBAAsB,mBAAmB,CACvC,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,QAAQ,GAAG,MAAM,GAAG,SAAS,CAAC,EACnD,EAAE,GAAG,EAAE,EAAE;IAAE,GAAG,EAAE,MAAM,GAAG,SAAS,CAAA;CAAE,EACpC,QAAQ,EAAE,oBAAoB,GAC7B,OAAO,CAAC,oBAAoB,CAAC,CA0F/B"}
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
// GENERATED from packages/schemas by `pnpm sync-cli`. Do not edit.
|
|
2
|
+
import { satisfies, valid } from 'semver';
|
|
3
|
+
/**
|
|
4
|
+
* The rules a bundle flagged `metadata.claudePlugin` must meet to become a claude.ai plugin, and what the plugin holds
|
|
5
|
+
* when it does (ATK-538). One source for both readers of the registry: `@atk/claude-plugins` checks a registry
|
|
6
|
+
* checkout before it generates the plugins, and the API checks its snapshot before a flagged bundle's publish
|
|
7
|
+
* (ATK-747). Every problem names the bundle and the asset. No I/O and no `node:path`, since the CLI vendors this
|
|
8
|
+
* package: the {@link ClaudePluginRegistry} reads, and paths are compared as plain strings.
|
|
9
|
+
*/
|
|
10
|
+
/** The asset types a plugin can hold, and their directories under `assets/`. */
|
|
11
|
+
export const CLAUDE_PLUGIN_TYPE_DIRS = { 'mcp-config': 'mcp-configs', skill: 'skills' };
|
|
12
|
+
const PLACEHOLDER = /\$\{[^}]*\}/;
|
|
13
|
+
// The registry's asset and bundle names (apps/api/src/publish/plan-builder.ts): they become directory names.
|
|
14
|
+
const NAME = /^[a-z][a-z0-9-]*$/;
|
|
15
|
+
/** True when the bundle asks to become a claude.ai plugin. */
|
|
16
|
+
export function isClaudePlugin(bundle) {
|
|
17
|
+
return bundle.metadata?.['claudePlugin'] === true;
|
|
18
|
+
}
|
|
19
|
+
/** Checks the bundle against the plugin rules; `org` is its scope (the bundle's own, or its `bundles/@<org>/` directory). */
|
|
20
|
+
export async function resolveClaudePlugin(bundle, { org }, registry) {
|
|
21
|
+
const problems = [];
|
|
22
|
+
const prefix = `bundle ${bundle.name}@${bundle.version}`;
|
|
23
|
+
if (org !== undefined) {
|
|
24
|
+
problems.push({ message: `${prefix}: is org-scoped (@${org}); every staff member can read the plugins repo` });
|
|
25
|
+
}
|
|
26
|
+
if (!NAME.test(bundle.name)) {
|
|
27
|
+
problems.push({ message: `${prefix}: isn't a kebab-case name, so it can't name a plugin` });
|
|
28
|
+
}
|
|
29
|
+
const skills = [];
|
|
30
|
+
const mcpServers = new Map();
|
|
31
|
+
for (const [asset, ref] of bundle.assets.entries()) {
|
|
32
|
+
const label = `${ref.type} "${ref.name}"${ref.version === undefined ? '' : `@${ref.version}`}`;
|
|
33
|
+
const fail = (message) => problems.push({ asset, message: `${prefix}: ${label} ${message}` });
|
|
34
|
+
if (!NAME.test(ref.name)) {
|
|
35
|
+
fail(`isn't a kebab-case name`);
|
|
36
|
+
continue;
|
|
37
|
+
}
|
|
38
|
+
if (ref.org !== undefined) {
|
|
39
|
+
fail(`is org-scoped (@${ref.org}); every staff member can read the plugins repo`);
|
|
40
|
+
continue;
|
|
41
|
+
}
|
|
42
|
+
if (!isPluginType(ref.type)) {
|
|
43
|
+
fail(`can't be in a claude.ai plugin: only skill and mcp-config assets can`);
|
|
44
|
+
continue;
|
|
45
|
+
}
|
|
46
|
+
if (!isExact(ref.version)) {
|
|
47
|
+
fail(`isn't pinned to an exact version, so the plugin could change without a version bump`);
|
|
48
|
+
continue;
|
|
49
|
+
}
|
|
50
|
+
const { name } = ref;
|
|
51
|
+
const type = ref.type;
|
|
52
|
+
const version = ref.version;
|
|
53
|
+
const manifest = await registry.manifest(type, name, version);
|
|
54
|
+
if (manifest === undefined) {
|
|
55
|
+
fail(`isn't in the registry (no assets/${CLAUDE_PLUGIN_TYPE_DIRS[type]}/${name}/${version})`);
|
|
56
|
+
continue;
|
|
57
|
+
}
|
|
58
|
+
if (manifest.org !== undefined) {
|
|
59
|
+
fail(`is org-scoped (@${manifest.org}); every staff member can read the plugins repo`);
|
|
60
|
+
continue;
|
|
61
|
+
}
|
|
62
|
+
for (const message of dependencyProblems(manifest, bundle.assets))
|
|
63
|
+
fail(message);
|
|
64
|
+
if (manifest.files === 'auto') {
|
|
65
|
+
fail(`lists its files as "auto"; a published manifest lists them`);
|
|
66
|
+
continue;
|
|
67
|
+
}
|
|
68
|
+
const entrypoint = manifest.entrypoint ?? (await defaultEntrypoint(registry, type, name, version));
|
|
69
|
+
// The entrypoint is placed as SKILL.md, so a `files` entry naming it again would be a second copy.
|
|
70
|
+
const files = (manifest.files ?? []).filter((file) => normalize(file) !== normalize(entrypoint));
|
|
71
|
+
const outside = [entrypoint, ...files].filter((file) => !isInside(file));
|
|
72
|
+
if (outside.length > 0) {
|
|
73
|
+
fail(`lists files outside its directory: ${outside.join(', ')}`);
|
|
74
|
+
continue;
|
|
75
|
+
}
|
|
76
|
+
if (type === 'skill') {
|
|
77
|
+
const missing = [];
|
|
78
|
+
for (const file of [entrypoint, ...files]) {
|
|
79
|
+
if (!(await registry.isFile(type, name, version, normalize(file))))
|
|
80
|
+
missing.push(file);
|
|
81
|
+
}
|
|
82
|
+
if (missing.length > 0) {
|
|
83
|
+
fail(`lists files the registry doesn't have: ${missing.join(', ')}`);
|
|
84
|
+
continue;
|
|
85
|
+
}
|
|
86
|
+
if (files.some((file) => normalize(file).toLowerCase() === 'skill.md')) {
|
|
87
|
+
fail(`lists a SKILL.md besides its entrypoint ${entrypoint}, which the plugin places as SKILL.md`);
|
|
88
|
+
continue;
|
|
89
|
+
}
|
|
90
|
+
// Normalized, as the registry was asked for them, so the plugin copies the files the check found.
|
|
91
|
+
skills.push({ entrypoint: normalize(entrypoint), files: files.map(normalize), name, version });
|
|
92
|
+
continue;
|
|
93
|
+
}
|
|
94
|
+
const servers = parseServers(await registry.readText(type, name, version, normalize(entrypoint)), entrypoint);
|
|
95
|
+
if (typeof servers === 'string') {
|
|
96
|
+
fail(servers);
|
|
97
|
+
continue;
|
|
98
|
+
}
|
|
99
|
+
for (const [server, config] of servers) {
|
|
100
|
+
for (const message of serverProblems(config))
|
|
101
|
+
fail(`server "${server}" ${message}`);
|
|
102
|
+
if (mcpServers.has(server))
|
|
103
|
+
fail(`server "${server}" is also in another mcp-config of the bundle`);
|
|
104
|
+
mcpServers.set(server, config);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
return problems.length > 0
|
|
108
|
+
? { problems }
|
|
109
|
+
: { plugin: { mcpServers: Object.fromEntries(mcpServers), skills }, problems: [] };
|
|
110
|
+
}
|
|
111
|
+
// An mcp-config's manifest may leave out its entrypoint: then it is the file the CLI takes for one
|
|
112
|
+
// (apps/cli/src/lib/adapter.ts isEntrypoint). A skill's manifest must name it.
|
|
113
|
+
async function defaultEntrypoint(registry, type, name, version) {
|
|
114
|
+
if (type === 'skill')
|
|
115
|
+
return 'SKILL.md';
|
|
116
|
+
const names = (await registry.listFiles(type, name, version)).sort();
|
|
117
|
+
return names.find((name) => /^(mcp-config|config|index)\.json$/i.test(name)) ?? 'config.json';
|
|
118
|
+
}
|
|
119
|
+
// Each dependency must be in the bundle, pinned: a semver range the bundle doesn't pin would change the plugin
|
|
120
|
+
// without a version bump, and users wouldn't get it. A dependency's own dependencies are checked as its bundle entry.
|
|
121
|
+
function dependencyProblems(manifest, refs) {
|
|
122
|
+
return (manifest.dependencies ?? []).flatMap((dep) => {
|
|
123
|
+
const pinned = refs.find((ref) => ref.name === dep.name && ref.type === dep.type);
|
|
124
|
+
const name = `dependency ${dep.type} "${dep.name}"${dep.version === undefined ? '' : ` (${dep.version})`}`;
|
|
125
|
+
if (pinned === undefined || !isExact(pinned.version)) {
|
|
126
|
+
return [`has ${name}, which the bundle doesn't list with an exact version`];
|
|
127
|
+
}
|
|
128
|
+
if (dep.version !== undefined && !satisfies(pinned.version, dep.version)) {
|
|
129
|
+
return [`has ${name}, which the bundle's ${pinned.version} doesn't satisfy`];
|
|
130
|
+
}
|
|
131
|
+
return [];
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
function isExact(version) {
|
|
135
|
+
return version !== undefined && valid(version) === version;
|
|
136
|
+
}
|
|
137
|
+
function isInside(file) {
|
|
138
|
+
const normal = normalize(file);
|
|
139
|
+
return !normal.startsWith('/') && normal !== '..' && !normal.startsWith('../');
|
|
140
|
+
}
|
|
141
|
+
function isPluginType(type) {
|
|
142
|
+
return Object.hasOwn(CLAUDE_PLUGIN_TYPE_DIRS, type);
|
|
143
|
+
}
|
|
144
|
+
function isRecord(value) {
|
|
145
|
+
return typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
146
|
+
}
|
|
147
|
+
/** `path.posix.normalize` after turning backslashes into slashes, for comparing relative paths. */
|
|
148
|
+
function normalize(file) {
|
|
149
|
+
const slashed = file.replaceAll('\\', '/');
|
|
150
|
+
const absolute = slashed.startsWith('/');
|
|
151
|
+
const segments = [];
|
|
152
|
+
for (const segment of slashed.split('/')) {
|
|
153
|
+
if (segment === '' || segment === '.')
|
|
154
|
+
continue;
|
|
155
|
+
if (segment !== '..')
|
|
156
|
+
segments.push(segment);
|
|
157
|
+
else if (segments.length > 0 && segments.at(-1) !== '..')
|
|
158
|
+
segments.pop();
|
|
159
|
+
else if (!absolute)
|
|
160
|
+
segments.push(segment);
|
|
161
|
+
}
|
|
162
|
+
const joined = segments.join('/');
|
|
163
|
+
const normal = absolute ? `/${joined}` : joined || '.';
|
|
164
|
+
return slashed.endsWith('/') && joined !== '' ? `${normal}/` : normal;
|
|
165
|
+
}
|
|
166
|
+
function parseServers(text, entrypoint) {
|
|
167
|
+
if (text === undefined)
|
|
168
|
+
return `has no ${entrypoint}`;
|
|
169
|
+
let config;
|
|
170
|
+
try {
|
|
171
|
+
config = JSON.parse(text);
|
|
172
|
+
}
|
|
173
|
+
catch {
|
|
174
|
+
return `has a ${entrypoint} that isn't JSON`;
|
|
175
|
+
}
|
|
176
|
+
const servers = isRecord(config) ? config['mcpServers'] : undefined;
|
|
177
|
+
const entries = isRecord(servers) ? Object.entries(servers) : [];
|
|
178
|
+
const valid = entries.filter((entry) => isRecord(entry[1]));
|
|
179
|
+
if (entries.length === 0 || valid.length < entries.length)
|
|
180
|
+
return `has no mcpServers in ${entrypoint}`;
|
|
181
|
+
return valid;
|
|
182
|
+
}
|
|
183
|
+
// Chat runs remote servers only, and can't fill environment variables.
|
|
184
|
+
function serverProblems(server) {
|
|
185
|
+
const problems = [];
|
|
186
|
+
const { headers, type, url } = server;
|
|
187
|
+
if (type !== 'http' && type !== 'sse') {
|
|
188
|
+
const kind = type === undefined ? 'has no type, so it is stdio' : `is ${JSON.stringify(type)}`;
|
|
189
|
+
problems.push(`${kind}; claude.ai runs only http and sse servers`);
|
|
190
|
+
}
|
|
191
|
+
if (typeof url !== 'string')
|
|
192
|
+
problems.push(`has no url`);
|
|
193
|
+
const values = [url, ...(isRecord(headers) ? Object.values(headers) : [])];
|
|
194
|
+
if (values.some((value) => typeof value === 'string' && PLACEHOLDER.test(value))) {
|
|
195
|
+
problems.push(`has a \${…} placeholder in its url or headers, which claude.ai can't fill`);
|
|
196
|
+
}
|
|
197
|
+
return problems;
|
|
198
|
+
}
|
|
199
|
+
//# sourceMappingURL=claude-plugin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"claude-plugin.js","sourceRoot":"","sources":["../../../src/lib/atk-schemas/claude-plugin.ts"],"names":[],"mappings":"AAAA,mEAAmE;AACnE,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAK1C;;;;;;GAMG;AAEH,gFAAgF;AAChF,MAAM,CAAC,MAAM,uBAAuB,GAAG,EAAE,YAAY,EAAE,aAAa,EAAE,KAAK,EAAE,QAAQ,EAAW,CAAC;AAqCjG,MAAM,WAAW,GAAG,aAAa,CAAC;AAClC,6GAA6G;AAC7G,MAAM,IAAI,GAAG,mBAAmB,CAAC;AAEjC,8DAA8D;AAC9D,MAAM,UAAU,cAAc,CAAC,MAAgC;IAC7D,OAAO,MAAM,CAAC,QAAQ,EAAE,CAAC,cAAc,CAAC,KAAK,IAAI,CAAC;AACpD,CAAC;AAED,6HAA6H;AAC7H,MAAM,CAAC,KAAK,UAAU,mBAAmB,CACvC,MAAmD,EACnD,EAAE,GAAG,EAA+B,EACpC,QAA8B;IAE9B,MAAM,QAAQ,GAA0B,EAAE,CAAC;IAC3C,MAAM,MAAM,GAAG,UAAU,MAAM,CAAC,IAAI,IAAI,MAAM,CAAC,OAAO,EAAE,CAAC;IACzD,IAAI,GAAG,KAAK,SAAS,EAAE,CAAC;QACtB,QAAQ,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,GAAG,MAAM,qBAAqB,GAAG,iDAAiD,EAAE,CAAC,CAAC;IACjH,CAAC;IACD,I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IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,6BAA6B,CAAC,CAAC,CAAC,MAAM,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,CAAC;QAC/F,QAAQ,CAAC,IAAI,CAAC,GAAG,IAAI,4CAA4C,CAAC,CAAC;IACrE,CAAC;IACD,IAAI,OAAO,GAAG,KAAK,QAAQ;QAAE,QAAQ,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;IACzD,MAAM,MAAM,GAAG,CAAC,GAAG,EAAE,GAAG,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IAC3E,IAAI,MAAM,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,OAAO,KAAK,KAAK,QAAQ,IAAI,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC;QACjF,QAAQ,CAAC,IAAI,CAAC,2EAA2E,CAAC,CAAC;IAC7F,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC"}
|
|
@@ -8,12 +8,15 @@
|
|
|
8
8
|
* - The CLI vendors them (`pnpm sync-cli` → apps/cli/src/lib/atk-schemas/) and
|
|
9
9
|
* re-exports them from its schemas barrel, so `scripts/export-schemas.ts` (and
|
|
10
10
|
* through it the .NET API's vendored JSON Schemas) still exports them.
|
|
11
|
+
* - `resolveClaudePlugin` is the claude.ai plugin rules, which `@atk/claude-plugins`
|
|
12
|
+
* and the API's bundle publish both apply (ATK-747).
|
|
11
13
|
* - `withoutNullOptionals` (and `withNullOptionalsAsAbsent`, a schema that
|
|
12
14
|
* applies it) is how the API, the API client and the CLI read a published
|
|
13
15
|
* registry file (`registry.json`, `bundle.json`, an asset's `manifest.json`):
|
|
14
16
|
* a `null` optional object property reads as absent.
|
|
15
17
|
*/
|
|
16
18
|
export { type Bundle, BundleAssetRef, BundleSchema } from './bundle.ts';
|
|
19
|
+
export { CLAUDE_PLUGIN_TYPE_DIRS, type ClaudePlugin, type ClaudePluginAssetType, type ClaudePluginProblem, type ClaudePluginRegistry, type ClaudePluginSkill, isClaudePlugin, resolveClaudePlugin, type ResolvedClaudePlugin, } from './claude-plugin.ts';
|
|
17
20
|
export { AssetDependency, AssetType as AssetTypeSchema, HookConfig, HookEventBinding, type Manifest, ManifestSchema, SecurityBlock, } from './manifest.ts';
|
|
18
21
|
export { withNullOptionalsAsAbsent, withoutNullOptionals } from './null-optionals.ts';
|
|
19
22
|
export { DeprecatedEntry, type Registry, RegistryAsset, type RegistryAssetVersion, RegistryAssetVersionSchema, type RegistryAssetVersionsMap, RegistryAssetVersionsMapSchema, RegistryBundle, RegistrySchema, } from './registry.ts';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/atk-schemas/index.ts"],"names":[],"mappings":"AACA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/atk-schemas/index.ts"],"names":[],"mappings":"AACA;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,EAAE,KAAK,MAAM,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AACxE,OAAO,EACL,uBAAuB,EACvB,KAAK,YAAY,EACjB,KAAK,qBAAqB,EAC1B,KAAK,mBAAmB,EACxB,KAAK,oBAAoB,EACzB,KAAK,iBAAiB,EACtB,cAAc,EACd,mBAAmB,EACnB,KAAK,oBAAoB,GAC1B,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,eAAe,EACf,SAAS,IAAI,eAAe,EAC5B,UAAU,EACV,gBAAgB,EAChB,KAAK,QAAQ,EACb,cAAc,EACd,aAAa,GACd,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,yBAAyB,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AACtF,OAAO,EACL,eAAe,EACf,KAAK,QAAQ,EACb,aAAa,EACb,KAAK,oBAAoB,EACzB,0BAA0B,EAC1B,KAAK,wBAAwB,EAC7B,8BAA8B,EAC9B,cAAc,EACd,cAAc,GACf,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC"}
|
|
@@ -9,12 +9,15 @@
|
|
|
9
9
|
* - The CLI vendors them (`pnpm sync-cli` → apps/cli/src/lib/atk-schemas/) and
|
|
10
10
|
* re-exports them from its schemas barrel, so `scripts/export-schemas.ts` (and
|
|
11
11
|
* through it the .NET API's vendored JSON Schemas) still exports them.
|
|
12
|
+
* - `resolveClaudePlugin` is the claude.ai plugin rules, which `@atk/claude-plugins`
|
|
13
|
+
* and the API's bundle publish both apply (ATK-747).
|
|
12
14
|
* - `withoutNullOptionals` (and `withNullOptionalsAsAbsent`, a schema that
|
|
13
15
|
* applies it) is how the API, the API client and the CLI read a published
|
|
14
16
|
* registry file (`registry.json`, `bundle.json`, an asset's `manifest.json`):
|
|
15
17
|
* a `null` optional object property reads as absent.
|
|
16
18
|
*/
|
|
17
19
|
export { BundleAssetRef, BundleSchema } from "./bundle.js";
|
|
20
|
+
export { CLAUDE_PLUGIN_TYPE_DIRS, isClaudePlugin, resolveClaudePlugin, } from "./claude-plugin.js";
|
|
18
21
|
export { AssetDependency, AssetType as AssetTypeSchema, HookConfig, HookEventBinding, ManifestSchema, SecurityBlock, } from "./manifest.js";
|
|
19
22
|
export { withNullOptionalsAsAbsent, withoutNullOptionals } from "./null-optionals.js";
|
|
20
23
|
export { DeprecatedEntry, RegistryAsset, RegistryAssetVersionSchema, RegistryAssetVersionsMapSchema, RegistryBundle, RegistrySchema, } from "./registry.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/lib/atk-schemas/index.ts"],"names":[],"mappings":"AAAA,mEAAmE;AACnE
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/lib/atk-schemas/index.ts"],"names":[],"mappings":"AAAA,mEAAmE;AACnE;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,EAAe,cAAc,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AACxE,OAAO,EACL,uBAAuB,EAMvB,cAAc,EACd,mBAAmB,GAEpB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,eAAe,EACf,SAAS,IAAI,eAAe,EAC5B,UAAU,EACV,gBAAgB,EAEhB,cAAc,EACd,aAAa,GACd,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,yBAAyB,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AACtF,OAAO,EACL,eAAe,EAEf,aAAa,EAEb,0BAA0B,EAE1B,8BAA8B,EAC9B,cAAc,EACd,cAAc,GACf,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC"}
|
|
@@ -3,15 +3,27 @@ import type { RegistryAsset } from './schemas/index.js';
|
|
|
3
3
|
import type { InstalledAsset, InstalledFile } from './schemas/lockfile.js';
|
|
4
4
|
import { type Scope } from './scope.js';
|
|
5
5
|
export type DiffOutcome = {
|
|
6
|
+
/** The registry version the installed files were compared with. */
|
|
7
|
+
comparedVersion: string;
|
|
6
8
|
diffs: FileDiffEntry[];
|
|
7
9
|
installed: InstalledAsset;
|
|
8
10
|
latestVersion: string;
|
|
9
11
|
name: string;
|
|
10
12
|
outcome: 'results';
|
|
11
13
|
registryAsset: RegistryAsset;
|
|
14
|
+
/** Whether the installed version is the latest. */
|
|
12
15
|
sameVersion: boolean;
|
|
13
16
|
/** The scope the asset is installed in, for the update command. */
|
|
14
17
|
scope: Scope;
|
|
18
|
+
target: DiffTarget['kind'];
|
|
19
|
+
} | {
|
|
20
|
+
availableVersions: string[];
|
|
21
|
+
name: string;
|
|
22
|
+
outcome: 'version-not-found';
|
|
23
|
+
/** The scope the asset is installed in, for the update command. */
|
|
24
|
+
scope: Scope;
|
|
25
|
+
target: DiffTarget['kind'];
|
|
26
|
+
version: string;
|
|
15
27
|
} | {
|
|
16
28
|
name: string;
|
|
17
29
|
outcome: 'not-in-registry';
|
|
@@ -19,6 +31,18 @@ export type DiffOutcome = {
|
|
|
19
31
|
name: string;
|
|
20
32
|
outcome: 'not-installed';
|
|
21
33
|
};
|
|
34
|
+
/**
|
|
35
|
+
* What `atk diff` compares the installed files with: the latest version, a version (exact,
|
|
36
|
+
* range or `latest`, as `atk install` takes it), or the version the lockfile records.
|
|
37
|
+
*/
|
|
38
|
+
export type DiffTarget = {
|
|
39
|
+
kind: 'installed';
|
|
40
|
+
} | {
|
|
41
|
+
kind: 'latest';
|
|
42
|
+
} | {
|
|
43
|
+
kind: 'version';
|
|
44
|
+
version: string;
|
|
45
|
+
};
|
|
22
46
|
/** Describes a file to fetch for diff comparison, with its installed and remote paths. */
|
|
23
47
|
export interface FileFetchEntry {
|
|
24
48
|
file: InstalledFile;
|
|
@@ -27,9 +51,10 @@ export interface FileFetchEntry {
|
|
|
27
51
|
}
|
|
28
52
|
/**
|
|
29
53
|
* Core logic for the `atk diff` command. Computes the diff between a locally
|
|
30
|
-
* installed asset and
|
|
54
|
+
* installed asset and a version in the registry, the latest unless `target` names another.
|
|
31
55
|
*
|
|
32
56
|
* @param name - Asset name (without org prefix)
|
|
57
|
+
* @param target - The registry version to compare with
|
|
33
58
|
* @param org - Org from the --org CLI flag or inline @org/name syntax (already merged)
|
|
34
59
|
* @param tool - Tool override from --tool CLI flag
|
|
35
60
|
* @param context - Number of context lines for unified diff output
|
|
@@ -40,5 +65,5 @@ export interface FileFetchEntry {
|
|
|
40
65
|
* @param inlineOrg - Org parsed from @org/name syntax
|
|
41
66
|
* @param progress - Callback to report progress messages to the UI
|
|
42
67
|
*/
|
|
43
|
-
export declare function computeDiffOutcome(name: string, org: string | undefined, tool: string | undefined, context: number, refresh: boolean, projectRoot: string | undefined, user: boolean | undefined, cliOrg: string | undefined, inlineOrg: string | undefined, progress: (message: string) => void): Promise<DiffOutcome>;
|
|
68
|
+
export declare function computeDiffOutcome(name: string, target: DiffTarget, org: string | undefined, tool: string | undefined, context: number, refresh: boolean, projectRoot: string | undefined, user: boolean | undefined, cliOrg: string | undefined, inlineOrg: string | undefined, progress: (message: string) => void): Promise<DiffOutcome>;
|
|
44
69
|
//# sourceMappingURL=diff-command.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"diff-command.d.ts","sourceRoot":"","sources":["../../src/lib/diff-command.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,KAAK,EAAY,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAClE,OAAO,KAAK,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"diff-command.d.ts","sourceRoot":"","sources":["../../src/lib/diff-command.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,KAAK,EAAY,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAClE,OAAO,KAAK,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAsB3E,OAAO,EAAgB,KAAK,KAAK,EAAiB,MAAM,YAAY,CAAC;AAGrE,MAAM,MAAM,WAAW,GACnB;IACE,mEAAmE;IACnE,eAAe,EAAE,MAAM,CAAC;IACxB,KAAK,EAAE,aAAa,EAAE,CAAC;IACvB,SAAS,EAAE,cAAc,CAAC;IAC1B,aAAa,EAAE,MAAM,CAAC;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,SAAS,CAAC;IACnB,aAAa,EAAE,aAAa,CAAC;IAC7B,mDAAmD;IACnD,WAAW,EAAE,OAAO,CAAC;IACrB,mEAAmE;IACnE,KAAK,EAAE,KAAK,CAAC;IACb,MAAM,EAAE,UAAU,CAAC,MAAM,CAAC,CAAC;CAC5B,G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ovedFileDiff, computeUnifiedDiff } from
|
|
|
7
7
|
import { errorGuidance, errorMessage } from './errors.js';
|
|
8
8
|
import { findInstalledAssetWithFallback, readLockfile } from './lockfile.js';
|
|
9
9
|
import { resolveActiveOrg, scopeSwitchGuidance } from './org.js';
|
|
10
|
-
import { fetchAssetFileBytes, fetchRegistry, findAsset, listAssetFiles, RegistryError, versionTools, } from './registry.js';
|
|
10
|
+
import { fetchAssetFileBytes, fetchRegistry, findAsset, getSortedVersions, listAssetFiles, RegistryError, resolveAssetVersion, versionTools, } from './registry.js';
|
|
11
11
|
import { fromRoot } from './root-path.js';
|
|
12
12
|
import { resolveScope, scopedCommand } from './scope.js';
|
|
13
13
|
import { resolveTool } from './tool-resolver.js';
|
|
14
14
|
/**
|
|
15
15
|
* Core logic for the `atk diff` command. Computes the diff between a locally
|
|
16
|
-
* installed asset and
|
|
16
|
+
* installed asset and a version in the registry, the latest unless `target` names another.
|
|
17
17
|
*
|
|
18
18
|
* @param name - Asset name (without org prefix)
|
|
19
|
+
* @param target - The registry version to compare with
|
|
19
20
|
* @param org - Org from the --org CLI flag or inline @org/name syntax (already merged)
|
|
20
21
|
* @param tool - Tool override from --tool CLI flag
|
|
21
22
|
* @param context - Number of context lines for unified diff output
|
|
@@ -26,7 +27,7 @@ import { resolveTool } from './tool-resolver.js';
|
|
|
26
27
|
* @param inlineOrg - Org parsed from @org/name syntax
|
|
27
28
|
* @param progress - Callback to report progress messages to the UI
|
|
28
29
|
*/
|
|
29
|
-
export async function computeDiffOutcome(name, org, tool, context, refresh, projectRoot, user, cliOrg, inlineOrg, progress) {
|
|
30
|
+
export async function computeDiffOutcome(name, target, org, tool, context, refresh, projectRoot, user, cliOrg, inlineOrg, progress) {
|
|
30
31
|
const { root: projectDir, scope } = await resolveScope({ projectRoot, user });
|
|
31
32
|
progress('Loading configuration...');
|
|
32
33
|
const config = await loadConfig();
|
|
@@ -67,11 +68,29 @@ export async function computeDiffOutcome(name, org, tool, context, refresh, proj
|
|
|
67
68
|
throw Object.assign(new Error(message), guidance);
|
|
68
69
|
}
|
|
69
70
|
const { asset: registryAsset, version: latestVersion } = foundAsset;
|
|
70
|
-
|
|
71
|
+
let comparedVersion = latestVersion;
|
|
72
|
+
const requested = requestedVersion(target, installed);
|
|
73
|
+
if (requested !== undefined) {
|
|
74
|
+
// The locked version too: it may have been unpublished since it was installed.
|
|
75
|
+
const resolvedTarget = resolveAssetVersion(registryAsset, requested);
|
|
76
|
+
if (!resolvedTarget) {
|
|
77
|
+
const { versions: availableVersions } = getSortedVersions(registryAsset);
|
|
78
|
+
return {
|
|
79
|
+
availableVersions,
|
|
80
|
+
name,
|
|
81
|
+
outcome: 'version-not-found',
|
|
82
|
+
scope,
|
|
83
|
+
target: target.kind,
|
|
84
|
+
version: requested,
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
comparedVersion = resolvedTarget.version;
|
|
88
|
+
}
|
|
89
|
+
progress(`Fetching v${comparedVersion}...`);
|
|
71
90
|
const assetRef = { name: registryAsset.name, org: registryAsset.org, type: registryAsset.type };
|
|
72
91
|
let remoteFilesList;
|
|
73
92
|
try {
|
|
74
|
-
remoteFilesList = await listAssetFiles(assetRef,
|
|
93
|
+
remoteFilesList = await listAssetFiles(assetRef, comparedVersion);
|
|
75
94
|
}
|
|
76
95
|
catch (error) {
|
|
77
96
|
throw new RegistryError(`Failed to list asset directory files for "${name}": ${errorMessage(error)}`, errorGuidance(error));
|
|
@@ -114,7 +133,7 @@ export async function computeDiffOutcome(name, org, tool, context, refresh, proj
|
|
|
114
133
|
filesToFetch.push({ file, installedPath, remotePath: remoteFile.relativePath });
|
|
115
134
|
}
|
|
116
135
|
// Fetch all remote file contents in parallel
|
|
117
|
-
const remoteContents = await Promise.all(filesToFetch.map(async ({ remotePath }) => fetchRemoteText(assetRef,
|
|
136
|
+
const remoteContents = await Promise.all(filesToFetch.map(async ({ remotePath }) => fetchRemoteText(assetRef, comparedVersion, remotePath)));
|
|
118
137
|
// Read all local file contents in parallel
|
|
119
138
|
const localContents = await Promise.all(filesToFetch.map(async ({ installedPath }) => readFile(fromRoot(projectDir, installedPath), 'utf-8')));
|
|
120
139
|
// Build diffs from fetched content
|
|
@@ -145,7 +164,7 @@ export async function computeDiffOutcome(name, org, tool, context, refresh, proj
|
|
|
145
164
|
// Collect added files (present in registry but not in installed files), then batch-fetch in parallel
|
|
146
165
|
const installedSourcePaths = new Set(installed.files.map((f) => f.sourcePath));
|
|
147
166
|
const addedRemoteFiles = [...remoteFiles.values()].filter((rf) => !installedSourcePaths.has(rf.relativePath));
|
|
148
|
-
const addedContents = await Promise.all(addedRemoteFiles.map(async (rf) => fetchRemoteText(assetRef,
|
|
167
|
+
const addedContents = await Promise.all(addedRemoteFiles.map(async (rf) => fetchRemoteText(assetRef, comparedVersion, rf.relativePath)));
|
|
149
168
|
for (let i = 0; i < addedRemoteFiles.length; i++) {
|
|
150
169
|
const remoteFile = addedRemoteFiles[i];
|
|
151
170
|
const remoteContent = addedContents[i];
|
|
@@ -153,6 +172,7 @@ export async function computeDiffOutcome(name, org, tool, context, refresh, proj
|
|
|
153
172
|
}
|
|
154
173
|
const sameVersion = installed.version === latestVersion;
|
|
155
174
|
return {
|
|
175
|
+
comparedVersion,
|
|
156
176
|
diffs,
|
|
157
177
|
installed,
|
|
158
178
|
latestVersion,
|
|
@@ -161,12 +181,24 @@ export async function computeDiffOutcome(name, org, tool, context, refresh, proj
|
|
|
161
181
|
registryAsset,
|
|
162
182
|
sameVersion,
|
|
163
183
|
scope,
|
|
184
|
+
target: target.kind,
|
|
164
185
|
};
|
|
165
186
|
}
|
|
166
187
|
/** Fetch one remote file and decode it as UTF-8 text for diffing. */
|
|
167
188
|
async function fetchRemoteText(ref, version, relativePath) {
|
|
168
189
|
return (await fetchAssetFileBytes(ref, version, relativePath)).toString('utf-8');
|
|
169
190
|
}
|
|
191
|
+
/** The version `target` asks for, or undefined for the latest. */
|
|
192
|
+
function requestedVersion(target, installed) {
|
|
193
|
+
switch (target.kind) {
|
|
194
|
+
case 'installed':
|
|
195
|
+
return installed.version;
|
|
196
|
+
case 'latest':
|
|
197
|
+
return undefined;
|
|
198
|
+
case 'version':
|
|
199
|
+
return target.version;
|
|
200
|
+
}
|
|
201
|
+
}
|
|
170
202
|
/**
|
|
171
203
|
* The error for diffing a hook marked undeclared for `tool` (`undeclaredTools`): the registry no
|
|
172
204
|
* longer has its locked version, the version doesn't declare the tool, or it now does, and
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"diff-command.js","sourceRoot":"","sources":["../../src/lib/diff-command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAM5C,OAAO,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AACtE,OAAO,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAC/F,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,oBAAoB,EAAE,sBAAsB,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAC7F,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC1D,OAAO,EAAE,8BAA8B,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7E,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AACjE,OAAO,EAEL,mBAAmB,EACnB,aAAa,EACb,SAAS,EACT,cAAc,EACd,aAAa,EAEb,YAAY,GACb,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,YAAY,EAAc,aAAa,EAAE,MAAM,YAAY,CAAC;AACrE,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"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