@xenosystem/agent-host 0.0.0-stage → 0.1.211
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 +67 -0
- package/dist/archive.d.ts +15 -0
- package/dist/archive.d.ts.map +1 -0
- package/dist/archive.js +214 -0
- package/dist/archive.js.map +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -0
- package/dist/installStore.d.ts +99 -0
- package/dist/installStore.d.ts.map +1 -0
- package/dist/installStore.js +421 -0
- package/dist/installStore.js.map +1 -0
- package/dist/launcher.d.ts +43 -0
- package/dist/launcher.d.ts.map +1 -0
- package/dist/launcher.js +69 -0
- package/dist/launcher.js.map +1 -0
- package/dist/updater.d.ts +48 -0
- package/dist/updater.d.ts.map +1 -0
- package/dist/updater.js +186 -0
- package/dist/updater.js.map +1 -0
- package/package.json +28 -3
- package/README.md +0 -3
package/LICENSE
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
XENO Agent — Proprietary Software License
|
|
2
|
+
Copyright © 2026 XENO Corporation. All rights reserved.
|
|
3
|
+
|
|
4
|
+
This software, including its source code, compiled binaries, published packages,
|
|
5
|
+
assets, and accompanying documentation (collectively, the "Software"), is the
|
|
6
|
+
proprietary and confidential property of XENO Corporation ("XENO"). The Software
|
|
7
|
+
is licensed for use, not sold, and no title to or ownership of the Software is
|
|
8
|
+
transferred to any user.
|
|
9
|
+
|
|
10
|
+
1. GRANT OF USE
|
|
11
|
+
Subject to a separate written agreement and/or the terms of service published
|
|
12
|
+
at https://xenosystem.ai, XENO grants the end user a limited, non-exclusive,
|
|
13
|
+
non-transferable, revocable license to install and use the Software for its
|
|
14
|
+
intended purpose. The standalone desktop application ("the Agent") may be used
|
|
15
|
+
locally at no charge; connected platform features — hosted agent runs, model
|
|
16
|
+
inference, credits, and account services — are governed by the applicable
|
|
17
|
+
subscription and the XENO terms of service.
|
|
18
|
+
|
|
19
|
+
2. PACKAGE DISTRIBUTION
|
|
20
|
+
The `@xeno-corporation/xeno-agent-interface-*` and
|
|
21
|
+
`@xeno-corporation/xeno-agents-client` packages are published to a PRIVATE
|
|
22
|
+
registry and are licensed for use solely by XENO products and by parties
|
|
23
|
+
holding a separate written agreement with XENO. Access credentials to that
|
|
24
|
+
registry do not grant redistribution rights. Publication of any package in
|
|
25
|
+
this repository to a public registry is prohibited without written
|
|
26
|
+
authorization from XENO.
|
|
27
|
+
|
|
28
|
+
3. RESTRICTIONS
|
|
29
|
+
Except to the extent expressly permitted by applicable law or by a separate
|
|
30
|
+
written agreement with XENO, you may NOT: (a) copy, redistribute, sell, rent,
|
|
31
|
+
lease, sublicense, or otherwise transfer the Software; (b) modify, adapt,
|
|
32
|
+
translate, or create derivative works of the Software; (c) reverse-engineer,
|
|
33
|
+
decompile, or disassemble the Software, or attempt to derive its source code;
|
|
34
|
+
(d) remove, obscure, or alter any proprietary notices; or (e) use the Software
|
|
35
|
+
to build a competing product.
|
|
36
|
+
|
|
37
|
+
4. RESERVATION OF RIGHTS
|
|
38
|
+
All rights not expressly granted are reserved by XENO Corporation. The Software
|
|
39
|
+
is protected by copyright and other intellectual-property laws and treaties.
|
|
40
|
+
|
|
41
|
+
5. DISCLAIMER OF WARRANTY
|
|
42
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND "AS AVAILABLE", WITHOUT WARRANTY OF ANY
|
|
43
|
+
KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
44
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. THE
|
|
45
|
+
SOFTWARE EXECUTES AGENT-DIRECTED OPERATIONS AGAINST A USER-SELECTED WORKSPACE,
|
|
46
|
+
INCLUDING FILE AND PROCESS ACTIONS; THE USER IS RESPONSIBLE FOR THE WORKSPACES
|
|
47
|
+
AND PERMISSIONS THEY GRANT IT.
|
|
48
|
+
|
|
49
|
+
6. LIMITATION OF LIABILITY
|
|
50
|
+
TO THE MAXIMUM EXTENT PERMITTED BY LAW, IN NO EVENT SHALL XENO CORPORATION BE
|
|
51
|
+
LIABLE FOR ANY INDIRECT, INCIDENTAL, SPECIAL, CONSEQUENTIAL, OR PUNITIVE
|
|
52
|
+
DAMAGES, OR ANY LOSS OF PROFITS OR DATA, ARISING FROM OR RELATED TO THE USE OF
|
|
53
|
+
OR INABILITY TO USE THE SOFTWARE.
|
|
54
|
+
|
|
55
|
+
7. THIRD-PARTY COMPONENTS
|
|
56
|
+
The Software includes third-party open-source components, each licensed under
|
|
57
|
+
its own terms; those terms govern those components and are not superseded by
|
|
58
|
+
this license. It also composes third-party agent providers over the Agent
|
|
59
|
+
Client Protocol and hosted APIs; use of those providers is governed by their
|
|
60
|
+
own terms.
|
|
61
|
+
|
|
62
|
+
For licensing inquiries, contact: legal@xenostudio.ai
|
|
63
|
+
|
|
64
|
+
NOTE TO OPERATOR: confirm the exact legal entity name and notice/contact details
|
|
65
|
+
with counsel before public distribution and code-signing (the code-signing
|
|
66
|
+
publisher name must match the registered entity). No public distribution of this
|
|
67
|
+
product is authorized by this file — see docs/PRODUCT_STATUS.md.
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export interface TarArchiveEntry {
|
|
2
|
+
readonly path: string;
|
|
3
|
+
readonly data: Buffer;
|
|
4
|
+
readonly mode?: number;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Packs file entries into a deterministic standard POSIX USTAR `.tar.gz` buffer.
|
|
8
|
+
*/
|
|
9
|
+
export declare function createTarGzBuffer(entries: readonly TarArchiveEntry[]): Buffer;
|
|
10
|
+
/**
|
|
11
|
+
* Safely extracts a `.tar.gz` buffer into `targetDir`, refusing symlinks, hardlinks, absolute paths,
|
|
12
|
+
* path traversal, and oversized archives.
|
|
13
|
+
*/
|
|
14
|
+
export declare function extractTarGzBuffer(tarGz: Uint8Array, targetDir: string): Promise<string[]>;
|
|
15
|
+
//# sourceMappingURL=archive.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"archive.d.ts","sourceRoot":"","sources":["../src/archive.ts"],"names":[],"mappings":"AAQA,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CACvB;AA8DD;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,SAAS,eAAe,EAAE,GAAG,MAAM,CAiB7E;AAoDD;;;GAGG;AACH,wBAAsB,kBAAkB,CAAC,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAkFhG"}
|
package/dist/archive.js
ADDED
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
import { gunzipSync, gzipSync } from 'node:zlib';
|
|
2
|
+
import { mkdir, writeFile } from 'node:fs/promises';
|
|
3
|
+
import { dirname, isAbsolute, relative, resolve } from 'node:path';
|
|
4
|
+
const BLOCK_SIZE = 512;
|
|
5
|
+
const MAX_EXTRACT_ENTRIES = 10_000;
|
|
6
|
+
const MAX_EXTRACT_BYTES = 256 * 1024 * 1024;
|
|
7
|
+
function normalizeArchivePath(rawPath) {
|
|
8
|
+
const cleaned = rawPath.replace(/^\.\//, '').replace(/\/+$/, '');
|
|
9
|
+
if (!cleaned)
|
|
10
|
+
throw new Error('Archive entry has an empty path');
|
|
11
|
+
if (cleaned.includes('\0') || cleaned.includes('\\') || cleaned.startsWith('/') || /^[A-Za-z]:/.test(cleaned)) {
|
|
12
|
+
throw new Error(`Unsafe archive entry path: "${rawPath}"`);
|
|
13
|
+
}
|
|
14
|
+
const segments = cleaned.split('/');
|
|
15
|
+
if (segments.some((segment) => segment === '' || segment === '.' || segment === '..')) {
|
|
16
|
+
throw new Error(`Unsafe archive entry path traversal: "${rawPath}"`);
|
|
17
|
+
}
|
|
18
|
+
return cleaned;
|
|
19
|
+
}
|
|
20
|
+
function writeOctal(buffer, offset, length, value) {
|
|
21
|
+
const digits = Math.max(0, Math.floor(value)).toString(8).padStart(length - 1, '0');
|
|
22
|
+
if (digits.length > length - 1) {
|
|
23
|
+
throw new Error(`Tar header value ${value} overflows ${length}-byte octal field`);
|
|
24
|
+
}
|
|
25
|
+
buffer.write(digits, offset, length - 1, 'ascii');
|
|
26
|
+
buffer[offset + length - 1] = 0;
|
|
27
|
+
}
|
|
28
|
+
function splitUstarPath(entryPath) {
|
|
29
|
+
const byteLength = Buffer.byteLength(entryPath, 'utf8');
|
|
30
|
+
if (byteLength <= 100)
|
|
31
|
+
return { name: entryPath, prefix: '' };
|
|
32
|
+
const slashIndex = entryPath.lastIndexOf('/');
|
|
33
|
+
if (slashIndex > 0) {
|
|
34
|
+
const prefix = entryPath.slice(0, slashIndex);
|
|
35
|
+
const name = entryPath.slice(slashIndex + 1);
|
|
36
|
+
if (Buffer.byteLength(prefix, 'utf8') <= 155 && Buffer.byteLength(name, 'utf8') <= 100) {
|
|
37
|
+
return { name, prefix };
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
throw new Error(`Archive path exceeds POSIX USTAR limits: "${entryPath}"`);
|
|
41
|
+
}
|
|
42
|
+
function buildTarHeader(entryPath, size, mode, typeflag) {
|
|
43
|
+
const header = Buffer.alloc(BLOCK_SIZE, 0);
|
|
44
|
+
const { name, prefix } = splitUstarPath(entryPath);
|
|
45
|
+
header.write(name, 0, 100, 'utf8');
|
|
46
|
+
writeOctal(header, 100, 8, mode);
|
|
47
|
+
writeOctal(header, 108, 8, 0);
|
|
48
|
+
writeOctal(header, 116, 8, 0);
|
|
49
|
+
writeOctal(header, 124, 12, size);
|
|
50
|
+
writeOctal(header, 136, 12, Math.floor(Date.now() / 1000));
|
|
51
|
+
header.fill(0x20, 148, 156); // spaces while computing checksum
|
|
52
|
+
header[156] = typeflag.charCodeAt(0);
|
|
53
|
+
header.write('ustar\0', 257, 6, 'ascii');
|
|
54
|
+
header.write('00', 263, 2, 'ascii');
|
|
55
|
+
if (prefix)
|
|
56
|
+
header.write(prefix, 345, 155, 'utf8');
|
|
57
|
+
let checksum = 0;
|
|
58
|
+
for (let i = 0; i < BLOCK_SIZE; i += 1)
|
|
59
|
+
checksum += header[i];
|
|
60
|
+
const chksumStr = checksum.toString(8).padStart(6, '0');
|
|
61
|
+
header.write(chksumStr, 148, 6, 'ascii');
|
|
62
|
+
header[154] = 0;
|
|
63
|
+
header[155] = 0x20;
|
|
64
|
+
return header;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Packs file entries into a deterministic standard POSIX USTAR `.tar.gz` buffer.
|
|
68
|
+
*/
|
|
69
|
+
export function createTarGzBuffer(entries) {
|
|
70
|
+
const chunks = [];
|
|
71
|
+
const sorted = [...entries].sort((a, b) => a.path.localeCompare(b.path));
|
|
72
|
+
for (const entry of sorted) {
|
|
73
|
+
const cleanPath = normalizeArchivePath(entry.path);
|
|
74
|
+
const header = buildTarHeader(cleanPath, entry.data.length, entry.mode ?? 0o644, '0');
|
|
75
|
+
chunks.push(header);
|
|
76
|
+
if (entry.data.length > 0) {
|
|
77
|
+
chunks.push(entry.data);
|
|
78
|
+
const remainder = entry.data.length % BLOCK_SIZE;
|
|
79
|
+
if (remainder !== 0) {
|
|
80
|
+
chunks.push(Buffer.alloc(BLOCK_SIZE - remainder, 0));
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
chunks.push(Buffer.alloc(BLOCK_SIZE * 2, 0));
|
|
85
|
+
return gzipSync(Buffer.concat(chunks), { level: 9 });
|
|
86
|
+
}
|
|
87
|
+
function readNullString(buffer, start, end) {
|
|
88
|
+
const slice = buffer.subarray(start, end);
|
|
89
|
+
const zero = slice.indexOf(0);
|
|
90
|
+
return (zero === -1 ? slice : slice.subarray(0, zero)).toString('utf8');
|
|
91
|
+
}
|
|
92
|
+
function parseOctalField(buffer, start, end) {
|
|
93
|
+
const raw = readNullString(buffer, start, end).trim();
|
|
94
|
+
if (!raw)
|
|
95
|
+
return 0;
|
|
96
|
+
if (!/^[0-7]+$/.test(raw)) {
|
|
97
|
+
throw new Error(`Invalid octal field in tar header: "${raw}"`);
|
|
98
|
+
}
|
|
99
|
+
return Number.parseInt(raw, 8);
|
|
100
|
+
}
|
|
101
|
+
function isZeroBlock(buffer, offset) {
|
|
102
|
+
for (let i = 0; i < BLOCK_SIZE; i += 1) {
|
|
103
|
+
if (buffer[offset + i] !== 0)
|
|
104
|
+
return false;
|
|
105
|
+
}
|
|
106
|
+
return true;
|
|
107
|
+
}
|
|
108
|
+
function verifyHeaderChecksum(header) {
|
|
109
|
+
const recorded = parseOctalField(header, 148, 156);
|
|
110
|
+
let unsignedSum = 0;
|
|
111
|
+
for (let i = 0; i < BLOCK_SIZE; i += 1) {
|
|
112
|
+
unsignedSum += i >= 148 && i < 156 ? 0x20 : header[i];
|
|
113
|
+
}
|
|
114
|
+
if (unsignedSum !== recorded) {
|
|
115
|
+
throw new Error(`Tar header checksum mismatch: recorded ${recorded}, computed ${unsignedSum}`);
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
function parsePaxPath(data) {
|
|
119
|
+
const text = data.toString('utf8');
|
|
120
|
+
let cursor = 0;
|
|
121
|
+
while (cursor < text.length) {
|
|
122
|
+
const space = text.indexOf(' ', cursor);
|
|
123
|
+
if (space <= cursor)
|
|
124
|
+
break;
|
|
125
|
+
const length = Number.parseInt(text.slice(cursor, space), 10);
|
|
126
|
+
if (!Number.isSafeInteger(length) || length <= 0)
|
|
127
|
+
break;
|
|
128
|
+
const record = text.slice(space + 1, cursor + length);
|
|
129
|
+
cursor += length;
|
|
130
|
+
if (record.startsWith('path=')) {
|
|
131
|
+
return record.slice('path='.length).replace(/\n$/, '');
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
return undefined;
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* Safely extracts a `.tar.gz` buffer into `targetDir`, refusing symlinks, hardlinks, absolute paths,
|
|
138
|
+
* path traversal, and oversized archives.
|
|
139
|
+
*/
|
|
140
|
+
export async function extractTarGzBuffer(tarGz, targetDir) {
|
|
141
|
+
const tar = gunzipSync(tarGz);
|
|
142
|
+
if (tar.length < BLOCK_SIZE || tar.length % BLOCK_SIZE !== 0) {
|
|
143
|
+
throw new Error('Corrupt tar archive: payload is not aligned to 512-byte blocks');
|
|
144
|
+
}
|
|
145
|
+
const root = resolve(targetDir);
|
|
146
|
+
await mkdir(root, { recursive: true });
|
|
147
|
+
const extracted = [];
|
|
148
|
+
let offset = 0;
|
|
149
|
+
let totalBytes = 0;
|
|
150
|
+
let entryCount = 0;
|
|
151
|
+
let nextPathOverride;
|
|
152
|
+
while (offset + BLOCK_SIZE <= tar.length) {
|
|
153
|
+
if (isZeroBlock(tar, offset))
|
|
154
|
+
break;
|
|
155
|
+
const header = tar.subarray(offset, offset + BLOCK_SIZE);
|
|
156
|
+
verifyHeaderChecksum(header);
|
|
157
|
+
offset += BLOCK_SIZE;
|
|
158
|
+
const typeflag = String.fromCharCode(header[156] || 0x30);
|
|
159
|
+
const size = parseOctalField(header, 124, 136);
|
|
160
|
+
const paddedSize = Math.ceil(size / BLOCK_SIZE) * BLOCK_SIZE;
|
|
161
|
+
if (offset + paddedSize > tar.length) {
|
|
162
|
+
throw new Error('Corrupt tar archive: entry exceeds archive length');
|
|
163
|
+
}
|
|
164
|
+
const content = tar.subarray(offset, offset + size);
|
|
165
|
+
offset += paddedSize;
|
|
166
|
+
if (typeflag === 'L') {
|
|
167
|
+
nextPathOverride = content.toString('utf8').replace(/\0+$/, '');
|
|
168
|
+
continue;
|
|
169
|
+
}
|
|
170
|
+
if (typeflag === 'x') {
|
|
171
|
+
nextPathOverride = parsePaxPath(content);
|
|
172
|
+
continue;
|
|
173
|
+
}
|
|
174
|
+
if (typeflag === 'g') {
|
|
175
|
+
continue;
|
|
176
|
+
}
|
|
177
|
+
const rawName = readNullString(header, 0, 100);
|
|
178
|
+
const rawPrefix = readNullString(header, 345, 500);
|
|
179
|
+
const combined = nextPathOverride ?? (rawPrefix ? `${rawPrefix}/${rawName}` : rawName);
|
|
180
|
+
nextPathOverride = undefined;
|
|
181
|
+
if (typeflag === '5') {
|
|
182
|
+
const cleanDir = normalizeArchivePath(combined);
|
|
183
|
+
const destDir = resolve(root, cleanDir);
|
|
184
|
+
const rel = relative(root, destDir);
|
|
185
|
+
if (rel.startsWith('..') || isAbsolute(rel)) {
|
|
186
|
+
throw new Error(`Archive directory escapes target root: "${combined}"`);
|
|
187
|
+
}
|
|
188
|
+
await mkdir(destDir, { recursive: true });
|
|
189
|
+
continue;
|
|
190
|
+
}
|
|
191
|
+
if (typeflag !== '0' && typeflag !== '\0') {
|
|
192
|
+
throw new Error(`Refusing unsupported tar entry type "${typeflag}" for "${combined}"`);
|
|
193
|
+
}
|
|
194
|
+
entryCount += 1;
|
|
195
|
+
if (entryCount > MAX_EXTRACT_ENTRIES) {
|
|
196
|
+
throw new Error(`Archive exceeds maximum entry limit (${MAX_EXTRACT_ENTRIES})`);
|
|
197
|
+
}
|
|
198
|
+
totalBytes += size;
|
|
199
|
+
if (totalBytes > MAX_EXTRACT_BYTES) {
|
|
200
|
+
throw new Error(`Archive exceeds maximum extracted size (${MAX_EXTRACT_BYTES} bytes)`);
|
|
201
|
+
}
|
|
202
|
+
const cleanPath = normalizeArchivePath(combined);
|
|
203
|
+
const destPath = resolve(root, cleanPath);
|
|
204
|
+
const rel = relative(root, destPath);
|
|
205
|
+
if (rel.startsWith('..') || isAbsolute(rel)) {
|
|
206
|
+
throw new Error(`Archive file escapes target root: "${combined}"`);
|
|
207
|
+
}
|
|
208
|
+
await mkdir(dirname(destPath), { recursive: true });
|
|
209
|
+
await writeFile(destPath, content);
|
|
210
|
+
extracted.push(cleanPath);
|
|
211
|
+
}
|
|
212
|
+
return extracted;
|
|
213
|
+
}
|
|
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,CAAC,QAAQ,CAAC,CAAA;QAChD,MAAM,QAAQ,GAAG,OAAO,CAAC,IAAI,EAAE,SAAS,CAAC,CAAA;QACzC,MAAM,GAAG,GAAG,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAA;QACpC,IAAI,GAAG,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;YAC5C,MAAM,IAAI,KAAK,CAAC,sCAAsC,QAAQ,GAAG,CAAC,CAAA;QACpE,CAAC;QACD,MAAM,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAA;QACnD,MAAM,SAAS,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAA;QAClC,SAAS,CAAC,IAAI,CAAC,SAAS,CAAC,CAAA;IAC3B,CAAC;IAED,OAAO,SAAS,CAAA;AAClB,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { AGENT_HOST_INSTALL_ROOT_ENV, AGENT_HOST_PROTOCOL_VERSION, HostIntegrityError, compareHostVersions, compareHostVersions as compareRuntimeVersions, computeBufferSha256, computeFileSha256Sync, currentInstallFilePath, isValidSemver, isValidSha256, listInstalledHostVersions, parseHostBundleManifest, pruneOldHostVersions, readCurrentHostInstall, registerHostVersion, resolveAgentHostInstallRoot, selectHighestHostVersion, versionsDirectoryPath, type HostBundleManifest, type HostInstallRecord, type InstalledHostVersion, type PruneHostVersionsResult, type ReadHostInstallOptions, type RegisterHostVersionOptions, type ResolveAgentHostInstallRootOptions, } from './installStore.js';
|
|
2
|
+
export { AGENT_HOST_FEED_URL_ENV, DEFAULT_AGENT_HOST_FEED_URL, checkAndStageAgentHostUpdate, parseAgentHostFeedManifest, parseSha256Sums, resolvePlatformArtifactName, type AgentHostFeedManifest, type AgentHostUpdateResult, type CheckAndStageAgentHostUpdateOptions, } from './updater.js';
|
|
3
|
+
export { resolveSharedHostEntry, stageBundledHostIfNewer, type ResolvedSharedHostEntry, type ResolveSharedHostEntryOptions, type StageBundledHostOptions, type StageBundledHostResult, } from './launcher.js';
|
|
4
|
+
export { createTarGzBuffer, extractTarGzBuffer, type TarArchiveEntry, } from './archive.js';
|
|
5
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,2BAA2B,EAC3B,2BAA2B,EAC3B,kBAAkB,EAClB,mBAAmB,EACnB,mBAAmB,IAAI,sBAAsB,EAC7C,mBAAmB,EACnB,qBAAqB,EACrB,sBAAsB,EACtB,aAAa,EACb,aAAa,EACb,yBAAyB,EACzB,uBAAuB,EACvB,oBAAoB,EACpB,sBAAsB,EACtB,mBAAmB,EACnB,2BAA2B,EAC3B,wBAAwB,EACxB,qBAAqB,EACrB,KAAK,kBAAkB,EACvB,KAAK,iBAAiB,EACtB,KAAK,oBAAoB,EACzB,KAAK,uBAAuB,EAC5B,KAAK,sBAAsB,EAC3B,KAAK,0BAA0B,EAC/B,KAAK,kCAAkC,GACxC,MAAM,mBAAmB,CAAA;AAE1B,OAAO,EACL,uBAAuB,EACvB,2BAA2B,EAC3B,4BAA4B,EAC5B,0BAA0B,EAC1B,eAAe,EACf,2BAA2B,EAC3B,KAAK,qBAAqB,EAC1B,KAAK,qBAAqB,EAC1B,KAAK,mCAAmC,GACzC,MAAM,cAAc,CAAA;AAErB,OAAO,EACL,sBAAsB,EACtB,uBAAuB,EACvB,KAAK,uBAAuB,EAC5B,KAAK,6BAA6B,EAClC,KAAK,uBAAuB,EAC5B,KAAK,sBAAsB,GAC5B,MAAM,eAAe,CAAA;AAEtB,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,KAAK,eAAe,GACrB,MAAM,cAAc,CAAA"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { AGENT_HOST_INSTALL_ROOT_ENV, AGENT_HOST_PROTOCOL_VERSION, HostIntegrityError, compareHostVersions, compareHostVersions as compareRuntimeVersions, computeBufferSha256, computeFileSha256Sync, currentInstallFilePath, isValidSemver, isValidSha256, listInstalledHostVersions, parseHostBundleManifest, pruneOldHostVersions, readCurrentHostInstall, registerHostVersion, resolveAgentHostInstallRoot, selectHighestHostVersion, versionsDirectoryPath, } from './installStore.js';
|
|
2
|
+
export { AGENT_HOST_FEED_URL_ENV, DEFAULT_AGENT_HOST_FEED_URL, checkAndStageAgentHostUpdate, parseAgentHostFeedManifest, parseSha256Sums, resolvePlatformArtifactName, } from './updater.js';
|
|
3
|
+
export { resolveSharedHostEntry, stageBundledHostIfNewer, } from './launcher.js';
|
|
4
|
+
export { createTarGzBuffer, extractTarGzBuffer, } from './archive.js';
|
|
5
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,2BAA2B,EAC3B,2BAA2B,EAC3B,kBAAkB,EAClB,mBAAmB,EACnB,mBAAmB,IAAI,sBAAsB,EAC7C,mBAAmB,EACnB,qBAAqB,EACrB,sBAAsB,EACtB,aAAa,EACb,aAAa,EACb,yBAAyB,EACzB,uBAAuB,EACvB,oBAAoB,EACpB,sBAAsB,EACtB,mBAAmB,EACnB,2BAA2B,EAC3B,wBAAwB,EACxB,qBAAqB,GAQtB,MAAM,mBAAmB,CAAA;AAE1B,OAAO,EACL,uBAAuB,EACvB,2BAA2B,EAC3B,4BAA4B,EAC5B,0BAA0B,EAC1B,eAAe,EACf,2BAA2B,GAI5B,MAAM,cAAc,CAAA;AAErB,OAAO,EACL,sBAAsB,EACtB,uBAAuB,GAKxB,MAAM,eAAe,CAAA;AAEtB,OAAO,EACL,iBAAiB,EACjB,kBAAkB,GAEnB,MAAM,cAAc,CAAA"}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
export declare const AGENT_HOST_INSTALL_ROOT_ENV = "XENO_AGENT_HOST_INSTALL_ROOT";
|
|
2
|
+
export declare const AGENT_HOST_PROTOCOL_VERSION = 1;
|
|
3
|
+
export declare class HostIntegrityError extends Error {
|
|
4
|
+
readonly expectedSha256: string;
|
|
5
|
+
readonly actualSha256: string;
|
|
6
|
+
readonly target: string;
|
|
7
|
+
constructor(target: string, expectedSha256: string, actualSha256: string);
|
|
8
|
+
}
|
|
9
|
+
export interface ResolveAgentHostInstallRootOptions {
|
|
10
|
+
installRoot?: string;
|
|
11
|
+
homeDirectory?: string;
|
|
12
|
+
env?: Readonly<Record<string, string | undefined>>;
|
|
13
|
+
}
|
|
14
|
+
export interface HostInstallRecord {
|
|
15
|
+
readonly schemaVersion: 1;
|
|
16
|
+
readonly version: string;
|
|
17
|
+
readonly entryPath: string;
|
|
18
|
+
readonly sha256: string;
|
|
19
|
+
readonly protocolVersion: number;
|
|
20
|
+
readonly updatedAt: string;
|
|
21
|
+
}
|
|
22
|
+
export interface InstalledHostVersion {
|
|
23
|
+
readonly version: string;
|
|
24
|
+
readonly versionDir: string;
|
|
25
|
+
readonly entryPath: string;
|
|
26
|
+
readonly sha256: string;
|
|
27
|
+
readonly protocolVersion: number;
|
|
28
|
+
readonly manifestPath?: string;
|
|
29
|
+
}
|
|
30
|
+
export interface HostBundleManifest {
|
|
31
|
+
readonly name: string;
|
|
32
|
+
readonly version: string;
|
|
33
|
+
readonly protocolVersion: number;
|
|
34
|
+
readonly entry: string;
|
|
35
|
+
readonly sha256: string;
|
|
36
|
+
readonly accountWorkerEntry?: string;
|
|
37
|
+
readonly builtAt?: string;
|
|
38
|
+
}
|
|
39
|
+
export interface ReadHostInstallOptions {
|
|
40
|
+
installRoot?: string;
|
|
41
|
+
homeDirectory?: string;
|
|
42
|
+
env?: Readonly<Record<string, string | undefined>>;
|
|
43
|
+
/** Verify the entry file's SHA-256 matches the recorded digest (default true). */
|
|
44
|
+
verifyIntegrity?: boolean;
|
|
45
|
+
}
|
|
46
|
+
export interface RegisterHostVersionOptions {
|
|
47
|
+
installRoot?: string;
|
|
48
|
+
homeDirectory?: string;
|
|
49
|
+
env?: Readonly<Record<string, string | undefined>>;
|
|
50
|
+
protocolVersion?: number;
|
|
51
|
+
now?: () => Date;
|
|
52
|
+
}
|
|
53
|
+
export interface PruneHostVersionsResult {
|
|
54
|
+
readonly kept: string[];
|
|
55
|
+
readonly removed: string[];
|
|
56
|
+
}
|
|
57
|
+
export declare function isValidSemver(value: string | undefined): value is string;
|
|
58
|
+
export declare function isValidSha256(value: string | undefined): value is string;
|
|
59
|
+
/**
|
|
60
|
+
* Compare two semver version strings (`x.y.z` with optional `-prerelease`).
|
|
61
|
+
* Missing or malformed versions sort strictly below any valid version.
|
|
62
|
+
*/
|
|
63
|
+
export declare function compareHostVersions(a: string | undefined, b: string | undefined): number;
|
|
64
|
+
export declare function computeBufferSha256(buffer: Uint8Array): string;
|
|
65
|
+
export declare function computeFileSha256Sync(filePath: string): string;
|
|
66
|
+
/**
|
|
67
|
+
* Resolves the per-user versioned Agent host install root.
|
|
68
|
+
*
|
|
69
|
+
* Precedence: explicit `installRoot` > `XENO_AGENT_HOST_INSTALL_ROOT` > `<primitives data>/agent-host`.
|
|
70
|
+
*/
|
|
71
|
+
export declare function resolveAgentHostInstallRoot(options?: string | ResolveAgentHostInstallRootOptions): string;
|
|
72
|
+
export declare function currentInstallFilePath(installRoot: string): string;
|
|
73
|
+
export declare function versionsDirectoryPath(installRoot: string): string;
|
|
74
|
+
export declare function parseHostBundleManifest(input: unknown): HostBundleManifest | null;
|
|
75
|
+
/**
|
|
76
|
+
* Reads `<installRoot>/current.json` and verifies the pointed entry exists (and matches its SHA-256).
|
|
77
|
+
* Returns `null` if absent, malformed, missing on disk, or failing integrity verification.
|
|
78
|
+
*/
|
|
79
|
+
export declare function readCurrentHostInstall(options?: string | ReadHostInstallOptions): HostInstallRecord | null;
|
|
80
|
+
/**
|
|
81
|
+
* Lists all valid installed host versions under `<installRoot>/versions/<semver>/` plus any valid
|
|
82
|
+
* `current.json` registration, sorted descending by semver (newest first).
|
|
83
|
+
*/
|
|
84
|
+
export declare function listInstalledHostVersions(options?: string | ReadHostInstallOptions): InstalledHostVersion[];
|
|
85
|
+
/**
|
|
86
|
+
* Selects the strictly highest valid semver version installed in the per-user host store.
|
|
87
|
+
*/
|
|
88
|
+
export declare function selectHighestHostVersion(options?: string | ReadHostInstallOptions): InstalledHostVersion | null;
|
|
89
|
+
/**
|
|
90
|
+
* Verifies the entry file's exact SHA-256 digest and atomically writes `<installRoot>/current.json`.
|
|
91
|
+
* Throws `HostIntegrityError` on tamper / digest mismatch before touching `current.json`.
|
|
92
|
+
*/
|
|
93
|
+
export declare function registerHostVersion(version: string, entryPath: string, sha256: string, options?: string | RegisterHostVersionOptions): Promise<HostInstallRecord>;
|
|
94
|
+
/**
|
|
95
|
+
* Removes older version directories under `<installRoot>/versions/`, keeping the newest `keepCount`
|
|
96
|
+
* versions and never removing the currently active version referenced by `current.json`.
|
|
97
|
+
*/
|
|
98
|
+
export declare function pruneOldHostVersions(keepCount?: number, options?: string | ResolveAgentHostInstallRootOptions): Promise<PruneHostVersionsResult>;
|
|
99
|
+
//# sourceMappingURL=installStore.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"installStore.d.ts","sourceRoot":"","sources":["../src/installStore.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,2BAA2B,iCAAiC,CAAA;AACzE,eAAO,MAAM,2BAA2B,IAAI,CAAA;AAM5C,qBAAa,kBAAmB,SAAQ,KAAK;IAC3C,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAA;IAC/B,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAA;IAC7B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;gBAEX,MAAM,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM;CAOzE;AAED,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