@amd-gaia/gaia 0.1.0 → 0.1.1
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 +93 -0
- package/LICENSE +21 -0
- package/README.md +200 -6
- package/SKILL.md +473 -0
- package/SPEC.md +393 -0
- package/binaries.lock.json +78 -0
- package/dist/cli.d.ts +41 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +368 -0
- package/dist/cli.js.map +1 -0
- package/dist/errors.d.ts +32 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +42 -0
- package/dist/errors.js.map +1 -0
- package/dist/fetch.d.ts +110 -0
- package/dist/fetch.d.ts.map +1 -0
- package/dist/fetch.js +217 -0
- package/dist/fetch.js.map +1 -0
- package/dist/index.d.ts +22 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +21 -0
- package/dist/index.js.map +1 -0
- package/dist/lifecycle.d.ts +145 -0
- package/dist/lifecycle.d.ts.map +1 -0
- package/dist/lifecycle.js +397 -0
- package/dist/lifecycle.js.map +1 -0
- package/dist/logger.d.ts +13 -0
- package/dist/logger.d.ts.map +1 -0
- package/dist/logger.js +30 -0
- package/dist/logger.js.map +1 -0
- package/dist/platform.d.ts +100 -0
- package/dist/platform.d.ts.map +1 -0
- package/dist/platform.js +202 -0
- package/dist/platform.js.map +1 -0
- package/dist/url.d.ts +4 -0
- package/dist/url.d.ts.map +1 -0
- package/dist/url.js +22 -0
- package/dist/url.js.map +1 -0
- package/package.json +66 -15
package/dist/fetch.js
ADDED
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
// Copyright(C) 2025-2026 Advanced Micro Devices, Inc. All rights reserved.
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
/**
|
|
4
|
+
* Binary fetcher for both components (`sidecar` and `tui`).
|
|
5
|
+
*
|
|
6
|
+
* Resolves the current platform → looks the component up in
|
|
7
|
+
* `binaries.lock.json` → downloads it from THAT COMPONENT's base URL
|
|
8
|
+
* (overridable) → **verifies its SHA-256 against the lock and fails loudly on
|
|
9
|
+
* any mismatch** → writes it into a cache dir → `chmod +x` on POSIX.
|
|
10
|
+
*
|
|
11
|
+
* The two components come from different hub lanes: the sidecar from
|
|
12
|
+
* `agents/gaia/<agentVersion>/`, the TUI from `agents/terminal-hub/<tuiVersion>/`
|
|
13
|
+
* (the same binary a core install runs as `gaia tui`). Each entry's base URL
|
|
14
|
+
* comes from its own component, never from a shared top-level one.
|
|
15
|
+
*
|
|
16
|
+
* The SHA verify is the security boundary: a tampered, truncated, or
|
|
17
|
+
* not-yet-published artifact is rejected before it can ever be spawned. There is
|
|
18
|
+
* NO "use it anyway" path, and a placeholder hash in the lock blocks the fetch
|
|
19
|
+
* outright rather than degrading to an unverified download.
|
|
20
|
+
*/
|
|
21
|
+
import crypto from "node:crypto";
|
|
22
|
+
import fs from "node:fs";
|
|
23
|
+
import fsp from "node:fs/promises";
|
|
24
|
+
import os from "node:os";
|
|
25
|
+
import path from "node:path";
|
|
26
|
+
import { IntegrityError, PlatformError } from "./errors.js";
|
|
27
|
+
import { createLogger } from "./logger.js";
|
|
28
|
+
import { joinUrl } from "./url.js";
|
|
29
|
+
import { componentBaseUrl, currentPlatformKey, defaultLockPath, isPlaceholderSha, loadLock, resolveEntry, } from "./platform.js";
|
|
30
|
+
const log = createLogger("fetch");
|
|
31
|
+
/**
|
|
32
|
+
* Where verified binaries are cached, keyed by agent version so a version bump
|
|
33
|
+
* never reuses the previous release's executables.
|
|
34
|
+
*/
|
|
35
|
+
export function defaultCacheDir(agentVersion) {
|
|
36
|
+
return path.join(os.homedir(), ".gaia", "npm-cache", `gaia-${agentVersion}`);
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* The daemon's own sidecar cache — `~/.gaia/agents/gaia/`, mirroring
|
|
40
|
+
* `gaia.daemon.sidecars.fetch.default_cache_dir("gaia")`. Staging the verified
|
|
41
|
+
* sidecar here means the daemon's own fetch is a SHA-256 cache hit instead of a
|
|
42
|
+
* second download. This path is a cross-repo contract with the daemon.
|
|
43
|
+
*/
|
|
44
|
+
export function daemonSidecarCacheDir(agentId = "gaia") {
|
|
45
|
+
return path.join(os.homedir(), ".gaia", "agents", agentId);
|
|
46
|
+
}
|
|
47
|
+
function sha256Hex(buf) {
|
|
48
|
+
return crypto.createHash("sha256").update(buf).digest("hex");
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* SHA-256 of a file on disk, or null when it is simply absent. Any other error
|
|
52
|
+
* (a permission problem, a directory in the way) is re-raised: reading it as
|
|
53
|
+
* "no cache" would trigger a re-download that then fails on write with a far
|
|
54
|
+
* less useful message.
|
|
55
|
+
*/
|
|
56
|
+
export async function fileSha256(filePath) {
|
|
57
|
+
try {
|
|
58
|
+
return sha256Hex(await fsp.readFile(filePath));
|
|
59
|
+
}
|
|
60
|
+
catch (e) {
|
|
61
|
+
const code = e.code;
|
|
62
|
+
if (code === "ENOENT")
|
|
63
|
+
return null;
|
|
64
|
+
throw new Error(`cannot read the cached binary at ${filePath} to check its hash: ${e.message}. ` +
|
|
65
|
+
"Fix the permissions on that path, or pass a different --cache-dir / --sidecar-dir.", { cause: e });
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Verify a buffer against an expected SHA-256. Throws `IntegrityError` loudly on
|
|
70
|
+
* mismatch — this is the no-silent-fallback integrity gate.
|
|
71
|
+
*/
|
|
72
|
+
export function verifySha256(buf, expected, sourceLabel) {
|
|
73
|
+
const actual = sha256Hex(buf);
|
|
74
|
+
if (actual.toLowerCase() !== expected.toLowerCase()) {
|
|
75
|
+
throw new IntegrityError(`SHA-256 mismatch for ${sourceLabel}:\n` +
|
|
76
|
+
` expected ${expected}\n` +
|
|
77
|
+
` actual ${actual}\n` +
|
|
78
|
+
"Refusing to use a binary that does not match binaries.lock.json. " +
|
|
79
|
+
"The download may be corrupt, truncated, or tampered with. Re-run the fetch; " +
|
|
80
|
+
"if it persists, the lock is stale relative to the published artifact — " +
|
|
81
|
+
"report it at https://github.com/amd/gaia/issues.");
|
|
82
|
+
}
|
|
83
|
+
return actual;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Fetch + verify + install one component's binary for the current platform.
|
|
87
|
+
*
|
|
88
|
+
* @throws PlatformError unsupported platform / incomplete entry / placeholder hash
|
|
89
|
+
* @throws IntegrityError SHA-256 mismatch
|
|
90
|
+
* @throws Error download/network failure (HTTP status surfaced)
|
|
91
|
+
*/
|
|
92
|
+
export async function fetchBinary(opts) {
|
|
93
|
+
if (!opts?.outDir) {
|
|
94
|
+
throw new TypeError("fetchBinary requires an outDir to write the binary into");
|
|
95
|
+
}
|
|
96
|
+
if (!opts?.component) {
|
|
97
|
+
throw new TypeError('fetchBinary requires a component ("sidecar" or "tui")');
|
|
98
|
+
}
|
|
99
|
+
const fetchImpl = opts.fetchImpl ?? globalThis.fetch;
|
|
100
|
+
if (typeof fetchImpl !== "function") {
|
|
101
|
+
throw new TypeError("global fetch unavailable — use Node >= 18 or pass fetchImpl");
|
|
102
|
+
}
|
|
103
|
+
const lock = opts.lock ?? loadLock(opts.lockPath ?? defaultLockPath());
|
|
104
|
+
const platformKey = opts.platformKey ?? currentPlatformKey();
|
|
105
|
+
const entry = resolveEntry(lock, opts.component, platformKey);
|
|
106
|
+
// Per-component: the sidecar and the TUI live in different hub lanes at
|
|
107
|
+
// different versions, so there is no single base URL to fall back to.
|
|
108
|
+
const baseUrl = opts.baseUrl ?? componentBaseUrl(lock, opts.component);
|
|
109
|
+
if (isPlaceholderSha(entry.sha256)) {
|
|
110
|
+
throw new PlatformError(`binaries.lock.json has a placeholder sha256 for ${opts.component}/'${platformKey}' ` +
|
|
111
|
+
`(${entry.sha256}), so no verifiable binary is published for it in this build. ` +
|
|
112
|
+
"Fetch is blocked so an unverifiable binary can never be trusted. " +
|
|
113
|
+
"Install a released @amd-gaia/gaia, or build the binary locally " +
|
|
114
|
+
"(hub/agents/gaia/python/packaging for the sidecar, `make -C tui cross-compile` " +
|
|
115
|
+
"for the TUI) and point the lifecycle helpers at it directly.");
|
|
116
|
+
}
|
|
117
|
+
const outDir = path.resolve(opts.outDir);
|
|
118
|
+
await fsp.mkdir(outDir, { recursive: true });
|
|
119
|
+
const binaryPath = path.join(outDir, entry.executable);
|
|
120
|
+
const url = joinUrl(baseUrl, entry.filename);
|
|
121
|
+
if (!opts.force) {
|
|
122
|
+
const existing = await fileSha256(binaryPath);
|
|
123
|
+
if (existing && existing.toLowerCase() === entry.sha256.toLowerCase()) {
|
|
124
|
+
log.debug(`cache hit: ${binaryPath} already matches lock sha256`);
|
|
125
|
+
// Re-apply the exec bit: an interrupted earlier run or a restrictive umask
|
|
126
|
+
// can leave correct bytes that still cannot be spawned.
|
|
127
|
+
if (process.platform !== "win32")
|
|
128
|
+
await fsp.chmod(binaryPath, 0o755);
|
|
129
|
+
return {
|
|
130
|
+
component: opts.component,
|
|
131
|
+
binaryPath,
|
|
132
|
+
platformKey,
|
|
133
|
+
sha256: existing,
|
|
134
|
+
url,
|
|
135
|
+
cached: true,
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
log.info(`downloading ${opts.component} for ${platformKey} from ${url}`);
|
|
140
|
+
const timeoutMs = opts.timeoutMs ?? 300_000;
|
|
141
|
+
const controller = new AbortController();
|
|
142
|
+
const timer = setTimeout(() => controller.abort(), timeoutMs);
|
|
143
|
+
let buf;
|
|
144
|
+
try {
|
|
145
|
+
const res = await fetchImpl(url, {
|
|
146
|
+
headers: { accept: "application/octet-stream" },
|
|
147
|
+
signal: controller.signal,
|
|
148
|
+
});
|
|
149
|
+
if (!res.ok) {
|
|
150
|
+
throw new Error(`download failed: HTTP ${res.status} ${res.statusText} for ${url}. ` +
|
|
151
|
+
"Check the base URL and that the artifact is published for this platform.");
|
|
152
|
+
}
|
|
153
|
+
buf = Buffer.from(await res.arrayBuffer());
|
|
154
|
+
}
|
|
155
|
+
catch (e) {
|
|
156
|
+
if (e.name === "AbortError") {
|
|
157
|
+
throw new Error(`download timed out after ${timeoutMs}ms for ${url}`);
|
|
158
|
+
}
|
|
159
|
+
throw e;
|
|
160
|
+
}
|
|
161
|
+
finally {
|
|
162
|
+
clearTimeout(timer);
|
|
163
|
+
}
|
|
164
|
+
log.debug(`downloaded ${buf.length} bytes`);
|
|
165
|
+
const sha = verifySha256(buf, entry.sha256, `${opts.component} ${platformKey} (${url})`);
|
|
166
|
+
// Write to a temp then rename, so a crash mid-write never leaves a
|
|
167
|
+
// half-written file that a later run would treat as a real binary.
|
|
168
|
+
const tmp = `${binaryPath}.download.${process.pid}`;
|
|
169
|
+
try {
|
|
170
|
+
await fsp.writeFile(tmp, buf);
|
|
171
|
+
await fsp.rename(tmp, binaryPath);
|
|
172
|
+
}
|
|
173
|
+
catch (e) {
|
|
174
|
+
await fsp.rm(tmp, { force: true }).catch(() => undefined);
|
|
175
|
+
throw e;
|
|
176
|
+
}
|
|
177
|
+
if (process.platform !== "win32") {
|
|
178
|
+
await fsp.chmod(binaryPath, 0o755);
|
|
179
|
+
}
|
|
180
|
+
log.info(`installed verified ${opts.component} -> ${binaryPath}`);
|
|
181
|
+
return {
|
|
182
|
+
component: opts.component,
|
|
183
|
+
binaryPath,
|
|
184
|
+
platformKey,
|
|
185
|
+
sha256: sha,
|
|
186
|
+
url,
|
|
187
|
+
cached: false,
|
|
188
|
+
};
|
|
189
|
+
}
|
|
190
|
+
/**
|
|
191
|
+
* Fetch + verify BOTH binaries. Sequential on purpose: the sidecar is the large
|
|
192
|
+
* download and a failure there should not race a half-finished TUI download.
|
|
193
|
+
*
|
|
194
|
+
* The sidecar lands in the daemon's own cache dir so the daemon — which owns
|
|
195
|
+
* spawning it — finds it already verified instead of downloading it again.
|
|
196
|
+
*/
|
|
197
|
+
export async function fetchAll(opts = {}) {
|
|
198
|
+
const lock = opts.lock ?? loadLock(opts.lockPath ?? defaultLockPath());
|
|
199
|
+
const platformKey = opts.platformKey ?? currentPlatformKey();
|
|
200
|
+
const common = { ...opts, lock, platformKey };
|
|
201
|
+
const sidecar = await fetchBinary({
|
|
202
|
+
...common,
|
|
203
|
+
component: "sidecar",
|
|
204
|
+
outDir: opts.sidecarDir ?? daemonSidecarCacheDir(),
|
|
205
|
+
});
|
|
206
|
+
const tui = await fetchBinary({
|
|
207
|
+
...common,
|
|
208
|
+
component: "tui",
|
|
209
|
+
outDir: opts.tuiDir ?? defaultCacheDir(lock.agentVersion),
|
|
210
|
+
});
|
|
211
|
+
return { sidecar, tui, lock };
|
|
212
|
+
}
|
|
213
|
+
/** Sync existence check, for the lifecycle layer. */
|
|
214
|
+
export function binaryExists(binaryPath) {
|
|
215
|
+
return fs.existsSync(binaryPath);
|
|
216
|
+
}
|
|
217
|
+
//# sourceMappingURL=fetch.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fetch.js","sourceRoot":"","sources":["../src/fetch.ts"],"names":[],"mappings":"AAAA,2EAA2E;AAC3E,+BAA+B;AAC/B;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,MAAM,MAAM,aAAa,CAAC;AACjC,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,GAAG,MAAM,kBAAkB,CAAC;AACnC,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AACnC,OAAO,EAIL,gBAAgB,EAChB,kBAAkB,EAClB,eAAe,EACf,gBAAgB,EAChB,QAAQ,EACR,YAAY,GACb,MAAM,eAAe,CAAC;AAEvB,MAAM,GAAG,GAAG,YAAY,CAAC,OAAO,CAAC,CAAC;AAElC;;;GAGG;AACH,MAAM,UAAU,eAAe,CAAC,YAAoB;IA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,eAAe,CAAC,IAAI,CAAC,YAAY,CAAC;KAC1D,CAAC,CAAC;IACH,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,CAAC;AAChC,CAAC;AAED,qDAAqD;AACrD,MAAM,UAAU,YAAY,CAAC,UAAkB;IAC7C,OAAO,EAAE,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC;AACnC,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @amd-gaia/gaia — binary fetcher + process lifecycle for the GAIA flagship
|
|
3
|
+
* agent sidecar and the GAIA terminal UI.
|
|
4
|
+
*
|
|
5
|
+
* The CLI (`npx @amd-gaia/gaia`) is the normal way in. These exports are for
|
|
6
|
+
* integrators who want the pieces:
|
|
7
|
+
*
|
|
8
|
+
* import { fetchAll, startSidecar, shutdown } from "@amd-gaia/gaia";
|
|
9
|
+
*
|
|
10
|
+
* const { sidecar, tui } = await fetchAll(); // both, SHA-256 verified
|
|
11
|
+
* const proc = await startSidecar({ binaryPath: sidecar.binaryPath });
|
|
12
|
+
* const res = await fetch(`${proc.baseUrl}/v1/gaia/query`, { ... });
|
|
13
|
+
* await shutdown(proc);
|
|
14
|
+
*/
|
|
15
|
+
export { fetchAll, fetchBinary, verifySha256, fileSha256, binaryExists, defaultCacheDir, daemonSidecarCacheDir, } from "./fetch.js";
|
|
16
|
+
export type { FetchOptions, FetchResult, FetchAllOptions, FetchAllResult, } from "./fetch.js";
|
|
17
|
+
export { AGENT_ID, API_VERSION, DEFAULT_HOST, DEFAULT_PORT, RESERVED_PORT, checkVersion, health, resolveSidecarPath, resolveTuiPath, runTui, shutdown, sidecarExecutableName, spawnSidecar, startSidecar, tuiExecutableName, version, waitForHealth, } from "./lifecycle.js";
|
|
18
|
+
export type { HealthResponse, ResolveOptions, RunTuiOptions, Sidecar, SpawnOptions, StartOptions, VersionCheckOptions, VersionResponse, WaitForHealthOptions, } from "./lifecycle.js";
|
|
19
|
+
export { COMPONENTS, SCHEMA_MAJOR, SUPPORTED_PLATFORMS, SUPPORTED_SIDECAR_PLATFORMS, SUPPORTED_TUI_PLATFORMS, TUI_ARTIFACT_NAMES, componentBaseUrl, componentLock, currentPlatformKey, defaultLockPath, isPlaceholderSha, loadLock, platformsFor, resolveEntry, } from "./platform.js";
|
|
20
|
+
export type { BinaryLock, BinaryLockEntry, ComponentLock, ComponentName, } from "./platform.js";
|
|
21
|
+
export { BinaryNotFoundError, GaiaError, HealthTimeoutError, HttpError, IntegrityError, PlatformError, VersionMismatchError, } from "./errors.js";
|
|
22
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EACL,QAAQ,EACR,WAAW,EACX,YAAY,EACZ,UAAU,EACV,YAAY,EACZ,eAAe,EACf,qBAAqB,GACtB,MAAM,YAAY,CAAC;AACpB,YAAY,EACV,YAAY,EACZ,WAAW,EACX,eAAe,EACf,cAAc,GACf,MAAM,YAAY,CAAC;AAEpB,OAAO,EACL,QAAQ,EACR,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,YAAY,EACZ,MAAM,EACN,kBAAkB,EAClB,cAAc,EACd,MAAM,EACN,QAAQ,EACR,qBAAqB,EACrB,YAAY,EACZ,YAAY,EACZ,iBAAiB,EACjB,OAAO,EACP,aAAa,GACd,MAAM,gBAAgB,CAAC;AACxB,YAAY,EACV,cAAc,EACd,cAAc,EACd,aAAa,EACb,OAAO,EACP,YAAY,EACZ,YAAY,EACZ,mBAAmB,EACnB,eAAe,EACf,oBAAoB,GACrB,MAAM,gBAAgB,CAAC;AAExB,OAAO,EACL,UAAU,EACV,YAAY,EACZ,mBAAmB,EACnB,2BAA2B,EAC3B,uBAAuB,EACvB,kBAAkB,EAClB,gBAAgB,EAChB,aAAa,EACb,kBAAkB,EAClB,eAAe,EACf,gBAAgB,EAChB,QAAQ,EACR,YAAY,EACZ,YAAY,GACb,MAAM,eAAe,CAAC;AACvB,YAAY,EACV,UAAU,EACV,eAAe,EACf,aAAa,EACb,aAAa,GACd,MAAM,eAAe,CAAC;AAEvB,OAAO,EACL,mBAAmB,EACnB,SAAS,EACT,kBAAkB,EAClB,SAAS,EACT,cAAc,EACd,aAAa,EACb,oBAAoB,GACrB,MAAM,aAAa,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
// Copyright(C) 2025-2026 Advanced Micro Devices, Inc. All rights reserved.
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
/**
|
|
4
|
+
* @amd-gaia/gaia — binary fetcher + process lifecycle for the GAIA flagship
|
|
5
|
+
* agent sidecar and the GAIA terminal UI.
|
|
6
|
+
*
|
|
7
|
+
* The CLI (`npx @amd-gaia/gaia`) is the normal way in. These exports are for
|
|
8
|
+
* integrators who want the pieces:
|
|
9
|
+
*
|
|
10
|
+
* import { fetchAll, startSidecar, shutdown } from "@amd-gaia/gaia";
|
|
11
|
+
*
|
|
12
|
+
* const { sidecar, tui } = await fetchAll(); // both, SHA-256 verified
|
|
13
|
+
* const proc = await startSidecar({ binaryPath: sidecar.binaryPath });
|
|
14
|
+
* const res = await fetch(`${proc.baseUrl}/v1/gaia/query`, { ... });
|
|
15
|
+
* await shutdown(proc);
|
|
16
|
+
*/
|
|
17
|
+
export { fetchAll, fetchBinary, verifySha256, fileSha256, binaryExists, defaultCacheDir, daemonSidecarCacheDir, } from "./fetch.js";
|
|
18
|
+
export { AGENT_ID, API_VERSION, DEFAULT_HOST, DEFAULT_PORT, RESERVED_PORT, checkVersion, health, resolveSidecarPath, resolveTuiPath, runTui, shutdown, sidecarExecutableName, spawnSidecar, startSidecar, tuiExecutableName, version, waitForHealth, } from "./lifecycle.js";
|
|
19
|
+
export { COMPONENTS, SCHEMA_MAJOR, SUPPORTED_PLATFORMS, SUPPORTED_SIDECAR_PLATFORMS, SUPPORTED_TUI_PLATFORMS, TUI_ARTIFACT_NAMES, componentBaseUrl, componentLock, currentPlatformKey, defaultLockPath, isPlaceholderSha, loadLock, platformsFor, resolveEntry, } from "./platform.js";
|
|
20
|
+
export { BinaryNotFoundError, GaiaError, HealthTimeoutError, HttpError, IntegrityError, PlatformError, VersionMismatchError, } from "./errors.js";
|
|
21
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,2EAA2E;AAC3E,+BAA+B;AAC/B;;;;;;;;;;;;;GAaG;AAEH,OAAO,EACL,QAAQ,EACR,WAAW,EACX,YAAY,EACZ,UAAU,EACV,YAAY,EACZ,eAAe,EACf,qBAAqB,GACtB,MAAM,YAAY,CAAC;AAQpB,OAAO,EACL,QAAQ,EACR,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,YAAY,EACZ,MAAM,EACN,kBAAkB,EAClB,cAAc,EACd,MAAM,EACN,QAAQ,EACR,qBAAqB,EACrB,YAAY,EACZ,YAAY,EACZ,iBAAiB,EACjB,OAAO,EACP,aAAa,GACd,MAAM,gBAAgB,CAAC;AAaxB,OAAO,EACL,UAAU,EACV,YAAY,EACZ,mBAAmB,EACnB,2BAA2B,EAC3B,uBAAuB,EACvB,kBAAkB,EAClB,gBAAgB,EAChB,aAAa,EACb,kBAAkB,EAClB,eAAe,EACf,gBAAgB,EAChB,QAAQ,EACR,YAAY,EACZ,YAAY,GACb,MAAM,eAAe,CAAC;AAQvB,OAAO,EACL,mBAAmB,EACnB,SAAS,EACT,kBAAkB,EAClB,SAAS,EACT,cAAc,EACd,aAAa,EACb,oBAAoB,GACrB,MAAM,aAAa,CAAC"}
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Process lifecycle for the two binaries this package installs.
|
|
3
|
+
*
|
|
4
|
+
* **Sidecar** — locate the frozen binary, spawn it, poll `GET /health`, check the
|
|
5
|
+
* contract version via `GET /version`, and shut it down killing the whole process
|
|
6
|
+
* tree. Tree-kill matters: a PyInstaller one-file build spawns a child uvicorn
|
|
7
|
+
* process that `child.kill()` on the parent does NOT reap, leaving the port held.
|
|
8
|
+
*
|
|
9
|
+
* **TUI** — exec it with stdio inherited and propagate its exit code, so the
|
|
10
|
+
* terminal UI owns the terminal completely.
|
|
11
|
+
*
|
|
12
|
+
* Note on who spawns the sidecar in the normal `gaia` flow: the GAIA daemon does.
|
|
13
|
+
* The TUI reaches agents through the daemon's relay and deliberately never holds a
|
|
14
|
+
* sidecar bearer token, so `gaia run` stages the *verified* sidecar binary into the
|
|
15
|
+
* daemon's cache and lets the daemon own its process. The helpers below are the
|
|
16
|
+
* direct path — used by `gaia serve` and by programmatic integrators who want the
|
|
17
|
+
* REST surface without a daemon.
|
|
18
|
+
*/
|
|
19
|
+
import { type ChildProcess } from "node:child_process";
|
|
20
|
+
export declare const DEFAULT_HOST = "127.0.0.1";
|
|
21
|
+
/** Matches `gaia_agent_gaia.server.DEFAULT_PORT`. NEVER 4001 (repo-reserved). */
|
|
22
|
+
export declare const DEFAULT_PORT = 8141;
|
|
23
|
+
/** Repo-wide reserved port. Nothing here may ever bind it. */
|
|
24
|
+
export declare const RESERVED_PORT = 4001;
|
|
25
|
+
/** The apiVersion this package is built against (`server.py: API_VERSION`). */
|
|
26
|
+
export declare const API_VERSION = "2.12";
|
|
27
|
+
/** The agent id in the sidecar's route prefix (`/v1/gaia/...`). */
|
|
28
|
+
export declare const AGENT_ID = "gaia";
|
|
29
|
+
/** `GET /health` response. */
|
|
30
|
+
export interface HealthResponse {
|
|
31
|
+
status: string;
|
|
32
|
+
service?: string;
|
|
33
|
+
}
|
|
34
|
+
/** `GET /version` response — the key names are a contract, not a convention. */
|
|
35
|
+
export interface VersionResponse {
|
|
36
|
+
apiVersion: string;
|
|
37
|
+
agentVersion: string;
|
|
38
|
+
}
|
|
39
|
+
/** Basename the sidecar executable is written as (matches the lock). */
|
|
40
|
+
export declare function sidecarExecutableName(platform?: NodeJS.Platform): string;
|
|
41
|
+
/**
|
|
42
|
+
* Basename the TUI executable is written as. Deliberately `gaia-tui`, not
|
|
43
|
+
* `gaia`: npm installs its own `gaia` bin shim, and a same-named executable in a
|
|
44
|
+
* cache dir on PATH would shadow it.
|
|
45
|
+
*/
|
|
46
|
+
export declare function tuiExecutableName(platform?: NodeJS.Platform): string;
|
|
47
|
+
export interface ResolveOptions {
|
|
48
|
+
/** Directory the binary was fetched into. */
|
|
49
|
+
resourcesDir: string;
|
|
50
|
+
/** Override the executable basename (defaults per-platform). */
|
|
51
|
+
executable?: string;
|
|
52
|
+
}
|
|
53
|
+
export declare function resolveSidecarPath(opts: ResolveOptions): string;
|
|
54
|
+
export declare function resolveTuiPath(opts: ResolveOptions): string;
|
|
55
|
+
export interface SpawnOptions {
|
|
56
|
+
/** Absolute path to the sidecar binary. */
|
|
57
|
+
binaryPath: string;
|
|
58
|
+
/** Bind host. Default 127.0.0.1. */
|
|
59
|
+
host?: string;
|
|
60
|
+
/** Bind port. Default 8141. NEVER 4001. */
|
|
61
|
+
port?: number;
|
|
62
|
+
/** Extra CLI args appended verbatim. */
|
|
63
|
+
extraArgs?: string[];
|
|
64
|
+
/** Extra env vars merged over process.env. */
|
|
65
|
+
env?: NodeJS.ProcessEnv;
|
|
66
|
+
/**
|
|
67
|
+
* Reap this sidecar if the parent exits, crashes, or is interrupted without an
|
|
68
|
+
* explicit `shutdown()`. Default `true` — the frozen binary's detached child
|
|
69
|
+
* must never outlive us holding the port. Set `false` to own the lifecycle.
|
|
70
|
+
*/
|
|
71
|
+
autoCleanup?: boolean;
|
|
72
|
+
}
|
|
73
|
+
/** A running sidecar handle. */
|
|
74
|
+
export interface Sidecar {
|
|
75
|
+
child: ChildProcess;
|
|
76
|
+
host: string;
|
|
77
|
+
port: number;
|
|
78
|
+
baseUrl: string;
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Spawn the frozen sidecar. Does NOT wait for readiness — call `waitForHealth`
|
|
82
|
+
* (or `startSidecar`, which does both).
|
|
83
|
+
*/
|
|
84
|
+
export declare function spawnSidecar(opts: SpawnOptions): Sidecar;
|
|
85
|
+
/** `GET /health` — liveness only; it does not mean a model is loaded. */
|
|
86
|
+
export declare function health(baseUrl: string, timeoutMs?: number): Promise<HealthResponse>;
|
|
87
|
+
/** `GET /version` — the contract probe (`{ apiVersion, agentVersion }`). */
|
|
88
|
+
export declare function version(baseUrl: string, timeoutMs?: number): Promise<VersionResponse>;
|
|
89
|
+
export interface WaitForHealthOptions {
|
|
90
|
+
/** Total time to wait before failing loudly. Default 60000ms. */
|
|
91
|
+
timeoutMs?: number;
|
|
92
|
+
/** Poll interval. Default 250ms. */
|
|
93
|
+
intervalMs?: number;
|
|
94
|
+
/** Abort the wait early (e.g. the process being probed died). */
|
|
95
|
+
signal?: AbortSignal;
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Poll `GET /health` until the sidecar reports ok, or throw `HealthTimeoutError`.
|
|
99
|
+
* Never silently assumes ready.
|
|
100
|
+
*/
|
|
101
|
+
export declare function waitForHealth(baseUrl: string, opts?: WaitForHealthOptions): Promise<void>;
|
|
102
|
+
export interface VersionCheckOptions {
|
|
103
|
+
/** apiVersion this package was built against. Default API_VERSION ("2.12"). */
|
|
104
|
+
expectedApiVersion?: string;
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Fetch `/version` and refuse a sidecar whose apiVersion MAJOR differs from what
|
|
108
|
+
* this package expects. A major bump is a breaking contract change; a higher
|
|
109
|
+
* minor (same major) is a backward-compatible addition and is accepted.
|
|
110
|
+
*/
|
|
111
|
+
export declare function checkVersion(baseUrl: string, opts?: VersionCheckOptions): Promise<VersionResponse>;
|
|
112
|
+
/**
|
|
113
|
+
* Shut the sidecar down, killing the whole process tree. Resolves once the
|
|
114
|
+
* process has exited (or immediately if it already had).
|
|
115
|
+
*/
|
|
116
|
+
export declare function shutdown(sidecar: Sidecar, timeoutMs?: number): Promise<void>;
|
|
117
|
+
export interface StartOptions extends SpawnOptions {
|
|
118
|
+
/** Health-wait timeout. Default 60000ms (a cold frozen binary unpacks first). */
|
|
119
|
+
healthTimeoutMs?: number;
|
|
120
|
+
/** Verify the contract apiVersion after health. Default true. */
|
|
121
|
+
verifyVersion?: boolean;
|
|
122
|
+
/** apiVersion this package expects. Default API_VERSION. */
|
|
123
|
+
expectedApiVersion?: string;
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* Spawn → wait for health → (optionally) version-check. On any failure the
|
|
127
|
+
* sidecar is shut down before rethrowing, so a failed start never leaks a
|
|
128
|
+
* process.
|
|
129
|
+
*/
|
|
130
|
+
export declare function startSidecar(opts: StartOptions): Promise<Sidecar>;
|
|
131
|
+
export interface RunTuiOptions {
|
|
132
|
+
/** Absolute path to the gaia-tui binary. */
|
|
133
|
+
binaryPath: string;
|
|
134
|
+
/** Args forwarded verbatim to the TUI. */
|
|
135
|
+
args?: string[];
|
|
136
|
+
/** Extra env merged over process.env. */
|
|
137
|
+
env?: NodeJS.ProcessEnv;
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* Run the TUI in the foreground with stdio inherited and resolve with its exit
|
|
141
|
+
* code. A signal-terminated TUI resolves as 128 + signum, the shell convention,
|
|
142
|
+
* so a Ctrl+C is distinguishable from a clean exit 0.
|
|
143
|
+
*/
|
|
144
|
+
export declare function runTui(opts: RunTuiOptions): Promise<number>;
|
|
145
|
+
//# sourceMappingURL=lifecycle.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lifecycle.d.ts","sourceRoot":"","sources":["../src/lifecycle.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAE,KAAK,YAAY,EAAoB,MAAM,oBAAoB,CAAC;AAezE,eAAO,MAAM,YAA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