@calliopelabs/ui 0.12.0 → 0.14.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 (80) hide show
  1. package/README.md +68 -3
  2. package/dist/agent/AgentChat.d.ts +56 -0
  3. package/dist/agent/AgentChat.js +76 -0
  4. package/dist/agent/AgentLauncher.d.ts +25 -0
  5. package/dist/agent/AgentLauncher.js +25 -0
  6. package/dist/agent/AgentProvider.d.ts +82 -0
  7. package/dist/agent/AgentProvider.js +176 -0
  8. package/dist/agent/CalliopeAgent.d.ts +43 -0
  9. package/dist/agent/CalliopeAgent.js +111 -0
  10. package/dist/agent/controller.d.ts +148 -0
  11. package/dist/agent/controller.js +463 -0
  12. package/dist/agent/copilotkit/CopilotKitAgentProvider.d.ts +41 -0
  13. package/dist/agent/copilotkit/CopilotKitAgentProvider.js +145 -0
  14. package/dist/agent/copilotkit/index.d.ts +6 -0
  15. package/dist/agent/copilotkit/index.js +6 -0
  16. package/dist/agent/engine.d.ts +41 -0
  17. package/dist/agent/engine.js +93 -0
  18. package/dist/agent/index.d.ts +15 -0
  19. package/dist/agent/index.js +15 -0
  20. package/dist/agent/mock.d.ts +34 -0
  21. package/dist/agent/mock.js +112 -0
  22. package/dist/agent/surface.d.ts +30 -0
  23. package/dist/agent/surface.js +90 -0
  24. package/dist/agent/tool.d.ts +98 -0
  25. package/dist/agent/tool.js +81 -0
  26. package/dist/appearance/brands.d.ts +14 -12
  27. package/dist/appearance/brands.js +18 -51
  28. package/dist/chat/AgentProgress.d.ts +19 -0
  29. package/dist/chat/AgentProgress.js +34 -0
  30. package/dist/chat/Composer.d.ts +31 -0
  31. package/dist/chat/Composer.js +44 -0
  32. package/dist/chat/MessageBubble.d.ts +23 -0
  33. package/dist/chat/MessageBubble.js +26 -0
  34. package/dist/chat/MessageList.d.ts +36 -0
  35. package/dist/chat/MessageList.js +68 -0
  36. package/dist/chat/ModelPicker.d.ts +17 -0
  37. package/dist/chat/ModelPicker.js +13 -0
  38. package/dist/chat/ToolCallCard.d.ts +27 -0
  39. package/dist/chat/ToolCallCard.js +52 -0
  40. package/dist/chat/model.d.ts +123 -0
  41. package/dist/chat/model.js +337 -0
  42. package/dist/chat/patch.d.ts +12 -0
  43. package/dist/chat/patch.js +149 -0
  44. package/dist/chat/useAgUiRun.d.ts +52 -0
  45. package/dist/chat/useAgUiRun.js +137 -0
  46. package/dist/index.d.ts +11 -2
  47. package/dist/index.js +11 -1
  48. package/dist/primitives/Button.d.ts +1 -1
  49. package/dist/provider/messages.d.ts +83 -1
  50. package/dist/provider/messages.js +91 -0
  51. package/dist/theme/mappings/palette.d.ts +52 -0
  52. package/dist/theme/mappings/palette.js +208 -0
  53. package/dist/theme/mappings/render.d.ts +9 -0
  54. package/dist/theme/mappings/render.js +520 -0
  55. package/dist/theme/mappings/targets.d.ts +43 -0
  56. package/dist/theme/mappings/targets.js +222 -0
  57. package/dist/theme/tokens.d.ts +10 -9
  58. package/dist/theme/tokens.generated.d.ts +353 -0
  59. package/dist/theme/tokens.generated.js +357 -0
  60. package/dist/theme/tokens.js +20 -264
  61. package/dist/tokens/README.jupyterlab.md +125 -0
  62. package/dist/tokens/README.md +15 -0
  63. package/dist/tokens/README.native.md +29 -0
  64. package/dist/tokens/README.plain.md +84 -0
  65. package/dist/tokens/README.python.md +33 -0
  66. package/dist/tokens/README.vscode.md +114 -0
  67. package/dist/tokens/jupyterlab.css +1710 -0
  68. package/dist/tokens/plain.css +930 -0
  69. package/dist/tokens/tokens.native.d.ts +85 -0
  70. package/dist/tokens/tokens.native.js +773 -0
  71. package/dist/tokens/tokens.py +1043 -0
  72. package/dist/tokens/vscode.css +1138 -0
  73. package/dist/workflow/canvas/WorkflowCanvas.js +41 -1
  74. package/dist/workflow/definition.d.ts +20 -0
  75. package/dist/workflow/definition.js +44 -0
  76. package/dist/workflow/editor/WorkflowInspector.d.ts +21 -3
  77. package/dist/workflow/editor/WorkflowInspector.js +13 -5
  78. package/dist/workflow/editor/WorkflowWorkspace.d.ts +28 -3
  79. package/dist/workflow/editor/WorkflowWorkspace.js +75 -16
  80. package/package.json +35 -2
@@ -0,0 +1,137 @@
1
+ "use client";
2
+ import { EventType } from "@ag-ui/core";
3
+ import * as React from "react";
4
+ import { createChatView, foldChat, reduceChat } from "./model.js";
5
+ /** The person's own message as the events that fold it into the view. */
6
+ export function userMessageEvents(id, text) {
7
+ return [
8
+ { type: EventType.TEXT_MESSAGE_START, messageId: id, role: "user" },
9
+ { type: EventType.TEXT_MESSAGE_CONTENT, messageId: id, delta: text },
10
+ { type: EventType.TEXT_MESSAGE_END, messageId: id },
11
+ ];
12
+ }
13
+ const message = (error) => error instanceof Error && error.message
14
+ ? error.message
15
+ : typeof error === "string" && error
16
+ ? error
17
+ : "The event stream failed.";
18
+ /**
19
+ * Holds a `ChatView` and folds a host-provided AG-UI event source into it,
20
+ * one run at a time. No network code: the host connects, authenticates and
21
+ * sends input, and hands the hook what comes back.
22
+ *
23
+ * const chat = useAgUiRun();
24
+ * onSubmit={(text) => {
25
+ * chat.dispatch(userMessageEvents(id(), text));
26
+ * void chat.run(agent.stream({ threadId, text }));
27
+ * }}
28
+ */
29
+ export function useAgUiRun({ initialView, onError } = {}) {
30
+ const [view, setView] = React.useState(() => initialView ?? createChatView());
31
+ const [running, setRunning] = React.useState(false);
32
+ const current = React.useRef(null);
33
+ const onErrorRef = React.useRef(onError);
34
+ React.useEffect(() => {
35
+ onErrorRef.current = onError;
36
+ });
37
+ const release = React.useCallback(() => {
38
+ const active = current.current;
39
+ current.current = null;
40
+ active?.release();
41
+ }, []);
42
+ React.useEffect(() => release, [release]);
43
+ const run = React.useCallback((source) => {
44
+ release();
45
+ let live = true;
46
+ let cleanup = () => { };
47
+ let stopped = () => { };
48
+ const halted = new Promise((resolve) => {
49
+ stopped = () => resolve("stopped");
50
+ });
51
+ const token = {
52
+ release: () => {
53
+ live = false;
54
+ cleanup();
55
+ stopped();
56
+ },
57
+ };
58
+ current.current = token;
59
+ setRunning(true);
60
+ const fold = (event) => {
61
+ if (live)
62
+ setView((v) => reduceChat(v, event));
63
+ };
64
+ const end = (error) => {
65
+ if (!live)
66
+ return;
67
+ live = false;
68
+ if (current.current === token)
69
+ current.current = null;
70
+ if (error !== undefined) {
71
+ setView((v) => reduceChat(v, { type: EventType.RUN_ERROR, message: message(error) }));
72
+ onErrorRef.current?.(error);
73
+ }
74
+ setRunning(false);
75
+ };
76
+ if (typeof source === "function") {
77
+ let finished = () => { };
78
+ const ended = new Promise((resolve) => {
79
+ finished = resolve;
80
+ });
81
+ try {
82
+ const unsubscribe = source(fold, (error) => {
83
+ end(error);
84
+ finished();
85
+ });
86
+ if (live)
87
+ cleanup = unsubscribe;
88
+ else
89
+ unsubscribe();
90
+ }
91
+ catch (error) {
92
+ end(error);
93
+ finished();
94
+ }
95
+ return Promise.race([ended, halted]).then(() => { });
96
+ }
97
+ return (async () => {
98
+ try {
99
+ const iterator = source[Symbol.asyncIterator]();
100
+ cleanup = () => void iterator.return?.()?.catch(() => { });
101
+ for (;;) {
102
+ const next = await Promise.race([iterator.next(), halted]);
103
+ if (next === "stopped" || next.done)
104
+ break;
105
+ fold(next.value);
106
+ }
107
+ end();
108
+ }
109
+ catch (error) {
110
+ end(error);
111
+ }
112
+ })();
113
+ }, [release]);
114
+ const stop = React.useCallback(() => {
115
+ if (!current.current)
116
+ return;
117
+ release();
118
+ setRunning(false);
119
+ setView((v) => v.status === "running"
120
+ ? reduceChat(v, {
121
+ type: EventType.RUN_FINISHED,
122
+ threadId: v.threadId ?? "",
123
+ runId: v.runId ?? "",
124
+ outcome: { type: "cancelled" },
125
+ })
126
+ : v);
127
+ }, [release]);
128
+ const dispatch = React.useCallback((events) => {
129
+ setView((v) => foldChat(Array.isArray(events) ? events : [events], v));
130
+ }, []);
131
+ const reset = React.useCallback((next) => {
132
+ release();
133
+ setRunning(false);
134
+ setView(next ?? createChatView());
135
+ }, [release]);
136
+ return { view, running, run, stop, dispatch, reset };
137
+ }
package/dist/index.d.ts CHANGED
@@ -76,7 +76,7 @@ export { ReviewPanel, type ReviewPanelProps } from "./workflow/ReviewPanel.js";
76
76
  export { MediaReview, formatTimecode, type MediaAnchor, type MediaCaptionTrack, type MediaComment, type MediaRegion, type MediaReviewProps, } from "./workflow/MediaReview.js";
77
77
  export { DocumentReview, type DocumentAnnotation, type DocumentBlock, type DocumentPage, type DocumentReviewProps, type DocumentSegment, type DocumentSignOff, type SignOffStatus, } from "./workflow/DocumentReview.js";
78
78
  export { FormReview, type FormField, type FormFieldBox, type FormFieldStatus, type FormReviewProps, type FormSourcePage, } from "./workflow/FormReview.js";
79
- export { IN, LOOP_IN, LOOP_OUT, OUT, WORKFLOW_DEFINITION_VERSION, WORKFLOW_NODE_KINDS, WORKFLOW_SELECTORS, addNode, canConnect, createNode, dataTypes, downstream, edgeId, exitLabel, exitsOf, findFact, findGateKind, findPreset, freshId, inputsOf, isJudge, moveNode, operatorsFor, outputsOf, portOf, removeEdge, removeNode, startOf, typeAccepts, updateEdge, updateNode, upstream, withFlow, type WorkflowCase, type WorkflowCheckNode, type WorkflowClassifierNode, type WorkflowClassifierOption, type WorkflowCondition, type WorkflowConditionNode, type WorkflowConnectReason, type WorkflowConnectResult, type WorkflowConnection, type WorkflowDataType, type WorkflowDefinition, type WorkflowEdge, type WorkflowEvaluatorNode, type WorkflowFact, type WorkflowFactType, type WorkflowFanoutNode, type WorkflowFlow, type WorkflowGateField, type WorkflowGateKind, type WorkflowGateNode, type WorkflowGatePolicy, type WorkflowGotoNode, type WorkflowJoinNode, type WorkflowJudgeNode, type WorkflowModuleSpec, type WorkflowNode, type WorkflowNodeKind, type WorkflowNodeOf, type WorkflowNodeTemplate, type WorkflowOperator, type WorkflowOption, type WorkflowPort, type WorkflowPosition, type WorkflowRegistry, type WorkflowSelection, type WorkflowSelector, type WorkflowStepNode, type WorkflowStepPreset, type WorkflowSubflowNode, type WorkflowVariant, type WorkflowVariantsNode, } from "./workflow/definition.js";
79
+ export { IN, LOOP_IN, LOOP_OUT, OUT, WORKFLOW_DEFINITION_VERSION, WORKFLOW_FLOW_NAME, WORKFLOW_MAX_FLOWS, WORKFLOW_NODE_KINDS, WORKFLOW_SELECTORS, addFlow, addNode, canConnect, createNode, dataTypes, downstream, edgeId, exitLabel, exitsOf, findFact, findGateKind, findPreset, flowNameProblem, freshId, inputsOf, isJudge, moveNode, operatorsFor, outputsOf, portOf, removeEdge, removeNode, renameFlow, startOf, typeAccepts, updateEdge, updateNode, upstream, withFlow, type WorkflowCase, type WorkflowCheckNode, type WorkflowClassifierNode, type WorkflowClassifierOption, type WorkflowCondition, type WorkflowConditionNode, type WorkflowConnectReason, type WorkflowConnectResult, type WorkflowConnection, type WorkflowDataType, type WorkflowDefinition, type WorkflowEdge, type WorkflowEvaluatorNode, type WorkflowFact, type WorkflowFactType, type WorkflowFanoutNode, type WorkflowFlow, type WorkflowFlowNameProblem, type WorkflowGateField, type WorkflowGateKind, type WorkflowGateNode, type WorkflowGatePolicy, type WorkflowGotoNode, type WorkflowJoinNode, type WorkflowJudgeNode, type WorkflowModuleSpec, type WorkflowNode, type WorkflowNodeKind, type WorkflowNodeOf, type WorkflowNodeTemplate, type WorkflowOperator, type WorkflowOption, type WorkflowPort, type WorkflowPosition, type WorkflowRegistry, type WorkflowSelection, type WorkflowSelector, type WorkflowStepNode, type WorkflowStepPreset, type WorkflowSubflowNode, type WorkflowVariant, type WorkflowVariantsNode, } from "./workflow/definition.js";
80
80
  export { WORKFLOW_PROBLEM_CODES, blockingProblems, checkDefinition, definitionAvailability, nodeAvailability, type WorkflowProblem, type WorkflowProblemCode, type WorkflowProblemLevel, } from "./workflow/problems.js";
81
81
  export { WORKFLOW_PACKAGE_FORMAT, WORKFLOW_PACKAGE_VERSION, diffDefinitions, exportWorkflowPackage, previewWorkflowImport, readWorkflowDefinition, readWorkflowPackage, requirementsOf, sameDefinition, type WorkflowDefinitionDiff, type WorkflowDiffEdge, type WorkflowDiffItem, type WorkflowDisabledNode, type WorkflowFlowDiff, type WorkflowImportSummary, type WorkflowModuleGap, type WorkflowPackage, type WorkflowReadError, type WorkflowReadResult, type WorkflowRequirements, } from "./workflow/portable.js";
82
82
  export { NODE_HEADER, NODE_WIDTH, PORT_ROW, arrangeFlow, layoutFlow, nodeSize, portRows, ranksOf, regionsOf, type WorkflowRegion, } from "./workflow/layout.js";
@@ -84,9 +84,18 @@ export { insertPaletteItem, paletteOf, type WorkflowPaletteGroup, type WorkflowP
84
84
  export { READABLE_ZOOM, WorkflowCanvas, type WorkflowCanvasProps, } from "./workflow/canvas/WorkflowCanvas.js";
85
85
  export { WorkflowPalette, type WorkflowPaletteProps } from "./workflow/editor/WorkflowPalette.js";
86
86
  export { WorkflowProblems, problemTarget, type WorkflowProblemsProps, } from "./workflow/editor/WorkflowProblems.js";
87
- export { ConditionEditor, GatePolicyEditor, WorkflowInspector, type WorkflowInspectorProps, } from "./workflow/editor/WorkflowInspector.js";
87
+ export { ConditionEditor, GatePolicyEditor, WorkflowInspector, type WorkflowInspectorProps, type WorkflowNodeFieldsContext, } from "./workflow/editor/WorkflowInspector.js";
88
88
  export { WorkflowJsonView, type WorkflowJsonViewProps, } from "./workflow/editor/WorkflowJsonView.js";
89
89
  export { documentStatus, type WorkflowDocumentStatus, type WorkflowRevision, } from "./workflow/workspace.js";
90
90
  export { WorkflowDiff, type WorkflowDiffProps } from "./workflow/editor/WorkflowDiff.js";
91
91
  export { WorkflowImportPreview, type WorkflowImportPreviewProps, } from "./workflow/editor/WorkflowImportPreview.js";
92
92
  export { WorkflowWorkspace, type WorkflowWorkspaceProps, } from "./workflow/editor/WorkflowWorkspace.js";
93
+ export { contentText, createChatView, foldChat, isChatRunning, parseToolCallArgs, reduceChat, type AgUiEvent, type AgUiInterrupt, type ChatApproval, type ChatMessage, type ChatRole, type ChatRunStatus, type ChatStep, type ChatStepStatus, type ChatTimelineItem, type ChatToolCall, type ChatToolCallStatus, type ChatView, } from "./chat/model.js";
94
+ export { applyJsonPatch } from "./chat/patch.js";
95
+ export { MessageBubble, type ChatContentRenderer, type MessageBubbleProps, } from "./chat/MessageBubble.js";
96
+ export { MessageList, type MessageListProps } from "./chat/MessageList.js";
97
+ export { Composer, type ComposerProps } from "./chat/Composer.js";
98
+ export { ToolCallCard, type ToolCallCardProps } from "./chat/ToolCallCard.js";
99
+ export { AgentProgress, CHAT_RUN_TONE, chatStepStages, type AgentProgressProps, } from "./chat/AgentProgress.js";
100
+ export { ModelPicker, type ModelPickerProps } from "./chat/ModelPicker.js";
101
+ export { useAgUiRun, userMessageEvents, type AgUiEventSource, type AgUiRun, type AgUiSubscribe, type UseAgUiRunOptions, } from "./chat/useAgUiRun.js";
package/dist/index.js CHANGED
@@ -85,7 +85,7 @@ export { ReviewPanel } from "./workflow/ReviewPanel.js";
85
85
  export { MediaReview, formatTimecode, } from "./workflow/MediaReview.js";
86
86
  export { DocumentReview, } from "./workflow/DocumentReview.js";
87
87
  export { FormReview, } from "./workflow/FormReview.js";
88
- export { IN, LOOP_IN, LOOP_OUT, OUT, WORKFLOW_DEFINITION_VERSION, WORKFLOW_NODE_KINDS, WORKFLOW_SELECTORS, addNode, canConnect, createNode, dataTypes, downstream, edgeId, exitLabel, exitsOf, findFact, findGateKind, findPreset, freshId, inputsOf, isJudge, moveNode, operatorsFor, outputsOf, portOf, removeEdge, removeNode, startOf, typeAccepts, updateEdge, updateNode, upstream, withFlow, } from "./workflow/definition.js";
88
+ export { IN, LOOP_IN, LOOP_OUT, OUT, WORKFLOW_DEFINITION_VERSION, WORKFLOW_FLOW_NAME, WORKFLOW_MAX_FLOWS, WORKFLOW_NODE_KINDS, WORKFLOW_SELECTORS, addFlow, addNode, canConnect, createNode, dataTypes, downstream, edgeId, exitLabel, exitsOf, findFact, findGateKind, findPreset, flowNameProblem, freshId, inputsOf, isJudge, moveNode, operatorsFor, outputsOf, portOf, removeEdge, removeNode, renameFlow, startOf, typeAccepts, updateEdge, updateNode, upstream, withFlow, } from "./workflow/definition.js";
89
89
  export { WORKFLOW_PROBLEM_CODES, blockingProblems, checkDefinition, definitionAvailability, nodeAvailability, } from "./workflow/problems.js";
90
90
  export { WORKFLOW_PACKAGE_FORMAT, WORKFLOW_PACKAGE_VERSION, diffDefinitions, exportWorkflowPackage, previewWorkflowImport, readWorkflowDefinition, readWorkflowPackage, requirementsOf, sameDefinition, } from "./workflow/portable.js";
91
91
  export { NODE_HEADER, NODE_WIDTH, PORT_ROW, arrangeFlow, layoutFlow, nodeSize, portRows, ranksOf, regionsOf, } from "./workflow/layout.js";
@@ -99,3 +99,13 @@ export { documentStatus, } from "./workflow/workspace.js";
99
99
  export { WorkflowDiff } from "./workflow/editor/WorkflowDiff.js";
100
100
  export { WorkflowImportPreview, } from "./workflow/editor/WorkflowImportPreview.js";
101
101
  export { WorkflowWorkspace, } from "./workflow/editor/WorkflowWorkspace.js";
102
+ // Chat (AG-UI)
103
+ export { contentText, createChatView, foldChat, isChatRunning, parseToolCallArgs, reduceChat, } from "./chat/model.js";
104
+ export { applyJsonPatch } from "./chat/patch.js";
105
+ export { MessageBubble, } from "./chat/MessageBubble.js";
106
+ export { MessageList } from "./chat/MessageList.js";
107
+ export { Composer } from "./chat/Composer.js";
108
+ export { ToolCallCard } from "./chat/ToolCallCard.js";
109
+ export { AgentProgress, CHAT_RUN_TONE, chatStepStages, } from "./chat/AgentProgress.js";
110
+ export { ModelPicker } from "./chat/ModelPicker.js";
111
+ export { useAgUiRun, userMessageEvents, } from "./chat/useAgUiRun.js";
@@ -6,7 +6,7 @@ import type * as React from "react";
6
6
  * reaches buttons as it reaches panels.
7
7
  */
8
8
  export declare const buttonVariants: (props?: ({
9
- variant?: "link" | "default" | "outline" | "secondary" | "ghost" | "destructive" | null | undefined;
9
+ variant?: "destructive" | "link" | "default" | "outline" | "secondary" | "ghost" | null | undefined;
10
10
  size?: "default" | "xs" | "sm" | "lg" | "icon" | "icon-xs" | "icon-sm" | "icon-lg" | null | undefined;
11
11
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
12
12
  export interface ButtonProps extends React.ComponentProps<"button">, VariantProps<typeof buttonVariants> {
@@ -1,8 +1,9 @@
1
1
  import type { ProductTheme } from "../appearance/product.js";
2
+ import type { ChatRole, ChatRunStatus, ChatToolCallStatus } from "../chat/model.js";
2
3
  import type { WorkflowQuestionState } from "../workflow/question.js";
3
4
  import type { WorkflowAction, WorkflowAvailability, WorkflowScope, WorkflowStatus } from "../workflow/model.js";
4
5
  import type { ArtifactStatus, GateStatus, ReviewDecision, ReviewVerdict, RunStageStatus } from "../workflow/run.js";
5
- import type { WorkflowConnectReason, WorkflowNode, WorkflowNodeKind, WorkflowSelector } from "../workflow/definition.js";
6
+ import type { WorkflowConnectReason, WorkflowFlowNameProblem, WorkflowNode, WorkflowNodeKind, WorkflowSelector } from "../workflow/definition.js";
6
7
  /** The names a node's summary line uses, looked up by the caller. */
7
8
  export interface WorkflowSummaryNames {
8
9
  /** A step's or variants' preset, and its module. */
@@ -394,6 +395,22 @@ export interface Messages {
394
395
  importing: string;
395
396
  importedNotice: string;
396
397
  importAvailability: (status: WorkflowAvailability["status"]) => string;
398
+ newFlow: string;
399
+ newFlowTitle: string;
400
+ newFlowDescription: string;
401
+ createFlow: string;
402
+ renameFlow: string;
403
+ renameFlowTitle: (name: string) => string;
404
+ renameFlowDescription: string;
405
+ rename: string;
406
+ flowName: string;
407
+ flowNameHint: string;
408
+ flowLabel: string;
409
+ flowLabelHint: string;
410
+ flowNameProblem: (problem: WorkflowFlowNameProblem) => string;
411
+ flowsFull: (max: number) => string;
412
+ flowCreatedNotice: (name: string) => string;
413
+ flowRenamedNotice: (name: string) => string;
397
414
  modules: string;
398
415
  noModules: string;
399
416
  moduleStatus: (status: "available" | "missing" | "version" | "unavailable", installed?: string) => string;
@@ -534,6 +551,71 @@ export interface Messages {
534
551
  /** A field extraction found nothing in. */
535
552
  empty: string;
536
553
  };
554
+ chat: {
555
+ /** The message list's name. */
556
+ conversation: string;
557
+ empty: string;
558
+ emptyDescription: string;
559
+ /** Who said it: "You", "Assistant", "System", "Developer", "Tool". */
560
+ role: (role: ChatRole) => string;
561
+ /** A message's accessible name. */
562
+ messageFrom: (speaker: string) => string;
563
+ /** An answer that has started but has no text yet. */
564
+ thinking: string;
565
+ /** Read after a message still being written. */
566
+ writing: string;
567
+ jumpToLatest: string;
568
+ runFailed: string;
569
+ retry: string;
570
+ /** The composer's field. */
571
+ composer: string;
572
+ placeholder: string;
573
+ composerHint: string;
574
+ send: string;
575
+ stop: string;
576
+ attachments: string;
577
+ /** A tool call's accessible name. */
578
+ toolCall: (name: string) => string;
579
+ toolStatus: (status: ChatToolCallStatus | "approval") => string;
580
+ details: string;
581
+ arguments: string;
582
+ noArguments: string;
583
+ result: string;
584
+ toolError: string;
585
+ approvalNeeded: string;
586
+ approve: string;
587
+ deny: string;
588
+ approveTitle: (name: string) => string;
589
+ approveDescription: string;
590
+ denyTitle: (name: string) => string;
591
+ denyDescription: string;
592
+ denyReason: string;
593
+ /** The agent progress section's name. */
594
+ progress: string;
595
+ steps: string;
596
+ runStatus: (status: ChatRunStatus) => string;
597
+ model: string;
598
+ };
599
+ agent: {
600
+ /** The assistant's name: the panel's title and the launcher's. Takes the product's name when there is one. */
601
+ title: (product?: string) => string;
602
+ /** The launcher's name when closed and open. */
603
+ open: (title: string) => string;
604
+ close: string;
605
+ /** Read with the launcher's name: "2 unread". */
606
+ unread: (count: number) => string;
607
+ newConversation: string;
608
+ expand: string;
609
+ restore: string;
610
+ /** The suggestion chips' group. */
611
+ suggestions: string;
612
+ emptyTitle: string;
613
+ emptyDescription: string;
614
+ /** Under the composer while a tool waits on the person. */
615
+ waitingOnYou: string;
616
+ /** The shortcut as people read it, from the key list ("⌘/", "Ctrl+/"). */
617
+ shortcut: (keys: string) => string;
618
+ };
537
619
  }
538
620
  export declare const defaultMessages: Messages;
539
621
  /** Any subset of the messages, one level deep. */
@@ -600,6 +600,26 @@ export const defaultMessages = {
600
600
  importAction: "Import",
601
601
  importing: "Importing",
602
602
  importedNotice: "Imported.",
603
+ newFlow: "New flow",
604
+ newFlowTitle: "New flow",
605
+ newFlowDescription: "An empty flow beside the others. A sub-flow node runs it.",
606
+ createFlow: "Create flow",
607
+ renameFlow: "Rename flow",
608
+ renameFlowTitle: (name) => `Rename ${name}`,
609
+ renameFlowDescription: "Sub-flow nodes that run it, and the main flow, follow the new name.",
610
+ rename: "Rename",
611
+ flowName: "Name",
612
+ flowNameHint: "Lowercase letters, digits and dashes, starting with a letter. Up to 32.",
613
+ flowLabel: "Label",
614
+ flowLabelHint: "How the flow is shown. Its name when empty.",
615
+ flowNameProblem: (problem) => ({
616
+ empty: "Give the flow a name.",
617
+ format: "Use lowercase letters, digits and dashes, starting with a letter, up to 32.",
618
+ taken: "Another flow has this name.",
619
+ })[problem],
620
+ flowsFull: (max) => `A workflow holds at most ${count(max)} flows.`,
621
+ flowCreatedNotice: (name) => `Flow ${name} created.`,
622
+ flowRenamedNotice: (name) => `Flow renamed to ${name}.`,
603
623
  importAvailability: (status) => ({
604
624
  available: "Runs here",
605
625
  "missing-capabilities": "Missing capabilities here",
@@ -761,6 +781,77 @@ export const defaultMessages = {
761
781
  cancel: "Cancel",
762
782
  empty: "Nothing found",
763
783
  },
784
+ chat: {
785
+ conversation: "Conversation",
786
+ empty: "No messages yet",
787
+ emptyDescription: "Ask a question to start.",
788
+ role: (role) => ({
789
+ user: "You",
790
+ assistant: "Assistant",
791
+ system: "System",
792
+ developer: "Developer",
793
+ tool: "Tool",
794
+ })[role],
795
+ messageFrom: (speaker) => `Message from ${speaker}`,
796
+ thinking: "Thinking",
797
+ writing: "Still writing",
798
+ jumpToLatest: "Jump to latest",
799
+ runFailed: "The run failed",
800
+ retry: "Retry",
801
+ composer: "Message",
802
+ placeholder: "Ask anything",
803
+ composerHint: "Enter to send, Shift+Enter for a new line.",
804
+ send: "Send",
805
+ stop: "Stop",
806
+ attachments: "Attachments",
807
+ toolCall: (name) => `Tool call ${name}`,
808
+ toolStatus: (status) => ({
809
+ streaming: "preparing",
810
+ running: "running",
811
+ complete: "done",
812
+ failed: "failed",
813
+ cancelled: "cancelled",
814
+ approval: "needs approval",
815
+ })[status],
816
+ details: "Details",
817
+ arguments: "Arguments",
818
+ noArguments: "No arguments",
819
+ result: "Result",
820
+ toolError: "Error",
821
+ approvalNeeded: "The agent is waiting for your approval to run this.",
822
+ approve: "Approve",
823
+ deny: "Deny",
824
+ approveTitle: (name) => `Run ${name}?`,
825
+ approveDescription: "The agent runs it with the arguments shown and continues.",
826
+ denyTitle: (name) => `Deny ${name}?`,
827
+ denyDescription: "The agent does not run it and is told why.",
828
+ denyReason: "Reason",
829
+ progress: "Agent progress",
830
+ steps: "Steps",
831
+ runStatus: (status) => ({
832
+ idle: "idle",
833
+ running: "running",
834
+ finished: "finished",
835
+ interrupted: "waiting for you",
836
+ cancelled: "stopped",
837
+ error: "failed",
838
+ })[status],
839
+ model: "Model",
840
+ },
841
+ agent: {
842
+ title: (product) => (product ? `${product} assistant` : "Assistant"),
843
+ open: (title) => `Open ${title}`,
844
+ close: "Close",
845
+ unread: (count) => `${count.toLocaleString("en")} unread`,
846
+ newConversation: "New conversation",
847
+ expand: "Expand",
848
+ restore: "Restore",
849
+ suggestions: "Suggestions",
850
+ emptyTitle: "How can I help?",
851
+ emptyDescription: "Ask about what is on this page, or pick a starting point.",
852
+ waitingOnYou: "Answer the card above to continue.",
853
+ shortcut: (keys) => `Shortcut ${keys}`,
854
+ },
764
855
  };
765
856
  export function mergeMessages(overrides) {
766
857
  if (!overrides)
@@ -0,0 +1,52 @@
1
+ import { ACCENT_KEYS, DEFAULT_ACCENT, GROUNDS, GROUND_KEYS, type FamilyAccent, type Ground, type StatusName } from "../tokens.js";
2
+ export declare const COLOR_TOKENS: readonly ["background", "foreground", "card", "card-foreground", "popover", "popover-foreground", "primary", "primary-foreground", "secondary", "secondary-foreground", "muted", "muted-foreground", "accent", "accent-foreground", "destructive", "border", "input", "ring", "chart-1", "chart-2", "chart-3", "chart-4", "chart-5", "sidebar", "sidebar-foreground", "sidebar-primary", "sidebar-primary-foreground", "sidebar-accent", "sidebar-accent-foreground", "sidebar-border", "sidebar-ring", "sidebar-muted-foreground", "surface-0", "surface-1", "surface-2", ...(StatusName | "success-fg" | "warning-fg" | "info-fg" | "danger-fg" | "success-bg" | "warning-bg" | "info-bg" | "danger-bg" | "success-border" | "warning-border" | "info-border" | "danger-border")[]];
3
+ export type ColorToken = (typeof COLOR_TOKENS)[number];
4
+ export type Palette = Record<ColorToken, string>;
5
+ export { ACCENT_KEYS, DEFAULT_ACCENT, GROUNDS, GROUND_KEYS };
6
+ export type { FamilyAccent, Ground };
7
+ /** The ground `:root` paints when nothing chooses one (the preset's default). */
8
+ export declare const DEFAULT_GROUND: Ground;
9
+ /**
10
+ * The type stacks of the preset (`--font-sans`, `--font-mono`, `--font-head`
11
+ * in preset.css; a test holds them equal). Each names the app's loaded font
12
+ * variable first, then the family, then system fallbacks.
13
+ */
14
+ export declare const FONTS: {
15
+ readonly sans: "var(--font-plex-sans, \"IBM Plex Sans\"), system-ui, sans-serif";
16
+ readonly mono: "var(--font-plex-mono, \"IBM Plex Mono\"), ui-monospace, SFMono-Regular, Menlo, monospace";
17
+ readonly head: "var(--font-dm-sans, \"DM Sans\"), system-ui, sans-serif";
18
+ };
19
+ /** The family a stack names, for targets that take one font name (React Native). */
20
+ export declare function fontFamily(stack: string): string;
21
+ /** `--radius` in px, and the motion durations in ms, as numbers. */
22
+ export declare function staticNumbers(): {
23
+ radius: number;
24
+ motion: Record<"fast" | "base" | "slow", number>;
25
+ };
26
+ export interface Rgba {
27
+ r: number;
28
+ g: number;
29
+ b: number;
30
+ a: number;
31
+ }
32
+ /** Parses `#rrggbb` or `rgba(r, g, b, a)`; anything else is a token this module does not know. */
33
+ export declare function parseColor(value: string): Rgba;
34
+ /**
35
+ * A translucent token laid on its surface, for targets with no alpha
36
+ * (a terminal, Tk): `sidebar-*` tokens on the sidebar, the rest on the
37
+ * background. Opaque tokens come back as they are.
38
+ */
39
+ export declare function flatten(palette: Palette, token: ColorToken): Rgba;
40
+ /** The concrete palette of one ground with one family accent, with no product brand. */
41
+ export declare function resolvePalette(ground: Ground, accent?: FamilyAccent): Palette;
42
+ /** Every ground with every family accent. */
43
+ export declare function allPalettes(): Record<Ground, Record<FamilyAccent, Palette>>;
44
+ /**
45
+ * A target's values split for compact output: per ground, the entries every
46
+ * accent agrees on, and per ground and accent, the entries that move with
47
+ * the accent.
48
+ */
49
+ export declare function splitByAccent<K extends string, V>(values: (ground: Ground, accent: FamilyAccent) => Record<K, V>): {
50
+ ground: Record<Ground, Partial<Record<K, V>>>;
51
+ accent: Record<Ground, Record<FamilyAccent, Partial<Record<K, V>>>>;
52
+ };