@q1k-oss/behaviour-tree-workflows 0.0.1 → 0.0.2

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.
package/dist/index.d.cts CHANGED
@@ -165,7 +165,7 @@ interface TemporalContext extends TickContext {
165
165
  tokenProvider?: TokenProvider;
166
166
  }
167
167
  /**
168
- * Activity capabilities that can be provided to btree
168
+ * Activity capabilities that can be provided to behaviour-tree
169
169
  * Controlplane creates these via proxyActivities() and passes to context
170
170
  */
171
171
  interface BtreeActivities {
@@ -189,6 +189,18 @@ interface BtreeActivities {
189
189
  deleteFile?: (request: DeleteFileRequest) => Promise<DeleteFileResult>;
190
190
  /** Check if file exists in storage */
191
191
  fileExists?: (request: FileExistsRequest) => Promise<FileExistsResult>;
192
+ /** Execute LLM chat completion */
193
+ llmChat?: (request: LLMChatRequest) => Promise<LLMChatResult>;
194
+ /** Execute autonomous browser agent via Browserbase + Stagehand */
195
+ browserAgent?: (request: BrowserAgentRequest) => Promise<BrowserAgentResult>;
196
+ /** Execute autonomous Claude agent via Claude Agent SDK */
197
+ claudeAgent?: (request: ClaudeAgentRequest) => Promise<ClaudeAgentResult>;
198
+ /** Execute GitHub operations (create branch, PR, merge, etc.) */
199
+ githubAction?: (request: GitHubActionRequest) => Promise<GitHubActionResult>;
200
+ /** Create a human task (inserts into tasks table, returns taskId) */
201
+ createHumanTask?: (request: CreateHumanTaskRequest) => Promise<CreateHumanTaskResult>;
202
+ /** Wait for a human task to be completed (implemented as Temporal condition in workflow) */
203
+ waitForHumanTask?: (request: WaitForHumanTaskRequest) => Promise<WaitForHumanTaskResult>;
192
204
  }
193
205
  /**
194
206
  * Authentication credentials for a piece
@@ -383,6 +395,299 @@ interface CodeExecutionResult {
383
395
  /** Total execution time in milliseconds */
384
396
  executionTimeMs: number;
385
397
  }
398
+ /**
399
+ * Supported LLM providers
400
+ */
401
+ type LLMProvider = "anthropic" | "openai" | "google" | "ollama";
402
+ /**
403
+ * Message role in conversation
404
+ */
405
+ type MessageRole = "system" | "user" | "assistant";
406
+ /**
407
+ * Single message in a conversation
408
+ */
409
+ interface LLMMessage {
410
+ role: MessageRole;
411
+ content: string;
412
+ }
413
+ /**
414
+ * Request for LLM chat completion
415
+ */
416
+ interface LLMChatRequest {
417
+ /** LLM provider to use */
418
+ provider: LLMProvider;
419
+ /** Model identifier (e.g., "claude-sonnet-4-20250514", "gpt-4", "gemini-pro") */
420
+ model: string;
421
+ /** Conversation messages */
422
+ messages: LLMMessage[];
423
+ /** Optional system prompt (prepended as system message) */
424
+ systemPrompt?: string;
425
+ /** Sampling temperature (0-2, default: 1) */
426
+ temperature?: number;
427
+ /** Maximum tokens to generate */
428
+ maxTokens?: number;
429
+ /** Response format: "text" or "json" */
430
+ responseFormat?: "text" | "json";
431
+ /** JSON schema for structured output (when responseFormat is "json") */
432
+ jsonSchema?: Record<string, unknown>;
433
+ /** Request timeout in milliseconds */
434
+ timeout?: number;
435
+ /** Ollama-specific: base URL for local instance */
436
+ baseUrl?: string;
437
+ }
438
+ /**
439
+ * Result from LLM chat completion
440
+ */
441
+ interface LLMChatResult {
442
+ /** Generated response content */
443
+ content: string;
444
+ /** Parsed JSON if responseFormat was "json" */
445
+ parsed?: unknown;
446
+ /** Token usage statistics */
447
+ usage: {
448
+ promptTokens: number;
449
+ completionTokens: number;
450
+ totalTokens: number;
451
+ };
452
+ /** Model used for completion */
453
+ model: string;
454
+ /** Finish reason */
455
+ finishReason: "stop" | "length" | "content_filter" | "tool_calls" | "error";
456
+ }
457
+ /**
458
+ * Request for autonomous browser agent execution
459
+ */
460
+ interface BrowserAgentRequest {
461
+ /** Goal/instruction for the agent to achieve */
462
+ goal: string;
463
+ /** Starting URL (optional - agent may navigate) */
464
+ startUrl?: string;
465
+ /** Context ID for persisting cookies/auth/cache (server-side) */
466
+ contextId?: string;
467
+ /** Whether to persist context changes (default: false) */
468
+ persistContext?: boolean;
469
+ /** Timeout for entire agent execution (ms) */
470
+ timeout?: number;
471
+ /** Max steps/actions the agent can take */
472
+ maxSteps?: number;
473
+ /** LLM provider for agent reasoning */
474
+ llmProvider?: LLMProvider;
475
+ /** LLM model for agent reasoning */
476
+ llmModel?: string;
477
+ }
478
+ /**
479
+ * Result from browser agent execution
480
+ */
481
+ interface BrowserAgentResult {
482
+ /** Whether the agent achieved the goal (from Stagehand) */
483
+ success: boolean;
484
+ /** Whether execution completed (false if hit maxSteps limit) */
485
+ completed: boolean;
486
+ /** Human-readable summary of what was accomplished */
487
+ message: string;
488
+ actions: Array<{
489
+ type: string;
490
+ reasoning?: string;
491
+ taskCompleted: boolean;
492
+ pageUrl: string;
493
+ timestamp: number;
494
+ }>;
495
+ usage: {
496
+ inputTokens: number;
497
+ outputTokens: number;
498
+ reasoningTokens: number;
499
+ };
500
+ /** Browserbase session ID */
501
+ sessionId: string;
502
+ /** URL to view session recording */
503
+ debugUrl: string;
504
+ /** Final URL after agent execution */
505
+ finalUrl: string;
506
+ /** Context ID (for use in subsequent calls) */
507
+ contextId?: string;
508
+ executionTimeMs: number;
509
+ }
510
+ /**
511
+ * MCP server configuration for ClaudeAgent
512
+ */
513
+ type ClaudeAgentMcpServerConfig = {
514
+ type?: "stdio";
515
+ command: string;
516
+ args?: string[];
517
+ env?: Record<string, string>;
518
+ } | {
519
+ type: "sse";
520
+ url: string;
521
+ headers?: Record<string, string>;
522
+ } | {
523
+ type: "http";
524
+ url: string;
525
+ headers?: Record<string, string>;
526
+ };
527
+ /**
528
+ * Subagent definition for ClaudeAgent
529
+ */
530
+ interface ClaudeAgentSubagent {
531
+ description: string;
532
+ prompt: string;
533
+ tools?: string[];
534
+ model?: "sonnet" | "opus" | "haiku" | "inherit";
535
+ }
536
+ /**
537
+ * Request for autonomous Claude agent execution
538
+ */
539
+ interface ClaudeAgentRequest {
540
+ /** Task prompt for the agent */
541
+ prompt: string;
542
+ /** Model to use (e.g., "claude-sonnet-4-5-20250929") */
543
+ model?: string;
544
+ /** System prompt for agent behavior */
545
+ systemPrompt?: string;
546
+ /** Tools the agent can use (e.g., ["Read", "Write", "Edit", "Bash"]) */
547
+ allowedTools?: string[];
548
+ /** Permission mode: default, acceptEdits, bypassPermissions */
549
+ permissionMode?: "default" | "acceptEdits" | "bypassPermissions";
550
+ /** Maximum conversation turns */
551
+ maxTurns?: number;
552
+ /** Maximum budget in USD */
553
+ maxBudgetUsd?: number;
554
+ /** Working directory for the agent */
555
+ cwd?: string;
556
+ /** MCP server configurations */
557
+ mcpServers?: Record<string, ClaudeAgentMcpServerConfig>;
558
+ /** Subagent definitions */
559
+ agents?: Record<string, ClaudeAgentSubagent>;
560
+ /** Extra context data passed from blackboard */
561
+ context?: Record<string, unknown>;
562
+ }
563
+ /**
564
+ * Result from Claude agent execution
565
+ */
566
+ interface ClaudeAgentResult {
567
+ /** Final text result from the agent */
568
+ result: string;
569
+ /** Session ID for resuming/continuing */
570
+ sessionId: string;
571
+ /** Whether the agent completed successfully */
572
+ success: boolean;
573
+ /** Number of conversation turns used */
574
+ numTurns: number;
575
+ /** Total cost in USD */
576
+ totalCostUsd: number;
577
+ /** Token usage statistics */
578
+ usage: {
579
+ inputTokens: number;
580
+ outputTokens: number;
581
+ cacheReadTokens: number;
582
+ cacheCreationTokens: number;
583
+ };
584
+ /** Execution duration in milliseconds */
585
+ durationMs: number;
586
+ /** Errors encountered during execution */
587
+ errors?: string[];
588
+ }
589
+ /**
590
+ * Supported GitHub operations
591
+ */
592
+ type GitHubOperation = "createBranch" | "createPullRequest" | "getPullRequest" | "mergePullRequest" | "closePullRequest" | "createReview" | "listIssues" | "addLabels" | "createComment" | "createRelease";
593
+ /**
594
+ * Request for a GitHub operation
595
+ */
596
+ interface GitHubActionRequest {
597
+ /** The operation to perform */
598
+ operation: GitHubOperation;
599
+ /** Repository in "owner/repo" format */
600
+ repo: string;
601
+ /** Operation-specific parameters */
602
+ params: Record<string, unknown>;
603
+ }
604
+ /**
605
+ * Result of a GitHub operation
606
+ */
607
+ interface GitHubActionResult {
608
+ /** Whether the operation succeeded */
609
+ success: boolean;
610
+ /** Operation-specific response data */
611
+ data: unknown;
612
+ /** The operation that was performed */
613
+ operation: GitHubOperation;
614
+ }
615
+ /**
616
+ * A2UI component definition for human task surfaces
617
+ */
618
+ interface A2UIComponent {
619
+ id: string;
620
+ component: Record<string, unknown>;
621
+ weight?: number;
622
+ }
623
+ /**
624
+ * Request to create a human task
625
+ */
626
+ interface CreateHumanTaskRequest {
627
+ /** Btree node ID that created this task */
628
+ nodeId: string;
629
+ /** Tenant ID for multi-tenancy */
630
+ tenantId: string;
631
+ /** Execution/workflow ID */
632
+ executionId: string;
633
+ /** Task title */
634
+ title: string;
635
+ /** Task description */
636
+ description?: string;
637
+ /** Direct assignee email */
638
+ assigneeEmail?: string;
639
+ /** Role-based assignment */
640
+ assigneeRole?: string;
641
+ /** A2UI component definitions (the frozen surface template) */
642
+ a2uiComponents: A2UIComponent[];
643
+ /** Resolved A2UI data model (bindings already evaluated) */
644
+ a2uiDataModel: Record<string, unknown>;
645
+ /** Timeout in milliseconds before task expires */
646
+ timeoutMs?: number;
647
+ /** What to do on timeout: 'expire' | 'approve' | 'reject' */
648
+ onTimeout?: string;
649
+ /** Optional metadata */
650
+ metadata?: Record<string, unknown>;
651
+ }
652
+ /**
653
+ * Result from creating a human task
654
+ */
655
+ interface CreateHumanTaskResult {
656
+ /** Generated task ID (UUID) */
657
+ taskId: string;
658
+ /** URL where the task can be accessed */
659
+ taskUrl: string;
660
+ }
661
+ /**
662
+ * Request to wait for a human task to be completed
663
+ */
664
+ interface WaitForHumanTaskRequest {
665
+ /** Task ID to wait for */
666
+ taskId: string;
667
+ /** Node ID (for signal routing) */
668
+ nodeId: string;
669
+ /** Timeout in milliseconds */
670
+ timeoutMs?: number;
671
+ /** What to do on timeout */
672
+ onTimeout?: string;
673
+ }
674
+ /**
675
+ * Result from a completed human task
676
+ */
677
+ interface WaitForHumanTaskResult {
678
+ /** Whether the task was completed (vs timed out) */
679
+ completed: boolean;
680
+ /** Submitted form data from the user */
681
+ submittedData?: Record<string, unknown>;
682
+ /** Decision string (e.g., 'approved', 'rejected') */
683
+ decision?: string;
684
+ /** User ID who completed the task */
685
+ completedBy?: string;
686
+ /** Timestamp when completed */
687
+ completedAt?: string;
688
+ /** Whether the task timed out */
689
+ timedOut?: boolean;
690
+ }
386
691
  /**
387
692
  * Port definition for typed inputs/outputs
388
693
  */
@@ -738,9 +1043,9 @@ declare class BehaviorTree {
738
1043
  *
739
1044
  * @example
740
1045
  * ```typescript
741
- * import { BehaviorTree } from '@wayfarer-ai/btree';
742
- * import { Sequence } from '@wayfarer-ai/btree';
743
- * import { PrintAction } from '@wayfarer-ai/btree';
1046
+ * import { BehaviorTree } from '@q1k-oss/behaviour-tree-workflows';
1047
+ * import { Sequence } from '@q1k-oss/behaviour-tree-workflows';
1048
+ * import { PrintAction } from '@q1k-oss/behaviour-tree-workflows';
744
1049
  *
745
1050
  * const root = new Sequence({ id: 'root' });
746
1051
  * root.addChild(new PrintAction({ id: 'step1', message: 'Hello' }));
@@ -1421,7 +1726,7 @@ declare class Registry {
1421
1726
  *
1422
1727
  * @example
1423
1728
  * ```typescript
1424
- * import { Registry, registerStandardNodes } from '@wayfarer-ai/btree';
1729
+ * import { Registry, registerStandardNodes } from '@q1k-oss/behaviour-tree-workflows';
1425
1730
  *
1426
1731
  * const registry = new Registry();
1427
1732
  * registerStandardNodes(registry);
@@ -2426,7 +2731,7 @@ declare const schemaRegistry: SchemaRegistry;
2426
2731
 
2427
2732
  /**
2428
2733
  * Template Loader
2429
- * Load YAML template files from a directory and register them in the btree Registry.
2734
+ * Load YAML template files from a directory and register them in the behaviour-tree Registry.
2430
2735
  * Templates can then be referenced by SubTree nodes using their template ID.
2431
2736
  */
2432
2737
 
@@ -2596,7 +2901,7 @@ declare const envTokenProvider: TokenProvider;
2596
2901
  * Dynamically executes Active Pieces actions
2597
2902
  *
2598
2903
  * Active Pieces is an open-source automation platform with 440+ connectors.
2599
- * This module wraps their npm packages for use in btree workflows.
2904
+ * This module wraps their npm packages for use in behaviour-tree workflows.
2600
2905
  *
2601
2906
  * @see https://activepieces.com/docs
2602
2907
  */
@@ -3038,6 +3343,481 @@ declare class CodeExecution extends ActionNode {
3038
3343
  protected executeTick(context: TemporalContext): Promise<NodeStatus>;
3039
3344
  }
3040
3345
 
3346
+ /**
3347
+ * LLMChat Node
3348
+ *
3349
+ * Executes LLM chat completion via a Temporal activity.
3350
+ * This node requires the `llmChat` activity to be configured in the context -
3351
+ * it does not support standalone/inline execution because LLM API calls require
3352
+ * capabilities outside the workflow sandbox.
3353
+ *
3354
+ * Features:
3355
+ * - Multi-provider support (Anthropic, OpenAI, Google, Ollama)
3356
+ * - Variable resolution in messages and system prompt
3357
+ * - JSON response format with schema validation
3358
+ * - Token usage tracking
3359
+ * - Result stored in blackboard
3360
+ */
3361
+
3362
+ /**
3363
+ * Configuration for LLMChat node
3364
+ */
3365
+ interface LLMChatConfig extends NodeConfiguration {
3366
+ /** LLM provider: anthropic, openai, google, ollama */
3367
+ provider: LLMProvider;
3368
+ /** Model identifier (supports ${bb.model} resolution) */
3369
+ model: string;
3370
+ /** Conversation messages (supports variable resolution in content) */
3371
+ messages: Array<{
3372
+ role: MessageRole;
3373
+ content: string;
3374
+ }>;
3375
+ /** Optional system prompt (supports variable resolution) */
3376
+ systemPrompt?: string;
3377
+ /** Sampling temperature (0-2) */
3378
+ temperature?: number;
3379
+ /** Maximum tokens to generate */
3380
+ maxTokens?: number;
3381
+ /** Response format */
3382
+ responseFormat?: "text" | "json";
3383
+ /** JSON schema for structured output */
3384
+ jsonSchema?: Record<string, unknown>;
3385
+ /** Request timeout in milliseconds */
3386
+ timeout?: number;
3387
+ /** Ollama base URL for local instance */
3388
+ baseUrl?: string;
3389
+ /** Output key on blackboard for response */
3390
+ outputKey: string;
3391
+ }
3392
+ /**
3393
+ * LLMChat Node
3394
+ *
3395
+ * Executes LLM chat completion via a Temporal activity and stores the response in blackboard.
3396
+ * Requires the `llmChat` activity to be configured.
3397
+ *
3398
+ * @example YAML - Basic Usage
3399
+ * ```yaml
3400
+ * type: LLMChat
3401
+ * id: summarize
3402
+ * props:
3403
+ * provider: anthropic
3404
+ * model: claude-sonnet-4-20250514
3405
+ * systemPrompt: "You are a helpful assistant."
3406
+ * messages:
3407
+ * - role: user
3408
+ * content: "Summarize: ${bb.documentText}"
3409
+ * temperature: 0.7
3410
+ * maxTokens: 1000
3411
+ * outputKey: summary
3412
+ * ```
3413
+ *
3414
+ * @example YAML - JSON Response
3415
+ * ```yaml
3416
+ * type: LLMChat
3417
+ * id: extract-entities
3418
+ * props:
3419
+ * provider: openai
3420
+ * model: gpt-4
3421
+ * messages:
3422
+ * - role: user
3423
+ * content: "Extract entities from: ${bb.text}"
3424
+ * responseFormat: json
3425
+ * jsonSchema:
3426
+ * type: object
3427
+ * properties:
3428
+ * people: { type: array, items: { type: string } }
3429
+ * organizations: { type: array, items: { type: string } }
3430
+ * outputKey: entities
3431
+ * ```
3432
+ */
3433
+ declare class LLMChat extends ActionNode {
3434
+ private provider;
3435
+ private model;
3436
+ private messages;
3437
+ private systemPrompt?;
3438
+ private temperature?;
3439
+ private maxTokens?;
3440
+ private responseFormat;
3441
+ private jsonSchema?;
3442
+ private timeout?;
3443
+ private baseUrl?;
3444
+ private outputKey;
3445
+ constructor(config: LLMChatConfig);
3446
+ protected executeTick(context: TemporalContext): Promise<NodeStatus>;
3447
+ }
3448
+
3449
+ /**
3450
+ * BrowserAgent Node
3451
+ *
3452
+ * Executes autonomous browser agent via Browserbase + Stagehand.
3453
+ * This node requires the `browserAgent` activity to be configured in the context -
3454
+ * it does not support standalone/inline execution because browser automation requires
3455
+ * capabilities outside the workflow sandbox.
3456
+ *
3457
+ * Features:
3458
+ * - Goal-directed autonomous web navigation
3459
+ * - Browserbase Contexts for session persistence (cookies, auth, cache)
3460
+ * - Session recording via Browserbase for debugging/audit
3461
+ * - Variable resolution in goal and startUrl
3462
+ * - Result stored in blackboard with debugUrl for session replay
3463
+ */
3464
+
3465
+ /**
3466
+ * Configuration for BrowserAgent node
3467
+ */
3468
+ interface BrowserAgentConfig extends NodeConfiguration {
3469
+ /** Goal for the agent to achieve (supports variable resolution) */
3470
+ goal: string;
3471
+ /** Starting URL (optional, supports variable resolution) */
3472
+ startUrl?: string;
3473
+ /** Blackboard key to store/retrieve contextId */
3474
+ contextKey?: string;
3475
+ /** Whether to persist context changes (cookies, auth, cache) */
3476
+ persistContext?: boolean;
3477
+ /** Timeout for entire agent execution (ms) */
3478
+ timeout?: number;
3479
+ /** Max steps/actions the agent can take */
3480
+ maxSteps?: number;
3481
+ /** LLM provider for Stagehand agent */
3482
+ llmProvider?: LLMProvider;
3483
+ /** LLM model for Stagehand agent */
3484
+ llmModel?: string;
3485
+ /** Output key on blackboard for result */
3486
+ outputKey: string;
3487
+ }
3488
+ /**
3489
+ * BrowserAgent Node
3490
+ *
3491
+ * Executes autonomous browser agent via Browserbase + Stagehand and stores the result in blackboard.
3492
+ * Requires the `browserAgent` activity to be configured.
3493
+ *
3494
+ * @example YAML - Basic Usage
3495
+ * ```yaml
3496
+ * type: BrowserAgent
3497
+ * id: search
3498
+ * props:
3499
+ * goal: "Search for weather in NYC and extract the temperature"
3500
+ * startUrl: "https://google.com"
3501
+ * timeout: 60000
3502
+ * maxSteps: 15
3503
+ * outputKey: searchResult
3504
+ * ```
3505
+ *
3506
+ * @example YAML - Multi-Step with Context Persistence
3507
+ * ```yaml
3508
+ * type: Sequence
3509
+ * id: authenticated-scrape
3510
+ * children:
3511
+ * - type: BrowserAgent
3512
+ * id: login
3513
+ * props:
3514
+ * goal: "Login with username ${input.user} and password ${input.pass}"
3515
+ * startUrl: "${input.loginUrl}"
3516
+ * contextKey: browserContext
3517
+ * persistContext: true
3518
+ * outputKey: loginResult
3519
+ *
3520
+ * - type: BrowserAgent
3521
+ * id: scrape
3522
+ * props:
3523
+ * goal: "Navigate to dashboard and extract all data as JSON"
3524
+ * contextKey: browserContext
3525
+ * outputKey: scrapeResult
3526
+ * ```
3527
+ */
3528
+ declare class BrowserAgent extends ActionNode {
3529
+ private goal;
3530
+ private startUrl?;
3531
+ private contextKey?;
3532
+ private persistContext;
3533
+ private timeout?;
3534
+ private maxSteps?;
3535
+ private llmProvider?;
3536
+ private llmModel?;
3537
+ private outputKey;
3538
+ constructor(config: BrowserAgentConfig);
3539
+ protected executeTick(context: TemporalContext): Promise<NodeStatus>;
3540
+ }
3541
+
3542
+ /**
3543
+ * ClaudeAgent Node
3544
+ *
3545
+ * Executes an autonomous Claude agent via a Temporal activity.
3546
+ * This node requires the `claudeAgent` activity to be configured in the context -
3547
+ * it does not support standalone/inline execution because agent execution requires
3548
+ * capabilities outside the workflow sandbox.
3549
+ *
3550
+ * Features:
3551
+ * - Goal-driven autonomous coding agent (powered by Claude Agent SDK)
3552
+ * - Configurable tools, permissions, and cost limits
3553
+ * - MCP server integration for external tools
3554
+ * - Subagent support for delegating specialized tasks
3555
+ * - Variable resolution in prompt, systemPrompt, model, and cwd
3556
+ * - Session ID returned for resuming/continuing agent conversations
3557
+ * - Result stored in blackboard
3558
+ */
3559
+
3560
+ /**
3561
+ * Configuration for ClaudeAgent node
3562
+ */
3563
+ interface ClaudeAgentConfig extends NodeConfiguration {
3564
+ /** Task prompt for the agent (supports variable resolution) */
3565
+ prompt: string;
3566
+ /** Model to use, e.g. "claude-sonnet-4-5-20250929" (supports variable resolution) */
3567
+ model?: string;
3568
+ /** System prompt for agent behavior (supports variable resolution) */
3569
+ systemPrompt?: string;
3570
+ /** Tools the agent can use (e.g., ["Read", "Write", "Edit", "Bash"]) */
3571
+ allowedTools?: string[];
3572
+ /** Permission mode: default, acceptEdits, bypassPermissions */
3573
+ permissionMode?: "default" | "acceptEdits" | "bypassPermissions";
3574
+ /** Maximum conversation turns */
3575
+ maxTurns?: number;
3576
+ /** Maximum budget in USD */
3577
+ maxBudgetUsd?: number;
3578
+ /** Working directory for the agent (supports variable resolution) */
3579
+ cwd?: string;
3580
+ /** MCP server configurations */
3581
+ mcpServers?: Record<string, ClaudeAgentMcpServerConfig>;
3582
+ /** Subagent definitions */
3583
+ agents?: Record<string, ClaudeAgentSubagent>;
3584
+ /** Output key on blackboard for result */
3585
+ outputKey: string;
3586
+ }
3587
+ /**
3588
+ * ClaudeAgent Node
3589
+ *
3590
+ * Executes an autonomous Claude agent via the Claude Agent SDK and stores
3591
+ * the result in blackboard. Requires the `claudeAgent` activity to be configured.
3592
+ *
3593
+ * @example YAML - Basic coding task
3594
+ * ```yaml
3595
+ * type: ClaudeAgent
3596
+ * id: implement-feature
3597
+ * props:
3598
+ * prompt: "Add unit tests for the auth module"
3599
+ * allowedTools: [Read, Write, Edit, Bash, Glob, Grep]
3600
+ * permissionMode: acceptEdits
3601
+ * outputKey: agentResult
3602
+ * ```
3603
+ *
3604
+ * @example YAML - Dev workflow with PR creation
3605
+ * ```yaml
3606
+ * type: ClaudeAgent
3607
+ * id: dev-task
3608
+ * props:
3609
+ * prompt: "${bb.taskDescription}"
3610
+ * systemPrompt: |
3611
+ * You are working on @q1k-oss/behaviour-tree-workflows.
3612
+ * Read CLAUDE.md for project conventions.
3613
+ * Create a branch, implement changes, commit, push, and create a PR.
3614
+ * allowedTools: [Read, Write, Edit, Bash, Glob, Grep]
3615
+ * permissionMode: acceptEdits
3616
+ * maxTurns: 100
3617
+ * maxBudgetUsd: 10.0
3618
+ * outputKey: agentResult
3619
+ * ```
3620
+ */
3621
+ declare class ClaudeAgent extends ActionNode {
3622
+ private prompt;
3623
+ private model?;
3624
+ private systemPrompt?;
3625
+ private allowedTools?;
3626
+ private permissionMode;
3627
+ private maxTurns;
3628
+ private maxBudgetUsd?;
3629
+ private agentCwd?;
3630
+ private mcpServers?;
3631
+ private agents?;
3632
+ private outputKey;
3633
+ constructor(config: ClaudeAgentConfig);
3634
+ protected executeTick(context: TemporalContext): Promise<NodeStatus>;
3635
+ }
3636
+
3637
+ /**
3638
+ * GitHubAction Node
3639
+ *
3640
+ * Executes deterministic GitHub operations via a Temporal activity.
3641
+ * This node requires the `githubAction` activity to be configured in the context -
3642
+ * it does not support standalone/inline execution because GitHub API access requires
3643
+ * capabilities outside the workflow sandbox.
3644
+ *
3645
+ * Features:
3646
+ * - 10 supported operations (branches, PRs, reviews, issues, releases)
3647
+ * - Variable resolution in repo and params
3648
+ * - Auth handled at activity layer — no tokens in YAML
3649
+ * - Result stored in blackboard
3650
+ *
3651
+ * @example YAML - Create a PR
3652
+ * ```yaml
3653
+ * type: GitHubAction
3654
+ * id: create-pr
3655
+ * props:
3656
+ * operation: createPullRequest
3657
+ * repo: "${input.repo}"
3658
+ * params:
3659
+ * title: "feat: new feature"
3660
+ * body: "Description"
3661
+ * head: "feat/branch"
3662
+ * base: "main"
3663
+ * outputKey: prResult
3664
+ * ```
3665
+ */
3666
+
3667
+ /**
3668
+ * Configuration for GitHubAction node
3669
+ */
3670
+ interface GitHubActionConfig extends NodeConfiguration {
3671
+ /** The GitHub operation to perform */
3672
+ operation: GitHubOperation;
3673
+ /** Repository in "owner/repo" format (supports variable resolution) */
3674
+ repo: string;
3675
+ /** Operation-specific parameters (string values support variable resolution) */
3676
+ params?: Record<string, unknown>;
3677
+ /** Output key on blackboard for result */
3678
+ outputKey: string;
3679
+ }
3680
+ /**
3681
+ * GitHubAction Node
3682
+ *
3683
+ * Executes deterministic GitHub operations (branches, PRs, reviews, issues,
3684
+ * releases) via an activity and stores the result in blackboard.
3685
+ */
3686
+ declare class GitHubAction extends ActionNode {
3687
+ private operation;
3688
+ private repo;
3689
+ private params;
3690
+ private outputKey;
3691
+ constructor(config: GitHubActionConfig);
3692
+ protected executeTick(context: TemporalContext): Promise<NodeStatus>;
3693
+ }
3694
+
3695
+ /**
3696
+ * HumanTask Node
3697
+ *
3698
+ * Pauses workflow execution to present an A2UI surface to a human user
3699
+ * and waits for their response. This node requires the `createHumanTask`
3700
+ * and `waitForHumanTask` activities to be configured in the context.
3701
+ *
3702
+ * Features:
3703
+ * - A2UI component-based UI definition (frozen at design time)
3704
+ * - Data bindings from workflow context (blackboard/input) to A2UI data model
3705
+ * - Variable resolution in title, description, and assignee
3706
+ * - Configurable timeout with onTimeout behavior
3707
+ * - Response data stored in blackboard
3708
+ *
3709
+ * The actual waiting is handled by the Temporal workflow layer using
3710
+ * condition() + signals, not by blocking the activity.
3711
+ */
3712
+
3713
+ /**
3714
+ * Configuration for HumanTask node
3715
+ */
3716
+ interface HumanTaskConfig extends NodeConfiguration {
3717
+ /** Task title (supports ${bb.x} / ${input.x} resolution) */
3718
+ title: string;
3719
+ /** Task description (supports variable resolution) */
3720
+ description?: string;
3721
+ /** Assignee email (supports variable resolution) */
3722
+ assignee?: string;
3723
+ /** Role-based assignment */
3724
+ assigneeRole?: string;
3725
+ /** A2UI surface definition */
3726
+ a2ui: {
3727
+ /** Component tree definitions */
3728
+ components: A2UIComponent[];
3729
+ /** Maps A2UI JSON Pointer paths to btree expressions */
3730
+ dataBindings?: Record<string, string>;
3731
+ };
3732
+ /** Timeout in milliseconds (default: 24h) */
3733
+ timeoutMs?: number;
3734
+ /** Behavior on timeout: 'expire' | 'approve' | 'reject' */
3735
+ onTimeout?: string;
3736
+ /** Blackboard key prefix for response data (default: node id) */
3737
+ outputKey?: string;
3738
+ }
3739
+ /**
3740
+ * HumanTask Node
3741
+ *
3742
+ * Creates a human task with an A2UI surface and waits for the user to respond.
3743
+ *
3744
+ * @example YAML
3745
+ * ```yaml
3746
+ * type: HumanTask
3747
+ * id: expense-approval
3748
+ * props:
3749
+ * title: "Expense Approval"
3750
+ * description: "Review expense request from ${input.employeeName}"
3751
+ * assignee: "${input.managerEmail}"
3752
+ * a2ui:
3753
+ * components:
3754
+ * - id: root
3755
+ * component:
3756
+ * Column:
3757
+ * children:
3758
+ * explicitList: [header, amount-field, actions]
3759
+ * - id: header
3760
+ * component:
3761
+ * Text:
3762
+ * text: { path: '/title' }
3763
+ * - id: amount-field
3764
+ * component:
3765
+ * TextField:
3766
+ * text: { path: '/form/amount' }
3767
+ * label: { literalString: 'Amount ($)' }
3768
+ * - id: actions
3769
+ * component:
3770
+ * Row:
3771
+ * children:
3772
+ * explicitList: [approve-btn, reject-btn]
3773
+ * - id: approve-btn
3774
+ * component:
3775
+ * Button:
3776
+ * child: approve-text
3777
+ * primary: true
3778
+ * action:
3779
+ * name: submit
3780
+ * context:
3781
+ * - key: decision
3782
+ * value: { literalString: approved }
3783
+ * - id: approve-text
3784
+ * component:
3785
+ * Text:
3786
+ * text: { literalString: Approve }
3787
+ * - id: reject-btn
3788
+ * component:
3789
+ * Button:
3790
+ * child: reject-text
3791
+ * action:
3792
+ * name: submit
3793
+ * context:
3794
+ * - key: decision
3795
+ * value: { literalString: rejected }
3796
+ * - id: reject-text
3797
+ * component:
3798
+ * Text:
3799
+ * text: { literalString: Reject }
3800
+ * dataBindings:
3801
+ * /title: "Expense Request from ${input.employeeName}"
3802
+ * /form/amount: "${input.requestedAmount}"
3803
+ * timeoutMs: 86400000
3804
+ * onTimeout: expire
3805
+ * outputKey: approval
3806
+ * ```
3807
+ */
3808
+ declare class HumanTask extends ActionNode {
3809
+ private title;
3810
+ private description?;
3811
+ private assignee?;
3812
+ private assigneeRole?;
3813
+ private a2ui;
3814
+ private timeoutMs;
3815
+ private onTimeout;
3816
+ private outputKey?;
3817
+ constructor(config: HumanTaskConfig);
3818
+ protected executeTick(context: TemporalContext): Promise<NodeStatus>;
3819
+ }
3820
+
3041
3821
  /**
3042
3822
  * Observability types for workflow execution tracking
3043
3823
  * Used by ExecutionTracker and Analyzer Agent
@@ -3241,7 +4021,7 @@ declare class ExecutionTracker {
3241
4021
  * Usage in workflow:
3242
4022
  * ```typescript
3243
4023
  * import { proxySinks } from '@temporalio/workflow';
3244
- * import type { ObservabilitySinks } from '@wayfarer-ai/btree-workflows';
4024
+ * import type { ObservabilitySinks } from '@q1k-oss/behaviour-tree-workflows';
3245
4025
  *
3246
4026
  * const { events } = proxySinks<ObservabilitySinks>();
3247
4027
  * events.push(nodeEvent); // Fire-and-forget
@@ -3301,7 +4081,7 @@ type InjectedObservabilitySinks = {
3301
4081
  *
3302
4082
  * Usage in worker:
3303
4083
  * ```typescript
3304
- * import { createObservabilitySinkHandler } from '@wayfarer-ai/btree-workflows';
4084
+ * import { createObservabilitySinkHandler } from '@q1k-oss/behaviour-tree-workflows';
3305
4085
  *
3306
4086
  * const sinks = createObservabilitySinkHandler({
3307
4087
  * onEvent: (workflowId, runId, event) => {
@@ -3317,4 +4097,4 @@ type InjectedObservabilitySinks = {
3317
4097
  */
3318
4098
  declare function createObservabilitySinkHandler(config?: SinkHandlerConfig): InjectedObservabilitySinks;
3319
4099
 
3320
- export { ActionNode, AlwaysCondition, BaseNode, BehaviorTree, type BtreeActivities, CheckCondition, CodeExecution, type CodeExecutionConfig, type CodeExecutionRequest, type CodeExecutionResult, CompositeNode, ConditionNode, Conditional, ConfigValidationError, ConfigurationError, CounterAction, type DataRef$1 as DataRef, type DataStore, DecoratorNode, Delay, type DeleteFileRequest, type DeleteFileResult, type DownloadFileRequest, type DownloadFileResult, type ExecutionProgress, ExecutionTracker, FailureNode, Fallback, type FileExistsRequest, type FileExistsResult, ForEach, ForceFailure, ForceSuccess, GenerateFile, type GenerateFileConfig, type GenerateFileRequest, type GenerateFileResult, HttpRequest, type HttpRequestActivity, type HttpRequestConfig, type HttpResponseActivity, type IScopedBlackboard, type ITreeRegistry, type InferSchema, type InjectedObservabilitySinks, IntegrationAction, type IntegrationActionConfig, type IntegrationContext, Invert, KeepRunningUntilFailure, type LoadOptions, type LogEventData, LogMessage, type LogMessageConfig, MemoryDataStore, MemorySequence, MockAction, type NodeConfiguration, type NodeConstructor, type NodeEvent, type NodeEventCallback, NodeEventEmitter, NodeEventType, type NodeMetadata, type NodeState, NodeStatus, type ObservabilitySinks, type ObservableNodeEvent, Parallel, type ParallelStrategy, ParseFile, type ParseFileConfig, type ParseFileRequest, type ParseFileResult, type ParsedPath, type PieceActivityRequest as PieceActionRequest, type PieceActivityRequest, type PieceAuth, type PortDefinition, Precondition, PrintAction, type PutOptions, PythonScript, type PythonScriptConfig, type PythonScriptRequest, type PythonScriptResult, ReactiveSequence, Recovery, RegexExtract, type RegexExtractConfig, Registry, Repeat, type ResolveOptions, ResumePoint, type ResumePointConfig, RunOnce, RunningNode, SchemaRegistry, ScopedBlackboard, Selector, SemanticValidationError, Sequence, SequenceWithMemory, type SinkHandlerConfig, SoftAssert, StructureValidationError, type StructuredError, SubTree, SuccessNode, type TemplateLoaderOptions, type TemporalContext, type TickContext, type TimelineEntry, Timeout, type TokenProvider, type TreeDefinition, type TreeNode, type UploadFileRequest, type UploadFileResult, type ValidatedNodeConfiguration, ValidationError, ValidationErrors, type ValidationOptions, type ValidationResult, type VariableContext, WaitAction, While, type WorkflowArgs, type WorkflowResult, YamlSyntaxError, clearPieceCache, createNodeSchema, createObservabilitySinkHandler, envTokenProvider, executePieceAction, extractVariables, getTemplateIds, hasTemplate, hasVariables, isDataRef, isPieceInstalled, listPieceActions, loadTemplate, loadTemplatesFromDirectory, loadTreeFromFile, loadTreeFromYaml, nodeConfigurationSchema, parseYaml, registerStandardNodes, resolveString, resolveValue, safeValidateConfiguration, schemaRegistry, semanticValidator, toYaml, treeDefinitionSchema, validateChildCount, validateChildCountRange, validateCompositeChildren, validateConfiguration, validateDecoratorChildren, validateTreeDefinition, validateYaml, validations, zodErrorToConfigurationError };
4100
+ export { type A2UIComponent, ActionNode, AlwaysCondition, BaseNode, BehaviorTree, BrowserAgent, type BrowserAgentConfig, type BrowserAgentRequest, type BrowserAgentResult, type BtreeActivities, CheckCondition, ClaudeAgent, type ClaudeAgentConfig, type ClaudeAgentMcpServerConfig, type ClaudeAgentRequest, type ClaudeAgentResult, type ClaudeAgentSubagent, CodeExecution, type CodeExecutionConfig, type CodeExecutionRequest, type CodeExecutionResult, CompositeNode, ConditionNode, Conditional, ConfigValidationError, ConfigurationError, CounterAction, type CreateHumanTaskRequest, type CreateHumanTaskResult, type DataRef$1 as DataRef, type DataStore, DecoratorNode, Delay, type DeleteFileRequest, type DeleteFileResult, type DownloadFileRequest, type DownloadFileResult, type ExecutionProgress, ExecutionTracker, FailureNode, Fallback, type FileExistsRequest, type FileExistsResult, ForEach, ForceFailure, ForceSuccess, GenerateFile, type GenerateFileConfig, type GenerateFileRequest, type GenerateFileResult, GitHubAction, type GitHubActionConfig, type GitHubActionRequest, type GitHubActionResult, type GitHubOperation, HttpRequest, type HttpRequestActivity, type HttpRequestConfig, type HttpResponseActivity, HumanTask, type HumanTaskConfig, type IScopedBlackboard, type ITreeRegistry, type InferSchema, type InjectedObservabilitySinks, IntegrationAction, type IntegrationActionConfig, type IntegrationContext, Invert, KeepRunningUntilFailure, LLMChat, type LLMChatConfig, type LLMChatRequest, type LLMChatResult, type LLMMessage, type LLMProvider, type LoadOptions, type LogEventData, LogMessage, type LogMessageConfig, MemoryDataStore, MemorySequence, type MessageRole, MockAction, type NodeConfiguration, type NodeConstructor, type NodeEvent, type NodeEventCallback, NodeEventEmitter, NodeEventType, type NodeMetadata, type NodeState, NodeStatus, type ObservabilitySinks, type ObservableNodeEvent, Parallel, type ParallelStrategy, ParseFile, type ParseFileConfig, type ParseFileRequest, type ParseFileResult, type ParsedPath, type PieceActivityRequest as PieceActionRequest, type PieceActivityRequest, type PieceAuth, type PortDefinition, Precondition, PrintAction, type PutOptions, PythonScript, type PythonScriptConfig, type PythonScriptRequest, type PythonScriptResult, ReactiveSequence, Recovery, RegexExtract, type RegexExtractConfig, Registry, Repeat, type ResolveOptions, ResumePoint, type ResumePointConfig, RunOnce, RunningNode, SchemaRegistry, ScopedBlackboard, Selector, SemanticValidationError, Sequence, SequenceWithMemory, type SinkHandlerConfig, SoftAssert, StructureValidationError, type StructuredError, SubTree, SuccessNode, type TemplateLoaderOptions, type TemporalContext, type TickContext, type TimelineEntry, Timeout, type TokenProvider, type TreeDefinition, type TreeNode, type UploadFileRequest, type UploadFileResult, type ValidatedNodeConfiguration, ValidationError, ValidationErrors, type ValidationOptions, type ValidationResult, type VariableContext, WaitAction, type WaitForHumanTaskRequest, type WaitForHumanTaskResult, While, type WorkflowArgs, type WorkflowResult, YamlSyntaxError, clearPieceCache, createNodeSchema, createObservabilitySinkHandler, envTokenProvider, executePieceAction, extractVariables, getTemplateIds, hasTemplate, hasVariables, isDataRef, isPieceInstalled, listPieceActions, loadTemplate, loadTemplatesFromDirectory, loadTreeFromFile, loadTreeFromYaml, nodeConfigurationSchema, parseYaml, registerStandardNodes, resolveString, resolveValue, safeValidateConfiguration, schemaRegistry, semanticValidator, toYaml, treeDefinitionSchema, validateChildCount, validateChildCountRange, validateCompositeChildren, validateConfiguration, validateDecoratorChildren, validateTreeDefinition, validateYaml, validations, zodErrorToConfigurationError };