@keystrokehq/hosting 0.1.15 → 0.1.17

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/index.d.cts CHANGED
@@ -1,4 +1,5 @@
1
- import Docker from "dockerode";
1
+ import { a as ProjectRuntimeDatabase, c as ProjectRuntimeInput, d as ProjectRuntimeSleepInput, f as ProjectRuntimeWakeInput, i as ProjectRuntime, l as ProjectRuntimeReconcileInput, m as parseOrgArtifactsFromEnv, n as OrgProjectDeploy, o as ProjectRuntimeDestroyInput, p as encodeOrgArtifacts, r as ProjectPingTarget, s as ProjectRuntimeHosting, t as OrgArtifactSpec, u as ProjectRuntimeResult } from "./runtime-Cp906goK.cjs";
2
+ import { a as WorkerRuntimeConfig, i as OrganizationHostingResult, n as HostingPlugin, o as WorkerRuntimeConfigError, r as OrganizationHostingInput, s as resolveWorkerRuntimeConfig, t as HostingOptions } from "./plugin-4cuXkf42.cjs";
2
3
 
3
4
  //#region src/constants.d.ts
4
5
  declare const PROJECT_SERVER_IMAGE = "keystroke/project-server:local";
@@ -15,130 +16,37 @@ declare const PROJECT_SERVER_DEPLOY_STATUS: {
15
16
  readonly port: 3000;
16
17
  };
17
18
  //#endregion
18
- //#region src/runtime.d.ts
19
- type ProjectRuntimeDatabase = {
20
- host: string;
21
- port: number;
22
- database: string;
23
- user: string;
24
- password: string;
25
- searchPath: string;
26
- organizationId: string; /** @deprecated Per-project workers only — org workers omit this. */
27
- projectId?: string;
28
- };
29
- type OrgProjectDeploy = {
30
- projectId: string;
31
- name: string;
32
- artifactId: string;
33
- artifactStorageKey: string;
34
- artifactVersion: number;
19
+ //#region src/runtime-control.d.ts
20
+ declare const PROJECT_SERVER_CONTROL: {
21
+ readonly load: "/control/projects/load";
22
+ readonly promote: "/control/projects/promote";
23
+ readonly unload: "/control/projects/unload";
24
+ readonly port: 3000;
35
25
  };
36
- type OrgArtifactSpec = {
26
+ type LoadProjectOnRuntimeInput = {
37
27
  projectId: string;
38
- artifactStorageKey: string;
39
- artifactId: string; /** Monotonic per-project artifact version from the platform database. */
28
+ artifactId: string;
40
29
  artifactVersion: number;
30
+ storageKey: string;
31
+ activate?: boolean;
41
32
  };
42
- type ProjectRuntimeHosting = {
43
- appName: string;
44
- };
45
- type ProjectRuntimeInput = {
46
- organizationId: string;
47
- projects: OrgProjectDeploy[];
48
- database: ProjectRuntimeDatabase;
49
- hosting?: ProjectRuntimeHosting; /** Extra env merged into the project server launch spec (e.g. from an llmProxy plugin). */
50
- env?: Record<string, string>; /** Previous runtime to retire after a successful cutover. */
51
- previousRuntimeId?: string | null;
52
- };
53
- /** Builds base64 `KEYSTROKE_ORG_ARTIFACTS` payload for org worker containers. */
54
- declare function encodeOrgArtifacts(artifacts: OrgArtifactSpec[]): string;
55
- declare function parseOrgArtifactsFromEnv(env?: NodeJS.ProcessEnv): OrgArtifactSpec[] | undefined;
56
- type ProjectRuntimeDestroyInput = {
57
- runtimeId: string;
58
- hosting?: ProjectRuntimeHosting;
59
- };
60
- type ProjectRuntimeReconcileInput = {
61
- organizationId: string; /** The runtime to keep — every other runtime belonging to this org should be destroyed. */
62
- keepRuntimeId: string;
63
- hosting?: ProjectRuntimeHosting;
64
- };
65
- type ProjectRuntimeResult = {
66
- runtimeId: string;
67
- baseUrl: string;
68
- };
69
- type ProjectRuntime = {
70
- start(input: ProjectRuntimeInput): Promise<ProjectRuntimeResult>;
71
- destroy?(input: ProjectRuntimeDestroyInput): Promise<void>;
72
- /**
73
- * Sweep away every runtime for this org except `keepRuntimeId`, retrying
74
- * transient failures instead of giving up after one attempt. This catches
75
- * orphans that a single {@link destroy} call missed (e.g. a previous deploy's
76
- * destroy failed silently), not just the one runtime recorded as "previous."
77
- */
78
- reconcile?(input: ProjectRuntimeReconcileInput): Promise<void>;
79
- };
80
- type ProjectPingTarget = {
81
- baseUrl: string | null;
82
- runtimeId: string | null;
83
- };
84
- //#endregion
85
- //#region src/worker-runtime-config.d.ts
86
- /** Resolved platform ↔ project-server worker auth contract. */
87
- type WorkerRuntimeConfig = {
88
- /** Platform API base URL reachable from the project-server runtime. */platformUrl: string; /** Bearer token for platform `/internal` routes. */
89
- workerToken: string;
90
- };
91
- declare class WorkerRuntimeConfigError extends Error {
92
- readonly missing: readonly string[];
93
- constructor(missing: string[]);
94
- }
95
- /** Fail fast when the platform cannot start worker-mode project servers. */
96
- declare function resolveWorkerRuntimeConfig(source?: NodeJS.ProcessEnv): WorkerRuntimeConfig;
97
- //#endregion
98
- //#region src/plugin.d.ts
99
- type HostingOptions = {
100
- image?: string;
101
- env?: NodeJS.ProcessEnv;
33
+ type RuntimeControlOptions = {
102
34
  fetchImpl?: typeof fetch;
103
- healthTimeoutMs?: number;
104
- };
105
- type OrganizationHostingInput = {
106
- organizationId: string;
107
- name: string;
108
- };
109
- type OrganizationHostingResult = {
110
- appName: string;
111
- };
112
- type HostingPlugin = {
113
- name: string; /** Validated at plugin creation — shared by platform internal routes and project-server containers. */
114
- workerRuntime: WorkerRuntimeConfig;
115
- createRuntime(): ProjectRuntime;
116
- provisionOrganization?(input: OrganizationHostingInput): Promise<OrganizationHostingResult>;
117
- deprovisionOrganization?(result: OrganizationHostingResult): Promise<void>;
118
- canPingTarget?(target: ProjectPingTarget): target is {
119
- baseUrl: string;
120
- runtimeId: string | null;
121
- };
122
- pingRequestHeaders?(runtimeId: string | null): Record<string, string>;
123
- };
124
- //#endregion
125
- //#region src/docker/create-docker-runtime.d.ts
126
- type WorkspacesMount = {
127
- hostPath: string;
128
- containerPath: string;
35
+ timeoutMs?: number; /** Bearer token — typically the org's WORKER_INTERNAL_TOKEN. */
36
+ workerToken?: string;
129
37
  };
130
- type DockerPluginOptions = HostingOptions & {
131
- docker?: Docker; /** Bind a shared host workspace dir into dev workers (VM sandbox proxy mount path). */
132
- workspacesMount?: WorkspacesMount; /** Additional Docker bind mounts (`host:container[:options]`). */
133
- extraBinds?: string[];
134
- };
135
- //#endregion
136
- //#region src/docker/plugin.d.ts
137
- declare function dockerPlugin(options?: DockerPluginOptions): HostingPlugin;
138
- //#endregion
139
- //#region src/default-plugin.d.ts
140
- /** Local Docker hosting default for platform and dev. */
141
- declare function defaultHostingPlugin(options?: DockerPluginOptions): HostingPlugin;
38
+ declare function loadProjectOnRuntime(baseUrl: string, input: LoadProjectOnRuntimeInput, options?: RuntimeControlOptions): Promise<void>;
39
+ declare function promoteProjectOnRuntime(baseUrl: string, input: {
40
+ projectId: string;
41
+ artifactId: string;
42
+ }, options?: RuntimeControlOptions): Promise<void>;
43
+ declare function unloadProjectOnRuntime(baseUrl: string, input: {
44
+ projectId: string;
45
+ artifactId: string;
46
+ force?: boolean;
47
+ }, options?: RuntimeControlOptions): Promise<void>;
48
+ /** True when the org runtime answers /health. */
49
+ declare function pingRuntimeHealth(baseUrl: string, options?: RuntimeControlOptions): Promise<boolean>;
142
50
  //#endregion
143
51
  //#region src/runtime-env.d.ts
144
52
  /** Env keys that must never be forwarded into untrusted org workers. */
@@ -217,19 +125,57 @@ type ProjectDeployStatus = {
217
125
  ok: boolean;
218
126
  error?: string;
219
127
  };
128
+ type VersionDeployStatus = {
129
+ projectId: string;
130
+ artifactId: string;
131
+ state: "active" | "resident" | "indexed";
132
+ ok: boolean;
133
+ activeJobCount?: number;
134
+ error?: string;
135
+ };
220
136
  type DeployStatusResponse = {
221
137
  projects: ProjectDeployStatus[];
138
+ versions?: VersionDeployStatus[];
222
139
  };
223
140
  type FetchDeployStatusOptions = {
224
141
  fetchImpl?: typeof fetch;
225
142
  timeoutMs?: number;
226
143
  };
144
+ type WaitForDeployStatusOptions = {
145
+ fetchImpl?: typeof fetch;
146
+ timeoutMs?: number;
147
+ intervalMs?: number;
148
+ };
227
149
  /**
228
150
  * Ask a running org machine which projects bootstrapped and which failed.
229
- * Best-effort: returns undefined on any error so callers can fall back to
230
- * treating every project as healthy (preserving pre-existing behavior).
151
+ * Returns undefined when the endpoint is unreachable, non-OK, times out, or
152
+ * returns an unusable payload callers must treat that as non-affirmative
153
+ * health for every pending project (never promote on silence).
231
154
  */
232
155
  declare function fetchDeployStatus(baseUrl: string, options?: FetchDeployStatusOptions): Promise<DeployStatusResponse | undefined>;
156
+ /**
157
+ * Poll `/deploy-status` until the real worker returns a usable payload or the
158
+ * deadline expires. Retries only transient unavailability (network errors,
159
+ * non-2xx including early-health 404, timeouts, malformed bodies). Any valid
160
+ * `{ projects: [...] }` response — including empty or explicit failures — is
161
+ * terminal so genuine bootstrap errors surface immediately.
162
+ */
163
+ declare function waitForDeployStatus(baseUrl: string, options?: WaitForDeployStatusOptions): Promise<DeployStatusResponse | undefined>;
164
+ type DeployHealthVerdict = {
165
+ ok: true;
166
+ } | {
167
+ ok: false;
168
+ error: string;
169
+ };
170
+ /**
171
+ * Require an explicit `{ projectId, ok: true }` entry for each candidate.
172
+ * Missing entries, `ok: false`, empty `projects`, or an unavailable status
173
+ * response all fail closed for that project.
174
+ */
175
+ declare function classifyDeployHealth(input: {
176
+ projectIds: string[];
177
+ deployStatus: DeployStatusResponse | undefined;
178
+ }): Map<string, DeployHealthVerdict>;
233
179
  //#endregion
234
- export { DEV_PLATFORM_WORKER_TOKEN, type DeployStatusResponse, type DockerPluginOptions, FORBIDDEN_WORKER_ENV_KEYS, type FetchDeployStatusOptions, type HostingOptions, type HostingPlugin, type OrgArtifactSpec, type OrgProjectDeploy, type OrganizationHostingInput, type OrganizationHostingResult, PROJECT_SERVER_DEPLOY_STATUS, PROJECT_SERVER_FRAMEWORK_NODE_MODULES, PROJECT_SERVER_FRAMEWORK_ROOT, PROJECT_SERVER_HEALTH, PROJECT_SERVER_IMAGE, PROJECT_SERVER_PORT, PROJECT_SERVER_ROOT, type PingProjectOptions, type ProjectDeployStatus, type ProjectPingTarget, type ProjectRuntime, type ProjectRuntimeDatabase, type ProjectRuntimeDestroyInput, type ProjectRuntimeHosting, type ProjectRuntimeInput, type ProjectRuntimeReconcileInput, type ProjectRuntimeResult, RUNTIME_PING_TIMEOUT_MS, type RuntimeLaunchSpec, type VerifiedOrgWorkerToken, type WaitForHealthOptions, type WorkerRuntimeConfig, WorkerRuntimeConfigError, buildRuntimeEnv, canPingProjectTarget, defaultHostingPlugin, dockerPlugin, encodeOrgArtifacts, fetchDeployStatus, formatDockerEnv, mintOrgWorkerToken, parseOrgArtifactsFromEnv, pingProject, pingProjectTarget, resolvePlatformWorkerToken, resolveProjectServerImage, resolveRuntimeLaunch, resolveWorkerPlatformUrl, resolveWorkerRuntimeConfig, rewriteLoopbackHost, rewriteLoopbackUrl, verifyOrgWorkerToken, waitForHealth };
180
+ export { DEV_PLATFORM_WORKER_TOKEN, type DeployHealthVerdict, type DeployStatusResponse, FORBIDDEN_WORKER_ENV_KEYS, type FetchDeployStatusOptions, type HostingOptions, type HostingPlugin, type LoadProjectOnRuntimeInput, type OrgArtifactSpec, type OrgProjectDeploy, type OrganizationHostingInput, type OrganizationHostingResult, PROJECT_SERVER_CONTROL, PROJECT_SERVER_DEPLOY_STATUS, PROJECT_SERVER_FRAMEWORK_NODE_MODULES, PROJECT_SERVER_FRAMEWORK_ROOT, PROJECT_SERVER_HEALTH, PROJECT_SERVER_IMAGE, PROJECT_SERVER_PORT, PROJECT_SERVER_ROOT, type PingProjectOptions, type ProjectDeployStatus, type ProjectPingTarget, type ProjectRuntime, type ProjectRuntimeDatabase, type ProjectRuntimeDestroyInput, type ProjectRuntimeHosting, type ProjectRuntimeInput, type ProjectRuntimeReconcileInput, type ProjectRuntimeResult, type ProjectRuntimeSleepInput, type ProjectRuntimeWakeInput, RUNTIME_PING_TIMEOUT_MS, type RuntimeControlOptions, type RuntimeLaunchSpec, type VerifiedOrgWorkerToken, type VersionDeployStatus, type WaitForDeployStatusOptions, type WaitForHealthOptions, type WorkerRuntimeConfig, WorkerRuntimeConfigError, buildRuntimeEnv, canPingProjectTarget, classifyDeployHealth, encodeOrgArtifacts, fetchDeployStatus, formatDockerEnv, loadProjectOnRuntime, mintOrgWorkerToken, parseOrgArtifactsFromEnv, pingProject, pingProjectTarget, pingRuntimeHealth, promoteProjectOnRuntime, resolvePlatformWorkerToken, resolveProjectServerImage, resolveRuntimeLaunch, resolveWorkerPlatformUrl, resolveWorkerRuntimeConfig, rewriteLoopbackHost, rewriteLoopbackUrl, unloadProjectOnRuntime, verifyOrgWorkerToken, waitForDeployStatus, waitForHealth };
235
181
  //# sourceMappingURL=index.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.cts","names":[],"sources":["../src/constants.ts","../src/runtime.ts","../src/worker-runtime-config.ts","../src/plugin.ts","../src/docker/create-docker-runtime.ts","../src/docker/plugin.ts","../src/default-plugin.ts","../src/runtime-env.ts","../src/org-worker-token.ts","../src/wait-for-health.ts","../src/runtime-constants.ts","../src/ping-project.ts","../src/ping-project-target.ts","../src/deploy-status.ts"],"mappings":";;;cAAa,oBAAA;AAAA,cAEA,mBAAA;AAAA,cAEA,mBAAA;AAAA,cAEA,6BAAA;AAAA,cAEA,qCAAA;AAAA,cAEA,qBAAA;EAAA,SAGH,IAAA;EAAA,SAAA,IAAA;AAAA;AAAA,cAEG,4BAAA;EAAA,SAGH,IAAA;EAAA,SAAA,IAAA;AAAA;;;KClBE,sBAAA;EACV,IAAA;EACA,IAAA;EACA,QAAA;EACA,IAAA;EACA,QAAA;EACA,UAAA;EACA,cAAA,UDLW;ECOX,SAAA;AAAA;AAAA,KAGU,gBAAA;EACV,SAAA;EACA,IAAA;EACA,UAAA;EACA,kBAAA;EACA,eAAA;AAAA;AAAA,KAGU,eAAA;EACV,SAAA;EACA,kBAAA;EACA,UAAA,UDjBwC;ECmBxC,eAAA;AAAA;AAAA,KAGU,qBAAA;EACV,OAAO;AAAA;AAAA,KAGG,mBAAA;EACV,cAAA;EACA,QAAA,EAAU,gBAAA;EACV,QAAA,EAAU,sBAAA;EACV,OAAA,GAAU,qBAAA,EDrBC;ECuBX,GAAA,GAAM,MAAA;EAEN,iBAAA;AAAA;;iBAIc,kBAAA,CAAmB,SAA4B,EAAjB,eAAe;AAAA,iBAI7C,wBAAA,CACd,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O;;;;cCbG,uBAAA;;;KCGD,kBAAA;EACV,SAAA;EACA,SAAA,UAAmB,KAAA;EACnB,SAAA;EACA,MAAA,GAAS,IAAA,CAAK,aAAA;AAAA;AAAA,iBAGM,WAAA,CACpB,OAAA,UACA,OAAA,GAAS,kBAAA,GACR,OAAO;;;iBCVM,oBAAA,CACd,MAAA,EAAQ,iBAAA,EACR,MAAA,GAAS,IAAA,CAAK,aAAA,qBACb,MAAA;EAAY,OAAA;EAAiB,SAAA;AAAA;AAAA,iBAQV,iBAAA,CACpB,MAAA,EAAQ,iBAAA,EACR,OAAA,GAAS,kBAAA;EACP,MAAA,GAAS,IAAA,CAAK,aAAA;AAAA,IAEf,OAAA;;;;KChBS,mBAAA;EACV,SAAA;EACA,EAAA;EACA,KAAA;AAAA;AAAA,KAGU,oBAAA;EACV,QAAA,EAAU,mBAAmB;AAAA;AAAA,KAGnB,wBAAA;EACV,SAAA,UAAmB,KAAK;EACxB,SAAA;AAAA;AbZF;;;;AAAgC;AAAhC,iBaoBsB,iBAAA,CACpB,OAAA,UACA,OAAA,GAAS,wBAAA,GACR,OAAA,CAAQ,oBAAA"}
1
+ {"version":3,"file":"index.d.cts","names":[],"sources":["../src/constants.ts","../src/runtime-control.ts","../src/runtime-env.ts","../src/org-worker-token.ts","../src/wait-for-health.ts","../src/runtime-constants.ts","../src/ping-project.ts","../src/ping-project-target.ts","../src/deploy-status.ts"],"mappings":";;;;cAAa,oBAAA;AAAA,cAEA,mBAAA;AAAA,cAEA,mBAAA;AAAA,cAEA,6BAAA;AAAA,cAEA,qCAAA;AAAA,cAEA,qBAAA;EAAA,SAGH,IAAA;EAAA,SAAA,IAAA;AAAA;AAAA,cAEG,4BAAA;EAAA,SAGH,IAAA;EAAA,SAAA,IAAA;AAAA;;;cCfG,sBAAA;EAAA;;;;;KAOD,yBAAA;EACV,SAAA;EACA,UAAA;EACA,eAAA;EACA,UAAA;EACA,QAAA;AAAA;AAAA,KAGU,qBAAA;EACV,SAAA,UAAm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EAAA;EAAW,KAAA;AAAA;;;;;APxG9D;iBO+GgB,oBAAA,CAAqB,KAAA;EACnC,UAAA;EACA,YAAA,EAAc,oBAAA;AAAA,IACZ,GAAA,SAAY,mBAAA"}
package/dist/index.d.mts CHANGED
@@ -1,4 +1,5 @@
1
- import Docker from "dockerode";
1
+ import { a as ProjectRuntimeDatabase, c as ProjectRuntimeInput, d as ProjectRuntimeSleepInput, f as ProjectRuntimeWakeInput, i as ProjectRuntime, l as ProjectRuntimeReconcileInput, m as parseOrgArtifactsFromEnv, n as OrgProjectDeploy, o as ProjectRuntimeDestroyInput, p as encodeOrgArtifacts, r as ProjectPingTarget, s as ProjectRuntimeHosting, t as OrgArtifactSpec, u as ProjectRuntimeResult } from "./runtime-Cp906goK.mjs";
2
+ import { a as WorkerRuntimeConfig, i as OrganizationHostingResult, n as HostingPlugin, o as WorkerRuntimeConfigError, r as OrganizationHostingInput, s as resolveWorkerRuntimeConfig, t as HostingOptions } from "./plugin-eiAXqE7P.mjs";
2
3
 
3
4
  //#region src/constants.d.ts
4
5
  declare const PROJECT_SERVER_IMAGE = "keystroke/project-server:local";
@@ -15,130 +16,37 @@ declare const PROJECT_SERVER_DEPLOY_STATUS: {
15
16
  readonly port: 3000;
16
17
  };
17
18
  //#endregion
18
- //#region src/runtime.d.ts
19
- type ProjectRuntimeDatabase = {
20
- host: string;
21
- port: number;
22
- database: string;
23
- user: string;
24
- password: string;
25
- searchPath: string;
26
- organizationId: string; /** @deprecated Per-project workers only — org workers omit this. */
27
- projectId?: string;
28
- };
29
- type OrgProjectDeploy = {
30
- projectId: string;
31
- name: string;
32
- artifactId: string;
33
- artifactStorageKey: string;
34
- artifactVersion: number;
19
+ //#region src/runtime-control.d.ts
20
+ declare const PROJECT_SERVER_CONTROL: {
21
+ readonly load: "/control/projects/load";
22
+ readonly promote: "/control/projects/promote";
23
+ readonly unload: "/control/projects/unload";
24
+ readonly port: 3000;
35
25
  };
36
- type OrgArtifactSpec = {
26
+ type LoadProjectOnRuntimeInput = {
37
27
  projectId: string;
38
- artifactStorageKey: string;
39
- artifactId: string; /** Monotonic per-project artifact version from the platform database. */
28
+ artifactId: string;
40
29
  artifactVersion: number;
30
+ storageKey: string;
31
+ activate?: boolean;
41
32
  };
42
- type ProjectRuntimeHosting = {
43
- appName: string;
44
- };
45
- type ProjectRuntimeInput = {
46
- organizationId: string;
47
- projects: OrgProjectDeploy[];
48
- database: ProjectRuntimeDatabase;
49
- hosting?: ProjectRuntimeHosting; /** Extra env merged into the project server launch spec (e.g. from an llmProxy plugin). */
50
- env?: Record<string, string>; /** Previous runtime to retire after a successful cutover. */
51
- previousRuntimeId?: string | null;
52
- };
53
- /** Builds base64 `KEYSTROKE_ORG_ARTIFACTS` payload for org worker containers. */
54
- declare function encodeOrgArtifacts(artifacts: OrgArtifactSpec[]): string;
55
- declare function parseOrgArtifactsFromEnv(env?: NodeJS.ProcessEnv): OrgArtifactSpec[] | undefined;
56
- type ProjectRuntimeDestroyInput = {
57
- runtimeId: string;
58
- hosting?: ProjectRuntimeHosting;
59
- };
60
- type ProjectRuntimeReconcileInput = {
61
- organizationId: string; /** The runtime to keep — every other runtime belonging to this org should be destroyed. */
62
- keepRuntimeId: string;
63
- hosting?: ProjectRuntimeHosting;
64
- };
65
- type ProjectRuntimeResult = {
66
- runtimeId: string;
67
- baseUrl: string;
68
- };
69
- type ProjectRuntime = {
70
- start(input: ProjectRuntimeInput): Promise<ProjectRuntimeResult>;
71
- destroy?(input: ProjectRuntimeDestroyInput): Promise<void>;
72
- /**
73
- * Sweep away every runtime for this org except `keepRuntimeId`, retrying
74
- * transient failures instead of giving up after one attempt. This catches
75
- * orphans that a single {@link destroy} call missed (e.g. a previous deploy's
76
- * destroy failed silently), not just the one runtime recorded as "previous."
77
- */
78
- reconcile?(input: ProjectRuntimeReconcileInput): Promise<void>;
79
- };
80
- type ProjectPingTarget = {
81
- baseUrl: string | null;
82
- runtimeId: string | null;
83
- };
84
- //#endregion
85
- //#region src/worker-runtime-config.d.ts
86
- /** Resolved platform ↔ project-server worker auth contract. */
87
- type WorkerRuntimeConfig = {
88
- /** Platform API base URL reachable from the project-server runtime. */platformUrl: string; /** Bearer token for platform `/internal` routes. */
89
- workerToken: string;
90
- };
91
- declare class WorkerRuntimeConfigError extends Error {
92
- readonly missing: readonly string[];
93
- constructor(missing: string[]);
94
- }
95
- /** Fail fast when the platform cannot start worker-mode project servers. */
96
- declare function resolveWorkerRuntimeConfig(source?: NodeJS.ProcessEnv): WorkerRuntimeConfig;
97
- //#endregion
98
- //#region src/plugin.d.ts
99
- type HostingOptions = {
100
- image?: string;
101
- env?: NodeJS.ProcessEnv;
33
+ type RuntimeControlOptions = {
102
34
  fetchImpl?: typeof fetch;
103
- healthTimeoutMs?: number;
104
- };
105
- type OrganizationHostingInput = {
106
- organizationId: string;
107
- name: string;
108
- };
109
- type OrganizationHostingResult = {
110
- appName: string;
111
- };
112
- type HostingPlugin = {
113
- name: string; /** Validated at plugin creation — shared by platform internal routes and project-server containers. */
114
- workerRuntime: WorkerRuntimeConfig;
115
- createRuntime(): ProjectRuntime;
116
- provisionOrganization?(input: OrganizationHostingInput): Promise<OrganizationHostingResult>;
117
- deprovisionOrganization?(result: OrganizationHostingResult): Promise<void>;
118
- canPingTarget?(target: ProjectPingTarget): target is {
119
- baseUrl: string;
120
- runtimeId: string | null;
121
- };
122
- pingRequestHeaders?(runtimeId: string | null): Record<string, string>;
123
- };
124
- //#endregion
125
- //#region src/docker/create-docker-runtime.d.ts
126
- type WorkspacesMount = {
127
- hostPath: string;
128
- containerPath: string;
35
+ timeoutMs?: number; /** Bearer token — typically the org's WORKER_INTERNAL_TOKEN. */
36
+ workerToken?: string;
129
37
  };
130
- type DockerPluginOptions = HostingOptions & {
131
- docker?: Docker; /** Bind a shared host workspace dir into dev workers (VM sandbox proxy mount path). */
132
- workspacesMount?: WorkspacesMount; /** Additional Docker bind mounts (`host:container[:options]`). */
133
- extraBinds?: string[];
134
- };
135
- //#endregion
136
- //#region src/docker/plugin.d.ts
137
- declare function dockerPlugin(options?: DockerPluginOptions): HostingPlugin;
138
- //#endregion
139
- //#region src/default-plugin.d.ts
140
- /** Local Docker hosting default for platform and dev. */
141
- declare function defaultHostingPlugin(options?: DockerPluginOptions): HostingPlugin;
38
+ declare function loadProjectOnRuntime(baseUrl: string, input: LoadProjectOnRuntimeInput, options?: RuntimeControlOptions): Promise<void>;
39
+ declare function promoteProjectOnRuntime(baseUrl: string, input: {
40
+ projectId: string;
41
+ artifactId: string;
42
+ }, options?: RuntimeControlOptions): Promise<void>;
43
+ declare function unloadProjectOnRuntime(baseUrl: string, input: {
44
+ projectId: string;
45
+ artifactId: string;
46
+ force?: boolean;
47
+ }, options?: RuntimeControlOptions): Promise<void>;
48
+ /** True when the org runtime answers /health. */
49
+ declare function pingRuntimeHealth(baseUrl: string, options?: RuntimeControlOptions): Promise<boolean>;
142
50
  //#endregion
143
51
  //#region src/runtime-env.d.ts
144
52
  /** Env keys that must never be forwarded into untrusted org workers. */
@@ -217,19 +125,57 @@ type ProjectDeployStatus = {
217
125
  ok: boolean;
218
126
  error?: string;
219
127
  };
128
+ type VersionDeployStatus = {
129
+ projectId: string;
130
+ artifactId: string;
131
+ state: "active" | "resident" | "indexed";
132
+ ok: boolean;
133
+ activeJobCount?: number;
134
+ error?: string;
135
+ };
220
136
  type DeployStatusResponse = {
221
137
  projects: ProjectDeployStatus[];
138
+ versions?: VersionDeployStatus[];
222
139
  };
223
140
  type FetchDeployStatusOptions = {
224
141
  fetchImpl?: typeof fetch;
225
142
  timeoutMs?: number;
226
143
  };
144
+ type WaitForDeployStatusOptions = {
145
+ fetchImpl?: typeof fetch;
146
+ timeoutMs?: number;
147
+ intervalMs?: number;
148
+ };
227
149
  /**
228
150
  * Ask a running org machine which projects bootstrapped and which failed.
229
- * Best-effort: returns undefined on any error so callers can fall back to
230
- * treating every project as healthy (preserving pre-existing behavior).
151
+ * Returns undefined when the endpoint is unreachable, non-OK, times out, or
152
+ * returns an unusable payload callers must treat that as non-affirmative
153
+ * health for every pending project (never promote on silence).
231
154
  */
232
155
  declare function fetchDeployStatus(baseUrl: string, options?: FetchDeployStatusOptions): Promise<DeployStatusResponse | undefined>;
156
+ /**
157
+ * Poll `/deploy-status` until the real worker returns a usable payload or the
158
+ * deadline expires. Retries only transient unavailability (network errors,
159
+ * non-2xx including early-health 404, timeouts, malformed bodies). Any valid
160
+ * `{ projects: [...] }` response — including empty or explicit failures — is
161
+ * terminal so genuine bootstrap errors surface immediately.
162
+ */
163
+ declare function waitForDeployStatus(baseUrl: string, options?: WaitForDeployStatusOptions): Promise<DeployStatusResponse | undefined>;
164
+ type DeployHealthVerdict = {
165
+ ok: true;
166
+ } | {
167
+ ok: false;
168
+ error: string;
169
+ };
170
+ /**
171
+ * Require an explicit `{ projectId, ok: true }` entry for each candidate.
172
+ * Missing entries, `ok: false`, empty `projects`, or an unavailable status
173
+ * response all fail closed for that project.
174
+ */
175
+ declare function classifyDeployHealth(input: {
176
+ projectIds: string[];
177
+ deployStatus: DeployStatusResponse | undefined;
178
+ }): Map<string, DeployHealthVerdict>;
233
179
  //#endregion
234
- export { DEV_PLATFORM_WORKER_TOKEN, type DeployStatusResponse, type DockerPluginOptions, FORBIDDEN_WORKER_ENV_KEYS, type FetchDeployStatusOptions, type HostingOptions, type HostingPlugin, type OrgArtifactSpec, type OrgProjectDeploy, type OrganizationHostingInput, type OrganizationHostingResult, PROJECT_SERVER_DEPLOY_STATUS, PROJECT_SERVER_FRAMEWORK_NODE_MODULES, PROJECT_SERVER_FRAMEWORK_ROOT, PROJECT_SERVER_HEALTH, PROJECT_SERVER_IMAGE, PROJECT_SERVER_PORT, PROJECT_SERVER_ROOT, type PingProjectOptions, type ProjectDeployStatus, type ProjectPingTarget, type ProjectRuntime, type ProjectRuntimeDatabase, type ProjectRuntimeDestroyInput, type ProjectRuntimeHosting, type ProjectRuntimeInput, type ProjectRuntimeReconcileInput, type ProjectRuntimeResult, RUNTIME_PING_TIMEOUT_MS, type RuntimeLaunchSpec, type VerifiedOrgWorkerToken, type WaitForHealthOptions, type WorkerRuntimeConfig, WorkerRuntimeConfigError, buildRuntimeEnv, canPingProjectTarget, defaultHostingPlugin, dockerPlugin, encodeOrgArtifacts, fetchDeployStatus, formatDockerEnv, mintOrgWorkerToken, parseOrgArtifactsFromEnv, pingProject, pingProjectTarget, resolvePlatformWorkerToken, resolveProjectServerImage, resolveRuntimeLaunch, resolveWorkerPlatformUrl, resolveWorkerRuntimeConfig, rewriteLoopbackHost, rewriteLoopbackUrl, verifyOrgWorkerToken, waitForHealth };
180
+ export { DEV_PLATFORM_WORKER_TOKEN, type DeployHealthVerdict, type DeployStatusResponse, FORBIDDEN_WORKER_ENV_KEYS, type FetchDeployStatusOptions, type HostingOptions, type HostingPlugin, type LoadProjectOnRuntimeInput, type OrgArtifactSpec, type OrgProjectDeploy, type OrganizationHostingInput, type OrganizationHostingResult, PROJECT_SERVER_CONTROL, PROJECT_SERVER_DEPLOY_STATUS, PROJECT_SERVER_FRAMEWORK_NODE_MODULES, PROJECT_SERVER_FRAMEWORK_ROOT, PROJECT_SERVER_HEALTH, PROJECT_SERVER_IMAGE, PROJECT_SERVER_PORT, PROJECT_SERVER_ROOT, type PingProjectOptions, type ProjectDeployStatus, type ProjectPingTarget, type ProjectRuntime, type ProjectRuntimeDatabase, type ProjectRuntimeDestroyInput, type ProjectRuntimeHosting, type ProjectRuntimeInput, type ProjectRuntimeReconcileInput, type ProjectRuntimeResult, type ProjectRuntimeSleepInput, type ProjectRuntimeWakeInput, RUNTIME_PING_TIMEOUT_MS, type RuntimeControlOptions, type RuntimeLaunchSpec, type VerifiedOrgWorkerToken, type VersionDeployStatus, type WaitForDeployStatusOptions, type WaitForHealthOptions, type WorkerRuntimeConfig, WorkerRuntimeConfigError, buildRuntimeEnv, canPingProjectTarget, classifyDeployHealth, encodeOrgArtifacts, fetchDeployStatus, formatDockerEnv, loadProjectOnRuntime, mintOrgWorkerToken, parseOrgArtifactsFromEnv, pingProject, pingProjectTarget, pingRuntimeHealth, promoteProjectOnRuntime, resolvePlatformWorkerToken, resolveProjectServerImage, resolveRuntimeLaunch, resolveWorkerPlatformUrl, resolveWorkerRuntimeConfig, rewriteLoopbackHost, rewriteLoopbackUrl, unloadProjectOnRuntime, verifyOrgWorkerToken, waitForDeployStatus, waitForHealth };
235
181
  //# sourceMappingURL=index.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","names":[],"sources":["../src/constants.ts","../src/runtime.ts","../src/worker-runtime-config.ts","../src/plugin.ts","../src/docker/create-docker-runtime.ts","../src/docker/plugin.ts","../src/default-plugin.ts","../src/runtime-env.ts","../src/org-worker-token.ts","../src/wait-for-health.ts","../src/runtime-constants.ts","../src/ping-project.ts","../src/ping-project-target.ts","../src/deploy-status.ts"],"mappings":";;;cAAa,oBAAA;AAAA,cAEA,mBAAA;AAAA,cAEA,mBAAA;AAAA,cAEA,6BAAA;AAAA,cAEA,qCAAA;AAAA,cAEA,qBAAA;EAAA,SAGH,IAAA;EAAA,SAAA,IAAA;AAAA;AAAA,cAEG,4BAAA;EAAA,SAGH,IAAA;EAAA,SAAA,IAAA;AAAA;;;KClBE,sBAAA;EACV,IAAA;EACA,IAAA;EACA,QAAA;EACA,IAAA;EACA,QAAA;EACA,UAAA;EACA,cAAA,UDLW;ECOX,SAAA;AAAA;AAAA,KAGU,gBAAA;EACV,SAAA;EACA,IAAA;EACA,UAAA;EACA,kBAAA;EACA,eAAA;AAAA;AAAA,KAGU,eAAA;EACV,SAAA;EACA,kBAAA;EACA,UAAA,UDjBwC;ECmBxC,eAAA;AAAA;AAAA,KAGU,qBAAA;EACV,OAAO;AAAA;AAAA,KAGG,mBAAA;EACV,cAAA;EACA,QAAA,EAAU,gBAAA;EACV,QAAA,EAAU,sBAAA;EACV,OAAA,GAAU,qBAAA,EDrBC;ECuBX,GAAA,GAAM,MAAA;EAEN,iBAAA;AAAA;;iBAIc,kBAAA,CAAmB,SAA4B,EAAjB,eAAe;AAA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,GAAS,oBAAA,GACR,OAAO;;;;cCbG,uBAAA;;;KCGD,kBAAA;EACV,SAAA;EACA,SAAA,UAAmB,KAAA;EACnB,SAAA;EACA,MAAA,GAAS,IAAA,CAAK,aAAA;AAAA;AAAA,iBAGM,WAAA,CACpB,OAAA,UACA,OAAA,GAAS,kBAAA,GACR,OAAO;;;iBCVM,oBAAA,CACd,MAAA,EAAQ,iBAAA,EACR,MAAA,GAAS,IAAA,CAAK,aAAA,qBACb,MAAA;EAAY,OAAA;EAAiB,SAAA;AAAA;AAAA,iBAQV,iBAAA,CACpB,MAAA,EAAQ,iBAAA,EACR,OAAA,GAAS,kBAAA;EACP,MAAA,GAAS,IAAA,CAAK,aAAA;AAAA,IAEf,OAAA;;;;KChBS,mBAAA;EACV,SAAA;EACA,EAAA;EACA,KAAA;AAAA;AAAA,KAGU,oBAAA;EACV,QAAA,EAAU,mBAAmB;AAAA;AAAA,KAGnB,wBAAA;EACV,SAAA,UAAmB,KAAK;EACxB,SAAA;AAAA;AbZF;;;;AAAgC;AAAhC,iBaoBsB,iBAAA,CACpB,OAAA,UACA,OAAA,GAAS,wBAAA,GACR,OAAA,CAAQ,oBAAA"}
1
+ {"version":3,"file":"index.d.mts","names":[],"sources":["../src/constants.ts","../src/runtime-control.ts","../src/runtime-env.ts","../src/org-worker-token.ts","../src/wait-for-health.ts","../src/runtime-constants.ts","../src/ping-project.ts","../src/ping-project-target.ts","../src/deploy-status.ts"],"mappings":";;;;cAAa,oBAAA;AAAA,cAEA,mBAAA;AAAA,cAEA,mBAAA;AAAA,cAEA,6BAAA;AAAA,cAEA,qCAAA;AAAA,cAEA,qBAAA;EAAA,SAGH,IAAA;EAAA,SAAA,IAAA;AAAA;AAAA,cAEG,4BAAA;EAAA,SAGH,IAAA;EAAA,SAAA,IAAA;AAAA;;;cCfG,sBAAA;EAAA;;;;;KAOD,yBAAA;EACV,SAAA;EACA,UAAA;EACA,eAAA;EACA,UAAA;EACA,QAAA;AAAA;AAAA,KAGU,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