@assistant-ui/react-ink 0.0.4 → 0.0.7
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/README.md +1 -0
- package/dist/context/AssistantContext.d.ts +1 -1
- package/dist/context/AssistantContext.d.ts.map +1 -1
- package/dist/context/AssistantContext.js +1 -1
- package/dist/context/AssistantContext.js.map +1 -1
- package/dist/index.d.ts +28 -16
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +26 -17
- package/dist/index.js.map +1 -1
- package/dist/primitives/{actionBar/index.d.ts → actionBar.d.ts} +6 -6
- package/dist/primitives/actionBar.d.ts.map +1 -0
- package/dist/primitives/actionBar.js +6 -0
- package/dist/primitives/actionBar.js.map +1 -0
- package/dist/primitives/{attachment/index.d.ts → attachment.d.ts} +5 -5
- package/dist/primitives/attachment.d.ts.map +1 -0
- package/dist/primitives/attachment.js +5 -0
- package/dist/primitives/attachment.js.map +1 -0
- package/dist/primitives/branchPicker/BranchPickerNext.d.ts.map +1 -1
- package/dist/primitives/branchPicker/BranchPickerNext.js +3 -15
- package/dist/primitives/branchPicker/BranchPickerNext.js.map +1 -1
- package/dist/primitives/branchPicker/BranchPickerPrevious.d.ts.map +1 -1
- package/dist/primitives/branchPicker/BranchPickerPrevious.js +3 -15
- package/dist/primitives/branchPicker/BranchPickerPrevious.js.map +1 -1
- package/dist/primitives/branchPicker.d.ts +5 -0
- package/dist/primitives/branchPicker.d.ts.map +1 -0
- package/dist/primitives/branchPicker.js +5 -0
- package/dist/primitives/branchPicker.js.map +1 -0
- package/dist/primitives/{chainOfThought/index.d.ts → chainOfThought.d.ts} +3 -3
- package/dist/primitives/chainOfThought.d.ts.map +1 -0
- package/dist/primitives/chainOfThought.js +4 -0
- package/dist/primitives/chainOfThought.js.map +1 -0
- package/dist/primitives/composer/ComposerSend.js +1 -1
- package/dist/primitives/composer/ComposerSend.js.map +1 -1
- package/dist/primitives/composer.d.ts +8 -0
- package/dist/primitives/composer.d.ts.map +1 -0
- package/dist/primitives/composer.js +8 -0
- package/dist/primitives/composer.js.map +1 -0
- package/dist/primitives/diff/DiffContent.d.ts +22 -0
- package/dist/primitives/diff/DiffContent.d.ts.map +1 -0
- package/dist/primitives/diff/DiffContent.js +40 -0
- package/dist/primitives/diff/DiffContent.js.map +1 -0
- package/dist/primitives/diff/DiffContext.d.ts +8 -0
- package/dist/primitives/diff/DiffContext.d.ts.map +1 -0
- package/dist/primitives/diff/DiffContext.js +11 -0
- package/dist/primitives/diff/DiffContext.js.map +1 -0
- package/dist/primitives/diff/DiffHeader.d.ts +10 -0
- package/dist/primitives/diff/DiffHeader.d.ts.map +1 -0
- package/dist/primitives/diff/DiffHeader.js +18 -0
- package/dist/primitives/diff/DiffHeader.js.map +1 -0
- package/dist/primitives/diff/DiffLine.d.ts +13 -0
- package/dist/primitives/diff/DiffLine.d.ts.map +1 -0
- package/dist/primitives/diff/DiffLine.js +20 -0
- package/dist/primitives/diff/DiffLine.js.map +1 -0
- package/dist/primitives/diff/DiffRoot.d.ts +12 -0
- package/dist/primitives/diff/DiffRoot.d.ts.map +1 -0
- package/dist/primitives/diff/DiffRoot.js +8 -0
- package/dist/primitives/diff/DiffRoot.js.map +1 -0
- package/dist/primitives/diff/DiffStats.d.ts +10 -0
- package/dist/primitives/diff/DiffStats.d.ts.map +1 -0
- package/dist/primitives/diff/DiffStats.js +12 -0
- package/dist/primitives/diff/DiffStats.js.map +1 -0
- package/dist/primitives/diff/DiffView.d.ts +13 -0
- package/dist/primitives/diff/DiffView.d.ts.map +1 -0
- package/dist/primitives/diff/DiffView.js +76 -0
- package/dist/primitives/diff/DiffView.js.map +1 -0
- package/dist/primitives/diff/diff-utils.d.ts +9 -0
- package/dist/primitives/diff/diff-utils.d.ts.map +1 -0
- package/dist/primitives/diff/diff-utils.js +125 -0
- package/dist/primitives/diff/diff-utils.js.map +1 -0
- package/dist/primitives/diff/index.d.ts +7 -0
- package/dist/primitives/diff/index.d.ts.map +1 -0
- package/dist/primitives/diff/index.js +6 -0
- package/dist/primitives/diff/index.js.map +1 -0
- package/dist/primitives/diff/types.d.ts +24 -0
- package/dist/primitives/diff/types.d.ts.map +1 -0
- package/dist/primitives/diff/types.js +2 -0
- package/dist/primitives/diff/types.js.map +1 -0
- package/dist/primitives/diff.d.ts +2 -0
- package/dist/primitives/diff.d.ts.map +1 -0
- package/dist/primitives/diff.js +2 -0
- package/dist/primitives/diff.js.map +1 -0
- package/dist/primitives/error/ErrorMessage.d.ts +10 -0
- package/dist/primitives/error/ErrorMessage.d.ts.map +1 -0
- package/dist/primitives/error/ErrorMessage.js +11 -0
- package/dist/primitives/error/ErrorMessage.js.map +1 -0
- package/dist/primitives/error/ErrorRoot.d.ts +10 -0
- package/dist/primitives/error/ErrorRoot.d.ts.map +1 -0
- package/dist/primitives/error/ErrorRoot.js +11 -0
- package/dist/primitives/error/ErrorRoot.js.map +1 -0
- package/dist/primitives/error/index.d.ts +3 -0
- package/dist/primitives/error/index.d.ts.map +1 -0
- package/dist/primitives/error/index.js +3 -0
- package/dist/primitives/error/index.js.map +1 -0
- package/dist/primitives/message/MessageError.d.ts +3 -0
- package/dist/primitives/message/MessageError.d.ts.map +1 -0
- package/dist/primitives/message/MessageError.js +7 -0
- package/dist/primitives/message/MessageError.js.map +1 -0
- package/dist/primitives/message/MessageParts.d.ts.map +1 -1
- package/dist/primitives/message/MessageParts.js +5 -1
- package/dist/primitives/message/MessageParts.js.map +1 -1
- package/dist/primitives/message.d.ts +7 -0
- package/dist/primitives/message.d.ts.map +1 -0
- package/dist/primitives/message.js +7 -0
- package/dist/primitives/message.js.map +1 -0
- package/dist/primitives/suggestion/SuggestionTrigger.d.ts +1 -1
- package/dist/primitives/suggestion/SuggestionTrigger.d.ts.map +1 -1
- package/dist/primitives/suggestion/SuggestionTrigger.js +8 -29
- package/dist/primitives/suggestion/SuggestionTrigger.js.map +1 -1
- package/dist/primitives/suggestion.d.ts +4 -0
- package/dist/primitives/suggestion.d.ts.map +1 -0
- package/dist/primitives/suggestion.js +4 -0
- package/dist/primitives/suggestion.js.map +1 -0
- package/dist/primitives/thread/ThreadMessages.d.ts +9 -2
- package/dist/primitives/thread/ThreadMessages.d.ts.map +1 -1
- package/dist/primitives/thread/ThreadMessages.js +18 -18
- package/dist/primitives/thread/ThreadMessages.js.map +1 -1
- package/dist/primitives/thread/ThreadSuggestion.d.ts +1 -1
- package/dist/primitives/thread/ThreadSuggestion.d.ts.map +1 -1
- package/dist/primitives/thread/ThreadSuggestion.js +7 -29
- package/dist/primitives/thread/ThreadSuggestion.js.map +1 -1
- package/dist/primitives/{thread/index.d.ts → thread.d.ts} +6 -6
- package/dist/primitives/thread.d.ts.map +1 -0
- package/dist/primitives/thread.js +8 -0
- package/dist/primitives/thread.js.map +1 -0
- package/dist/primitives/threadList/ThreadListNew.d.ts +1 -1
- package/dist/primitives/threadList/ThreadListNew.d.ts.map +1 -1
- package/dist/primitives/threadList/ThreadListNew.js +3 -7
- package/dist/primitives/threadList/ThreadListNew.js.map +1 -1
- package/dist/primitives/{threadList/index.d.ts → threadList.d.ts} +4 -4
- package/dist/primitives/threadList.d.ts.map +1 -0
- package/dist/primitives/threadList.js +4 -0
- package/dist/primitives/threadList.js.map +1 -0
- package/dist/primitives/threadListItem/ThreadListItemArchive.d.ts +1 -1
- package/dist/primitives/threadListItem/ThreadListItemArchive.d.ts.map +1 -1
- package/dist/primitives/threadListItem/ThreadListItemArchive.js +3 -7
- package/dist/primitives/threadListItem/ThreadListItemArchive.js.map +1 -1
- package/dist/primitives/threadListItem/ThreadListItemDelete.d.ts +1 -1
- package/dist/primitives/threadListItem/ThreadListItemDelete.d.ts.map +1 -1
- package/dist/primitives/threadListItem/ThreadListItemDelete.js +3 -7
- package/dist/primitives/threadListItem/ThreadListItemDelete.js.map +1 -1
- package/dist/primitives/threadListItem/ThreadListItemTrigger.d.ts +1 -1
- package/dist/primitives/threadListItem/ThreadListItemTrigger.d.ts.map +1 -1
- package/dist/primitives/threadListItem/ThreadListItemTrigger.js +3 -7
- package/dist/primitives/threadListItem/ThreadListItemTrigger.js.map +1 -1
- package/dist/primitives/threadListItem/ThreadListItemUnarchive.d.ts +1 -1
- package/dist/primitives/threadListItem/ThreadListItemUnarchive.d.ts.map +1 -1
- package/dist/primitives/threadListItem/ThreadListItemUnarchive.js +3 -7
- package/dist/primitives/threadListItem/ThreadListItemUnarchive.js.map +1 -1
- package/dist/primitives/threadListItem.d.ts +7 -0
- package/dist/primitives/threadListItem.d.ts.map +1 -0
- package/dist/primitives/threadListItem.js +7 -0
- package/dist/primitives/threadListItem.js.map +1 -0
- package/dist/primitives/toolCall/ToolFallback.d.ts +1 -1
- package/dist/primitives/toolCall/ToolFallback.d.ts.map +1 -1
- package/dist/primitives/toolCall.d.ts +2 -0
- package/dist/primitives/toolCall.d.ts.map +1 -0
- package/dist/primitives/toolCall.js +2 -0
- package/dist/primitives/toolCall.js.map +1 -0
- package/package.json +14 -12
- package/src/context/AssistantContext.tsx +1 -4
- package/src/index.ts +71 -7
- package/src/primitives/{actionBar/index.ts → actionBar.ts} +5 -5
- package/src/primitives/{attachment/index.ts → attachment.ts} +4 -4
- package/src/primitives/branchPicker/BranchPickerNext.tsx +3 -15
- package/src/primitives/branchPicker/BranchPickerPrevious.tsx +3 -15
- package/src/primitives/{branchPicker/index.ts → branchPicker.ts} +4 -4
- package/src/primitives/{chainOfThought/index.ts → chainOfThought.ts} +2 -2
- package/src/primitives/composer/ComposerSend.tsx +1 -1
- package/src/primitives/{composer/index.ts → composer.ts} +7 -7
- package/src/primitives/diff/DiffContent.tsx +77 -0
- package/src/primitives/diff/DiffContext.tsx +18 -0
- package/src/primitives/diff/DiffHeader.tsx +38 -0
- package/src/primitives/diff/DiffLine.tsx +42 -0
- package/src/primitives/diff/DiffRoot.tsx +25 -0
- package/src/primitives/diff/DiffStats.tsx +22 -0
- package/src/primitives/diff/DiffView.test.tsx +340 -0
- package/src/primitives/diff/DiffView.tsx +204 -0
- package/src/primitives/diff/diff-utils.ts +149 -0
- package/src/primitives/diff/index.ts +25 -0
- package/src/primitives/diff/types.ts +28 -0
- package/src/primitives/diff.ts +1 -0
- package/src/primitives/error/ErrorMessage.tsx +17 -0
- package/src/primitives/error/ErrorRoot.tsx +16 -0
- package/src/primitives/error/index.ts +8 -0
- package/src/primitives/message/MessageContent.tsx +1 -1
- package/src/primitives/message/MessageError.tsx +9 -0
- package/src/primitives/message/MessageParts.tsx +10 -4
- package/src/primitives/{message/index.ts → message.ts} +9 -5
- package/src/primitives/suggestion/SuggestionTrigger.tsx +10 -30
- package/src/primitives/{suggestion/index.ts → suggestion.ts} +3 -3
- package/src/primitives/thread/ThreadMessages.tsx +46 -37
- package/src/primitives/thread/ThreadSuggestion.tsx +9 -30
- package/src/primitives/{thread/index.ts → thread.ts} +8 -5
- package/src/primitives/threadList/ThreadListNew.tsx +4 -8
- package/src/primitives/{threadList/index.ts → threadList.ts} +3 -3
- package/src/primitives/threadListItem/ThreadListItemArchive.tsx +4 -8
- package/src/primitives/threadListItem/ThreadListItemDelete.tsx +4 -8
- package/src/primitives/threadListItem/ThreadListItemTrigger.tsx +4 -8
- package/src/primitives/threadListItem/ThreadListItemUnarchive.tsx +4 -8
- package/src/primitives/{threadListItem/index.ts → threadListItem.ts} +5 -5
- package/src/primitives/toolCall/ToolFallback.tsx +1 -1
- package/src/primitives/{toolCall/index.ts → toolCall.ts} +1 -1
- package/dist/client/index.d.ts +0 -5
- package/dist/client/index.d.ts.map +0 -1
- package/dist/client/index.js +0 -7
- package/dist/client/index.js.map +0 -1
- package/dist/context/index.d.ts +0 -2
- package/dist/context/index.d.ts.map +0 -1
- package/dist/context/index.js +0 -2
- package/dist/context/index.js.map +0 -1
- package/dist/model-context/index.d.ts +0 -9
- package/dist/model-context/index.d.ts.map +0 -1
- package/dist/model-context/index.js +0 -7
- package/dist/model-context/index.js.map +0 -1
- package/dist/primitives/actionBar/index.d.ts.map +0 -1
- package/dist/primitives/actionBar/index.js +0 -6
- package/dist/primitives/actionBar/index.js.map +0 -1
- package/dist/primitives/attachment/index.d.ts.map +0 -1
- package/dist/primitives/attachment/index.js +0 -5
- package/dist/primitives/attachment/index.js.map +0 -1
- package/dist/primitives/branchPicker/index.d.ts +0 -5
- package/dist/primitives/branchPicker/index.d.ts.map +0 -1
- package/dist/primitives/branchPicker/index.js +0 -5
- package/dist/primitives/branchPicker/index.js.map +0 -1
- package/dist/primitives/chainOfThought/index.d.ts.map +0 -1
- package/dist/primitives/chainOfThought/index.js +0 -4
- package/dist/primitives/chainOfThought/index.js.map +0 -1
- package/dist/primitives/composer/index.d.ts +0 -8
- package/dist/primitives/composer/index.d.ts.map +0 -1
- package/dist/primitives/composer/index.js +0 -8
- package/dist/primitives/composer/index.js.map +0 -1
- package/dist/primitives/message/index.d.ts +0 -6
- package/dist/primitives/message/index.d.ts.map +0 -1
- package/dist/primitives/message/index.js +0 -6
- package/dist/primitives/message/index.js.map +0 -1
- package/dist/primitives/suggestion/index.d.ts +0 -4
- package/dist/primitives/suggestion/index.d.ts.map +0 -1
- package/dist/primitives/suggestion/index.js +0 -4
- package/dist/primitives/suggestion/index.js.map +0 -1
- package/dist/primitives/thread/index.d.ts.map +0 -1
- package/dist/primitives/thread/index.js +0 -8
- package/dist/primitives/thread/index.js.map +0 -1
- package/dist/primitives/threadList/index.d.ts.map +0 -1
- package/dist/primitives/threadList/index.js +0 -4
- package/dist/primitives/threadList/index.js.map +0 -1
- package/dist/primitives/threadListItem/index.d.ts +0 -7
- package/dist/primitives/threadListItem/index.d.ts.map +0 -1
- package/dist/primitives/threadListItem/index.js +0 -7
- package/dist/primitives/threadListItem/index.js.map +0 -1
- package/dist/primitives/toolCall/index.d.ts +0 -2
- package/dist/primitives/toolCall/index.d.ts.map +0 -1
- package/dist/primitives/toolCall/index.js +0 -2
- package/dist/primitives/toolCall/index.js.map +0 -1
- package/dist/runtimes/index.d.ts +0 -3
- package/dist/runtimes/index.d.ts.map +0 -1
- package/dist/runtimes/index.js +0 -3
- package/dist/runtimes/index.js.map +0 -1
- package/dist/types/index.d.ts +0 -2
- package/dist/types/index.d.ts.map +0 -1
- package/dist/types/index.js +0 -2
- package/dist/types/index.js.map +0 -1
- package/dist/types/scopes/index.d.ts +0 -3
- package/dist/types/scopes/index.d.ts.map +0 -1
- package/dist/types/scopes/index.js +0 -2
- package/dist/types/scopes/index.js.map +0 -1
- package/src/client/index.ts +0 -7
- package/src/context/index.ts +0 -4
- package/src/model-context/index.ts +0 -44
- package/src/runtimes/index.ts +0 -2
- package/src/types/index.ts +0 -23
- package/src/types/scopes/index.ts +0 -59
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@assistant-ui/react-ink",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.7",
|
|
4
4
|
"description": "React Ink (terminal UI) bindings for assistant-ui",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"assistant",
|
|
@@ -34,17 +34,19 @@
|
|
|
34
34
|
],
|
|
35
35
|
"sideEffects": false,
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@assistant-ui/core": "^0.1.
|
|
38
|
-
"@assistant-ui/store": "^0.2.
|
|
39
|
-
"@assistant-ui/tap": "^0.5.
|
|
40
|
-
"assistant-stream": "^0.3.
|
|
37
|
+
"@assistant-ui/core": "^0.1.8",
|
|
38
|
+
"@assistant-ui/store": "^0.2.4",
|
|
39
|
+
"@assistant-ui/tap": "^0.5.4",
|
|
40
|
+
"assistant-stream": "^0.3.7",
|
|
41
|
+
"diff": "^8.0.3",
|
|
41
42
|
"ink-spinner": "^5.0.0",
|
|
42
|
-
"
|
|
43
|
+
"parse-diff": "^0.11.1",
|
|
44
|
+
"zustand": "^5.0.12"
|
|
43
45
|
},
|
|
44
46
|
"peerDependencies": {
|
|
45
47
|
"@types/react": "*",
|
|
46
|
-
"ink": ">=
|
|
47
|
-
"react": "^
|
|
48
|
+
"ink": ">=6",
|
|
49
|
+
"react": "^19"
|
|
48
50
|
},
|
|
49
51
|
"peerDependenciesMeta": {
|
|
50
52
|
"@types/react": {
|
|
@@ -53,11 +55,11 @@
|
|
|
53
55
|
},
|
|
54
56
|
"devDependencies": {
|
|
55
57
|
"@types/react": "^19.2.14",
|
|
56
|
-
"ink": "^
|
|
58
|
+
"ink": "^6.8.0",
|
|
57
59
|
"ink-testing-library": "^4.0.0",
|
|
58
|
-
"react": "
|
|
59
|
-
"vitest": "^4.0
|
|
60
|
-
"@assistant-ui/x-buildutils": "0.0.
|
|
60
|
+
"react": "^19.2.4",
|
|
61
|
+
"vitest": "^4.1.0",
|
|
62
|
+
"@assistant-ui/x-buildutils": "0.0.3"
|
|
61
63
|
},
|
|
62
64
|
"publishConfig": {
|
|
63
65
|
"access": "public",
|
package/src/index.ts
CHANGED
|
@@ -91,15 +91,15 @@ export {
|
|
|
91
91
|
type AssistantEventCallback,
|
|
92
92
|
} from "@assistant-ui/store";
|
|
93
93
|
|
|
94
|
-
// Context providers
|
|
95
|
-
export { AssistantRuntimeProvider
|
|
94
|
+
// Context providers
|
|
95
|
+
export { AssistantRuntimeProvider } from "./context/AssistantContext";
|
|
96
96
|
|
|
97
97
|
// Runtime
|
|
98
98
|
export {
|
|
99
99
|
useLocalRuntime,
|
|
100
100
|
type LocalRuntimeOptions,
|
|
101
|
-
|
|
102
|
-
} from "./runtimes";
|
|
101
|
+
} from "./runtimes/useLocalRuntime";
|
|
102
|
+
export { useRemoteThreadListRuntime } from "./runtimes/useRemoteThreadListRuntime";
|
|
103
103
|
|
|
104
104
|
// Primitives
|
|
105
105
|
export * as ThreadPrimitive from "./primitives/thread";
|
|
@@ -113,6 +113,9 @@ export * as ThreadListItemPrimitive from "./primitives/threadListItem";
|
|
|
113
113
|
export * as ChainOfThoughtPrimitive from "./primitives/chainOfThought";
|
|
114
114
|
export * as SuggestionPrimitive from "./primitives/suggestion";
|
|
115
115
|
export * as ToolCallPrimitive from "./primitives/toolCall";
|
|
116
|
+
export * as ErrorPrimitive from "./primitives/error";
|
|
117
|
+
export * as DiffPrimitive from "./primitives/diff";
|
|
118
|
+
export { DiffView, type DiffViewProps } from "./primitives/diff/DiffView";
|
|
116
119
|
|
|
117
120
|
// Re-export shared providers from core/react
|
|
118
121
|
export {
|
|
@@ -126,6 +129,67 @@ export {
|
|
|
126
129
|
} from "@assistant-ui/core/react";
|
|
127
130
|
|
|
128
131
|
// Model context, tools & clients
|
|
129
|
-
export
|
|
130
|
-
|
|
131
|
-
|
|
132
|
+
export {
|
|
133
|
+
makeAssistantTool,
|
|
134
|
+
type AssistantTool,
|
|
135
|
+
makeAssistantToolUI,
|
|
136
|
+
type AssistantToolUI,
|
|
137
|
+
makeAssistantDataUI,
|
|
138
|
+
type AssistantDataUI,
|
|
139
|
+
useAssistantTool,
|
|
140
|
+
type AssistantToolProps,
|
|
141
|
+
useAssistantToolUI,
|
|
142
|
+
type AssistantToolUIProps,
|
|
143
|
+
useAssistantDataUI,
|
|
144
|
+
type AssistantDataUIProps,
|
|
145
|
+
useAssistantInstructions,
|
|
146
|
+
useInlineRender,
|
|
147
|
+
type Toolkit,
|
|
148
|
+
type ToolDefinition,
|
|
149
|
+
Tools,
|
|
150
|
+
DataRenderers,
|
|
151
|
+
} from "@assistant-ui/core/react";
|
|
152
|
+
export type {
|
|
153
|
+
ModelContext,
|
|
154
|
+
ModelContextProvider,
|
|
155
|
+
LanguageModelConfig,
|
|
156
|
+
LanguageModelV1CallSettings,
|
|
157
|
+
} from "@assistant-ui/core";
|
|
158
|
+
export { mergeModelContexts } from "@assistant-ui/core";
|
|
159
|
+
export type { Tool } from "assistant-stream";
|
|
160
|
+
export { tool } from "@assistant-ui/core";
|
|
161
|
+
export { Suggestions, type SuggestionConfig } from "@assistant-ui/core/store";
|
|
162
|
+
export { ModelContextRegistry } from "@assistant-ui/core";
|
|
163
|
+
export type {
|
|
164
|
+
ModelContextRegistryToolHandle,
|
|
165
|
+
ModelContextRegistryInstructionHandle,
|
|
166
|
+
ModelContextRegistryProviderHandle,
|
|
167
|
+
} from "@assistant-ui/core";
|
|
168
|
+
|
|
169
|
+
// Client exports
|
|
170
|
+
export { ModelContext as ModelContextClient } from "@assistant-ui/core/store";
|
|
171
|
+
export { ChainOfThoughtClient } from "@assistant-ui/core/store";
|
|
172
|
+
|
|
173
|
+
// Component types
|
|
174
|
+
export type {
|
|
175
|
+
EmptyMessagePartComponent,
|
|
176
|
+
EmptyMessagePartProps,
|
|
177
|
+
TextMessagePartComponent,
|
|
178
|
+
TextMessagePartProps,
|
|
179
|
+
ReasoningMessagePartComponent,
|
|
180
|
+
ReasoningMessagePartProps,
|
|
181
|
+
ReasoningGroupProps,
|
|
182
|
+
ReasoningGroupComponent,
|
|
183
|
+
SourceMessagePartComponent,
|
|
184
|
+
SourceMessagePartProps,
|
|
185
|
+
ImageMessagePartComponent,
|
|
186
|
+
ImageMessagePartProps,
|
|
187
|
+
FileMessagePartComponent,
|
|
188
|
+
FileMessagePartProps,
|
|
189
|
+
Unstable_AudioMessagePartComponent,
|
|
190
|
+
Unstable_AudioMessagePartProps,
|
|
191
|
+
DataMessagePartComponent,
|
|
192
|
+
DataMessagePartProps,
|
|
193
|
+
ToolCallMessagePartComponent,
|
|
194
|
+
ToolCallMessagePartProps,
|
|
195
|
+
} from "@assistant-ui/core/react";
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
export {
|
|
2
2
|
ActionBarCopy as Copy,
|
|
3
3
|
type ActionBarCopyProps as CopyProps,
|
|
4
|
-
} from "./ActionBarCopy";
|
|
4
|
+
} from "./actionBar/ActionBarCopy";
|
|
5
5
|
export {
|
|
6
6
|
ActionBarEdit as Edit,
|
|
7
7
|
type ActionBarEditProps as EditProps,
|
|
8
|
-
} from "./ActionBarEdit";
|
|
8
|
+
} from "./actionBar/ActionBarEdit";
|
|
9
9
|
export {
|
|
10
10
|
ActionBarReload as Reload,
|
|
11
11
|
type ActionBarReloadProps as ReloadProps,
|
|
12
|
-
} from "./ActionBarReload";
|
|
12
|
+
} from "./actionBar/ActionBarReload";
|
|
13
13
|
export {
|
|
14
14
|
ActionBarFeedbackPositive as FeedbackPositive,
|
|
15
15
|
type ActionBarFeedbackPositiveProps as FeedbackPositiveProps,
|
|
16
|
-
} from "./ActionBarFeedbackPositive";
|
|
16
|
+
} from "./actionBar/ActionBarFeedbackPositive";
|
|
17
17
|
export {
|
|
18
18
|
ActionBarFeedbackNegative as FeedbackNegative,
|
|
19
19
|
type ActionBarFeedbackNegativeProps as FeedbackNegativeProps,
|
|
20
|
-
} from "./ActionBarFeedbackNegative";
|
|
20
|
+
} from "./actionBar/ActionBarFeedbackNegative";
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
export {
|
|
2
2
|
AttachmentRoot as Root,
|
|
3
3
|
type AttachmentRootProps as RootProps,
|
|
4
|
-
} from "./AttachmentRoot";
|
|
4
|
+
} from "./attachment/AttachmentRoot";
|
|
5
5
|
export {
|
|
6
6
|
AttachmentName as Name,
|
|
7
7
|
type AttachmentNameProps as NameProps,
|
|
8
|
-
} from "./AttachmentName";
|
|
8
|
+
} from "./attachment/AttachmentName";
|
|
9
9
|
export {
|
|
10
10
|
AttachmentThumb as Thumb,
|
|
11
11
|
type AttachmentThumbProps as ThumbProps,
|
|
12
|
-
} from "./AttachmentThumb";
|
|
12
|
+
} from "./attachment/AttachmentThumb";
|
|
13
13
|
export {
|
|
14
14
|
AttachmentRemove as Remove,
|
|
15
15
|
type AttachmentRemoveProps as RemoveProps,
|
|
16
|
-
} from "./AttachmentRemove";
|
|
16
|
+
} from "./attachment/AttachmentRemove";
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { ReactNode } from "react";
|
|
2
|
-
import {
|
|
3
|
-
import { useAui, useAuiState } from "@assistant-ui/store";
|
|
2
|
+
import { useBranchPickerNext } from "@assistant-ui/core/react";
|
|
4
3
|
import { Pressable, type PressableProps } from "../internal/Pressable";
|
|
5
4
|
|
|
6
5
|
export type BranchPickerNextProps = Omit<PressableProps, "onPress"> & {
|
|
@@ -12,22 +11,11 @@ export const BranchPickerNext = ({
|
|
|
12
11
|
disabled: disabledProp,
|
|
13
12
|
...pressableProps
|
|
14
13
|
}: BranchPickerNextProps) => {
|
|
15
|
-
const
|
|
16
|
-
const disabled = useAuiState((s) => {
|
|
17
|
-
if (s.message.branchNumber >= s.message.branchCount) return true;
|
|
18
|
-
if (s.thread.isRunning && !s.thread.capabilities.switchBranchDuringRun) {
|
|
19
|
-
return true;
|
|
20
|
-
}
|
|
21
|
-
return false;
|
|
22
|
-
});
|
|
23
|
-
|
|
24
|
-
const goToNext = useCallback(() => {
|
|
25
|
-
aui.message().switchToBranch({ position: "next" });
|
|
26
|
-
}, [aui]);
|
|
14
|
+
const { next, disabled } = useBranchPickerNext();
|
|
27
15
|
|
|
28
16
|
return (
|
|
29
17
|
<Pressable
|
|
30
|
-
onPress={
|
|
18
|
+
onPress={next}
|
|
31
19
|
disabled={disabledProp ?? disabled}
|
|
32
20
|
{...pressableProps}
|
|
33
21
|
>
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { ReactNode } from "react";
|
|
2
|
-
import {
|
|
3
|
-
import { useAui, useAuiState } from "@assistant-ui/store";
|
|
2
|
+
import { useBranchPickerPrevious } from "@assistant-ui/core/react";
|
|
4
3
|
import { Pressable, type PressableProps } from "../internal/Pressable";
|
|
5
4
|
|
|
6
5
|
export type BranchPickerPreviousProps = Omit<PressableProps, "onPress"> & {
|
|
@@ -12,22 +11,11 @@ export const BranchPickerPrevious = ({
|
|
|
12
11
|
disabled: disabledProp,
|
|
13
12
|
...pressableProps
|
|
14
13
|
}: BranchPickerPreviousProps) => {
|
|
15
|
-
const
|
|
16
|
-
const disabled = useAuiState((s) => {
|
|
17
|
-
if (s.message.branchNumber <= 1) return true;
|
|
18
|
-
if (s.thread.isRunning && !s.thread.capabilities.switchBranchDuringRun) {
|
|
19
|
-
return true;
|
|
20
|
-
}
|
|
21
|
-
return false;
|
|
22
|
-
});
|
|
23
|
-
|
|
24
|
-
const goToPrevious = useCallback(() => {
|
|
25
|
-
aui.message().switchToBranch({ position: "previous" });
|
|
26
|
-
}, [aui]);
|
|
14
|
+
const { previous, disabled } = useBranchPickerPrevious();
|
|
27
15
|
|
|
28
16
|
return (
|
|
29
17
|
<Pressable
|
|
30
|
-
onPress={
|
|
18
|
+
onPress={previous}
|
|
31
19
|
disabled={disabledProp ?? disabled}
|
|
32
20
|
{...pressableProps}
|
|
33
21
|
>
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
export {
|
|
2
2
|
BranchPickerPrevious as Previous,
|
|
3
3
|
type BranchPickerPreviousProps as PreviousProps,
|
|
4
|
-
} from "./BranchPickerPrevious";
|
|
4
|
+
} from "./branchPicker/BranchPickerPrevious";
|
|
5
5
|
export {
|
|
6
6
|
BranchPickerNext as Next,
|
|
7
7
|
type BranchPickerNextProps as NextProps,
|
|
8
|
-
} from "./BranchPickerNext";
|
|
8
|
+
} from "./branchPicker/BranchPickerNext";
|
|
9
9
|
export {
|
|
10
10
|
BranchPickerNumber as Number,
|
|
11
11
|
type BranchPickerNumberProps as NumberProps,
|
|
12
|
-
} from "./BranchPickerNumber";
|
|
12
|
+
} from "./branchPicker/BranchPickerNumber";
|
|
13
13
|
export {
|
|
14
14
|
BranchPickerCount as Count,
|
|
15
15
|
type BranchPickerCountProps as CountProps,
|
|
16
|
-
} from "./BranchPickerCount";
|
|
16
|
+
} from "./branchPicker/BranchPickerCount";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
export {
|
|
2
2
|
ChainOfThoughtRoot as Root,
|
|
3
3
|
type ChainOfThoughtRootProps as RootProps,
|
|
4
|
-
} from "./ChainOfThoughtRoot";
|
|
4
|
+
} from "./chainOfThought/ChainOfThoughtRoot";
|
|
5
5
|
export {
|
|
6
6
|
ChainOfThoughtAccordionTrigger as AccordionTrigger,
|
|
7
7
|
type ChainOfThoughtAccordionTriggerProps as AccordionTriggerProps,
|
|
8
|
-
} from "./ChainOfThoughtAccordionTrigger";
|
|
8
|
+
} from "./chainOfThought/ChainOfThoughtAccordionTrigger";
|
|
9
9
|
export { ChainOfThoughtPrimitiveParts as Parts } from "@assistant-ui/core/react";
|
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
export {
|
|
2
2
|
ComposerRoot as Root,
|
|
3
3
|
type ComposerRootProps as RootProps,
|
|
4
|
-
} from "./ComposerRoot";
|
|
4
|
+
} from "./composer/ComposerRoot";
|
|
5
5
|
export {
|
|
6
6
|
ComposerAttachments as Attachments,
|
|
7
7
|
ComposerAttachmentByIndex as AttachmentByIndex,
|
|
8
|
-
} from "./ComposerAttachments";
|
|
8
|
+
} from "./composer/ComposerAttachments";
|
|
9
9
|
export {
|
|
10
10
|
ComposerInput as Input,
|
|
11
11
|
type ComposerInputProps as InputProps,
|
|
12
|
-
} from "./ComposerInput";
|
|
12
|
+
} from "./composer/ComposerInput";
|
|
13
13
|
export {
|
|
14
14
|
ComposerSend as Send,
|
|
15
15
|
type ComposerSendProps as SendProps,
|
|
16
|
-
} from "./ComposerSend";
|
|
16
|
+
} from "./composer/ComposerSend";
|
|
17
17
|
export {
|
|
18
18
|
ComposerCancel as Cancel,
|
|
19
19
|
type ComposerCancelProps as CancelProps,
|
|
20
|
-
} from "./ComposerCancel";
|
|
20
|
+
} from "./composer/ComposerCancel";
|
|
21
21
|
export {
|
|
22
22
|
ComposerAddAttachment as AddAttachment,
|
|
23
23
|
type ComposerAddAttachmentProps as AddAttachmentProps,
|
|
24
|
-
} from "./ComposerAddAttachment";
|
|
25
|
-
export { ComposerIf as If } from "./ComposerIf";
|
|
24
|
+
} from "./composer/ComposerAddAttachment";
|
|
25
|
+
export { ComposerIf as If } from "./composer/ComposerIf";
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { type ComponentProps, type ReactNode, Fragment } from "react";
|
|
2
|
+
import { Box, Text } from "ink";
|
|
3
|
+
import { useMemo } from "react";
|
|
4
|
+
import { useDiffContext } from "./DiffContext";
|
|
5
|
+
import { DiffLine } from "./DiffLine";
|
|
6
|
+
import { foldContext } from "./diff-utils";
|
|
7
|
+
import type { ParsedLine, DisplayLine, FoldedRegion } from "./types";
|
|
8
|
+
|
|
9
|
+
export type DiffContentProps = ComponentProps<typeof Box> & {
|
|
10
|
+
fileIndex?: number | undefined;
|
|
11
|
+
showLineNumbers?: boolean | undefined;
|
|
12
|
+
contextLines?: number | undefined;
|
|
13
|
+
maxLines?: number | undefined;
|
|
14
|
+
renderLine?:
|
|
15
|
+
| ((props: { line: ParsedLine; index: number }) => ReactNode)
|
|
16
|
+
| undefined;
|
|
17
|
+
renderFold?:
|
|
18
|
+
| ((props: { region: FoldedRegion; index: number }) => ReactNode)
|
|
19
|
+
| undefined;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export const DiffContent = ({
|
|
23
|
+
fileIndex = 0,
|
|
24
|
+
showLineNumbers = true,
|
|
25
|
+
contextLines,
|
|
26
|
+
maxLines,
|
|
27
|
+
renderLine,
|
|
28
|
+
renderFold,
|
|
29
|
+
...boxProps
|
|
30
|
+
}: DiffContentProps) => {
|
|
31
|
+
const { files } = useDiffContext();
|
|
32
|
+
const file = files[fileIndex];
|
|
33
|
+
|
|
34
|
+
const displayLines: DisplayLine[] = useMemo(() => {
|
|
35
|
+
if (!file) return [];
|
|
36
|
+
if (contextLines !== undefined) {
|
|
37
|
+
return foldContext(file.lines, contextLines);
|
|
38
|
+
}
|
|
39
|
+
return file.lines;
|
|
40
|
+
}, [file, contextLines]);
|
|
41
|
+
|
|
42
|
+
if (!file) return null;
|
|
43
|
+
|
|
44
|
+
const truncated = maxLines !== undefined && displayLines.length > maxLines;
|
|
45
|
+
const visibleLines = truncated
|
|
46
|
+
? displayLines.slice(0, maxLines)
|
|
47
|
+
: displayLines;
|
|
48
|
+
const remainingCount = truncated ? displayLines.length - maxLines! : 0;
|
|
49
|
+
|
|
50
|
+
return (
|
|
51
|
+
<Box flexDirection="column" {...boxProps}>
|
|
52
|
+
{visibleLines.map((line, i) => {
|
|
53
|
+
if (line.type === "fold") {
|
|
54
|
+
if (renderFold) {
|
|
55
|
+
return (
|
|
56
|
+
<Fragment key={i}>
|
|
57
|
+
{renderFold({ region: line, index: i })}
|
|
58
|
+
</Fragment>
|
|
59
|
+
);
|
|
60
|
+
}
|
|
61
|
+
return (
|
|
62
|
+
<Text key={i}>{` --- ${line.hiddenCount} lines hidden ---`}</Text>
|
|
63
|
+
);
|
|
64
|
+
}
|
|
65
|
+
if (renderLine) {
|
|
66
|
+
return <Fragment key={i}>{renderLine({ line, index: i })}</Fragment>;
|
|
67
|
+
}
|
|
68
|
+
return (
|
|
69
|
+
<DiffLine key={i} line={line} showLineNumbers={showLineNumbers} />
|
|
70
|
+
);
|
|
71
|
+
})}
|
|
72
|
+
{truncated && <Text>{`... (${remainingCount} more lines)`}</Text>}
|
|
73
|
+
</Box>
|
|
74
|
+
);
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
DiffContent.displayName = "DiffPrimitive.Content";
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { createContext, useContext } from "react";
|
|
2
|
+
import type { ParsedFile } from "./types";
|
|
3
|
+
|
|
4
|
+
interface DiffContextValue {
|
|
5
|
+
files: ParsedFile[];
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
const DiffContext = createContext<DiffContextValue | null>(null);
|
|
9
|
+
|
|
10
|
+
export const useDiffContext = (): DiffContextValue => {
|
|
11
|
+
const ctx = useContext(DiffContext);
|
|
12
|
+
if (!ctx) {
|
|
13
|
+
throw new Error("useDiffContext must be used within a DiffRoot");
|
|
14
|
+
}
|
|
15
|
+
return ctx;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export const DiffContextProvider = DiffContext.Provider;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { ComponentProps } from "react";
|
|
2
|
+
import { Box, Text } from "ink";
|
|
3
|
+
import { useDiffContext } from "./DiffContext";
|
|
4
|
+
import { DiffStats } from "./DiffStats";
|
|
5
|
+
|
|
6
|
+
export type DiffHeaderProps = ComponentProps<typeof Box> & {
|
|
7
|
+
fileIndex?: number;
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export const DiffHeader = ({ fileIndex = 0, ...boxProps }: DiffHeaderProps) => {
|
|
11
|
+
const { files } = useDiffContext();
|
|
12
|
+
const file = files[fileIndex];
|
|
13
|
+
if (!file) return null;
|
|
14
|
+
|
|
15
|
+
const isDevNull = (n: string | undefined) => !n || n === "/dev/null";
|
|
16
|
+
const renamed =
|
|
17
|
+
!isDevNull(file.oldName) &&
|
|
18
|
+
!isDevNull(file.newName) &&
|
|
19
|
+
file.oldName !== file.newName;
|
|
20
|
+
const displayName = isDevNull(file.newName) ? file.oldName : file.newName;
|
|
21
|
+
|
|
22
|
+
return (
|
|
23
|
+
<Box gap={1} {...boxProps}>
|
|
24
|
+
{renamed ? (
|
|
25
|
+
<>
|
|
26
|
+
<Text>{file.oldName}</Text>
|
|
27
|
+
<Text>{"->"}</Text>
|
|
28
|
+
<Text>{file.newName}</Text>
|
|
29
|
+
</>
|
|
30
|
+
) : (
|
|
31
|
+
<Text>{displayName}</Text>
|
|
32
|
+
)}
|
|
33
|
+
<DiffStats fileIndex={fileIndex} />
|
|
34
|
+
</Box>
|
|
35
|
+
);
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
DiffHeader.displayName = "DiffPrimitive.Header";
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { ComponentProps } from "react";
|
|
2
|
+
import { Box, Text } from "ink";
|
|
3
|
+
import type { ParsedLine } from "./types";
|
|
4
|
+
|
|
5
|
+
const INDICATOR: Record<ParsedLine["type"], string> = {
|
|
6
|
+
add: "+",
|
|
7
|
+
del: "-",
|
|
8
|
+
normal: " ",
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export type DiffLineProps = ComponentProps<typeof Box> & {
|
|
12
|
+
line: ParsedLine;
|
|
13
|
+
showLineNumbers?: boolean;
|
|
14
|
+
lineNumberWidth?: number;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export const DiffLine = ({
|
|
18
|
+
line,
|
|
19
|
+
showLineNumbers = true,
|
|
20
|
+
lineNumberWidth = 4,
|
|
21
|
+
...boxProps
|
|
22
|
+
}: DiffLineProps) => {
|
|
23
|
+
const lineNum =
|
|
24
|
+
line.type === "del"
|
|
25
|
+
? line.oldLineNumber
|
|
26
|
+
: line.type === "add"
|
|
27
|
+
? line.newLineNumber
|
|
28
|
+
: line.oldLineNumber;
|
|
29
|
+
|
|
30
|
+
const numStr = lineNum !== undefined ? String(lineNum) : "";
|
|
31
|
+
const padded = numStr.padStart(lineNumberWidth);
|
|
32
|
+
const content = `${INDICATOR[line.type]} ${line.content}`;
|
|
33
|
+
|
|
34
|
+
return (
|
|
35
|
+
<Box {...boxProps}>
|
|
36
|
+
{showLineNumbers && <Text>{padded} </Text>}
|
|
37
|
+
<Text>{content}</Text>
|
|
38
|
+
</Box>
|
|
39
|
+
);
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
DiffLine.displayName = "DiffPrimitive.Line";
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { ComponentProps, ReactNode } from "react";
|
|
2
|
+
import { Box } from "ink";
|
|
3
|
+
import { DiffContextProvider } from "./DiffContext";
|
|
4
|
+
import type { ParsedFile } from "./types";
|
|
5
|
+
|
|
6
|
+
export type DiffRootProps = ComponentProps<typeof Box> & {
|
|
7
|
+
files?: ParsedFile[] | undefined;
|
|
8
|
+
children: ReactNode;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export const DiffRoot = ({
|
|
12
|
+
files = [],
|
|
13
|
+
children,
|
|
14
|
+
...boxProps
|
|
15
|
+
}: DiffRootProps) => {
|
|
16
|
+
return (
|
|
17
|
+
<DiffContextProvider value={{ files }}>
|
|
18
|
+
<Box flexDirection="column" {...boxProps}>
|
|
19
|
+
{children}
|
|
20
|
+
</Box>
|
|
21
|
+
</DiffContextProvider>
|
|
22
|
+
);
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
DiffRoot.displayName = "DiffPrimitive.Root";
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { ComponentProps } from "react";
|
|
2
|
+
import { Box, Text } from "ink";
|
|
3
|
+
import { useDiffContext } from "./DiffContext";
|
|
4
|
+
|
|
5
|
+
export type DiffStatsProps = ComponentProps<typeof Box> & {
|
|
6
|
+
fileIndex?: number;
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
export const DiffStats = ({ fileIndex = 0, ...boxProps }: DiffStatsProps) => {
|
|
10
|
+
const { files } = useDiffContext();
|
|
11
|
+
const file = files[fileIndex];
|
|
12
|
+
if (!file) return null;
|
|
13
|
+
|
|
14
|
+
return (
|
|
15
|
+
<Box gap={1} {...boxProps}>
|
|
16
|
+
<Text>+{file.additions}</Text>
|
|
17
|
+
<Text>-{file.deletions}</Text>
|
|
18
|
+
</Box>
|
|
19
|
+
);
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
DiffStats.displayName = "DiffPrimitive.Stats";
|