Skip to content
Source
Sign inSign up
TanStack/ai

Add Workflow-backed AI orchestration #979

Opentannerlinsleywants to merge 7 commits intomain fromtaren/workflow-orchestration-rfcopened View on GitHub

Showing 21 changed files with 99 additions and 0 deletions (loading 16).

x
0 of 21 viewed, 21 left
8 additions and 0 deletions.changeset/quiet-agents-work.mdAdded
View file
@@ -0,0 +1,8 @@
+---
+'@tanstack/ai-orchestration': minor
+---
+​
+Add the first Workflow-backed AI orchestration package. It provides typed agent
+definitions, a `ctx.ai.agent()` Workflow middleware, and adapters that project
+Workflow events into TanStack AI AG-UI streams without introducing another
+workflow runtime or store.
83 additions and 0 deletionspackages/ai-orchestration/src/agent.tsAdded
View file
@@ -0,0 +1,83 @@
+import type { StandardSchemaV1 } from '@standard-schema/spec'
+import type { StreamChunk } from '@tanstack/ai'
+import type {
+ AgentDefinition,
+ AgentRunResult,
+ AgentStreamResult,
+} from './types'
+​
+export interface DefineAgentConfig<TInput, TOutput, TName extends string> {
+ name: TName
+ description?: string
+ input?: StandardSchemaV1<unknown, TInput>
+ output?: StandardSchemaV1<unknown, TOutput>
+ run: (context: {
+ input: TInput
+ signal: AbortSignal
+ abortController: AbortController
+ }) => AgentRunResult<TOutput>
+}