mastracode 0.2.0 → 0.3.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.
- package/CHANGELOG.md +144 -0
- package/README.md +9 -1
- package/dist/agents/instructions.d.ts.map +1 -1
- package/dist/agents/prompts/base.d.ts +2 -0
- package/dist/agents/prompts/base.d.ts.map +1 -1
- package/dist/agents/prompts/build.d.ts +1 -1
- package/dist/agents/prompts/build.d.ts.map +1 -1
- package/dist/agents/prompts/index.d.ts +1 -2
- package/dist/agents/prompts/index.d.ts.map +1 -1
- package/dist/agents/prompts/plan.d.ts +1 -1
- package/dist/agents/prompts/plan.d.ts.map +1 -1
- package/dist/agents/prompts/tool-guidance.d.ts +11 -0
- package/dist/agents/prompts/tool-guidance.d.ts.map +1 -0
- package/dist/agents/workspace.d.ts.map +1 -1
- package/dist/auth/storage.d.ts +0 -48
- package/dist/auth/storage.d.ts.map +1 -1
- package/dist/{chunk-LVGWM7ZS.cjs → chunk-7K5VFY2N.cjs} +768 -1373
- package/dist/chunk-7K5VFY2N.cjs.map +1 -0
- package/dist/chunk-7TFV3VBB.cjs +8823 -0
- package/dist/chunk-7TFV3VBB.cjs.map +1 -0
- package/dist/chunk-C6XKRHRK.cjs +853 -0
- package/dist/chunk-C6XKRHRK.cjs.map +1 -0
- package/dist/{chunk-7V6U7OKQ.js → chunk-HHX6BKLR.js} +234 -121
- package/dist/chunk-HHX6BKLR.js.map +1 -0
- package/dist/{chunk-FYTZFUHD.js → chunk-LYETHS2L.js} +6389 -5481
- package/dist/chunk-LYETHS2L.js.map +1 -0
- package/dist/{chunk-BYMDWH2E.js → chunk-V4HZ2AVV.js} +729 -1332
- package/dist/chunk-V4HZ2AVV.js.map +1 -0
- package/dist/chunk-VRZZSUQE.js +835 -0
- package/dist/chunk-VRZZSUQE.js.map +1 -0
- package/dist/{chunk-QDLLGD43.cjs → chunk-VZFPT5N7.cjs} +274 -161
- package/dist/chunk-VZFPT5N7.cjs.map +1 -0
- package/dist/cli.cjs +64 -21
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.js +61 -18
- package/dist/cli.js.map +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.d.ts +6 -7
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/onboarding/index.d.ts +7 -0
- package/dist/onboarding/index.d.ts.map +1 -0
- package/dist/onboarding/onboarding-inline.d.ts +95 -0
- package/dist/onboarding/onboarding-inline.d.ts.map +1 -0
- package/dist/onboarding/packs.d.ts +46 -0
- package/dist/onboarding/packs.d.ts.map +1 -0
- package/dist/onboarding/settings.d.ts +110 -0
- package/dist/onboarding/settings.d.ts.map +1 -0
- package/dist/storage-52Y5MKTG.js +3 -0
- package/dist/storage-52Y5MKTG.js.map +1 -0
- package/dist/storage-JFFX7LJJ.cjs +24 -0
- package/dist/storage-JFFX7LJJ.cjs.map +1 -0
- package/dist/tools/string-replace-lsp.d.ts.map +1 -1
- package/dist/tui/command-dispatch.d.ts +8 -0
- package/dist/tui/command-dispatch.d.ts.map +1 -0
- package/dist/tui/commands/cost.d.ts +3 -0
- package/dist/tui/commands/cost.d.ts.map +1 -0
- package/dist/tui/commands/diff.d.ts +3 -0
- package/dist/tui/commands/diff.d.ts.map +1 -0
- package/dist/tui/commands/exit.d.ts +3 -0
- package/dist/tui/commands/exit.d.ts.map +1 -0
- package/dist/tui/commands/help.d.ts +3 -0
- package/dist/tui/commands/help.d.ts.map +1 -0
- package/dist/tui/commands/hooks.d.ts +3 -0
- package/dist/tui/commands/hooks.d.ts.map +1 -0
- package/dist/tui/commands/index.d.ts +27 -0
- package/dist/tui/commands/index.d.ts.map +1 -0
- package/dist/tui/commands/login.d.ts +3 -0
- package/dist/tui/commands/login.d.ts.map +1 -0
- package/dist/tui/commands/mcp.d.ts +3 -0
- package/dist/tui/commands/mcp.d.ts.map +1 -0
- package/dist/tui/commands/mode.d.ts +3 -0
- package/dist/tui/commands/mode.d.ts.map +1 -0
- package/dist/tui/commands/models-pack.d.ts +3 -0
- package/dist/tui/commands/models-pack.d.ts.map +1 -0
- package/dist/tui/commands/models.d.ts +3 -0
- package/dist/tui/commands/models.d.ts.map +1 -0
- package/dist/tui/commands/name.d.ts +3 -0
- package/dist/tui/commands/name.d.ts.map +1 -0
- package/dist/tui/commands/new.d.ts +3 -0
- package/dist/tui/commands/new.d.ts.map +1 -0
- package/dist/tui/commands/om.d.ts +3 -0
- package/dist/tui/commands/om.d.ts.map +1 -0
- package/dist/tui/commands/permissions.d.ts +3 -0
- package/dist/tui/commands/permissions.d.ts.map +1 -0
- package/dist/tui/commands/resource.d.ts +3 -0
- package/dist/tui/commands/resource.d.ts.map +1 -0
- package/dist/tui/commands/review.d.ts +3 -0
- package/dist/tui/commands/review.d.ts.map +1 -0
- package/dist/tui/commands/sandbox.d.ts +3 -0
- package/dist/tui/commands/sandbox.d.ts.map +1 -0
- package/dist/tui/commands/settings.d.ts +3 -0
- package/dist/tui/commands/settings.d.ts.map +1 -0
- package/dist/tui/commands/setup.d.ts +3 -0
- package/dist/tui/commands/setup.d.ts.map +1 -0
- package/dist/tui/commands/skills.d.ts +3 -0
- package/dist/tui/commands/skills.d.ts.map +1 -0
- package/dist/tui/commands/subagents.d.ts +3 -0
- package/dist/tui/commands/subagents.d.ts.map +1 -0
- package/dist/tui/commands/think.d.ts +3 -0
- package/dist/tui/commands/think.d.ts.map +1 -0
- package/dist/tui/commands/thread-tag-dir.d.ts +3 -0
- package/dist/tui/commands/thread-tag-dir.d.ts.map +1 -0
- package/dist/tui/commands/threads.d.ts +3 -0
- package/dist/tui/commands/threads.d.ts.map +1 -0
- package/dist/tui/commands/types.d.ts +28 -0
- package/dist/tui/commands/types.d.ts.map +1 -0
- package/dist/tui/commands/yolo.d.ts +3 -0
- package/dist/tui/commands/yolo.d.ts.map +1 -0
- package/dist/tui/components/banner.d.ts +9 -0
- package/dist/tui/components/banner.d.ts.map +1 -0
- package/dist/tui/components/help-overlay.d.ts +15 -0
- package/dist/tui/components/help-overlay.d.ts.map +1 -0
- package/dist/tui/components/model-selector.d.ts +3 -0
- package/dist/tui/components/model-selector.d.ts.map +1 -1
- package/dist/tui/components/om-progress.d.ts +4 -30
- package/dist/tui/components/om-progress.d.ts.map +1 -1
- package/dist/tui/components/settings.d.ts +5 -0
- package/dist/tui/components/settings.d.ts.map +1 -1
- package/dist/tui/components/tool-execution-enhanced.d.ts.map +1 -1
- package/dist/tui/display.d.ts +12 -0
- package/dist/tui/display.d.ts.map +1 -0
- package/dist/tui/event-dispatch.d.ts +11 -0
- package/dist/tui/event-dispatch.d.ts.map +1 -0
- package/dist/tui/handlers/agent-lifecycle.d.ts +6 -0
- package/dist/tui/handlers/agent-lifecycle.d.ts.map +1 -0
- package/dist/tui/handlers/index.d.ts +8 -0
- package/dist/tui/handlers/index.d.ts.map +1 -0
- package/dist/tui/handlers/message.d.ts +6 -0
- package/dist/tui/handlers/message.d.ts.map +1 -0
- package/dist/tui/handlers/om.d.ts +11 -0
- package/dist/tui/handlers/om.d.ts.map +1 -0
- package/dist/tui/handlers/prompts.d.ts +20 -0
- package/dist/tui/handlers/prompts.d.ts.map +1 -0
- package/dist/tui/handlers/subagent.d.ts +6 -0
- package/dist/tui/handlers/subagent.d.ts.map +1 -0
- package/dist/tui/handlers/tool.d.ts +30 -0
- package/dist/tui/handlers/tool.d.ts.map +1 -0
- package/dist/tui/handlers/types.d.ts +33 -0
- package/dist/tui/handlers/types.d.ts.map +1 -0
- package/dist/tui/mastra-tui.d.ts +9 -221
- package/dist/tui/mastra-tui.d.ts.map +1 -1
- package/dist/tui/render-messages.d.ts +22 -0
- package/dist/tui/render-messages.d.ts.map +1 -0
- package/dist/tui/setup.d.ts +17 -0
- package/dist/tui/setup.d.ts.map +1 -0
- package/dist/tui/shell.d.ts +3 -0
- package/dist/tui/shell.d.ts.map +1 -0
- package/dist/tui/state.d.ts +4 -24
- package/dist/tui/state.d.ts.map +1 -1
- package/dist/tui/status-line.d.ts +7 -0
- package/dist/tui/status-line.d.ts.map +1 -0
- package/dist/tui.cjs +17 -17
- package/dist/tui.js +2 -2
- package/dist/utils/project.d.ts +37 -9
- package/dist/utils/project.d.ts.map +1 -1
- package/dist/utils/storage-factory.d.ts +21 -0
- package/dist/utils/storage-factory.d.ts.map +1 -0
- package/package.json +7 -6
- package/dist/chunk-7V6U7OKQ.js.map +0 -1
- package/dist/chunk-BQ4ZKTYN.cjs +0 -7915
- package/dist/chunk-BQ4ZKTYN.cjs.map +0 -1
- package/dist/chunk-BYMDWH2E.js.map +0 -1
- package/dist/chunk-FYTZFUHD.js.map +0 -1
- package/dist/chunk-LVGWM7ZS.cjs.map +0 -1
- package/dist/chunk-QDLLGD43.cjs.map +0 -1
package/dist/tui/mastra-tui.d.ts
CHANGED
|
@@ -4,10 +4,6 @@ export declare class MastraTUI {
|
|
|
4
4
|
private state;
|
|
5
5
|
private static readonly DOUBLE_CTRL_C_MS;
|
|
6
6
|
constructor(options: MastraTUIOptions);
|
|
7
|
-
/**
|
|
8
|
-
* Setup keyboard shortcuts for the custom editor.
|
|
9
|
-
*/
|
|
10
|
-
private setupKeyboardShortcuts;
|
|
11
7
|
/**
|
|
12
8
|
* Run the TUI. This is the main entry point.
|
|
13
9
|
*/
|
|
@@ -22,240 +18,32 @@ export declare class MastraTUI {
|
|
|
22
18
|
*/
|
|
23
19
|
stop(): void;
|
|
24
20
|
private init;
|
|
25
|
-
/**
|
|
26
|
-
* Render existing tasks from the harness state on startup
|
|
27
|
-
*/
|
|
28
|
-
private renderExistingTasks;
|
|
29
|
-
/**
|
|
30
|
-
* Prompt user to continue existing thread or start new one.
|
|
31
|
-
* This runs before the TUI is fully initialized.
|
|
32
|
-
* Threads are scoped to the current resourceId by listThreads(),
|
|
33
|
-
* then further filtered by projectPath to avoid resuming threads
|
|
34
|
-
* from other worktrees of the same repo.
|
|
35
|
-
*/
|
|
36
|
-
private promptForThreadSelection;
|
|
37
|
-
/**
|
|
38
|
-
* Extract text content from a harness message.
|
|
39
|
-
*/
|
|
40
|
-
private extractTextContent;
|
|
41
|
-
/**
|
|
42
|
-
* Truncate text for preview display.
|
|
43
|
-
*/
|
|
44
|
-
private truncatePreview;
|
|
45
|
-
private buildLayout;
|
|
46
|
-
/**
|
|
47
|
-
* Update the two-line status bar.
|
|
48
|
-
* Line 1: [MODE] provider/model memory tokens think:level
|
|
49
|
-
* Line 2: ~/path/to/project (branch)
|
|
50
|
-
*/
|
|
51
|
-
private updateStatusLine;
|
|
52
21
|
private refreshModelAuthStatus;
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
* - Global: ~/.opencode/command, ~/.claude/commands, and ~/.mastracode/commands
|
|
57
|
-
* - Local: .opencode/command, .claude/commands, and .mastracode/commands
|
|
58
|
-
*/
|
|
59
|
-
private loadCustomSlashCommands;
|
|
60
|
-
private setupKeyHandlers;
|
|
61
|
-
private setupEditorSubmitHandler;
|
|
62
|
-
private subscribeToHarness;
|
|
63
|
-
private updateTerminalTitle;
|
|
22
|
+
/** Cached event context – built once, reused for every event. */
|
|
23
|
+
private _ectx;
|
|
24
|
+
private getEventContext;
|
|
64
25
|
private handleEvent;
|
|
65
|
-
private handleUsageUpdate;
|
|
66
|
-
/**
|
|
67
|
-
* Sync omProgress thresholds from harness state (thread metadata).
|
|
68
|
-
* Called after thread load to pick up per-thread threshold overrides.
|
|
69
|
-
*/
|
|
70
|
-
private syncOMThresholdsFromHarness;
|
|
71
|
-
private resetStatusLineState;
|
|
72
|
-
/**
|
|
73
|
-
* Add an OM marker to the chat container, inserting it *before* the
|
|
74
|
-
* current streaming component so it doesn't get pushed down as text
|
|
75
|
-
* streams in. Falls back to a normal append when nothing is streaming.
|
|
76
|
-
*/
|
|
77
|
-
private addOMMarkerToChat;
|
|
78
|
-
private addOMOutputToChat;
|
|
79
|
-
private handleOMStatus;
|
|
80
|
-
private handleOMObservationStart;
|
|
81
|
-
private handleOMObservationEnd;
|
|
82
|
-
private handleOMReflectionStart;
|
|
83
|
-
private handleOMReflectionEnd;
|
|
84
|
-
private handleOMFailed;
|
|
85
|
-
/** Update the loading animation text (e.g., "Working..." → "Observing...") */
|
|
86
|
-
private updateLoaderText;
|
|
87
|
-
private handleAgentStart;
|
|
88
|
-
private handleAgentEnd;
|
|
89
|
-
private handleAgentAborted;
|
|
90
|
-
private handleAgentError;
|
|
91
|
-
private handleMessageStart;
|
|
92
|
-
private handleMessageUpdate;
|
|
93
|
-
/**
|
|
94
|
-
* Get content parts after the last tool_call/tool_result in the message.
|
|
95
|
-
* These are the parts that should be rendered in the current streaming component.
|
|
96
|
-
*/
|
|
97
|
-
private getTrailingContentParts;
|
|
98
|
-
/**
|
|
99
|
-
* Get content parts between the last processed tool call and this one (text/thinking only).
|
|
100
|
-
*/
|
|
101
|
-
private getContentBeforeToolCall;
|
|
102
|
-
private handleMessageEnd;
|
|
103
26
|
/**
|
|
104
27
|
* Insert a child into the chat container before any follow-up user messages.
|
|
105
28
|
* If no follow-ups are pending, appends to end.
|
|
106
29
|
*/
|
|
107
30
|
private addChildBeforeFollowUps;
|
|
108
|
-
private handleToolApprovalRequired;
|
|
109
|
-
private handleToolStart;
|
|
110
|
-
private handleToolUpdate;
|
|
111
|
-
/**
|
|
112
|
-
* Handle streaming shell output from execute_command tool.
|
|
113
|
-
*/
|
|
114
|
-
private handleShellOutput;
|
|
115
|
-
/**
|
|
116
|
-
* Handle the start of streaming tool call input arguments.
|
|
117
|
-
* Creates the tool component early so partial args can render as they arrive.
|
|
118
|
-
*/
|
|
119
|
-
private handleToolInputStart;
|
|
120
|
-
/**
|
|
121
|
-
* Handle an incremental delta of tool call input arguments.
|
|
122
|
-
* Buffers the partial JSON text and attempts to parse it, updating the component's args.
|
|
123
|
-
*/
|
|
124
|
-
private handleToolInputDelta;
|
|
125
|
-
/**
|
|
126
|
-
* Clean up the input buffer when tool input streaming ends.
|
|
127
|
-
*/
|
|
128
|
-
private handleToolInputEnd;
|
|
129
|
-
/**
|
|
130
|
-
* Handle an ask_question event from the ask_user tool.
|
|
131
|
-
* Shows a dialog overlay and resolves the tool's pending promise.
|
|
132
|
-
*/
|
|
133
|
-
private handleAskQuestion;
|
|
134
|
-
/**
|
|
135
|
-
* Handle a sandbox_access_request event from the request_sandbox_access tool.
|
|
136
|
-
* Shows an inline prompt for the user to approve or deny directory access.
|
|
137
|
-
*/
|
|
138
|
-
private handleSandboxAccessRequest;
|
|
139
|
-
/**
|
|
140
|
-
* Handle a plan_approval_required event from the submit_plan tool.
|
|
141
|
-
* Shows the plan inline with Approve/Reject/Request Changes options.
|
|
142
|
-
*/
|
|
143
|
-
private handlePlanApproval;
|
|
144
|
-
private handleToolEnd;
|
|
145
|
-
/**
|
|
146
|
-
* Format a tool result for display.
|
|
147
|
-
* Handles objects, strings, and other types.
|
|
148
|
-
* Extracts content from common tool return structures like { content: "...", isError: false }
|
|
149
|
-
*/
|
|
150
|
-
private formatToolResult;
|
|
151
|
-
/**
|
|
152
|
-
* Render a completed task list inline in the chat history.
|
|
153
|
-
* This mirrors the pinned TaskProgressComponent format but shows
|
|
154
|
-
* all items as completed, since the pinned component hides itself
|
|
155
|
-
* when everything is done.
|
|
156
|
-
* @param tasks The completed task items
|
|
157
|
-
* @param insertIndex Optional index to insert at (replaces tool component position)
|
|
158
|
-
*/
|
|
159
|
-
private renderCompletedTasksInline;
|
|
160
|
-
/**
|
|
161
|
-
* Render inline display when tasks are cleared.
|
|
162
|
-
* Shows what was cleared with strikethrough.
|
|
163
|
-
*/
|
|
164
|
-
private renderClearedTasksInline;
|
|
165
|
-
private handleSubagentStart;
|
|
166
|
-
private handleSubagentToolStart;
|
|
167
|
-
private handleSubagentToolEnd;
|
|
168
|
-
private handleSubagentEnd;
|
|
169
31
|
private getUserInput;
|
|
170
|
-
private showThreadSelector;
|
|
171
|
-
private tagThreadWithDir;
|
|
172
32
|
/**
|
|
173
33
|
* Show an inline prompt when a thread is locked by another process.
|
|
174
34
|
* User can create a new thread (y) or exit (n).
|
|
175
35
|
*/
|
|
176
36
|
private showThreadLockPrompt;
|
|
177
|
-
private handleSandboxCommand;
|
|
178
|
-
private showSandboxAddPrompt;
|
|
179
|
-
private sandboxAddPath;
|
|
180
|
-
private sandboxRemovePath;
|
|
181
37
|
/**
|
|
182
38
|
* Get the workspace, preferring harness-owned workspace over the direct option.
|
|
183
39
|
*/
|
|
184
40
|
private getResolvedWorkspace;
|
|
185
|
-
private
|
|
186
|
-
|
|
187
|
-
* Show mode selector first, then scope (global/thread), then model list.
|
|
188
|
-
* Flow: Mode → Scope → Model
|
|
189
|
-
*/
|
|
190
|
-
private showModelScopeSelector;
|
|
191
|
-
/**
|
|
192
|
-
* Show scope selector (global/thread) for a specific mode, then model list.
|
|
193
|
-
*/
|
|
194
|
-
private showModelScopeThenList;
|
|
195
|
-
/**
|
|
196
|
-
* Show the model list for a specific mode and scope.
|
|
197
|
-
*/
|
|
198
|
-
private showModelListForScope;
|
|
199
|
-
/**
|
|
200
|
-
* Show agent type selector first, then scope (global/thread), then model list.
|
|
201
|
-
* Flow: Agent Type → Scope → Model
|
|
202
|
-
*/
|
|
203
|
-
private showSubagentModelSelector;
|
|
204
|
-
/**
|
|
205
|
-
* Show scope selector (global/thread) for a specific agent type, then model list.
|
|
206
|
-
*/
|
|
207
|
-
private showSubagentScopeThenList;
|
|
208
|
-
/**
|
|
209
|
-
* Show the model list for subagent type and scope selection.
|
|
210
|
-
*/
|
|
211
|
-
private showSubagentModelListForScope;
|
|
212
|
-
private showOMSettings;
|
|
213
|
-
private showPermissions;
|
|
214
|
-
private showSettings;
|
|
215
|
-
private showLoginSelector;
|
|
216
|
-
private performLogin;
|
|
217
|
-
private showCostBreakdown;
|
|
41
|
+
private buildCommandContext;
|
|
42
|
+
private buildEventContext;
|
|
218
43
|
private handleSlashCommand;
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
private handleReviewCommand;
|
|
224
|
-
/**
|
|
225
|
-
* Handle a custom slash command by processing its template and adding to context
|
|
226
|
-
*/
|
|
227
|
-
private handleCustomSlashCommand;
|
|
228
|
-
private addUserMessage;
|
|
229
|
-
private renderExistingMessages;
|
|
230
|
-
private showError;
|
|
231
|
-
/**
|
|
232
|
-
* Show a formatted error with helpful context based on error type.
|
|
233
|
-
*/
|
|
234
|
-
showFormattedError(event: {
|
|
235
|
-
error: Error;
|
|
236
|
-
errorType?: string;
|
|
237
|
-
retryable?: boolean;
|
|
238
|
-
retryDelay?: number;
|
|
239
|
-
} | Error): void;
|
|
240
|
-
/**
|
|
241
|
-
* Get a helpful hint based on error type.
|
|
242
|
-
*/
|
|
243
|
-
private getErrorHint;
|
|
244
|
-
/**
|
|
245
|
-
* Show file changes tracked during this session.
|
|
246
|
-
* With no args: shows summary of all modified files.
|
|
247
|
-
* With a path: shows git diff for that specific file.
|
|
248
|
-
*/
|
|
249
|
-
private showDiff;
|
|
250
|
-
/**
|
|
251
|
-
* Run a shell command directly and display the output in the chat.
|
|
252
|
-
* Triggered by the `!` prefix (e.g., `!ls -la`).
|
|
253
|
-
*/
|
|
254
|
-
private handleShellPassthrough;
|
|
255
|
-
/**
|
|
256
|
-
* Send a notification alert (bell / system / hooks) based on user settings.
|
|
257
|
-
*/
|
|
258
|
-
private notify;
|
|
259
|
-
private showInfo;
|
|
44
|
+
performLogin(providerId: string): Promise<void>;
|
|
45
|
+
showOnboarding(): Promise<void>;
|
|
46
|
+
private applyOnboardingResult;
|
|
47
|
+
private shouldShowOnboarding;
|
|
260
48
|
}
|
|
261
49
|
//# sourceMappingURL=mastra-tui.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mastra-tui.d.ts","sourceRoot":"","sources":["../../src/tui/mastra-tui.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"mastra-tui.d.ts","sourceRoot":"","sources":["../../src/tui/mastra-tui.ts"],"names":[],"mappings":"AA8CA,OAAO,KAAK,EAAE,gBAAgB,EAAY,MAAM,YAAY,CAAC;AAQ7D,YAAY,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAMnD,qBAAa,SAAS;IACpB,OAAO,CAAC,KAAK,CAAW;IAExB,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,gBAAgB,CAAO;gBAEnC,OAAO,EAAE,gBAAgB;IAiDrC;;OAEG;IACG,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;IAmF1B;;;OAGG;IACH,OAAO,CAAC,WAAW;IAMnB;;OAEG;IACH,IAAI,IAAI,IAAI;YAiBE,IAAI;YA0DJ,sBAAsB;IASpC,iEAAiE;IACjE,OAAO,CAAC,KAAK,CAAkC;IAE/C,OAAO,CAAC,eAAe;YAOT,WAAW;IAKzB;;;OAGG;IACH,OAAO,CAAC,uBAAuB;IAiB/B,OAAO,CAAC,YAAY;IAapB;;;OAGG;IACH,OAAO,CAAC,oBAAoB;IAoC5B;;OAEG;IACH,OAAO,CAAC,oBAAoB;IAgB5B,OAAO,CAAC,mBAAmB;IAmB3B,OAAO,CAAC,iBAAiB;YAqBX,kBAAkB;IAQ1B,YAAY,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAoE/C,cAAc,IAAI,OAAO,CAAC,IAAI,CAAC;YAiHvB,qBAAqB;IA8EnC,OAAO,CAAC,oBAAoB;CAQ7B"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { HarnessMessage, TaskItem } from '@mastra/core/harness';
|
|
2
|
+
import { formatToolResult } from './handlers/tool.js';
|
|
3
|
+
import type { TUIState } from './state.js';
|
|
4
|
+
export { formatToolResult };
|
|
5
|
+
/**
|
|
6
|
+
* Render a completed task list inline in the chat history.
|
|
7
|
+
*/
|
|
8
|
+
export declare function renderCompletedTasksInline(state: TUIState, tasks: TaskItem[], insertIndex?: number, collapsed?: boolean): void;
|
|
9
|
+
/**
|
|
10
|
+
* Render inline display when tasks are cleared.
|
|
11
|
+
*/
|
|
12
|
+
export declare function renderClearedTasksInline(state: TUIState, clearedTasks: TaskItem[], insertIndex?: number): void;
|
|
13
|
+
/**
|
|
14
|
+
* Add a user message to the chat container.
|
|
15
|
+
*/
|
|
16
|
+
export declare function addUserMessage(state: TUIState, message: HarnessMessage): void;
|
|
17
|
+
/**
|
|
18
|
+
* Re-render all existing messages from the harness thread into the chat container.
|
|
19
|
+
* Called on thread switch and initial load.
|
|
20
|
+
*/
|
|
21
|
+
export declare function renderExistingMessages(state: TUIState): Promise<void>;
|
|
22
|
+
//# sourceMappingURL=render-messages.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"render-messages.d.ts","sourceRoot":"","sources":["../../src/tui/render-messages.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,cAAc,EAAyB,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAY5F,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAI3C,OAAO,EAAE,gBAAgB,EAAE,CAAC;AAM5B;;GAEG;AACH,wBAAgB,0BAA0B,CACxC,KAAK,EAAE,QAAQ,EACf,KAAK,EAAE,QAAQ,EAAE,EACjB,WAAW,SAAK,EAChB,SAAS,UAAQ,GAChB,IAAI,CA4BN;AAED;;GAEG;AACH,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,QAAQ,EAAE,YAAY,EAAE,QAAQ,EAAE,EAAE,WAAW,SAAK,GAAG,IAAI,CAiB1G;AAMD;;GAEG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,cAAc,GAAG,IAAI,CAoD7E;AAMD;;;GAGG;AACH,wBAAsB,sBAAsB,CAAC,KAAK,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,CAoO3E"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { TUIState } from './state.js';
|
|
2
|
+
export declare function setupKeyboardShortcuts(state: TUIState, callbacks: {
|
|
3
|
+
stop: () => void;
|
|
4
|
+
doubleCtrlCMs: number;
|
|
5
|
+
}): void;
|
|
6
|
+
export declare function buildLayout(state: TUIState, refreshModelAuthStatus: () => Promise<void>): void;
|
|
7
|
+
export declare function setupAutocomplete(state: TUIState): void;
|
|
8
|
+
export declare function loadCustomSlashCommands(state: TUIState): Promise<void>;
|
|
9
|
+
export declare function setupKeyHandlers(state: TUIState, callbacks: {
|
|
10
|
+
stop: () => void;
|
|
11
|
+
doubleCtrlCMs: number;
|
|
12
|
+
}): void;
|
|
13
|
+
export declare function subscribeToHarness(state: TUIState, handleEvent: (event: any) => Promise<void>): void;
|
|
14
|
+
export declare function updateTerminalTitle(state: TUIState): void;
|
|
15
|
+
export declare function promptForThreadSelection(state: TUIState): Promise<void>;
|
|
16
|
+
export declare function renderExistingTasks(state: TUIState): Promise<void>;
|
|
17
|
+
//# sourceMappingURL=setup.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"setup.d.ts","sourceRoot":"","sources":["../../src/tui/setup.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAQ3C,wBAAgB,sBAAsB,CACpC,KAAK,EAAE,QAAQ,EACf,SAAS,EAAE;IACT,IAAI,EAAE,MAAM,IAAI,CAAC;IACjB,aAAa,EAAE,MAAM,CAAC;CACvB,GACA,IAAI,CAwHN;AAMD,wBAAgB,WAAW,CAAC,KAAK,EAAE,QAAQ,EAAE,sBAAsB,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAqD9F;AAMD,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,QAAQ,GAAG,IAAI,CAgEvD;AAMD,wBAAsB,uBAAuB,CAAC,KAAK,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,CAuB5E;AAMD,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,QAAQ,EACf,SAAS,EAAE;IACT,IAAI,EAAE,MAAM,IAAI,CAAC;IACjB,aAAa,EAAE,MAAM,CAAC;CACvB,GACA,IAAI,CAqBN;AAMD,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAKpG;AAMD,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,QAAQ,GAAG,IAAI,CAIzD;AAMD,wBAAsB,wBAAwB,CAAC,KAAK,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,CA+C7E;AAMD,wBAAsB,mBAAmB,CAAC,KAAK,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,CAYxE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shell.d.ts","sourceRoot":"","sources":["../../src/tui/shell.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAE3C,wBAAsB,sBAAsB,CAAC,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAyB5F"}
|
package/dist/tui/state.d.ts
CHANGED
|
@@ -6,11 +6,12 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import { Container, TUI, ProcessTerminal } from '@mariozechner/pi-tui';
|
|
8
8
|
import type { CombinedAutocompleteProvider, Text } from '@mariozechner/pi-tui';
|
|
9
|
-
import type { Harness, HarnessMessage
|
|
9
|
+
import type { Harness, HarnessMessage } from '@mastra/core/harness';
|
|
10
10
|
import type { Workspace } from '@mastra/core/workspace';
|
|
11
11
|
import type { AuthStorage } from '../auth/storage.js';
|
|
12
12
|
import type { HookManager } from '../hooks/index.js';
|
|
13
13
|
import type { McpManager } from '../mcp/manager.js';
|
|
14
|
+
import type { OnboardingInlineComponent } from '../onboarding/onboarding-inline.js';
|
|
14
15
|
import type { ProjectInfo } from '../utils/project.js';
|
|
15
16
|
import type { SlashCommandMetadata } from '../utils/slash-command-loader.js';
|
|
16
17
|
import type { AskQuestionInlineComponent } from './components/ask-question-inline.js';
|
|
@@ -18,7 +19,7 @@ import type { AssistantMessageComponent } from './components/assistant-message.j
|
|
|
18
19
|
import { CustomEditor } from './components/custom-editor.js';
|
|
19
20
|
import type { GradientAnimator } from './components/obi-loader.js';
|
|
20
21
|
import type { OMMarkerComponent } from './components/om-marker.js';
|
|
21
|
-
import type { OMProgressComponent
|
|
22
|
+
import type { OMProgressComponent } from './components/om-progress.js';
|
|
22
23
|
import type { PlanApprovalInlineComponent } from './components/plan-approval-inline.js';
|
|
23
24
|
import type { SlashCommandComponent } from './components/slash-command.js';
|
|
24
25
|
import type { SubagentExecutionComponent } from './components/subagent-execution.js';
|
|
@@ -65,16 +66,10 @@ export interface TUIState {
|
|
|
65
66
|
footer: Container;
|
|
66
67
|
terminal: ProcessTerminal;
|
|
67
68
|
isInitialized: boolean;
|
|
68
|
-
isAgentActive: boolean;
|
|
69
69
|
gradientAnimator?: GradientAnimator;
|
|
70
70
|
streamingComponent?: AssistantMessageComponent;
|
|
71
71
|
streamingMessage?: HarnessMessage;
|
|
72
72
|
pendingTools: Map<string, IToolExecutionComponent>;
|
|
73
|
-
/** Buffer partial JSON args text per toolCallId for streaming input */
|
|
74
|
-
toolInputBuffers: Map<string, {
|
|
75
|
-
text: string;
|
|
76
|
-
toolName: string;
|
|
77
|
-
}>;
|
|
78
73
|
/** Position hint for task_write inline rendering when streaming */
|
|
79
74
|
taskWriteInsertIndex: number;
|
|
80
75
|
/** Track all tool IDs seen during current stream (prevents duplicates) */
|
|
@@ -101,6 +96,7 @@ export interface TUIState {
|
|
|
101
96
|
lastClearedText: string;
|
|
102
97
|
activeInlineQuestion?: AskQuestionInlineComponent;
|
|
103
98
|
activeInlinePlanApproval?: PlanApprovalInlineComponent;
|
|
99
|
+
activeOnboarding?: OnboardingInlineComponent;
|
|
104
100
|
lastSubmitPlanComponent?: IToolExecutionComponent;
|
|
105
101
|
/** Follow-up messages sent via Ctrl+F while streaming */
|
|
106
102
|
followUpComponents: UserMessageComponent[];
|
|
@@ -109,24 +105,17 @@ export interface TUIState {
|
|
|
109
105
|
/** Active approval dialog dismiss callback — called on Ctrl+C to unblock the dialog */
|
|
110
106
|
pendingApprovalDismiss: (() => void) | null;
|
|
111
107
|
projectInfo: ProjectInfo;
|
|
112
|
-
tokenUsage: TokenUsage;
|
|
113
108
|
statusLine?: Text;
|
|
114
109
|
memoryStatusLine?: Text;
|
|
115
110
|
modelAuthStatus: {
|
|
116
111
|
hasAuth: boolean;
|
|
117
112
|
apiKeyEnvVar?: string;
|
|
118
113
|
};
|
|
119
|
-
omProgress: OMProgressState;
|
|
120
114
|
omProgressComponent?: OMProgressComponent;
|
|
121
115
|
activeOMMarker?: OMMarkerComponent;
|
|
122
116
|
activeBufferingMarker?: OMMarkerComponent;
|
|
123
117
|
activeActivationMarker?: OMMarkerComponent;
|
|
124
|
-
/** Drives statusline label animation */
|
|
125
|
-
bufferingMessages: boolean;
|
|
126
|
-
bufferingObservations: boolean;
|
|
127
118
|
taskProgress?: TaskProgressComponent;
|
|
128
|
-
/** Track previous state for diff */
|
|
129
|
-
previousTasks: TaskItem[];
|
|
130
119
|
autocompleteProvider?: CombinedAutocompleteProvider;
|
|
131
120
|
customSlashCommands: SlashCommandMetadata[];
|
|
132
121
|
/** Pending images from clipboard paste */
|
|
@@ -137,15 +126,6 @@ export interface TUIState {
|
|
|
137
126
|
lastCtrlCTime: number;
|
|
138
127
|
/** Track user-initiated aborts (Ctrl+C/Esc) vs system aborts */
|
|
139
128
|
userInitiatedAbort: boolean;
|
|
140
|
-
modifiedFiles: Map<string, {
|
|
141
|
-
operations: string[];
|
|
142
|
-
firstModified: Date;
|
|
143
|
-
}>;
|
|
144
|
-
/** Map toolCallId -> { toolName, filePath } for pending tool calls that modify files */
|
|
145
|
-
pendingFileTools: Map<string, {
|
|
146
|
-
toolName: string;
|
|
147
|
-
filePath: string;
|
|
148
|
-
}>;
|
|
149
129
|
unsubscribe?: () => void;
|
|
150
130
|
}
|
|
151
131
|
/**
|
package/dist/tui/state.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"state.d.ts","sourceRoot":"","sources":["../../src/tui/state.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,SAAS,EAAE,GAAG,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvE,OAAO,KAAK,EAAE,4BAA4B,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAC/E,OAAO,KAAK,EAAE,OAAO,EAAE,cAAc,EAAE,
|
|
1
|
+
{"version":3,"file":"state.d.ts","sourceRoot":"","sources":["../../src/tui/state.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,SAAS,EAAE,GAAG,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvE,OAAO,KAAK,EAAE,4BAA4B,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAC/E,OAAO,KAAK,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACpE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,oCAAoC,CAAC;AAEpF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AAC7E,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,qCAAqC,CAAC;AACtF,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,mCAAmC,CAAC;AACnF,O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 @@
|
|
|
1
|
+
import type { TUIState } from './state.js';
|
|
2
|
+
/**
|
|
3
|
+
* Update the status line at the bottom of the TUI.
|
|
4
|
+
* Progressively reduces content to fit the terminal width.
|
|
5
|
+
*/
|
|
6
|
+
export declare function updateStatusLine(state: TUIState): void;
|
|
7
|
+
//# sourceMappingURL=status-line.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"status-line.d.ts","sourceRoot":"","sources":["../../src/tui/status-line.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAO3C;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,QAAQ,GAAG,IAAI,CAsTtD"}
|
package/dist/tui.cjs
CHANGED
|
@@ -1,69 +1,69 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
3
|
+
var chunk7TFV3VBB_cjs = require('./chunk-7TFV3VBB.cjs');
|
|
4
|
+
var chunk7K5VFY2N_cjs = require('./chunk-7K5VFY2N.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
Object.defineProperty(exports, "AssistantMessageComponent", {
|
|
9
9
|
enumerable: true,
|
|
10
|
-
get: function () { return
|
|
10
|
+
get: function () { return chunk7TFV3VBB_cjs.AssistantMessageComponent; }
|
|
11
11
|
});
|
|
12
12
|
Object.defineProperty(exports, "LoginDialogComponent", {
|
|
13
13
|
enumerable: true,
|
|
14
|
-
get: function () { return
|
|
14
|
+
get: function () { return chunk7TFV3VBB_cjs.LoginDialogComponent; }
|
|
15
15
|
});
|
|
16
16
|
Object.defineProperty(exports, "LoginSelectorComponent", {
|
|
17
17
|
enumerable: true,
|
|
18
|
-
get: function () { return
|
|
18
|
+
get: function () { return chunk7TFV3VBB_cjs.LoginSelectorComponent; }
|
|
19
19
|
});
|
|
20
20
|
Object.defineProperty(exports, "MastraTUI", {
|
|
21
21
|
enumerable: true,
|
|
22
|
-
get: function () { return
|
|
22
|
+
get: function () { return chunk7TFV3VBB_cjs.MastraTUI; }
|
|
23
23
|
});
|
|
24
24
|
Object.defineProperty(exports, "ModelSelectorComponent", {
|
|
25
25
|
enumerable: true,
|
|
26
|
-
get: function () { return
|
|
26
|
+
get: function () { return chunk7TFV3VBB_cjs.ModelSelectorComponent; }
|
|
27
27
|
});
|
|
28
28
|
Object.defineProperty(exports, "OMProgressComponent", {
|
|
29
29
|
enumerable: true,
|
|
30
|
-
get: function () { return
|
|
30
|
+
get: function () { return chunk7TFV3VBB_cjs.OMProgressComponent; }
|
|
31
31
|
});
|
|
32
32
|
Object.defineProperty(exports, "ToolExecutionComponentEnhanced", {
|
|
33
33
|
enumerable: true,
|
|
34
|
-
get: function () { return
|
|
34
|
+
get: function () { return chunk7TFV3VBB_cjs.ToolExecutionComponentEnhanced; }
|
|
35
35
|
});
|
|
36
36
|
Object.defineProperty(exports, "UserMessageComponent", {
|
|
37
37
|
enumerable: true,
|
|
38
|
-
get: function () { return
|
|
38
|
+
get: function () { return chunk7TFV3VBB_cjs.UserMessageComponent; }
|
|
39
39
|
});
|
|
40
40
|
Object.defineProperty(exports, "createTUIState", {
|
|
41
41
|
enumerable: true,
|
|
42
|
-
get: function () { return
|
|
42
|
+
get: function () { return chunk7TFV3VBB_cjs.createTUIState; }
|
|
43
43
|
});
|
|
44
44
|
Object.defineProperty(exports, "formatOMStatus", {
|
|
45
45
|
enumerable: true,
|
|
46
|
-
get: function () { return
|
|
46
|
+
get: function () { return chunk7TFV3VBB_cjs.formatOMStatus; }
|
|
47
47
|
});
|
|
48
48
|
Object.defineProperty(exports, "getEditorTheme", {
|
|
49
49
|
enumerable: true,
|
|
50
|
-
get: function () { return
|
|
50
|
+
get: function () { return chunk7K5VFY2N_cjs.getEditorTheme; }
|
|
51
51
|
});
|
|
52
52
|
Object.defineProperty(exports, "getMarkdownTheme", {
|
|
53
53
|
enumerable: true,
|
|
54
|
-
get: function () { return
|
|
54
|
+
get: function () { return chunk7K5VFY2N_cjs.getMarkdownTheme; }
|
|
55
55
|
});
|
|
56
56
|
Object.defineProperty(exports, "getTheme", {
|
|
57
57
|
enumerable: true,
|
|
58
|
-
get: function () { return
|
|
58
|
+
get: function () { return chunk7K5VFY2N_cjs.getTheme; }
|
|
59
59
|
});
|
|
60
60
|
Object.defineProperty(exports, "setTheme", {
|
|
61
61
|
enumerable: true,
|
|
62
|
-
get: function () { return
|
|
62
|
+
get: function () { return chunk7K5VFY2N_cjs.setTheme; }
|
|
63
63
|
});
|
|
64
64
|
Object.defineProperty(exports, "theme", {
|
|
65
65
|
enumerable: true,
|
|
66
|
-
get: function () { return
|
|
66
|
+
get: function () { return chunk7K5VFY2N_cjs.theme; }
|
|
67
67
|
});
|
|
68
68
|
//# sourceMappingURL=tui.cjs.map
|
|
69
69
|
//# sourceMappingURL=tui.cjs.map
|
package/dist/tui.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { AssistantMessageComponent, LoginDialogComponent, LoginSelectorComponent, MastraTUI, ModelSelectorComponent, OMProgressComponent, ToolExecutionComponentEnhanced, UserMessageComponent, createTUIState, formatOMStatus } from './chunk-
|
|
2
|
-
export { getEditorTheme, getMarkdownTheme, getTheme, setTheme, theme } from './chunk-
|
|
1
|
+
export { AssistantMessageComponent, LoginDialogComponent, LoginSelectorComponent, MastraTUI, ModelSelectorComponent, OMProgressComponent, ToolExecutionComponentEnhanced, UserMessageComponent, createTUIState, formatOMStatus } from './chunk-LYETHS2L.js';
|
|
2
|
+
export { getEditorTheme, getMarkdownTheme, getTheme, setTheme, theme } from './chunk-V4HZ2AVV.js';
|
|
3
3
|
//# sourceMappingURL=tui.js.map
|
|
4
4
|
//# sourceMappingURL=tui.js.map
|
package/dist/utils/project.d.ts
CHANGED
|
@@ -38,25 +38,53 @@ export declare function getAppDataDir(): string;
|
|
|
38
38
|
* Can be overridden with the MASTRA_DB_PATH environment variable for debugging.
|
|
39
39
|
*/
|
|
40
40
|
export declare function getDatabasePath(): string;
|
|
41
|
+
import type { StorageSettings } from '../onboarding/settings.js';
|
|
41
42
|
/**
|
|
42
|
-
*
|
|
43
|
-
* Either a local file URL or a remote Turso URL with auth token.
|
|
43
|
+
* LibSQL storage configuration.
|
|
44
44
|
*/
|
|
45
|
-
export interface
|
|
45
|
+
export interface LibSQLStorageConfig {
|
|
46
|
+
backend: 'libsql';
|
|
46
47
|
url: string;
|
|
47
48
|
authToken?: string;
|
|
48
49
|
isRemote: boolean;
|
|
49
50
|
}
|
|
50
51
|
/**
|
|
51
|
-
*
|
|
52
|
+
* PostgreSQL storage configuration.
|
|
53
|
+
*/
|
|
54
|
+
export interface PgStorageConfig {
|
|
55
|
+
backend: 'pg';
|
|
56
|
+
connectionString?: string;
|
|
57
|
+
host?: string;
|
|
58
|
+
port?: number;
|
|
59
|
+
database?: string;
|
|
60
|
+
user?: string;
|
|
61
|
+
password?: string;
|
|
62
|
+
schemaName?: string;
|
|
63
|
+
disableInit?: boolean;
|
|
64
|
+
skipDefaultIndexes?: boolean;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Resolved storage configuration for either backend.
|
|
68
|
+
*/
|
|
69
|
+
export type StorageConfig = LibSQLStorageConfig | PgStorageConfig;
|
|
70
|
+
/**
|
|
71
|
+
* Get the resolved storage configuration.
|
|
52
72
|
*
|
|
53
73
|
* Priority (highest to lowest):
|
|
54
|
-
* 1. Environment variables:
|
|
55
|
-
* 2.
|
|
56
|
-
* 3.
|
|
57
|
-
* 4. Local file database (default)
|
|
74
|
+
* 1. Environment variables: MASTRA_STORAGE_BACKEND + backend-specific vars
|
|
75
|
+
* 2. Global settings (from /settings): settings.storage
|
|
76
|
+
* 3. Legacy config files: .mastracode/database.json (LibSQL only)
|
|
77
|
+
* 4. Local file database (LibSQL default)
|
|
78
|
+
*
|
|
79
|
+
* For PG, the env vars are:
|
|
80
|
+
* MASTRA_STORAGE_BACKEND=pg
|
|
81
|
+
* MASTRA_PG_CONNECTION_STRING or MASTRA_PG_HOST/PORT/DATABASE/USER/PASSWORD
|
|
82
|
+
* MASTRA_PG_SCHEMA_NAME (optional)
|
|
83
|
+
*
|
|
84
|
+
* For LibSQL, the legacy env vars still work:
|
|
85
|
+
* MASTRA_DB_URL + MASTRA_DB_AUTH_TOKEN
|
|
58
86
|
*/
|
|
59
|
-
export declare function getStorageConfig(projectDir?: string): StorageConfig;
|
|
87
|
+
export declare function getStorageConfig(projectDir?: string, storageSettings?: StorageSettings): StorageConfig;
|
|
60
88
|
/**
|
|
61
89
|
* Get the current user identity.
|
|
62
90
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"project.d.ts","sourceRoot":"","sources":["../../src/utils/project.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAOH,MAAM,WAAW,WAAW;IAC1B,qEAAqE;IACrE,UAAU,EAAE,MAAM,CAAC;IACnB,kCAAkC;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,wCAAwC;IACxC,QAAQ,EAAE,MAAM,CAAC;IACjB,kCAAkC;IAClC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,yBAAyB;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,qCAAqC;IACrC,UAAU,EAAE,OAAO,CAAC;IACpB,kEAAkE;IAClE,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,2EAA2E;IAC3E,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAC9B;AAgDD;;GAEG;AACH,wBAAgB,aAAa,CAAC,WAAW,EAAE,MAAM,GAAG,WAAW,CAwE9D;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,IAAI,MAAM,CAqBtC;AACD;;;GAGG;AACH,wBAAgB,eAAe,IAAI,MAAM,CAKxC;AAED
|
|
1
|
+
{"version":3,"file":"project.d.ts","sourceRoot":"","sources":["../../src/utils/project.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAOH,MAAM,WAAW,WAAW;IAC1B,qEAAqE;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AG,mBAAmB,GAAG,eAAe,CAAC;AAElE;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,gBAAgB,CAAC,UAAU,CAAC,EAAE,MAAM,EAAE,eAAe,CAAC,EAAE,eAAe,GAAG,aAAa,CAyCtG;AAyED;;;;;;;GAOG;AACH,wBAAgB,SAAS,CAAC,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,CAerD;AAED;;GAEG;AACH,MAAM,MAAM,OAAO,GAAG,QAAQ,GAAG,UAAU,CAAC;AAE5C;;;;;;;;GAQG;AACH,wBAAgB,UAAU,CAAC,UAAU,CAAC,EAAE,MAAM,GAAG,OAAO,CAmBvD;AAgBD;;;;;;;;;;;GAWG;AACH,wBAAgB,qBAAqB,CAAC,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAiBxE"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Storage factory — creates the appropriate storage backend based on resolved config.
|
|
3
|
+
*
|
|
4
|
+
* If PG is selected but fails to connect, falls back to LibSQL so the TUI
|
|
5
|
+
* can start and the user can fix the connection via /settings.
|
|
6
|
+
*/
|
|
7
|
+
import type { MastraCompositeStore } from '@mastra/core/storage';
|
|
8
|
+
import type { StorageConfig } from './project.js';
|
|
9
|
+
export interface StorageResult {
|
|
10
|
+
storage: MastraCompositeStore;
|
|
11
|
+
/** Non-null when PG was requested but failed — contains a user-facing warning. */
|
|
12
|
+
warning?: string;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Create a storage instance from the resolved config.
|
|
16
|
+
*
|
|
17
|
+
* - `libsql` backend → LibSQLStore (always available)
|
|
18
|
+
* - `pg` backend → PostgresStore, falls back to LibSQL on connection failure
|
|
19
|
+
*/
|
|
20
|
+
export declare function createStorage(config: StorageConfig): Promise<StorageResult>;
|
|
21
|
+
//# sourceMappingURL=storage-factory.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"storage-factory.d.ts","sourceRoot":"","sources":["../../src/utils/storage-factory.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAIjE,OAAO,KAAK,EAAE,aAAa,EAAmB,MAAM,cAAc,CAAC;AAGnE,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,oBAAoB,CAAC;IAC9B,kFAAkF;IAClF,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AASD;;;;;GAKG;AACH,wBAAsB,aAAa,CAAC,MAAM,EAAE,aAAa,GAAG,OAAO,CAAC,aAAa,CAAC,CAajF"}
|