@yukino.js/yukino 0.0.7 → 0.0.8
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/README.md +130 -25
- package/dist/a2a-GBVNBDMY.js +14 -0
- package/dist/{acp-76S2XII3.js → acp-C6VUCEZ6.js} +7 -7
- package/dist/anthropic-ZEQI4K52.js +4 -0
- package/dist/chunk-37IAJFPF.js +4 -0
- package/dist/{chunk-NG62ISUV.js → chunk-3P7BR7SO.js} +8 -8
- package/dist/{chunk-7PPWFSIC.js → chunk-6XDMANXO.js} +1 -1
- package/dist/{chunk-HWDSXNX4.js → chunk-L5C5JBLP.js} +1 -1
- package/dist/chunk-MU6PSBZT.js +358 -0
- package/dist/chunk-WGFROGUC.js +8 -0
- package/dist/{chunk-QRO6H32L.js → chunk-YHE4BT76.js} +148 -148
- package/dist/esm-4KOJC56H.js +225 -0
- package/dist/fe/dist/index.html +21 -0
- package/dist/fe/dist/static/index.css +2 -0
- package/dist/fe/dist/static/index.js +203 -0
- package/dist/lib/{anthropic-CDPTNR5L.js → anthropic-K7VWTSFH.js} +2 -2
- package/dist/lib/{chunk-EO23VPDZ.js → chunk-2NA2RSV7.js} +1 -9
- package/dist/lib/{chunk-PEV5NGQ2.js → chunk-E2DXHLHR.js} +1 -1
- package/dist/lib/{chunk-HE4RUUZP.js → chunk-IIL5NGQF.js} +461 -457
- package/dist/lib/{chunk-OYQY3Q45.js → chunk-K532PPI6.js} +0 -2
- package/dist/lib/{chunk-TKCJSTWI.js → chunk-RJQT6B2O.js} +1 -1
- package/dist/lib/index.d.ts +402 -3616
- package/dist/lib/index.js +2733 -1893
- package/dist/lib/{openai-TEFKPV7T.js → openai-6MPSWGKN.js} +2 -2
- package/dist/lib/{providers-2X5JB2JX.js → providers-N52Y2QTJ.js} +1 -1
- package/dist/lib/{tool-filter-HUVHJN3O.js → tool-filter-F4S25GMJ.js} +1 -1
- package/dist/main.js +366 -237
- package/dist/{openai-RYXW7AKZ.js → openai-VV2RYB77.js} +1 -1
- package/dist/{providers-YG2HYIG6.js → providers-UD3DPALA.js} +1 -1
- package/dist/server-FXK26WN2.js +4 -0
- package/package.json +11 -12
- package/dist/anthropic-WK6EYMUE.js +0 -4
- package/dist/chunk-4GE22WHI.js +0 -4
- package/dist/chunk-7ZBAF7M4.js +0 -4
- package/dist/chunk-QQZCYWYI.js +0 -241
- package/dist/esm-5V3TYPZK.js +0 -229
- package/dist/lib/chunk-EFNPK4SJ.js +0 -137
- package/dist/lib/sandbox-runtime-QDN5SXPM.js +0 -9
- package/dist/sandbox-runtime-ELKAYRIL.js +0 -4
- package/dist/server-66HLMSUR.js +0 -4
|
@@ -1,137 +0,0 @@
|
|
|
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(
|
|
46
|
-
this.availabilityError ?? "sandbox runtime is unavailable"
|
|
47
|
-
);
|
|
48
|
-
}
|
|
49
|
-
const runtime = await this.loadRuntime();
|
|
50
|
-
const runtimeConfig = runtime.SandboxRuntimeConfigSchema.parse(
|
|
51
|
-
createSandboxRuntimeConfig(config, context.cwd)
|
|
52
|
-
);
|
|
53
|
-
const configKey = JSON.stringify(runtimeConfig);
|
|
54
|
-
if (this.initializationPromise) {
|
|
55
|
-
await this.initializationPromise;
|
|
56
|
-
}
|
|
57
|
-
if (this.configKey !== configKey || !runtime.SandboxManager.isSandboxingEnabled()) {
|
|
58
|
-
this.initializationPromise = (async () => {
|
|
59
|
-
if (runtime.SandboxManager.isSandboxingEnabled()) {
|
|
60
|
-
await runtime.SandboxManager.reset();
|
|
61
|
-
}
|
|
62
|
-
await runtime.SandboxManager.initialize(
|
|
63
|
-
runtimeConfig,
|
|
64
|
-
config.networkEnabled ? () => Promise.resolve(true) : void 0
|
|
65
|
-
);
|
|
66
|
-
this.configKey = configKey;
|
|
67
|
-
})();
|
|
68
|
-
try {
|
|
69
|
-
await this.initializationPromise;
|
|
70
|
-
} finally {
|
|
71
|
-
this.initializationPromise = void 0;
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
const commandId = context.commandId ?? command;
|
|
75
|
-
const prepared = await runtime.SandboxManager.wrapWithSandboxArgv(
|
|
76
|
-
command,
|
|
77
|
-
"/bin/bash",
|
|
78
|
-
void 0,
|
|
79
|
-
context.abortSignal,
|
|
80
|
-
context.cwd,
|
|
81
|
-
{ commandId, commandText: command }
|
|
82
|
-
);
|
|
83
|
-
const [executable, ...args] = prepared.argv;
|
|
84
|
-
if (!executable) {
|
|
85
|
-
throw new Error("sandbox runtime returned an empty command");
|
|
86
|
-
}
|
|
87
|
-
return {
|
|
88
|
-
executable,
|
|
89
|
-
args,
|
|
90
|
-
env: prepared.env,
|
|
91
|
-
annotateStderr: (stderr) => runtime.SandboxManager.annotateStderrWithSandboxFailures(
|
|
92
|
-
commandId,
|
|
93
|
-
stderr
|
|
94
|
-
),
|
|
95
|
-
cleanup: () => {
|
|
96
|
-
runtime.SandboxManager.cleanupAfterCommand();
|
|
97
|
-
}
|
|
98
|
-
};
|
|
99
|
-
}
|
|
100
|
-
async dispose() {
|
|
101
|
-
if (!this.runtimePromise) {
|
|
102
|
-
return;
|
|
103
|
-
}
|
|
104
|
-
await this.initializationPromise;
|
|
105
|
-
const runtime = await this.runtimePromise;
|
|
106
|
-
await runtime.SandboxManager.reset();
|
|
107
|
-
this.configKey = void 0;
|
|
108
|
-
}
|
|
109
|
-
async checkAvailability() {
|
|
110
|
-
try {
|
|
111
|
-
const runtime = await this.loadRuntime();
|
|
112
|
-
if (!runtime.SandboxManager.isSupportedPlatform()) {
|
|
113
|
-
this.availabilityError = "sandbox runtime does not support this platform";
|
|
114
|
-
return false;
|
|
115
|
-
}
|
|
116
|
-
const dependencies = await runtime.SandboxManager.checkDependenciesAsync();
|
|
117
|
-
if (dependencies.errors.length > 0) {
|
|
118
|
-
this.availabilityError = dependencies.errors.join("; ");
|
|
119
|
-
return false;
|
|
120
|
-
}
|
|
121
|
-
this.availabilityError = void 0;
|
|
122
|
-
return true;
|
|
123
|
-
} catch (error) {
|
|
124
|
-
this.availabilityError = error instanceof Error ? error.message : String(error);
|
|
125
|
-
return false;
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
loadRuntime() {
|
|
129
|
-
return this.runtimePromise ??= loadSandboxRuntime();
|
|
130
|
-
}
|
|
131
|
-
};
|
|
132
|
-
|
|
133
|
-
export {
|
|
134
|
-
createSandboxRuntimeConfig,
|
|
135
|
-
SandboxRuntimeSandbox,
|
|
136
|
-
sandbox_runtime_exports
|
|
137
|
-
};
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { createRequire as __yukinoCreateRequire } from "node:module";
|
|
3
|
-
const require = __yukinoCreateRequire(import.meta.url);
|
|
4
|
-
import{a,b}from"./chunk-4GE22WHI.js";import"./chunk-7MKA3SHV.js";export{b as SandboxRuntimeSandbox,a as createSandboxRuntimeConfig};
|
package/dist/server-66HLMSUR.js
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { createRequire as __yukinoCreateRequire } from "node:module";
|
|
3
|
-
const require = __yukinoCreateRequire(import.meta.url);
|
|
4
|
-
import{b as a,c as b}from"./chunk-QQZCYWYI.js";import"./chunk-QRO6H32L.js";import"./chunk-HWDSXNX4.js";import"./chunk-JFKC4VCA.js";import"./chunk-7PPWFSIC.js";import"./chunk-NG62ISUV.js";import"./chunk-IW5L5276.js";import"./chunk-NAQRFHUX.js";import"./chunk-VM4YKTHC.js";import"./chunk-HMZQYFYG.js";import"./chunk-3QL446GD.js";import"./chunk-AGSYLE4E.js";import"./chunk-CU3IISCC.js";import"./chunk-VCIRD267.js";import"./chunk-7MKA3SHV.js";export{b as RemoteServer,a as createRemoteAgent};
|