@lesliechan721/aw 0.1.0-beta.4 → 0.1.0-beta.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/authoring/scripts/lib/plugin-version-check.d.mts +14 -0
- package/dist/authoring/scripts/lib/plugin-version-check.mjs +10 -224
- package/dist/authoring/scripts/lib/plugin-version-check.mjs.map +1 -1
- package/dist/authoring/scripts/remove-plugin.d.mts +2 -0
- package/dist/authoring/scripts/remove-plugin.mjs +366 -0
- package/dist/authoring/scripts/remove-plugin.mjs.map +1 -0
- package/dist/authoring/scripts/validate-plugin.mjs +9 -46
- package/dist/authoring/scripts/validate-plugin.mjs.map +1 -1
- package/dist/scripts/bundle-plugins.d.ts +0 -2
- package/dist/scripts/bundle-plugins.js +4 -2
- package/dist/scripts/bundle-plugins.js.map +1 -1
- package/dist/scripts/plugin-staging.d.ts +1 -16
- package/dist/scripts/plugin-staging.js +8 -115
- package/dist/scripts/plugin-staging.js.map +1 -1
- package/dist/src/authoring/workspace-commands.d.ts +9 -1
- package/dist/src/authoring/workspace-commands.js +24 -16
- package/dist/src/authoring/workspace-commands.js.map +1 -1
- package/dist/src/commands/catalog-publication-inspection.d.ts +106 -0
- package/dist/src/commands/catalog-publication-inspection.js +444 -0
- package/dist/src/commands/catalog-publication-inspection.js.map +1 -0
- package/dist/src/commands/catalog-publish.d.ts +18 -2
- package/dist/src/commands/catalog-publish.js +261 -316
- package/dist/src/commands/catalog-publish.js.map +1 -1
- package/dist/src/commands/catalog-status.d.ts +60 -0
- package/dist/src/commands/catalog-status.js +251 -0
- package/dist/src/commands/catalog-status.js.map +1 -0
- package/dist/src/commands/plugin-capabilities.d.ts +22 -0
- package/dist/src/commands/plugin-capabilities.js +143 -0
- package/dist/src/commands/plugin-capabilities.js.map +1 -0
- package/dist/src/commands/rebuild-command.d.ts +2 -0
- package/dist/src/commands/rebuild-command.js +37 -6
- package/dist/src/commands/rebuild-command.js.map +1 -1
- package/dist/src/commands/rebuild-integration.d.ts +1 -0
- package/dist/src/commands/rebuild-integration.js +55 -57
- package/dist/src/commands/rebuild-integration.js.map +1 -1
- package/dist/src/commands/status-v4.d.ts +21 -0
- package/dist/src/commands/status-v4.js +63 -2
- package/dist/src/commands/status-v4.js.map +1 -1
- package/dist/src/index.js +79 -18
- package/dist/src/index.js.map +1 -1
- package/dist/src/tui/components.d.ts +70 -0
- package/dist/src/tui/components.js +149 -6
- package/dist/src/tui/components.js.map +1 -1
- package/dist/src/tui/console-app-v4.js +1660 -628
- package/dist/src/tui/console-app-v4.js.map +1 -1
- package/dist/src/tui/controller-runtime.d.ts +5 -1
- package/dist/src/tui/controller-runtime.js +184 -33
- package/dist/src/tui/controller-runtime.js.map +1 -1
- package/dist/src/tui/controller.d.ts +35 -2
- package/dist/src/tui/controller.js +300 -39
- package/dist/src/tui/controller.js.map +1 -1
- package/dist/src/tui/diagnostics.d.ts +31 -0
- package/dist/src/tui/diagnostics.js +71 -0
- package/dist/src/tui/diagnostics.js.map +1 -0
- package/dist/src/tui/index.d.ts +5 -3
- package/dist/src/tui/index.js +3 -1
- package/dist/src/tui/index.js.map +1 -1
- package/dist/src/tui/model.d.ts +33 -4
- package/dist/src/tui/model.js +252 -17
- package/dist/src/tui/model.js.map +1 -1
- package/dist/src/tui/router.d.ts +15 -9
- package/dist/src/tui/router.js +35 -0
- package/dist/src/tui/router.js.map +1 -1
- package/dist/src/tui/theme.d.ts +18 -10
- package/dist/src/tui/theme.js +18 -10
- package/dist/src/tui/theme.js.map +1 -1
- package/dist/src/tui/viewport.d.ts +20 -0
- package/dist/src/tui/viewport.js +29 -0
- package/dist/src/tui/viewport.js.map +1 -0
- package/dist/src/utils/catalog-runtime-projection.d.ts +1 -7
- package/dist/src/utils/catalog-runtime-projection.js +2 -62
- package/dist/src/utils/catalog-runtime-projection.js.map +1 -1
- package/dist/src/utils/catalog-source-cache.d.ts +12 -11
- package/dist/src/utils/catalog-source-cache.js +20 -0
- package/dist/src/utils/catalog-source-cache.js.map +1 -1
- package/dist/src/utils/dynamic-skill-tree.js +1 -1
- package/dist/src/utils/dynamic-skill-tree.js.map +1 -1
- package/dist/src/utils/git-catalog-provider.js +1 -1
- package/dist/src/utils/git-catalog-provider.js.map +1 -1
- package/dist/src/utils/manifest.d.ts +0 -1
- package/dist/src/utils/manifest.js +0 -1
- package/dist/src/utils/manifest.js.map +1 -1
- package/dist/src/utils/plugin-config.js +28 -30
- package/dist/src/utils/plugin-config.js.map +1 -1
- package/dist/src/utils/skill-validation.d.ts +1 -1
- package/dist/src/utils/skill-validation.js +1 -1
- package/dist/src/utils/skill-validation.js.map +1 -1
- package/dist/src/utils/state-paths.d.ts +1 -0
- package/dist/src/utils/state-paths.js +5 -0
- package/dist/src/utils/state-paths.js.map +1 -1
- package/package.json +3 -4
- package/dist/src/utils/plugin-authoring-capabilities.d.ts +0 -23
- package/dist/src/utils/plugin-authoring-capabilities.js +0 -37
- package/dist/src/utils/plugin-authoring-capabilities.js.map +0 -1
- package/dist/src/utils/plugin-authoring-capabilities.json +0 -92
- package/dist/src/utils/skill-frontmatter-capabilities.d.ts +0 -201
- package/dist/src/utils/skill-frontmatter-capabilities.js +0 -5
- package/dist/src/utils/skill-frontmatter-capabilities.js.map +0 -1
- package/dist/src/utils/skill-frontmatter-capabilities.json +0 -200
|
@@ -0,0 +1,444 @@
|
|
|
1
|
+
import crypto from 'node:crypto';
|
|
2
|
+
import { execFile } from 'node:child_process';
|
|
3
|
+
import os from 'node:os';
|
|
4
|
+
import path from 'node:path';
|
|
5
|
+
import { promisify } from 'node:util';
|
|
6
|
+
import fs from 'fs-extra';
|
|
7
|
+
import { preparePublishedCatalogWorkspace, readCatalogWorkspace, validatePublishedCatalogSnapshot, } from '@lesliechan721/aw-plugin-core';
|
|
8
|
+
import { bundleLocalPlugin, createCatalogRuntimeImportResolver } from '../../scripts/plugin-staging.js';
|
|
9
|
+
import { CLI_RESERVED_IMPORTS } from '../utils/manifest.js';
|
|
10
|
+
import { resolveCliPackageRoot } from '../utils/paths.js';
|
|
11
|
+
const execFileAsync = promisify(execFile);
|
|
12
|
+
const INHERITED_GIT_AUTH_ENV = new Set([
|
|
13
|
+
'GIT_ASKPASS',
|
|
14
|
+
'GIT_HTTP_USER_AGENT',
|
|
15
|
+
'GIT_SSH',
|
|
16
|
+
'GIT_SSH_COMMAND',
|
|
17
|
+
'GIT_SSH_VARIANT',
|
|
18
|
+
'GIT_SSL_CAINFO',
|
|
19
|
+
'GIT_SSL_NO_VERIFY',
|
|
20
|
+
'GIT_TERMINAL_PROMPT',
|
|
21
|
+
]);
|
|
22
|
+
export class CatalogPublicationInspectionError extends Error {
|
|
23
|
+
code;
|
|
24
|
+
constructor(code, message, options) {
|
|
25
|
+
super(message, options);
|
|
26
|
+
this.name = 'CatalogPublicationInspectionError';
|
|
27
|
+
this.code = code;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
function digest(value) {
|
|
31
|
+
return `sha256:${crypto.createHash('sha256').update(value).digest('hex')}`;
|
|
32
|
+
}
|
|
33
|
+
export function sanitizedGitEnvironment(source) {
|
|
34
|
+
return Object.fromEntries(Object.entries(source).filter(([key]) => !key.startsWith('GIT_') || INHERITED_GIT_AUTH_ENV.has(key)));
|
|
35
|
+
}
|
|
36
|
+
function directRemoteGitEnvironment(source) {
|
|
37
|
+
return {
|
|
38
|
+
...sanitizedGitEnvironment(source),
|
|
39
|
+
GIT_CONFIG_NOSYSTEM: '1',
|
|
40
|
+
GIT_CONFIG_GLOBAL: os.devNull,
|
|
41
|
+
GIT_ATTR_NOSYSTEM: '1',
|
|
42
|
+
GIT_TERMINAL_PROMPT: '0',
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
export function safeRemoteIdentity(value) {
|
|
46
|
+
if (/^[a-z][a-z\d+.-]*:\/\//iu.test(value)) {
|
|
47
|
+
try {
|
|
48
|
+
const url = new URL(value);
|
|
49
|
+
url.username = '';
|
|
50
|
+
url.password = '';
|
|
51
|
+
url.search = '';
|
|
52
|
+
url.hash = '';
|
|
53
|
+
return url.toString();
|
|
54
|
+
}
|
|
55
|
+
catch {
|
|
56
|
+
// Fall through to conservative display sanitization for malformed URLs.
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
const withoutQuery = value.split(/[?#]/u, 1)[0];
|
|
60
|
+
return withoutQuery
|
|
61
|
+
.replace(/^([^/@\s:]+):([^/@\s]+)@/u, '')
|
|
62
|
+
.replace(/^[^@\s]+@(?=[^:/\s]+[/:])/u, '');
|
|
63
|
+
}
|
|
64
|
+
function assertSafeRemoteUrl(value) {
|
|
65
|
+
if (value.trim() === '' || value !== value.trim() || /\s/u.test(value) || value.startsWith('-')) {
|
|
66
|
+
throw new CatalogPublicationInspectionError('remoteInvalid', 'Catalog remote URL is unsafe.');
|
|
67
|
+
}
|
|
68
|
+
if (/^[a-z][a-z\d+.-]*:\/\/[^/\s?#]*@/iu.test(value)) {
|
|
69
|
+
throw new CatalogPublicationInspectionError('remoteInvalid', 'Catalog remote URL must not contain embedded credentials.');
|
|
70
|
+
}
|
|
71
|
+
return value;
|
|
72
|
+
}
|
|
73
|
+
export function catalogAttemptPath(catalogWorkspaceRoot, catalogVersion) {
|
|
74
|
+
return path.join(catalogWorkspaceRoot, '.aw', 'publish', 'attempts', `${catalogVersion}.json`);
|
|
75
|
+
}
|
|
76
|
+
export async function publicationGit(cwd, args, env, code, label) {
|
|
77
|
+
try {
|
|
78
|
+
const result = await execFileAsync('git', [...args], {
|
|
79
|
+
cwd,
|
|
80
|
+
env,
|
|
81
|
+
encoding: 'utf8',
|
|
82
|
+
maxBuffer: 16 * 1024 * 1024,
|
|
83
|
+
});
|
|
84
|
+
return result.stdout.trim();
|
|
85
|
+
}
|
|
86
|
+
catch (error) {
|
|
87
|
+
throw new CatalogPublicationInspectionError(code, label, { cause: error });
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
export async function publicationGitExit(cwd, args, env) {
|
|
91
|
+
try {
|
|
92
|
+
await execFileAsync('git', [...args], { cwd, env, encoding: 'utf8' });
|
|
93
|
+
return true;
|
|
94
|
+
}
|
|
95
|
+
catch {
|
|
96
|
+
return false;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
export function parseRemoteRefs(output) {
|
|
100
|
+
return new Map(output.split('\n').filter(Boolean).map((line) => {
|
|
101
|
+
const [objectId, ref] = line.split(/\s+/u);
|
|
102
|
+
return [ref, objectId];
|
|
103
|
+
}));
|
|
104
|
+
}
|
|
105
|
+
export async function materializeSourceHead(options) {
|
|
106
|
+
const archivePath = path.join(options.temporaryRoot, 'source-head.tar');
|
|
107
|
+
await fs.ensureDir(options.outputRoot);
|
|
108
|
+
await publicationGit(options.repoRoot, [
|
|
109
|
+
'archive', '--format=tar', `--output=${archivePath}`, options.sourceHead,
|
|
110
|
+
], options.env, 'sourceArchiveFailed', 'Could not archive the committed source HEAD.');
|
|
111
|
+
const tarEnv = { ...options.env };
|
|
112
|
+
delete tarEnv.TAR_OPTIONS;
|
|
113
|
+
try {
|
|
114
|
+
await execFileAsync('tar', ['-xf', archivePath, '-C', options.outputRoot], {
|
|
115
|
+
env: tarEnv,
|
|
116
|
+
encoding: 'utf8',
|
|
117
|
+
maxBuffer: 16 * 1024 * 1024,
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
catch (error) {
|
|
121
|
+
throw new CatalogPublicationInspectionError('sourceArchiveFailed', 'Could not materialize the committed source HEAD.', { cause: error });
|
|
122
|
+
}
|
|
123
|
+
finally {
|
|
124
|
+
await fs.remove(archivePath);
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
export async function validateCatalogPublicationPlugins(catalogWorkspace, env) {
|
|
128
|
+
const validator = path.join(resolveCliPackageRoot(), 'dist', 'authoring', 'scripts', 'validate-plugin.mjs');
|
|
129
|
+
for (const plugin of catalogWorkspace.plugins) {
|
|
130
|
+
try {
|
|
131
|
+
await execFileAsync(process.execPath, [
|
|
132
|
+
validator,
|
|
133
|
+
plugin.rootDir,
|
|
134
|
+
'--workspace-root', catalogWorkspace.workspaceRoot,
|
|
135
|
+
'--json',
|
|
136
|
+
], {
|
|
137
|
+
cwd: catalogWorkspace.workspaceRoot,
|
|
138
|
+
env,
|
|
139
|
+
encoding: 'utf8',
|
|
140
|
+
maxBuffer: 16 * 1024 * 1024,
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
catch (error) {
|
|
144
|
+
let details = '';
|
|
145
|
+
if (typeof error === 'object' && error !== null && 'stdout' in error && typeof error.stdout === 'string') {
|
|
146
|
+
try {
|
|
147
|
+
const result = JSON.parse(error.stdout);
|
|
148
|
+
details = (result.errors ?? [])
|
|
149
|
+
.map((entry) => typeof entry.message === 'string' ? entry.message : '')
|
|
150
|
+
.filter(Boolean)
|
|
151
|
+
.join('; ');
|
|
152
|
+
}
|
|
153
|
+
catch {
|
|
154
|
+
// Keep the public validator failure bounded to its plugin identity.
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
throw new CatalogPublicationInspectionError('pluginValidationFailed', `Plugin ${plugin.manifest.name} failed public source validation before Catalog publication${details ? `: ${details}` : '.'}`);
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
const publicationBuildAdapter = {
|
|
162
|
+
async build(options) {
|
|
163
|
+
await bundleLocalPlugin(options.plugin, options.outputRoot, {
|
|
164
|
+
buildMode: 'staging',
|
|
165
|
+
runtimeResolver: createCatalogRuntimeImportResolver(options.plugins),
|
|
166
|
+
});
|
|
167
|
+
},
|
|
168
|
+
};
|
|
169
|
+
function inspectionError(code, error) {
|
|
170
|
+
if (error instanceof CatalogPublicationInspectionError)
|
|
171
|
+
return error;
|
|
172
|
+
return new CatalogPublicationInspectionError(code, error instanceof Error ? error.message : String(error), {
|
|
173
|
+
cause: error,
|
|
174
|
+
});
|
|
175
|
+
}
|
|
176
|
+
export async function prepareCatalogPublicationInspection(options) {
|
|
177
|
+
if (options.remote !== undefined && options.remoteUrl !== undefined) {
|
|
178
|
+
throw new CatalogPublicationInspectionError('remoteInvalid', 'Catalog publication accepts a configured remote name or a direct remote URL, not both.');
|
|
179
|
+
}
|
|
180
|
+
const remote = options.remote ?? (options.remoteUrl === undefined ? 'origin' : 'direct');
|
|
181
|
+
const branch = options.branch ?? 'catalog';
|
|
182
|
+
const env = options.remoteUrl === undefined
|
|
183
|
+
? sanitizedGitEnvironment(options.env)
|
|
184
|
+
: directRemoteGitEnvironment(options.env);
|
|
185
|
+
let temporaryRoot = '';
|
|
186
|
+
let fetchUrl = '';
|
|
187
|
+
let pushUrl = '';
|
|
188
|
+
let safeFetchUrl = '';
|
|
189
|
+
let safePushUrl = '';
|
|
190
|
+
try {
|
|
191
|
+
const catalogWorkspaceRoot = await fs.realpath(path.resolve(options.workspaceRoot));
|
|
192
|
+
const repoRoot = await publicationGit(catalogWorkspaceRoot, ['rev-parse', '--show-toplevel'], env, 'gitWorkspaceInvalid', 'Catalog Workspace must be inside a real Git worktree.');
|
|
193
|
+
const sourceHead = await publicationGit(repoRoot, ['rev-parse', '--verify', 'HEAD'], env, 'sourceHeadMissing', 'Catalog Workspace Git HEAD must be committed and not unborn.');
|
|
194
|
+
const status = await publicationGit(repoRoot, [
|
|
195
|
+
'status', '--porcelain=v1', '--untracked-files=all', '--ignore-submodules=none',
|
|
196
|
+
], env, 'sourceStatusFailed', 'Could not inspect the source worktree.');
|
|
197
|
+
if (status !== '') {
|
|
198
|
+
throw new CatalogPublicationInspectionError('sourceDirty', 'Catalog publish requires the complete source Git worktree to be clean.');
|
|
199
|
+
}
|
|
200
|
+
temporaryRoot = await fs.mkdtemp(path.join(os.tmpdir(), 'aw-public-catalog-'));
|
|
201
|
+
const sourceRoot = path.join(temporaryRoot, 'source');
|
|
202
|
+
await materializeSourceHead({ repoRoot, sourceHead, outputRoot: sourceRoot, temporaryRoot, env });
|
|
203
|
+
const catalogWorkspaceRelative = path.relative(repoRoot, catalogWorkspaceRoot);
|
|
204
|
+
if (catalogWorkspaceRelative === '..'
|
|
205
|
+
|| catalogWorkspaceRelative.startsWith(`..${path.sep}`)
|
|
206
|
+
|| path.isAbsolute(catalogWorkspaceRelative)) {
|
|
207
|
+
throw new CatalogPublicationInspectionError('workspaceOutsideRepository', 'Catalog Workspace must stay inside its Git worktree root.');
|
|
208
|
+
}
|
|
209
|
+
const archivedCatalogWorkspaceRoot = path.join(sourceRoot, catalogWorkspaceRelative);
|
|
210
|
+
await publicationGit(repoRoot, ['check-ref-format', '--branch', branch], env, 'branchInvalid', 'Invalid Catalog publication branch name.');
|
|
211
|
+
let catalogWorkspace;
|
|
212
|
+
try {
|
|
213
|
+
catalogWorkspace = await readCatalogWorkspace(archivedCatalogWorkspaceRoot, { reservedImports: CLI_RESERVED_IMPORTS });
|
|
214
|
+
}
|
|
215
|
+
catch (error) {
|
|
216
|
+
throw inspectionError('workspaceInvalid', error);
|
|
217
|
+
}
|
|
218
|
+
await validateCatalogPublicationPlugins(catalogWorkspace, env);
|
|
219
|
+
const catalogVersion = catalogWorkspace.metadata.catalog.version;
|
|
220
|
+
const tag = `catalog-v${catalogVersion}`;
|
|
221
|
+
await publicationGit(repoRoot, ['check-ref-format', `refs/tags/${tag}`], env, 'tagInvalid', 'Invalid Catalog publication tag.');
|
|
222
|
+
const attemptPath = catalogAttemptPath(catalogWorkspaceRoot, catalogVersion);
|
|
223
|
+
const attemptAvailable = !(await fs.pathExists(attemptPath));
|
|
224
|
+
if (!attemptAvailable && options.failOnUnavailable) {
|
|
225
|
+
throw new CatalogPublicationInspectionError('attemptUnavailable', `Catalog ${catalogVersion} already has an attempted publication record. Run aw catalog version <higher> before publishing again.`);
|
|
226
|
+
}
|
|
227
|
+
if (options.remoteUrl !== undefined) {
|
|
228
|
+
fetchUrl = assertSafeRemoteUrl(options.remoteUrl);
|
|
229
|
+
pushUrl = fetchUrl;
|
|
230
|
+
}
|
|
231
|
+
else {
|
|
232
|
+
fetchUrl = await publicationGit(repoRoot, ['remote', 'get-url', remote], env, 'remoteMissing', `Git remote ${JSON.stringify(remote)} is not configured.`);
|
|
233
|
+
pushUrl = await publicationGit(repoRoot, ['remote', 'get-url', '--push', remote], env, 'remoteMissing', `Git remote ${JSON.stringify(remote)} has no push URL.`);
|
|
234
|
+
}
|
|
235
|
+
safeFetchUrl = safeRemoteIdentity(fetchUrl);
|
|
236
|
+
safePushUrl = safeRemoteIdentity(pushUrl);
|
|
237
|
+
const remoteIdentityDigest = digest(JSON.stringify({ fetchUrl, pushUrl }));
|
|
238
|
+
const branchRef = `refs/heads/${branch}`;
|
|
239
|
+
const tagRef = `refs/tags/${tag}`;
|
|
240
|
+
const repositoryRoot = path.join(temporaryRoot, 'repository');
|
|
241
|
+
await fs.ensureDir(repositoryRoot);
|
|
242
|
+
await publicationGit(repositoryRoot, ['init', '--quiet'], env, 'temporaryRepositoryFailed', 'Could not create the isolated publication repository.');
|
|
243
|
+
await publicationGit(repositoryRoot, ['config', 'core.hooksPath', path.join(temporaryRoot, 'disabled-hooks')], env, 'temporaryRepositoryFailed', 'Could not disable publication hooks.');
|
|
244
|
+
await publicationGit(repositoryRoot, ['config', 'core.symlinks', 'true'], env, 'temporaryRepositoryFailed', 'Could not configure the isolated publication repository.');
|
|
245
|
+
await publicationGit(repositoryRoot, ['remote', 'add', 'publish', pushUrl], env, 'temporaryRepositoryFailed', 'Could not configure the publication remote.');
|
|
246
|
+
const initialRefs = parseRemoteRefs(await publicationGit(repositoryRoot, [
|
|
247
|
+
'ls-remote', 'publish', branchRef, tagRef, `${tagRef}^{}`,
|
|
248
|
+
], env, 'remoteReadFailed', 'Could not inspect the Catalog publication remote.'));
|
|
249
|
+
const tagAvailable = !initialRefs.has(tagRef) && !initialRefs.has(`${tagRef}^{}`);
|
|
250
|
+
if (!tagAvailable && options.failOnUnavailable) {
|
|
251
|
+
throw new CatalogPublicationInspectionError('tagUnavailable', `Remote Catalog tag ${tag} already exists. Increase the Catalog version.`);
|
|
252
|
+
}
|
|
253
|
+
const parent = initialRefs.get(branchRef) ?? null;
|
|
254
|
+
let previousSnapshotRoot;
|
|
255
|
+
let publishedVersion = null;
|
|
256
|
+
if (parent) {
|
|
257
|
+
await publicationGit(repositoryRoot, [
|
|
258
|
+
'fetch', '--quiet', '--no-tags', 'publish', `${branchRef}:refs/aw/catalog-parent`,
|
|
259
|
+
], env, 'remoteBranchInvalid', 'Could not fetch the published Catalog branch.');
|
|
260
|
+
previousSnapshotRoot = path.join(temporaryRoot, 'previous');
|
|
261
|
+
await fs.ensureDir(previousSnapshotRoot);
|
|
262
|
+
await publicationGit(repositoryRoot, [
|
|
263
|
+
'--work-tree', previousSnapshotRoot, 'checkout', '--quiet', 'refs/aw/catalog-parent', '--', '.',
|
|
264
|
+
], env, 'remoteBranchInvalid', 'Could not read the published Catalog snapshot.');
|
|
265
|
+
try {
|
|
266
|
+
const previous = await validatePublishedCatalogSnapshot(previousSnapshotRoot);
|
|
267
|
+
publishedVersion = previous.manifest.catalogVersion;
|
|
268
|
+
}
|
|
269
|
+
catch (error) {
|
|
270
|
+
throw inspectionError('remoteSnapshotInvalid', error);
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
let prepared;
|
|
274
|
+
try {
|
|
275
|
+
prepared = await preparePublishedCatalogWorkspace({
|
|
276
|
+
workspaceRoot: archivedCatalogWorkspaceRoot,
|
|
277
|
+
sourceHead,
|
|
278
|
+
previousSnapshotRoot,
|
|
279
|
+
adapter: publicationBuildAdapter,
|
|
280
|
+
reservedImports: CLI_RESERVED_IMPORTS,
|
|
281
|
+
});
|
|
282
|
+
}
|
|
283
|
+
catch (error) {
|
|
284
|
+
throw inspectionError('catalogPreparationFailed', error);
|
|
285
|
+
}
|
|
286
|
+
const preparedHead = await publicationGit(repoRoot, ['rev-parse', '--verify', 'HEAD'], env, 'sourceDrift', 'Could not recheck the source Git HEAD.');
|
|
287
|
+
const preparedStatus = await publicationGit(repoRoot, [
|
|
288
|
+
'status', '--porcelain=v1', '--untracked-files=all', '--ignore-submodules=none',
|
|
289
|
+
], env, 'sourceDrift', 'Could not recheck the source worktree.');
|
|
290
|
+
if (preparedHead !== sourceHead || preparedStatus !== '') {
|
|
291
|
+
throw new CatalogPublicationInspectionError('sourceDrift', 'Source HEAD or worktree changed during Catalog preparation. Commit or clean it before publishing.');
|
|
292
|
+
}
|
|
293
|
+
const finalRefs = parseRemoteRefs(await publicationGit(repositoryRoot, [
|
|
294
|
+
'ls-remote', 'publish', branchRef, tagRef, `${tagRef}^{}`,
|
|
295
|
+
], env, 'remoteDrift', 'Could not recheck the Catalog publication remote.'));
|
|
296
|
+
if ((finalRefs.get(branchRef) ?? null) !== parent
|
|
297
|
+
|| finalRefs.has(tagRef) !== initialRefs.has(tagRef)
|
|
298
|
+
|| finalRefs.has(`${tagRef}^{}`) !== initialRefs.has(`${tagRef}^{}`)) {
|
|
299
|
+
throw new CatalogPublicationInspectionError('remoteDrift', 'Catalog remote changed during preparation. Increase the Catalog version before publishing again.');
|
|
300
|
+
}
|
|
301
|
+
const [preparedValidation, ledgerBytes] = await Promise.all([
|
|
302
|
+
validatePublishedCatalogSnapshot(prepared.outputRoot),
|
|
303
|
+
fs.readFile(path.join(prepared.outputRoot, 'plugin-release-ledger.json')),
|
|
304
|
+
]);
|
|
305
|
+
const ledgerDigest = digest(ledgerBytes);
|
|
306
|
+
const descriptor = {
|
|
307
|
+
schemaVersion: 1,
|
|
308
|
+
workspaceIdentity: catalogWorkspace.workspaceIdentity,
|
|
309
|
+
catalogVersion: prepared.catalogVersion,
|
|
310
|
+
channel: prepared.channel,
|
|
311
|
+
sourceHead,
|
|
312
|
+
remote: {
|
|
313
|
+
name: options.remoteUrl === undefined ? remote : null,
|
|
314
|
+
identityDigest: remoteIdentityDigest,
|
|
315
|
+
},
|
|
316
|
+
branch,
|
|
317
|
+
parent,
|
|
318
|
+
tag,
|
|
319
|
+
snapshotDigest: prepared.snapshotDigest,
|
|
320
|
+
contentDigest: prepared.contentDigest,
|
|
321
|
+
planId: prepared.planId,
|
|
322
|
+
ledgerDigest,
|
|
323
|
+
minCliVersion: preparedValidation.manifest.compatibility.aw.minVersion,
|
|
324
|
+
pluginNames: [...prepared.pluginNames],
|
|
325
|
+
};
|
|
326
|
+
return {
|
|
327
|
+
temporaryRoot,
|
|
328
|
+
repositoryRoot,
|
|
329
|
+
archivedCatalogWorkspaceRoot,
|
|
330
|
+
catalogWorkspaceRoot,
|
|
331
|
+
repoRoot,
|
|
332
|
+
sourceHead,
|
|
333
|
+
remote,
|
|
334
|
+
branch,
|
|
335
|
+
branchRef,
|
|
336
|
+
tag,
|
|
337
|
+
tagRef,
|
|
338
|
+
fetchUrl,
|
|
339
|
+
pushUrl,
|
|
340
|
+
safeFetchUrl,
|
|
341
|
+
safePushUrl,
|
|
342
|
+
remoteIdentityDigest,
|
|
343
|
+
parent,
|
|
344
|
+
publishedVersion,
|
|
345
|
+
attemptPath,
|
|
346
|
+
attemptAvailable,
|
|
347
|
+
tagAvailable,
|
|
348
|
+
catalogWorkspace,
|
|
349
|
+
prepared,
|
|
350
|
+
descriptor,
|
|
351
|
+
env,
|
|
352
|
+
};
|
|
353
|
+
}
|
|
354
|
+
catch (error) {
|
|
355
|
+
if (temporaryRoot)
|
|
356
|
+
await fs.remove(temporaryRoot);
|
|
357
|
+
let safeMessage = error instanceof Error ? error.message : String(error);
|
|
358
|
+
if (temporaryRoot)
|
|
359
|
+
safeMessage = safeMessage.replaceAll(temporaryRoot, '<temporary Catalog state>');
|
|
360
|
+
if (fetchUrl)
|
|
361
|
+
safeMessage = safeMessage.replaceAll(fetchUrl, safeFetchUrl);
|
|
362
|
+
if (pushUrl)
|
|
363
|
+
safeMessage = safeMessage.replaceAll(pushUrl, safePushUrl);
|
|
364
|
+
if (error instanceof CatalogPublicationInspectionError) {
|
|
365
|
+
throw new CatalogPublicationInspectionError(error.code, safeMessage, { cause: error.cause });
|
|
366
|
+
}
|
|
367
|
+
throw new CatalogPublicationInspectionError('catalogPreflightFailed', safeMessage, { cause: error });
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
async function resolveRemoteUrlForInspection(options) {
|
|
371
|
+
if (options.remote !== undefined && options.remoteUrl !== undefined) {
|
|
372
|
+
throw new CatalogPublicationInspectionError('remoteInvalid', 'Catalog publication accepts a configured remote name or a direct remote URL, not both.');
|
|
373
|
+
}
|
|
374
|
+
const env = options.remoteUrl === undefined
|
|
375
|
+
? sanitizedGitEnvironment(options.env)
|
|
376
|
+
: directRemoteGitEnvironment(options.env);
|
|
377
|
+
if (options.remoteUrl !== undefined) {
|
|
378
|
+
return { remoteUrl: assertSafeRemoteUrl(options.remoteUrl), env };
|
|
379
|
+
}
|
|
380
|
+
const remote = options.remote ?? 'origin';
|
|
381
|
+
return {
|
|
382
|
+
remoteUrl: await publicationGit(options.workspaceRoot, ['remote', 'get-url', '--push', remote], env, 'remoteMissing', `Git remote ${JSON.stringify(remote)} has no push URL.`),
|
|
383
|
+
env,
|
|
384
|
+
};
|
|
385
|
+
}
|
|
386
|
+
export async function listCatalogPublicationVersions(options) {
|
|
387
|
+
const resolved = await resolveRemoteUrlForInspection(options);
|
|
388
|
+
const temporaryRoot = await fs.mkdtemp(path.join(os.tmpdir(), 'aw-catalog-remote-read-'));
|
|
389
|
+
try {
|
|
390
|
+
await publicationGit(temporaryRoot, ['init', '--quiet'], resolved.env, 'temporaryRepositoryFailed', 'Could not create the Catalog inspection repository.');
|
|
391
|
+
await publicationGit(temporaryRoot, ['remote', 'add', 'publish', resolved.remoteUrl], resolved.env, 'temporaryRepositoryFailed', 'Could not configure the Catalog inspection remote.');
|
|
392
|
+
const refs = parseRemoteRefs(await publicationGit(temporaryRoot, [
|
|
393
|
+
'ls-remote', '--refs', 'publish', 'refs/tags/catalog-v*',
|
|
394
|
+
], resolved.env, 'remoteReadFailed', 'Could not inspect Catalog publication versions.'));
|
|
395
|
+
return [...refs.keys()]
|
|
396
|
+
.filter((ref) => ref.startsWith('refs/tags/catalog-v'))
|
|
397
|
+
.map((ref) => ref.slice('refs/tags/catalog-v'.length));
|
|
398
|
+
}
|
|
399
|
+
finally {
|
|
400
|
+
await fs.remove(temporaryRoot);
|
|
401
|
+
}
|
|
402
|
+
}
|
|
403
|
+
export async function readCatalogPublicationBranchState(options) {
|
|
404
|
+
const resolved = await resolveRemoteUrlForInspection(options);
|
|
405
|
+
const temporaryRoot = await fs.mkdtemp(path.join(os.tmpdir(), 'aw-catalog-remote-read-'));
|
|
406
|
+
try {
|
|
407
|
+
await publicationGit(options.workspaceRoot, [
|
|
408
|
+
'check-ref-format', '--branch', options.branch,
|
|
409
|
+
], resolved.env, 'branchInvalid', 'Invalid Catalog publication branch name.');
|
|
410
|
+
const branchRef = `refs/heads/${options.branch}`;
|
|
411
|
+
await publicationGit(temporaryRoot, ['init', '--quiet'], resolved.env, 'temporaryRepositoryFailed', 'Could not create the Catalog inspection repository.');
|
|
412
|
+
await publicationGit(temporaryRoot, ['config', 'core.symlinks', 'true'], resolved.env, 'temporaryRepositoryFailed', 'Could not configure the Catalog inspection repository.');
|
|
413
|
+
await publicationGit(temporaryRoot, ['remote', 'add', 'publish', resolved.remoteUrl], resolved.env, 'temporaryRepositoryFailed', 'Could not configure the Catalog inspection remote.');
|
|
414
|
+
const refs = parseRemoteRefs(await publicationGit(temporaryRoot, [
|
|
415
|
+
'ls-remote', 'publish', branchRef,
|
|
416
|
+
], resolved.env, 'remoteReadFailed', 'Could not inspect the Catalog publication branch.'));
|
|
417
|
+
const commit = refs.get(branchRef);
|
|
418
|
+
if (!commit)
|
|
419
|
+
return null;
|
|
420
|
+
await publicationGit(temporaryRoot, [
|
|
421
|
+
'fetch', '--quiet', '--no-tags', 'publish', `${branchRef}:refs/aw/catalog-parent`,
|
|
422
|
+
], resolved.env, 'remoteBranchInvalid', 'Could not fetch the published Catalog branch.');
|
|
423
|
+
const snapshotRoot = path.join(temporaryRoot, 'snapshot');
|
|
424
|
+
await fs.ensureDir(snapshotRoot);
|
|
425
|
+
await publicationGit(temporaryRoot, [
|
|
426
|
+
'--work-tree', snapshotRoot, 'checkout', '--quiet', 'refs/aw/catalog-parent', '--', '.',
|
|
427
|
+
], resolved.env, 'remoteBranchInvalid', 'Could not read the published Catalog snapshot.');
|
|
428
|
+
const validation = await validatePublishedCatalogSnapshot(snapshotRoot);
|
|
429
|
+
return {
|
|
430
|
+
commit,
|
|
431
|
+
version: validation.manifest.catalogVersion,
|
|
432
|
+
manifest: validation.manifest,
|
|
433
|
+
ledger: validation.ledger,
|
|
434
|
+
snapshotDigest: validation.snapshotDigest,
|
|
435
|
+
};
|
|
436
|
+
}
|
|
437
|
+
finally {
|
|
438
|
+
await fs.remove(temporaryRoot);
|
|
439
|
+
}
|
|
440
|
+
}
|
|
441
|
+
export async function disposeCatalogPublicationInspection(preparation) {
|
|
442
|
+
await fs.remove(preparation.temporaryRoot);
|
|
443
|
+
}
|
|
444
|
+
//# sourceMappingURL=catalog-publication-inspection.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"catalog-publication-inspection.js","sourceRoot":"","sources":["../../../src/commands/catalog-publication-inspection.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,aAAa,CAAC;AACjC,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAEtC,OAAO,EAAE,MAAM,UAAU,CAAC;AAC1B,OAAO,EACL,gCAAgC,EAChC,oBAAoB,EACpB,gCAAgC,GAGjC,MAAM,+BAA+B,CAAC;AAEvC,OAAO,EAAE,iBAAiB,EAAE,kCAAkC,EAAE,MAAM,iCAAiC,CAAC;AACxG,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAE1D,MAAM,aAAa,GAAG,SAAS,CAAC,QAAQ,CAAC,CAAC;AAC1C,MAAM,sBA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F,MAAM,YAAY,GAAG,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE,UAAU,CAAC,CAAC;QAC1D,MAAM,EAAE,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC;QACjC,MAAM,cAAc,CAAC,aAAa,EAAE;YAClC,aAAa,EAAE,YAAY,EAAE,UAAU,EAAE,SAAS,EAAE,wBAAwB,EAAE,IAAI,EAAE,GAAG;SACxF,EAAE,QAAQ,CAAC,GAAG,EAAE,qBAAqB,EAAE,gDAAgD,CAAC,CAAC;QAC1F,MAAM,UAAU,GAAG,MAAM,gCAAgC,CAAC,YAAY,CAAC,CAAC;QACxE,OAAO;YACL,MAAM;YACN,OAAO,EAAE,UAAU,CAAC,QAAQ,CAAC,cAAc;YAC3C,QAAQ,EAAE,UAAU,CAAC,QAAQ;YAC7B,MAAM,EAAE,UAAU,CAAC,MAAM;YACzB,cAAc,EAAE,UAAU,CAAC,cAAc;SAC1C,CAAC;IACJ,CAAC;YAAS,CAAC;QACT,MAAM,EAAE,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC;IACjC,CAAC;AACH,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,mCAAmC,CACvD,WAAiE;IAEjE,MAAM,EAAE,CAAC,MAAM,CAAC,WAAW,CAAC,aAAa,CAAC,CAAC;AAC7C,CAAC"}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { type CatalogPublicationDescriptor } from './catalog-publication-inspection.js';
|
|
2
|
+
export { safeRemoteIdentity, sanitizedGitEnvironment } from './catalog-publication-inspection.js';
|
|
1
3
|
export interface CatalogPublishIo {
|
|
2
4
|
stdout(text: string): void;
|
|
3
5
|
stderr(text: string): void;
|
|
@@ -5,6 +7,7 @@ export interface CatalogPublishIo {
|
|
|
5
7
|
export interface CatalogPublishReceipt {
|
|
6
8
|
command: 'catalog:publish';
|
|
7
9
|
ok: true;
|
|
10
|
+
workspaceIdentity: string;
|
|
8
11
|
catalogVersion: string;
|
|
9
12
|
channel: 'latest' | 'beta';
|
|
10
13
|
remote: string;
|
|
@@ -12,18 +15,31 @@ export interface CatalogPublishReceipt {
|
|
|
12
15
|
fetchUrl: string;
|
|
13
16
|
pushUrl: string;
|
|
14
17
|
branch: string;
|
|
18
|
+
parent: string | null;
|
|
15
19
|
tag: string;
|
|
16
20
|
commit: string;
|
|
17
21
|
sourceHead: string;
|
|
18
22
|
pluginCount: number;
|
|
19
23
|
snapshotDigest: string;
|
|
24
|
+
planId: string;
|
|
25
|
+
descriptorDigest: string;
|
|
20
26
|
}
|
|
21
|
-
export declare function
|
|
22
|
-
export declare function
|
|
27
|
+
export declare function catalogPublicationDescriptorDigest(descriptor: CatalogPublicationDescriptor): string;
|
|
28
|
+
export declare function publishPreparedCatalogPublication(options: {
|
|
29
|
+
workspaceRoot: string;
|
|
30
|
+
remote?: string;
|
|
31
|
+
remoteUrl?: string;
|
|
32
|
+
branch?: string;
|
|
33
|
+
descriptor: CatalogPublicationDescriptor;
|
|
34
|
+
snapshotRoot: string;
|
|
35
|
+
env: NodeJS.ProcessEnv;
|
|
36
|
+
beforeRemoteWrite?: () => Promise<void>;
|
|
37
|
+
}): Promise<CatalogPublishReceipt>;
|
|
23
38
|
export declare function runCatalogPublishCommand(options: {
|
|
24
39
|
workspaceRoot: string;
|
|
25
40
|
remote?: string;
|
|
26
41
|
branch?: string;
|
|
42
|
+
expectedDescriptorDigest?: string;
|
|
27
43
|
yes?: boolean;
|
|
28
44
|
json?: boolean;
|
|
29
45
|
env: NodeJS.ProcessEnv;
|