@hexabot-ai/agentic 3.0.1-alpha.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 (176) hide show
  1. package/LICENSE.md +120 -0
  2. package/README.md +231 -0
  3. package/dist/cjs/action/abstract-action.js +141 -0
  4. package/dist/cjs/action/action.js +47 -0
  5. package/dist/cjs/action/action.types.js +7 -0
  6. package/dist/cjs/bindings/base-binding.js +278 -0
  7. package/dist/cjs/context.js +79 -0
  8. package/dist/cjs/dsl.types.js +318 -0
  9. package/dist/cjs/index.js +52 -0
  10. package/dist/cjs/runner-runtime-control.js +343 -0
  11. package/dist/cjs/step-executors/conditional-executor.js +63 -0
  12. package/dist/cjs/step-executors/loop-executor.js +187 -0
  13. package/dist/cjs/step-executors/parallel-executor.js +51 -0
  14. package/dist/cjs/step-executors/skip-helpers.js +29 -0
  15. package/dist/cjs/step-executors/task-executor.js +155 -0
  16. package/dist/cjs/step-executors/types.js +7 -0
  17. package/dist/cjs/suspension-rebuilder.js +301 -0
  18. package/dist/cjs/utils/deferred.js +17 -0
  19. package/dist/cjs/utils/naming.js +48 -0
  20. package/dist/cjs/utils/timeout.js +42 -0
  21. package/dist/cjs/utils/workflow-definition.js +102 -0
  22. package/dist/cjs/workflow-compiler.js +212 -0
  23. package/dist/cjs/workflow-event-emitter.js +40 -0
  24. package/dist/cjs/workflow-runner.js +448 -0
  25. package/dist/cjs/workflow-types.js +7 -0
  26. package/dist/cjs/workflow-values.js +99 -0
  27. package/dist/cjs/workflow.js +243 -0
  28. package/dist/esm/action/abstract-action.js +137 -0
  29. package/dist/esm/action/action.js +44 -0
  30. package/dist/esm/action/action.types.js +6 -0
  31. package/dist/esm/bindings/base-binding.js +273 -0
  32. package/dist/esm/context.js +75 -0
  33. package/dist/esm/dsl.types.js +309 -0
  34. package/dist/esm/index.js +16 -0
  35. package/dist/esm/runner-runtime-control.js +338 -0
  36. package/dist/esm/step-executors/conditional-executor.js +60 -0
  37. package/dist/esm/step-executors/loop-executor.js +182 -0
  38. package/dist/esm/step-executors/parallel-executor.js +48 -0
  39. package/dist/esm/step-executors/skip-helpers.js +25 -0
  40. package/dist/esm/step-executors/task-executor.js +152 -0
  41. package/dist/esm/step-executors/types.js +6 -0
  42. package/dist/esm/suspension-rebuilder.js +296 -0
  43. package/dist/esm/utils/deferred.js +14 -0
  44. package/dist/esm/utils/naming.js +42 -0
  45. package/dist/esm/utils/timeout.js +37 -0
  46. package/dist/esm/utils/workflow-definition.js +98 -0
  47. package/dist/esm/workflow-compiler.js +208 -0
  48. package/dist/esm/workflow-event-emitter.js +36 -0
  49. package/dist/esm/workflow-runner.js +444 -0
  50. package/dist/esm/workflow-types.js +6 -0
  51. package/dist/esm/workflow-values.js +89 -0
  52. package/dist/esm/workflow.js +236 -0
  53. package/dist/types/action/abstract-action.d.ts +54 -0
  54. package/dist/types/action/abstract-action.d.ts.map +1 -0
  55. package/dist/types/action/action.d.ts +23 -0
  56. package/dist/types/action/action.d.ts.map +1 -0
  57. package/dist/types/action/action.types.d.ts +55 -0
  58. package/dist/types/action/action.types.d.ts.map +1 -0
  59. package/dist/types/bindings/base-binding.d.ts +52 -0
  60. package/dist/types/bindings/base-binding.d.ts.map +1 -0
  61. package/dist/types/context.d.ts +105 -0
  62. package/dist/types/context.d.ts.map +1 -0
  63. package/dist/types/dsl.types.d.ts +220 -0
  64. package/dist/types/dsl.types.d.ts.map +1 -0
  65. package/dist/types/index.d.ts +18 -0
  66. package/dist/types/index.d.ts.map +1 -0
  67. package/dist/types/runner-runtime-control.d.ts +64 -0
  68. package/dist/types/runner-runtime-control.d.ts.map +1 -0
  69. package/dist/types/step-executors/conditional-executor.d.ts +13 -0
  70. package/dist/types/step-executors/conditional-executor.d.ts.map +1 -0
  71. package/dist/types/step-executors/loop-executor.d.ts +33 -0
  72. package/dist/types/step-executors/loop-executor.d.ts.map +1 -0
  73. package/dist/types/step-executors/parallel-executor.d.ts +14 -0
  74. package/dist/types/step-executors/parallel-executor.d.ts.map +1 -0
  75. package/dist/types/step-executors/skip-helpers.d.ts +12 -0
  76. package/dist/types/step-executors/skip-helpers.d.ts.map +1 -0
  77. package/dist/types/step-executors/task-executor.d.ts +13 -0
  78. package/dist/types/step-executors/task-executor.d.ts.map +1 -0
  79. package/dist/types/step-executors/types.d.ts +24 -0
  80. package/dist/types/step-executors/types.d.ts.map +1 -0
  81. package/dist/types/suspension-rebuilder.d.ts +67 -0
  82. package/dist/types/suspension-rebuilder.d.ts.map +1 -0
  83. package/dist/types/utils/deferred.d.ts +7 -0
  84. package/dist/types/utils/deferred.d.ts.map +1 -0
  85. package/dist/types/utils/naming.d.ts +24 -0
  86. package/dist/types/utils/naming.d.ts.map +1 -0
  87. package/dist/types/utils/timeout.d.ts +17 -0
  88. package/dist/types/utils/timeout.d.ts.map +1 -0
  89. package/dist/types/utils/workflow-definition.d.ts +3 -0
  90. package/dist/types/utils/workflow-definition.d.ts.map +1 -0
  91. package/dist/types/workflow-compiler.d.ts +12 -0
  92. package/dist/types/workflow-compiler.d.ts.map +1 -0
  93. package/dist/types/workflow-event-emitter.d.ts +70 -0
  94. package/dist/types/workflow-event-emitter.d.ts.map +1 -0
  95. package/dist/types/workflow-runner.d.ts +179 -0
  96. package/dist/types/workflow-runner.d.ts.map +1 -0
  97. package/dist/types/workflow-types.d.ts +195 -0
  98. package/dist/types/workflow-types.d.ts.map +1 -0
  99. package/dist/types/workflow-values.d.ts +34 -0
  100. package/dist/types/workflow-values.d.ts.map +1 -0
  101. package/dist/types/workflow.d.ts +75 -0
  102. package/dist/types/workflow.d.ts.map +1 -0
  103. package/examples/defs-bindings-agent/actions/ai-agent.ts +110 -0
  104. package/examples/defs-bindings-agent/actions/caculate-score.ts +49 -0
  105. package/examples/defs-bindings-agent/actions/index.ts +15 -0
  106. package/examples/defs-bindings-agent/bindings.ts +20 -0
  107. package/examples/defs-bindings-agent/context.ts +32 -0
  108. package/examples/defs-bindings-agent/workflow.ts +67 -0
  109. package/examples/defs-bindings-agent/workflow.yml +28 -0
  110. package/examples/full/actions/await-user-input.ts +46 -0
  111. package/examples/full/actions/call-llm.ts +133 -0
  112. package/examples/full/actions/create-ticket.ts +46 -0
  113. package/examples/full/actions/decision-router.ts +83 -0
  114. package/examples/full/actions/get-calendar-events.ts +55 -0
  115. package/examples/full/actions/get-user-profile.ts +72 -0
  116. package/examples/full/actions/index.ts +33 -0
  117. package/examples/full/actions/query-memory.ts +45 -0
  118. package/examples/full/actions/search-web.ts +53 -0
  119. package/examples/full/actions/send-email.ts +50 -0
  120. package/examples/full/context.ts +41 -0
  121. package/examples/full/workflow.ts +75 -0
  122. package/examples/full/workflow.yml +359 -0
  123. package/examples/loop/actions/await-reply.ts +47 -0
  124. package/examples/loop/actions/index.ts +19 -0
  125. package/examples/loop/actions/send-text-message.ts +40 -0
  126. package/examples/loop/context.ts +32 -0
  127. package/examples/loop/workflow.ts +66 -0
  128. package/examples/loop/workflow.yml +66 -0
  129. package/examples/suspend-resume/actions/format-reply.ts +43 -0
  130. package/examples/suspend-resume/actions/index.ts +13 -0
  131. package/examples/suspend-resume/actions/wait-for-user.ts +51 -0
  132. package/examples/suspend-resume/context.ts +32 -0
  133. package/examples/suspend-resume/workflow.ts +79 -0
  134. package/examples/suspend-resume/workflow.yml +29 -0
  135. package/package.json +60 -0
  136. package/src/__tests__/parser.test.ts +95 -0
  137. package/src/__tests__/suspension-rebuilder.test.ts +361 -0
  138. package/src/__tests__/test-helpers.ts +36 -0
  139. package/src/__tests__/validation.test.ts +526 -0
  140. package/src/__tests__/workflow-compiler.test.ts +715 -0
  141. package/src/__tests__/workflow-definition-path.test.ts +381 -0
  142. package/src/__tests__/workflow-event-emitter.test.ts +50 -0
  143. package/src/__tests__/workflow-runner.test.ts +1397 -0
  144. package/src/__tests__/workflow-values.test.ts +132 -0
  145. package/src/__tests__/workflow.test.ts +320 -0
  146. package/src/action/__tests__/abstract-action-timing.test.ts +183 -0
  147. package/src/action/__tests__/action.test.ts +473 -0
  148. package/src/action/abstract-action.ts +215 -0
  149. package/src/action/action.ts +83 -0
  150. package/src/action/action.types.ts +93 -0
  151. package/src/bindings/base-binding.ts +508 -0
  152. package/src/context.ts +179 -0
  153. package/src/dsl.types.ts +473 -0
  154. package/src/index.ts +114 -0
  155. package/src/runner-runtime-control.ts +544 -0
  156. package/src/step-executors/conditional-executor.test.ts +192 -0
  157. package/src/step-executors/conditional-executor.ts +83 -0
  158. package/src/step-executors/loop-executor.test.ts +303 -0
  159. package/src/step-executors/loop-executor.ts +299 -0
  160. package/src/step-executors/parallel-executor.test.ts +182 -0
  161. package/src/step-executors/parallel-executor.ts +77 -0
  162. package/src/step-executors/skip-helpers.ts +68 -0
  163. package/src/step-executors/task-executor.test.ts +257 -0
  164. package/src/step-executors/task-executor.ts +248 -0
  165. package/src/step-executors/types.ts +70 -0
  166. package/src/suspension-rebuilder.ts +504 -0
  167. package/src/utils/deferred.ts +23 -0
  168. package/src/utils/naming.ts +55 -0
  169. package/src/utils/timeout.ts +48 -0
  170. package/src/utils/workflow-definition.ts +173 -0
  171. package/src/workflow-compiler.ts +317 -0
  172. package/src/workflow-event-emitter.ts +86 -0
  173. package/src/workflow-runner.ts +603 -0
  174. package/src/workflow-types.ts +207 -0
  175. package/src/workflow-values.ts +159 -0
  176. package/src/workflow.ts +387 -0
@@ -0,0 +1,72 @@
1
+ /*
2
+ * Hexabot — Fair Core License (FCL-1.0-ALv2)
3
+ * Copyright (c) 2025 Hexastack.
4
+ * Full terms: see LICENSE.md.
5
+ */
6
+
7
+ import { z } from 'zod';
8
+
9
+ import { defineAction } from '../../../src';
10
+ import { SettingsSchema } from '../../../src/dsl.types';
11
+ import type { ExampleContext } from '../context';
12
+
13
+ const stakeholderSchema = z.object({
14
+ name: z.string(),
15
+ email: z.string(),
16
+ role: z.string(),
17
+ });
18
+ const inputSchema = z.object({
19
+ user_id: z.string(),
20
+ include_history: z.boolean().optional(),
21
+ });
22
+ const outputSchema = z.object({
23
+ profile: z.object({
24
+ id: z.string(),
25
+ name: z.string(),
26
+ company: z.string(),
27
+ persona: z.string(),
28
+ stakeholders: z.array(stakeholderSchema),
29
+ }),
30
+ recent_cases: z.array(z.object({ id: z.string(), subject: z.string() })),
31
+ });
32
+ const settingsSchema = SettingsSchema;
33
+
34
+ type GetUserProfileInput = z.infer<typeof inputSchema>;
35
+ type GetUserProfileOutput = z.infer<typeof outputSchema>;
36
+ type GetUserProfileSettings = z.infer<typeof settingsSchema>;
37
+
38
+ export const getUserProfile = defineAction<
39
+ GetUserProfileInput,
40
+ GetUserProfileOutput,
41
+ ExampleContext,
42
+ GetUserProfileSettings
43
+ >({
44
+ name: 'get_user_profile',
45
+ description:
46
+ 'Returns a mocked CRM profile with a couple of stakeholders and prior cases.',
47
+ inputSchema,
48
+ outputSchema,
49
+ settingSchema: settingsSchema,
50
+ execute: async ({ input, context }) => {
51
+ const profile = {
52
+ id: input.user_id,
53
+ name: 'Ada Lovelace',
54
+ company: 'Analytical Engines Inc.',
55
+ persona: 'CTO',
56
+ stakeholders: [
57
+ { name: 'Mia Ops', email: 'mia.ops@example.com', role: 'operations' },
58
+ { name: 'Cal CTO', email: 'cal.cto@example.com', role: 'technology' },
59
+ ],
60
+ };
61
+ const recent_cases = input.include_history
62
+ ? [
63
+ { id: 'case-100', subject: 'Renewal follow-up' },
64
+ { id: 'case-101', subject: 'Product feedback' },
65
+ ]
66
+ : [];
67
+
68
+ context.log('Fetched profile', { user_id: input.user_id });
69
+
70
+ return { profile, recent_cases };
71
+ },
72
+ });
@@ -0,0 +1,33 @@
1
+ /*
2
+ * Hexabot — Fair Core License (FCL-1.0-ALv2)
3
+ * Copyright (c) 2025 Hexastack.
4
+ * Full terms: see LICENSE.md.
5
+ */
6
+
7
+ import type { Action, Settings } from '../../../src';
8
+ import type { ExampleContext } from '../context';
9
+
10
+ import { awaitUserInput } from './await-user-input';
11
+ import { callLlm } from './call-llm';
12
+ import { createTicket } from './create-ticket';
13
+ import { decisionRouter } from './decision-router';
14
+ import { getCalendarEvents } from './get-calendar-events';
15
+ import { getUserProfile } from './get-user-profile';
16
+ import { queryMemory } from './query-memory';
17
+ import { searchWeb } from './search-web';
18
+ import { sendEmail } from './send-email';
19
+
20
+ export const exampleActions: Record<
21
+ string,
22
+ Action<unknown, unknown, ExampleContext, Settings>
23
+ > = {
24
+ call_llm: callLlm,
25
+ get_user_profile: getUserProfile,
26
+ search_web: searchWeb,
27
+ query_memory: queryMemory,
28
+ get_calendar_events: getCalendarEvents,
29
+ await_user_input: awaitUserInput,
30
+ decision_router: decisionRouter,
31
+ create_ticket: createTicket,
32
+ send_email: sendEmail,
33
+ };
@@ -0,0 +1,45 @@
1
+ /*
2
+ * Hexabot — Fair Core License (FCL-1.0-ALv2)
3
+ * Copyright (c) 2025 Hexastack.
4
+ * Full terms: see LICENSE.md.
5
+ */
6
+
7
+ import { z } from 'zod';
8
+
9
+ import { defineAction } from '../../../src';
10
+ import { SettingsSchema } from '../../../src/dsl.types';
11
+ import type { ExampleContext } from '../context';
12
+
13
+ const inputSchema = z.object({
14
+ thread_id: z.string().optional(),
15
+ user_id: z.string().optional(),
16
+ });
17
+ const outputSchema = z.object({
18
+ summary: z.string(),
19
+ });
20
+ const settingsSchema = SettingsSchema;
21
+
22
+ type QueryMemoryInput = z.infer<typeof inputSchema>;
23
+ type QueryMemoryOutput = z.infer<typeof outputSchema>;
24
+ type QueryMemorySettings = z.infer<typeof settingsSchema>;
25
+
26
+ export const queryMemory = defineAction<
27
+ QueryMemoryInput,
28
+ QueryMemoryOutput,
29
+ ExampleContext,
30
+ QueryMemorySettings
31
+ >({
32
+ name: 'query_memory',
33
+ description: 'Returns a canned memory summary for the provided thread.',
34
+ inputSchema,
35
+ outputSchema,
36
+ settingSchema: settingsSchema,
37
+ execute: async ({ input, context }) => {
38
+ context.log('Fetching memory thread', {
39
+ thread_id: input.thread_id,
40
+ user_id: input.user_id,
41
+ });
42
+
43
+ return { summary: 'Previous discussion summarized for quick recall.' };
44
+ },
45
+ });
@@ -0,0 +1,53 @@
1
+ /*
2
+ * Hexabot — Fair Core License (FCL-1.0-ALv2)
3
+ * Copyright (c) 2025 Hexastack.
4
+ * Full terms: see LICENSE.md.
5
+ */
6
+
7
+ import { z } from 'zod';
8
+
9
+ import { defineAction } from '../../../src';
10
+ import { SettingsSchema } from '../../../src/dsl.types';
11
+ import type { ExampleContext } from '../context';
12
+
13
+ const inputSchema = z.object({
14
+ query: z.string(),
15
+ limit: z.number().int().positive().optional(),
16
+ });
17
+ const outputSchema = z.object({
18
+ links: z.array(z.string()),
19
+ snippets: z.array(z.string()),
20
+ });
21
+ const settingsSchema = SettingsSchema;
22
+
23
+ type SearchWebInput = z.infer<typeof inputSchema>;
24
+ type SearchWebOutput = z.infer<typeof outputSchema>;
25
+ type SearchWebSettings = z.infer<typeof settingsSchema>;
26
+
27
+ export const searchWeb = defineAction<
28
+ SearchWebInput,
29
+ SearchWebOutput,
30
+ ExampleContext,
31
+ SearchWebSettings
32
+ >({
33
+ name: 'search_web',
34
+ description: 'Stubbed web search returning predictable links for the demo.',
35
+ inputSchema,
36
+ outputSchema,
37
+ settingSchema: settingsSchema,
38
+ execute: async ({ input, context }) => {
39
+ const limit = input.limit ?? 3;
40
+ context.log('Searching web', { query: input.query, limit });
41
+
42
+ const snippets = Array.from(
43
+ { length: limit },
44
+ (_, index) => `Result ${index + 1} about ${input.query}`,
45
+ );
46
+ const links = snippets.map(
47
+ (snippet, index) =>
48
+ `https://example.com/${index + 1}?q=${encodeURIComponent(input.query)}`,
49
+ );
50
+
51
+ return { links, snippets };
52
+ },
53
+ });
@@ -0,0 +1,50 @@
1
+ /*
2
+ * Hexabot — Fair Core License (FCL-1.0-ALv2)
3
+ * Copyright (c) 2025 Hexastack.
4
+ * Full terms: see LICENSE.md.
5
+ */
6
+
7
+ import { z } from 'zod';
8
+
9
+ import { defineAction } from '../../../src';
10
+ import { SettingsSchema } from '../../../src/dsl.types';
11
+ import type { ExampleContext } from '../context';
12
+
13
+ const inputSchema = z.object({
14
+ to: z.string(),
15
+ subject: z.string(),
16
+ body: z.unknown(),
17
+ track_opens: z.boolean().optional(),
18
+ });
19
+ const outputSchema = z.object({
20
+ status: z.string(),
21
+ acknowledged: z.boolean().optional(),
22
+ });
23
+ const settingsSchema = SettingsSchema;
24
+
25
+ type SendEmailInput = z.infer<typeof inputSchema>;
26
+ type SendEmailOutput = z.infer<typeof outputSchema>;
27
+ type SendEmailSettings = z.infer<typeof settingsSchema>;
28
+
29
+ export const sendEmail = defineAction<
30
+ SendEmailInput,
31
+ SendEmailOutput,
32
+ ExampleContext,
33
+ SendEmailSettings
34
+ >({
35
+ name: 'send_email',
36
+ description:
37
+ 'Pretends to send an email and optionally marks acknowledgement.',
38
+ inputSchema,
39
+ outputSchema,
40
+ settingSchema: settingsSchema,
41
+ execute: async ({ input, context }) => {
42
+ const acknowledged =
43
+ input.subject.toLowerCase().includes('fyi') &&
44
+ input.to.toLowerCase().includes('ops');
45
+
46
+ context.log('Sent email', { to: input.to, subject: input.subject });
47
+
48
+ return { status: 'sent', acknowledged };
49
+ },
50
+ });
@@ -0,0 +1,41 @@
1
+ /*
2
+ * Hexabot — Fair Core License (FCL-1.0-ALv2)
3
+ * Copyright (c) 2025 Hexastack.
4
+ * Full terms: see LICENSE.md.
5
+ */
6
+
7
+ import {
8
+ BaseWorkflowContext,
9
+ WorkflowEventEmitter,
10
+ type WorkflowEventEmitterLike,
11
+ } from '../../src';
12
+
13
+ export type ExampleContextState = {
14
+ user_id: string;
15
+ account_tier: string;
16
+ locale: string;
17
+ timezone: string;
18
+ channel: string;
19
+ thread_id: string;
20
+ full_transcript: string;
21
+ last_summary: string;
22
+ support_playbook: string;
23
+ product_brief: string;
24
+ };
25
+
26
+ export class ExampleContext extends BaseWorkflowContext<ExampleContextState> {
27
+ public eventEmitter: WorkflowEventEmitterLike<WorkflowEventEmitter>;
28
+
29
+ constructor(
30
+ state: ExampleContextState,
31
+ eventEmitter: WorkflowEventEmitterLike<WorkflowEventEmitter> = new WorkflowEventEmitter(),
32
+ ) {
33
+ super(state);
34
+ this.eventEmitter = eventEmitter;
35
+ }
36
+
37
+ log(message: string, payload?: unknown): void {
38
+ const suffix = payload === undefined ? '' : ` ${JSON.stringify(payload)}`;
39
+ console.log(`[workflow] ${message}${suffix}`);
40
+ }
41
+ }
@@ -0,0 +1,75 @@
1
+ /*
2
+ * Hexabot — Fair Core License (FCL-1.0-ALv2)
3
+ * Copyright (c) 2025 Hexastack.
4
+ * Full terms: see LICENSE.md.
5
+ */
6
+
7
+ import fs from 'fs';
8
+ import path from 'path';
9
+
10
+ import { Workflow, WorkflowEventEmitter } from '../../src';
11
+
12
+ import { exampleActions } from './actions';
13
+ import { ExampleContext } from './context';
14
+
15
+ const workflowPath = path.join(__dirname, 'workflow.yml');
16
+
17
+ async function main() {
18
+ const yamlSource = fs.readFileSync(workflowPath, 'utf8');
19
+ const workflow = Workflow.fromYaml(yamlSource, {
20
+ actions: exampleActions,
21
+ });
22
+ const emitter = new WorkflowEventEmitter();
23
+ const context = new ExampleContext(
24
+ {
25
+ user_id: 'user-123',
26
+ account_tier: 'pro',
27
+ locale: 'en-US',
28
+ timezone: 'America/Los_Angeles',
29
+ channel: 'email',
30
+ thread_id: 'thread-123',
31
+ full_transcript: 'Conversation so far with the user.',
32
+ last_summary: 'Previous summary of the issue.',
33
+ support_playbook: 'Support runbook v1.2',
34
+ product_brief: 'Launch messaging and positioning.',
35
+ },
36
+ emitter,
37
+ );
38
+ emitter.on('hook:step:start', ({ step }) =>
39
+ context.log(`hook:step:start:${step.name}`),
40
+ );
41
+ emitter.on('hook:step:success', ({ step }) =>
42
+ context.log(`hook:step:success:${step.name}`),
43
+ );
44
+ emitter.on('hook:workflow:finish', ({ output }) =>
45
+ context.log('hook:workflow:finish', output),
46
+ );
47
+ const runner = await workflow.buildAsyncRunner();
48
+ const inputData = {
49
+ query: 'We are seeing API errors after deploying billing changes.',
50
+ user_email: 'customer@example.com',
51
+ priority: 'normal',
52
+ attachments: [],
53
+ };
54
+ const result = await runner.start({ inputData, context });
55
+
56
+ if (result.status === 'finished') {
57
+ console.log('Final workflow outputs:', result.output);
58
+
59
+ return;
60
+ }
61
+
62
+ if (result.status === 'suspended') {
63
+ console.log(
64
+ `Workflow suspended at step ${result.step.id} for reason "${result.reason}"`,
65
+ result.data,
66
+ );
67
+
68
+ return;
69
+ }
70
+
71
+ console.error('Workflow failed:', result.error);
72
+ }
73
+
74
+ // pnpm dlx ts-node packages/agentic/examples/full/workflow.ts
75
+ void main();