@sendbird/actionbook-core 0.10.11 → 0.10.12

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.ts CHANGED
@@ -433,4 +433,67 @@ declare function actionbookToAST(manual: {
433
433
  logic: LogicV2;
434
434
  }): DocumentNode;
435
435
 
436
- export { ActionbookConversionError, type ActionbookJSON, AstNode, BlockNode, BlockquoteNode, BoldMark, type BranchDecision, BulletListNode, CodeMark, type ConditionToken, type ConditionValidationResult, type DecisionTree, type DeleteOp, DeserializationError, DocumentNode, type DocumentTreeNode, type DocumentTreeNodeType, type EnumeratePathsIterOptions, type GotoEdge, type GotoEntryResolution, HardBreakNode, HeadingNode, type HighlightCategory, HorizontalRuleNode, InlineNode, type InsertOp, ItalicMark, type JinjaBlock, JinjaIfBlockNode, JinjaIfBranch, JinjaIfInlineNode, type JinjaIfStructure, type JinjaVisualBranch, type JinjaVisualStructure, JumpPointNode, LinkMark, type LintAsyncOptions, LintContext, LintResult, LintRule, LintSection, ListItemNode, LlmCompletionEndpoint, LlmLintRule, Mark, NodePath, NoteBlockNode, type Operation, OperationError, OrderedListNode, ParagraphNode, type ParseMarkdownOptions, type ReplaceOp, ResourceTagNode, ResourceTagType, StrikethroughMark, TableCellNode, TableNode, TableRowNode, TextNode, type Transaction, type TreeNode, type TreeNodeClassification, type TreeNodeLine, type TreeNodeType, type TreePath, type TreeSection, UnderlineMark, type ValidationError, type Variable, type VariableValue, type VisitOptions, actionbookToAST, analyzeJinjaBlocks, applyOperation, applyTransaction, blockquote, bold, buildDocumentTree, bulletList, chunkByHeading, code, collectAllVariables, comparePaths, defaultLlmRules, defaultRules, deserializeFromJSON, doc, enumeratePaths, enumeratePathsBySection, enumeratePathsIter, evaluateCondition, evaluateJinjaNodes, extractResourceTags, extractVariables, findAll, findDuplicateJumpPoints, fromMdast, generateDecisionTree, hardBreak, heading, horizontalRule, invertOperation, isBlock, isDocument, isInline, isTextNode, italic, jinjaBranch, jinjaIfBlock, jinjaIfInline, jumpPoint, link, lint, lintAsync, listItem, map, nodeAtPath, noteBlock, orderedList, paragraph, parentPath, parseFragment, parseMarkdown, pathFromString, pathToString, resolveGotoEntryPath, resourceTag, scanJinjaBlocks, serializeFragment, serializeToJSON, serializeToMarkdown, strikethrough, structureJinjaBlocks, table, tableCell, tableRow, text, textContent, toMdast, todoItem, tokenizeCondition, underline, validate, validateCondition, visit };
436
+ /**
437
+ * Visualization graph types for Actionbook flow diagrams.
438
+ *
439
+ * VizGraph is the output of buildVizGraph() — a display-ready,
440
+ * collapsed graph derived from the analysis-focused DecisionTree.
441
+ * Layout and rendering are handled by the consumer (D3, React, etc.).
442
+ */
443
+ type VizNodeType = 'START' | 'CONTENT' | 'BRANCH' | 'TOOL_CALL' | 'HANDOFF' | 'END_CONVERSATION';
444
+ interface VizNodeAnnotation {
445
+ readonly kind: 'tool' | 'handoff' | 'end_call' | 'jump_point';
446
+ readonly label: string;
447
+ readonly resourceId?: string;
448
+ }
449
+ interface VizNode {
450
+ readonly id: string;
451
+ readonly type: VizNodeType;
452
+ readonly label: string;
453
+ readonly lines: readonly string[];
454
+ readonly section: string;
455
+ readonly annotations: readonly VizNodeAnnotation[];
456
+ readonly sourceBlockRange: {
457
+ readonly start: number;
458
+ readonly end: number;
459
+ };
460
+ readonly branchType?: 'if' | 'elif' | 'else';
461
+ readonly conditionText?: string;
462
+ readonly isJinja?: boolean;
463
+ readonly gotoTarget?: string;
464
+ }
465
+ type VizEdgeType = 'SEQUENTIAL' | 'BRANCH_TRUE' | 'GOTO' | 'FALLBACK' | 'BROKEN_REF';
466
+ interface VizEdge {
467
+ readonly id: string;
468
+ readonly from: string;
469
+ readonly to: string;
470
+ readonly type: VizEdgeType;
471
+ readonly label?: string;
472
+ readonly branchIndex?: number;
473
+ }
474
+ interface VizSection {
475
+ readonly name: string;
476
+ readonly headingBlockIndex: number;
477
+ readonly nodeIds: readonly string[];
478
+ }
479
+ interface VizGraph {
480
+ readonly nodes: readonly VizNode[];
481
+ readonly edges: readonly VizEdge[];
482
+ readonly sections: readonly VizSection[];
483
+ readonly anchorMap: Readonly<Record<string, string>>;
484
+ }
485
+
486
+ /**
487
+ * VizGraph builder — converts DocumentNode AST directly into a visualization graph.
488
+ *
489
+ * Works from the AST rather than DecisionTree to faithfully implement v1 rules:
490
+ * - ALL bullet lists → BRANCH (unless pure text with no actions)
491
+ * - Ordered lists → sequential CONTENT
492
+ * - Jinja if blocks → BRANCH
493
+ * - Headings → section boundaries
494
+ * - Resource tags → TOOL_CALL / HANDOFF / END_CONVERSATION
495
+ */
496
+
497
+ declare function buildVizGraph(doc: DocumentNode): VizGraph;
498
+
499
+ export { ActionbookConversionError, type ActionbookJSON, AstNode, BlockNode, BlockquoteNode, BoldMark, type BranchDecision, BulletListNode, CodeMark, type ConditionToken, type ConditionValidationResult, type DecisionTree, type DeleteOp, DeserializationError, DocumentNode, type DocumentTreeNode, type DocumentTreeNodeType, type EnumeratePathsIterOptions, type GotoEdge, type GotoEntryResolution, HardBreakNode, HeadingNode, type HighlightCategory, HorizontalRuleNode, InlineNode, type InsertOp, ItalicMark, type JinjaBlock, JinjaIfBlockNode, JinjaIfBranch, JinjaIfInlineNode, type JinjaIfStructure, type JinjaVisualBranch, type JinjaVisualStructure, JumpPointNode, LinkMark, type LintAsyncOptions, LintContext, LintResult, LintRule, LintSection, ListItemNode, LlmCompletionEndpoint, LlmLintRule, Mark, NodePath, NoteBlockNode, type Operation, OperationError, OrderedListNode, ParagraphNode, type ParseMarkdownOptions, type ReplaceOp, ResourceTagNode, ResourceTagType, StrikethroughMark, TableCellNode, TableNode, TableRowNode, TextNode, type Transaction, type TreeNode, type TreeNodeClassification, type TreeNodeLine, type TreeNodeType, type TreePath, type TreeSection, UnderlineMark, type ValidationError, type Variable, type VariableValue, type VisitOptions, type VizEdge, type VizEdgeType, type VizGraph, type VizNode, type VizNodeAnnotation, type VizNodeType, type VizSection, actionbookToAST, analyzeJinjaBlocks, applyOperation, applyTransaction, blockquote, bold, buildDocumentTree, buildVizGraph, bulletList, chunkByHeading, code, collectAllVariables, comparePaths, defaultLlmRules, defaultRules, deserializeFromJSON, doc, enumeratePaths, enumeratePathsBySection, enumeratePathsIter, evaluateCondition, evaluateJinjaNodes, extractResourceTags, extractVariables, findAll, findDuplicateJumpPoints, fromMdast, generateDecisionTree, hardBreak, heading, horizontalRule, invertOperation, isBlock, isDocument, isInline, isTextNode, italic, jinjaBranch, jinjaIfBlock, jinjaIfInline, jumpPoint, link, lint, lintAsync, listItem, map, nodeAtPath, noteBlock, orderedList, paragraph, parentPath, parseFragment, parseMarkdown, pathFromString, pathToString, resolveGotoEntryPath, resourceTag, scanJinjaBlocks, serializeFragment, serializeToJSON, serializeToMarkdown, strikethrough, structureJinjaBlocks, table, tableCell, tableRow, text, textContent, toMdast, todoItem, tokenizeCondition, underline, validate, validateCondition, visit };