maka-agent 0.2.1-dev.80.20261012 → 0.2.1-dev.83.20261014

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 (60) hide show
  1. package/dist/acp/tool-event-mapper.js +14 -6
  2. package/dist/cli-core.js +1 -0
  3. package/dist/fullscreen-mode.js +165 -0
  4. package/dist/mcp-capability-provider.js +1 -0
  5. package/dist/pi-transcript.js +19 -7
  6. package/dist/pi-tui-layout.js +266 -0
  7. package/dist/pi-tui-runner.js +67 -4
  8. package/dist/runtime-host-tui-command.js +7 -2
  9. package/dist/skill-highlight-editor.js +9 -0
  10. package/dist/tui-copy-catalog.js +515 -488
  11. package/native/runtime-host-windows-task-launcher/prebuilds/win32-x64/maka-runtime-host-task-launcher.exe +0 -0
  12. package/node_modules/@maka/core/dist/connection-readiness.js +1 -1
  13. package/node_modules/@maka/core/dist/display-redaction.js +3 -2
  14. package/node_modules/@maka/core/dist/model-catalog.js +2 -1
  15. package/node_modules/@maka/core/dist/provider-auth.js +2 -1
  16. package/node_modules/@maka/core/dist/provider-registry.js +1 -11
  17. package/node_modules/@maka/core/dist/provider-retirement.js +45 -0
  18. package/node_modules/@maka/core/dist/redaction.js +4 -3
  19. package/node_modules/@maka/core/dist/relative-time-policy.js +3 -2
  20. package/node_modules/@maka/core/dist/runtime-event.js +5 -1
  21. package/node_modules/@maka/core/dist/session-trace.js +4 -1
  22. package/node_modules/@maka/core/dist/session.js +5 -0
  23. package/node_modules/@maka/core/dist/tool-quiet-preview.js +3 -2
  24. package/node_modules/@maka/core/dist/tool-result-status.js +12 -1
  25. package/node_modules/@maka/core/dist/ui-locale.js +8 -2
  26. package/node_modules/@maka/core/package.json +1 -0
  27. package/node_modules/@maka/runtime/dist/computer-use-tools.js +94 -22
  28. package/node_modules/@maka/runtime/dist/mcp-tools.js +1 -0
  29. package/node_modules/@maka/runtime/dist/read-page.js +28 -10
  30. package/node_modules/@maka/runtime/dist/runtime-event-backfill.js +1 -0
  31. package/node_modules/@maka/runtime/dist/runtime-event-read-model.js +1 -0
  32. package/node_modules/@maka/runtime/dist/session-event-runtime-mapper.js +1 -0
  33. package/node_modules/@maka/runtime/dist/session-trace-projection.js +6 -1
  34. package/node_modules/@maka/runtime/dist/test-connection.js +3 -1
  35. package/node_modules/@maka/runtime/dist/tool-runtime.js +65 -24
  36. package/node_modules/@maka/runtime/dist/workers/filesystem-worker.mjs +24 -10
  37. package/node_modules/@maka/runtime-host/dist/adapter/session-projector.js +2 -1
  38. package/node_modules/@maka/runtime-host/dist/client/client-capability-channel.js +1 -0
  39. package/node_modules/@maka/runtime-host/dist/client/connection.js +19 -0
  40. package/node_modules/@maka/runtime-host/dist/client/host-handoff-copy.js +3 -2
  41. package/node_modules/@maka/runtime-host/dist/client/reconnecting-connection.js +8 -0
  42. package/node_modules/@maka/runtime-host/dist/protocol/artifact-change.js +46 -0
  43. package/node_modules/@maka/runtime-host/dist/protocol/client-capability.js +6 -1
  44. package/node_modules/@maka/runtime-host/dist/protocol/index.js +10 -1
  45. package/node_modules/@maka/runtime-host/dist/protocol/session-continuity.js +3 -1
  46. package/node_modules/@maka/runtime-host/dist/server/artifact-coordinator.js +4 -1
  47. package/node_modules/@maka/runtime-host/dist/server/client-capability-coordinator.js +3 -0
  48. package/node_modules/@maka/runtime-host/dist/server/connection-session.js +8 -0
  49. package/node_modules/@maka/runtime-host/dist/server/execution-composition.js +3 -1
  50. package/node_modules/@maka/runtime-host/dist/server/host-change-feed.js +8 -0
  51. package/node_modules/@maka/runtime-host/dist/server/session-continuity-coordinator.js +1 -1
  52. package/node_modules/@maka/runtime-host/dist/server/session-retirement-coordinator.js +3 -0
  53. package/node_modules/@maka/runtime-host/dist/server/session-revision-coordinator.js +49 -8
  54. package/node_modules/@maka/runtime-host/dist/server/session-sidecar-purge.js +5 -2
  55. package/node_modules/@maka/runtime-host/dist/server/shared-session-transcript.js +1 -0
  56. package/node_modules/@maka/storage/dist/config-transfer.js +2 -1
  57. package/node_modules/@maka/storage/dist/session-store-values.js +11 -1
  58. package/node_modules/node-pty/lib/windowsPtyAgent.js +7 -0
  59. package/node_modules/node-pty/lib/windowsTerminal.js +11 -1
  60. package/package.json +1 -1
@@ -17,7 +17,7 @@
17
17
  * under the License.
18
18
  */
19
19
  import { randomUUID } from 'node:crypto';
20
- import { Key, ProcessTerminal, SelectList, TuiMainScreen, isKeyRelease, isKeyRepeat, matchesKey, } from '@earendil-works/pi-tui';
20
+ import { Key, ProcessTerminal, SelectList, TuiAltScreen, TuiMainScreen, VStack, isKeyRelease, isKeyRepeat, matchesKey, } from '@earendil-works/pi-tui';
21
21
  import { normalizeExternalSessionQueryText, } from '@maka/core/external-session';
22
22
  import { CurrentTodoStore, TodoOverlay, renderTodoIndicator } from './pi-tui-todo.js';
23
23
  import { isThinkingLevel } from '@maka/core/model-thinking';
@@ -37,7 +37,7 @@ import { SafeBoundaryResumeParkedError } from './runtime-host-session-driver.js'
37
37
  import { appendExpansionCollapseConfirmation, appendTurnFailureToTranscript, appendUserCommandToTranscript, appendUserPrompt, applyMakaSessionEventToTranscript, applyShellRunUpdateToTranscript, createMakaPiTranscriptState, hasRunningUserCommand, activeSandboxBoundaryRequest, activeFormRequest, activeUserQuestionRequest, applyExpansionDefaultToAll, completePendingInteraction, applyShellRunViewUpdateToTranscript, EXPANSION_COLLAPSE_CONFIRM_WINDOW_MS, hasExpandedEntriesAboveViewport, permissionModeLabel, retireCancelledTransientMessages, replaceTranscriptWithStoredMessages, hydrateToolsWithStoredMessages, submitCompactToTranscript, toggleAllThinkingExpansion, toggleAllToolExpansion, } from './pi-transcript.js';
38
38
  import { FormInteractionOverlay } from './pi-tui-form-interaction.js';
39
39
  import { runMakaPiTuiTurn } from './pi-tui-turn.js';
40
- import { editorTheme, selectListTheme } from './tui-ansi.js';
40
+ import { ansi, editorTheme, selectListTheme } from './tui-ansi.js';
41
41
  import { MakaAutocompleteAboveEditorComponent } from './tui-autocomplete-layout.js';
42
42
  import { TranscriptViewerOverlay } from './pi-tui-transcript-viewer.js';
43
43
  import { copyToClipboard } from './tui-clipboard.js';
@@ -49,7 +49,8 @@ import { createShellRunHydrationController } from './shell-run-hydration.js';
49
49
  import { CTX_REFRESH_DEBOUNCE_MS, createCtxRefresher, scheduleCtxRefreshTimeout, } from './tui-context-refresh.js';
50
50
  import { sessionStatusBadge } from './tui-session-status.js';
51
51
  import { AttentionController, DISABLE_FOCUS_REPORTING, ENABLE_FOCUS_REPORTING, FOCUS_IN_SEQUENCE, FOCUS_OUT_SEQUENCE, } from './tui-attention.js';
52
- import { MakaActivityStripComponent, MakaPendingQueueComponent, MakaPiLayoutComponent, MakaStatusLineComponent, MakaTranscriptComponent, } from './pi-tui-layout.js';
52
+ import { MakaActivityStripComponent, MakaFullscreenChromeComponent, MakaPendingQueueComponent, MakaPiLayoutComponent, MakaStatusLineComponent, MakaTranscriptComponent, MakaTranscriptDocumentComponent, MakaTranscriptScrollView, } from './pi-tui-layout.js';
53
+ import { openExternalUrl, resolveTuiFullscreen, TUI_FULLSCREEN_ENV } from './fullscreen-mode.js';
53
54
  import { MakaAutocompleteProvider, DirectoryPickerOverlay, ModelSearchOverlay, SessionSearchOverlay, OnboardingWizard, PickerOverlay, UserQuestionOverlay, modelChoiceConnectionLabels, getTuiPickerCopy, modelPickerItems, onboardingFailureMessage, onboardingOAuthFailureMessage, permissionModePickerItems, skillPickerItems, thinkingLevelPickerItems, } from './pi-tui-pickers.js';
54
55
  import { formatMakaResumeCommand } from './cli-invocation.js';
55
56
  import { goalAttachedNoticeText, goalPausedNoticeText, goalStatusLabel, goalSummaryLines, isLiveGoalStatus, } from './pi-goal.js';
@@ -182,7 +183,23 @@ export async function runMakaPiTui(input) {
182
183
  if (taskbarProgress)
183
184
  terminal.setProgress(active);
184
185
  };
185
- const tui = new TuiMainScreen(terminal);
186
+ // Nightly trial (issue #4136): fullscreen swaps the terminal-scrollback
187
+ // renderer for an alternate-screen viewport whose transcript scrolls
188
+ // independently under an anchored composer. Opt out with
189
+ // MAKA_TUI_FULLSCREEN=0, opt in on release builds with =1.
190
+ const tuiFullscreen = resolveTuiFullscreen({
191
+ ...(input.tuiFullscreen !== undefined ? { setting: input.tuiFullscreen } : {}),
192
+ override: process.env[TUI_FULLSCREEN_ENV],
193
+ packageVersion: input.buildVersion,
194
+ });
195
+ const tui = tuiFullscreen
196
+ ? new TuiAltScreen(terminal, undefined, undefined, {
197
+ // App-owned mouse: wheel scrolls the transcript, drag selects, click
198
+ // opens OSC 8 links. Copy keeps pi-tui's OSC 52 write.
199
+ mouse: true,
200
+ openUrl: openExternalUrl,
201
+ })
202
+ : new TuiMainScreen(terminal);
186
203
  const state = createMakaPiTranscriptState();
187
204
  // A pending confirmation is meaningful only for the exact transcript whose
188
205
  // geometry produced it; reconnect/session replacement starts fresh.
@@ -424,6 +441,44 @@ export async function runMakaPiTui(input) {
424
441
  });
425
442
  let refreshEditorCwd;
426
443
  const editorSurface = new MakaAutocompleteAboveEditorComponent(editor);
444
+ // Fullscreen trial (#4136): the transcript document lives inside a primary
445
+ // ScrollView (follow-end, app-owned wheel/keyboard scrolling, chaining
446
+ // overscroll), the chrome is an intrinsic-height VStack entry below it, so
447
+ // the composer and status line stay anchored while history scrolls. The
448
+ // main-screen layout below is still constructed and mounted in both modes;
449
+ // with a layout root set, TuiAltScreen renders and routes only the root
450
+ // (getMountedRoots), so the main layout stays inert in fullscreen.
451
+ const transcriptDocument = new MakaTranscriptDocumentComponent(transcript);
452
+ let transcriptScroll;
453
+ let fullscreenChrome;
454
+ // Constructed above exactly when the fullscreen trial is on, so this both
455
+ // narrows the TUI type for setLayoutRoot and reads correctly in both arms.
456
+ if (tui instanceof TuiAltScreen) {
457
+ transcriptScroll = new MakaTranscriptScrollView(transcriptDocument, {
458
+ follow: 'end',
459
+ primary: true,
460
+ overscroll: 'chain',
461
+ scrollbar: 'auto',
462
+ });
463
+ fullscreenChrome = new MakaFullscreenChromeComponent(state, activityStrip, pendingQueue, editorSurface, statusLine, terminal, {
464
+ current: () => transcriptScroll.computedUnread,
465
+ present: (unreadLines) => {
466
+ transcriptScroll.presentedUnread = unreadLines;
467
+ },
468
+ }, ansi.accent, locale, todoIndicator);
469
+ tui.setLayoutRoot(new VStack([
470
+ { component: transcriptScroll, basis: 0, grow: 1, minSize: 1 },
471
+ { component: fullscreenChrome, basis: 'auto', shrink: 1, minSize: 1 },
472
+ ]));
473
+ // Typing while reading older content re-anchors to the newest output: the
474
+ // composer and its autocomplete live at the bottom, so composing from the
475
+ // middle of history would be blind. One of the trial's explicit evaluation
476
+ // questions (#4136) — revisit with nightly evidence.
477
+ editor.onUserTextChanged = () => {
478
+ transcriptScroll.scrollToEnd();
479
+ tui.requestRender();
480
+ };
481
+ }
427
482
  const layout = new MakaPiLayoutComponent(state, transcript, activityStrip, pendingQueue, editorSurface, statusLine, terminal, todoIndicator);
428
483
  const attention = new AttentionController(terminal, {
429
484
  baseTitle: input.title,
@@ -1947,6 +2002,10 @@ export async function runMakaPiTui(input) {
1947
2002
  if (!prompt)
1948
2003
  return;
1949
2004
  layout.setBlockingInteraction(undefined);
2005
+ // In fullscreen the main-screen layout stays inert (the mounted layout
2006
+ // root draws and budgets rows), so the chrome has to detach the question
2007
+ // from the tree that actually renders it.
2008
+ fullscreenChrome?.setBlockingInteraction(undefined);
1950
2009
  userQuestionPrompt = undefined;
1951
2010
  if (tui.getFocusedComponent() === prompt)
1952
2011
  tui.setFocus(editorSurface);
@@ -2005,6 +2064,10 @@ export async function runMakaPiTui(input) {
2005
2064
  onSkip: () => advance(null),
2006
2065
  });
2007
2066
  layout.setBlockingInteraction(userQuestionPrompt);
2067
+ // The fullscreen question must live inside the mounted layout root, or
2068
+ // the focused overlay is never drawn and the turn waits on a blind answer
2069
+ // (#4136 review P1).
2070
+ fullscreenChrome?.setBlockingInteraction(userQuestionPrompt);
2008
2071
  tui.setFocus(userQuestionPrompt);
2009
2072
  };
2010
2073
  const syncUserQuestionPrompt = () => {
@@ -48,7 +48,7 @@ export async function runRuntimeHostTui(input) {
48
48
  return 1;
49
49
  if (!isMissingDefaultConnection(error) || input.resumeSessionId)
50
50
  throw error;
51
- const configured = await runFirstRunOnboarding(input.clientDataRoot, input.workspaceRoot, input.cwd, input.locale, input.hostProfileId);
51
+ const configured = await runFirstRunOnboarding(input.clientDataRoot, input.workspaceRoot, input.cwd, input.locale, input.hostProfileId, input.buildVersion);
52
52
  if (!configured)
53
53
  return 0;
54
54
  context = await createRuntimeHostTuiContext(contextInput);
@@ -113,6 +113,7 @@ export async function runRuntimeHostTui(input) {
113
113
  listShellRunUpdates: (sessionId) => context.driver.listShellRunUpdates(sessionId),
114
114
  onProcessExit: input.onProcessExit,
115
115
  cliCommand: input.cliCommand,
116
+ buildVersion: input.buildVersion,
116
117
  resumeSessionId: input.resumeSessionId,
117
118
  resumeCwd: input.resumeCwd,
118
119
  ...(runtimeHostProfileUsesHostWorkspace(context.profile.kind) && input.resumeSessionId
@@ -137,7 +138,7 @@ export async function runRuntimeHostTui(input) {
137
138
  // can use the restored terminal without competing with the TUI renderer.
138
139
  return ownerAction ? ownerAction() : 0;
139
140
  }
140
- async function runFirstRunOnboarding(clientDataRoot, rootPath, cwd, locale, hostProfileId) {
141
+ async function runFirstRunOnboarding(clientDataRoot, rootPath, cwd, locale, hostProfileId, buildVersion) {
141
142
  const connected = await connectRuntimeHostCli({
142
143
  clientDataRoot,
143
144
  rootPath,
@@ -163,6 +164,10 @@ async function runFirstRunOnboarding(clientDataRoot, rootPath, cwd, locale, host
163
164
  connectionSlug: '',
164
165
  permissionMode: 'bypass',
165
166
  firstRun: true,
167
+ // Anchored above the onboarding key: upstream rewrites the onboarding
168
+ // line below (surface hoisting), and a spread after it would collide
169
+ // in the three-way merge. Object literal order is irrelevant here.
170
+ ...(buildVersion ? { buildVersion } : {}),
166
171
  turnActivity: {
167
172
  activities: new SessionActivityRegistry(),
168
173
  },
@@ -41,6 +41,13 @@ const MID_MESSAGE_SLASH_TOKEN = /(?:\s)\/\S*$/;
41
41
  */
42
42
  export class MakaSkillHighlightEditor extends Editor {
43
43
  isInvocable = () => false;
44
+ /**
45
+ * Invoked after any input that changed the editor text (typing, paste,
46
+ * autocomplete insertion). The fullscreen TUI uses it to re-anchor the
47
+ * transcript to the newest output — typing while reading older content
48
+ * jumps back to the bottom (an explicit evaluation point of issue #4136).
49
+ */
50
+ onUserTextChanged;
44
51
  /**
45
52
  * Swap the validator used by the render pass. Must be synchronous and
46
53
  * cheap (called per token per render) — the runner feeds it a snapshot of
@@ -64,6 +71,8 @@ export class MakaSkillHighlightEditor extends Editor {
64
71
  // here because super.handleInput performs the insertion.
65
72
  const textBefore = this.getText();
66
73
  super.handleInput(data);
74
+ if (this.getText() !== textBefore)
75
+ this.onUserTextChanged?.();
67
76
  if (this.isShowingAutocomplete())
68
77
  return;
69
78
  if (this.getText() === textBefore)