maka-agent 0.2.0-dev.11.20260831 → 0.2.0-dev.14.20260902

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 (226) hide show
  1. package/LICENSE +2 -2
  2. package/RUNTIME_HOST_PEER_DEPENDENCIES.rust.tsv +70 -0
  3. package/RUNTIME_HOST_PEER_THIRD_PARTY_NOTICES.txt +1839 -140
  4. package/THIRD_PARTY_NOTICES.txt +2 -2
  5. package/dist/acp/maka-acp-agent.js +6 -3
  6. package/dist/acp/session-registry.js +307 -0
  7. package/dist/acp/stdio-server.js +20 -1
  8. package/dist/cli-core.js +40 -3
  9. package/dist/mcp-capability-provider.js +1 -1
  10. package/dist/onboarding-catalog.js +3 -5
  11. package/dist/pi-transcript.js +21 -17
  12. package/dist/pi-tui-layout.js +4 -2
  13. package/dist/pi-tui-mcp-status.js +44 -130
  14. package/dist/pi-tui-pickers.js +11 -5
  15. package/dist/pi-tui-runner.js +133 -102
  16. package/dist/runtime-host-access-command.js +37 -4
  17. package/dist/runtime-host-capability-provider-command.js +16 -2
  18. package/dist/runtime-host-cli-context.js +73 -3
  19. package/dist/runtime-host-cli.js +187 -10
  20. package/dist/runtime-host-lifecycle-transaction.js +5 -2
  21. package/dist/runtime-host-managed-lifecycle-manager.js +1 -0
  22. package/dist/runtime-host-onboarding.js +12 -16
  23. package/dist/runtime-host-peer-management-command.js +16 -4
  24. package/dist/runtime-host-plugin-command.js +101 -0
  25. package/dist/runtime-host-run-command.js +8 -2
  26. package/dist/runtime-host-service-management-command.js +2 -1
  27. package/dist/runtime-host-setup-command.js +1 -0
  28. package/dist/runtime-host-task-readiness.js +2 -3
  29. package/dist/runtime-host-tui-command.js +1 -1
  30. package/dist/runtime-host-tui-context.js +18 -5
  31. package/dist/runtime-host-update-command.js +71 -35
  32. package/dist/runtime-host-update-discovery.js +1 -0
  33. package/dist/tui-clipboard.js +86 -0
  34. package/dist/tui-copy-catalog.js +248 -0
  35. package/dist/tui-copy-command.js +103 -0
  36. package/native/runtime-host-peer/prebuilds/darwin-arm64/maka_runtime_host_peer.node +0 -0
  37. package/native/runtime-host-peer/prebuilds/linux-arm64/maka_runtime_host_peer.node +0 -0
  38. package/native/runtime-host-peer/prebuilds/linux-x64/maka_runtime_host_peer.node +0 -0
  39. package/native/runtime-host-peer/prebuilds/win32-x64/maka_runtime_host_peer.node +0 -0
  40. package/node_modules/@maka/core/dist/attachments.js +92 -1
  41. package/node_modules/@maka/core/dist/bounded-response.js +71 -0
  42. package/node_modules/@maka/core/dist/chat-model-choice.js +8 -33
  43. package/node_modules/@maka/core/dist/client-capability-grant.js +149 -0
  44. package/node_modules/@maka/core/dist/connection-error-copy.js +17 -34
  45. package/node_modules/@maka/core/dist/connection-readiness.js +3 -31
  46. package/node_modules/@maka/core/dist/deep-research.js +1 -20
  47. package/node_modules/@maka/core/dist/events.js +22 -14
  48. package/node_modules/@maka/core/dist/foreign-session.js +2 -2
  49. package/node_modules/@maka/core/dist/interaction.js +49 -2
  50. package/node_modules/@maka/core/dist/llm-connections.js +74 -82
  51. package/node_modules/@maka/core/dist/maka-wordmark.js +23 -0
  52. package/node_modules/@maka/core/dist/model-catalog.js +242 -315
  53. package/node_modules/@maka/core/dist/model-facts.js +13 -19
  54. package/node_modules/@maka/core/dist/model-metadata.generated.js +1907 -1872
  55. package/node_modules/@maka/core/dist/model-metadata.js +184 -199
  56. package/node_modules/@maka/core/dist/model-thinking.js +1 -1
  57. package/node_modules/@maka/core/dist/models-dev-projection.js +302 -0
  58. package/node_modules/@maka/core/dist/models-dev-refresh.js +55 -0
  59. package/node_modules/@maka/core/dist/onboarding.js +2 -1
  60. package/node_modules/@maka/core/dist/provider-auth.js +47 -291
  61. package/node_modules/@maka/core/dist/provider-registry.js +68 -357
  62. package/node_modules/@maka/core/dist/runtime-event.js +5 -0
  63. package/node_modules/@maka/core/dist/runtime-policy/connection-catalog-codec.js +83 -18
  64. package/node_modules/@maka/core/dist/runtime-policy/credential-vault-codec.js +9 -1
  65. package/node_modules/@maka/core/dist/runtime-policy/model-catalog-entry-codec.js +84 -0
  66. package/node_modules/@maka/core/dist/runtime-policy/policy-codec.js +75 -0
  67. package/node_modules/@maka/core/dist/runtime-policy.js +5 -2
  68. package/node_modules/@maka/core/dist/session-send-projection.js +2 -1
  69. package/node_modules/@maka/core/dist/session-start-mode.js +42 -0
  70. package/node_modules/@maka/core/dist/session.js +120 -5
  71. package/node_modules/@maka/core/dist/settings.js +10 -2
  72. package/node_modules/@maka/core/dist/slash-command-catalog.js +1 -0
  73. package/node_modules/@maka/core/dist/task-submission-readiness.js +2 -1
  74. package/node_modules/@maka/core/dist/usage-record-schema.js +11 -1
  75. package/node_modules/@maka/core/dist/workhub-creation-intent.js +896 -0
  76. package/node_modules/@maka/core/package.json +8 -2
  77. package/node_modules/@maka/mcp/dist/index.js +1 -0
  78. package/node_modules/@maka/runtime/dist/agent-run.js +7 -0
  79. package/node_modules/@maka/runtime/dist/ai-sdk-backend.js +55 -82
  80. package/node_modules/@maka/runtime/dist/ai-sdk-compaction.js +178 -140
  81. package/node_modules/@maka/runtime/dist/archive-read-tool.js +26 -5
  82. package/node_modules/@maka/runtime/dist/builtin-tools.js +27 -2
  83. package/node_modules/@maka/runtime/dist/context-budget-policy.js +0 -12
  84. package/node_modules/@maka/runtime/dist/conversation-copy.js +66 -43
  85. package/node_modules/@maka/runtime/dist/durable-tool-result-projection.js +31 -0
  86. package/node_modules/@maka/runtime/dist/history-compact-error.js +10 -2
  87. package/node_modules/@maka/runtime/dist/history-compact-input-fit.js +7 -1
  88. package/node_modules/@maka/runtime/dist/history-compaction.js +13 -22
  89. package/node_modules/@maka/runtime/dist/image-file.js +5 -20
  90. package/node_modules/@maka/runtime/dist/local-web-fetch.js +2 -43
  91. package/node_modules/@maka/runtime/dist/mcp-tools.js +28 -0
  92. package/node_modules/@maka/runtime/dist/model-fetcher.js +15 -8
  93. package/node_modules/@maka/runtime/dist/model-history.js +59 -17
  94. package/node_modules/@maka/runtime/dist/model-runtime.js +2 -2
  95. package/node_modules/@maka/runtime/dist/plugin-composition-loader.js +173 -20
  96. package/node_modules/@maka/runtime/dist/plugin-runtime.js +219 -0
  97. package/node_modules/@maka/runtime/dist/provider-image-overflow-recovery.js +12 -31
  98. package/node_modules/@maka/runtime/dist/quiescent-session-snapshot.js +78 -0
  99. package/node_modules/@maka/runtime/dist/runtime-event-backfill.js +6 -0
  100. package/node_modules/@maka/runtime/dist/runtime-event-read-model.js +14 -2
  101. package/node_modules/@maka/runtime/dist/session-event-runtime-mapper.js +11 -10
  102. package/node_modules/@maka/runtime/dist/shell-tools.js +77 -1
  103. package/node_modules/@maka/runtime/dist/telemetry/model-pricing.generated.js +93 -83
  104. package/node_modules/@maka/runtime/dist/test-connection.js +6 -6
  105. package/node_modules/@maka/runtime/dist/tool-availability.js +74 -5
  106. package/node_modules/@maka/runtime/dist/tool-result-archive-resource.js +333 -52
  107. package/node_modules/@maka/runtime/dist/tool-result-archive-transition.js +34 -3
  108. package/node_modules/@maka/runtime/dist/tool-runtime.js +62 -6
  109. package/node_modules/@maka/runtime/dist/workers/filesystem-worker.js +39 -16
  110. package/node_modules/@maka/runtime/package.json +1 -0
  111. package/node_modules/@maka/runtime-host/dist/adapter/session-projector.js +10 -3
  112. package/node_modules/@maka/runtime-host/dist/client/catalog-reader.js +59 -18
  113. package/node_modules/@maka/runtime-host/dist/client/client-capability-channel.js +3 -2
  114. package/node_modules/@maka/runtime-host/dist/client/connection.js +72 -31
  115. package/node_modules/@maka/runtime-host/dist/client/host-profile.js +49 -4
  116. package/node_modules/@maka/runtime-host/dist/client/index.js +3 -2
  117. package/node_modules/@maka/runtime-host/dist/client/oauth-presentation.js +1 -1
  118. package/node_modules/@maka/runtime-host/dist/client/owner-connection-code.js +32 -1
  119. package/node_modules/@maka/runtime-host/dist/client/peer-client.js +26 -4
  120. package/node_modules/@maka/runtime-host/dist/client/reconnecting-connection.js +8 -0
  121. package/node_modules/@maka/runtime-host/dist/operator/access-management-frame.js +10 -1
  122. package/node_modules/@maka/runtime-host/dist/operator/index.js +2 -1
  123. package/node_modules/@maka/runtime-host/dist/operator/managed-deployment.js +2 -0
  124. package/node_modules/@maka/runtime-host/dist/operator/peer-management-frame.js +2 -0
  125. package/node_modules/@maka/runtime-host/dist/operator/service-management-frame.js +2 -0
  126. package/node_modules/@maka/runtime-host/dist/peer-mesh/node.js +56 -12
  127. package/node_modules/@maka/runtime-host/dist/peer-mesh/owner.js +4 -0
  128. package/node_modules/@maka/runtime-host/dist/protocol/client-capability.js +22 -1
  129. package/node_modules/@maka/runtime-host/dist/protocol/configuration.js +55 -9
  130. package/node_modules/@maka/{storage/dist/task-ledger-store-internal.js → runtime-host/dist/protocol/connection-catalog-change.js} +7 -13
  131. package/node_modules/@maka/runtime-host/dist/protocol/host-status.js +37 -0
  132. package/node_modules/@maka/runtime-host/dist/protocol/index.js +49 -1
  133. package/node_modules/@maka/runtime-host/dist/protocol/network-proxy.js +1 -7
  134. package/node_modules/@maka/runtime-host/dist/protocol/operations.js +5 -1
  135. package/node_modules/@maka/runtime-host/dist/protocol/plugin-platform.js +512 -0
  136. package/node_modules/@maka/runtime-host/dist/protocol/runtime-policy.js +72 -61
  137. package/node_modules/@maka/runtime-host/dist/protocol/session-catalog.js +1 -1
  138. package/node_modules/@maka/runtime-host/dist/protocol/session-collaboration.js +4 -2
  139. package/node_modules/@maka/runtime-host/dist/protocol/turn.js +5 -12
  140. package/node_modules/@maka/runtime-host/dist/protocol/workhub-coordination.js +92 -4
  141. package/node_modules/@maka/runtime-host/dist/server/access-authority.js +17 -14
  142. package/node_modules/@maka/runtime-host/dist/server/access-credential-metadata.js +4 -2
  143. package/node_modules/@maka/runtime-host/dist/server/access-credential-store.js +119 -47
  144. package/node_modules/@maka/runtime-host/dist/server/agent-graph-execution-coordinator.js +1 -2
  145. package/node_modules/@maka/runtime-host/dist/server/bootstrap-runtime-policy.js +10 -4
  146. package/node_modules/@maka/runtime-host/dist/server/canonical-turn-snapshot.js +0 -9
  147. package/node_modules/@maka/runtime-host/dist/server/client-capability-coordinator.js +192 -18
  148. package/node_modules/@maka/runtime-host/dist/server/client-capability-invocation-broker.js +122 -48
  149. package/node_modules/@maka/runtime-host/dist/server/client-capability-provider-id.js +31 -0
  150. package/node_modules/@maka/runtime-host/dist/server/configuration-coordinator.js +20 -1
  151. package/node_modules/@maka/runtime-host/dist/server/connection-effect-coordinator.js +5 -5
  152. package/node_modules/@maka/runtime-host/dist/server/connection-session.js +1 -0
  153. package/node_modules/@maka/runtime-host/dist/server/execution-composition.js +163 -28
  154. package/node_modules/@maka/runtime-host/dist/server/execution-model-authority.js +2 -2
  155. package/node_modules/@maka/runtime-host/dist/server/execution-service.js +4 -1
  156. package/node_modules/@maka/runtime-host/dist/server/extension-bundle.js +249 -0
  157. package/node_modules/@maka/runtime-host/dist/server/extension-package-manifest.js +262 -0
  158. package/node_modules/@maka/runtime-host/dist/server/host-change-feed.js +11 -0
  159. package/node_modules/@maka/runtime-host/dist/server/host-kernel.js +15 -0
  160. package/node_modules/@maka/runtime-host/dist/server/index.js +5 -0
  161. package/node_modules/@maka/runtime-host/dist/server/interaction-coordinator.js +181 -13
  162. package/node_modules/@maka/runtime-host/dist/server/interaction-projection.js +6 -0
  163. package/node_modules/@maka/runtime-host/dist/server/listener-set.js +8 -4
  164. package/node_modules/@maka/runtime-host/dist/server/message-coordinator.js +88 -22
  165. package/node_modules/@maka/runtime-host/dist/server/model-metadata-refresh.js +96 -0
  166. package/node_modules/@maka/runtime-host/dist/server/network-proxy-coordinator.js +0 -1
  167. package/node_modules/@maka/runtime-host/dist/server/operation-dispatcher.js +43 -118
  168. package/node_modules/@maka/runtime-host/dist/server/peer-listener.js +3 -0
  169. package/node_modules/@maka/runtime-host/dist/server/plugin-composition-patch.js +58 -0
  170. package/node_modules/@maka/runtime-host/dist/server/plugin-composition-store.js +141 -0
  171. package/node_modules/@maka/runtime-host/dist/server/plugin-package-loader.js +130 -0
  172. package/node_modules/@maka/runtime-host/dist/server/plugin-package-store.js +528 -0
  173. package/node_modules/@maka/runtime-host/dist/server/plugin-platform-coordinator.js +249 -0
  174. package/node_modules/@maka/runtime-host/dist/server/plugin-platform.js +1130 -0
  175. package/node_modules/@maka/runtime-host/dist/server/root-admission-owner.js +4 -0
  176. package/node_modules/@maka/runtime-host/dist/server/root-turn-coordinator.js +24 -5
  177. package/node_modules/@maka/runtime-host/dist/server/runtime-policy-coordinator.js +57 -5
  178. package/node_modules/@maka/runtime-host/dist/server/session-catalog-coordinator.js +2 -1
  179. package/node_modules/@maka/runtime-host/dist/server/session-retirement-coordinator.js +3 -3
  180. package/node_modules/@maka/runtime-host/dist/server/session-revision-coordinator.js +35 -3
  181. package/node_modules/@maka/runtime-host/dist/server/session-sidecar-purge.js +16 -0
  182. package/node_modules/@maka/runtime-host/dist/server/session-transcript-pager.js +10 -2
  183. package/node_modules/@maka/runtime-host/dist/server/web-fetch-tool.js +1 -1
  184. package/node_modules/@maka/runtime-host/dist/server/workhub-coordination-action-gate.js +276 -3
  185. package/node_modules/@maka/runtime-host/dist/server/workhub-coordination-coordinator.js +101 -1
  186. package/node_modules/@maka/runtime-host/dist/transport/peer-native.js +1 -0
  187. package/node_modules/@maka/runtime-host/dist/webrtc-stun-policy.js +114 -0
  188. package/node_modules/@maka/runtime-host/package.json +2 -0
  189. package/node_modules/@maka/storage/dist/agent-run-store.js +4 -0
  190. package/node_modules/@maka/storage/dist/artifact-store.js +7 -23
  191. package/node_modules/@maka/storage/dist/conversation-operational-state.js +3 -0
  192. package/node_modules/@maka/storage/dist/execution-stores.js +3 -0
  193. package/node_modules/@maka/storage/dist/interaction-store-public.js +1 -1
  194. package/node_modules/@maka/storage/dist/interaction-store.js +173 -0
  195. package/node_modules/@maka/storage/dist/production-session-snapshot.js +761 -0
  196. package/node_modules/@maka/storage/dist/quiescent-session-snapshot.js +1 -1
  197. package/node_modules/@maka/storage/dist/runtime-policy/connection-catalog-document.js +19 -22
  198. package/node_modules/@maka/storage/dist/runtime-policy/coordinator.js +205 -42
  199. package/node_modules/@maka/storage/dist/runtime-policy/onboarding-transaction.js +2 -2
  200. package/node_modules/@maka/storage/dist/runtime-policy-stores.js +5 -2
  201. package/node_modules/@maka/storage/dist/session-message-projection.js +1 -1
  202. package/node_modules/@maka/storage/dist/session-store.js +32 -6
  203. package/node_modules/@maka/storage/dist/session-todo-store.js +6 -68
  204. package/node_modules/@maka/storage/dist/settings-store.js +16 -25
  205. package/node_modules/@maka/storage/dist/sqlite-core-execution-schema.js +19 -0
  206. package/node_modules/@maka/storage/dist/sqlite-session-metadata-schema.js +10 -1
  207. package/node_modules/@maka/storage/dist/sqlite-session-metadata-store.js +73 -3
  208. package/node_modules/@maka/storage/dist/sqlite-workflow-schema.js +2 -10
  209. package/node_modules/@maka/storage/package.json +2 -0
  210. package/node_modules/fast-uri/index.js +215 -47
  211. package/node_modules/fast-uri/lib/schemes.js +9 -4
  212. package/node_modules/fast-uri/lib/utils.js +396 -92
  213. package/node_modules/fast-uri/package.json +1 -1
  214. package/node_modules/qs/.github/THREAT_MODEL.md +3 -3
  215. package/node_modules/qs/CHANGELOG.md +15 -0
  216. package/node_modules/qs/README.md +19 -1
  217. package/node_modules/qs/dist/qs.js +21 -21
  218. package/node_modules/qs/eslint.config.mjs +1 -1
  219. package/node_modules/qs/lib/parse.js +3 -4
  220. package/node_modules/qs/lib/stringify.js +23 -8
  221. package/node_modules/qs/lib/utils.js +10 -3
  222. package/node_modules/qs/package.json +4 -4
  223. package/package.json +1 -1
  224. package/node_modules/@maka/core/dist/task-ledger.js +0 -669
  225. package/node_modules/@maka/storage/dist/task-ledger-authority.js +0 -121
  226. package/node_modules/@maka/storage/dist/task-ledger-store.js +0 -663
@@ -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
  }
@@ -222,7 +222,7 @@ export class McpManagementOverlay {
222
222
  startEdit(serverId) {
223
223
  const edit = this.management()?.configForEdit(serverId);
224
224
  if (!edit) {
225
- this.notice = { level: 'error', text: copy(this.input.locale, 'missing') };
225
+ this.notice = { level: 'error', text: resultCopy(this.input.locale, 'missing') };
226
226
  return;
227
227
  }
228
228
  this.startInput('edit', undefined, serverId, edit.revision, JSON.stringify(edit.config, null, 2));
@@ -324,7 +324,7 @@ export class McpManagementOverlay {
324
324
  this.notice = undefined;
325
325
  }
326
326
  catch {
327
- this.notice = { level: 'error', text: copy(this.input.locale, 'invalid') };
327
+ this.notice = { level: 'error', text: resultCopy(this.input.locale, 'invalid') };
328
328
  }
329
329
  this.input.onChange();
330
330
  }
@@ -334,7 +334,7 @@ export class McpManagementOverlay {
334
334
  return;
335
335
  if (this.input.canManage && !this.input.canManage()) {
336
336
  this.backToList(false);
337
- this.notice = { level: 'error', text: copy(this.input.locale, 'turn_active') };
337
+ this.notice = { level: 'error', text: resultCopy(this.input.locale, 'turn_active') };
338
338
  this.input.onChange();
339
339
  return;
340
340
  }
@@ -362,30 +362,15 @@ export class McpManagementOverlay {
362
362
  return unavailableDocument(this.input.locale);
363
363
  if (this.phase.kind === 'input')
364
364
  return this.inputDocument(width);
365
+ const editor = MCP_STATUS_COPY[this.input.locale].editor;
365
366
  if (this.phase.kind === 'add_choice') {
366
- return [
367
- heading(this.input.locale, 'Add MCP server', '添加 MCP 服务器'),
368
- '',
369
- 'g Guided setup',
370
- 'j Paste JSON',
371
- ];
367
+ return [ansi.bold(editor.addTitle), '', 'g Guided setup', 'j Paste JSON'];
372
368
  }
373
369
  if (this.phase.kind === 'transport') {
374
- return [
375
- heading(this.input.locale, 'Transport', '传输方式'),
376
- '',
377
- '1 stdio',
378
- '2 Streamable HTTP',
379
- ];
370
+ return [ansi.bold(editor.transportTitle), '', '1 stdio', '2 Streamable HTTP'];
380
371
  }
381
372
  if (this.phase.kind === 'protocol') {
382
- return [
383
- heading(this.input.locale, 'Protocol preference', '协议偏好'),
384
- '',
385
- '1 legacy',
386
- '2 auto',
387
- '3 2026-07-28',
388
- ];
373
+ return [ansi.bold(editor.protocolTitle), '', '1 legacy', '2 auto', '3 2026-07-28'];
389
374
  }
390
375
  if (this.phase.kind === 'confirm_add') {
391
376
  return confirmAddDocument(this.phase.draft, this.input.locale);
@@ -395,20 +380,18 @@ export class McpManagementOverlay {
395
380
  }
396
381
  if (this.phase.kind === 'confirm_remove') {
397
382
  return [
398
- 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))),
399
384
  '',
400
- confirmCopy(this.input.locale),
385
+ editor.confirmHint,
401
386
  ];
402
387
  }
403
388
  if (this.phase.kind === 'confirm_remove_publication_credential') {
404
389
  return [
405
- heading(this.input.locale, 'Remove the remote provider credential?', '删除远程 Provider 凭据?'),
390
+ ansi.bold(editor.confirmRemoveCredentialTitle),
406
391
  '',
407
- this.input.locale === 'zh'
408
- ? '这会停止向所选 Runtime Host 发布 MCP 工具。'
409
- : 'This stops publishing MCP tools to the selected Runtime Host.',
392
+ editor.confirmRemoveCredentialDetail,
410
393
  '',
411
- confirmCopy(this.input.locale),
394
+ editor.confirmHint,
412
395
  ];
413
396
  }
414
397
  if (this.phase.kind === 'busy')
@@ -613,152 +596,83 @@ function serverLines(server, locale, selected) {
613
596
  ];
614
597
  }
615
598
  function actionNotice(result, locale) {
616
- if (result.status === 'conflict')
617
- return { level: 'error', text: copy(locale, result.reason) };
618
- if (result.status === 'failed')
619
- 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
+ }
620
602
  if (result.status === 'tested') {
621
603
  if (result.test.ok && result.effect === 'publication_failed') {
622
- return { level: 'error', text: copy(locale, 'test_publication_failed') };
604
+ return { level: 'error', text: resultCopy(locale, 'test_publication_failed') };
623
605
  }
624
606
  if (result.test.ok && result.effect === 'pending_host') {
625
- return { level: 'info', text: copy(locale, 'test_pending_host') };
607
+ return { level: 'info', text: resultCopy(locale, 'test_pending_host') };
626
608
  }
627
609
  return {
628
610
  level: result.test.ok ? 'info' : 'error',
629
- 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'),
630
612
  };
631
613
  }
632
614
  return {
633
615
  level: result.effect === 'sync_failed' || result.effect === 'publication_failed' ? 'error' : 'info',
634
- text: copy(locale, result.effect),
616
+ text: resultCopy(locale, result.effect),
635
617
  };
636
618
  }
637
- function copy(locale, key) {
638
- const en = {
639
- exists: 'That server ID already exists.',
640
- stale_config: 'MCP configuration changed; retry the action.',
641
- stale_edit: 'This server changed; reopen it before editing.',
642
- stale_import: 'An imported entry changed; preview the import again.',
643
- missing: 'That server no longer exists.',
644
- closed: 'The MCP controller is closed.',
645
- 'invalid-config': 'The server configuration is invalid.',
646
- 'credential-cleanup-failed': 'Stored credentials could not be removed; the configuration was not changed.',
647
- 'publication-credential-failed': 'The provider credential could not be stored or applied.',
648
- 'persist-failed': 'The configuration could not be saved.',
649
- 'manager-failed': 'The MCP connection action failed.',
650
- turn_active: 'MCP cannot be changed while a turn or another control action is running.',
651
- invalid: 'Check the value and try again.',
652
- published: 'Configuration saved and tools refreshed.',
653
- pending_host: 'Configuration saved; publication is waiting for Runtime Host.',
654
- sync_failed: 'Configuration saved, but the MCP manager is out of sync.',
655
- publication_failed: 'Configuration saved, but capability publication failed.',
656
- test_ok: 'Connection test passed.',
657
- test_failed: 'Connection test failed.',
658
- test_publication_failed: 'Connection test passed, but capability publication failed.',
659
- test_pending_host: 'Connection test passed; publication is waiting for Runtime Host.',
660
- };
661
- const zh = {
662
- exists: '该服务器 ID 已存在。',
663
- stale_config: 'MCP 配置已变化,请重试。',
664
- stale_edit: '该服务器已变化,请重新打开后编辑。',
665
- stale_import: '导入项已变化,请重新预览。',
666
- missing: '该服务器已不存在。',
667
- closed: 'MCP 控制器已关闭。',
668
- 'invalid-config': '服务器配置无效。',
669
- 'credential-cleanup-failed': '无法删除旧凭据,配置未修改。',
670
- 'publication-credential-failed': '无法保存或应用 Provider 凭据。',
671
- 'persist-failed': '无法保存配置。',
672
- 'manager-failed': 'MCP 连接操作失败。',
673
- turn_active: 'Turn 或其他控制操作运行期间不能修改 MCP。',
674
- invalid: '请检查输入后重试。',
675
- published: '配置已保存,工具已刷新。',
676
- pending_host: '配置已保存,正等待 Runtime Host 发布。',
677
- sync_failed: '配置已保存,但 MCP Manager 尚未同步。',
678
- publication_failed: '配置已保存,但 capability 发布失败。',
679
- test_ok: '连接测试通过。',
680
- test_failed: '连接测试失败。',
681
- test_publication_failed: '连接测试通过,但 capability 发布失败。',
682
- test_pending_host: '连接测试通过,正等待 Runtime Host 发布。',
683
- };
684
- return (locale === 'zh' ? zh : en)[key] ?? key;
619
+ function resultCopy(locale, code) {
620
+ return MCP_STATUS_COPY[locale].editor.results[code];
685
621
  }
686
622
  function confirmAddDocument(draft, locale) {
623
+ const editor = MCP_STATUS_COPY[locale].editor;
687
624
  return [
688
- heading(locale, 'Add this MCP server?', '添加该 MCP 服务器?'),
625
+ ansi.bold(editor.confirmAddTitle),
689
626
  '',
690
627
  `${draft.serverId} · ${draft.transport} · ${draft.protocol}`,
691
628
  draft.transport === 'stdio' ? (draft.command ?? '') : (draft.url ?? ''),
692
629
  '',
693
- confirmCopy(locale),
630
+ editor.confirmHint,
694
631
  ];
695
632
  }
696
633
  function confirmImportDocument(preview, locale) {
634
+ const editor = MCP_STATUS_COPY[locale].editor;
697
635
  return [
698
- heading(locale, 'Import MCP servers?', '导入 MCP 服务器?'),
636
+ ansi.bold(editor.confirmImportTitle),
699
637
  '',
700
638
  ...preview.entries.map((entry) => `${entry.change === 'add' ? '+' : '~'} ${entry.serverId} · ${entry.transport} · ${entry.protocol}`),
701
639
  '',
702
- confirmCopy(locale),
640
+ editor.confirmHint,
703
641
  ];
704
642
  }
705
643
  function actionLabel(action, locale) {
706
- if (locale === 'zh')
707
- return '正在应用 MCP 更改…';
644
+ const labels = MCP_STATUS_COPY[locale].editor.action;
708
645
  if (action.kind === 'test')
709
- return 'Testing MCP server…';
646
+ return labels.test;
710
647
  if (action.kind === 'reconnect')
711
- return 'Reconnecting MCP server…';
712
- return 'Applying MCP configuration…';
648
+ return labels.reconnect;
649
+ return labels.apply;
713
650
  }
714
651
  function inputLabel(kind, locale) {
715
- const labels = {
716
- server_id: ['Server ID', '服务器 ID'],
717
- command: ['Command', '命令'],
718
- args: ['Arguments', '参数'],
719
- url: ['Streamable HTTP URL', 'Streamable HTTP URL'],
720
- cwd: ['Working directory', '工作目录'],
721
- env: ['Environment', '环境变量'],
722
- headers: ['Request headers', '请求头'],
723
- edit: ['Edit server JSON', '编辑服务器 JSON'],
724
- import: ['Paste MCP JSON', '粘贴 MCP JSON'],
725
- publication_credential: ['Provider credential', 'Provider 凭据'],
726
- };
727
- return labels[kind][locale === 'zh' ? 1 : 0];
652
+ return MCP_STATUS_COPY[locale].editor.inputLabels[kind];
728
653
  }
729
654
  function inputHint(kind, locale) {
730
- const optional = locale === 'zh' ? '可留空' : 'optional';
655
+ const hints = MCP_STATUS_COPY[locale].editor.hints;
731
656
  if (kind === 'args')
732
- return `JSON string array, ${optional}`;
657
+ return hints.args;
733
658
  if (kind === 'env' || kind === 'headers')
734
- return `JSON string map, ${optional}`;
659
+ return hints.map;
735
660
  if (kind === 'cwd')
736
- return optional;
737
- if (kind === 'publication_credential') {
738
- return locale === 'zh'
739
- ? '仅保存到本机凭据存储;不会写入 profile、参数或对话 · Enter 提交 · Esc 返回'
740
- : 'Stored only in the local credential store; never written to profiles, arguments, or chat · Enter submit · Esc back';
741
- }
742
- 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;
743
665
  }
744
666
  function configurationLine(state, locale) {
745
- if (state === 'synchronizing') {
746
- return locale === 'zh' ? '配置同步中…' : 'Configuration is synchronizing…';
747
- }
748
- return ansi.red(locale === 'zh'
749
- ? '持久化配置与 MCP Manager 尚未同步。'
750
- : '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);
751
671
  }
752
672
  function unavailableDocument(locale) {
753
673
  const copy = MCP_STATUS_COPY[locale];
754
674
  return [ansi.yellow(copy.unavailableTitle), copy.unavailableDetail];
755
675
  }
756
- function heading(locale, en, zh) {
757
- return ansi.bold(locale === 'zh' ? zh : en);
758
- }
759
- function confirmCopy(locale) {
760
- return locale === 'zh' ? 'y 确认 · Esc 取消' : 'y Confirm · Esc cancel';
761
- }
762
676
  function loadingCopy(locale) {
763
677
  return MCP_STATUS_COPY[locale].loading;
764
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
  }