@getmateo/protocol 0.17.1 → 0.19.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.
package/dist/messages.js CHANGED
@@ -5,6 +5,7 @@ import { HostsLinkOpenRequestSchema, HostsLinkAckSchema, HostsRouteOpenRequestSc
5
5
  import { FleetSelfStateSchema, FleetStatusRequestSchema, FleetCredentialIssueRequestSchema, FleetJoinRequestSchema, FleetLeaveRequestSchema, FleetMemberRemoveRequestSchema, FleetDispatchSetRequestSchema, FleetProjectsListRequestSchema, FleetWorkspaceResolveRequestSchema, FleetStatusResponseSchema, FleetCredentialIssueResponseSchema, FleetJoinResponseSchema, FleetLeaveResponseSchema, FleetMemberRemoveResponseSchema, FleetDispatchSetResponseSchema, FleetProjectsListResponseSchema, FleetWorkspaceResolveResponseSchema, } from "./fleet.js";
6
6
  import { DaemonAuthStatusRequestSchema, DaemonAuthPasswordSetRequestSchema, DaemonAuthDeviceRevokeRequestSchema, DaemonAuthDeviceSubscribeRequestSchema, DaemonAuthStatusResponseSchema, DaemonAuthPasswordSetResponseSchema, DaemonAuthDeviceRevokeResponseSchema, DaemonAuthDeviceSubscribeResponseSchema, DaemonAuthDeviceCredentialSchema, DaemonAuthSessionDisconnectRequestSchema, DaemonAuthSessionDisconnectResponseSchema, DaemonAuthStatusSubscribeRequestSchema, DaemonAuthStatusSubscribeResponseSchema, DaemonAuthStatusChangedSchema, ClientDeviceDetailsSchema, } from "./daemon-auth.js";
7
7
  import { PluginRegistryIdentitySchema } from "./plugin-registry.js";
8
+ import { PluginBrowserIdentitySchema } from "./plugin-browser-grants.js";
8
9
  import { AgentProfileSchema, AgentSkillSelectionSchema } from "./agent-profile.js";
9
10
  export { AgentProfileSchema, AgentSkillSelectionSchema, } from "./agent-profile.js";
10
11
  import { PluginIdSchema, PluginRequirementsSchema, PluginSourceSchema } from "./plugin-config.js";
@@ -23,7 +24,8 @@ import { WORKSPACE_LABEL_COLORS } from "./workspace-labels.js";
23
24
  import { ChatCreateRequestSchema, ChatListRequestSchema, ChatInspectRequestSchema, ChatDeleteRequestSchema, ChatPostRequestSchema, ChatReadRequestSchema, ChatWaitRequestSchema, ChatCreateResponseSchema, ChatListResponseSchema, ChatInspectResponseSchema, ChatDeleteResponseSchema, ChatPostResponseSchema, ChatReadResponseSchema, ChatWaitResponseSchema, } from "./chat/rpc-schemas.js";
24
25
  import { ScheduleCreateRequestSchema, ScheduleListRequestSchema, ScheduleInspectRequestSchema, ScheduleLogsRequestSchema, SchedulePauseRequestSchema, ScheduleResumeRequestSchema, ScheduleDeleteRequestSchema, ScheduleRunOnceRequestSchema, ScheduleUpdateRequestSchema, ScheduleCreateResponseSchema, ScheduleListResponseSchema, ScheduleInspectResponseSchema, ScheduleLogsResponseSchema, SchedulePauseResponseSchema, ScheduleResumeResponseSchema, ScheduleDeleteResponseSchema, ScheduleRunOnceResponseSchema, ScheduleUpdateResponseSchema, } from "./schedule/rpc-schemas.js";
25
26
  import { LoopRunRequestSchema, LoopListRequestSchema, LoopInspectRequestSchema, LoopLogsRequestSchema, LoopStopRequestSchema, LoopRunResponseSchema, LoopListResponseSchema, LoopInspectResponseSchema, LoopLogsResponseSchema, LoopStopResponseSchema, } from "./loop/rpc-schemas.js";
26
- import { BROWSER_AUTOMATION_COMMAND_NAMES, BrowserAutomationExecuteRequestSchema, BrowserAutomationExecuteResponseSchema, } from "./browser-automation/rpc-schemas.js";
27
+ import { BROWSER_AUTOMATION_COMMAND_NAMES, BrowserAutomationExecuteRequestSchema, BrowserAutomationExecuteResponseSchema, BrowserDownloadListSchema, } from "./browser-automation/rpc-schemas.js";
28
+ import { PluginBrowserRequestSchema, PluginBrowserResponseSchema, PluginBrowserHostRequestSchema, PluginBrowserHostResponseSchema, PluginBrowserGrantUpdateRequestSchema, PluginBrowserGrantUpdateResponseSchema, } from "./plugin-browser.js";
27
29
  import { BrowserAutomationHostCapabilitySchema } from "./browser-automation/capabilities.js";
28
30
  import { MateoConfigRawSchema, MateoLifecycleCommandRawSchema, MateoMetadataGenerationEntrySchema, MateoMetadataGenerationSchema, MateoScriptEntryRawSchema, MateoWorktreeConfigRawSchema, MateoConfigRevisionSchema, ProjectConfigRpcErrorSchema, } from "./mateo-config-schema.js";
29
31
  export { MateoConfigRawSchema, MateoLifecycleCommandRawSchema, MateoMetadataGenerationEntrySchema, MateoMetadataGenerationSchema, MateoScriptEntryRawSchema, MateoWorktreeConfigRawSchema, };
@@ -1955,6 +1957,8 @@ export const CheckoutPullRequestSchema = z.object({
1955
1957
  export const CheckoutPushRequestSchema = z.object({
1956
1958
  type: z.literal("checkout_push_request"),
1957
1959
  cwd: z.string(),
1960
+ // Only a first Push sets this: do not reinterpret stale UI intent as a tracked or mapped push.
1961
+ firstPushBranch: z.string().optional(),
1958
1962
  requestId: z.string(),
1959
1963
  });
1960
1964
  export const CheckoutRefreshRequestSchema = z.object({
@@ -2734,6 +2738,7 @@ export const HubExecutionAgentValidateRequestSchema = z.object({
2734
2738
  type: z.literal("hub.execution.agent.validate.request"),
2735
2739
  requestId: z.string(),
2736
2740
  provider: z.string(),
2741
+ cwd: z.string().optional(),
2737
2742
  model: z.string().optional(),
2738
2743
  modeId: z.string().optional(),
2739
2744
  thinkingOptionId: z.string().optional(),
@@ -2796,7 +2801,18 @@ export const SessionEventsSetSubscriptionResponseSchema = z.object({
2796
2801
  type: z.literal("session.events.set_subscription.response"),
2797
2802
  payload: z.object({ requestId: z.string(), subscriptionId: z.string().optional() }),
2798
2803
  });
2804
+ export const BrowserListDownloadsRequestSchema = z.object({
2805
+ type: z.literal("browser.list_downloads.request"),
2806
+ requestId: z.string(),
2807
+ workspaceId: z.string().min(1),
2808
+ });
2809
+ export const BrowserListDownloadsResponseSchema = z.object({
2810
+ type: z.literal("browser.list_downloads.response"),
2811
+ payload: z.object({ requestId: z.string(), downloads: BrowserDownloadListSchema }),
2812
+ });
2799
2813
  export const BrowserHostRegisterRequestSchema = z.object({
2814
+ downloadReceipts: z.boolean().optional(),
2815
+ pluginBrowserVersion: z.number().int().positive().optional(),
2800
2816
  type: z.literal("browser.host.register.request"),
2801
2817
  requestId: z.string(),
2802
2818
  hostKind: z.string().min(1),
@@ -2836,6 +2852,10 @@ export const SessionInboundMessageSchema = z.discriminatedUnion("type", [
2836
2852
  HostsRouteFrameRequestSchema,
2837
2853
  HostsRouteCloseRequestSchema,
2838
2854
  BrowserHostRegisterRequestSchema,
2855
+ BrowserListDownloadsRequestSchema,
2856
+ PluginBrowserRequestSchema,
2857
+ PluginBrowserGrantUpdateRequestSchema,
2858
+ PluginBrowserHostResponseSchema,
2839
2859
  SubscriptionReleaseRequestSchema,
2840
2860
  SessionEventsSetSubscriptionRequestSchema,
2841
2861
  HubExecutionAgentCreateRequestSchema,
@@ -3246,6 +3266,7 @@ export const ServerInfoStatusPayloadSchema = z
3246
3266
  workspaceSetupRun: z.boolean().optional(),
3247
3267
  // COMPAT(workspaceTerminals): added in v0.8.0, remove gate after 2027-09-05.
3248
3268
  workspaceTerminals: z.boolean().optional(),
3269
+ checkoutFirstPush: z.boolean().optional(),
3249
3270
  // COMPAT(checkoutForgeSetAutoMerge): added in v0.2.0-beta.1. Remove the
3250
3271
  // feature gate and checkoutGithubSetAutoMerge fallback after 2027-01-17
3251
3272
  // once the supported daemon floor is >= v0.2.0.
@@ -3289,6 +3310,8 @@ export const ServerInfoStatusPayloadSchema = z
3289
3310
  // COMPAT(builtinPluginToggles): added in v0.11.0-beta.4; plugin.list can include built-ins and
3290
3311
  // plugin.enable/disable accept built-in IDs. No current client reads it; remove after 2027-04-05.
3291
3312
  builtinPluginToggles: z.boolean().optional(),
3313
+ browserDownloadReceipts: z.boolean().optional(),
3314
+ pluginBrowserVersion: z.number().int().positive().optional(),
3292
3315
  // COMPAT(pluginThemes): added in v0.5.0, remove gate after 2027-08-20.
3293
3316
  // A daemon that predates this flag keeps `addTheme` in the server bundle it compiles,
3294
3317
  // so a theme plugin cannot start there at all.
@@ -4820,6 +4843,10 @@ const CheckoutStatusCommonSchema = z.object({
4820
4843
  // upstream branch name is not necessarily currentBranch, so composing one is wrong.
4821
4844
  // aheadOfOrigin/behindOfOrigin are measured against exactly this ref.
4822
4845
  upstreamRef: z.string().nullable().optional(),
4846
+ // A missing tracking ref can mean no upstream, a pruned upstream, or a limited fetch refspec.
4847
+ upstreamState: z.enum(["tracked", "none", "gone", "unknown"]).optional(),
4848
+ // For a regular checkout's first push, null unless Git's destination agrees with Mateo's.
4849
+ firstPushRemote: z.string().nullable().optional(),
4823
4850
  });
4824
4851
  const CheckoutStatusNotGitSchema = CheckoutStatusCommonSchema.extend({
4825
4852
  isGit: z.literal(false),
@@ -5341,7 +5368,6 @@ export const PullRequestTimelineResponseSchema = z.object({
5341
5368
  // daemon floor is >= v0.2.0.
5342
5369
  authState: ForgeAuthStateSchema,
5343
5370
  })
5344
- .optional()
5345
5371
  .prefault({}),
5346
5372
  });
5347
5373
  export const CheckoutSwitchBranchResponseSchema = z.object({
@@ -6195,6 +6221,7 @@ export const PluginListItemSchema = z.object({
6195
6221
  source: z.enum(["directory", "git"]).optional(),
6196
6222
  npm: PluginNpmInstallationSchema.optional(),
6197
6223
  installation: PluginInstallationSchema.optional(),
6224
+ browserIdentity: PluginBrowserIdentitySchema.optional(),
6198
6225
  remote: z.string().optional(),
6199
6226
  ref: z.string().optional(),
6200
6227
  commit: z.string().optional(),
@@ -6355,6 +6382,10 @@ export const SessionOutboundMessageSchema = z.discriminatedUnion("type", [
6355
6382
  HostsRouteFrameSchema,
6356
6383
  HostsRouteClosedSchema,
6357
6384
  BrowserHostRegisterResponseSchema,
6385
+ BrowserListDownloadsResponseSchema,
6386
+ PluginBrowserResponseSchema,
6387
+ PluginBrowserGrantUpdateResponseSchema,
6388
+ PluginBrowserHostRequestSchema,
6358
6389
  SubscriptionReleaseResponseSchema,
6359
6390
  SessionEventsSetSubscriptionResponseSchema,
6360
6391
  HubExecutionAgentCreateResponseSchema,
@@ -0,0 +1,211 @@
1
+ export declare const pluginBrowserConsentCopy: {
2
+ readonly en: {
3
+ readonly title: "Browser permissions";
4
+ readonly reason: "Reason given by the plugin";
5
+ readonly workspace: "Workspace";
6
+ readonly choose: "Choose a workspace";
7
+ readonly read: "Read and navigate";
8
+ readonly upload: "Upload workspace images";
9
+ readonly lifetime: "Access ends when the plugin reloads or Mateo restarts. Upload also requires read access.";
10
+ readonly allow: "Allow";
11
+ readonly revoke: "Revoke";
12
+ readonly cancel: "Cancel";
13
+ };
14
+ readonly ar: {
15
+ readonly title: "أذونات المتصفح";
16
+ readonly reason: "السبب الذي قدمته الإضافة";
17
+ readonly workspace: "مساحة العمل";
18
+ readonly choose: "اختر مساحة عمل";
19
+ readonly read: "القراءة والتنقل";
20
+ readonly upload: "رفع صور مساحة العمل";
21
+ readonly lifetime: "ينتهي الوصول عند إعادة تحميل الإضافة أو إعادة تشغيل Mateo. يتطلب الرفع إذن القراءة أيضًا.";
22
+ readonly allow: "السماح";
23
+ readonly revoke: "إلغاء الإذن";
24
+ readonly cancel: "إلغاء";
25
+ };
26
+ readonly es: {
27
+ readonly title: "Permisos del navegador";
28
+ readonly reason: "Motivo indicado por el plugin";
29
+ readonly workspace: "Espacio de trabajo";
30
+ readonly choose: "Elige un espacio de trabajo";
31
+ readonly read: "Leer y navegar";
32
+ readonly upload: "Subir imágenes del espacio de trabajo";
33
+ readonly lifetime: "El acceso termina al recargar el plugin o reiniciar Mateo. Para subir imágenes también se necesita permiso de lectura.";
34
+ readonly allow: "Permitir";
35
+ readonly revoke: "Revocar";
36
+ readonly cancel: "Cancelar";
37
+ };
38
+ readonly fr: {
39
+ readonly title: "Autorisations du navigateur";
40
+ readonly reason: "Motif indiqué par le plugin";
41
+ readonly workspace: "Espace de travail";
42
+ readonly choose: "Choisir un espace de travail";
43
+ readonly read: "Lire et naviguer";
44
+ readonly upload: "Envoyer des images de l’espace de travail";
45
+ readonly lifetime: "L’accès prend fin au rechargement du plugin ou au redémarrage de Mateo. L’envoi d’images nécessite aussi l’accès en lecture.";
46
+ readonly allow: "Autoriser";
47
+ readonly revoke: "Révoquer";
48
+ readonly cancel: "Annuler";
49
+ };
50
+ readonly ja: {
51
+ readonly title: "ブラウザの権限";
52
+ readonly reason: "プラグインが提示した理由";
53
+ readonly workspace: "ワークスペース";
54
+ readonly choose: "ワークスペースを選択";
55
+ readonly read: "読み取りと移動";
56
+ readonly upload: "ワークスペースの画像をアップロード";
57
+ readonly lifetime: "プラグインの再読み込みまたは Mateo の再起動で権限は失効します。アップロードには読み取り権限も必要です。";
58
+ readonly allow: "許可";
59
+ readonly revoke: "取り消す";
60
+ readonly cancel: "キャンセル";
61
+ };
62
+ readonly ko: {
63
+ readonly title: "브라우저 권한";
64
+ readonly reason: "플러그인이 제시한 이유";
65
+ readonly workspace: "작업 공간";
66
+ readonly choose: "작업 공간 선택";
67
+ readonly read: "읽기 및 탐색";
68
+ readonly upload: "작업 공간 이미지 업로드";
69
+ readonly lifetime: "플러그인을 다시 로드하거나 Mateo를 다시 시작하면 권한이 만료됩니다. 업로드하려면 읽기 권한도 필요합니다.";
70
+ readonly allow: "허용";
71
+ readonly revoke: "권한 취소";
72
+ readonly cancel: "취소";
73
+ };
74
+ readonly "pt-BR": {
75
+ readonly title: "Permissões do navegador";
76
+ readonly reason: "Motivo informado pelo plugin";
77
+ readonly workspace: "Espaço de trabalho";
78
+ readonly choose: "Escolha um espaço de trabalho";
79
+ readonly read: "Ler e navegar";
80
+ readonly upload: "Enviar imagens do espaço de trabalho";
81
+ readonly lifetime: "O acesso termina ao recarregar o plugin ou reiniciar o Mateo. O envio também exige permissão de leitura.";
82
+ readonly allow: "Permitir";
83
+ readonly revoke: "Revogar";
84
+ readonly cancel: "Cancelar";
85
+ };
86
+ readonly ru: {
87
+ readonly title: "Разрешения браузера";
88
+ readonly reason: "Причина, указанная плагином";
89
+ readonly workspace: "Рабочая область";
90
+ readonly choose: "Выберите рабочую область";
91
+ readonly read: "Чтение и навигация";
92
+ readonly upload: "Загрузка изображений из рабочей области";
93
+ readonly lifetime: "Доступ прекращается при перезагрузке плагина или перезапуске Mateo. Для загрузки также требуется разрешение на чтение.";
94
+ readonly allow: "Разрешить";
95
+ readonly revoke: "Отозвать";
96
+ readonly cancel: "Отмена";
97
+ };
98
+ readonly "zh-CN": {
99
+ readonly title: "浏览器权限";
100
+ readonly reason: "插件提供的理由";
101
+ readonly workspace: "工作区";
102
+ readonly choose: "选择工作区";
103
+ readonly read: "读取和导航";
104
+ readonly upload: "上传工作区图片";
105
+ readonly lifetime: "重新加载插件或重启 Mateo 后,授权会失效。上传图片还需要读取权限。";
106
+ readonly allow: "允许";
107
+ readonly revoke: "撤销";
108
+ readonly cancel: "取消";
109
+ };
110
+ };
111
+ export declare function browserConsentCopy(language: string): {
112
+ readonly title: "Browser permissions";
113
+ readonly reason: "Reason given by the plugin";
114
+ readonly workspace: "Workspace";
115
+ readonly choose: "Choose a workspace";
116
+ readonly read: "Read and navigate";
117
+ readonly upload: "Upload workspace images";
118
+ readonly lifetime: "Access ends when the plugin reloads or Mateo restarts. Upload also requires read access.";
119
+ readonly allow: "Allow";
120
+ readonly revoke: "Revoke";
121
+ readonly cancel: "Cancel";
122
+ } | {
123
+ readonly title: "أذونات المتصفح";
124
+ readonly reason: "السبب الذي قدمته الإضافة";
125
+ readonly workspace: "مساحة العمل";
126
+ readonly choose: "اختر مساحة عمل";
127
+ readonly read: "القراءة والتنقل";
128
+ readonly upload: "رفع صور مساحة العمل";
129
+ readonly lifetime: "ينتهي الوصول عند إعادة تحميل الإضافة أو إعادة تشغيل Mateo. يتطلب الرفع إذن القراءة أيضًا.";
130
+ readonly allow: "السماح";
131
+ readonly revoke: "إلغاء الإذن";
132
+ readonly cancel: "إلغاء";
133
+ } | {
134
+ readonly title: "Permisos del navegador";
135
+ readonly reason: "Motivo indicado por el plugin";
136
+ readonly workspace: "Espacio de trabajo";
137
+ readonly choose: "Elige un espacio de trabajo";
138
+ readonly read: "Leer y navegar";
139
+ readonly upload: "Subir imágenes del espacio de trabajo";
140
+ readonly lifetime: "El acceso termina al recargar el plugin o reiniciar Mateo. Para subir imágenes también se necesita permiso de lectura.";
141
+ readonly allow: "Permitir";
142
+ readonly revoke: "Revocar";
143
+ readonly cancel: "Cancelar";
144
+ } | {
145
+ readonly title: "Autorisations du navigateur";
146
+ readonly reason: "Motif indiqué par le plugin";
147
+ readonly workspace: "Espace de travail";
148
+ readonly choose: "Choisir un espace de travail";
149
+ readonly read: "Lire et naviguer";
150
+ readonly upload: "Envoyer des images de l’espace de travail";
151
+ readonly lifetime: "L’accès prend fin au rechargement du plugin ou au redémarrage de Mateo. L’envoi d’images nécessite aussi l’accès en lecture.";
152
+ readonly allow: "Autoriser";
153
+ readonly revoke: "Révoquer";
154
+ readonly cancel: "Annuler";
155
+ } | {
156
+ readonly title: "ブラウザの権限";
157
+ readonly reason: "プラグインが提示した理由";
158
+ readonly workspace: "ワークスペース";
159
+ readonly choose: "ワークスペースを選択";
160
+ readonly read: "読み取りと移動";
161
+ readonly upload: "ワークスペースの画像をアップロード";
162
+ readonly lifetime: "プラグインの再読み込みまたは Mateo の再起動で権限は失効します。アップロードには読み取り権限も必要です。";
163
+ readonly allow: "許可";
164
+ readonly revoke: "取り消す";
165
+ readonly cancel: "キャンセル";
166
+ } | {
167
+ readonly title: "브라우저 권한";
168
+ readonly reason: "플러그인이 제시한 이유";
169
+ readonly workspace: "작업 공간";
170
+ readonly choose: "작업 공간 선택";
171
+ readonly read: "읽기 및 탐색";
172
+ readonly upload: "작업 공간 이미지 업로드";
173
+ readonly lifetime: "플러그인을 다시 로드하거나 Mateo를 다시 시작하면 권한이 만료됩니다. 업로드하려면 읽기 권한도 필요합니다.";
174
+ readonly allow: "허용";
175
+ readonly revoke: "권한 취소";
176
+ readonly cancel: "취소";
177
+ } | {
178
+ readonly title: "Permissões do navegador";
179
+ readonly reason: "Motivo informado pelo plugin";
180
+ readonly workspace: "Espaço de trabalho";
181
+ readonly choose: "Escolha um espaço de trabalho";
182
+ readonly read: "Ler e navegar";
183
+ readonly upload: "Enviar imagens do espaço de trabalho";
184
+ readonly lifetime: "O acesso termina ao recarregar o plugin ou reiniciar o Mateo. O envio também exige permissão de leitura.";
185
+ readonly allow: "Permitir";
186
+ readonly revoke: "Revogar";
187
+ readonly cancel: "Cancelar";
188
+ } | {
189
+ readonly title: "Разрешения браузера";
190
+ readonly reason: "Причина, указанная плагином";
191
+ readonly workspace: "Рабочая область";
192
+ readonly choose: "Выберите рабочую область";
193
+ readonly read: "Чтение и навигация";
194
+ readonly upload: "Загрузка изображений из рабочей области";
195
+ readonly lifetime: "Доступ прекращается при перезагрузке плагина или перезапуске Mateo. Для загрузки также требуется разрешение на чтение.";
196
+ readonly allow: "Разрешить";
197
+ readonly revoke: "Отозвать";
198
+ readonly cancel: "Отмена";
199
+ } | {
200
+ readonly title: "浏览器权限";
201
+ readonly reason: "插件提供的理由";
202
+ readonly workspace: "工作区";
203
+ readonly choose: "选择工作区";
204
+ readonly read: "读取和导航";
205
+ readonly upload: "上传工作区图片";
206
+ readonly lifetime: "重新加载插件或重启 Mateo 后,授权会失效。上传图片还需要读取权限。";
207
+ readonly allow: "允许";
208
+ readonly revoke: "撤销";
209
+ readonly cancel: "取消";
210
+ };
211
+ //# sourceMappingURL=plugin-browser-consent-copy.d.ts.map
@@ -0,0 +1,118 @@
1
+ // Shared by the first-party settings sheet and the native confirmation. The
2
+ // renderer may choose a language, but never supplies native dialog strings.
3
+ export const pluginBrowserConsentCopy = {
4
+ en: {
5
+ title: "Browser permissions",
6
+ reason: "Reason given by the plugin",
7
+ workspace: "Workspace",
8
+ choose: "Choose a workspace",
9
+ read: "Read and navigate",
10
+ upload: "Upload workspace images",
11
+ lifetime: "Access ends when the plugin reloads or Mateo restarts. Upload also requires read access.",
12
+ allow: "Allow",
13
+ revoke: "Revoke",
14
+ cancel: "Cancel",
15
+ },
16
+ ar: {
17
+ title: "أذونات المتصفح",
18
+ reason: "السبب الذي قدمته الإضافة",
19
+ workspace: "مساحة العمل",
20
+ choose: "اختر مساحة عمل",
21
+ read: "القراءة والتنقل",
22
+ upload: "رفع صور مساحة العمل",
23
+ lifetime: "ينتهي الوصول عند إعادة تحميل الإضافة أو إعادة تشغيل Mateo. يتطلب الرفع إذن القراءة أيضًا.",
24
+ allow: "السماح",
25
+ revoke: "إلغاء الإذن",
26
+ cancel: "إلغاء",
27
+ },
28
+ es: {
29
+ title: "Permisos del navegador",
30
+ reason: "Motivo indicado por el plugin",
31
+ workspace: "Espacio de trabajo",
32
+ choose: "Elige un espacio de trabajo",
33
+ read: "Leer y navegar",
34
+ upload: "Subir imágenes del espacio de trabajo",
35
+ lifetime: "El acceso termina al recargar el plugin o reiniciar Mateo. Para subir imágenes también se necesita permiso de lectura.",
36
+ allow: "Permitir",
37
+ revoke: "Revocar",
38
+ cancel: "Cancelar",
39
+ },
40
+ fr: {
41
+ title: "Autorisations du navigateur",
42
+ reason: "Motif indiqué par le plugin",
43
+ workspace: "Espace de travail",
44
+ choose: "Choisir un espace de travail",
45
+ read: "Lire et naviguer",
46
+ upload: "Envoyer des images de l’espace de travail",
47
+ lifetime: "L’accès prend fin au rechargement du plugin ou au redémarrage de Mateo. L’envoi d’images nécessite aussi l’accès en lecture.",
48
+ allow: "Autoriser",
49
+ revoke: "Révoquer",
50
+ cancel: "Annuler",
51
+ },
52
+ ja: {
53
+ title: "ブラウザの権限",
54
+ reason: "プラグインが提示した理由",
55
+ workspace: "ワークスペース",
56
+ choose: "ワークスペースを選択",
57
+ read: "読み取りと移動",
58
+ upload: "ワークスペースの画像をアップロード",
59
+ lifetime: "プラグインの再読み込みまたは Mateo の再起動で権限は失効します。アップロードには読み取り権限も必要です。",
60
+ allow: "許可",
61
+ revoke: "取り消す",
62
+ cancel: "キャンセル",
63
+ },
64
+ ko: {
65
+ title: "브라우저 권한",
66
+ reason: "플러그인이 제시한 이유",
67
+ workspace: "작업 공간",
68
+ choose: "작업 공간 선택",
69
+ read: "읽기 및 탐색",
70
+ upload: "작업 공간 이미지 업로드",
71
+ lifetime: "플러그인을 다시 로드하거나 Mateo를 다시 시작하면 권한이 만료됩니다. 업로드하려면 읽기 권한도 필요합니다.",
72
+ allow: "허용",
73
+ revoke: "권한 취소",
74
+ cancel: "취소",
75
+ },
76
+ "pt-BR": {
77
+ title: "Permissões do navegador",
78
+ reason: "Motivo informado pelo plugin",
79
+ workspace: "Espaço de trabalho",
80
+ choose: "Escolha um espaço de trabalho",
81
+ read: "Ler e navegar",
82
+ upload: "Enviar imagens do espaço de trabalho",
83
+ lifetime: "O acesso termina ao recarregar o plugin ou reiniciar o Mateo. O envio também exige permissão de leitura.",
84
+ allow: "Permitir",
85
+ revoke: "Revogar",
86
+ cancel: "Cancelar",
87
+ },
88
+ ru: {
89
+ title: "Разрешения браузера",
90
+ reason: "Причина, указанная плагином",
91
+ workspace: "Рабочая область",
92
+ choose: "Выберите рабочую область",
93
+ read: "Чтение и навигация",
94
+ upload: "Загрузка изображений из рабочей области",
95
+ lifetime: "Доступ прекращается при перезагрузке плагина или перезапуске Mateo. Для загрузки также требуется разрешение на чтение.",
96
+ allow: "Разрешить",
97
+ revoke: "Отозвать",
98
+ cancel: "Отмена",
99
+ },
100
+ "zh-CN": {
101
+ title: "浏览器权限",
102
+ reason: "插件提供的理由",
103
+ workspace: "工作区",
104
+ choose: "选择工作区",
105
+ read: "读取和导航",
106
+ upload: "上传工作区图片",
107
+ lifetime: "重新加载插件或重启 Mateo 后,授权会失效。上传图片还需要读取权限。",
108
+ allow: "允许",
109
+ revoke: "撤销",
110
+ cancel: "取消",
111
+ },
112
+ };
113
+ export function browserConsentCopy(language) {
114
+ return Object.hasOwn(pluginBrowserConsentCopy, language)
115
+ ? pluginBrowserConsentCopy[language]
116
+ : pluginBrowserConsentCopy.en;
117
+ }
118
+ //# sourceMappingURL=plugin-browser-consent-copy.js.map
@@ -0,0 +1,48 @@
1
+ import { z } from "zod";
2
+ export declare function isPluginBrowserDomain(domain: string): boolean;
3
+ export declare const PluginBrowserIdentitySchema: z.ZodObject<{
4
+ pluginId: z.ZodString;
5
+ installationId: z.ZodUUID;
6
+ domains: z.ZodArray<z.ZodString>;
7
+ }, z.core.$strip>;
8
+ export type PluginBrowserIdentity = z.infer<typeof PluginBrowserIdentitySchema>;
9
+ export declare const PluginBrowserGrantScopeSchema: z.ZodObject<{
10
+ pluginId: z.ZodString;
11
+ installationId: z.ZodUUID;
12
+ workspaceId: z.ZodString;
13
+ domain: z.ZodString;
14
+ capability: z.ZodEnum<{
15
+ read: "read";
16
+ upload: "upload";
17
+ }>;
18
+ }, z.core.$strip>;
19
+ export type PluginBrowserGrantScope = z.infer<typeof PluginBrowserGrantScopeSchema>;
20
+ export declare const PluginBrowserGrantSchema: z.ZodObject<{
21
+ pluginId: z.ZodString;
22
+ installationId: z.ZodUUID;
23
+ workspaceId: z.ZodString;
24
+ domain: z.ZodString;
25
+ capability: z.ZodEnum<{
26
+ read: "read";
27
+ upload: "upload";
28
+ }>;
29
+ epoch: z.ZodUUID;
30
+ }, z.core.$strip>;
31
+ export type PluginBrowserGrant = z.infer<typeof PluginBrowserGrantSchema>;
32
+ export declare const MAX_PLUGIN_BROWSER_GRANTS = 256;
33
+ export declare const PluginBrowserGrantSnapshotSchema: z.ZodObject<{
34
+ revision: z.ZodNumber;
35
+ grants: z.ZodArray<z.ZodObject<{
36
+ pluginId: z.ZodString;
37
+ installationId: z.ZodUUID;
38
+ workspaceId: z.ZodString;
39
+ domain: z.ZodString;
40
+ capability: z.ZodEnum<{
41
+ read: "read";
42
+ upload: "upload";
43
+ }>;
44
+ epoch: z.ZodUUID;
45
+ }, z.core.$strip>>;
46
+ }, z.core.$strip>;
47
+ export type PluginBrowserGrantSnapshot = z.infer<typeof PluginBrowserGrantSnapshotSchema>;
48
+ //# sourceMappingURL=plugin-browser-grants.d.ts.map
@@ -0,0 +1,56 @@
1
+ import { z } from "zod";
2
+ import { PluginIdSchema } from "./plugin-config.js";
3
+ const nonPublicSuffixes = [
4
+ "localhost",
5
+ "local",
6
+ "internal",
7
+ "intranet",
8
+ "lan",
9
+ "corp",
10
+ "home",
11
+ "localdomain",
12
+ "arpa",
13
+ "onion",
14
+ "invalid",
15
+ "alt",
16
+ "localtest.me",
17
+ "lvh.me",
18
+ "localhost.direct",
19
+ "localhost.run",
20
+ "vcap.me",
21
+ "lacolhost.com",
22
+ "nip.io",
23
+ "sslip.io",
24
+ "xip.io",
25
+ "traefik.me",
26
+ ];
27
+ // Declarations are DNS names, not URLs. Never normalize userinfo, explicit default
28
+ // ports, IPv4 aliases, Unicode or wildcard patterns into something approvable.
29
+ export function isPluginBrowserDomain(domain) {
30
+ if (domain.length > 253 || /[^a-z0-9.-]/.test(domain))
31
+ return false;
32
+ const labels = domain.split(".");
33
+ return (labels.length > 1 &&
34
+ /^[a-z]{2,63}$/.test(labels.at(-1)) &&
35
+ labels.every((label) => /^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$/.test(label)) &&
36
+ !nonPublicSuffixes.some((suffix) => domain === suffix || domain.endsWith(`.${suffix}`)));
37
+ }
38
+ export const PluginBrowserIdentitySchema = z.object({
39
+ pluginId: PluginIdSchema,
40
+ installationId: z.uuid(),
41
+ domains: z.array(z.string().min(1).max(253)).max(32),
42
+ });
43
+ export const PluginBrowserGrantScopeSchema = z.object({
44
+ pluginId: PluginIdSchema.max(128),
45
+ installationId: z.uuid(),
46
+ workspaceId: z.string().min(1).max(512),
47
+ domain: z.string().min(1).max(253),
48
+ capability: z.enum(["read", "upload"]),
49
+ });
50
+ export const PluginBrowserGrantSchema = PluginBrowserGrantScopeSchema.extend({ epoch: z.uuid() });
51
+ export const MAX_PLUGIN_BROWSER_GRANTS = 256;
52
+ export const PluginBrowserGrantSnapshotSchema = z.object({
53
+ revision: z.number().int().nonnegative(),
54
+ grants: z.array(PluginBrowserGrantSchema).max(MAX_PLUGIN_BROWSER_GRANTS),
55
+ });
56
+ //# sourceMappingURL=plugin-browser-grants.js.map