@keystrokehq/hosting 0.1.7 → 0.1.9
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 +577 -37
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +26 -1
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +26 -1
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +576 -38
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -4
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;
|
|
@@ -2275,6 +2279,21 @@ function handleReadonlyResult(payload) {
|
|
|
2275
2279
|
payload.value = Object.freeze(payload.value);
|
|
2276
2280
|
return payload;
|
|
2277
2281
|
}
|
|
2282
|
+
const $ZodLazy = /* @__PURE__ */ $constructor("$ZodLazy", (inst, def) => {
|
|
2283
|
+
$ZodType.init(inst, def);
|
|
2284
|
+
defineLazy(inst._zod, "innerType", () => {
|
|
2285
|
+
const d = def;
|
|
2286
|
+
if (!d._cachedInner) d._cachedInner = def.getter();
|
|
2287
|
+
return d._cachedInner;
|
|
2288
|
+
});
|
|
2289
|
+
defineLazy(inst._zod, "pattern", () => inst._zod.innerType?._zod?.pattern);
|
|
2290
|
+
defineLazy(inst._zod, "propValues", () => inst._zod.innerType?._zod?.propValues);
|
|
2291
|
+
defineLazy(inst._zod, "optin", () => inst._zod.innerType?._zod?.optin ?? void 0);
|
|
2292
|
+
defineLazy(inst._zod, "optout", () => inst._zod.innerType?._zod?.optout ?? void 0);
|
|
2293
|
+
inst._zod.parse = (payload, ctx) => {
|
|
2294
|
+
return inst._zod.innerType._zod.run(payload, ctx);
|
|
2295
|
+
};
|
|
2296
|
+
});
|
|
2278
2297
|
const $ZodCustom = /* @__PURE__ */ $constructor("$ZodCustom", (inst, def) => {
|
|
2279
2298
|
$ZodCheck.init(inst, def);
|
|
2280
2299
|
$ZodType.init(inst, def);
|
|
@@ -3417,6 +3436,12 @@ const optionalProcessor = (schema, ctx, _json, params) => {
|
|
|
3417
3436
|
const seen = ctx.seen.get(schema);
|
|
3418
3437
|
seen.ref = def.innerType;
|
|
3419
3438
|
};
|
|
3439
|
+
const lazyProcessor = (schema, ctx, _json, params) => {
|
|
3440
|
+
const innerType = schema._zod.innerType;
|
|
3441
|
+
process$1(innerType, ctx, params);
|
|
3442
|
+
const seen = ctx.seen.get(schema);
|
|
3443
|
+
seen.ref = innerType;
|
|
3444
|
+
};
|
|
3420
3445
|
//#endregion
|
|
3421
3446
|
//#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/classic/iso.js
|
|
3422
3447
|
const ZodISODateTime = /* @__PURE__ */ $constructor("ZodISODateTime", (inst, def) => {
|
|
@@ -4280,6 +4305,18 @@ function readonly(innerType) {
|
|
|
4280
4305
|
innerType
|
|
4281
4306
|
});
|
|
4282
4307
|
}
|
|
4308
|
+
const ZodLazy = /* @__PURE__ */ $constructor("ZodLazy", (inst, def) => {
|
|
4309
|
+
$ZodLazy.init(inst, def);
|
|
4310
|
+
ZodType.init(inst, def);
|
|
4311
|
+
inst._zod.processJSONSchema = (ctx, json, params) => lazyProcessor(inst, ctx, json, params);
|
|
4312
|
+
inst.unwrap = () => inst._zod.def.getter();
|
|
4313
|
+
});
|
|
4314
|
+
function lazy(getter) {
|
|
4315
|
+
return new ZodLazy({
|
|
4316
|
+
type: "lazy",
|
|
4317
|
+
getter
|
|
4318
|
+
});
|
|
4319
|
+
}
|
|
4283
4320
|
const ZodCustom = /* @__PURE__ */ $constructor("ZodCustom", (inst, def) => {
|
|
4284
4321
|
$ZodCustom.init(inst, def);
|
|
4285
4322
|
ZodType.init(inst, def);
|
|
@@ -4955,10 +4992,244 @@ const AppSlugSchema = ProjectSlugSchema;
|
|
|
4955
4992
|
function resolveExplicitPublicPlatformOrigin(env = process.env) {
|
|
4956
4993
|
return env.PUBLIC_PLATFORM_URL?.replace(/\/$/, "") || void 0;
|
|
4957
4994
|
}
|
|
4995
|
+
/** How a credential instance is stored (`credential_instances.auth_kind`). */
|
|
4996
|
+
const CredentialAuthKindSchema = _enum([
|
|
4997
|
+
"api_key",
|
|
4998
|
+
"oauth_managed",
|
|
4999
|
+
"keystroke"
|
|
5000
|
+
]);
|
|
5001
|
+
/**
|
|
5002
|
+
* Where a credential instance is stored (`credential_instances.scope_type`), and the only thing an
|
|
5003
|
+
* action/tool can pin via `.scope(...)`. There is no resolution chain: when no scope is pinned, the
|
|
5004
|
+
* resolver tries the project default, then the org default, then throws.
|
|
5005
|
+
*/
|
|
5006
|
+
const CredentialScopeTypeSchema = _enum([
|
|
5007
|
+
"organization",
|
|
5008
|
+
"project",
|
|
5009
|
+
"user"
|
|
5010
|
+
]);
|
|
5011
|
+
CredentialAuthKindSchema.options;
|
|
5012
|
+
CredentialScopeTypeSchema.options;
|
|
5013
|
+
/** Non-empty human-readable label or description (trimmed). */
|
|
5014
|
+
const requiredDisplayTextSchema = string().trim().min(1);
|
|
5015
|
+
/**
|
|
5016
|
+
* Structural workflow-canvas graph contract.
|
|
5017
|
+
*
|
|
5018
|
+
* This is the deterministic skeleton the deploy-time AST producer emits for a
|
|
5019
|
+
* workflow (nodes + edges), plus the manifest-derived trigger-source nodes. It
|
|
5020
|
+
* is the single source of truth shared by:
|
|
5021
|
+
* - the AST producer (emits it at deploy, stored with the manifest),
|
|
5022
|
+
* - the platform route that serves the canvas, and
|
|
5023
|
+
* - the SDK / web client that renders it (React Flow).
|
|
5024
|
+
*
|
|
5025
|
+
* Only the structural skeleton lives here. The LLM enrichment + run-overlay
|
|
5026
|
+
* envelope types live in `workflow-canvas-envelope.ts`; the SDK re-exports them.
|
|
5027
|
+
* See WORKFLOW.md (§4 grammar, §8 node ids, §9 caching).
|
|
5028
|
+
*/
|
|
5029
|
+
/**
|
|
5030
|
+
* Canvas node taxonomy — the single discriminator for every canvas node. The
|
|
5031
|
+
* client derives the React Flow component, icon, and per-node treatment from it
|
|
5032
|
+
* (no parallel `type` / `data.kind` fields), and the producer + fixtures emit it
|
|
5033
|
+
* directly, so the structural contract can never silently diverge across the
|
|
5034
|
+
* deploy → render boundary.
|
|
5035
|
+
* - Boundaries: `entry` (Start, owns input) · `exit` (Output, owns output) ·
|
|
5036
|
+
* `error` (a terminal `throw` — an error output that ends the run on a branch)
|
|
5037
|
+
* - Callable: `step` (action / agent / llm / hook / child-workflow invocation) —
|
|
5038
|
+
* the invocation flavor lives in {@link WorkflowCanvasCallKind}
|
|
5039
|
+
* - Structural control flow: `code-block` · `decision` · `merge` · `loop` ·
|
|
5040
|
+
* `parallel` (group containers) · `loop-start` (the group body's entry marker,
|
|
5041
|
+
* shared by loop + parallel)
|
|
5042
|
+
* - Upstream of entry: `trigger-source` (one per manifest trigger attachment)
|
|
5043
|
+
*
|
|
5044
|
+
* `Promise.all([...])` is modeled as a `parallel` group container: the branches
|
|
5045
|
+
* are stacked inside and the container itself is the single prong leaving the
|
|
5046
|
+
* wrapper (there is no separate fork/join pair).
|
|
5047
|
+
*
|
|
5048
|
+
* `exit` and `error` are both terminals: a `return` flows to the shared `exit`
|
|
5049
|
+
* (the workflow output), while a `throw` gets its own `error` terminal off the
|
|
5050
|
+
* branch so guard clauses (`if (bad) throw …`) read as a visible dead-end.
|
|
5051
|
+
*/
|
|
5052
|
+
const WorkflowCanvasNodeTypeSchema = _enum([
|
|
5053
|
+
"entry",
|
|
5054
|
+
"exit",
|
|
5055
|
+
"error",
|
|
5056
|
+
"step",
|
|
5057
|
+
"code-block",
|
|
5058
|
+
"decision",
|
|
5059
|
+
"merge",
|
|
5060
|
+
"loop",
|
|
5061
|
+
"parallel",
|
|
5062
|
+
"loop-start",
|
|
5063
|
+
"trigger-source"
|
|
5064
|
+
]);
|
|
5065
|
+
_enum([
|
|
5066
|
+
"workflow-step",
|
|
5067
|
+
"agent",
|
|
5068
|
+
"llm",
|
|
5069
|
+
"wait",
|
|
5070
|
+
"hook",
|
|
5071
|
+
"tool",
|
|
5072
|
+
"child-workflow"
|
|
5073
|
+
]);
|
|
5074
|
+
/** A labeled branch output on a decision-style node. */
|
|
5075
|
+
const WorkflowCanvasNodeOutputSchema = object({
|
|
5076
|
+
id: string(),
|
|
5077
|
+
label: string()
|
|
5078
|
+
});
|
|
5079
|
+
/**
|
|
5080
|
+
* A step input's configured value at its call site, captured deterministically
|
|
5081
|
+
* by the producer from the call's argument object. The platform join turns this
|
|
5082
|
+
* into the inspector's {@link WorkflowNodeInputBinding} (filling display labels).
|
|
5083
|
+
*/
|
|
5084
|
+
const WorkflowCanvasRawBindingSchema = object({
|
|
5085
|
+
tokens: array(discriminatedUnion("kind", [
|
|
5086
|
+
object({
|
|
5087
|
+
kind: literal("text"),
|
|
5088
|
+
text: string()
|
|
5089
|
+
}),
|
|
5090
|
+
object({
|
|
5091
|
+
kind: literal("reference"),
|
|
5092
|
+
/** Upstream node id this value flows from; absent only for unresolved refs. */
|
|
5093
|
+
sourceNodeId: string().optional(),
|
|
5094
|
+
/** Output field of the source (dotted path); omitted = the whole output. */
|
|
5095
|
+
field: string().optional()
|
|
5096
|
+
}),
|
|
5097
|
+
object({
|
|
5098
|
+
kind: literal("variable"),
|
|
5099
|
+
text: string()
|
|
5100
|
+
}),
|
|
5101
|
+
object({
|
|
5102
|
+
kind: literal("call"),
|
|
5103
|
+
name: string()
|
|
5104
|
+
})
|
|
5105
|
+
])),
|
|
5106
|
+
/** Render as a tall multi-line box (object/array/multiline template values). */
|
|
5107
|
+
multiline: boolean().optional()
|
|
5108
|
+
});
|
|
5109
|
+
/**
|
|
5110
|
+
* Statically-captured `promptLlm` options for an `llm` step node. Literal-only:
|
|
5111
|
+
* dynamic/expression values (a computed model, a `system` built by a function) are
|
|
5112
|
+
* not captured; `system`/`outputSchema` record presence so the inspector can note
|
|
5113
|
+
* "a system prompt is configured" / "structured output" without their values.
|
|
5114
|
+
*/
|
|
5115
|
+
const WorkflowCanvasLlmOptionsSchema = object({
|
|
5116
|
+
model: string().optional(),
|
|
5117
|
+
maxTokens: number$1().optional(),
|
|
5118
|
+
temperature: number$1().optional(),
|
|
5119
|
+
thinkingLevel: string().optional(),
|
|
5120
|
+
hasSystemPrompt: boolean().optional(),
|
|
5121
|
+
hasOutputSchema: boolean().optional()
|
|
5122
|
+
});
|
|
5123
|
+
const WorkflowCanvasNodeDataSchema = object({
|
|
5124
|
+
label: string(),
|
|
5125
|
+
/** Set on group nodes (loop / parallel section containers). */
|
|
5126
|
+
groupKind: _enum([
|
|
5127
|
+
"loop",
|
|
5128
|
+
"parallel",
|
|
5129
|
+
"conditional"
|
|
5130
|
+
]).optional(),
|
|
5131
|
+
description: string().optional(),
|
|
5132
|
+
/** {@link WorkflowCanvasCallKind} or a looser raw call-site label. */
|
|
5133
|
+
callKind: string().optional(),
|
|
5134
|
+
/**
|
|
5135
|
+
* App/integration slug for a `step` whose action/agent is imported directly
|
|
5136
|
+
* from a `@keystrokehq/<app>` package (e.g. "slack", "apollo"). Lets the client
|
|
5137
|
+
* badge the node with that app's logo; absent for custom (project-local)
|
|
5138
|
+
* actions, which fall back to the call-kind icon.
|
|
5139
|
+
*/
|
|
5140
|
+
appSlug: string().optional(),
|
|
5141
|
+
/** Cron/webhook/poll discriminator on trigger-source nodes. */
|
|
5142
|
+
triggerType: string().optional(),
|
|
5143
|
+
/** Branch outputs (decision nodes). */
|
|
5144
|
+
outputs: array(WorkflowCanvasNodeOutputSchema).optional(),
|
|
5145
|
+
/**
|
|
5146
|
+
* Action/agent/workflow slug resolved at deploy time (via import → definition).
|
|
5147
|
+
* Optional when the deploy build cannot resolve source (dist-only artifacts).
|
|
5148
|
+
*/
|
|
5149
|
+
slug: string().optional(),
|
|
5150
|
+
/**
|
|
5151
|
+
* Durable call-site ids nested inside an off-grammar `code-block` (same-file only).
|
|
5152
|
+
* Used by the run overlay to light the block when any contained step executes.
|
|
5153
|
+
*/
|
|
5154
|
+
containedCallSiteIds: array(string()).optional(),
|
|
5155
|
+
/**
|
|
5156
|
+
* Per-input call-site value bindings for `step` nodes, keyed by input field name.
|
|
5157
|
+
* Deterministically captured from the call's argument object; reference tokens point
|
|
5158
|
+
* at the upstream node that produced the value. The platform join fills display labels.
|
|
5159
|
+
*/
|
|
5160
|
+
inputBindings: record(string(), WorkflowCanvasRawBindingSchema).optional(),
|
|
5161
|
+
/**
|
|
5162
|
+
* Static `promptLlm(prompt, options)` configuration captured at the call site for
|
|
5163
|
+
* `llm` step nodes. Only literal values are captured (model/maxTokens/temperature/
|
|
5164
|
+
* thinkingLevel); `system`/`outputSchema` are usually expressions, so only their
|
|
5165
|
+
* presence is recorded. Absent when no options are statically resolvable.
|
|
5166
|
+
*/
|
|
5167
|
+
llmOptions: WorkflowCanvasLlmOptionsSchema.optional()
|
|
5168
|
+
});
|
|
5169
|
+
/**
|
|
5170
|
+
* A single structural node. This is the deploy artifact's shape: identity
|
|
5171
|
+
* (`id`), the canonical discriminator (`nodeType`), display `data`, and group
|
|
5172
|
+
* nesting (`parentId`). All layout/rendering — React Flow component key,
|
|
5173
|
+
* positions, sizes, `extent`, group box dimensions — is derived entirely
|
|
5174
|
+
* client-side from this structure, so it never leaks into the wire contract.
|
|
5175
|
+
*/
|
|
5176
|
+
const WorkflowCanvasGraphNodeSchema = object({
|
|
5177
|
+
id: string(),
|
|
5178
|
+
nodeType: WorkflowCanvasNodeTypeSchema,
|
|
5179
|
+
data: WorkflowCanvasNodeDataSchema,
|
|
5180
|
+
/** Set on children nested inside a group (loop / parallel) container. */
|
|
5181
|
+
parentId: string().optional()
|
|
5182
|
+
});
|
|
5183
|
+
const WorkflowCanvasEdgeSchema = object({
|
|
5184
|
+
id: string(),
|
|
5185
|
+
source: string(),
|
|
5186
|
+
target: string(),
|
|
5187
|
+
type: string().optional(),
|
|
5188
|
+
label: string().optional(),
|
|
5189
|
+
sourceHandle: string().optional(),
|
|
5190
|
+
targetHandle: string().optional(),
|
|
5191
|
+
data: object({ branchKind: _enum([
|
|
5192
|
+
"then",
|
|
5193
|
+
"else",
|
|
5194
|
+
"parallel-branch",
|
|
5195
|
+
"error"
|
|
5196
|
+
]).optional() }).optional()
|
|
5197
|
+
});
|
|
5198
|
+
/** A statically-evaluable top-level `const` value (literal scalars only). */
|
|
5199
|
+
const WorkflowCanvasConstantValueSchema = union([
|
|
5200
|
+
string(),
|
|
5201
|
+
number$1(),
|
|
5202
|
+
boolean()
|
|
5203
|
+
]);
|
|
5204
|
+
/**
|
|
5205
|
+
* Top-level `const NAME = <literal>` declarations in the workflow source, captured
|
|
5206
|
+
* at deploy. Lets the platform resolve `variable` value tokens (e.g. a `model` set
|
|
5207
|
+
* to a named const) to their concrete value for display. Scalars only — computed,
|
|
5208
|
+
* function-local, or non-literal consts are intentionally omitted.
|
|
5209
|
+
*/
|
|
5210
|
+
const WorkflowCanvasConstantsSchema = record(string(), WorkflowCanvasConstantValueSchema);
|
|
5211
|
+
const WorkflowCanvasGraphSchema = object({
|
|
5212
|
+
nodes: array(WorkflowCanvasGraphNodeSchema),
|
|
5213
|
+
edges: array(WorkflowCanvasEdgeSchema),
|
|
5214
|
+
/** Top-level literal constants from the workflow source (for value-token resolution). */
|
|
5215
|
+
constants: WorkflowCanvasConstantsSchema.optional()
|
|
5216
|
+
});
|
|
5217
|
+
/**
|
|
5218
|
+
* Deploy-time summary of one credential a step requires, derived from the
|
|
5219
|
+
* action/agent-tool definition's `.credentials`. The workflow-canvas credential
|
|
5220
|
+
* overlay joins a step node's `slug` to these to resolve the bound instance.
|
|
5221
|
+
* `key` doubles as the app slug (matches `credential_instances.app_slug`).
|
|
5222
|
+
*/
|
|
5223
|
+
const CredentialRequirementSummarySchema = object({
|
|
5224
|
+
key: string(),
|
|
5225
|
+
kind: CredentialAuthKindSchema,
|
|
5226
|
+
/** Scope pinned via `.scope(...)`; absent means project-default → org-default. */
|
|
5227
|
+
scope: CredentialScopeTypeSchema.optional()
|
|
5228
|
+
});
|
|
4958
5229
|
const StoredRouteManifestSkillSchema = object({
|
|
4959
5230
|
slug: string(),
|
|
4960
|
-
name:
|
|
4961
|
-
description:
|
|
5231
|
+
name: requiredDisplayTextSchema,
|
|
5232
|
+
description: requiredDisplayTextSchema,
|
|
4962
5233
|
moduleFile: string()
|
|
4963
5234
|
});
|
|
4964
5235
|
const attachmentSchemasSchema = record(string(), object({
|
|
@@ -4966,8 +5237,8 @@ const attachmentSchemasSchema = record(string(), object({
|
|
|
4966
5237
|
filterSchema: record(string(), unknown()).optional()
|
|
4967
5238
|
}));
|
|
4968
5239
|
const attachmentMetaSchema = record(string(), object({
|
|
4969
|
-
name:
|
|
4970
|
-
description:
|
|
5240
|
+
name: requiredDisplayTextSchema,
|
|
5241
|
+
description: requiredDisplayTextSchema
|
|
4971
5242
|
}));
|
|
4972
5243
|
const storedRouteManifestEntryV2Schema = discriminatedUnion("kind", [
|
|
4973
5244
|
object({ kind: literal("health") }),
|
|
@@ -4975,23 +5246,43 @@ const storedRouteManifestEntryV2Schema = discriminatedUnion("kind", [
|
|
|
4975
5246
|
kind: literal("agent"),
|
|
4976
5247
|
slug: string(),
|
|
4977
5248
|
moduleFile: string(),
|
|
4978
|
-
name:
|
|
4979
|
-
description:
|
|
5249
|
+
name: requiredDisplayTextSchema,
|
|
5250
|
+
description: requiredDisplayTextSchema,
|
|
4980
5251
|
model: string(),
|
|
4981
5252
|
systemPrompt: string(),
|
|
4982
5253
|
toolCount: number$1().int().nonnegative(),
|
|
4983
5254
|
credentialCount: number$1().int().nonnegative(),
|
|
4984
5255
|
appSlugs: array(string()).default([]),
|
|
4985
|
-
toolSlugs: array(string()).default([])
|
|
5256
|
+
toolSlugs: array(string()).default([]),
|
|
5257
|
+
/** Credential requirements per tool slug (the agent's credential consumer key). */
|
|
5258
|
+
toolRequirements: record(string(), array(CredentialRequirementSummarySchema)).optional()
|
|
5259
|
+
}),
|
|
5260
|
+
object({
|
|
5261
|
+
kind: literal("action"),
|
|
5262
|
+
slug: string(),
|
|
5263
|
+
name: requiredDisplayTextSchema,
|
|
5264
|
+
description: requiredDisplayTextSchema,
|
|
5265
|
+
moduleFile: string(),
|
|
5266
|
+
/** App slug for actions imported from an integration package (`@keystrokehq/<app>/actions`). */
|
|
5267
|
+
appSlug: string().optional(),
|
|
5268
|
+
inputSchema: record(string(), unknown()),
|
|
5269
|
+
outputSchema: record(string(), unknown()),
|
|
5270
|
+
/** Credentials this action requires (for the canvas credential overlay). */
|
|
5271
|
+
requirements: array(CredentialRequirementSummarySchema).optional()
|
|
4986
5272
|
}),
|
|
4987
5273
|
object({
|
|
4988
5274
|
kind: literal("workflow"),
|
|
4989
5275
|
slug: string(),
|
|
4990
|
-
name:
|
|
4991
|
-
description:
|
|
5276
|
+
name: requiredDisplayTextSchema,
|
|
5277
|
+
description: requiredDisplayTextSchema,
|
|
4992
5278
|
subscribable: boolean(),
|
|
4993
5279
|
moduleFile: string(),
|
|
4994
|
-
requestSchema: record(string(), unknown())
|
|
5280
|
+
requestSchema: record(string(), unknown()),
|
|
5281
|
+
responseSchema: record(string(), unknown()).optional(),
|
|
5282
|
+
/** Deterministic AST control-flow skeleton (deploy-time producer). */
|
|
5283
|
+
flowGraph: WorkflowCanvasGraphSchema.optional(),
|
|
5284
|
+
/** sha256 of the workflow source the `flowGraph` was produced from (staleness). */
|
|
5285
|
+
flowGraphSourceHash: string().optional()
|
|
4995
5286
|
}),
|
|
4996
5287
|
object({
|
|
4997
5288
|
kind: literal("trigger-webhook"),
|
|
@@ -5010,8 +5301,8 @@ const storedRouteManifestEntryV2Schema = discriminatedUnion("kind", [
|
|
|
5010
5301
|
moduleFile: string(),
|
|
5011
5302
|
sourceHash: string().optional(),
|
|
5012
5303
|
schedule: string(),
|
|
5013
|
-
name:
|
|
5014
|
-
description:
|
|
5304
|
+
name: requiredDisplayTextSchema,
|
|
5305
|
+
description: requiredDisplayTextSchema
|
|
5015
5306
|
}),
|
|
5016
5307
|
object({
|
|
5017
5308
|
kind: literal("trigger-poll-group"),
|
|
@@ -5027,8 +5318,8 @@ const storedRouteManifestEntryV2Schema = discriminatedUnion("kind", [
|
|
|
5027
5318
|
moduleFile: string(),
|
|
5028
5319
|
sourceHash: string().optional(),
|
|
5029
5320
|
schedule: string(),
|
|
5030
|
-
name:
|
|
5031
|
-
description:
|
|
5321
|
+
name: requiredDisplayTextSchema,
|
|
5322
|
+
description: requiredDisplayTextSchema
|
|
5032
5323
|
})
|
|
5033
5324
|
]);
|
|
5034
5325
|
object({
|
|
@@ -5454,24 +5745,6 @@ object({
|
|
|
5454
5745
|
outputParameters: record(string(), unknown()).optional(),
|
|
5455
5746
|
version: string().optional()
|
|
5456
5747
|
});
|
|
5457
|
-
/** How a credential instance is stored (`credential_instances.auth_kind`). */
|
|
5458
|
-
const CredentialAuthKindSchema = _enum([
|
|
5459
|
-
"api_key",
|
|
5460
|
-
"oauth_managed",
|
|
5461
|
-
"keystroke"
|
|
5462
|
-
]);
|
|
5463
|
-
/**
|
|
5464
|
-
* Where a credential instance is stored (`credential_instances.scope_type`), and the only thing an
|
|
5465
|
-
* action/tool can pin via `.scope(...)`. There is no resolution chain: when no scope is pinned, the
|
|
5466
|
-
* resolver tries the project default, then the org default, then throws.
|
|
5467
|
-
*/
|
|
5468
|
-
const CredentialScopeTypeSchema = _enum([
|
|
5469
|
-
"organization",
|
|
5470
|
-
"project",
|
|
5471
|
-
"user"
|
|
5472
|
-
]);
|
|
5473
|
-
CredentialAuthKindSchema.options;
|
|
5474
|
-
CredentialScopeTypeSchema.options;
|
|
5475
5748
|
/** Scope of a platform app credential (maps to `credential_instances.scope_type`). */
|
|
5476
5749
|
const AppCredentialScopeSchema = _enum([
|
|
5477
5750
|
"user",
|
|
@@ -5487,6 +5760,8 @@ const nullableOptionalTimestamp = string().nullable().optional();
|
|
|
5487
5760
|
object({
|
|
5488
5761
|
id: string().min(1),
|
|
5489
5762
|
appId: string().min(1),
|
|
5763
|
+
/** Stable per-scope identifier; pass to `--credential` to pin a specific instance. */
|
|
5764
|
+
slug: string().min(1),
|
|
5490
5765
|
label: string().min(1),
|
|
5491
5766
|
scope: AppCredentialScopeSchema,
|
|
5492
5767
|
lastRefreshedAt: string().nullable(),
|
|
@@ -5643,7 +5918,11 @@ object({
|
|
|
5643
5918
|
/** When set, platform MCP resolve checks credential assignments before scope defaults. */
|
|
5644
5919
|
assignmentTarget: McpCredentialAssignmentTargetSchema.optional(),
|
|
5645
5920
|
/** Tool/step consumer id for assignment lookup (action slug or workflow step correlation id). */
|
|
5646
|
-
consumerId: string().trim().min(1).optional()
|
|
5921
|
+
consumerId: string().trim().min(1).optional(),
|
|
5922
|
+
/** Explicit credential instance slug; overrides default resolution to pick that instance. */
|
|
5923
|
+
credentialSlug: string().trim().min(1).optional(),
|
|
5924
|
+
/** Project slug (CLI --project); the platform resolves it to a project and binds that scope. */
|
|
5925
|
+
projectSlug: string().trim().min(1).optional()
|
|
5647
5926
|
});
|
|
5648
5927
|
object({
|
|
5649
5928
|
error: _enum([
|
|
@@ -6467,7 +6746,7 @@ object({
|
|
|
6467
6746
|
id: string(),
|
|
6468
6747
|
slug: string(),
|
|
6469
6748
|
name: string(),
|
|
6470
|
-
description: string().
|
|
6749
|
+
description: string().min(1),
|
|
6471
6750
|
type: TriggerTypeSchema,
|
|
6472
6751
|
status: TriggerStatusSchema,
|
|
6473
6752
|
projectId: string(),
|
|
@@ -6763,7 +7042,7 @@ const AgentSummarySchema = object({
|
|
|
6763
7042
|
name: string().min(1),
|
|
6764
7043
|
projectId: string().min(1),
|
|
6765
7044
|
updatedAt: string().min(1),
|
|
6766
|
-
description: string().
|
|
7045
|
+
description: string().min(1),
|
|
6767
7046
|
sourcePath: string().min(1).optional(),
|
|
6768
7047
|
model: string().optional(),
|
|
6769
7048
|
capabilities: object({
|
|
@@ -6785,7 +7064,7 @@ const WorkflowSummarySchema = object({
|
|
|
6785
7064
|
name: string().min(1),
|
|
6786
7065
|
projectId: string().min(1),
|
|
6787
7066
|
updatedAt: string().min(1),
|
|
6788
|
-
description: string().
|
|
7067
|
+
description: string().min(1),
|
|
6789
7068
|
sourcePath: string().min(1).optional(),
|
|
6790
7069
|
lastRunAt: optionalTimestamp
|
|
6791
7070
|
});
|
|
@@ -6795,7 +7074,7 @@ const SkillSummarySchema = object({
|
|
|
6795
7074
|
name: string().min(1),
|
|
6796
7075
|
projectId: string().min(1),
|
|
6797
7076
|
updatedAt: string().min(1),
|
|
6798
|
-
description: string().
|
|
7077
|
+
description: string().min(1),
|
|
6799
7078
|
sourcePath: string().min(1).optional()
|
|
6800
7079
|
});
|
|
6801
7080
|
AgentSummarySchema.nullable();
|
|
@@ -6904,6 +7183,245 @@ object({ files: array(object({
|
|
|
6904
7183
|
id: string(),
|
|
6905
7184
|
path: string().min(1)
|
|
6906
7185
|
})) });
|
|
7186
|
+
/** Whether the overview is still being produced or finished. */
|
|
7187
|
+
const WorkflowOverviewStatusSchema = _enum(["generating", "ready"]);
|
|
7188
|
+
/** One phase of the guided-tour overview. */
|
|
7189
|
+
const WorkflowPhaseSchema = object({
|
|
7190
|
+
id: string(),
|
|
7191
|
+
title: string(),
|
|
7192
|
+
copy: string(),
|
|
7193
|
+
nodeIds: array(string())
|
|
7194
|
+
});
|
|
7195
|
+
object({
|
|
7196
|
+
status: WorkflowOverviewStatusSchema,
|
|
7197
|
+
summary: string(),
|
|
7198
|
+
phases: array(WorkflowPhaseSchema),
|
|
7199
|
+
hash: string(),
|
|
7200
|
+
generatedAt: string().nullable(),
|
|
7201
|
+
model: string()
|
|
7202
|
+
});
|
|
7203
|
+
/** Subset of JSON-Schema field types the dashboard form renders inline. */
|
|
7204
|
+
const WorkflowInputFieldTypeSchema = _enum([
|
|
7205
|
+
"string",
|
|
7206
|
+
"number",
|
|
7207
|
+
"boolean",
|
|
7208
|
+
"enum",
|
|
7209
|
+
"object",
|
|
7210
|
+
"array"
|
|
7211
|
+
]);
|
|
7212
|
+
const WorkflowInputFieldSchema = lazy(() => object({
|
|
7213
|
+
key: string(),
|
|
7214
|
+
label: string(),
|
|
7215
|
+
type: WorkflowInputFieldTypeSchema,
|
|
7216
|
+
required: boolean(),
|
|
7217
|
+
description: string().optional(),
|
|
7218
|
+
placeholder: string().optional(),
|
|
7219
|
+
options: array(string()).optional(),
|
|
7220
|
+
default: union([
|
|
7221
|
+
string(),
|
|
7222
|
+
number$1(),
|
|
7223
|
+
boolean()
|
|
7224
|
+
]).optional(),
|
|
7225
|
+
children: array(WorkflowInputFieldSchema).optional(),
|
|
7226
|
+
format: string().optional()
|
|
7227
|
+
}));
|
|
7228
|
+
object({
|
|
7229
|
+
schema: object({ fields: array(WorkflowInputFieldSchema) }),
|
|
7230
|
+
values: record(string(), unknown()).nullable()
|
|
7231
|
+
});
|
|
7232
|
+
object({ runId: string() });
|
|
7233
|
+
/** Annotation lifecycle: "generating" while the LLM pass streams in, then "ready". */
|
|
7234
|
+
const WorkflowCanvasStatusSchema = _enum(["generating", "ready"]);
|
|
7235
|
+
/** LLM-produced enrichment for a single skeleton node. */
|
|
7236
|
+
const WorkflowCanvasAnnotationSchema = object({
|
|
7237
|
+
label: string().optional(),
|
|
7238
|
+
description: string().optional()
|
|
7239
|
+
});
|
|
7240
|
+
/** The configured value of one input at this call site. */
|
|
7241
|
+
const WorkflowNodeInputBindingSchema = object({
|
|
7242
|
+
tokens: array(discriminatedUnion("kind", [
|
|
7243
|
+
object({
|
|
7244
|
+
kind: literal("text"),
|
|
7245
|
+
text: string()
|
|
7246
|
+
}),
|
|
7247
|
+
object({
|
|
7248
|
+
kind: literal("reference"),
|
|
7249
|
+
sourceNodeId: string().optional(),
|
|
7250
|
+
sourceLabel: string(),
|
|
7251
|
+
field: string().optional()
|
|
7252
|
+
}),
|
|
7253
|
+
object({
|
|
7254
|
+
kind: literal("variable"),
|
|
7255
|
+
text: string(),
|
|
7256
|
+
/** Concrete value when `text` resolves to a top-level literal constant. */
|
|
7257
|
+
resolvedValue: string().optional()
|
|
7258
|
+
}),
|
|
7259
|
+
object({
|
|
7260
|
+
kind: literal("call"),
|
|
7261
|
+
name: string()
|
|
7262
|
+
})
|
|
7263
|
+
])),
|
|
7264
|
+
multiline: boolean().optional()
|
|
7265
|
+
});
|
|
7266
|
+
/** An inspector input with optional call-site binding. */
|
|
7267
|
+
const WorkflowCanvasNodeInputSchema = WorkflowInputFieldSchema.and(object({
|
|
7268
|
+
binding: WorkflowNodeInputBindingSchema.optional(),
|
|
7269
|
+
additional: boolean().optional()
|
|
7270
|
+
}));
|
|
7271
|
+
/** Authored, deterministic metadata for a single node. */
|
|
7272
|
+
const WorkflowCanvasNodeMetaSchema = object({
|
|
7273
|
+
kind: _enum([
|
|
7274
|
+
"action",
|
|
7275
|
+
"agent",
|
|
7276
|
+
"workflow",
|
|
7277
|
+
"llm",
|
|
7278
|
+
"trigger",
|
|
7279
|
+
"boundary"
|
|
7280
|
+
]),
|
|
7281
|
+
slug: string(),
|
|
7282
|
+
name: string(),
|
|
7283
|
+
description: string().optional(),
|
|
7284
|
+
appSlug: string().optional(),
|
|
7285
|
+
inputs: array(WorkflowCanvasNodeInputSchema),
|
|
7286
|
+
outputs: array(WorkflowInputFieldSchema),
|
|
7287
|
+
requiredApps: array(string()).optional(),
|
|
7288
|
+
model: string().optional(),
|
|
7289
|
+
toolCount: number$1().int().nonnegative().optional()
|
|
7290
|
+
});
|
|
7291
|
+
object({
|
|
7292
|
+
graph: WorkflowCanvasGraphSchema,
|
|
7293
|
+
nodeMetadata: record(string(), WorkflowCanvasNodeMetaSchema),
|
|
7294
|
+
annotations: record(string(), WorkflowCanvasAnnotationSchema),
|
|
7295
|
+
status: WorkflowCanvasStatusSchema,
|
|
7296
|
+
hash: string(),
|
|
7297
|
+
generatedAt: string().nullable(),
|
|
7298
|
+
model: string()
|
|
7299
|
+
});
|
|
7300
|
+
const WorkflowCanvasNodeRunStateSchema = object({
|
|
7301
|
+
status: _enum([
|
|
7302
|
+
"pending",
|
|
7303
|
+
"running",
|
|
7304
|
+
"succeeded",
|
|
7305
|
+
"failed",
|
|
7306
|
+
"skipped"
|
|
7307
|
+
]),
|
|
7308
|
+
iteration: object({
|
|
7309
|
+
index: number$1().int().nonnegative(),
|
|
7310
|
+
total: number$1().int().nonnegative()
|
|
7311
|
+
}).optional()
|
|
7312
|
+
});
|
|
7313
|
+
/** Overall lifecycle of a run as the canvas animates it. */
|
|
7314
|
+
const WorkflowCanvasRunStatusSchema = _enum([
|
|
7315
|
+
"running",
|
|
7316
|
+
"succeeded",
|
|
7317
|
+
"failed",
|
|
7318
|
+
"canceled"
|
|
7319
|
+
]);
|
|
7320
|
+
object({
|
|
7321
|
+
runId: string(),
|
|
7322
|
+
status: WorkflowCanvasRunStatusSchema,
|
|
7323
|
+
startedAt: string(),
|
|
7324
|
+
finishedAt: string().nullable(),
|
|
7325
|
+
nodeStates: record(string(), WorkflowCanvasNodeRunStateSchema)
|
|
7326
|
+
});
|
|
7327
|
+
/** Scope a credential instance lives in. */
|
|
7328
|
+
const WorkflowCredentialScopeSchema = _enum([
|
|
7329
|
+
"organization",
|
|
7330
|
+
"project",
|
|
7331
|
+
"user"
|
|
7332
|
+
]);
|
|
7333
|
+
/** The concrete credential instance a binding currently resolves to. */
|
|
7334
|
+
const WorkflowResolvedCredentialSchema = object({
|
|
7335
|
+
id: string(),
|
|
7336
|
+
name: string(),
|
|
7337
|
+
scope: WorkflowCredentialScopeSchema,
|
|
7338
|
+
appSlug: string().optional(),
|
|
7339
|
+
isDefault: boolean().optional(),
|
|
7340
|
+
projectId: string().optional(),
|
|
7341
|
+
projectName: string().optional()
|
|
7342
|
+
});
|
|
7343
|
+
record(string(), WorkflowCanvasAnnotationSchema);
|
|
7344
|
+
/** One opaque code-block the annotation pass should label, keyed by its canvas node id. */
|
|
7345
|
+
const WorkflowCanvasAnnotationCodeBlockSchema = object({
|
|
7346
|
+
nodeId: string(),
|
|
7347
|
+
/** The raw source snippet (the node's label) the LLM turns into human copy. */
|
|
7348
|
+
source: string()
|
|
7349
|
+
});
|
|
7350
|
+
/** Inputs the worker feeds the LLM for the gated code-block annotation pass. */
|
|
7351
|
+
const WorkflowCanvasAnnotationsInputSchema = object({
|
|
7352
|
+
workflowName: string(),
|
|
7353
|
+
workflowDescription: string().nullable(),
|
|
7354
|
+
codeBlocks: array(WorkflowCanvasAnnotationCodeBlockSchema)
|
|
7355
|
+
});
|
|
7356
|
+
object({
|
|
7357
|
+
workflowId: string(),
|
|
7358
|
+
projectId: string(),
|
|
7359
|
+
hash: string(),
|
|
7360
|
+
model: string(),
|
|
7361
|
+
input: WorkflowCanvasAnnotationsInputSchema
|
|
7362
|
+
});
|
|
7363
|
+
/** One node as the overview LLM sees it (derived from the canvas node metadata + graph). */
|
|
7364
|
+
const WorkflowOverviewNodeSchema = object({
|
|
7365
|
+
nodeId: string(),
|
|
7366
|
+
label: string(),
|
|
7367
|
+
kind: string(),
|
|
7368
|
+
description: string().optional(),
|
|
7369
|
+
/** App/integration slug for steps imported from a `@keystrokehq/<app>` package. */
|
|
7370
|
+
appSlug: string().optional(),
|
|
7371
|
+
/** Authored input field keys (from the action/agent/workflow definition). */
|
|
7372
|
+
inputs: array(string()).optional(),
|
|
7373
|
+
/** Authored output field keys. */
|
|
7374
|
+
outputs: array(string()).optional(),
|
|
7375
|
+
/** Agent-only: the model the agent runs on. */
|
|
7376
|
+
model: string().optional(),
|
|
7377
|
+
/** Agent-only: number of tools available to the agent. */
|
|
7378
|
+
toolCount: number$1().int().nonnegative().optional()
|
|
7379
|
+
});
|
|
7380
|
+
/** Inputs the worker feeds the LLM to produce the workflow overview (summary + phases). */
|
|
7381
|
+
const WorkflowOverviewInputSchema = object({
|
|
7382
|
+
workflowName: string(),
|
|
7383
|
+
workflowDescription: string().nullable(),
|
|
7384
|
+
/** Display labels of the trigger sources upstream of the workflow (read-only context). */
|
|
7385
|
+
triggers: array(string()),
|
|
7386
|
+
nodes: array(WorkflowOverviewNodeSchema),
|
|
7387
|
+
/** The workflow's TypeScript source (best-effort; null when the deploy has no source snapshot). */
|
|
7388
|
+
source: string().nullable()
|
|
7389
|
+
});
|
|
7390
|
+
object({
|
|
7391
|
+
workflowId: string(),
|
|
7392
|
+
projectId: string(),
|
|
7393
|
+
hash: string(),
|
|
7394
|
+
model: string(),
|
|
7395
|
+
input: WorkflowOverviewInputSchema
|
|
7396
|
+
});
|
|
7397
|
+
const WorkflowCanvasCredentialBindingBaseSchema = object({
|
|
7398
|
+
credentialKey: string(),
|
|
7399
|
+
label: string(),
|
|
7400
|
+
appSlug: string().optional()
|
|
7401
|
+
});
|
|
7402
|
+
/** How one credential requirement on a step currently resolves. */
|
|
7403
|
+
const WorkflowCanvasCredentialBindingSchema = union([
|
|
7404
|
+
WorkflowCanvasCredentialBindingBaseSchema.extend({
|
|
7405
|
+
policy: _enum([
|
|
7406
|
+
"project-default",
|
|
7407
|
+
"org-default",
|
|
7408
|
+
"assigned"
|
|
7409
|
+
]),
|
|
7410
|
+
instance: WorkflowResolvedCredentialSchema
|
|
7411
|
+
}),
|
|
7412
|
+
WorkflowCanvasCredentialBindingBaseSchema.extend({
|
|
7413
|
+
policy: literal("scope-pinned"),
|
|
7414
|
+
pinnedScope: WorkflowCredentialScopeSchema,
|
|
7415
|
+
instance: WorkflowResolvedCredentialSchema
|
|
7416
|
+
}),
|
|
7417
|
+
WorkflowCanvasCredentialBindingBaseSchema.extend({
|
|
7418
|
+
policy: literal("unresolved"),
|
|
7419
|
+
reason: _enum(["needs-selection", "missing"]),
|
|
7420
|
+
pinnedScope: WorkflowCredentialScopeSchema.optional()
|
|
7421
|
+
})
|
|
7422
|
+
]);
|
|
7423
|
+
record(string(), array(WorkflowCanvasCredentialBindingSchema));
|
|
7424
|
+
record(string(), unknown());
|
|
6907
7425
|
//#endregion
|
|
6908
7426
|
//#region src/runtime.ts
|
|
6909
7427
|
/** Builds base64 `KEYSTROKE_ORG_ARTIFACTS` payload for org worker containers. */
|
|
@@ -7223,6 +7741,26 @@ async function pingProjectTarget(target, options = {}) {
|
|
|
7223
7741
|
});
|
|
7224
7742
|
}
|
|
7225
7743
|
//#endregion
|
|
7226
|
-
|
|
7744
|
+
//#region src/deploy-status.ts
|
|
7745
|
+
/**
|
|
7746
|
+
* Ask a running org machine which projects bootstrapped and which failed.
|
|
7747
|
+
* Best-effort: returns undefined on any error so callers can fall back to
|
|
7748
|
+
* treating every project as healthy (preserving pre-existing behavior).
|
|
7749
|
+
*/
|
|
7750
|
+
async function fetchDeployStatus(baseUrl, options = {}) {
|
|
7751
|
+
const timeoutMs = options.timeoutMs ?? 15e3;
|
|
7752
|
+
try {
|
|
7753
|
+
const response = await (options.fetchImpl ?? fetch)(new URL(PROJECT_SERVER_DEPLOY_STATUS.path, baseUrl), { signal: AbortSignal.timeout(timeoutMs) });
|
|
7754
|
+
if (!response.ok) return;
|
|
7755
|
+
const data = await response.json();
|
|
7756
|
+
if (!data || !Array.isArray(data.projects)) return;
|
|
7757
|
+
return data;
|
|
7758
|
+
} catch (error) {
|
|
7759
|
+
console.warn(`[deploy-status] failed to fetch from ${baseUrl}:`, error);
|
|
7760
|
+
return;
|
|
7761
|
+
}
|
|
7762
|
+
}
|
|
7763
|
+
//#endregion
|
|
7764
|
+
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 };
|
|
7227
7765
|
|
|
7228
7766
|
//# sourceMappingURL=index.mjs.map
|