@celljs/ta-web 4.13.1 → 4.15.0

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 (149) hide show
  1. package/README.en.md +3 -3
  2. package/README.md +3 -3
  3. package/esm/browser/assistant/assistant-extension.js +3 -2
  4. package/esm/browser/assistant/assistant-initiative.js +1 -1
  5. package/esm/browser/assistant/assistant-state.js +2 -2
  6. package/esm/browser/components/access-view.js +3 -2
  7. package/esm/browser/components/account-menu.js +2 -2
  8. package/esm/browser/components/app-view.js +4 -0
  9. package/esm/browser/components/auth-view.d.ts +1 -1
  10. package/esm/browser/components/auth-view.js +38 -10
  11. package/esm/browser/components/chat-asks.d.ts +8 -0
  12. package/esm/browser/components/chat-asks.js +10 -0
  13. package/esm/browser/components/chat-list.js +11 -1
  14. package/esm/browser/components/composer-box.d.ts +2 -0
  15. package/esm/browser/components/composer-box.js +2 -1
  16. package/esm/browser/components/composer.d.ts +3 -1
  17. package/esm/browser/components/composer.js +16 -4
  18. package/esm/browser/components/custom-provider-advanced.d.ts +14 -0
  19. package/esm/browser/components/custom-provider-advanced.js +50 -0
  20. package/esm/browser/components/custom-provider-util.d.ts +38 -0
  21. package/esm/browser/components/custom-provider-util.js +103 -0
  22. package/esm/browser/components/custom-provider-view.d.ts +11 -0
  23. package/esm/browser/components/custom-provider-view.js +181 -0
  24. package/esm/browser/components/face.d.ts +13 -1
  25. package/esm/browser/components/face.js +16 -1
  26. package/esm/browser/components/host-view.d.ts +1 -1
  27. package/esm/browser/components/message-list.js +20 -1
  28. package/esm/browser/components/people.d.ts +32 -0
  29. package/esm/browser/components/people.js +71 -0
  30. package/esm/browser/components/session-view.d.ts +1 -1
  31. package/esm/browser/components/session-view.js +56 -36
  32. package/esm/browser/components/settings-choices.js +2 -3
  33. package/esm/browser/components/settings-controls.d.ts +7 -1
  34. package/esm/browser/components/settings-controls.js +8 -0
  35. package/esm/browser/components/settings-parts.js +25 -8
  36. package/esm/browser/components/sign-in-setup.d.ts +16 -0
  37. package/esm/browser/components/sign-in-setup.js +118 -0
  38. package/esm/browser/components/use-seen-chats.d.ts +2 -0
  39. package/esm/browser/components/use-seen-chats.js +2 -2
  40. package/esm/browser/editor/monaco-loader.js +7 -1
  41. package/esm/browser/extension/web-api-components.d.ts +12 -0
  42. package/esm/browser/extension/web-api-contributions.d.ts +3 -0
  43. package/esm/browser/extension/web-extension-api.d.ts +9 -2
  44. package/esm/browser/extension/web-extension-context.d.ts +2 -0
  45. package/esm/browser/extension/web-extension-context.js +19 -0
  46. package/esm/browser/game/game-loader.js +22 -2
  47. package/esm/browser/game/game3d-protocol.d.ts +13 -4
  48. package/esm/browser/i18n/locales.d.ts +90 -1
  49. package/esm/browser/i18n/locales.js +25 -1
  50. package/esm/browser/i18n/messages-ja.d.ts +2 -0
  51. package/esm/browser/i18n/messages-ja.js +972 -0
  52. package/esm/browser/i18n/messages-zh-tw.d.ts +3 -0
  53. package/esm/browser/i18n/messages-zh-tw.js +973 -0
  54. package/esm/browser/i18n/messages.d.ts +85 -0
  55. package/esm/browser/i18n/messages.js +171 -1
  56. package/esm/browser/i18n/use-t.js +3 -2
  57. package/esm/browser/presence/presence-reporter.d.ts +32 -0
  58. package/esm/browser/presence/presence-reporter.js +71 -0
  59. package/esm/browser/settings/settings-protocol.d.ts +3 -2
  60. package/esm/browser/settings/settings-protocol.js +4 -3
  61. package/esm/browser/style/conversation.d.ts +1 -1
  62. package/esm/browser/style/conversation.js +24 -0
  63. package/esm/browser/style/layout.d.ts +1 -1
  64. package/esm/browser/style/layout.js +8 -0
  65. package/esm/browser/style/pages.d.ts +1 -1
  66. package/esm/browser/style/pages.js +53 -1
  67. package/esm/browser/util/desktop.d.ts +12 -1
  68. package/esm/browser/util/desktop.js +14 -0
  69. package/esm/browser/util/voice.d.ts +20 -1
  70. package/esm/browser/util/voice.js +27 -11
  71. package/esm/browser/workbench-protocol.d.ts +9 -0
  72. package/esm/browser/workbench-util.d.ts +4 -0
  73. package/esm/browser/workbench-util.js +24 -1
  74. package/esm/browser/workbench.d.ts +3 -0
  75. package/esm/browser/workbench.js +14 -4
  76. package/lib/browser/assistant/assistant-extension.js +3 -2
  77. package/lib/browser/assistant/assistant-initiative.js +1 -1
  78. package/lib/browser/assistant/assistant-state.js +1 -1
  79. package/lib/browser/components/access-view.js +3 -2
  80. package/lib/browser/components/account-menu.js +2 -2
  81. package/lib/browser/components/app-view.js +4 -0
  82. package/lib/browser/components/auth-view.d.ts +1 -1
  83. package/lib/browser/components/auth-view.js +37 -9
  84. package/lib/browser/components/chat-asks.d.ts +8 -0
  85. package/lib/browser/components/chat-asks.js +10 -0
  86. package/lib/browser/components/chat-list.js +11 -1
  87. package/lib/browser/components/composer-box.d.ts +2 -0
  88. package/lib/browser/components/composer-box.js +2 -1
  89. package/lib/browser/components/composer.d.ts +3 -1
  90. package/lib/browser/components/composer.js +16 -4
  91. package/lib/browser/components/custom-provider-advanced.d.ts +15 -0
  92. package/lib/browser/components/custom-provider-advanced.js +86 -0
  93. package/lib/browser/components/custom-provider-util.d.ts +39 -0
  94. package/lib/browser/components/custom-provider-util.js +106 -0
  95. package/lib/browser/components/custom-provider-view.d.ts +12 -0
  96. package/lib/browser/components/custom-provider-view.js +217 -0
  97. package/lib/browser/components/face.d.ts +13 -1
  98. package/lib/browser/components/face.js +16 -1
  99. package/lib/browser/components/host-view.d.ts +1 -1
  100. package/lib/browser/components/message-list.js +19 -0
  101. package/lib/browser/components/people.d.ts +33 -0
  102. package/lib/browser/components/people.js +109 -0
  103. package/lib/browser/components/session-view.d.ts +1 -1
  104. package/lib/browser/components/session-view.js +56 -36
  105. package/lib/browser/components/settings-choices.js +1 -2
  106. package/lib/browser/components/settings-controls.d.ts +7 -1
  107. package/lib/browser/components/settings-controls.js +9 -0
  108. package/lib/browser/components/settings-parts.js +24 -7
  109. package/lib/browser/components/sign-in-setup.d.ts +17 -0
  110. package/lib/browser/components/sign-in-setup.js +155 -0
  111. package/lib/browser/components/use-seen-chats.d.ts +2 -0
  112. package/lib/browser/components/use-seen-chats.js +3 -2
  113. package/lib/browser/editor/monaco-loader.js +7 -1
  114. package/lib/browser/extension/web-api-components.d.ts +12 -0
  115. package/lib/browser/extension/web-api-contributions.d.ts +3 -0
  116. package/lib/browser/extension/web-extension-api.d.ts +9 -2
  117. package/lib/browser/extension/web-extension-context.d.ts +2 -0
  118. package/lib/browser/extension/web-extension-context.js +19 -0
  119. package/lib/browser/game/game-loader.js +22 -2
  120. package/lib/browser/game/game3d-protocol.d.ts +13 -4
  121. package/lib/browser/i18n/locales.d.ts +90 -1
  122. package/lib/browser/i18n/locales.js +25 -1
  123. package/lib/browser/i18n/messages-ja.d.ts +3 -0
  124. package/lib/browser/i18n/messages-ja.js +975 -0
  125. package/lib/browser/i18n/messages-zh-tw.d.ts +4 -0
  126. package/lib/browser/i18n/messages-zh-tw.js +976 -0
  127. package/lib/browser/i18n/messages.d.ts +85 -0
  128. package/lib/browser/i18n/messages.js +174 -2
  129. package/lib/browser/i18n/use-t.js +2 -1
  130. package/lib/browser/presence/presence-reporter.d.ts +33 -0
  131. package/lib/browser/presence/presence-reporter.js +75 -0
  132. package/lib/browser/settings/settings-protocol.d.ts +3 -2
  133. package/lib/browser/settings/settings-protocol.js +4 -3
  134. package/lib/browser/style/conversation.d.ts +1 -1
  135. package/lib/browser/style/conversation.js +24 -0
  136. package/lib/browser/style/layout.d.ts +1 -1
  137. package/lib/browser/style/layout.js +8 -0
  138. package/lib/browser/style/pages.d.ts +1 -1
  139. package/lib/browser/style/pages.js +53 -1
  140. package/lib/browser/util/desktop.d.ts +12 -1
  141. package/lib/browser/util/desktop.js +14 -0
  142. package/lib/browser/util/voice.d.ts +20 -1
  143. package/lib/browser/util/voice.js +27 -11
  144. package/lib/browser/workbench-protocol.d.ts +9 -0
  145. package/lib/browser/workbench-util.d.ts +4 -0
  146. package/lib/browser/workbench-util.js +24 -1
  147. package/lib/browser/workbench.d.ts +3 -0
  148. package/lib/browser/workbench.js +14 -4
  149. package/package.json +10 -10
@@ -1,3 +1,6 @@
1
+ import { type TaLanguage } from '@celljs/ta-protocol';
2
+ import { JA_MESSAGES } from './messages-ja.js';
3
+ import { ZH_TW_MESSAGES } from './messages-zh-tw.js';
1
4
  /** The messages of the web client, in ICU format. English is the source and the fallback. */
2
5
  export declare const EN_MESSAGES: {
3
6
  'ta.dismiss': string;
@@ -156,6 +159,34 @@ export declare const EN_MESSAGES: {
156
159
  'ta.access.thisBrowser': string;
157
160
  'ta.access.lastUsed': string;
158
161
  'ta.access.signOut': string;
162
+ 'ta.signInSetup.title': string;
163
+ 'ta.signInSetup.hint': string;
164
+ 'ta.signInSetup.callback': string;
165
+ 'ta.signInSetup.copy': string;
166
+ 'ta.signInSetup.copied': string;
167
+ 'ta.signInSetup.oidc': string;
168
+ 'ta.signInSetup.on': string;
169
+ 'ta.signInSetup.off': string;
170
+ 'ta.signInSetup.device': string;
171
+ 'ta.signInSetup.incomplete': string;
172
+ 'ta.signInSetup.fromEnv': string;
173
+ 'ta.signInSetup.add': string;
174
+ 'ta.signInSetup.edit': string;
175
+ 'ta.signInSetup.save': string;
176
+ 'ta.signInSetup.saved': string;
177
+ 'ta.signInSetup.removed': string;
178
+ 'ta.signInSetup.remove': string;
179
+ 'ta.signInSetup.removeConfirm': string;
180
+ 'ta.signInSetup.removeDetail': string;
181
+ 'ta.signInSetup.secretKept': string;
182
+ 'ta.signInSetup.optional': string;
183
+ 'ta.signInSetup.field.clientId': string;
184
+ 'ta.signInSetup.field.clientSecret': string;
185
+ 'ta.signInSetup.field.appId': string;
186
+ 'ta.signInSetup.field.appSecret': string;
187
+ 'ta.signInSetup.field.url': string;
188
+ 'ta.signInSetup.field.issuer': string;
189
+ 'ta.signInSetup.field.name': string;
159
190
  'ta.sidebar.closeTitle': string;
160
191
  'ta.chat.open': string;
161
192
  'ta.chat.remove': string;
@@ -618,6 +649,13 @@ export declare const EN_MESSAGES: {
618
649
  'ta.composer.queue.takeBackTitle': string;
619
650
  'ta.composer.queue.editTitle': string;
620
651
  'ta.composer.queue.remove': string;
652
+ 'ta.presence.viewing': string;
653
+ 'ta.presence.typing': string;
654
+ 'ta.presence.asked': string;
655
+ 'ta.presence.separator': string;
656
+ 'ta.presence.more': string;
657
+ 'ta.presence.owner': string;
658
+ 'ta.chat.replyingFor': string;
621
659
  'ta.account': string;
622
660
  'ta.account.service': string;
623
661
  'ta.manage.packages': string;
@@ -884,6 +922,48 @@ export declare const EN_MESSAGES: {
884
922
  'ta.auth.none': string;
885
923
  'ta.auth.search': string;
886
924
  'ta.auth.accountsTitle': string;
925
+ 'ta.auth.custom.add': string;
926
+ 'ta.auth.custom.addHint': string;
927
+ 'ta.auth.custom.title': string;
928
+ 'ta.auth.custom.kind': string;
929
+ 'ta.auth.custom.api': string;
930
+ 'ta.auth.custom.apiOpenai': string;
931
+ 'ta.auth.custom.apiResponses': string;
932
+ 'ta.auth.custom.apiAnthropic': string;
933
+ 'ta.auth.custom.apiGoogle': string;
934
+ 'ta.auth.custom.baseUrl': string;
935
+ 'ta.auth.custom.apiKey': string;
936
+ 'ta.auth.custom.keyKept': string;
937
+ 'ta.auth.custom.keyOptional': string;
938
+ 'ta.auth.custom.name': string;
939
+ 'ta.auth.custom.optional': string;
940
+ 'ta.auth.custom.models': string;
941
+ 'ta.auth.custom.modelPlaceholder': string;
942
+ 'ta.auth.custom.removeModel': string;
943
+ 'ta.auth.custom.fetch': string;
944
+ 'ta.auth.custom.fetched': string;
945
+ 'ta.auth.custom.fetchedNone': string;
946
+ 'ta.auth.custom.fetchFailed': string;
947
+ 'ta.auth.custom.filter': string;
948
+ 'ta.auth.custom.note': string;
949
+ 'ta.auth.custom.needModel': string;
950
+ 'ta.auth.custom.save': string;
951
+ 'ta.auth.custom.saved': string;
952
+ 'ta.auth.custom.remove': string;
953
+ 'ta.auth.custom.removeConfirm': string;
954
+ 'ta.auth.custom.advanced': string;
955
+ 'ta.auth.custom.advancedHint': string;
956
+ 'ta.auth.custom.contextWindow': string;
957
+ 'ta.auth.custom.maxTokens': string;
958
+ 'ta.auth.custom.mixed': string;
959
+ 'ta.auth.custom.reasoning': string;
960
+ 'ta.auth.custom.images': string;
961
+ 'ta.auth.custom.headers': string;
962
+ 'ta.auth.custom.headerName': string;
963
+ 'ta.auth.custom.headerValue': string;
964
+ 'ta.auth.custom.addHeader': string;
965
+ 'ta.auth.custom.removeHeader': string;
966
+ 'ta.auth.custom.badNumber': string;
887
967
  'ta.manage.accounts': string;
888
968
  'ta.manage.workingDirectory': string;
889
969
  'ta.settings.accounts': string;
@@ -895,5 +975,10 @@ export declare const EN_MESSAGES: {
895
975
  };
896
976
  export type MessageId = keyof typeof EN_MESSAGES;
897
977
  export declare const ZH_MESSAGES: Record<MessageId, string>;
978
+ export { JA_MESSAGES, ZH_TW_MESSAGES };
979
+ /** The messages of each language of Ta, checked by scripts/check-i18n.ts. */
980
+ export declare const MESSAGES: Readonly<Record<TaLanguage, Record<MessageId, string>>>;
981
+ /** The messages of a language of the settings (`zh-CN`, `zh-TW`, `ja-JP`), English for another. */
982
+ export declare function messagesOf(language: string): Record<MessageId, string>;
898
983
  /** A message outside React, in a language of the settings. */
899
984
  export declare function message(language: string, id: MessageId): string;
@@ -1,3 +1,6 @@
1
+ import { TaLanguageUtil } from '@celljs/ta-protocol';
2
+ import { JA_MESSAGES } from './messages-ja.js';
3
+ import { ZH_TW_MESSAGES } from './messages-zh-tw.js';
1
4
  /** The messages of the web client, in ICU format. English is the source and the fallback. */
2
5
  export const EN_MESSAGES = {
3
6
  'ta.dismiss': 'Dismiss',
@@ -160,6 +163,34 @@ export const EN_MESSAGES = {
160
163
  'ta.access.thisBrowser': 'This browser',
161
164
  'ta.access.lastUsed': 'Last used {time}',
162
165
  'ta.access.signOut': 'Sign out',
166
+ 'ta.signInSetup.title': 'Ways to sign in',
167
+ 'ta.signInSetup.hint': 'Those you invite sign in with these to say who they are, from the Ta app or a browser; the same account is the same member from any device.',
168
+ 'ta.signInSetup.callback': 'Register this as the callback (redirect) URL with the provider:',
169
+ 'ta.signInSetup.copy': 'Copy',
170
+ 'ta.signInSetup.copied': 'Copied',
171
+ 'ta.signInSetup.oidc': 'Company SSO (OpenID Connect)',
172
+ 'ta.signInSetup.on': 'On · {id}',
173
+ 'ta.signInSetup.off': 'Not set up',
174
+ 'ta.signInSetup.device': 'Built in: those you invite sign in by typing a code at GitHub. Set up your own app to replace it.',
175
+ 'ta.signInSetup.incomplete': 'Not complete: it needs its id and its secret',
176
+ 'ta.signInSetup.fromEnv': 'Set by the environment of the service',
177
+ 'ta.signInSetup.add': 'Set up',
178
+ 'ta.signInSetup.edit': 'Change',
179
+ 'ta.signInSetup.save': 'Save',
180
+ 'ta.signInSetup.saved': 'Saved: it is offered now',
181
+ 'ta.signInSetup.removed': 'Taken out',
182
+ 'ta.signInSetup.remove': 'Take out {name}',
183
+ 'ta.signInSetup.removeConfirm': 'Take out signing in with {name}?',
184
+ 'ta.signInSetup.removeDetail': 'Members who came in with it stay; nobody signs in with it any more.',
185
+ 'ta.signInSetup.secretKept': 'Kept; empty keeps it',
186
+ 'ta.signInSetup.optional': 'Optional',
187
+ 'ta.signInSetup.field.clientId': 'Client ID',
188
+ 'ta.signInSetup.field.clientSecret': 'Client secret',
189
+ 'ta.signInSetup.field.appId': 'AppID',
190
+ 'ta.signInSetup.field.appSecret': 'AppSecret',
191
+ 'ta.signInSetup.field.url': 'GitHub Enterprise address',
192
+ 'ta.signInSetup.field.issuer': 'Issuer',
193
+ 'ta.signInSetup.field.name': 'Name on the button',
163
194
  'ta.sidebar.closeTitle': 'Remove from the list; it stays under Removed',
164
195
  'ta.chat.open': 'Open',
165
196
  'ta.chat.remove': 'Remove from the list',
@@ -623,6 +654,14 @@ export const EN_MESSAGES = {
623
654
  'ta.composer.queue.takeBackTitle': 'Take the waiting messages back into the box',
624
655
  'ta.composer.queue.editTitle': 'Take back into the box to edit',
625
656
  'ta.composer.queue.remove': 'Remove',
657
+ // Others in the same Ta (TaSessionInfo.people)
658
+ 'ta.presence.viewing': 'Also here',
659
+ 'ta.presence.typing': '{names} typing',
660
+ 'ta.presence.asked': 'Ta is answering {names}',
661
+ 'ta.presence.separator': ', ',
662
+ 'ta.presence.more': ' +{count}',
663
+ 'ta.presence.owner': 'Owner',
664
+ 'ta.chat.replyingFor': '{names} · answering',
626
665
  'ta.account': 'Account',
627
666
  'ta.account.service': 'Ta service',
628
667
  // The settings view and the menu of the account
@@ -891,6 +930,48 @@ export const EN_MESSAGES = {
891
930
  'ta.auth.none': 'No matching providers',
892
931
  'ta.auth.search': 'Search providers',
893
932
  'ta.auth.accountsTitle': 'Model accounts',
933
+ 'ta.auth.custom.add': 'Add a custom model service',
934
+ 'ta.auth.custom.addHint': 'Your own address and key',
935
+ 'ta.auth.custom.title': 'Custom model service',
936
+ 'ta.auth.custom.kind': 'Custom',
937
+ 'ta.auth.custom.api': 'Compatible with',
938
+ 'ta.auth.custom.apiOpenai': 'OpenAI (Chat Completions)',
939
+ 'ta.auth.custom.apiResponses': 'OpenAI (Responses)',
940
+ 'ta.auth.custom.apiAnthropic': 'Anthropic (Messages)',
941
+ 'ta.auth.custom.apiGoogle': 'Google Gemini',
942
+ 'ta.auth.custom.baseUrl': 'Base URL',
943
+ 'ta.auth.custom.apiKey': 'API key',
944
+ 'ta.auth.custom.keyKept': 'Saved; leave blank to keep it',
945
+ 'ta.auth.custom.keyOptional': 'not needed for a local server',
946
+ 'ta.auth.custom.name': 'Name',
947
+ 'ta.auth.custom.optional': 'optional',
948
+ 'ta.auth.custom.models': 'Models',
949
+ 'ta.auth.custom.modelPlaceholder': 'Type a model ID, then Enter',
950
+ 'ta.auth.custom.removeModel': 'Remove {id}',
951
+ 'ta.auth.custom.fetch': 'Get the list from the service',
952
+ 'ta.auth.custom.fetched': '{count} models; pick the ones to use',
953
+ 'ta.auth.custom.fetchedNone': 'The service lists no models: type their IDs',
954
+ 'ta.auth.custom.fetchFailed': 'Could not get the models: {message}',
955
+ 'ta.auth.custom.filter': 'Filter models',
956
+ 'ta.auth.custom.note': 'The address and the key stay on the computer that runs Ta.',
957
+ 'ta.auth.custom.needModel': 'Add at least one model',
958
+ 'ta.auth.custom.save': 'Save',
959
+ 'ta.auth.custom.saved': '{name} saved; pick its models in the + menu',
960
+ 'ta.auth.custom.remove': 'Delete',
961
+ 'ta.auth.custom.removeConfirm': 'Delete {name}? Its models can no longer be used.',
962
+ 'ta.auth.custom.advanced': 'Advanced',
963
+ 'ta.auth.custom.advancedHint': 'For every model of this service',
964
+ 'ta.auth.custom.contextWindow': 'Context window',
965
+ 'ta.auth.custom.maxTokens': 'Max output',
966
+ 'ta.auth.custom.mixed': 'differs by model, kept unless changed',
967
+ 'ta.auth.custom.reasoning': 'Thinks before answering (a reasoning model)',
968
+ 'ta.auth.custom.images': 'Takes pictures',
969
+ 'ta.auth.custom.headers': 'Headers',
970
+ 'ta.auth.custom.headerName': 'Name',
971
+ 'ta.auth.custom.headerValue': 'Value',
972
+ 'ta.auth.custom.addHeader': 'Add a header',
973
+ 'ta.auth.custom.removeHeader': 'Remove {name}',
974
+ 'ta.auth.custom.badNumber': 'Not a number of tokens: {value}',
894
975
  'ta.manage.accounts': 'Model accounts…',
895
976
  'ta.manage.workingDirectory': 'Default directory…',
896
977
  'ta.settings.accounts': 'Model accounts',
@@ -1057,6 +1138,34 @@ export const ZH_MESSAGES = {
1057
1138
  'ta.access.thisBrowser': '当前浏览器',
1058
1139
  'ta.access.lastUsed': '最近使用 {time}',
1059
1140
  'ta.access.signOut': '退出登录',
1141
+ 'ta.signInSetup.title': '登录方式',
1142
+ 'ta.signInSetup.hint': '你邀请的人用这些方式登录,说明自己是谁;在 Ta 应用和浏览器里都能用,同一个账号在哪台设备上都是同一个成员。',
1143
+ 'ta.signInSetup.callback': '在提供方那里把这个地址登记为回调地址(Callback / Redirect URL):',
1144
+ 'ta.signInSetup.copy': '复制',
1145
+ 'ta.signInSetup.copied': '已复制',
1146
+ 'ta.signInSetup.oidc': '企业 SSO(OpenID Connect)',
1147
+ 'ta.signInSetup.on': '已开启 · {id}',
1148
+ 'ta.signInSetup.off': '未配置',
1149
+ 'ta.signInSetup.device': '已内置:你邀请的人在 GitHub 输入一个码就能登录。配置自己的应用后改用你的。',
1150
+ 'ta.signInSetup.incomplete': '还没配完:需要 ID 和密钥',
1151
+ 'ta.signInSetup.fromEnv': '由服务的环境变量设置',
1152
+ 'ta.signInSetup.add': '配置',
1153
+ 'ta.signInSetup.edit': '修改',
1154
+ 'ta.signInSetup.save': '保存',
1155
+ 'ta.signInSetup.saved': '已保存,现在就能用',
1156
+ 'ta.signInSetup.removed': '已移除',
1157
+ 'ta.signInSetup.remove': '移除 {name}',
1158
+ 'ta.signInSetup.removeConfirm': '不再用 {name} 登录?',
1159
+ 'ta.signInSetup.removeDetail': '用它加入的成员会保留,只是以后不能再用它登录。',
1160
+ 'ta.signInSetup.secretKept': '已保存,留空不改',
1161
+ 'ta.signInSetup.optional': '可不填',
1162
+ 'ta.signInSetup.field.clientId': 'Client ID',
1163
+ 'ta.signInSetup.field.clientSecret': 'Client secret',
1164
+ 'ta.signInSetup.field.appId': 'AppID',
1165
+ 'ta.signInSetup.field.appSecret': 'AppSecret',
1166
+ 'ta.signInSetup.field.url': 'GitHub Enterprise 地址',
1167
+ 'ta.signInSetup.field.issuer': '签发方地址(Issuer)',
1168
+ 'ta.signInSetup.field.name': '按钮上显示的名称',
1060
1169
  'ta.sidebar.closeTitle': '从列表移除;可在“已移除”里找回',
1061
1170
  'ta.chat.open': '打开',
1062
1171
  'ta.chat.remove': '从列表移除',
@@ -1520,6 +1629,13 @@ export const ZH_MESSAGES = {
1520
1629
  'ta.composer.queue.takeBackTitle': '把排队的消息取回输入框',
1521
1630
  'ta.composer.queue.editTitle': '撤回到输入框编辑',
1522
1631
  'ta.composer.queue.remove': '删除',
1632
+ 'ta.presence.viewing': '也在看',
1633
+ 'ta.presence.typing': '{names}正在输入',
1634
+ 'ta.presence.asked': 'Ta 正在回复{names}',
1635
+ 'ta.presence.separator': '、',
1636
+ 'ta.presence.more': '等 {count} 人',
1637
+ 'ta.presence.owner': '所有者',
1638
+ 'ta.chat.replyingFor': '{names} · 正在回复',
1523
1639
  'ta.account': '账号',
1524
1640
  'ta.account.service': 'Ta 服务',
1525
1641
  // The settings view and the menu of the gear
@@ -1787,6 +1903,48 @@ export const ZH_MESSAGES = {
1787
1903
  'ta.auth.none': '没有匹配的服务商',
1788
1904
  'ta.auth.search': '搜索服务商',
1789
1905
  'ta.auth.accountsTitle': '模型账号',
1906
+ 'ta.auth.custom.add': '添加自定义模型服务',
1907
+ 'ta.auth.custom.addHint': '填服务地址和 Key',
1908
+ 'ta.auth.custom.title': '自定义模型服务',
1909
+ 'ta.auth.custom.kind': '自定义',
1910
+ 'ta.auth.custom.api': '接口格式',
1911
+ 'ta.auth.custom.apiOpenai': 'OpenAI 兼容(Chat Completions)',
1912
+ 'ta.auth.custom.apiResponses': 'OpenAI 兼容(Responses)',
1913
+ 'ta.auth.custom.apiAnthropic': 'Anthropic 兼容(Messages)',
1914
+ 'ta.auth.custom.apiGoogle': 'Google Gemini',
1915
+ 'ta.auth.custom.baseUrl': '服务地址',
1916
+ 'ta.auth.custom.apiKey': 'API Key',
1917
+ 'ta.auth.custom.keyKept': '已保存,不改就留空',
1918
+ 'ta.auth.custom.keyOptional': '本机服务可不填',
1919
+ 'ta.auth.custom.name': '名称',
1920
+ 'ta.auth.custom.optional': '可不填',
1921
+ 'ta.auth.custom.models': '模型',
1922
+ 'ta.auth.custom.modelPlaceholder': '输入模型 ID,回车添加',
1923
+ 'ta.auth.custom.removeModel': '移除 {id}',
1924
+ 'ta.auth.custom.fetch': '从服务读取模型',
1925
+ 'ta.auth.custom.fetched': '共 {count} 个模型,点选要用的',
1926
+ 'ta.auth.custom.fetchedNone': '服务没有列出模型,请手动输入',
1927
+ 'ta.auth.custom.fetchFailed': '读取不到模型:{message}',
1928
+ 'ta.auth.custom.filter': '筛选模型',
1929
+ 'ta.auth.custom.note': '地址和 Key 只保存在运行 Ta 的电脑上。',
1930
+ 'ta.auth.custom.needModel': '至少添加一个模型',
1931
+ 'ta.auth.custom.save': '保存',
1932
+ 'ta.auth.custom.saved': '已保存 {name},可在 + 菜单里选它的模型',
1933
+ 'ta.auth.custom.remove': '删除',
1934
+ 'ta.auth.custom.removeConfirm': '删除 {name}?它的模型将不能再用。',
1935
+ 'ta.auth.custom.advanced': '高级设置',
1936
+ 'ta.auth.custom.advancedHint': '对这个服务的所有模型生效',
1937
+ 'ta.auth.custom.contextWindow': '上下文窗口',
1938
+ 'ta.auth.custom.maxTokens': '最大输出',
1939
+ 'ta.auth.custom.mixed': '各模型不同,不改就保留',
1940
+ 'ta.auth.custom.reasoning': '会先思考(推理模型)',
1941
+ 'ta.auth.custom.images': '能看图片',
1942
+ 'ta.auth.custom.headers': '请求头',
1943
+ 'ta.auth.custom.headerName': '名称',
1944
+ 'ta.auth.custom.headerValue': '值',
1945
+ 'ta.auth.custom.addHeader': '添加请求头',
1946
+ 'ta.auth.custom.removeHeader': '移除 {name}',
1947
+ 'ta.auth.custom.badNumber': '不是有效的 token 数:{value}',
1790
1948
  'ta.manage.accounts': '模型账号…',
1791
1949
  'ta.manage.workingDirectory': '默认目录…',
1792
1950
  'ta.settings.accounts': '模型账号',
@@ -1796,8 +1954,20 @@ export const ZH_MESSAGES = {
1796
1954
  'ta.settings.cwdDescription': '新对话、终端和分身派出的任务在这里打开;已有的对话留在各自的目录:{path}',
1797
1955
  'ta.workingDirectory.changed': '默认目录已改为 {path}',
1798
1956
  };
1957
+ export { JA_MESSAGES, ZH_TW_MESSAGES };
1958
+ /** The messages of each language of Ta, checked by scripts/check-i18n.ts. */
1959
+ export const MESSAGES = {
1960
+ 'zh-CN': ZH_MESSAGES,
1961
+ 'zh-TW': ZH_TW_MESSAGES,
1962
+ 'en-US': EN_MESSAGES,
1963
+ 'ja-JP': JA_MESSAGES,
1964
+ };
1965
+ /** The messages of a language of the settings (`zh-CN`, `zh-TW`, `ja-JP`), English for another. */
1966
+ export function messagesOf(language) {
1967
+ return TaLanguageUtil.pick(language, MESSAGES);
1968
+ }
1799
1969
  /** A message outside React, in a language of the settings. */
1800
1970
  export function message(language, id) {
1801
- return (language === 'zh-CN' ? ZH_MESSAGES : EN_MESSAGES)[id];
1971
+ return messagesOf(language)[id];
1802
1972
  }
1803
1973
  //# sourceMappingURL=messages.js.map
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import { createIntl, IntlContext } from 'react-intl';
3
- import { EN_MESSAGES, ZH_MESSAGES } from './messages.js';
3
+ import { EN_MESSAGES, messagesOf } from './messages.js';
4
4
  let fallback;
5
5
  function english() {
6
6
  fallback !== null && fallback !== void 0 ? fallback : (fallback = createIntl({ locale: 'en-US', messages: EN_MESSAGES }));
@@ -15,7 +15,8 @@ const intls = new Map();
15
15
  export function translator(language) {
16
16
  let intl = intls.get(language);
17
17
  if (!intl) {
18
- intl = language === 'zh-CN' ? createIntl({ locale: 'zh-CN', messages: ZH_MESSAGES }) : english();
18
+ const messages = messagesOf(language);
19
+ intl = messages === EN_MESSAGES ? english() : createIntl({ locale: language, messages });
19
20
  intls.set(language, intl);
20
21
  }
21
22
  const shape = intl;
@@ -0,0 +1,32 @@
1
+ import { type TaPresenceReport } from '@celljs/ta-protocol';
2
+ /** How long typing lasts after the last key, while nothing more is typed nor sent. */
3
+ export declare const TYPING_MS = 6000;
4
+ /**
5
+ * What this page tells the others in the same Ta (TaPresenceServer, docs/design/ta-team.md 7): the conversation in front
6
+ * of the user while the page is seen, and whether they type in it. It says so as it changes, at most once a frame, again
7
+ * every heartbeat while it looks at one, and again on each new connection; never while nothing changed and it looks at
8
+ * none. `send` goes on the connection of the time, and fails quietly without one.
9
+ */
10
+ export declare class PresenceReporter {
11
+ protected readonly send: (state: TaPresenceReport) => void;
12
+ protected readonly heartbeatMs: number;
13
+ protected readonly typingMs: number;
14
+ protected looking?: string;
15
+ protected typingIn?: string;
16
+ protected sent?: string;
17
+ protected flushTimer?: ReturnType<typeof setTimeout>;
18
+ protected typingTimer?: ReturnType<typeof setTimeout>;
19
+ protected heartbeat?: ReturnType<typeof setInterval>;
20
+ constructor(send: (state: TaPresenceReport) => void, heartbeatMs?: number, typingMs?: number);
21
+ /** The conversation in front of the user, the page seen; none otherwise. */
22
+ look(sessionId: string | undefined): void;
23
+ /** What the box of a conversation holds now: typing while it holds something and keys come. */
24
+ type(sessionId: string, typing: boolean): void;
25
+ /** A new connection knows nothing of this page: what it is at goes again. */
26
+ resend(): void;
27
+ dispose(): void;
28
+ /** What it is at now. */
29
+ get state(): TaPresenceReport;
30
+ protected schedule(): void;
31
+ protected flush(): void;
32
+ }
@@ -0,0 +1,71 @@
1
+ import { TA_PRESENCE_HEARTBEAT_MS } from '@celljs/ta-protocol';
2
+ /** How long typing lasts after the last key, while nothing more is typed nor sent. */
3
+ export const TYPING_MS = 6000;
4
+ /**
5
+ * What this page tells the others in the same Ta (TaPresenceServer, docs/design/ta-team.md 7): the conversation in front
6
+ * of the user while the page is seen, and whether they type in it. It says so as it changes, at most once a frame, again
7
+ * every heartbeat while it looks at one, and again on each new connection; never while nothing changed and it looks at
8
+ * none. `send` goes on the connection of the time, and fails quietly without one.
9
+ */
10
+ export class PresenceReporter {
11
+ constructor(send, heartbeatMs = TA_PRESENCE_HEARTBEAT_MS, typingMs = TYPING_MS) {
12
+ this.send = send;
13
+ this.heartbeatMs = heartbeatMs;
14
+ this.typingMs = typingMs;
15
+ }
16
+ /** The conversation in front of the user, the page seen; none otherwise. */
17
+ look(sessionId) {
18
+ this.looking = sessionId || undefined;
19
+ this.schedule();
20
+ }
21
+ /** What the box of a conversation holds now: typing while it holds something and keys come. */
22
+ type(sessionId, typing) {
23
+ clearTimeout(this.typingTimer);
24
+ this.typingIn = typing ? sessionId : undefined;
25
+ if (typing) {
26
+ this.typingTimer = setTimeout(() => {
27
+ this.typingIn = undefined;
28
+ this.schedule();
29
+ }, this.typingMs);
30
+ }
31
+ this.schedule();
32
+ }
33
+ /** A new connection knows nothing of this page: what it is at goes again. */
34
+ resend() {
35
+ this.sent = undefined;
36
+ this.schedule();
37
+ }
38
+ dispose() {
39
+ clearTimeout(this.flushTimer);
40
+ clearTimeout(this.typingTimer);
41
+ clearInterval(this.heartbeat);
42
+ }
43
+ /** What it is at now. */
44
+ get state() {
45
+ return this.looking ? { sessionId: this.looking, ...(this.typingIn === this.looking ? { typing: true } : {}) } : {};
46
+ }
47
+ schedule() {
48
+ var _a;
49
+ (_a = this.flushTimer) !== null && _a !== void 0 ? _a : (this.flushTimer = setTimeout(() => {
50
+ this.flushTimer = undefined;
51
+ this.flush();
52
+ }, 0));
53
+ }
54
+ flush() {
55
+ const state = this.state;
56
+ const json = JSON.stringify(state);
57
+ // Nothing to say of a page that was never at a conversation.
58
+ if (json !== this.sent && (this.sent !== undefined || state.sessionId)) {
59
+ this.sent = json;
60
+ this.send(state);
61
+ }
62
+ if (state.sessionId && !this.heartbeat) {
63
+ this.heartbeat = setInterval(() => this.send(this.state), this.heartbeatMs);
64
+ }
65
+ else if (!state.sessionId && this.heartbeat) {
66
+ clearInterval(this.heartbeat);
67
+ this.heartbeat = undefined;
68
+ }
69
+ }
70
+ }
71
+ //# sourceMappingURL=presence-reporter.js.map
@@ -1,10 +1,11 @@
1
+ import { type TaLanguage } from '@celljs/ta-protocol';
1
2
  import type { StateSpec } from '../state/state-protocol.js';
2
3
  import { type NavigationSetting } from './navigation.js';
3
4
  export declare const TaSettings: unique symbol;
4
5
  export type ThemeSetting = 'system' | 'light' | 'dark';
5
6
  export type Theme = 'light' | 'dark';
6
7
  export type LanguageSetting = 'system' | Language;
7
- export type Language = 'zh-CN' | 'en-US';
8
+ export type Language = TaLanguage;
8
9
  /** How large the text is, as the font size of WeChat: small, standard, large, extra large. */
9
10
  export type FontSize = 'small' | 'standard' | 'large' | 'xlarge';
10
11
  /** What each size multiplies the font sizes of the styles by (`--ta-font-scale`, see style/base.ts). */
@@ -89,7 +90,7 @@ export declare namespace SettingsUtil {
89
90
  function theme(setting: ThemeSetting, prefersDark: boolean): Theme;
90
91
  /** What the font sizes of the page are multiplied by on this device: `fontScale`, more on a phone. */
91
92
  function deviceFontScale(fontScale: number, handheld: boolean): number;
92
- /** Chinese for any Chinese, English for the rest. */
93
+ /** That of the browser for system: Traditional Chinese for Taiwan, Hong Kong and Macau, Simplified for other Chinese, Japanese, else English. */
93
94
  function language(setting: LanguageSetting, browserLanguage: string): Language;
94
95
  }
95
96
  /** The settings of the web client: theme, language, font size, voice, motion. They apply as soon as they change. */
@@ -1,3 +1,4 @@
1
+ import { TaLanguageUtil } from '@celljs/ta-protocol';
1
2
  import { DEFAULT_NAVIGATION, NavigationUtil } from './navigation.js';
2
3
  export const TaSettings = Symbol('TaSettings');
3
4
  /** What each size multiplies the font sizes of the styles by (`--ta-font-scale`, see style/base.ts). */
@@ -60,7 +61,7 @@ export var SettingsUtil;
60
61
  const kept = value;
61
62
  return {
62
63
  theme: ['system', 'light', 'dark'].includes(kept.theme) ? kept.theme : DEFAULT_SETTINGS.theme,
63
- language: ['system', 'zh-CN', 'en-US'].includes(kept.language) ? kept.language : DEFAULT_SETTINGS.language,
64
+ language: ['system', ...TaLanguageUtil.ALL].includes(kept.language) ? kept.language : DEFAULT_SETTINGS.language,
64
65
  fontSize: fontSize(kept.fontSize),
65
66
  chatFontSize: fontSize(kept.chatFontSize),
66
67
  speak: kept.speak === true,
@@ -91,9 +92,9 @@ export var SettingsUtil;
91
92
  return handheld ? fontScale * HANDHELD_FONT_SCALE : fontScale;
92
93
  }
93
94
  SettingsUtil.deviceFontScale = deviceFontScale;
94
- /** Chinese for any Chinese, English for the rest. */
95
+ /** That of the browser for system: Traditional Chinese for Taiwan, Hong Kong and Macau, Simplified for other Chinese, Japanese, else English. */
95
96
  function language(setting, browserLanguage) {
96
- return setting === 'system' ? (browserLanguage.toLowerCase().startsWith('zh') ? 'zh-CN' : 'en-US') : setting;
97
+ return setting === 'system' ? TaLanguageUtil.of(browserLanguage) : setting;
97
98
  }
98
99
  SettingsUtil.language = language;
99
100
  })(SettingsUtil || (SettingsUtil = {}));