executor 1.2.4-beta.5 → 1.2.4-beta.6
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/bin/executor.mjs +23 -62
- package/package.json +1 -1
- package/resources/web/assets/{highlighted-body-TPN3WLV5-BgXTsZ30.js → highlighted-body-TPN3WLV5-DYg1rqdL.js} +1 -1
- package/resources/web/assets/{index-CVy-DVgr.js → index-BuXgGpBl.js} +2 -2
- package/resources/web/assets/{mermaid-O7DHMXV3-C-YmyPuX.js → mermaid-O7DHMXV3-Du9Efp9a.js} +3 -3
- package/resources/web/index.html +1 -1
package/bin/executor.mjs
CHANGED
|
@@ -370351,7 +370351,6 @@ var waitForReachability = (baseUrl2, expected) => gen2(function* () {
|
|
|
370351
370351
|
}
|
|
370352
370352
|
return yield* failReachabilityTimeout({ baseUrl: baseUrl2, expected });
|
|
370353
370353
|
});
|
|
370354
|
-
var renderDenoSandboxDetail = (denoVersion) => denoVersion !== null ? `deno ${denoVersion}` : "deno not found (run `executor sandbox` to install)";
|
|
370355
370354
|
var getServerStatus = (baseUrl2) => gen2(function* () {
|
|
370356
370355
|
const pidRecord = yield* readPidRecord();
|
|
370357
370356
|
const reachable = yield* isServerReachable(baseUrl2);
|
|
@@ -370362,7 +370361,6 @@ var getServerStatus = (baseUrl2) => gen2(function* () {
|
|
|
370362
370361
|
const pid = typeof pidRecord?.pid === "number" ? pidRecord.pid : null;
|
|
370363
370362
|
const pidRunning = pid !== null ? isPidRunning(pid) : false;
|
|
370364
370363
|
const logFile = pidRecord?.logFile ?? DEFAULT_SERVER_LOG_FILE;
|
|
370365
|
-
const denoVersion = yield* getDenoVersion();
|
|
370366
370364
|
return {
|
|
370367
370365
|
baseUrl: baseUrl2,
|
|
370368
370366
|
reachable,
|
|
@@ -370372,8 +370370,7 @@ var getServerStatus = (baseUrl2) => gen2(function* () {
|
|
|
370372
370370
|
logFile,
|
|
370373
370371
|
localDataDir: DEFAULT_LOCAL_DATA_DIR,
|
|
370374
370372
|
webAssetsDir: resolveRuntimeWebAssetsDir(),
|
|
370375
|
-
installation
|
|
370376
|
-
denoVersion
|
|
370373
|
+
installation
|
|
370377
370374
|
};
|
|
370378
370375
|
});
|
|
370379
370376
|
var renderStatus = (status2) => [
|
|
@@ -370385,8 +370382,21 @@ var renderStatus = (status2) => [
|
|
|
370385
370382
|
`logFile: ${status2.logFile}`,
|
|
370386
370383
|
`localDataDir: ${status2.localDataDir}`,
|
|
370387
370384
|
`webAssetsDir: ${status2.webAssetsDir ?? "missing"}`,
|
|
370388
|
-
`workspaceId: ${status2.installation?.workspaceId ?? "unavailable"}
|
|
370389
|
-
|
|
370385
|
+
`workspaceId: ${status2.installation?.workspaceId ?? "unavailable"}`
|
|
370386
|
+
].join(`
|
|
370387
|
+
`);
|
|
370388
|
+
var appendUrlPath = (baseUrl2, pathname) => new URL(pathname, baseUrl2.endsWith("/") ? baseUrl2 : `${baseUrl2}/`).toString();
|
|
370389
|
+
var renderUpSummary = (input) => [
|
|
370390
|
+
input.started ? "Executor is ready." : "Executor is already running.",
|
|
370391
|
+
`API: ${input.status.baseUrl}`,
|
|
370392
|
+
`MCP: ${appendUrlPath(input.status.baseUrl, "mcp")}`,
|
|
370393
|
+
`OpenAPI: ${appendUrlPath(input.status.baseUrl, "v1/openapi.json")}`,
|
|
370394
|
+
`Workspace: ${input.status.installation?.workspaceId ?? "unavailable"}`,
|
|
370395
|
+
"",
|
|
370396
|
+
"Try next:",
|
|
370397
|
+
` ${CLI_NAME} call 'return 1 + 1'`,
|
|
370398
|
+
` ${CLI_NAME} status`,
|
|
370399
|
+
` ${CLI_NAME} down`
|
|
370390
370400
|
].join(`
|
|
370391
370401
|
`);
|
|
370392
370402
|
var getDoctorReport = (baseUrl2) => getServerStatus(baseUrl2).pipe(map16((status2) => {
|
|
@@ -370414,10 +370424,6 @@ var getDoctorReport = (baseUrl2) => getServerStatus(baseUrl2).pipe(map16((status
|
|
|
370414
370424
|
installation: {
|
|
370415
370425
|
ok: status2.installation !== null,
|
|
370416
370426
|
detail: status2.installation ? `workspace ${status2.installation.workspaceId}` : "local installation unavailable"
|
|
370417
|
-
},
|
|
370418
|
-
denoSandbox: {
|
|
370419
|
-
ok: status2.denoVersion !== null,
|
|
370420
|
-
detail: renderDenoSandboxDetail(status2.denoVersion)
|
|
370421
370427
|
}
|
|
370422
370428
|
};
|
|
370423
370429
|
return {
|
|
@@ -370456,12 +370462,17 @@ var stopServer = (baseUrl2) => gen2(function* () {
|
|
|
370456
370462
|
var ensureServer = (baseUrl2 = DEFAULT_SERVER_BASE_URL) => gen2(function* () {
|
|
370457
370463
|
const reachable = yield* isServerReachable(baseUrl2);
|
|
370458
370464
|
if (reachable) {
|
|
370459
|
-
return
|
|
370465
|
+
return {
|
|
370466
|
+
started: false
|
|
370467
|
+
};
|
|
370460
370468
|
}
|
|
370461
370469
|
const url3 = new URL(baseUrl2);
|
|
370462
370470
|
const port2 = Number(url3.port || DEFAULT_SERVER_PORT);
|
|
370463
370471
|
yield* startServerInBackground(port2);
|
|
370464
370472
|
yield* waitForReachability(baseUrl2, true);
|
|
370473
|
+
return {
|
|
370474
|
+
started: true
|
|
370475
|
+
};
|
|
370465
370476
|
});
|
|
370466
370477
|
var isRecord9 = (value7) => typeof value7 === "object" && value7 !== null && !Array.isArray(value7);
|
|
370467
370478
|
var getPromptFields = (requestedSchema) => {
|
|
@@ -370769,7 +370780,7 @@ var serverStartCommand = exports_Command2.make("start", {
|
|
|
370769
370780
|
var serverCommand = exports_Command2.make("server").pipe(exports_Command2.withSubcommands([serverStartCommand]), exports_Command2.withDescription("Local server commands"));
|
|
370770
370781
|
var upCommand = exports_Command2.make("up", {
|
|
370771
370782
|
baseUrl: exports_Options.text("base-url").pipe(exports_Options.withDefault(DEFAULT_SERVER_BASE_URL))
|
|
370772
|
-
}, ({ baseUrl: baseUrl2 }) => ensureServer(baseUrl2).pipe(
|
|
370783
|
+
}, ({ baseUrl: baseUrl2 }) => ensureServer(baseUrl2).pipe(flatMap10(({ started }) => getServerStatus(baseUrl2).pipe(flatMap10((status2) => printText(renderUpSummary({ started, status: status2 }))))))).pipe(exports_Command2.withDescription("Start the local executor server if needed and show how to use it"));
|
|
370773
370784
|
var downCommand = exports_Command2.make("down", {
|
|
370774
370785
|
baseUrl: exports_Options.text("base-url").pipe(exports_Options.withDefault(DEFAULT_SERVER_BASE_URL))
|
|
370775
370786
|
}, ({ baseUrl: baseUrl2 }) => stopServer(baseUrl2).pipe(flatMap10((stopped) => printText(stopped ? "Stopped local executor server." : "Local executor server is not running.")))).pipe(exports_Command2.withDescription("Stop the local executor server"));
|
|
@@ -370785,55 +370796,6 @@ var doctorCommand = exports_Command2.make("doctor", {
|
|
|
370785
370796
|
...Object.entries(report.checks).map(([name, check3]) => `${name}: ${check3.ok ? "ok" : "fail"} - ${check3.detail}`)
|
|
370786
370797
|
].join(`
|
|
370787
370798
|
`))))).pipe(exports_Command2.withDescription("Check local executor install and daemon health"));
|
|
370788
|
-
var getDenoVersion = () => gen2(function* () {
|
|
370789
|
-
const fs3 = yield* exports_FileSystem.FileSystem;
|
|
370790
|
-
const configuredDenoExecutable = process.env.DENO_BIN?.trim();
|
|
370791
|
-
const bundledDenoExecutable = process.env.HOME?.trim() ? `${process.env.HOME.trim()}/.deno/bin/deno` : null;
|
|
370792
|
-
const bundledDenoExists = bundledDenoExecutable === null ? false : yield* fs3.exists(bundledDenoExecutable).pipe(catchAll2(() => succeed8(false)));
|
|
370793
|
-
const denoExecutable = configuredDenoExecutable || (bundledDenoExists ? bundledDenoExecutable : null) || "deno";
|
|
370794
|
-
return yield* tryPromise2({
|
|
370795
|
-
try: () => new Promise((resolveVersion) => {
|
|
370796
|
-
const child = spawn4(denoExecutable, ["--version"], {
|
|
370797
|
-
stdio: ["ignore", "pipe", "ignore"],
|
|
370798
|
-
timeout: 5000
|
|
370799
|
-
});
|
|
370800
|
-
let stdout = "";
|
|
370801
|
-
child.stdout?.setEncoding("utf8");
|
|
370802
|
-
child.stdout?.on("data", (chunk4) => {
|
|
370803
|
-
stdout += chunk4;
|
|
370804
|
-
});
|
|
370805
|
-
child.once("error", () => resolveVersion(null));
|
|
370806
|
-
child.once("close", (code2) => {
|
|
370807
|
-
if (code2 !== 0) {
|
|
370808
|
-
resolveVersion(null);
|
|
370809
|
-
return;
|
|
370810
|
-
}
|
|
370811
|
-
const match18 = /deno\s+(\S+)/i.exec(stdout);
|
|
370812
|
-
resolveVersion(match18 ? match18[1] : null);
|
|
370813
|
-
});
|
|
370814
|
-
}),
|
|
370815
|
-
catch: () => null
|
|
370816
|
-
}).pipe(catchAll2(() => succeed8(null)));
|
|
370817
|
-
}).pipe(catchAll2(() => succeed8(null)));
|
|
370818
|
-
var sandboxCommand = exports_Command2.make("sandbox", {}, () => gen2(function* () {
|
|
370819
|
-
const version2 = yield* getDenoVersion();
|
|
370820
|
-
if (version2 !== null) {
|
|
370821
|
-
yield* printText(`Deno sandbox is ready (deno ${version2}).`);
|
|
370822
|
-
return;
|
|
370823
|
-
}
|
|
370824
|
-
yield* printText([
|
|
370825
|
-
"Deno is not installed.",
|
|
370826
|
-
"",
|
|
370827
|
-
"The executor sandbox requires Deno to run code in a secure, isolated subprocess.",
|
|
370828
|
-
"",
|
|
370829
|
-
"Install Deno:",
|
|
370830
|
-
" curl -fsSL https://deno.land/install.sh | sh",
|
|
370831
|
-
"",
|
|
370832
|
-
"Or see: https://docs.deno.com/runtime/getting_started/installation/"
|
|
370833
|
-
].join(`
|
|
370834
|
-
`));
|
|
370835
|
-
process.exitCode = 1;
|
|
370836
|
-
})).pipe(exports_Command2.withDescription("Check whether the Deno sandbox runtime is available"));
|
|
370837
370799
|
var callCommand = exports_Command2.make("call", {
|
|
370838
370800
|
code: exports_Args.text({ name: "code" }).pipe(exports_Args.withDescription("Inline code to execute."), exports_Args.optional),
|
|
370839
370801
|
file: exports_Options.text("file").pipe(exports_Options.optional),
|
|
@@ -370922,7 +370884,6 @@ var root = exports_Command2.make("executor").pipe(exports_Command2.withSubcomman
|
|
|
370922
370884
|
downCommand,
|
|
370923
370885
|
statusCommand,
|
|
370924
370886
|
doctorCommand,
|
|
370925
|
-
sandboxCommand,
|
|
370926
370887
|
callCommand,
|
|
370927
370888
|
resumeCommand,
|
|
370928
370889
|
devCommand
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r,R as c,M as p,B as x}from"./mermaid-O7DHMXV3-
|
|
1
|
+
import{r,R as c,M as p,B as x}from"./mermaid-O7DHMXV3-Du9Efp9a.js";import{j as d}from"./index-CRuElBS1.js";var R=({code:i,language:e,raw:t,className:g,startLine:u,...m})=>{let{shikiTheme:o}=r.useContext(c),a=p(),[n,s]=r.useState(t);return r.useEffect(()=>{if(!a){s(t);return}let l=a.highlight({code:i,language:e,themes:o},h=>{s(h)});l&&s(l)},[i,e,o,a,t]),d.jsx(x,{className:g,language:e,result:n,startLine:u,...m})};export{R as HighlightedCodeBlockBody};
|