@hearsay-tools/squawk 0.19.0-pr4575.9079 → 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/boot.js +2 -0
- package/dist/boot.js.map +1 -1
- 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/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/live-topic-registry.d.ts +29 -0
- package/dist/core/live-topic-registry.js +68 -0
- package/dist/core/live-topic-registry.js.map +1 -0
- package/dist/core/server-hook-registry.d.ts +19 -2
- package/dist/core/server-hook-registry.js +1 -0
- package/dist/core/server-hook-registry.js.map +1 -1
- package/dist/delegation/transport.d.ts +78 -78
- 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/reports/capability.d.ts +3 -0
- package/dist/features/reports/capability.js +6 -0
- package/dist/features/reports/capability.js.map +1 -0
- package/dist/features/reports/index.d.ts +13 -0
- package/dist/features/reports/index.js +12 -0
- package/dist/features/reports/index.js.map +1 -0
- package/dist/features/reports/live-topic.d.ts +5 -0
- package/dist/{server/reports-topic.js → features/reports/live-topic.js} +10 -7
- package/dist/features/reports/live-topic.js.map +1 -0
- package/dist/{artifacts → features/reports}/reports-index.d.ts +5 -5
- package/dist/{artifacts → features/reports}/reports-index.js +7 -7
- package/dist/features/reports/reports-index.js.map +1 -0
- package/dist/{artifacts → features/reports}/reports-watch.d.ts +3 -3
- package/dist/{artifacts → features/reports}/reports-watch.js +2 -2
- package/dist/features/reports/reports-watch.js.map +1 -0
- package/dist/{server/reports-api.d.ts → features/reports/routes.d.ts} +8 -4
- package/dist/features/reports/routes.js +32 -0
- package/dist/features/reports/routes.js.map +1 -0
- package/dist/features/reports/server-hook.d.ts +8 -0
- package/dist/features/reports/server-hook.js +25 -0
- package/dist/features/reports/server-hook.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/api.d.ts +3 -0
- package/dist/plugin/api.js +10 -1
- package/dist/plugin/api.js.map +1 -1
- package/dist/plugin/cli.js +1 -1
- package/dist/plugin/cli.js.map +1 -1
- package/dist/plugin/index.d.ts +2 -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/activity-routes.d.ts +23 -23
- package/dist/server/activity-routes.js +0 -2
- package/dist/server/activity-routes.js.map +1 -1
- package/dist/server/plugin-live-topics.d.ts +18 -0
- package/dist/server/plugin-live-topics.js +120 -0
- package/dist/server/plugin-live-topics.js.map +1 -0
- 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-context.js +0 -2
- package/dist/server/project-context.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/repo-routes.d.ts +52 -52
- package/dist/server/runners-routes.d.ts +10 -10
- package/dist/server/runs-routes.d.ts +979 -997
- 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 +1854 -2607
- package/dist/server/server.js +13 -20
- 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 +14 -14
- package/dist/server/start-server.js.map +1 -1
- package/dist/server/workspace-identity-routes.d.ts +5 -5
- 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/artifacts/reports-index.js.map +0 -1
- package/dist/artifacts/reports-watch.js.map +0 -1
- package/dist/runs/webhook.js.map +0 -1
- package/dist/server/reports-api.js +0 -22
- package/dist/server/reports-api.js.map +0 -1
- package/dist/server/reports-topic.d.ts +0 -5
- package/dist/server/reports-topic.js.map +0 -1
- package/dist/webhooks/cli.js.map +0 -1
- package/dist/webhooks/prompt.js.map +0 -1
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Live WebSocket topic registry for bundled features and plugins (spec
|
|
3
|
+
* 2026-11-30-task-file-store-and-bundled-webhooks-reports, Decision 3,
|
|
4
|
+
* hearsay-tools/squawk#4568). Follows the register -> seal -> read lifecycle of
|
|
5
|
+
* `core/registry.ts`. Each registered topic is mounted as a topic family
|
|
6
|
+
* `<id>:project:<project id>` by `server/plugin-live-topics.ts`; a plugin never
|
|
7
|
+
* receives the socket hub.
|
|
8
|
+
*/
|
|
9
|
+
import { createKeyedRegistry } from './registry.js';
|
|
10
|
+
export const LIVE_TOPIC_SCOPES = ['project'];
|
|
11
|
+
/** Core topic prefixes reserved by `server/ws.ts`, `server/activity-topic.ts`, `server/home-recovery-routes.ts` and `server/server.ts`. */
|
|
12
|
+
export const RESERVED_LIVE_TOPIC_IDS = new Set([
|
|
13
|
+
'activity',
|
|
14
|
+
'health',
|
|
15
|
+
'home',
|
|
16
|
+
]);
|
|
17
|
+
const LIVE_TOPIC_ID = /^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/;
|
|
18
|
+
// Keeps `<id>:project:<projectId>` within the 128-character WebSocket topic limit (`ws.ts`)
|
|
19
|
+
// for the longest 64-character project slug (`workspace/projects.ts` `SLUG_MAX`): 55 + 9 + 64 = 128.
|
|
20
|
+
export const MAX_LIVE_TOPIC_ID_LENGTH = 55;
|
|
21
|
+
const topics = createKeyedRegistry({
|
|
22
|
+
name: 'Live topics',
|
|
23
|
+
bootHint: 'register every live topic, then call sealLiveTopics() at the runtime boot boundary (boot.ts), or import a testkit that seals it.',
|
|
24
|
+
});
|
|
25
|
+
function checkShape(topic) {
|
|
26
|
+
if (typeof topic !== 'object' || topic === null) {
|
|
27
|
+
throw new Error('Live topics: a live topic definition must be an object.');
|
|
28
|
+
}
|
|
29
|
+
if (typeof topic.id !== 'string'
|
|
30
|
+
|| topic.id.length === 0
|
|
31
|
+
|| topic.id.length > MAX_LIVE_TOPIC_ID_LENGTH
|
|
32
|
+
|| !LIVE_TOPIC_ID.test(topic.id)) {
|
|
33
|
+
throw new Error(`Live topics: invalid id ${JSON.stringify(topic.id)} (must be a lowercase slug).`);
|
|
34
|
+
}
|
|
35
|
+
if (RESERVED_LIVE_TOPIC_IDS.has(topic.id)) {
|
|
36
|
+
throw new Error(`Live topics: '${topic.id}' is reserved for core.`);
|
|
37
|
+
}
|
|
38
|
+
if (!LIVE_TOPIC_SCOPES.includes(topic.scope)) {
|
|
39
|
+
throw new Error(`Live topics: '${topic.id}' has unsupported scope ${JSON.stringify(topic.scope)}.`);
|
|
40
|
+
}
|
|
41
|
+
if (topic.loopbackReadable !== undefined && typeof topic.loopbackReadable !== 'boolean') {
|
|
42
|
+
throw new Error(`Live topics: '${topic.id}' loopbackReadable must be a boolean.`);
|
|
43
|
+
}
|
|
44
|
+
if (typeof topic.publisher !== 'function') {
|
|
45
|
+
throw new Error(`Live topics: '${topic.id}' needs a publisher function.`);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
/** Throws what `registerLiveTopic` would throw, without writing. */
|
|
49
|
+
export function checkLiveTopicRegistration(topic) {
|
|
50
|
+
checkShape(topic);
|
|
51
|
+
topics.check(topic.id, topic);
|
|
52
|
+
}
|
|
53
|
+
export function registerLiveTopic(topic) {
|
|
54
|
+
checkLiveTopicRegistration(topic);
|
|
55
|
+
topics.register(topic.id, topic);
|
|
56
|
+
}
|
|
57
|
+
export function sealLiveTopics() { topics.seal(); }
|
|
58
|
+
/** Whether the registry is sealed. Never throws. */
|
|
59
|
+
export function liveTopicsSealed() { return topics.isSealed(); }
|
|
60
|
+
/** Registered live topics in registration order. Throws until sealed. */
|
|
61
|
+
export function registeredLiveTopics() {
|
|
62
|
+
return topics.values();
|
|
63
|
+
}
|
|
64
|
+
/** Look up one registered live topic by id. Throws until sealed. */
|
|
65
|
+
export function liveTopic(id) {
|
|
66
|
+
return topics.get(id);
|
|
67
|
+
}
|
|
68
|
+
//# sourceMappingURL=live-topic-registry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"live-topic-registry.js","sourceRoot":"","sources":["../../src/core/live-topic-registry.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AASpD,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,SAAS,CAAU,CAAC;AAGtD,2IAA2I;AAC3I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ACD,IAAI,KAAK,CAAC,gBAAgB,KAAK,SAAS,IAAI,OAAO,KAAK,CAAC,gBAAgB,KAAK,SAAS,EAAE,CAAC;QACxF,MAAM,IAAI,KAAK,CAAC,iBAAiB,KAAK,CAAC,EAAE,uCAAuC,CAAC,CAAC;IACpF,CAAC;IACD,IAAI,OAAO,KAAK,CAAC,SAAS,KAAK,UAAU,EAAE,CAAC;QAC1C,MAAM,IAAI,KAAK,CAAC,iBAAiB,KAAK,CAAC,EAAE,+BAA+B,CAAC,CAAC;IAC5E,CAAC;AACH,CAAC;AAED,oEAAoE;AACpE,MAAM,UAAU,0BAA0B,CAAC,KAA0B;IACnE,UAAU,CAAC,KAAK,CAAC,CAAC;IAClB,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;AAChC,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,KAA0B;IAC1D,0BAA0B,CAAC,KAAK,CAAC,CAAC;IAClC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;AACnC,CAAC;AAED,MAAM,UAAU,cAAc,KAAW,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;AAEzD,oDAAoD;AACpD,MAAM,UAAU,gBAAgB,KAAc,OAAO,MAAM,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC;AAEzE,yEAAyE;AACzE,MAAM,UAAU,oBAAoB;IAClC,OAAO,MAAM,CAAC,MAAM,EAAE,CAAC;AACzB,CAAC;AAED,oEAAoE;AACpE,MAAM,UAAU,SAAS,CAAC,EAAU;IAClC,OAAO,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;AACxB,CAAC"}
|
|
@@ -4,10 +4,12 @@
|
|
|
4
4
|
* cockpit app setup, server start/stop, per-project context lifecycle, and archived-run search
|
|
5
5
|
* without leaking feature imports into `server/`.
|
|
6
6
|
*/
|
|
7
|
+
import type { NoBootProjectErrorCode } from '../contract/index.js';
|
|
7
8
|
import type { ProviderStatusResponse } from '../contract/index.js';
|
|
8
9
|
import type { Home } from '../home/home.ts';
|
|
9
10
|
import type { RunStore } from '../runs/store.ts';
|
|
10
11
|
import type { RunManager } from '../workflows/run.ts';
|
|
12
|
+
import type { WorkspaceProject } from '../workspace/config.ts';
|
|
11
13
|
import type { RunnerModelCatalog } from './runner-model-catalog.ts';
|
|
12
14
|
/** Per-project plugin state keyed by feature-owned string keys. */
|
|
13
15
|
export interface ProjectPluginState {
|
|
@@ -22,16 +24,26 @@ export interface ServerProjectManagerPort {
|
|
|
22
24
|
cockpitAddress: RunManager['cockpitAddress'];
|
|
23
25
|
setToolService?: (key: string, service: unknown) => void;
|
|
24
26
|
}
|
|
25
|
-
/**
|
|
26
|
-
export interface
|
|
27
|
+
/** Project store handle passed to `onProjectStoreOpened`, after the store opens and before recovery. */
|
|
28
|
+
export interface ServerProjectStoreHandle {
|
|
27
29
|
readonly home: Home;
|
|
28
30
|
readonly id: string;
|
|
29
31
|
readonly root: string;
|
|
30
32
|
readonly dataDir: string;
|
|
31
33
|
readonly store: RunStore;
|
|
34
|
+
}
|
|
35
|
+
/** Per-project handle passed to server hooks and project-scoped plugin bundles. */
|
|
36
|
+
export interface ServerProjectHandle extends ServerProjectStoreHandle {
|
|
32
37
|
readonly manager: ServerProjectManagerPort;
|
|
33
38
|
readonly state: ProjectPluginState;
|
|
34
39
|
}
|
|
40
|
+
/** Result of resolving a raw route project parameter (`default`, boot id, or registered slug). */
|
|
41
|
+
export type ResolvedProjectId = {
|
|
42
|
+
id: string;
|
|
43
|
+
} | {
|
|
44
|
+
error: string;
|
|
45
|
+
code?: NoBootProjectErrorCode;
|
|
46
|
+
};
|
|
35
47
|
/** Registered project summary for server-wide background services. */
|
|
36
48
|
export interface ServerProjectEntry {
|
|
37
49
|
readonly id: string;
|
|
@@ -63,6 +75,8 @@ export interface ServerPluginContext {
|
|
|
63
75
|
readonly home: Home;
|
|
64
76
|
/** Boot project id, or `undefined` on a server started with no boot project. */
|
|
65
77
|
readonly bootProjectId?: string | undefined;
|
|
78
|
+
/** Resolves with the bound cockpit origin once the listener binds, or immediately with `''` when built without a listener. */
|
|
79
|
+
readonly cockpitOrigin: Promise<string>;
|
|
66
80
|
readonly capabilities: () => Readonly<Record<string, boolean | undefined>>;
|
|
67
81
|
readonly modelCatalog: RunnerModelCatalog;
|
|
68
82
|
readonly providerStatus: (options?: {
|
|
@@ -76,6 +90,8 @@ export interface ServerPluginContext {
|
|
|
76
90
|
peek(projectId: string): ServerProjectHandle | undefined;
|
|
77
91
|
ids(): string[];
|
|
78
92
|
resolve(projectId: string): Promise<ServerProjectHandle>;
|
|
93
|
+
resolveId(raw: string): Promise<ResolvedProjectId>;
|
|
94
|
+
registryEntry(raw: string): Promise<WorkspaceProject | undefined>;
|
|
79
95
|
};
|
|
80
96
|
ensureProjectReady(root: string): Promise<void>;
|
|
81
97
|
ensureProjectsReady<T extends ServerProjectEntry>(projects: readonly T[], options?: {
|
|
@@ -88,6 +104,7 @@ export interface ServerHookDefinition {
|
|
|
88
104
|
onAppCreated?(context: ServerPluginContext): void;
|
|
89
105
|
onServerStart?(context: ServerPluginContext, start: ServerStartContext): void | Promise<void>;
|
|
90
106
|
onServerStop?(context: ServerPluginContext): void;
|
|
107
|
+
onProjectStoreOpened?(project: ServerProjectStoreHandle): void;
|
|
91
108
|
onProjectContextBuilt?(project: ServerProjectHandle, context: ServerPluginContext): void;
|
|
92
109
|
onProjectContextDisposed?(project: ServerProjectHandle, context: ServerPluginContext): void;
|
|
93
110
|
/** Optional id → display label entries merged into archived-run search matching. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server-hook-registry.js","sourceRoot":"","sources":["../../src/core/server-hook-registry.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"server-hook-registry.js","sourceRoot":"","sources":["../../src/core/server-hook-registry.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe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E,SAAS;QAC/B,IAAI,OAAO,EAAE,KAAK,UAAU;YAAE,MAAM,IAAI,KAAK,CAAC,kBAAkB,IAAI,CAAC,EAAE,KAAK,GAAG,sBAAsB,CAAC,CAAC;QACvG,IAAI,EAAE,CAAC,WAAW,EAAE,IAAI,KAAK,eAAe,EAAE,CAAC;YAC7C,MAAM,IAAI,KAAK,CAAC,kBAAkB,IAAI,CAAC,EAAE,KAAK,GAAG,uBAAuB,CAAC,CAAC;QAC5E,CAAC;IACH,CAAC;IACD,IAAI,IAAI,CAAC,aAAa,KAAK,SAAS,IAAI,OAAO,IAAI,CAAC,aAAa,KAAK,UAAU,EAAE,CAAC;QACjF,MAAM,IAAI,KAAK,CAAC,kBAAkB,IAAI,CAAC,EAAE,qCAAqC,CAAC,CAAC;IAClF,CAAC;AACH,CAAC;AAED,qEAAqE;AACrE,MAAM,UAAU,2BAA2B,CAAC,IAA0B;IACpE,UAAU,CAAC,IAAI,CAAC,CAAC;IACjB,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,EAAE,IAAI,CAAC,CAAC;AAC7B,CAAC;AAED,MAAM,UAAU,kBAAkB,CAAC,IAA0B;IAC3D,2BAA2B,CAAC,IAAI,CAAC,CAAC;IAClC,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,EAAE,IAAI,CAAC,CAAC;AAChC,CAAC;AAED,MAAM,UAAU,eAAe,KAAW,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;AAEzD,oDAAoD;AACpD,MAAM,UAAU,iBAAiB,KAAc,OAAO,KAAK,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC;AAEzE,0EAA0E;AAC1E,MAAM,UAAU,qBAAqB;IACnC,OAAO,KAAK,CAAC,MAAM,EAAE,CAAC;AACxB,CAAC"}
|
|
@@ -2,6 +2,18 @@ import type { DelegationRoutes } from './routes.ts';
|
|
|
2
2
|
export declare function createDelegationApp(routes: DelegationRoutes): import("hono/hono-base").HonoBase<import("hono/types").BlankEnv, import("hono/types").BlankSchema | import("hono/types").MergeSchemaPath<{
|
|
3
3
|
"/list": {
|
|
4
4
|
$get: {
|
|
5
|
+
output: {
|
|
6
|
+
error: string;
|
|
7
|
+
code?: "invalid_input" | undefined;
|
|
8
|
+
};
|
|
9
|
+
outputFormat: "json";
|
|
10
|
+
status: 400;
|
|
11
|
+
input: {
|
|
12
|
+
query: {
|
|
13
|
+
offset?: string | undefined;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
} | {
|
|
5
17
|
output: {
|
|
6
18
|
workers: {
|
|
7
19
|
workerId: string;
|
|
@@ -54,18 +66,6 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
|
|
|
54
66
|
offset?: string | undefined;
|
|
55
67
|
};
|
|
56
68
|
};
|
|
57
|
-
} | {
|
|
58
|
-
output: {
|
|
59
|
-
error: string;
|
|
60
|
-
code?: "invalid_input" | undefined;
|
|
61
|
-
};
|
|
62
|
-
outputFormat: "json";
|
|
63
|
-
status: 400;
|
|
64
|
-
input: {
|
|
65
|
-
query: {
|
|
66
|
-
offset?: string | undefined;
|
|
67
|
-
};
|
|
68
|
-
};
|
|
69
69
|
};
|
|
70
70
|
};
|
|
71
71
|
} & {
|
|
@@ -652,6 +652,18 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
|
|
|
652
652
|
} & {
|
|
653
653
|
"/:workerId": {
|
|
654
654
|
$get: {
|
|
655
|
+
output: {
|
|
656
|
+
error: string;
|
|
657
|
+
code?: "invalid_input" | undefined;
|
|
658
|
+
};
|
|
659
|
+
outputFormat: "json";
|
|
660
|
+
status: 400;
|
|
661
|
+
input: {
|
|
662
|
+
param: {
|
|
663
|
+
workerId: string;
|
|
664
|
+
};
|
|
665
|
+
};
|
|
666
|
+
} | {
|
|
655
667
|
output: {
|
|
656
668
|
workerId: string;
|
|
657
669
|
settled: boolean;
|
|
@@ -776,7 +788,11 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
|
|
|
776
788
|
workerId: string;
|
|
777
789
|
};
|
|
778
790
|
};
|
|
779
|
-
}
|
|
791
|
+
};
|
|
792
|
+
};
|
|
793
|
+
} & {
|
|
794
|
+
"/:workerId/collect": {
|
|
795
|
+
$post: {
|
|
780
796
|
output: {
|
|
781
797
|
error: string;
|
|
782
798
|
code?: "invalid_input" | undefined;
|
|
@@ -787,12 +803,10 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
|
|
|
787
803
|
param: {
|
|
788
804
|
workerId: string;
|
|
789
805
|
};
|
|
806
|
+
} & {
|
|
807
|
+
json: Record<string, never>;
|
|
790
808
|
};
|
|
791
|
-
}
|
|
792
|
-
};
|
|
793
|
-
} & {
|
|
794
|
-
"/:workerId/collect": {
|
|
795
|
-
$post: {
|
|
809
|
+
} | {
|
|
796
810
|
output: {
|
|
797
811
|
workerId: string;
|
|
798
812
|
parentRunId: string;
|
|
@@ -917,7 +931,11 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
|
|
|
917
931
|
} & {
|
|
918
932
|
json: Record<string, never>;
|
|
919
933
|
};
|
|
920
|
-
}
|
|
934
|
+
};
|
|
935
|
+
};
|
|
936
|
+
} & {
|
|
937
|
+
"/:workerId/steer": {
|
|
938
|
+
$post: {
|
|
921
939
|
output: {
|
|
922
940
|
error: string;
|
|
923
941
|
code?: "invalid_input" | undefined;
|
|
@@ -929,13 +947,11 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
|
|
|
929
947
|
workerId: string;
|
|
930
948
|
};
|
|
931
949
|
} & {
|
|
932
|
-
json:
|
|
950
|
+
json: {
|
|
951
|
+
text: string;
|
|
952
|
+
};
|
|
933
953
|
};
|
|
934
|
-
}
|
|
935
|
-
};
|
|
936
|
-
} & {
|
|
937
|
-
"/:workerId/steer": {
|
|
938
|
-
$post: {
|
|
954
|
+
} | {
|
|
939
955
|
output: {
|
|
940
956
|
workerId: string;
|
|
941
957
|
state: "delivered" | "queued";
|
|
@@ -951,7 +967,11 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
|
|
|
951
967
|
text: string;
|
|
952
968
|
};
|
|
953
969
|
};
|
|
954
|
-
}
|
|
970
|
+
};
|
|
971
|
+
};
|
|
972
|
+
} & {
|
|
973
|
+
"/:workerId/stop": {
|
|
974
|
+
$post: {
|
|
955
975
|
output: {
|
|
956
976
|
error: string;
|
|
957
977
|
code?: "invalid_input" | undefined;
|
|
@@ -963,15 +983,9 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
|
|
|
963
983
|
workerId: string;
|
|
964
984
|
};
|
|
965
985
|
} & {
|
|
966
|
-
json:
|
|
967
|
-
text: string;
|
|
968
|
-
};
|
|
986
|
+
json: Record<string, never>;
|
|
969
987
|
};
|
|
970
|
-
}
|
|
971
|
-
};
|
|
972
|
-
} & {
|
|
973
|
-
"/:workerId/stop": {
|
|
974
|
-
$post: {
|
|
988
|
+
} | {
|
|
975
989
|
output: {
|
|
976
990
|
workerId: string;
|
|
977
991
|
state: "stopping" | "terminated";
|
|
@@ -985,7 +999,11 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
|
|
|
985
999
|
} & {
|
|
986
1000
|
json: Record<string, never>;
|
|
987
1001
|
};
|
|
988
|
-
}
|
|
1002
|
+
};
|
|
1003
|
+
};
|
|
1004
|
+
} & {
|
|
1005
|
+
"/:workerId/destroy": {
|
|
1006
|
+
$post: {
|
|
989
1007
|
output: {
|
|
990
1008
|
error: string;
|
|
991
1009
|
code?: "invalid_input" | undefined;
|
|
@@ -997,13 +1015,11 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
|
|
|
997
1015
|
workerId: string;
|
|
998
1016
|
};
|
|
999
1017
|
} & {
|
|
1000
|
-
json:
|
|
1018
|
+
json: {
|
|
1019
|
+
discardWork?: true | undefined;
|
|
1020
|
+
};
|
|
1001
1021
|
};
|
|
1002
|
-
}
|
|
1003
|
-
};
|
|
1004
|
-
} & {
|
|
1005
|
-
"/:workerId/destroy": {
|
|
1006
|
-
$post: {
|
|
1022
|
+
} | {
|
|
1007
1023
|
output: {
|
|
1008
1024
|
workerId: string;
|
|
1009
1025
|
state: "complete" | "incomplete";
|
|
@@ -1032,22 +1048,6 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
|
|
|
1032
1048
|
discardWork?: true | undefined;
|
|
1033
1049
|
};
|
|
1034
1050
|
};
|
|
1035
|
-
} | {
|
|
1036
|
-
output: {
|
|
1037
|
-
error: string;
|
|
1038
|
-
code?: "invalid_input" | undefined;
|
|
1039
|
-
};
|
|
1040
|
-
outputFormat: "json";
|
|
1041
|
-
status: 400;
|
|
1042
|
-
input: {
|
|
1043
|
-
param: {
|
|
1044
|
-
workerId: string;
|
|
1045
|
-
};
|
|
1046
|
-
} & {
|
|
1047
|
-
json: {
|
|
1048
|
-
discardWork?: true | undefined;
|
|
1049
|
-
};
|
|
1050
|
-
};
|
|
1051
1051
|
} | {
|
|
1052
1052
|
output: {
|
|
1053
1053
|
workerId: string;
|
|
@@ -1083,18 +1083,11 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
|
|
|
1083
1083
|
"/:workerId/summary": {
|
|
1084
1084
|
$post: {
|
|
1085
1085
|
output: {
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
source: "assistant" | "failure";
|
|
1089
|
-
seq: number;
|
|
1090
|
-
totalLines: number;
|
|
1091
|
-
offset: number;
|
|
1092
|
-
lineCount: number;
|
|
1093
|
-
text: string;
|
|
1094
|
-
nextOffset?: number | undefined;
|
|
1086
|
+
error: string;
|
|
1087
|
+
code?: "invalid_input" | undefined;
|
|
1095
1088
|
};
|
|
1096
1089
|
outputFormat: "json";
|
|
1097
|
-
status:
|
|
1090
|
+
status: 400;
|
|
1098
1091
|
input: {
|
|
1099
1092
|
param: {
|
|
1100
1093
|
workerId: string;
|
|
@@ -1107,11 +1100,18 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
|
|
|
1107
1100
|
};
|
|
1108
1101
|
} | {
|
|
1109
1102
|
output: {
|
|
1110
|
-
|
|
1111
|
-
|
|
1103
|
+
workerId: string;
|
|
1104
|
+
revision: number;
|
|
1105
|
+
source: "assistant" | "failure";
|
|
1106
|
+
seq: number;
|
|
1107
|
+
totalLines: number;
|
|
1108
|
+
offset: number;
|
|
1109
|
+
lineCount: number;
|
|
1110
|
+
text: string;
|
|
1111
|
+
nextOffset?: number | undefined;
|
|
1112
1112
|
};
|
|
1113
1113
|
outputFormat: "json";
|
|
1114
|
-
status:
|
|
1114
|
+
status: 200;
|
|
1115
1115
|
input: {
|
|
1116
1116
|
param: {
|
|
1117
1117
|
workerId: string;
|
|
@@ -1128,13 +1128,11 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
|
|
|
1128
1128
|
"/:workerId/diff": {
|
|
1129
1129
|
$get: {
|
|
1130
1130
|
output: {
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
diff: string;
|
|
1134
|
-
truncated: boolean;
|
|
1131
|
+
error: string;
|
|
1132
|
+
code?: "invalid_input" | undefined;
|
|
1135
1133
|
};
|
|
1136
1134
|
outputFormat: "json";
|
|
1137
|
-
status:
|
|
1135
|
+
status: 400;
|
|
1138
1136
|
input: {
|
|
1139
1137
|
param: {
|
|
1140
1138
|
workerId: string;
|
|
@@ -1142,11 +1140,13 @@ export declare function createDelegationApp(routes: DelegationRoutes): import("h
|
|
|
1142
1140
|
};
|
|
1143
1141
|
} | {
|
|
1144
1142
|
output: {
|
|
1145
|
-
|
|
1146
|
-
|
|
1143
|
+
workerId: string;
|
|
1144
|
+
baselineSha: string;
|
|
1145
|
+
diff: string;
|
|
1146
|
+
truncated: boolean;
|
|
1147
1147
|
};
|
|
1148
1148
|
outputFormat: "json";
|
|
1149
|
-
status:
|
|
1149
|
+
status: 200;
|
|
1150
1150
|
input: {
|
|
1151
1151
|
param: {
|
|
1152
1152
|
workerId: string;
|
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `hsq host add | list | remove` (spec § Architecture 1, hearsay-tools/squawk#4537).
|
|
3
|
+
*
|
|
4
|
+
* Host-operator CLI for managing `<config>/hosts.json` directly through `HomeStore`.
|
|
5
|
+
* Works with no cockpit running; running cockpits of the same home see updates on the next read.
|
|
6
|
+
*/
|
|
7
|
+
import { type ParseArgsOptionsConfig } from 'node:util';
|
|
1
8
|
import type { Home } from '../../home/home.ts';
|
|
2
9
|
export declare const HOST_CLI_USAGE: string;
|
|
3
10
|
export interface HostCliDeps {
|
|
@@ -5,4 +12,56 @@ export interface HostCliDeps {
|
|
|
5
12
|
stdout?: (line: string) => void;
|
|
6
13
|
stderr?: (line: string) => void;
|
|
7
14
|
}
|
|
15
|
+
export interface HostCliIo {
|
|
16
|
+
stdout(line: string): void;
|
|
17
|
+
stderr(line: string): void;
|
|
18
|
+
}
|
|
19
|
+
export declare class HostCliUsageError extends Error {
|
|
20
|
+
}
|
|
21
|
+
export declare function resolveHostCliIo(deps: Pick<HostCliDeps, 'stdout' | 'stderr'>): HostCliIo;
|
|
22
|
+
export declare function isHostCliHelp(argv: readonly string[]): boolean;
|
|
23
|
+
export declare function parseStrictHostArgs<T extends ParseArgsOptionsConfig>(argv: string[], options: T): {
|
|
24
|
+
values: T & {
|
|
25
|
+
json: {
|
|
26
|
+
type: "boolean";
|
|
27
|
+
default: false;
|
|
28
|
+
};
|
|
29
|
+
help: {
|
|
30
|
+
type: "boolean";
|
|
31
|
+
short: string;
|
|
32
|
+
default: false;
|
|
33
|
+
};
|
|
34
|
+
} extends ParseArgsOptionsConfig ? (T & {
|
|
35
|
+
json: {
|
|
36
|
+
type: "boolean";
|
|
37
|
+
default: false;
|
|
38
|
+
};
|
|
39
|
+
help: {
|
|
40
|
+
type: "boolean";
|
|
41
|
+
short: string;
|
|
42
|
+
default: false;
|
|
43
|
+
};
|
|
44
|
+
} extends infer T_1 extends ParseArgsOptionsConfig ? { -readonly [LongOption in keyof T_1]?: V[LongOption]; } : never) & (T & {
|
|
45
|
+
json: {
|
|
46
|
+
type: "boolean";
|
|
47
|
+
default: false;
|
|
48
|
+
};
|
|
49
|
+
help: {
|
|
50
|
+
type: "boolean";
|
|
51
|
+
short: string;
|
|
52
|
+
default: false;
|
|
53
|
+
};
|
|
54
|
+
} extends infer T_2 extends ParseArgsOptionsConfig ? { [LongOption in keyof T_2 as (T & {
|
|
55
|
+
json: {
|
|
56
|
+
type: "boolean";
|
|
57
|
+
default: false;
|
|
58
|
+
};
|
|
59
|
+
help: {
|
|
60
|
+
type: "boolean";
|
|
61
|
+
short: string;
|
|
62
|
+
default: false;
|
|
63
|
+
};
|
|
64
|
+
})[LongOption]["default"] extends {} ? LongOption : never]: V[LongOption]; } : never) extends infer P ? { [K in keyof P]: P[K]; } : never : {};
|
|
65
|
+
positionals: string[];
|
|
66
|
+
};
|
|
8
67
|
export declare function runHostCommand(argv: string[], _env: NodeJS.ProcessEnv, deps?: HostCliDeps): Promise<number>;
|
|
@@ -14,24 +14,23 @@ export const HOST_CLI_USAGE = commandText(`usage:
|
|
|
14
14
|
cez host list [--json] list saved remote hosts
|
|
15
15
|
cez host remove <id> [--json]
|
|
16
16
|
remove a saved remote host`);
|
|
17
|
-
class HostCliUsageError extends Error {
|
|
17
|
+
export class HostCliUsageError extends Error {
|
|
18
18
|
}
|
|
19
|
-
function
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
}
|
|
25
|
-
return Number(value);
|
|
19
|
+
export function resolveHostCliIo(deps) {
|
|
20
|
+
return {
|
|
21
|
+
stdout: deps.stdout ?? ((line) => console.log(line)),
|
|
22
|
+
stderr: deps.stderr ?? ((line) => console.error(line)),
|
|
23
|
+
};
|
|
26
24
|
}
|
|
27
|
-
function
|
|
25
|
+
export function isHostCliHelp(argv) {
|
|
26
|
+
return argv.length === 0 || argv[0] === 'help' || argv.includes('--help') || argv.includes('-h');
|
|
27
|
+
}
|
|
28
|
+
export function parseStrictHostArgs(argv, options) {
|
|
28
29
|
try {
|
|
29
30
|
return parseArgs({
|
|
30
31
|
args: argv,
|
|
31
32
|
options: {
|
|
32
|
-
|
|
33
|
-
label: { type: 'string' },
|
|
34
|
-
port: { type: 'string' },
|
|
33
|
+
...options,
|
|
35
34
|
json: { type: 'boolean', default: false },
|
|
36
35
|
help: { type: 'boolean', short: 'h', default: false },
|
|
37
36
|
},
|
|
@@ -43,6 +42,21 @@ function parseHostArgv(argv) {
|
|
|
43
42
|
throw new HostCliUsageError(error instanceof Error ? error.message : 'invalid arguments');
|
|
44
43
|
}
|
|
45
44
|
}
|
|
45
|
+
function parsePortFlag(value) {
|
|
46
|
+
if (value === undefined)
|
|
47
|
+
return undefined;
|
|
48
|
+
if (!/^[1-9]\d{0,4}$/.test(value) || Number(value) > 65_535) {
|
|
49
|
+
throw new HostCliUsageError(`--port must be an integer between 1 and 65535, not "${value}"`);
|
|
50
|
+
}
|
|
51
|
+
return Number(value);
|
|
52
|
+
}
|
|
53
|
+
function parseHostArgv(argv) {
|
|
54
|
+
return parseStrictHostArgs(argv, {
|
|
55
|
+
id: { type: 'string' },
|
|
56
|
+
label: { type: 'string' },
|
|
57
|
+
port: { type: 'string' },
|
|
58
|
+
});
|
|
59
|
+
}
|
|
46
60
|
function formatHostRow(entry, idWidth, labelWidth) {
|
|
47
61
|
const portSuffix = entry.port !== undefined ? ` port=${entry.port}` : '';
|
|
48
62
|
return ` · ${entry.id.padEnd(idWidth)} ${entry.label.padEnd(labelWidth)} unreachable (${HOST_NOT_CONNECTED_REASON}) ssh=${entry.sshAlias}${portSuffix}`;
|
|
@@ -137,11 +151,8 @@ function reportCliError(error, json, io) {
|
|
|
137
151
|
return exitCode;
|
|
138
152
|
}
|
|
139
153
|
export async function runHostCommand(argv, _env, deps = {}) {
|
|
140
|
-
const io =
|
|
141
|
-
|
|
142
|
-
stderr: deps.stderr ?? ((line) => console.error(line)),
|
|
143
|
-
};
|
|
144
|
-
if (argv.length === 0 || argv[0] === 'help' || argv.includes('--help') || argv.includes('-h')) {
|
|
154
|
+
const io = resolveHostCliIo(deps);
|
|
155
|
+
if (isHostCliHelp(argv)) {
|
|
145
156
|
io.stdout(HOST_CLI_USAGE);
|
|
146
157
|
return 0;
|
|
147
158
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../../../src/features/hosts/cli.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,SAAS,
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../../../src/features/hosts/cli.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,SAAS,EAA+B,MAAM,WAAW,CAAC;AACnE,OAAO,EAAE,yBAAyB,EAAkB,MAAM,oCAAoC,CAAC;AAC/F,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAEpD,OAAO,EAAE,kBAAkB,EAAE,OAAO,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3F,MAAM,CAAC,MAAM,cAAc,GAAG,WAAW,CAAC;;;;;uDAKa,CAAC,CAAC;AAazD,MAAM,OAAO,iBAAkB,SAAQ,KAAK;CAAG;AAE/C,MAAM,UAAU,gBAAgB,CAAC,IAA4C;IAC3E,OAAO;QACL,MAAM,EAAE,IAAI,CAAC,MAAM,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QACpD,MAAM,EAAE,IAAI,CAAC,MAAM,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;KACvD,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,aAAa,CAAC,IAAuB;IACnD,OAAO,IAAI,CAAC,MAAM,KAAK,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC,KAAK,MAAM,IAAI,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,IAAI,CAAC,QAAQ,CAAC,IAAI,CAA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AAI;YAAE,MAAM,IAAI,KAAK,CAAC,wCAAwC,CAAC,CAAC;QAC1E,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC;QACzB,IAAI,MAAM,KAAK,MAAM;YAAE,OAAO,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC;QAC9D,IAAI,MAAM,KAAK,KAAK;YAAE,OAAO,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC;QAC5D,OAAO,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC;IAC3C,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,cAAc,CAAC,KAAK,EAAE,SAAS,EAAE,EAAE,CAAC,CAAC;IAC9C,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { Home } from '../../home/home.ts';
|
|
2
|
+
import { type HostServerOpsDeps } from './host-server.ts';
|
|
3
|
+
import { type RuntimeInstallDeps } from './runtime-archive.ts';
|
|
4
|
+
export declare const HOST_SERVER_CLI_USAGE: string;
|
|
5
|
+
export interface HostServerCliDeps {
|
|
6
|
+
home?: () => Home;
|
|
7
|
+
stdout?: (line: string) => void;
|
|
8
|
+
stderr?: (line: string) => void;
|
|
9
|
+
ops?: HostServerOpsDeps;
|
|
10
|
+
runtimeInstall?: RuntimeInstallDeps;
|
|
11
|
+
readOwnVersion?: () => string;
|
|
12
|
+
}
|
|
13
|
+
export declare function runHostServerCommand(argv: string[], env: NodeJS.ProcessEnv, deps?: HostServerCliDeps): Promise<number>;
|