@ai-switch/tauri-plugin-runtime 0.1.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 (77) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +327 -0
  3. package/THIRD_PARTY_NOTICES.md +210 -0
  4. package/dist/bridge/handshake.d.ts +11 -0
  5. package/dist/bridge/json-codec.d.ts +4 -0
  6. package/dist/bridge/rpc-peer.d.ts +7 -0
  7. package/dist/bridge/rpc-types.d.ts +20 -0
  8. package/dist/chunk-CFQSUF5W.js +1794 -0
  9. package/dist/chunk-JSBRDJBE.js +30 -0
  10. package/dist/chunk-K5YWIJN6.js +389 -0
  11. package/dist/chunk-PW7XHHWG.js +403 -0
  12. package/dist/chunk-RKQEK7DY.js +13879 -0
  13. package/dist/chunk-WT62GTMC.js +18 -0
  14. package/dist/chunk-YI6NQ6WR.js +513 -0
  15. package/dist/host/event-router.d.ts +19 -0
  16. package/dist/host/file-handles.d.ts +15 -0
  17. package/dist/host/host.d.ts +2 -0
  18. package/dist/host/index.d.ts +4 -0
  19. package/dist/host/index.js +791 -0
  20. package/dist/host/policy.d.ts +7 -0
  21. package/dist/host/requests.d.ts +13 -0
  22. package/dist/host/types.d.ts +19 -0
  23. package/dist/host/view.d.ts +18 -0
  24. package/dist/index.d.ts +2 -0
  25. package/dist/index.js +9 -0
  26. package/dist/node/buffer.d.ts +7 -0
  27. package/dist/node/buffer.js +8 -0
  28. package/dist/node/events.d.ts +12 -0
  29. package/dist/node/events.js +458 -0
  30. package/dist/node/fs/backend.d.ts +8 -0
  31. package/dist/node/fs/callback-types.d.ts +43 -0
  32. package/dist/node/fs/callbacks.d.ts +3 -0
  33. package/dist/node/fs/client.d.ts +3 -0
  34. package/dist/node/fs/errors.d.ts +5 -0
  35. package/dist/node/fs/lifecycle.d.ts +11 -0
  36. package/dist/node/fs/options.d.ts +7 -0
  37. package/dist/node/fs/promises.d.ts +33 -0
  38. package/dist/node/fs/promises.js +30 -0
  39. package/dist/node/fs/transfer.d.ts +7 -0
  40. package/dist/node/fs/types.d.ts +86 -0
  41. package/dist/node/fs.d.ts +36 -0
  42. package/dist/node/fs.js +92 -0
  43. package/dist/node/path.d.ts +20 -0
  44. package/dist/node/path.js +434 -0
  45. package/dist/plugin/client.d.ts +4 -0
  46. package/dist/plugin/connection.d.ts +6 -0
  47. package/dist/plugin/errors.d.ts +3 -0
  48. package/dist/plugin/index.d.ts +6 -0
  49. package/dist/plugin/index.js +12 -0
  50. package/dist/plugin/types.d.ts +28 -0
  51. package/dist/protocol/capabilities.d.ts +8 -0
  52. package/dist/protocol/errors.d.ts +14 -0
  53. package/dist/protocol/generated/capabilities.generated.d.ts +56 -0
  54. package/dist/protocol/generated/fs.generated.d.ts +178 -0
  55. package/dist/protocol/generated/host-event.generated.d.ts +17 -0
  56. package/dist/protocol/generated/manifest.generated.d.ts +64 -0
  57. package/dist/protocol/generated/session.generated.d.ts +93 -0
  58. package/dist/protocol/generated/types.generated.d.ts +6 -0
  59. package/dist/protocol/generated/validators.generated.d.mts +24 -0
  60. package/dist/protocol/generated/wire.generated.d.ts +63 -0
  61. package/dist/protocol/index.d.ts +18 -0
  62. package/dist/protocol/index.js +746 -0
  63. package/dist/protocol/json-safety.d.ts +3 -0
  64. package/dist/protocol/limits.d.ts +11 -0
  65. package/dist/protocol/manifest.d.ts +5 -0
  66. package/dist/protocol/path-policy.d.ts +2 -0
  67. package/dist/protocol/schema/capabilities.schema.json +301 -0
  68. package/dist/protocol/schema/fs.schema.json +900 -0
  69. package/dist/protocol/schema/host-event.schema.json +116 -0
  70. package/dist/protocol/schema/manifest.schema.json +60 -0
  71. package/dist/protocol/schema/session.schema.json +145 -0
  72. package/dist/protocol/schema/wire.schema.json +358 -0
  73. package/dist/protocol/session.d.ts +3 -0
  74. package/dist/protocol/types.d.ts +27 -0
  75. package/dist/protocol/validation.d.ts +2 -0
  76. package/dist/protocol/wire.d.ts +16 -0
  77. package/package.json +95 -0
@@ -0,0 +1,3 @@
1
+ import type { JsonValue, ValidationResult } from "./types.js";
2
+ /** Validate before schema traversal or serialization; never read an accessor. */
3
+ export declare function validateJson(value: unknown, maxBytes?: number): ValidationResult<JsonValue>;
@@ -0,0 +1,11 @@
1
+ export declare const protocolVersion: "aplg/1";
2
+ export declare const apiVersion: "1.0.0";
3
+ export declare const limits: Readonly<{
4
+ readonly controlBytes: 1048576;
5
+ readonly fileChunkBytes: 262144;
6
+ readonly fileBytes: 8388608;
7
+ readonly fileTransfers: 2;
8
+ readonly archiveBytes: 134217728;
9
+ readonly archiveExtractedBytes: 536870912;
10
+ readonly archiveEntries: 10000;
11
+ }>;
@@ -0,0 +1,5 @@
1
+ import type { Manifest } from "./generated/types.generated.js";
2
+ import { type ValidationResult } from "./types.js";
3
+ export declare function satisfiesApiRange(version: string, range: string): boolean;
4
+ export declare function validateManifest(value: unknown): ValidationResult<Manifest>;
5
+ export declare function parseManifest(value: unknown): Manifest;
@@ -0,0 +1,2 @@
1
+ export declare function normalizeArchivePath(path: string): string;
2
+ export declare function validateVirtualPath(path: string): string;
@@ -0,0 +1,301 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "https://ai-switch.github.io/aplg/schema/v1/capabilities.schema.json",
4
+ "title": "StandardCapabilityMessage",
5
+ "oneOf": [
6
+ {
7
+ "type": "object",
8
+ "additionalProperties": false,
9
+ "required": [
10
+ "capability",
11
+ "method",
12
+ "direction",
13
+ "value"
14
+ ],
15
+ "properties": {
16
+ "capability": {
17
+ "const": "aplg.storage"
18
+ },
19
+ "method": {
20
+ "const": "get"
21
+ },
22
+ "direction": {
23
+ "const": "request"
24
+ },
25
+ "value": {
26
+ "type": "object",
27
+ "additionalProperties": false,
28
+ "required": [
29
+ "key"
30
+ ],
31
+ "properties": {
32
+ "key": {
33
+ "type": "string",
34
+ "minLength": 1,
35
+ "maxLength": 1024
36
+ }
37
+ }
38
+ }
39
+ }
40
+ },
41
+ {
42
+ "type": "object",
43
+ "additionalProperties": false,
44
+ "required": [
45
+ "capability",
46
+ "method",
47
+ "direction",
48
+ "value"
49
+ ],
50
+ "properties": {
51
+ "capability": {
52
+ "const": "aplg.storage"
53
+ },
54
+ "method": {
55
+ "const": "get"
56
+ },
57
+ "direction": {
58
+ "const": "result"
59
+ },
60
+ "value": {
61
+ "$ref": "#/definitions/jsonValue"
62
+ }
63
+ }
64
+ },
65
+ {
66
+ "type": "object",
67
+ "additionalProperties": false,
68
+ "required": [
69
+ "capability",
70
+ "method",
71
+ "direction",
72
+ "value"
73
+ ],
74
+ "properties": {
75
+ "capability": {
76
+ "const": "aplg.storage"
77
+ },
78
+ "method": {
79
+ "const": "set"
80
+ },
81
+ "direction": {
82
+ "const": "request"
83
+ },
84
+ "value": {
85
+ "type": "object",
86
+ "additionalProperties": false,
87
+ "required": [
88
+ "key",
89
+ "value"
90
+ ],
91
+ "properties": {
92
+ "key": {
93
+ "type": "string",
94
+ "minLength": 1,
95
+ "maxLength": 1024
96
+ },
97
+ "value": {
98
+ "$ref": "#/definitions/jsonValue"
99
+ }
100
+ }
101
+ }
102
+ }
103
+ },
104
+ {
105
+ "type": "object",
106
+ "additionalProperties": false,
107
+ "required": [
108
+ "capability",
109
+ "method",
110
+ "direction",
111
+ "value"
112
+ ],
113
+ "properties": {
114
+ "capability": {
115
+ "const": "aplg.storage"
116
+ },
117
+ "method": {
118
+ "const": "set"
119
+ },
120
+ "direction": {
121
+ "const": "result"
122
+ },
123
+ "value": {
124
+ "type": "null"
125
+ }
126
+ }
127
+ },
128
+ {
129
+ "type": "object",
130
+ "additionalProperties": false,
131
+ "required": [
132
+ "capability",
133
+ "method",
134
+ "direction",
135
+ "value"
136
+ ],
137
+ "properties": {
138
+ "capability": {
139
+ "const": "aplg.storage"
140
+ },
141
+ "method": {
142
+ "const": "remove"
143
+ },
144
+ "direction": {
145
+ "const": "request"
146
+ },
147
+ "value": {
148
+ "type": "object",
149
+ "additionalProperties": false,
150
+ "required": [
151
+ "key"
152
+ ],
153
+ "properties": {
154
+ "key": {
155
+ "type": "string",
156
+ "minLength": 1,
157
+ "maxLength": 1024
158
+ }
159
+ }
160
+ }
161
+ }
162
+ },
163
+ {
164
+ "type": "object",
165
+ "additionalProperties": false,
166
+ "required": [
167
+ "capability",
168
+ "method",
169
+ "direction",
170
+ "value"
171
+ ],
172
+ "properties": {
173
+ "capability": {
174
+ "const": "aplg.storage"
175
+ },
176
+ "method": {
177
+ "const": "remove"
178
+ },
179
+ "direction": {
180
+ "const": "result"
181
+ },
182
+ "value": {
183
+ "type": "null"
184
+ }
185
+ }
186
+ },
187
+ {
188
+ "type": "object",
189
+ "additionalProperties": false,
190
+ "required": [
191
+ "capability",
192
+ "method",
193
+ "direction",
194
+ "value"
195
+ ],
196
+ "properties": {
197
+ "capability": {
198
+ "const": "aplg.dialog"
199
+ },
200
+ "method": {
201
+ "const": "pickDirectory"
202
+ },
203
+ "direction": {
204
+ "const": "request"
205
+ },
206
+ "value": {
207
+ "type": "object",
208
+ "additionalProperties": false,
209
+ "required": [],
210
+ "properties": {
211
+ "access": {
212
+ "enum": [
213
+ "read",
214
+ "readwrite"
215
+ ]
216
+ }
217
+ }
218
+ }
219
+ }
220
+ },
221
+ {
222
+ "type": "object",
223
+ "additionalProperties": false,
224
+ "required": [
225
+ "capability",
226
+ "method",
227
+ "direction",
228
+ "value"
229
+ ],
230
+ "properties": {
231
+ "capability": {
232
+ "const": "aplg.dialog"
233
+ },
234
+ "method": {
235
+ "const": "pickDirectory"
236
+ },
237
+ "direction": {
238
+ "const": "result"
239
+ },
240
+ "value": {
241
+ "anyOf": [
242
+ {
243
+ "type": "null"
244
+ },
245
+ {
246
+ "type": "object",
247
+ "additionalProperties": false,
248
+ "required": [
249
+ "path",
250
+ "access"
251
+ ],
252
+ "properties": {
253
+ "path": {
254
+ "type": "string",
255
+ "minLength": 1,
256
+ "maxLength": 4096
257
+ },
258
+ "access": {
259
+ "enum": [
260
+ "read",
261
+ "readwrite"
262
+ ]
263
+ }
264
+ }
265
+ }
266
+ ]
267
+ }
268
+ }
269
+ }
270
+ ],
271
+ "definitions": {
272
+ "jsonValue": {
273
+ "anyOf": [
274
+ {
275
+ "type": "null"
276
+ },
277
+ {
278
+ "type": "boolean"
279
+ },
280
+ {
281
+ "type": "number"
282
+ },
283
+ {
284
+ "type": "string"
285
+ },
286
+ {
287
+ "type": "array",
288
+ "items": {
289
+ "$ref": "#/definitions/jsonValue"
290
+ }
291
+ },
292
+ {
293
+ "type": "object",
294
+ "additionalProperties": {
295
+ "$ref": "#/definitions/jsonValue"
296
+ }
297
+ }
298
+ ]
299
+ }
300
+ }
301
+ }