@swifty.js/swifty 0.0.27 → 0.0.28

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 (52) hide show
  1. package/README.md +14 -6
  2. package/dist/agent-3NON2EXE.js +4 -0
  3. package/dist/anthropic-BJ5GN2VT.js +4 -0
  4. package/dist/checker-N5TIJEN5.js +4 -0
  5. package/dist/chunk-D34FUVGU.js +4 -0
  6. package/dist/chunk-JGSIQXEN.js +4 -0
  7. package/dist/{chunk-UGJVMFGH.js → chunk-K5ZK27BX.js} +1 -1
  8. package/dist/chunk-LZBOXJX2.js +301 -0
  9. package/dist/chunk-OTVZGPHD.js +121 -0
  10. package/dist/chunk-QCKJLO6X.js +4 -0
  11. package/dist/chunk-R63ASIIW.js +407 -0
  12. package/dist/chunk-WX3B64R4.js +4 -0
  13. package/dist/chunk-Y6SQB5FG.js +4 -0
  14. package/dist/glob.wasm +0 -0
  15. package/dist/lib/agent-XYO2MXXK.js +11 -0
  16. package/dist/lib/{anthropic-RYPJDHQM.js → anthropic-TGJGAP5R.js} +4 -5
  17. package/dist/lib/{checker-6BW4222R.js → checker-AXHPKVBY.js} +2 -2
  18. package/dist/lib/{chunk-HK2Z6WP4.js → chunk-2IVEVG5N.js} +5 -1
  19. package/dist/lib/{chunk-2AUSNVIB.js → chunk-ALJAVRRX.js} +28 -34
  20. package/dist/lib/{chunk-GNI7YX6F.js → chunk-DJ6AILPN.js} +70 -24
  21. package/dist/lib/chunk-DV6RV5WU.js +2345 -0
  22. package/dist/lib/{chunk-3LU4APFB.js → chunk-FBSPZQGC.js} +126 -73
  23. package/dist/lib/chunk-IB5IQK2S.js +136 -0
  24. package/dist/lib/{chunk-PZ42NAFA.js → chunk-KG4MJGKQ.js} +19 -21
  25. package/dist/lib/{chunk-XFSN4LMA.js → chunk-P4F46PEF.js} +43 -14
  26. package/dist/lib/glob.wasm +0 -0
  27. package/dist/lib/index.d.ts +145 -123
  28. package/dist/lib/index.js +2185 -1722
  29. package/dist/lib/{openai-VX5VBXZ4.js → openai-5UCIIDPO.js} +2 -3
  30. package/dist/lib/{tool-filter-VF7TZRE5.js → tool-filter-R6HDDJHE.js} +1 -1
  31. package/dist/main.js +204 -195
  32. package/dist/{openai-5FDSLJNM.js → openai-YLS2LUAI.js} +14 -14
  33. package/dist/{server-F666APPN.js → server-GX72MJQF.js} +21 -21
  34. package/dist/{tool-filter-NO7I3HFD.js → tool-filter-VBP6WOGO.js} +1 -1
  35. package/package.json +1 -1
  36. package/dist/agent-OMC6YIMW.js +0 -4
  37. package/dist/anthropic-T5K4BQPB.js +0 -4
  38. package/dist/checker-TOQVEG3P.js +0 -4
  39. package/dist/chunk-5I2WXSGV.js +0 -90
  40. package/dist/chunk-A2VR3BC4.js +0 -4
  41. package/dist/chunk-A57FEYSN.js +0 -4
  42. package/dist/chunk-BRC5L644.js +0 -130
  43. package/dist/chunk-FZPTNGTU.js +0 -4
  44. package/dist/chunk-G6YIQW3Z.js +0 -238
  45. package/dist/chunk-I2XG2PXV.js +0 -4
  46. package/dist/chunk-LVSHXIBK.js +0 -389
  47. package/dist/chunk-SULWNDNC.js +0 -4
  48. package/dist/chunk-WO6DL7OB.js +0 -35
  49. package/dist/lib/agent-U7MIUCKT.js +0 -9
  50. package/dist/lib/chunk-2QILP24G.js +0 -1120
  51. package/dist/lib/chunk-OO2CLOEE.js +0 -88
  52. package/dist/lib/chunk-RKJYTYQM.js +0 -1285
@@ -1,88 +0,0 @@
1
- // src/llm/errors.ts
2
- var LLMError = class extends Error {
3
- constructor(message) {
4
- super(message);
5
- this.name = "LLMError";
6
- }
7
- };
8
- var AuthenticationError = class extends LLMError {
9
- constructor(message) {
10
- super(message);
11
- this.name = "AuthenticationError";
12
- }
13
- };
14
- var RateLimitError = class extends LLMError {
15
- retryAfter;
16
- constructor(message, retryAfter) {
17
- super(message);
18
- this.name = "RateLimitError";
19
- this.retryAfter = retryAfter;
20
- }
21
- };
22
- var NetworkError = class extends LLMError {
23
- constructor(message) {
24
- super(message);
25
- this.name = "NetworkError";
26
- }
27
- };
28
- var ContextTooLongError = class extends LLMError {
29
- constructor(message) {
30
- super(message);
31
- this.name = "ContextTooLongError";
32
- }
33
- };
34
-
35
- // src/conversation/pairing.ts
36
- var INTERRUPTED_TOOL_RESULT = "Tool execution was interrupted. The tool may or may not have completed; verify before relying on its effects.";
37
- var REJECTED_TOOL_RESULT = "The user rejected this tool use. Nothing was changed (for file edits, the new content was NOT written).";
38
- function ensureToolPairing(messages) {
39
- const resolved = /* @__PURE__ */ new Set();
40
- const issued = /* @__PURE__ */ new Set();
41
- for (const m of messages) {
42
- for (const tr of m.toolResults ?? []) {
43
- resolved.add(tr.toolUseId);
44
- }
45
- for (const tu of m.toolUses ?? []) {
46
- issued.add(tu.toolUseId);
47
- }
48
- }
49
- const out = [];
50
- for (const m of messages) {
51
- let current = m;
52
- if ((m.toolResults?.length ?? 0) > 0) {
53
- const kept = (m.toolResults ?? []).filter((tr) => issued.has(tr.toolUseId));
54
- if (kept.length === 0 && !m.content && !(m.toolUses?.length ?? 0)) {
55
- continue;
56
- }
57
- current = { ...m, toolResults: kept };
58
- }
59
- out.push(current);
60
- const missing = [];
61
- for (const tu of m.toolUses ?? []) {
62
- if (resolved.has(tu.toolUseId)) {
63
- continue;
64
- }
65
- missing.push({
66
- toolUseId: tu.toolUseId,
67
- content: INTERRUPTED_TOOL_RESULT,
68
- isError: true
69
- });
70
- resolved.add(tu.toolUseId);
71
- }
72
- if (missing.length > 0) {
73
- out.push({ role: "user", content: "", toolResults: missing });
74
- }
75
- }
76
- return out;
77
- }
78
-
79
- export {
80
- LLMError,
81
- AuthenticationError,
82
- RateLimitError,
83
- NetworkError,
84
- ContextTooLongError,
85
- INTERRUPTED_TOOL_RESULT,
86
- REJECTED_TOOL_RESULT,
87
- ensureToolPairing
88
- };