@swifty.js/swifty 0.0.33 → 0.0.36
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-ZU5LZRUP.js +14 -0
- package/dist/agent-YDU6HB4S.js +4 -0
- package/dist/{anthropic-FXRRA63E.js → anthropic-GDT73MMP.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-5W2TCASL.js +4 -0
- package/dist/{providers-WNYZUMZ3.js → chunk-EEEW3GG4.js} +3 -3
- package/dist/{chunk-4PQYUHSN.js → chunk-H56UQALW.js} +1 -1
- package/dist/chunk-IXCJZNBB.js +5 -0
- package/dist/chunk-JC44NVST.js +4 -0
- package/dist/{chunk-PXQD6GWP.js → chunk-MNP6IJ7C.js} +17 -17
- package/dist/chunk-MTAGHTBG.js +164 -0
- package/dist/chunk-NDPYUGE5.js +5 -0
- package/dist/chunk-PH643I2P.js +4 -0
- package/dist/{chunk-TNF3EHFY.js → chunk-Q3NPRV5P.js} +1 -1
- package/dist/chunk-RDVRYI56.js +610 -0
- package/dist/{chunk-4C3KJLJV.js → chunk-UJGMTIYO.js} +1 -1
- package/dist/{esm-4DBD7ONK.js → esm-PDXUGWFK.js} +1 -1
- package/dist/lib/agent-ZMIS6IH6.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-CFYAZWDA.js → chunk-BHSNJT6Z.js} +34 -56
- 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/{chunk-BCBD34D2.js → chunk-OLFXCZVH.js} +25 -7
- package/dist/lib/{providers-UJEWP7C7.js → chunk-PJ7354ZG.js} +46 -3
- package/dist/lib/chunk-YIWNQ7OA.js +47 -0
- package/dist/lib/{chunk-AFYPVA5C.js → chunk-YUDCYSKO.js} +958 -112
- package/dist/lib/{chunk-3XCGUKGJ.js → chunk-ZPIF7IJN.js} +219 -6
- package/dist/lib/index.d.ts +3771 -1322
- package/dist/lib/index.js +13714 -12463
- package/dist/lib/{openai-C2PZFGJ2.js → openai-ZWIYIBLC.js} +4 -3
- package/dist/lib/{checker-UPY4CXUL.js → permissions-77UJQITR.js} +4 -3
- package/dist/lib/providers-5SJFTU2G.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 +225 -191
- package/dist/{openai-WPEICAZ4.js → openai-7LMX5HKW.js} +1 -1
- package/dist/permissions-74IHQW76.js +4 -0
- package/dist/providers-FQCJFM3Q.js +4 -0
- package/dist/sandbox-runtime-RVW4BK3L.js +4 -0
- package/dist/seatbelt-GMQUP6SV.js +4 -0
- package/dist/server-C6H5ZWUG.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-FUKVR3XO.js +0 -608
- package/dist/chunk-LHSUYZO5.js +0 -4
- package/dist/chunk-NAAAN2TD.js +0 -60
- package/dist/chunk-YIKI3EPG.js +0 -150
- 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
|
@@ -1,42 +1,40 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createChildLogger
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
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/
|
|
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
|
-
|
|
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
|
};
|
|
@@ -3,9 +3,30 @@ import {
|
|
|
3
3
|
asRecord,
|
|
4
4
|
createChildLogger,
|
|
5
5
|
strArg
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-ZPIF7IJN.js";
|
|
7
|
+
import {
|
|
8
|
+
__export
|
|
9
|
+
} from "./chunk-MLKGABMK.js";
|
|
10
|
+
|
|
11
|
+
// src/tools/mcp-call.ts
|
|
12
|
+
var mcp_call_exports = {};
|
|
13
|
+
__export(mcp_call_exports, {
|
|
14
|
+
McpCallTool: () => McpCallTool,
|
|
15
|
+
coerceBySchema: () => coerceBySchema,
|
|
16
|
+
isMcpToolLike: () => isMcpToolLike,
|
|
17
|
+
mcpCallPermissionContent: () => mcpCallPermissionContent
|
|
18
|
+
});
|
|
7
19
|
|
|
8
20
|
// src/mcp/tool-wrapper.ts
|
|
21
|
+
var tool_wrapper_exports = {};
|
|
22
|
+
__export(tool_wrapper_exports, {
|
|
23
|
+
MCPToolWrapper: () => MCPToolWrapper,
|
|
24
|
+
MCP_NAME_SEP: () => MCP_NAME_SEP,
|
|
25
|
+
MCP_TOOL_PREFIX: () => MCP_TOOL_PREFIX,
|
|
26
|
+
buildMcpToolName: () => buildMcpToolName,
|
|
27
|
+
mcpToolNamePrefix: () => mcpToolNamePrefix,
|
|
28
|
+
sanitizeSegment: () => sanitizeSegment
|
|
29
|
+
});
|
|
9
30
|
var log = createChildLogger({ module: "mcp" });
|
|
10
31
|
var MCP_TOOL_PREFIX = "mcp__";
|
|
11
32
|
var MCP_NAME_SEP = "__";
|
|
@@ -225,13 +246,10 @@ var McpCallTool = class {
|
|
|
225
246
|
|
|
226
247
|
export {
|
|
227
248
|
MCP_TOOL_PREFIX,
|
|
228
|
-
MCP_NAME_SEP,
|
|
229
|
-
sanitizeSegment,
|
|
230
|
-
mcpToolNamePrefix,
|
|
231
|
-
buildMcpToolName,
|
|
232
249
|
MCPToolWrapper,
|
|
233
|
-
|
|
250
|
+
tool_wrapper_exports,
|
|
234
251
|
mcpCallPermissionContent,
|
|
235
252
|
isMcpToolLike,
|
|
236
|
-
McpCallTool
|
|
253
|
+
McpCallTool,
|
|
254
|
+
mcp_call_exports
|
|
237
255
|
};
|
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
} from "./chunk-
|
|
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.36";
|
|
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
|
-
|
|
461
|
+
providers_exports
|
|
419
462
|
};
|
|
@@ -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
|
+
};
|