@skylandnpm/octopus-proxy 0.1.23 → 0.1.26
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/{chunk-KYGWORYZ.js → chunk-3IEPWZVZ.js} +33 -8
- package/dist/cli.js +1 -1
- package/dist/main.js +1 -1
- package/package.json +1 -1
|
@@ -12459,6 +12459,9 @@ var EventStream = class {
|
|
|
12459
12459
|
|
|
12460
12460
|
// src/proxy-snapshot.ts
|
|
12461
12461
|
import { randomUUID as randomUUID5 } from "node:crypto";
|
|
12462
|
+
import { execFile as execFile2 } from "node:child_process";
|
|
12463
|
+
import { promisify as promisify2 } from "node:util";
|
|
12464
|
+
var execute2 = promisify2(execFile2);
|
|
12462
12465
|
function record(value) {
|
|
12463
12466
|
return value !== null && typeof value === "object" && !Array.isArray(value) ? value : {};
|
|
12464
12467
|
}
|
|
@@ -12478,10 +12481,32 @@ function publicModels(value) {
|
|
|
12478
12481
|
}
|
|
12479
12482
|
return result;
|
|
12480
12483
|
}
|
|
12484
|
+
async function gitBranch(directory) {
|
|
12485
|
+
const git = async (...args) => (await execute2("git", ["--no-optional-locks", ...args], {
|
|
12486
|
+
cwd: directory,
|
|
12487
|
+
encoding: "utf8",
|
|
12488
|
+
timeout: 3e3,
|
|
12489
|
+
maxBuffer: 64 * 1024
|
|
12490
|
+
})).stdout.trim();
|
|
12491
|
+
try {
|
|
12492
|
+
const branch = await git("branch", "--show-current");
|
|
12493
|
+
if (branch) return branch;
|
|
12494
|
+
const commit = await git("rev-parse", "--short", "HEAD");
|
|
12495
|
+
return commit ? `HEAD@${commit}` : void 0;
|
|
12496
|
+
} catch {
|
|
12497
|
+
return void 0;
|
|
12498
|
+
}
|
|
12499
|
+
}
|
|
12500
|
+
async function publicProjects(config) {
|
|
12501
|
+
return Promise.all(config.projects.map(async ({ id, name, directory, specDirectories }) => {
|
|
12502
|
+
const branch = await gitBranch(directory);
|
|
12503
|
+
return { id, name, directory, specDirectories, ...branch ? { gitBranch: branch } : {} };
|
|
12504
|
+
}));
|
|
12505
|
+
}
|
|
12481
12506
|
async function buildProxySnapshot(config, runtime, adapter, requestedProjectId) {
|
|
12482
12507
|
const capabilities = adapter.supportedOperations();
|
|
12483
12508
|
const status = record(await runtime.status());
|
|
12484
|
-
const projects =
|
|
12509
|
+
const projects = await publicProjects(config);
|
|
12485
12510
|
const projectId = projects.find((project) => project.id === requestedProjectId)?.id ?? projects[0]?.id;
|
|
12486
12511
|
const models = [];
|
|
12487
12512
|
let modelCatalogStatus = capabilities.includes("configuration.models") ? "unavailable" : "unsupported";
|
|
@@ -14831,8 +14856,8 @@ function zcodeEnvironment(command) {
|
|
|
14831
14856
|
}
|
|
14832
14857
|
|
|
14833
14858
|
// src/tools/stdio-runtime.ts
|
|
14834
|
-
import { spawn as spawn2, execFile as
|
|
14835
|
-
import { promisify as
|
|
14859
|
+
import { spawn as spawn2, execFile as execFile3 } from "node:child_process";
|
|
14860
|
+
import { promisify as promisify3 } from "node:util";
|
|
14836
14861
|
import { mkdir as mkdir5, open as open5 } from "node:fs/promises";
|
|
14837
14862
|
import { join as join7 } from "node:path";
|
|
14838
14863
|
|
|
@@ -15026,7 +15051,7 @@ function wrapEnvelope(frame) {
|
|
|
15026
15051
|
}
|
|
15027
15052
|
|
|
15028
15053
|
// src/tools/stdio-runtime.ts
|
|
15029
|
-
var run =
|
|
15054
|
+
var run = promisify3(execFile3);
|
|
15030
15055
|
var StdioRuntime = class {
|
|
15031
15056
|
constructor(config) {
|
|
15032
15057
|
this.config = config;
|
|
@@ -16384,11 +16409,11 @@ var PiAdapter = class {
|
|
|
16384
16409
|
};
|
|
16385
16410
|
|
|
16386
16411
|
// src/tools/pi-runtime.ts
|
|
16387
|
-
import { execFile as
|
|
16412
|
+
import { execFile as execFile4, spawn as spawn4 } from "node:child_process";
|
|
16388
16413
|
import { mkdir as mkdir6, open as open6 } from "node:fs/promises";
|
|
16389
16414
|
import { join as join9 } from "node:path";
|
|
16390
|
-
import { promisify as
|
|
16391
|
-
var run2 =
|
|
16415
|
+
import { promisify as promisify4 } from "node:util";
|
|
16416
|
+
var run2 = promisify4(execFile4);
|
|
16392
16417
|
var PiRuntime = class {
|
|
16393
16418
|
constructor(config) {
|
|
16394
16419
|
this.config = config;
|
|
@@ -16622,7 +16647,7 @@ async function runDaemon(configPath) {
|
|
|
16622
16647
|
if (c.operation === "runtime.start") return runtime.start();
|
|
16623
16648
|
if (c.operation === "runtime.stop") return runtime.stop();
|
|
16624
16649
|
if (c.operation === "runtime.restart") return runtime.restart();
|
|
16625
|
-
if (c.operation === "workspace.projects") return config
|
|
16650
|
+
if (c.operation === "workspace.projects") return publicProjects(config);
|
|
16626
16651
|
const project = c.projectId;
|
|
16627
16652
|
if (!project) throw new Error("Project required");
|
|
16628
16653
|
workspace.project(project);
|
package/dist/cli.js
CHANGED
package/dist/main.js
CHANGED