summrise-agent 1.2.510 → 1.2.511
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/bin/summrise.exe +0 -0
- package/package.json +11 -8
- package/summrise-agent.exe +0 -0
- package/summrise-desktop-electron/src/main.js +400 -354
- package/summrise-desktop-electron/src/preload.js +4 -1
- package/summrise-desktop-electron/src/summrise_shell_policy.js +1280 -0
- package/summrise-desktop-electron/src/summrise_shell_policy_bg.wasm +0 -0
- package/summrise-desktop-electron/src/summrise_url_policy.js +404 -0
- package/summrise-desktop-electron/src/summrise_url_policy_bg.wasm +0 -0
- package/summrise-launch.exe +0 -0
- package/bin/summrise.js +0 -3906
- package/summrise-desktop-electron/src/url-policy.js +0 -238
|
Binary file
|
|
@@ -0,0 +1,404 @@
|
|
|
1
|
+
/* @ts-self-types="./summrise_url_policy.d.ts" */
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* The one wrapper with a decision of its own: the JavaScript threw a real `Error`, so a thrown STRING
|
|
5
|
+
* would not be the same refusal (a caller printing `err.message` or matching a regex sees the
|
|
6
|
+
* difference). The message is the TypeScript's, `${port}` included — which is why a non-number is
|
|
7
|
+
* rendered with `String(value)` rather than dropped: `addDshPort("abc")` must say `not a port: abc`.
|
|
8
|
+
* @param {number} port
|
|
9
|
+
*/
|
|
10
|
+
function addDshPort(port) {
|
|
11
|
+
try {
|
|
12
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
13
|
+
wasm.addDshPort(retptr, addHeapObject(port));
|
|
14
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
15
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
16
|
+
if (r1) {
|
|
17
|
+
throw takeObject(r0);
|
|
18
|
+
}
|
|
19
|
+
} finally {
|
|
20
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
exports.addDshPort = addDshPort;
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* @returns {string}
|
|
27
|
+
*/
|
|
28
|
+
function agentBase() {
|
|
29
|
+
let deferred1_0;
|
|
30
|
+
let deferred1_1;
|
|
31
|
+
try {
|
|
32
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
33
|
+
wasm.agentBase(retptr);
|
|
34
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
35
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
36
|
+
deferred1_0 = r0;
|
|
37
|
+
deferred1_1 = r1;
|
|
38
|
+
return getStringFromWasm0(r0, r1);
|
|
39
|
+
} finally {
|
|
40
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
41
|
+
wasm.__wbindgen_export3(deferred1_0, deferred1_1, 1);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
exports.agentBase = agentBase;
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* @param {string} url
|
|
48
|
+
* @returns {boolean}
|
|
49
|
+
*/
|
|
50
|
+
function certBypassAllowed(url) {
|
|
51
|
+
const ret = wasm.certBypassAllowed(addHeapObject(url));
|
|
52
|
+
return ret !== 0;
|
|
53
|
+
}
|
|
54
|
+
exports.certBypassAllowed = certBypassAllowed;
|
|
55
|
+
|
|
56
|
+
function clearExtraDshPorts() {
|
|
57
|
+
wasm.clearExtraDshPorts();
|
|
58
|
+
}
|
|
59
|
+
exports.clearExtraDshPorts = clearExtraDshPorts;
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* @param {string | null} [origin]
|
|
63
|
+
* @returns {boolean}
|
|
64
|
+
*/
|
|
65
|
+
function controlOriginOk(origin) {
|
|
66
|
+
const ret = wasm.controlOriginOk(isLikeNone(origin) ? 0 : addHeapObject(origin));
|
|
67
|
+
return ret !== 0;
|
|
68
|
+
}
|
|
69
|
+
exports.controlOriginOk = controlOriginOk;
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* @returns {string}
|
|
73
|
+
*/
|
|
74
|
+
function dshBase() {
|
|
75
|
+
let deferred1_0;
|
|
76
|
+
let deferred1_1;
|
|
77
|
+
try {
|
|
78
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
79
|
+
wasm.dshBase(retptr);
|
|
80
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
81
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
82
|
+
deferred1_0 = r0;
|
|
83
|
+
deferred1_1 = r1;
|
|
84
|
+
return getStringFromWasm0(r0, r1);
|
|
85
|
+
} finally {
|
|
86
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
87
|
+
wasm.__wbindgen_export3(deferred1_0, deferred1_1, 1);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
exports.dshBase = dshBase;
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* @returns {string[]}
|
|
94
|
+
*/
|
|
95
|
+
function dshOrigins() {
|
|
96
|
+
try {
|
|
97
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
98
|
+
wasm.dshOrigins(retptr);
|
|
99
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
100
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
101
|
+
var v1 = getArrayJsValueFromWasm0(r0, r1);
|
|
102
|
+
wasm.__wbindgen_export3(r0, r1 * 4, 4);
|
|
103
|
+
return v1;
|
|
104
|
+
} finally {
|
|
105
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
exports.dshOrigins = dshOrigins;
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* @param {string} url
|
|
112
|
+
* @returns {boolean}
|
|
113
|
+
*/
|
|
114
|
+
function frameUrlOk(url) {
|
|
115
|
+
const ret = wasm.frameUrlOk(addHeapObject(url));
|
|
116
|
+
return ret !== 0;
|
|
117
|
+
}
|
|
118
|
+
exports.frameUrlOk = frameUrlOk;
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* @returns {number}
|
|
122
|
+
*/
|
|
123
|
+
function getAgentPort() {
|
|
124
|
+
const ret = wasm.getAgentPort();
|
|
125
|
+
return ret;
|
|
126
|
+
}
|
|
127
|
+
exports.getAgentPort = getAgentPort;
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* @returns {number}
|
|
131
|
+
*/
|
|
132
|
+
function getDshPort() {
|
|
133
|
+
const ret = wasm.getDshPort();
|
|
134
|
+
return ret;
|
|
135
|
+
}
|
|
136
|
+
exports.getDshPort = getDshPort;
|
|
137
|
+
|
|
138
|
+
/**
|
|
139
|
+
* @param {string} url
|
|
140
|
+
* @returns {boolean}
|
|
141
|
+
*/
|
|
142
|
+
function isBaseOrigin(url) {
|
|
143
|
+
const ret = wasm.isBaseOrigin(addHeapObject(url));
|
|
144
|
+
return ret !== 0;
|
|
145
|
+
}
|
|
146
|
+
exports.isBaseOrigin = isBaseOrigin;
|
|
147
|
+
|
|
148
|
+
/**
|
|
149
|
+
* @param {string} url
|
|
150
|
+
* @returns {boolean}
|
|
151
|
+
*/
|
|
152
|
+
function isDesktopSpaUrl(url) {
|
|
153
|
+
const ret = wasm.isDesktopSpaUrl(addHeapObject(url));
|
|
154
|
+
return ret !== 0;
|
|
155
|
+
}
|
|
156
|
+
exports.isDesktopSpaUrl = isDesktopSpaUrl;
|
|
157
|
+
|
|
158
|
+
/**
|
|
159
|
+
* @param {string} url
|
|
160
|
+
* @returns {boolean}
|
|
161
|
+
*/
|
|
162
|
+
function isDshUrl(url) {
|
|
163
|
+
const ret = wasm.isDshUrl(addHeapObject(url));
|
|
164
|
+
return ret !== 0;
|
|
165
|
+
}
|
|
166
|
+
exports.isDshUrl = isDshUrl;
|
|
167
|
+
|
|
168
|
+
/**
|
|
169
|
+
* @param {string} hostname
|
|
170
|
+
* @returns {boolean}
|
|
171
|
+
*/
|
|
172
|
+
function isPrivateHost(hostname) {
|
|
173
|
+
const ret = wasm.isPrivateHost(addHeapObject(hostname));
|
|
174
|
+
return ret !== 0;
|
|
175
|
+
}
|
|
176
|
+
exports.isPrivateHost = isPrivateHost;
|
|
177
|
+
|
|
178
|
+
/**
|
|
179
|
+
* `Option<u16>` rather than a `JsValue` holding `null`: the generated `.d.ts` then says
|
|
180
|
+
* `number | undefined` instead of `any`, and the shell's one call site is `if (port) return port;` — a
|
|
181
|
+
* truthiness test, which `undefined` and `null` answer the same way. The TypeScript answered `null`;
|
|
182
|
+
* this is the one place the JS-visible answer is spelled differently, and nothing can observe it.
|
|
183
|
+
* @param {string} yaml_text
|
|
184
|
+
* @returns {number | undefined}
|
|
185
|
+
*/
|
|
186
|
+
function parseAgentPort(yaml_text) {
|
|
187
|
+
const ret = wasm.parseAgentPort(addHeapObject(yaml_text));
|
|
188
|
+
return ret === 0xFFFFFF ? undefined : ret;
|
|
189
|
+
}
|
|
190
|
+
exports.parseAgentPort = parseAgentPort;
|
|
191
|
+
|
|
192
|
+
/**
|
|
193
|
+
* @param {string | null} [url]
|
|
194
|
+
* @returns {string}
|
|
195
|
+
*/
|
|
196
|
+
function sanitizeBrowserUrl(url) {
|
|
197
|
+
let deferred1_0;
|
|
198
|
+
let deferred1_1;
|
|
199
|
+
try {
|
|
200
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
201
|
+
wasm.sanitizeBrowserUrl(retptr, isLikeNone(url) ? 0 : addHeapObject(url));
|
|
202
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
203
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
204
|
+
deferred1_0 = r0;
|
|
205
|
+
deferred1_1 = r1;
|
|
206
|
+
return getStringFromWasm0(r0, r1);
|
|
207
|
+
} finally {
|
|
208
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
209
|
+
wasm.__wbindgen_export3(deferred1_0, deferred1_1, 1);
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
exports.sanitizeBrowserUrl = sanitizeBrowserUrl;
|
|
213
|
+
|
|
214
|
+
/**
|
|
215
|
+
* @param {number} port
|
|
216
|
+
*/
|
|
217
|
+
function setAgentPort(port) {
|
|
218
|
+
wasm.setAgentPort(addHeapObject(port));
|
|
219
|
+
}
|
|
220
|
+
exports.setAgentPort = setAgentPort;
|
|
221
|
+
|
|
222
|
+
/**
|
|
223
|
+
* @param {number} port
|
|
224
|
+
*/
|
|
225
|
+
function setDshPort(port) {
|
|
226
|
+
wasm.setDshPort(addHeapObject(port));
|
|
227
|
+
}
|
|
228
|
+
exports.setDshPort = setDshPort;
|
|
229
|
+
function __wbg_get_imports() {
|
|
230
|
+
const import0 = {
|
|
231
|
+
__proto__: null,
|
|
232
|
+
__wbg_String_73fabd11edc2c89f: function(arg0) {
|
|
233
|
+
const ret = String(getObject(arg0));
|
|
234
|
+
return addHeapObject(ret);
|
|
235
|
+
},
|
|
236
|
+
__wbg___wbindgen_is_falsy_16bd49b68658263e: function(arg0) {
|
|
237
|
+
const ret = !getObject(arg0);
|
|
238
|
+
return ret;
|
|
239
|
+
},
|
|
240
|
+
__wbg___wbindgen_is_undefined_8865fb403f8fe9d8: function(arg0) {
|
|
241
|
+
const ret = getObject(arg0) === undefined;
|
|
242
|
+
return ret;
|
|
243
|
+
},
|
|
244
|
+
__wbg___wbindgen_number_get_2e0e7dee9f701a71: function(arg0, arg1) {
|
|
245
|
+
const obj = getObject(arg1);
|
|
246
|
+
const ret = typeof(obj) === 'number' ? obj : undefined;
|
|
247
|
+
getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
|
|
248
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
|
|
249
|
+
},
|
|
250
|
+
__wbg___wbindgen_string_get_0380ccaa2f57f0d9: function(arg0, arg1) {
|
|
251
|
+
const obj = getObject(arg1);
|
|
252
|
+
const ret = typeof(obj) === 'string' ? obj : undefined;
|
|
253
|
+
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
254
|
+
var len1 = WASM_VECTOR_LEN;
|
|
255
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
256
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
257
|
+
},
|
|
258
|
+
__wbg___wbindgen_throw_41e9ee4f547fc59a: function(arg0, arg1) {
|
|
259
|
+
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
260
|
+
},
|
|
261
|
+
__wbg_new_343a093a3c2ffb4e: function(arg0, arg1) {
|
|
262
|
+
const ret = new Error(getStringFromWasm0(arg0, arg1));
|
|
263
|
+
return addHeapObject(ret);
|
|
264
|
+
},
|
|
265
|
+
__wbindgen_generic_0000000000000001: function(arg0, arg1) {
|
|
266
|
+
// Cast intrinsic for `Ref(String) -> Externref`.
|
|
267
|
+
const ret = getStringFromWasm0(arg0, arg1);
|
|
268
|
+
return addHeapObject(ret);
|
|
269
|
+
},
|
|
270
|
+
__wbindgen_object_drop_ref: function(arg0) {
|
|
271
|
+
takeObject(arg0);
|
|
272
|
+
},
|
|
273
|
+
};
|
|
274
|
+
return {
|
|
275
|
+
__proto__: null,
|
|
276
|
+
"./summrise_url_policy_bg.js": import0,
|
|
277
|
+
};
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
function addHeapObject(obj) {
|
|
281
|
+
if (heap_next === heap.length) heap.push(heap.length + 1);
|
|
282
|
+
const idx = heap_next;
|
|
283
|
+
heap_next = heap[idx];
|
|
284
|
+
|
|
285
|
+
heap[idx] = obj;
|
|
286
|
+
return idx;
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
function dropObject(idx) {
|
|
290
|
+
if (idx < 1028) return;
|
|
291
|
+
heap[idx] = heap_next;
|
|
292
|
+
heap_next = idx;
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
function getArrayJsValueFromWasm0(ptr, len) {
|
|
296
|
+
ptr = ptr >>> 0;
|
|
297
|
+
const mem = getDataViewMemory0();
|
|
298
|
+
const result = [];
|
|
299
|
+
for (let i = ptr; i < ptr + 4 * len; i += 4) {
|
|
300
|
+
result.push(takeObject(mem.getUint32(i, true)));
|
|
301
|
+
}
|
|
302
|
+
return result;
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
let cachedDataViewMemory0 = null;
|
|
306
|
+
function getDataViewMemory0() {
|
|
307
|
+
if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
|
|
308
|
+
cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
|
|
309
|
+
}
|
|
310
|
+
return cachedDataViewMemory0;
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
function getStringFromWasm0(ptr, len) {
|
|
314
|
+
return decodeText(ptr >>> 0, len);
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
let cachedUint8ArrayMemory0 = null;
|
|
318
|
+
function getUint8ArrayMemory0() {
|
|
319
|
+
if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
|
|
320
|
+
cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
|
|
321
|
+
}
|
|
322
|
+
return cachedUint8ArrayMemory0;
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
function getObject(idx) { return heap[idx]; }
|
|
326
|
+
|
|
327
|
+
let heap = new Array(1024).fill(undefined);
|
|
328
|
+
heap.push(undefined, null, true, false);
|
|
329
|
+
|
|
330
|
+
let heap_next = heap.length;
|
|
331
|
+
|
|
332
|
+
function isLikeNone(x) {
|
|
333
|
+
return x === undefined || x === null;
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
function passStringToWasm0(arg, malloc, realloc) {
|
|
337
|
+
if (realloc === undefined) {
|
|
338
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
339
|
+
const ptr = malloc(buf.length, 1) >>> 0;
|
|
340
|
+
getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
|
|
341
|
+
WASM_VECTOR_LEN = buf.length;
|
|
342
|
+
return ptr;
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
let len = arg.length;
|
|
346
|
+
let ptr = malloc(len, 1) >>> 0;
|
|
347
|
+
|
|
348
|
+
const mem = getUint8ArrayMemory0();
|
|
349
|
+
|
|
350
|
+
let offset = 0;
|
|
351
|
+
|
|
352
|
+
for (; offset < len; offset++) {
|
|
353
|
+
const code = arg.charCodeAt(offset);
|
|
354
|
+
if (code > 0x7F) break;
|
|
355
|
+
mem[ptr + offset] = code;
|
|
356
|
+
}
|
|
357
|
+
if (offset !== len) {
|
|
358
|
+
if (offset !== 0) {
|
|
359
|
+
arg = arg.slice(offset);
|
|
360
|
+
}
|
|
361
|
+
ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
|
|
362
|
+
const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
|
|
363
|
+
const ret = cachedTextEncoder.encodeInto(arg, view);
|
|
364
|
+
|
|
365
|
+
offset += ret.written;
|
|
366
|
+
ptr = realloc(ptr, len, offset, 1) >>> 0;
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
WASM_VECTOR_LEN = offset;
|
|
370
|
+
return ptr;
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
function takeObject(idx) {
|
|
374
|
+
const ret = getObject(idx);
|
|
375
|
+
dropObject(idx);
|
|
376
|
+
return ret;
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
380
|
+
cachedTextDecoder.decode();
|
|
381
|
+
function decodeText(ptr, len) {
|
|
382
|
+
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
const cachedTextEncoder = new TextEncoder();
|
|
386
|
+
|
|
387
|
+
if (!('encodeInto' in cachedTextEncoder)) {
|
|
388
|
+
cachedTextEncoder.encodeInto = function (arg, view) {
|
|
389
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
390
|
+
view.set(buf);
|
|
391
|
+
return {
|
|
392
|
+
read: arg.length,
|
|
393
|
+
written: buf.length
|
|
394
|
+
};
|
|
395
|
+
};
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
let WASM_VECTOR_LEN = 0;
|
|
399
|
+
|
|
400
|
+
const wasmPath = `${__dirname}/summrise_url_policy_bg.wasm`;
|
|
401
|
+
const wasmBytes = require('fs').readFileSync(wasmPath);
|
|
402
|
+
const wasmModule = new WebAssembly.Module(wasmBytes);
|
|
403
|
+
let wasmInstance = new WebAssembly.Instance(wasmModule, __wbg_get_imports());
|
|
404
|
+
let wasm = wasmInstance.exports;
|
|
Binary file
|
|
Binary file
|