maka-agent 0.2.0-dev.10.20260831 → 0.2.0-dev.12.20260901

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 (237) hide show
  1. package/LICENSE +49 -2
  2. package/RUNTIME_HOST_PEER_DEPENDENCIES.rust.tsv +70 -0
  3. package/RUNTIME_HOST_PEER_THIRD_PARTY_NOTICES.txt +1839 -140
  4. package/dist/cli-core.js +25 -1
  5. package/dist/mcp-capability-provider.js +1 -1
  6. package/dist/onboarding-catalog.js +3 -5
  7. package/dist/pi-transcript.js +21 -17
  8. package/dist/pi-tui-layout.js +4 -2
  9. package/dist/pi-tui-mcp-status.js +115 -122
  10. package/dist/pi-tui-pickers.js +11 -5
  11. package/dist/pi-tui-runner.js +133 -102
  12. package/dist/runtime-host-cli-context.js +4 -0
  13. package/dist/runtime-host-cli.js +150 -4
  14. package/dist/runtime-host-lifecycle-transaction.js +5 -2
  15. package/dist/runtime-host-managed-lifecycle-manager.js +1 -0
  16. package/dist/runtime-host-onboarding.js +12 -16
  17. package/dist/runtime-host-peer-management-command.js +16 -4
  18. package/dist/runtime-host-plugin-command.js +101 -0
  19. package/dist/runtime-host-run-command.js +5 -1
  20. package/dist/runtime-host-service-management-command.js +2 -1
  21. package/dist/runtime-host-setup-command.js +1 -0
  22. package/dist/runtime-host-task-readiness.js +2 -3
  23. package/dist/runtime-host-tui-command.js +1 -1
  24. package/dist/runtime-host-tui-context.js +34 -6
  25. package/dist/runtime-host-update-command.js +13 -5
  26. package/dist/runtime-host-update-discovery.js +1 -0
  27. package/dist/tui-clipboard.js +86 -0
  28. package/dist/tui-copy-catalog.js +256 -0
  29. package/dist/tui-copy-command.js +103 -0
  30. package/dist/tui-mcp-control.js +46 -4
  31. package/dist/tui-mcp-remote-publication.js +395 -0
  32. package/native/runtime-host-peer/prebuilds/darwin-arm64/maka_runtime_host_peer.node +0 -0
  33. package/native/runtime-host-peer/prebuilds/linux-arm64/maka_runtime_host_peer.node +0 -0
  34. package/native/runtime-host-peer/prebuilds/linux-x64/maka_runtime_host_peer.node +0 -0
  35. package/native/runtime-host-peer/prebuilds/win32-x64/maka_runtime_host_peer.node +0 -0
  36. package/node_modules/@maka/core/dist/agent-run.js +5 -0
  37. package/node_modules/@maka/core/dist/attachments.js +80 -1
  38. package/node_modules/@maka/core/dist/bounded-response.js +71 -0
  39. package/node_modules/@maka/core/dist/chat-model-choice.js +8 -31
  40. package/node_modules/@maka/core/dist/client-capability-grant.js +149 -0
  41. package/node_modules/@maka/core/dist/connection-readiness.js +3 -31
  42. package/node_modules/@maka/core/dist/deep-research.js +1 -20
  43. package/node_modules/@maka/core/dist/events.js +22 -1
  44. package/node_modules/@maka/core/dist/execution-inspect.js +3 -1
  45. package/node_modules/@maka/core/dist/foreign-session.js +2 -2
  46. package/node_modules/@maka/core/dist/interaction.js +49 -2
  47. package/node_modules/@maka/core/dist/llm-connections.js +74 -82
  48. package/node_modules/@maka/core/dist/model-call-attempt.js +66 -0
  49. package/node_modules/@maka/core/dist/model-catalog.js +238 -313
  50. package/node_modules/@maka/core/dist/model-facts.js +280 -0
  51. package/node_modules/@maka/core/dist/model-metadata.generated.js +1907 -1872
  52. package/node_modules/@maka/core/dist/model-metadata.js +184 -199
  53. package/node_modules/@maka/core/dist/model-projection-transition.js +145 -0
  54. package/node_modules/@maka/core/dist/model-thinking.js +1 -1
  55. package/node_modules/@maka/core/dist/models-dev-projection.js +302 -0
  56. package/node_modules/@maka/core/dist/models-dev-refresh.js +55 -0
  57. package/node_modules/@maka/core/dist/onboarding.js +2 -1
  58. package/node_modules/@maka/core/dist/provider-auth.js +47 -291
  59. package/node_modules/@maka/core/dist/provider-registry.js +68 -357
  60. package/node_modules/@maka/core/dist/runtime-boundary.js +2 -2
  61. package/node_modules/@maka/core/dist/runtime-event.js +5 -1
  62. package/node_modules/@maka/core/dist/runtime-policy/connection-catalog-codec.js +82 -5
  63. package/node_modules/@maka/core/dist/runtime-policy/model-catalog-entry-codec.js +75 -0
  64. package/node_modules/@maka/core/dist/runtime-policy.js +2 -1
  65. package/node_modules/@maka/core/dist/session-send-projection.js +2 -1
  66. package/node_modules/@maka/core/dist/session-start-mode.js +42 -0
  67. package/node_modules/@maka/core/dist/session-todo.js +101 -0
  68. package/node_modules/@maka/core/dist/session.js +119 -5
  69. package/node_modules/@maka/core/dist/slash-command-catalog.js +1 -0
  70. package/node_modules/@maka/core/dist/task-submission-readiness.js +2 -1
  71. package/node_modules/@maka/core/dist/tool-activity-args.js +4 -0
  72. package/node_modules/@maka/core/dist/tool-quiet-preview.js +5 -5
  73. package/node_modules/@maka/core/dist/tool-result-record-schema.js +2 -1
  74. package/node_modules/@maka/core/dist/workhub-creation-intent.js +896 -0
  75. package/node_modules/@maka/core/package.json +9 -1
  76. package/node_modules/@maka/runtime/dist/active-tool-result-prune.js +45 -131
  77. package/node_modules/@maka/runtime/dist/agent-run.js +58 -44
  78. package/node_modules/@maka/runtime/dist/ai-sdk-backend.js +146 -201
  79. package/node_modules/@maka/runtime/dist/ai-sdk-compaction.js +235 -69
  80. package/node_modules/@maka/runtime/dist/context-budget-helpers.js +4 -41
  81. package/node_modules/@maka/runtime/dist/context-budget-policy.js +8 -1
  82. package/node_modules/@maka/runtime/dist/context-budget.js +9 -81
  83. package/node_modules/@maka/runtime/dist/context-diagnostics.js +63 -27
  84. package/node_modules/@maka/runtime/dist/continuation-replay.js +19 -11
  85. package/node_modules/@maka/runtime/dist/conversation-copy.js +179 -16
  86. package/node_modules/@maka/runtime/dist/deep-research-tools.js +2 -3
  87. package/node_modules/@maka/runtime/dist/durable-tool-result-projection.js +21 -0
  88. package/node_modules/@maka/runtime/dist/execution-inspect.js +13 -3
  89. package/node_modules/@maka/runtime/dist/history-compact-checkpoint.js +58 -7
  90. package/node_modules/@maka/runtime/dist/history-compact-ledger.js +9 -1
  91. package/node_modules/@maka/runtime/dist/history-compact-summarizer.js +2 -2
  92. package/node_modules/@maka/runtime/dist/history-compact-summary-validation.js +2 -1
  93. package/node_modules/@maka/runtime/dist/history-compaction.js +2 -1
  94. package/node_modules/@maka/runtime/dist/image-file.js +5 -20
  95. package/node_modules/@maka/runtime/dist/latest-context-snapshot.js +114 -20
  96. package/node_modules/@maka/runtime/dist/local-web-fetch.js +2 -43
  97. package/node_modules/@maka/runtime/dist/mcp-tools.js +28 -0
  98. package/node_modules/@maka/runtime/dist/model-adapter.js +47 -15
  99. package/node_modules/@maka/runtime/dist/model-factory.js +7 -1
  100. package/node_modules/@maka/runtime/dist/model-fetcher.js +15 -8
  101. package/node_modules/@maka/runtime/dist/model-history.js +125 -3
  102. package/node_modules/@maka/runtime/dist/model-projection-transition-ledger.js +207 -0
  103. package/node_modules/@maka/runtime/dist/model-runtime.js +7 -4
  104. package/node_modules/@maka/runtime/dist/openai-codex-history-compactor.js +12 -14
  105. package/node_modules/@maka/runtime/dist/plugin-composition-loader.js +173 -20
  106. package/node_modules/@maka/runtime/dist/plugin-runtime.js +219 -0
  107. package/node_modules/@maka/runtime/dist/prompt-composition.js +33 -21
  108. package/node_modules/@maka/runtime/dist/provider-request-telemetry.js +35 -74
  109. package/node_modules/@maka/runtime/dist/quiescent-session-snapshot.js +78 -0
  110. package/node_modules/@maka/runtime/dist/request-shape.js +256 -343
  111. package/node_modules/@maka/runtime/dist/run-trace.js +2 -24
  112. package/node_modules/@maka/runtime/dist/runtime-continuation-admission.js +1 -1
  113. package/node_modules/@maka/runtime/dist/runtime-event-backfill.js +3 -0
  114. package/node_modules/@maka/runtime/dist/runtime-event-read-model.js +1 -0
  115. package/node_modules/@maka/runtime/dist/runtime-kernel.js +77 -23
  116. package/node_modules/@maka/runtime/dist/runtime-resume.js +20 -11
  117. package/node_modules/@maka/runtime/dist/session-event-runtime-mapper.js +8 -4
  118. package/node_modules/@maka/runtime/dist/session-manager.js +45 -9
  119. package/node_modules/@maka/runtime/dist/session-recap.js +2 -1
  120. package/node_modules/@maka/runtime/dist/session-todo-tools.js +67 -0
  121. package/node_modules/@maka/runtime/dist/subagent-tools.js +2 -77
  122. package/node_modules/@maka/runtime/dist/system-prompt/main-session-prompt.js +1 -1
  123. package/node_modules/@maka/runtime/dist/telemetry/model-pricing.generated.js +93 -83
  124. package/node_modules/@maka/runtime/dist/test-connection.js +6 -6
  125. package/node_modules/@maka/runtime/dist/tool-result-archive-transition.js +227 -0
  126. package/node_modules/@maka/runtime/dist/tool-result-archive.js +40 -168
  127. package/node_modules/@maka/runtime/dist/tool-runtime.js +50 -6
  128. package/node_modules/@maka/runtime/dist/workers/filesystem-worker.js +39 -16
  129. package/node_modules/@maka/runtime/package.json +2 -1
  130. package/node_modules/@maka/runtime-host/dist/adapter/session-projector.js +10 -0
  131. package/node_modules/@maka/runtime-host/dist/client/catalog-reader.js +19 -5
  132. package/node_modules/@maka/runtime-host/dist/client/client-capability-channel.js +3 -2
  133. package/node_modules/@maka/runtime-host/dist/client/connection.js +22 -0
  134. package/node_modules/@maka/runtime-host/dist/client/host-profile.js +222 -19
  135. package/node_modules/@maka/runtime-host/dist/client/index.js +2 -1
  136. package/node_modules/@maka/runtime-host/dist/client/oauth-presentation.js +1 -1
  137. package/node_modules/@maka/runtime-host/dist/client/peer-client.js +4 -0
  138. package/node_modules/@maka/runtime-host/dist/client/reconnecting-connection.js +8 -0
  139. package/node_modules/@maka/runtime-host/dist/operator/index.js +2 -1
  140. package/node_modules/@maka/runtime-host/dist/operator/managed-deployment.js +2 -0
  141. package/node_modules/@maka/runtime-host/dist/operator/peer-management-frame.js +2 -0
  142. package/node_modules/@maka/runtime-host/dist/operator/service-management-frame.js +2 -0
  143. package/node_modules/@maka/runtime-host/dist/peer-mesh/owner.js +1 -0
  144. package/node_modules/@maka/runtime-host/dist/protocol/client-capability.js +22 -1
  145. package/node_modules/@maka/{storage/dist/task-ledger-store-internal.js → runtime-host/dist/protocol/connection-catalog-change.js} +7 -13
  146. package/node_modules/@maka/runtime-host/dist/protocol/index.js +43 -2
  147. package/node_modules/@maka/runtime-host/dist/protocol/operations.js +7 -3
  148. package/node_modules/@maka/runtime-host/dist/protocol/plugin-platform.js +512 -0
  149. package/node_modules/@maka/runtime-host/dist/protocol/runtime-policy.js +24 -12
  150. package/node_modules/@maka/runtime-host/dist/protocol/session-catalog.js +1 -1
  151. package/node_modules/@maka/runtime-host/dist/protocol/session-continuity.js +1 -1
  152. package/node_modules/@maka/runtime-host/dist/protocol/session-retirement.js +30 -3
  153. package/node_modules/@maka/runtime-host/dist/protocol/session-todo.js +53 -0
  154. package/node_modules/@maka/runtime-host/dist/protocol/turn.js +4 -1
  155. package/node_modules/@maka/runtime-host/dist/protocol/workhub-coordination.js +92 -4
  156. package/node_modules/@maka/runtime-host/dist/server/access-authority.js +15 -13
  157. package/node_modules/@maka/runtime-host/dist/server/access-credential-metadata.js +4 -2
  158. package/node_modules/@maka/runtime-host/dist/server/access-credential-store.js +119 -47
  159. package/node_modules/@maka/runtime-host/dist/server/bootstrap-runtime-policy.js +10 -4
  160. package/node_modules/@maka/runtime-host/dist/server/child-agent-composition.js +1 -1
  161. package/node_modules/@maka/runtime-host/dist/server/client-capability-coordinator.js +192 -18
  162. package/node_modules/@maka/runtime-host/dist/server/client-capability-invocation-broker.js +122 -48
  163. package/node_modules/@maka/runtime-host/dist/server/client-capability-provider-id.js +31 -0
  164. package/node_modules/@maka/runtime-host/dist/server/connection-effect-coordinator.js +6 -5
  165. package/node_modules/@maka/runtime-host/dist/server/connection-session.js +1 -0
  166. package/node_modules/@maka/runtime-host/dist/server/deep-research-coordinator.js +1 -1
  167. package/node_modules/@maka/runtime-host/dist/server/execution-composition.js +163 -66
  168. package/node_modules/@maka/runtime-host/dist/server/execution-model-authority.js +27 -9
  169. package/node_modules/@maka/runtime-host/dist/server/execution-model-composition.js +38 -43
  170. package/node_modules/@maka/runtime-host/dist/server/extension-bundle.js +249 -0
  171. package/node_modules/@maka/runtime-host/dist/server/extension-package-manifest.js +262 -0
  172. package/node_modules/@maka/runtime-host/dist/server/goal-coordinator.js +0 -23
  173. package/node_modules/@maka/runtime-host/dist/server/host-change-feed.js +11 -0
  174. package/node_modules/@maka/runtime-host/dist/server/index.js +5 -0
  175. package/node_modules/@maka/runtime-host/dist/server/interaction-coordinator.js +181 -13
  176. package/node_modules/@maka/runtime-host/dist/server/interaction-projection.js +6 -0
  177. package/node_modules/@maka/runtime-host/dist/server/interactive-run-composer.js +7 -9
  178. package/node_modules/@maka/runtime-host/dist/server/message-coordinator.js +88 -22
  179. package/node_modules/@maka/runtime-host/dist/server/model-metadata-refresh.js +96 -0
  180. package/node_modules/@maka/runtime-host/dist/server/operation-dispatcher.js +43 -118
  181. package/node_modules/@maka/runtime-host/dist/server/plugin-composition-patch.js +58 -0
  182. package/node_modules/@maka/runtime-host/dist/server/plugin-composition-store.js +141 -0
  183. package/node_modules/@maka/runtime-host/dist/server/plugin-package-loader.js +130 -0
  184. package/node_modules/@maka/runtime-host/dist/server/plugin-package-store.js +528 -0
  185. package/node_modules/@maka/runtime-host/dist/server/plugin-platform-coordinator.js +249 -0
  186. package/node_modules/@maka/runtime-host/dist/server/plugin-platform.js +1130 -0
  187. package/node_modules/@maka/runtime-host/dist/server/root-admission-owner.js +4 -0
  188. package/node_modules/@maka/runtime-host/dist/server/root-turn-coordinator.js +24 -5
  189. package/node_modules/@maka/runtime-host/dist/server/runtime-policy-coordinator.js +31 -2
  190. package/node_modules/@maka/runtime-host/dist/server/session-catalog-coordinator.js +2 -1
  191. package/node_modules/@maka/runtime-host/dist/server/session-retirement-coordinator.js +58 -9
  192. package/node_modules/@maka/runtime-host/dist/server/session-revision-coordinator.js +30 -13
  193. package/node_modules/@maka/runtime-host/dist/server/session-sidecar-purge.js +1 -1
  194. package/node_modules/@maka/runtime-host/dist/server/session-todo-coordinator.js +77 -0
  195. package/node_modules/@maka/runtime-host/dist/server/session-transcript-pager.js +10 -2
  196. package/node_modules/@maka/runtime-host/dist/server/web-fetch-tool.js +1 -1
  197. package/node_modules/@maka/runtime-host/dist/server/workhub-coordination-action-gate.js +276 -3
  198. package/node_modules/@maka/runtime-host/dist/server/workhub-coordination-coordinator.js +101 -1
  199. package/node_modules/@maka/runtime-host/dist/transport/peer-native.js +1 -0
  200. package/node_modules/@maka/runtime-host/dist/webrtc-stun-policy.js +114 -0
  201. package/node_modules/@maka/runtime-host/package.json +2 -0
  202. package/node_modules/@maka/storage/dist/agent-run-store.js +80 -15
  203. package/node_modules/@maka/storage/dist/artifact-attachments.js +29 -6
  204. package/node_modules/@maka/storage/dist/artifact-store.js +7 -23
  205. package/node_modules/@maka/storage/dist/artifact-stores.js +13 -2
  206. package/node_modules/@maka/storage/dist/conversation-operational-state.js +3 -0
  207. package/node_modules/@maka/storage/dist/credential-store.js +3 -0
  208. package/node_modules/@maka/storage/dist/execution-stores.js +4 -0
  209. package/node_modules/@maka/storage/dist/file-lifetime-owner.js +30 -2
  210. package/node_modules/@maka/storage/dist/interaction-store-public.js +1 -1
  211. package/node_modules/@maka/storage/dist/interaction-store.js +173 -0
  212. package/node_modules/@maka/storage/dist/model-facts-store.js +79 -0
  213. package/node_modules/@maka/storage/dist/production-session-snapshot.js +761 -0
  214. package/node_modules/@maka/storage/dist/quiescent-session-snapshot.js +1 -1
  215. package/node_modules/@maka/storage/dist/runtime-policy/connection-catalog-document.js +26 -26
  216. package/node_modules/@maka/storage/dist/runtime-policy/coordinator.js +114 -56
  217. package/node_modules/@maka/storage/dist/runtime-policy/document-io.js +22 -16
  218. package/node_modules/@maka/storage/dist/runtime-policy/onboarding-transaction.js +2 -2
  219. package/node_modules/@maka/storage/dist/runtime-policy-stores.js +1 -1
  220. package/node_modules/@maka/storage/dist/session-message-projection.js +1 -1
  221. package/node_modules/@maka/storage/dist/session-store.js +32 -6
  222. package/node_modules/@maka/storage/dist/{task-ledger-authority.js → session-todo-authority.js} +13 -28
  223. package/node_modules/@maka/storage/dist/session-todo-store.js +169 -0
  224. package/node_modules/@maka/storage/dist/sqlite-core-execution-schema.js +19 -0
  225. package/node_modules/@maka/storage/dist/sqlite-runtime-schema.js +42 -1
  226. package/node_modules/@maka/storage/dist/sqlite-session-metadata-schema.js +10 -1
  227. package/node_modules/@maka/storage/dist/sqlite-session-metadata-store.js +73 -3
  228. package/node_modules/@maka/storage/dist/sqlite-workflow-schema.js +5 -8
  229. package/node_modules/@maka/storage/dist/storage-writer-composition.js +3 -3
  230. package/node_modules/@maka/storage/package.json +3 -1
  231. package/package.json +1 -1
  232. package/node_modules/@maka/core/dist/task-ledger.js +0 -669
  233. package/node_modules/@maka/runtime/dist/task-ledger-tools.js +0 -244
  234. package/node_modules/@maka/runtime/dist/test-helpers.js +0 -61
  235. package/node_modules/@maka/runtime-host/dist/protocol/task-ledger.js +0 -321
  236. package/node_modules/@maka/runtime-host/dist/server/task-ledger-coordinator.js +0 -154
  237. package/node_modules/@maka/storage/dist/task-ledger-store.js +0 -663
@@ -19,10 +19,11 @@
19
19
  import { randomUUID } from 'node:crypto';
20
20
  import { basename } from 'node:path';
21
21
  import { Key, ProcessTerminal, SelectList, TuiMainScreen, isKeyRelease, isKeyRepeat, matchesKey, } from '@earendil-works/pi-tui';
22
- import { isThinkingLevel, thinkingVariantsForModel, } from '@maka/core/model-thinking';
22
+ import { isThinkingLevel } from '@maka/core/model-thinking';
23
23
  import { projectRevisionLinkedSessionTree } from '@maka/core/session-revisions';
24
24
  import { slashCommandsForSurface, } from '@maka/core/slash-command-catalog';
25
25
  import { latestAssistantModelId, } from '@maka/core/session';
26
+ import { defineUiMessageCatalog, formatUiMessage, resolveUiMessageCatalog, } from '@maka/core/ui-locale';
26
27
  import { buildForeignSessionHandoffMessage, foreignSessionHandoffDisplayText, foreignSourceLabel, } from '@maka/core/foreign-session';
27
28
  import { listApiKeyOnboardableProviders } from './onboarding-catalog.js';
28
29
  import { AUTO_RECAP_DISPLAY_LIMIT_BYTES, shouldAutoRecap } from './session-recap.js';
@@ -36,6 +37,8 @@ import { runMakaPiTuiTurn } from './pi-tui-turn.js';
36
37
  import { editorTheme, selectListTheme } from './tui-ansi.js';
37
38
  import { MakaAutocompleteAboveEditorComponent } from './tui-autocomplete-layout.js';
38
39
  import { TranscriptViewerOverlay } from './pi-tui-transcript-viewer.js';
40
+ import { copyToClipboard } from './tui-clipboard.js';
41
+ import { getTuiCopyCopy, lastAssistantText, serializeTranscriptText } from './tui-copy-command.js';
39
42
  import { McpManagementOverlay } from './pi-tui-mcp-status.js';
40
43
  import { createShellRunElapsedTicker } from './shell-run-elapsed-ticker.js';
41
44
  import { createShellRunHydrationController } from './shell-run-hydration.js';
@@ -46,6 +49,7 @@ import { MakaAutocompleteProvider, DirectoryPickerOverlay, ModelSearchOverlay, O
46
49
  import { formatMakaResumeCommand } from './cli-invocation.js';
47
50
  import { goalAttachedNoticeText, goalPausedNoticeText, goalStatusLabel, goalSummaryLines, isLiveGoalStatus, } from './pi-goal.js';
48
51
  import { getTuiPrimaryGuidance } from './tui-primary-guidance.js';
52
+ import { TUI_COPY_RESOURCES } from './tui-copy-catalog.js';
49
53
  export function resolveTaskbarProgress(setting, environment = {
50
54
  platform: process.platform,
51
55
  override: process.env.MAKA_TASKBAR_PROGRESS,
@@ -84,38 +88,34 @@ export function safeBoundaryResumeParkedCopy(reason) {
84
88
  return { level: 'error', text: `Safe-boundary resume parked: ${reason}` };
85
89
  }
86
90
  }
91
+ const TUI_REWIND_COPY = resolveUiMessageCatalog(defineUiMessageCatalog()(TUI_COPY_RESOURCES.rewind));
92
+ const TUI_SKILLS_COPY = resolveUiMessageCatalog(defineUiMessageCatalog()(TUI_COPY_RESOURCES.skills));
93
+ const TUI_CONNECTION_IDENTITY_COPY = resolveUiMessageCatalog(defineUiMessageCatalog()(TUI_COPY_RESOURCES['connection-identity']));
94
+ const TUI_SESSION_ACTIONS_COPY = resolveUiMessageCatalog(defineUiMessageCatalog()(TUI_COPY_RESOURCES['session-actions']));
87
95
  function sessionConnectionIdentityNotice(session, identities, locale) {
88
96
  if (!identities)
89
97
  return undefined;
90
- const emptyChoiceRecovery = locale === 'zh'
91
- ? '如果 /model 没有可选项,请先添加或启用连接(API Key 连接可运行 /setup)。'
92
- : 'If /model has no choices, add or enable a connection first (run /setup for API-key connections).';
98
+ const copy = TUI_CONNECTION_IDENTITY_COPY[locale];
99
+ const withRecovery = (notice) => formatUiMessage(copy.withRecovery, { notice, recovery: copy.emptyChoiceRecovery }, locale);
93
100
  if (!session.llmConnectionId) {
94
- return locale === 'zh'
95
- ? `此任务来自旧版本,需要确认一次账号。运行 /model 选择现有账号和模型。${emptyChoiceRecovery}`
96
- : `This task comes from an older version and needs a one-time account confirmation. Run /model and choose an existing account and model. ${emptyChoiceRecovery}`;
101
+ return withRecovery(copy.confirmAccount);
97
102
  }
98
103
  const identified = identities.find((entry) => entry.connectionId === session.llmConnectionId);
99
104
  if (!identified) {
100
- return locale === 'zh'
101
- ? `原账号已删除;运行 /model 选择新账号和模型后继续。${emptyChoiceRecovery}`
102
- : `The original account was deleted. Run /model and choose a new account and model to continue. ${emptyChoiceRecovery}`;
105
+ return withRecovery(copy.accountDeleted);
103
106
  }
104
107
  if (identified.connectionSlug !== session.llmConnectionSlug) {
105
- return locale === 'zh'
106
- ? `任务保存的账号身份与当前连接不一致;运行 /model 重新选择账号和模型。${emptyChoiceRecovery}`
107
- : `The saved account identity no longer matches its connection. Run /model and choose an account and model again. ${emptyChoiceRecovery}`;
108
+ return withRecovery(copy.identityMismatch);
108
109
  }
109
110
  if (!identified.enabled) {
110
- return locale === 'zh'
111
- ? `原账号已停用;请启用该账号,或运行 /model 选择新账号和模型。${emptyChoiceRecovery}`
112
- : `The original account is disabled. Enable it, or run /model and choose a new account and model. ${emptyChoiceRecovery}`;
111
+ return withRecovery(copy.accountDisabled);
113
112
  }
114
113
  return undefined;
115
114
  }
116
115
  export async function runMakaPiTui(input) {
117
116
  const locale = input.locale ?? 'en';
118
117
  const pickerCopy = getTuiPickerCopy(locale);
118
+ const copyCopy = getTuiCopyCopy(locale);
119
119
  const primaryGuidance = getTuiPrimaryGuidance(locale);
120
120
  const terminal = input.terminal ?? new ProcessTerminal();
121
121
  const taskbarProgress = resolveTaskbarProgress(input.taskbarProgress);
@@ -141,18 +141,9 @@ export async function runMakaPiTui(input) {
141
141
  let model = input.model;
142
142
  let connectionId = input.connectionId;
143
143
  let connectionSlug = input.connectionSlug;
144
- // Mutable: a cross-connection /model switch rebinds the provider, which changes
145
- // both the connection and the thinking variants the new model supports.
146
- let providerType = input.providerType;
147
- let modelContextWindow = input.modelContextWindow;
148
144
  let permissionMode = input.permissionMode;
149
145
  let orchestrationMode = input.driver.getOrchestrationMode?.() ?? 'default';
150
146
  let thinkingLevel = undefined;
151
- // The boot connection's declared capabilities win (an openai-compatible
152
- // relay can declare relayModelProfiles[model].thinkingLevels). The
153
- // providerType+model metadata variant is the fallback for modelChoices-free
154
- // embeddings of the runner.
155
- let thinkingLevels = input.modelChoices?.find((choice) => choice.connectionSlug === connectionSlug && choice.model === model)?.thinkingLevels ?? (providerType ? thinkingVariantsForModel(providerType, model) : []);
156
147
  let sessionListScope = input.sessionListScope ?? 'current';
157
148
  let connectionIdentityNotice;
158
149
  let busy = false;
@@ -292,11 +283,11 @@ export async function runMakaPiTui(input) {
292
283
  permissionMode,
293
284
  orchestrationMode,
294
285
  thinkingLevel,
295
- thinkingLevels,
286
+ thinkingLevels: currentThinkingLevels(),
296
287
  sessionId: input.driver.getSessionId(),
297
288
  busy,
298
289
  usage: state.usage,
299
- modelContextWindow,
290
+ modelContextWindow: currentModelContextWindow(),
300
291
  turnElapsedMs: turnStartedAt !== undefined ? Date.now() - turnStartedAt : undefined,
301
292
  providerRetry: state.providerRetry,
302
293
  uiLocale: locale,
@@ -314,7 +305,7 @@ export async function runMakaPiTui(input) {
314
305
  });
315
306
  const transcript = new MakaTranscriptComponent(state, metadata);
316
307
  const activityStrip = new MakaActivityStripComponent(metadata);
317
- const pendingQueue = new MakaPendingQueueComponent(state);
308
+ const pendingQueue = new MakaPendingQueueComponent(state, locale);
318
309
  const statusLine = new MakaStatusLineComponent(metadata);
319
310
  // Use the vendor editor's full 20-item autocomplete capacity. Larger command
320
311
  // catalogs remain scrollable and keep an exact position/total counter.
@@ -454,30 +445,31 @@ export async function runMakaPiTui(input) {
454
445
  // Warm the highlight validator so tokens light up before the first
455
446
  // autocomplete or picker open.
456
447
  void listSkillsCached(true);
457
- const SKILL_INVOCATION_FAILURE_REASON_LABEL = {
458
- not_found: '未找到',
459
- disabled: '已禁用',
460
- host_incompatible: '当前主机缺少其依赖的工具',
461
- invalid_name: '名称无效',
462
- too_many_requests: '调用请求过多',
463
- };
448
+ const skillsCopy = TUI_SKILLS_COPY[locale];
464
449
  const showSkillInvocation = (skillInvocation) => {
465
450
  const failed = skillInvocation.failed;
466
451
  const failedLabels = failed.map((entry) => entry.reason === 'too_many_requests'
467
- ? `请求超过 ${entry.requestLimit} 个上限(${SKILL_INVOCATION_FAILURE_REASON_LABEL[entry.reason]})`
468
- : `/skill:${entry.request}(${SKILL_INVOCATION_FAILURE_REASON_LABEL[entry.reason] ?? entry.reason})`);
452
+ ? formatUiMessage(skillsCopy.tooManyRequestsItem, { limit: entry.requestLimit, reason: skillsCopy.failureReasons[entry.reason] }, locale)
453
+ : formatUiMessage(skillsCopy.failedItem, { request: entry.request, reason: skillsCopy.failureReasons[entry.reason] }, locale));
469
454
  if (failed.length > 0) {
470
455
  state.entries.push({
471
456
  kind: 'notice',
472
457
  level: 'info',
473
- text: `未能加载技能 ${failedLabels.join('、')};${skillInvocation.loaded.length === 0 ? '未发起模型请求。' : '失败的调用标记未发送给模型。'}`,
458
+ text: formatUiMessage(skillsCopy.loadFailed, {
459
+ failures: failedLabels.join(skillsCopy.listSeparator),
460
+ outcome: skillInvocation.loaded.length === 0
461
+ ? skillsCopy.outcomeNoRequest
462
+ : skillsCopy.outcomeMarkersNotSent,
463
+ }, locale),
474
464
  });
475
465
  }
476
466
  if (skillInvocation.loaded.length > 0) {
477
467
  state.entries.push({
478
468
  kind: 'notice',
479
469
  level: 'info',
480
- text: `已加载技能:${skillInvocation.loaded.map((skill) => skill.name).join('、')}`,
470
+ text: formatUiMessage(skillsCopy.loaded, {
471
+ names: skillInvocation.loaded.map((skill) => skill.name).join(skillsCopy.listSeparator),
472
+ }, locale),
481
473
  });
482
474
  }
483
475
  requestRender();
@@ -564,8 +556,10 @@ export async function runMakaPiTui(input) {
564
556
  process.off('uncaughtException', handleUncaughtException);
565
557
  process.off('unhandledRejection', handleUnhandledRejection);
566
558
  };
559
+ let unsubscribeModelCatalogChanges;
567
560
  const restoreTerminal = () => {
568
561
  removeProcessHandlers();
562
+ unsubscribeModelCatalogChanges?.();
569
563
  unsubscribeSessionTitleChanges();
570
564
  unsubscribeGoalChanges?.();
571
565
  void sideConversation?.stopParentObserver?.();
@@ -871,6 +865,33 @@ export async function runMakaPiTui(input) {
871
865
  // available — the single source the picker and connection/model lookups read.
872
866
  let modelChoices = input.modelChoices;
873
867
  let connectionIdentities = input.connectionIdentities;
868
+ // Derived, never mirrored: both the choices and the selected target move —
869
+ // the Host republishes its catalog, the user switches model — and a stored
870
+ // copy of what the two imply has to be resynchronized at every one of those
871
+ // points or go stale at the one that was missed.
872
+ // The slug and model identify the target; the id narrows it only once the
873
+ // caller or a session summary has supplied one, because two connections can
874
+ // share a slug across a rebind but a caller need not know either id.
875
+ const currentModelChoice = () => modelChoices?.find((choice) => choice.connectionSlug === connectionSlug &&
876
+ choice.model === model &&
877
+ (connectionId === undefined || choice.connectionId === connectionId));
878
+ const onInitialTarget = () => connectionId === input.connectionId &&
879
+ connectionSlug === input.connectionSlug &&
880
+ model === input.model;
881
+ /** The caller's value stands only while no choice describes the target it came with. */
882
+ const currentModelContextWindow = () => currentModelChoice()?.contextWindow ??
883
+ (onInitialTarget() ? input.modelContextWindow : undefined);
884
+ // The Host resolved these when it projected the choice — including a relay's
885
+ // declared `relayModelProfiles[model].thinkingLevels`. A model no choice
886
+ // describes offers none rather than a locally guessed list.
887
+ const currentThinkingLevels = () => currentModelChoice()?.thinkingLevels ?? [];
888
+ unsubscribeModelCatalogChanges = input.subscribeModelCatalogChanges?.((refresh) => {
889
+ if (closed)
890
+ return;
891
+ modelChoices = refresh.modelChoices;
892
+ connectionIdentities = refresh.connectionIdentities;
893
+ requestRender();
894
+ });
874
895
  // Monotonic attempt id: each setup submit captures one, and any transition
875
896
  // that abandons the in-flight attempt (back, re-pick, close) increments it so
876
897
  // a late verify/save settlement cannot clobber a newer attempt.
@@ -1137,9 +1158,6 @@ export async function runMakaPiTui(input) {
1137
1158
  const adoptSessionMetadata = (summary, announceIdentity = true) => {
1138
1159
  cwd = summary.cwd ?? cwd;
1139
1160
  setSessionTitle(summary.name);
1140
- const previousModel = model;
1141
- const previousConnectionId = connectionId;
1142
- const previousConnectionSlug = connectionSlug;
1143
1161
  model = summary.model;
1144
1162
  connectionId = summary.llmConnectionId;
1145
1163
  connectionSlug = summary.llmConnectionSlug;
@@ -1148,34 +1166,9 @@ export async function runMakaPiTui(input) {
1148
1166
  state.entries.push({ kind: 'notice', level: 'error', text: identityNotice });
1149
1167
  }
1150
1168
  connectionIdentityNotice = identityNotice;
1151
- const matchingChoice = modelChoices?.find((choice) => choice.connectionId === summary.llmConnectionId &&
1152
- choice.connectionSlug === summary.llmConnectionSlug);
1153
- providerType =
1154
- matchingChoice?.providerType ??
1155
- (previousConnectionId === summary.llmConnectionId &&
1156
- previousConnectionSlug === summary.llmConnectionSlug
1157
- ? providerType
1158
- : undefined);
1159
- const contextWindowMatch = modelChoices?.find((choice) => choice.connectionId === summary.llmConnectionId &&
1160
- choice.connectionSlug === summary.llmConnectionSlug &&
1161
- choice.model === summary.model);
1162
- if (contextWindowMatch) {
1163
- modelContextWindow = contextWindowMatch.contextWindow;
1164
- }
1165
- else if (previousConnectionId !== summary.llmConnectionId ||
1166
- previousConnectionSlug !== summary.llmConnectionSlug ||
1167
- previousModel !== summary.model) {
1168
- modelContextWindow = undefined;
1169
- }
1170
1169
  permissionMode = input.driver.getPermissionMode?.() ?? summary.permissionMode;
1171
1170
  orchestrationMode = summary.orchestrationMode ?? 'default';
1172
1171
  thinkingLevel = summary.thinkingLevel;
1173
- // Choice-first: a relay model's user-declared levels live on the ModelChoice;
1174
- // the metadata fallback serves providers whose variants derive from the
1175
- // model id alone.
1176
- thinkingLevels =
1177
- contextWindowMatch?.thinkingLevels ??
1178
- (providerType ? thinkingVariantsForModel(providerType, summary.model) : []);
1179
1172
  refreshEditorCwd?.(cwd);
1180
1173
  };
1181
1174
  startAttachedTurn = (attached) => {
@@ -1189,16 +1182,7 @@ export async function runMakaPiTui(input) {
1189
1182
  const previousModel = transcriptLastUsedModel ?? model;
1190
1183
  await input.driver.setModel(nextModel);
1191
1184
  model = nextModel;
1192
- // Same-connection switch: scope the choice lookup to the live connection
1193
- // (another connection may expose the same model id with different
1194
- // declared thinking levels).
1195
- const match = modelChoices?.find((choice) => choice.connectionSlug === connectionSlug && choice.model === nextModel);
1196
- if (match)
1197
- modelContextWindow = match.contextWindow;
1198
1185
  thinkingLevel = undefined;
1199
- thinkingLevels =
1200
- match?.thinkingLevels ??
1201
- (providerType ? thinkingVariantsForModel(providerType, nextModel) : []);
1202
1186
  state.entries.push({
1203
1187
  kind: 'notice',
1204
1188
  level: 'info',
@@ -1214,9 +1198,6 @@ export async function runMakaPiTui(input) {
1214
1198
  choice.connectionId === connectionId) {
1215
1199
  return;
1216
1200
  }
1217
- if (!choice.connectionId) {
1218
- throw new Error('Model choice is missing its exact Connection identity');
1219
- }
1220
1201
  const previousModel = transcriptLastUsedModel ?? model;
1221
1202
  const previousConnectionSlug = connectionSlug;
1222
1203
  const connectionLabels = modelChoiceConnectionLabels(modelChoices ?? [choice]);
@@ -1224,11 +1205,7 @@ export async function runMakaPiTui(input) {
1224
1205
  model = choice.model;
1225
1206
  connectionId = choice.connectionId;
1226
1207
  connectionSlug = choice.connectionSlug;
1227
- providerType = choice.providerType;
1228
- modelContextWindow = choice.contextWindow;
1229
1208
  thinkingLevel = undefined;
1230
- thinkingLevels =
1231
- choice.thinkingLevels ?? thinkingVariantsForModel(choice.providerType, choice.model);
1232
1209
  state.entries.push({
1233
1210
  kind: 'notice',
1234
1211
  level: 'info',
@@ -1589,7 +1566,7 @@ export async function runMakaPiTui(input) {
1589
1566
  const pendingNotice = {
1590
1567
  kind: 'notice',
1591
1568
  level: 'info',
1592
- text: '正在回退到该轮之前…',
1569
+ text: TUI_REWIND_COPY[locale].pending,
1593
1570
  };
1594
1571
  state.entries.push(pendingNotice);
1595
1572
  requestRender();
@@ -1615,9 +1592,7 @@ export async function runMakaPiTui(input) {
1615
1592
  state.entries.push({
1616
1593
  kind: 'notice',
1617
1594
  level: 'info',
1618
- text: refill
1619
- ? '已回退到该轮之前(分支为新任务,原任务保留),该轮 prompt 已回填输入框,可修改后重新发送。'
1620
- : '已回退到该轮之前(分支为新任务,原任务保留)。输入框已有未发送内容,未覆盖;该轮 prompt 已存入输入历史,可按 ↑ 找回。',
1595
+ text: refill ? TUI_REWIND_COPY[locale].doneRefilled : TUI_REWIND_COPY[locale].doneKeptDraft,
1621
1596
  });
1622
1597
  requestRender();
1623
1598
  }
@@ -1807,7 +1782,6 @@ export async function runMakaPiTui(input) {
1807
1782
  apiKey: wizardApiKey,
1808
1783
  baseUrl: wizardBaseUrl,
1809
1784
  enabledModelIds,
1810
- models: wizardModels,
1811
1785
  })
1812
1786
  .then((result) => {
1813
1787
  if (result.kind !== 'ok') {
@@ -2113,13 +2087,16 @@ export async function runMakaPiTui(input) {
2113
2087
  // prefixed select value so they never collide with Maka session ids. A scan
2114
2088
  // error is surfaced (not silently swallowed): degrade to no rows but tell
2115
2089
  // the user why, so a real store bug isn't mistaken for "no sessions".
2090
+ // Deliberate #2672 exception: the interpolated detail is a local
2091
+ // file-scan diagnostic (not backend copy) and the TUI has no log channel
2092
+ // to carry it, so dropping it would hide the only debugging signal.
2116
2093
  const foreignByValue = new Map();
2117
2094
  if ('error' in foreignScan) {
2118
2095
  const detail = foreignScan.error instanceof Error ? foreignScan.error.message : String(foreignScan.error);
2119
2096
  state.entries.push({
2120
2097
  kind: 'notice',
2121
2098
  level: 'error',
2122
- text: `读取外部对话失败:${detail}`,
2099
+ text: formatUiMessage(TUI_SESSION_ACTIONS_COPY[locale].foreignScanFailed, { detail }, locale),
2123
2100
  });
2124
2101
  }
2125
2102
  else {
@@ -2201,7 +2178,7 @@ export async function runMakaPiTui(input) {
2201
2178
  state.entries.push({
2202
2179
  kind: 'notice',
2203
2180
  level: 'info',
2204
- text: '没有可回退的轮次。',
2181
+ text: TUI_REWIND_COPY[locale].noTargets,
2205
2182
  });
2206
2183
  requestRender();
2207
2184
  return;
@@ -2210,7 +2187,8 @@ export async function runMakaPiTui(input) {
2210
2187
  value: target.turnId,
2211
2188
  label: target.label,
2212
2189
  }));
2213
- showSelectPicker('Rewind', 'Rewind', items, (item) => {
2190
+ const rewindCopy = TUI_REWIND_COPY[locale];
2191
+ showSelectPicker(rewindCopy.pickerTitle, rewindCopy.pickerTitle, items, (item) => {
2214
2192
  // runControl drops the action silently when busy is already held (e.g.
2215
2193
  // a Goal auto-continuation started while the picker was open). The
2216
2194
  // overlay is already closed at this point, so say so instead of
@@ -2219,7 +2197,7 @@ export async function runMakaPiTui(input) {
2219
2197
  state.entries.push({
2220
2198
  kind: 'notice',
2221
2199
  level: 'error',
2222
- text: '无法回退:当前有正在进行的操作 — 请等待其完成,或中断(Esc)后重试。',
2200
+ text: rewindCopy.busy,
2223
2201
  });
2224
2202
  requestRender();
2225
2203
  return;
@@ -2228,23 +2206,22 @@ export async function runMakaPiTui(input) {
2228
2206
  }, {
2229
2207
  minPrimaryColumnWidth: 24,
2230
2208
  maxPrimaryColumnWidth: 48,
2231
- hint: '回到选定轮次之前(丢弃该轮及之后,prompt 回填输入框) · enter 选择 / esc 取消',
2209
+ hint: rewindCopy.pickerHint,
2232
2210
  });
2233
2211
  };
2234
2212
  const newSession = async () => {
2235
2213
  try {
2236
2214
  await input.driver.startNewSession();
2237
2215
  }
2238
- catch (error) {
2216
+ catch {
2239
2217
  // The identity swap was aborted driver-side: the previous Session, its
2240
2218
  // transcript, and every user-command card stay exactly as they were.
2241
- // Surface why instead of silently stranding the running commands.
2219
+ // Surface the failure instead of silently stranding the running
2220
+ // commands; the driver's raw error text is not product copy (#2672).
2242
2221
  state.entries.push({
2243
2222
  kind: 'notice',
2244
2223
  level: 'error',
2245
- text: error instanceof Error && error.message.length > 0
2246
- ? error.message
2247
- : '无法开始新会话:停止本地命令失败,请稍后重试。',
2224
+ text: TUI_SESSION_ACTIONS_COPY[locale].newSessionFailed,
2248
2225
  });
2249
2226
  requestRender();
2250
2227
  return false;
@@ -2400,18 +2377,18 @@ export async function runMakaPiTui(input) {
2400
2377
  state.entries.push({
2401
2378
  kind: 'notice',
2402
2379
  level: 'info',
2403
- text: '当前没有可调用的技能。',
2380
+ text: skillsCopy.noneAvailable,
2404
2381
  });
2405
2382
  requestRender();
2406
2383
  return;
2407
2384
  }
2408
- showSelectPicker('Invoke Skill', String(entries.length), skillPickerItems(entries), (item) => {
2385
+ showSelectPicker(skillsCopy.pickerTitle, String(entries.length), skillPickerItems(entries), (item) => {
2409
2386
  editor.insertTextAtCursor(`/skill:${item.value} `);
2410
2387
  requestRender();
2411
2388
  }, { minPrimaryColumnWidth: 16, maxPrimaryColumnWidth: 40 });
2412
2389
  };
2413
2390
  const showThinkingLevelList = () => {
2414
- const items = thinkingLevelPickerItems(thinkingLevels, thinkingLevel, locale);
2391
+ const items = thinkingLevelPickerItems(currentThinkingLevels(), thinkingLevel, locale);
2415
2392
  showSelectPicker(pickerCopy.thinkingPickerTitle, thinkingLevel ?? 'default', items, (item) => {
2416
2393
  const level = item.value === 'default' ? undefined : item.value;
2417
2394
  if (level !== undefined && !isThinkingLevel(level))
@@ -2808,6 +2785,59 @@ export async function runMakaPiTui(input) {
2808
2785
  void runControl(compactSession);
2809
2786
  },
2810
2787
  },
2788
+ copy: {
2789
+ description: primaryGuidance.commands.copy,
2790
+ // Refused mid-turn: copy grabs the finished reply, and while a turn streams
2791
+ // the last assistant entry is the half-written one — copying that would
2792
+ // silently hand back a partial message. Wait for the turn (or Esc) first.
2793
+ midTurn: 'refuse',
2794
+ run: (parts) => {
2795
+ const scope = parts.length >= 2 ? parts[1] : undefined;
2796
+ if (parts.length > 2 || (scope !== undefined && scope !== 'all')) {
2797
+ state.entries.push({
2798
+ kind: 'notice',
2799
+ level: 'error',
2800
+ text: 'Usage: /copy [all]',
2801
+ });
2802
+ requestRender();
2803
+ return;
2804
+ }
2805
+ const copyAll = scope === 'all';
2806
+ const text = copyAll
2807
+ ? serializeTranscriptText(state, {
2808
+ user: copyCopy.roleUser,
2809
+ assistant: copyCopy.roleAssistant,
2810
+ goalContinuation: copyCopy.roleGoalContinuation,
2811
+ legacyAutomation: copyCopy.roleLegacyAutomation,
2812
+ })
2813
+ : lastAssistantText(state);
2814
+ if (!text) {
2815
+ state.entries.push({
2816
+ kind: 'notice',
2817
+ level: 'info',
2818
+ text: copyCopy.nothingToCopy,
2819
+ });
2820
+ requestRender();
2821
+ return;
2822
+ }
2823
+ const result = copyToClipboard(terminal, text);
2824
+ if (!result.ok) {
2825
+ state.entries.push({
2826
+ kind: 'notice',
2827
+ level: 'error',
2828
+ text: formatUiMessage(copyCopy.tooLarge, { bytes: result.bytes, limit: result.limit }, locale),
2829
+ });
2830
+ requestRender();
2831
+ return;
2832
+ }
2833
+ state.entries.push({
2834
+ kind: 'notice',
2835
+ level: 'info',
2836
+ text: formatUiMessage(copyAll ? copyCopy.copiedAll : copyCopy.copiedLast, { count: text.length }, locale),
2837
+ });
2838
+ requestRender();
2839
+ },
2840
+ },
2811
2841
  exit: {
2812
2842
  description: primaryGuidance.commands.exit,
2813
2843
  // isExitPrompt (which also matches bare "quit"/"exit" without a slash)
@@ -2896,7 +2926,7 @@ export async function runMakaPiTui(input) {
2896
2926
  state.entries.push({
2897
2927
  kind: 'notice',
2898
2928
  level: 'error',
2899
- text: 'Usage: /skill,或直接在消息中输入 /skill:<name>',
2929
+ text: skillsCopy.usage,
2900
2930
  });
2901
2931
  requestRender();
2902
2932
  return;
@@ -2957,6 +2987,7 @@ export async function runMakaPiTui(input) {
2957
2987
  description: primaryGuidance.commands.thinking,
2958
2988
  midTurn: 'refuse',
2959
2989
  run: (parts) => {
2990
+ const thinkingLevels = currentThinkingLevels();
2960
2991
  if (parts.length === 1) {
2961
2992
  if (thinkingLevels.length === 0) {
2962
2993
  state.entries.push({
@@ -124,6 +124,10 @@ export async function connectRuntimeHostCli(input, overrides = {}) {
124
124
  connection: liveConnection,
125
125
  catalog: await deps.readConnectionCatalog(liveConnection),
126
126
  profile,
127
+ clientInstanceId,
128
+ ...(resolvedProfile.profileIncarnationId
129
+ ? { profileIncarnationId: resolvedProfile.profileIncarnationId }
130
+ : {}),
127
131
  close: async () => {
128
132
  try {
129
133
  await liveConnection.close();