mastracode 0.20.0-alpha.6 → 0.20.0-alpha.8
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 +30 -0
- package/dist/analytics.d.ts +18 -0
- package/dist/analytics.d.ts.map +1 -0
- package/dist/{chunk-KZHLKVWQ.js → chunk-7VEHWBDA.js} +41 -6
- package/dist/chunk-7VEHWBDA.js.map +1 -0
- package/dist/{chunk-Z7PZS23L.cjs → chunk-B4OZBWQJ.cjs} +41 -6
- package/dist/chunk-B4OZBWQJ.cjs.map +1 -0
- package/dist/{chunk-NHOZTX3H.js → chunk-BAMGMQK2.js} +32 -12
- package/dist/chunk-BAMGMQK2.js.map +1 -0
- package/dist/{chunk-EOBCOAWI.cjs → chunk-BX3BAWTX.cjs} +66 -46
- package/dist/chunk-BX3BAWTX.cjs.map +1 -0
- package/dist/{chunk-PAOLP5EY.cjs → chunk-OXPA6TJA.cjs} +1962 -1011
- package/dist/chunk-OXPA6TJA.cjs.map +1 -0
- package/dist/{chunk-P4IRGY3S.js → chunk-PTEMRGV5.js} +1154 -203
- package/dist/chunk-PTEMRGV5.js.map +1 -0
- package/dist/cli.cjs +158 -19
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.js +142 -6
- package/dist/cli.js.map +1 -1
- package/dist/headless.d.ts.map +1 -1
- package/dist/index.cjs +3 -3
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/onboarding/settings.d.ts +8 -0
- package/dist/onboarding/settings.d.ts.map +1 -1
- package/dist/tui/chat-boundary-reconciliation.d.ts +4 -0
- package/dist/tui/chat-boundary-reconciliation.d.ts.map +1 -0
- package/dist/tui/command-dispatch.d.ts.map +1 -1
- package/dist/tui/commands/login.d.ts.map +1 -1
- package/dist/tui/commands/settings.d.ts.map +1 -1
- package/dist/tui/commands/threads.d.ts.map +1 -1
- package/dist/tui/commands/types.d.ts +2 -0
- package/dist/tui/commands/types.d.ts.map +1 -1
- package/dist/tui/components/ask-question-dialog.d.ts +4 -0
- package/dist/tui/components/ask-question-dialog.d.ts.map +1 -1
- package/dist/tui/components/assistant-message.d.ts +2 -0
- package/dist/tui/components/assistant-message.d.ts.map +1 -1
- package/dist/tui/components/chat-boundary-spacer.d.ts +13 -0
- package/dist/tui/components/chat-boundary-spacer.d.ts.map +1 -0
- package/dist/tui/components/chat-spacing.d.ts +9 -0
- package/dist/tui/components/chat-spacing.d.ts.map +1 -0
- package/dist/tui/components/plan-approval-inline.d.ts +3 -0
- package/dist/tui/components/plan-approval-inline.d.ts.map +1 -1
- package/dist/tui/components/settings.d.ts +2 -0
- package/dist/tui/components/settings.d.ts.map +1 -1
- package/dist/tui/components/task-progress.d.ts +4 -0
- package/dist/tui/components/task-progress.d.ts.map +1 -1
- package/dist/tui/components/tool-execution-enhanced.d.ts +64 -2
- package/dist/tui/components/tool-execution-enhanced.d.ts.map +1 -1
- package/dist/tui/components/tool-execution-interface.d.ts +16 -1
- package/dist/tui/components/tool-execution-interface.d.ts.map +1 -1
- package/dist/tui/components/user-message.d.ts +4 -0
- package/dist/tui/components/user-message.d.ts.map +1 -1
- package/dist/tui/event-dispatch.d.ts +0 -3
- package/dist/tui/event-dispatch.d.ts.map +1 -1
- package/dist/tui/handlers/message.d.ts.map +1 -1
- package/dist/tui/handlers/om.d.ts.map +1 -1
- package/dist/tui/handlers/tool.d.ts +0 -5
- package/dist/tui/handlers/tool.d.ts.map +1 -1
- package/dist/tui/handlers/types.d.ts +2 -0
- package/dist/tui/handlers/types.d.ts.map +1 -1
- package/dist/tui/mastra-tui.d.ts +4 -0
- package/dist/tui/mastra-tui.d.ts.map +1 -1
- package/dist/tui/modal-question.d.ts +2 -0
- package/dist/tui/modal-question.d.ts.map +1 -1
- package/dist/tui/render-messages.d.ts.map +1 -1
- package/dist/tui/setup.d.ts.map +1 -1
- package/dist/tui/state.d.ts +5 -0
- package/dist/tui/state.d.ts.map +1 -1
- package/dist/tui.cjs +19 -19
- package/dist/tui.js +2 -2
- package/dist/utils/signals-pubsub.d.ts +4 -0
- package/dist/utils/signals-pubsub.d.ts.map +1 -0
- package/package.json +7 -6
- package/dist/chunk-EOBCOAWI.cjs.map +0 -1
- package/dist/chunk-KZHLKVWQ.js.map +0 -1
- package/dist/chunk-NHOZTX3H.js.map +0 -1
- package/dist/chunk-P4IRGY3S.js.map +0 -1
- package/dist/chunk-PAOLP5EY.cjs.map +0 -1
- package/dist/chunk-Z7PZS23L.cjs.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,35 @@
|
|
|
1
1
|
# mastracode
|
|
2
2
|
|
|
3
|
+
## 0.20.0-alpha.8
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Added a Unix socket PubSub transport and wired the Mastra Code TUI through a per-resource socket so local sessions can coordinate thread streams across processes. Programmatic `createMastraCode` usage remains opt-in: ([#16669](https://github.com/mastra-ai/mastra/pull/16669))
|
|
8
|
+
|
|
9
|
+
```ts
|
|
10
|
+
await createMastraCode({ unixSocketPubSub: true });
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
- Updated dependencies [[`71a820b`](https://github.com/mastra-ai/mastra/commit/71a820b2353fa1406772c50760a3732058a8b337)]:
|
|
14
|
+
- @mastra/core@1.36.0-alpha.6
|
|
15
|
+
|
|
16
|
+
## 0.20.0-alpha.7
|
|
17
|
+
|
|
18
|
+
### Minor Changes
|
|
19
|
+
|
|
20
|
+
- Added PostHog product analytics for MastraCode sessions, prompts, thread changes, command usage, and interactive prompts. Set MASTRA_TELEMETRY_DISABLED=1 to disable telemetry. ([#15173](https://github.com/mastra-ai/mastra/pull/15173))
|
|
21
|
+
|
|
22
|
+
### Patch Changes
|
|
23
|
+
|
|
24
|
+
- Improved MastraCode quiet mode so terminal sessions are easier to scan. ([#16771](https://github.com/mastra-ai/mastra/pull/16771))
|
|
25
|
+
- Quiet mode is now the default for new installs, and existing classic users get a one-time prompt to choose whether to enable it.
|
|
26
|
+
- Added compact tool previews with a configurable preview-line limit, including an option to hide previews.
|
|
27
|
+
- Improved repeated tool-call rendering, path continuation handling, task wrapping, shell/error previews, and spacing between tools, messages, plans, and completed subagents.
|
|
28
|
+
- Added edited line ranges to workspace edit results so tool UIs can show where replacements happened.
|
|
29
|
+
|
|
30
|
+
- Updated dependencies [[`ac79462`](https://github.com/mastra-ai/mastra/commit/ac79462b98f1062394c45093aa515b0766f27ee2), [`19281c7`](https://github.com/mastra-ai/mastra/commit/19281c70424f757219782de16c2699743c5e04d0)]:
|
|
31
|
+
- @mastra/core@1.36.0-alpha.5
|
|
32
|
+
|
|
3
33
|
## 0.20.0-alpha.6
|
|
4
34
|
|
|
5
35
|
### Minor Changes
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export declare function getMastraAnalyticsDistinctId(hostname?: string): string;
|
|
2
|
+
export type MastraCodeAnalyticsEvent = 'mastracode_session_started' | 'mastracode_prompt_submitted' | 'mastracode_thread_changed' | 'mastracode_model_changed' | 'mastracode_command_used' | 'mastracode_interactive_prompt_shown';
|
|
3
|
+
export interface MastraCodeAnalytics {
|
|
4
|
+
capture(event: MastraCodeAnalyticsEvent, properties?: Record<string, unknown>): void;
|
|
5
|
+
trackCommand(command: string, properties?: Record<string, unknown>): void;
|
|
6
|
+
trackInteractivePrompt(promptType: string, properties?: Record<string, unknown>): void;
|
|
7
|
+
shutdown(): Promise<void>;
|
|
8
|
+
isEnabled(): boolean;
|
|
9
|
+
}
|
|
10
|
+
interface MastraCodeAnalyticsOptions {
|
|
11
|
+
version: string;
|
|
12
|
+
host?: string;
|
|
13
|
+
apiKey?: string;
|
|
14
|
+
}
|
|
15
|
+
export declare function isTelemetryDisabled(env?: NodeJS.ProcessEnv): boolean;
|
|
16
|
+
export declare function createMastraCodeAnalytics(options: MastraCodeAnalyticsOptions): MastraCodeAnalytics;
|
|
17
|
+
export {};
|
|
18
|
+
//# sourceMappingURL=analytics.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"analytics.d.ts","sourceRoot":"","sources":["../src/analytics.ts"],"names":[],"mappings":"AAUA,wBAAgB,4BAA4B,CAAC,QAAQ,SAAgB,GAAG,MAAM,CAE7E;AAeD,MAAM,MAAM,wBAAwB,GAChC,4BAA4B,GAC5B,6BAA6B,GAC7B,2BAA2B,GAC3B,0BAA0B,GAC1B,yBAAyB,GACzB,qCAAqC,CAAC;AAE1C,MAAM,WAAW,mBAAmB;IAClC,OAAO,CAAC,KAAK,EAAE,wBAAwB,EAAE,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;IACrF,YAAY,CAAC,OAAO,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;IAC1E,sBAAsB,CAAC,UAAU,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;IACvF,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAC1B,SAAS,IAAI,OAAO,CAAC;CACtB;AAED,UAAU,0BAA0B;IAClC,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AA8FD,wBAAgB,mBAAmB,CAAC,GAAG,GAAE,MAAM,CAAC,UAAwB,GAAG,OAAO,CAOjF;AAED,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,0BAA0B,GAAG,mBAAmB,CAOlG"}
|
|
@@ -25,7 +25,8 @@ var DEFAULTS = {
|
|
|
25
25
|
skippedAt: null,
|
|
26
26
|
version: 0,
|
|
27
27
|
modePackId: null,
|
|
28
|
-
omPackId: null
|
|
28
|
+
omPackId: null,
|
|
29
|
+
quietModePreferenceSelected: true
|
|
29
30
|
},
|
|
30
31
|
models: {
|
|
31
32
|
activeModelPackId: null,
|
|
@@ -46,7 +47,8 @@ var DEFAULTS = {
|
|
|
46
47
|
yolo: null,
|
|
47
48
|
theme: "auto",
|
|
48
49
|
thinkingLevel: "off",
|
|
49
|
-
quietMode: false
|
|
50
|
+
quietMode: false,
|
|
51
|
+
quietModeMaxToolPreviewLines: 2
|
|
50
52
|
},
|
|
51
53
|
storage: { ...STORAGE_DEFAULTS },
|
|
52
54
|
customModelPacks: [],
|
|
@@ -62,20 +64,42 @@ var DEFAULTS = {
|
|
|
62
64
|
viewport: { width: 1280, height: 720 },
|
|
63
65
|
stagehand: { env: "LOCAL" }
|
|
64
66
|
},
|
|
67
|
+
signals: { unixSocketPubSub: false },
|
|
65
68
|
observability: { resources: {}, localTracing: false }
|
|
66
69
|
};
|
|
67
70
|
var THINKING_LEVEL_VALUES = ["off", "low", "medium", "high", "xhigh"];
|
|
71
|
+
var QUIET_MODE_MAX_TOOL_PREVIEW_LINES_MAX = 8;
|
|
68
72
|
function parseThinkingLevel(value) {
|
|
69
73
|
return typeof value === "string" && THINKING_LEVEL_VALUES.includes(value) ? value : DEFAULTS.preferences.thinkingLevel;
|
|
70
74
|
}
|
|
75
|
+
function parseQuietModeMaxToolPreviewLines(value) {
|
|
76
|
+
const rawValue = typeof value === "number" && Number.isFinite(value) ? value : DEFAULTS.preferences.quietModeMaxToolPreviewLines;
|
|
77
|
+
return Math.min(QUIET_MODE_MAX_TOOL_PREVIEW_LINES_MAX, Math.max(0, Math.floor(rawValue)));
|
|
78
|
+
}
|
|
71
79
|
function parsePreferences(rawPreferences) {
|
|
72
80
|
const raw = rawPreferences && typeof rawPreferences === "object" ? rawPreferences : {};
|
|
73
81
|
return {
|
|
74
82
|
...DEFAULTS.preferences,
|
|
75
83
|
...raw,
|
|
76
|
-
thinkingLevel: parseThinkingLevel(raw.thinkingLevel)
|
|
84
|
+
thinkingLevel: parseThinkingLevel(raw.thinkingLevel),
|
|
85
|
+
quietModeMaxToolPreviewLines: parseQuietModeMaxToolPreviewLines(raw.quietModeMaxToolPreviewLines)
|
|
77
86
|
};
|
|
78
87
|
}
|
|
88
|
+
function hasQuietModePreferenceSelected(rawOnboarding) {
|
|
89
|
+
return Boolean(
|
|
90
|
+
rawOnboarding && typeof rawOnboarding === "object" && Object.prototype.hasOwnProperty.call(rawOnboarding, "quietModePreferenceSelected")
|
|
91
|
+
);
|
|
92
|
+
}
|
|
93
|
+
function applyQuietModePreferenceRollout(settings, rawOnboarding) {
|
|
94
|
+
if (hasQuietModePreferenceSelected(rawOnboarding)) return;
|
|
95
|
+
settings.onboarding.quietModePreferenceSelected = settings.preferences.quietMode === true;
|
|
96
|
+
}
|
|
97
|
+
function getNewInstallDefaults() {
|
|
98
|
+
const settings = structuredClone(DEFAULTS);
|
|
99
|
+
settings.preferences.quietMode = true;
|
|
100
|
+
settings.onboarding.quietModePreferenceSelected = true;
|
|
101
|
+
return settings;
|
|
102
|
+
}
|
|
79
103
|
function getSettingsPath() {
|
|
80
104
|
return join(getAppDataDir(), "settings.json");
|
|
81
105
|
}
|
|
@@ -204,8 +228,12 @@ function migrateFromAuth(settingsPath) {
|
|
|
204
228
|
memoryGateway: raw.memoryGateway && typeof raw.memoryGateway === "object" ? raw.memoryGateway : {},
|
|
205
229
|
lsp: raw.lsp && typeof raw.lsp === "object" ? raw.lsp : void 0,
|
|
206
230
|
browser: parseBrowserSettings(raw.browser),
|
|
231
|
+
signals: {
|
|
232
|
+
unixSocketPubSub: raw.signals && typeof raw.signals === "object" && typeof raw.signals.unixSocketPubSub === "boolean" ? raw.signals.unixSocketPubSub : DEFAULTS.signals.unixSocketPubSub
|
|
233
|
+
},
|
|
207
234
|
observability: parseObservabilitySettings(raw.observability)
|
|
208
235
|
};
|
|
236
|
+
applyQuietModePreferenceRollout(settings, raw.onboarding);
|
|
209
237
|
} catch {
|
|
210
238
|
settings = structuredClone(DEFAULTS);
|
|
211
239
|
}
|
|
@@ -277,7 +305,7 @@ function migrateLegacyVariedPack(settings) {
|
|
|
277
305
|
}
|
|
278
306
|
function loadSettings(filePath = getSettingsPath()) {
|
|
279
307
|
migrateFromAuth(filePath);
|
|
280
|
-
if (!existsSync(filePath)) return
|
|
308
|
+
if (!existsSync(filePath)) return getNewInstallDefaults();
|
|
281
309
|
try {
|
|
282
310
|
const raw = JSON.parse(readFileSync(filePath, "utf-8"));
|
|
283
311
|
const settings = {
|
|
@@ -298,9 +326,16 @@ function loadSettings(filePath = getSettingsPath()) {
|
|
|
298
326
|
memoryGateway: raw.memoryGateway && typeof raw.memoryGateway === "object" ? raw.memoryGateway : {},
|
|
299
327
|
lsp: raw.lsp && typeof raw.lsp === "object" ? raw.lsp : void 0,
|
|
300
328
|
browser: parseBrowserSettings(raw.browser),
|
|
329
|
+
signals: {
|
|
330
|
+
unixSocketPubSub: raw.signals && typeof raw.signals === "object" && typeof raw.signals.unixSocketPubSub === "boolean" ? raw.signals.unixSocketPubSub : DEFAULTS.signals.unixSocketPubSub
|
|
331
|
+
},
|
|
301
332
|
observability: parseObservabilitySettings(raw.observability)
|
|
302
333
|
};
|
|
303
334
|
let settingsChanged = false;
|
|
335
|
+
if (!hasQuietModePreferenceSelected(raw.onboarding)) {
|
|
336
|
+
applyQuietModePreferenceRollout(settings, raw.onboarding);
|
|
337
|
+
settingsChanged = true;
|
|
338
|
+
}
|
|
304
339
|
if (raw.models?.omModelId && !settings.models.omModelOverride) {
|
|
305
340
|
settings.models.omModelOverride = raw.models.omModelId;
|
|
306
341
|
settingsChanged = true;
|
|
@@ -1783,5 +1818,5 @@ function releaseAllThreadLocks() {
|
|
|
1783
1818
|
}
|
|
1784
1819
|
|
|
1785
1820
|
export { BOX_INDENT, BOX_INDENT_STR, CHAT_INDENT, MEMORY_GATEWAY_DEFAULT_URL, MEMORY_GATEWAY_PROVIDER, OBSERVABILITY_AUTH_PREFIX, ONBOARDING_VERSION, TERM_WIDTH_BUFFER, THREAD_ACTIVE_MODEL_PACK_ID_KEY, ThreadLockError, acquireThreadLock, applyThemeMode, checkProfileProviderMismatch, createBrowserFromSettings, getAvailableModePacks, getAvailableOmPacks, getCopilotModelCatalog, getCustomProviderId, getDynamicModel, getEditorTheme, getMarkdownTheme, getSelectListTheme, getSettingsListTheme, getTermWidth, getThemeMode, loadSettings, luminance, mastra, mastraBrand, releaseAllThreadLocks, releaseThreadLock, resolveModel, resolveModelDefaults, resolveOmRoleModel, resolveThreadActiveModelPackId, restoreTerminalForeground, saveSettings, setAuthStorage, setAuthStorage2, setAuthStorage3, setProfileProvider, theme, tintHex, toCustomProviderModelId };
|
|
1786
|
-
//# sourceMappingURL=chunk-
|
|
1787
|
-
//# sourceMappingURL=chunk-
|
|
1821
|
+
//# sourceMappingURL=chunk-7VEHWBDA.js.map
|
|
1822
|
+
//# sourceMappingURL=chunk-7VEHWBDA.js.map
|