6bf8bebf51
CI / Test and Build (push) Failing after 1s
CI / Migrate Dev DB (push) Has been skipped
CI / Migrate DB (push) Has been skipped
CodeQL / Analyze actions (push) Has been cancelled
CodeQL / Analyze javascript-typescript (push) Has been cancelled
CI / Detect Version (push) Has been cancelled
CI / Detect Desktop Changes (push) Has been cancelled
CI / Build AMD64 (blacksmith-2vcpu-ubuntu-2404, ./docker/cron.Dockerfile, ubuntu-latest, ghcr.io/simstudioai/cron) (push) Has been cancelled
CI / Build AMD64 (blacksmith-2vcpu-ubuntu-2404, ./docker/db.Dockerfile, ECR_MIGRATIONS, ubuntu-latest, ghcr.io/simstudioai/migrations) (push) Has been cancelled
CI / Build AMD64 (blacksmith-4vcpu-ubuntu-2404, ./docker/pii.Dockerfile, ECR_PII, ubuntu-latest, ghcr.io/simstudioai/pii) (push) Has been cancelled
CI / Build AMD64 (blacksmith-4vcpu-ubuntu-2404, ./docker/realtime.Dockerfile, ECR_REALTIME, ubuntu-latest, ghcr.io/simstudioai/realtime) (push) Has been cancelled
CI / Build AMD64 (blacksmith-8vcpu-ubuntu-2404, ./docker/app.Dockerfile, ECR_APP, linux-x64-8-core, ghcr.io/simstudioai/simstudio) (push) Has been cancelled
CI / Build ARM64 (GHCR Only) (blacksmith-4vcpu-ubuntu-2404-arm, ./docker/cron.Dockerfile, ubuntu-24.04-arm, ghcr.io/simstudioai/cron) (push) Has been cancelled
CI / Build ARM64 (GHCR Only) (blacksmith-4vcpu-ubuntu-2404-arm, ./docker/db.Dockerfile, ubuntu-24.04-arm, ghcr.io/simstudioai/migrations) (push) Has been cancelled
CI / Build ARM64 (GHCR Only) (blacksmith-4vcpu-ubuntu-2404-arm, ./docker/pii.Dockerfile, ubuntu-24.04-arm, ghcr.io/simstudioai/pii) (push) Has been cancelled
CI / Build ARM64 (GHCR Only) (blacksmith-4vcpu-ubuntu-2404-arm, ./docker/realtime.Dockerfile, ubuntu-24.04-arm, ghcr.io/simstudioai/realtime) (push) Has been cancelled
CI / Build ARM64 (GHCR Only) (blacksmith-8vcpu-ubuntu-2404-arm, ./docker/app.Dockerfile, linux-arm64-8-core, ghcr.io/simstudioai/simstudio) (push) Has been cancelled
CI / Check Docs Changes (push) Has been cancelled
Publish CLI Package / publish-npm (push) Has been cancelled
Publish Python SDK / publish-pypi (push) Has been cancelled
CI / Deploy Trigger.dev (Dev) (push) Has been cancelled
Helm Chart / Lint, test, and validate chart (push) Has been cancelled
Helm Chart / Chart version bumped (push) Has been cancelled
Publish TypeScript SDK / publish-npm (push) Has been cancelled
CI / Build Dev ECR (blacksmith-8vcpu-ubuntu-2404, ./docker/app.Dockerfile, ECR_APP, linux-x64-8-core) (push) Has been cancelled
CI / Promote Images (push) Has been cancelled
CI / Create GHCR Manifests (ghcr.io/simstudioai/cron) (push) Has been cancelled
CI / Create GHCR Manifests (ghcr.io/simstudioai/migrations) (push) Has been cancelled
CI / Create GHCR Manifests (ghcr.io/simstudioai/pii) (push) Has been cancelled
CI / Create GHCR Manifests (ghcr.io/simstudioai/realtime) (push) Has been cancelled
CI / Build Dev ECR (blacksmith-2vcpu-ubuntu-2404, ./docker/db.Dockerfile, ECR_MIGRATIONS, ubuntu-latest) (push) Has been cancelled
CI / Build Dev ECR (blacksmith-4vcpu-ubuntu-2404, ./docker/pii.Dockerfile, ECR_PII, ubuntu-latest) (push) Has been cancelled
CI / Build Dev ECR (blacksmith-4vcpu-ubuntu-2404, ./docker/realtime.Dockerfile, ECR_REALTIME, ubuntu-latest) (push) Has been cancelled
CI / Create GHCR Manifests (ghcr.io/simstudioai/simstudio) (push) Has been cancelled
CI / Process Docs (push) Has been cancelled
CI / Create GitHub Release (push) Has been cancelled
CI / Check Desktop Signing Secrets (push) Has been cancelled
CI / Desktop Release (push) Has been cancelled
CI / Create Desktop Prerelease (push) Has been cancelled
CI / Desktop Prerelease Build (push) Has been cancelled
CI / Publish Desktop Prerelease (push) Has been cancelled
CI / Prune Desktop Prereleases (push) Has been cancelled
Helm Chart / Install on kind and run helm test (push) Has been cancelled
123 lines
3.8 KiB
TypeScript
123 lines
3.8 KiB
TypeScript
import { describe, expect, it } from 'vitest'
|
|
import {
|
|
executeWorkflowBodySchema,
|
|
updateWorkflowBodySchema,
|
|
workflowListItemSchema,
|
|
} from '@/lib/api/contracts/workflows'
|
|
import { PRIVATE_SECRET_PROVENANCE_FIELD } from '@/lib/execution/private-tool-metadata'
|
|
|
|
describe('workflow contracts', () => {
|
|
/**
|
|
* Agent-event frames are additive to an existing wire format, so an
|
|
* integration that never asked for them must keep the frame set it has.
|
|
*/
|
|
it('leaves agent-event exposure off when the caller does not ask for it', () => {
|
|
const parsed = executeWorkflowBodySchema.parse({ stream: true })
|
|
|
|
expect(parsed.includeThinking).toBe(false)
|
|
expect(parsed.includeToolCalls).toBe(false)
|
|
})
|
|
|
|
it('accepts each agent-event policy independently', () => {
|
|
expect(executeWorkflowBodySchema.parse({ stream: true, includeToolCalls: true })).toMatchObject(
|
|
{ includeThinking: false, includeToolCalls: true }
|
|
)
|
|
|
|
expect(executeWorkflowBodySchema.parse({ stream: true, includeThinking: true })).toMatchObject({
|
|
includeThinking: true,
|
|
includeToolCalls: false,
|
|
})
|
|
})
|
|
|
|
it('accepts a trusted prior-execution input reference', () => {
|
|
expect(
|
|
executeWorkflowBodySchema.parse({ inputFromExecutionId: 'execution-123' })
|
|
).toMatchObject({ inputFromExecutionId: 'execution-123' })
|
|
})
|
|
|
|
it('retains a private workflow-input provenance envelope for boundary validation', () => {
|
|
const bundle = {
|
|
version: 1 as const,
|
|
complete: true,
|
|
selections: [
|
|
{
|
|
key: 'input',
|
|
provenance: {
|
|
version: 1 as const,
|
|
complete: true,
|
|
entries: [{ name: 'TOKEN', encryptedValue: 'encrypted-token' }],
|
|
scope: { userId: 'parent-owner', workspaceId: 'workspace-1' },
|
|
},
|
|
},
|
|
],
|
|
}
|
|
|
|
expect(
|
|
executeWorkflowBodySchema.parse({ [PRIVATE_SECRET_PROVENANCE_FIELD]: bundle })
|
|
).toMatchObject({ [PRIVATE_SECRET_PROVENANCE_FIELD]: bundle })
|
|
})
|
|
|
|
it('normalizes null React Flow edge handles in execution overrides', () => {
|
|
const parsed = executeWorkflowBodySchema.parse({
|
|
workflowStateOverride: {
|
|
blocks: {
|
|
source: {
|
|
id: 'source',
|
|
type: 'start_trigger',
|
|
name: 'Start',
|
|
position: { x: 0, y: 0 },
|
|
subBlocks: {},
|
|
outputs: {},
|
|
enabled: true,
|
|
},
|
|
target: {
|
|
id: 'target',
|
|
type: 'function',
|
|
name: 'Function',
|
|
position: { x: 100, y: 0 },
|
|
subBlocks: {},
|
|
outputs: {},
|
|
enabled: true,
|
|
},
|
|
},
|
|
edges: [
|
|
{
|
|
id: 'edge-1',
|
|
source: 'source',
|
|
target: 'target',
|
|
sourceHandle: null,
|
|
targetHandle: null,
|
|
type: 'workflowEdge',
|
|
},
|
|
],
|
|
loops: {},
|
|
parallels: {},
|
|
},
|
|
})
|
|
|
|
expect(parsed.workflowStateOverride?.edges[0].sourceHandle).toBeUndefined()
|
|
expect(parsed.workflowStateOverride?.edges[0].targetHandle).toBeUndefined()
|
|
})
|
|
|
|
it('updateWorkflowBodySchema accepts forkSyncExcluded and leaves it optional', () => {
|
|
expect(updateWorkflowBodySchema.parse({ forkSyncExcluded: true }).forkSyncExcluded).toBe(true)
|
|
expect(updateWorkflowBodySchema.parse({}).forkSyncExcluded).toBeUndefined()
|
|
})
|
|
|
|
it('workflowListItemSchema defaults an absent forkSyncExcluded to false (old-server tolerance)', () => {
|
|
const item = workflowListItemSchema.parse({
|
|
id: 'wf-1',
|
|
name: 'Alpha',
|
|
description: null,
|
|
workspaceId: 'ws-1',
|
|
folderId: null,
|
|
sortOrder: 0,
|
|
createdAt: '2026-01-01T00:00:00.000Z',
|
|
updatedAt: '2026-01-01T00:00:00.000Z',
|
|
archivedAt: null,
|
|
locked: false,
|
|
})
|
|
expect(item.forkSyncExcluded).toBe(false)
|
|
})
|
|
})
|