@getmateo/protocol 0.17.1 → 0.18.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, };
@@ -2796,7 +2798,18 @@ export const SessionEventsSetSubscriptionResponseSchema = z.object({
2796
2798
  type: z.literal("session.events.set_subscription.response"),
2797
2799
  payload: z.object({ requestId: z.string(), subscriptionId: z.string().optional() }),
2798
2800
  });
2801
+ export const BrowserListDownloadsRequestSchema = z.object({
2802
+ type: z.literal("browser.list_downloads.request"),
2803
+ requestId: z.string(),
2804
+ workspaceId: z.string().min(1),
2805
+ });
2806
+ export const BrowserListDownloadsResponseSchema = z.object({
2807
+ type: z.literal("browser.list_downloads.response"),
2808
+ payload: z.object({ requestId: z.string(), downloads: BrowserDownloadListSchema }),
2809
+ });
2799
2810
  export const BrowserHostRegisterRequestSchema = z.object({
2811
+ downloadReceipts: z.boolean().optional(),
2812
+ pluginBrowserVersion: z.number().int().positive().optional(),
2800
2813
  type: z.literal("browser.host.register.request"),
2801
2814
  requestId: z.string(),
2802
2815
  hostKind: z.string().min(1),
@@ -2836,6 +2849,10 @@ export const SessionInboundMessageSchema = z.discriminatedUnion("type", [
2836
2849
  HostsRouteFrameRequestSchema,
2837
2850
  HostsRouteCloseRequestSchema,
2838
2851
  BrowserHostRegisterRequestSchema,
2852
+ BrowserListDownloadsRequestSchema,
2853
+ PluginBrowserRequestSchema,
2854
+ PluginBrowserGrantUpdateRequestSchema,
2855
+ PluginBrowserHostResponseSchema,
2839
2856
  SubscriptionReleaseRequestSchema,
2840
2857
  SessionEventsSetSubscriptionRequestSchema,
2841
2858
  HubExecutionAgentCreateRequestSchema,
@@ -3289,6 +3306,8 @@ export const ServerInfoStatusPayloadSchema = z
3289
3306
  // COMPAT(builtinPluginToggles): added in v0.11.0-beta.4; plugin.list can include built-ins and
3290
3307
  // plugin.enable/disable accept built-in IDs. No current client reads it; remove after 2027-04-05.
3291
3308
  builtinPluginToggles: z.boolean().optional(),
3309
+ browserDownloadReceipts: z.boolean().optional(),
3310
+ pluginBrowserVersion: z.number().int().positive().optional(),
3292
3311
  // COMPAT(pluginThemes): added in v0.5.0, remove gate after 2027-08-20.
3293
3312
  // A daemon that predates this flag keeps `addTheme` in the server bundle it compiles,
3294
3313
  // so a theme plugin cannot start there at all.
@@ -5341,7 +5360,6 @@ export const PullRequestTimelineResponseSchema = z.object({
5341
5360
  // daemon floor is >= v0.2.0.
5342
5361
  authState: ForgeAuthStateSchema,
5343
5362
  })
5344
- .optional()
5345
5363
  .prefault({}),
5346
5364
  });
5347
5365
  export const CheckoutSwitchBranchResponseSchema = z.object({
@@ -6195,6 +6213,7 @@ export const PluginListItemSchema = z.object({
6195
6213
  source: z.enum(["directory", "git"]).optional(),
6196
6214
  npm: PluginNpmInstallationSchema.optional(),
6197
6215
  installation: PluginInstallationSchema.optional(),
6216
+ browserIdentity: PluginBrowserIdentitySchema.optional(),
6198
6217
  remote: z.string().optional(),
6199
6218
  ref: z.string().optional(),
6200
6219
  commit: z.string().optional(),
@@ -6355,6 +6374,10 @@ export const SessionOutboundMessageSchema = z.discriminatedUnion("type", [
6355
6374
  HostsRouteFrameSchema,
6356
6375
  HostsRouteClosedSchema,
6357
6376
  BrowserHostRegisterResponseSchema,
6377
+ BrowserListDownloadsResponseSchema,
6378
+ PluginBrowserResponseSchema,
6379
+ PluginBrowserGrantUpdateResponseSchema,
6380
+ PluginBrowserHostRequestSchema,
6358
6381
  SubscriptionReleaseResponseSchema,
6359
6382
  SessionEventsSetSubscriptionResponseSchema,
6360
6383
  HubExecutionAgentCreateResponseSchema,
@@ -0,0 +1,193 @@
1
+ export declare const pluginBrowserConsentCopy: {
2
+ readonly en: {
3
+ readonly title: "Browser permissions";
4
+ readonly workspace: "Workspace";
5
+ readonly choose: "Choose a workspace";
6
+ readonly read: "Read and navigate";
7
+ readonly upload: "Upload workspace images";
8
+ readonly lifetime: "Access ends when the plugin reloads or Mateo restarts. Upload also requires read access.";
9
+ readonly allow: "Allow";
10
+ readonly revoke: "Revoke";
11
+ readonly cancel: "Cancel";
12
+ };
13
+ readonly ar: {
14
+ readonly title: "أذونات المتصفح";
15
+ readonly workspace: "مساحة العمل";
16
+ readonly choose: "اختر مساحة عمل";
17
+ readonly read: "القراءة والتنقل";
18
+ readonly upload: "رفع صور مساحة العمل";
19
+ readonly lifetime: "ينتهي الوصول عند إعادة تحميل الإضافة أو إعادة تشغيل Mateo. يتطلب الرفع إذن القراءة أيضًا.";
20
+ readonly allow: "السماح";
21
+ readonly revoke: "إلغاء الإذن";
22
+ readonly cancel: "إلغاء";
23
+ };
24
+ readonly es: {
25
+ readonly title: "Permisos del navegador";
26
+ readonly workspace: "Espacio de trabajo";
27
+ readonly choose: "Elige un espacio de trabajo";
28
+ readonly read: "Leer y navegar";
29
+ readonly upload: "Subir imágenes del espacio de trabajo";
30
+ readonly lifetime: "El acceso termina al recargar el plugin o reiniciar Mateo. Para subir imágenes también se necesita permiso de lectura.";
31
+ readonly allow: "Permitir";
32
+ readonly revoke: "Revocar";
33
+ readonly cancel: "Cancelar";
34
+ };
35
+ readonly fr: {
36
+ readonly title: "Autorisations du navigateur";
37
+ readonly workspace: "Espace de travail";
38
+ readonly choose: "Choisir un espace de travail";
39
+ readonly read: "Lire et naviguer";
40
+ readonly upload: "Envoyer des images de l’espace de travail";
41
+ 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.";
42
+ readonly allow: "Autoriser";
43
+ readonly revoke: "Révoquer";
44
+ readonly cancel: "Annuler";
45
+ };
46
+ readonly ja: {
47
+ readonly title: "ブラウザの権限";
48
+ readonly workspace: "ワークスペース";
49
+ readonly choose: "ワークスペースを選択";
50
+ readonly read: "読み取りと移動";
51
+ readonly upload: "ワークスペースの画像をアップロード";
52
+ readonly lifetime: "プラグインの再読み込みまたは Mateo の再起動で権限は失効します。アップロードには読み取り権限も必要です。";
53
+ readonly allow: "許可";
54
+ readonly revoke: "取り消す";
55
+ readonly cancel: "キャンセル";
56
+ };
57
+ readonly ko: {
58
+ readonly title: "브라우저 권한";
59
+ readonly workspace: "작업 공간";
60
+ readonly choose: "작업 공간 선택";
61
+ readonly read: "읽기 및 탐색";
62
+ readonly upload: "작업 공간 이미지 업로드";
63
+ readonly lifetime: "플러그인을 다시 로드하거나 Mateo를 다시 시작하면 권한이 만료됩니다. 업로드하려면 읽기 권한도 필요합니다.";
64
+ readonly allow: "허용";
65
+ readonly revoke: "권한 취소";
66
+ readonly cancel: "취소";
67
+ };
68
+ readonly "pt-BR": {
69
+ readonly title: "Permissões do navegador";
70
+ readonly workspace: "Espaço de trabalho";
71
+ readonly choose: "Escolha um espaço de trabalho";
72
+ readonly read: "Ler e navegar";
73
+ readonly upload: "Enviar imagens do espaço de trabalho";
74
+ readonly lifetime: "O acesso termina ao recarregar o plugin ou reiniciar o Mateo. O envio também exige permissão de leitura.";
75
+ readonly allow: "Permitir";
76
+ readonly revoke: "Revogar";
77
+ readonly cancel: "Cancelar";
78
+ };
79
+ readonly ru: {
80
+ readonly title: "Разрешения браузера";
81
+ readonly workspace: "Рабочая область";
82
+ readonly choose: "Выберите рабочую область";
83
+ readonly read: "Чтение и навигация";
84
+ readonly upload: "Загрузка изображений из рабочей области";
85
+ readonly lifetime: "Доступ прекращается при перезагрузке плагина или перезапуске Mateo. Для загрузки также требуется разрешение на чтение.";
86
+ readonly allow: "Разрешить";
87
+ readonly revoke: "Отозвать";
88
+ readonly cancel: "Отмена";
89
+ };
90
+ readonly "zh-CN": {
91
+ readonly title: "浏览器权限";
92
+ readonly workspace: "工作区";
93
+ readonly choose: "选择工作区";
94
+ readonly read: "读取和导航";
95
+ readonly upload: "上传工作区图片";
96
+ readonly lifetime: "重新加载插件或重启 Mateo 后,授权会失效。上传图片还需要读取权限。";
97
+ readonly allow: "允许";
98
+ readonly revoke: "撤销";
99
+ readonly cancel: "取消";
100
+ };
101
+ };
102
+ export declare function browserConsentCopy(language: string): {
103
+ readonly title: "Browser permissions";
104
+ readonly workspace: "Workspace";
105
+ readonly choose: "Choose a workspace";
106
+ readonly read: "Read and navigate";
107
+ readonly upload: "Upload workspace images";
108
+ readonly lifetime: "Access ends when the plugin reloads or Mateo restarts. Upload also requires read access.";
109
+ readonly allow: "Allow";
110
+ readonly revoke: "Revoke";
111
+ readonly cancel: "Cancel";
112
+ } | {
113
+ readonly title: "أذونات المتصفح";
114
+ readonly workspace: "مساحة العمل";
115
+ readonly choose: "اختر مساحة عمل";
116
+ readonly read: "القراءة والتنقل";
117
+ readonly upload: "رفع صور مساحة العمل";
118
+ readonly lifetime: "ينتهي الوصول عند إعادة تحميل الإضافة أو إعادة تشغيل Mateo. يتطلب الرفع إذن القراءة أيضًا.";
119
+ readonly allow: "السماح";
120
+ readonly revoke: "إلغاء الإذن";
121
+ readonly cancel: "إلغاء";
122
+ } | {
123
+ readonly title: "Permisos del navegador";
124
+ readonly workspace: "Espacio de trabajo";
125
+ readonly choose: "Elige un espacio de trabajo";
126
+ readonly read: "Leer y navegar";
127
+ readonly upload: "Subir imágenes del espacio de trabajo";
128
+ readonly lifetime: "El acceso termina al recargar el plugin o reiniciar Mateo. Para subir imágenes también se necesita permiso de lectura.";
129
+ readonly allow: "Permitir";
130
+ readonly revoke: "Revocar";
131
+ readonly cancel: "Cancelar";
132
+ } | {
133
+ readonly title: "Autorisations du navigateur";
134
+ readonly workspace: "Espace de travail";
135
+ readonly choose: "Choisir un espace de travail";
136
+ readonly read: "Lire et naviguer";
137
+ readonly upload: "Envoyer des images de l’espace de travail";
138
+ 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.";
139
+ readonly allow: "Autoriser";
140
+ readonly revoke: "Révoquer";
141
+ readonly cancel: "Annuler";
142
+ } | {
143
+ readonly title: "ブラウザの権限";
144
+ readonly workspace: "ワークスペース";
145
+ readonly choose: "ワークスペースを選択";
146
+ readonly read: "読み取りと移動";
147
+ readonly upload: "ワークスペースの画像をアップロード";
148
+ readonly lifetime: "プラグインの再読み込みまたは Mateo の再起動で権限は失効します。アップロードには読み取り権限も必要です。";
149
+ readonly allow: "許可";
150
+ readonly revoke: "取り消す";
151
+ readonly cancel: "キャンセル";
152
+ } | {
153
+ readonly title: "브라우저 권한";
154
+ readonly workspace: "작업 공간";
155
+ readonly choose: "작업 공간 선택";
156
+ readonly read: "읽기 및 탐색";
157
+ readonly upload: "작업 공간 이미지 업로드";
158
+ readonly lifetime: "플러그인을 다시 로드하거나 Mateo를 다시 시작하면 권한이 만료됩니다. 업로드하려면 읽기 권한도 필요합니다.";
159
+ readonly allow: "허용";
160
+ readonly revoke: "권한 취소";
161
+ readonly cancel: "취소";
162
+ } | {
163
+ readonly title: "Permissões do navegador";
164
+ readonly workspace: "Espaço de trabalho";
165
+ readonly choose: "Escolha um espaço de trabalho";
166
+ readonly read: "Ler e navegar";
167
+ readonly upload: "Enviar imagens do espaço de trabalho";
168
+ readonly lifetime: "O acesso termina ao recarregar o plugin ou reiniciar o Mateo. O envio também exige permissão de leitura.";
169
+ readonly allow: "Permitir";
170
+ readonly revoke: "Revogar";
171
+ readonly cancel: "Cancelar";
172
+ } | {
173
+ readonly title: "Разрешения браузера";
174
+ readonly workspace: "Рабочая область";
175
+ readonly choose: "Выберите рабочую область";
176
+ readonly read: "Чтение и навигация";
177
+ readonly upload: "Загрузка изображений из рабочей области";
178
+ readonly lifetime: "Доступ прекращается при перезагрузке плагина или перезапуске Mateo. Для загрузки также требуется разрешение на чтение.";
179
+ readonly allow: "Разрешить";
180
+ readonly revoke: "Отозвать";
181
+ readonly cancel: "Отмена";
182
+ } | {
183
+ readonly title: "浏览器权限";
184
+ readonly workspace: "工作区";
185
+ readonly choose: "选择工作区";
186
+ readonly read: "读取和导航";
187
+ readonly upload: "上传工作区图片";
188
+ readonly lifetime: "重新加载插件或重启 Mateo 后,授权会失效。上传图片还需要读取权限。";
189
+ readonly allow: "允许";
190
+ readonly revoke: "撤销";
191
+ readonly cancel: "取消";
192
+ };
193
+ //# sourceMappingURL=plugin-browser-consent-copy.d.ts.map
@@ -0,0 +1,109 @@
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
+ workspace: "Workspace",
7
+ choose: "Choose a workspace",
8
+ read: "Read and navigate",
9
+ upload: "Upload workspace images",
10
+ lifetime: "Access ends when the plugin reloads or Mateo restarts. Upload also requires read access.",
11
+ allow: "Allow",
12
+ revoke: "Revoke",
13
+ cancel: "Cancel",
14
+ },
15
+ ar: {
16
+ title: "أذونات المتصفح",
17
+ workspace: "مساحة العمل",
18
+ choose: "اختر مساحة عمل",
19
+ read: "القراءة والتنقل",
20
+ upload: "رفع صور مساحة العمل",
21
+ lifetime: "ينتهي الوصول عند إعادة تحميل الإضافة أو إعادة تشغيل Mateo. يتطلب الرفع إذن القراءة أيضًا.",
22
+ allow: "السماح",
23
+ revoke: "إلغاء الإذن",
24
+ cancel: "إلغاء",
25
+ },
26
+ es: {
27
+ title: "Permisos del navegador",
28
+ workspace: "Espacio de trabajo",
29
+ choose: "Elige un espacio de trabajo",
30
+ read: "Leer y navegar",
31
+ upload: "Subir imágenes del espacio de trabajo",
32
+ lifetime: "El acceso termina al recargar el plugin o reiniciar Mateo. Para subir imágenes también se necesita permiso de lectura.",
33
+ allow: "Permitir",
34
+ revoke: "Revocar",
35
+ cancel: "Cancelar",
36
+ },
37
+ fr: {
38
+ title: "Autorisations du navigateur",
39
+ workspace: "Espace de travail",
40
+ choose: "Choisir un espace de travail",
41
+ read: "Lire et naviguer",
42
+ upload: "Envoyer des images de l’espace de travail",
43
+ 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.",
44
+ allow: "Autoriser",
45
+ revoke: "Révoquer",
46
+ cancel: "Annuler",
47
+ },
48
+ ja: {
49
+ title: "ブラウザの権限",
50
+ workspace: "ワークスペース",
51
+ choose: "ワークスペースを選択",
52
+ read: "読み取りと移動",
53
+ upload: "ワークスペースの画像をアップロード",
54
+ lifetime: "プラグインの再読み込みまたは Mateo の再起動で権限は失効します。アップロードには読み取り権限も必要です。",
55
+ allow: "許可",
56
+ revoke: "取り消す",
57
+ cancel: "キャンセル",
58
+ },
59
+ ko: {
60
+ title: "브라우저 권한",
61
+ workspace: "작업 공간",
62
+ choose: "작업 공간 선택",
63
+ read: "읽기 및 탐색",
64
+ upload: "작업 공간 이미지 업로드",
65
+ lifetime: "플러그인을 다시 로드하거나 Mateo를 다시 시작하면 권한이 만료됩니다. 업로드하려면 읽기 권한도 필요합니다.",
66
+ allow: "허용",
67
+ revoke: "권한 취소",
68
+ cancel: "취소",
69
+ },
70
+ "pt-BR": {
71
+ title: "Permissões do navegador",
72
+ workspace: "Espaço de trabalho",
73
+ choose: "Escolha um espaço de trabalho",
74
+ read: "Ler e navegar",
75
+ upload: "Enviar imagens do espaço de trabalho",
76
+ lifetime: "O acesso termina ao recarregar o plugin ou reiniciar o Mateo. O envio também exige permissão de leitura.",
77
+ allow: "Permitir",
78
+ revoke: "Revogar",
79
+ cancel: "Cancelar",
80
+ },
81
+ ru: {
82
+ title: "Разрешения браузера",
83
+ workspace: "Рабочая область",
84
+ choose: "Выберите рабочую область",
85
+ read: "Чтение и навигация",
86
+ upload: "Загрузка изображений из рабочей области",
87
+ lifetime: "Доступ прекращается при перезагрузке плагина или перезапуске Mateo. Для загрузки также требуется разрешение на чтение.",
88
+ allow: "Разрешить",
89
+ revoke: "Отозвать",
90
+ cancel: "Отмена",
91
+ },
92
+ "zh-CN": {
93
+ title: "浏览器权限",
94
+ workspace: "工作区",
95
+ choose: "选择工作区",
96
+ read: "读取和导航",
97
+ upload: "上传工作区图片",
98
+ lifetime: "重新加载插件或重启 Mateo 后,授权会失效。上传图片还需要读取权限。",
99
+ allow: "允许",
100
+ revoke: "撤销",
101
+ cancel: "取消",
102
+ },
103
+ };
104
+ export function browserConsentCopy(language) {
105
+ return Object.hasOwn(pluginBrowserConsentCopy, language)
106
+ ? pluginBrowserConsentCopy[language]
107
+ : pluginBrowserConsentCopy.en;
108
+ }
109
+ //# 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