MCPcopy
hub / github.com/coder/mux / hashWorkflowStepInput

Function hashWorkflowStepInput

src/node/services/workflows/workflowReplayKey.ts:12–16  ·  view source on GitHub ↗
(stepId: string, input: unknown)

Source from the content-addressed store, hash-verified

10}
11
12export function hashWorkflowStepInput(stepId: string, input: unknown): string {
13 assertWorkflowStepId(stepId, "workflow step");
14 const canonical = JSON.stringify({ stepId, input: canonicalizeWorkflowInput(input) });
15 return `sha256:${crypto.createHash("sha256").update(canonical).digest("hex")}`;
16}
17
18export function canonicalizeWorkflowInput(input: unknown): unknown {
19 if (input == null || typeof input === "string" || typeof input === "boolean") {

Callers 7

runApplyPatchStepMethod · 0.90
runNestedWorkflowStepMethod · 0.90
runAgentStepMethod · 0.90

Calls 3

assertWorkflowStepIdFunction · 0.85
updateMethod · 0.65

Tested by

no test coverage detected