@stigmer/runner 3.29.0 → 3.31.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/README.md +5 -0
- package/dist/.build-fingerprint +1 -1
- package/dist/activities/call-eval.d.ts +16 -0
- package/dist/activities/call-eval.js +54 -1
- package/dist/activities/call-eval.js.map +1 -1
- package/dist/activities/execute-cursor/__test-utils__/hermetic-cursor.js +1 -0
- package/dist/activities/execute-cursor/__test-utils__/hermetic-cursor.js.map +1 -1
- package/dist/activities/execute-deep-agent/__test-utils__/hermetic-deep-agent.js +1 -0
- package/dist/activities/execute-deep-agent/__test-utils__/hermetic-deep-agent.js.map +1 -1
- package/dist/activities/hydrate-workflow-execution.d.ts +1 -1
- package/dist/activities/workflow-event-activities.d.ts +2 -2
- package/dist/activities/workflow-event-activities.js +2 -2
- package/dist/config.d.ts +8 -0
- package/dist/config.js +2 -0
- package/dist/config.js.map +1 -1
- package/dist/harness/transcript/builder.d.ts +3 -2
- package/dist/harness/transcript/builder.js +28 -8
- package/dist/harness/transcript/builder.js.map +1 -1
- package/dist/runner-manager.d.ts +9 -0
- package/dist/runner-manager.js +3 -0
- package/dist/runner-manager.js.map +1 -1
- package/dist/runner.d.ts +9 -0
- package/dist/runner.js +3 -1
- package/dist/runner.js.map +1 -1
- package/dist/shared/approval-policy.d.ts +5 -0
- package/dist/shared/approval-policy.js +8 -0
- package/dist/shared/approval-policy.js.map +1 -1
- package/dist/shared/args-preview.d.ts +12 -5
- package/dist/shared/args-preview.js +12 -5
- package/dist/shared/args-preview.js.map +1 -1
- package/dist/shared/runner-credential-keys.d.ts +0 -29
- package/dist/shared/runner-credential-keys.js +8 -0
- package/dist/shared/runner-credential-keys.js.map +1 -1
- package/dist/worker.d.ts +2 -4
- package/dist/worker.js +3 -4
- package/dist/worker.js.map +1 -1
- package/dist/workflow-engine/tasks/run.d.ts +15 -1
- package/dist/workflow-engine/tasks/run.js +18 -1
- package/dist/workflow-engine/tasks/run.js.map +1 -1
- package/dist/workflows/call-agent-orchestrator.d.ts +1 -1
- package/dist/workflows/call-agent-orchestrator.js +1 -1
- package/dist/workflows/engine-core.d.ts +28 -8
- package/dist/workflows/engine-core.js +9 -7
- package/dist/workflows/engine-core.js.map +1 -1
- package/dist/workflows/index.d.ts +22 -7
- package/dist/workflows/index.js +22 -7
- package/dist/workflows/index.js.map +1 -1
- package/dist/workflows/workflow-signals.d.ts +3 -3
- package/dist/workflows/workflow-signals.js +3 -3
- package/package.json +5 -5
- package/src/__test-utils__/config-fixture.ts +1 -0
- package/src/__test-utils__/workflows/index.ts +15 -0
- package/src/__test-utils__/workflows/inline-model.ts +34 -0
- package/src/__tests__/dispatch-surface-e2e.test.ts +212 -0
- package/src/__tests__/golden-e2e.test.ts +4 -3
- package/src/__tests__/history-encryption-e2e.test.ts +1 -1
- package/src/__tests__/runner.test.ts +20 -0
- package/src/activities/__tests__/call-eval.test.ts +115 -0
- package/src/activities/__tests__/classify-tool-approvals.test.ts +1 -0
- package/src/activities/__tests__/discover-mcp-server.test.ts +1 -0
- package/src/activities/call-eval.ts +59 -1
- package/src/activities/execute-cursor/__test-utils__/hermetic-cursor.ts +1 -0
- package/src/activities/execute-deep-agent/__test-utils__/hermetic-deep-agent.ts +1 -0
- package/src/activities/execute-deep-agent/__tests__/adapter.test.ts +1 -0
- package/src/activities/hydrate-workflow-execution.ts +1 -1
- package/src/activities/workflow-event-activities.ts +2 -2
- package/src/config.ts +10 -0
- package/src/harness/transcript/__tests__/builder.test.ts +56 -1
- package/src/harness/transcript/builder.ts +29 -8
- package/src/runner-manager.ts +14 -0
- package/src/runner.ts +14 -0
- package/src/shared/__tests__/approval-policy.test.ts +10 -0
- package/src/shared/__tests__/args-preview.test.ts +50 -1
- package/src/shared/__tests__/artifact-storage.test.ts +1 -0
- package/src/shared/__tests__/runner-credential-store.test.ts +20 -0
- package/src/shared/approval-policy.ts +7 -0
- package/src/shared/args-preview.ts +12 -5
- package/src/shared/runner-credential-keys.ts +12 -0
- package/src/worker.ts +3 -4
- package/src/workflow-engine/__tests__/tasks/run.test.ts +25 -0
- package/src/workflow-engine/tasks/run.ts +21 -1
- package/src/workflows/__tests__/barrel.test.ts +52 -0
- package/src/workflows/__tests__/{execute-serverless-workflow.test.ts → engine-inline-model.test.ts} +16 -4
- package/src/workflows/call-agent-orchestrator.ts +1 -1
- package/src/workflows/engine-core.ts +34 -9
- package/src/workflows/index.ts +22 -10
- package/src/workflows/workflow-signals.ts +3 -3
- package/dist/workflows/execute-serverless-workflow.d.ts +0 -32
- package/dist/workflows/execute-serverless-workflow.js +0 -36
- package/dist/workflows/execute-serverless-workflow.js.map +0 -1
- package/src/workflows/execute-serverless-workflow.ts +0 -60
|
@@ -2,10 +2,13 @@
|
|
|
2
2
|
* Shared workflow engine core — runs CNCF Serverless Workflow DSL
|
|
3
3
|
* tasks inside the Temporal deterministic sandbox.
|
|
4
4
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
5
|
+
* The engine runs a fully materialized {@link ExecuteServerlessWorkflowInput}
|
|
6
|
+
* and owns that type. Production reaches it only through the hydration
|
|
7
|
+
* workflow ("stigmer/workflow/execute-from-execution"), which reads the
|
|
8
|
+
* model, env and input back from the server by id; no registered workflow
|
|
9
|
+
* accepts a materialized model from its caller (see `index.ts`). The test
|
|
10
|
+
* harness runs goldens through an inline entry of its own
|
|
11
|
+
* (`src/__test-utils__/workflows/`).
|
|
9
12
|
*
|
|
10
13
|
* SANDBOX RULES: This file runs inside the Temporal deterministic V8
|
|
11
14
|
* isolate. No Node.js built-ins (crypto, fs, net), no non-deterministic
|
|
@@ -94,9 +97,8 @@ const promoteProxy = proxyLocalActivities({
|
|
|
94
97
|
* executes all tasks via {@link executeDoTasks}, and returns the final
|
|
95
98
|
* output.
|
|
96
99
|
*
|
|
97
|
-
* Called by
|
|
98
|
-
*
|
|
99
|
-
* - `executeFromExecution` (wrapper that hydrates from slim IDs first)
|
|
100
|
+
* Called by `executeFromExecution` once it has hydrated the input from
|
|
101
|
+
* slim ids, and by the test harness's inline entry.
|
|
100
102
|
*
|
|
101
103
|
* @param options.checkPause Optional pause yield point callback. When
|
|
102
104
|
* provided, the engine calls this between tasks and allows the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"engine-core.js","sourceRoot":"","sources":["../../src/workflows/engine-core.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,oBAAoB,EAAE,eAAe,EAAE,GAAG,EAAE,OAAO,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAChH,OAAO,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAC7F,OAAO,EAAE,0BAA0B,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAC;AASzF,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AACpE,OAAO,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AACjE,OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAC/D,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AACtE,OAAO,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AACnE,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAC1D,OAAO,EAAE,oBAAoB,EAAE,MAAM,gCAAgC,CAAC;AAEtE,OAAO,EAAE,qBAAqB,EAAE,MAAM,+CAA+C,CAAC;AA+BtF,MAAM,SAAS,GAAG,oBAAoB,CAAiB;IACrD,mBAAmB,EAAE,KAAK;CAC3B,CAAC,CAAC;AAEH,MAAM,gBAAgB,GAAG;IACvB,eAAe,EAAE,CAAC;IAClB,eAAe,EAAE,IAAI;IACrB,kBAAkB,EAAE,CAAC;IACrB,eAAe,EAAE,IAAI;CACb,CAAC;AAEX,MAAM,SAAS,GAAG,eAAe,CAA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
|
-
* Workflow barrel file — the entry point for Temporal's workflow bundler
|
|
2
|
+
* Workflow barrel file — the entry point for Temporal's workflow bundler,
|
|
3
|
+
* and the complete list of workflow types a runner registers.
|
|
3
4
|
*
|
|
4
5
|
* Re-exports workflow functions with the exact Temporal workflow type
|
|
5
|
-
* names that the
|
|
6
|
-
*
|
|
7
|
-
*
|
|
6
|
+
* names that the server uses to start them. The Temporal TS SDK derives
|
|
7
|
+
* the workflow type from the export name of the module passed to
|
|
8
|
+
* `workflowsPath`, so every export here is a registered type on every
|
|
9
|
+
* worker root: the static worker, the manager and pool workers, and the
|
|
10
|
+
* pre-built bundle (`scripts/bundle-slim.mjs`).
|
|
8
11
|
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
12
|
+
* THE RULE: every export is a type the server starts, and each takes ids
|
|
13
|
+
* that the runner reads back from the server, never a model to run.
|
|
14
|
+
* Anyone who can reach Temporal can start any type registered here on a
|
|
15
|
+
* runner's queue, so a new export is a new door and is reviewed as a
|
|
16
|
+
* wire change. `__tests__/barrel.test.ts` pins the exact set. Tests that
|
|
17
|
+
* hand the engine a model directly use the test barrel
|
|
18
|
+
* (`src/__test-utils__/workflows/index.ts`).
|
|
19
|
+
*
|
|
20
|
+
* The types and their starters:
|
|
21
|
+
* - "stigmer/mcp-server/connect" and "stigmer/mcp-server/discover": the
|
|
22
|
+
* server's MCP connect lane (`temporal/mcpserver/names.ts` in the
|
|
23
|
+
* server), by MCP server id.
|
|
24
|
+
* - "stigmer/workflow/execute-from-execution": the server's workflow
|
|
25
|
+
* execution orchestrator (`temporal/workflowexecution/names.ts`), by
|
|
26
|
+
* execution id; it hydrates the model from the server.
|
|
11
27
|
*
|
|
12
28
|
* ES2022 arbitrary module export names (`export { fn as "..." }`) let
|
|
13
29
|
* us map TypeScript function names to the slash-delimited Temporal
|
|
@@ -21,5 +37,4 @@
|
|
|
21
37
|
* src/workflow-source.ts).
|
|
22
38
|
*/
|
|
23
39
|
export { connectMcpServer as "stigmer/mcp-server/connect", discoverMcpServerLegacy as "stigmer/mcp-server/discover", } from "./connect-mcp-server.js";
|
|
24
|
-
export { executeServerlessWorkflow as "stigmer/workflow/execute", } from "./execute-serverless-workflow.js";
|
|
25
40
|
export { executeFromExecution as "stigmer/workflow/execute-from-execution", } from "./execute-from-execution.js";
|
package/dist/workflows/index.js
CHANGED
|
@@ -1,13 +1,29 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Workflow barrel file — the entry point for Temporal's workflow bundler
|
|
2
|
+
* Workflow barrel file — the entry point for Temporal's workflow bundler,
|
|
3
|
+
* and the complete list of workflow types a runner registers.
|
|
3
4
|
*
|
|
4
5
|
* Re-exports workflow functions with the exact Temporal workflow type
|
|
5
|
-
* names that the
|
|
6
|
-
*
|
|
7
|
-
*
|
|
6
|
+
* names that the server uses to start them. The Temporal TS SDK derives
|
|
7
|
+
* the workflow type from the export name of the module passed to
|
|
8
|
+
* `workflowsPath`, so every export here is a registered type on every
|
|
9
|
+
* worker root: the static worker, the manager and pool workers, and the
|
|
10
|
+
* pre-built bundle (`scripts/bundle-slim.mjs`).
|
|
8
11
|
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
12
|
+
* THE RULE: every export is a type the server starts, and each takes ids
|
|
13
|
+
* that the runner reads back from the server, never a model to run.
|
|
14
|
+
* Anyone who can reach Temporal can start any type registered here on a
|
|
15
|
+
* runner's queue, so a new export is a new door and is reviewed as a
|
|
16
|
+
* wire change. `__tests__/barrel.test.ts` pins the exact set. Tests that
|
|
17
|
+
* hand the engine a model directly use the test barrel
|
|
18
|
+
* (`src/__test-utils__/workflows/index.ts`).
|
|
19
|
+
*
|
|
20
|
+
* The types and their starters:
|
|
21
|
+
* - "stigmer/mcp-server/connect" and "stigmer/mcp-server/discover": the
|
|
22
|
+
* server's MCP connect lane (`temporal/mcpserver/names.ts` in the
|
|
23
|
+
* server), by MCP server id.
|
|
24
|
+
* - "stigmer/workflow/execute-from-execution": the server's workflow
|
|
25
|
+
* execution orchestrator (`temporal/workflowexecution/names.ts`), by
|
|
26
|
+
* execution id; it hydrates the model from the server.
|
|
11
27
|
*
|
|
12
28
|
* ES2022 arbitrary module export names (`export { fn as "..." }`) let
|
|
13
29
|
* us map TypeScript function names to the slash-delimited Temporal
|
|
@@ -21,6 +37,5 @@
|
|
|
21
37
|
* src/workflow-source.ts).
|
|
22
38
|
*/
|
|
23
39
|
export { connectMcpServer as "stigmer/mcp-server/connect", discoverMcpServerLegacy as "stigmer/mcp-server/discover", } from "./connect-mcp-server.js";
|
|
24
|
-
export { executeServerlessWorkflow as "stigmer/workflow/execute", } from "./execute-serverless-workflow.js";
|
|
25
40
|
export { executeFromExecution as "stigmer/workflow/execute-from-execution", } from "./execute-from-execution.js";
|
|
26
41
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/workflows/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/workflows/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AAEH,OAAO,EACL,gBAAgB,IAAI,4BAA4B,EAChD,uBAAuB,IAAI,6BAA6B,GACzD,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EACL,oBAAoB,IAAI,yCAAyC,GAClE,MAAM,6BAA6B,CAAC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Shared pause/resume signal definitions and handler setup for
|
|
3
|
-
* workflow execution. Used by
|
|
4
|
-
* ("stigmer/workflow/execute-from-execution") and the
|
|
5
|
-
*
|
|
3
|
+
* workflow execution. Used by the hydration wrapper
|
|
4
|
+
* ("stigmer/workflow/execute-from-execution") and by the test harness's
|
|
5
|
+
* inline entry (`src/__test-utils__/workflows/inline-model.ts`).
|
|
6
6
|
*
|
|
7
7
|
* The Java/Go orchestrators forward pause and resume signals to
|
|
8
8
|
* the child workflow. The engine checks a `checkPause` callback
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Shared pause/resume signal definitions and handler setup for
|
|
3
|
-
* workflow execution. Used by
|
|
4
|
-
* ("stigmer/workflow/execute-from-execution") and the
|
|
5
|
-
*
|
|
3
|
+
* workflow execution. Used by the hydration wrapper
|
|
4
|
+
* ("stigmer/workflow/execute-from-execution") and by the test harness's
|
|
5
|
+
* inline entry (`src/__test-utils__/workflows/inline-model.ts`).
|
|
6
6
|
*
|
|
7
7
|
* The Java/Go orchestrators forward pause and resume signals to
|
|
8
8
|
* the child workflow. The engine checks a `checkPause` callback
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stigmer/runner",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.31.0",
|
|
4
4
|
"description": "Embeddable Temporal worker for the Stigmer AI agent platform — handles agent execution, workflow orchestration, and MCP server management",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
@@ -104,10 +104,10 @@
|
|
|
104
104
|
"@opentelemetry/sdk-metrics": "^2.0.0",
|
|
105
105
|
"@opentelemetry/sdk-trace-base": "^2.0.0",
|
|
106
106
|
"@opentelemetry/sdk-trace-node": "^2.0.0",
|
|
107
|
-
"@stigmer/outbound": "3.
|
|
108
|
-
"@stigmer/protos": "3.
|
|
109
|
-
"@stigmer/temporal-codecs": "3.
|
|
110
|
-
"@stigmer/zip-structure": "3.
|
|
107
|
+
"@stigmer/outbound": "3.31.0",
|
|
108
|
+
"@stigmer/protos": "3.31.0",
|
|
109
|
+
"@stigmer/temporal-codecs": "3.31.0",
|
|
110
|
+
"@stigmer/zip-structure": "3.31.0",
|
|
111
111
|
"@temporalio/activity": "1.16.2",
|
|
112
112
|
"@temporalio/common": "1.16.2",
|
|
113
113
|
"@temporalio/interceptors-opentelemetry": "1.16.2",
|
|
@@ -41,6 +41,7 @@ export function testConfig(overrides: Partial<Config> = {}): Config {
|
|
|
41
41
|
taskQueue: "test-task-queue",
|
|
42
42
|
temporalAddress: "127.0.0.1:1",
|
|
43
43
|
temporalNamespace: "default",
|
|
44
|
+
temporalConnection: {},
|
|
44
45
|
stigmerBackendEndpoint: INERT_ENDPOINT,
|
|
45
46
|
stigmerTokenRef: { current: null },
|
|
46
47
|
mcpBridgeEndpoint: null,
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Test-only workflow barrel: every production type, plus the inline-model
|
|
3
|
+
* entry the goldens drive the engine through (`inline-model.ts` says why it
|
|
4
|
+
* is test-only). Point a test worker's `workflowsPath` here instead of at
|
|
5
|
+
* `src/workflows/index.ts` when a test hands the engine a model directly.
|
|
6
|
+
*
|
|
7
|
+
* WORKFLOW-BUNDLE IMPORT DISCIPLINE applies (sandbox module).
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
export * from "../../workflows/index.js";
|
|
11
|
+
|
|
12
|
+
// Equals INLINE_MODEL_WORKFLOW_TYPE in inline-model.ts, pinned by
|
|
13
|
+
// `workflows/__tests__/barrel.test.ts`: an ES2022 export alias must be a
|
|
14
|
+
// literal, so this line cannot import it.
|
|
15
|
+
export { executeInlineModel as "test/workflow/execute-inline" } from "./inline-model.js";
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Test-only workflow: runs the engine on a model the caller hands it.
|
|
3
|
+
*
|
|
4
|
+
* The golden E2E (`src/__tests__/golden-e2e.test.ts`) and the engine's
|
|
5
|
+
* unit test (`src/workflows/__tests__/engine-inline-model.test.ts`) drive
|
|
6
|
+
* the engine with a materialized {@link ExecuteServerlessWorkflowInput}
|
|
7
|
+
* and no server to hydrate from.
|
|
8
|
+
* Production registers no such type. A worker that ran whatever model
|
|
9
|
+
* arrived on its queue would let anyone who can reach Temporal run work
|
|
10
|
+
* that no signed-in person asked for, so the production barrel
|
|
11
|
+
* (`src/workflows/index.ts`) exports only the types the server starts.
|
|
12
|
+
* This entry lives here, outside the published build (`tsconfig.build.json`
|
|
13
|
+
* excludes `src/__test-utils__`), and is registered only by the test
|
|
14
|
+
* barrel beside it, under a name outside the platform's `stigmer/`
|
|
15
|
+
* namespace.
|
|
16
|
+
*
|
|
17
|
+
* SANDBOX RULES: This file runs inside the Temporal deterministic V8
|
|
18
|
+
* isolate. No Node.js built-ins, no non-deterministic operations, no
|
|
19
|
+
* side-effecting imports.
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
import { runWorkflowEngine } from "../../workflows/engine-core.js";
|
|
23
|
+
import type { ExecuteServerlessWorkflowInput } from "../../workflows/engine-core.js";
|
|
24
|
+
import { setupPauseResumeHandlers } from "../../workflows/workflow-signals.js";
|
|
25
|
+
|
|
26
|
+
/** The test barrel's name for this workflow; never a production type. */
|
|
27
|
+
export const INLINE_MODEL_WORKFLOW_TYPE = "test/workflow/execute-inline";
|
|
28
|
+
|
|
29
|
+
export async function executeInlineModel(
|
|
30
|
+
input: ExecuteServerlessWorkflowInput,
|
|
31
|
+
): Promise<unknown> {
|
|
32
|
+
const { checkPause } = setupPauseResumeHandlers();
|
|
33
|
+
return runWorkflowEngine(input, { checkPause });
|
|
34
|
+
}
|
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What a runner does with a workflow it was never meant to run, through a
|
|
3
|
+
* real Temporal (`TestWorkflowEnvironment`, the golden E2E's harness).
|
|
4
|
+
*
|
|
5
|
+
* A client that can reach Temporal can start any workflow type on a
|
|
6
|
+
* runner's queue, with any input. The runner's answer is its registered
|
|
7
|
+
* set: the production barrel (`src/workflows/index.ts`), which every
|
|
8
|
+
* worker root bundles, registers only types the server starts by id. This
|
|
9
|
+
* file pins the consequence end to end, on a worker that loads that barrel
|
|
10
|
+
* and the run-credential interceptors the way the roots do:
|
|
11
|
+
* - a start of `stigmer/workflow/execute` carrying a complete model never
|
|
12
|
+
* runs. Its workflow task fails because the type is unregistered, and no
|
|
13
|
+
* activity is ever scheduled, so the model's shell task never executes;
|
|
14
|
+
* - the same worker still runs `execute-from-execution`, the type the
|
|
15
|
+
* server does start, so the refusal is the barrel's and not a dead worker.
|
|
16
|
+
*
|
|
17
|
+
* The inline type's name is written out here on purpose: it is the removed
|
|
18
|
+
* type, and this test is what keeps it removed at the wire. Skipped when a
|
|
19
|
+
* local Temporal cannot boot.
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
import { describe, it, expect, beforeAll, afterAll } from "vitest";
|
|
23
|
+
import { readFileSync } from "node:fs";
|
|
24
|
+
import { join, dirname } from "node:path";
|
|
25
|
+
import { fileURLToPath } from "node:url";
|
|
26
|
+
|
|
27
|
+
import { loadWorkflowFromYaml } from "../workflow-engine/loader.js";
|
|
28
|
+
import { evaluateExpressionBatch } from "../workflow-engine/expression.js";
|
|
29
|
+
import type { ExecuteServerlessWorkflowInput } from "../workflows/engine-core.js";
|
|
30
|
+
import type { ExecuteFromExecutionInput } from "../workflows/execute-from-execution.js";
|
|
31
|
+
import { EXECUTE_FROM_EXECUTION_WORKFLOW_TYPE } from "../workflows/execute-from-execution.js";
|
|
32
|
+
import { runCredentialActivityInterceptor } from "../interceptors/run-credential-activity.js";
|
|
33
|
+
|
|
34
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
35
|
+
const WORKFLOWS_PATH = join(__dirname, "../workflows/index.ts");
|
|
36
|
+
const RUN_CREDENTIAL_WORKFLOW_INTERCEPTOR = join(
|
|
37
|
+
__dirname,
|
|
38
|
+
"../workflows/interceptors/run-credential.ts",
|
|
39
|
+
);
|
|
40
|
+
const GOLDEN_MODEL = readFileSync(
|
|
41
|
+
join(__dirname, "../../test/golden/01-operation-basic.yaml"),
|
|
42
|
+
"utf-8",
|
|
43
|
+
);
|
|
44
|
+
const TASK_QUEUE = "dispatch-surface-e2e-test";
|
|
45
|
+
const REMOVED_INLINE_TYPE = "stigmer/workflow/execute";
|
|
46
|
+
|
|
47
|
+
const SHELL_MODEL = `
|
|
48
|
+
document:
|
|
49
|
+
dsl: '1.0.0'
|
|
50
|
+
namespace: dispatch-surface
|
|
51
|
+
name: handed-model
|
|
52
|
+
version: '1.0.0'
|
|
53
|
+
do:
|
|
54
|
+
- runShell:
|
|
55
|
+
run:
|
|
56
|
+
shell:
|
|
57
|
+
command: echo
|
|
58
|
+
arguments:
|
|
59
|
+
msg: "this must never run"
|
|
60
|
+
`;
|
|
61
|
+
|
|
62
|
+
type TestWorkflowEnvironment =
|
|
63
|
+
import("@temporalio/testing").TestWorkflowEnvironment;
|
|
64
|
+
type Worker = import("@temporalio/worker").Worker;
|
|
65
|
+
|
|
66
|
+
let env: TestWorkflowEnvironment | null = null;
|
|
67
|
+
let worker: Worker | null = null;
|
|
68
|
+
let workerRunPromise: Promise<void> | null = null;
|
|
69
|
+
let envReady = false;
|
|
70
|
+
|
|
71
|
+
/** Every activity the worker ran, in order. */
|
|
72
|
+
const ran: string[] = [];
|
|
73
|
+
|
|
74
|
+
function recording<T extends (...args: never[]) => unknown>(
|
|
75
|
+
activity: string,
|
|
76
|
+
body: T,
|
|
77
|
+
): T {
|
|
78
|
+
return ((...args: never[]) => {
|
|
79
|
+
ran.push(activity);
|
|
80
|
+
return body(...args);
|
|
81
|
+
}) as T;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
function createRecordingActivities() {
|
|
85
|
+
return {
|
|
86
|
+
HydrateWorkflowExecution: recording(
|
|
87
|
+
"HydrateWorkflowExecution",
|
|
88
|
+
async (input: ExecuteFromExecutionInput) => ({
|
|
89
|
+
model: loadWorkflowFromYaml(GOLDEN_MODEL),
|
|
90
|
+
workflow_input: null,
|
|
91
|
+
env: {},
|
|
92
|
+
metadata: { execution_id: input.execution_id },
|
|
93
|
+
}),
|
|
94
|
+
),
|
|
95
|
+
ResetEventSequence: recording("ResetEventSequence", async (): Promise<number> => 0),
|
|
96
|
+
LoadRecoveryContext: recording("LoadRecoveryContext", async (): Promise<unknown[]> => []),
|
|
97
|
+
EmitWorkflowEvents: recording("EmitWorkflowEvents", async (): Promise<void> => {}),
|
|
98
|
+
PromoteTaskOutput: recording("PromoteTaskOutput", async (): Promise<void> => {}),
|
|
99
|
+
EvaluateExpressions: recording(
|
|
100
|
+
"EvaluateExpressions",
|
|
101
|
+
async (
|
|
102
|
+
expressions: Record<string, string>,
|
|
103
|
+
input: unknown,
|
|
104
|
+
stateVars: Record<string, unknown>,
|
|
105
|
+
) => evaluateExpressionBatch(expressions, input, stateVars),
|
|
106
|
+
),
|
|
107
|
+
RunShell: recording("RunShell", async (): Promise<unknown> => ({ stdout: "" })),
|
|
108
|
+
RunScript: recording("RunScript", async (): Promise<unknown> => ({ stdout: "" })),
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
function uniqueId(prefix: string): string {
|
|
113
|
+
return `${prefix}-${Date.now()}-${Math.random().toString(36).slice(2)}`;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
describe("dispatch surface E2E — Temporal TestWorkflowEnvironment", () => {
|
|
117
|
+
beforeAll(async () => {
|
|
118
|
+
try {
|
|
119
|
+
const { TestWorkflowEnvironment: TWE } = await import("@temporalio/testing");
|
|
120
|
+
const { Worker: W } = await import("@temporalio/worker");
|
|
121
|
+
|
|
122
|
+
env = await TWE.createLocal();
|
|
123
|
+
worker = await W.create({
|
|
124
|
+
connection: env.nativeConnection,
|
|
125
|
+
taskQueue: TASK_QUEUE,
|
|
126
|
+
workflowsPath: WORKFLOWS_PATH,
|
|
127
|
+
activities: createRecordingActivities(),
|
|
128
|
+
interceptors: {
|
|
129
|
+
activity: [runCredentialActivityInterceptor],
|
|
130
|
+
workflowModules: [RUN_CREDENTIAL_WORKFLOW_INTERCEPTOR],
|
|
131
|
+
},
|
|
132
|
+
});
|
|
133
|
+
workerRunPromise = worker.run();
|
|
134
|
+
envReady = true;
|
|
135
|
+
} catch (err: unknown) {
|
|
136
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
137
|
+
console.warn(`Temporal E2E smoke test failed (tests will be skipped): ${msg}`);
|
|
138
|
+
envReady = false;
|
|
139
|
+
}
|
|
140
|
+
}, 90_000);
|
|
141
|
+
|
|
142
|
+
afterAll(async () => {
|
|
143
|
+
if (worker) {
|
|
144
|
+
worker.shutdown();
|
|
145
|
+
await workerRunPromise?.catch(() => {});
|
|
146
|
+
}
|
|
147
|
+
await env?.teardown();
|
|
148
|
+
});
|
|
149
|
+
|
|
150
|
+
it("never runs a complete model started on its queue as the removed inline type", async (testCtx) => {
|
|
151
|
+
if (!envReady || !env) return testCtx.skip();
|
|
152
|
+
ran.length = 0;
|
|
153
|
+
|
|
154
|
+
const input: ExecuteServerlessWorkflowInput = {
|
|
155
|
+
model: loadWorkflowFromYaml(SHELL_MODEL),
|
|
156
|
+
workflow_input: null,
|
|
157
|
+
env: {},
|
|
158
|
+
};
|
|
159
|
+
const handle = await env.client.workflow.start(REMOVED_INLINE_TYPE, {
|
|
160
|
+
taskQueue: TASK_QUEUE,
|
|
161
|
+
workflowId: uniqueId("dispatch-surface-inline"),
|
|
162
|
+
args: [input],
|
|
163
|
+
workflowExecutionTimeout: "60s",
|
|
164
|
+
});
|
|
165
|
+
|
|
166
|
+
// The worker answers the first workflow task with a failure and the
|
|
167
|
+
// workflow stays open. Poll the history until that failure appears, or
|
|
168
|
+
// until the workflow closes (which only a worker that ran it can cause).
|
|
169
|
+
const deadline = Date.now() + 30_000;
|
|
170
|
+
let taskFailure: string | undefined;
|
|
171
|
+
let scheduledActivities = 0;
|
|
172
|
+
let running = true;
|
|
173
|
+
while (Date.now() < deadline && taskFailure === undefined && running) {
|
|
174
|
+
const history = await handle.fetchHistory();
|
|
175
|
+
const events = history.events ?? [];
|
|
176
|
+
scheduledActivities = events.filter((e) => e.activityTaskScheduledEventAttributes).length;
|
|
177
|
+
const failed = events.find((e) => e.workflowTaskFailedEventAttributes);
|
|
178
|
+
taskFailure = failed?.workflowTaskFailedEventAttributes?.failure?.message ?? undefined;
|
|
179
|
+
running = (await handle.describe()).status.name === "RUNNING";
|
|
180
|
+
if (taskFailure === undefined && running) await new Promise((r) => setTimeout(r, 200));
|
|
181
|
+
}
|
|
182
|
+
if (running) {
|
|
183
|
+
await handle.terminate("dispatch-surface e2e: the removed type is never executed");
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
expect(ran, "no activity of the handed model may run").toEqual([]);
|
|
187
|
+
expect(scheduledActivities).toBe(0);
|
|
188
|
+
expect(running, "the workflow must stay open: nothing ran it").toBe(true);
|
|
189
|
+
expect(taskFailure, "the workflow task must fail for the unregistered type").toBeDefined();
|
|
190
|
+
expect(taskFailure).toContain(REMOVED_INLINE_TYPE);
|
|
191
|
+
}, 60_000);
|
|
192
|
+
|
|
193
|
+
it("still runs the type the server starts, on the same worker", async (testCtx) => {
|
|
194
|
+
if (!envReady || !env) return testCtx.skip();
|
|
195
|
+
ran.length = 0;
|
|
196
|
+
|
|
197
|
+
const input: ExecuteFromExecutionInput = {
|
|
198
|
+
execution_id: `wex_dispatch_${Math.random().toString(36).slice(2)}`,
|
|
199
|
+
workflow_instance_id: "wfi_1",
|
|
200
|
+
workflow_id: "wf_1",
|
|
201
|
+
org_id: "org_1",
|
|
202
|
+
};
|
|
203
|
+
await env.client.workflow.execute(EXECUTE_FROM_EXECUTION_WORKFLOW_TYPE, {
|
|
204
|
+
taskQueue: TASK_QUEUE,
|
|
205
|
+
workflowId: uniqueId("dispatch-surface-dispatched"),
|
|
206
|
+
args: [input],
|
|
207
|
+
workflowExecutionTimeout: "30s",
|
|
208
|
+
});
|
|
209
|
+
|
|
210
|
+
expect(ran).toContain("HydrateWorkflowExecution");
|
|
211
|
+
}, 60_000);
|
|
212
|
+
});
|
|
@@ -25,12 +25,13 @@ import { join, dirname } from "node:path";
|
|
|
25
25
|
import { fileURLToPath } from "node:url";
|
|
26
26
|
import { loadWorkflowFromYaml } from "../workflow-engine/loader.js";
|
|
27
27
|
import { evaluateExpressionBatch } from "../workflow-engine/expression.js";
|
|
28
|
-
import type { ExecuteServerlessWorkflowInput } from "../workflows/
|
|
28
|
+
import type { ExecuteServerlessWorkflowInput } from "../workflows/engine-core.js";
|
|
29
29
|
import type { WorkflowModel } from "../workflow-engine/types.js";
|
|
30
|
+
import { INLINE_MODEL_WORKFLOW_TYPE } from "../__test-utils__/workflows/inline-model.js";
|
|
30
31
|
|
|
31
32
|
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
32
33
|
const GOLDEN_DIR = join(__dirname, "../../test/golden");
|
|
33
|
-
const WORKFLOWS_PATH = join(__dirname, "../workflows/index.ts");
|
|
34
|
+
const WORKFLOWS_PATH = join(__dirname, "../__test-utils__/workflows/index.ts");
|
|
34
35
|
const TASK_QUEUE = "golden-e2e-test";
|
|
35
36
|
|
|
36
37
|
function loadGolden(filename: string): string {
|
|
@@ -91,7 +92,7 @@ async function runGoldenWorkflow(model: WorkflowModel, workflowInput: unknown =
|
|
|
91
92
|
env: {},
|
|
92
93
|
metadata: { execution_id: "e2e-test" },
|
|
93
94
|
};
|
|
94
|
-
return env.client.workflow.execute(
|
|
95
|
+
return env.client.workflow.execute(INLINE_MODEL_WORKFLOW_TYPE, {
|
|
95
96
|
taskQueue: TASK_QUEUE,
|
|
96
97
|
workflowId: `golden-e2e-${Date.now()}-${Math.random().toString(36).slice(2)}`,
|
|
97
98
|
args: [input],
|
|
@@ -26,7 +26,7 @@ import { fileURLToPath } from "node:url";
|
|
|
26
26
|
import { loadWorkflowFromYaml } from "../workflow-engine/loader.js";
|
|
27
27
|
import { evaluateExpressionBatch } from "../workflow-engine/expression.js";
|
|
28
28
|
import { EncryptionPayloadCodec } from "@stigmer/temporal-codecs";
|
|
29
|
-
import type { ExecuteServerlessWorkflowInput } from "../workflows/
|
|
29
|
+
import type { ExecuteServerlessWorkflowInput } from "../workflows/engine-core.js";
|
|
30
30
|
|
|
31
31
|
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
32
32
|
const WORKFLOWS_PATH = join(__dirname, "../workflows/index.ts");
|
|
@@ -112,6 +112,26 @@ describe("StigmerRunnerOptions type contract", () => {
|
|
|
112
112
|
* credential (it mints no separate proxy token), and the config carries no
|
|
113
113
|
* credential by value (config.ts header).
|
|
114
114
|
*/
|
|
115
|
+
describe("mapOptionsToConfig — Temporal connection security", () => {
|
|
116
|
+
const base: StigmerRunnerOptions = {
|
|
117
|
+
taskQueue: "session:test-123",
|
|
118
|
+
temporalAddress: "localhost:7233",
|
|
119
|
+
stigmerEndpoint: "http://localhost:7234",
|
|
120
|
+
};
|
|
121
|
+
const refs = (): [TokenRef, TokenRef] => [{ current: null }, { current: null }];
|
|
122
|
+
|
|
123
|
+
it("carries an embedder's explicit settings", () => {
|
|
124
|
+
const temporalConnection = { tls: { serverNameOverride: "temporal.internal" }, apiKey: "k" };
|
|
125
|
+
expect(mapOptionsToConfig({ ...base, temporalConnection }, ...refs()).temporalConnection).toEqual(
|
|
126
|
+
temporalConnection,
|
|
127
|
+
);
|
|
128
|
+
});
|
|
129
|
+
|
|
130
|
+
it("falls back to the environment's STIGMER_TEMPORAL_* settings, plaintext when none is set", () => {
|
|
131
|
+
expect(mapOptionsToConfig(base, ...refs()).temporalConnection).toEqual({});
|
|
132
|
+
});
|
|
133
|
+
});
|
|
134
|
+
|
|
115
135
|
describe("mapOptionsToConfig — execution mode", () => {
|
|
116
136
|
const base: StigmerRunnerOptions = {
|
|
117
137
|
taskQueue: "session:test-123",
|