@keystrokehq/hosting 0.1.8 → 0.1.10
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.cjs +149 -58
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +40 -2
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +40 -2
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +148 -59
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
package/dist/index.d.cts
CHANGED
|
@@ -10,6 +10,10 @@ declare const PROJECT_SERVER_HEALTH: {
|
|
|
10
10
|
readonly path: "/health";
|
|
11
11
|
readonly port: 3000;
|
|
12
12
|
};
|
|
13
|
+
declare const PROJECT_SERVER_DEPLOY_STATUS: {
|
|
14
|
+
readonly path: "/deploy-status";
|
|
15
|
+
readonly port: 3000;
|
|
16
|
+
};
|
|
13
17
|
//#endregion
|
|
14
18
|
//#region src/runtime.d.ts
|
|
15
19
|
type ProjectRuntimeDatabase = {
|
|
@@ -50,6 +54,11 @@ type ProjectRuntimeDestroyInput = {
|
|
|
50
54
|
runtimeId: string;
|
|
51
55
|
hosting?: ProjectRuntimeHosting;
|
|
52
56
|
};
|
|
57
|
+
type ProjectRuntimeReconcileInput = {
|
|
58
|
+
organizationId: string; /** The runtime to keep — every other runtime belonging to this org should be destroyed. */
|
|
59
|
+
keepRuntimeId: string;
|
|
60
|
+
hosting?: ProjectRuntimeHosting;
|
|
61
|
+
};
|
|
53
62
|
type ProjectRuntimeResult = {
|
|
54
63
|
runtimeId: string;
|
|
55
64
|
baseUrl: string;
|
|
@@ -57,6 +66,13 @@ type ProjectRuntimeResult = {
|
|
|
57
66
|
type ProjectRuntime = {
|
|
58
67
|
start(input: ProjectRuntimeInput): Promise<ProjectRuntimeResult>;
|
|
59
68
|
destroy?(input: ProjectRuntimeDestroyInput): Promise<void>;
|
|
69
|
+
/**
|
|
70
|
+
* Sweep away every runtime for this org except `keepRuntimeId`, retrying
|
|
71
|
+
* transient failures instead of giving up after one attempt. This catches
|
|
72
|
+
* orphans that a single {@link destroy} call missed (e.g. a previous deploy's
|
|
73
|
+
* destroy failed silently), not just the one runtime recorded as "previous."
|
|
74
|
+
*/
|
|
75
|
+
reconcile?(input: ProjectRuntimeReconcileInput): Promise<void>;
|
|
60
76
|
};
|
|
61
77
|
type ProjectPingTarget = {
|
|
62
78
|
baseUrl: string | null;
|
|
@@ -110,7 +126,8 @@ type WorkspacesMount = {
|
|
|
110
126
|
};
|
|
111
127
|
type DockerPluginOptions = HostingOptions & {
|
|
112
128
|
docker?: Docker; /** Bind a shared host workspace dir into dev workers (VM sandbox proxy mount path). */
|
|
113
|
-
workspacesMount?: WorkspacesMount;
|
|
129
|
+
workspacesMount?: WorkspacesMount; /** Additional Docker bind mounts (`host:container[:options]`). */
|
|
130
|
+
extraBinds?: string[];
|
|
114
131
|
};
|
|
115
132
|
//#endregion
|
|
116
133
|
//#region src/docker/plugin.d.ts
|
|
@@ -179,5 +196,26 @@ declare function pingProjectTarget(target: ProjectPingTarget, options?: PingProj
|
|
|
179
196
|
plugin?: Pick<HostingPlugin, "canPingTarget" | "pingRequestHeaders">;
|
|
180
197
|
}): Promise<boolean>;
|
|
181
198
|
//#endregion
|
|
182
|
-
|
|
199
|
+
//#region src/deploy-status.d.ts
|
|
200
|
+
/** Per-project bootstrap outcome reported by an org runtime machine. */
|
|
201
|
+
type ProjectDeployStatus = {
|
|
202
|
+
projectId: string;
|
|
203
|
+
ok: boolean;
|
|
204
|
+
error?: string;
|
|
205
|
+
};
|
|
206
|
+
type DeployStatusResponse = {
|
|
207
|
+
projects: ProjectDeployStatus[];
|
|
208
|
+
};
|
|
209
|
+
type FetchDeployStatusOptions = {
|
|
210
|
+
fetchImpl?: typeof fetch;
|
|
211
|
+
timeoutMs?: number;
|
|
212
|
+
};
|
|
213
|
+
/**
|
|
214
|
+
* Ask a running org machine which projects bootstrapped and which failed.
|
|
215
|
+
* Best-effort: returns undefined on any error so callers can fall back to
|
|
216
|
+
* treating every project as healthy (preserving pre-existing behavior).
|
|
217
|
+
*/
|
|
218
|
+
declare function fetchDeployStatus(baseUrl: string, options?: FetchDeployStatusOptions): Promise<DeployStatusResponse | undefined>;
|
|
219
|
+
//#endregion
|
|
220
|
+
export { DEV_PLATFORM_WORKER_TOKEN, type DeployStatusResponse, type DockerPluginOptions, type FetchDeployStatusOptions, type HostingOptions, type HostingPlugin, type OrgArtifactSpec, type OrgProjectDeploy, type OrganizationHostingInput, type OrganizationHostingResult, PROJECT_DATABASE_ENV_KEYS, 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 WaitForHealthOptions, type WorkerRuntimeConfig, WorkerRuntimeConfigError, buildRuntimeEnv, canPingProjectTarget, defaultHostingPlugin, dockerPlugin, encodeOrgArtifacts, fetchDeployStatus, formatDockerEnv, parseOrgArtifactsFromEnv, pingProject, pingProjectTarget, projectDatabaseRuntimeEnv, resolvePlatformWorkerToken, resolveProjectServerImage, resolveRuntimeLaunch, resolveWorkerPlatformUrl, resolveWorkerRuntimeConfig, rewriteLoopbackHost, rewriteLoopbackUrl, waitForHealth };
|
|
183
221
|
//# sourceMappingURL=index.d.cts.map
|
package/dist/index.d.cts.map
CHANGED
|
@@ -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/wait-for-health.ts","../src/runtime-constants.ts","../src/ping-project.ts","../src/ping-project-target.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;;;
|
|
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/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;AAAA;AAAA,KAGU,eAAA;EACV,SAAA;EACA,kBAAkB;AAAA;AAAA,KAGR,qBAAA;EACV,OAAO;AAAA;AAAA,KAGG,mBAAA;EACV,cAAA;EACA,QAAA,EAAU,gBAAA;EACV,QAAA,EAAU,sBAAA;EACV,OAAA,GAAU,qBAAA,EDnBF;ECqBR,GAAA,GAAM,MAAA,kBDrBE;ECuBR,iBAAA;AAAA;;iBAIc,kBAAA,CAAmB,SAA4B,EAAjB,eAAe;AAAA,iBAI7C,wBA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AAmB,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;AZZF;;;;AAAgC;AAAhC,iBYoBsB,iBAAA,CACpB,OAAA,UACA,OAAA,GAAS,wBAAA,GACR,OAAA,CAAQ,oBAAA"}
|
package/dist/index.d.mts
CHANGED
|
@@ -10,6 +10,10 @@ declare const PROJECT_SERVER_HEALTH: {
|
|
|
10
10
|
readonly path: "/health";
|
|
11
11
|
readonly port: 3000;
|
|
12
12
|
};
|
|
13
|
+
declare const PROJECT_SERVER_DEPLOY_STATUS: {
|
|
14
|
+
readonly path: "/deploy-status";
|
|
15
|
+
readonly port: 3000;
|
|
16
|
+
};
|
|
13
17
|
//#endregion
|
|
14
18
|
//#region src/runtime.d.ts
|
|
15
19
|
type ProjectRuntimeDatabase = {
|
|
@@ -50,6 +54,11 @@ type ProjectRuntimeDestroyInput = {
|
|
|
50
54
|
runtimeId: string;
|
|
51
55
|
hosting?: ProjectRuntimeHosting;
|
|
52
56
|
};
|
|
57
|
+
type ProjectRuntimeReconcileInput = {
|
|
58
|
+
organizationId: string; /** The runtime to keep — every other runtime belonging to this org should be destroyed. */
|
|
59
|
+
keepRuntimeId: string;
|
|
60
|
+
hosting?: ProjectRuntimeHosting;
|
|
61
|
+
};
|
|
53
62
|
type ProjectRuntimeResult = {
|
|
54
63
|
runtimeId: string;
|
|
55
64
|
baseUrl: string;
|
|
@@ -57,6 +66,13 @@ type ProjectRuntimeResult = {
|
|
|
57
66
|
type ProjectRuntime = {
|
|
58
67
|
start(input: ProjectRuntimeInput): Promise<ProjectRuntimeResult>;
|
|
59
68
|
destroy?(input: ProjectRuntimeDestroyInput): Promise<void>;
|
|
69
|
+
/**
|
|
70
|
+
* Sweep away every runtime for this org except `keepRuntimeId`, retrying
|
|
71
|
+
* transient failures instead of giving up after one attempt. This catches
|
|
72
|
+
* orphans that a single {@link destroy} call missed (e.g. a previous deploy's
|
|
73
|
+
* destroy failed silently), not just the one runtime recorded as "previous."
|
|
74
|
+
*/
|
|
75
|
+
reconcile?(input: ProjectRuntimeReconcileInput): Promise<void>;
|
|
60
76
|
};
|
|
61
77
|
type ProjectPingTarget = {
|
|
62
78
|
baseUrl: string | null;
|
|
@@ -110,7 +126,8 @@ type WorkspacesMount = {
|
|
|
110
126
|
};
|
|
111
127
|
type DockerPluginOptions = HostingOptions & {
|
|
112
128
|
docker?: Docker; /** Bind a shared host workspace dir into dev workers (VM sandbox proxy mount path). */
|
|
113
|
-
workspacesMount?: WorkspacesMount;
|
|
129
|
+
workspacesMount?: WorkspacesMount; /** Additional Docker bind mounts (`host:container[:options]`). */
|
|
130
|
+
extraBinds?: string[];
|
|
114
131
|
};
|
|
115
132
|
//#endregion
|
|
116
133
|
//#region src/docker/plugin.d.ts
|
|
@@ -179,5 +196,26 @@ declare function pingProjectTarget(target: ProjectPingTarget, options?: PingProj
|
|
|
179
196
|
plugin?: Pick<HostingPlugin, "canPingTarget" | "pingRequestHeaders">;
|
|
180
197
|
}): Promise<boolean>;
|
|
181
198
|
//#endregion
|
|
182
|
-
|
|
199
|
+
//#region src/deploy-status.d.ts
|
|
200
|
+
/** Per-project bootstrap outcome reported by an org runtime machine. */
|
|
201
|
+
type ProjectDeployStatus = {
|
|
202
|
+
projectId: string;
|
|
203
|
+
ok: boolean;
|
|
204
|
+
error?: string;
|
|
205
|
+
};
|
|
206
|
+
type DeployStatusResponse = {
|
|
207
|
+
projects: ProjectDeployStatus[];
|
|
208
|
+
};
|
|
209
|
+
type FetchDeployStatusOptions = {
|
|
210
|
+
fetchImpl?: typeof fetch;
|
|
211
|
+
timeoutMs?: number;
|
|
212
|
+
};
|
|
213
|
+
/**
|
|
214
|
+
* Ask a running org machine which projects bootstrapped and which failed.
|
|
215
|
+
* Best-effort: returns undefined on any error so callers can fall back to
|
|
216
|
+
* treating every project as healthy (preserving pre-existing behavior).
|
|
217
|
+
*/
|
|
218
|
+
declare function fetchDeployStatus(baseUrl: string, options?: FetchDeployStatusOptions): Promise<DeployStatusResponse | undefined>;
|
|
219
|
+
//#endregion
|
|
220
|
+
export { DEV_PLATFORM_WORKER_TOKEN, type DeployStatusResponse, type DockerPluginOptions, type FetchDeployStatusOptions, type HostingOptions, type HostingPlugin, type OrgArtifactSpec, type OrgProjectDeploy, type OrganizationHostingInput, type OrganizationHostingResult, PROJECT_DATABASE_ENV_KEYS, 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 WaitForHealthOptions, type WorkerRuntimeConfig, WorkerRuntimeConfigError, buildRuntimeEnv, canPingProjectTarget, defaultHostingPlugin, dockerPlugin, encodeOrgArtifacts, fetchDeployStatus, formatDockerEnv, parseOrgArtifactsFromEnv, pingProject, pingProjectTarget, projectDatabaseRuntimeEnv, resolvePlatformWorkerToken, resolveProjectServerImage, resolveRuntimeLaunch, resolveWorkerPlatformUrl, resolveWorkerRuntimeConfig, rewriteLoopbackHost, rewriteLoopbackUrl, waitForHealth };
|
|
183
221
|
//# sourceMappingURL=index.d.mts.map
|
package/dist/index.d.mts.map
CHANGED
|
@@ -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/wait-for-health.ts","../src/runtime-constants.ts","../src/ping-project.ts","../src/ping-project-target.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;;;
|
|
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/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,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AAY;AAAA,iBAQhC,kBAAA,CAAmB,GAAW;;iBAW9B,eAAA,CAAgB,GAA2B,EAAtB,MAAM;AAAA,iBAI3B,yBAAA,CACd,GAAA,GAAK,MAAA,CAAO,UAAwB,EACpC,QAAA;;;KCpNU,oBAAA;EACV,SAAA;EACA,UAAA;EACA,SAAA,UAAmB,KAAK;AAAA;AAAA,iBAGJ,aAAA,CACpB,OAAA,UACA,OAAA,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;AZZF;;;;AAAgC;AAAhC,iBYoBsB,iBAAA,CACpB,OAAA,UACA,OAAA,GAAS,wBAAA,GACR,OAAA,CAAQ,oBAAA"}
|
package/dist/index.mjs
CHANGED
|
@@ -10,6 +10,10 @@ const PROJECT_SERVER_HEALTH = {
|
|
|
10
10
|
path: "/health",
|
|
11
11
|
port: PROJECT_SERVER_PORT
|
|
12
12
|
};
|
|
13
|
+
const PROJECT_SERVER_DEPLOY_STATUS = {
|
|
14
|
+
path: "/deploy-status",
|
|
15
|
+
port: PROJECT_SERVER_PORT
|
|
16
|
+
};
|
|
13
17
|
//#endregion
|
|
14
18
|
//#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/core.js
|
|
15
19
|
var _a$1;
|
|
@@ -617,6 +621,7 @@ const string$1 = (params) => {
|
|
|
617
621
|
const integer = /^-?\d+$/;
|
|
618
622
|
const number$2 = /^-?\d+(?:\.\d+)?$/;
|
|
619
623
|
const boolean$1 = /^(?:true|false)$/i;
|
|
624
|
+
const _null$2 = /^null$/i;
|
|
620
625
|
const lowercase = /^[^A-Z]*$/;
|
|
621
626
|
const uppercase = /^[^a-z]*$/;
|
|
622
627
|
//#endregion
|
|
@@ -1429,6 +1434,22 @@ const $ZodBoolean = /* @__PURE__ */ $constructor("$ZodBoolean", (inst, def) => {
|
|
|
1429
1434
|
return payload;
|
|
1430
1435
|
};
|
|
1431
1436
|
});
|
|
1437
|
+
const $ZodNull = /* @__PURE__ */ $constructor("$ZodNull", (inst, def) => {
|
|
1438
|
+
$ZodType.init(inst, def);
|
|
1439
|
+
inst._zod.pattern = _null$2;
|
|
1440
|
+
inst._zod.values = new Set([null]);
|
|
1441
|
+
inst._zod.parse = (payload, _ctx) => {
|
|
1442
|
+
const input = payload.value;
|
|
1443
|
+
if (input === null) return payload;
|
|
1444
|
+
payload.issues.push({
|
|
1445
|
+
expected: "null",
|
|
1446
|
+
code: "invalid_type",
|
|
1447
|
+
input,
|
|
1448
|
+
inst
|
|
1449
|
+
});
|
|
1450
|
+
return payload;
|
|
1451
|
+
};
|
|
1452
|
+
});
|
|
1432
1453
|
const $ZodUnknown = /* @__PURE__ */ $constructor("$ZodUnknown", (inst, def) => {
|
|
1433
1454
|
$ZodType.init(inst, def);
|
|
1434
1455
|
inst._zod.parse = (payload) => payload;
|
|
@@ -2675,6 +2696,13 @@ function _boolean(Class, params) {
|
|
|
2675
2696
|
});
|
|
2676
2697
|
}
|
|
2677
2698
|
/* @__NO_SIDE_EFFECTS__ */
|
|
2699
|
+
function _null$1(Class, params) {
|
|
2700
|
+
return new Class({
|
|
2701
|
+
type: "null",
|
|
2702
|
+
...normalizeParams(params)
|
|
2703
|
+
});
|
|
2704
|
+
}
|
|
2705
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
2678
2706
|
function _unknown(Class) {
|
|
2679
2707
|
return new Class({ type: "unknown" });
|
|
2680
2708
|
}
|
|
@@ -3223,6 +3251,13 @@ const numberProcessor = (schema, ctx, _json, _params) => {
|
|
|
3223
3251
|
const booleanProcessor = (_schema, _ctx, json, _params) => {
|
|
3224
3252
|
json.type = "boolean";
|
|
3225
3253
|
};
|
|
3254
|
+
const nullProcessor = (_schema, ctx, json, _params) => {
|
|
3255
|
+
if (ctx.target === "openapi-3.0") {
|
|
3256
|
+
json.type = "string";
|
|
3257
|
+
json.nullable = true;
|
|
3258
|
+
json.enum = [null];
|
|
3259
|
+
} else json.type = "null";
|
|
3260
|
+
};
|
|
3226
3261
|
const neverProcessor = (_schema, _ctx, json, _params) => {
|
|
3227
3262
|
json.not = {};
|
|
3228
3263
|
};
|
|
@@ -3922,6 +3957,14 @@ const ZodBoolean = /* @__PURE__ */ $constructor("ZodBoolean", (inst, def) => {
|
|
|
3922
3957
|
function boolean(params) {
|
|
3923
3958
|
return /* @__PURE__ */ _boolean(ZodBoolean, params);
|
|
3924
3959
|
}
|
|
3960
|
+
const ZodNull = /* @__PURE__ */ $constructor("ZodNull", (inst, def) => {
|
|
3961
|
+
$ZodNull.init(inst, def);
|
|
3962
|
+
ZodType.init(inst, def);
|
|
3963
|
+
inst._zod.processJSONSchema = (ctx, json, params) => nullProcessor(inst, ctx, json, params);
|
|
3964
|
+
});
|
|
3965
|
+
function _null(params) {
|
|
3966
|
+
return /* @__PURE__ */ _null$1(ZodNull, params);
|
|
3967
|
+
}
|
|
3925
3968
|
const ZodUnknown = /* @__PURE__ */ $constructor("ZodUnknown", (inst, def) => {
|
|
3926
3969
|
$ZodUnknown.init(inst, def);
|
|
3927
3970
|
ZodType.init(inst, def);
|
|
@@ -5756,6 +5799,8 @@ const nullableOptionalTimestamp = string().nullable().optional();
|
|
|
5756
5799
|
object({
|
|
5757
5800
|
id: string().min(1),
|
|
5758
5801
|
appId: string().min(1),
|
|
5802
|
+
/** Stable per-scope identifier; pass to `--credential` to pin a specific instance. */
|
|
5803
|
+
slug: string().min(1),
|
|
5759
5804
|
label: string().min(1),
|
|
5760
5805
|
scope: AppCredentialScopeSchema,
|
|
5761
5806
|
lastRefreshedAt: string().nullable(),
|
|
@@ -5912,7 +5957,11 @@ object({
|
|
|
5912
5957
|
/** When set, platform MCP resolve checks credential assignments before scope defaults. */
|
|
5913
5958
|
assignmentTarget: McpCredentialAssignmentTargetSchema.optional(),
|
|
5914
5959
|
/** Tool/step consumer id for assignment lookup (action slug or workflow step correlation id). */
|
|
5915
|
-
consumerId: string().trim().min(1).optional()
|
|
5960
|
+
consumerId: string().trim().min(1).optional(),
|
|
5961
|
+
/** Explicit credential instance slug; overrides default resolution to pick that instance. */
|
|
5962
|
+
credentialSlug: string().trim().min(1).optional(),
|
|
5963
|
+
/** Project slug (CLI --project); the platform resolves it to a project and binds that scope. */
|
|
5964
|
+
projectSlug: string().trim().min(1).optional()
|
|
5916
5965
|
});
|
|
5917
5966
|
object({
|
|
5918
5967
|
error: _enum([
|
|
@@ -6913,6 +6962,14 @@ object({
|
|
|
6913
6962
|
uploadUrl: url(),
|
|
6914
6963
|
storageKey: string().min(1)
|
|
6915
6964
|
});
|
|
6965
|
+
function isValidIanaTimezone(value) {
|
|
6966
|
+
try {
|
|
6967
|
+
Intl.DateTimeFormat(void 0, { timeZone: value });
|
|
6968
|
+
return true;
|
|
6969
|
+
} catch {
|
|
6970
|
+
return false;
|
|
6971
|
+
}
|
|
6972
|
+
}
|
|
6916
6973
|
const UserInterfaceThemeSchema = _enum([
|
|
6917
6974
|
"system",
|
|
6918
6975
|
"light",
|
|
@@ -6932,22 +6989,25 @@ const UserWorkspaceFavoriteSchema = object({
|
|
|
6932
6989
|
]),
|
|
6933
6990
|
resourceId: string().min(1)
|
|
6934
6991
|
});
|
|
6992
|
+
const UserSidebarPreferencesSchema = object({
|
|
6993
|
+
navIconVisibility: UserSidebarNavIconVisibilitySchema,
|
|
6994
|
+
footerChatRowVisibility: UserSidebarFooterChatRowVisibilitySchema,
|
|
6995
|
+
hiddenNavItemIds: array(string()),
|
|
6996
|
+
topNavItemOrderIds: array(string()),
|
|
6997
|
+
workspaceNavItemOrderIds: array(string())
|
|
6998
|
+
});
|
|
6999
|
+
const UserTimezoneSchema = string().refine(isValidIanaTimezone, { message: "Invalid IANA timezone" });
|
|
6935
7000
|
object({
|
|
6936
7001
|
interfaceTheme: UserInterfaceThemeSchema,
|
|
6937
7002
|
surfaceContrast: UserSurfaceContrastSchema,
|
|
6938
7003
|
layoutMode: UserWorkspaceLayoutModeSchema,
|
|
6939
7004
|
fontSize: UserWorkspaceFontSizeSchema,
|
|
6940
|
-
sidebar:
|
|
6941
|
-
navIconVisibility: UserSidebarNavIconVisibilitySchema,
|
|
6942
|
-
footerChatRowVisibility: UserSidebarFooterChatRowVisibilitySchema,
|
|
6943
|
-
hiddenNavItemIds: array(string()),
|
|
6944
|
-
topNavItemOrderIds: array(string()),
|
|
6945
|
-
workspaceNavItemOrderIds: array(string())
|
|
6946
|
-
}),
|
|
7005
|
+
sidebar: UserSidebarPreferencesSchema,
|
|
6947
7006
|
favorites: array(UserWorkspaceFavoriteSchema),
|
|
6948
7007
|
projectOrderIds: array(string()),
|
|
6949
7008
|
projectDotColors: record(string(), string()),
|
|
6950
|
-
onboardingTabVisible: boolean()
|
|
7009
|
+
onboardingTabVisible: boolean(),
|
|
7010
|
+
timezone: union([UserTimezoneSchema, _null()])
|
|
6951
7011
|
});
|
|
6952
7012
|
const UserSidebarPreferencesPatchSchema = object({
|
|
6953
7013
|
navIconVisibility: UserSidebarNavIconVisibilitySchema.optional(),
|
|
@@ -6965,8 +7025,9 @@ object({
|
|
|
6965
7025
|
favorites: array(UserWorkspaceFavoriteSchema).optional(),
|
|
6966
7026
|
projectOrderIds: array(string()).optional(),
|
|
6967
7027
|
projectDotColors: record(string(), string()).optional(),
|
|
6968
|
-
onboardingTabVisible: boolean().optional()
|
|
6969
|
-
|
|
7028
|
+
onboardingTabVisible: boolean().optional(),
|
|
7029
|
+
timezone: union([UserTimezoneSchema, _null()]).optional()
|
|
7030
|
+
}).refine((value) => value.interfaceTheme !== void 0 || value.surfaceContrast !== void 0 || value.layoutMode !== void 0 || value.fontSize !== void 0 || value.sidebar !== void 0 || value.favorites !== void 0 || value.projectOrderIds !== void 0 || value.projectDotColors !== void 0 || value.onboardingTabVisible !== void 0 || value.timezone !== void 0, { message: "At least one preference field is required" });
|
|
6970
7031
|
const OrganizationLogoVariantSchema = _enum(["light", "dark"]);
|
|
6971
7032
|
object({
|
|
6972
7033
|
customLogoEnabled: boolean(),
|
|
@@ -7595,55 +7656,63 @@ function sleep(ms) {
|
|
|
7595
7656
|
const MINIO_DOCKER_NETWORK = process.env.MINIO_DOCKER_NETWORK ?? "keystroke";
|
|
7596
7657
|
function createDockerRuntime(options = {}) {
|
|
7597
7658
|
const docker = options.docker ?? new Docker();
|
|
7598
|
-
return {
|
|
7599
|
-
|
|
7600
|
-
|
|
7601
|
-
|
|
7602
|
-
|
|
7603
|
-
|
|
7604
|
-
|
|
7605
|
-
|
|
7606
|
-
|
|
7607
|
-
|
|
7608
|
-
|
|
7609
|
-
|
|
7610
|
-
|
|
7611
|
-
|
|
7612
|
-
|
|
7659
|
+
return {
|
|
7660
|
+
async start(input) {
|
|
7661
|
+
if (input.projects.length === 0) throw new Error("Docker org runtime requires at least one project deploy");
|
|
7662
|
+
let launch = resolveRuntimeLaunch(options, input.projects.map((project) => ({
|
|
7663
|
+
projectId: project.projectId,
|
|
7664
|
+
artifactStorageKey: project.artifactStorageKey
|
|
7665
|
+
})), input.database, input.env);
|
|
7666
|
+
if (options.workspacesMount) {
|
|
7667
|
+
const { hostPath, containerPath } = options.workspacesMount;
|
|
7668
|
+
await mkdir(hostPath, { recursive: true });
|
|
7669
|
+
launch = {
|
|
7670
|
+
...launch,
|
|
7671
|
+
env: {
|
|
7672
|
+
...launch.env,
|
|
7673
|
+
KEYSTROKE_WORKSPACES_ROOT: containerPath
|
|
7674
|
+
}
|
|
7675
|
+
};
|
|
7676
|
+
}
|
|
7677
|
+
await ensureImage(docker, launch.image);
|
|
7678
|
+
await removeExistingContainer(docker, input.organizationId);
|
|
7679
|
+
const binds = [...options.workspacesMount ? [`${options.workspacesMount.hostPath}:${options.workspacesMount.containerPath}`] : [], ...options.extraBinds ?? []];
|
|
7680
|
+
const container = await docker.createContainer({
|
|
7681
|
+
Image: launch.image,
|
|
7682
|
+
name: containerName(input.organizationId),
|
|
7683
|
+
Labels: {
|
|
7684
|
+
"keystroke.organization.id": input.organizationId,
|
|
7685
|
+
"keystroke.project.ids": input.projects.map((project) => project.projectId).join(",")
|
|
7686
|
+
},
|
|
7687
|
+
ExposedPorts: { [`${launch.port}/tcp`]: {} },
|
|
7688
|
+
HostConfig: {
|
|
7689
|
+
ExtraHosts: ["host.docker.internal:host-gateway"],
|
|
7690
|
+
PortBindings: { [`${launch.port}/tcp`]: [{ HostPort: "0" }] },
|
|
7691
|
+
...binds.length > 0 ? { Binds: binds } : {}
|
|
7692
|
+
},
|
|
7693
|
+
NetworkingConfig: { EndpointsConfig: { [MINIO_DOCKER_NETWORK]: {} } },
|
|
7694
|
+
Env: formatDockerEnv(launch.env)
|
|
7695
|
+
});
|
|
7696
|
+
await container.start();
|
|
7697
|
+
const inspect = await container.inspect();
|
|
7698
|
+
const binding = inspect.NetworkSettings.Ports?.[`${launch.port}/tcp`]?.[0];
|
|
7699
|
+
if (!binding?.HostPort) throw new Error("Failed to resolve org container host port");
|
|
7700
|
+
const baseUrl = `http://127.0.0.1:${binding.HostPort}`;
|
|
7701
|
+
await waitForHealth(baseUrl, {
|
|
7702
|
+
fetchImpl: options.fetchImpl,
|
|
7703
|
+
timeoutMs: options.healthTimeoutMs
|
|
7704
|
+
});
|
|
7705
|
+
return {
|
|
7706
|
+
runtimeId: inspect.Id,
|
|
7707
|
+
baseUrl
|
|
7613
7708
|
};
|
|
7709
|
+
},
|
|
7710
|
+
async destroy(input) {
|
|
7711
|
+
try {
|
|
7712
|
+
await docker.getContainer(input.runtimeId).remove({ force: true });
|
|
7713
|
+
} catch {}
|
|
7614
7714
|
}
|
|
7615
|
-
|
|
7616
|
-
await removeExistingContainer(docker, input.organizationId);
|
|
7617
|
-
const container = await docker.createContainer({
|
|
7618
|
-
Image: launch.image,
|
|
7619
|
-
name: containerName(input.organizationId),
|
|
7620
|
-
Labels: {
|
|
7621
|
-
"keystroke.organization.id": input.organizationId,
|
|
7622
|
-
"keystroke.project.ids": input.projects.map((project) => project.projectId).join(",")
|
|
7623
|
-
},
|
|
7624
|
-
ExposedPorts: { [`${launch.port}/tcp`]: {} },
|
|
7625
|
-
HostConfig: {
|
|
7626
|
-
ExtraHosts: ["host.docker.internal:host-gateway"],
|
|
7627
|
-
PortBindings: { [`${launch.port}/tcp`]: [{ HostPort: "0" }] },
|
|
7628
|
-
...options.workspacesMount ? { Binds: [`${options.workspacesMount.hostPath}:${options.workspacesMount.containerPath}`] } : {}
|
|
7629
|
-
},
|
|
7630
|
-
NetworkingConfig: { EndpointsConfig: { [MINIO_DOCKER_NETWORK]: {} } },
|
|
7631
|
-
Env: formatDockerEnv(launch.env)
|
|
7632
|
-
});
|
|
7633
|
-
await container.start();
|
|
7634
|
-
const inspect = await container.inspect();
|
|
7635
|
-
const binding = inspect.NetworkSettings.Ports?.[`${launch.port}/tcp`]?.[0];
|
|
7636
|
-
if (!binding?.HostPort) throw new Error("Failed to resolve org container host port");
|
|
7637
|
-
const baseUrl = `http://127.0.0.1:${binding.HostPort}`;
|
|
7638
|
-
await waitForHealth(baseUrl, {
|
|
7639
|
-
fetchImpl: options.fetchImpl,
|
|
7640
|
-
timeoutMs: options.healthTimeoutMs
|
|
7641
|
-
});
|
|
7642
|
-
return {
|
|
7643
|
-
runtimeId: inspect.Id,
|
|
7644
|
-
baseUrl
|
|
7645
|
-
};
|
|
7646
|
-
} };
|
|
7715
|
+
};
|
|
7647
7716
|
}
|
|
7648
7717
|
function containerName(organizationId) {
|
|
7649
7718
|
return `keystroke-org-${organizationId}`;
|
|
@@ -7731,6 +7800,26 @@ async function pingProjectTarget(target, options = {}) {
|
|
|
7731
7800
|
});
|
|
7732
7801
|
}
|
|
7733
7802
|
//#endregion
|
|
7734
|
-
|
|
7803
|
+
//#region src/deploy-status.ts
|
|
7804
|
+
/**
|
|
7805
|
+
* Ask a running org machine which projects bootstrapped and which failed.
|
|
7806
|
+
* Best-effort: returns undefined on any error so callers can fall back to
|
|
7807
|
+
* treating every project as healthy (preserving pre-existing behavior).
|
|
7808
|
+
*/
|
|
7809
|
+
async function fetchDeployStatus(baseUrl, options = {}) {
|
|
7810
|
+
const timeoutMs = options.timeoutMs ?? 15e3;
|
|
7811
|
+
try {
|
|
7812
|
+
const response = await (options.fetchImpl ?? fetch)(new URL(PROJECT_SERVER_DEPLOY_STATUS.path, baseUrl), { signal: AbortSignal.timeout(timeoutMs) });
|
|
7813
|
+
if (!response.ok) return;
|
|
7814
|
+
const data = await response.json();
|
|
7815
|
+
if (!data || !Array.isArray(data.projects)) return;
|
|
7816
|
+
return data;
|
|
7817
|
+
} catch (error) {
|
|
7818
|
+
console.warn(`[deploy-status] failed to fetch from ${baseUrl}:`, error);
|
|
7819
|
+
return;
|
|
7820
|
+
}
|
|
7821
|
+
}
|
|
7822
|
+
//#endregion
|
|
7823
|
+
export { DEV_PLATFORM_WORKER_TOKEN, PROJECT_DATABASE_ENV_KEYS, 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, RUNTIME_PING_TIMEOUT_MS, WorkerRuntimeConfigError, buildRuntimeEnv, canPingProjectTarget, defaultHostingPlugin, dockerPlugin, encodeOrgArtifacts, fetchDeployStatus, formatDockerEnv, parseOrgArtifactsFromEnv, pingProject, pingProjectTarget, projectDatabaseRuntimeEnv, resolvePlatformWorkerToken, resolveProjectServerImage, resolveRuntimeLaunch, resolveWorkerPlatformUrl, resolveWorkerRuntimeConfig, rewriteLoopbackHost, rewriteLoopbackUrl, waitForHealth };
|
|
7735
7824
|
|
|
7736
7825
|
//# sourceMappingURL=index.mjs.map
|