@swifty.js/swifty 0.0.33 → 0.0.35
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/acp-A4KRKOHD.js +14 -0
- package/dist/agent-VDWIGFIV.js +4 -0
- package/dist/{anthropic-FXRRA63E.js → anthropic-AR2Y4FBR.js} +1 -1
- package/dist/bwrap-4KOC7P3X.js +4 -0
- package/dist/{chunk-IKQTIDRL.js → chunk-325L2ILZ.js} +1 -1
- package/dist/chunk-44LPRRYU.js +60 -0
- package/dist/chunk-4B4SGVJH.js +164 -0
- package/dist/chunk-5W2TCASL.js +4 -0
- package/dist/{chunk-FUKVR3XO.js → chunk-F4FOFPKL.js} +126 -123
- package/dist/{chunk-4PQYUHSN.js → chunk-H56UQALW.js} +1 -1
- package/dist/{providers-WNYZUMZ3.js → chunk-IOLGXPUQ.js} +3 -3
- package/dist/chunk-IXCJZNBB.js +5 -0
- package/dist/chunk-JC44NVST.js +4 -0
- package/dist/chunk-NDPYUGE5.js +5 -0
- package/dist/chunk-PH643I2P.js +4 -0
- package/dist/{chunk-PXQD6GWP.js → chunk-TOM34LJB.js} +7 -7
- package/dist/{chunk-4C3KJLJV.js → chunk-UJGMTIYO.js} +1 -1
- package/dist/chunk-YBS5ATGZ.js +4 -0
- package/dist/esm-VBV56AO5.js +229 -0
- package/dist/lib/agent-TC4HSVMS.js +16 -0
- package/dist/lib/{anthropic-B33M2AVN.js → anthropic-FKIGL7NL.js} +6 -5
- package/dist/lib/bwrap-2OL7VPSO.js +7 -0
- package/dist/lib/{chunk-FODSMOWP.js → chunk-6V7RW6HA.js} +34 -16
- package/dist/lib/{chunk-TJLAJGG4.js → chunk-ALQHMYOZ.js} +14 -3
- package/dist/lib/{chunk-XT67KGWE.js → chunk-BQFVUVLI.js} +12 -2
- package/dist/lib/chunk-FFM2LB4C.js +132 -0
- package/dist/lib/{chunk-VUD72RTY.js → chunk-FLKB4BK7.js} +16 -5
- package/dist/lib/{chunk-3OFLDUAW.js → chunk-HQSYRTER.js} +96 -49
- package/dist/lib/{chunk-LDWFI6MR.js → chunk-LRN4MOQ3.js} +25 -1
- package/dist/lib/chunk-MLKGABMK.js +9 -0
- package/dist/lib/{providers-UJEWP7C7.js → chunk-OJTISIYU.js} +46 -3
- package/dist/lib/{chunk-BCBD34D2.js → chunk-OLFXCZVH.js} +25 -7
- package/dist/lib/{chunk-CFYAZWDA.js → chunk-RUDYC7OS.js} +33 -55
- package/dist/lib/{chunk-AFYPVA5C.js → chunk-S5VWPTME.js} +940 -109
- package/dist/lib/chunk-YIWNQ7OA.js +47 -0
- package/dist/lib/{chunk-3XCGUKGJ.js → chunk-ZPIF7IJN.js} +219 -6
- package/dist/lib/index.d.ts +3427 -1380
- package/dist/lib/index.js +12767 -12281
- package/dist/lib/{openai-C2PZFGJ2.js → openai-ZWIYIBLC.js} +4 -3
- package/dist/lib/{checker-UPY4CXUL.js → permissions-BW4QPZXV.js} +4 -3
- package/dist/lib/providers-ROWSB6ND.js +9 -0
- package/dist/lib/sandbox-runtime-CCQ3X3SM.js +9 -0
- package/dist/lib/seatbelt-WO7YWKLR.js +7 -0
- package/dist/lib/{tool-filter-BFEINZIA.js → tool-filter-QU4LOZII.js} +2 -1
- package/dist/main.js +227 -194
- package/dist/{openai-WPEICAZ4.js → openai-7LMX5HKW.js} +1 -1
- package/dist/permissions-74IHQW76.js +4 -0
- package/dist/providers-2J4JJYQD.js +4 -0
- package/dist/sandbox-runtime-RVW4BK3L.js +4 -0
- package/dist/seatbelt-GMQUP6SV.js +4 -0
- package/dist/server-ZYK4L22D.js +4 -0
- package/dist/{tool-filter-X6IYME2K.js → tool-filter-U5SSL3LR.js} +1 -1
- package/package.json +6 -3
- package/dist/acp-5WRTN2LL.js +0 -14
- package/dist/agent-3CAPJCPD.js +0 -4
- package/dist/bwrap-ZTS67W2K.js +0 -4
- package/dist/checker-3O7QF7XV.js +0 -4
- package/dist/chunk-4HSQBZBI.js +0 -4
- package/dist/chunk-C5WLP3DH.js +0 -5
- package/dist/chunk-I7XJSLRI.js +0 -4
- package/dist/chunk-LHSUYZO5.js +0 -4
- package/dist/chunk-NAAAN2TD.js +0 -60
- package/dist/chunk-YIKI3EPG.js +0 -150
- package/dist/esm-4DBD7ONK.js +0 -229
- package/dist/lib/agent-NNYCUIOF.js +0 -10
- package/dist/lib/bwrap-QRGPUP4J.js +0 -6
- package/dist/lib/chunk-GTHYQZRL.js +0 -31
- package/dist/lib/chunk-ORSYNBMM.js +0 -38
- package/dist/lib/seatbelt-FT5IY73W.js +0 -6
- package/dist/seatbelt-PSPJ5LBR.js +0 -5
- package/dist/server-YPBLBRDN.js +0 -4
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import {
|
|
2
|
+
__export
|
|
3
|
+
} from "./chunk-MLKGABMK.js";
|
|
4
|
+
|
|
5
|
+
// src/sandbox/bwrap.ts
|
|
6
|
+
var bwrap_exports = {};
|
|
7
|
+
__export(bwrap_exports, {
|
|
8
|
+
BwrapSandbox: () => BwrapSandbox
|
|
9
|
+
});
|
|
10
|
+
import { execFileSync } from "child_process";
|
|
11
|
+
var BwrapSandbox = class {
|
|
12
|
+
implementation = "bwrap";
|
|
13
|
+
detected;
|
|
14
|
+
available() {
|
|
15
|
+
if (this.detected !== void 0) {
|
|
16
|
+
return this.detected;
|
|
17
|
+
}
|
|
18
|
+
try {
|
|
19
|
+
execFileSync("which", ["bwrap"], { stdio: "ignore" });
|
|
20
|
+
this.detected = true;
|
|
21
|
+
} catch {
|
|
22
|
+
this.detected = false;
|
|
23
|
+
}
|
|
24
|
+
return this.detected;
|
|
25
|
+
}
|
|
26
|
+
prepare(command, config) {
|
|
27
|
+
const args = ["--unshare-user", "--unshare-pid"];
|
|
28
|
+
args.push("--ro-bind", "/", "/");
|
|
29
|
+
for (const path of config.allowWrite) {
|
|
30
|
+
args.push("--bind", path, path);
|
|
31
|
+
}
|
|
32
|
+
for (const path of config.denyWrite) {
|
|
33
|
+
args.push("--ro-bind", path, path);
|
|
34
|
+
}
|
|
35
|
+
if (!config.networkEnabled) {
|
|
36
|
+
args.push("--unshare-net");
|
|
37
|
+
}
|
|
38
|
+
args.push("--proc", "/proc");
|
|
39
|
+
args.push("--", "bash", "-c", command);
|
|
40
|
+
return { executable: "bwrap", args };
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
export {
|
|
45
|
+
BwrapSandbox,
|
|
46
|
+
bwrap_exports
|
|
47
|
+
};
|
|
@@ -1,4 +1,16 @@
|
|
|
1
|
-
|
|
1
|
+
import {
|
|
2
|
+
__export
|
|
3
|
+
} from "./chunk-MLKGABMK.js";
|
|
4
|
+
|
|
5
|
+
// src/logger/index.ts
|
|
6
|
+
var logger_exports = {};
|
|
7
|
+
__export(logger_exports, {
|
|
8
|
+
closeLogger: () => closeLogger,
|
|
9
|
+
createChildLogger: () => createChildLogger,
|
|
10
|
+
initLogger: () => initLogger,
|
|
11
|
+
logger: () => logger,
|
|
12
|
+
sanitizeNameSegment: () => sanitizeNameSegment
|
|
13
|
+
});
|
|
2
14
|
import { openSync, closeSync, mkdirSync, writeFileSync } from "fs";
|
|
3
15
|
import { readdir, stat, unlink } from "fs/promises";
|
|
4
16
|
import { homedir } from "os";
|
|
@@ -228,7 +240,207 @@ function errSerializer(err) {
|
|
|
228
240
|
return { message: safeStringify(err), value: err };
|
|
229
241
|
}
|
|
230
242
|
|
|
231
|
-
// src/utils/
|
|
243
|
+
// src/utils/paths.ts
|
|
244
|
+
var paths_exports = {};
|
|
245
|
+
__export(paths_exports, {
|
|
246
|
+
canonicalPath: () => canonicalPath,
|
|
247
|
+
compactPath: () => compactPath,
|
|
248
|
+
isPathWithin: () => isPathWithin
|
|
249
|
+
});
|
|
250
|
+
import { realpathSync } from "fs";
|
|
251
|
+
import { homedir as homedir2 } from "os";
|
|
252
|
+
import { basename as basename2, dirname as dirname2, isAbsolute, join as join2, relative, resolve, sep } from "path";
|
|
253
|
+
function canonicalPath(path) {
|
|
254
|
+
let current = resolve(path);
|
|
255
|
+
const missing = [];
|
|
256
|
+
for (; ; ) {
|
|
257
|
+
try {
|
|
258
|
+
return join2(realpathSync(current), ...missing);
|
|
259
|
+
} catch (error) {
|
|
260
|
+
if (!(error instanceof Error) || !("code" in error) || error.code !== "ENOENT" && error.code !== "ENOTDIR") {
|
|
261
|
+
throw error;
|
|
262
|
+
}
|
|
263
|
+
const parent = dirname2(current);
|
|
264
|
+
if (parent === current) {
|
|
265
|
+
return resolve(path);
|
|
266
|
+
}
|
|
267
|
+
missing.unshift(basename2(current));
|
|
268
|
+
current = parent;
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
function isPathWithin(root, path) {
|
|
273
|
+
const child = relative(root, path);
|
|
274
|
+
return child === "" || child !== ".." && !child.startsWith(`..${sep}`) && !isAbsolute(child);
|
|
275
|
+
}
|
|
276
|
+
function compactPath(path) {
|
|
277
|
+
const home = homedir2();
|
|
278
|
+
return path === home ? "~" : path.startsWith(`${home}/`) ? `~/${path.slice(home.length + 1)}` : path;
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
// src/utils/index.ts
|
|
282
|
+
var utils_exports = {};
|
|
283
|
+
__export(utils_exports, {
|
|
284
|
+
Paths: () => paths_exports,
|
|
285
|
+
Verbs: () => verbs_exports,
|
|
286
|
+
asError: () => asError,
|
|
287
|
+
asErrorString: () => asErrorString,
|
|
288
|
+
asRecord: () => asRecord,
|
|
289
|
+
asString: () => asString,
|
|
290
|
+
boolArg: () => boolArg,
|
|
291
|
+
contentToText: () => contentToText,
|
|
292
|
+
formatToolArgs: () => formatToolArgs,
|
|
293
|
+
intArg: () => intArg,
|
|
294
|
+
isObject: () => isObject,
|
|
295
|
+
isRecord: () => isRecord,
|
|
296
|
+
safeJSONParse: () => safeJSONParse,
|
|
297
|
+
strArg: () => strArg,
|
|
298
|
+
strList: () => strList,
|
|
299
|
+
toTry: () => toTry
|
|
300
|
+
});
|
|
301
|
+
|
|
302
|
+
// src/utils/verbs.ts
|
|
303
|
+
var verbs_exports = {};
|
|
304
|
+
__export(verbs_exports, {
|
|
305
|
+
randomCompletionVerb: () => randomCompletionVerb,
|
|
306
|
+
randomVerb: () => randomVerb
|
|
307
|
+
});
|
|
308
|
+
var spinnerVerbs = [
|
|
309
|
+
"Accomplishing",
|
|
310
|
+
"Architecting",
|
|
311
|
+
"Baking",
|
|
312
|
+
"Barking",
|
|
313
|
+
"Woofing",
|
|
314
|
+
"Howling",
|
|
315
|
+
"Be-bopping'",
|
|
316
|
+
"Befuddling",
|
|
317
|
+
"Boogieing",
|
|
318
|
+
"Boondoggling",
|
|
319
|
+
"Bootstrapping",
|
|
320
|
+
"Brewing",
|
|
321
|
+
"Calculating",
|
|
322
|
+
"Canoodling",
|
|
323
|
+
"Caramelizing",
|
|
324
|
+
"Cascading",
|
|
325
|
+
"Cerebrating",
|
|
326
|
+
"Choreographing",
|
|
327
|
+
"Churning",
|
|
328
|
+
"Coalescing",
|
|
329
|
+
"Cogitating",
|
|
330
|
+
"Combobulating",
|
|
331
|
+
"Composing",
|
|
332
|
+
"Computing",
|
|
333
|
+
"Concocting",
|
|
334
|
+
"Considering",
|
|
335
|
+
"Contemplating",
|
|
336
|
+
"Cooking",
|
|
337
|
+
"Crafting",
|
|
338
|
+
"Creating",
|
|
339
|
+
"Crunching",
|
|
340
|
+
"Crystallizing",
|
|
341
|
+
"Cultivating",
|
|
342
|
+
"Deciphering",
|
|
343
|
+
"Deliberating",
|
|
344
|
+
"Dilly-dallying",
|
|
345
|
+
"Discombobulating",
|
|
346
|
+
"Doodling",
|
|
347
|
+
"Elucidating",
|
|
348
|
+
"Enchanting",
|
|
349
|
+
"Envisioning",
|
|
350
|
+
"Fermenting",
|
|
351
|
+
"Finagling",
|
|
352
|
+
"Flamb\xE9ing",
|
|
353
|
+
"Flummoxing",
|
|
354
|
+
"Forging",
|
|
355
|
+
"Frolicking",
|
|
356
|
+
"Gallivanting",
|
|
357
|
+
"Garnishing",
|
|
358
|
+
"Generating",
|
|
359
|
+
"Germinating",
|
|
360
|
+
"Grooving",
|
|
361
|
+
"Harmonizing",
|
|
362
|
+
"Hatching",
|
|
363
|
+
"Honking",
|
|
364
|
+
"Ideating",
|
|
365
|
+
"Imagining",
|
|
366
|
+
"Improvising",
|
|
367
|
+
"Incubating",
|
|
368
|
+
"Inferring",
|
|
369
|
+
"Infusing",
|
|
370
|
+
"Kneading",
|
|
371
|
+
"Lollygagging",
|
|
372
|
+
"Manifesting",
|
|
373
|
+
"Marinating",
|
|
374
|
+
"Meandering",
|
|
375
|
+
"Metamorphosing",
|
|
376
|
+
"Mewing",
|
|
377
|
+
"Moonwalking",
|
|
378
|
+
"Moseying",
|
|
379
|
+
"Mulling",
|
|
380
|
+
"Musing",
|
|
381
|
+
"Noodling",
|
|
382
|
+
"Orbiting",
|
|
383
|
+
"Orchestrating",
|
|
384
|
+
"Percolating",
|
|
385
|
+
"Philosophizing",
|
|
386
|
+
"Pondering",
|
|
387
|
+
"Pontificating",
|
|
388
|
+
"Pouncing",
|
|
389
|
+
"Purring",
|
|
390
|
+
"Puzzling",
|
|
391
|
+
"Razzle-dazzling",
|
|
392
|
+
"Ruminating",
|
|
393
|
+
"Scampering",
|
|
394
|
+
"Simmering",
|
|
395
|
+
"Sketching",
|
|
396
|
+
"Spelunking",
|
|
397
|
+
"Spinning",
|
|
398
|
+
"Sprouting",
|
|
399
|
+
"Synthesizing",
|
|
400
|
+
"Thinking",
|
|
401
|
+
"Tinkering",
|
|
402
|
+
"Transfiguring",
|
|
403
|
+
"Transmuting",
|
|
404
|
+
"Undulating",
|
|
405
|
+
"Unfurling",
|
|
406
|
+
"Unravelling",
|
|
407
|
+
"Vibing",
|
|
408
|
+
"Wandering",
|
|
409
|
+
"Whisking",
|
|
410
|
+
"Working",
|
|
411
|
+
"Wrangling",
|
|
412
|
+
"Zigzagging"
|
|
413
|
+
];
|
|
414
|
+
function randomVerb() {
|
|
415
|
+
return spinnerVerbs[Math.floor(Math.random() * spinnerVerbs.length)];
|
|
416
|
+
}
|
|
417
|
+
var completionVerbs = [
|
|
418
|
+
"Accomplished",
|
|
419
|
+
"Baked",
|
|
420
|
+
"Brewed",
|
|
421
|
+
"Cooked",
|
|
422
|
+
"Crafted",
|
|
423
|
+
"Crunched",
|
|
424
|
+
"Forged",
|
|
425
|
+
"Hatched",
|
|
426
|
+
"Pondered",
|
|
427
|
+
"Synthesized",
|
|
428
|
+
"Tinkered",
|
|
429
|
+
"Worked",
|
|
430
|
+
"Wrangled",
|
|
431
|
+
"Computed",
|
|
432
|
+
"Created",
|
|
433
|
+
"Composed",
|
|
434
|
+
"Conjured",
|
|
435
|
+
"Concocted",
|
|
436
|
+
"Cultivated",
|
|
437
|
+
"Deciphered"
|
|
438
|
+
];
|
|
439
|
+
function randomCompletionVerb() {
|
|
440
|
+
return completionVerbs[Math.floor(Math.random() * completionVerbs.length)];
|
|
441
|
+
}
|
|
442
|
+
|
|
443
|
+
// src/utils/index.ts
|
|
232
444
|
var log = createChildLogger({ module: "utils" });
|
|
233
445
|
function contentToText(content) {
|
|
234
446
|
if (typeof content === "string") {
|
|
@@ -361,18 +573,19 @@ export {
|
|
|
361
573
|
closeLogger,
|
|
362
574
|
logger,
|
|
363
575
|
createChildLogger,
|
|
576
|
+
logger_exports,
|
|
577
|
+
canonicalPath,
|
|
578
|
+
isPathWithin,
|
|
579
|
+
randomVerb,
|
|
364
580
|
contentToText,
|
|
365
581
|
isRecord,
|
|
366
582
|
asRecord,
|
|
367
583
|
asString,
|
|
368
584
|
asErrorString,
|
|
369
585
|
isObject,
|
|
370
|
-
toTry,
|
|
371
|
-
safeJSONParse,
|
|
372
|
-
asError,
|
|
373
586
|
intArg,
|
|
374
587
|
strList,
|
|
375
588
|
strArg,
|
|
376
589
|
boolArg,
|
|
377
|
-
|
|
590
|
+
utils_exports
|
|
378
591
|
};
|