@swifty.js/swifty 0.0.32 → 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.
Files changed (101) hide show
  1. package/README.md +64 -0
  2. package/dist/acp-A4KRKOHD.js +14 -0
  3. package/dist/agent-VDWIGFIV.js +4 -0
  4. package/dist/anthropic-AR2Y4FBR.js +4 -0
  5. package/dist/bwrap-4KOC7P3X.js +4 -0
  6. package/dist/chunk-2U4IWZ6E.js +4 -0
  7. package/dist/{chunk-2EV72T5X.js → chunk-325L2ILZ.js} +1 -1
  8. package/dist/chunk-35X3GW25.js +4 -0
  9. package/dist/chunk-44LPRRYU.js +60 -0
  10. package/dist/chunk-4B4SGVJH.js +164 -0
  11. package/dist/chunk-5W2TCASL.js +4 -0
  12. package/dist/chunk-6I3HEMIE.js +4 -0
  13. package/dist/{chunk-TKQ5T5VO.js → chunk-7JQHFZRD.js} +2 -2
  14. package/dist/chunk-F4FOFPKL.js +611 -0
  15. package/dist/chunk-FZORZF22.js +16 -0
  16. package/dist/chunk-G2TE2QZM.js +4 -0
  17. package/dist/{chunk-JMF2DWGY.js → chunk-H56UQALW.js} +1 -1
  18. package/dist/chunk-IOLGXPUQ.js +6 -0
  19. package/dist/chunk-IXCJZNBB.js +5 -0
  20. package/dist/chunk-IZ7QOBSB.js +4 -0
  21. package/dist/chunk-JC44NVST.js +4 -0
  22. package/dist/chunk-LC7ZWLIH.js +4 -0
  23. package/dist/chunk-M4D66APS.js +67 -0
  24. package/dist/chunk-NCZR3AGA.js +65 -0
  25. package/dist/chunk-NDPYUGE5.js +5 -0
  26. package/dist/chunk-PH643I2P.js +4 -0
  27. package/dist/{chunk-FPQ2LBL4.js → chunk-QQVDL4QT.js} +1 -1
  28. package/dist/{chunk-TCQ4EB4G.js → chunk-TNF3EHFY.js} +1 -1
  29. package/dist/{server-QMMIYNXW.js → chunk-TOM34LJB.js} +16 -16
  30. package/dist/{chunk-NERVCUWE.js → chunk-UJGMTIYO.js} +1 -1
  31. package/dist/chunk-XGUH7SGV.js +4 -0
  32. package/dist/chunk-YBS5ATGZ.js +4 -0
  33. package/dist/chunk-YKWIZE5D.js +4 -0
  34. package/dist/{devtools-OJ75EP3T.js → devtools-WJM4UVVT.js} +1 -1
  35. package/dist/esm-46WSO26W.js +4 -0
  36. package/dist/esm-6EDGM6QS.js +4 -0
  37. package/dist/esm-D6BB3FBR.js +4 -0
  38. package/dist/esm-P2KEXEEK.js +4 -0
  39. package/dist/esm-VBV56AO5.js +229 -0
  40. package/dist/esm-XYKZYVLV.js +4 -0
  41. package/dist/esm-YJVVI2QX.js +4 -0
  42. package/dist/getMachineId-bsd-NBOQ3GRQ.js +4 -0
  43. package/dist/getMachineId-darwin-6VBNSUFR.js +5 -0
  44. package/dist/getMachineId-linux-RQ33NIOO.js +4 -0
  45. package/dist/getMachineId-unsupported-IWOYPUHZ.js +4 -0
  46. package/dist/getMachineId-win-ITT3WXP6.js +4 -0
  47. package/dist/lib/agent-TC4HSVMS.js +16 -0
  48. package/dist/lib/{anthropic-B33M2AVN.js → anthropic-FKIGL7NL.js} +6 -5
  49. package/dist/lib/bwrap-2OL7VPSO.js +7 -0
  50. package/dist/lib/{chunk-FODSMOWP.js → chunk-6V7RW6HA.js} +34 -16
  51. package/dist/lib/{chunk-TJLAJGG4.js → chunk-ALQHMYOZ.js} +14 -3
  52. package/dist/lib/{chunk-XT67KGWE.js → chunk-BQFVUVLI.js} +12 -2
  53. package/dist/lib/chunk-FFM2LB4C.js +132 -0
  54. package/dist/lib/{chunk-VUD72RTY.js → chunk-FLKB4BK7.js} +16 -5
  55. package/dist/lib/{chunk-3OFLDUAW.js → chunk-HQSYRTER.js} +96 -49
  56. package/dist/lib/{chunk-4BPKIIQD.js → chunk-LRN4MOQ3.js} +31 -5
  57. package/dist/lib/chunk-MLKGABMK.js +9 -0
  58. package/dist/lib/chunk-OJTISIYU.js +462 -0
  59. package/dist/lib/{chunk-BCBD34D2.js → chunk-OLFXCZVH.js} +25 -7
  60. package/dist/lib/{chunk-SOOSTGHI.js → chunk-RUDYC7OS.js} +32 -48
  61. package/dist/lib/{chunk-UH5M7FDP.js → chunk-S5VWPTME.js} +1189 -126
  62. package/dist/lib/chunk-YIWNQ7OA.js +47 -0
  63. package/dist/lib/{chunk-3XCGUKGJ.js → chunk-ZPIF7IJN.js} +219 -6
  64. package/dist/lib/index.d.ts +3267 -1143
  65. package/dist/lib/index.js +13214 -12207
  66. package/dist/lib/{openai-C2PZFGJ2.js → openai-ZWIYIBLC.js} +4 -3
  67. package/dist/lib/{checker-QNMXPZ7C.js → permissions-BW4QPZXV.js} +4 -3
  68. package/dist/lib/providers-ROWSB6ND.js +9 -0
  69. package/dist/lib/sandbox-runtime-CCQ3X3SM.js +9 -0
  70. package/dist/lib/seatbelt-WO7YWKLR.js +7 -0
  71. package/dist/lib/{tool-filter-IMIU7CW2.js → tool-filter-QU4LOZII.js} +2 -1
  72. package/dist/main.js +231 -190
  73. package/dist/{node-GXMM4JG3.js → node-A6KBFKOV.js} +1 -1
  74. package/dist/{openai-M7B2TITO.js → openai-7LMX5HKW.js} +1 -1
  75. package/dist/permissions-74IHQW76.js +4 -0
  76. package/dist/providers-2J4JJYQD.js +4 -0
  77. package/dist/sandbox-runtime-RVW4BK3L.js +4 -0
  78. package/dist/seatbelt-GMQUP6SV.js +4 -0
  79. package/dist/server-ZYK4L22D.js +4 -0
  80. package/dist/src-3A5BCUSZ.js +4 -0
  81. package/dist/src-CRYFVH7Y.js +12 -0
  82. package/dist/src-Y77IB66J.js +4 -0
  83. package/dist/src-ZCW4GCG2.js +4 -0
  84. package/dist/{tool-filter-7LLVAHD5.js → tool-filter-U5SSL3LR.js} +1 -1
  85. package/dist/turndown.es-WNOSVZF6.js +83 -0
  86. package/package.json +34 -5
  87. package/dist/agent-2DUTUJFX.js +0 -4
  88. package/dist/anthropic-KR5MXB5I.js +0 -4
  89. package/dist/bwrap-TPE6G4BM.js +0 -4
  90. package/dist/checker-RKAWOOXC.js +0 -4
  91. package/dist/chunk-4YVJP2CO.js +0 -4
  92. package/dist/chunk-BWWNI2FK.js +0 -121
  93. package/dist/chunk-LTFPTWX4.js +0 -612
  94. package/dist/chunk-S35E7OYL.js +0 -5
  95. package/dist/chunk-TW7RHCDS.js +0 -150
  96. package/dist/chunk-X3UA5OZL.js +0 -4
  97. package/dist/lib/agent-3OEC4SOB.js +0 -10
  98. package/dist/lib/bwrap-QRGPUP4J.js +0 -6
  99. package/dist/lib/chunk-ORSYNBMM.js +0 -38
  100. package/dist/lib/seatbelt-FT5IY73W.js +0 -6
  101. package/dist/seatbelt-3GM2YGXV.js +0 -5
@@ -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
- // src/logger/logger.ts
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/utils.ts
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
- formatToolArgs
590
+ utils_exports
378
591
  };