@usestratus/sdk 1.6.0 → 1.9.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.
Files changed (59) hide show
  1. package/README.md +109 -2
  2. package/dist/ai-sdk/index.d.ts +294 -0
  3. package/dist/ai-sdk/index.d.ts.map +1 -0
  4. package/dist/ai-sdk/index.js +741 -0
  5. package/dist/ai-sdk/index.js.map +1 -0
  6. package/dist/azure/index.d.ts +4 -4
  7. package/dist/azure/index.d.ts.map +1 -1
  8. package/dist/azure/index.js +1 -1
  9. package/dist/azure/index.js.map +1 -1
  10. package/dist/azure/responses-model.js +15 -5
  11. package/dist/azure/responses-model.js.map +1 -1
  12. package/dist/core/codemode/index.d.ts +1 -2
  13. package/dist/core/codemode/index.d.ts.map +1 -1
  14. package/dist/core/codemode/index.js.map +1 -1
  15. package/dist/core/index.d.ts +41 -34
  16. package/dist/core/index.d.ts.map +1 -1
  17. package/dist/core/index.js +18 -15
  18. package/dist/core/index.js.map +1 -1
  19. package/dist/core/run.d.ts.map +1 -1
  20. package/dist/core/run.js +1 -1
  21. package/dist/core/run.js.map +1 -1
  22. package/dist/core/session.d.ts.map +1 -1
  23. package/dist/core/session.js.map +1 -1
  24. package/dist/core/subagent.js +1 -1
  25. package/dist/core/subagent.js.map +1 -1
  26. package/dist/core/types.d.ts +4 -1
  27. package/dist/core/types.d.ts.map +1 -1
  28. package/dist/core/utils/zod.d.ts.map +1 -1
  29. package/dist/core/utils/zod.js.map +1 -1
  30. package/dist/core/validate-agent.d.ts.map +1 -1
  31. package/dist/core/validate-agent.js.map +1 -1
  32. package/dist/core/workflow-draft.d.ts +32 -0
  33. package/dist/core/workflow-draft.d.ts.map +1 -0
  34. package/dist/core/workflow-draft.js +84 -0
  35. package/dist/core/workflow-draft.js.map +1 -0
  36. package/dist/core/workflow-manager.d.ts +25 -0
  37. package/dist/core/workflow-manager.d.ts.map +1 -0
  38. package/dist/core/workflow-manager.js +178 -0
  39. package/dist/core/workflow-manager.js.map +1 -0
  40. package/dist/core/workflow-saved.d.ts +21 -0
  41. package/dist/core/workflow-saved.d.ts.map +1 -0
  42. package/dist/core/workflow-saved.js +79 -0
  43. package/dist/core/workflow-saved.js.map +1 -0
  44. package/dist/core/workflow.d.ts +262 -0
  45. package/dist/core/workflow.d.ts.map +1 -0
  46. package/dist/core/workflow.js +560 -0
  47. package/dist/core/workflow.js.map +1 -0
  48. package/dist/effect/index.d.ts +39 -0
  49. package/dist/effect/index.d.ts.map +1 -0
  50. package/dist/effect/index.js +90 -0
  51. package/dist/effect/index.js.map +1 -0
  52. package/dist/index.d.ts +1 -1
  53. package/dist/index.d.ts.map +1 -1
  54. package/dist/index.js +1 -1
  55. package/dist/index.js.map +1 -1
  56. package/dist/testing/index.d.ts +1 -1
  57. package/dist/testing/index.d.ts.map +1 -1
  58. package/dist/testing/index.js.map +1 -1
  59. package/package.json +19 -5
package/README.md CHANGED
@@ -18,12 +18,13 @@ A TypeScript agent SDK purpose-built for Azure OpenAI.
18
18
  - **One line to start** — `createModel()` reads your env vars. No config objects, no API version guessing.
19
19
  - **One interface, two backends** — Chat Completions and Responses API through the same agent, tool, and session code.
20
20
  - **Agents that compose** — handoffs, subagents, guardrails, and hooks in a single run loop. Deny or modify tool calls at runtime.
21
+ - **Workflow orchestration** — fan out bounded parallel agent tasks, stream progress events, resume completed work from snapshots, and synthesize the final answer.
21
22
  - **Human-in-the-loop** — permission callbacks, per-tool approval, glob-filtered tools, and graceful mid-run interrupts.
22
23
  - **State you own** — save, resume, and fork conversations as JSON. No server-side threads.
23
24
  - **Type-safe end to end** — Zod schemas drive parameters, structured output, and validation. Types flow through agents, hooks, and guardrails at compile time.
24
- - **Zero dep** — only Zod as a peer dep.
25
+ - **Tiny dependency surface** — Zod as a peer dep, with optional Effect integration when you want it.
25
26
 
26
- `agents` `tools` `streaming` `structured output` `handoffs` `subagents` `guardrails` `hooks` `tracing` `sessions` `abort signals` `code mode` `todo tracking` `cost tracking` `human-in-the-loop` `predicted output` `audio` `data sources` `context compaction` `background tasks` `testing utilities` `debug mode`
27
+ `agents` `tools` `streaming` `structured output` `handoffs` `subagents` `workflows` `guardrails` `hooks` `tracing` `sessions` `abort signals` `code mode` `todo tracking` `cost tracking` `human-in-the-loop` `predicted output` `audio` `data sources` `context compaction` `background tasks` `testing utilities` `debug mode`
27
28
 
28
29
  ## Install
29
30
 
@@ -126,6 +127,31 @@ for await (const event of s) {
126
127
  const finalResult = await result;
127
128
  ```
128
129
 
130
+ ### Vercel AI SDK Interop
131
+
132
+ Use `@usestratus/sdk/ai-sdk` to connect Stratus agents to AI SDK UI streams without adding `ai` as a required runtime dependency:
133
+
134
+ ```ts
135
+ import { Agent, createModel } from "@usestratus/sdk";
136
+ import {
137
+ createStratusChatResponse,
138
+ type AISDKUIMessage,
139
+ } from "@usestratus/sdk/ai-sdk";
140
+
141
+ const agent = new Agent({
142
+ name: "assistant",
143
+ instructions: "You are helpful and concise.",
144
+ model: createModel(),
145
+ });
146
+
147
+ export async function POST(req: Request) {
148
+ const { messages }: { messages: AISDKUIMessage[] } = await req.json();
149
+ return createStratusChatResponse({ agent, messages });
150
+ }
151
+ ```
152
+
153
+ The interop package also includes helpers for `UIMessage` history conversion, tool approval resume flows, AI SDK-style model adapters, and OpenAI Agents-style stream event projection.
154
+
129
155
  ### Structured Output
130
156
 
131
157
  Use Zod schemas to get typed, validated output:
@@ -239,6 +265,87 @@ const parentAgent = new Agent({
239
265
  });
240
266
  ```
241
267
 
268
+ ### Workflows
269
+
270
+ Use workflows when the orchestration itself should live in code: audits, migrations, research passes, and verification loops that need many agents without stuffing every intermediate result into one conversation.
271
+
272
+ ```ts
273
+ import { Agent, createModel, runWorkflow, workflow, workflowTask } from "@usestratus/sdk";
274
+
275
+ const model = createModel();
276
+
277
+ const reviewer = new Agent({
278
+ name: "reviewer",
279
+ instructions: "Review the target carefully and report concrete findings only.",
280
+ model,
281
+ });
282
+
283
+ const synthesizer = new Agent({
284
+ name: "synthesizer",
285
+ instructions: "Merge independent findings into a concise final report.",
286
+ model,
287
+ });
288
+
289
+ const auditWorkflow = workflow({
290
+ name: "parallel-audit",
291
+ run: async (ctx, files: string[]) => {
292
+ const findings = await ctx.phase(
293
+ "review files",
294
+ files.map((file) =>
295
+ workflowTask({
296
+ id: file,
297
+ name: `review ${file}`,
298
+ agent: reviewer,
299
+ input: `Audit ${file} for correctness, security, and missing tests.`,
300
+ metadata: { file },
301
+ }),
302
+ ),
303
+ { concurrency: 8, failFast: false },
304
+ );
305
+
306
+ const synthesis = await ctx.synthesize(
307
+ synthesizer,
308
+ findings
309
+ .map((finding) => `## ${finding.name}\n${finding.output || finding.error}`)
310
+ .join("\n\n"),
311
+ );
312
+
313
+ return synthesis.output;
314
+ },
315
+ });
316
+
317
+ const result = await runWorkflow(auditWorkflow, [
318
+ "src/routes/users.ts",
319
+ "src/routes/billing.ts",
320
+ ]);
321
+
322
+ console.log(result.output);
323
+ console.log(result.usage.totalTokens);
324
+ ```
325
+
326
+ Workflows support:
327
+ - Bounded parallel phases (`concurrency`, capped by `maxConcurrency`)
328
+ - Progress streaming with `streamWorkflow()`
329
+ - Anthropic-style helpers: `ctx.fanOutAndSynthesize()`, `ctx.adversarialVerify()`, `ctx.generateAndFilter()`, `ctx.tournament()`, and `ctx.loopUntilDone()`
330
+ - Token, cost, and duration guardrails through `budget`
331
+ - Managed runs with `WorkflowRunManager` for event collection, stop, restart, and snapshot resume
332
+ - Generated workflow drafts with `generateWorkflowDraft()` so users can preview the plan and script before running it
333
+ - Saved workflow discovery/loading from `.stratus/workflows`
334
+ - `AbortSignal` cancellation
335
+ - `failFast: false` phases for tolerant audit-style runs
336
+ - `resumeFrom` snapshots that skip completed task IDs
337
+ - Custom function tasks for non-model work alongside agent tasks
338
+
339
+ ```ts
340
+ const result = await runWorkflow(auditWorkflow, files, {
341
+ concurrency: 8,
342
+ maxTasks: 1000,
343
+ budget: { maxTotalTokens: 50_000, maxDurationMs: 10 * 60_000 },
344
+ });
345
+ ```
346
+
347
+ Budget checks run after tasks or synthesis calls complete, so concurrent phases can overshoot a threshold before the workflow stops. Use conservative concurrency for strict spend control.
348
+
242
349
  ### Guardrails
243
350
 
244
351
  Validate inputs and outputs with guardrails:
@@ -0,0 +1,294 @@
1
+ import type { Agent } from "../core/agent";
2
+ import type { Model, StreamEvent } from "../core/model";
3
+ import type { InterruptedRunResult, PendingToolCall, RunResult } from "../core/result";
4
+ import { type RunOptions, type ToolApproval } from "../core/run";
5
+ import { type SessionConfig, type SessionSnapshot } from "../core/session";
6
+ import type { FunctionTool } from "../core/tool";
7
+ import type { ChatMessage, FileContentPart, TextContentPart } from "../core/types";
8
+ export interface AISDKUIMessage {
9
+ id: string;
10
+ role: "system" | "user" | "assistant";
11
+ metadata?: unknown;
12
+ parts: AISDKUIMessagePart[];
13
+ }
14
+ export type AISDKUIMessagePart = {
15
+ type: "text";
16
+ text: string;
17
+ } | {
18
+ type: "file";
19
+ url: string;
20
+ mediaType: string;
21
+ filename?: string;
22
+ } | ({
23
+ type: `tool-${string}`;
24
+ } & AISDKToolUIPart) | ({
25
+ type: "dynamic-tool";
26
+ toolName: string;
27
+ } & AISDKToolUIPart) | {
28
+ type: string;
29
+ [key: string]: unknown;
30
+ };
31
+ export interface AISDKToolUIPart {
32
+ toolCallId: string;
33
+ state: "input-streaming" | "input-available" | "approval-requested" | "approval-responded" | "output-available" | "output-error" | "output-denied";
34
+ input?: unknown;
35
+ output?: unknown;
36
+ errorText?: string;
37
+ approval?: {
38
+ approved?: boolean;
39
+ reason?: string;
40
+ };
41
+ }
42
+ export type AISDKModelMessage = {
43
+ role: "system";
44
+ content: string;
45
+ } | {
46
+ role: "user";
47
+ content: string | AISDKModelContentPart[];
48
+ } | {
49
+ role: "assistant";
50
+ content: string | AISDKModelContentPart[];
51
+ } | {
52
+ role: "tool";
53
+ content: AISDKModelContentPart[];
54
+ };
55
+ export type AISDKModelContentPart = {
56
+ type: "text";
57
+ text: string;
58
+ } | {
59
+ type: "image";
60
+ image: string | URL | {
61
+ type: "reference";
62
+ reference: string;
63
+ };
64
+ } | {
65
+ type: "file";
66
+ data: string | URL | {
67
+ type: "url";
68
+ url: string;
69
+ } | {
70
+ type: "reference";
71
+ reference: string;
72
+ };
73
+ filename?: string;
74
+ mediaType?: string;
75
+ } | {
76
+ type: "tool-call";
77
+ toolCallId: string;
78
+ toolName: string;
79
+ input: unknown;
80
+ } | {
81
+ type: "tool-result";
82
+ toolCallId: string;
83
+ toolName: string;
84
+ output: unknown;
85
+ } | {
86
+ type: string;
87
+ [key: string]: unknown;
88
+ };
89
+ export type AISDKMessage = AISDKUIMessage | AISDKModelMessage;
90
+ export type AISDKUIMessageChunk = {
91
+ type: "start";
92
+ messageId?: string;
93
+ messageMetadata?: unknown;
94
+ } | {
95
+ type: "text-start";
96
+ id: string;
97
+ } | {
98
+ type: "text-delta";
99
+ id: string;
100
+ delta: string;
101
+ } | {
102
+ type: "text-end";
103
+ id: string;
104
+ } | {
105
+ type: "tool-input-start";
106
+ toolCallId: string;
107
+ toolName: string;
108
+ } | {
109
+ type: "tool-input-delta";
110
+ toolCallId: string;
111
+ inputTextDelta: string;
112
+ } | {
113
+ type: "tool-input-available";
114
+ toolCallId: string;
115
+ toolName: string;
116
+ input: unknown;
117
+ } | {
118
+ type: "tool-input-error";
119
+ toolCallId: string;
120
+ toolName: string;
121
+ input: unknown;
122
+ errorText: string;
123
+ } | {
124
+ type: "tool-output-available";
125
+ toolCallId: string;
126
+ output: unknown;
127
+ } | {
128
+ type: "tool-approval-request";
129
+ approvalId: string;
130
+ toolCallId: string;
131
+ isAutomatic?: boolean;
132
+ } | {
133
+ type: "tool-approval-response";
134
+ approvalId: string;
135
+ approved: boolean;
136
+ reason?: string;
137
+ } | {
138
+ type: "data-stratus-event";
139
+ data: StreamEvent;
140
+ } | {
141
+ type: "finish";
142
+ finishReason?: string;
143
+ messageMetadata?: unknown;
144
+ } | {
145
+ type: "error";
146
+ errorText: string;
147
+ };
148
+ export interface FromAISDKMessagesOptions {
149
+ /**
150
+ * Convert custom UI data parts into Stratus user content. Return undefined to ignore a part.
151
+ */
152
+ convertDataPart?: (part: AISDKUIMessagePart) => TextContentPart | FileContentPart | undefined;
153
+ }
154
+ export interface ToAISDKUIMessageOptions {
155
+ id?: string;
156
+ metadata?: unknown;
157
+ }
158
+ export interface ToAISDKUIMessageStreamOptions {
159
+ messageId?: string;
160
+ textId?: string;
161
+ messageMetadata?: unknown;
162
+ sendStart?: boolean;
163
+ sendFinish?: boolean;
164
+ }
165
+ export interface AISDKUIMessageStreamResponseInit extends ResponseInit {
166
+ consumeSseStream?: (options: {
167
+ stream: ReadableStream<string>;
168
+ }) => PromiseLike<void> | void;
169
+ }
170
+ export interface CreateStratusChatResponseOptions<TContext, TOutput = undefined> extends AISDKUIMessageStreamResponseInit {
171
+ agent: Agent<TContext, TOutput>;
172
+ messages: AISDKMessage[];
173
+ runOptions?: RunOptions<TContext, TOutput>;
174
+ messageId?: string;
175
+ messageMetadata?: unknown;
176
+ convertDataPart?: FromAISDKMessagesOptions["convertDataPart"];
177
+ }
178
+ export interface ResumeStratusChatResponseOptions<TContext, TOutput = undefined> extends AISDKUIMessageStreamResponseInit {
179
+ interrupted: InterruptedRunResult<TOutput>;
180
+ messages: AISDKMessage[];
181
+ runOptions?: RunOptions<TContext, TOutput>;
182
+ messageId?: string;
183
+ messageMetadata?: unknown;
184
+ }
185
+ export type AISDKToolSet<TContext = unknown> = Record<string, {
186
+ description: string;
187
+ inputSchema: FunctionTool<unknown, TContext>["parameters"];
188
+ execute: (input: unknown, options?: {
189
+ signal?: AbortSignal;
190
+ }) => Promise<string> | string;
191
+ }>;
192
+ export type AISDKLanguageModelFinishReason = "stop" | "length" | "content-filter" | "tool-calls" | "unknown";
193
+ export interface AISDKLanguageModelCallOptions {
194
+ prompt?: AISDKModelMessage[];
195
+ messages?: AISDKModelMessage[];
196
+ tools?: Array<{
197
+ type?: "function";
198
+ name: string;
199
+ description?: string;
200
+ inputSchema?: Record<string, unknown>;
201
+ parameters?: Record<string, unknown>;
202
+ }>;
203
+ toolChoice?: unknown;
204
+ temperature?: number;
205
+ topP?: number;
206
+ maxOutputTokens?: number;
207
+ abortSignal?: AbortSignal;
208
+ [key: string]: unknown;
209
+ }
210
+ export interface AISDKLanguageModel {
211
+ specificationVersion: "v2";
212
+ provider: string;
213
+ modelId: string;
214
+ supportedUrls: Record<string, RegExp[]>;
215
+ doGenerate(options: AISDKLanguageModelCallOptions): Promise<{
216
+ content: Array<{
217
+ type: "text";
218
+ text: string;
219
+ } | {
220
+ type: "tool-call";
221
+ toolCallId: string;
222
+ toolName: string;
223
+ input: unknown;
224
+ }>;
225
+ finishReason: AISDKLanguageModelFinishReason;
226
+ usage: {
227
+ inputTokens: number;
228
+ outputTokens: number;
229
+ totalTokens: number;
230
+ };
231
+ response?: {
232
+ id?: string;
233
+ };
234
+ }>;
235
+ doStream(options: AISDKLanguageModelCallOptions): Promise<{
236
+ stream: ReadableStream<{
237
+ type: "text-delta";
238
+ id: string;
239
+ delta: string;
240
+ } | {
241
+ type: "tool-call";
242
+ toolCallId: string;
243
+ toolName: string;
244
+ input: unknown;
245
+ } | {
246
+ type: "finish";
247
+ finishReason: AISDKLanguageModelFinishReason;
248
+ usage: {
249
+ inputTokens: number;
250
+ outputTokens: number;
251
+ totalTokens: number;
252
+ };
253
+ }>;
254
+ }>;
255
+ }
256
+ export type OpenAIAgentsStyleStreamEvent = {
257
+ type: "raw_model_stream_event";
258
+ data: StreamEvent;
259
+ source?: "stratus";
260
+ } | {
261
+ type: "run_item_stream_event";
262
+ name: "message_output_created" | "tool_called" | "tool_output" | "tool_approval_requested" | "handoff_occurred" | "reasoning_item_created";
263
+ item: Record<string, unknown>;
264
+ } | {
265
+ type: "agent_updated_stream_event";
266
+ agent: {
267
+ name: string;
268
+ };
269
+ };
270
+ export declare function fromAISDKMessages(messages: AISDKMessage[], options?: FromAISDKMessagesOptions): ChatMessage[];
271
+ export declare function toAISDKUIMessages(messagesOrSnapshot: ChatMessage[] | SessionSnapshot | RunResult<unknown>): AISDKUIMessage[];
272
+ export declare function toSessionSnapshotFromAISDKMessages(messages: AISDKMessage[], options?: FromAISDKMessagesOptions & {
273
+ id?: string;
274
+ }): SessionSnapshot;
275
+ export declare function resumeSessionFromAISDKMessages<TContext = unknown, TOutput = undefined>(messages: AISDKMessage[], config: SessionConfig<TContext, TOutput>, options?: FromAISDKMessagesOptions & {
276
+ id?: string;
277
+ }): import("..").Session<TContext, TOutput>;
278
+ export declare function toAISDKUIMessage(result: RunResult<unknown> | ChatMessage[], options?: ToAISDKUIMessageOptions): AISDKUIMessage;
279
+ export declare function toAISDKToolApprovalRequests(interrupted: InterruptedRunResult<unknown>): AISDKUIMessageChunk[];
280
+ export declare function approvalsFromAISDKMessages(messages: AISDKMessage[], pendingToolCalls: PendingToolCall[]): ToolApproval[];
281
+ export declare function toAISDKUIMessageChunks(events: AsyncIterable<StreamEvent>, options?: ToAISDKUIMessageStreamOptions): AsyncGenerator<AISDKUIMessageChunk>;
282
+ export declare function toAISDKUIMessageStream(events: AsyncIterable<StreamEvent>, options?: ToAISDKUIMessageStreamOptions): ReadableStream<AISDKUIMessageChunk>;
283
+ export declare function createAISDKUIMessageStreamResponse(options: AISDKUIMessageStreamResponseInit & {
284
+ stream: ReadableStream<AISDKUIMessageChunk>;
285
+ }): Response;
286
+ export declare function createStratusChatResponse<TContext, TOutput = undefined>(options: CreateStratusChatResponseOptions<TContext, TOutput>): Response;
287
+ export declare function resumeStratusChatResponse<TContext, TOutput = undefined>(options: ResumeStratusChatResponseOptions<TContext, TOutput>): Response;
288
+ export declare function toAISDKToolSet<TContext>(tools: FunctionTool<unknown, TContext>[], context: TContext): AISDKToolSet<TContext>;
289
+ export declare function toAISDKLanguageModel(model: Model, options?: {
290
+ provider?: string;
291
+ modelId?: string;
292
+ }): AISDKLanguageModel;
293
+ export declare function toOpenAIAgentsStyleStreamEvents(events: AsyncIterable<StreamEvent>): AsyncGenerator<OpenAIAg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