@aopslabs/aops 0.2.0
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/LICENSE +19 -0
- package/NOTICE +7 -0
- package/README.md +203 -0
- package/assets/agent-assets/core/SKILL.md +49 -0
- package/assets/agent-assets/core/references/agentspace/SKILL.md +78 -0
- package/assets/agent-assets/core/references/aops-cli-core/SKILL.md +108 -0
- package/assets/agent-assets/core/references/chatv3/SKILL.md +48 -0
- package/assets/agent-assets/core/references/collaborative-work/SKILL.md +85 -0
- package/assets/agent-assets/core/references/discuss/SKILL.md +66 -0
- package/assets/agent-assets/core/references/docman/SKILL.md +69 -0
- package/assets/agent-assets/core/references/hosted-chat/SKILL.md +64 -0
- package/assets/agent-assets/core/references/mission/SKILL.md +54 -0
- package/assets/agent-assets/core/references/projectman/SKILL.md +86 -0
- package/assets/agent-assets/core/references/sys/SKILL.md +36 -0
- package/assets/agent-assets/core/references/view/SKILL.md +58 -0
- package/assets/agent-assets/core/references/working-disciplines/SKILL.md +69 -0
- package/assets/agent-assets/core/user-guides/agent-assets.md +81 -0
- package/assets/agent-assets/core/user-guides/agentspace.md +1098 -0
- package/assets/agent-assets/core/user-guides/aops-cli.md +1107 -0
- package/assets/agent-assets/core/user-guides/aops-system.md +63 -0
- package/assets/agent-assets/core/user-guides/chatv3.md +113 -0
- package/assets/agent-assets/core/user-guides/docman.md +162 -0
- package/assets/agent-assets/core/user-guides/projectman.md +212 -0
- package/assets/agent-assets/core/user-guides/sys.md +94 -0
- package/assets/agent-assets/core/user-guides/working-disciplines.md +588 -0
- package/assets/agent-assets/gateway/aops/SKILL.md +14 -0
- package/assets/r6-remote-session-baseline.json +19 -0
- package/assets/skills/aops-install/SKILL.md +231 -0
- package/assets/skills/aops-install/agents/openai.yaml +4 -0
- package/dist/commands/activity.js +352 -0
- package/dist/commands/agent-profile.js +653 -0
- package/dist/commands/agent.js +710 -0
- package/dist/commands/agents-md.js +125 -0
- package/dist/commands/api.js +84 -0
- package/dist/commands/archive.js +873 -0
- package/dist/commands/artifact.js +535 -0
- package/dist/commands/assets.js +1414 -0
- package/dist/commands/auth/device-login.js +1 -0
- package/dist/commands/auth/legacy-export.js +177 -0
- package/dist/commands/auth/login.js +426 -0
- package/dist/commands/chat.js +1363 -0
- package/dist/commands/chatv3.js +1684 -0
- package/dist/commands/checkpoint.js +549 -0
- package/dist/commands/commercial-artifact.js +475 -0
- package/dist/commands/commercial-license.js +594 -0
- package/dist/commands/community-auth.js +62 -0
- package/dist/commands/community-cockpit.js +185 -0
- package/dist/commands/community-console.js +109 -0
- package/dist/commands/community-doctor.js +335 -0
- package/dist/commands/community-server.js +2062 -0
- package/dist/commands/community-setup.js +284 -0
- package/dist/commands/discuss.js +1448 -0
- package/dist/commands/doc.js +5219 -0
- package/dist/commands/experience.js +922 -0
- package/dist/commands/host.js +1127 -0
- package/dist/commands/init.js +118 -0
- package/dist/commands/memory.js +3129 -0
- package/dist/commands/mission.js +562 -0
- package/dist/commands/official-catalog.js +134 -0
- package/dist/commands/plan.js +84 -0
- package/dist/commands/playbook.js +415 -0
- package/dist/commands/pm/context.js +6 -0
- package/dist/commands/pm/index.js +701 -0
- package/dist/commands/pm/projectman.js +6266 -0
- package/dist/commands/project.js +1080 -0
- package/dist/commands/prompt.js +1024 -0
- package/dist/commands/repo-sync.js +1907 -0
- package/dist/commands/resource.js +527 -0
- package/dist/commands/skill.js +1211 -0
- package/dist/commands/start-disciplines.js +510 -0
- package/dist/commands/start.js +1343 -0
- package/dist/commands/target.js +309 -0
- package/dist/commands/version.js +42 -0
- package/dist/commands/view.js +1852 -0
- package/dist/launchers/cockpit.js +28 -0
- package/dist/launchers/options.js +74 -0
- package/dist/launchers/server.js +41 -0
- package/dist/lib/agent-assets/envelope.js +83 -0
- package/dist/lib/agent-assets/gateway.js +15 -0
- package/dist/lib/agent-assets/guards.js +23 -0
- package/dist/lib/agent-assets/hosted-discovery.js +148 -0
- package/dist/lib/agent-assets/hosted-package-input.js +154 -0
- package/dist/lib/agent-assets/legacy-pointer-migration.js +677 -0
- package/dist/lib/agent-assets/native-fs.js +589 -0
- package/dist/lib/agent-assets/package-manifest.js +324 -0
- package/dist/lib/agent-assets/portable-path.js +67 -0
- package/dist/lib/agent-assets/release-input.js +177 -0
- package/dist/lib/agent-assets/roots.js +45 -0
- package/dist/lib/agent-assets/runtime-binding-reader.js +545 -0
- package/dist/lib/agent-assets/runtime-targets.js +50 -0
- package/dist/lib/agent-assets/store-reader.js +1212 -0
- package/dist/lib/agent-assets/store-types.js +1 -0
- package/dist/lib/agent-assets/store-writer.js +1484 -0
- package/dist/lib/agent-assets/types.js +1 -0
- package/dist/lib/agent-assets/unicode-case-folding-v15-1.generated.js +1548 -0
- package/dist/lib/commercial-final-readiness.js +504 -0
- package/dist/lib/commercial-lifecycle-smoke-isolation.js +236 -0
- package/dist/lib/commercial-managed-postgres-docker-adapter.js +274 -0
- package/dist/lib/commercial-setup-readiness-adapter.js +179 -0
- package/dist/lib/community-client-contract.js +164 -0
- package/dist/lib/community-cockpit-lifecycle.js +601 -0
- package/dist/lib/community-command-abort.js +59 -0
- package/dist/lib/community-diagnostic.js +237 -0
- package/dist/lib/community-docker-adapter.js +498 -0
- package/dist/lib/community-home.js +31 -0
- package/dist/lib/community-instance-contract.js +148 -0
- package/dist/lib/community-instance-layout.js +97 -0
- package/dist/lib/community-lifecycle.js +1631 -0
- package/dist/lib/community-migration-snapshot.js +770 -0
- package/dist/lib/community-native-application-recovery.js +425 -0
- package/dist/lib/community-native-child.js +240 -0
- package/dist/lib/community-native-database-recovery.js +456 -0
- package/dist/lib/community-native-lifecycle.js +2458 -0
- package/dist/lib/community-native-migration.js +339 -0
- package/dist/lib/community-native-postgres.js +596 -0
- package/dist/lib/community-operation-journal.js +773 -0
- package/dist/lib/community-operation-lock.js +596 -0
- package/dist/lib/community-release-resolver.js +291 -0
- package/dist/lib/community-release-verifier.js +475 -0
- package/dist/lib/community-repo-discovery.js +252 -0
- package/dist/lib/community-setup-server-env.js +203 -0
- package/dist/lib/external-url.js +110 -0
- package/dist/lib/official-catalog-gateway.js +108 -0
- package/dist/lib/official-catalog.js +364 -0
- package/dist/lib/server-bootstrap.js +240 -0
- package/dist/lib/setup-agent-assets-bridge.js +176 -0
- package/dist/lib/setup-agent-assets-release.js +52 -0
- package/dist/lib/setup-external-postgres.js +108 -0
- package/dist/lib/setup-init-orchestrator.js +990 -0
- package/dist/lib/setup-install-guide.js +52 -0
- package/dist/lib/setup-installer-release.js +47 -0
- package/dist/lib/setup-local-postgres.js +329 -0
- package/dist/lib/setup-official-catalog-bridge.js +148 -0
- package/dist/lib/setup-readiness.js +888 -0
- package/dist/lib/tui-launcher.js +59 -0
- package/dist/main.js +150 -0
- package/dist/seeds/agents-md.js +54 -0
- package/dist/utils/agent-gateway.js +275 -0
- package/dist/utils/agents-md.js +281 -0
- package/dist/utils/api.js +255 -0
- package/dist/utils/chatv3-session-store.js +185 -0
- package/dist/utils/command.js +67 -0
- package/dist/utils/community-host-runtime.js +376 -0
- package/dist/utils/config.js +1015 -0
- package/dist/utils/discussion-workspace.js +552 -0
- package/dist/utils/experience-workspace.js +326 -0
- package/dist/utils/guide-paths.js +67 -0
- package/dist/utils/hosted-sugar.js +56 -0
- package/dist/utils/hosted-workspace.js +229 -0
- package/dist/utils/memory-workspace.js +537 -0
- package/dist/utils/operator-runtime.js +199 -0
- package/dist/utils/password-crypto.js +39 -0
- package/dist/utils/playbook-workspace.js +479 -0
- package/dist/utils/project-context.js +255 -0
- package/dist/utils/prompts.js +70 -0
- package/dist/utils/refresh-race.js +28 -0
- package/dist/utils/repo-config.js +109 -0
- package/dist/utils/repo-first-projectman.js +194 -0
- package/dist/utils/repo-first-storage.js +13 -0
- package/dist/utils/repo-first-view.js +305 -0
- package/dist/utils/session-guidance.js +278 -0
- package/dist/utils/session-state.js +137 -0
- package/dist/utils/table.js +39 -0
- package/dist/utils/transient-fs.js +49 -0
- package/dist/utils/workspace-root.js +1 -0
- package/launchers/aops-cockpit.ps1 +15 -0
- package/launchers/aops-cockpit.sh +16 -0
- package/launchers/aops-server.ps1 +15 -0
- package/launchers/aops-server.sh +16 -0
- package/native/tui/win32-x64/aops-tui.exe +0 -0
- package/package.json +81 -0
|
@@ -0,0 +1,291 @@
|
|
|
1
|
+
import { createHash } from 'node:crypto';
|
|
2
|
+
import { lstatSync, readFileSync, realpathSync } from 'node:fs';
|
|
3
|
+
import path from 'node:path';
|
|
4
|
+
import { verifyCommunityReleaseDescriptor, } from './community-release-verifier.js';
|
|
5
|
+
const RELEASE_VERSION = /^\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?$/;
|
|
6
|
+
const RAW_ORIGIN = 'https://raw.githubusercontent.com';
|
|
7
|
+
const PUBLIC_REPOSITORY_PATH = 'eeemzs/aops-community';
|
|
8
|
+
const FETCH_TIMEOUT_MS = 15_000;
|
|
9
|
+
const MAX_BYTES = Object.freeze({
|
|
10
|
+
manifest: 256 * 1024,
|
|
11
|
+
signature: 2 * 1024 * 1024,
|
|
12
|
+
compose: 1024 * 1024,
|
|
13
|
+
});
|
|
14
|
+
function fail(code, detail) {
|
|
15
|
+
throw new Error(detail ? `${code}:${detail}` : code);
|
|
16
|
+
}
|
|
17
|
+
function lstatBigInt(candidate, code) {
|
|
18
|
+
try {
|
|
19
|
+
return lstatSync(candidate, { bigint: true });
|
|
20
|
+
}
|
|
21
|
+
catch {
|
|
22
|
+
fail(code, candidate);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
function canonicalPath(candidate, code) {
|
|
26
|
+
try {
|
|
27
|
+
return realpathSync.native(candidate);
|
|
28
|
+
}
|
|
29
|
+
catch {
|
|
30
|
+
fail(code, candidate);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
function sameEntry(left, right) {
|
|
34
|
+
return left.dev === right.dev
|
|
35
|
+
&& left.ino === right.ino
|
|
36
|
+
&& left.mode === right.mode
|
|
37
|
+
&& left.size === right.size
|
|
38
|
+
&& left.mtimeNs === right.mtimeNs;
|
|
39
|
+
}
|
|
40
|
+
function entrySnapshot(lexicalPath, realPath, stat, bytes) {
|
|
41
|
+
return Object.freeze({
|
|
42
|
+
lexicalPath,
|
|
43
|
+
realPath,
|
|
44
|
+
device: stat.dev.toString(),
|
|
45
|
+
inode: stat.ino.toString(),
|
|
46
|
+
mode: stat.mode.toString(),
|
|
47
|
+
size: stat.size.toString(),
|
|
48
|
+
modifiedNanoseconds: stat.mtimeNs.toString(),
|
|
49
|
+
...(bytes ? { sha256: `sha256:${createHash('sha256').update(bytes).digest('hex')}` } : {}),
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
function captureOfflineRoot(rootPath) {
|
|
53
|
+
const lexicalPath = path.resolve(rootPath);
|
|
54
|
+
const before = lstatBigInt(lexicalPath, 'community_offline_release_root_missing');
|
|
55
|
+
if (before.isSymbolicLink() || !before.isDirectory())
|
|
56
|
+
fail('community_offline_release_root_invalid', lexicalPath);
|
|
57
|
+
const realPath = canonicalPath(lexicalPath, 'community_offline_release_root_realpath_failed');
|
|
58
|
+
const after = lstatBigInt(lexicalPath, 'community_offline_release_snapshot_changed');
|
|
59
|
+
const physical = lstatBigInt(realPath, 'community_offline_release_snapshot_changed');
|
|
60
|
+
if (!sameEntry(before, after) || !sameEntry(after, physical)) {
|
|
61
|
+
fail('community_offline_release_snapshot_changed', lexicalPath);
|
|
62
|
+
}
|
|
63
|
+
return entrySnapshot(lexicalPath, realPath, after);
|
|
64
|
+
}
|
|
65
|
+
function isConfined(root, candidate) {
|
|
66
|
+
const relative = path.relative(root, candidate);
|
|
67
|
+
return relative === '' || (!relative.startsWith(`..${path.sep}`) && relative !== '..' && !path.isAbsolute(relative));
|
|
68
|
+
}
|
|
69
|
+
function captureOfflineFile(options) {
|
|
70
|
+
const lexicalPath = path.resolve(options.filePath);
|
|
71
|
+
const before = lstatBigInt(lexicalPath, `${options.code}_missing`);
|
|
72
|
+
if (before.isSymbolicLink() || !before.isFile())
|
|
73
|
+
fail(`${options.code}_invalid`, lexicalPath);
|
|
74
|
+
if (before.size <= 0n || before.size > BigInt(options.maxBytes))
|
|
75
|
+
fail(`${options.code}_size_invalid`);
|
|
76
|
+
const realPath = canonicalPath(lexicalPath, `${options.code}_realpath_failed`);
|
|
77
|
+
if (!isConfined(options.root.realPath, realPath))
|
|
78
|
+
fail(`${options.code}_escape`, realPath);
|
|
79
|
+
const physical = lstatBigInt(realPath, 'community_offline_release_snapshot_changed');
|
|
80
|
+
if (!sameEntry(before, physical))
|
|
81
|
+
fail('community_offline_release_snapshot_changed', lexicalPath);
|
|
82
|
+
let bytes;
|
|
83
|
+
try {
|
|
84
|
+
bytes = readFileSync(realPath);
|
|
85
|
+
}
|
|
86
|
+
catch {
|
|
87
|
+
fail(`${options.code}_read_failed`, realPath);
|
|
88
|
+
}
|
|
89
|
+
const after = lstatBigInt(lexicalPath, 'community_offline_release_snapshot_changed');
|
|
90
|
+
if (!sameEntry(before, after) || bytes.byteLength !== Number(after.size)) {
|
|
91
|
+
fail('community_offline_release_snapshot_changed', lexicalPath);
|
|
92
|
+
}
|
|
93
|
+
let content;
|
|
94
|
+
try {
|
|
95
|
+
content = new TextDecoder('utf-8', { fatal: true }).decode(bytes);
|
|
96
|
+
}
|
|
97
|
+
catch {
|
|
98
|
+
fail(`${options.code}_utf8_invalid`);
|
|
99
|
+
}
|
|
100
|
+
return { content, snapshot: entrySnapshot(lexicalPath, realPath, after, bytes) };
|
|
101
|
+
}
|
|
102
|
+
function captureOfflineReleaseSnapshot(descriptorPath) {
|
|
103
|
+
const lexicalManifestPath = path.resolve(descriptorPath);
|
|
104
|
+
if (path.basename(lexicalManifestPath) !== 'release.json') {
|
|
105
|
+
fail('community_offline_release_descriptor_name_invalid');
|
|
106
|
+
}
|
|
107
|
+
const root = captureOfflineRoot(path.dirname(lexicalManifestPath));
|
|
108
|
+
const manifest = captureOfflineFile({
|
|
109
|
+
filePath: lexicalManifestPath,
|
|
110
|
+
root,
|
|
111
|
+
maxBytes: MAX_BYTES.manifest,
|
|
112
|
+
code: 'community_offline_release_manifest',
|
|
113
|
+
});
|
|
114
|
+
const signatureBundle = captureOfflineFile({
|
|
115
|
+
filePath: path.join(root.lexicalPath, 'release.sigstore.json'),
|
|
116
|
+
root,
|
|
117
|
+
maxBytes: MAX_BYTES.signature,
|
|
118
|
+
code: 'community_offline_release_signature',
|
|
119
|
+
});
|
|
120
|
+
const compose = captureOfflineFile({
|
|
121
|
+
filePath: path.join(root.lexicalPath, 'compose.yaml'),
|
|
122
|
+
root,
|
|
123
|
+
maxBytes: MAX_BYTES.compose,
|
|
124
|
+
code: 'community_offline_release_compose',
|
|
125
|
+
});
|
|
126
|
+
return {
|
|
127
|
+
snapshot: Object.freeze({
|
|
128
|
+
root,
|
|
129
|
+
manifest: manifest.snapshot,
|
|
130
|
+
signatureBundle: signatureBundle.snapshot,
|
|
131
|
+
compose: compose.snapshot,
|
|
132
|
+
}),
|
|
133
|
+
manifestContent: manifest.content,
|
|
134
|
+
signatureBundleContent: signatureBundle.content,
|
|
135
|
+
composeContent: compose.content,
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
function assertOfflineReleaseCurrent(expected) {
|
|
139
|
+
let current;
|
|
140
|
+
try {
|
|
141
|
+
current = captureOfflineReleaseSnapshot(expected.manifest.lexicalPath).snapshot;
|
|
142
|
+
}
|
|
143
|
+
catch (error) {
|
|
144
|
+
fail('community_offline_release_snapshot_changed', error instanceof Error ? error.message : String(error));
|
|
145
|
+
}
|
|
146
|
+
if (JSON.stringify(current) !== JSON.stringify(expected))
|
|
147
|
+
fail('community_offline_release_snapshot_changed');
|
|
148
|
+
}
|
|
149
|
+
function exactReleaseBase(releaseVersion) {
|
|
150
|
+
if (!RELEASE_VERSION.test(releaseVersion))
|
|
151
|
+
fail('community_published_release_version_invalid');
|
|
152
|
+
return `${RAW_ORIGIN}/${PUBLIC_REPOSITORY_PATH}/v${releaseVersion}/release`;
|
|
153
|
+
}
|
|
154
|
+
function boundedSignal(signal) {
|
|
155
|
+
const timeout = AbortSignal.timeout(FETCH_TIMEOUT_MS);
|
|
156
|
+
return signal ? AbortSignal.any([signal, timeout]) : timeout;
|
|
157
|
+
}
|
|
158
|
+
async function readBoundedUtf8(response, maxBytes, code) {
|
|
159
|
+
const declared = response.headers.get('content-length');
|
|
160
|
+
if (declared !== null && (!/^\d+$/.test(declared) || Number(declared) > maxBytes)) {
|
|
161
|
+
fail(`${code}_size_invalid`);
|
|
162
|
+
}
|
|
163
|
+
if (!response.body)
|
|
164
|
+
fail(`${code}_body_missing`);
|
|
165
|
+
const reader = response.body.getReader();
|
|
166
|
+
const chunks = [];
|
|
167
|
+
let byteLength = 0;
|
|
168
|
+
try {
|
|
169
|
+
while (true) {
|
|
170
|
+
const result = await reader.read();
|
|
171
|
+
if (result.done)
|
|
172
|
+
break;
|
|
173
|
+
byteLength += result.value.byteLength;
|
|
174
|
+
if (byteLength > maxBytes)
|
|
175
|
+
fail(`${code}_size_invalid`);
|
|
176
|
+
chunks.push(result.value);
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
finally {
|
|
180
|
+
reader.releaseLock();
|
|
181
|
+
}
|
|
182
|
+
if (byteLength === 0)
|
|
183
|
+
fail(`${code}_body_empty`);
|
|
184
|
+
try {
|
|
185
|
+
return new TextDecoder('utf-8', { fatal: true }).decode(Buffer.concat(chunks.map((chunk) => Buffer.from(chunk))));
|
|
186
|
+
}
|
|
187
|
+
catch {
|
|
188
|
+
fail(`${code}_utf8_invalid`);
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
async function fetchExactText(options) {
|
|
192
|
+
let response;
|
|
193
|
+
try {
|
|
194
|
+
response = await options.fetcher(options.url, {
|
|
195
|
+
method: 'GET',
|
|
196
|
+
redirect: 'error',
|
|
197
|
+
cache: 'no-store',
|
|
198
|
+
headers: { accept: 'application/octet-stream, application/json;q=0.9, text/plain;q=0.8' },
|
|
199
|
+
signal: boundedSignal(options.signal),
|
|
200
|
+
});
|
|
201
|
+
}
|
|
202
|
+
catch (error) {
|
|
203
|
+
fail(`${options.code}_fetch_failed`, error instanceof Error ? error.message : String(error));
|
|
204
|
+
}
|
|
205
|
+
if (response.status !== 200)
|
|
206
|
+
fail(`${options.code}_http_status`, String(response.status));
|
|
207
|
+
if (response.redirected || (response.url && response.url !== options.url)) {
|
|
208
|
+
fail(`${options.code}_redirect_refused`);
|
|
209
|
+
}
|
|
210
|
+
return readBoundedUtf8(response, options.maxBytes, options.code);
|
|
211
|
+
}
|
|
212
|
+
export async function resolveCommunityPublishedRelease(options) {
|
|
213
|
+
const base = exactReleaseBase(options.releaseVersion);
|
|
214
|
+
const descriptorSource = Object.freeze({
|
|
215
|
+
kind: 'published-tag',
|
|
216
|
+
repository: 'https://github.com/eeemzs/aops-community',
|
|
217
|
+
tag: `v${options.releaseVersion}`,
|
|
218
|
+
manifestUrl: `${base}/release.json`,
|
|
219
|
+
signatureBundleUrl: `${base}/release.sigstore.json`,
|
|
220
|
+
composeUrl: `${base}/compose.yaml`,
|
|
221
|
+
});
|
|
222
|
+
const fetcher = options.fetcher ?? globalThis.fetch;
|
|
223
|
+
const manifestContent = await fetchExactText({
|
|
224
|
+
url: descriptorSource.manifestUrl,
|
|
225
|
+
maxBytes: MAX_BYTES.manifest,
|
|
226
|
+
code: 'community_published_release_manifest',
|
|
227
|
+
fetcher,
|
|
228
|
+
signal: options.signal,
|
|
229
|
+
});
|
|
230
|
+
const [signatureBundleContent, composeContent] = await Promise.all([
|
|
231
|
+
fetchExactText({
|
|
232
|
+
url: descriptorSource.signatureBundleUrl,
|
|
233
|
+
maxBytes: MAX_BYTES.signature,
|
|
234
|
+
code: 'community_published_release_signature',
|
|
235
|
+
fetcher,
|
|
236
|
+
signal: options.signal,
|
|
237
|
+
}),
|
|
238
|
+
fetchExactText({
|
|
239
|
+
url: descriptorSource.composeUrl,
|
|
240
|
+
maxBytes: MAX_BYTES.compose,
|
|
241
|
+
code: 'community_published_release_compose',
|
|
242
|
+
fetcher,
|
|
243
|
+
signal: options.signal,
|
|
244
|
+
}),
|
|
245
|
+
]);
|
|
246
|
+
const verified = await verifyCommunityReleaseDescriptor({
|
|
247
|
+
manifestContent,
|
|
248
|
+
signatureBundleContent,
|
|
249
|
+
composeContent,
|
|
250
|
+
expectedReleaseVersion: options.releaseVersion,
|
|
251
|
+
certificateIdentity: options.certificateIdentity,
|
|
252
|
+
certificateOidcIssuer: options.certificateOidcIssuer,
|
|
253
|
+
signatureVerifier: options.signatureVerifier,
|
|
254
|
+
verificationMode: 'online',
|
|
255
|
+
});
|
|
256
|
+
return { ...verified, descriptorSource };
|
|
257
|
+
}
|
|
258
|
+
export async function resolveCommunityOfflineRelease(options) {
|
|
259
|
+
if (typeof options.descriptorPath !== 'string' || options.descriptorPath.trim() === '') {
|
|
260
|
+
fail('community_offline_release_descriptor_path_invalid');
|
|
261
|
+
}
|
|
262
|
+
options.signal?.throwIfAborted();
|
|
263
|
+
const captured = captureOfflineReleaseSnapshot(options.descriptorPath);
|
|
264
|
+
const verified = await verifyCommunityReleaseDescriptor({
|
|
265
|
+
manifestContent: captured.manifestContent,
|
|
266
|
+
signatureBundleContent: captured.signatureBundleContent,
|
|
267
|
+
composeContent: captured.composeContent,
|
|
268
|
+
expectedReleaseVersion: options.releaseVersion,
|
|
269
|
+
certificateIdentity: options.certificateIdentity,
|
|
270
|
+
certificateOidcIssuer: options.certificateOidcIssuer,
|
|
271
|
+
signatureVerifier: options.signatureVerifier,
|
|
272
|
+
verificationMode: 'offline',
|
|
273
|
+
});
|
|
274
|
+
options.signal?.throwIfAborted();
|
|
275
|
+
const assertCurrent = () => assertOfflineReleaseCurrent(captured.snapshot);
|
|
276
|
+
assertCurrent();
|
|
277
|
+
return Object.freeze({
|
|
278
|
+
verified,
|
|
279
|
+
assertCurrent,
|
|
280
|
+
descriptorSource: Object.freeze({
|
|
281
|
+
kind: 'offline-descriptor',
|
|
282
|
+
releaseDirectory: captured.snapshot.root.realPath,
|
|
283
|
+
manifestPath: captured.snapshot.manifest.realPath,
|
|
284
|
+
manifestSha256: captured.snapshot.manifest.sha256,
|
|
285
|
+
signatureBundlePath: captured.snapshot.signatureBundle.realPath,
|
|
286
|
+
signatureBundleSha256: captured.snapshot.signatureBundle.sha256,
|
|
287
|
+
composePath: captured.snapshot.compose.realPath,
|
|
288
|
+
composeSha256: captured.snapshot.compose.sha256,
|
|
289
|
+
}),
|
|
290
|
+
});
|
|
291
|
+
}
|