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
package/dist/cli-core.js CHANGED
@@ -121,6 +121,11 @@ function helpText(cliCommand) {
121
121
  ` ${cliCommand} runtime-host access revoke --credential <id>`,
122
122
  ` ${cliCommand} runtime-host project list [--root <path>]`,
123
123
  ` ${cliCommand} runtime-host project add <path> [--prefer] [--root <path>]`,
124
+ ` ${cliCommand} runtime-host plugin status|list|inspect|failures [--root <path>]`,
125
+ ` ${cliCommand} runtime-host plugin install|uninstall|reload <target> [--root <path>]`,
126
+ ` ${cliCommand} runtime-host plugin export <extension-id> <bundle-path> [--root <path>]`,
127
+ ` ${cliCommand} runtime-host plugin apply <operations.json> [--root <path>]`,
128
+ ` ${cliCommand} runtime-host plugin reconcile [--root <path>]`,
124
129
  ` ${cliCommand} runtime-host profile list`,
125
130
  ` ${cliCommand} runtime-host profile set --id <id> --name <name> --tls-url <wss-url> --expected-root <root-id> [--credential-env <name>]`,
126
131
  ` ${cliCommand} runtime-host profile set --id <id> --name <name> --ssh-destination <user@host> --ssh-remote-port <port> --expected-root <root-id> [--ssh-port <port>] [--credential-env <name>]`,
@@ -180,6 +185,9 @@ function helpText(cliCommand) {
180
185
  ' --clear-coordination-relays Remove every manually configured relay',
181
186
  ' --automatic-relay-discovery Enable best-effort public relay discovery',
182
187
  ' --no-automatic-relay-discovery Disable public discovery and retain manual relays',
188
+ ' --default-public-stun Use the packaged best-effort public STUN policy',
189
+ ' --no-public-stun Disable public STUN and keep host candidates only',
190
+ ' --webrtc-stun <stun-url> Use a custom STUN endpoint (repeatable)',
183
191
  '',
184
192
  'Runtime Host access issue options:',
185
193
  ' --root <path> Select the canonical data root',
@@ -248,7 +256,7 @@ export async function runMakaCli(argv = process.argv.slice(2), options = RELEASE
248
256
  case 'runtime-host-serve': {
249
257
  const { runRuntimeHostServiceCli } = await import('./runtime-host-service-command.js');
250
258
  if (command.managedDeployment) {
251
- const { resolveRuntimeHostManagedDeployment, resolveRuntimeHostNpmDeploymentLayout } = await import('@maka/runtime-host/operator');
259
+ const { resolveRuntimeHostManagedDeployment, resolveRuntimeHostNpmDeploymentLayout, resolveRuntimeHostWebRtcStunUrls, } = await import('@maka/runtime-host/operator');
252
260
  const { config } = await resolveRuntimeHostManagedDeployment(command.managedDeployment.rootId);
253
261
  const peer = config.listeners.directPeer?.enabled ? config.listeners.directPeer : undefined;
254
262
  const packageLayout = resolveRuntimeHostNpmDeploymentLayout(config.deploymentRoot, config.launch.package.integrity);
@@ -270,6 +278,7 @@ export async function runMakaCli(argv = process.argv.slice(2), options = RELEASE
270
278
  listenAddresses: peer.listenAddresses,
271
279
  coordinationRelays: peer.coordinationRelays,
272
280
  automaticRelayDiscovery: peer.automaticRelayDiscovery,
281
+ webRtcStunUrls: resolveRuntimeHostWebRtcStunUrls(peer.webRtcStunPolicy),
273
282
  meshDataRoot: join(config.deploymentRoot, 'peer-mesh'),
274
283
  },
275
284
  }
@@ -430,6 +439,8 @@ export async function runMakaCli(argv = process.argv.slice(2), options = RELEASE
430
439
  ? {}
431
440
  : { automaticRelayDiscovery: command.automaticRelayDiscovery }),
432
441
  ...(command.relayDiscoveryStatus ? { relayDiscoveryStatus: true } : {}),
442
+ ...(command.webRtcStunPolicy ? { webRtcStunPolicy: command.webRtcStunPolicy } : {}),
443
+ ...(command.webRtcStunStatus ? { webRtcStunStatus: true } : {}),
433
444
  ...(command.expectedTarget ? { expectedTarget: command.expectedTarget } : {}),
434
445
  ...(command.allowInterruptActiveTasks ? { allowInterruptActiveTasks: true } : {}),
435
446
  });
@@ -469,6 +480,7 @@ export async function runMakaCli(argv = process.argv.slice(2), options = RELEASE
469
480
  ...(command.operatorDeploymentId
470
481
  ? { operatorDeploymentId: command.operatorDeploymentId }
471
482
  : {}),
483
+ ...(command.allowManualUpdate ? { allowManualUpdate: true } : {}),
472
484
  ...(command.allowInterruptActiveTasks ? { allowInterruptActiveTasks: true } : {}),
473
485
  });
474
486
  }
@@ -612,6 +624,18 @@ export async function runMakaCli(argv = process.argv.slice(2), options = RELEASE
612
624
  prefer: command.prefer,
613
625
  });
614
626
  }
627
+ case 'runtime-host-plugin': {
628
+ const { runRuntimeHostPluginCli } = await import('./runtime-host-plugin-command.js');
629
+ return runRuntimeHostPluginCli({
630
+ rootPath: command.rootPath ?? dataRoots.workspaceRoot,
631
+ action: command.action,
632
+ ...(command.subject ? { subject: command.subject } : {}),
633
+ ...(command.targetPath ? { targetPath: command.targetPath } : {}),
634
+ ...(command.rootId ? { rootId: command.rootId } : {}),
635
+ ...(command.cursor === undefined ? {} : { cursor: command.cursor }),
636
+ ...(command.limit === undefined ? {} : { limit: command.limit }),
637
+ });
638
+ }
615
639
  case 'runtime-host-capability-provider-serve': {
616
640
  const { runRuntimeHostCapabilityProviderCli } = await import('./runtime-host-capability-provider-command.js');
617
641
  return runRuntimeHostCapabilityProviderCli({
@@ -71,7 +71,7 @@ export function createMcpCapabilityProvider(manager) {
71
71
  const binding = bindings.get(capabilityBindingKey(frame.offerId, frame.serverId, frame.toolName));
72
72
  if (!binding)
73
73
  throw new Error('MCP capability is not part of the published snapshot');
74
- await options.accept();
74
+ await options.accept({ kind: 'none' });
75
75
  return projectMcpResult(await manager.callTool(binding, frame.arguments, { signal: options.signal }));
76
76
  },
77
77
  };
@@ -16,7 +16,7 @@
16
16
  * specific language governing permissions and limitations
17
17
  * under the License.
18
18
  */
19
- import { CATALOG_PROVIDER_TYPES, PROVIDER_DEFAULTS, providerAuthSupportsApiKey, } from '@maka/core/llm-connections';
19
+ import { CATALOG_PROVIDER_TYPES, PROVIDER_REGISTRY, providerAuthSupportsApiKey, } from '@maka/core/llm-connections';
20
20
  export function listApiKeyOnboardableProviders() {
21
21
  // Custom relays have no built-in base URL and stay listed: `requiresBaseUrl`
22
22
  // tells the wizard to collect an endpoint before the API key. The original
@@ -28,16 +28,14 @@ export function listApiKeyOnboardableProviders() {
28
28
  return CATALOG_PROVIDER_TYPES.filter((providerType) => {
29
29
  if (!providerAuthSupportsApiKey(providerType))
30
30
  return false;
31
- const definition = PROVIDER_DEFAULTS[providerType];
31
+ const definition = PROVIDER_REGISTRY[providerType];
32
32
  return Boolean(definition.baseUrl) || definition.category === 'custom';
33
33
  }).map((providerType) => {
34
- const definition = PROVIDER_DEFAULTS[providerType];
34
+ const definition = PROVIDER_REGISTRY[providerType];
35
35
  return {
36
36
  providerType,
37
37
  label: definition.label,
38
- authKind: definition.authKind,
39
38
  requiresBaseUrl: !definition.baseUrl,
40
- fallbackModels: definition.fallbackModels,
41
39
  };
42
40
  });
43
41
  }
@@ -19,12 +19,14 @@
19
19
  import { Markdown, visibleWidth } from '@earendil-works/pi-tui';
20
20
  import { deriveTurnRecords, STEP_LIMIT_NOTICE_TEXT, } from '@maka/core/session';
21
21
  import { providerRetryDisplaySeconds } from '@maka/core/provider-retry-countdown';
22
+ import { defineUiMessageCatalog, resolveUiMessageCatalog, } from '@maka/core/ui-locale';
23
+ import { TUI_COPY_RESOURCES } from './tui-copy-catalog.js';
22
24
  import { isActiveShellRunStatus } from '@maka/core/shell-run';
23
25
  import { mergeShellRunStateWithDiagnostics } from '@maka/core/shell-run-result';
24
26
  import { projectToolActivityArgs } from '@maka/core/tool-activity-args';
25
27
  import { toolResultActivityStatus, unfinishedToolActivityStatus, } from '@maka/core/tool-result-status';
26
28
  import { homedir } from 'node:os';
27
- import { basename } from 'node:path';
29
+ import { basename, isAbsolute, relative, sep } from 'node:path';
28
30
  import { BoundedChunkBuffer } from './bounded-chunk-buffer.js';
29
31
  import { ansi } from './tui-ansi.js';
30
32
  import { collapseToSingleLine, fitLine, formatTokenCount, limitText, markdownTheme, renderIndented, } from './pi-transcript-format.js';
@@ -1380,28 +1382,23 @@ function formatElapsedDuration(elapsedMs) {
1380
1382
  parts.push(`${remainingSeconds}s`);
1381
1383
  return parts.join(' ');
1382
1384
  }
1383
- /**
1384
- * Pending-queue bar shown above the editor while messages are queued. Each
1385
- * steering message reads `Steering: <text>` (injected into the running turn at
1386
- * the next step boundary); each followup reads `Queued: <text>` (opens the next
1387
- * turn). A trailing hint reminds the user that alt+↑ takes them back to edit.
1388
- * Renders nothing when both queues are empty.
1389
- */
1390
- export function renderMakaPiPendingQueue(state, width, platform = process.platform) {
1385
+ const TUI_PENDING_QUEUE_COPY = resolveUiMessageCatalog(defineUiMessageCatalog()(TUI_COPY_RESOURCES['pending-queue']));
1386
+ export function renderMakaPiPendingQueue(state, width, platform = process.platform, locale = 'en') {
1391
1387
  if (state.steering.length === 0 && state.followup.length === 0) {
1392
1388
  return [];
1393
1389
  }
1390
+ const copy = TUI_PENDING_QUEUE_COPY[locale];
1394
1391
  const safeWidth = Math.max(1, width);
1395
1392
  const steering = state.steering;
1396
1393
  const followup = state.followup;
1397
1394
  const lines = [];
1398
1395
  for (const text of steering) {
1399
- lines.push(fitLine(`${ansi.accent('Steering:')} ${ansi.dim(firstLinePreview(text))}`, safeWidth));
1396
+ lines.push(fitLine(`${ansi.accent(copy.steeringLabel)} ${ansi.dim(firstLinePreview(text))}`, safeWidth));
1400
1397
  }
1401
1398
  for (const text of followup) {
1402
- lines.push(fitLine(`${ansi.dim('Queued:')} ${ansi.dim(firstLinePreview(text))}`, safeWidth));
1399
+ lines.push(fitLine(`${ansi.dim(copy.queuedLabel)} ${ansi.dim(firstLinePreview(text))}`, safeWidth));
1403
1400
  }
1404
- lines.push(fitLine(ansi.dim(renderTuiShortcutCopy('Alt+↑ 取回队列以重新编辑', platform)), safeWidth));
1401
+ lines.push(fitLine(ansi.dim(renderTuiShortcutCopy(copy.requeueHint, platform)), safeWidth));
1405
1402
  return lines;
1406
1403
  }
1407
1404
  /**
@@ -1426,14 +1423,21 @@ function firstLinePreview(text) {
1426
1423
  * Shorten an absolute path to a `~`-relative form for the statusline.
1427
1424
  * `/Users/alice/workspace/project` → `~/workspace/project`.
1428
1425
  * Falls back to the original path if it is not under the home directory.
1426
+ * Comparison runs through `path.relative`, so Windows profile paths and
1427
+ * case-only differences shorten as well; the remainder keeps its native
1428
+ * separators (`~/Videos\Clips` on Windows).
1429
1429
  */
1430
- function shortenCwd(cwd, homeDir) {
1430
+ export function shortenCwd(cwd, homeDir) {
1431
1431
  const home = homeDir ?? homedir();
1432
- if (home && cwd.startsWith(home + '/'))
1433
- return `~${cwd.slice(home.length)}`;
1434
- if (home && cwd === home)
1432
+ if (!home)
1433
+ return cwd;
1434
+ const rel = relative(home, cwd);
1435
+ if (rel === '')
1435
1436
  return '~';
1436
- return cwd;
1437
+ if (isAbsolute(rel) || rel === '..' || rel.startsWith(`..${sep}`)) {
1438
+ return cwd;
1439
+ }
1440
+ return `~/${rel}`;
1437
1441
  }
1438
1442
  function formatCost(costUsd) {
1439
1443
  if (costUsd < 0.01)
@@ -91,12 +91,14 @@ export class MakaActivityStripComponent {
91
91
  /** The pending-queue bar (Steering:/Queued:) rendered just above the editor. */
92
92
  export class MakaPendingQueueComponent {
93
93
  state;
94
- constructor(state) {
94
+ locale;
95
+ constructor(state, locale = 'en') {
95
96
  this.state = state;
97
+ this.locale = locale;
96
98
  }
97
99
  invalidate() { }
98
100
  render(width) {
99
- return renderMakaPiPendingQueue(this.state, width);
101
+ return renderMakaPiPendingQueue(this.state, width, process.platform, this.locale);
100
102
  }
101
103
  }
102
104
  /**
@@ -16,7 +16,7 @@
16
16
  * specific language governing permissions and limitations
17
17
  * under the License.
18
18
  */
19
- import { Editor, Key, matchesKey, truncateToWidth, visibleWidth, } from '@earendil-works/pi-tui';
19
+ import { Editor, Input, Key, matchesKey, truncateToWidth, visibleWidth, } from '@earendil-works/pi-tui';
20
20
  import { defineUiMessageCatalog, formatUiMessage, resolveUiMessageCatalog, } from '@maka/core/ui-locale';
21
21
  import { normalizeMcpConfig } from '@maka/storage/mcp-config-store';
22
22
  import { ansi, editorTheme } from './tui-ansi.js';
@@ -24,7 +24,7 @@ import { TUI_COPY_RESOURCES } from './tui-copy-catalog.js';
24
24
  const CHROME_ROWS = 2;
25
25
  const MCP_STATUS_COPY = resolveUiMessageCatalog(defineUiMessageCatalog()(TUI_COPY_RESOURCES['mcp-status']));
26
26
  /** One in-frame state machine for status, editing, confirmation, and errors.
27
- * Raw config values live only in the editor and are cleared on every exit;
27
+ * Raw config values live only in the input component and are cleared on every exit;
28
28
  * no management result is written into the conversation transcript. */
29
29
  export class McpManagementOverlay {
30
30
  input;
@@ -90,7 +90,7 @@ export class McpManagementOverlay {
90
90
  }
91
91
  }
92
92
  catch {
93
- this.notice = { level: 'error', text: copy(this.input.locale, 'invalid') };
93
+ this.notice = { level: 'error', text: resultCopy(this.input.locale, 'invalid') };
94
94
  this.backToList(false);
95
95
  }
96
96
  }
@@ -100,6 +100,10 @@ export class McpManagementOverlay {
100
100
  else if (this.phase.kind === 'confirm_remove' && matchesKey(data, 'y')) {
101
101
  void this.runAction({ kind: 'remove', serverId: this.phase.serverId });
102
102
  }
103
+ else if (this.phase.kind === 'confirm_remove_publication_credential' &&
104
+ matchesKey(data, 'y')) {
105
+ void this.runAction({ kind: 'remove_publication_credential' });
106
+ }
103
107
  }
104
108
  render(width) {
105
109
  const safeWidth = Math.max(1, width);
@@ -127,7 +131,8 @@ export class McpManagementOverlay {
127
131
  return this.input.surface;
128
132
  }
129
133
  handleListInput(data) {
130
- const servers = this.input.surface?.snapshot().servers ?? [];
134
+ const snapshot = this.input.surface?.snapshot();
135
+ const servers = snapshot?.servers ?? [];
131
136
  if (matchesKey(data, Key.up)) {
132
137
  this.selected = clamp(this.selected - 1, 0, servers.length - 1);
133
138
  }
@@ -146,6 +151,16 @@ export class McpManagementOverlay {
146
151
  this.selected = Math.max(0, servers.length - 1);
147
152
  else if (matchesKey(data, 'a') && this.management())
148
153
  this.phase = { kind: 'add_choice' };
154
+ else if (matchesKey(data, 'p') &&
155
+ this.management() &&
156
+ snapshot?.canManagePublicationCredential) {
157
+ this.startInput('publication_credential');
158
+ }
159
+ else if (matchesKey(data, 'x') &&
160
+ this.management() &&
161
+ snapshot?.canManagePublicationCredential) {
162
+ this.phase = { kind: 'confirm_remove_publication_credential' };
163
+ }
149
164
  else {
150
165
  const server = servers[this.selected];
151
166
  if (!server || !this.management())
@@ -207,7 +222,7 @@ export class McpManagementOverlay {
207
222
  startEdit(serverId) {
208
223
  const edit = this.management()?.configForEdit(serverId);
209
224
  if (!edit) {
210
- this.notice = { level: 'error', text: copy(this.input.locale, 'missing') };
225
+ this.notice = { level: 'error', text: resultCopy(this.input.locale, 'missing') };
211
226
  return;
212
227
  }
213
228
  this.startInput('edit', undefined, serverId, edit.revision, JSON.stringify(edit.config, null, 2));
@@ -218,7 +233,10 @@ export class McpManagementOverlay {
218
233
  this.clearEditor();
219
234
  this.notice = undefined;
220
235
  this.phase = { kind: 'input', input, draft, serverId, revision };
221
- this.editor = new Editor(this.input.tui, editorTheme(), { paddingX: 0 });
236
+ this.editor =
237
+ input === 'publication_credential'
238
+ ? new MaskedTextInput()
239
+ : new Editor(this.input.tui, editorTheme(), { paddingX: 0 });
222
240
  this.editor.onSubmit = (submitted) => this.submitInput(submitted);
223
241
  this.editor.setText(value);
224
242
  this.editor.focused = true;
@@ -290,6 +308,12 @@ export class McpManagementOverlay {
290
308
  config,
291
309
  });
292
310
  }
311
+ else if (phase.input === 'publication_credential') {
312
+ if (!trimmed)
313
+ throw new Error();
314
+ this.clearEditor();
315
+ void this.runAction({ kind: 'set_publication_credential', credential: trimmed });
316
+ }
293
317
  else {
294
318
  const preview = this.management()?.previewImport(value);
295
319
  if (!preview || preview.status !== 'ready')
@@ -300,7 +324,7 @@ export class McpManagementOverlay {
300
324
  this.notice = undefined;
301
325
  }
302
326
  catch {
303
- this.notice = { level: 'error', text: copy(this.input.locale, 'invalid') };
327
+ this.notice = { level: 'error', text: resultCopy(this.input.locale, 'invalid') };
304
328
  }
305
329
  this.input.onChange();
306
330
  }
@@ -310,7 +334,7 @@ export class McpManagementOverlay {
310
334
  return;
311
335
  if (this.input.canManage && !this.input.canManage()) {
312
336
  this.backToList(false);
313
- this.notice = { level: 'error', text: copy(this.input.locale, 'turn_active') };
337
+ this.notice = { level: 'error', text: resultCopy(this.input.locale, 'turn_active') };
314
338
  this.input.onChange();
315
339
  return;
316
340
  }
@@ -338,30 +362,15 @@ export class McpManagementOverlay {
338
362
  return unavailableDocument(this.input.locale);
339
363
  if (this.phase.kind === 'input')
340
364
  return this.inputDocument(width);
365
+ const editor = MCP_STATUS_COPY[this.input.locale].editor;
341
366
  if (this.phase.kind === 'add_choice') {
342
- return [
343
- heading(this.input.locale, 'Add MCP server', '添加 MCP 服务器'),
344
- '',
345
- 'g Guided setup',
346
- 'j Paste JSON',
347
- ];
367
+ return [ansi.bold(editor.addTitle), '', 'g Guided setup', 'j Paste JSON'];
348
368
  }
349
369
  if (this.phase.kind === 'transport') {
350
- return [
351
- heading(this.input.locale, 'Transport', '传输方式'),
352
- '',
353
- '1 stdio',
354
- '2 Streamable HTTP',
355
- ];
370
+ return [ansi.bold(editor.transportTitle), '', '1 stdio', '2 Streamable HTTP'];
356
371
  }
357
372
  if (this.phase.kind === 'protocol') {
358
- return [
359
- heading(this.input.locale, 'Protocol preference', '协议偏好'),
360
- '',
361
- '1 legacy',
362
- '2 auto',
363
- '3 2026-07-28',
364
- ];
373
+ return [ansi.bold(editor.protocolTitle), '', '1 legacy', '2 auto', '3 2026-07-28'];
365
374
  }
366
375
  if (this.phase.kind === 'confirm_add') {
367
376
  return confirmAddDocument(this.phase.draft, this.input.locale);
@@ -371,9 +380,18 @@ export class McpManagementOverlay {
371
380
  }
372
381
  if (this.phase.kind === 'confirm_remove') {
373
382
  return [
374
- ansi.red(heading(this.input.locale, `Remove ${this.phase.serverId}?`, `删除 ${this.phase.serverId}?`)),
383
+ ansi.red(ansi.bold(formatUiMessage(editor.confirmRemoveTitle, { serverId: this.phase.serverId }, this.input.locale))),
384
+ '',
385
+ editor.confirmHint,
386
+ ];
387
+ }
388
+ if (this.phase.kind === 'confirm_remove_publication_credential') {
389
+ return [
390
+ ansi.bold(editor.confirmRemoveCredentialTitle),
391
+ '',
392
+ editor.confirmRemoveCredentialDetail,
375
393
  '',
376
- confirmCopy(this.input.locale),
394
+ editor.confirmHint,
377
395
  ];
378
396
  }
379
397
  if (this.phase.kind === 'busy')
@@ -421,7 +439,9 @@ export class McpManagementOverlay {
421
439
  return copy.back;
422
440
  if (!this.management())
423
441
  return copy.readOnly;
424
- return copy.manage;
442
+ return this.input.surface?.snapshot().canManagePublicationCredential
443
+ ? copy.managePublication
444
+ : copy.manage;
425
445
  }
426
446
  backToList(clearNotice = true) {
427
447
  if (this.phase.kind === 'confirm_import') {
@@ -481,6 +501,40 @@ export class McpManagementOverlay {
481
501
  return Math.max(0, this.documentRows - this.bodyRows);
482
502
  }
483
503
  }
504
+ class MaskedTextInput {
505
+ #input = new Input();
506
+ onSubmit;
507
+ onChange;
508
+ constructor() {
509
+ this.#input.onSubmit = (value) => this.onSubmit?.(value);
510
+ }
511
+ get focused() {
512
+ return this.#input.focused;
513
+ }
514
+ set focused(value) {
515
+ this.#input.focused = value;
516
+ }
517
+ setText(value) {
518
+ this.#input.setValue(value);
519
+ }
520
+ handleInput(data) {
521
+ this.#input.handleInput(data);
522
+ this.onChange?.(this.#input.getValue());
523
+ }
524
+ invalidate() {
525
+ this.#input.invalidate();
526
+ }
527
+ render(width) {
528
+ const value = this.#input.getValue();
529
+ this.#input.setValue('•'.repeat(value.length));
530
+ try {
531
+ return this.#input.render(width);
532
+ }
533
+ finally {
534
+ this.#input.setValue(value);
535
+ }
536
+ }
537
+ }
484
538
  function normalizeOneServer(serverId, source) {
485
539
  const value = JSON.parse(source);
486
540
  return normalizeMcpConfig({ version: 3, mcpServers: { [serverId]: value } }).mcpServers[serverId];
@@ -542,144 +596,83 @@ function serverLines(server, locale, selected) {
542
596
  ];
543
597
  }
544
598
  function actionNotice(result, locale) {
545
- if (result.status === 'conflict')
546
- return { level: 'error', text: copy(locale, result.reason) };
547
- if (result.status === 'failed')
548
- return { level: 'error', text: copy(locale, result.reason) };
599
+ if (result.status === 'conflict' || result.status === 'failed') {
600
+ return { level: 'error', text: resultCopy(locale, result.reason) };
601
+ }
549
602
  if (result.status === 'tested') {
550
603
  if (result.test.ok && result.effect === 'publication_failed') {
551
- return { level: 'error', text: copy(locale, 'test_publication_failed') };
604
+ return { level: 'error', text: resultCopy(locale, 'test_publication_failed') };
552
605
  }
553
606
  if (result.test.ok && result.effect === 'pending_host') {
554
- return { level: 'info', text: copy(locale, 'test_pending_host') };
607
+ return { level: 'info', text: resultCopy(locale, 'test_pending_host') };
555
608
  }
556
609
  return {
557
610
  level: result.test.ok ? 'info' : 'error',
558
- text: result.test.ok ? copy(locale, 'test_ok') : copy(locale, 'test_failed'),
611
+ text: result.test.ok ? resultCopy(locale, 'test_ok') : resultCopy(locale, 'test_failed'),
559
612
  };
560
613
  }
561
614
  return {
562
615
  level: result.effect === 'sync_failed' || result.effect === 'publication_failed' ? 'error' : 'info',
563
- text: copy(locale, result.effect),
616
+ text: resultCopy(locale, result.effect),
564
617
  };
565
618
  }
566
- function copy(locale, key) {
567
- const en = {
568
- exists: 'That server ID already exists.',
569
- stale_config: 'MCP configuration changed; retry the action.',
570
- stale_edit: 'This server changed; reopen it before editing.',
571
- stale_import: 'An imported entry changed; preview the import again.',
572
- missing: 'That server no longer exists.',
573
- closed: 'The MCP controller is closed.',
574
- 'invalid-config': 'The server configuration is invalid.',
575
- 'credential-cleanup-failed': 'Stored credentials could not be removed; the configuration was not changed.',
576
- 'persist-failed': 'The configuration could not be saved.',
577
- 'manager-failed': 'The MCP connection action failed.',
578
- turn_active: 'MCP cannot be changed while a turn or another control action is running.',
579
- invalid: 'Check the value and try again.',
580
- published: 'Configuration saved and tools refreshed.',
581
- pending_host: 'Configuration saved; publication is waiting for Runtime Host.',
582
- sync_failed: 'Configuration saved, but the MCP manager is out of sync.',
583
- publication_failed: 'Configuration saved, but capability publication failed.',
584
- test_ok: 'Connection test passed.',
585
- test_failed: 'Connection test failed.',
586
- test_publication_failed: 'Connection test passed, but capability publication failed.',
587
- test_pending_host: 'Connection test passed; publication is waiting for Runtime Host.',
588
- };
589
- const zh = {
590
- exists: '该服务器 ID 已存在。',
591
- stale_config: 'MCP 配置已变化,请重试。',
592
- stale_edit: '该服务器已变化,请重新打开后编辑。',
593
- stale_import: '导入项已变化,请重新预览。',
594
- missing: '该服务器已不存在。',
595
- closed: 'MCP 控制器已关闭。',
596
- 'invalid-config': '服务器配置无效。',
597
- 'credential-cleanup-failed': '无法删除旧凭据,配置未修改。',
598
- 'persist-failed': '无法保存配置。',
599
- 'manager-failed': 'MCP 连接操作失败。',
600
- turn_active: 'Turn 或其他控制操作运行期间不能修改 MCP。',
601
- invalid: '请检查输入后重试。',
602
- published: '配置已保存,工具已刷新。',
603
- pending_host: '配置已保存,正等待 Runtime Host 发布。',
604
- sync_failed: '配置已保存,但 MCP Manager 尚未同步。',
605
- publication_failed: '配置已保存,但 capability 发布失败。',
606
- test_ok: '连接测试通过。',
607
- test_failed: '连接测试失败。',
608
- test_publication_failed: '连接测试通过,但 capability 发布失败。',
609
- test_pending_host: '连接测试通过,正等待 Runtime Host 发布。',
610
- };
611
- return (locale === 'zh' ? zh : en)[key] ?? key;
619
+ function resultCopy(locale, code) {
620
+ return MCP_STATUS_COPY[locale].editor.results[code] ?? code;
612
621
  }
613
622
  function confirmAddDocument(draft, locale) {
623
+ const editor = MCP_STATUS_COPY[locale].editor;
614
624
  return [
615
- heading(locale, 'Add this MCP server?', '添加该 MCP 服务器?'),
625
+ ansi.bold(editor.confirmAddTitle),
616
626
  '',
617
627
  `${draft.serverId} · ${draft.transport} · ${draft.protocol}`,
618
628
  draft.transport === 'stdio' ? (draft.command ?? '') : (draft.url ?? ''),
619
629
  '',
620
- confirmCopy(locale),
630
+ editor.confirmHint,
621
631
  ];
622
632
  }
623
633
  function confirmImportDocument(preview, locale) {
634
+ const editor = MCP_STATUS_COPY[locale].editor;
624
635
  return [
625
- heading(locale, 'Import MCP servers?', '导入 MCP 服务器?'),
636
+ ansi.bold(editor.confirmImportTitle),
626
637
  '',
627
638
  ...preview.entries.map((entry) => `${entry.change === 'add' ? '+' : '~'} ${entry.serverId} · ${entry.transport} · ${entry.protocol}`),
628
639
  '',
629
- confirmCopy(locale),
640
+ editor.confirmHint,
630
641
  ];
631
642
  }
632
643
  function actionLabel(action, locale) {
633
- if (locale === 'zh')
634
- return '正在应用 MCP 更改…';
644
+ const labels = MCP_STATUS_COPY[locale].editor.action;
635
645
  if (action.kind === 'test')
636
- return 'Testing MCP server…';
646
+ return labels.test;
637
647
  if (action.kind === 'reconnect')
638
- return 'Reconnecting MCP server…';
639
- return 'Applying MCP configuration…';
648
+ return labels.reconnect;
649
+ return labels.apply;
640
650
  }
641
651
  function inputLabel(kind, locale) {
642
- const labels = {
643
- server_id: ['Server ID', '服务器 ID'],
644
- command: ['Command', '命令'],
645
- args: ['Arguments', '参数'],
646
- url: ['Streamable HTTP URL', 'Streamable HTTP URL'],
647
- cwd: ['Working directory', '工作目录'],
648
- env: ['Environment', '环境变量'],
649
- headers: ['Request headers', '请求头'],
650
- edit: ['Edit server JSON', '编辑服务器 JSON'],
651
- import: ['Paste MCP JSON', '粘贴 MCP JSON'],
652
- };
653
- return labels[kind][locale === 'zh' ? 1 : 0];
652
+ return MCP_STATUS_COPY[locale].editor.inputLabels[kind];
654
653
  }
655
654
  function inputHint(kind, locale) {
656
- const optional = locale === 'zh' ? '可留空' : 'optional';
655
+ const hints = MCP_STATUS_COPY[locale].editor.hints;
657
656
  if (kind === 'args')
658
- return `JSON string array, ${optional}`;
657
+ return hints.args;
659
658
  if (kind === 'env' || kind === 'headers')
660
- return `JSON string map, ${optional}`;
659
+ return hints.map;
661
660
  if (kind === 'cwd')
662
- return optional;
663
- return locale === 'zh' ? 'Enter 提交 · Esc 返回' : 'Enter submit · Esc back';
661
+ return hints.optional;
662
+ if (kind === 'publication_credential')
663
+ return hints.credential;
664
+ return hints.submit;
664
665
  }
665
666
  function configurationLine(state, locale) {
666
- if (state === 'synchronizing') {
667
- return locale === 'zh' ? '配置同步中…' : 'Configuration is synchronizing…';
668
- }
669
- return ansi.red(locale === 'zh'
670
- ? '持久化配置与 MCP Manager 尚未同步。'
671
- : 'Durable configuration and MCP Manager are out of sync.');
667
+ const editor = MCP_STATUS_COPY[locale].editor;
668
+ if (state === 'synchronizing')
669
+ return editor.synchronizing;
670
+ return ansi.red(editor.outOfSync);
672
671
  }
673
672
  function unavailableDocument(locale) {
674
673
  const copy = MCP_STATUS_COPY[locale];
675
674
  return [ansi.yellow(copy.unavailableTitle), copy.unavailableDetail];
676
675
  }
677
- function heading(locale, en, zh) {
678
- return ansi.bold(locale === 'zh' ? zh : en);
679
- }
680
- function confirmCopy(locale) {
681
- return locale === 'zh' ? 'y 确认 · Esc 取消' : 'y Confirm · Esc cancel';
682
- }
683
676
  function loadingCopy(locale) {
684
677
  return MCP_STATUS_COPY[locale].loading;
685
678
  }
@@ -18,7 +18,7 @@
18
18
  */
19
19
  import { CombinedAutocompleteProvider, Editor, Key, SelectList, decodeKittyPrintable, isKeyRepeat, matchesKey, truncateToWidth, visibleWidth, } from '@earendil-works/pi-tui';
20
20
  import { defineUiMessageCatalog, formatUiMessage, resolveUiMessageCatalog, } from '@maka/core/ui-locale';
21
- import { PROVIDER_DEFAULTS } from '@maka/core/llm-connections';
21
+ import { providerDefaultsOf, } from '@maka/core/llm-connections';
22
22
  import { ansi, editorTheme, selectListTheme, stripAnsi } from './tui-ansi.js';
23
23
  import { TUI_COPY_RESOURCES } from './tui-copy-catalog.js';
24
24
  const TUI_PICKER_COPY = resolveUiMessageCatalog(defineUiMessageCatalog()(TUI_COPY_RESOURCES.pickers));
@@ -480,12 +480,12 @@ export function modelChoiceConnectionLabels(choices) {
480
480
  const labels = new Map();
481
481
  for (const connection of connections) {
482
482
  let label = connection.base;
483
- if (used.has(label) && connection.connectionId) {
483
+ if (used.has(label)) {
484
484
  label = `${connection.base} · ${connection.connectionId}`;
485
485
  }
486
486
  let suffix = 2;
487
487
  while (used.has(label)) {
488
- label = `${connection.base} · ${connection.connectionId ?? connection.connectionSlug} · ${suffix}`;
488
+ label = `${connection.base} · ${connection.connectionId} · ${suffix}`;
489
489
  suffix += 1;
490
490
  }
491
491
  used.add(label);
@@ -527,8 +527,14 @@ function matchesModelChoice(choice, query) {
527
527
  return true;
528
528
  if (choice.providerType.toLowerCase().includes(query))
529
529
  return true;
530
- const providerLabel = PROVIDER_DEFAULTS[choice.providerType]?.label;
531
- if (providerLabel && providerLabel.toLowerCase().includes(query))
530
+ // Both provider names, not just the one the row shows: the dense `menuLabel`
531
+ // drops the qualifier the full label carries ("Google Gemini" → "Google"), so
532
+ // searching only the displayed one loses `gemini`, and searching only the full
533
+ // one loses a qualifier that exists nowhere else ("OpenAI OAuth").
534
+ const provider = providerDefaultsOf(choice.providerType);
535
+ if (provider?.label.toLowerCase().includes(query))
536
+ return true;
537
+ if (provider?.menuLabel?.toLowerCase().includes(query))
532
538
  return true;
533
539
  return false;
534
540
  }