@jixo/cli 0.27.0 → 4.0.0
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/bundle/{file-replacer-D6j8Nj7r.js → file-replacer-C3H2FqOL.js} +95 -14
- package/bundle/file-replacer-C3H2FqOL.js.map +1 -0
- package/bundle/file-replacer-ajVzZOp7.js +3 -0
- package/bundle/gen-prompt-DF1HOjXb.js +4 -0
- package/bundle/{gen-prompt-DqGDmpRI.js → gen-prompt-DxNgl5Cp.js} +2 -2
- package/bundle/{gen-prompt-DqGDmpRI.js.map → gen-prompt-DxNgl5Cp.js.map} +1 -1
- package/bundle/index.js +248 -204
- package/bundle/index.js.map +1 -1
- package/dist/commands/google-aistudio.d.ts.map +1 -1
- package/dist/commands/google-aistudio.js +2 -1
- package/dist/commands/google-aistudio.js.map +1 -1
- package/package.json +3 -3
- package/assets/bundle/google-aistudio.browser.js +0 -1750
- package/assets/bundle/google-aistudio.jixo.js +0 -63644
- package/bundle/file-replacer-D6j8Nj7r.js.map +0 -1
- package/bundle/file-replacer-DY3KYbf9.js +0 -3
- package/bundle/gen-prompt-Dzy9yRhQ.js +0 -4
package/bundle/index.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { $ZodAny, $ZodArray, $ZodBoolean, $ZodCustom, $ZodLiteral, $ZodNumber, $ZodObject, $ZodOptional, $ZodString, $ZodType, $ZodUnion, $ZodUnknown, $constructor, __commonJS as __commonJS$1, __export as __export$2, __require as __require$1, __toESM as __toESM$1, _any, _boolean, _custom, _enum, _number, _string, _unknown, array as array$2, assignProp, boolean as boolean$1, clone as clone$2, createAcontext, createResolver, defineLazy, delay, extend as extend$1, func_catch, func_remember, globFilesWithParams, globbySync, isDynamicPattern, iter_map_not_null, literal as literal$2, map_get_or_put, map_get_or_put_async, normalizeFilePath, normalizeParams, number as number$1, obj_assign_props, object as object$1, parse as parse$5, parseAsync, partial as partial$1, reactiveFs, require_src as require_src$1, safeParse, safeParseAsync, string as string$1, timmers, toJSONSchema, toPath, traversePathUp, union as union$1, z, zod_default } from "./file-replacer-
|
|
3
|
-
import { _gen_content, blue, bold, cyan, doGenPrompts, gray, green, italic as italic$1, magenta, red, simpleGit, underline as underline$1, yellow as yellow$1 } from "./gen-prompt-
|
|
2
|
+
import { $ZodAny, $ZodArray, $ZodBoolean, $ZodCustom, $ZodDiscriminatedUnion, $ZodLiteral, $ZodNumber, $ZodObject, $ZodOptional, $ZodString, $ZodType, $ZodUnion, $ZodUnknown, $constructor, __commonJS as __commonJS$1, __export as __export$2, __require as __require$1, __toESM as __toESM$1, _any, _boolean, _custom, _enum, _number, _string, _unknown, array as array$2, assignProp, boolean as boolean$1, clone as clone$2, createAcontext, createResolver, defineLazy, delay, extend as extend$1, func_catch, func_remember, globFilesWithParams, globbySync, isDynamicPattern, iter_map_not_null, literal as literal$2, map_get_or_put, map_get_or_put_async, normalizeFilePath, normalizeParams, number as number$1, obj_assign_props, object as object$1, parse as parse$5, parseAsync, partial as partial$1, reactiveFs, require_src as require_src$1, safeParse, safeParseAsync, string as string$1, timmers, toJSONSchema, toPath, traversePathUp, union as union$1, z, zod_default } from "./file-replacer-C3H2FqOL.js";
|
|
3
|
+
import { _gen_content, blue, bold, cyan, doGenPrompts, gray, green, italic as italic$1, magenta, red, simpleGit, underline as underline$1, yellow as yellow$1 } from "./gen-prompt-DxNgl5Cp.js";
|
|
4
4
|
import { createRequire } from "node:module";
|
|
5
5
|
import { URL as URL$1, fileURLToPath, pathToFileURL } from "node:url";
|
|
6
6
|
import path, { dirname } from "node:path";
|
|
7
7
|
import fs, { appendFileSync, createReadStream, createWriteStream, readFileSync, readdirSync, realpathSync, statSync, writeFileSync } from "node:fs";
|
|
8
8
|
import assert3, { notStrictEqual, strictEqual } from "node:assert";
|
|
9
|
-
import * as path$
|
|
10
|
-
import
|
|
9
|
+
import * as path$6 from "node:path";
|
|
10
|
+
import path10, { basename, dirname as dirname$1, extname, join as join$1, normalize, relative, resolve } from "node:path";
|
|
11
11
|
import fs3, { readFileSync as readFileSync$1, readdirSync as readdirSync$1, realpathSync as realpathSync$1, statSync as statSync$1, writeFile } from "node:fs";
|
|
12
12
|
import { format, inspect } from "node:util";
|
|
13
13
|
import * as url from "node:url";
|
|
@@ -1521,9 +1521,9 @@ const parser = new YargsParser({
|
|
|
1521
1521
|
format,
|
|
1522
1522
|
normalize,
|
|
1523
1523
|
resolve,
|
|
1524
|
-
require: (path$
|
|
1525
|
-
if (typeof require$3 !== "undefined") return require$3(path$
|
|
1526
|
-
else if (path$
|
|
1524
|
+
require: (path$7) => {
|
|
1525
|
+
if (typeof require$3 !== "undefined") return require$3(path$7);
|
|
1526
|
+
else if (path$7.match(/\.json$/)) return JSON.parse(readFileSync$1(path$7, "utf8"));
|
|
1527
1527
|
else throw Error("only .json config files are supported in ESM");
|
|
1528
1528
|
}
|
|
1529
1529
|
});
|
|
@@ -4636,7 +4636,7 @@ var yargs_default = Yargs;
|
|
|
4636
4636
|
//#endregion
|
|
4637
4637
|
//#region package.json
|
|
4638
4638
|
var name$11 = "@jixo/cli";
|
|
4639
|
-
var version = "0.
|
|
4639
|
+
var version = "0.1.0";
|
|
4640
4640
|
var type = "module";
|
|
4641
4641
|
var bin = { "jixo": "./bundle/index.js" };
|
|
4642
4642
|
var files = [
|
|
@@ -7070,15 +7070,15 @@ var require_route = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/col
|
|
|
7070
7070
|
};
|
|
7071
7071
|
}
|
|
7072
7072
|
function wrapConversion(toModel, graph) {
|
|
7073
|
-
const path$
|
|
7073
|
+
const path$7 = [graph[toModel].parent, toModel];
|
|
7074
7074
|
let fn = conversions$1[graph[toModel].parent][toModel];
|
|
7075
7075
|
let cur = graph[toModel].parent;
|
|
7076
7076
|
while (graph[cur].parent) {
|
|
7077
|
-
path$
|
|
7077
|
+
path$7.unshift(graph[cur].parent);
|
|
7078
7078
|
fn = link(conversions$1[graph[cur].parent][cur], fn);
|
|
7079
7079
|
cur = graph[cur].parent;
|
|
7080
7080
|
}
|
|
7081
|
-
fn.conversion = path$
|
|
7081
|
+
fn.conversion = path$7;
|
|
7082
7082
|
return fn;
|
|
7083
7083
|
}
|
|
7084
7084
|
module.exports = function(fromModel) {
|
|
@@ -18471,7 +18471,7 @@ var isUrlInstance = (value) => value instanceof URL;
|
|
|
18471
18471
|
var isUrlString = (value) => typeof value === "string" && value.startsWith(URL_STRING_PREFIX);
|
|
18472
18472
|
var isUrl$1 = (urlOrPath) => isUrlInstance(urlOrPath) || isUrlString(urlOrPath);
|
|
18473
18473
|
var toPath$1 = (urlOrPath) => isUrl$1(urlOrPath) ? url.fileURLToPath(urlOrPath) : urlOrPath;
|
|
18474
|
-
var toAbsolutePath = (urlOrPath) => urlOrPath ? path$
|
|
18474
|
+
var toAbsolutePath = (urlOrPath) => urlOrPath ? path$6.resolve(isUrl$1(urlOrPath) ? url.fileURLToPath(urlOrPath) : urlOrPath) : urlOrPath;
|
|
18475
18475
|
function partition2(array2, predicate) {
|
|
18476
18476
|
const result = [[], []];
|
|
18477
18477
|
for (const value of array2) result[predicate(value) ? 0 : 1].push(value);
|
|
@@ -18485,7 +18485,7 @@ async function findInDirectory(nameOrNames, { typeCheck, cwd: cwd$1, allowSymlin
|
|
|
18485
18485
|
const directory = toAbsolutePath(cwd$1) ?? process2.cwd();
|
|
18486
18486
|
const names = Array.isArray(nameOrNames) ? nameOrNames : [nameOrNames];
|
|
18487
18487
|
for (const name$12 of names) {
|
|
18488
|
-
const fileOrDirectory = path$
|
|
18488
|
+
const fileOrDirectory = path$6.join(directory, name$12);
|
|
18489
18489
|
const stats = await safeStat(fileOrDirectory, allowSymlinks);
|
|
18490
18490
|
if (await typeCheck(stats) && (!filter2 || await filter2({
|
|
18491
18491
|
name: name$12,
|
|
@@ -18515,13 +18515,13 @@ function* iterateDirectoryUp(from, to) {
|
|
|
18515
18515
|
let directory = toAbsolutePath(from) ?? process2.cwd();
|
|
18516
18516
|
let stopDirectory = toAbsolutePath(to);
|
|
18517
18517
|
if (stopDirectory) {
|
|
18518
|
-
const relation = path$
|
|
18518
|
+
const relation = path$6.relative(stopDirectory, directory);
|
|
18519
18519
|
if (relation[0] === "." || relation === directory) return;
|
|
18520
18520
|
}
|
|
18521
|
-
stopDirectory = stopDirectory ? directory.slice(0, stopDirectory.length) : path$
|
|
18521
|
+
stopDirectory = stopDirectory ? directory.slice(0, stopDirectory.length) : path$6.parse(directory).root;
|
|
18522
18522
|
while (directory !== stopDirectory) {
|
|
18523
18523
|
yield directory;
|
|
18524
|
-
directory = path$
|
|
18524
|
+
directory = path$6.dirname(directory);
|
|
18525
18525
|
}
|
|
18526
18526
|
yield stopDirectory;
|
|
18527
18527
|
}
|
|
@@ -18596,7 +18596,7 @@ var searcher;
|
|
|
18596
18596
|
async function findProjectRoot(startDirectory, options8) {
|
|
18597
18597
|
searcher ?? (searcher = new DirectorySearcher(DIRECTORIES, { allowSymlinks: false }));
|
|
18598
18598
|
const directory = await searcher.search(startDirectory, { cache: options8.shouldCache });
|
|
18599
|
-
return directory ? path$
|
|
18599
|
+
return directory ? path$6.dirname(directory) : void 0;
|
|
18600
18600
|
}
|
|
18601
18601
|
function clearFindProjectRootCache() {
|
|
18602
18602
|
searcher?.clearCache();
|
|
@@ -18639,13 +18639,13 @@ function clearEditorconfigCache() {
|
|
|
18639
18639
|
editorconfigCache.clear();
|
|
18640
18640
|
}
|
|
18641
18641
|
async function loadEditorconfigInternal(file, { shouldCache }) {
|
|
18642
|
-
const directory =
|
|
18642
|
+
const directory = path10.dirname(file);
|
|
18643
18643
|
const root2 = await findProjectRoot(directory, { shouldCache });
|
|
18644
18644
|
const editorConfig = await import_editorconfig.default.parse(file, { root: root2 });
|
|
18645
18645
|
return editorconfig_to_prettier_default(editorConfig);
|
|
18646
18646
|
}
|
|
18647
18647
|
function loadEditorconfig(file, { shouldCache }) {
|
|
18648
|
-
file =
|
|
18648
|
+
file = path10.resolve(file);
|
|
18649
18649
|
if (!shouldCache || !editorconfigCache.has(file)) editorconfigCache.set(file, loadEditorconfigInternal(file, { shouldCache }));
|
|
18650
18650
|
return editorconfigCache.get(file);
|
|
18651
18651
|
}
|
|
@@ -20511,7 +20511,7 @@ function read2(jsonPath, { base, specifier }) {
|
|
|
20511
20511
|
if (existing) return existing;
|
|
20512
20512
|
let string$2;
|
|
20513
20513
|
try {
|
|
20514
|
-
string$2 = fs3.readFileSync(
|
|
20514
|
+
string$2 = fs3.readFileSync(path10.toNamespacedPath(jsonPath), "utf8");
|
|
20515
20515
|
} catch (error) {
|
|
20516
20516
|
const exception = error;
|
|
20517
20517
|
if (exception.code !== "ENOENT") throw exception;
|
|
@@ -20670,7 +20670,7 @@ function emitLegacyIndexDeprecation(url3, packageJsonUrl, base, main) {
|
|
|
20670
20670
|
const basePath = fileURLToPath$1(base);
|
|
20671
20671
|
if (!main) process2.emitWarning(`No "main" or "exports" field defined in the package.json for ${packagePath} resolving the main entry point "${urlPath.slice(packagePath.length)}", imported from ${basePath}.
|
|
20672
20672
|
Default "index" lookups for the main are deprecated for ES modules.`, "DeprecationWarning", "DEP0151");
|
|
20673
|
-
else if (
|
|
20673
|
+
else if (path10.resolve(packagePath, main) !== urlPath) process2.emitWarning(`Package ${packagePath} has a "main" field set to "${main}", excluding the full filename and extension to the resolved file at "${urlPath.slice(packagePath.length)}", imported from ${basePath}.
|
|
20674
20674
|
Automatic extension resolution of the "main" field is deprecated for ES modules.`, "DeprecationWarning", "DEP0151");
|
|
20675
20675
|
}
|
|
20676
20676
|
function tryStatSync(path14) {
|
|
@@ -20749,7 +20749,7 @@ function finalizeResolution(resolved, base, preserveSymlinks) {
|
|
|
20749
20749
|
if (!preserveSymlinks) {
|
|
20750
20750
|
const real = realpathSync$1(filePath);
|
|
20751
20751
|
const { search, hash } = resolved;
|
|
20752
|
-
resolved = pathToFileURL$1(real + (filePath.endsWith(
|
|
20752
|
+
resolved = pathToFileURL$1(real + (filePath.endsWith(path10.sep) ? "/" : ""));
|
|
20753
20753
|
resolved.search = search;
|
|
20754
20754
|
resolved.hash = hash;
|
|
20755
20755
|
}
|
|
@@ -21140,7 +21140,7 @@ async function loadExternalConfig(externalConfig, configFile) {
|
|
|
21140
21140
|
}
|
|
21141
21141
|
var load_external_config_default = loadExternalConfig;
|
|
21142
21142
|
async function loadConfig(configFile) {
|
|
21143
|
-
const { base: fileName, ext: extension$1 } =
|
|
21143
|
+
const { base: fileName, ext: extension$1 } = path10.parse(configFile);
|
|
21144
21144
|
const load$3 = fileName === "package.json" ? loadConfigFromPackageJson : fileName === "package.yaml" ? loadConfigFromPackageYaml : loaders_default[extension$1];
|
|
21145
21145
|
if (!load$3) throw new Error(`No loader specified for extension "${extension$1 || "noExt"}"`);
|
|
21146
21146
|
let config = await load$3(configFile);
|
|
@@ -21158,12 +21158,12 @@ function clearPrettierConfigCache() {
|
|
|
21158
21158
|
searchCache.clear();
|
|
21159
21159
|
}
|
|
21160
21160
|
function loadPrettierConfig(configFile, { shouldCache }) {
|
|
21161
|
-
configFile =
|
|
21161
|
+
configFile = path10.resolve(configFile);
|
|
21162
21162
|
if (!shouldCache || !loadCache.has(configFile)) loadCache.set(configFile, load_config_default(configFile));
|
|
21163
21163
|
return loadCache.get(configFile);
|
|
21164
21164
|
}
|
|
21165
21165
|
function getSearchFunction(stopDirectory) {
|
|
21166
|
-
stopDirectory = stopDirectory ?
|
|
21166
|
+
stopDirectory = stopDirectory ? path10.resolve(stopDirectory) : void 0;
|
|
21167
21167
|
if (!searchCache.has(stopDirectory)) {
|
|
21168
21168
|
const searcher2 = config_searcher_default(stopDirectory);
|
|
21169
21169
|
const searchFunction = searcher2.search.bind(searcher2);
|
|
@@ -21172,7 +21172,7 @@ function getSearchFunction(stopDirectory) {
|
|
|
21172
21172
|
return searchCache.get(stopDirectory);
|
|
21173
21173
|
}
|
|
21174
21174
|
function searchPrettierConfig(startDirectory, options8 = {}) {
|
|
21175
|
-
startDirectory = startDirectory ?
|
|
21175
|
+
startDirectory = startDirectory ? path10.resolve(startDirectory) : process.cwd();
|
|
21176
21176
|
const stopDirectory = mockable_default.getPrettierConfigSearchStopDirectory();
|
|
21177
21177
|
return getSearchFunction(stopDirectory)(startDirectory, { cache: options8.shouldCache });
|
|
21178
21178
|
}
|
|
@@ -21189,7 +21189,7 @@ async function loadPrettierConfig2(file, options8) {
|
|
|
21189
21189
|
const shouldCache = options8.useCache;
|
|
21190
21190
|
let configFile = options8.config;
|
|
21191
21191
|
if (!configFile) {
|
|
21192
|
-
const directory = file ?
|
|
21192
|
+
const directory = file ? path10.dirname(path10.resolve(file)) : void 0;
|
|
21193
21193
|
configFile = await searchPrettierConfig(directory, { shouldCache });
|
|
21194
21194
|
}
|
|
21195
21195
|
if (!configFile) return;
|
|
@@ -21211,18 +21211,18 @@ async function resolveConfig(fileUrlOrPath, options8) {
|
|
|
21211
21211
|
...editorConfigured,
|
|
21212
21212
|
...mergeOverrides(result, filePath)
|
|
21213
21213
|
};
|
|
21214
|
-
if (Array.isArray(merged.plugins)) merged.plugins = merged.plugins.map((value) => typeof value === "string" && value.startsWith(".") ?
|
|
21214
|
+
if (Array.isArray(merged.plugins)) merged.plugins = merged.plugins.map((value) => typeof value === "string" && value.startsWith(".") ? path10.resolve(path10.dirname(result.configFile), value) : value);
|
|
21215
21215
|
return merged;
|
|
21216
21216
|
}
|
|
21217
21217
|
async function resolveConfigFile(fileUrlOrPath) {
|
|
21218
|
-
const directory = fileUrlOrPath ?
|
|
21218
|
+
const directory = fileUrlOrPath ? path10.dirname(path10.resolve(toPath$1(fileUrlOrPath))) : void 0;
|
|
21219
21219
|
return await searchPrettierConfig(directory, { shouldCache: false }) ?? null;
|
|
21220
21220
|
}
|
|
21221
21221
|
function mergeOverrides(configResult, filePath) {
|
|
21222
21222
|
const { config, configFile } = configResult || {};
|
|
21223
21223
|
const { overrides,...options8 } = config || {};
|
|
21224
21224
|
if (filePath && overrides) {
|
|
21225
|
-
const relativeFilePath =
|
|
21225
|
+
const relativeFilePath = path10.relative(path10.dirname(configFile), filePath);
|
|
21226
21226
|
for (const override of overrides) if (pathMatchesGlobs(relativeFilePath, override.files, override.excludeFiles)) Object.assign(options8, override.options);
|
|
21227
21227
|
}
|
|
21228
21228
|
return options8;
|
|
@@ -24745,14 +24745,14 @@ function loadBuiltinPlugins() {
|
|
|
24745
24745
|
}
|
|
24746
24746
|
var load_builtin_plugins_default = loadBuiltinPlugins;
|
|
24747
24747
|
function importFromDirectory(specifier, directory) {
|
|
24748
|
-
return import_from_file_default(specifier,
|
|
24748
|
+
return import_from_file_default(specifier, path10.join(directory, "noop.js"));
|
|
24749
24749
|
}
|
|
24750
24750
|
var import_from_directory_default = importFromDirectory;
|
|
24751
24751
|
async function importPlugin(name$12, cwd$1) {
|
|
24752
24752
|
if (isUrl$1(name$12)) return import(name$12);
|
|
24753
|
-
if (
|
|
24753
|
+
if (path10.isAbsolute(name$12)) return import(pathToFileURL$1(name$12).href);
|
|
24754
24754
|
try {
|
|
24755
|
-
return await import(pathToFileURL$1(
|
|
24755
|
+
return await import(pathToFileURL$1(path10.resolve(name$12)).href);
|
|
24756
24756
|
} catch {
|
|
24757
24757
|
return import_from_directory_default(name$12, cwd$1);
|
|
24758
24758
|
}
|
|
@@ -24783,11 +24783,11 @@ function loadPlugins(plugins = []) {
|
|
|
24783
24783
|
}
|
|
24784
24784
|
var load_plugins_default = loadPlugins;
|
|
24785
24785
|
var import_ignore = __toESM(require_ignore(), 1);
|
|
24786
|
-
var slash =
|
|
24786
|
+
var slash = path10.sep === "\\" ? (filePath) => string_replace_all_default(false, filePath, "\\", "/") : (filePath) => filePath;
|
|
24787
24787
|
function getRelativePath(file, ignoreFile) {
|
|
24788
24788
|
const ignoreFilePath = toPath$1(ignoreFile);
|
|
24789
|
-
const filePath = isUrl$1(file) ? url2.fileURLToPath(file) :
|
|
24790
|
-
return
|
|
24789
|
+
const filePath = isUrl$1(file) ? url2.fileURLToPath(file) : path10.resolve(file);
|
|
24790
|
+
return path10.relative(ignoreFilePath ? path10.dirname(ignoreFilePath) : process.cwd(), filePath);
|
|
24791
24791
|
}
|
|
24792
24792
|
async function createSingleIsIgnoredFunction(ignoreFile, withNodeModules) {
|
|
24793
24793
|
let content = "";
|
|
@@ -25499,6 +25499,18 @@ function union(options, params) {
|
|
|
25499
25499
|
...normalizeParams(params)
|
|
25500
25500
|
});
|
|
25501
25501
|
}
|
|
25502
|
+
const ZodMiniDiscriminatedUnion = /* @__PURE__ */ $constructor("ZodMiniDiscriminatedUnion", (inst, def) => {
|
|
25503
|
+
$ZodDiscriminatedUnion.init(inst, def);
|
|
25504
|
+
ZodMiniType.init(inst, def);
|
|
25505
|
+
});
|
|
25506
|
+
function discriminatedUnion(discriminator, options, params) {
|
|
25507
|
+
return new ZodMiniDiscriminatedUnion({
|
|
25508
|
+
type: "union",
|
|
25509
|
+
options,
|
|
25510
|
+
discriminator,
|
|
25511
|
+
...normalizeParams(params)
|
|
25512
|
+
});
|
|
25513
|
+
}
|
|
25502
25514
|
const ZodMiniLiteral = /* @__PURE__ */ $constructor("ZodMiniLiteral", (inst, def) => {
|
|
25503
25515
|
$ZodLiteral.init(inst, def);
|
|
25504
25516
|
ZodMiniType.init(inst, def);
|
|
@@ -25535,7 +25547,11 @@ function _instanceof(cls, params = { error: `Input not instance of ${cls.name}`
|
|
|
25535
25547
|
|
|
25536
25548
|
//#endregion
|
|
25537
25549
|
//#region ../dev/dist/google-aistudio/browser/config/types.js
|
|
25538
|
-
const zBaseAgentMetadata = object({
|
|
25550
|
+
const zBaseAgentMetadata = object({
|
|
25551
|
+
workDir: string(),
|
|
25552
|
+
tools: optional(object({ exclude: optional(array(string())) }))
|
|
25553
|
+
});
|
|
25554
|
+
const zCommonAgentMetadata = extend(zBaseAgentMetadata, { agent: literal("common") });
|
|
25539
25555
|
const zCoderAgentMetadata = extend(zBaseAgentMetadata, {
|
|
25540
25556
|
agent: literal("coder"),
|
|
25541
25557
|
codeName: string(),
|
|
@@ -25544,10 +25560,9 @@ const zCoderAgentMetadata = extend(zBaseAgentMetadata, {
|
|
|
25544
25560
|
mcp: array(object({
|
|
25545
25561
|
command: string(),
|
|
25546
25562
|
prefix: optional(string())
|
|
25547
|
-
}))
|
|
25548
|
-
tools: optional(object({ exclude: optional(array(string())) }))
|
|
25563
|
+
}))
|
|
25549
25564
|
});
|
|
25550
|
-
const zAgentMetadata =
|
|
25565
|
+
const zAgentMetadata = discriminatedUnion("agent", [zCommonAgentMetadata, zCoderAgentMetadata]);
|
|
25551
25566
|
const zPageToolConfig = object({
|
|
25552
25567
|
name: string(),
|
|
25553
25568
|
description: string(),
|
|
@@ -25556,7 +25571,7 @@ const zPageToolConfig = object({
|
|
|
25556
25571
|
disabled: optional(boolean())
|
|
25557
25572
|
});
|
|
25558
25573
|
const zPageConfig = object({
|
|
25559
|
-
metadata:
|
|
25574
|
+
metadata: zAgentMetadata,
|
|
25560
25575
|
model: string(),
|
|
25561
25576
|
systemPrompt: string(),
|
|
25562
25577
|
tools: array(zPageToolConfig),
|
|
@@ -25780,18 +25795,18 @@ var require_comlink = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/c
|
|
|
25780
25795
|
console.warn(`Invalid origin '${ev.origin}' for comlink proxy`);
|
|
25781
25796
|
return;
|
|
25782
25797
|
}
|
|
25783
|
-
const { id, type: type$1, path: path$
|
|
25798
|
+
const { id, type: type$1, path: path$7 } = Object.assign({ path: [] }, ev.data);
|
|
25784
25799
|
const argumentList = (ev.data.argumentList || []).map(fromWireValue);
|
|
25785
25800
|
let returnValue;
|
|
25786
25801
|
try {
|
|
25787
|
-
const parent = path$
|
|
25788
|
-
const rawValue = path$
|
|
25802
|
+
const parent = path$7.slice(0, -1).reduce((obj$1, prop) => obj$1[prop], obj);
|
|
25803
|
+
const rawValue = path$7.reduce((obj$1, prop) => obj$1[prop], obj);
|
|
25789
25804
|
switch (type$1) {
|
|
25790
25805
|
case "GET":
|
|
25791
25806
|
returnValue = rawValue;
|
|
25792
25807
|
break;
|
|
25793
25808
|
case "SET":
|
|
25794
|
-
parent[path$
|
|
25809
|
+
parent[path$7.slice(-1)[0]] = fromWireValue(ev.data.value);
|
|
25795
25810
|
returnValue = true;
|
|
25796
25811
|
break;
|
|
25797
25812
|
case "APPLY":
|
|
@@ -25887,7 +25902,7 @@ var require_comlink = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/c
|
|
|
25887
25902
|
function unregisterProxy(proxy$2) {
|
|
25888
25903
|
if (proxyFinalizers) proxyFinalizers.unregister(proxy$2);
|
|
25889
25904
|
}
|
|
25890
|
-
function createProxy(ep, pendingListeners, path$
|
|
25905
|
+
function createProxy(ep, pendingListeners, path$7 = [], target = function() {}) {
|
|
25891
25906
|
let isProxyReleased = false;
|
|
25892
25907
|
const proxy$2 = new Proxy(target, {
|
|
25893
25908
|
get(_target, prop) {
|
|
@@ -25899,33 +25914,33 @@ var require_comlink = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/c
|
|
|
25899
25914
|
isProxyReleased = true;
|
|
25900
25915
|
};
|
|
25901
25916
|
if (prop === "then") {
|
|
25902
|
-
if (path$
|
|
25917
|
+
if (path$7.length === 0) return { then: () => proxy$2 };
|
|
25903
25918
|
const r = requestResponseMessage(ep, pendingListeners, {
|
|
25904
25919
|
type: "GET",
|
|
25905
|
-
path: path$
|
|
25920
|
+
path: path$7.map((p) => p.toString())
|
|
25906
25921
|
}).then(fromWireValue);
|
|
25907
25922
|
return r.then.bind(r);
|
|
25908
25923
|
}
|
|
25909
|
-
return createProxy(ep, pendingListeners, [...path$
|
|
25924
|
+
return createProxy(ep, pendingListeners, [...path$7, prop]);
|
|
25910
25925
|
},
|
|
25911
25926
|
set(_target, prop, rawValue) {
|
|
25912
25927
|
throwIfProxyReleased(isProxyReleased);
|
|
25913
25928
|
const [value, transferables] = toWireValue(rawValue);
|
|
25914
25929
|
return requestResponseMessage(ep, pendingListeners, {
|
|
25915
25930
|
type: "SET",
|
|
25916
|
-
path: [...path$
|
|
25931
|
+
path: [...path$7, prop].map((p) => p.toString()),
|
|
25917
25932
|
value
|
|
25918
25933
|
}, transferables).then(fromWireValue);
|
|
25919
25934
|
},
|
|
25920
25935
|
apply(_target, _thisArg, rawArgumentList) {
|
|
25921
25936
|
throwIfProxyReleased(isProxyReleased);
|
|
25922
|
-
const last = path$
|
|
25937
|
+
const last = path$7[path$7.length - 1];
|
|
25923
25938
|
if (last === createEndpoint$1) return requestResponseMessage(ep, pendingListeners, { type: "ENDPOINT" }).then(fromWireValue);
|
|
25924
|
-
if (last === "bind") return createProxy(ep, pendingListeners, path$
|
|
25939
|
+
if (last === "bind") return createProxy(ep, pendingListeners, path$7.slice(0, -1));
|
|
25925
25940
|
const [argumentList, transferables] = processArguments(rawArgumentList);
|
|
25926
25941
|
return requestResponseMessage(ep, pendingListeners, {
|
|
25927
25942
|
type: "APPLY",
|
|
25928
|
-
path: path$
|
|
25943
|
+
path: path$7.map((p) => p.toString()),
|
|
25929
25944
|
argumentList
|
|
25930
25945
|
}, transferables).then(fromWireValue);
|
|
25931
25946
|
},
|
|
@@ -25934,7 +25949,7 @@ var require_comlink = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/c
|
|
|
25934
25949
|
const [argumentList, transferables] = processArguments(rawArgumentList);
|
|
25935
25950
|
return requestResponseMessage(ep, pendingListeners, {
|
|
25936
25951
|
type: "CONSTRUCT",
|
|
25937
|
-
path: path$
|
|
25952
|
+
path: path$7.map((p) => p.toString()),
|
|
25938
25953
|
argumentList
|
|
25939
25954
|
}, transferables).then(fromWireValue);
|
|
25940
25955
|
}
|
|
@@ -26230,13 +26245,13 @@ var require_polyfills = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm
|
|
|
26230
26245
|
fs$10.fstatSync = statFixSync(fs$10.fstatSync);
|
|
26231
26246
|
fs$10.lstatSync = statFixSync(fs$10.lstatSync);
|
|
26232
26247
|
if (fs$10.chmod && !fs$10.lchmod) {
|
|
26233
|
-
fs$10.lchmod = function(path$
|
|
26248
|
+
fs$10.lchmod = function(path$7, mode, cb) {
|
|
26234
26249
|
if (cb) process.nextTick(cb);
|
|
26235
26250
|
};
|
|
26236
26251
|
fs$10.lchmodSync = function() {};
|
|
26237
26252
|
}
|
|
26238
26253
|
if (fs$10.chown && !fs$10.lchown) {
|
|
26239
|
-
fs$10.lchown = function(path$
|
|
26254
|
+
fs$10.lchown = function(path$7, uid, gid, cb) {
|
|
26240
26255
|
if (cb) process.nextTick(cb);
|
|
26241
26256
|
};
|
|
26242
26257
|
fs$10.lchownSync = function() {};
|
|
@@ -26295,8 +26310,8 @@ var require_polyfills = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm
|
|
|
26295
26310
|
};
|
|
26296
26311
|
})(fs$10.readSync);
|
|
26297
26312
|
function patchLchmod(fs$11) {
|
|
26298
|
-
fs$11.lchmod = function(path$
|
|
26299
|
-
fs$11.open(path$
|
|
26313
|
+
fs$11.lchmod = function(path$7, mode, callback) {
|
|
26314
|
+
fs$11.open(path$7, constants$1.O_WRONLY | constants$1.O_SYMLINK, mode, function(err, fd) {
|
|
26300
26315
|
if (err) {
|
|
26301
26316
|
if (callback) callback(err);
|
|
26302
26317
|
return;
|
|
@@ -26308,8 +26323,8 @@ var require_polyfills = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm
|
|
|
26308
26323
|
});
|
|
26309
26324
|
});
|
|
26310
26325
|
};
|
|
26311
|
-
fs$11.lchmodSync = function(path$
|
|
26312
|
-
var fd = fs$11.openSync(path$
|
|
26326
|
+
fs$11.lchmodSync = function(path$7, mode) {
|
|
26327
|
+
var fd = fs$11.openSync(path$7, constants$1.O_WRONLY | constants$1.O_SYMLINK, mode);
|
|
26313
26328
|
var threw = true;
|
|
26314
26329
|
var ret;
|
|
26315
26330
|
try {
|
|
@@ -26326,8 +26341,8 @@ var require_polyfills = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm
|
|
|
26326
26341
|
}
|
|
26327
26342
|
function patchLutimes(fs$11) {
|
|
26328
26343
|
if (constants$1.hasOwnProperty("O_SYMLINK") && fs$11.futimes) {
|
|
26329
|
-
fs$11.lutimes = function(path$
|
|
26330
|
-
fs$11.open(path$
|
|
26344
|
+
fs$11.lutimes = function(path$7, at$2, mt, cb) {
|
|
26345
|
+
fs$11.open(path$7, constants$1.O_SYMLINK, function(er, fd) {
|
|
26331
26346
|
if (er) {
|
|
26332
26347
|
if (cb) cb(er);
|
|
26333
26348
|
return;
|
|
@@ -26339,8 +26354,8 @@ var require_polyfills = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm
|
|
|
26339
26354
|
});
|
|
26340
26355
|
});
|
|
26341
26356
|
};
|
|
26342
|
-
fs$11.lutimesSync = function(path$
|
|
26343
|
-
var fd = fs$11.openSync(path$
|
|
26357
|
+
fs$11.lutimesSync = function(path$7, at$2, mt) {
|
|
26358
|
+
var fd = fs$11.openSync(path$7, constants$1.O_SYMLINK);
|
|
26344
26359
|
var ret;
|
|
26345
26360
|
var threw = true;
|
|
26346
26361
|
try {
|
|
@@ -26448,11 +26463,11 @@ var require_legacy_streams = /* @__PURE__ */ __commonJS$1({ "../../node_modules/
|
|
|
26448
26463
|
ReadStream,
|
|
26449
26464
|
WriteStream
|
|
26450
26465
|
};
|
|
26451
|
-
function ReadStream(path$
|
|
26452
|
-
if (!(this instanceof ReadStream)) return new ReadStream(path$
|
|
26466
|
+
function ReadStream(path$7, options) {
|
|
26467
|
+
if (!(this instanceof ReadStream)) return new ReadStream(path$7, options);
|
|
26453
26468
|
Stream.call(this);
|
|
26454
26469
|
var self$1 = this;
|
|
26455
|
-
this.path = path$
|
|
26470
|
+
this.path = path$7;
|
|
26456
26471
|
this.fd = null;
|
|
26457
26472
|
this.readable = true;
|
|
26458
26473
|
this.paused = false;
|
|
@@ -26490,10 +26505,10 @@ var require_legacy_streams = /* @__PURE__ */ __commonJS$1({ "../../node_modules/
|
|
|
26490
26505
|
self$1._read();
|
|
26491
26506
|
});
|
|
26492
26507
|
}
|
|
26493
|
-
function WriteStream(path$
|
|
26494
|
-
if (!(this instanceof WriteStream)) return new WriteStream(path$
|
|
26508
|
+
function WriteStream(path$7, options) {
|
|
26509
|
+
if (!(this instanceof WriteStream)) return new WriteStream(path$7, options);
|
|
26495
26510
|
Stream.call(this);
|
|
26496
|
-
this.path = path$
|
|
26511
|
+
this.path = path$7;
|
|
26497
26512
|
this.fd = null;
|
|
26498
26513
|
this.writable = true;
|
|
26499
26514
|
this.flags = "w";
|
|
@@ -26617,15 +26632,15 @@ var require_graceful_fs = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pn
|
|
|
26617
26632
|
fs$10.createWriteStream = createWriteStream$1;
|
|
26618
26633
|
var fs$readFile = fs$10.readFile;
|
|
26619
26634
|
fs$10.readFile = readFile$1;
|
|
26620
|
-
function readFile$1(path$
|
|
26635
|
+
function readFile$1(path$7, options, cb) {
|
|
26621
26636
|
if (typeof options === "function") cb = options, options = null;
|
|
26622
|
-
return go$readFile(path$
|
|
26623
|
-
function go$readFile(path$
|
|
26624
|
-
return fs$readFile(path$
|
|
26637
|
+
return go$readFile(path$7, options, cb);
|
|
26638
|
+
function go$readFile(path$8, options$1, cb$1, startTime) {
|
|
26639
|
+
return fs$readFile(path$8, options$1, function(err) {
|
|
26625
26640
|
if (err && (err.code === "EMFILE" || err.code === "ENFILE")) enqueue([
|
|
26626
26641
|
go$readFile,
|
|
26627
26642
|
[
|
|
26628
|
-
path$
|
|
26643
|
+
path$8,
|
|
26629
26644
|
options$1,
|
|
26630
26645
|
cb$1
|
|
26631
26646
|
],
|
|
@@ -26639,15 +26654,15 @@ var require_graceful_fs = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pn
|
|
|
26639
26654
|
}
|
|
26640
26655
|
var fs$writeFile = fs$10.writeFile;
|
|
26641
26656
|
fs$10.writeFile = writeFile$2;
|
|
26642
|
-
function writeFile$2(path$
|
|
26657
|
+
function writeFile$2(path$7, data, options, cb) {
|
|
26643
26658
|
if (typeof options === "function") cb = options, options = null;
|
|
26644
|
-
return go$writeFile(path$
|
|
26645
|
-
function go$writeFile(path$
|
|
26646
|
-
return fs$writeFile(path$
|
|
26659
|
+
return go$writeFile(path$7, data, options, cb);
|
|
26660
|
+
function go$writeFile(path$8, data$1, options$1, cb$1, startTime) {
|
|
26661
|
+
return fs$writeFile(path$8, data$1, options$1, function(err) {
|
|
26647
26662
|
if (err && (err.code === "EMFILE" || err.code === "ENFILE")) enqueue([
|
|
26648
26663
|
go$writeFile,
|
|
26649
26664
|
[
|
|
26650
|
-
path$
|
|
26665
|
+
path$8,
|
|
26651
26666
|
data$1,
|
|
26652
26667
|
options$1,
|
|
26653
26668
|
cb$1
|
|
@@ -26662,15 +26677,15 @@ var require_graceful_fs = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pn
|
|
|
26662
26677
|
}
|
|
26663
26678
|
var fs$appendFile = fs$10.appendFile;
|
|
26664
26679
|
if (fs$appendFile) fs$10.appendFile = appendFile;
|
|
26665
|
-
function appendFile(path$
|
|
26680
|
+
function appendFile(path$7, data, options, cb) {
|
|
26666
26681
|
if (typeof options === "function") cb = options, options = null;
|
|
26667
|
-
return go$appendFile(path$
|
|
26668
|
-
function go$appendFile(path$
|
|
26669
|
-
return fs$appendFile(path$
|
|
26682
|
+
return go$appendFile(path$7, data, options, cb);
|
|
26683
|
+
function go$appendFile(path$8, data$1, options$1, cb$1, startTime) {
|
|
26684
|
+
return fs$appendFile(path$8, data$1, options$1, function(err) {
|
|
26670
26685
|
if (err && (err.code === "EMFILE" || err.code === "ENFILE")) enqueue([
|
|
26671
26686
|
go$appendFile,
|
|
26672
26687
|
[
|
|
26673
|
-
path$
|
|
26688
|
+
path$8,
|
|
26674
26689
|
data$1,
|
|
26675
26690
|
options$1,
|
|
26676
26691
|
cb$1
|
|
@@ -26712,20 +26727,20 @@ var require_graceful_fs = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pn
|
|
|
26712
26727
|
var fs$readdir = fs$10.readdir;
|
|
26713
26728
|
fs$10.readdir = readdir;
|
|
26714
26729
|
var noReaddirOptionVersions = /^v[0-5]\./;
|
|
26715
|
-
function readdir(path$
|
|
26730
|
+
function readdir(path$7, options, cb) {
|
|
26716
26731
|
if (typeof options === "function") cb = options, options = null;
|
|
26717
|
-
var go$readdir = noReaddirOptionVersions.test(process.version) ? function go$readdir$1(path$
|
|
26718
|
-
return fs$readdir(path$
|
|
26719
|
-
} : function go$readdir$1(path$
|
|
26720
|
-
return fs$readdir(path$
|
|
26732
|
+
var go$readdir = noReaddirOptionVersions.test(process.version) ? function go$readdir$1(path$8, options$1, cb$1, startTime) {
|
|
26733
|
+
return fs$readdir(path$8, fs$readdirCallback(path$8, options$1, cb$1, startTime));
|
|
26734
|
+
} : function go$readdir$1(path$8, options$1, cb$1, startTime) {
|
|
26735
|
+
return fs$readdir(path$8, options$1, fs$readdirCallback(path$8, options$1, cb$1, startTime));
|
|
26721
26736
|
};
|
|
26722
|
-
return go$readdir(path$
|
|
26723
|
-
function fs$readdirCallback(path$
|
|
26737
|
+
return go$readdir(path$7, options, cb);
|
|
26738
|
+
function fs$readdirCallback(path$8, options$1, cb$1, startTime) {
|
|
26724
26739
|
return function(err, files$1) {
|
|
26725
26740
|
if (err && (err.code === "EMFILE" || err.code === "ENFILE")) enqueue([
|
|
26726
26741
|
go$readdir,
|
|
26727
26742
|
[
|
|
26728
|
-
path$
|
|
26743
|
+
path$8,
|
|
26729
26744
|
options$1,
|
|
26730
26745
|
cb$1
|
|
26731
26746
|
],
|
|
@@ -26797,7 +26812,7 @@ var require_graceful_fs = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pn
|
|
|
26797
26812
|
enumerable: true,
|
|
26798
26813
|
configurable: true
|
|
26799
26814
|
});
|
|
26800
|
-
function ReadStream(path$
|
|
26815
|
+
function ReadStream(path$7, options) {
|
|
26801
26816
|
if (this instanceof ReadStream) return fs$ReadStream.apply(this, arguments), this;
|
|
26802
26817
|
else return ReadStream.apply(Object.create(ReadStream.prototype), arguments);
|
|
26803
26818
|
}
|
|
@@ -26814,7 +26829,7 @@ var require_graceful_fs = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pn
|
|
|
26814
26829
|
}
|
|
26815
26830
|
});
|
|
26816
26831
|
}
|
|
26817
|
-
function WriteStream(path$
|
|
26832
|
+
function WriteStream(path$7, options) {
|
|
26818
26833
|
if (this instanceof WriteStream) return fs$WriteStream.apply(this, arguments), this;
|
|
26819
26834
|
else return WriteStream.apply(Object.create(WriteStream.prototype), arguments);
|
|
26820
26835
|
}
|
|
@@ -26830,23 +26845,23 @@ var require_graceful_fs = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pn
|
|
|
26830
26845
|
}
|
|
26831
26846
|
});
|
|
26832
26847
|
}
|
|
26833
|
-
function createReadStream$1(path$
|
|
26834
|
-
return new fs$10.ReadStream(path$
|
|
26848
|
+
function createReadStream$1(path$7, options) {
|
|
26849
|
+
return new fs$10.ReadStream(path$7, options);
|
|
26835
26850
|
}
|
|
26836
|
-
function createWriteStream$1(path$
|
|
26837
|
-
return new fs$10.WriteStream(path$
|
|
26851
|
+
function createWriteStream$1(path$7, options) {
|
|
26852
|
+
return new fs$10.WriteStream(path$7, options);
|
|
26838
26853
|
}
|
|
26839
26854
|
var fs$open = fs$10.open;
|
|
26840
26855
|
fs$10.open = open;
|
|
26841
|
-
function open(path$
|
|
26856
|
+
function open(path$7, flags, mode, cb) {
|
|
26842
26857
|
if (typeof mode === "function") cb = mode, mode = null;
|
|
26843
|
-
return go$open(path$
|
|
26844
|
-
function go$open(path$
|
|
26845
|
-
return fs$open(path$
|
|
26858
|
+
return go$open(path$7, flags, mode, cb);
|
|
26859
|
+
function go$open(path$8, flags$1, mode$1, cb$1, startTime) {
|
|
26860
|
+
return fs$open(path$8, flags$1, mode$1, function(err, fd) {
|
|
26846
26861
|
if (err && (err.code === "EMFILE" || err.code === "ENFILE")) enqueue([
|
|
26847
26862
|
go$open,
|
|
26848
26863
|
[
|
|
26849
|
-
path$
|
|
26864
|
+
path$8,
|
|
26850
26865
|
flags$1,
|
|
26851
26866
|
mode$1,
|
|
26852
26867
|
cb$1
|
|
@@ -27259,7 +27274,7 @@ var require_mtime_precision = /* @__PURE__ */ __commonJS$1({ "../../node_modules
|
|
|
27259
27274
|
//#endregion
|
|
27260
27275
|
//#region ../../node_modules/.pnpm/proper-lockfile@4.1.2/node_modules/proper-lockfile/lib/lockfile.js
|
|
27261
27276
|
var require_lockfile = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/proper-lockfile@4.1.2/node_modules/proper-lockfile/lib/lockfile.js": ((exports, module) => {
|
|
27262
|
-
const path$
|
|
27277
|
+
const path$5 = __require$1("path");
|
|
27263
27278
|
const fs$7 = require_graceful_fs();
|
|
27264
27279
|
const retry = require_retry();
|
|
27265
27280
|
const onExit$1 = require_signal_exit();
|
|
@@ -27269,7 +27284,7 @@ var require_lockfile = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/
|
|
|
27269
27284
|
return options.lockfilePath || `${file}.lock`;
|
|
27270
27285
|
}
|
|
27271
27286
|
function resolveCanonicalPath(file, options, callback) {
|
|
27272
|
-
if (!options.realpath) return callback(null, path$
|
|
27287
|
+
if (!options.realpath) return callback(null, path$5.resolve(file));
|
|
27273
27288
|
options.fs.realpath(file, callback);
|
|
27274
27289
|
}
|
|
27275
27290
|
function acquireLock(file, options, callback) {
|
|
@@ -29115,28 +29130,28 @@ var require_windows = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/i
|
|
|
29115
29130
|
module.exports = isexe$3;
|
|
29116
29131
|
isexe$3.sync = sync$3;
|
|
29117
29132
|
var fs$5 = __require$1("fs");
|
|
29118
|
-
function checkPathExt(path$
|
|
29133
|
+
function checkPathExt(path$7, options) {
|
|
29119
29134
|
var pathext = options.pathExt !== void 0 ? options.pathExt : process.env.PATHEXT;
|
|
29120
29135
|
if (!pathext) return true;
|
|
29121
29136
|
pathext = pathext.split(";");
|
|
29122
29137
|
if (pathext.indexOf("") !== -1) return true;
|
|
29123
29138
|
for (var i$1 = 0; i$1 < pathext.length; i$1++) {
|
|
29124
29139
|
var p = pathext[i$1].toLowerCase();
|
|
29125
|
-
if (p && path$
|
|
29140
|
+
if (p && path$7.substr(-p.length).toLowerCase() === p) return true;
|
|
29126
29141
|
}
|
|
29127
29142
|
return false;
|
|
29128
29143
|
}
|
|
29129
|
-
function checkStat$1(stat, path$
|
|
29144
|
+
function checkStat$1(stat, path$7, options) {
|
|
29130
29145
|
if (!stat.isSymbolicLink() && !stat.isFile()) return false;
|
|
29131
|
-
return checkPathExt(path$
|
|
29146
|
+
return checkPathExt(path$7, options);
|
|
29132
29147
|
}
|
|
29133
|
-
function isexe$3(path$
|
|
29134
|
-
fs$5.stat(path$
|
|
29135
|
-
cb(er, er ? false : checkStat$1(stat, path$
|
|
29148
|
+
function isexe$3(path$7, options, cb) {
|
|
29149
|
+
fs$5.stat(path$7, function(er, stat) {
|
|
29150
|
+
cb(er, er ? false : checkStat$1(stat, path$7, options));
|
|
29136
29151
|
});
|
|
29137
29152
|
}
|
|
29138
|
-
function sync$3(path$
|
|
29139
|
-
return checkStat$1(fs$5.statSync(path$
|
|
29153
|
+
function sync$3(path$7, options) {
|
|
29154
|
+
return checkStat$1(fs$5.statSync(path$7), path$7, options);
|
|
29140
29155
|
}
|
|
29141
29156
|
}) });
|
|
29142
29157
|
|
|
@@ -29146,13 +29161,13 @@ var require_mode = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/isex
|
|
|
29146
29161
|
module.exports = isexe$2;
|
|
29147
29162
|
isexe$2.sync = sync$2;
|
|
29148
29163
|
var fs$4 = __require$1("fs");
|
|
29149
|
-
function isexe$2(path$
|
|
29150
|
-
fs$4.stat(path$
|
|
29164
|
+
function isexe$2(path$7, options, cb) {
|
|
29165
|
+
fs$4.stat(path$7, function(er, stat) {
|
|
29151
29166
|
cb(er, er ? false : checkStat(stat, options));
|
|
29152
29167
|
});
|
|
29153
29168
|
}
|
|
29154
|
-
function sync$2(path$
|
|
29155
|
-
return checkStat(fs$4.statSync(path$
|
|
29169
|
+
function sync$2(path$7, options) {
|
|
29170
|
+
return checkStat(fs$4.statSync(path$7), options);
|
|
29156
29171
|
}
|
|
29157
29172
|
function checkStat(stat, options) {
|
|
29158
29173
|
return stat.isFile() && checkMode(stat, options);
|
|
@@ -29180,7 +29195,7 @@ var require_isexe = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/ise
|
|
|
29180
29195
|
else core = require_mode();
|
|
29181
29196
|
module.exports = isexe$1;
|
|
29182
29197
|
isexe$1.sync = sync$1;
|
|
29183
|
-
function isexe$1(path$
|
|
29198
|
+
function isexe$1(path$7, options, cb) {
|
|
29184
29199
|
if (typeof options === "function") {
|
|
29185
29200
|
cb = options;
|
|
29186
29201
|
options = {};
|
|
@@ -29188,13 +29203,13 @@ var require_isexe = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/ise
|
|
|
29188
29203
|
if (!cb) {
|
|
29189
29204
|
if (typeof Promise !== "function") throw new TypeError("callback not provided");
|
|
29190
29205
|
return new Promise(function(resolve$1, reject) {
|
|
29191
|
-
isexe$1(path$
|
|
29206
|
+
isexe$1(path$7, options || {}, function(er, is) {
|
|
29192
29207
|
if (er) reject(er);
|
|
29193
29208
|
else resolve$1(is);
|
|
29194
29209
|
});
|
|
29195
29210
|
});
|
|
29196
29211
|
}
|
|
29197
|
-
core(path$
|
|
29212
|
+
core(path$7, options || {}, function(er, is) {
|
|
29198
29213
|
if (er) {
|
|
29199
29214
|
if (er.code === "EACCES" || options && options.ignoreErrors) {
|
|
29200
29215
|
er = null;
|
|
@@ -29204,9 +29219,9 @@ var require_isexe = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/ise
|
|
|
29204
29219
|
cb(er, is);
|
|
29205
29220
|
});
|
|
29206
29221
|
}
|
|
29207
|
-
function sync$1(path$
|
|
29222
|
+
function sync$1(path$7, options) {
|
|
29208
29223
|
try {
|
|
29209
|
-
return core.sync(path$
|
|
29224
|
+
return core.sync(path$7, options || {});
|
|
29210
29225
|
} catch (er) {
|
|
29211
29226
|
if (options && options.ignoreErrors || er.code === "EACCES") return false;
|
|
29212
29227
|
else throw er;
|
|
@@ -29218,7 +29233,7 @@ var require_isexe = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/ise
|
|
|
29218
29233
|
//#region ../../node_modules/.pnpm/which@2.0.2/node_modules/which/which.js
|
|
29219
29234
|
var require_which = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/which@2.0.2/node_modules/which/which.js": ((exports, module) => {
|
|
29220
29235
|
const isWindows = process.platform === "win32" || process.env.OSTYPE === "cygwin" || process.env.OSTYPE === "msys";
|
|
29221
|
-
const path$
|
|
29236
|
+
const path$4 = __require$1("path");
|
|
29222
29237
|
const COLON = isWindows ? ";" : ":";
|
|
29223
29238
|
const isexe = require_isexe();
|
|
29224
29239
|
const getNotFoundError = (cmd) => Object.assign(/* @__PURE__ */ new Error(`not found: ${cmd}`), { code: "ENOENT" });
|
|
@@ -29248,7 +29263,7 @@ var require_which = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/whi
|
|
|
29248
29263
|
if (i$1 === pathEnv.length) return opt.all && found.length ? resolve$1(found) : reject(getNotFoundError(cmd));
|
|
29249
29264
|
const ppRaw = pathEnv[i$1];
|
|
29250
29265
|
const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
|
|
29251
|
-
const pCmd = path$
|
|
29266
|
+
const pCmd = path$4.join(pathPart, cmd);
|
|
29252
29267
|
const p = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
|
|
29253
29268
|
resolve$1(subStep(p, i$1, 0));
|
|
29254
29269
|
});
|
|
@@ -29270,7 +29285,7 @@ var require_which = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/whi
|
|
|
29270
29285
|
for (let i$1 = 0; i$1 < pathEnv.length; i$1++) {
|
|
29271
29286
|
const ppRaw = pathEnv[i$1];
|
|
29272
29287
|
const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
|
|
29273
|
-
const pCmd = path$
|
|
29288
|
+
const pCmd = path$4.join(pathPart, cmd);
|
|
29274
29289
|
const p = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
|
|
29275
29290
|
for (let j = 0; j < pathExt.length; j++) {
|
|
29276
29291
|
const cur = p + pathExt[j];
|
|
@@ -29303,7 +29318,7 @@ var require_path_key = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/
|
|
|
29303
29318
|
//#endregion
|
|
29304
29319
|
//#region ../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/resolveCommand.js
|
|
29305
29320
|
var require_resolveCommand = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/resolveCommand.js": ((exports, module) => {
|
|
29306
|
-
const path$
|
|
29321
|
+
const path$3 = __require$1("path");
|
|
29307
29322
|
const which = require_which();
|
|
29308
29323
|
const getPathKey = require_path_key();
|
|
29309
29324
|
function resolveCommandAttempt(parsed, withoutPathExt) {
|
|
@@ -29318,12 +29333,12 @@ var require_resolveCommand = /* @__PURE__ */ __commonJS$1({ "../../node_modules/
|
|
|
29318
29333
|
try {
|
|
29319
29334
|
resolved = which.sync(parsed.command, {
|
|
29320
29335
|
path: env$1[getPathKey({ env: env$1 })],
|
|
29321
|
-
pathExt: withoutPathExt ? path$
|
|
29336
|
+
pathExt: withoutPathExt ? path$3.delimiter : void 0
|
|
29322
29337
|
});
|
|
29323
29338
|
} catch (e) {} finally {
|
|
29324
29339
|
if (shouldSwitchCwd) process.chdir(cwd$1);
|
|
29325
29340
|
}
|
|
29326
|
-
if (resolved) resolved = path$
|
|
29341
|
+
if (resolved) resolved = path$3.resolve(hasCustomCwd ? parsed.options.cwd : "", resolved);
|
|
29327
29342
|
return resolved;
|
|
29328
29343
|
}
|
|
29329
29344
|
function resolveCommand$1(parsed) {
|
|
@@ -29366,8 +29381,8 @@ var require_shebang_command = /* @__PURE__ */ __commonJS$1({ "../../node_modules
|
|
|
29366
29381
|
module.exports = (string$2 = "") => {
|
|
29367
29382
|
const match = string$2.match(shebangRegex);
|
|
29368
29383
|
if (!match) return null;
|
|
29369
|
-
const [path$
|
|
29370
|
-
const binary = path$
|
|
29384
|
+
const [path$7, argument] = match[0].replace(/#! ?/, "").split(" ");
|
|
29385
|
+
const binary = path$7.split("/").pop();
|
|
29371
29386
|
if (binary === "env") return argument;
|
|
29372
29387
|
return argument ? `${binary} ${argument}` : binary;
|
|
29373
29388
|
};
|
|
@@ -29395,7 +29410,7 @@ var require_readShebang = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pn
|
|
|
29395
29410
|
//#endregion
|
|
29396
29411
|
//#region ../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/parse.js
|
|
29397
29412
|
var require_parse = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/parse.js": ((exports, module) => {
|
|
29398
|
-
const path$
|
|
29413
|
+
const path$2 = __require$1("path");
|
|
29399
29414
|
const resolveCommand = require_resolveCommand();
|
|
29400
29415
|
const escape = require_escape();
|
|
29401
29416
|
const readShebang = require_readShebang();
|
|
@@ -29418,7 +29433,7 @@ var require_parse = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/cro
|
|
|
29418
29433
|
const needsShell = !isExecutableRegExp.test(commandFile);
|
|
29419
29434
|
if (parsed.options.forceShell || needsShell) {
|
|
29420
29435
|
const needsDoubleEscapeMetaChars = isCmdShimRegExp.test(commandFile);
|
|
29421
|
-
parsed.command = path$
|
|
29436
|
+
parsed.command = path$2.normalize(parsed.command);
|
|
29422
29437
|
parsed.command = escape.command(parsed.command);
|
|
29423
29438
|
parsed.args = parsed.args.map((arg) => escape.argument(arg, needsDoubleEscapeMetaChars));
|
|
29424
29439
|
parsed.args = [
|
|
@@ -32530,12 +32545,12 @@ const logOutputSync = ({ serializedResult, fdNumber, state, verboseInfo, encodin
|
|
|
32530
32545
|
}
|
|
32531
32546
|
};
|
|
32532
32547
|
const writeToFiles = (serializedResult, stdioItems, outputFiles) => {
|
|
32533
|
-
for (const { path: path$
|
|
32534
|
-
const pathString = typeof path$
|
|
32535
|
-
if (append || outputFiles.has(pathString)) appendFileSync(path$
|
|
32548
|
+
for (const { path: path$7, append } of stdioItems.filter(({ type: type$1 }) => FILE_TYPES.has(type$1))) {
|
|
32549
|
+
const pathString = typeof path$7 === "string" ? path$7 : path$7.toString();
|
|
32550
|
+
if (append || outputFiles.has(pathString)) appendFileSync(path$7, serializedResult);
|
|
32536
32551
|
else {
|
|
32537
32552
|
outputFiles.add(pathString);
|
|
32538
|
-
writeFileSync(path$
|
|
32553
|
+
writeFileSync(path$7, serializedResult);
|
|
32539
32554
|
}
|
|
32540
32555
|
}
|
|
32541
32556
|
};
|
|
@@ -35075,9 +35090,14 @@ async function loadAgentTools({ agent, workDir, tools }) {
|
|
|
35075
35090
|
* @returns A promise that resolves to the generated PageConfig object.
|
|
35076
35091
|
*/
|
|
35077
35092
|
const genPageConfig = async (metadata) => {
|
|
35078
|
-
|
|
35093
|
+
let genContentCodeName = "";
|
|
35094
|
+
let agentModel = "";
|
|
35095
|
+
const systemPromptTemplate = [];
|
|
35079
35096
|
const { toolDeclarations } = await loadAgentTools(metadata);
|
|
35080
|
-
if (metadata) {
|
|
35097
|
+
if (metadata.agent === "coder") {
|
|
35098
|
+
genContentCodeName = (metadata.codeName || metadata.workDir.split(/[\/\\]+/).findLast((v) => !v.startsWith("."))) ?? "NoNameJob";
|
|
35099
|
+
agentModel = "gemini-2.5-pro";
|
|
35100
|
+
systemPromptTemplate.push("[JIXO:CODER2](@INJECT)");
|
|
35081
35101
|
if (metadata.dirs?.length) {
|
|
35082
35102
|
systemPromptTemplate.push("\n# Relevant Directories:\n");
|
|
35083
35103
|
metadata.dirs.forEach((dir) => systemPromptTemplate.push(`[${dir}](@FILE_TREE)`));
|
|
@@ -35088,9 +35108,10 @@ const genPageConfig = async (metadata) => {
|
|
|
35088
35108
|
}
|
|
35089
35109
|
}
|
|
35090
35110
|
const workDirResolver = createResolver(metadata.workDir);
|
|
35111
|
+
const finalSystemPrompt = systemPromptTemplate.length > 0 ? await _gen_content(genContentCodeName, systemPromptTemplate.join("\n"), workDirResolver) : "";
|
|
35091
35112
|
const finalConfig = {
|
|
35092
|
-
model:
|
|
35093
|
-
systemPrompt:
|
|
35113
|
+
model: agentModel,
|
|
35114
|
+
systemPrompt: finalSystemPrompt,
|
|
35094
35115
|
tools: toolDeclarations,
|
|
35095
35116
|
metadata
|
|
35096
35117
|
};
|
|
@@ -35154,7 +35175,7 @@ var SessionAPI = class {
|
|
|
35154
35175
|
}
|
|
35155
35176
|
async resolvePaths(paths) {
|
|
35156
35177
|
const workDir = await this.getWorkDir();
|
|
35157
|
-
return paths.map((p) =>
|
|
35178
|
+
return paths.map((p) => path10.resolve(workDir, p));
|
|
35158
35179
|
}
|
|
35159
35180
|
async globFiles(patterns) {
|
|
35160
35181
|
const workDir = await this.getWorkDir();
|
|
@@ -35268,53 +35289,79 @@ function createFunctionCallContext(sessionId) {
|
|
|
35268
35289
|
|
|
35269
35290
|
//#endregion
|
|
35270
35291
|
//#region ../dev/dist/tools/tasks.js
|
|
35271
|
-
const parseContent = async (fcs, dir, sessionId, contentFilepath
|
|
35292
|
+
const parseContent = async (fcs, dir, sessionId, contentFilepath) => {
|
|
35272
35293
|
console.log(magenta("开始处理文件"), path.relative(process.cwd(), contentFilepath));
|
|
35273
35294
|
const contents = await zContentsSchema.parse(JSON.parse(reactiveFs.readFile(contentFilepath)));
|
|
35274
|
-
const
|
|
35275
|
-
|
|
35276
|
-
|
|
35277
|
-
|
|
35278
|
-
|
|
35279
|
-
|
|
35280
|
-
|
|
35281
|
-
|
|
35282
|
-
|
|
35283
|
-
|
|
35284
|
-
|
|
35285
|
-
|
|
35286
|
-
|
|
35287
|
-
|
|
35288
|
-
|
|
35289
|
-
|
|
35290
|
-
|
|
35291
|
-
|
|
35292
|
-
|
|
35293
|
-
|
|
35294
|
-
|
|
35295
|
-
|
|
35296
|
-
const
|
|
35297
|
-
|
|
35298
|
-
|
|
35299
|
-
|
|
35300
|
-
|
|
35301
|
-
|
|
35302
|
-
|
|
35303
|
-
|
|
35304
|
-
|
|
35305
|
-
|
|
35306
|
-
|
|
35307
|
-
|
|
35308
|
-
|
|
35309
|
-
|
|
35310
|
-
|
|
35311
|
-
|
|
35312
|
-
|
|
35313
|
-
|
|
35314
|
-
|
|
35315
|
-
|
|
35295
|
+
const taskFilenames = reactiveFs.readDirByGlob(dir, "*.function_call.json").filter((fn) => fn.startsWith(`${sessionId}.`));
|
|
35296
|
+
const rmFiles = /* @__PURE__ */ new Map();
|
|
35297
|
+
const rmFile = (filename) => {
|
|
35298
|
+
map_get_or_put_async(rmFiles, filename, (filename$1) => {
|
|
35299
|
+
return fs.promises.rm(path.join(dir, filename$1)).then(() => true, () => false);
|
|
35300
|
+
});
|
|
35301
|
+
};
|
|
35302
|
+
try {
|
|
35303
|
+
for (const existTaskFilename of taskFilenames) {
|
|
35304
|
+
const [_sessionId, _toolName, modelIndex$1, contentHash] = existTaskFilename.split(".");
|
|
35305
|
+
const modelContent$1 = contents[+modelIndex$1];
|
|
35306
|
+
const isMatch = () => {
|
|
35307
|
+
if (modelContent$1.role !== "model") return false;
|
|
35308
|
+
if (createHash("sha256").update(`INDEX:${modelIndex$1}`).update(JSON.stringify(modelContent$1)).digest("hex").slice(0, 8) !== contentHash) return false;
|
|
35309
|
+
return true;
|
|
35310
|
+
};
|
|
35311
|
+
if (!isMatch()) rmFile(existTaskFilename);
|
|
35312
|
+
}
|
|
35313
|
+
const latestUserContent = contents.findLast((c$2) => {
|
|
35314
|
+
return c$2.role === "user" && c$2.parts.some((p) => "functionResponse" in p);
|
|
35315
|
+
});
|
|
35316
|
+
if (!latestUserContent) return;
|
|
35317
|
+
const modelContent = contents.slice(0, contents.lastIndexOf(latestUserContent)).findLast((content) => {
|
|
35318
|
+
return content.role === "model" && content.parts.some((p) => "functionCall" in p);
|
|
35319
|
+
});
|
|
35320
|
+
if (!modelContent) return;
|
|
35321
|
+
const functionCallPart = modelContent.parts.find((p) => "functionCall" in p)?.["functionCall"];
|
|
35322
|
+
if (!functionCallPart) return;
|
|
35323
|
+
const modelIndex = contents.indexOf(modelContent);
|
|
35324
|
+
if (modelIndex === -1) return;
|
|
35325
|
+
for (const existTaskFilename of taskFilenames) {
|
|
35326
|
+
const [_sessionId, _toolName, existModelIndex] = existTaskFilename.split(".");
|
|
35327
|
+
if (+existModelIndex < modelIndex) rmFile(existTaskFilename);
|
|
35328
|
+
}
|
|
35329
|
+
const functionResponsePart = latestUserContent.parts.find((p) => "functionResponse" in p);
|
|
35330
|
+
if (!functionResponsePart || functionResponsePart.functionResponse.response !== "") return;
|
|
35331
|
+
const hash = createHash("sha256").update(`INDEX:${modelIndex}`).update(JSON.stringify(modelContent)).digest("hex").slice(0, 8);
|
|
35332
|
+
const taskFilename = `${sessionId}.${functionCallPart.name}.${modelIndex}.${hash}.function_call.json`;
|
|
35333
|
+
if (taskFilenames.includes(taskFilename)) return;
|
|
35334
|
+
console.log(blue("收到 functionCallPart 任务请求"), functionCallPart);
|
|
35335
|
+
const fc = fcs.get(functionCallPart.name);
|
|
35336
|
+
if (!fc) {
|
|
35337
|
+
console.warn("找不到任务处理工具");
|
|
35316
35338
|
return false;
|
|
35339
|
+
} else {
|
|
35340
|
+
const { functionCall: functionCall$11 } = fc.module;
|
|
35341
|
+
const input = JSON.parse(functionCallPart.parameters);
|
|
35342
|
+
try {
|
|
35343
|
+
console.log(cyan("开始执行任务"));
|
|
35344
|
+
const context = createFunctionCallContext(sessionId);
|
|
35345
|
+
const output = await functionCall$11(input, context);
|
|
35346
|
+
console.log(green("生成任务结果:"), taskFilename);
|
|
35347
|
+
fs.writeFileSync(path.join(dir, taskFilename), JSON.stringify({
|
|
35348
|
+
...functionCallPart,
|
|
35349
|
+
input,
|
|
35350
|
+
output
|
|
35351
|
+
}, null, 2));
|
|
35352
|
+
return true;
|
|
35353
|
+
} catch (e) {
|
|
35354
|
+
console.log(red("任务执行失败:"), e);
|
|
35355
|
+
fs.writeFileSync(path.join(dir, taskFilename), JSON.stringify({
|
|
35356
|
+
...functionCallPart,
|
|
35357
|
+
input,
|
|
35358
|
+
output: { error: e instanceof Error ? e.message : String(e) }
|
|
35359
|
+
}, null, 2));
|
|
35360
|
+
return false;
|
|
35361
|
+
}
|
|
35317
35362
|
}
|
|
35363
|
+
} finally {
|
|
35364
|
+
await Promise.all([...rmFiles.values()]);
|
|
35318
35365
|
}
|
|
35319
35366
|
};
|
|
35320
35367
|
const _cache = /* @__PURE__ */ new Map();
|
|
@@ -35344,7 +35391,7 @@ const googleAiStudioAutomation = async ({ dir = process.cwd() }) => {
|
|
|
35344
35391
|
const { tools: tools$1 } = await loadAgentTools(metadata);
|
|
35345
35392
|
return tools$1;
|
|
35346
35393
|
});
|
|
35347
|
-
await parseContent(tools, dir, basename$1, contentFilepath
|
|
35394
|
+
await parseContent(tools, dir, basename$1, contentFilepath).catch(console.error);
|
|
35348
35395
|
} catch (e) {
|
|
35349
35396
|
console.error(red(e instanceof Error ? e.stack ?? e.message : String(e)));
|
|
35350
35397
|
}
|
|
@@ -35395,7 +35442,7 @@ var require_constants = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm
|
|
|
35395
35442
|
//#region ../../node_modules/.pnpm/node-gyp-build@4.8.4/node_modules/node-gyp-build/node-gyp-build.js
|
|
35396
35443
|
var require_node_gyp_build$1 = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/node-gyp-build@4.8.4/node_modules/node-gyp-build/node-gyp-build.js": ((exports, module) => {
|
|
35397
35444
|
var fs$2 = __require$1("fs");
|
|
35398
|
-
var path$
|
|
35445
|
+
var path$1 = __require$1("path");
|
|
35399
35446
|
var os = __require$1("os");
|
|
35400
35447
|
var runtimeRequire$1 = typeof __webpack_require__ === "function" ? __non_webpack_require__ : __require$1;
|
|
35401
35448
|
var vars = process.config && process.config.variables || {};
|
|
@@ -35412,20 +35459,20 @@ var require_node_gyp_build$1 = /* @__PURE__ */ __commonJS$1({ "../../node_module
|
|
|
35412
35459
|
return runtimeRequire$1(load.resolve(dir));
|
|
35413
35460
|
}
|
|
35414
35461
|
load.resolve = load.path = function(dir) {
|
|
35415
|
-
dir = path$
|
|
35462
|
+
dir = path$1.resolve(dir || ".");
|
|
35416
35463
|
try {
|
|
35417
|
-
var name$12 = runtimeRequire$1(path$
|
|
35464
|
+
var name$12 = runtimeRequire$1(path$1.join(dir, "package.json")).name.toUpperCase().replace(/-/g, "_");
|
|
35418
35465
|
if (process.env[name$12 + "_PREBUILD"]) dir = process.env[name$12 + "_PREBUILD"];
|
|
35419
35466
|
} catch (err) {}
|
|
35420
35467
|
if (!prebuildsOnly) {
|
|
35421
|
-
var release = getFirst(path$
|
|
35468
|
+
var release = getFirst(path$1.join(dir, "build/Release"), matchBuild);
|
|
35422
35469
|
if (release) return release;
|
|
35423
|
-
var debug$5 = getFirst(path$
|
|
35470
|
+
var debug$5 = getFirst(path$1.join(dir, "build/Debug"), matchBuild);
|
|
35424
35471
|
if (debug$5) return debug$5;
|
|
35425
35472
|
}
|
|
35426
35473
|
var prebuild = resolve$1(dir);
|
|
35427
35474
|
if (prebuild) return prebuild;
|
|
35428
|
-
var nearby = resolve$1(path$
|
|
35475
|
+
var nearby = resolve$1(path$1.dirname(process.execPath));
|
|
35429
35476
|
if (nearby) return nearby;
|
|
35430
35477
|
var target = [
|
|
35431
35478
|
"platform=" + platform$1,
|
|
@@ -35441,11 +35488,11 @@ var require_node_gyp_build$1 = /* @__PURE__ */ __commonJS$1({ "../../node_module
|
|
|
35441
35488
|
].filter(Boolean).join(" ");
|
|
35442
35489
|
throw new Error("No native build was found for " + target + "\n loaded from: " + dir + "\n");
|
|
35443
35490
|
function resolve$1(dir$1) {
|
|
35444
|
-
var tuple = readdirSync$2(path$
|
|
35491
|
+
var tuple = readdirSync$2(path$1.join(dir$1, "prebuilds")).map(parseTuple).filter(matchTuple(platform$1, arch)).sort(compareTuples)[0];
|
|
35445
35492
|
if (!tuple) return;
|
|
35446
|
-
var prebuilds = path$
|
|
35493
|
+
var prebuilds = path$1.join(dir$1, "prebuilds", tuple.name);
|
|
35447
35494
|
var winner = readdirSync$2(prebuilds).map(parseTags).filter(matchTags(runtime, abi)).sort(compareTags(runtime))[0];
|
|
35448
|
-
if (winner) return path$
|
|
35495
|
+
if (winner) return path$1.join(prebuilds, winner.file);
|
|
35449
35496
|
}
|
|
35450
35497
|
};
|
|
35451
35498
|
function readdirSync$2(dir) {
|
|
@@ -35457,7 +35504,7 @@ var require_node_gyp_build$1 = /* @__PURE__ */ __commonJS$1({ "../../node_module
|
|
|
35457
35504
|
}
|
|
35458
35505
|
function getFirst(dir, filter$1) {
|
|
35459
35506
|
var files$1 = readdirSync$2(dir).filter(filter$1);
|
|
35460
|
-
return files$1[0] && path$
|
|
35507
|
+
return files$1[0] && path$1.join(dir, files$1[0]);
|
|
35461
35508
|
}
|
|
35462
35509
|
function matchBuild(name$12) {
|
|
35463
35510
|
return /\.node$/.test(name$12);
|
|
@@ -39300,12 +39347,9 @@ const initSessionByHttp = (req, res) => {
|
|
|
39300
39347
|
session.api.setWorkDir(workDir);
|
|
39301
39348
|
return res.writeHead(200).end();
|
|
39302
39349
|
};
|
|
39303
|
-
const initSession = (nid, workDir) => {
|
|
39304
|
-
const
|
|
39305
|
-
if (!
|
|
39306
|
-
const session = sessionWsMap.get(sessionId);
|
|
39307
|
-
if (!session) throw new Error("Session not found");
|
|
39308
|
-
session.api.setWorkDir(workDir);
|
|
39350
|
+
const initSession = async (nid, workDir) => {
|
|
39351
|
+
const res = await fetch(`http://localhost:8765/init-session?nid=${nid}&workDir=${encodeURIComponent(workDir)}`);
|
|
39352
|
+
if (!res.ok) throw new Error(await res.text());
|
|
39309
39353
|
};
|
|
39310
39354
|
const getSessionByNid = (nid) => {
|
|
39311
39355
|
if (nid == null) return;
|
|
@@ -39462,7 +39506,7 @@ const initCommand = {
|
|
|
39462
39506
|
}),
|
|
39463
39507
|
handler: async (argv) => {
|
|
39464
39508
|
try {
|
|
39465
|
-
initSession(argv.nid, argv.dir
|
|
39509
|
+
initSession(argv.nid, argv.dir ? path.resolve(process.cwd(), argv.dir) : process.cwd());
|
|
39466
39510
|
} catch (e) {
|
|
39467
39511
|
console.error(red(e instanceof Error ? e.message : String(e)));
|
|
39468
39512
|
}
|