@stigmer/runner-slim 3.11.0 → 3.12.0

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/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@stigmer/runner-slim",
3
- "version": "3.11.0",
3
+ "version": "3.12.0",
4
4
  "description": "Self-contained Stigmer runner build for embedding in desktop apps — the bundle-friendly @stigmer/runner",
5
5
  "license": "Apache-2.0",
6
6
  "engines": {
7
- "node": ">=22.13"
7
+ "node": "^22.13.0 || >=23.4.0"
8
8
  },
9
9
  "bin": {
10
10
  "stigmer-runner": "./main.js"
@@ -16,11 +16,11 @@
16
16
  "jq-wasm": "^1.1.0-jq-1.8.1"
17
17
  },
18
18
  "optionalDependencies": {
19
- "@stigmer/runner-slim-darwin-arm64": "3.11.0",
20
- "@stigmer/runner-slim-darwin-x64": "3.11.0",
21
- "@stigmer/runner-slim-linux-x64": "3.11.0",
22
- "@stigmer/runner-slim-linux-arm64": "3.11.0",
23
- "@stigmer/runner-slim-win32-x64": "3.11.0"
19
+ "@stigmer/runner-slim-darwin-arm64": "3.12.0",
20
+ "@stigmer/runner-slim-darwin-x64": "3.12.0",
21
+ "@stigmer/runner-slim-linux-x64": "3.12.0",
22
+ "@stigmer/runner-slim-linux-arm64": "3.12.0",
23
+ "@stigmer/runner-slim-win32-x64": "3.12.0"
24
24
  },
25
25
  "keywords": [
26
26
  "stigmer",
@@ -25152,12 +25152,14 @@ function buildRecoveryContext(tasks) {
25152
25152
  "use strict";
25153
25153
  __webpack_require__.r(__webpack_exports__);
25154
25154
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
25155
+ /* harmony export */ RuntimePlaceholderResolutionError: () => (/* binding */ RuntimePlaceholderResolutionError),
25155
25156
  /* harmony export */ collectExpressions: () => (/* binding */ collectExpressions),
25156
25157
  /* harmony export */ isRuntimePlaceholder: () => (/* binding */ isRuntimePlaceholder),
25157
25158
  /* harmony export */ resolveConfigExpressions: () => (/* binding */ resolveConfigExpressions),
25158
25159
  /* harmony export */ resolveEmbeddedExpressions: () => (/* binding */ resolveEmbeddedExpressions),
25159
25160
  /* harmony export */ resolveObjectPlaceholders: () => (/* binding */ resolveObjectPlaceholders),
25160
25161
  /* harmony export */ resolveRuntimePlaceholders: () => (/* binding */ resolveRuntimePlaceholders),
25162
+ /* harmony export */ resolveRuntimePlaceholdersStrict: () => (/* binding */ resolveRuntimePlaceholdersStrict),
25161
25163
  /* harmony export */ substituteResults: () => (/* binding */ substituteResults)
25162
25164
  /* harmony export */ });
25163
25165
  /* harmony import */ var _clone_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./clone.js */ "./dist/workflow-engine/clone.js");
@@ -25288,6 +25290,8 @@ function parsePath(path) {
25288
25290
  return parts;
25289
25291
  }
25290
25292
  const RUNTIME_PLACEHOLDER_RE = /\$\{\.(secrets|env_vars)\.\w+\}/;
25293
+ /** Substitution form of {@link RUNTIME_PLACEHOLDER_RE} (global, capturing). */
25294
+ const RUNTIME_PLACEHOLDER_SUB_RE = /\$\{\.(secrets|env_vars)\.(\w+)\}/g;
25291
25295
  /**
25292
25296
  * Checks whether a string contains a runtime placeholder that should
25293
25297
  * NOT be evaluated in the workflow (deterministic) phase. These are
@@ -25301,16 +25305,49 @@ function isRuntimePlaceholder(value) {
25301
25305
  }
25302
25306
  /**
25303
25307
  * Resolves runtime placeholders (`${.secrets.KEY}`, `${.env_vars.KEY}`)
25304
- * in a string using values from the runtime environment map.
25308
+ * in a string using values from the runtime environment map. Missing
25309
+ * keys resolve to `""` — callers that must fail loudly instead use
25310
+ * {@link resolveRuntimePlaceholdersStrict}.
25305
25311
  *
25306
25312
  * This runs in activities only — never in the workflow sandbox.
25307
25313
  */
25308
25314
  function resolveRuntimePlaceholders(value, runtimeEnv) {
25309
- return value.replace(/\$\{\.(secrets|env_vars)\.(\w+)\}/g, (_match, _ns, key) => {
25315
+ return value.replace(RUNTIME_PLACEHOLDER_SUB_RE, (_match, _ns, key) => {
25310
25316
  const resolved = runtimeEnv[key];
25311
25317
  return resolved !== undefined ? String(resolved) : "";
25312
25318
  });
25313
25319
  }
25320
+ /** Thrown by {@link resolveRuntimePlaceholdersStrict} for a missing key. */
25321
+ class RuntimePlaceholderResolutionError extends Error {
25322
+ variableName;
25323
+ context;
25324
+ constructor(variableName, context) {
25325
+ const where = context ? ` in ${context}` : "";
25326
+ super(`Unresolved runtime placeholder for "${variableName}"${where}: ` +
25327
+ `variable is not present in the workflow's runtime environment`);
25328
+ this.variableName = variableName;
25329
+ this.context = context;
25330
+ this.name = "RuntimePlaceholderResolutionError";
25331
+ }
25332
+ }
25333
+ /**
25334
+ * Strict variant of {@link resolveRuntimePlaceholders}: a placeholder
25335
+ * whose key is missing from the runtime environment throws instead of
25336
+ * resolving to `""` — a silently-empty credential produces cryptic
25337
+ * downstream failures, so declared-value consumers (the run task's env
25338
+ * contract) fail fast with the variable named.
25339
+ *
25340
+ * This runs in activities only — never in the workflow sandbox.
25341
+ */
25342
+ function resolveRuntimePlaceholdersStrict(value, runtimeEnv, context) {
25343
+ return value.replace(RUNTIME_PLACEHOLDER_SUB_RE, (_match, _ns, key) => {
25344
+ const resolved = runtimeEnv[key];
25345
+ if (resolved === undefined) {
25346
+ throw new RuntimePlaceholderResolutionError(key, context);
25347
+ }
25348
+ return String(resolved);
25349
+ });
25350
+ }
25314
25351
  /**
25315
25352
  * Recursively resolves all runtime placeholders in a nested object.
25316
25353
  * Walks maps, arrays, and strings. Non-string leaves pass through.
@@ -28261,6 +28298,7 @@ async function connectMcpServer(input) {
28261
28298
  const discovery = await discover.DiscoverMcpServerCapabilities({
28262
28299
  mcpServerId: input.mcp_server_id,
28263
28300
  executionContextId: input.execution_context_id ?? null,
28301
+ executionContextToken: input.execution_context_token ?? null,
28264
28302
  invokerIdentityAccountId: input.invoker_identity_account_id ?? null,
28265
28303
  });
28266
28304
  // Content-addressed incremental classification: reuse prior decisions for
@@ -28325,6 +28363,7 @@ async function discoverMcpServerLegacy(input) {
28325
28363
  const discovery = await discover.DiscoverMcpServerCapabilities({
28326
28364
  mcpServerId: input.mcp_server_id,
28327
28365
  executionContextId: input.execution_context_id ?? null,
28366
+ executionContextToken: input.execution_context_token ?? null,
28328
28367
  invokerIdentityAccountId: input.invoker_identity_account_id ?? null,
28329
28368
  });
28330
28369
  return {