@geminixiang/mikan 1.0.0-beta.26 → 1.0.0-beta.28
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 +34 -0
- package/README.md +1 -1
- package/dist/adapters/discord/bot.d.ts.map +1 -1
- package/dist/adapters/discord/bot.js +17 -3
- package/dist/adapters/discord/bot.js.map +1 -1
- package/dist/adapters/slack/blocks.d.ts.map +1 -1
- package/dist/adapters/slack/blocks.js +49 -5
- package/dist/adapters/slack/blocks.js.map +1 -1
- package/dist/adapters/slack/bot.d.ts.map +1 -1
- package/dist/adapters/slack/bot.js +13 -1
- package/dist/adapters/slack/bot.js.map +1 -1
- package/dist/adapters/slack/response-lifecycle.d.ts.map +1 -1
- package/dist/adapters/slack/response-lifecycle.js +14 -4
- package/dist/adapters/slack/response-lifecycle.js.map +1 -1
- package/dist/adapters/telegram/bot.d.ts.map +1 -1
- package/dist/adapters/telegram/bot.js +24 -1
- package/dist/adapters/telegram/bot.js.map +1 -1
- package/dist/agent.d.ts.map +1 -1
- package/dist/agent.js +73 -0
- package/dist/agent.js.map +1 -1
- package/dist/cli/boot.d.ts +1 -1
- package/dist/cli/boot.d.ts.map +1 -1
- package/dist/cli/boot.js +7 -14
- package/dist/cli/boot.js.map +1 -1
- package/dist/commands/new.d.ts.map +1 -1
- package/dist/commands/new.js +8 -1
- package/dist/commands/new.js.map +1 -1
- package/dist/commands/types.d.ts +2 -1
- package/dist/commands/types.d.ts.map +1 -1
- package/dist/commands/types.js.map +1 -1
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +13 -40
- package/dist/config.js.map +1 -1
- package/dist/harness/extensions/registry.d.ts +19 -7
- package/dist/harness/extensions/registry.d.ts.map +1 -1
- package/dist/harness/extensions/registry.js +65 -6
- package/dist/harness/extensions/registry.js.map +1 -1
- package/dist/harness/extensions/types.d.ts +27 -6
- package/dist/harness/extensions/types.d.ts.map +1 -1
- package/dist/harness/extensions/types.js.map +1 -1
- package/dist/harness/index.d.ts +1 -1
- package/dist/harness/index.d.ts.map +1 -1
- package/dist/harness/index.js.map +1 -1
- package/dist/harness/runner.d.ts +8 -1
- package/dist/harness/runner.d.ts.map +1 -1
- package/dist/harness/runner.js +62 -11
- package/dist/harness/runner.js.map +1 -1
- package/dist/harness/session-store.d.ts +5 -4
- package/dist/harness/session-store.d.ts.map +1 -1
- package/dist/harness/session-store.js +120 -28
- package/dist/harness/session-store.js.map +1 -1
- package/dist/main.js +1 -51
- package/dist/main.js.map +1 -1
- package/dist/runtime/conversation-runtime.js +86 -4
- package/dist/runtime/conversation-runtime.js.map +1 -1
- package/dist/runtime/types.d.ts +2 -0
- package/dist/runtime/types.d.ts.map +1 -1
- package/dist/runtime/types.js.map +1 -1
- package/dist/sandbox/gondolin-bootstrap.d.ts +3 -17
- package/dist/sandbox/gondolin-bootstrap.d.ts.map +1 -1
- package/dist/sandbox/gondolin-bootstrap.js +2 -20
- package/dist/sandbox/gondolin-bootstrap.js.map +1 -1
- package/dist/sandbox/gondolin-contract.d.ts +3 -70
- package/dist/sandbox/gondolin-contract.d.ts.map +1 -1
- package/dist/sandbox/gondolin-contract.js +5 -89
- package/dist/sandbox/gondolin-contract.js.map +1 -1
- package/dist/sandbox/gondolin-recovery.d.ts +5 -18
- package/dist/sandbox/gondolin-recovery.d.ts.map +1 -1
- package/dist/sandbox/gondolin-recovery.js +5 -20
- package/dist/sandbox/gondolin-recovery.js.map +1 -1
- package/dist/sandbox/gondolin-worker-client.d.ts +8 -33
- package/dist/sandbox/gondolin-worker-client.d.ts.map +1 -1
- package/dist/sandbox/gondolin-worker-client.js +6 -7
- package/dist/sandbox/gondolin-worker-client.js.map +1 -1
- package/dist/sandbox/gondolin.d.ts +0 -5
- package/dist/sandbox/gondolin.d.ts.map +1 -1
- package/dist/sandbox/gondolin.js +14 -56
- package/dist/sandbox/gondolin.js.map +1 -1
- package/dist/sandbox/types.d.ts +1 -1
- package/dist/sandbox/types.d.ts.map +1 -1
- package/dist/sandbox/types.js.map +1 -1
- package/dist/sessions/chat-history-sync.d.ts.map +1 -1
- package/dist/sessions/chat-history-sync.js +14 -3
- package/dist/sessions/chat-history-sync.js.map +1 -1
- package/dist/tools/bash.d.ts.map +1 -1
- package/dist/tools/bash.js +1 -0
- package/dist/tools/bash.js.map +1 -1
- package/dist/tools/edit.d.ts.map +1 -1
- package/dist/tools/edit.js +1 -0
- package/dist/tools/edit.js.map +1 -1
- package/dist/tools/sandbox.d.ts.map +1 -1
- package/dist/tools/sandbox.js +1 -0
- package/dist/tools/sandbox.js.map +1 -1
- package/dist/tools/write.d.ts.map +1 -1
- package/dist/tools/write.js +1 -0
- package/dist/tools/write.js.map +1 -1
- package/dist/types.d.ts +6 -65
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/package.json +1 -1
- package/dist/sandbox/gondolin-fleet.d.ts +0 -104
- package/dist/sandbox/gondolin-fleet.d.ts.map +0 -1
- package/dist/sandbox/gondolin-fleet.js +0 -330
- package/dist/sandbox/gondolin-fleet.js.map +0 -1
- package/dist/sandbox/gondolin-gateway.d.ts +0 -86
- package/dist/sandbox/gondolin-gateway.d.ts.map +0 -1
- package/dist/sandbox/gondolin-gateway.js +0 -407
- package/dist/sandbox/gondolin-gateway.js.map +0 -1
- package/dist/sandbox/gondolin-join.d.ts +0 -62
- package/dist/sandbox/gondolin-join.d.ts.map +0 -1
- package/dist/sandbox/gondolin-join.js +0 -261
- package/dist/sandbox/gondolin-join.js.map +0 -1
- package/dist/sandbox/gondolin-nfs-advisory.d.ts +0 -15
- package/dist/sandbox/gondolin-nfs-advisory.d.ts.map +0 -1
- package/dist/sandbox/gondolin-nfs-advisory.js +0 -60
- package/dist/sandbox/gondolin-nfs-advisory.js.map +0 -1
- package/dist/sandbox/gondolin-placement.d.ts +0 -30
- package/dist/sandbox/gondolin-placement.d.ts.map +0 -1
- package/dist/sandbox/gondolin-placement.js +0 -77
- package/dist/sandbox/gondolin-placement.js.map +0 -1
- package/dist/sandbox/gondolin-remote.d.ts +0 -70
- package/dist/sandbox/gondolin-remote.d.ts.map +0 -1
- package/dist/sandbox/gondolin-remote.js +0 -325
- package/dist/sandbox/gondolin-remote.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/runtime/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,KAAK,EACV,YAAY,EACZ,mBAAmB,EACnB,iBAAiB,EACjB,qBAAqB,EACrB,gBAAgB,EAChB,gBAAgB,EAChB,eAAe,EACf,gBAAgB,EACjB,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,EACV,mBAAmB,EACnB,cAAc,EACd,eAAe,EACf,kBAAkB,EAClB,yBAAyB,EAC1B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAC;AACjE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEtD,MAAM,WAAW,uBAAuB;IACtC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,GAAG,CAAC,EAAE,MAAM,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,wBAAwB;IACvC,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,cAAc,CAAC;IACvB,aAAa,EAAE,OAAO,CAAC;IACvB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,cAAc,EAAE,MAAM,CAAC;IACvB,WAAW,EAAE,MAAM,CAAC;IACpB,0DAA0D;IAC1D,SAAS,EAAE,MAAM,CAAC;IAClB,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,iBAAiB,CAAC;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4E;IAC5E,uBAAuB,IAAI;QAAE,IAAI,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC;IAC9C,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC7C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/runtime/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { PiAgentWrapper } from \"../agent.js\";\nimport type {\n MessagingBot,\n ConversationContext,\n ConversationEvent,\n MessagingEventHandler,\n ConversationKind,\n PlatformNotifier,\n PlatformReactor,\n PlatformUploader,\n} from \"../adapter.js\";\nimport type {\n AdminTokenStoreLike,\n CommandHandler,\n CommandServices,\n LinkTokenStoreLike,\n SessionViewTokenStoreLike,\n} from \"../commands/types.js\";\nimport type { MikanModels } from \"../harness/index.js\";\nimport type { PlatformToolPackFactory } from \"../tools/types.js\";\nimport type { VaultManager } from \"../vault/index.js\";\n\nexport interface SessionLifecycleOptions {\n maxSessions?: number;\n idleTimeoutMs?: number;\n now?: () => number;\n}\n\nexport interface ConversationRuntimeState {\n running: boolean;\n runner: PiAgentWrapper;\n stopRequested: boolean;\n stopMessageTs?: string;\n lastAccessedAt: number;\n sessionFile: string;\n /** Epoch ms when the current run started; 0 when idle. */\n startedAt: number;\n lastActivityAt?: number;\n}\n\nexport interface RunSessionOptions {\n event: ConversationEvent;\n bot: MessagingBot;\n context: ConversationContext;\n}\n\n/** Conversation/session identity used to resolve per-session runner state. */\nexport interface SessionStateOptions {\n conversationId: string;\n sessionKey: string;\n conversationKind?: ConversationKind;\n}\n\nexport interface ConversationRuntimeOptions extends Omit<\n CommandServices,\n \"runtime\" | \"vaultManager\" | \"linkTokenStore\" | \"sessionViewTokenStore\" | \"adminTokenStore\"\n> {\n /**\n * Credential vault for sandboxed conversations. Optional for embedders;\n * when omitted the runtime uses an inert, disabled vault.\n */\n vaultManager?: VaultManager;\n /** Login-portal token store; omit when no web portal is hosted. */\n linkTokenStore?: LinkTokenStoreLike;\n /** Session-viewer token store; omit when no web portal is hosted. */\n sessionViewTokenStore?: SessionViewTokenStoreLike;\n /** Admin-portal token store; omit when no web portal is hosted. */\n adminTokenStore?: AdminTokenStoreLike;\n /** Override the default command handlers (e.g., to add /help, /status). */\n commandHandlers?: readonly CommandHandler[];\n /** Model registry override; defaults to the process-wide models.json load. */\n models?: MikanModels;\n /** Proactive platform messaging for extensions (`api.notify`). */\n platformNotifier?: PlatformNotifier;\n /** Proactive emoji reactions for extensions (`api.react`). */\n platformReactor?: PlatformReactor;\n /** Proactive file uploads for extensions (`api.uploadFile`). */\n platformUploader?: PlatformUploader;\n /**\n * Optional platform capability packs (extra tools + per-run bind), as\n * factories — each runner instantiates its own pack because bind state is\n * per-runner. Assembled at process start (e.g. GitHub PR/CI pack); core\n * stays platform-neutral.\n */\n platformToolPackFactories?: readonly PlatformToolPackFactory[];\n}\n\nexport interface ConversationRuntime extends MessagingEventHandler {\n runSession(options: RunSessionOptions): Promise<void>;\n switchConversationModel(conversationId: string, provider: string, model: string): boolean;\n refreshConversationEnvironment(conversationId: string): boolean;\n /** Clear every idle conversation's cached runners; report the busy ones. */\n refreshAllConversations(): { busy: string[] };\n shutdown(timeoutMs?: number): Promise<void>;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/runtime/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { PiAgentWrapper } from \"../agent.js\";\nimport type {\n MessagingBot,\n ConversationContext,\n ConversationEvent,\n MessagingEventHandler,\n ConversationKind,\n PlatformNotifier,\n PlatformReactor,\n PlatformUploader,\n} from \"../adapter.js\";\nimport type {\n AdminTokenStoreLike,\n CommandHandler,\n CommandServices,\n LinkTokenStoreLike,\n SessionViewTokenStoreLike,\n} from \"../commands/types.js\";\nimport type { MikanModels } from \"../harness/index.js\";\nimport type { PlatformToolPackFactory } from \"../tools/types.js\";\nimport type { VaultManager } from \"../vault/index.js\";\n\nexport interface SessionLifecycleOptions {\n maxSessions?: number;\n idleTimeoutMs?: number;\n now?: () => number;\n}\n\nexport interface ConversationRuntimeState {\n running: boolean;\n /** Exact settlement of the current run, including post-run response handling. */\n runSettlement?: Promise<void>;\n runner: PiAgentWrapper;\n stopRequested: boolean;\n stopMessageTs?: string;\n lastAccessedAt: number;\n sessionFile: string;\n /** Epoch ms when the current run started; 0 when idle. */\n startedAt: number;\n lastActivityAt?: number;\n}\n\nexport interface RunSessionOptions {\n event: ConversationEvent;\n bot: MessagingBot;\n context: ConversationContext;\n}\n\n/** Conversation/session identity used to resolve per-session runner state. */\nexport interface SessionStateOptions {\n conversationId: string;\n sessionKey: string;\n conversationKind?: ConversationKind;\n}\n\nexport interface ConversationRuntimeOptions extends Omit<\n CommandServices,\n \"runtime\" | \"vaultManager\" | \"linkTokenStore\" | \"sessionViewTokenStore\" | \"adminTokenStore\"\n> {\n /**\n * Credential vault for sandboxed conversations. Optional for embedders;\n * when omitted the runtime uses an inert, disabled vault.\n */\n vaultManager?: VaultManager;\n /** Login-portal token store; omit when no web portal is hosted. */\n linkTokenStore?: LinkTokenStoreLike;\n /** Session-viewer token store; omit when no web portal is hosted. */\n sessionViewTokenStore?: SessionViewTokenStoreLike;\n /** Admin-portal token store; omit when no web portal is hosted. */\n adminTokenStore?: AdminTokenStoreLike;\n /** Override the default command handlers (e.g., to add /help, /status). */\n commandHandlers?: readonly CommandHandler[];\n /** Model registry override; defaults to the process-wide models.json load. */\n models?: MikanModels;\n /** Proactive platform messaging for extensions (`api.notify`). */\n platformNotifier?: PlatformNotifier;\n /** Proactive emoji reactions for extensions (`api.react`). */\n platformReactor?: PlatformReactor;\n /** Proactive file uploads for extensions (`api.uploadFile`). */\n platformUploader?: PlatformUploader;\n /**\n * Optional platform capability packs (extra tools + per-run bind), as\n * factories — each runner instantiates its own pack because bind state is\n * per-runner. Assembled at process start (e.g. GitHub PR/CI pack); core\n * stays platform-neutral.\n */\n platformToolPackFactories?: readonly PlatformToolPackFactory[];\n}\n\nexport interface ConversationRuntime extends MessagingEventHandler {\n runSession(options: RunSessionOptions): Promise<void>;\n switchConversationModel(conversationId: string, provider: string, model: string): boolean;\n refreshConversationEnvironment(conversationId: string): boolean;\n /** Clear every idle conversation's cached runners; report the busy ones. */\n refreshAllConversations(): { busy: string[] };\n shutdown(timeoutMs?: number): Promise<void>;\n}\n"]}
|
|
@@ -1,26 +1,12 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ResourceLimits } from "../types.js";
|
|
2
2
|
export interface GondolinBootstrapOptions {
|
|
3
|
-
/** Host-only state dir; inventory
|
|
3
|
+
/** Host-only state dir; runtime inventory lives under it. */
|
|
4
4
|
stateDir: string;
|
|
5
5
|
/** Default per-runtime resource limits. */
|
|
6
6
|
limits?: ResourceLimits;
|
|
7
7
|
/** Boosted limits applied while a runtime holds a boost. */
|
|
8
8
|
boostLimits?: ResourceLimits;
|
|
9
|
-
/** Remote fleet settings (workers, gateway); omit for local-only gondolin. */
|
|
10
|
-
remote?: GondolinRemoteSettings;
|
|
11
|
-
/**
|
|
12
|
-
* Fail loudly when the remote profile is requested but no worker source is
|
|
13
|
-
* configured, instead of discovering it on the first runtime ensure.
|
|
14
|
-
*/
|
|
15
|
-
requireRemote?: boolean;
|
|
16
9
|
}
|
|
17
|
-
/**
|
|
18
|
-
* Configure every gondolin runtime singleton for one process — resources,
|
|
19
|
-
* inventory, placements, fleet, join, gateway — from one options object.
|
|
20
|
-
* This is the managed-sandbox bootstrap seam: main.ts and embedders
|
|
21
|
-
* (src/index.ts) call it before creating conversation runtimes with a
|
|
22
|
-
* gondolin sandbox config; nothing else may call the individual configure()
|
|
23
|
-
* methods outside tests.
|
|
24
|
-
*/
|
|
10
|
+
/** Configure local Gondolin resources and detached-runtime inventory. */
|
|
25
11
|
export declare function configureGondolinRuntime(options: GondolinBootstrapOptions): void;
|
|
26
12
|
//# sourceMappingURL=gondolin-bootstrap.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gondolin-bootstrap.d.ts","sourceRoot":"","sources":["../../src/sandbox/gondolin-bootstrap.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"gondolin-bootstrap.d.ts","sourceRoot":"","sources":["../../src/sandbox/gondolin-bootstrap.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAIlD,MAAM,WAAW,wBAAwB;IACvC,6DAA6D;IAC7D,QAAQ,EAAE,MAAM,CAAC;IACjB,2CAA2C;IAC3C,MAAM,CAAC,EAAE,cAAc,CAAC;IACxB,4DAA4D;IAC5D,WAAW,CAAC,EAAE,cAAc,CAAC;CAC9B;AAED,yEAAyE;AACzE,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,wBAAwB,GAAG,IAAI,CAGhF"}
|
|
@@ -1,27 +1,9 @@
|
|
|
1
1
|
import { join } from "node:path";
|
|
2
|
-
import {
|
|
3
|
-
import { gondolinFleet } from "./gondolin-fleet.js";
|
|
4
|
-
import { gondolinGateway } from "./gondolin-gateway.js";
|
|
2
|
+
import { gondolinResources } from "./gondolin.js";
|
|
5
3
|
import { gondolinInventory } from "./gondolin-inventory.js";
|
|
6
|
-
|
|
7
|
-
import { gondolinPlacements } from "./gondolin-placement.js";
|
|
8
|
-
/**
|
|
9
|
-
* Configure every gondolin runtime singleton for one process — resources,
|
|
10
|
-
* inventory, placements, fleet, join, gateway — from one options object.
|
|
11
|
-
* This is the managed-sandbox bootstrap seam: main.ts and embedders
|
|
12
|
-
* (src/index.ts) call it before creating conversation runtimes with a
|
|
13
|
-
* gondolin sandbox config; nothing else may call the individual configure()
|
|
14
|
-
* methods outside tests.
|
|
15
|
-
*/
|
|
4
|
+
/** Configure local Gondolin resources and detached-runtime inventory. */
|
|
16
5
|
export function configureGondolinRuntime(options) {
|
|
17
6
|
gondolinResources.configure(options.limits, options.boostLimits);
|
|
18
7
|
gondolinInventory.configure(join(options.stateDir, "gondolin-runtimes"));
|
|
19
|
-
gondolinPlacements.configure(join(options.stateDir, "gondolin-placement.json"));
|
|
20
|
-
gondolinFleet.configure(options.remote);
|
|
21
|
-
gondolinJoin.configure(join(options.stateDir, "gondolin-gateway"));
|
|
22
|
-
gondolinGateway.configure(options.remote?.gateway);
|
|
23
|
-
if (options.requireRemote) {
|
|
24
|
-
assertRemoteConfigured();
|
|
25
|
-
}
|
|
26
8
|
}
|
|
27
9
|
//# sourceMappingURL=gondolin-bootstrap.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gondolin-bootstrap.js","sourceRoot":"","sources":["../../src/sandbox/gondolin-bootstrap.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"gondolin-bootstrap.js","sourceRoot":"","sources":["../../src/sandbox/gondolin-bootstrap.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAW5D,yEAAyE;AACzE,MAAM,UAAU,wBAAwB,CAAC,OAAiC;IACxE,iBAAiB,CAAC,SAAS,CAAC,OAAO,CAAC,MAAM,EAAE,OAAO,CAAC,WAAW,CAAC,CAAC;IACjE,iBAAiB,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,mBAAmB,CAAC,CAAC,CAAC;AAC3E,CAAC","sourcesContent":["import { join } from \"node:path\";\nimport type { ResourceLimits } from \"../types.js\";\nimport { gondolinResources } from \"./gondolin.js\";\nimport { gondolinInventory } from \"./gondolin-inventory.js\";\n\nexport interface GondolinBootstrapOptions {\n /** Host-only state dir; runtime inventory lives under it. */\n stateDir: string;\n /** Default per-runtime resource limits. */\n limits?: ResourceLimits;\n /** Boosted limits applied while a runtime holds a boost. */\n boostLimits?: ResourceLimits;\n}\n\n/** Configure local Gondolin resources and detached-runtime inventory. */\nexport function configureGondolinRuntime(options: GondolinBootstrapOptions): void {\n gondolinResources.configure(options.limits, options.boostLimits);\n gondolinInventory.configure(join(options.stateDir, \"gondolin-runtimes\"));\n}\n"]}
|
|
@@ -1,16 +1,14 @@
|
|
|
1
1
|
import { type Static } from "@sinclair/typebox";
|
|
2
2
|
/**
|
|
3
3
|
* Everything a worker process needs to host one Gondolin VM. Serialized as a
|
|
4
|
-
* single JSON argv entry by
|
|
5
|
-
* the Go daemon's supervisor).
|
|
4
|
+
* single JSON argv entry by the local TS worker client.
|
|
6
5
|
*/
|
|
7
6
|
export declare const GondolinWorkerConfigSchema: import("@sinclair/typebox").TObject<{
|
|
8
7
|
/** mikan session key the runtime belongs to. */
|
|
9
8
|
instanceId: import("@sinclair/typebox").TString;
|
|
10
9
|
/** Resolved guest image asset directory. */
|
|
11
10
|
image: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
12
|
-
/**
|
|
13
|
-
* spawning host has no image store). Ignored when `image` is set. */
|
|
11
|
+
/** Optional image selector resolved inside the worker when no image path is supplied. */
|
|
14
12
|
imageSelector: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
15
13
|
mounts: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
|
|
16
14
|
source: import("@sinclair/typebox").TString;
|
|
@@ -38,7 +36,7 @@ export declare const GondolinWorkerHandshakeSchema: import("@sinclair/typebox").
|
|
|
38
36
|
export type GondolinWorkerHandshake = Static<typeof GondolinWorkerHandshakeSchema>;
|
|
39
37
|
/**
|
|
40
38
|
* One `<sessionId>.json` inventory record, written by the worker process and
|
|
41
|
-
* read back by the TS inventory
|
|
39
|
+
* read back by the TS inventory.
|
|
42
40
|
*/
|
|
43
41
|
export declare const GondolinRuntimeRecordSchema: import("@sinclair/typebox").TObject<{
|
|
44
42
|
/** Gondolin session id (`vm.id`); also names the record file. */
|
|
@@ -57,69 +55,4 @@ export declare const GondolinRuntimeRecordSchema: import("@sinclair/typebox").TO
|
|
|
57
55
|
}>;
|
|
58
56
|
export type GondolinRuntimeRecord = Static<typeof GondolinRuntimeRecordSchema>;
|
|
59
57
|
export declare function isGondolinRuntimeRecord(value: unknown): value is GondolinRuntimeRecord;
|
|
60
|
-
/** A vault credential shipped by content on the ensure request (never a shared-fs mount). */
|
|
61
|
-
declare const GondolinCredentialFileSchema: import("@sinclair/typebox").TObject<{
|
|
62
|
-
target: import("@sinclair/typebox").TString;
|
|
63
|
-
contentBase64: import("@sinclair/typebox").TString;
|
|
64
|
-
}>;
|
|
65
|
-
export type GondolinCredentialFile = Static<typeof GondolinCredentialFileSchema>;
|
|
66
|
-
/** POST /v1/runtimes body sent to the remote worker daemon. */
|
|
67
|
-
export declare const GondolinEnsureRuntimeRequestSchema: import("@sinclair/typebox").TObject<{
|
|
68
|
-
instanceId: import("@sinclair/typebox").TString;
|
|
69
|
-
imageSelector: import("@sinclair/typebox").TString;
|
|
70
|
-
mounts: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
|
|
71
|
-
source: import("@sinclair/typebox").TString;
|
|
72
|
-
target: import("@sinclair/typebox").TString;
|
|
73
|
-
}>>;
|
|
74
|
-
credentialFiles: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
|
|
75
|
-
target: import("@sinclair/typebox").TString;
|
|
76
|
-
contentBase64: import("@sinclair/typebox").TString;
|
|
77
|
-
}>>;
|
|
78
|
-
/** Fractional cgroup CPU limit as a string; "" when unset. */
|
|
79
|
-
cpus: import("@sinclair/typebox").TString;
|
|
80
|
-
memory: import("@sinclair/typebox").TString;
|
|
81
|
-
fingerprint: import("@sinclair/typebox").TString;
|
|
82
|
-
/** Accepted by the daemon; the TS client currently leaves it unset (0). */
|
|
83
|
-
heartbeatStaleMs: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
|
|
84
|
-
}>;
|
|
85
|
-
export type GondolinEnsureRuntimeRequest = Static<typeof GondolinEnsureRuntimeRequestSchema>;
|
|
86
|
-
/**
|
|
87
|
-
* One runtime as reported by the daemon (ensure response, GET, and the
|
|
88
|
-
* elements of the list response). The daemon's socketPath never crosses the
|
|
89
|
-
* wire — sessions reach the runtime through the tunnel, not the socket.
|
|
90
|
-
*/
|
|
91
|
-
export declare const GondolinRemoteRuntimeSchema: import("@sinclair/typebox").TObject<{
|
|
92
|
-
sessionId: import("@sinclair/typebox").TString;
|
|
93
|
-
instanceId: import("@sinclair/typebox").TString;
|
|
94
|
-
fingerprint: import("@sinclair/typebox").TString;
|
|
95
|
-
workerPid: import("@sinclair/typebox").TNumber;
|
|
96
|
-
runnerPid: import("@sinclair/typebox").TNumber;
|
|
97
|
-
epoch: import("@sinclair/typebox").TNumber;
|
|
98
|
-
adopted: import("@sinclair/typebox").TBoolean;
|
|
99
|
-
}>;
|
|
100
|
-
export type GondolinRemoteRuntime = Static<typeof GondolinRemoteRuntimeSchema>;
|
|
101
|
-
/** POST /v1/leases response: a fenced, epoch-monotonic per-instance lease. */
|
|
102
|
-
export declare const GondolinLeaseGrantSchema: import("@sinclair/typebox").TObject<{
|
|
103
|
-
id: import("@sinclair/typebox").TString;
|
|
104
|
-
instanceId: import("@sinclair/typebox").TString;
|
|
105
|
-
epoch: import("@sinclair/typebox").TNumber;
|
|
106
|
-
/** RFC 3339 timestamp (Go time.Time marshalling). */
|
|
107
|
-
expiresAt: import("@sinclair/typebox").TString;
|
|
108
|
-
}>;
|
|
109
|
-
/** Structural shape of the JSON messages on the session protocol. */
|
|
110
|
-
export interface SessionFrameCallbacks {
|
|
111
|
-
onJson: (message: {
|
|
112
|
-
type: string;
|
|
113
|
-
id?: number;
|
|
114
|
-
exit_code?: number | null;
|
|
115
|
-
code?: string;
|
|
116
|
-
message?: string;
|
|
117
|
-
}) => void;
|
|
118
|
-
onBinary: (frame: Buffer) => void;
|
|
119
|
-
}
|
|
120
|
-
/** Parses the daemon-to-client session framing: u8 type + u32be length + payload. */
|
|
121
|
-
export declare function createSessionFrameParser(callbacks: SessionFrameCallbacks): (chunk: Buffer) => void;
|
|
122
|
-
/** Encodes a client-to-daemon session message: u32be length + JSON. */
|
|
123
|
-
export declare function encodeSessionMessage(message: object): Buffer;
|
|
124
|
-
export {};
|
|
125
58
|
//# sourceMappingURL=gondolin-contract.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gondolin-contract.d.ts","sourceRoot":"","sources":["../../src/sandbox/gondolin-contract.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,KAAK,MAAM,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"gondolin-contract.d.ts","sourceRoot":"","sources":["../../src/sandbox/gondolin-contract.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,KAAK,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAatD;;;GAGG;AACH,eAAO,MAAM,0BAA0B;IACrC,gDAAgD;;IAEhD,4CAA4C;;IAE5C,yFAAyF;;;;;;;;IAKzF,gEAAgE;;IAEhE,oEAAoE;;IAEpE,8EAA8E;;EAE9E,CAAC;AAEH,MAAM,MAAM,oBAAoB,GAAG,MAAM,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAE7E,gEAAgE;AAChE,eAAO,MAAM,6BAA6B;;;;;;;EAOxC,CAAC;AAEH,MAAM,MAAM,uBAAuB,GAAG,MAAM,CAAC,OAAO,6BAA6B,CAAC,CAAC;AAEnF;;;GAGG;AACH,eAAO,MAAM,2BAA2B;IACtC,iEAAiE;;IAEjE,iEAAiE;;IAEjE,0DAA0D;;IAE1D,wEAAwE;;;IAGxE,4EAA4E;;IAE5E,2DAA2D;;EAE3D,CAAC;AAEH,MAAM,MAAM,qBAAqB,GAAG,MAAM,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAE/E,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,qBAAqB,CAYtF"}
|
|
@@ -1,18 +1,8 @@
|
|
|
1
1
|
import { Type } from "@sinclair/typebox";
|
|
2
2
|
import { isRecord } from "../utils/file-guards.js";
|
|
3
3
|
/**
|
|
4
|
-
* Single home for
|
|
5
|
-
*
|
|
6
|
-
* (worker/internal/runtime/supervisor.go, worker/internal/api/server.go,
|
|
7
|
-
* worker/internal/lease/lease.go); the shared fixtures under
|
|
8
|
-
* `worker/contract-fixtures/` pin both sides — the TS test
|
|
9
|
-
* (test/gondolin-contract.test.ts) checks each fixture against the schemas
|
|
10
|
-
* here, and the Go contract tests round-trip the same files through the Go
|
|
11
|
-
* structs. Add a field on one side only and one of those tests fails.
|
|
12
|
-
*
|
|
13
|
-
* Secrets never travel through these shapes: vault env rides per-exec over
|
|
14
|
-
* the session IPC socket, and credential files are shipped by content only
|
|
15
|
-
* on the authenticated ensure request.
|
|
4
|
+
* Single home for the wire shapes shared by mikan's local Gondolin client and
|
|
5
|
+
* detached worker process.
|
|
16
6
|
*/
|
|
17
7
|
const GondolinMountSchema = Type.Object({
|
|
18
8
|
source: Type.String(),
|
|
@@ -20,16 +10,14 @@ const GondolinMountSchema = Type.Object({
|
|
|
20
10
|
});
|
|
21
11
|
/**
|
|
22
12
|
* Everything a worker process needs to host one Gondolin VM. Serialized as a
|
|
23
|
-
* single JSON argv entry by
|
|
24
|
-
* the Go daemon's supervisor).
|
|
13
|
+
* single JSON argv entry by the local TS worker client.
|
|
25
14
|
*/
|
|
26
15
|
export const GondolinWorkerConfigSchema = Type.Object({
|
|
27
16
|
/** mikan session key the runtime belongs to. */
|
|
28
17
|
instanceId: Type.String(),
|
|
29
18
|
/** Resolved guest image asset directory. */
|
|
30
19
|
image: Type.Optional(Type.String()),
|
|
31
|
-
/**
|
|
32
|
-
* spawning host has no image store). Ignored when `image` is set. */
|
|
20
|
+
/** Optional image selector resolved inside the worker when no image path is supplied. */
|
|
33
21
|
imageSelector: Type.Optional(Type.String()),
|
|
34
22
|
mounts: Type.Array(GondolinMountSchema),
|
|
35
23
|
cpus: Type.Optional(Type.Number()),
|
|
@@ -52,7 +40,7 @@ export const GondolinWorkerHandshakeSchema = Type.Object({
|
|
|
52
40
|
});
|
|
53
41
|
/**
|
|
54
42
|
* One `<sessionId>.json` inventory record, written by the worker process and
|
|
55
|
-
* read back by the TS inventory
|
|
43
|
+
* read back by the TS inventory.
|
|
56
44
|
*/
|
|
57
45
|
export const GondolinRuntimeRecordSchema = Type.Object({
|
|
58
46
|
/** Gondolin session id (`vm.id`); also names the record file. */
|
|
@@ -80,76 +68,4 @@ export function isGondolinRuntimeRecord(value) {
|
|
|
80
68
|
(value.socketPath === undefined || typeof value.socketPath === "string") &&
|
|
81
69
|
(value.fingerprint === undefined || typeof value.fingerprint === "string"));
|
|
82
70
|
}
|
|
83
|
-
/** A vault credential shipped by content on the ensure request (never a shared-fs mount). */
|
|
84
|
-
const GondolinCredentialFileSchema = Type.Object({
|
|
85
|
-
target: Type.String(),
|
|
86
|
-
contentBase64: Type.String(),
|
|
87
|
-
});
|
|
88
|
-
/** POST /v1/runtimes body sent to the remote worker daemon. */
|
|
89
|
-
export const GondolinEnsureRuntimeRequestSchema = Type.Object({
|
|
90
|
-
instanceId: Type.String(),
|
|
91
|
-
imageSelector: Type.String(),
|
|
92
|
-
mounts: Type.Array(GondolinMountSchema),
|
|
93
|
-
credentialFiles: Type.Array(GondolinCredentialFileSchema),
|
|
94
|
-
/** Fractional cgroup CPU limit as a string; "" when unset. */
|
|
95
|
-
cpus: Type.String(),
|
|
96
|
-
memory: Type.String(),
|
|
97
|
-
fingerprint: Type.String(),
|
|
98
|
-
/** Accepted by the daemon; the TS client currently leaves it unset (0). */
|
|
99
|
-
heartbeatStaleMs: Type.Optional(Type.Number()),
|
|
100
|
-
});
|
|
101
|
-
/**
|
|
102
|
-
* One runtime as reported by the daemon (ensure response, GET, and the
|
|
103
|
-
* elements of the list response). The daemon's socketPath never crosses the
|
|
104
|
-
* wire — sessions reach the runtime through the tunnel, not the socket.
|
|
105
|
-
*/
|
|
106
|
-
export const GondolinRemoteRuntimeSchema = Type.Object({
|
|
107
|
-
sessionId: Type.String(),
|
|
108
|
-
instanceId: Type.String(),
|
|
109
|
-
fingerprint: Type.String(),
|
|
110
|
-
workerPid: Type.Number(),
|
|
111
|
-
runnerPid: Type.Number(),
|
|
112
|
-
epoch: Type.Number(),
|
|
113
|
-
adopted: Type.Boolean(),
|
|
114
|
-
});
|
|
115
|
-
/** POST /v1/leases response: a fenced, epoch-monotonic per-instance lease. */
|
|
116
|
-
export const GondolinLeaseGrantSchema = Type.Object({
|
|
117
|
-
id: Type.String(),
|
|
118
|
-
instanceId: Type.String(),
|
|
119
|
-
epoch: Type.Number(),
|
|
120
|
-
/** RFC 3339 timestamp (Go time.Time marshalling). */
|
|
121
|
-
expiresAt: Type.String(),
|
|
122
|
-
});
|
|
123
|
-
/** Parses the daemon-to-client session framing: u8 type + u32be length + payload. */
|
|
124
|
-
export function createSessionFrameParser(callbacks) {
|
|
125
|
-
let buffer = Buffer.alloc(0);
|
|
126
|
-
return (chunk) => {
|
|
127
|
-
buffer = Buffer.concat([buffer, chunk]);
|
|
128
|
-
while (buffer.length >= 5) {
|
|
129
|
-
const type = buffer.readUInt8(0);
|
|
130
|
-
const length = buffer.readUInt32BE(1);
|
|
131
|
-
if (buffer.length < 5 + length)
|
|
132
|
-
return;
|
|
133
|
-
const payload = buffer.subarray(5, 5 + length);
|
|
134
|
-
buffer = buffer.subarray(5 + length);
|
|
135
|
-
if (type === 1) {
|
|
136
|
-
callbacks.onBinary(Buffer.from(payload));
|
|
137
|
-
continue;
|
|
138
|
-
}
|
|
139
|
-
try {
|
|
140
|
-
callbacks.onJson(JSON.parse(payload.toString("utf8")));
|
|
141
|
-
}
|
|
142
|
-
catch {
|
|
143
|
-
// ignore malformed frames
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
};
|
|
147
|
-
}
|
|
148
|
-
/** Encodes a client-to-daemon session message: u32be length + JSON. */
|
|
149
|
-
export function encodeSessionMessage(message) {
|
|
150
|
-
const payload = Buffer.from(JSON.stringify(message));
|
|
151
|
-
const header = Buffer.alloc(4);
|
|
152
|
-
header.writeUInt32BE(payload.length, 0);
|
|
153
|
-
return Buffer.concat([header, payload]);
|
|
154
|
-
}
|
|
155
71
|
//# sourceMappingURL=gondolin-contract.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gondolin-contract.js","sourceRoot":"","sources":["../../src/sandbox/gondolin-contract.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAe,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAEnD;;;;;;;;;;;;;GAaG;AAEH,MAAM,mBAAmB,GAAG,IAAI,CAAC,MAAM,CAAC;IACtC,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE;IACrB,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE;CACtB,CAAC,CAAC;AAEH;;;;GAIG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,IAAI,CAAC,MAAM,CAAC;IACpD,gDAAgD;IAChD,UAAU,EAAE,IAAI,CAAC,MAAM,EAAE;IACzB,4CAA4C;IAC5C,KAAK,EAAE,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;IACnC;yEACqE;IACrE,aAAa,EAAE,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;IAC3C,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,mBAAmB,CAAC;IACvC,IAAI,EAAE,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;IAClC,MAAM,EAAE,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;IACpC,gEAAgE;IAChE,WAAW,EAAE,IAAI,CAAC,MAAM,EAAE;IAC1B,oEAAoE;IACpE,YAAY,EAAE,IAAI,C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ACtC,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC,GAAG,MAAM;gBAAE,OAAO;YACvC,MAAM,OAAO,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC,CAAC;YAC/C,MAAM,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC;YACrC,IAAI,IAAI,KAAK,CAAC,EAAE,CAAC;gBACf,SAAS,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;gBACzC,SAAS;YACX,CAAC;YACD,IAAI,CAAC;gBACH,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;YACzD,CAAC;YAAC,MAAM,CAAC;gBACP,0BAA0B;YAC5B,CAAC;QACH,CAAC;IACH,CAAC,CAAC;AACJ,CAAC;AAED,uEAAuE;AACvE,MAAM,UAAU,oBAAoB,CAAC,OAAe;IAClD,MAAM,OAAO,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC;IACrD,MAAM,MAAM,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IAC/B,MAAM,CAAC,aAAa,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;IACxC,OAAO,MAAM,CAAC,MAAM,CAAC,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;AAC1C,CAAC","sourcesContent":["import { Type, type Static } from \"@sinclair/typebox\";\nimport { isRecord } from \"../utils/file-guards.js\";\n\n/**\n * Single home for every wire shape that crosses the mikan ⇄ gondolin-worker\n * boundary. The Go daemon mirrors these shapes by hand\n * (worker/internal/runtime/supervisor.go, worker/internal/api/server.go,\n * worker/internal/lease/lease.go); the shared fixtures under\n * `worker/contract-fixtures/` pin both sides — the TS test\n * (test/gondolin-contract.test.ts) checks each fixture against the schemas\n * here, and the Go contract tests round-trip the same files through the Go\n * structs. Add a field on one side only and one of those tests fails.\n *\n * Secrets never travel through these shapes: vault env rides per-exec over\n * the session IPC socket, and credential files are shipped by content only\n * on the authenticated ensure request.\n */\n\nconst GondolinMountSchema = Type.Object({\n source: Type.String(),\n target: Type.String(),\n});\n\n/**\n * Everything a worker process needs to host one Gondolin VM. Serialized as a\n * single JSON argv entry by both spawners (the local TS worker client and\n * the Go daemon's supervisor).\n */\nexport const GondolinWorkerConfigSchema = Type.Object({\n /** mikan session key the runtime belongs to. */\n instanceId: Type.String(),\n /** Resolved guest image asset directory. */\n image: Type.Optional(Type.String()),\n /** Image selector resolved inside the worker (remote workers, where the\n * spawning host has no image store). Ignored when `image` is set. */\n imageSelector: Type.Optional(Type.String()),\n mounts: Type.Array(GondolinMountSchema),\n cpus: Type.Optional(Type.Number()),\n memory: Type.Optional(Type.String()),\n /** Desired-runtime fingerprint recorded for adoption checks. */\n fingerprint: Type.String(),\n /** Runtime inventory directory (shared with the spawning mikan). */\n inventoryDir: Type.String(),\n /** Self-stop when the mikan heartbeat file is older than this. 0 disables. */\n heartbeatStaleMs: Type.Number(),\n});\n\nexport type GondolinWorkerConfig = Static<typeof GondolinWorkerConfigSchema>;\n\n/** First stdout line of a worker, consumed by both spawners. */\nexport const GondolinWorkerHandshakeSchema = Type.Object({\n ready: Type.Boolean(),\n error: Type.Optional(Type.String()),\n sessionId: Type.Optional(Type.String()),\n socketPath: Type.Optional(Type.String()),\n workerPid: Type.Optional(Type.Number()),\n runnerPid: Type.Optional(Type.Union([Type.Number(), Type.Null()])),\n});\n\nexport type GondolinWorkerHandshake = Static<typeof GondolinWorkerHandshakeSchema>;\n\n/**\n * One `<sessionId>.json` inventory record, written by the worker process and\n * read back by the TS inventory and the Go daemon's rediscovery.\n */\nexport const GondolinRuntimeRecordSchema = Type.Object({\n /** Gondolin session id (`vm.id`); also names the record file. */\n sessionId: Type.String(),\n /** mikan session key (vault key) the runtime was created for. */\n instanceId: Type.String(),\n /** Process that owns the runtime (the worker process). */\n ownerPid: Type.Number(),\n /** Host pid of the active VM runner process (QEMU/krun), if started. */\n runnerPid: Type.Union([Type.Number(), Type.Null()]),\n createdAt: Type.String(),\n /** Session IPC socket for adopting the runtime from a new mikan process. */\n socketPath: Type.Optional(Type.String()),\n /** Desired-runtime fingerprint the VM was created from. */\n fingerprint: Type.Optional(Type.String()),\n});\n\nexport type GondolinRuntimeRecord = Static<typeof GondolinRuntimeRecordSchema>;\n\nexport function isGondolinRuntimeRecord(value: unknown): value is GondolinRuntimeRecord {\n return (\n isRecord(value) &&\n typeof value.sessionId === \"string\" &&\n value.sessionId.length > 0 &&\n typeof value.instanceId === \"string\" &&\n typeof value.ownerPid === \"number\" &&\n (value.runnerPid === null || typeof value.runnerPid === \"number\") &&\n typeof value.createdAt === \"string\" &&\n (value.socketPath === undefined || typeof value.socketPath === \"string\") &&\n (value.fingerprint === undefined || typeof value.fingerprint === \"string\")\n );\n}\n\n/** A vault credential shipped by content on the ensure request (never a shared-fs mount). */\nconst GondolinCredentialFileSchema = Type.Object({\n target: Type.String(),\n contentBase64: Type.String(),\n});\n\nexport type GondolinCredentialFile = Static<typeof GondolinCredentialFileSchema>;\n\n/** POST /v1/runtimes body sent to the remote worker daemon. */\nexport const GondolinEnsureRuntimeRequestSchema = Type.Object({\n instanceId: Type.String(),\n imageSelector: Type.String(),\n mounts: Type.Array(GondolinMountSchema),\n credentialFiles: Type.Array(GondolinCredentialFileSchema),\n /** Fractional cgroup CPU limit as a string; \"\" when unset. */\n cpus: Type.String(),\n memory: Type.String(),\n fingerprint: Type.String(),\n /** Accepted by the daemon; the TS client currently leaves it unset (0). */\n heartbeatStaleMs: Type.Optional(Type.Number()),\n});\n\nexport type GondolinEnsureRuntimeRequest = Static<typeof GondolinEnsureRuntimeRequestSchema>;\n\n/**\n * One runtime as reported by the daemon (ensure response, GET, and the\n * elements of the list response). The daemon's socketPath never crosses the\n * wire — sessions reach the runtime through the tunnel, not the socket.\n */\nexport const GondolinRemoteRuntimeSchema = Type.Object({\n sessionId: Type.String(),\n instanceId: Type.String(),\n fingerprint: Type.String(),\n workerPid: Type.Number(),\n runnerPid: Type.Number(),\n epoch: Type.Number(),\n adopted: Type.Boolean(),\n});\n\nexport type GondolinRemoteRuntime = Static<typeof GondolinRemoteRuntimeSchema>;\n\n/** POST /v1/leases response: a fenced, epoch-monotonic per-instance lease. */\nexport const GondolinLeaseGrantSchema = Type.Object({\n id: Type.String(),\n instanceId: Type.String(),\n epoch: Type.Number(),\n /** RFC 3339 timestamp (Go time.Time marshalling). */\n expiresAt: Type.String(),\n});\n\n// ── session tunnel framing ────────────────────────────────────────────────────\n// The session protocol itself is TS⇄TS (worker session server ⇄ client); the\n// Go daemon splices it byte-for-byte through the upgraded tunnel. The framing\n// still lives here because it is part of the boundary a transport must carry.\n\n/** Structural shape of the JSON messages on the session protocol. */\nexport interface SessionFrameCallbacks {\n onJson: (message: {\n type: string;\n id?: number;\n exit_code?: number | null;\n code?: string;\n message?: string;\n }) => void;\n onBinary: (frame: Buffer) => void;\n}\n\n/** Parses the daemon-to-client session framing: u8 type + u32be length + payload. */\nexport function createSessionFrameParser(\n callbacks: SessionFrameCallbacks,\n): (chunk: Buffer) => void {\n let buffer = Buffer.alloc(0);\n return (chunk: Buffer) => {\n buffer = Buffer.concat([buffer, chunk]);\n while (buffer.length >= 5) {\n const type = buffer.readUInt8(0);\n const length = buffer.readUInt32BE(1);\n if (buffer.length < 5 + length) return;\n const payload = buffer.subarray(5, 5 + length);\n buffer = buffer.subarray(5 + length);\n if (type === 1) {\n callbacks.onBinary(Buffer.from(payload));\n continue;\n }\n try {\n callbacks.onJson(JSON.parse(payload.toString(\"utf8\")));\n } catch {\n // ignore malformed frames\n }\n }\n };\n}\n\n/** Encodes a client-to-daemon session message: u32be length + JSON. */\nexport function encodeSessionMessage(message: object): Buffer {\n const payload = Buffer.from(JSON.stringify(message));\n const header = Buffer.alloc(4);\n header.writeUInt32BE(payload.length, 0);\n return Buffer.concat([header, payload]);\n}\n"]}
|
|
1
|
+
{"version":3,"file":"gondolin-contract.js","sourceRoot":"","sources":["../../src/sandbox/gondolin-contract.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAe,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAEnD;;;GAGG;AAEH,MAAM,mBAAmB,GAAG,IAAI,CAAC,MAAM,CAAC;IACtC,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE;IACrB,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE;CACtB,CAAC,CAAC;AAEH;;;GAGG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,IAAI,CAAC,MAAM,CAAC;IACpD,gDAAgD;IAChD,UAAU,EAAE,IAAI,CAAC,MAAM,EAAE;IACzB,4CAA4C;IAC5C,KAAK,EAAE,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;IACnC,yFAAyF;IACzF,aAAa,EAAE,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;IAC3C,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,mBAAmB,CAAC;IACvC,IAAI,EAAE,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;IAClC,MAAM,EAAE,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;IACpC,gEAAgE;IAChE,WAAW,EAAE,IAAI,CAAC,MAAM,EAAE;IAC1B,oEAAoE;IACpE,YAAY,EAAE,IAAI,CAAC,MAAM,EAAE;IAC3B,8EAA8E;IAC9E,gBAAgB,EAAE,IAAI,CAAC,MAAM,EAAE;CAChC,CAAC,CAAC;AAIH,gEAAgE;AAChE,MAAM,CAAC,MAAM,6BAA6B,GAAG,IAAI,CAAC,MAAM,CAAC;IACvD,KAAK,EAAE,IAAI,CA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AS,CAAC,MAAM,GAAG,CAAC;QAC1B,OAAO,KAAK,CAAC,UAAU,KAAK,QAAQ;QACpC,OAAO,KAAK,CAAC,QAAQ,KAAK,QAAQ;QAClC,CAAC,KAAK,CAAC,SAAS,KAAK,IAAI,IAAI,OAAO,KAAK,CAAC,SAAS,KAAK,QAAQ,CAAC;QACjE,OAAO,KAAK,CAAC,SAAS,KAAK,QAAQ;QACnC,CAAC,KAAK,CAAC,UAAU,KAAK,SAAS,IAAI,OAAO,KAAK,CAAC,UAAU,KAAK,QAAQ,CAAC;QACxE,CAAC,KAAK,CAAC,WAAW,KAAK,SAAS,IAAI,OAAO,KAAK,CAAC,WAAW,KAAK,QAAQ,CAAC,CAC3E,CAAC;AACJ,CAAC","sourcesContent":["import { Type, type Static } from \"@sinclair/typebox\";\nimport { isRecord } from \"../utils/file-guards.js\";\n\n/**\n * Single home for the wire shapes shared by mikan's local Gondolin client and\n * detached worker process.\n */\n\nconst GondolinMountSchema = Type.Object({\n source: Type.String(),\n target: Type.String(),\n});\n\n/**\n * Everything a worker process needs to host one Gondolin VM. Serialized as a\n * single JSON argv entry by the local TS worker client.\n */\nexport const GondolinWorkerConfigSchema = Type.Object({\n /** mikan session key the runtime belongs to. */\n instanceId: Type.String(),\n /** Resolved guest image asset directory. */\n image: Type.Optional(Type.String()),\n /** Optional image selector resolved inside the worker when no image path is supplied. */\n imageSelector: Type.Optional(Type.String()),\n mounts: Type.Array(GondolinMountSchema),\n cpus: Type.Optional(Type.Number()),\n memory: Type.Optional(Type.String()),\n /** Desired-runtime fingerprint recorded for adoption checks. */\n fingerprint: Type.String(),\n /** Runtime inventory directory (shared with the spawning mikan). */\n inventoryDir: Type.String(),\n /** Self-stop when the mikan heartbeat file is older than this. 0 disables. */\n heartbeatStaleMs: Type.Number(),\n});\n\nexport type GondolinWorkerConfig = Static<typeof GondolinWorkerConfigSchema>;\n\n/** First stdout line of a worker, consumed by both spawners. */\nexport const GondolinWorkerHandshakeSchema = Type.Object({\n ready: Type.Boolean(),\n error: Type.Optional(Type.String()),\n sessionId: Type.Optional(Type.String()),\n socketPath: Type.Optional(Type.String()),\n workerPid: Type.Optional(Type.Number()),\n runnerPid: Type.Optional(Type.Union([Type.Number(), Type.Null()])),\n});\n\nexport type GondolinWorkerHandshake = Static<typeof GondolinWorkerHandshakeSchema>;\n\n/**\n * One `<sessionId>.json` inventory record, written by the worker process and\n * read back by the TS inventory.\n */\nexport const GondolinRuntimeRecordSchema = Type.Object({\n /** Gondolin session id (`vm.id`); also names the record file. */\n sessionId: Type.String(),\n /** mikan session key (vault key) the runtime was created for. */\n instanceId: Type.String(),\n /** Process that owns the runtime (the worker process). */\n ownerPid: Type.Number(),\n /** Host pid of the active VM runner process (QEMU/krun), if started. */\n runnerPid: Type.Union([Type.Number(), Type.Null()]),\n createdAt: Type.String(),\n /** Session IPC socket for adopting the runtime from a new mikan process. */\n socketPath: Type.Optional(Type.String()),\n /** Desired-runtime fingerprint the VM was created from. */\n fingerprint: Type.Optional(Type.String()),\n});\n\nexport type GondolinRuntimeRecord = Static<typeof GondolinRuntimeRecordSchema>;\n\nexport function isGondolinRuntimeRecord(value: unknown): value is GondolinRuntimeRecord {\n return (\n isRecord(value) &&\n typeof value.sessionId === \"string\" &&\n value.sessionId.length > 0 &&\n typeof value.instanceId === \"string\" &&\n typeof value.ownerPid === \"number\" &&\n (value.runnerPid === null || typeof value.runnerPid === \"number\") &&\n typeof value.createdAt === \"string\" &&\n (value.socketPath === undefined || typeof value.socketPath === \"string\") &&\n (value.fingerprint === undefined || typeof value.fingerprint === \"string\")\n );\n}\n"]}
|
|
@@ -1,21 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
* classifies failures with these errors, and every policy site decides
|
|
4
|
-
* through the named predicates — the story reads in one place:
|
|
2
|
+
* Crash-recovery vocabulary for a local detached Gondolin worker.
|
|
5
3
|
*
|
|
6
|
-
* - **Gone
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* - **Interrupted** (isRuntimeInterrupted): the runtime died (or went silent
|
|
11
|
-
* past the idle deadline) with the command in flight. Side effects may have
|
|
12
|
-
* landed, so the failure must surface; the session is discarded only when
|
|
13
|
-
* the runtime is confirmed dead.
|
|
14
|
-
* - **Lease-fenced** (isLeaseFencedStatus): the remote daemon rejected our
|
|
15
|
-
* lease — a newer epoch superseded it (409) or it expired (410). The cached
|
|
16
|
-
* lease is dropped and re-acquired once; the fleet's failover gate
|
|
17
|
-
* (assertFailoverAllowed) separately keeps a replacement placement fenced
|
|
18
|
-
* until the old lease's watermark passes.
|
|
4
|
+
* - **Gone**: the command never reached the runtime because its session socket
|
|
5
|
+
* refused the connection. Recreating the runtime and retrying is safe.
|
|
6
|
+
* - **Interrupted**: the runtime died or went silent with a command in flight.
|
|
7
|
+
* Side effects may have landed, so the failure must surface.
|
|
19
8
|
*/
|
|
20
9
|
/**
|
|
21
10
|
* The runtime is gone and the command never reached it (the session socket
|
|
@@ -28,6 +17,4 @@ export declare class GondolinRuntimeInterruptedError extends Error {
|
|
|
28
17
|
}
|
|
29
18
|
export declare function isRuntimeGone(error: unknown): error is GondolinRuntimeGoneError;
|
|
30
19
|
export declare function isRuntimeInterrupted(error: unknown): error is GondolinRuntimeInterruptedError;
|
|
31
|
-
/** 409 = a newer lease epoch superseded ours; 410 = our lease expired. */
|
|
32
|
-
export declare function isLeaseFencedStatus(status: number | undefined): boolean;
|
|
33
20
|
//# sourceMappingURL=gondolin-recovery.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gondolin-recovery.d.ts","sourceRoot":"","sources":["../../src/sandbox/gondolin-recovery.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"gondolin-recovery.d.ts","sourceRoot":"","sources":["../../src/sandbox/gondolin-recovery.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH;;;GAGG;AACH,qBAAa,wBAAyB,SAAQ,KAAK;CAAG;AAEtD,+EAA+E;AAC/E,qBAAa,+BAAgC,SAAQ,KAAK;CAAG;AAE7D,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,wBAAwB,CAE/E;AAED,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,+BAA+B,CAE7F"}
|
|
@@ -1,21 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
* classifies failures with these errors, and every policy site decides
|
|
4
|
-
* through the named predicates — the story reads in one place:
|
|
2
|
+
* Crash-recovery vocabulary for a local detached Gondolin worker.
|
|
5
3
|
*
|
|
6
|
-
* - **Gone
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* - **Interrupted** (isRuntimeInterrupted): the runtime died (or went silent
|
|
11
|
-
* past the idle deadline) with the command in flight. Side effects may have
|
|
12
|
-
* landed, so the failure must surface; the session is discarded only when
|
|
13
|
-
* the runtime is confirmed dead.
|
|
14
|
-
* - **Lease-fenced** (isLeaseFencedStatus): the remote daemon rejected our
|
|
15
|
-
* lease — a newer epoch superseded it (409) or it expired (410). The cached
|
|
16
|
-
* lease is dropped and re-acquired once; the fleet's failover gate
|
|
17
|
-
* (assertFailoverAllowed) separately keeps a replacement placement fenced
|
|
18
|
-
* until the old lease's watermark passes.
|
|
4
|
+
* - **Gone**: the command never reached the runtime because its session socket
|
|
5
|
+
* refused the connection. Recreating the runtime and retrying is safe.
|
|
6
|
+
* - **Interrupted**: the runtime died or went silent with a command in flight.
|
|
7
|
+
* Side effects may have landed, so the failure must surface.
|
|
19
8
|
*/
|
|
20
9
|
/**
|
|
21
10
|
* The runtime is gone and the command never reached it (the session socket
|
|
@@ -32,8 +21,4 @@ export function isRuntimeGone(error) {
|
|
|
32
21
|
export function isRuntimeInterrupted(error) {
|
|
33
22
|
return error instanceof GondolinRuntimeInterruptedError;
|
|
34
23
|
}
|
|
35
|
-
/** 409 = a newer lease epoch superseded ours; 410 = our lease expired. */
|
|
36
|
-
export function isLeaseFencedStatus(status) {
|
|
37
|
-
return status === 409 || status === 410;
|
|
38
|
-
}
|
|
39
24
|
//# sourceMappingURL=gondolin-recovery.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gondolin-recovery.js","sourceRoot":"","sources":["../../src/sandbox/gondolin-recovery.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"gondolin-recovery.js","sourceRoot":"","sources":["../../src/sandbox/gondolin-recovery.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH;;;GAGG;AACH,MAAM,OAAO,wBAAyB,SAAQ,KAAK;CAAG;AAEtD,+EAA+E;AAC/E,MAAM,OAAO,+BAAgC,SAAQ,KAAK;CAAG;AAE7D,MAAM,UAAU,aAAa,CAAC,KAAc;IAC1C,OAAO,KAAK,YAAY,wBAAwB,CAAC;AACnD,CAAC;AAED,MAAM,UAAU,oBAAoB,CAAC,KAAc;IACjD,OAAO,KAAK,YAAY,+BAA+B,CAAC;AAC1D,CAAC","sourcesContent":["/**\n * Crash-recovery vocabulary for a local detached Gondolin worker.\n *\n * - **Gone**: the command never reached the runtime because its session socket\n * refused the connection. Recreating the runtime and retrying is safe.\n * - **Interrupted**: the runtime died or went silent with a command in flight.\n * Side effects may have landed, so the failure must surface.\n */\n\n/**\n * The runtime is gone and the command never reached it (the session socket\n * refused the connection) — safe to recreate the runtime and retry.\n */\nexport class GondolinRuntimeGoneError extends Error {}\n\n/** The runtime died with the command in flight — not safe to retry blindly. */\nexport class GondolinRuntimeInterruptedError extends Error {}\n\nexport function isRuntimeGone(error: unknown): error is GondolinRuntimeGoneError {\n return error instanceof GondolinRuntimeGoneError;\n}\n\nexport function isRuntimeInterrupted(error: unknown): error is GondolinRuntimeInterruptedError {\n return error instanceof GondolinRuntimeInterruptedError;\n}\n"]}
|
|
@@ -1,50 +1,26 @@
|
|
|
1
1
|
import type { Readable } from "node:stream";
|
|
2
2
|
import type { GondolinWorkerConfig } from "./gondolin-worker.js";
|
|
3
3
|
import type { ExecResult } from "./types.js";
|
|
4
|
-
/**
|
|
5
|
-
* A live worker-hosted runtime as seen from mikan: identity plus fleet
|
|
6
|
-
* routing only. Transport-private connection details (the local worker's
|
|
7
|
-
* session socket, the remote worker's lease/tunnel) stay inside the owning
|
|
8
|
-
* transport — a handle never carries another transport's address fields.
|
|
9
|
-
*/
|
|
4
|
+
/** A live detached worker-hosted runtime as seen from mikan. */
|
|
10
5
|
export interface GondolinRuntimeHandle {
|
|
11
6
|
sessionId: string;
|
|
12
7
|
instanceId: string;
|
|
13
8
|
workerPid: number;
|
|
14
9
|
fingerprint: string;
|
|
15
|
-
/** Fleet identity of the worker hosting the runtime (remote transport). */
|
|
16
|
-
workerName?: string;
|
|
17
10
|
}
|
|
18
|
-
/**
|
|
19
|
-
|
|
20
|
-
* a local asset directory for the local transport and an image selector for
|
|
21
|
-
* the remote one (resolved on the worker host).
|
|
22
|
-
*/
|
|
23
|
-
export interface GondolinRuntimeSpec {
|
|
11
|
+
/** Desired configuration for a local Gondolin runtime. */
|
|
12
|
+
interface GondolinRuntimeSpec {
|
|
24
13
|
image: string;
|
|
25
14
|
mounts: Array<{
|
|
26
15
|
source: string;
|
|
27
16
|
target: string;
|
|
28
17
|
}>;
|
|
29
|
-
/** Raw fractional CPU limit (cgroup enforcement on remote Linux workers). */
|
|
30
18
|
cpus?: string;
|
|
31
|
-
/** Whole vCPUs given to the VM. */
|
|
32
19
|
vmCpus?: number;
|
|
33
20
|
memory?: string;
|
|
34
21
|
fingerprint: string;
|
|
35
|
-
/** mikan-host workspace root, for remote mount prefix translation. */
|
|
36
22
|
workspacePath?: string;
|
|
37
23
|
}
|
|
38
|
-
/** One way of running Gondolin runtimes: in local workers or on a remote fleet. */
|
|
39
|
-
export interface GondolinRuntimeTransport {
|
|
40
|
-
ensure(instanceId: string, spec: GondolinRuntimeSpec): Promise<GondolinRuntimeHandle>;
|
|
41
|
-
stop(handle: Pick<GondolinRuntimeHandle, "workerPid" | "sessionId" | "instanceId" | "workerName">): Promise<void>;
|
|
42
|
-
exec(handle: GondolinRuntimeHandle, command: string, options?: {
|
|
43
|
-
env?: Record<string, string>;
|
|
44
|
-
signal?: AbortSignal;
|
|
45
|
-
}): Promise<ExecResult>;
|
|
46
|
-
isRuntimeAlive(handle: GondolinRuntimeHandle): Promise<boolean>;
|
|
47
|
-
}
|
|
48
24
|
interface WorkerProcessLike {
|
|
49
25
|
pid?: number;
|
|
50
26
|
stdout: Readable | null;
|
|
@@ -78,17 +54,17 @@ interface GondolinWorkerClientOverrides {
|
|
|
78
54
|
stopPollIntervalMs?: number;
|
|
79
55
|
}
|
|
80
56
|
/**
|
|
81
|
-
* Run one command through a fresh session connection
|
|
82
|
-
*
|
|
83
|
-
*
|
|
57
|
+
* Run one command through a fresh local worker session connection. Closing
|
|
58
|
+
* the connection (abort, timeout, or the far side dying) kills the in-flight
|
|
59
|
+
* guest process.
|
|
84
60
|
*/
|
|
85
61
|
export declare function execOverSessionConnect(connect: (callbacks: SessionClientCallbacks) => SessionClient | Promise<SessionClient>, command: string, options?: {
|
|
86
62
|
env?: Record<string, string>;
|
|
87
63
|
signal?: AbortSignal;
|
|
88
64
|
idleTimeoutMs?: number;
|
|
89
65
|
}): Promise<ExecResult>;
|
|
90
|
-
declare class GondolinWorkerClient
|
|
91
|
-
/** Session IPC socket per runtime
|
|
66
|
+
declare class GondolinWorkerClient {
|
|
67
|
+
/** Session IPC socket per runtime, kept out of the public handle. */
|
|
92
68
|
private readonly socketPaths;
|
|
93
69
|
private spawnProcess;
|
|
94
70
|
private connectImpl;
|
|
@@ -115,7 +91,6 @@ declare class GondolinWorkerClient implements GondolinRuntimeTransport {
|
|
|
115
91
|
* SIGKILL and reap its leftovers if it will not die.
|
|
116
92
|
*/
|
|
117
93
|
stop(handle: Pick<GondolinRuntimeHandle, "workerPid" | "sessionId">): Promise<void>;
|
|
118
|
-
/** Whether the worker process behind a handle is still alive. */
|
|
119
94
|
/**
|
|
120
95
|
* Run one command over a dedicated session IPC connection. Aborting (or the
|
|
121
96
|
* caller's timeout signal firing) destroys the connection, which kills the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gondolin-worker-client.d.ts","sourceRoot":"","sources":["../../src/sandbox/gondolin-worker-client.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAI5C,OAAO,KAAK,EAAE,oBAAoB,EAA2B,MAAM,sBAAsB,CAAC;AAC1F,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAE7C
|
|
1
|
+
{"version":3,"file":"gondolin-worker-client.d.ts","sourceRoot":"","sources":["../../src/sandbox/gondolin-worker-client.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAI5C,OAAO,KAAK,EAAE,oBAAoB,EAA2B,MAAM,sBAAsB,CAAC;AAC1F,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAE7C,gEAAgE;AAChE,MAAM,WAAW,qBAAqB;IACpC,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,0DAA0D;AAC1D,UAAU,mBAAmB;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,KAAK,CAAC;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAClD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAID,UAAU,iBAAiB;IACzB,GAAG,CAAC,EAAE,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