Skip to content

Commit 850dd36

Browse files
committed
add bun workbench
1 parent f9b112a commit 850dd36

File tree

7 files changed

+28149
-1
lines changed

7 files changed

+28149
-1
lines changed

workbench/bun/server.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
import workflowPlugin from 'workflow/bun';
2+
3+
Bun.plugin(workflowPlugin());
4+
15
const server = Bun.serve({
26
// `routes` requires Bun v1.2.3+
37
routes: {
@@ -6,7 +10,7 @@ const server = Bun.serve({
610

711
// (optional) fallback for unmatched routes:
812
// Required if Bun's version < 1.2.3
9-
fetch(req) {
13+
fetch(_) {
1014
return new Response('Not Found', { status: 404 });
1115
},
1216
});
Lines changed: 223 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,223 @@
1+
{
2+
"workflows": {
3+
"example/workflows/98_duplicate_case.ts": {
4+
"addTenWorkflow": {
5+
"workflowId": "workflow//example/workflows/98_duplicate_case.ts//addTenWorkflow"
6+
}
7+
},
8+
"workflows/0_demo.ts": {
9+
"calc": {
10+
"workflowId": "workflow//workflows/0_demo.ts//calc"
11+
}
12+
},
13+
"example/workflows/3_streams.ts": {
14+
"streams": {
15+
"workflowId": "workflow//example/workflows/3_streams.ts//streams"
16+
}
17+
},
18+
"example/workflows/4_ai.ts": {
19+
"agent": {
20+
"workflowId": "workflow//example/workflows/4_ai.ts//agent"
21+
},
22+
"ai": {
23+
"workflowId": "workflow//example/workflows/4_ai.ts//ai"
24+
}
25+
},
26+
"example/workflows/5_hooks.ts": {
27+
"withCreateHook": {
28+
"workflowId": "workflow//example/workflows/5_hooks.ts//withCreateHook"
29+
},
30+
"withWorkflowMetadata": {
31+
"workflowId": "workflow//example/workflows/5_hooks.ts//withWorkflowMetadata"
32+
}
33+
},
34+
"example/workflows/1_simple.ts": {
35+
"simple": {
36+
"workflowId": "workflow//example/workflows/1_simple.ts//simple"
37+
}
38+
},
39+
"example/workflows/6_batching.ts": {
40+
"batchInStep": {
41+
"workflowId": "workflow//example/workflows/6_batching.ts//batchInStep"
42+
},
43+
"batchOverSteps": {
44+
"workflowId": "workflow//example/workflows/6_batching.ts//batchOverSteps"
45+
}
46+
},
47+
"example/workflows/2_control_flow.ts": {
48+
"control_flow": {
49+
"workflowId": "workflow//example/workflows/2_control_flow.ts//control_flow"
50+
}
51+
},
52+
"example/workflows/99_e2e.ts": {
53+
"addTenWorkflow": {
54+
"workflowId": "workflow//example/workflows/99_e2e.ts//addTenWorkflow"
55+
},
56+
"fetchWorkflow": {
57+
"workflowId": "workflow//example/workflows/99_e2e.ts//fetchWorkflow"
58+
},
59+
"hookWorkflow": {
60+
"workflowId": "workflow//example/workflows/99_e2e.ts//hookWorkflow"
61+
},
62+
"nullByteWorkflow": {
63+
"workflowId": "workflow//example/workflows/99_e2e.ts//nullByteWorkflow"
64+
},
65+
"outputStreamWorkflow": {
66+
"workflowId": "workflow//example/workflows/99_e2e.ts//outputStreamWorkflow"
67+
},
68+
"promiseAllWorkflow": {
69+
"workflowId": "workflow//example/workflows/99_e2e.ts//promiseAllWorkflow"
70+
},
71+
"promiseAnyWorkflow": {
72+
"workflowId": "workflow//example/workflows/99_e2e.ts//promiseAnyWorkflow"
73+
},
74+
"promiseRaceStressTestWorkflow": {
75+
"workflowId": "workflow//example/workflows/99_e2e.ts//promiseRaceStressTestWorkflow"
76+
},
77+
"promiseRaceWorkflow": {
78+
"workflowId": "workflow//example/workflows/99_e2e.ts//promiseRaceWorkflow"
79+
},
80+
"readableStreamWorkflow": {
81+
"workflowId": "workflow//example/workflows/99_e2e.ts//readableStreamWorkflow"
82+
},
83+
"retryAttemptCounterWorkflow": {
84+
"workflowId": "workflow//example/workflows/99_e2e.ts//retryAttemptCounterWorkflow"
85+
},
86+
"sleepingDateWorkflow": {
87+
"workflowId": "workflow//example/workflows/99_e2e.ts//sleepingDateWorkflow"
88+
},
89+
"sleepingWorkflow": {
90+
"workflowId": "workflow//example/workflows/99_e2e.ts//sleepingWorkflow"
91+
},
92+
"webhookWorkflow": {
93+
"workflowId": "workflow//example/workflows/99_e2e.ts//webhookWorkflow"
94+
},
95+
"workflowAndStepMetadataWorkflow": {
96+
"workflowId": "workflow//example/workflows/99_e2e.ts//workflowAndStepMetadataWorkflow"
97+
}
98+
}
99+
},
100+
"steps": {
101+
"example/workflows/6_batching.ts": {
102+
"logItem": {
103+
"stepId": "step//example/workflows/6_batching.ts//logItem"
104+
},
105+
"processItems": {
106+
"stepId": "step//example/workflows/6_batching.ts//processItems"
107+
}
108+
},
109+
"example/workflows/98_duplicate_case.ts": {
110+
"add": {
111+
"stepId": "step//example/workflows/98_duplicate_case.ts//add"
112+
}
113+
},
114+
"example/workflows/4_ai.ts": {
115+
"getWeatherInformation": {
116+
"stepId": "step//example/workflows/4_ai.ts//getWeatherInformation"
117+
}
118+
},
119+
"workflows/0_demo.ts": {
120+
"pow": {
121+
"stepId": "step//workflows/0_demo.ts//pow"
122+
}
123+
},
124+
"packages/workflow/dist/stdlib.js": {
125+
"fetch": {
126+
"stepId": "step//packages/workflow/dist/stdlib.js//fetch"
127+
},
128+
"sleep": {
129+
"stepId": "step//packages/workflow/dist/stdlib.js//sleep"
130+
}
131+
},
132+
"example/workflows/1_simple.ts": {
133+
"add": {
134+
"stepId": "step//example/workflows/1_simple.ts//add"
135+
}
136+
},
137+
"example/workflows/3_streams.ts": {
138+
"consumeStreams": {
139+
"stepId": "step//example/workflows/3_streams.ts//consumeStreams"
140+
},
141+
"genStream": {
142+
"stepId": "step//example/workflows/3_streams.ts//genStream"
143+
}
144+
},
145+
"example/workflows/5_hooks.ts": {
146+
"getOpenAIResponse": {
147+
"stepId": "step//example/workflows/5_hooks.ts//getOpenAIResponse"
148+
},
149+
"initiateOpenAIResponse": {
150+
"stepId": "step//example/workflows/5_hooks.ts//initiateOpenAIResponse"
151+
},
152+
"stepWithGetMetadata": {
153+
"stepId": "step//example/workflows/5_hooks.ts//stepWithGetMetadata"
154+
}
155+
},
156+
"packages/workflow/dist/internal/builtins.js": {
157+
"__builtin_response_array_buffer": {
158+
"stepId": "__builtin_response_array_buffer"
159+
},
160+
"__builtin_response_json": {
161+
"stepId": "__builtin_response_json"
162+
},
163+
"__builtin_response_text": {
164+
"stepId": "__builtin_response_text"
165+
}
166+
},
167+
"example/workflows/2_control_flow.ts": {
168+
"add": {
169+
"stepId": "step//example/workflows/2_control_flow.ts//add"
170+
},
171+
"delayedMessage": {
172+
"stepId": "step//example/workflows/2_control_flow.ts//delayedMessage"
173+
},
174+
"failingStep": {
175+
"stepId": "step//example/workflows/2_control_flow.ts//failingStep"
176+
},
177+
"retryableStep": {
178+
"stepId": "step//example/workflows/2_control_flow.ts//retryableStep"
179+
}
180+
},
181+
"example/workflows/99_e2e.ts": {
182+
"add": {
183+
"stepId": "step//example/workflows/99_e2e.ts//add"
184+
},
185+
"genReadableStream": {
186+
"stepId": "step//example/workflows/99_e2e.ts//genReadableStream"
187+
},
188+
"nullByteStep": {
189+
"stepId": "step//example/workflows/99_e2e.ts//nullByteStep"
190+
},
191+
"promiseRaceStressTestDelayStep": {
192+
"stepId": "step//example/workflows/99_e2e.ts//promiseRaceStressTestDelayStep"
193+
},
194+
"randomDelay": {
195+
"stepId": "step//example/workflows/99_e2e.ts//randomDelay"
196+
},
197+
"sendWebhookResponse": {
198+
"stepId": "step//example/workflows/99_e2e.ts//sendWebhookResponse"
199+
},
200+
"specificDelay": {
201+
"stepId": "step//example/workflows/99_e2e.ts//specificDelay"
202+
},
203+
"stepCloseOutputStream": {
204+
"stepId": "step//example/workflows/99_e2e.ts//stepCloseOutputStream"
205+
},
206+
"stepThatFails": {
207+
"stepId": "step//example/workflows/99_e2e.ts//stepThatFails"
208+
},
209+
"stepThatRetriesAndSucceeds": {
210+
"stepId": "step//example/workflows/99_e2e.ts//stepThatRetriesAndSucceeds"
211+
},
212+
"stepWithMetadata": {
213+
"stepId": "step//example/workflows/99_e2e.ts//stepWithMetadata"
214+
},
215+
"stepWithOutputStreamBinary": {
216+
"stepId": "step//example/workflows/99_e2e.ts//stepWithOutputStreamBinary"
217+
},
218+
"stepWithOutputStreamObject": {
219+
"stepId": "step//example/workflows/99_e2e.ts//stepWithOutputStreamObject"
220+
}
221+
}
222+
}
223+
}

0 commit comments

Comments
 (0)