@amalgm/shell 0.1.112 → 0.1.114
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/PURPOSE.md +75 -6
- package/README.md +36 -7
- package/dist/authorization/device-key.d.ts +19 -0
- package/dist/authorization/device-key.js +81 -0
- package/dist/authorization/device-key.js.map +1 -0
- package/dist/authorization/index.d.ts +65 -0
- package/dist/authorization/index.js +63 -0
- package/dist/authorization/index.js.map +1 -0
- package/dist/authorization/issuer.d.ts +11 -0
- package/dist/authorization/issuer.js +76 -0
- package/dist/authorization/issuer.js.map +1 -0
- package/dist/authorization/key-store.d.ts +15 -0
- package/dist/authorization/key-store.js +148 -0
- package/dist/authorization/key-store.js.map +1 -0
- package/dist/authorization/recovery-client.d.ts +19 -0
- package/dist/authorization/recovery-client.js +102 -0
- package/dist/authorization/recovery-client.js.map +1 -0
- package/dist/authorization/recovery-host.d.ts +28 -0
- package/dist/authorization/recovery-host.js +93 -0
- package/dist/authorization/recovery-host.js.map +1 -0
- package/dist/authorization/recovery.d.ts +13 -0
- package/dist/authorization/recovery.js +27 -0
- package/dist/authorization/recovery.js.map +1 -0
- package/dist/authorization/secret-process.d.ts +2 -0
- package/dist/authorization/secret-process.js +32 -0
- package/dist/authorization/secret-process.js.map +1 -0
- package/dist/boot.d.ts +19 -11
- package/dist/boot.js +34 -25
- package/dist/boot.js.map +1 -1
- package/dist/builtin-agents.d.ts +3 -0
- package/dist/builtin-agents.js +15 -0
- package/dist/builtin-agents.js.map +1 -0
- package/dist/chat-composition.d.ts +19 -0
- package/dist/chat-composition.js +83 -0
- package/dist/chat-composition.js.map +1 -0
- package/dist/chat-host.d.ts +9 -25
- package/dist/chat-host.js +12 -158
- package/dist/chat-host.js.map +1 -1
- package/dist/cli.js +21 -13
- package/dist/cli.js.map +1 -1
- package/dist/content-cache-host.d.ts +7 -0
- package/dist/content-cache-host.js +23 -1
- package/dist/content-cache-host.js.map +1 -1
- package/dist/credentials-host.d.ts +1 -5
- package/dist/credentials-host.js +1 -5
- package/dist/credentials-host.js.map +1 -1
- package/dist/entity-record-store.d.ts +2 -0
- package/dist/entity-record-store.js +15 -0
- package/dist/entity-record-store.js.map +1 -1
- package/dist/forward.js +1 -1
- package/dist/forward.js.map +1 -1
- package/dist/index.d.ts +7 -6
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/machine-host.d.ts +29 -0
- package/dist/machine-host.js +240 -10
- package/dist/machine-host.js.map +1 -1
- package/dist/parity.d.ts +1 -5
- package/dist/parity.js +4 -41
- package/dist/parity.js.map +1 -1
- package/dist/registry-graph.d.ts +61 -0
- package/dist/registry-graph.js +156 -0
- package/dist/registry-graph.js.map +1 -0
- package/dist/release-catalog.js +7 -4
- package/dist/release-catalog.js.map +1 -1
- package/dist/runtime-command-host.d.ts +11 -0
- package/dist/runtime-command-host.js +65 -0
- package/dist/runtime-command-host.js.map +1 -1
- package/dist/user-ground-host.d.ts +13 -0
- package/dist/user-ground-host.js +449 -205
- package/dist/user-ground-host.js.map +1 -1
- package/dist/wire-client.js +1 -1
- package/package.json +15 -6
- package/dist/chat-payloads-host.d.ts +0 -8
- package/dist/chat-payloads-host.js +0 -76
- package/dist/chat-payloads-host.js.map +0 -1
- package/dist/chat-relay-host.d.ts +0 -24
- package/dist/chat-relay-host.js +0 -90
- package/dist/chat-relay-host.js.map +0 -1
- package/dist/drivers/claude-code.d.ts +0 -27
- package/dist/drivers/claude-code.js +0 -72
- package/dist/drivers/claude-code.js.map +0 -1
- package/dist/paged-mutation-submit.d.ts +0 -28
- package/dist/paged-mutation-submit.js +0 -61
- package/dist/paged-mutation-submit.js.map +0 -1
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The registry graph as this machine holds it.
|
|
3
|
+
*
|
|
4
|
+
* The authority stores the graph as a small head naming each root's immutable
|
|
5
|
+
* pages, so this machine holds the same shape: the head, and the records of
|
|
6
|
+
* every root that head names, grouped exactly as the head pages them. A
|
|
7
|
+
* publication rebuilds only the roots it walked — every other root carries its
|
|
8
|
+
* page list forward untouched, never re-serialized, re-hashed, or re-journaled.
|
|
9
|
+
*
|
|
10
|
+
* A resource whose authority snapshot is still records-shaped (a login's
|
|
11
|
+
* initial publication, before any head has committed) is held with a null
|
|
12
|
+
* head. Its first head commit must page every root at once, which is exactly
|
|
13
|
+
* what the authority demands of a commit over a records base.
|
|
14
|
+
*/
|
|
15
|
+
import { assembleRootRecords, graphHeadChecksum, graphHeadFromRootPages, graphHeadReplacement, pagesForRoot, parseGraphHead, parseSnapshot, recordsByRoot, snapshotFromRecords, stableJson, ENTITY_CLOUD_SCHEMA_VERSION, GRAPH_HEAD_KIND, } from "@amalgm/live";
|
|
16
|
+
export class RegistryGraph {
|
|
17
|
+
/** The committed head, or null while the authority still holds a
|
|
18
|
+
* records-shaped snapshot. */
|
|
19
|
+
head;
|
|
20
|
+
rootRecords;
|
|
21
|
+
flat = null;
|
|
22
|
+
rootIndex = null;
|
|
23
|
+
constructor(head, rootRecords) {
|
|
24
|
+
this.head = head;
|
|
25
|
+
this.rootRecords = rootRecords;
|
|
26
|
+
}
|
|
27
|
+
/** Hold a records-shaped snapshot as the same per-root groups a head would
|
|
28
|
+
* name, so every reader above this class is shape-blind. */
|
|
29
|
+
static fromRecords(records) {
|
|
30
|
+
return new RegistryGraph(null, recordsByRoot(records));
|
|
31
|
+
}
|
|
32
|
+
rootIds() {
|
|
33
|
+
return [...this.rootRecords.keys()];
|
|
34
|
+
}
|
|
35
|
+
recordsFor(rootId) {
|
|
36
|
+
return this.rootRecords.get(rootId.toLowerCase()) ?? [];
|
|
37
|
+
}
|
|
38
|
+
/** Every record of every root, uuid-sorted. Only whole-graph readers pay
|
|
39
|
+
* for this — a publication never calls it. */
|
|
40
|
+
records() {
|
|
41
|
+
this.flat ??= snapshotFromRecords([...this.rootRecords.values()].flat()).records;
|
|
42
|
+
return this.flat;
|
|
43
|
+
}
|
|
44
|
+
/** The whole graph in the records shape the cold install and workspace
|
|
45
|
+
* selection paths read. Normalization already happened per root, so this
|
|
46
|
+
* only names the shape. */
|
|
47
|
+
snapshot() {
|
|
48
|
+
return {
|
|
49
|
+
schemaVersion: ENTITY_CLOUD_SCHEMA_VERSION,
|
|
50
|
+
kind: "amalgm-entity-registry",
|
|
51
|
+
records: this.records(),
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
/** Which root a record descends from, or null when the graph does not hold
|
|
55
|
+
* it. The index is built once, and only for callers that need it. */
|
|
56
|
+
rootOf(uuid) {
|
|
57
|
+
if (!this.rootIndex) {
|
|
58
|
+
const index = new Map();
|
|
59
|
+
for (const [rootId, records] of this.rootRecords) {
|
|
60
|
+
for (const record of records)
|
|
61
|
+
index.set(record.uuid, rootId);
|
|
62
|
+
}
|
|
63
|
+
this.rootIndex = index;
|
|
64
|
+
}
|
|
65
|
+
return this.rootIndex.get(uuid) ?? null;
|
|
66
|
+
}
|
|
67
|
+
/** The checksum the authority holds for this graph right now. */
|
|
68
|
+
checksum(sha256Hex) {
|
|
69
|
+
return this.head === null
|
|
70
|
+
? sha256Hex(stableJson(snapshotFromRecords(this.records())))
|
|
71
|
+
: graphHeadChecksum(this.head, sha256Hex);
|
|
72
|
+
}
|
|
73
|
+
/** Publish a new graph in which `rebuilt` roots carry the given records and
|
|
74
|
+
* every other root carries its committed pages forward. A root mapped to an
|
|
75
|
+
* empty record list is dropped from the graph. */
|
|
76
|
+
rebuild(rebuilt, sha256Hex) {
|
|
77
|
+
const replaced = new Map([...rebuilt].map(([rootId, records]) => [rootId.toLowerCase(), records]));
|
|
78
|
+
if (this.head === null) {
|
|
79
|
+
// The authority's base carries no page identities, so it can prove
|
|
80
|
+
// nothing about a root this commit leaves alone. Paging every root is
|
|
81
|
+
// the only lawful first head.
|
|
82
|
+
for (const rootId of this.rootRecords.keys()) {
|
|
83
|
+
if (!replaced.has(rootId)) {
|
|
84
|
+
throw new Error(`the first graph head must page every root, and ${rootId} is missing`);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
const carried = (this.head?.roots ?? []).filter((root) => !replaced.has(root.rootId));
|
|
89
|
+
const pages = [];
|
|
90
|
+
const paged = [];
|
|
91
|
+
const nextRecords = new Map(this.rootRecords);
|
|
92
|
+
for (const [rootId, records] of replaced) {
|
|
93
|
+
if (records.length === 0) {
|
|
94
|
+
nextRecords.delete(rootId);
|
|
95
|
+
continue;
|
|
96
|
+
}
|
|
97
|
+
const rootPages = pagesForRoot(rootId, records, sha256Hex);
|
|
98
|
+
pages.push(...rootPages);
|
|
99
|
+
paged.push({ rootId, pages: rootPages.map((page) => page.ref) });
|
|
100
|
+
nextRecords.set(rootId, rootPages.flatMap((page) => page.records));
|
|
101
|
+
}
|
|
102
|
+
const head = graphHeadFromRootPages([...carried, ...paged]);
|
|
103
|
+
return {
|
|
104
|
+
graph: new RegistryGraph(head, nextRecords),
|
|
105
|
+
operation: graphHeadReplacement(head, [...replaced.keys()]),
|
|
106
|
+
pages,
|
|
107
|
+
checksum: graphHeadChecksum(head, sha256Hex),
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
/** Every page identity the head names — the set a publication may skip
|
|
112
|
+
* uploading because the authority already holds it under this exact graph. */
|
|
113
|
+
export function graphPageIdentities(head) {
|
|
114
|
+
const identities = new Set();
|
|
115
|
+
for (const root of head?.roots ?? []) {
|
|
116
|
+
for (const page of root.pages)
|
|
117
|
+
identities.add(page.sha256);
|
|
118
|
+
}
|
|
119
|
+
return identities;
|
|
120
|
+
}
|
|
121
|
+
/** Materialize the authority's stored snapshot bytes into this machine's
|
|
122
|
+
* graph. A head is materialized by reading the pages it names; a records-shaped
|
|
123
|
+
* snapshot is grouped in place. */
|
|
124
|
+
export async function registryGraphFromSnapshot(bytes, readPages, sha256Hex) {
|
|
125
|
+
if (!snapshotIsGraphHead(bytes)) {
|
|
126
|
+
return RegistryGraph.fromRecords(parseSnapshot(bytes).records);
|
|
127
|
+
}
|
|
128
|
+
const head = parseGraphHead(bytes);
|
|
129
|
+
const read = await readPages(head.roots.flatMap((root) => root.pages));
|
|
130
|
+
const rootRecords = new Map();
|
|
131
|
+
for (const root of head.roots) {
|
|
132
|
+
rootRecords.set(root.rootId, assembleRootRecords(root.rootId, root.pages, root.pages.map((page) => {
|
|
133
|
+
const found = read.get(page.sha256);
|
|
134
|
+
if (!found)
|
|
135
|
+
throw new Error(`cloud graph page ${page.sha256} was not read`);
|
|
136
|
+
return found;
|
|
137
|
+
}), sha256Hex));
|
|
138
|
+
}
|
|
139
|
+
return new RegistryGraph(head, rootRecords);
|
|
140
|
+
}
|
|
141
|
+
/** Which shape the authority's snapshot bytes carry. Both shapes declare their
|
|
142
|
+
* kind ahead of their payload, and no record carries a `kind` of its own, so
|
|
143
|
+
* the first declaration in the opening bytes is the snapshot's — the shape is
|
|
144
|
+
* decided from a few bytes rather than by parsing a whole graph. */
|
|
145
|
+
function snapshotIsGraphHead(bytes) {
|
|
146
|
+
const declared = /"kind":"([^"]*)"/
|
|
147
|
+
.exec(Buffer.from(bytes.subarray(0, SNAPSHOT_KIND_PREFIX_BYTES)).toString("utf8"));
|
|
148
|
+
if (!declared)
|
|
149
|
+
throw new Error("cloud registry snapshot declares no kind");
|
|
150
|
+
return declared[1] === GRAPH_HEAD_KIND;
|
|
151
|
+
}
|
|
152
|
+
/** Enough opening bytes to hold the kind declaration of either shape, whatever
|
|
153
|
+
* small members precede it. The authority reads the same prefix to decide the
|
|
154
|
+
* same question. */
|
|
155
|
+
const SNAPSHOT_KIND_PREFIX_BYTES = 128;
|
|
156
|
+
//# sourceMappingURL=registry-graph.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry-graph.js","sourceRoot":"","sources":["../src/registry-graph.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EACL,mBAAmB,EACnB,iBAAiB,EACjB,sBAAsB,EACtB,oBAAoB,EACpB,YAAY,EACZ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,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;YACpC,IAAI,CAAC,KAAK;gBAAE,MAAM,IAAI,KAAK,CAAC,oBAAoB,IAAI,CAAC,MAAM,eAAe,CAAC,CAAC;YAC5E,OAAO,KAAK,CAAC;QACf,CAAC,CAAC,EACF,SAAS,CACV,CAAC,CAAC;IACL,CAAC;IACD,OAAO,IAAI,aAAa,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC;AAC9C,CAAC;AAED;;;oEAGoE;AACpE,SAAS,mBAAmB,CAAC,KAAiB;IAC5C,MAAM,QAAQ,GAAG,kBAAkB;SAChC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,EAAE,0BAA0B,CAAC,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC;IACrF,IAAI,CAAC,QAAQ;QAAE,MAAM,IAAI,KAAK,CAAC,0CAA0C,CAAC,CAAC;IAC3E,OAAO,QAAQ,CAAC,CAAC,CAAC,KAAK,eAAe,CAAC;AACzC,CAAC;AAED;;oBAEoB;AACpB,MAAM,0BAA0B,GAAG,GAAG,CAAC"}
|
package/dist/release-catalog.js
CHANGED
|
@@ -1,17 +1,20 @@
|
|
|
1
1
|
import { createPublicKey, verify } from "node:crypto";
|
|
2
2
|
const RELEASE_KEY = `-----BEGIN PUBLIC KEY-----
|
|
3
|
-
|
|
3
|
+
MCowBQYDK2VwAyEAFYplNyJKDsGlrlGOcQ7IotvOwUaauTyRjFqkVqxl03A=
|
|
4
4
|
-----END PUBLIC KEY-----`;
|
|
5
5
|
/** Signed once by the Shell release authority. The private key is not part of
|
|
6
6
|
* the package; changing this graph requires a newly signed release. */
|
|
7
7
|
export const shellReleaseCatalog = Object.freeze({
|
|
8
|
-
releaseId: "shell-
|
|
9
|
-
keyId: "shell-
|
|
8
|
+
releaseId: "shell-chat-0.2.0",
|
|
9
|
+
keyId: "shell-release-2026-08-chat",
|
|
10
10
|
services: Object.freeze([
|
|
11
11
|
{ id: "core", dependencies: [] },
|
|
12
12
|
{ id: "files", dependencies: ["core"] },
|
|
13
|
+
{ id: "agents", dependencies: ["core"] },
|
|
14
|
+
{ id: "tools", dependencies: ["core"] },
|
|
15
|
+
{ id: "chat", dependencies: ["core", "agents", "tools"] },
|
|
13
16
|
]),
|
|
14
|
-
signature: "
|
|
17
|
+
signature: "VHufdjgg-ojAEHZjZBs3XYQ9Zezz53ZnRrQeDfnmmWCMaqSTnWaoAfwfig_07a6bUqc6jOMmofqPcHC79smVAA",
|
|
15
18
|
});
|
|
16
19
|
const releaseKey = createPublicKey(RELEASE_KEY);
|
|
17
20
|
export const shellReleaseVerifier = Object.freeze({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"release-catalog.js","sourceRoot":"","sources":["../src/release-catalog.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAOtD,MAAM,WAAW,GAAG;;yBAEK,CAAC;AAE1B;uEACuE;AACvE,MAAM,CAAC,MAAM,mBAAmB,GAAyB,MAAM,CAAC,MAAM,CAAC;IACrE,SAAS,EAAE,
|
|
1
|
+
{"version":3,"file":"release-catalog.js","sourceRoot":"","sources":["../src/release-catalog.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAOtD,MAAM,WAAW,GAAG;;yBAEK,CAAC;AAE1B;uEACuE;AACvE,MAAM,CAAC,MAAM,mBAAmB,GAAyB,MAAM,CAAC,MAAM,CAAC;IACrE,SAAS,EAAE,kBAAkB;IAC7B,KAAK,EAAE,4BAA4B;IACnC,QAAQ,EAAE,MAAM,CAAC,MAAM,CAAC;QACtB,EAAE,EAAE,EAAE,MAAM,EAAE,YAAY,EAAE,EAAE,EAAE;QAChC,EAAE,EAAE,EAAE,OAAO,EAAE,YAAY,EAAE,CAAC,MAAM,CAAC,EAAE;QACvC,EAAE,EAAE,EAAE,QAAQ,EAAE,YAAY,EAAE,CAAC,MAAM,CAAC,EAAE;QACxC,EAAE,EAAE,EAAE,OAAO,EAAE,YAAY,EAAE,CAAC,MAAM,CAAC,EAAE;QACvC,EAAE,EAAE,EAAE,MAAM,EAAE,YAAY,EAAE,CAAC,MAAM,EAAE,QAAQ,EAAE,OAAO,CAAC,EAAE;KAC1D,CAAC;IACF,SAAS,EAAE,wFAAwF;CACpG,CAAC,CAAC;AAEH,MAAM,UAAU,GAAG,eAAe,CAAC,WAAW,CAAC,CAAC;AAEhD,MAAM,CAAC,MAAM,oBAAoB,GAA+B,MAAM,CAAC,MAAM,CAAC;IAC5E,MAAM,CAAC,OAAe,EAAE,SAAiB,EAAE,KAAa;QACtD,OAAO,KAAK,KAAK,mBAAmB,CAAC,KAAK;eACrC,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,UAAU,EAAE,MAAM,CAAC,IAAI,CAAC,SAAS,EAAE,WAAW,CAAC,CAAC,CAAC;IAC3F,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -8,9 +8,20 @@ export interface RuntimeCommandPublication extends RuntimeCommandAddress {
|
|
|
8
8
|
readonly port: number;
|
|
9
9
|
readonly token: string;
|
|
10
10
|
}
|
|
11
|
+
export interface RuntimeCommandStatus {
|
|
12
|
+
readonly published: boolean;
|
|
13
|
+
readonly running: boolean;
|
|
14
|
+
readonly pid: number | null;
|
|
15
|
+
readonly port: number | null;
|
|
16
|
+
}
|
|
11
17
|
/** Publish the loopback address only after the watching runtime is ready. */
|
|
12
18
|
export declare function publishRuntimeCommands(input: RuntimeCommandPublication): void;
|
|
13
19
|
/** Remove only the discovery document owned by this exact runtime token. */
|
|
14
20
|
export declare function unpublishRuntimeCommands(input: RuntimeCommandPublication): void;
|
|
21
|
+
/** Readiness is the published address plus an authenticated response from the
|
|
22
|
+
* exact loopback runtime. A marker or a live PID alone cannot prove that the
|
|
23
|
+
* composed services are accepting requests. This probe is read-only so a UI
|
|
24
|
+
* may adopt a runtime it did not start. */
|
|
25
|
+
export declare function inspectRuntimeCommands(input: RuntimeCommandAddress): Promise<RuntimeCommandStatus>;
|
|
15
26
|
/** Call the one running Files runtime. The CLI owns no Files effects. */
|
|
16
27
|
export declare function callRuntimeCommand(input: RuntimeCommandAddress, path: "/entities/register" | "/entities/add", body: Record<string, unknown>): Promise<Record<string, unknown>>;
|
|
@@ -23,6 +23,44 @@ export function unpublishRuntimeCommands(input) {
|
|
|
23
23
|
rmSync(files.state, { force: true });
|
|
24
24
|
rmSync(files.token, { force: true });
|
|
25
25
|
}
|
|
26
|
+
/** Readiness is the published address plus an authenticated response from the
|
|
27
|
+
* exact loopback runtime. A marker or a live PID alone cannot prove that the
|
|
28
|
+
* composed services are accepting requests. This probe is read-only so a UI
|
|
29
|
+
* may adopt a runtime it did not start. */
|
|
30
|
+
export async function inspectRuntimeCommands(input) {
|
|
31
|
+
const files = commandFiles(input);
|
|
32
|
+
const state = readJson(files.state);
|
|
33
|
+
const label = coerceRuntimeLabel(input.runtimeLabel);
|
|
34
|
+
if (!state
|
|
35
|
+
|| state.runtime_label !== label
|
|
36
|
+
|| state.user_scope !== input.userScope) {
|
|
37
|
+
return { published: false, running: false, pid: null, port: null };
|
|
38
|
+
}
|
|
39
|
+
const pid = Number.isSafeInteger(state.pid) && Number(state.pid) > 0
|
|
40
|
+
? Number(state.pid)
|
|
41
|
+
: null;
|
|
42
|
+
let port = null;
|
|
43
|
+
let token = "";
|
|
44
|
+
try {
|
|
45
|
+
port = validPort(state.ports?.[FILES_PORT]);
|
|
46
|
+
token = required(readJson(files.token)?.token, "runtime token");
|
|
47
|
+
}
|
|
48
|
+
catch {
|
|
49
|
+
return { published: true, running: false, pid, port };
|
|
50
|
+
}
|
|
51
|
+
try {
|
|
52
|
+
const response = await getRuntimeHealth(port, token);
|
|
53
|
+
return {
|
|
54
|
+
published: true,
|
|
55
|
+
running: response.statusCode === 200 && response.body === '{"ok":true}',
|
|
56
|
+
pid,
|
|
57
|
+
port,
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
catch {
|
|
61
|
+
return { published: true, running: false, pid, port };
|
|
62
|
+
}
|
|
63
|
+
}
|
|
26
64
|
/** Call the one running Files runtime. The CLI owns no Files effects. */
|
|
27
65
|
export async function callRuntimeCommand(input, path, body) {
|
|
28
66
|
const files = commandFiles(input);
|
|
@@ -95,6 +133,33 @@ function postRuntimeCommand(port, path, token, body) {
|
|
|
95
133
|
command.end(encoded);
|
|
96
134
|
});
|
|
97
135
|
}
|
|
136
|
+
function getRuntimeHealth(port, token) {
|
|
137
|
+
return new Promise((resolve, reject) => {
|
|
138
|
+
const command = request({
|
|
139
|
+
hostname: "127.0.0.1",
|
|
140
|
+
port,
|
|
141
|
+
path: "/healthz",
|
|
142
|
+
method: "GET",
|
|
143
|
+
headers: {
|
|
144
|
+
"x-amalgm-runtime-token": token,
|
|
145
|
+
"connection": "close",
|
|
146
|
+
},
|
|
147
|
+
timeout: 2_000,
|
|
148
|
+
}, (response) => {
|
|
149
|
+
response.setEncoding("utf8");
|
|
150
|
+
let responseBody = "";
|
|
151
|
+
response.on("data", (chunk) => { responseBody += chunk; });
|
|
152
|
+
response.once("end", () => resolve({
|
|
153
|
+
statusCode: response.statusCode ?? 500,
|
|
154
|
+
body: responseBody,
|
|
155
|
+
}));
|
|
156
|
+
response.once("error", reject);
|
|
157
|
+
});
|
|
158
|
+
command.once("timeout", () => command.destroy(new Error("runtime health probe timed out")));
|
|
159
|
+
command.once("error", reject);
|
|
160
|
+
command.end();
|
|
161
|
+
});
|
|
162
|
+
}
|
|
98
163
|
function commandFiles(input) {
|
|
99
164
|
const directory = runtimeStateDir(input.userRoot, required(input.deviceId, "device id"), coerceRuntimeLabel(input.runtimeLabel));
|
|
100
165
|
return { state: runtimeStateFile(directory), token: runtimeTokenFile(directory) };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime-command-host.js","sourceRoot":"","sources":["../src/runtime-command-host.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EACL,kBAAkB,EAClB,eAAe,EACf,gBAAgB,EAChB,gBAAgB,GACjB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAEvD,MAAM,UAAU,GAAG,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"runtime-command-host.js","sourceRoot":"","sources":["../src/runtime-command-host.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EACL,kBAAkB,EAClB,eAAe,EACf,gBAAgB,EAChB,gBAAgB,GACjB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAEvD,MAAM,UAAU,GAAG,YAAY,CAAC;AAgChC,6EAA6E;AAC7E,MAAM,UAAU,sBAAsB,CAAC,KAAgC;IACrE,MAAM,KAAK,GAAG,YAAY,CAAC,KAAK,CAAC,CAAC;IAClC,MAAM,KAAK,GAAG,kBAAkB,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;IACrD,UAAU,CAAC,KAAK,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,QAAQ,CAAC,KAAK,CAAC,KAAK,EAAE,eAAe,CAAC,EAAE,CAAC,CAAC;IAC3E,UAAU,CAAC,KAAK,CAAC,KAAK,EAAE;QACtB,aAAa,EAAE,KAAK;QACpB,UAAU,EAAE,KAAK,CAAC,SAAS;QAC3B,GAAG,EAAE,OAAO,CAAC,GAAG;QAChB,KAAK,EAAE,EAAE,CAAC,UAAU,CAAC,EAAE,SAAS,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE;K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C,CAAC;QAC9B,OAAO,CAAC,GAAG,EAAE,CAAC;IAChB,CAAC,CAAC,CAAC;AACL,CAAC;AAED,SAAS,YAAY,CAAC,KAA4B;IAChD,MAAM,SAAS,GAAG,eAAe,CAC/B,KAAK,CAAC,QAAQ,EACd,QAAQ,CAAC,KAAK,CAAC,QAAQ,EAAE,WAAW,CAAC,EACrC,kBAAkB,CAAC,KAAK,CAAC,YAAY,CAAC,CACvC,CAAC;IACF,OAAO,EAAE,KAAK,EAAE,gBAAgB,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,gBAAgB,CAAC,SAAS,CAAC,EAAE,CAAC;AACpF,CAAC;AAED,SAAS,SAAS,CAAC,KAAc;IAC/B,MAAM,IAAI,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;IAC3B,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,IAAI,GAAG,CAAC,IAAI,IAAI,GAAG,MAAM,EAAE,CAAC;QACzD,MAAM,IAAI,KAAK,CAAC,yCAAyC,CAAC,CAAC;IAC7D,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAED,SAAS,QAAQ,CAAC,KAAc,EAAE,KAAa;IAC7C,MAAM,IAAI,GAAG,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;IAC3D,IAAI,CAAC,IAAI;QAAE,MAAM,IAAI,KAAK,CAAC,GAAG,KAAK,aAAa,CAAC,CAAC;IAClD,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -182,6 +182,14 @@ export declare class UserGroundHost {
|
|
|
182
182
|
private userRoot;
|
|
183
183
|
private cacheDir;
|
|
184
184
|
private cloudPort;
|
|
185
|
+
/** The authority's stored snapshot as this machine's graph. A head names
|
|
186
|
+
* immutable pages, so every page this machine already cached is a local read
|
|
187
|
+
* and an unchanged root never crosses the network twice. */
|
|
188
|
+
private materializeRegistry;
|
|
189
|
+
/** Read graph pages by identity: cached pages come off local disk, the rest
|
|
190
|
+
* are fetched straight from content storage and cached on the way in. Every
|
|
191
|
+
* page is re-proven against its declared identity before it is kept. */
|
|
192
|
+
private readGraphPages;
|
|
185
193
|
private localPort;
|
|
186
194
|
/** Send's small-cargo fast path: the record's sealed artifact rides the
|
|
187
195
|
* submit frame itself, so one round trip carries record, manifest, and
|
|
@@ -219,6 +227,11 @@ export declare class UserGroundHost {
|
|
|
219
227
|
* frames; the answer is the only permission to skip an upload. */
|
|
220
228
|
private sealedContentHashes;
|
|
221
229
|
private publishPendingSnapshots;
|
|
230
|
+
/** Seal this publication's graph pages. Pages are immutable, content
|
|
231
|
+
* addressed, and already in memory, so the authority's seal inventory alone
|
|
232
|
+
* decides what still has to move and whole pages ride cargo waves. The head
|
|
233
|
+
* may not commit until every page it newly names is sealed. */
|
|
234
|
+
private uploadGraphPages;
|
|
222
235
|
private publishLoadedSnapshot;
|
|
223
236
|
}
|
|
224
237
|
/** The single opener and schema-migration entry for a user ground database.
|