@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.
Files changed (71) hide show
  1. package/dist/acp-A4KRKOHD.js +14 -0
  2. package/dist/agent-VDWIGFIV.js +4 -0
  3. package/dist/{anthropic-FXRRA63E.js → anthropic-AR2Y4FBR.js} +1 -1
  4. package/dist/bwrap-4KOC7P3X.js +4 -0
  5. package/dist/{chunk-IKQTIDRL.js → chunk-325L2ILZ.js} +1 -1
  6. package/dist/chunk-44LPRRYU.js +60 -0
  7. package/dist/chunk-4B4SGVJH.js +164 -0
  8. package/dist/chunk-5W2TCASL.js +4 -0
  9. package/dist/{chunk-FUKVR3XO.js → chunk-F4FOFPKL.js} +126 -123
  10. package/dist/{chunk-4PQYUHSN.js → chunk-H56UQALW.js} +1 -1
  11. package/dist/{providers-WNYZUMZ3.js → chunk-IOLGXPUQ.js} +3 -3
  12. package/dist/chunk-IXCJZNBB.js +5 -0
  13. package/dist/chunk-JC44NVST.js +4 -0
  14. package/dist/chunk-NDPYUGE5.js +5 -0
  15. package/dist/chunk-PH643I2P.js +4 -0
  16. package/dist/{chunk-PXQD6GWP.js → chunk-TOM34LJB.js} +7 -7
  17. package/dist/{chunk-4C3KJLJV.js → chunk-UJGMTIYO.js} +1 -1
  18. package/dist/chunk-YBS5ATGZ.js +4 -0
  19. package/dist/esm-VBV56AO5.js +229 -0
  20. package/dist/lib/agent-TC4HSVMS.js +16 -0
  21. package/dist/lib/{anthropic-B33M2AVN.js → anthropic-FKIGL7NL.js} +6 -5
  22. package/dist/lib/bwrap-2OL7VPSO.js +7 -0
  23. package/dist/lib/{chunk-FODSMOWP.js → chunk-6V7RW6HA.js} +34 -16
  24. package/dist/lib/{chunk-TJLAJGG4.js → chunk-ALQHMYOZ.js} +14 -3
  25. package/dist/lib/{chunk-XT67KGWE.js → chunk-BQFVUVLI.js} +12 -2
  26. package/dist/lib/chunk-FFM2LB4C.js +132 -0
  27. package/dist/lib/{chunk-VUD72RTY.js → chunk-FLKB4BK7.js} +16 -5
  28. package/dist/lib/{chunk-3OFLDUAW.js → chunk-HQSYRTER.js} +96 -49
  29. package/dist/lib/{chunk-LDWFI6MR.js → chunk-LRN4MOQ3.js} +25 -1
  30. package/dist/lib/chunk-MLKGABMK.js +9 -0
  31. package/dist/lib/{providers-UJEWP7C7.js → chunk-OJTISIYU.js} +46 -3
  32. package/dist/lib/{chunk-BCBD34D2.js → chunk-OLFXCZVH.js} +25 -7
  33. package/dist/lib/{chunk-CFYAZWDA.js → chunk-RUDYC7OS.js} +33 -55
  34. package/dist/lib/{chunk-AFYPVA5C.js → chunk-S5VWPTME.js} +940 -109
  35. package/dist/lib/chunk-YIWNQ7OA.js +47 -0
  36. package/dist/lib/{chunk-3XCGUKGJ.js → chunk-ZPIF7IJN.js} +219 -6
  37. package/dist/lib/index.d.ts +3427 -1380
  38. package/dist/lib/index.js +12767 -12281
  39. package/dist/lib/{openai-C2PZFGJ2.js → openai-ZWIYIBLC.js} +4 -3
  40. package/dist/lib/{checker-UPY4CXUL.js → permissions-BW4QPZXV.js} +4 -3
  41. package/dist/lib/providers-ROWSB6ND.js +9 -0
  42. package/dist/lib/sandbox-runtime-CCQ3X3SM.js +9 -0
  43. package/dist/lib/seatbelt-WO7YWKLR.js +7 -0
  44. package/dist/lib/{tool-filter-BFEINZIA.js → tool-filter-QU4LOZII.js} +2 -1
  45. package/dist/main.js +227 -194
  46. package/dist/{openai-WPEICAZ4.js → openai-7LMX5HKW.js} +1 -1
  47. package/dist/permissions-74IHQW76.js +4 -0
  48. package/dist/providers-2J4JJYQD.js +4 -0
  49. package/dist/sandbox-runtime-RVW4BK3L.js +4 -0
  50. package/dist/seatbelt-GMQUP6SV.js +4 -0
  51. package/dist/server-ZYK4L22D.js +4 -0
  52. package/dist/{tool-filter-X6IYME2K.js → tool-filter-U5SSL3LR.js} +1 -1
  53. package/package.json +6 -3
  54. package/dist/acp-5WRTN2LL.js +0 -14
  55. package/dist/agent-3CAPJCPD.js +0 -4
  56. package/dist/bwrap-ZTS67W2K.js +0 -4
  57. package/dist/checker-3O7QF7XV.js +0 -4
  58. package/dist/chunk-4HSQBZBI.js +0 -4
  59. package/dist/chunk-C5WLP3DH.js +0 -5
  60. package/dist/chunk-I7XJSLRI.js +0 -4
  61. package/dist/chunk-LHSUYZO5.js +0 -4
  62. package/dist/chunk-NAAAN2TD.js +0 -60
  63. package/dist/chunk-YIKI3EPG.js +0 -150
  64. package/dist/esm-4DBD7ONK.js +0 -229
  65. package/dist/lib/agent-NNYCUIOF.js +0 -10
  66. package/dist/lib/bwrap-QRGPUP4J.js +0 -6
  67. package/dist/lib/chunk-GTHYQZRL.js +0 -31
  68. package/dist/lib/chunk-ORSYNBMM.js +0 -38
  69. package/dist/lib/seatbelt-FT5IY73W.js +0 -6
  70. package/dist/seatbelt-PSPJ5LBR.js +0 -5
  71. package/dist/server-YPBLBRDN.js +0 -4
@@ -0,0 +1,16 @@
1
+ import {
2
+ Agent,
3
+ events_exports,
4
+ streaming_executor_exports
5
+ } from "./chunk-S5VWPTME.js";
6
+ import "./chunk-OJTISIYU.js";
7
+ import "./chunk-BQFVUVLI.js";
8
+ import "./chunk-HQSYRTER.js";
9
+ import "./chunk-OLFXCZVH.js";
10
+ import "./chunk-ZPIF7IJN.js";
11
+ import "./chunk-MLKGABMK.js";
12
+ export {
13
+ Agent,
14
+ events_exports as Events,
15
+ streaming_executor_exports as StreamingExecutor
16
+ };
@@ -5,11 +5,12 @@ import {
5
5
  markLastUserTailForCache,
6
6
  markToolsForCache,
7
7
  needsToolSearchBeta
8
- } from "./chunk-FODSMOWP.js";
9
- import "./chunk-XT67KGWE.js";
10
- import "./chunk-BCBD34D2.js";
11
- import "./chunk-3OFLDUAW.js";
12
- import "./chunk-3XCGUKGJ.js";
8
+ } from "./chunk-6V7RW6HA.js";
9
+ import "./chunk-BQFVUVLI.js";
10
+ import "./chunk-HQSYRTER.js";
11
+ import "./chunk-OLFXCZVH.js";
12
+ import "./chunk-ZPIF7IJN.js";
13
+ import "./chunk-MLKGABMK.js";
13
14
  export {
14
15
  AnthropicClient,
15
16
  buildAnthropicMessages,
@@ -0,0 +1,7 @@
1
+ import {
2
+ BwrapSandbox
3
+ } from "./chunk-YIWNQ7OA.js";
4
+ import "./chunk-MLKGABMK.js";
5
+ export {
6
+ BwrapSandbox
7
+ };
@@ -1,10 +1,6 @@
1
1
  import {
2
2
  normalizeToolResultContentBlock
3
- } from "./chunk-XT67KGWE.js";
4
- import {
5
- MCP_TOOL_PREFIX,
6
- isMcpToolLike
7
- } from "./chunk-BCBD34D2.js";
3
+ } from "./chunk-BQFVUVLI.js";
8
4
  import {
9
5
  AuthenticationError,
10
6
  ContextTooLongError,
@@ -21,7 +17,11 @@ import {
21
17
  thinkingBudgetForLevel,
22
18
  toAnthropicThinkingEffort,
23
19
  toReasoningEffort
24
- } from "./chunk-3OFLDUAW.js";
20
+ } from "./chunk-HQSYRTER.js";
21
+ import {
22
+ MCP_TOOL_PREFIX,
23
+ isMcpToolLike
24
+ } from "./chunk-OLFXCZVH.js";
25
25
  import {
26
26
  asErrorString,
27
27
  asRecord,
@@ -30,13 +30,37 @@ import {
30
30
  createChildLogger,
31
31
  isRecord,
32
32
  strArg
33
- } from "./chunk-3XCGUKGJ.js";
33
+ } from "./chunk-ZPIF7IJN.js";
34
+ import {
35
+ __export
36
+ } from "./chunk-MLKGABMK.js";
34
37
 
35
38
  // src/llm/anthropic.ts
39
+ var anthropic_exports = {};
40
+ __export(anthropic_exports, {
41
+ AnthropicClient: () => AnthropicClient,
42
+ buildAnthropicMessages: () => buildAnthropicMessages,
43
+ fetchModelContextWindow: () => fetchModelContextWindow,
44
+ markLastUserTailForCache: () => markLastUserTailForCache,
45
+ markToolsForCache: () => markToolsForCache,
46
+ needsToolSearchBeta: () => needsToolSearchBeta
47
+ });
36
48
  import Anthropic from "@anthropic-ai/sdk";
37
49
  import { safeParseAsync, z } from "zod";
38
50
 
39
51
  // src/mcp/strategy.ts
52
+ var strategy_exports = {};
53
+ __export(strategy_exports, {
54
+ CHARS_PER_TOKEN: () => CHARS_PER_TOKEN,
55
+ DEFAULT_EAGER_THRESHOLD_PERCENT: () => DEFAULT_EAGER_THRESHOLD_PERCENT,
56
+ NATIVE_TOOL_USE_BETA: () => NATIVE_TOOL_USE_BETA,
57
+ applyMode: () => applyMode,
58
+ decideAndApply: () => decideAndApply,
59
+ decideMode: () => decideMode,
60
+ estimateSchemaTokens: () => estimateSchemaTokens,
61
+ isOfficialAnthropicEndpoint: () => isOfficialAnthropicEndpoint,
62
+ measureSchemaChars: () => measureSchemaChars
63
+ });
40
64
  var DEFAULT_EAGER_THRESHOLD_PERCENT = 10;
41
65
  var CHARS_PER_TOKEN = 2.5;
42
66
  var NATIVE_TOOL_USE_BETA = "advanced-tool-use-2025-11-20";
@@ -570,19 +594,13 @@ function classifyAnthropicError(err) {
570
594
  }
571
595
 
572
596
  export {
573
- DEFAULT_EAGER_THRESHOLD_PERCENT,
574
- CHARS_PER_TOKEN,
575
- NATIVE_TOOL_USE_BETA,
576
- isOfficialAnthropicEndpoint,
577
- estimateSchemaTokens,
578
- decideMode,
579
- measureSchemaChars,
580
- applyMode,
581
597
  decideAndApply,
598
+ strategy_exports,
582
599
  markToolsForCache,
583
600
  needsToolSearchBeta,
584
601
  fetchModelContextWindow,
585
602
  buildAnthropicMessages,
586
603
  AnthropicClient,
587
- markLastUserTailForCache
604
+ markLastUserTailForCache,
605
+ anthropic_exports
588
606
  };
@@ -11,7 +11,7 @@ import {
11
11
  getThinkingLevel,
12
12
  resolveAPIKey,
13
13
  toReasoningEffort
14
- } from "./chunk-3OFLDUAW.js";
14
+ } from "./chunk-HQSYRTER.js";
15
15
  import {
16
16
  asRecord,
17
17
  asString,
@@ -19,9 +19,19 @@ import {
19
19
  createChildLogger,
20
20
  isRecord,
21
21
  strArg
22
- } from "./chunk-3XCGUKGJ.js";
22
+ } from "./chunk-ZPIF7IJN.js";
23
+ import {
24
+ __export
25
+ } from "./chunk-MLKGABMK.js";
23
26
 
24
27
  // src/llm/openai.ts
28
+ var openai_exports = {};
29
+ __export(openai_exports, {
30
+ OpenAIClient: () => OpenAIClient,
31
+ OpenAICompatClient: () => OpenAICompatClient,
32
+ buildChatCompletionMessages: () => buildChatCompletionMessages,
33
+ buildOpenAIInput: () => buildOpenAIInput
34
+ });
25
35
  import OpenAI from "openai";
26
36
  var log = createChildLogger({ module: "llm" });
27
37
  function computerActionArguments(action) {
@@ -842,5 +852,6 @@ export {
842
852
  OpenAIClient,
843
853
  buildOpenAIInput,
844
854
  OpenAICompatClient,
845
- buildChatCompletionMessages
855
+ buildChatCompletionMessages,
856
+ openai_exports
846
857
  };
@@ -1,4 +1,14 @@
1
+ import {
2
+ __export
3
+ } from "./chunk-MLKGABMK.js";
4
+
1
5
  // src/tools/types.ts
6
+ var types_exports = {};
7
+ __export(types_exports, {
8
+ SKIP_DIRS: () => SKIP_DIRS,
9
+ isToolResultContentBlock: () => isToolResultContentBlock,
10
+ normalizeToolResultContentBlock: () => normalizeToolResultContentBlock
11
+ });
2
12
  function isRecord(value) {
3
13
  return typeof value === "object" && value !== null && !Array.isArray(value);
4
14
  }
@@ -135,6 +145,6 @@ var SKIP_DIRS = /* @__PURE__ */ new Set([
135
145
 
136
146
  export {
137
147
  normalizeToolResultContentBlock,
138
- isToolResultContentBlock,
139
- SKIP_DIRS
148
+ SKIP_DIRS,
149
+ types_exports
140
150
  };
@@ -0,0 +1,132 @@
1
+ import {
2
+ __export
3
+ } from "./chunk-MLKGABMK.js";
4
+
5
+ // src/sandbox/sandbox-runtime.ts
6
+ var sandbox_runtime_exports = {};
7
+ __export(sandbox_runtime_exports, {
8
+ SandboxRuntimeSandbox: () => SandboxRuntimeSandbox,
9
+ createSandboxRuntimeConfig: () => createSandboxRuntimeConfig
10
+ });
11
+ import { isAbsolute, resolve } from "path";
12
+ async function loadSandboxRuntime() {
13
+ return await import("@anthropic-ai/sandbox-runtime");
14
+ }
15
+ function resolvePaths(paths, cwd) {
16
+ return paths.map((path) => isAbsolute(path) ? path : resolve(cwd, path));
17
+ }
18
+ function createSandboxRuntimeConfig(config, cwd) {
19
+ return {
20
+ network: {
21
+ allowedDomains: [],
22
+ deniedDomains: config.networkEnabled ? [] : ["*"],
23
+ strictAllowlist: !config.networkEnabled
24
+ },
25
+ filesystem: {
26
+ denyRead: [],
27
+ allowWrite: resolvePaths(config.allowWrite, cwd),
28
+ denyWrite: resolvePaths(config.denyWrite, cwd),
29
+ allowGitConfig: false
30
+ }
31
+ };
32
+ }
33
+ var SandboxRuntimeSandbox = class {
34
+ implementation = "sandbox-runtime";
35
+ availabilityError;
36
+ availabilityPromise;
37
+ configKey;
38
+ initializationPromise;
39
+ runtimePromise;
40
+ available() {
41
+ return this.availabilityPromise ??= this.checkAvailability();
42
+ }
43
+ async prepare(command, config, context) {
44
+ if (!await this.available()) {
45
+ throw new Error(this.availabilityError ?? "sandbox runtime is unavailable");
46
+ }
47
+ const runtime = await this.loadRuntime();
48
+ const runtimeConfig = runtime.SandboxRuntimeConfigSchema.parse(
49
+ createSandboxRuntimeConfig(config, context.cwd)
50
+ );
51
+ const configKey = JSON.stringify(runtimeConfig);
52
+ if (this.initializationPromise) {
53
+ await this.initializationPromise;
54
+ }
55
+ if (this.configKey !== configKey || !runtime.SandboxManager.isSandboxingEnabled()) {
56
+ this.initializationPromise = (async () => {
57
+ if (runtime.SandboxManager.isSandboxingEnabled()) {
58
+ await runtime.SandboxManager.reset();
59
+ }
60
+ await runtime.SandboxManager.initialize(
61
+ runtimeConfig,
62
+ config.networkEnabled ? () => Promise.resolve(true) : void 0
63
+ );
64
+ this.configKey = configKey;
65
+ })();
66
+ try {
67
+ await this.initializationPromise;
68
+ } finally {
69
+ this.initializationPromise = void 0;
70
+ }
71
+ }
72
+ const commandId = context.commandId ?? command;
73
+ const prepared = await runtime.SandboxManager.wrapWithSandboxArgv(
74
+ command,
75
+ "/bin/bash",
76
+ void 0,
77
+ context.abortSignal,
78
+ context.cwd,
79
+ { commandId, commandText: command }
80
+ );
81
+ const [executable, ...args] = prepared.argv;
82
+ if (!executable) {
83
+ throw new Error("sandbox runtime returned an empty command");
84
+ }
85
+ return {
86
+ executable,
87
+ args,
88
+ env: prepared.env,
89
+ annotateStderr: (stderr) => runtime.SandboxManager.annotateStderrWithSandboxFailures(commandId, stderr),
90
+ cleanup: () => {
91
+ runtime.SandboxManager.cleanupAfterCommand();
92
+ }
93
+ };
94
+ }
95
+ async dispose() {
96
+ if (!this.runtimePromise) {
97
+ return;
98
+ }
99
+ await this.initializationPromise;
100
+ const runtime = await this.runtimePromise;
101
+ await runtime.SandboxManager.reset();
102
+ this.configKey = void 0;
103
+ }
104
+ async checkAvailability() {
105
+ try {
106
+ const runtime = await this.loadRuntime();
107
+ if (!runtime.SandboxManager.isSupportedPlatform()) {
108
+ this.availabilityError = "sandbox runtime does not support this platform";
109
+ return false;
110
+ }
111
+ const dependencies = await runtime.SandboxManager.checkDependenciesAsync();
112
+ if (dependencies.errors.length > 0) {
113
+ this.availabilityError = dependencies.errors.join("; ");
114
+ return false;
115
+ }
116
+ this.availabilityError = void 0;
117
+ return true;
118
+ } catch (error) {
119
+ this.availabilityError = error instanceof Error ? error.message : String(error);
120
+ return false;
121
+ }
122
+ }
123
+ loadRuntime() {
124
+ return this.runtimePromise ??= loadSandboxRuntime();
125
+ }
126
+ };
127
+
128
+ export {
129
+ createSandboxRuntimeConfig,
130
+ SandboxRuntimeSandbox,
131
+ sandbox_runtime_exports
132
+ };
@@ -1,14 +1,24 @@
1
+ import {
2
+ __export
3
+ } from "./chunk-MLKGABMK.js";
4
+
1
5
  // src/sandbox/seatbelt.ts
6
+ var seatbelt_exports = {};
7
+ __export(seatbelt_exports, {
8
+ SeatbeltSandbox: () => SeatbeltSandbox
9
+ });
2
10
  import { existsSync, statSync } from "fs";
3
11
  var SANDBOX_EXEC_PATH = "/usr/bin/sandbox-exec";
4
12
  var SeatbeltSandbox = class {
13
+ implementation = "seatbelt";
5
14
  available() {
6
15
  return existsSync(SANDBOX_EXEC_PATH);
7
16
  }
8
- wrap(command, config) {
9
- const profile = buildProfile(config);
10
- const escaped = command.replace(/'/g, "'\\''");
11
- return `${SANDBOX_EXEC_PATH} -p '${profile}' bash -c '${escaped}'`;
17
+ prepare(command, config) {
18
+ return {
19
+ executable: SANDBOX_EXEC_PATH,
20
+ args: ["-p", buildProfile(config), "bash", "-c", command]
21
+ };
12
22
  }
13
23
  };
14
24
  function buildProfile(config) {
@@ -35,5 +45,6 @@ function buildProfile(config) {
35
45
  }
36
46
 
37
47
  export {
38
- SeatbeltSandbox
48
+ SeatbeltSandbox,
49
+ seatbelt_exports
39
50
  };
@@ -1,42 +1,40 @@
1
1
  import {
2
2
  createChildLogger
3
- } from "./chunk-3XCGUKGJ.js";
4
-
5
- // src/llm/errors.ts
6
- var LLMError = class extends Error {
7
- constructor(message) {
8
- super(message);
9
- this.name = "LLMError";
10
- }
11
- };
12
- var AuthenticationError = class extends LLMError {
13
- constructor(message) {
14
- super(message);
15
- this.name = "AuthenticationError";
16
- }
17
- };
18
- var RateLimitError = class extends LLMError {
19
- retryAfter;
20
- constructor(message, retryAfter) {
21
- super(message);
22
- this.name = "RateLimitError";
23
- this.retryAfter = retryAfter;
24
- }
25
- };
26
- var NetworkError = class extends LLMError {
27
- constructor(message) {
28
- super(message);
29
- this.name = "NetworkError";
30
- }
31
- };
32
- var ContextTooLongError = class extends LLMError {
33
- constructor(message) {
34
- super(message);
35
- this.name = "ContextTooLongError";
36
- }
37
- };
3
+ } from "./chunk-ZPIF7IJN.js";
4
+ import {
5
+ __export
6
+ } from "./chunk-MLKGABMK.js";
38
7
 
39
- // src/config/config.ts
8
+ // src/config/index.ts
9
+ var config_exports = {};
10
+ __export(config_exports, {
11
+ ConfigError: () => ConfigError,
12
+ DEFAULT_CONTEXT_WINDOW: () => DEFAULT_CONTEXT_WINDOW,
13
+ DEFAULT_MAX_OUTPUT_TOKENS: () => DEFAULT_MAX_OUTPUT_TOKENS,
14
+ DEFAULT_THINKING_LEVEL: () => DEFAULT_THINKING_LEVEL,
15
+ HookConfigSchema: () => HookConfigSchema,
16
+ MIN_THINKING_ANSWER_TOKENS: () => MIN_THINKING_ANSWER_TOKENS,
17
+ MIN_THINKING_BUDGET_TOKENS: () => MIN_THINKING_BUDGET_TOKENS,
18
+ ProviderConfigSchema: () => ProviderConfigSchema,
19
+ THINKING_BUDGETS: () => THINKING_BUDGETS,
20
+ THINKING_LEVELS: () => THINKING_LEVELS,
21
+ clampThinkingLevel: () => clampThinkingLevel,
22
+ forkEnabled: () => forkEnabled,
23
+ getContextWindow: () => getContextWindow,
24
+ getMaxOutputTokens: () => getMaxOutputTokens,
25
+ getSupportedThinkingLevels: () => getSupportedThinkingLevels,
26
+ getThinkingLevel: () => getThinkingLevel,
27
+ globalConfigPath: () => globalConfigPath,
28
+ isValidThinkingLevel: () => isValidThinkingLevel,
29
+ loadConfig: () => loadConfig,
30
+ loadProjectMcpServers: () => loadProjectMcpServers,
31
+ resolveAPIKey: () => resolveAPIKey,
32
+ thinkingBudgetForLevel: () => thinkingBudgetForLevel,
33
+ toAnthropicThinkingEffort: () => toAnthropicThinkingEffort,
34
+ toReasoningEffort: () => toReasoningEffort,
35
+ withProjectMcpServers: () => withProjectMcpServers,
36
+ withProviderDefaults: () => withProviderDefaults
37
+ });
40
38
  import { existsSync, readFileSync } from "fs";
41
39
  import { homedir } from "os";
42
40
  import { join } from "path";
@@ -224,6 +222,7 @@ var HookConfigSchema = z.object({
224
222
  });
225
223
  var SandboxYamlConfigSchema = z.object({
226
224
  enabled: z.boolean().optional(),
225
+ backend: z.enum(["native", "sandbox-runtime"]).optional(),
227
226
  auto_allow: z.boolean().optional(),
228
227
  network_enabled: z.boolean().optional()
229
228
  });
@@ -304,6 +303,10 @@ function loadSingleFile(path) {
304
303
  const parsed2 = safeParse(SandboxYamlConfigSchema, raw.sandbox);
305
304
  if (parsed2.success) {
306
305
  sandbox = parsed2.data;
306
+ } else {
307
+ throw new ConfigError(
308
+ `Invalid sandbox configuration in ${path}: ${getParseErrorMessage(parsed2.error)}`
309
+ );
307
310
  }
308
311
  }
309
312
  if ("enable_coordinator_mode" in raw) {
@@ -483,6 +486,12 @@ function loadConfig(path, options = {}) {
483
486
  }
484
487
 
485
488
  // src/conversation/pairing.ts
489
+ var pairing_exports = {};
490
+ __export(pairing_exports, {
491
+ INTERRUPTED_TOOL_RESULT: () => INTERRUPTED_TOOL_RESULT,
492
+ REJECTED_TOOL_RESULT: () => REJECTED_TOOL_RESULT,
493
+ ensureToolPairing: () => ensureToolPairing
494
+ });
486
495
  var INTERRUPTED_TOOL_RESULT = "Tool execution was interrupted. The tool may or may not have completed; verify before relying on its effects.";
487
496
  var REJECTED_TOOL_RESULT = "The user rejected this tool use. Nothing was changed (for file edits, the new content was NOT written).";
488
497
  function ensureToolPairing(messages) {
@@ -533,21 +542,55 @@ function ensureToolPairing(messages) {
533
542
  return out;
534
543
  }
535
544
 
545
+ // src/llm/errors.ts
546
+ var errors_exports = {};
547
+ __export(errors_exports, {
548
+ AuthenticationError: () => AuthenticationError,
549
+ ContextTooLongError: () => ContextTooLongError,
550
+ LLMError: () => LLMError,
551
+ NetworkError: () => NetworkError,
552
+ RateLimitError: () => RateLimitError
553
+ });
554
+ var LLMError = class extends Error {
555
+ constructor(message) {
556
+ super(message);
557
+ this.name = "LLMError";
558
+ }
559
+ };
560
+ var AuthenticationError = class extends LLMError {
561
+ constructor(message) {
562
+ super(message);
563
+ this.name = "AuthenticationError";
564
+ }
565
+ };
566
+ var RateLimitError = class extends LLMError {
567
+ retryAfter;
568
+ constructor(message, retryAfter) {
569
+ super(message);
570
+ this.name = "RateLimitError";
571
+ this.retryAfter = retryAfter;
572
+ }
573
+ };
574
+ var NetworkError = class extends LLMError {
575
+ constructor(message) {
576
+ super(message);
577
+ this.name = "NetworkError";
578
+ }
579
+ };
580
+ var ContextTooLongError = class extends LLMError {
581
+ constructor(message) {
582
+ super(message);
583
+ this.name = "ContextTooLongError";
584
+ }
585
+ };
586
+
536
587
  export {
537
- LLMError,
538
- AuthenticationError,
539
- RateLimitError,
540
- NetworkError,
541
- ContextTooLongError,
542
- ConfigError,
543
588
  globalConfigPath,
544
589
  THINKING_LEVELS,
545
590
  ProviderConfigSchema,
546
591
  DEFAULT_THINKING_LEVEL,
547
592
  DEFAULT_CONTEXT_WINDOW,
548
593
  DEFAULT_MAX_OUTPUT_TOKENS,
549
- THINKING_BUDGETS,
550
- MIN_THINKING_BUDGET_TOKENS,
551
594
  MIN_THINKING_ANSWER_TOKENS,
552
595
  isValidThinkingLevel,
553
596
  getThinkingLevel,
@@ -556,16 +599,20 @@ export {
556
599
  toAnthropicThinkingEffort,
557
600
  getSupportedThinkingLevels,
558
601
  clampThinkingLevel,
559
- withProviderDefaults,
560
602
  getContextWindow,
561
603
  getMaxOutputTokens,
562
604
  resolveAPIKey,
563
- HookConfigSchema,
564
605
  forkEnabled,
565
- loadProjectMcpServers,
566
606
  withProjectMcpServers,
567
607
  loadConfig,
568
- INTERRUPTED_TOOL_RESULT,
608
+ config_exports,
569
609
  REJECTED_TOOL_RESULT,
570
- ensureToolPairing
610
+ ensureToolPairing,
611
+ pairing_exports,
612
+ LLMError,
613
+ AuthenticationError,
614
+ RateLimitError,
615
+ NetworkError,
616
+ ContextTooLongError,
617
+ errors_exports
571
618
  };
@@ -1,4 +1,25 @@
1
+ import {
2
+ __export
3
+ } from "./chunk-MLKGABMK.js";
4
+
5
+ // src/subagent/tool-filter.ts
6
+ var tool_filter_exports = {};
7
+ __export(tool_filter_exports, {
8
+ ASYNC_AGENT_ALLOWED_TOOLS: () => ASYNC_AGENT_ALLOWED_TOOLS,
9
+ CUSTOM_AGENT_DISALLOWED_TOOLS: () => CUSTOM_AGENT_DISALLOWED_TOOLS,
10
+ FORK_QUERY_SOURCE: () => FORK_QUERY_SOURCE,
11
+ MAIN_AGENT_ONLY_TOOLS: () => MAIN_AGENT_ONLY_TOOLS,
12
+ SUBAGENT_DISALLOWED_TOOLS: () => SUBAGENT_DISALLOWED_TOOLS,
13
+ TEAMMATE_DISALLOWED_TOOLS: () => TEAMMATE_DISALLOWED_TOOLS,
14
+ cloneRegistryForFork: () => cloneRegistryForFork,
15
+ filterToolsForAgent: () => filterToolsForAgent
16
+ });
17
+
1
18
  // src/tools/registry.ts
19
+ var registry_exports = {};
20
+ __export(registry_exports, {
21
+ ToolRegistry: () => ToolRegistry
22
+ });
2
23
  var ToolRegistry = class {
3
24
  tools = /* @__PURE__ */ new Map();
4
25
  discovered = /* @__PURE__ */ new Set();
@@ -157,6 +178,7 @@ var ASYNC_AGENT_ALLOWED_TOOLS = /* @__PURE__ */ new Set([
157
178
  "Grep",
158
179
  "Glob",
159
180
  "Bash",
181
+ "JavaScript",
160
182
  "PowerShell",
161
183
  "EditFile",
162
184
  "WriteFile",
@@ -230,6 +252,7 @@ function cloneRegistryForFork(registry) {
230
252
 
231
253
  export {
232
254
  ToolRegistry,
255
+ registry_exports,
233
256
  MAIN_AGENT_ONLY_TOOLS,
234
257
  SUBAGENT_DISALLOWED_TOOLS,
235
258
  TEAMMATE_DISALLOWED_TOOLS,
@@ -237,5 +260,6 @@ export {
237
260
  ASYNC_AGENT_ALLOWED_TOOLS,
238
261
  filterToolsForAgent,
239
262
  FORK_QUERY_SOURCE,
240
- cloneRegistryForFork
263
+ cloneRegistryForFork,
264
+ tool_filter_exports
241
265
  };
@@ -0,0 +1,9 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __export = (target, all) => {
3
+ for (var name in all)
4
+ __defProp(target, name, { get: all[name], enumerable: true });
5
+ };
6
+
7
+ export {
8
+ __export
9
+ };
@@ -1,8 +1,13 @@
1
1
  import {
2
- version
3
- } from "./chunk-GTHYQZRL.js";
2
+ __export
3
+ } from "./chunk-MLKGABMK.js";
4
4
 
5
5
  // src/telemetry/providers.ts
6
+ var providers_exports = {};
7
+ __export(providers_exports, {
8
+ createTelemetryRuntime: () => createTelemetryRuntime,
9
+ parseExporterTypes: () => parseExporterTypes
10
+ });
6
11
  import { LangfuseSpanProcessor } from "@langfuse/otel";
7
12
  import {
8
13
  setLangfuseTracerProvider,
@@ -27,6 +32,40 @@ import {
27
32
  ConsoleSpanExporter
28
33
  } from "@opentelemetry/sdk-trace-base";
29
34
  import { ATTR_SERVICE_NAME, ATTR_SERVICE_VERSION } from "@opentelemetry/semantic-conventions";
35
+
36
+ // src/version.ts
37
+ var version_exports = {};
38
+ __export(version_exports, {
39
+ version: () => version
40
+ });
41
+ import { readFileSync } from "fs";
42
+ import path from "path";
43
+ import { fileURLToPath } from "url";
44
+ import { z } from "zod";
45
+ var PackageJsonSchema = z.object({
46
+ version: z.string()
47
+ });
48
+ function resolveVersion() {
49
+ if (true) {
50
+ return "0.0.35";
51
+ }
52
+ const here = path.dirname(fileURLToPath(import.meta.url));
53
+ for (const levels of ["..", "../.."]) {
54
+ const candidate = path.resolve(here, levels, "package.json");
55
+ try {
56
+ const raw = JSON.parse(readFileSync(candidate, "utf-8"));
57
+ const parsed = PackageJsonSchema.safeParse(raw);
58
+ if (parsed.success) {
59
+ return parsed.data.version;
60
+ }
61
+ } catch {
62
+ }
63
+ }
64
+ throw new Error("Could not resolve package version");
65
+ }
66
+ var version = resolveVersion();
67
+
68
+ // src/telemetry/providers.ts
30
69
  var DEFAULT_EXPORT_INTERVAL_MS = 6e4;
31
70
  var SHUTDOWN_TIMEOUT_MS = 2e3;
32
71
  function parseExporterTypes(value) {
@@ -413,7 +452,11 @@ async function createTelemetryRuntime() {
413
452
  const logger = loggerProvider?.getLogger("@swifty.js/swifty", version) ?? null;
414
453
  return new ProviderRuntime(tracerProvider, loggerProvider, meterProvider, meter, logger, sentry);
415
454
  }
455
+
416
456
  export {
457
+ version,
458
+ version_exports,
459
+ parseExporterTypes,
417
460
  createTelemetryRuntime,
418
- parseExporterTypes
461
+ providers_exports
419
462
  };