dsh-permission-rules 0.7.1 → 0.7.3

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.
@@ -23,8 +23,46 @@ export declare const TYPERT: Readonly<{
23
23
  }>;
24
24
  readonly parameters: readonly never[];
25
25
  readonly result: Readonly<{
26
+ create: () => import("zod").ZodObject<{
27
+ enabled: import("zod").ZodBoolean;
28
+ mode: import("zod").ZodUnion<readonly [import("zod").ZodLiteral<"deny-all">, import("zod").ZodLiteral<"whitelist">, import("zod").ZodLiteral<"allow-all">]>;
29
+ configuredMode: import("zod").ZodUnion<readonly [import("zod").ZodLiteral<"auto">, import("zod").ZodLiteral<"deny-all">, import("zod").ZodLiteral<"whitelist">, import("zod").ZodLiteral<"allow-all">]>;
30
+ sandboxMode: import("zod").ZodNullable<import("zod").ZodString>;
31
+ proxyPort: import("zod").ZodNumber;
32
+ proxyActive: import("zod").ZodBoolean;
33
+ denied: import("zod").ZodNumber;
34
+ askBlocked: import("zod").ZodNumber;
35
+ recent: import("zod").ZodArray<import("zod").ZodObject<{
36
+ time: import("zod").ZodNumber;
37
+ tool: import("zod").ZodString;
38
+ attributed: import("zod").ZodBoolean;
39
+ domain: import("zod").ZodString;
40
+ scheme: import("zod").ZodUnion<readonly [import("zod").ZodLiteral<"http">, import("zod").ZodLiteral<"https">, import("zod").ZodNull]>;
41
+ port: import("zod").ZodNullable<import("zod").ZodNumber>;
42
+ action: import("zod").ZodUnion<readonly [import("zod").ZodLiteral<"deny">, import("zod").ZodLiteral<"ask">]>;
43
+ mode: import("zod").ZodUnion<readonly [import("zod").ZodLiteral<"deny-all">, import("zod").ZodLiteral<"whitelist">, import("zod").ZodLiteral<"allow-all">]>;
44
+ matched: import("zod").ZodBoolean;
45
+ source: import("zod").ZodString;
46
+ ruleIndex: import("zod").ZodNullable<import("zod").ZodNumber>;
47
+ reason: import("zod").ZodNullable<import("zod").ZodString>;
48
+ cwd: import("zod").ZodNullable<import("zod").ZodString>;
49
+ }, import("zod/v4/core").$strip>>;
50
+ sources: import("zod").ZodArray<import("zod").ZodObject<{
51
+ path: import("zod").ZodString;
52
+ exists: import("zod").ZodBoolean;
53
+ cwd: import("zod").ZodNullable<import("zod").ZodString>;
54
+ }, import("zod/v4/core").$strip>>;
55
+ allowHostAction: import("zod").ZodBoolean;
56
+ upstream: import("zod").ZodObject<{
57
+ mode: import("zod").ZodUnion<readonly [import("zod").ZodLiteral<"off">, import("zod").ZodLiteral<"inherit">, import("zod").ZodLiteral<"url">]>;
58
+ http: import("zod").ZodNullable<import("zod").ZodString>;
59
+ https: import("zod").ZodNullable<import("zod").ZodString>;
60
+ active: import("zod").ZodBoolean;
61
+ chained: import("zod").ZodNumber;
62
+ }, import("zod/v4/core").$strip>;
63
+ }, import("zod/v4/core").$strip>;
26
64
  mode: "strict";
27
- typeSymbol: "dsh-permission-rules/types#PermissionRulesSnapshot";
65
+ typeSymbol: string;
28
66
  schema: import("zod").ZodObject<{
29
67
  enabled: import("zod").ZodBoolean;
30
68
  mode: import("zod").ZodUnion<readonly [import("zod").ZodLiteral<"deny-all">, import("zod").ZodLiteral<"whitelist">, import("zod").ZodLiteral<"allow-all">]>;
@@ -82,14 +120,21 @@ export declare const TYPERT: Readonly<{
82
120
  wire: string;
83
121
  source: "json";
84
122
  codec: Readonly<{
123
+ create: () => import("zod").ZodString;
85
124
  mode: "strict";
86
- typeSymbol: "dsh-permission-rules/types#RulesReadRequestPath";
125
+ typeSymbol: string;
87
126
  schema: import("zod").ZodString;
88
127
  }>;
89
128
  }>[];
90
129
  readonly result: Readonly<{
130
+ create: () => import("zod").ZodObject<{
131
+ path: import("zod").ZodString;
132
+ exists: import("zod").ZodBoolean;
133
+ text: import("zod").ZodString;
134
+ error: import("zod").ZodNullable<import("zod").ZodString>;
135
+ }, import("zod/v4/core").$strip>;
91
136
  mode: "strict";
92
- typeSymbol: "dsh-permission-rules/types#RulesReadResult";
137
+ typeSymbol: string;
93
138
  schema: import("zod").ZodObject<{
94
139
  path: import("zod").ZodString;
95
140
  exists: import("zod").ZodBoolean;
@@ -110,28 +155,25 @@ export declare const TYPERT: Readonly<{
110
155
  readonly invocation: Readonly<{
111
156
  kind: "direct";
112
157
  }>;
113
- readonly parameters: readonly (Readonly<{
114
- name: string;
115
- wire: string;
116
- source: "json";
117
- codec: Readonly<{
118
- mode: "strict";
119
- typeSymbol: "dsh-permission-rules/types#RulesSaveRequestPath";
120
- schema: import("zod").ZodString;
121
- }>;
122
- }> | Readonly<{
158
+ readonly parameters: readonly Readonly<{
123
159
  name: string;
124
160
  wire: string;
125
161
  source: "json";
126
162
  codec: Readonly<{
163
+ create: () => import("zod").ZodString;
127
164
  mode: "strict";
128
- typeSymbol: "dsh-permission-rules/types#RulesSaveRequestText";
165
+ typeSymbol: string;
129
166
  schema: import("zod").ZodString;
130
167
  }>;
131
- }>)[];
168
+ }>[];
132
169
  readonly result: Readonly<{
170
+ create: () => import("zod").ZodObject<{
171
+ ok: import("zod").ZodBoolean;
172
+ error: import("zod").ZodNullable<import("zod").ZodString>;
173
+ reloaded: import("zod").ZodNullable<import("zod").ZodNumber>;
174
+ }, import("zod/v4/core").$strip>;
133
175
  mode: "strict";
134
- typeSymbol: "dsh-permission-rules/types#RulesSaveResult";
176
+ typeSymbol: string;
135
177
  schema: import("zod").ZodObject<{
136
178
  ok: import("zod").ZodBoolean;
137
179
  error: import("zod").ZodNullable<import("zod").ZodString>;
@@ -153,8 +195,12 @@ export declare const TYPERT: Readonly<{
153
195
  }>;
154
196
  readonly parameters: readonly never[];
155
197
  readonly result: Readonly<{
198
+ create: () => import("zod").ZodObject<{
199
+ ok: import("zod").ZodBoolean;
200
+ error: import("zod").ZodNullable<import("zod").ZodString>;
201
+ }, import("zod/v4/core").$strip>;
156
202
  mode: "strict";
157
- typeSymbol: "dsh-permission-rules/types#RulesReloadResult";
203
+ typeSymbol: string;
158
204
  schema: import("zod").ZodObject<{
159
205
  ok: import("zod").ZodBoolean;
160
206
  error: import("zod").ZodNullable<import("zod").ZodString>;
@@ -178,8 +224,14 @@ export declare const TYPERT: Readonly<{
178
224
  wire: string;
179
225
  source: "json";
180
226
  codec: Readonly<{
227
+ create: () => import("zod").ZodObject<{
228
+ host: import("zod").ZodString;
229
+ scheme: import("zod").ZodUnion<readonly [import("zod").ZodLiteral<"http">, import("zod").ZodLiteral<"https">, import("zod").ZodNull]>;
230
+ port: import("zod").ZodNullable<import("zod").ZodNumber>;
231
+ cwd: import("zod").ZodNullable<import("zod").ZodString>;
232
+ }, import("zod/v4/core").$strip>;
181
233
  mode: "strict";
182
- typeSymbol: "dsh-permission-rules/types#AllowHostRequest";
234
+ typeSymbol: string;
183
235
  schema: import("zod").ZodObject<{
184
236
  host: import("zod").ZodString;
185
237
  scheme: import("zod").ZodUnion<readonly [import("zod").ZodLiteral<"http">, import("zod").ZodLiteral<"https">, import("zod").ZodNull]>;
@@ -189,8 +241,17 @@ export declare const TYPERT: Readonly<{
189
241
  }>;
190
242
  }>[];
191
243
  readonly result: Readonly<{
244
+ create: () => import("zod").ZodObject<{
245
+ ok: import("zod").ZodBoolean;
246
+ path: import("zod").ZodNullable<import("zod").ZodString>;
247
+ created: import("zod").ZodBoolean;
248
+ reloaded: import("zod").ZodNumber;
249
+ outcome: import("zod").ZodUnion<readonly [import("zod").ZodLiteral<"allow">, import("zod").ZodLiteral<"deny">, import("zod").ZodLiteral<"ask">, import("zod").ZodNull]>;
250
+ alreadyAllowed: import("zod").ZodBoolean;
251
+ error: import("zod").ZodNullable<import("zod").ZodString>;
252
+ }, import("zod/v4/core").$strip>;
192
253
  mode: "strict";
193
- typeSymbol: "dsh-permission-rules/types#AllowHostResult";
254
+ typeSymbol: string;
194
255
  schema: import("zod").ZodObject<{
195
256
  ok: import("zod").ZodBoolean;
196
257
  path: import("zod").ZodNullable<import("zod").ZodString>;
@@ -1 +1 @@
1
- {"version":3,"file":"typert.host.d.ts","sourceRoot":"","sources":["../../src/typert.host.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAIH,4EAA4E;AAC5E,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAUjB,CAAA"}
1
+ {"version":3,"file":"typert.host.d.ts","sourceRoot":"","sources":["../../src/typert.host.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAIH,4EAA4E;AAC5E,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAUjB,CAAA"}
@@ -215,8 +215,46 @@ export declare const NETWORK_STATUS_DESCRIPTOR: Readonly<{
215
215
  }>;
216
216
  readonly parameters: readonly never[];
217
217
  readonly result: Readonly<{
218
+ create: () => z.ZodObject<{
219
+ enabled: z.ZodBoolean;
220
+ mode: z.ZodUnion<readonly [z.ZodLiteral<"deny-all">, z.ZodLiteral<"whitelist">, z.ZodLiteral<"allow-all">]>;
221
+ configuredMode: z.ZodUnion<readonly [z.ZodLiteral<"auto">, z.ZodLiteral<"deny-all">, z.ZodLiteral<"whitelist">, z.ZodLiteral<"allow-all">]>;
222
+ sandboxMode: z.ZodNullable<z.ZodString>;
223
+ proxyPort: z.ZodNumber;
224
+ proxyActive: z.ZodBoolean;
225
+ denied: z.ZodNumber;
226
+ askBlocked: z.ZodNumber;
227
+ recent: z.ZodArray<z.ZodObject<{
228
+ time: z.ZodNumber;
229
+ tool: z.ZodString;
230
+ attributed: z.ZodBoolean;
231
+ domain: z.ZodString;
232
+ scheme: z.ZodUnion<readonly [z.ZodLiteral<"http">, z.ZodLiteral<"https">, z.ZodNull]>;
233
+ port: z.ZodNullable<z.ZodNumber>;
234
+ action: z.ZodUnion<readonly [z.ZodLiteral<"deny">, z.ZodLiteral<"ask">]>;
235
+ mode: z.ZodUnion<readonly [z.ZodLiteral<"deny-all">, z.ZodLiteral<"whitelist">, z.ZodLiteral<"allow-all">]>;
236
+ matched: z.ZodBoolean;
237
+ source: z.ZodString;
238
+ ruleIndex: z.ZodNullable<z.ZodNumber>;
239
+ reason: z.ZodNullable<z.ZodString>;
240
+ cwd: z.ZodNullable<z.ZodString>;
241
+ }, z.core.$strip>>;
242
+ sources: z.ZodArray<z.ZodObject<{
243
+ path: z.ZodString;
244
+ exists: z.ZodBoolean;
245
+ cwd: z.ZodNullable<z.ZodString>;
246
+ }, z.core.$strip>>;
247
+ allowHostAction: z.ZodBoolean;
248
+ upstream: z.ZodObject<{
249
+ mode: z.ZodUnion<readonly [z.ZodLiteral<"off">, z.ZodLiteral<"inherit">, z.ZodLiteral<"url">]>;
250
+ http: z.ZodNullable<z.ZodString>;
251
+ https: z.ZodNullable<z.ZodString>;
252
+ active: z.ZodBoolean;
253
+ chained: z.ZodNumber;
254
+ }, z.core.$strip>;
255
+ }, z.core.$strip>;
218
256
  mode: "strict";
219
- typeSymbol: "dsh-permission-rules/types#PermissionRulesSnapshot";
257
+ typeSymbol: string;
220
258
  schema: z.ZodObject<{
221
259
  enabled: z.ZodBoolean;
222
260
  mode: z.ZodUnion<readonly [z.ZodLiteral<"deny-all">, z.ZodLiteral<"whitelist">, z.ZodLiteral<"allow-all">]>;
@@ -276,14 +314,21 @@ export declare const RULES_READ_DESCRIPTOR: Readonly<{
276
314
  wire: string;
277
315
  source: "json";
278
316
  codec: Readonly<{
317
+ create: () => z.ZodString;
279
318
  mode: "strict";
280
- typeSymbol: "dsh-permission-rules/types#RulesReadRequestPath";
319
+ typeSymbol: string;
281
320
  schema: z.ZodString;
282
321
  }>;
283
322
  }>[];
284
323
  readonly result: Readonly<{
324
+ create: () => z.ZodObject<{
325
+ path: z.ZodString;
326
+ exists: z.ZodBoolean;
327
+ text: z.ZodString;
328
+ error: z.ZodNullable<z.ZodString>;
329
+ }, z.core.$strip>;
285
330
  mode: "strict";
286
- typeSymbol: "dsh-permission-rules/types#RulesReadResult";
331
+ typeSymbol: string;
287
332
  schema: z.ZodObject<{
288
333
  path: z.ZodString;
289
334
  exists: z.ZodBoolean;
@@ -306,28 +351,25 @@ export declare const RULES_SAVE_DESCRIPTOR: Readonly<{
306
351
  readonly invocation: Readonly<{
307
352
  kind: "direct";
308
353
  }>;
309
- readonly parameters: readonly (Readonly<{
310
- name: string;
311
- wire: string;
312
- source: "json";
313
- codec: Readonly<{
314
- mode: "strict";
315
- typeSymbol: "dsh-permission-rules/types#RulesSaveRequestPath";
316
- schema: z.ZodString;
317
- }>;
318
- }> | Readonly<{
354
+ readonly parameters: readonly Readonly<{
319
355
  name: string;
320
356
  wire: string;
321
357
  source: "json";
322
358
  codec: Readonly<{
359
+ create: () => z.ZodString;
323
360
  mode: "strict";
324
- typeSymbol: "dsh-permission-rules/types#RulesSaveRequestText";
361
+ typeSymbol: string;
325
362
  schema: z.ZodString;
326
363
  }>;
327
- }>)[];
364
+ }>[];
328
365
  readonly result: Readonly<{
366
+ create: () => z.ZodObject<{
367
+ ok: z.ZodBoolean;
368
+ error: z.ZodNullable<z.ZodString>;
369
+ reloaded: z.ZodNullable<z.ZodNumber>;
370
+ }, z.core.$strip>;
329
371
  mode: "strict";
330
- typeSymbol: "dsh-permission-rules/types#RulesSaveResult";
372
+ typeSymbol: string;
331
373
  schema: z.ZodObject<{
332
374
  ok: z.ZodBoolean;
333
375
  error: z.ZodNullable<z.ZodString>;
@@ -351,8 +393,12 @@ export declare const RULES_RELOAD_DESCRIPTOR: Readonly<{
351
393
  }>;
352
394
  readonly parameters: readonly never[];
353
395
  readonly result: Readonly<{
396
+ create: () => z.ZodObject<{
397
+ ok: z.ZodBoolean;
398
+ error: z.ZodNullable<z.ZodString>;
399
+ }, z.core.$strip>;
354
400
  mode: "strict";
355
- typeSymbol: "dsh-permission-rules/types#RulesReloadResult";
401
+ typeSymbol: string;
356
402
  schema: z.ZodObject<{
357
403
  ok: z.ZodBoolean;
358
404
  error: z.ZodNullable<z.ZodString>;
@@ -381,8 +427,14 @@ export declare const ALLOW_HOST_DESCRIPTOR: Readonly<{
381
427
  wire: string;
382
428
  source: "json";
383
429
  codec: Readonly<{
430
+ create: () => z.ZodObject<{
431
+ host: z.ZodString;
432
+ scheme: z.ZodUnion<readonly [z.ZodLiteral<"http">, z.ZodLiteral<"https">, z.ZodNull]>;
433
+ port: z.ZodNullable<z.ZodNumber>;
434
+ cwd: z.ZodNullable<z.ZodString>;
435
+ }, z.core.$strip>;
384
436
  mode: "strict";
385
- typeSymbol: "dsh-permission-rules/types#AllowHostRequest";
437
+ typeSymbol: string;
386
438
  schema: z.ZodObject<{
387
439
  host: z.ZodString;
388
440
  scheme: z.ZodUnion<readonly [z.ZodLiteral<"http">, z.ZodLiteral<"https">, z.ZodNull]>;
@@ -392,8 +444,17 @@ export declare const ALLOW_HOST_DESCRIPTOR: Readonly<{
392
444
  }>;
393
445
  }>[];
394
446
  readonly result: Readonly<{
447
+ create: () => z.ZodObject<{
448
+ ok: z.ZodBoolean;
449
+ path: z.ZodNullable<z.ZodString>;
450
+ created: z.ZodBoolean;
451
+ reloaded: z.ZodNumber;
452
+ outcome: z.ZodUnion<readonly [z.ZodLiteral<"allow">, z.ZodLiteral<"deny">, z.ZodLiteral<"ask">, z.ZodNull]>;
453
+ alreadyAllowed: z.ZodBoolean;
454
+ error: z.ZodNullable<z.ZodString>;
455
+ }, z.core.$strip>;
395
456
  mode: "strict";
396
- typeSymbol: "dsh-permission-rules/types#AllowHostResult";
457
+ typeSymbol: string;
397
458
  schema: z.ZodObject<{
398
459
  ok: z.ZodBoolean;
399
460
  path: z.ZodNullable<z.ZodString>;
@@ -425,8 +486,46 @@ export declare const PERMISSION_RULES_INVOCATIONS: readonly (Readonly<{
425
486
  }>;
426
487
  readonly parameters: readonly never[];
427
488
  readonly result: Readonly<{
489
+ create: () => z.ZodObject<{
490
+ enabled: z.ZodBoolean;
491
+ mode: z.ZodUnion<readonly [z.ZodLiteral<"deny-all">, z.ZodLiteral<"whitelist">, z.ZodLiteral<"allow-all">]>;
492
+ configuredMode: z.ZodUnion<readonly [z.ZodLiteral<"auto">, z.ZodLiteral<"deny-all">, z.ZodLiteral<"whitelist">, z.ZodLiteral<"allow-all">]>;
493
+ sandboxMode: z.ZodNullable<z.ZodString>;
494
+ proxyPort: z.ZodNumber;
495
+ proxyActive: z.ZodBoolean;
496
+ denied: z.ZodNumber;
497
+ askBlocked: z.ZodNumber;
498
+ recent: z.ZodArray<z.ZodObject<{
499
+ time: z.ZodNumber;
500
+ tool: z.ZodString;
501
+ attributed: z.ZodBoolean;
502
+ domain: z.ZodString;
503
+ scheme: z.ZodUnion<readonly [z.ZodLiteral<"http">, z.ZodLiteral<"https">, z.ZodNull]>;
504
+ port: z.ZodNullable<z.ZodNumber>;
505
+ action: z.ZodUnion<readonly [z.ZodLiteral<"deny">, z.ZodLiteral<"ask">]>;
506
+ mode: z.ZodUnion<readonly [z.ZodLiteral<"deny-all">, z.ZodLiteral<"whitelist">, z.ZodLiteral<"allow-all">]>;
507
+ matched: z.ZodBoolean;
508
+ source: z.ZodString;
509
+ ruleIndex: z.ZodNullable<z.ZodNumber>;
510
+ reason: z.ZodNullable<z.ZodString>;
511
+ cwd: z.ZodNullable<z.ZodString>;
512
+ }, z.core.$strip>>;
513
+ sources: z.ZodArray<z.ZodObject<{
514
+ path: z.ZodString;
515
+ exists: z.ZodBoolean;
516
+ cwd: z.ZodNullable<z.ZodString>;
517
+ }, z.core.$strip>>;
518
+ allowHostAction: z.ZodBoolean;
519
+ upstream: z.ZodObject<{
520
+ mode: z.ZodUnion<readonly [z.ZodLiteral<"off">, z.ZodLiteral<"inherit">, z.ZodLiteral<"url">]>;
521
+ http: z.ZodNullable<z.ZodString>;
522
+ https: z.ZodNullable<z.ZodString>;
523
+ active: z.ZodBoolean;
524
+ chained: z.ZodNumber;
525
+ }, z.core.$strip>;
526
+ }, z.core.$strip>;
428
527
  mode: "strict";
429
- typeSymbol: "dsh-permission-rules/types#PermissionRulesSnapshot";
528
+ typeSymbol: string;
430
529
  schema: z.ZodObject<{
431
530
  enabled: z.ZodBoolean;
432
531
  mode: z.ZodUnion<readonly [z.ZodLiteral<"deny-all">, z.ZodLiteral<"whitelist">, z.ZodLiteral<"allow-all">]>;
@@ -484,14 +583,21 @@ export declare const PERMISSION_RULES_INVOCATIONS: readonly (Readonly<{
484
583
  wire: string;
485
584
  source: "json";
486
585
  codec: Readonly<{
586
+ create: () => z.ZodString;
487
587
  mode: "strict";
488
- typeSymbol: "dsh-permission-rules/types#RulesReadRequestPath";
588
+ typeSymbol: string;
489
589
  schema: z.ZodString;
490
590
  }>;
491
591
  }>[];
492
592
  readonly result: Readonly<{
593
+ create: () => z.ZodObject<{
594
+ path: z.ZodString;
595
+ exists: z.ZodBoolean;
596
+ text: z.ZodString;
597
+ error: z.ZodNullable<z.ZodString>;
598
+ }, z.core.$strip>;
493
599
  mode: "strict";
494
- typeSymbol: "dsh-permission-rules/types#RulesReadResult";
600
+ typeSymbol: string;
495
601
  schema: z.ZodObject<{
496
602
  path: z.ZodString;
497
603
  exists: z.ZodBoolean;
@@ -512,28 +618,25 @@ export declare const PERMISSION_RULES_INVOCATIONS: readonly (Readonly<{
512
618
  readonly invocation: Readonly<{
513
619
  kind: "direct";
514
620
  }>;
515
- readonly parameters: readonly (Readonly<{
516
- name: string;
517
- wire: string;
518
- source: "json";
519
- codec: Readonly<{
520
- mode: "strict";
521
- typeSymbol: "dsh-permission-rules/types#RulesSaveRequestPath";
522
- schema: z.ZodString;
523
- }>;
524
- }> | Readonly<{
621
+ readonly parameters: readonly Readonly<{
525
622
  name: string;
526
623
  wire: string;
527
624
  source: "json";
528
625
  codec: Readonly<{
626
+ create: () => z.ZodString;
529
627
  mode: "strict";
530
- typeSymbol: "dsh-permission-rules/types#RulesSaveRequestText";
628
+ typeSymbol: string;
531
629
  schema: z.ZodString;
532
630
  }>;
533
- }>)[];
631
+ }>[];
534
632
  readonly result: Readonly<{
633
+ create: () => z.ZodObject<{
634
+ ok: z.ZodBoolean;
635
+ error: z.ZodNullable<z.ZodString>;
636
+ reloaded: z.ZodNullable<z.ZodNumber>;
637
+ }, z.core.$strip>;
535
638
  mode: "strict";
536
- typeSymbol: "dsh-permission-rules/types#RulesSaveResult";
639
+ typeSymbol: string;
537
640
  schema: z.ZodObject<{
538
641
  ok: z.ZodBoolean;
539
642
  error: z.ZodNullable<z.ZodString>;
@@ -555,8 +658,12 @@ export declare const PERMISSION_RULES_INVOCATIONS: readonly (Readonly<{
555
658
  }>;
556
659
  readonly parameters: readonly never[];
557
660
  readonly result: Readonly<{
661
+ create: () => z.ZodObject<{
662
+ ok: z.ZodBoolean;
663
+ error: z.ZodNullable<z.ZodString>;
664
+ }, z.core.$strip>;
558
665
  mode: "strict";
559
- typeSymbol: "dsh-permission-rules/types#RulesReloadResult";
666
+ typeSymbol: string;
560
667
  schema: z.ZodObject<{
561
668
  ok: z.ZodBoolean;
562
669
  error: z.ZodNullable<z.ZodString>;
@@ -580,8 +687,14 @@ export declare const PERMISSION_RULES_INVOCATIONS: readonly (Readonly<{
580
687
  wire: string;
581
688
  source: "json";
582
689
  codec: Readonly<{
690
+ create: () => z.ZodObject<{
691
+ host: z.ZodString;
692
+ scheme: z.ZodUnion<readonly [z.ZodLiteral<"http">, z.ZodLiteral<"https">, z.ZodNull]>;
693
+ port: z.ZodNullable<z.ZodNumber>;
694
+ cwd: z.ZodNullable<z.ZodString>;
695
+ }, z.core.$strip>;
583
696
  mode: "strict";
584
- typeSymbol: "dsh-permission-rules/types#AllowHostRequest";
697
+ typeSymbol: string;
585
698
  schema: z.ZodObject<{
586
699
  host: z.ZodString;
587
700
  scheme: z.ZodUnion<readonly [z.ZodLiteral<"http">, z.ZodLiteral<"https">, z.ZodNull]>;
@@ -591,8 +704,17 @@ export declare const PERMISSION_RULES_INVOCATIONS: readonly (Readonly<{
591
704
  }>;
592
705
  }>[];
593
706
  readonly result: Readonly<{
707
+ create: () => z.ZodObject<{
708
+ ok: z.ZodBoolean;
709
+ path: z.ZodNullable<z.ZodString>;
710
+ created: z.ZodBoolean;
711
+ reloaded: z.ZodNumber;
712
+ outcome: z.ZodUnion<readonly [z.ZodLiteral<"allow">, z.ZodLiteral<"deny">, z.ZodLiteral<"ask">, z.ZodNull]>;
713
+ alreadyAllowed: z.ZodBoolean;
714
+ error: z.ZodNullable<z.ZodString>;
715
+ }, z.core.$strip>;
594
716
  mode: "strict";
595
- typeSymbol: "dsh-permission-rules/types#AllowHostResult";
717
+ typeSymbol: string;
596
718
  schema: z.ZodObject<{
597
719
  ok: z.ZodBoolean;
598
720
  path: z.ZodNullable<z.ZodString>;
@@ -1 +1 @@
1
- {"version":3,"file":"wire.d.ts","sourceRoot":"","sources":["../../src/wire.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAGvB,wDAAwD;AACxD,MAAM,MAAM,eAAe,GAAG,UAAU,GAAG,WAAW,GAAG,WAAW,CAAA;AAEpE,2DAA2D;AAC3D,MAAM,WAAW,gBAAgB;IAC/B,6BAA6B;IAC7B,IAAI,EAAE,MAAM,CAAA;IACZ,6DAA6D;IAC7D,IAAI,EAAE,MAAM,CAAA;IACZ,2DAA2D;IAC3D,UAAU,EAAE,OAAO,CAAA;IACnB,2BAA2B;IAC3B,MAAM,EAAE,MAAM,CAAA;IACd,MAAM,EAAE,MAAM,GAAG,OAAO,GAAG,IAA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAMvC,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-permission-rules",
3
- "version": "0.7.1",
3
+ "version": "0.7.3",
4
4
  "description": "Declarative Claude Code-style permission rules plus a Codex-style process-level network policy for DeepSeek Harness: ordered allow/deny/ask rules with tool-name, argument (glob/regex), workspace-path, and network-target (domain/ip/port/scheme) matching on the tools/pre-execute waterfall, a built-in local HTTP/CONNECT proxy governing shell subprocess traffic, three network modes mapped onto the official sandbox presets, full session-log audit, HMR rule reload, and a settings page with a rule editor, block counters, and recent interception lists.",
5
5
  "private": false,
6
6
  "type": "module",
@@ -38,6 +38,7 @@
38
38
  ],
39
39
  "sideEffects": false,
40
40
  "dsh": {
41
+ "manifestVersion": 1,
41
42
  "bundle": {
42
43
  "patch": "./cordis.patch.yml"
43
44
  },
@@ -114,22 +115,23 @@
114
115
  "url": "https://github.com/PerryLink/dsh-permission-rules/issues"
115
116
  },
116
117
  "engines": {
117
- "node": "^22.19.0 || >=24.0.0"
118
+ "node": "^22.19.0 || >=24.0.0",
119
+ "dsh": ">=0.1.2-rc.1 <0.2.0 || >=0.1.5-alpha.1 <0.2.0 || >=0.1.6-0 <0.2.0"
118
120
  },
119
121
  "peerDependencies": {
120
122
  "@deepseek-ai/cordis": "^4.0.2",
121
- "@deepseek-ai/dsh-agent": ">=0.1.2-rc.1 <0.2.0 || >=0.1.5-alpha.1 <0.2.0",
122
- "@deepseek-ai/dsh-commands": ">=0.1.2-rc.1 <0.2.0 || >=0.1.5-alpha.1 <0.2.0",
123
- "@deepseek-ai/dsh-llm": ">=0.1.2-rc.1 <0.2.0 || >=0.1.5-alpha.1 <0.2.0",
124
- "@deepseek-ai/dsh-session": ">=0.1.2-rc.1 <0.2.0 || >=0.1.5-alpha.1 <0.2.0",
125
- "@deepseek-ai/dsh-tools": ">=0.1.2-rc.1 <0.2.0 || >=0.1.5-alpha.1 <0.2.0",
126
- "@deepseek-ai/dsh-typert-protocol": ">=0.1.2-rc.1 <0.2.0 || >=0.1.5-alpha.1 <0.2.0",
123
+ "@deepseek-ai/dsh-agent": ">=0.1.2-rc.1 <0.2.0 || >=0.1.5-alpha.1 <0.2.0 || >=0.1.6-0 <0.2.0",
124
+ "@deepseek-ai/dsh-commands": ">=0.1.2-rc.1 <0.2.0 || >=0.1.5-alpha.1 <0.2.0 || >=0.1.6-0 <0.2.0",
125
+ "@deepseek-ai/dsh-llm": ">=0.1.2-rc.1 <0.2.0 || >=0.1.5-alpha.1 <0.2.0 || >=0.1.6-0 <0.2.0",
126
+ "@deepseek-ai/dsh-session": ">=0.1.2-rc.1 <0.2.0 || >=0.1.5-alpha.1 <0.2.0 || >=0.1.6-0 <0.2.0",
127
+ "@deepseek-ai/dsh-tools": ">=0.1.2-rc.1 <0.2.0 || >=0.1.5-alpha.1 <0.2.0 || >=0.1.6-0 <0.2.0",
128
+ "@deepseek-ai/dsh-typert-protocol": ">=0.1.2-rc.1 <0.2.0 || >=0.1.5-alpha.1 <0.2.0 || >=0.1.6-0 <0.2.0",
127
129
  "@deepseek-ai/schemastery": "^3.18.2",
128
130
  "react": "^18.2.0",
129
- "@deepseek-ai/dsh-client-connection": ">=0.1.2-rc.1 <0.2.0 || >=0.1.5-alpha.1 <0.2.0",
130
- "@deepseek-ai/dsh-client-locale": ">=0.1.2-rc.1 <0.2.0 || >=0.1.5-alpha.1 <0.2.0",
131
- "@deepseek-ai/dsh-client-ui-settings": ">=0.1.2-rc.1 <0.2.0 || >=0.1.5-alpha.1 <0.2.0",
132
- "@deepseek-ai/dsh-client-web": ">=0.1.2-rc.1 <0.2.0 || >=0.1.5-alpha.1 <0.2.0"
131
+ "@deepseek-ai/dsh-client-connection": ">=0.1.2-rc.1 <0.2.0 || >=0.1.5-alpha.1 <0.2.0 || >=0.1.6-0 <0.2.0",
132
+ "@deepseek-ai/dsh-client-locale": ">=0.1.2-rc.1 <0.2.0 || >=0.1.5-alpha.1 <0.2.0 || >=0.1.6-0 <0.2.0",
133
+ "@deepseek-ai/dsh-client-ui-settings": ">=0.1.2-rc.1 <0.2.0 || >=0.1.5-alpha.1 <0.2.0 || >=0.1.6-0 <0.2.0",
134
+ "@deepseek-ai/dsh-client-web": ">=0.1.2-rc.1 <0.2.0 || >=0.1.5-alpha.1 <0.2.0 || >=0.1.6-0 <0.2.0"
133
135
  },
134
136
  "peerDependenciesMeta": {
135
137
  "@deepseek-ai/dsh-client-connection": {
@@ -189,11 +191,13 @@
189
191
  "scripts": {
190
192
  "build": "node scripts/prepare.mjs",
191
193
  "typecheck": "tsc -p tsconfig.json --noEmit && tsc -p tsconfig.test.json --noEmit",
194
+ "typecheck:ci": "tsc -p tsconfig.ci.json --noEmit",
192
195
  "lint": "eslint src test scripts",
193
196
  "test": "vitest run",
194
197
  "test:coverage": "vitest run --coverage",
195
198
  "check:readmes": "node scripts/check-readme-sync.mjs",
196
199
  "verify:self-contained": "node scripts/verify-self-contained.mjs",
200
+ "verify:client-bundle": "node scripts/verify-client-bundle.mjs",
197
201
  "pack:check": "node scripts/prepare.mjs && pnpm pack",
198
202
  "prepare": "node scripts/prepare.mjs"
199
203
  },
@@ -0,0 +1,76 @@
1
+ /**
2
+ * The client-safe half of the settings-page "allow this host" action: the
3
+ * workspace choices offered for a host-level block ({@link allowHostWorkspaces})
4
+ * and the notice mapping ({@link allowHostNotice}).
5
+ *
6
+ * These live in their own module — separate from the host-only
7
+ * `./allow-host.ts` — because the settings page (the browser bundle built
8
+ * from `src/client/index.ts`) imports them, and the client bundler inlines
9
+ * every value import it meets. A single `import { allowHostNotice } from
10
+ * '../allow-host.ts'` used to drag the whole host module — `node:path`,
11
+ * `node:net`, `yaml`, `process.platform` — into `lib/client.js` as external
12
+ * `require("process")`/`require("buffer")` calls the shell's frozen module
13
+ * table cannot answer, which made the entire plugin fail to load.
14
+ *
15
+ * The hard rule for this module: NO runtime imports beyond pure type-only
16
+ * references to `./wire.ts`. Anything that needs a node builtin, the yaml
17
+ * parser, or the rule compiler belongs in `./allow-host.ts` (or deeper),
18
+ * never here.
19
+ * @module dsh-permission-rules/allow-host-notice
20
+ */
21
+
22
+ import type { AllowHostResult, RuleSourceView } from './wire.ts'
23
+
24
+ /**
25
+ * The workspaces a host-level block may be allowed in: the distinct non-null
26
+ * `cwd`s of the loaded rule sources.
27
+ *
28
+ * A block with no cwd was judged by the proxy's session-less host chain, which
29
+ * any loaded workspace chain outranks the moment one exists — so writing the
30
+ * host file can leave the connection blocked while the rule sits in a file
31
+ * nothing consults. The settings page therefore offers these workspaces and
32
+ * sends the chosen one as the request's cwd; when there is exactly one (or
33
+ * none), there is nothing to choose between.
34
+ * @param sources - the snapshot's rule sources.
35
+ * @returns the distinct workspace roots, in source order.
36
+ */
37
+ export function allowHostWorkspaces(sources: readonly RuleSourceView[]): string[] {
38
+ const seen = new Set<string>()
39
+ const workspaces: string[] = []
40
+ for (const source of sources) {
41
+ if (source.cwd === null || seen.has(source.cwd)) continue
42
+ seen.add(source.cwd)
43
+ workspaces.push(source.cwd)
44
+ }
45
+ return workspaces
46
+ }
47
+
48
+ /** The locale keys the allow action reports through. */
49
+ export type AllowHostNoticeKey = 'allowHostSaved' | 'allowHostAlready' | 'allowHostStillBlocked' | 'allowHostFailed'
50
+
51
+ /** The notice one action result maps onto: a locale key plus its interpolation values. */
52
+ export interface AllowHostNotice {
53
+ readonly ok: boolean
54
+ readonly key: AllowHostNoticeKey
55
+ readonly vars: Record<string, string | number>
56
+ }
57
+
58
+ /**
59
+ * Map an action result onto the page notice.
60
+ *
61
+ * A non-`allow` outcome outranks `alreadyAllowed`: the whole point of
62
+ * returning the RECOMPUTED decision is that the page can never say "allowed"
63
+ * while the connection is still blocked (a nearer chain with an earlier deny,
64
+ * or a mode default, still wins). `alreadyAllowed` therefore only ever reads
65
+ * as success when the decision really is `allow`.
66
+ * @param result - the `permissionRules/allowHost` result.
67
+ * @returns the notice to render.
68
+ */
69
+ export function allowHostNotice(result: AllowHostResult): AllowHostNotice {
70
+ if (!result.ok) return { ok: false, key: 'allowHostFailed', vars: { error: result.error ?? 'unknown error' } }
71
+ if (result.outcome !== 'allow') {
72
+ return { ok: false, key: 'allowHostStillBlocked', vars: { outcome: result.outcome ?? 'unknown' } }
73
+ }
74
+ if (result.alreadyAllowed) return { ok: true, key: 'allowHostAlready', vars: {} }
75
+ return { ok: true, key: 'allowHostSaved', vars: { path: result.path ?? '', reloaded: result.reloaded } }
76
+ }