@hearsay-tools/squawk 0.19.0-pr4576.9083 → 0.19.0-pr4577.9090
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/built-in-cli-commands.js +6 -5
- package/dist/built-in-cli-commands.js.map +1 -1
- package/dist/built-in-launch-parts.d.ts +0 -4
- package/dist/built-in-launch-parts.js +1 -17
- package/dist/built-in-launch-parts.js.map +1 -1
- package/dist/ci-wait/controller.d.ts +7 -7
- package/dist/cli-dispatch.d.ts +2 -1
- package/dist/cli-dispatch.js +20 -7
- package/dist/cli-dispatch.js.map +1 -1
- package/dist/contract/hosts.d.ts +161 -0
- package/dist/contract/index.js +116 -0
- package/dist/core/cli-registry.d.ts +1 -0
- package/dist/core/cli-registry.js.map +1 -1
- package/dist/core/server-hook-registry.d.ts +17 -2
- package/dist/core/server-hook-registry.js +1 -0
- package/dist/core/server-hook-registry.js.map +1 -1
- package/dist/features/automations/tools.d.ts +8 -8
- package/dist/features/hosts/cli.d.ts +59 -0
- package/dist/features/hosts/cli.js +28 -17
- package/dist/features/hosts/cli.js.map +1 -1
- package/dist/features/hosts/host-server-cli.d.ts +13 -0
- package/dist/features/hosts/host-server-cli.js +246 -0
- package/dist/features/hosts/host-server-cli.js.map +1 -0
- package/dist/features/hosts/host-server.d.ts +51 -0
- package/dist/features/hosts/host-server.js +407 -0
- package/dist/features/hosts/host-server.js.map +1 -0
- package/dist/features/hosts/index.d.ts +2 -0
- package/dist/features/hosts/index.js +12 -0
- package/dist/features/hosts/index.js.map +1 -1
- package/dist/features/hosts/routes.d.ts +44 -44
- package/dist/features/hosts/runtime-archive.d.ts +103 -0
- package/dist/features/hosts/runtime-archive.js +619 -0
- package/dist/features/hosts/runtime-archive.js.map +1 -0
- package/dist/features/hosts/start-methods.d.ts +76 -0
- package/dist/features/hosts/start-methods.js +234 -0
- package/dist/features/hosts/start-methods.js.map +1 -0
- package/dist/features/hosts/tar-gz.d.ts +30 -0
- package/dist/features/hosts/tar-gz.js +143 -0
- package/dist/features/hosts/tar-gz.js.map +1 -0
- package/dist/features/webhooks/capability.d.ts +3 -0
- package/dist/features/webhooks/capability.js +6 -0
- package/dist/features/webhooks/capability.js.map +1 -0
- package/dist/features/webhooks/cli-command.d.ts +3 -0
- package/dist/features/webhooks/cli-command.js +10 -0
- package/dist/features/webhooks/cli-command.js.map +1 -0
- package/dist/{webhooks → features/webhooks}/cli.d.ts +2 -2
- package/dist/{webhooks → features/webhooks}/cli.js +7 -7
- package/dist/features/webhooks/cli.js.map +1 -0
- package/dist/features/webhooks/index.d.ts +13 -0
- package/dist/features/webhooks/index.js +14 -0
- package/dist/features/webhooks/index.js.map +1 -0
- package/dist/features/webhooks/launch-part.d.ts +7 -0
- package/dist/features/webhooks/launch-part.js +19 -0
- package/dist/features/webhooks/launch-part.js.map +1 -0
- package/dist/{webhooks → features/webhooks}/prompt.d.ts +1 -1
- package/dist/{webhooks → features/webhooks}/prompt.js +1 -1
- package/dist/features/webhooks/prompt.js.map +1 -0
- package/dist/features/webhooks/routes.d.ts +463 -0
- package/dist/features/webhooks/routes.js +177 -0
- package/dist/features/webhooks/routes.js.map +1 -0
- package/dist/features/webhooks/server-plugin.d.ts +16 -0
- package/dist/features/webhooks/server-plugin.js +98 -0
- package/dist/features/webhooks/server-plugin.js.map +1 -0
- package/dist/{runs → features/webhooks}/webhook.d.ts +5 -5
- package/dist/{runs → features/webhooks}/webhook.js +16 -10
- package/dist/features/webhooks/webhook.js.map +1 -0
- package/dist/host-server-store.d.ts +103 -0
- package/dist/host-server-store.js +348 -0
- package/dist/host-server-store.js.map +1 -0
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/plugin/index.d.ts +1 -1
- package/dist/plugin/index.js.map +1 -1
- package/dist/serve-command.d.ts +12 -3
- package/dist/serve-command.js +76 -18
- package/dist/serve-command.js.map +1 -1
- package/dist/server/live-routes.d.ts +6 -6
- package/dist/server/plugin-server-hooks.d.ts +12 -1
- package/dist/server/plugin-server-hooks.js +33 -0
- package/dist/server/plugin-server-hooks.js.map +1 -1
- package/dist/server/project-settings-routes.d.ts +0 -90
- package/dist/server/project-settings-routes.js +0 -30
- package/dist/server/project-settings-routes.js.map +1 -1
- package/dist/server/projects-routes.d.ts +1 -376
- package/dist/server/projects-routes.js +2 -137
- package/dist/server/projects-routes.js.map +1 -1
- package/dist/server/provider-sign-in-routes.d.ts +2 -2
- package/dist/server/providers-routes.d.ts +58 -58
- package/dist/server/repo-routes.d.ts +52 -52
- package/dist/server/runners-routes.d.ts +10 -10
- package/dist/server/runs-routes.d.ts +984 -1002
- package/dist/server/runs-routes.js +6 -11
- package/dist/server/runs-routes.js.map +1 -1
- package/dist/server/server-deps.d.ts +1 -4
- package/dist/server/server-deps.js +3 -7
- package/dist/server/server-deps.js.map +1 -1
- package/dist/server/server.d.ts +520 -1100
- package/dist/server/server.js +10 -16
- package/dist/server/server.js.map +1 -1
- package/dist/server/start-run-options.d.ts +5 -3
- package/dist/server/start-run-options.js +8 -3
- package/dist/server/start-run-options.js.map +1 -1
- package/dist/server/start-server.js +8 -11
- package/dist/server/start-server.js.map +1 -1
- package/dist/server/workspace-live-routes.d.ts +11 -11
- package/dist/server/workspace-projects.d.ts +2 -5
- package/dist/server/workspace-projects.js +10 -11
- package/dist/server/workspace-projects.js.map +1 -1
- package/dist/server/workspace-routes.d.ts +85 -85
- package/package.json +4 -4
- package/dist/runs/webhook.js.map +0 -1
- package/dist/webhooks/cli.js.map +0 -1
- package/dist/webhooks/prompt.js.map +0 -1
|
@@ -34,20 +34,10 @@ export declare function createHostsRoutes(deps: HostsRouteDeps): import("hono/ho
|
|
|
34
34
|
"/hosts": {
|
|
35
35
|
$post: {
|
|
36
36
|
output: {
|
|
37
|
-
|
|
38
|
-
id: string;
|
|
39
|
-
label: string;
|
|
40
|
-
state: "unreachable";
|
|
41
|
-
reason?: string | undefined;
|
|
42
|
-
kind?: "ssh" | undefined;
|
|
43
|
-
sshAlias?: string | undefined;
|
|
44
|
-
installId?: string | undefined;
|
|
45
|
-
port?: number | undefined;
|
|
46
|
-
addedAt?: string | undefined;
|
|
47
|
-
};
|
|
37
|
+
error: string;
|
|
48
38
|
};
|
|
49
39
|
outputFormat: "json";
|
|
50
|
-
status:
|
|
40
|
+
status: 404;
|
|
51
41
|
input: {
|
|
52
42
|
json: {
|
|
53
43
|
sshAlias: string;
|
|
@@ -75,7 +65,7 @@ export declare function createHostsRoutes(deps: HostsRouteDeps): import("hono/ho
|
|
|
75
65
|
error: string;
|
|
76
66
|
};
|
|
77
67
|
outputFormat: "json";
|
|
78
|
-
status:
|
|
68
|
+
status: 409;
|
|
79
69
|
input: {
|
|
80
70
|
json: {
|
|
81
71
|
sshAlias: string;
|
|
@@ -89,7 +79,7 @@ export declare function createHostsRoutes(deps: HostsRouteDeps): import("hono/ho
|
|
|
89
79
|
error: string;
|
|
90
80
|
};
|
|
91
81
|
outputFormat: "json";
|
|
92
|
-
status:
|
|
82
|
+
status: 500;
|
|
93
83
|
input: {
|
|
94
84
|
json: {
|
|
95
85
|
sshAlias: string;
|
|
@@ -100,10 +90,20 @@ export declare function createHostsRoutes(deps: HostsRouteDeps): import("hono/ho
|
|
|
100
90
|
};
|
|
101
91
|
} | {
|
|
102
92
|
output: {
|
|
103
|
-
|
|
93
|
+
host: {
|
|
94
|
+
id: string;
|
|
95
|
+
label: string;
|
|
96
|
+
state: "unreachable";
|
|
97
|
+
reason?: string | undefined;
|
|
98
|
+
kind?: "ssh" | undefined;
|
|
99
|
+
sshAlias?: string | undefined;
|
|
100
|
+
installId?: string | undefined;
|
|
101
|
+
port?: number | undefined;
|
|
102
|
+
addedAt?: string | undefined;
|
|
103
|
+
};
|
|
104
104
|
};
|
|
105
105
|
outputFormat: "json";
|
|
106
|
-
status:
|
|
106
|
+
status: 201;
|
|
107
107
|
input: {
|
|
108
108
|
json: {
|
|
109
109
|
sshAlias: string;
|
|
@@ -117,7 +117,7 @@ export declare function createHostsRoutes(deps: HostsRouteDeps): import("hono/ho
|
|
|
117
117
|
error: string;
|
|
118
118
|
};
|
|
119
119
|
outputFormat: "json";
|
|
120
|
-
status:
|
|
120
|
+
status: 409;
|
|
121
121
|
input: {
|
|
122
122
|
json: {
|
|
123
123
|
sshAlias: string;
|
|
@@ -132,20 +132,11 @@ export declare function createHostsRoutes(deps: HostsRouteDeps): import("hono/ho
|
|
|
132
132
|
"/hosts/:id": {
|
|
133
133
|
$patch: {
|
|
134
134
|
output: {
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
label: string;
|
|
138
|
-
state: "unreachable";
|
|
139
|
-
reason?: string | undefined;
|
|
140
|
-
kind?: "ssh" | undefined;
|
|
141
|
-
sshAlias?: string | undefined;
|
|
142
|
-
installId?: string | undefined;
|
|
143
|
-
port?: number | undefined;
|
|
144
|
-
addedAt?: string | undefined;
|
|
145
|
-
};
|
|
135
|
+
error: string;
|
|
136
|
+
code?: "invalid_input" | undefined;
|
|
146
137
|
};
|
|
147
138
|
outputFormat: "json";
|
|
148
|
-
status:
|
|
139
|
+
status: 400;
|
|
149
140
|
input: {
|
|
150
141
|
param: {
|
|
151
142
|
id: string;
|
|
@@ -160,10 +151,9 @@ export declare function createHostsRoutes(deps: HostsRouteDeps): import("hono/ho
|
|
|
160
151
|
} | {
|
|
161
152
|
output: {
|
|
162
153
|
error: string;
|
|
163
|
-
code?: "invalid_input" | undefined;
|
|
164
154
|
};
|
|
165
155
|
outputFormat: "json";
|
|
166
|
-
status:
|
|
156
|
+
status: 404;
|
|
167
157
|
input: {
|
|
168
158
|
param: {
|
|
169
159
|
id: string;
|
|
@@ -197,7 +187,7 @@ export declare function createHostsRoutes(deps: HostsRouteDeps): import("hono/ho
|
|
|
197
187
|
error: string;
|
|
198
188
|
};
|
|
199
189
|
outputFormat: "json";
|
|
200
|
-
status:
|
|
190
|
+
status: 409;
|
|
201
191
|
input: {
|
|
202
192
|
param: {
|
|
203
193
|
id: string;
|
|
@@ -214,7 +204,7 @@ export declare function createHostsRoutes(deps: HostsRouteDeps): import("hono/ho
|
|
|
214
204
|
error: string;
|
|
215
205
|
};
|
|
216
206
|
outputFormat: "json";
|
|
217
|
-
status:
|
|
207
|
+
status: 500;
|
|
218
208
|
input: {
|
|
219
209
|
param: {
|
|
220
210
|
id: string;
|
|
@@ -245,10 +235,20 @@ export declare function createHostsRoutes(deps: HostsRouteDeps): import("hono/ho
|
|
|
245
235
|
};
|
|
246
236
|
} | {
|
|
247
237
|
output: {
|
|
248
|
-
|
|
238
|
+
host: {
|
|
239
|
+
id: string;
|
|
240
|
+
label: string;
|
|
241
|
+
state: "unreachable";
|
|
242
|
+
reason?: string | undefined;
|
|
243
|
+
kind?: "ssh" | undefined;
|
|
244
|
+
sshAlias?: string | undefined;
|
|
245
|
+
installId?: string | undefined;
|
|
246
|
+
port?: number | undefined;
|
|
247
|
+
addedAt?: string | undefined;
|
|
248
|
+
};
|
|
249
249
|
};
|
|
250
250
|
outputFormat: "json";
|
|
251
|
-
status:
|
|
251
|
+
status: 200;
|
|
252
252
|
input: {
|
|
253
253
|
param: {
|
|
254
254
|
id: string;
|
|
@@ -266,11 +266,11 @@ export declare function createHostsRoutes(deps: HostsRouteDeps): import("hono/ho
|
|
|
266
266
|
"/hosts/:id": {
|
|
267
267
|
$delete: {
|
|
268
268
|
output: {
|
|
269
|
-
|
|
270
|
-
|
|
269
|
+
error: string;
|
|
270
|
+
code?: "invalid_input" | undefined;
|
|
271
271
|
};
|
|
272
272
|
outputFormat: "json";
|
|
273
|
-
status:
|
|
273
|
+
status: 400;
|
|
274
274
|
input: {
|
|
275
275
|
param: {
|
|
276
276
|
id: string;
|
|
@@ -279,10 +279,9 @@ export declare function createHostsRoutes(deps: HostsRouteDeps): import("hono/ho
|
|
|
279
279
|
} | {
|
|
280
280
|
output: {
|
|
281
281
|
error: string;
|
|
282
|
-
code?: "invalid_input" | undefined;
|
|
283
282
|
};
|
|
284
283
|
outputFormat: "json";
|
|
285
|
-
status:
|
|
284
|
+
status: 404;
|
|
286
285
|
input: {
|
|
287
286
|
param: {
|
|
288
287
|
id: string;
|
|
@@ -304,7 +303,7 @@ export declare function createHostsRoutes(deps: HostsRouteDeps): import("hono/ho
|
|
|
304
303
|
error: string;
|
|
305
304
|
};
|
|
306
305
|
outputFormat: "json";
|
|
307
|
-
status:
|
|
306
|
+
status: 409;
|
|
308
307
|
input: {
|
|
309
308
|
param: {
|
|
310
309
|
id: string;
|
|
@@ -315,7 +314,7 @@ export declare function createHostsRoutes(deps: HostsRouteDeps): import("hono/ho
|
|
|
315
314
|
error: string;
|
|
316
315
|
};
|
|
317
316
|
outputFormat: "json";
|
|
318
|
-
status:
|
|
317
|
+
status: 500;
|
|
319
318
|
input: {
|
|
320
319
|
param: {
|
|
321
320
|
id: string;
|
|
@@ -334,10 +333,11 @@ export declare function createHostsRoutes(deps: HostsRouteDeps): import("hono/ho
|
|
|
334
333
|
};
|
|
335
334
|
} | {
|
|
336
335
|
output: {
|
|
337
|
-
|
|
336
|
+
removed: true;
|
|
337
|
+
id: string;
|
|
338
338
|
};
|
|
339
339
|
outputFormat: "json";
|
|
340
|
-
status:
|
|
340
|
+
status: 200;
|
|
341
341
|
input: {
|
|
342
342
|
param: {
|
|
343
343
|
id: string;
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import type { Writable } from 'node:stream';
|
|
2
|
+
import { type RecordedProcess } from '../../core/process-stat.ts';
|
|
3
|
+
import type { Home } from '../../home/home.ts';
|
|
4
|
+
import { type CockpitLease } from '../../home/leases.ts';
|
|
5
|
+
export type RuntimeArchiveErrorCode = 'missing_build' | 'missing_dependency' | 'invalid_version' | 'corrupt_archive' | 'verification_failed' | 'escaping_link' | 'invalid_staged_dir';
|
|
6
|
+
export declare class RuntimeArchiveError extends Error {
|
|
7
|
+
readonly code: RuntimeArchiveErrorCode;
|
|
8
|
+
constructor(code: RuntimeArchiveErrorCode, message: string);
|
|
9
|
+
}
|
|
10
|
+
/** Named error thrown when the resolved production dependency closure contains a native module. */
|
|
11
|
+
export declare class NativeModuleError extends Error {
|
|
12
|
+
readonly code: 'native_module';
|
|
13
|
+
readonly packageName: string;
|
|
14
|
+
readonly reason: string;
|
|
15
|
+
readonly filePath?: string | undefined;
|
|
16
|
+
constructor(packageName: string, reason: string, filePath?: string);
|
|
17
|
+
}
|
|
18
|
+
export interface ResolvedDependencyPackage {
|
|
19
|
+
archivePath: string;
|
|
20
|
+
sourceDir: string;
|
|
21
|
+
name: string;
|
|
22
|
+
version: string;
|
|
23
|
+
}
|
|
24
|
+
export interface ProductionClosure {
|
|
25
|
+
packageRoot: string;
|
|
26
|
+
name: string;
|
|
27
|
+
version: string;
|
|
28
|
+
packages: ResolvedDependencyPackage[];
|
|
29
|
+
}
|
|
30
|
+
/** Default root of the running Squawk package (`packages/cezar` or installed package dir). */
|
|
31
|
+
export declare function defaultRunningPackageRoot(): string;
|
|
32
|
+
export declare function hostRuntimesDir(home: Pick<Home, 'data'>): string;
|
|
33
|
+
export declare function validateRuntimeVersion(version: string): string;
|
|
34
|
+
export declare function hostRuntimeVersionDir(home: Pick<Home, 'data'>, version: string): string;
|
|
35
|
+
/**
|
|
36
|
+
* Resolve the production dependency closure of `packageRoot` following Node.js resolution.
|
|
37
|
+
* Rejects any native module in the closure with `NativeModuleError`.
|
|
38
|
+
*/
|
|
39
|
+
export declare function resolveProductionClosure(packageRoot?: string): ProductionClosure;
|
|
40
|
+
export interface BuildRuntimeArchiveOptions {
|
|
41
|
+
packageRoot?: string | undefined;
|
|
42
|
+
outputPath?: string | undefined;
|
|
43
|
+
}
|
|
44
|
+
export interface BuiltRuntimeArchive {
|
|
45
|
+
version: string;
|
|
46
|
+
packageCount: number;
|
|
47
|
+
entryCount: number;
|
|
48
|
+
buffer?: Buffer | undefined;
|
|
49
|
+
outputPath?: string | undefined;
|
|
50
|
+
}
|
|
51
|
+
/** Build the runtime `.tar.gz` archive (writing atomically to `outputPath` or returning a `Buffer`). */
|
|
52
|
+
export declare function buildRuntimeArchive(options?: BuildRuntimeArchiveOptions): Promise<BuiltRuntimeArchive>;
|
|
53
|
+
/** Stream the runtime `.tar.gz` archive directly to a `Writable` (such as an SSH child's stdin). */
|
|
54
|
+
export declare function streamRuntimeArchive(destination: Writable, options?: {
|
|
55
|
+
packageRoot?: string | undefined;
|
|
56
|
+
}): Promise<{
|
|
57
|
+
version: string;
|
|
58
|
+
packageCount: number;
|
|
59
|
+
entryCount: number;
|
|
60
|
+
}>;
|
|
61
|
+
export interface RuntimeInstallDeps {
|
|
62
|
+
isProcessLive?: ((entry: RecordedProcess) => boolean) | undefined;
|
|
63
|
+
readProcessCommand?: ((pid: number) => string | undefined) | undefined;
|
|
64
|
+
listProcessCommands?: (() => string[] | undefined) | undefined;
|
|
65
|
+
verifyRuntime?: ((pkgDir: string, expectedVersion: string) => Promise<void>) | undefined;
|
|
66
|
+
readLeases?: ((home: Home) => CockpitLease[]) | undefined;
|
|
67
|
+
nowMs?: (() => number) | undefined;
|
|
68
|
+
unownedTempGraceMs?: number | undefined;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Remove stale `.runtime-tmp-*` folders beside `<data>/runtime/`:
|
|
72
|
+
* - Folders with an `owner.json` whose recorded process is dead are swept immediately.
|
|
73
|
+
* - Folders without `owner.json` (creation window or external shell `tar` staging) are kept until
|
|
74
|
+
* older than `unownedTempGraceMs` so concurrent cross-process installs cannot delete each other.
|
|
75
|
+
*/
|
|
76
|
+
export declare function sweepStaleRuntimeTempDirs(home: Pick<Home, 'data'>, deps?: Pick<RuntimeInstallDeps, 'isProcessLive' | 'nowMs' | 'unownedTempGraceMs'>): string[];
|
|
77
|
+
/** Check an unpacked runtime by running its own `hsq --version` and comparing stdout to `expectedVersion`. */
|
|
78
|
+
export declare function verifyStagedRuntime(pkgDir: string, expectedVersion: string): Promise<void>;
|
|
79
|
+
/**
|
|
80
|
+
* Remove old `<data>/runtime/<version>/` folders when no server runs from them.
|
|
81
|
+
* Fails safe: keeps any version held by a live start claim, a live cockpit lease, or any running
|
|
82
|
+
* process of the user whose command line references it (protecting servers spawned from an old
|
|
83
|
+
* runtime before they commit their claim); skips pruning if `host-server.db`, leases, or process
|
|
84
|
+
* commands cannot be read.
|
|
85
|
+
*/
|
|
86
|
+
export declare function pruneOldRuntimes(home: Home, keepVersion: string, deps?: Pick<RuntimeInstallDeps, 'isProcessLive' | 'readProcessCommand' | 'listProcessCommands' | 'readLeases'>): string[];
|
|
87
|
+
export interface InstallRuntimeResult {
|
|
88
|
+
version: string;
|
|
89
|
+
runtimeDir: string;
|
|
90
|
+
alreadyInstalled: boolean;
|
|
91
|
+
prunedVersions: string[];
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Verify a staged runtime folder beside `<data>/runtime/`, atomically rename it to
|
|
95
|
+
* `<data>/runtime/<version>/`, clean up the temporary folder, sweep stale temp folders, and prune
|
|
96
|
+
* unused old runtime versions.
|
|
97
|
+
*/
|
|
98
|
+
export declare function finalizeStagedRuntime(input: {
|
|
99
|
+
home: Home;
|
|
100
|
+
stagedDir: string;
|
|
101
|
+
version: string;
|
|
102
|
+
deps?: RuntimeInstallDeps | undefined;
|
|
103
|
+
}): Promise<InstallRuntimeResult>;
|