@chosengeneration/light-code 0.171.0 → 0.172.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/dist/cli.cjs +623 -506
- package/dist/server.cjs +581 -464
- package/package.json +1 -1
package/dist/server.cjs
CHANGED
|
@@ -494,14 +494,14 @@ var require_util = __commonJS({
|
|
|
494
494
|
}
|
|
495
495
|
const port = url2.port != null ? url2.port : url2.protocol === "https:" ? 443 : 80;
|
|
496
496
|
let origin = url2.origin != null ? url2.origin : `${url2.protocol}//${url2.hostname}:${port}`;
|
|
497
|
-
let
|
|
497
|
+
let path64 = url2.path != null ? url2.path : `${url2.pathname || ""}${url2.search || ""}`;
|
|
498
498
|
if (origin.endsWith("/")) {
|
|
499
499
|
origin = origin.substring(0, origin.length - 1);
|
|
500
500
|
}
|
|
501
|
-
if (
|
|
502
|
-
|
|
501
|
+
if (path64 && !path64.startsWith("/")) {
|
|
502
|
+
path64 = `/${path64}`;
|
|
503
503
|
}
|
|
504
|
-
url2 = new URL(origin +
|
|
504
|
+
url2 = new URL(origin + path64);
|
|
505
505
|
}
|
|
506
506
|
return url2;
|
|
507
507
|
}
|
|
@@ -2115,20 +2115,20 @@ var require_parseParams = __commonJS({
|
|
|
2115
2115
|
var require_basename = __commonJS({
|
|
2116
2116
|
"../../node_modules/.pnpm/@fastify+busboy@2.1.1/node_modules/@fastify/busboy/lib/utils/basename.js"(exports2, module2) {
|
|
2117
2117
|
"use strict";
|
|
2118
|
-
module2.exports = function basename(
|
|
2119
|
-
if (typeof
|
|
2118
|
+
module2.exports = function basename(path64) {
|
|
2119
|
+
if (typeof path64 !== "string") {
|
|
2120
2120
|
return "";
|
|
2121
2121
|
}
|
|
2122
|
-
for (var i =
|
|
2123
|
-
switch (
|
|
2122
|
+
for (var i = path64.length - 1; i >= 0; --i) {
|
|
2123
|
+
switch (path64.charCodeAt(i)) {
|
|
2124
2124
|
case 47:
|
|
2125
2125
|
// '/'
|
|
2126
2126
|
case 92:
|
|
2127
|
-
|
|
2128
|
-
return
|
|
2127
|
+
path64 = path64.slice(i + 1);
|
|
2128
|
+
return path64 === ".." || path64 === "." ? "" : path64;
|
|
2129
2129
|
}
|
|
2130
2130
|
}
|
|
2131
|
-
return
|
|
2131
|
+
return path64 === ".." || path64 === "." ? "" : path64;
|
|
2132
2132
|
};
|
|
2133
2133
|
}
|
|
2134
2134
|
});
|
|
@@ -5158,7 +5158,7 @@ var require_request = __commonJS({
|
|
|
5158
5158
|
}
|
|
5159
5159
|
var Request = class _Request {
|
|
5160
5160
|
constructor(origin, {
|
|
5161
|
-
path:
|
|
5161
|
+
path: path64,
|
|
5162
5162
|
method,
|
|
5163
5163
|
body,
|
|
5164
5164
|
headers,
|
|
@@ -5172,11 +5172,11 @@ var require_request = __commonJS({
|
|
|
5172
5172
|
throwOnError,
|
|
5173
5173
|
expectContinue
|
|
5174
5174
|
}, handler) {
|
|
5175
|
-
if (typeof
|
|
5175
|
+
if (typeof path64 !== "string") {
|
|
5176
5176
|
throw new InvalidArgumentError("path must be a string");
|
|
5177
|
-
} else if (
|
|
5177
|
+
} else if (path64[0] !== "/" && !(path64.startsWith("http://") || path64.startsWith("https://")) && method !== "CONNECT") {
|
|
5178
5178
|
throw new InvalidArgumentError("path must be an absolute URL or start with a slash");
|
|
5179
|
-
} else if (invalidPathRegex.exec(
|
|
5179
|
+
} else if (invalidPathRegex.exec(path64) !== null) {
|
|
5180
5180
|
throw new InvalidArgumentError("invalid request path");
|
|
5181
5181
|
}
|
|
5182
5182
|
if (typeof method !== "string") {
|
|
@@ -5239,7 +5239,7 @@ var require_request = __commonJS({
|
|
|
5239
5239
|
this.completed = false;
|
|
5240
5240
|
this.aborted = false;
|
|
5241
5241
|
this.upgrade = upgrade || null;
|
|
5242
|
-
this.path = query ? util.buildURL(
|
|
5242
|
+
this.path = query ? util.buildURL(path64, query) : path64;
|
|
5243
5243
|
this.origin = origin;
|
|
5244
5244
|
this.idempotent = idempotent == null ? method === "HEAD" || method === "GET" : idempotent;
|
|
5245
5245
|
this.blocking = blocking == null ? false : blocking;
|
|
@@ -6247,9 +6247,9 @@ var require_RedirectHandler = __commonJS({
|
|
|
6247
6247
|
return this.handler.onHeaders(statusCode, headers, resume, statusText);
|
|
6248
6248
|
}
|
|
6249
6249
|
const { origin, pathname, search } = util.parseURL(new URL(this.location, this.opts.origin && new URL(this.opts.path, this.opts.origin)));
|
|
6250
|
-
const
|
|
6250
|
+
const path64 = search ? `${pathname}${search}` : pathname;
|
|
6251
6251
|
this.opts.headers = cleanRequestHeaders(this.opts.headers, statusCode === 303, this.opts.origin !== origin);
|
|
6252
|
-
this.opts.path =
|
|
6252
|
+
this.opts.path = path64;
|
|
6253
6253
|
this.opts.origin = origin;
|
|
6254
6254
|
this.opts.maxRedirections = 0;
|
|
6255
6255
|
this.opts.query = null;
|
|
@@ -7489,7 +7489,7 @@ var require_client = __commonJS({
|
|
|
7489
7489
|
writeH2(client, client[kHTTP2Session], request);
|
|
7490
7490
|
return;
|
|
7491
7491
|
}
|
|
7492
|
-
const { body, method, path:
|
|
7492
|
+
const { body, method, path: path64, host, upgrade, headers, blocking, reset } = request;
|
|
7493
7493
|
const expectsPayload = method === "PUT" || method === "POST" || method === "PATCH";
|
|
7494
7494
|
if (body && typeof body.read === "function") {
|
|
7495
7495
|
body.read(0);
|
|
@@ -7539,7 +7539,7 @@ var require_client = __commonJS({
|
|
|
7539
7539
|
if (blocking) {
|
|
7540
7540
|
socket[kBlocking] = true;
|
|
7541
7541
|
}
|
|
7542
|
-
let header2 = `${method} ${
|
|
7542
|
+
let header2 = `${method} ${path64} HTTP/1.1\r
|
|
7543
7543
|
`;
|
|
7544
7544
|
if (typeof host === "string") {
|
|
7545
7545
|
header2 += `host: ${host}\r
|
|
@@ -7602,7 +7602,7 @@ upgrade: ${upgrade}\r
|
|
|
7602
7602
|
return true;
|
|
7603
7603
|
}
|
|
7604
7604
|
function writeH2(client, session, request) {
|
|
7605
|
-
const { body, method, path:
|
|
7605
|
+
const { body, method, path: path64, host, upgrade, expectContinue, signal, headers: reqHeaders } = request;
|
|
7606
7606
|
let headers;
|
|
7607
7607
|
if (typeof reqHeaders === "string") headers = Request[kHTTP2CopyHeaders](reqHeaders.trim());
|
|
7608
7608
|
else headers = reqHeaders;
|
|
@@ -7645,7 +7645,7 @@ upgrade: ${upgrade}\r
|
|
|
7645
7645
|
});
|
|
7646
7646
|
return true;
|
|
7647
7647
|
}
|
|
7648
|
-
headers[HTTP2_HEADER_PATH] =
|
|
7648
|
+
headers[HTTP2_HEADER_PATH] = path64;
|
|
7649
7649
|
headers[HTTP2_HEADER_SCHEME] = "https";
|
|
7650
7650
|
const expectsPayload = method === "PUT" || method === "POST" || method === "PATCH";
|
|
7651
7651
|
if (body && typeof body.read === "function") {
|
|
@@ -9885,20 +9885,20 @@ var require_mock_utils = __commonJS({
|
|
|
9885
9885
|
}
|
|
9886
9886
|
return true;
|
|
9887
9887
|
}
|
|
9888
|
-
function safeUrl(
|
|
9889
|
-
if (typeof
|
|
9890
|
-
return
|
|
9888
|
+
function safeUrl(path64) {
|
|
9889
|
+
if (typeof path64 !== "string") {
|
|
9890
|
+
return path64;
|
|
9891
9891
|
}
|
|
9892
|
-
const pathSegments =
|
|
9892
|
+
const pathSegments = path64.split("?");
|
|
9893
9893
|
if (pathSegments.length !== 2) {
|
|
9894
|
-
return
|
|
9894
|
+
return path64;
|
|
9895
9895
|
}
|
|
9896
9896
|
const qp = new URLSearchParams(pathSegments.pop());
|
|
9897
9897
|
qp.sort();
|
|
9898
9898
|
return [...pathSegments, qp.toString()].join("?");
|
|
9899
9899
|
}
|
|
9900
|
-
function matchKey(mockDispatch2, { path:
|
|
9901
|
-
const pathMatch = matchValue(mockDispatch2.path,
|
|
9900
|
+
function matchKey(mockDispatch2, { path: path64, method, body, headers }) {
|
|
9901
|
+
const pathMatch = matchValue(mockDispatch2.path, path64);
|
|
9902
9902
|
const methodMatch = matchValue(mockDispatch2.method, method);
|
|
9903
9903
|
const bodyMatch = typeof mockDispatch2.body !== "undefined" ? matchValue(mockDispatch2.body, body) : true;
|
|
9904
9904
|
const headersMatch = matchHeaders(mockDispatch2, headers);
|
|
@@ -9916,7 +9916,7 @@ var require_mock_utils = __commonJS({
|
|
|
9916
9916
|
function getMockDispatch(mockDispatches, key3) {
|
|
9917
9917
|
const basePath = key3.query ? buildURL(key3.path, key3.query) : key3.path;
|
|
9918
9918
|
const resolvedPath = typeof basePath === "string" ? safeUrl(basePath) : basePath;
|
|
9919
|
-
let matchedMockDispatches = mockDispatches.filter(({ consumed }) => !consumed).filter(({ path:
|
|
9919
|
+
let matchedMockDispatches = mockDispatches.filter(({ consumed }) => !consumed).filter(({ path: path64 }) => matchValue(safeUrl(path64), resolvedPath));
|
|
9920
9920
|
if (matchedMockDispatches.length === 0) {
|
|
9921
9921
|
throw new MockNotMatchedError(`Mock dispatch not matched for path '${resolvedPath}'`);
|
|
9922
9922
|
}
|
|
@@ -9953,9 +9953,9 @@ var require_mock_utils = __commonJS({
|
|
|
9953
9953
|
}
|
|
9954
9954
|
}
|
|
9955
9955
|
function buildKey(opts) {
|
|
9956
|
-
const { path:
|
|
9956
|
+
const { path: path64, method, body, headers, query } = opts;
|
|
9957
9957
|
return {
|
|
9958
|
-
path:
|
|
9958
|
+
path: path64,
|
|
9959
9959
|
method,
|
|
9960
9960
|
body,
|
|
9961
9961
|
headers,
|
|
@@ -10404,10 +10404,10 @@ var require_pending_interceptors_formatter = __commonJS({
|
|
|
10404
10404
|
}
|
|
10405
10405
|
format(pendingInterceptors) {
|
|
10406
10406
|
const withPrettyHeaders = pendingInterceptors.map(
|
|
10407
|
-
({ method, path:
|
|
10407
|
+
({ method, path: path64, data: { statusCode }, persist, times, timesInvoked, origin }) => ({
|
|
10408
10408
|
Method: method,
|
|
10409
10409
|
Origin: origin,
|
|
10410
|
-
Path:
|
|
10410
|
+
Path: path64,
|
|
10411
10411
|
"Status code": statusCode,
|
|
10412
10412
|
Persistent: persist ? "\u2705" : "\u274C",
|
|
10413
10413
|
Invocations: timesInvoked,
|
|
@@ -15027,8 +15027,8 @@ var require_util6 = __commonJS({
|
|
|
15027
15027
|
}
|
|
15028
15028
|
}
|
|
15029
15029
|
}
|
|
15030
|
-
function validateCookiePath(
|
|
15031
|
-
for (const char of
|
|
15030
|
+
function validateCookiePath(path64) {
|
|
15031
|
+
for (const char of path64) {
|
|
15032
15032
|
const code = char.charCodeAt(0);
|
|
15033
15033
|
if (code < 33 || char === ";") {
|
|
15034
15034
|
throw new Error("Invalid cookie path");
|
|
@@ -16708,11 +16708,11 @@ var require_undici = __commonJS({
|
|
|
16708
16708
|
if (typeof opts.path !== "string") {
|
|
16709
16709
|
throw new InvalidArgumentError("invalid opts.path");
|
|
16710
16710
|
}
|
|
16711
|
-
let
|
|
16711
|
+
let path64 = opts.path;
|
|
16712
16712
|
if (!opts.path.startsWith("/")) {
|
|
16713
|
-
|
|
16713
|
+
path64 = `/${path64}`;
|
|
16714
16714
|
}
|
|
16715
|
-
url2 = new URL(util.parseOrigin(url2).origin +
|
|
16715
|
+
url2 = new URL(util.parseOrigin(url2).origin + path64);
|
|
16716
16716
|
} else {
|
|
16717
16717
|
if (!opts) {
|
|
16718
16718
|
opts = typeof url2 === "object" ? url2 : {};
|
|
@@ -19983,8 +19983,8 @@ var require_utils2 = __commonJS({
|
|
|
19983
19983
|
}
|
|
19984
19984
|
return ind;
|
|
19985
19985
|
}
|
|
19986
|
-
function removeDotSegments(
|
|
19987
|
-
let input =
|
|
19986
|
+
function removeDotSegments(path64) {
|
|
19987
|
+
let input = path64;
|
|
19988
19988
|
const output = [];
|
|
19989
19989
|
let nextSlash = -1;
|
|
19990
19990
|
let len = 0;
|
|
@@ -20236,8 +20236,8 @@ var require_schemes = __commonJS({
|
|
|
20236
20236
|
wsComponent.secure = void 0;
|
|
20237
20237
|
}
|
|
20238
20238
|
if (wsComponent.resourceName) {
|
|
20239
|
-
const [
|
|
20240
|
-
wsComponent.path =
|
|
20239
|
+
const [path64, query] = wsComponent.resourceName.split("?");
|
|
20240
|
+
wsComponent.path = path64 && path64 !== "/" ? path64 : void 0;
|
|
20241
20241
|
wsComponent.query = query;
|
|
20242
20242
|
wsComponent.resourceName = void 0;
|
|
20243
20243
|
}
|
|
@@ -23655,7 +23655,7 @@ var require_windows = __commonJS({
|
|
|
23655
23655
|
module2.exports = isexe;
|
|
23656
23656
|
isexe.sync = sync;
|
|
23657
23657
|
var fs43 = require("fs");
|
|
23658
|
-
function checkPathExt(
|
|
23658
|
+
function checkPathExt(path64, options) {
|
|
23659
23659
|
var pathext = options.pathExt !== void 0 ? options.pathExt : process.env.PATHEXT;
|
|
23660
23660
|
if (!pathext) {
|
|
23661
23661
|
return true;
|
|
@@ -23666,25 +23666,25 @@ var require_windows = __commonJS({
|
|
|
23666
23666
|
}
|
|
23667
23667
|
for (var i = 0; i < pathext.length; i++) {
|
|
23668
23668
|
var p = pathext[i].toLowerCase();
|
|
23669
|
-
if (p &&
|
|
23669
|
+
if (p && path64.substr(-p.length).toLowerCase() === p) {
|
|
23670
23670
|
return true;
|
|
23671
23671
|
}
|
|
23672
23672
|
}
|
|
23673
23673
|
return false;
|
|
23674
23674
|
}
|
|
23675
|
-
function checkStat(stat,
|
|
23675
|
+
function checkStat(stat, path64, options) {
|
|
23676
23676
|
if (!stat.isSymbolicLink() && !stat.isFile()) {
|
|
23677
23677
|
return false;
|
|
23678
23678
|
}
|
|
23679
|
-
return checkPathExt(
|
|
23679
|
+
return checkPathExt(path64, options);
|
|
23680
23680
|
}
|
|
23681
|
-
function isexe(
|
|
23682
|
-
fs43.stat(
|
|
23683
|
-
cb(er, er ? false : checkStat(stat,
|
|
23681
|
+
function isexe(path64, options, cb) {
|
|
23682
|
+
fs43.stat(path64, function(er, stat) {
|
|
23683
|
+
cb(er, er ? false : checkStat(stat, path64, options));
|
|
23684
23684
|
});
|
|
23685
23685
|
}
|
|
23686
|
-
function sync(
|
|
23687
|
-
return checkStat(fs43.statSync(
|
|
23686
|
+
function sync(path64, options) {
|
|
23687
|
+
return checkStat(fs43.statSync(path64), path64, options);
|
|
23688
23688
|
}
|
|
23689
23689
|
}
|
|
23690
23690
|
});
|
|
@@ -23695,13 +23695,13 @@ var require_mode = __commonJS({
|
|
|
23695
23695
|
module2.exports = isexe;
|
|
23696
23696
|
isexe.sync = sync;
|
|
23697
23697
|
var fs43 = require("fs");
|
|
23698
|
-
function isexe(
|
|
23699
|
-
fs43.stat(
|
|
23698
|
+
function isexe(path64, options, cb) {
|
|
23699
|
+
fs43.stat(path64, function(er, stat) {
|
|
23700
23700
|
cb(er, er ? false : checkStat(stat, options));
|
|
23701
23701
|
});
|
|
23702
23702
|
}
|
|
23703
|
-
function sync(
|
|
23704
|
-
return checkStat(fs43.statSync(
|
|
23703
|
+
function sync(path64, options) {
|
|
23704
|
+
return checkStat(fs43.statSync(path64), options);
|
|
23705
23705
|
}
|
|
23706
23706
|
function checkStat(stat, options) {
|
|
23707
23707
|
return stat.isFile() && checkMode(stat, options);
|
|
@@ -23734,7 +23734,7 @@ var require_isexe = __commonJS({
|
|
|
23734
23734
|
}
|
|
23735
23735
|
module2.exports = isexe;
|
|
23736
23736
|
isexe.sync = sync;
|
|
23737
|
-
function isexe(
|
|
23737
|
+
function isexe(path64, options, cb) {
|
|
23738
23738
|
if (typeof options === "function") {
|
|
23739
23739
|
cb = options;
|
|
23740
23740
|
options = {};
|
|
@@ -23744,7 +23744,7 @@ var require_isexe = __commonJS({
|
|
|
23744
23744
|
throw new TypeError("callback not provided");
|
|
23745
23745
|
}
|
|
23746
23746
|
return new Promise(function(resolve, reject2) {
|
|
23747
|
-
isexe(
|
|
23747
|
+
isexe(path64, options || {}, function(er, is) {
|
|
23748
23748
|
if (er) {
|
|
23749
23749
|
reject2(er);
|
|
23750
23750
|
} else {
|
|
@@ -23753,7 +23753,7 @@ var require_isexe = __commonJS({
|
|
|
23753
23753
|
});
|
|
23754
23754
|
});
|
|
23755
23755
|
}
|
|
23756
|
-
core(
|
|
23756
|
+
core(path64, options || {}, function(er, is) {
|
|
23757
23757
|
if (er) {
|
|
23758
23758
|
if (er.code === "EACCES" || options && options.ignoreErrors) {
|
|
23759
23759
|
er = null;
|
|
@@ -23763,9 +23763,9 @@ var require_isexe = __commonJS({
|
|
|
23763
23763
|
cb(er, is);
|
|
23764
23764
|
});
|
|
23765
23765
|
}
|
|
23766
|
-
function sync(
|
|
23766
|
+
function sync(path64, options) {
|
|
23767
23767
|
try {
|
|
23768
|
-
return core.sync(
|
|
23768
|
+
return core.sync(path64, options || {});
|
|
23769
23769
|
} catch (er) {
|
|
23770
23770
|
if (options && options.ignoreErrors || er.code === "EACCES") {
|
|
23771
23771
|
return false;
|
|
@@ -23781,7 +23781,7 @@ var require_isexe = __commonJS({
|
|
|
23781
23781
|
var require_which = __commonJS({
|
|
23782
23782
|
"../../node_modules/.pnpm/which@2.0.2/node_modules/which/which.js"(exports2, module2) {
|
|
23783
23783
|
var isWindows = process.platform === "win32" || process.env.OSTYPE === "cygwin" || process.env.OSTYPE === "msys";
|
|
23784
|
-
var
|
|
23784
|
+
var path64 = require("path");
|
|
23785
23785
|
var COLON = isWindows ? ";" : ":";
|
|
23786
23786
|
var isexe = require_isexe();
|
|
23787
23787
|
var getNotFoundError = (cmd) => Object.assign(new Error(`not found: ${cmd}`), { code: "ENOENT" });
|
|
@@ -23819,7 +23819,7 @@ var require_which = __commonJS({
|
|
|
23819
23819
|
return opt.all && found2.length ? resolve(found2) : reject2(getNotFoundError(cmd));
|
|
23820
23820
|
const ppRaw = pathEnv[i];
|
|
23821
23821
|
const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
|
|
23822
|
-
const pCmd =
|
|
23822
|
+
const pCmd = path64.join(pathPart, cmd);
|
|
23823
23823
|
const p = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
|
|
23824
23824
|
resolve(subStep(p, i, 0));
|
|
23825
23825
|
});
|
|
@@ -23846,7 +23846,7 @@ var require_which = __commonJS({
|
|
|
23846
23846
|
for (let i = 0; i < pathEnv.length; i++) {
|
|
23847
23847
|
const ppRaw = pathEnv[i];
|
|
23848
23848
|
const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
|
|
23849
|
-
const pCmd =
|
|
23849
|
+
const pCmd = path64.join(pathPart, cmd);
|
|
23850
23850
|
const p = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
|
|
23851
23851
|
for (let j = 0; j < pathExt.length; j++) {
|
|
23852
23852
|
const cur = p + pathExt[j];
|
|
@@ -23894,7 +23894,7 @@ var require_path_key = __commonJS({
|
|
|
23894
23894
|
var require_resolveCommand = __commonJS({
|
|
23895
23895
|
"../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/resolveCommand.js"(exports2, module2) {
|
|
23896
23896
|
"use strict";
|
|
23897
|
-
var
|
|
23897
|
+
var path64 = require("path");
|
|
23898
23898
|
var which = require_which();
|
|
23899
23899
|
var getPathKey = require_path_key();
|
|
23900
23900
|
function resolveCommandAttempt(parsed, withoutPathExt) {
|
|
@@ -23912,7 +23912,7 @@ var require_resolveCommand = __commonJS({
|
|
|
23912
23912
|
try {
|
|
23913
23913
|
resolved = which.sync(parsed.command, {
|
|
23914
23914
|
path: env2[getPathKey({ env: env2 })],
|
|
23915
|
-
pathExt: withoutPathExt ?
|
|
23915
|
+
pathExt: withoutPathExt ? path64.delimiter : void 0
|
|
23916
23916
|
});
|
|
23917
23917
|
} catch (e) {
|
|
23918
23918
|
} finally {
|
|
@@ -23921,7 +23921,7 @@ var require_resolveCommand = __commonJS({
|
|
|
23921
23921
|
}
|
|
23922
23922
|
}
|
|
23923
23923
|
if (resolved) {
|
|
23924
|
-
resolved =
|
|
23924
|
+
resolved = path64.resolve(hasCustomCwd ? parsed.options.cwd : "", resolved);
|
|
23925
23925
|
}
|
|
23926
23926
|
return resolved;
|
|
23927
23927
|
}
|
|
@@ -23975,8 +23975,8 @@ var require_shebang_command = __commonJS({
|
|
|
23975
23975
|
if (!match) {
|
|
23976
23976
|
return null;
|
|
23977
23977
|
}
|
|
23978
|
-
const [
|
|
23979
|
-
const binary =
|
|
23978
|
+
const [path64, argument] = match[0].replace(/#! ?/, "").split(" ");
|
|
23979
|
+
const binary = path64.split("/").pop();
|
|
23980
23980
|
if (binary === "env") {
|
|
23981
23981
|
return argument;
|
|
23982
23982
|
}
|
|
@@ -24011,7 +24011,7 @@ var require_readShebang = __commonJS({
|
|
|
24011
24011
|
var require_parse2 = __commonJS({
|
|
24012
24012
|
"../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/parse.js"(exports2, module2) {
|
|
24013
24013
|
"use strict";
|
|
24014
|
-
var
|
|
24014
|
+
var path64 = require("path");
|
|
24015
24015
|
var resolveCommand = require_resolveCommand();
|
|
24016
24016
|
var escape4 = require_escape();
|
|
24017
24017
|
var readShebang = require_readShebang();
|
|
@@ -24036,7 +24036,7 @@ var require_parse2 = __commonJS({
|
|
|
24036
24036
|
const needsShell = !isExecutableRegExp.test(commandFile);
|
|
24037
24037
|
if (parsed.options.forceShell || needsShell) {
|
|
24038
24038
|
const needsDoubleEscapeMetaChars = isCmdShimRegExp.test(commandFile);
|
|
24039
|
-
parsed.command =
|
|
24039
|
+
parsed.command = path64.normalize(parsed.command);
|
|
24040
24040
|
parsed.command = escape4.command(parsed.command);
|
|
24041
24041
|
parsed.args = parsed.args.map((arg) => escape4.argument(arg, needsDoubleEscapeMetaChars));
|
|
24042
24042
|
const shellCommand = [parsed.command].concat(parsed.args).join(" ");
|
|
@@ -24260,7 +24260,7 @@ module.exports = __toCommonJS(server_exports);
|
|
|
24260
24260
|
var import_promises36 = __toESM(require("node:fs/promises"), 1);
|
|
24261
24261
|
var import_node_fs16 = require("node:fs");
|
|
24262
24262
|
var import_node_http = require("node:http");
|
|
24263
|
-
var
|
|
24263
|
+
var import_node_path64 = __toESM(require("node:path"), 1);
|
|
24264
24264
|
|
|
24265
24265
|
// ../../packages/core/dist/platform/http.js
|
|
24266
24266
|
var import_node_crypto = require("node:crypto");
|
|
@@ -25421,10 +25421,10 @@ function mergeDefs(...defs) {
|
|
|
25421
25421
|
function cloneDef(schema8) {
|
|
25422
25422
|
return mergeDefs(schema8._zod.def);
|
|
25423
25423
|
}
|
|
25424
|
-
function getElementAtPath(obj,
|
|
25425
|
-
if (!
|
|
25424
|
+
function getElementAtPath(obj, path64) {
|
|
25425
|
+
if (!path64)
|
|
25426
25426
|
return obj;
|
|
25427
|
-
return
|
|
25427
|
+
return path64.reduce((acc, key3) => acc?.[key3], obj);
|
|
25428
25428
|
}
|
|
25429
25429
|
function promiseAllObject(promisesObj) {
|
|
25430
25430
|
const keys = Object.keys(promisesObj);
|
|
@@ -25833,11 +25833,11 @@ function explicitlyAborted(x, startIndex = 0) {
|
|
|
25833
25833
|
}
|
|
25834
25834
|
return false;
|
|
25835
25835
|
}
|
|
25836
|
-
function prefixIssues(
|
|
25836
|
+
function prefixIssues(path64, issues) {
|
|
25837
25837
|
return issues.map((iss) => {
|
|
25838
25838
|
var _a3;
|
|
25839
25839
|
(_a3 = iss).path ?? (_a3.path = []);
|
|
25840
|
-
iss.path.unshift(
|
|
25840
|
+
iss.path.unshift(path64);
|
|
25841
25841
|
return iss;
|
|
25842
25842
|
});
|
|
25843
25843
|
}
|
|
@@ -25984,16 +25984,16 @@ function flattenError(error51, mapper = (issue2) => issue2.message) {
|
|
|
25984
25984
|
}
|
|
25985
25985
|
function formatError(error51, mapper = (issue2) => issue2.message) {
|
|
25986
25986
|
const fieldErrors = { _errors: [] };
|
|
25987
|
-
const processError = (error52,
|
|
25987
|
+
const processError = (error52, path64 = []) => {
|
|
25988
25988
|
for (const issue2 of error52.issues) {
|
|
25989
25989
|
if (issue2.code === "invalid_union" && issue2.errors.length) {
|
|
25990
|
-
issue2.errors.map((issues) => processError({ issues }, [...
|
|
25990
|
+
issue2.errors.map((issues) => processError({ issues }, [...path64, ...issue2.path]));
|
|
25991
25991
|
} else if (issue2.code === "invalid_key") {
|
|
25992
|
-
processError({ issues: issue2.issues }, [...
|
|
25992
|
+
processError({ issues: issue2.issues }, [...path64, ...issue2.path]);
|
|
25993
25993
|
} else if (issue2.code === "invalid_element") {
|
|
25994
|
-
processError({ issues: issue2.issues }, [...
|
|
25994
|
+
processError({ issues: issue2.issues }, [...path64, ...issue2.path]);
|
|
25995
25995
|
} else {
|
|
25996
|
-
const fullpath = [...
|
|
25996
|
+
const fullpath = [...path64, ...issue2.path];
|
|
25997
25997
|
if (fullpath.length === 0) {
|
|
25998
25998
|
fieldErrors._errors.push(mapper(issue2));
|
|
25999
25999
|
} else {
|
|
@@ -26020,17 +26020,17 @@ function formatError(error51, mapper = (issue2) => issue2.message) {
|
|
|
26020
26020
|
}
|
|
26021
26021
|
function treeifyError(error51, mapper = (issue2) => issue2.message) {
|
|
26022
26022
|
const result = { errors: [] };
|
|
26023
|
-
const processError = (error52,
|
|
26023
|
+
const processError = (error52, path64 = []) => {
|
|
26024
26024
|
var _a3, _b;
|
|
26025
26025
|
for (const issue2 of error52.issues) {
|
|
26026
26026
|
if (issue2.code === "invalid_union" && issue2.errors.length) {
|
|
26027
|
-
issue2.errors.map((issues) => processError({ issues }, [...
|
|
26027
|
+
issue2.errors.map((issues) => processError({ issues }, [...path64, ...issue2.path]));
|
|
26028
26028
|
} else if (issue2.code === "invalid_key") {
|
|
26029
|
-
processError({ issues: issue2.issues }, [...
|
|
26029
|
+
processError({ issues: issue2.issues }, [...path64, ...issue2.path]);
|
|
26030
26030
|
} else if (issue2.code === "invalid_element") {
|
|
26031
|
-
processError({ issues: issue2.issues }, [...
|
|
26031
|
+
processError({ issues: issue2.issues }, [...path64, ...issue2.path]);
|
|
26032
26032
|
} else {
|
|
26033
|
-
const fullpath = [...
|
|
26033
|
+
const fullpath = [...path64, ...issue2.path];
|
|
26034
26034
|
if (fullpath.length === 0) {
|
|
26035
26035
|
result.errors.push(mapper(issue2));
|
|
26036
26036
|
continue;
|
|
@@ -26062,8 +26062,8 @@ function treeifyError(error51, mapper = (issue2) => issue2.message) {
|
|
|
26062
26062
|
}
|
|
26063
26063
|
function toDotPath(_path) {
|
|
26064
26064
|
const segs = [];
|
|
26065
|
-
const
|
|
26066
|
-
for (const seg of
|
|
26065
|
+
const path64 = _path.map((seg) => typeof seg === "object" ? seg.key : seg);
|
|
26066
|
+
for (const seg of path64) {
|
|
26067
26067
|
if (typeof seg === "number")
|
|
26068
26068
|
segs.push(`[${seg}]`);
|
|
26069
26069
|
else if (typeof seg === "symbol")
|
|
@@ -38755,13 +38755,13 @@ function resolveRef(ref, ctx) {
|
|
|
38755
38755
|
if (!ref.startsWith("#")) {
|
|
38756
38756
|
throw new Error("External $ref is not supported, only local refs (#/...) are allowed");
|
|
38757
38757
|
}
|
|
38758
|
-
const
|
|
38759
|
-
if (
|
|
38758
|
+
const path64 = ref.slice(1).split("/").filter(Boolean);
|
|
38759
|
+
if (path64.length === 0) {
|
|
38760
38760
|
return ctx.rootSchema;
|
|
38761
38761
|
}
|
|
38762
38762
|
const defsKey = ctx.version === "draft-2020-12" ? "$defs" : "definitions";
|
|
38763
|
-
if (
|
|
38764
|
-
const key3 =
|
|
38763
|
+
if (path64[0] === defsKey) {
|
|
38764
|
+
const key3 = path64[1];
|
|
38765
38765
|
if (!key3 || !ctx.defs[key3]) {
|
|
38766
38766
|
throw new Error(`Reference not found: ${ref}`);
|
|
38767
38767
|
}
|
|
@@ -44100,8 +44100,8 @@ var SUPERSEDED_MARKER = "[Superseded: this file was read again later in the conv
|
|
|
44100
44100
|
function readFilePath(argumentsJson) {
|
|
44101
44101
|
try {
|
|
44102
44102
|
const parsed = JSON.parse(argumentsJson.length > 0 ? argumentsJson : "{}");
|
|
44103
|
-
const
|
|
44104
|
-
return typeof
|
|
44103
|
+
const path64 = parsed.path;
|
|
44104
|
+
return typeof path64 === "string" && path64.length > 0 ? path64 : void 0;
|
|
44105
44105
|
} catch {
|
|
44106
44106
|
return void 0;
|
|
44107
44107
|
}
|
|
@@ -44114,8 +44114,8 @@ function dropSupersededReads(messages) {
|
|
|
44114
44114
|
for (const toolCall of message5.toolCalls ?? []) {
|
|
44115
44115
|
if (toolCall.name !== "read_file")
|
|
44116
44116
|
continue;
|
|
44117
|
-
const
|
|
44118
|
-
if (
|
|
44117
|
+
const path64 = readFilePath(toolCall.arguments);
|
|
44118
|
+
if (path64 === void 0)
|
|
44119
44119
|
continue;
|
|
44120
44120
|
keyByCallId.set(toolCall.id, toolCall.arguments);
|
|
44121
44121
|
}
|
|
@@ -46971,13 +46971,13 @@ var OpenSearchClient = class {
|
|
|
46971
46971
|
* `_bulk`, `_delete_by_query`, index creation — is refused here rather than merely
|
|
46972
46972
|
* unused, so no future edit or crafted argument can turn a read client into a writer.
|
|
46973
46973
|
*/
|
|
46974
|
-
async request(
|
|
46974
|
+
async request(path64, options = {}) {
|
|
46975
46975
|
const method = options.method ?? "GET";
|
|
46976
|
-
const isSearchPost = method === "POST" && /\/_search(\?|$)/.test(
|
|
46976
|
+
const isSearchPost = method === "POST" && /\/_search(\?|$)/.test(path64);
|
|
46977
46977
|
if (method !== "GET" && !isSearchPost) {
|
|
46978
|
-
throw new OpenSearchError(`Refusing ${method} ${
|
|
46978
|
+
throw new OpenSearchError(`Refusing ${method} ${path64}: this client is read-only. Indexing goes through the indexer, which the user starts from Settings.`);
|
|
46979
46979
|
}
|
|
46980
|
-
const url2 = `${this.base}${
|
|
46980
|
+
const url2 = `${this.base}${path64}`;
|
|
46981
46981
|
const request = {
|
|
46982
46982
|
method,
|
|
46983
46983
|
headers: this.headers()
|
|
@@ -47144,11 +47144,11 @@ function collectFields(properties, prefix, out) {
|
|
|
47144
47144
|
return;
|
|
47145
47145
|
for (const [name, raw] of Object.entries(properties)) {
|
|
47146
47146
|
const field2 = raw;
|
|
47147
|
-
const
|
|
47147
|
+
const path64 = prefix.length > 0 ? `${prefix}.${name}` : name;
|
|
47148
47148
|
if (typeof field2.type === "string")
|
|
47149
|
-
out[
|
|
47149
|
+
out[path64] = field2.type;
|
|
47150
47150
|
if (field2.properties !== void 0)
|
|
47151
|
-
collectFields(field2.properties,
|
|
47151
|
+
collectFields(field2.properties, path64, out);
|
|
47152
47152
|
}
|
|
47153
47153
|
}
|
|
47154
47154
|
function describeStatus(status2, url2, body) {
|
|
@@ -47167,23 +47167,23 @@ function describeStatus(status2, url2, body) {
|
|
|
47167
47167
|
var TEXT_TYPES = /* @__PURE__ */ new Set(["text", "match_only_text", "search_as_you_type", "wildcard"]);
|
|
47168
47168
|
var KEYWORD_TYPES = /* @__PURE__ */ new Set(["keyword", "constant_keyword"]);
|
|
47169
47169
|
var NOISE_FIELDS = /* @__PURE__ */ new Set(["@version", "ecs", "tags", "stream", "input", "agent", "host", "event"]);
|
|
47170
|
-
function leafName(
|
|
47171
|
-
const parts =
|
|
47172
|
-
return parts[parts.length - 1] ??
|
|
47170
|
+
function leafName(path64) {
|
|
47171
|
+
const parts = path64.split(".");
|
|
47172
|
+
return parts[parts.length - 1] ?? path64;
|
|
47173
47173
|
}
|
|
47174
47174
|
function selectQueryFields(mapping, limit = 25) {
|
|
47175
47175
|
const text2 = [];
|
|
47176
47176
|
const keyword = [];
|
|
47177
|
-
for (const [
|
|
47178
|
-
if (NOISE_FIELDS.has(leafName(
|
|
47177
|
+
for (const [path64, type] of Object.entries(mapping)) {
|
|
47178
|
+
if (NOISE_FIELDS.has(leafName(path64)) || NOISE_FIELDS.has(path64.split(".")[0] ?? ""))
|
|
47179
47179
|
continue;
|
|
47180
47180
|
if (TEXT_TYPES.has(type)) {
|
|
47181
|
-
text2.push(
|
|
47181
|
+
text2.push(path64);
|
|
47182
47182
|
} else if (KEYWORD_TYPES.has(type)) {
|
|
47183
|
-
const parent =
|
|
47184
|
-
if (
|
|
47183
|
+
const parent = path64.replace(/\.keyword$/, "");
|
|
47184
|
+
if (path64.endsWith(".keyword") && TEXT_TYPES.has(mapping[parent] ?? ""))
|
|
47185
47185
|
continue;
|
|
47186
|
-
keyword.push(
|
|
47186
|
+
keyword.push(path64);
|
|
47187
47187
|
}
|
|
47188
47188
|
}
|
|
47189
47189
|
const byDepth = (a, b) => a.split(".").length - b.split(".").length || a.localeCompare(b);
|
|
@@ -47325,8 +47325,8 @@ var OpenSearchIndexWriter = class {
|
|
|
47325
47325
|
}
|
|
47326
47326
|
return headers;
|
|
47327
47327
|
}
|
|
47328
|
-
async request(
|
|
47329
|
-
const url2 = `${this.connection.url.replace(/\/+$/, "")}${
|
|
47328
|
+
async request(path64, method, body, signal) {
|
|
47329
|
+
const url2 = `${this.connection.url.replace(/\/+$/, "")}${path64}`;
|
|
47330
47330
|
const request = { method, headers: this.headers() };
|
|
47331
47331
|
if (body !== void 0) {
|
|
47332
47332
|
if (typeof body === "string") {
|
|
@@ -47540,13 +47540,13 @@ var OpenSearchIndexWriter = class {
|
|
|
47540
47540
|
for (const hit of hits) {
|
|
47541
47541
|
const source = hit._source ?? {};
|
|
47542
47542
|
const vector = source.vector;
|
|
47543
|
-
const
|
|
47544
|
-
if (typeof
|
|
47543
|
+
const path64 = source.path;
|
|
47544
|
+
if (typeof path64 !== "string" || !Array.isArray(vector))
|
|
47545
47545
|
continue;
|
|
47546
47546
|
documents.push({
|
|
47547
47547
|
id: hit._id ?? "",
|
|
47548
47548
|
text: typeof source.text === "string" ? source.text : "",
|
|
47549
|
-
path:
|
|
47549
|
+
path: path64,
|
|
47550
47550
|
startLine: typeof source.startLine === "number" ? source.startLine : 1,
|
|
47551
47551
|
endLine: typeof source.endLine === "number" ? source.endLine : 1,
|
|
47552
47552
|
vector
|
|
@@ -47620,8 +47620,8 @@ var RestTransport = class {
|
|
|
47620
47620
|
* threw would push every caller into catching and re-inspecting an error to find out
|
|
47621
47621
|
* whether it was really an error. `expectOk` is there for the cases that are.
|
|
47622
47622
|
*/
|
|
47623
|
-
async send(
|
|
47624
|
-
const url2 = `${this.connection.url.replace(/\/+$/, "")}${
|
|
47623
|
+
async send(path64, method, body, signal) {
|
|
47624
|
+
const url2 = `${this.connection.url.replace(/\/+$/, "")}${path64}`;
|
|
47625
47625
|
const request = { method, headers: this.headers() };
|
|
47626
47626
|
if (body !== void 0)
|
|
47627
47627
|
request.body = JSON.stringify(body);
|
|
@@ -47647,11 +47647,11 @@ var RestTransport = class {
|
|
|
47647
47647
|
return { status: response.status, body: parsed };
|
|
47648
47648
|
}
|
|
47649
47649
|
/** Sends, and throws unless the status is 2xx. */
|
|
47650
|
-
async expectOk(
|
|
47651
|
-
const result = await this.send(
|
|
47650
|
+
async expectOk(path64, method, body, signal) {
|
|
47651
|
+
const result = await this.send(path64, method, body, signal);
|
|
47652
47652
|
if (result.status < 200 || result.status >= 300) {
|
|
47653
47653
|
const detail = typeof result.body === "string" ? result.body : JSON.stringify(result.body ?? "");
|
|
47654
|
-
throw new VectorStoreError(`${method} ${
|
|
47654
|
+
throw new VectorStoreError(`${method} ${path64} on ${this.label} returned HTTP ${String(result.status)}. ${detail.slice(0, 300)}`, result.status);
|
|
47655
47655
|
}
|
|
47656
47656
|
return result.body;
|
|
47657
47657
|
}
|
|
@@ -47759,10 +47759,10 @@ var ChromaSearcher = class extends ChromaBase {
|
|
|
47759
47759
|
const matches = [];
|
|
47760
47760
|
for (let index = 0; index < ids.length; index++) {
|
|
47761
47761
|
const metadata = metadatas[index] ?? {};
|
|
47762
|
-
const
|
|
47763
|
-
if (
|
|
47762
|
+
const path64 = typeof metadata.path === "string" ? metadata.path : void 0;
|
|
47763
|
+
if (path64 === void 0)
|
|
47764
47764
|
continue;
|
|
47765
|
-
if (prefix !== void 0 && prefix.length > 0 && !
|
|
47765
|
+
if (prefix !== void 0 && prefix.length > 0 && !path64.startsWith(prefix))
|
|
47766
47766
|
continue;
|
|
47767
47767
|
if (projectHere && typeof metadata.project === "string" && !options.project?.names.includes(metadata.project))
|
|
47768
47768
|
continue;
|
|
@@ -47776,7 +47776,7 @@ var ChromaSearcher = class extends ChromaBase {
|
|
|
47776
47776
|
*/
|
|
47777
47777
|
score: typeof distance === "number" ? 1 / (1 + Math.max(0, distance)) : 0,
|
|
47778
47778
|
text: documents[index] ?? (typeof metadata.text === "string" ? metadata.text : ""),
|
|
47779
|
-
path:
|
|
47779
|
+
path: path64
|
|
47780
47780
|
};
|
|
47781
47781
|
if (typeof metadata.startLine === "number")
|
|
47782
47782
|
match.startLine = metadata.startLine;
|
|
@@ -47887,13 +47887,13 @@ var ChromaIndexWriter = class extends ChromaBase {
|
|
|
47887
47887
|
for (let index = 0; index < ids.length; index++) {
|
|
47888
47888
|
const metadata = result.metadatas?.[index] ?? {};
|
|
47889
47889
|
const vector = result.embeddings?.[index];
|
|
47890
|
-
const
|
|
47891
|
-
if (
|
|
47890
|
+
const path64 = typeof metadata.path === "string" ? metadata.path : void 0;
|
|
47891
|
+
if (path64 === void 0 || !Array.isArray(vector))
|
|
47892
47892
|
continue;
|
|
47893
47893
|
documents.push({
|
|
47894
47894
|
id: ids[index] ?? "",
|
|
47895
47895
|
text: result.documents?.[index] ?? "",
|
|
47896
|
-
path:
|
|
47896
|
+
path: path64,
|
|
47897
47897
|
startLine: typeof metadata.startLine === "number" ? metadata.startLine : 1,
|
|
47898
47898
|
endLine: typeof metadata.endLine === "number" ? metadata.endLine : 1,
|
|
47899
47899
|
vector
|
|
@@ -47910,9 +47910,9 @@ var ChromaIndexWriter = class extends ChromaBase {
|
|
|
47910
47910
|
const result = await this.rest.expectOk(`${this.base}/collections/${found2.id}/get`, "POST", { include: ["metadatas"], limit }, options.signal);
|
|
47911
47911
|
const paths = /* @__PURE__ */ new Set();
|
|
47912
47912
|
for (const metadata of result.metadatas ?? []) {
|
|
47913
|
-
const
|
|
47914
|
-
if (typeof
|
|
47915
|
-
paths.add(
|
|
47913
|
+
const path64 = metadata?.path;
|
|
47914
|
+
if (typeof path64 === "string")
|
|
47915
|
+
paths.add(path64);
|
|
47916
47916
|
}
|
|
47917
47917
|
return [...paths];
|
|
47918
47918
|
}
|
|
@@ -47939,14 +47939,14 @@ var MARKER_ID = "5f6d2a41-0000-5000-8000-6c69676874c0";
|
|
|
47939
47939
|
var MARKER_MARK = "light-code";
|
|
47940
47940
|
function toMatch(point) {
|
|
47941
47941
|
const payload = point.payload ?? {};
|
|
47942
|
-
const
|
|
47943
|
-
if (
|
|
47942
|
+
const path64 = typeof payload.path === "string" ? payload.path : void 0;
|
|
47943
|
+
if (path64 === void 0)
|
|
47944
47944
|
return void 0;
|
|
47945
47945
|
const match = {
|
|
47946
47946
|
id: typeof payload.chunkId === "string" ? payload.chunkId : point.id,
|
|
47947
47947
|
score: typeof point.score === "number" ? point.score : 0,
|
|
47948
47948
|
text: typeof payload.text === "string" ? payload.text : "",
|
|
47949
|
-
path:
|
|
47949
|
+
path: path64
|
|
47950
47950
|
};
|
|
47951
47951
|
if (typeof payload.startLine === "number")
|
|
47952
47952
|
match.startLine = payload.startLine;
|
|
@@ -48140,13 +48140,13 @@ var QdrantIndexWriter = class extends QdrantBase {
|
|
|
48140
48140
|
const documents = [];
|
|
48141
48141
|
for (const point of result.body.result?.points ?? []) {
|
|
48142
48142
|
const payload = point.payload ?? {};
|
|
48143
|
-
const
|
|
48144
|
-
if (
|
|
48143
|
+
const path64 = typeof payload.path === "string" ? payload.path : void 0;
|
|
48144
|
+
if (path64 === void 0 || !Array.isArray(point.vector))
|
|
48145
48145
|
continue;
|
|
48146
48146
|
documents.push({
|
|
48147
48147
|
id: typeof payload.chunkId === "string" ? payload.chunkId : point.id,
|
|
48148
48148
|
text: typeof payload.text === "string" ? payload.text : "",
|
|
48149
|
-
path:
|
|
48149
|
+
path: path64,
|
|
48150
48150
|
startLine: typeof payload.startLine === "number" ? payload.startLine : 1,
|
|
48151
48151
|
endLine: typeof payload.endLine === "number" ? payload.endLine : 1,
|
|
48152
48152
|
vector: point.vector
|
|
@@ -48173,9 +48173,9 @@ var QdrantIndexWriter = class extends QdrantBase {
|
|
|
48173
48173
|
throw new VectorStoreError(`Could not list "${collection}" (HTTP ${String(result.status)}).`, result.status);
|
|
48174
48174
|
}
|
|
48175
48175
|
for (const point of result.body.result?.points ?? []) {
|
|
48176
|
-
const
|
|
48177
|
-
if (typeof
|
|
48178
|
-
paths.add(
|
|
48176
|
+
const path64 = point.payload?.path;
|
|
48177
|
+
if (typeof path64 === "string")
|
|
48178
|
+
paths.add(path64);
|
|
48179
48179
|
}
|
|
48180
48180
|
offset = result.body.result?.next_page_offset;
|
|
48181
48181
|
if (offset === void 0 || offset === null)
|
|
@@ -48709,8 +48709,8 @@ function teamSkillDocument(skill, body, vector, attribution) {
|
|
|
48709
48709
|
vector
|
|
48710
48710
|
};
|
|
48711
48711
|
}
|
|
48712
|
-
function nameFromPath(
|
|
48713
|
-
return
|
|
48712
|
+
function nameFromPath(path64) {
|
|
48713
|
+
return path64.startsWith("skill:") ? path64.slice("skill:".length) : path64;
|
|
48714
48714
|
}
|
|
48715
48715
|
function toHit(match, self) {
|
|
48716
48716
|
return {
|
|
@@ -51796,8 +51796,8 @@ function createMailCoverageTool(options) {
|
|
|
51796
51796
|
}
|
|
51797
51797
|
};
|
|
51798
51798
|
}
|
|
51799
|
-
function normaliseFolder(
|
|
51800
|
-
return
|
|
51799
|
+
function normaliseFolder(path64) {
|
|
51800
|
+
return path64.toLowerCase().replace(/[\\/]+/g, "\\");
|
|
51801
51801
|
}
|
|
51802
51802
|
function haystackOf(record2) {
|
|
51803
51803
|
return `${record2.subject}
|
|
@@ -52293,7 +52293,7 @@ async function refreshMail(options) {
|
|
|
52293
52293
|
const limit = options.batchLimit ?? 2e3;
|
|
52294
52294
|
const previewChars = options.previewChars ?? 400;
|
|
52295
52295
|
const sinceMs = Date.now() - options.days * 24 * 60 * 60 * 1e3;
|
|
52296
|
-
const harvested = await options.harvest(options.folders.map((
|
|
52296
|
+
const harvested = await options.harvest(options.folders.map((path64) => ({ path: path64, sinceMs })), { limit, previewChars });
|
|
52297
52297
|
const fetched = harvested.messages.map(toRecord);
|
|
52298
52298
|
if (fetched.length === 0) {
|
|
52299
52299
|
return { added: 0, more: false, total: known.length, embedded: 0, backfilled: 0, complete: [] };
|
|
@@ -52334,9 +52334,9 @@ async function syncMail(options) {
|
|
|
52334
52334
|
const backfillDone = await options.store.loadBackfillState();
|
|
52335
52335
|
const limit = options.batchLimit ?? 500;
|
|
52336
52336
|
const previewChars = options.previewChars ?? 400;
|
|
52337
|
-
const forwardRequests = options.folders.map((
|
|
52338
|
-
const mark = marks.get(
|
|
52339
|
-
return mark === void 0 ? { path:
|
|
52337
|
+
const forwardRequests = options.folders.map((path64) => {
|
|
52338
|
+
const mark = marks.get(path64);
|
|
52339
|
+
return mark === void 0 ? { path: path64 } : { path: path64, sinceMs: mark.newest - 1e3 };
|
|
52340
52340
|
});
|
|
52341
52341
|
const forward = await options.harvest(forwardRequests, { limit, previewChars });
|
|
52342
52342
|
let candidates = forward.messages.map(toRecord);
|
|
@@ -52345,15 +52345,15 @@ async function syncMail(options) {
|
|
|
52345
52345
|
let more = forward.truncated;
|
|
52346
52346
|
const remaining = limit - candidates.length;
|
|
52347
52347
|
const floor = options.retentionMonths === void 0 ? void 0 : monthsBefore(options.now ?? Date.now(), options.retentionMonths);
|
|
52348
|
-
const outstanding = options.folders.filter((
|
|
52349
|
-
const atFloor = floor === void 0 ? [] : outstanding.filter((
|
|
52350
|
-
const behind = outstanding.filter((
|
|
52348
|
+
const outstanding = options.folders.filter((path64) => marks.has(path64) && backfillDone[path64] !== true);
|
|
52349
|
+
const atFloor = floor === void 0 ? [] : outstanding.filter((path64) => marks.get(path64).oldest <= floor);
|
|
52350
|
+
const behind = outstanding.filter((path64) => !atFloor.includes(path64));
|
|
52351
52351
|
completed.push(...atFloor);
|
|
52352
52352
|
if (remaining > 0 && behind.length > 0 && options.signal?.aborted !== true) {
|
|
52353
|
-
const backRequests = behind.map((
|
|
52354
|
-
path:
|
|
52353
|
+
const backRequests = behind.map((path64) => ({
|
|
52354
|
+
path: path64,
|
|
52355
52355
|
// Strictly older, so the oldest held message is not fetched again every pass.
|
|
52356
|
-
beforeMs: marks.get(
|
|
52356
|
+
beforeMs: marks.get(path64).oldest,
|
|
52357
52357
|
// And no older than retention wants. The harvest ANDs the two into one window.
|
|
52358
52358
|
...floor === void 0 ? {} : { sinceMs: floor }
|
|
52359
52359
|
}));
|
|
@@ -52361,9 +52361,9 @@ async function syncMail(options) {
|
|
|
52361
52361
|
backfilled = backward.messages.length;
|
|
52362
52362
|
candidates = [...candidates, ...backward.messages.map(toRecord)];
|
|
52363
52363
|
const returnedFor = new Set(backward.messages.map((message5) => message5.folder));
|
|
52364
|
-
for (const
|
|
52365
|
-
if (!returnedFor.has(
|
|
52366
|
-
completed.push(
|
|
52364
|
+
for (const path64 of behind) {
|
|
52365
|
+
if (!returnedFor.has(path64))
|
|
52366
|
+
completed.push(path64);
|
|
52367
52367
|
}
|
|
52368
52368
|
if (backward.truncated || backfilled > 0)
|
|
52369
52369
|
more = true;
|
|
@@ -52371,7 +52371,7 @@ async function syncMail(options) {
|
|
|
52371
52371
|
if (completed.length > 0) {
|
|
52372
52372
|
await options.store.saveBackfillState({
|
|
52373
52373
|
...backfillDone,
|
|
52374
|
-
...Object.fromEntries(completed.map((
|
|
52374
|
+
...Object.fromEntries(completed.map((path64) => [path64, true]))
|
|
52375
52375
|
});
|
|
52376
52376
|
}
|
|
52377
52377
|
const fresh = withoutKnown(candidates, known);
|
|
@@ -52711,14 +52711,14 @@ function formatBytes(size) {
|
|
|
52711
52711
|
return `${(size / (1 << 10)).toFixed(1)}KB`;
|
|
52712
52712
|
return `${String(size)}B`;
|
|
52713
52713
|
}
|
|
52714
|
-
async function readTail(fs43,
|
|
52714
|
+
async function readTail(fs43, path64, size, count3) {
|
|
52715
52715
|
let span = Math.min(size, CHUNK);
|
|
52716
52716
|
let text2;
|
|
52717
52717
|
let start;
|
|
52718
52718
|
for (; ; ) {
|
|
52719
52719
|
start = Math.max(0, size - span);
|
|
52720
52720
|
const decoder2 = new import_node_string_decoder.StringDecoder("utf8");
|
|
52721
|
-
text2 = decoder2.write(await fs43.readBytesSlice(
|
|
52721
|
+
text2 = decoder2.write(await fs43.readBytesSlice(path64, start, size)) + decoder2.end();
|
|
52722
52722
|
const enough = text2.split("\n").length > count3;
|
|
52723
52723
|
if (enough || start === 0 || span >= size)
|
|
52724
52724
|
break;
|
|
@@ -52736,7 +52736,7 @@ async function readTail(fs43, path63, size, count3) {
|
|
|
52736
52736
|
hasMoreAfter: false
|
|
52737
52737
|
};
|
|
52738
52738
|
}
|
|
52739
|
-
async function readLineWindow(fs43,
|
|
52739
|
+
async function readLineWindow(fs43, path64, size, from, count3) {
|
|
52740
52740
|
const decoder2 = new import_node_string_decoder.StringDecoder("utf8");
|
|
52741
52741
|
const lines2 = [];
|
|
52742
52742
|
let pending = "";
|
|
@@ -52751,7 +52751,7 @@ async function readLineWindow(fs43, path63, size, from, count3) {
|
|
|
52751
52751
|
};
|
|
52752
52752
|
scan: while (position < size) {
|
|
52753
52753
|
const end = Math.min(size, position + CHUNK);
|
|
52754
|
-
pending += decoder2.write(await fs43.readBytesSlice(
|
|
52754
|
+
pending += decoder2.write(await fs43.readBytesSlice(path64, position, end));
|
|
52755
52755
|
position = end;
|
|
52756
52756
|
const parts = pending.split(/\r\n|\r|\n/);
|
|
52757
52757
|
pending = parts.pop() ?? "";
|
|
@@ -52774,13 +52774,13 @@ async function readLineWindow(fs43, path63, size, from, count3) {
|
|
|
52774
52774
|
hasMoreAfter: !reachedEnd || lineNumber > from + lines2.length
|
|
52775
52775
|
};
|
|
52776
52776
|
}
|
|
52777
|
-
async function countLines(fs43,
|
|
52777
|
+
async function countLines(fs43, path64, size) {
|
|
52778
52778
|
let newlines = 0;
|
|
52779
52779
|
let position = 0;
|
|
52780
52780
|
let lastByte = -1;
|
|
52781
52781
|
while (position < size) {
|
|
52782
52782
|
const end = Math.min(size, position + CHUNK);
|
|
52783
|
-
const buffer = await fs43.readBytesSlice(
|
|
52783
|
+
const buffer = await fs43.readBytesSlice(path64, position, end);
|
|
52784
52784
|
for (const byte of buffer)
|
|
52785
52785
|
if (byte === 10)
|
|
52786
52786
|
newlines += 1;
|
|
@@ -60792,9 +60792,9 @@ function secretRefsFor(section, config2) {
|
|
|
60792
60792
|
}
|
|
60793
60793
|
return refs;
|
|
60794
60794
|
}
|
|
60795
|
-
function getPath2(source,
|
|
60795
|
+
function getPath2(source, path64) {
|
|
60796
60796
|
let value = source;
|
|
60797
|
-
for (const part of
|
|
60797
|
+
for (const part of path64.split(".")) {
|
|
60798
60798
|
if (typeof value !== "object" || value === null)
|
|
60799
60799
|
return void 0;
|
|
60800
60800
|
value = value[part];
|
|
@@ -60808,8 +60808,8 @@ function hasValue(value) {
|
|
|
60808
60808
|
return Object.keys(value).length > 0;
|
|
60809
60809
|
return true;
|
|
60810
60810
|
}
|
|
60811
|
-
function setPath(target,
|
|
60812
|
-
const [head, ...rest] =
|
|
60811
|
+
function setPath(target, path64, value) {
|
|
60812
|
+
const [head, ...rest] = path64.split(".");
|
|
60813
60813
|
if (head === void 0)
|
|
60814
60814
|
return;
|
|
60815
60815
|
if (rest.length === 0) {
|
|
@@ -60829,8 +60829,8 @@ function setPath(target, path63, value) {
|
|
|
60829
60829
|
var NESTED_PATHS = SHARE_SECTIONS.flatMap((section) => section.nested ?? []);
|
|
60830
60830
|
function withoutNested(config2) {
|
|
60831
60831
|
const copy = { ...config2 };
|
|
60832
|
-
for (const
|
|
60833
|
-
setPath(copy,
|
|
60832
|
+
for (const path64 of NESTED_PATHS)
|
|
60833
|
+
setPath(copy, path64, void 0);
|
|
60834
60834
|
return copy;
|
|
60835
60835
|
}
|
|
60836
60836
|
function describeSections(config2) {
|
|
@@ -60839,7 +60839,7 @@ function describeSections(config2) {
|
|
|
60839
60839
|
id: section.id,
|
|
60840
60840
|
label: section.label,
|
|
60841
60841
|
description: section.description,
|
|
60842
|
-
present: section.keys.some((key3) => has(owned, key3)) || (section.nested ?? []).some((
|
|
60842
|
+
present: section.keys.some((key3) => has(owned, key3)) || (section.nested ?? []).some((path64) => hasValue(getPath2(config2, path64))),
|
|
60843
60843
|
detail: detailFor(section, config2),
|
|
60844
60844
|
secretRefs: secretRefsFor(section, config2),
|
|
60845
60845
|
...section.machineSpecific === true ? { machineSpecific: true } : {},
|
|
@@ -60860,18 +60860,18 @@ function buildExport(config2, selected) {
|
|
|
60860
60860
|
if (has(config2, key3))
|
|
60861
60861
|
exported[key3] = config2[key3];
|
|
60862
60862
|
}
|
|
60863
|
-
for (const
|
|
60864
|
-
const value = getPath2(config2,
|
|
60863
|
+
for (const path64 of section.nested ?? []) {
|
|
60864
|
+
const value = getPath2(config2, path64);
|
|
60865
60865
|
if (hasValue(value))
|
|
60866
|
-
setPath(exported,
|
|
60866
|
+
setPath(exported, path64, value);
|
|
60867
60867
|
}
|
|
60868
|
-
for (const
|
|
60869
|
-
stripPath(exported,
|
|
60868
|
+
for (const path64 of section.strip ?? [])
|
|
60869
|
+
stripPath(exported, path64);
|
|
60870
60870
|
}
|
|
60871
60871
|
return exported;
|
|
60872
60872
|
}
|
|
60873
|
-
function stripPath(target,
|
|
60874
|
-
const [head, ...rest] =
|
|
60873
|
+
function stripPath(target, path64) {
|
|
60874
|
+
const [head, ...rest] = path64.split(".");
|
|
60875
60875
|
if (head === void 0)
|
|
60876
60876
|
return;
|
|
60877
60877
|
const value = target[head];
|
|
@@ -60899,22 +60899,22 @@ function applyImport(existing, imported, selected) {
|
|
|
60899
60899
|
else
|
|
60900
60900
|
delete merged[key3];
|
|
60901
60901
|
}
|
|
60902
|
-
for (const
|
|
60903
|
-
carryPath(existing, merged,
|
|
60902
|
+
for (const path64 of section.strip ?? []) {
|
|
60903
|
+
carryPath(existing, merged, path64);
|
|
60904
60904
|
}
|
|
60905
60905
|
}
|
|
60906
60906
|
for (const section of SHARE_SECTIONS) {
|
|
60907
60907
|
if (!chosen.has(section.id))
|
|
60908
60908
|
continue;
|
|
60909
|
-
for (const
|
|
60910
|
-
const value = getPath2(imported,
|
|
60911
|
-
setPath(merged,
|
|
60909
|
+
for (const path64 of section.nested ?? []) {
|
|
60910
|
+
const value = getPath2(imported, path64);
|
|
60911
|
+
setPath(merged, path64, hasValue(value) ? value : void 0);
|
|
60912
60912
|
}
|
|
60913
60913
|
}
|
|
60914
60914
|
return merged;
|
|
60915
60915
|
}
|
|
60916
|
-
function carryPath(from, to,
|
|
60917
|
-
const [head, ...rest] =
|
|
60916
|
+
function carryPath(from, to, path64) {
|
|
60917
|
+
const [head, ...rest] = path64.split(".");
|
|
60918
60918
|
if (head === void 0)
|
|
60919
60919
|
return;
|
|
60920
60920
|
const source = from[head];
|
|
@@ -63445,7 +63445,7 @@ function gatewayFromSettings(input, stored) {
|
|
|
63445
63445
|
|
|
63446
63446
|
// ../../packages/core/dist/host/bridge.js
|
|
63447
63447
|
var import_node_fs11 = require("node:fs");
|
|
63448
|
-
var
|
|
63448
|
+
var import_node_child_process16 = require("node:child_process");
|
|
63449
63449
|
var import_promises29 = __toESM(require("node:fs/promises"), 1);
|
|
63450
63450
|
|
|
63451
63451
|
// ../../packages/core/dist/jupyter/spec.js
|
|
@@ -66028,7 +66028,7 @@ function pick2(hubs, name) {
|
|
|
66028
66028
|
// ../../packages/core/dist/host/bridge.js
|
|
66029
66029
|
var import_node_os6 = __toESM(require("node:os"), 1);
|
|
66030
66030
|
var import_node_fs12 = require("node:fs");
|
|
66031
|
-
var
|
|
66031
|
+
var import_node_path53 = __toESM(require("node:path"), 1);
|
|
66032
66032
|
|
|
66033
66033
|
// ../../packages/core/dist/modes/autoGuidance.js
|
|
66034
66034
|
function idiomsFor(environment) {
|
|
@@ -67926,8 +67926,8 @@ var ChangeLedger = class {
|
|
|
67926
67926
|
this.chat = chat;
|
|
67927
67927
|
}
|
|
67928
67928
|
/** Best effort: a ledger that cannot be written must never fail an edit that happened. */
|
|
67929
|
-
record(
|
|
67930
|
-
const line = JSON.stringify({ chat: this.chat, path: normalizeForComparison(
|
|
67929
|
+
record(path64) {
|
|
67930
|
+
const line = JSON.stringify({ chat: this.chat, path: normalizeForComparison(path64), at: Date.now() });
|
|
67931
67931
|
void (0, import_promises23.appendFile)(this.file, `${line}
|
|
67932
67932
|
`).catch(() => void 0);
|
|
67933
67933
|
}
|
|
@@ -72274,10 +72274,10 @@ function isSafeSegment(value) {
|
|
|
72274
72274
|
function isSafeTagName(name) {
|
|
72275
72275
|
return /^[A-Za-z0-9._/-]+$/.test(name) && !name.startsWith("-") && !name.startsWith("/") && !name.endsWith("/") && !name.endsWith(".") && !name.endsWith(".lock") && !name.includes("..") && !name.includes("//") && !name.split("/").some((part) => part.startsWith("."));
|
|
72276
72276
|
}
|
|
72277
|
-
function encodeRepoPath(
|
|
72278
|
-
const segments =
|
|
72277
|
+
function encodeRepoPath(path64) {
|
|
72278
|
+
const segments = path64.replace(/\\/g, "/").split("/").filter((segment) => segment.length > 0);
|
|
72279
72279
|
if (segments.length === 0 || segments.some((segment) => segment === ".." || segment === ".")) {
|
|
72280
|
-
throw new AtlassianError(`"${
|
|
72280
|
+
throw new AtlassianError(`"${path64}" is not a file path inside the repository.`);
|
|
72281
72281
|
}
|
|
72282
72282
|
return segments.map(encodeURIComponent).join("/");
|
|
72283
72283
|
}
|
|
@@ -72362,24 +72362,24 @@ var BitbucketClient = class {
|
|
|
72362
72362
|
* redirect was followed, the login page came back, and the file "could not be read" although
|
|
72363
72363
|
* pull requests on the same repository could. `browse` is REST, so it authenticates like those.
|
|
72364
72364
|
*/
|
|
72365
|
-
async file(repo,
|
|
72366
|
-
const target = encodeRepoPath(
|
|
72365
|
+
async file(repo, path64, ref, signal) {
|
|
72366
|
+
const target = encodeRepoPath(path64);
|
|
72367
72367
|
const lines2 = [];
|
|
72368
72368
|
let start = 0;
|
|
72369
72369
|
for (let page = 0; page < MAX_FILE_PAGES; page += 1) {
|
|
72370
72370
|
const query = new URLSearchParams({ start: String(start), limit: String(FILE_PAGE_LINES) });
|
|
72371
72371
|
if (ref !== void 0 && ref.length > 0)
|
|
72372
72372
|
query.set("at", ref);
|
|
72373
|
-
const body = await this.rest.json(`reading ${
|
|
72373
|
+
const body = await this.rest.json(`reading ${path64}`, `${this.repoPath(repo)}/browse/${target}?${query.toString()}`, { method: "GET" }, signal);
|
|
72374
72374
|
if (body.children !== void 0) {
|
|
72375
72375
|
const names = (body.children.values ?? []).map((child) => {
|
|
72376
72376
|
const name = child.path?.toString ?? child.path?.name ?? "?";
|
|
72377
72377
|
return child.type === "DIRECTORY" ? `${name}/` : name;
|
|
72378
72378
|
});
|
|
72379
|
-
throw new AtlassianError(`${
|
|
72379
|
+
throw new AtlassianError(`${path64} is a folder, not a file. It holds: ${names.join(", ") || "nothing"}.`);
|
|
72380
72380
|
}
|
|
72381
72381
|
if (body.binary === true)
|
|
72382
|
-
throw new AtlassianError(`${
|
|
72382
|
+
throw new AtlassianError(`${path64} is a binary file, so there is no text to read.`);
|
|
72383
72383
|
for (const line of body.lines ?? [])
|
|
72384
72384
|
lines2.push(line.text ?? "");
|
|
72385
72385
|
if (body.isLastPage !== false || body.nextPageStart === void 0 || body.nextPageStart <= start)
|
|
@@ -72402,6 +72402,27 @@ var BitbucketClient = class {
|
|
|
72402
72402
|
}
|
|
72403
72403
|
// --- A repository as a store of files: the team repository for skills and tools (`teamrepo/sync.ts`). ---
|
|
72404
72404
|
// Every call is REST under /rest/, so the personal access token authenticates it like the rest (no git, no web URL).
|
|
72405
|
+
/**
|
|
72406
|
+
* The commits that changed one file on a branch, newest first - who changed a team skill or tool, and when
|
|
72407
|
+
* (`sharing/provenance.ts`). Empty when the file is not in the repository.
|
|
72408
|
+
*/
|
|
72409
|
+
async fileCommits(repo, file2, branch, limit = 50, signal) {
|
|
72410
|
+
try {
|
|
72411
|
+
const page = await this.rest.json(`reading the history of ${file2}`, `${this.repoPath(repo)}/commits?${new URLSearchParams({ path: file2, until: `refs/heads/${branch}`, limit: String(limit) }).toString()}`, { method: "GET" }, signal);
|
|
72412
|
+
return (page.values ?? []).map((c2) => ({
|
|
72413
|
+
id: c2.displayId ?? (c2.id ?? "").slice(0, 11),
|
|
72414
|
+
by: c2.author?.displayName ?? c2.author?.name ?? "unknown",
|
|
72415
|
+
...c2.author?.emailAddress !== void 0 ? { email: c2.author.emailAddress } : {},
|
|
72416
|
+
at: Math.floor((c2.authorTimestamp ?? 0) / 1e3),
|
|
72417
|
+
// The first line: the subject of the commit.
|
|
72418
|
+
message: (c2.message ?? "").split(/\r?\n/)[0] ?? ""
|
|
72419
|
+
}));
|
|
72420
|
+
} catch (error51) {
|
|
72421
|
+
if (error51 instanceof AtlassianError && (error51.status === 404 || error51.status === 400))
|
|
72422
|
+
return [];
|
|
72423
|
+
throw error51;
|
|
72424
|
+
}
|
|
72425
|
+
}
|
|
72405
72426
|
/** The newest commit on a branch, or undefined when the branch does not exist. */
|
|
72406
72427
|
async branchHead(repo, branch, signal) {
|
|
72407
72428
|
try {
|
|
@@ -72469,9 +72490,9 @@ var BitbucketClient = class {
|
|
|
72469
72490
|
return out;
|
|
72470
72491
|
}
|
|
72471
72492
|
/** A file's bytes at `at`, or undefined when it is not there. */
|
|
72472
|
-
async readBytes(repo,
|
|
72493
|
+
async readBytes(repo, path64, at, signal) {
|
|
72473
72494
|
try {
|
|
72474
|
-
return await this.rest.bytes(`reading ${
|
|
72495
|
+
return await this.rest.bytes(`reading ${path64}`, `${this.repoPath(repo)}/raw/${encodeRepoPath(path64)}?${new URLSearchParams({ at }).toString()}`, signal);
|
|
72475
72496
|
} catch (error51) {
|
|
72476
72497
|
if (error51 instanceof AtlassianError && error51.status === 404)
|
|
72477
72498
|
return void 0;
|
|
@@ -73295,8 +73316,8 @@ ${text2.slice(-2e4)}`);
|
|
|
73295
73316
|
}
|
|
73296
73317
|
/** Queues a build, then follows the queue item briefly to learn its number. */
|
|
73297
73318
|
async startBuild(job, parameters, signal) {
|
|
73298
|
-
const
|
|
73299
|
-
const response = await this.post(`starting ${job}`, parameters !== void 0 && Object.keys(parameters).length > 0 ? `${
|
|
73319
|
+
const path64 = jobPath(job, this.base);
|
|
73320
|
+
const response = await this.post(`starting ${job}`, parameters !== void 0 && Object.keys(parameters).length > 0 ? `${path64}/buildWithParameters` : `${path64}/build`, parameters ?? {}, signal);
|
|
73300
73321
|
const location = response.headers["location"];
|
|
73301
73322
|
const queueId = location === void 0 ? void 0 : /\/queue\/item\/(\d+)/.exec(location)?.[1];
|
|
73302
73323
|
if (queueId === void 0)
|
|
@@ -73333,10 +73354,10 @@ ${text2.slice(-2e4)}`);
|
|
|
73333
73354
|
}
|
|
73334
73355
|
/** Creates a job from a whole config.xml, in the folder its name gives (`folder/sub/new-job`). */
|
|
73335
73356
|
async createJob(job, xml, signal) {
|
|
73336
|
-
const
|
|
73337
|
-
const cut =
|
|
73338
|
-
const parent =
|
|
73339
|
-
const name = decodeURIComponent(
|
|
73357
|
+
const path64 = jobPath(job, this.base);
|
|
73358
|
+
const cut = path64.lastIndexOf("/job/");
|
|
73359
|
+
const parent = path64.slice(0, cut);
|
|
73360
|
+
const name = decodeURIComponent(path64.slice(cut + "/job/".length));
|
|
73340
73361
|
await this.postBody(`creating ${job}`, `${parent}/createItem?${new URLSearchParams({ name }).toString()}`, xml, "application/xml", signal);
|
|
73341
73362
|
}
|
|
73342
73363
|
/** Replaces a job's config.xml. */
|
|
@@ -73649,14 +73670,14 @@ ${client.base}${jobPath(job, client.base)}/${buildRef(params3.build)}/`
|
|
|
73649
73670
|
};
|
|
73650
73671
|
return tool;
|
|
73651
73672
|
}
|
|
73652
|
-
async function readJenkinsfile(
|
|
73653
|
-
const resolved = await resolveToolPath(context,
|
|
73673
|
+
async function readJenkinsfile(path64, context) {
|
|
73674
|
+
const resolved = await resolveToolPath(context, path64);
|
|
73654
73675
|
if (!resolved.ok)
|
|
73655
73676
|
return { ok: false, message: resolved.message };
|
|
73656
73677
|
try {
|
|
73657
73678
|
return { ok: true, text: await context.fs.readFile(resolved.realPath), realPath: resolved.realPath };
|
|
73658
73679
|
} catch (error51) {
|
|
73659
|
-
return { ok: false, message: `Could not read ${
|
|
73680
|
+
return { ok: false, message: `Could not read ${path64}: ${error51 instanceof Error ? error51.message : String(error51)}` };
|
|
73660
73681
|
}
|
|
73661
73682
|
}
|
|
73662
73683
|
var checkSchema = external_exports.object({
|
|
@@ -74431,9 +74452,9 @@ var AutosysClient = class _AutosysClient {
|
|
|
74431
74452
|
* Something this server may not offer at the documented address: undefined for a 404, so a tool can
|
|
74432
74453
|
* say which setting (`autosys.paths`) points elsewhere, rather than reporting "found nothing".
|
|
74433
74454
|
*/
|
|
74434
|
-
async optional(doing,
|
|
74455
|
+
async optional(doing, path64, signal) {
|
|
74435
74456
|
try {
|
|
74436
|
-
return asList(await this.rest.json(doing,
|
|
74457
|
+
return asList(await this.rest.json(doing, path64, { method: "GET" }, signal));
|
|
74437
74458
|
} catch (error51) {
|
|
74438
74459
|
if (error51 instanceof AtlassianError && error51.status === 404)
|
|
74439
74460
|
return void 0;
|
|
@@ -75736,13 +75757,13 @@ var MonitorHistoryStore = class {
|
|
|
75736
75757
|
if (!isSafeIndexName(index))
|
|
75737
75758
|
throw new MonitorHistoryError(`"${index}" is not a usable index name (lowercase letters, digits, - and _).`);
|
|
75738
75759
|
}
|
|
75739
|
-
async send(method,
|
|
75760
|
+
async send(method, path64, body) {
|
|
75740
75761
|
const headers = { "Content-Type": "application/json" };
|
|
75741
75762
|
const { username, password } = this.connection;
|
|
75742
75763
|
if (username !== void 0 && username.length > 0) {
|
|
75743
75764
|
headers.Authorization = `Basic ${Buffer.from(`${username}:${password ?? ""}`).toString("base64")}`;
|
|
75744
75765
|
}
|
|
75745
|
-
const url2 = `${this.connection.url.replace(/\/+$/, "")}/${encodeURIComponent(this.index)}${
|
|
75766
|
+
const url2 = `${this.connection.url.replace(/\/+$/, "")}/${encodeURIComponent(this.index)}${path64}`;
|
|
75746
75767
|
const request = { method, headers };
|
|
75747
75768
|
if (body !== void 0)
|
|
75748
75769
|
request.body = JSON.stringify(body);
|
|
@@ -76155,7 +76176,7 @@ var createSchema2 = external_exports.object({
|
|
|
76155
76176
|
name: external_exports.string().describe('kebab-case, e.g. "overnight-batch" - the monitor and its skill file.'),
|
|
76156
76177
|
title: external_exports.string().describe('What the tile says, a few words: "Overnight batch".'),
|
|
76157
76178
|
summary: external_exports.string().describe("One sentence shown on hover: what it watches and what an alert means."),
|
|
76158
|
-
audience: external_exports.enum(["me", "team"]).optional().describe(`"me": a Personal monitor, only on this computer - always possible. "team": shown under Team alerts and shared where the team shares skills; needs the team's OpenSearch history (Settings \u2192 Monitoring). Left out: team when that history is set up, otherwise personal. Use "me"
|
|
76179
|
+
audience: external_exports.enum(["me", "team"]).optional().describe(`"me": a Personal monitor, only on this computer - always possible. "team": shown under Team alerts and shared where the team shares skills; needs the team's OpenSearch history (Settings \u2192 Monitoring). Left out: team when that history is set up, otherwise personal. Use "me" whenever the user says personal, private, just for me or similar - and a request worded that way is made personal whatever is passed.`),
|
|
76159
76180
|
every: external_exports.union([external_exports.string(), external_exports.number()]).optional().describe('How often to check: "5m", "15m", "1h", "1d" (one minute at least). Leave out when "at" gives the times instead; both together check at the times and in between.'),
|
|
76160
76181
|
at: external_exports.union([external_exports.string(), external_exports.array(external_exports.string())]).optional().describe('Exact times of day: "07:30" for once a day, or ["07:30", "12:00", "18:00"]. Run on the "days" given, whatever activeHours says.'),
|
|
76161
76182
|
activeHours: external_exports.string().optional().describe('A run window for "every": "07:00-19:00" (past midnight is allowed), "09:00-" for not before nine, "-17:00" for until five.'),
|
|
@@ -76216,6 +76237,15 @@ function describeEvaluation(e) {
|
|
|
76216
76237
|
].join("\n");
|
|
76217
76238
|
}
|
|
76218
76239
|
var message2 = (error51) => error51 instanceof Error ? error51.message : String(error51);
|
|
76240
|
+
function askedAudience(text2) {
|
|
76241
|
+
const personal = /\b(personal|private|privately|just (for )?me|only (for )?me|for myself|my own|only on (this|my) (computer|machine|pc|laptop))\b/i.test(text2);
|
|
76242
|
+
const team = /\b(team|shared|for everyone|for the team|colleagues)\b/i.test(text2.replace(/\bteam (history|index|opensearch)\b/gi, ""));
|
|
76243
|
+
if (personal && !team)
|
|
76244
|
+
return "me";
|
|
76245
|
+
if (team && !personal)
|
|
76246
|
+
return "team";
|
|
76247
|
+
return void 0;
|
|
76248
|
+
}
|
|
76219
76249
|
function createMonitorCreateTool(options) {
|
|
76220
76250
|
const skillParams = (params3, block2, audience) => ({
|
|
76221
76251
|
name: params3.name,
|
|
@@ -76223,9 +76253,14 @@ function createMonitorCreateTool(options) {
|
|
|
76223
76253
|
body: monitorSkillBody(params3, block2),
|
|
76224
76254
|
audience
|
|
76225
76255
|
});
|
|
76226
|
-
const audienceFor = async (params3) => {
|
|
76256
|
+
const audienceFor = async (params3, context) => {
|
|
76257
|
+
const asked = askedAudience(context?.lastUserText?.() ?? "");
|
|
76258
|
+
if (asked === "me" && params3.audience !== "me")
|
|
76259
|
+
return { audience: "me", note: "Personal (only on this computer), as you asked." };
|
|
76227
76260
|
if (params3.audience !== void 0)
|
|
76228
76261
|
return { audience: params3.audience };
|
|
76262
|
+
if (asked === "team")
|
|
76263
|
+
return { audience: "team" };
|
|
76229
76264
|
try {
|
|
76230
76265
|
const listed = await options.channel.request("list");
|
|
76231
76266
|
if (listed.teamReady === true)
|
|
@@ -76260,7 +76295,7 @@ ${describeEvaluation(tried)}` };
|
|
|
76260
76295
|
return {
|
|
76261
76296
|
name: "monitor_create",
|
|
76262
76297
|
group: "edit",
|
|
76263
|
-
description: `Create or replace a Fire Code monitor: a check that runs on a schedule and shows on the Monitoring dashboard as a coloured tile, with a data grid whose cells or rows are coloured by alert rules, and Windows notifications at the levels the user chose. Before creating one: find an existing tool that returns the data (search_docs, or the tools you have) and reuse it; if none does, write a Python tool with create_python_tool from the template in monitor_check_tool, and run monitor_check_tool until it says PASS - then use the columns and key it gives. A SQLite database or CSV/Excel file needs no tool. Rules are judged by Fire Code itself on every check - no model is involved - so make them exact. ASK THE AUTHOR (ask_user_form, one field per rule plus a general one) what each alert means and what to do about it, unless they already said, and put it in each rule's "advice" and in "runbook": that is what an agent tells whoever meets the alert later. A team monitor needs the team's OpenSearch history set in Fire Code \u2192 Settings \u2192 Monitoring; without it the monitor is created personal (only on this computer), which always works - say so to the user.The user approves the skill file; the result shows what the first check found. ` + MONITOR_TOOL_FORMAT,
|
|
76298
|
+
description: `Create or replace a Fire Code monitor: a check that runs on a schedule and shows on the Monitoring dashboard as a coloured tile, with a data grid whose cells or rows are coloured by alert rules, and Windows notifications at the levels the user chose. Before creating one: find an existing tool that returns the data (search_docs, or the tools you have) and reuse it; if none does, write a Python tool with create_python_tool from the template in monitor_check_tool, and run monitor_check_tool until it says PASS - then use the columns and key it gives. A SQLite database or CSV/Excel file needs no tool. Rules are judged by Fire Code itself on every check - no model is involved - so make them exact. ASK THE AUTHOR (ask_user_form, one field per rule plus a general one) what each alert means and what to do about it, unless they already said, and put it in each rule's "advice" and in "runbook": that is what an agent tells whoever meets the alert later. A team monitor needs the team's OpenSearch history set in Fire Code \u2192 Settings \u2192 Monitoring; without it the monitor is created personal (only on this computer), which always works - say so to the user. The user approves the skill file; the result shows what the first check found. ` + MONITOR_TOOL_FORMAT,
|
|
76264
76299
|
parametersSchema: createSchema2,
|
|
76265
76300
|
async preview(params3, context) {
|
|
76266
76301
|
const block2 = monitorBlock(params3);
|
|
@@ -76272,7 +76307,7 @@ ${describeEvaluation(tried)}` };
|
|
|
76272
76307
|
${"tool" in params3.source ? `Run ${params3.source.tool}(${JSON.stringify(params3.source.args ?? {})})` : `Read ${JSON.stringify(params3.source)}`}`
|
|
76273
76308
|
};
|
|
76274
76309
|
}
|
|
76275
|
-
const { audience, note: forWhom } = await audienceFor(params3);
|
|
76310
|
+
const { audience, note: forWhom } = await audienceFor(params3, context);
|
|
76276
76311
|
const tried = await tryIt(block2, audience === "team");
|
|
76277
76312
|
if (!tried.ok) {
|
|
76278
76313
|
return { kind: "text", text: `This monitor cannot be created as written - nothing will be saved:
|
|
@@ -76287,7 +76322,7 @@ ${tried.error}` };
|
|
|
76287
76322
|
},
|
|
76288
76323
|
async execute(params3, context) {
|
|
76289
76324
|
const block2 = monitorBlock(params3);
|
|
76290
|
-
const { audience, note: forWhom } = params3.tryOnly === true ? { audience: "me", note: void 0 } : await audienceFor(params3);
|
|
76325
|
+
const { audience, note: forWhom } = params3.tryOnly === true ? { audience: "me", note: void 0 } : await audienceFor(params3, context);
|
|
76291
76326
|
const tried = await tryIt(block2, audience === "team");
|
|
76292
76327
|
if (!tried.ok)
|
|
76293
76328
|
return { content: `Not created: ${tried.error}`, isError: true };
|
|
@@ -77069,6 +77104,35 @@ async function repoFilesOf(options) {
|
|
|
77069
77104
|
}).map(([repoPath]) => repoPath).sort();
|
|
77070
77105
|
}
|
|
77071
77106
|
|
|
77107
|
+
// ../../packages/core/dist/sharing/provenance.js
|
|
77108
|
+
var import_node_child_process14 = require("node:child_process");
|
|
77109
|
+
var import_node_path47 = __toESM(require("node:path"), 1);
|
|
77110
|
+
var SEPARATOR = "";
|
|
77111
|
+
function git2(args, cwd) {
|
|
77112
|
+
return new Promise((resolve) => {
|
|
77113
|
+
(0, import_node_child_process14.execFile)("git", [...args], { cwd, maxBuffer: 4 * 1024 * 1024, windowsHide: true, timeout: 15e3 }, (error51, stdout) => {
|
|
77114
|
+
resolve(error51 ? void 0 : stdout);
|
|
77115
|
+
});
|
|
77116
|
+
});
|
|
77117
|
+
}
|
|
77118
|
+
function parseGitLog(text2) {
|
|
77119
|
+
return text2.split(/\r?\n/).map((line) => line.split(SEPARATOR)).filter((parts) => parts.length >= 5 && parts[0] !== "").map(([id, by, email3, at, ...message5]) => ({ id: id ?? "", by: by ?? "", ...email3 ? { email: email3 } : {}, at: Number(at), message: message5.join(SEPARATOR) })).filter((c2) => Number.isFinite(c2.at));
|
|
77120
|
+
}
|
|
77121
|
+
async function gitFileHistory(file2, limit = 50) {
|
|
77122
|
+
const dir = import_node_path47.default.dirname(file2);
|
|
77123
|
+
const top = (await git2(["rev-parse", "--show-toplevel"], dir))?.trim();
|
|
77124
|
+
if (top === void 0 || top === "")
|
|
77125
|
+
return void 0;
|
|
77126
|
+
const log = await git2(["--no-optional-locks", "log", `-n${String(limit)}`, "--follow", `--format=%h${"%x1f"}%an${"%x1f"}%ae${"%x1f"}%at${"%x1f"}%s`, "--", import_node_path47.default.basename(file2)], dir);
|
|
77127
|
+
if (log === void 0)
|
|
77128
|
+
return void 0;
|
|
77129
|
+
const commits = parseGitLog(log);
|
|
77130
|
+
if (commits.length === 0)
|
|
77131
|
+
return void 0;
|
|
77132
|
+
const status2 = await git2(["--no-optional-locks", "status", "--porcelain", "--", import_node_path47.default.basename(file2)], dir);
|
|
77133
|
+
return { source: "git", commits, ...status2 !== void 0 && status2.trim() !== "" ? { uncommitted: true } : {}, where: import_node_path47.default.relative(top, file2).split(import_node_path47.default.sep).join("/") };
|
|
77134
|
+
}
|
|
77135
|
+
|
|
77072
77136
|
// ../../packages/core/dist/platform/httpTrace.js
|
|
77073
77137
|
var SECRET_NAME = /secret|password|passwd|token|api[-_]?key|assertion|credential|session|signature|cookie/i;
|
|
77074
77138
|
var MASK = "\u2022\u2022\u2022";
|
|
@@ -78721,7 +78785,7 @@ function message3(error51) {
|
|
|
78721
78785
|
}
|
|
78722
78786
|
function filesIn(params3) {
|
|
78723
78787
|
return [
|
|
78724
|
-
...(params3.attachments ?? []).map((
|
|
78788
|
+
...(params3.attachments ?? []).map((path64) => ({ path: path64, inline: false })),
|
|
78725
78789
|
...(params3.inlineImages ?? []).map((image) => ({ path: image.path, inline: true }))
|
|
78726
78790
|
];
|
|
78727
78791
|
}
|
|
@@ -79404,17 +79468,17 @@ var WebviewApprovalGate = class {
|
|
|
79404
79468
|
// ../../packages/core/dist/platform/node/filesystem.js
|
|
79405
79469
|
var import_promises27 = __toESM(require("node:fs/promises"), 1);
|
|
79406
79470
|
var NodeFileSystem = class {
|
|
79407
|
-
async readFile(
|
|
79408
|
-
return import_promises27.default.readFile(
|
|
79471
|
+
async readFile(path64) {
|
|
79472
|
+
return import_promises27.default.readFile(path64, "utf8");
|
|
79409
79473
|
}
|
|
79410
|
-
async readBytes(
|
|
79411
|
-
return import_promises27.default.readFile(
|
|
79474
|
+
async readBytes(path64) {
|
|
79475
|
+
return import_promises27.default.readFile(path64);
|
|
79412
79476
|
}
|
|
79413
|
-
async readBytesSlice(
|
|
79477
|
+
async readBytesSlice(path64, start, end) {
|
|
79414
79478
|
const length = Math.max(0, end - start);
|
|
79415
79479
|
if (length === 0)
|
|
79416
79480
|
return Buffer.alloc(0);
|
|
79417
|
-
const handle = await import_promises27.default.open(
|
|
79481
|
+
const handle = await import_promises27.default.open(path64, "r");
|
|
79418
79482
|
try {
|
|
79419
79483
|
const buffer = Buffer.alloc(length);
|
|
79420
79484
|
const { bytesRead } = await handle.read(buffer, 0, length, start);
|
|
@@ -79423,18 +79487,18 @@ var NodeFileSystem = class {
|
|
|
79423
79487
|
await handle.close();
|
|
79424
79488
|
}
|
|
79425
79489
|
}
|
|
79426
|
-
async writeFile(
|
|
79427
|
-
await import_promises27.default.writeFile(
|
|
79490
|
+
async writeFile(path64, contents) {
|
|
79491
|
+
await import_promises27.default.writeFile(path64, contents, "utf8");
|
|
79428
79492
|
}
|
|
79429
79493
|
/** The counterpart of `readBytes`, and deliberately as bare as `writeFile` beside it. */
|
|
79430
|
-
async writeBytes(
|
|
79431
|
-
await import_promises27.default.writeFile(
|
|
79494
|
+
async writeBytes(path64, contents) {
|
|
79495
|
+
await import_promises27.default.writeFile(path64, contents);
|
|
79432
79496
|
}
|
|
79433
79497
|
async rename(from, to) {
|
|
79434
79498
|
await replaceFile(from, to);
|
|
79435
79499
|
}
|
|
79436
|
-
async stat(
|
|
79437
|
-
const stat = await import_promises27.default.lstat(
|
|
79500
|
+
async stat(path64) {
|
|
79501
|
+
const stat = await import_promises27.default.lstat(path64);
|
|
79438
79502
|
return {
|
|
79439
79503
|
size: stat.size,
|
|
79440
79504
|
mtimeMs: stat.mtimeMs,
|
|
@@ -79443,8 +79507,8 @@ var NodeFileSystem = class {
|
|
|
79443
79507
|
isSymbolicLink: stat.isSymbolicLink()
|
|
79444
79508
|
};
|
|
79445
79509
|
}
|
|
79446
|
-
async readdir(
|
|
79447
|
-
const entries = await import_promises27.default.readdir(
|
|
79510
|
+
async readdir(path64) {
|
|
79511
|
+
const entries = await import_promises27.default.readdir(path64, { withFileTypes: true });
|
|
79448
79512
|
return entries.map((entry) => ({
|
|
79449
79513
|
name: entry.name,
|
|
79450
79514
|
isFile: entry.isFile(),
|
|
@@ -79452,21 +79516,21 @@ var NodeFileSystem = class {
|
|
|
79452
79516
|
isSymbolicLink: entry.isSymbolicLink()
|
|
79453
79517
|
}));
|
|
79454
79518
|
}
|
|
79455
|
-
async exists(
|
|
79519
|
+
async exists(path64) {
|
|
79456
79520
|
try {
|
|
79457
|
-
await import_promises27.default.access(
|
|
79521
|
+
await import_promises27.default.access(path64);
|
|
79458
79522
|
return true;
|
|
79459
79523
|
} catch {
|
|
79460
79524
|
return false;
|
|
79461
79525
|
}
|
|
79462
79526
|
}
|
|
79463
|
-
async mkdir(
|
|
79464
|
-
await import_promises27.default.mkdir(
|
|
79527
|
+
async mkdir(path64) {
|
|
79528
|
+
await import_promises27.default.mkdir(path64, { recursive: true });
|
|
79465
79529
|
}
|
|
79466
79530
|
};
|
|
79467
79531
|
|
|
79468
79532
|
// ../../packages/core/dist/config/project.js
|
|
79469
|
-
var
|
|
79533
|
+
var import_node_path48 = __toESM(require("node:path"), 1);
|
|
79470
79534
|
function configuredProjectName(config2) {
|
|
79471
79535
|
const name = config2?.project?.name?.trim();
|
|
79472
79536
|
return name !== void 0 && name.length > 0 ? name : void 0;
|
|
@@ -79475,7 +79539,7 @@ function projectName(config2, workspaceRoot) {
|
|
|
79475
79539
|
const configured = configuredProjectName(config2);
|
|
79476
79540
|
if (configured !== void 0)
|
|
79477
79541
|
return configured;
|
|
79478
|
-
return workspaceRoot === void 0 ? void 0 :
|
|
79542
|
+
return workspaceRoot === void 0 ? void 0 : import_node_path48.default.basename(import_node_path48.default.resolve(workspaceRoot));
|
|
79479
79543
|
}
|
|
79480
79544
|
function projectSlug(name) {
|
|
79481
79545
|
if (name === void 0)
|
|
@@ -79485,7 +79549,7 @@ function projectSlug(name) {
|
|
|
79485
79549
|
}
|
|
79486
79550
|
|
|
79487
79551
|
// ../../packages/core/dist/rag/renameIndexes.js
|
|
79488
|
-
var
|
|
79552
|
+
var import_node_path49 = __toESM(require("node:path"), 1);
|
|
79489
79553
|
var import_node_fs8 = require("node:fs");
|
|
79490
79554
|
function planIndexRenames(names) {
|
|
79491
79555
|
const plans = [];
|
|
@@ -79549,7 +79613,7 @@ async function copyBookkeeping(directory, from, to, storeId) {
|
|
|
79549
79613
|
continue;
|
|
79550
79614
|
const target = `${to}@${storeId}.${entry.slice(prefix.length)}`;
|
|
79551
79615
|
try {
|
|
79552
|
-
await import_node_fs8.promises.copyFile(
|
|
79616
|
+
await import_node_fs8.promises.copyFile(import_node_path49.default.join(directory, entry), import_node_path49.default.join(directory, target), import_node_fs8.constants.COPYFILE_EXCL);
|
|
79553
79617
|
copied.push(target);
|
|
79554
79618
|
} catch {
|
|
79555
79619
|
}
|
|
@@ -79558,7 +79622,7 @@ async function copyBookkeeping(directory, from, to, storeId) {
|
|
|
79558
79622
|
}
|
|
79559
79623
|
|
|
79560
79624
|
// ../../packages/core/dist/platform/node/terminal.js
|
|
79561
|
-
var
|
|
79625
|
+
var import_node_child_process15 = require("node:child_process");
|
|
79562
79626
|
var NodeTerminalProcess = class {
|
|
79563
79627
|
child;
|
|
79564
79628
|
dataListeners = [];
|
|
@@ -79588,7 +79652,7 @@ var NodeTerminalProcess = class {
|
|
|
79588
79652
|
return;
|
|
79589
79653
|
if (process.platform === "win32") {
|
|
79590
79654
|
await new Promise((resolve) => {
|
|
79591
|
-
(0,
|
|
79655
|
+
(0, import_node_child_process15.execFile)("taskkill", ["/PID", String(pid), "/T", "/F"], () => resolve());
|
|
79592
79656
|
});
|
|
79593
79657
|
return;
|
|
79594
79658
|
}
|
|
@@ -79623,7 +79687,7 @@ var NodeTerminal = class {
|
|
|
79623
79687
|
}
|
|
79624
79688
|
run(command, options = {}) {
|
|
79625
79689
|
const chosen = this.shell?.trim();
|
|
79626
|
-
const child = (0,
|
|
79690
|
+
const child = (0, import_node_child_process15.spawn)(command, {
|
|
79627
79691
|
cwd: options.cwd,
|
|
79628
79692
|
env: options.env ? { ...process.env, ...options.env } : process.env,
|
|
79629
79693
|
// `true` is Node's own default shell, which is what has always run. A string names one.
|
|
@@ -79636,7 +79700,7 @@ var NodeTerminal = class {
|
|
|
79636
79700
|
|
|
79637
79701
|
// ../../packages/core/dist/platform/node/taskStore.js
|
|
79638
79702
|
var import_promises28 = __toESM(require("node:fs/promises"), 1);
|
|
79639
|
-
var
|
|
79703
|
+
var import_node_path50 = __toESM(require("node:path"), 1);
|
|
79640
79704
|
|
|
79641
79705
|
// ../../packages/core/dist/history/types.js
|
|
79642
79706
|
function taskSummary(task) {
|
|
@@ -79659,7 +79723,7 @@ var JsonTaskStore = class {
|
|
|
79659
79723
|
constructor(globalStoragePath, truncationStore, logger) {
|
|
79660
79724
|
this.truncationStore = truncationStore;
|
|
79661
79725
|
this.logger = logger;
|
|
79662
|
-
this.directory =
|
|
79726
|
+
this.directory = import_node_path50.default.join(globalStoragePath, "tasks");
|
|
79663
79727
|
}
|
|
79664
79728
|
async list(workspaceRoot) {
|
|
79665
79729
|
const index = await this.readIndex();
|
|
@@ -79708,11 +79772,11 @@ var JsonTaskStore = class {
|
|
|
79708
79772
|
await this.writeIndex(index.filter((entry) => entry.id !== id));
|
|
79709
79773
|
}
|
|
79710
79774
|
fileFor(id) {
|
|
79711
|
-
return
|
|
79775
|
+
return import_node_path50.default.join(this.directory, `${id}.json`);
|
|
79712
79776
|
}
|
|
79713
79777
|
async readIndex() {
|
|
79714
79778
|
try {
|
|
79715
|
-
const raw = await import_promises28.default.readFile(
|
|
79779
|
+
const raw = await import_promises28.default.readFile(import_node_path50.default.join(this.directory, INDEX_FILE), "utf8");
|
|
79716
79780
|
const parsed = JSON.parse(raw);
|
|
79717
79781
|
if (Array.isArray(parsed))
|
|
79718
79782
|
return parsed.filter(isIndexEntry);
|
|
@@ -79747,7 +79811,7 @@ var JsonTaskStore = class {
|
|
|
79747
79811
|
}
|
|
79748
79812
|
async writeIndex(entries) {
|
|
79749
79813
|
await import_promises28.default.mkdir(this.directory, { recursive: true });
|
|
79750
|
-
const target =
|
|
79814
|
+
const target = import_node_path50.default.join(this.directory, INDEX_FILE);
|
|
79751
79815
|
const temporary = `${target}.tmp`;
|
|
79752
79816
|
await import_promises28.default.writeFile(temporary, JSON.stringify(entries, null, 2), "utf8");
|
|
79753
79817
|
await replaceFile(temporary, target);
|
|
@@ -79779,7 +79843,7 @@ function parseTask(raw) {
|
|
|
79779
79843
|
|
|
79780
79844
|
// ../../packages/core/dist/usage/store.js
|
|
79781
79845
|
var import_node_fs9 = require("node:fs");
|
|
79782
|
-
var
|
|
79846
|
+
var import_node_path51 = __toESM(require("node:path"), 1);
|
|
79783
79847
|
|
|
79784
79848
|
// ../../packages/core/dist/s3/keys.js
|
|
79785
79849
|
function normalisePrefix(prefix) {
|
|
@@ -79912,7 +79976,7 @@ var FolderShardStore = class {
|
|
|
79912
79976
|
await this.ask({ action: "write", user: shardSegment(shard.user), day: shard.day, instance: shard.instance, events });
|
|
79913
79977
|
return;
|
|
79914
79978
|
}
|
|
79915
|
-
await this.writeAtomically(
|
|
79979
|
+
await this.writeAtomically(import_node_path51.default.join(this.root, shardSegment(shard.user), `${shard.day}__${shard.instance}.jsonl`), shardText(events));
|
|
79916
79980
|
}
|
|
79917
79981
|
async read(fromDay, toDay) {
|
|
79918
79982
|
this.lastProblems = [];
|
|
@@ -79932,8 +79996,8 @@ var FolderShardStore = class {
|
|
|
79932
79996
|
}
|
|
79933
79997
|
const files = await this.listFiles();
|
|
79934
79998
|
const wanted = selectShards(files, fromDay, toDay);
|
|
79935
|
-
const texts = await pooled(wanted, 8, (file2) => import_node_fs9.promises.readFile(
|
|
79936
|
-
this.lastProblems.push(`${
|
|
79999
|
+
const texts = await pooled(wanted, 8, (file2) => import_node_fs9.promises.readFile(import_node_path51.default.join(this.root, file2.user, file2.name), "utf8").catch((error51) => {
|
|
80000
|
+
this.lastProblems.push(`${import_node_path51.default.join(this.root, file2.user, file2.name)}: ${error51 instanceof Error ? error51.message : String(error51)}`);
|
|
79937
80001
|
return "";
|
|
79938
80002
|
}));
|
|
79939
80003
|
return texts.flatMap(parseUsageLines);
|
|
@@ -79950,7 +80014,7 @@ var FolderShardStore = class {
|
|
|
79950
80014
|
}
|
|
79951
80015
|
const files = [];
|
|
79952
80016
|
for (const user of users) {
|
|
79953
|
-
const folder =
|
|
80017
|
+
const folder = import_node_path51.default.join(this.root, user);
|
|
79954
80018
|
let names;
|
|
79955
80019
|
try {
|
|
79956
80020
|
names = await import_node_fs9.promises.readdir(folder);
|
|
@@ -79969,7 +80033,7 @@ var FolderShardStore = class {
|
|
|
79969
80033
|
}
|
|
79970
80034
|
async readShard(shard) {
|
|
79971
80035
|
try {
|
|
79972
|
-
return parseUsageLines(await import_node_fs9.promises.readFile(
|
|
80036
|
+
return parseUsageLines(await import_node_fs9.promises.readFile(import_node_path51.default.join(this.root, shardSegment(shard.user), shardFileName(shard)), "utf8"));
|
|
79973
80037
|
} catch (error51) {
|
|
79974
80038
|
if (error51.code === "ENOENT")
|
|
79975
80039
|
return void 0;
|
|
@@ -79977,10 +80041,10 @@ var FolderShardStore = class {
|
|
|
79977
80041
|
}
|
|
79978
80042
|
}
|
|
79979
80043
|
async putMonth(shard, events) {
|
|
79980
|
-
await this.writeAtomically(
|
|
80044
|
+
await this.writeAtomically(import_node_path51.default.join(this.root, shardSegment(shard.user), shardFileName(shard)), shardText(events));
|
|
79981
80045
|
}
|
|
79982
80046
|
async removeShard(shard) {
|
|
79983
|
-
await import_node_fs9.promises.rm(
|
|
80047
|
+
await import_node_fs9.promises.rm(import_node_path51.default.join(this.root, shardSegment(shard.user), shardFileName(shard)), { force: true });
|
|
79984
80048
|
}
|
|
79985
80049
|
async putProfile(user, profile) {
|
|
79986
80050
|
this.profilesFromRead = void 0;
|
|
@@ -79988,7 +80052,7 @@ var FolderShardStore = class {
|
|
|
79988
80052
|
await this.ask({ action: "writeProfile", user: shardSegment(user), profile: cleanProfile(profile) });
|
|
79989
80053
|
return;
|
|
79990
80054
|
}
|
|
79991
|
-
await this.writeAtomically(
|
|
80055
|
+
await this.writeAtomically(import_node_path51.default.join(this.root, "_profiles", `${shardSegment(user)}.json`), JSON.stringify(cleanProfile(profile)));
|
|
79992
80056
|
}
|
|
79993
80057
|
async readProfiles() {
|
|
79994
80058
|
if (this.profilesFromRead !== void 0)
|
|
@@ -79997,13 +80061,13 @@ var FolderShardStore = class {
|
|
|
79997
80061
|
await this.read("9999-12-31", "9999-12-31");
|
|
79998
80062
|
return this.profilesFromRead ?? {};
|
|
79999
80063
|
}
|
|
80000
|
-
const folder =
|
|
80064
|
+
const folder = import_node_path51.default.join(this.root, "_profiles");
|
|
80001
80065
|
const profiles = {};
|
|
80002
80066
|
for (const name of await import_node_fs9.promises.readdir(folder).catch(() => [])) {
|
|
80003
80067
|
if (!name.endsWith(".json"))
|
|
80004
80068
|
continue;
|
|
80005
80069
|
try {
|
|
80006
|
-
profiles[name.slice(0, -5)] = cleanProfile(JSON.parse(await import_node_fs9.promises.readFile(
|
|
80070
|
+
profiles[name.slice(0, -5)] = cleanProfile(JSON.parse(await import_node_fs9.promises.readFile(import_node_path51.default.join(folder, name), "utf8")));
|
|
80007
80071
|
} catch {
|
|
80008
80072
|
}
|
|
80009
80073
|
}
|
|
@@ -80752,7 +80816,7 @@ function usageCollectionOn(config2, choice) {
|
|
|
80752
80816
|
|
|
80753
80817
|
// ../../packages/core/dist/usage/backfill.js
|
|
80754
80818
|
var import_node_fs10 = require("node:fs");
|
|
80755
|
-
var
|
|
80819
|
+
var import_node_path52 = __toESM(require("node:path"), 1);
|
|
80756
80820
|
function comparablePath(value) {
|
|
80757
80821
|
return value.replace(/\\/g, "/").replace(/\/+$/, "").toLowerCase();
|
|
80758
80822
|
}
|
|
@@ -80762,7 +80826,7 @@ function eventsFromTask(task, context) {
|
|
|
80762
80826
|
return [];
|
|
80763
80827
|
const created = typeof task.createdAt === "number" && task.createdAt <= updated ? task.createdAt : updated;
|
|
80764
80828
|
const root = typeof task.workspaceRoot === "string" ? task.workspaceRoot : void 0;
|
|
80765
|
-
const project = root !== void 0 && context.workspaceRoot !== void 0 && comparablePath(root) === comparablePath(context.workspaceRoot) ? context.project : root !== void 0 ?
|
|
80829
|
+
const project = root !== void 0 && context.workspaceRoot !== void 0 && comparablePath(root) === comparablePath(context.workspaceRoot) ? context.project : root !== void 0 ? import_node_path52.default.basename(root.replace(/\\/g, "/")) : void 0;
|
|
80766
80830
|
const skillsByPath = new Map(context.skills.map((skill) => [comparablePath(skill.filePath), skill]));
|
|
80767
80831
|
const skip = new Set(context.skip);
|
|
80768
80832
|
const calls = [];
|
|
@@ -80799,7 +80863,7 @@ function eventsFromTask(task, context) {
|
|
|
80799
80863
|
let skill;
|
|
80800
80864
|
if (call.name === "read_file" && typeof call.args["path"] === "string") {
|
|
80801
80865
|
const requested2 = call.args["path"];
|
|
80802
|
-
const absolute =
|
|
80866
|
+
const absolute = import_node_path52.default.isAbsolute(requested2) || /^[A-Za-z]:[\\/]/.test(requested2) || root === void 0 ? requested2 : import_node_path52.default.join(root, requested2);
|
|
80803
80867
|
skill = skillsByPath.get(comparablePath(absolute));
|
|
80804
80868
|
}
|
|
80805
80869
|
if (call.name === "use_skill_file" && typeof call.args["skill"] === "string") {
|
|
@@ -80844,7 +80908,7 @@ async function backfillFromTasks(tasksDir, context, helper) {
|
|
|
80844
80908
|
let unreadable = 0;
|
|
80845
80909
|
for (const name of names) {
|
|
80846
80910
|
try {
|
|
80847
|
-
events.push(...eventsFromTask(JSON.parse(await import_node_fs10.promises.readFile(
|
|
80911
|
+
events.push(...eventsFromTask(JSON.parse(await import_node_fs10.promises.readFile(import_node_path52.default.join(tasksDir, name), "utf8")), context));
|
|
80848
80912
|
} catch {
|
|
80849
80913
|
unreadable++;
|
|
80850
80914
|
}
|
|
@@ -80852,13 +80916,13 @@ async function backfillFromTasks(tasksDir, context, helper) {
|
|
|
80852
80916
|
return { events, tasks: names.length, unreadable, via: "node" };
|
|
80853
80917
|
}
|
|
80854
80918
|
async function backfillOnce(options) {
|
|
80855
|
-
const doneFile =
|
|
80919
|
+
const doneFile = import_node_path52.default.join(options.usageDir, "backfill.json");
|
|
80856
80920
|
for (const file2 of [doneFile, ...options.legacyDoneFile !== void 0 ? [options.legacyDoneFile] : []]) {
|
|
80857
80921
|
if (await import_node_fs10.promises.stat(file2).then(() => true, () => false))
|
|
80858
80922
|
return { ran: false };
|
|
80859
80923
|
}
|
|
80860
80924
|
await import_node_fs10.promises.mkdir(options.usageDir, { recursive: true });
|
|
80861
|
-
const startFile =
|
|
80925
|
+
const startFile = import_node_path52.default.join(options.usageDir, "backfill-start.json");
|
|
80862
80926
|
let before;
|
|
80863
80927
|
try {
|
|
80864
80928
|
before = (options.now ?? Date.now)();
|
|
@@ -81255,8 +81319,8 @@ function wireChatBridge(services) {
|
|
|
81255
81319
|
const workspaceBranch = workspaceRoot !== void 0 ? currentBranchOf(workspaceRoot) : void 0;
|
|
81256
81320
|
const machineApprovals = services.machineApprovalsFile !== void 0 ? new FileMachineApprovals(services.machineApprovalsFile) : void 0;
|
|
81257
81321
|
const mirrorRoot = services.mirrorRoot ?? storageDir;
|
|
81258
|
-
const personalSkillsDir = services.personalDir !== void 0 ?
|
|
81259
|
-
const personalToolsDir = services.personalDir !== void 0 ?
|
|
81322
|
+
const personalSkillsDir = services.personalDir !== void 0 ? import_node_path53.default.join(services.personalDir, "skills") : void 0;
|
|
81323
|
+
const personalToolsDir = services.personalDir !== void 0 ? import_node_path53.default.join(services.personalDir, "tools") : void 0;
|
|
81260
81324
|
const logger = new Logger({ level: "debug", sink: services.logSink });
|
|
81261
81325
|
let fastFsOps;
|
|
81262
81326
|
if (services.fastFs !== void 0) {
|
|
@@ -81271,14 +81335,14 @@ function wireChatBridge(services) {
|
|
|
81271
81335
|
let cachedSecretValues = [];
|
|
81272
81336
|
const droppedFilesRoot2 = droppedFilesRoot();
|
|
81273
81337
|
const mailAttachmentsRoot2 = mailAttachmentsRoot();
|
|
81274
|
-
const droppedFilesDir =
|
|
81275
|
-
const truncationStore = new RecordingTruncationStore(new DiskTruncationStore(
|
|
81338
|
+
const droppedFilesDir = import_node_path53.default.join(droppedFilesRoot2, (0, import_node_crypto17.randomUUID)().slice(0, 8));
|
|
81339
|
+
const truncationStore = new RecordingTruncationStore(new DiskTruncationStore(import_node_path53.default.join(storageDir, "tool-results"), () => cachedSecretValues));
|
|
81276
81340
|
const taskStore = new JsonTaskStore(storageDir, truncationStore, logger);
|
|
81277
81341
|
const manifestsRoot = services.codebaseDir ?? storageDir;
|
|
81278
81342
|
const codebaseInstructionsFile = codebaseInstructionsPath({ codebaseDir: services.codebaseDir, storageDir, workspaceRoot: projectRoot });
|
|
81279
81343
|
if (services.codebaseDir !== void 0) {
|
|
81280
|
-
const shared =
|
|
81281
|
-
void import_promises29.default.access(shared).catch(() => import_promises29.default.cp(
|
|
81344
|
+
const shared = import_node_path53.default.join(services.codebaseDir, "index-manifests");
|
|
81345
|
+
void import_promises29.default.access(shared).catch(() => import_promises29.default.cp(import_node_path53.default.join(storageDir, "index-manifests"), shared, { recursive: true, errorOnExist: false, force: false })).catch(() => void 0);
|
|
81282
81346
|
}
|
|
81283
81347
|
const python = new PythonManager({
|
|
81284
81348
|
workspaceRoot,
|
|
@@ -81420,7 +81484,7 @@ ${preview.text}` } : {}
|
|
|
81420
81484
|
void postDatasetStatus();
|
|
81421
81485
|
}
|
|
81422
81486
|
});
|
|
81423
|
-
const defaultSkillsDir = workspaceRoot !== void 0 ?
|
|
81487
|
+
const defaultSkillsDir = workspaceRoot !== void 0 ? import_node_path53.default.join(workspaceRoot, ".lightcode", "skills") : void 0;
|
|
81424
81488
|
let skillsDir = defaultSkillsDir;
|
|
81425
81489
|
let localSkillsDir = defaultSkillsDir;
|
|
81426
81490
|
let extraSkillDirs = [];
|
|
@@ -81443,9 +81507,9 @@ ${preview.text}` } : {}
|
|
|
81443
81507
|
const trimmed = entry.trim();
|
|
81444
81508
|
if (trimmed.length === 0)
|
|
81445
81509
|
return void 0;
|
|
81446
|
-
if (
|
|
81447
|
-
return
|
|
81448
|
-
return workspaceRoot === void 0 ? void 0 :
|
|
81510
|
+
if (import_node_path53.default.isAbsolute(trimmed))
|
|
81511
|
+
return import_node_path53.default.resolve(trimmed);
|
|
81512
|
+
return workspaceRoot === void 0 ? void 0 : import_node_path53.default.resolve(workspaceRoot, trimmed);
|
|
81449
81513
|
}
|
|
81450
81514
|
function skillSearchPath() {
|
|
81451
81515
|
return [skillsDir, ...extraSkillDirs].filter((dir) => dir !== void 0);
|
|
@@ -81477,7 +81541,7 @@ ${preview.text}` } : {}
|
|
|
81477
81541
|
function watchSkillFolders() {
|
|
81478
81542
|
stopWatchingSkills();
|
|
81479
81543
|
const dirs = skillSearchPath();
|
|
81480
|
-
for (const dir of [...dirs, ...dirs.map((entry) =>
|
|
81544
|
+
for (const dir of [...dirs, ...dirs.map((entry) => import_node_path53.default.dirname(entry))]) {
|
|
81481
81545
|
try {
|
|
81482
81546
|
skillWatchers.push(
|
|
81483
81547
|
// Recursive, because a skill may be a folder with SKILL.md inside — a non-recursive
|
|
@@ -81554,7 +81618,7 @@ ${preview.text}` } : {}
|
|
|
81554
81618
|
await openInPanelEditor(filePath);
|
|
81555
81619
|
return;
|
|
81556
81620
|
}
|
|
81557
|
-
const real = await confineToAny(
|
|
81621
|
+
const real = await confineToAny(import_node_path53.default.resolve(filePath), roots);
|
|
81558
81622
|
await ui.openFile?.(real);
|
|
81559
81623
|
} catch (error51) {
|
|
81560
81624
|
post({ type: "error", message: error51 instanceof Error ? error51.message : String(error51) });
|
|
@@ -81565,9 +81629,9 @@ ${preview.text}` } : {}
|
|
|
81565
81629
|
python.toolsDirectory(),
|
|
81566
81630
|
...skillsDir === void 0 ? [] : [skillsDir],
|
|
81567
81631
|
...extraSkillDirs.filter((dir) => dir !== void 0),
|
|
81568
|
-
|
|
81632
|
+
import_node_path53.default.join(storageDir, "reports"),
|
|
81569
81633
|
// Its own folder: nothing else lives there.
|
|
81570
|
-
...codebaseInstructionsFile === void 0 ? [] : [
|
|
81634
|
+
...codebaseInstructionsFile === void 0 ? [] : [import_node_path53.default.dirname(codebaseInstructionsFile)]
|
|
81571
81635
|
].filter((dir) => dir.length > 0);
|
|
81572
81636
|
}
|
|
81573
81637
|
function mostlyCrlf(text2) {
|
|
@@ -81576,17 +81640,17 @@ ${preview.text}` } : {}
|
|
|
81576
81640
|
}
|
|
81577
81641
|
const EDITOR_MAX_BYTES = 2 * 1024 * 1024;
|
|
81578
81642
|
async function openInPanelEditor(filePath) {
|
|
81579
|
-
const real = await confineToAny(
|
|
81643
|
+
const real = await confineToAny(import_node_path53.default.resolve(filePath), managedRoots());
|
|
81580
81644
|
const stat = await import_promises29.default.stat(real);
|
|
81581
81645
|
if (stat.size > EDITOR_MAX_BYTES)
|
|
81582
|
-
throw new Error(`${
|
|
81646
|
+
throw new Error(`${import_node_path53.default.basename(real)} is too large to edit here (${String(Math.round(stat.size / 1024))} KB).`);
|
|
81583
81647
|
const raw = await import_promises29.default.readFile(real, "utf8");
|
|
81584
81648
|
const crlf = mostlyCrlf(raw);
|
|
81585
|
-
post({ type: "editorFile", path: real, name:
|
|
81649
|
+
post({ type: "editorFile", path: real, name: import_node_path53.default.basename(real), content: raw.split("\r\n").join("\n"), mtimeMs: stat.mtimeMs, eol: crlf ? "crlf" : "lf" });
|
|
81586
81650
|
}
|
|
81587
81651
|
async function handleSaveEditorFile(filePath, content, mtimeMs) {
|
|
81588
81652
|
try {
|
|
81589
|
-
const real = await confineToAny(
|
|
81653
|
+
const real = await confineToAny(import_node_path53.default.resolve(filePath), managedRoots());
|
|
81590
81654
|
const current = await import_promises29.default.stat(real).catch(() => void 0);
|
|
81591
81655
|
if (current !== void 0 && Math.abs(current.mtimeMs - mtimeMs) > 1) {
|
|
81592
81656
|
post({
|
|
@@ -81594,7 +81658,7 @@ ${preview.text}` } : {}
|
|
|
81594
81658
|
path: real,
|
|
81595
81659
|
ok: false,
|
|
81596
81660
|
conflict: true,
|
|
81597
|
-
message: `${
|
|
81661
|
+
message: `${import_node_path53.default.basename(real)} was changed on disk after you opened it. Copy your text, close the editor, and open it again to see the new version.`
|
|
81598
81662
|
});
|
|
81599
81663
|
return;
|
|
81600
81664
|
}
|
|
@@ -81618,7 +81682,7 @@ ${preview.text}` } : {}
|
|
|
81618
81682
|
await handleOpenManagedFile(existing.filePath);
|
|
81619
81683
|
return;
|
|
81620
81684
|
}
|
|
81621
|
-
const target =
|
|
81685
|
+
const target = import_node_path53.default.join(skillsDir, "standing-instructions.md");
|
|
81622
81686
|
try {
|
|
81623
81687
|
await import_promises29.default.mkdir(skillsDir, { recursive: true });
|
|
81624
81688
|
await import_promises29.default.writeFile(target, STANDING_SKILL_TEMPLATE, { encoding: "utf8", flag: "wx" });
|
|
@@ -81638,7 +81702,7 @@ ${preview.text}` } : {}
|
|
|
81638
81702
|
return;
|
|
81639
81703
|
}
|
|
81640
81704
|
try {
|
|
81641
|
-
await import_promises29.default.mkdir(
|
|
81705
|
+
await import_promises29.default.mkdir(import_node_path53.default.dirname(codebaseInstructionsFile), { recursive: true });
|
|
81642
81706
|
await import_promises29.default.writeFile(codebaseInstructionsFile, "", { encoding: "utf8", flag: "wx" });
|
|
81643
81707
|
} catch (error51) {
|
|
81644
81708
|
if (error51.code !== "EEXIST") {
|
|
@@ -81655,11 +81719,11 @@ ${preview.text}` } : {}
|
|
|
81655
81719
|
return;
|
|
81656
81720
|
if (!isValidToolName(name))
|
|
81657
81721
|
throw new Error(`"${name}" is not a valid tool name.`);
|
|
81658
|
-
const ownCopy =
|
|
81722
|
+
const ownCopy = import_node_path53.default.join(dir, toolFileName(name));
|
|
81659
81723
|
if (filePath !== void 0) {
|
|
81660
|
-
const same2 = (a, b) => normalizeForComparison(
|
|
81724
|
+
const same2 = (a, b) => normalizeForComparison(import_node_path53.default.resolve(a)) === normalizeForComparison(import_node_path53.default.resolve(b));
|
|
81661
81725
|
if (!same2(filePath, ownCopy)) {
|
|
81662
|
-
const fromBucket = mirroredToolsDirs.some((mirror) => same2(
|
|
81726
|
+
const fromBucket = mirroredToolsDirs.some((mirror) => same2(import_node_path53.default.dirname(filePath), mirror));
|
|
81663
81727
|
throw new Error(fromBucket ? `"${name}" at ${filePath} comes from a bucket folder, so deleting it here would be undone by the next sync. Decline it to hide this version, or remove it from the bucket to remove it for everyone.` : `${filePath} is not in the tools folder this machine writes to (${dir}), so it was not deleted.`);
|
|
81664
81728
|
}
|
|
81665
81729
|
}
|
|
@@ -81685,7 +81749,7 @@ ${preview.text}` } : {}
|
|
|
81685
81749
|
let dir;
|
|
81686
81750
|
let filePath = "";
|
|
81687
81751
|
for (const candidate of python.toolDirectories()) {
|
|
81688
|
-
const attempt =
|
|
81752
|
+
const attempt = import_node_path53.default.join(candidate, toolFileName(name));
|
|
81689
81753
|
if (await onDisk(attempt)) {
|
|
81690
81754
|
dir = candidate;
|
|
81691
81755
|
filePath = attempt;
|
|
@@ -81716,7 +81780,7 @@ ${preview.text}` } : {}
|
|
|
81716
81780
|
function samePath(a, b) {
|
|
81717
81781
|
if (a === void 0 || b === void 0)
|
|
81718
81782
|
return false;
|
|
81719
|
-
const norm2 = (value) => process.platform === "win32" ?
|
|
81783
|
+
const norm2 = (value) => process.platform === "win32" ? import_node_path53.default.resolve(value).toLowerCase() : import_node_path53.default.resolve(value);
|
|
81720
81784
|
return norm2(a) === norm2(b);
|
|
81721
81785
|
}
|
|
81722
81786
|
function publishFolder(kind, mirrors) {
|
|
@@ -81825,7 +81889,7 @@ ${preview.text}` } : {}
|
|
|
81825
81889
|
target,
|
|
81826
81890
|
...mirror.prefix !== void 0 ? { prefix: mirror.prefix } : {},
|
|
81827
81891
|
relative: entry,
|
|
81828
|
-
contents: await import_promises29.default.readFile(
|
|
81892
|
+
contents: await import_promises29.default.readFile(import_node_path53.default.join(dir, entry))
|
|
81829
81893
|
});
|
|
81830
81894
|
uploaded += 1;
|
|
81831
81895
|
} catch (error51) {
|
|
@@ -81847,7 +81911,7 @@ ${preview.text}` } : {}
|
|
|
81847
81911
|
if (!isValidToolName(name))
|
|
81848
81912
|
throw new Error(`"${name}" is not a valid tool name.`);
|
|
81849
81913
|
for (const candidate of python.toolDirectories()) {
|
|
81850
|
-
const attempt =
|
|
81914
|
+
const attempt = import_node_path53.default.join(candidate, toolFileName(name));
|
|
81851
81915
|
try {
|
|
81852
81916
|
post({ type: "pythonToolSource", name, source: await import_promises29.default.readFile(attempt, "utf8") });
|
|
81853
81917
|
return;
|
|
@@ -81900,7 +81964,7 @@ ${preview.text}` } : {}
|
|
|
81900
81964
|
continue;
|
|
81901
81965
|
for (const candidate of python.toolDirectories()) {
|
|
81902
81966
|
try {
|
|
81903
|
-
const source = await import_promises29.default.readFile(
|
|
81967
|
+
const source = await import_promises29.default.readFile(import_node_path53.default.join(candidate, toolFileName(name)), "utf8");
|
|
81904
81968
|
declined[name] = hashSource(source);
|
|
81905
81969
|
recorded += 1;
|
|
81906
81970
|
break;
|
|
@@ -81958,7 +82022,7 @@ ${preview.text}` } : {}
|
|
|
81958
82022
|
let dir;
|
|
81959
82023
|
let filePath = "";
|
|
81960
82024
|
for (const candidate of python.toolDirectories()) {
|
|
81961
|
-
const attempt =
|
|
82025
|
+
const attempt = import_node_path53.default.join(candidate, toolFileName(name));
|
|
81962
82026
|
if (await onDisk(attempt)) {
|
|
81963
82027
|
dir = candidate;
|
|
81964
82028
|
filePath = attempt;
|
|
@@ -81984,7 +82048,7 @@ ${preview.text}` } : {}
|
|
|
81984
82048
|
function mirrorForDir(sourceDir) {
|
|
81985
82049
|
if (sourceDir === void 0)
|
|
81986
82050
|
return void 0;
|
|
81987
|
-
const wanted =
|
|
82051
|
+
const wanted = import_node_path53.default.resolve(sourceDir).toLowerCase();
|
|
81988
82052
|
for (const mirror of cachedSkillMirrors) {
|
|
81989
82053
|
if (mirror.enabled !== true)
|
|
81990
82054
|
continue;
|
|
@@ -81994,7 +82058,7 @@ ${preview.text}` } : {}
|
|
|
81994
82058
|
kind: "skills",
|
|
81995
82059
|
...mirror.prefix !== void 0 ? { prefix: mirror.prefix } : {}
|
|
81996
82060
|
});
|
|
81997
|
-
if (
|
|
82061
|
+
if (import_node_path53.default.resolve(localDir).toLowerCase() === wanted)
|
|
81998
82062
|
return { mirror, localDir };
|
|
81999
82063
|
}
|
|
82000
82064
|
return void 0;
|
|
@@ -82059,8 +82123,8 @@ ${preview.text}` } : {}
|
|
|
82059
82123
|
});
|
|
82060
82124
|
let localProblem;
|
|
82061
82125
|
try {
|
|
82062
|
-
await import_promises29.default.rm(
|
|
82063
|
-
await import_promises29.default.rm(
|
|
82126
|
+
await import_promises29.default.rm(import_node_path53.default.join(found2.localDir, `${name}.md`), { force: true });
|
|
82127
|
+
await import_promises29.default.rm(import_node_path53.default.join(found2.localDir, name), { recursive: true, force: true });
|
|
82064
82128
|
} catch (error51) {
|
|
82065
82129
|
localProblem = error51 instanceof Error ? error51.message : String(error51);
|
|
82066
82130
|
}
|
|
@@ -82095,7 +82159,7 @@ ${preview.text}` } : {}
|
|
|
82095
82159
|
throw new Error(`"${name}" lives in ${existing.sourceDir}, which is a read-only skills folder. Delete the file there, or remove the folder in Settings.`);
|
|
82096
82160
|
}
|
|
82097
82161
|
const from = existing?.sourceDir !== void 0 && samePath(existing.sourceDir, personalSkillsDir) ? existing.sourceDir : skillsDir;
|
|
82098
|
-
await import_promises29.default.rm(
|
|
82162
|
+
await import_promises29.default.rm(import_node_path53.default.join(from, skillFileName(name)), { force: true });
|
|
82099
82163
|
await postSkills();
|
|
82100
82164
|
} catch (error51) {
|
|
82101
82165
|
post({ type: "error", message: error51 instanceof Error ? error51.message : String(error51) });
|
|
@@ -82277,7 +82341,7 @@ ${preview.text}` } : {}
|
|
|
82277
82341
|
let scheduleToolAccess;
|
|
82278
82342
|
const approvalsKey = projectRoot ?? "__no_workspace__";
|
|
82279
82343
|
function comparableApprovalsKey(key3) {
|
|
82280
|
-
return key3 === "__no_workspace__" ? key3 : normalizeForComparison(
|
|
82344
|
+
return key3 === "__no_workspace__" ? key3 : normalizeForComparison(import_node_path53.default.resolve(key3));
|
|
82281
82345
|
}
|
|
82282
82346
|
function approvalsFrom(stored) {
|
|
82283
82347
|
if (stored === void 0)
|
|
@@ -82488,7 +82552,7 @@ ${preview.text}` } : {}
|
|
|
82488
82552
|
...taskExpertEstimate === void 0 ? {} : { estimate: taskExpertEstimate }
|
|
82489
82553
|
});
|
|
82490
82554
|
}
|
|
82491
|
-
const expertEventsPath =
|
|
82555
|
+
const expertEventsPath = import_node_path53.default.join(storageDir, "expert-events.jsonl");
|
|
82492
82556
|
let expertEvents;
|
|
82493
82557
|
let juniorTurnWithoutExpert = false;
|
|
82494
82558
|
async function loadExpertEvents() {
|
|
@@ -82516,7 +82580,7 @@ ${preview.text}` } : {}
|
|
|
82516
82580
|
try {
|
|
82517
82581
|
const events = await loadExpertEvents();
|
|
82518
82582
|
events.push(event);
|
|
82519
|
-
await import_promises29.default.mkdir(
|
|
82583
|
+
await import_promises29.default.mkdir(import_node_path53.default.dirname(expertEventsPath), { recursive: true });
|
|
82520
82584
|
await import_promises29.default.appendFile(expertEventsPath, `${JSON.stringify(event)}
|
|
82521
82585
|
`, "utf8");
|
|
82522
82586
|
} catch (error51) {
|
|
@@ -82802,15 +82866,15 @@ ${preview.text}` } : {}
|
|
|
82802
82866
|
function contextMentionPath(file2) {
|
|
82803
82867
|
if (workspaceRoot === void 0)
|
|
82804
82868
|
return file2;
|
|
82805
|
-
const relative =
|
|
82806
|
-
return relative.length > 0 && !relative.startsWith("..") && !
|
|
82869
|
+
const relative = import_node_path53.default.relative(workspaceRoot, file2);
|
|
82870
|
+
return relative.length > 0 && !relative.startsWith("..") && !import_node_path53.default.isAbsolute(relative) ? relative.split(import_node_path53.default.sep).join("/") : file2;
|
|
82807
82871
|
}
|
|
82808
82872
|
function hostCapabilities() {
|
|
82809
82873
|
return {
|
|
82810
82874
|
// The branch this window or tab works on, shown under the chat's name; and the repository, when this
|
|
82811
82875
|
// folder is one of its branch folders (git/worktrees.ts).
|
|
82812
82876
|
...workspaceBranch !== void 0 ? { workspaceBranch } : {},
|
|
82813
|
-
...projectRoot !== void 0 && workspaceRoot !== void 0 && projectRoot !== workspaceRoot ? { branchFolderOf:
|
|
82877
|
+
...projectRoot !== void 0 && workspaceRoot !== void 0 && projectRoot !== workspaceRoot ? { branchFolderOf: import_node_path53.default.basename(projectRoot) } : {},
|
|
82814
82878
|
// The GitHub Copilot preset, offered only where VS Code's models can be reached.
|
|
82815
82879
|
hostModels: services.languageModels !== void 0,
|
|
82816
82880
|
nativeGuide: ui.openWalkthrough !== void 0,
|
|
@@ -83350,14 +83414,14 @@ ${error51.stack.split("\n").slice(1, 6).join("\n")}`;
|
|
|
83350
83414
|
}
|
|
83351
83415
|
function readUserNpmrc() {
|
|
83352
83416
|
try {
|
|
83353
|
-
return (0, import_node_fs12.readFileSync)(process.env["NPM_CONFIG_USERCONFIG"] ??
|
|
83417
|
+
return (0, import_node_fs12.readFileSync)(process.env["NPM_CONFIG_USERCONFIG"] ?? import_node_path53.default.join(import_node_os6.default.homedir(), ".npmrc"), "utf8");
|
|
83354
83418
|
} catch {
|
|
83355
83419
|
return void 0;
|
|
83356
83420
|
}
|
|
83357
83421
|
}
|
|
83358
83422
|
function addonFolders(config2) {
|
|
83359
83423
|
return {
|
|
83360
|
-
configured: (config2.addons?.folders ?? []).map((folder) =>
|
|
83424
|
+
configured: (config2.addons?.folders ?? []).map((folder) => import_node_path53.default.resolve(folder)),
|
|
83361
83425
|
defaults: defaultAddonFolders(process.env, process.execPath, process.platform, readUserNpmrc())
|
|
83362
83426
|
};
|
|
83363
83427
|
}
|
|
@@ -83638,7 +83702,7 @@ ${error51.stack.split("\n").slice(1, 6).join("\n")}`;
|
|
|
83638
83702
|
}
|
|
83639
83703
|
async function handleSaveAddonFolders(folders) {
|
|
83640
83704
|
const cleaned = [...new Set(folders.map((folder) => folder.trim()).filter((folder) => folder.length > 0))];
|
|
83641
|
-
const relative = cleaned.find((folder) => !
|
|
83705
|
+
const relative = cleaned.find((folder) => !import_node_path53.default.isAbsolute(folder));
|
|
83642
83706
|
if (relative !== void 0) {
|
|
83643
83707
|
await postAddons(`"${relative}" is not a full path. Add-on folders are full paths, such as C:\\addons.`);
|
|
83644
83708
|
return;
|
|
@@ -83649,7 +83713,7 @@ ${error51.stack.split("\n").slice(1, 6).join("\n")}`;
|
|
|
83649
83713
|
postMcp();
|
|
83650
83714
|
await postAddons();
|
|
83651
83715
|
}
|
|
83652
|
-
const shadowGit = workspaceRoot !== void 0 ? new ShadowGit(workspaceRoot,
|
|
83716
|
+
const shadowGit = workspaceRoot !== void 0 ? new ShadowGit(workspaceRoot, import_node_path53.default.join(storageDir, "checkpoints", "shadow.git"), services.codebaseDir !== void 0 ? import_node_path53.default.join(services.codebaseDir, "checkpoint-objects") : void 0) : void 0;
|
|
83653
83717
|
async function postProfiles() {
|
|
83654
83718
|
const { config: config2 } = await configManager.load();
|
|
83655
83719
|
const profiles = await Promise.all((config2.profiles ?? []).map((profile) => toSummary(profile, secrets)));
|
|
@@ -84086,7 +84150,7 @@ ${error51.stack.split("\n").slice(1, 6).join("\n")}`;
|
|
|
84086
84150
|
...schedule === void 0 ? { requestForm } : {},
|
|
84087
84151
|
// A skill read with the user's defaults for its placeholders carries them (`skills/defaults.ts`).
|
|
84088
84152
|
annotateRead: (realPath) => {
|
|
84089
|
-
const fold = (value) => process.platform === "win32" ?
|
|
84153
|
+
const fold = (value) => process.platform === "win32" ? import_node_path53.default.resolve(value).toLowerCase() : import_node_path53.default.resolve(value);
|
|
84090
84154
|
const skill = skills.find((each) => fold(each.filePath) === fold(realPath));
|
|
84091
84155
|
return skill === void 0 ? void 0 : skillDefaultsReadNote(skill.name, config2.skillDefaults?.[skill.name]);
|
|
84092
84156
|
},
|
|
@@ -84095,6 +84159,7 @@ ${error51.stack.split("\n").slice(1, 6).join("\n")}`;
|
|
|
84095
84159
|
// What the user has said, for `http_request`'s host rule. Not the images a tool returned (labelled
|
|
84096
84160
|
// user messages nobody typed) and not the loop's own nudge to continue.
|
|
84097
84161
|
userText: () => conversation.toArray().filter((message5) => message5.role === "user" && !message5.content.startsWith("[Images returned by ") && message5.content !== CONTINUE_PROMPT).map((message5) => message5.content).join("\n"),
|
|
84162
|
+
lastUserText: () => conversation.toArray().filter((message5) => message5.role === "user" && !message5.content.startsWith("[Images returned by ") && message5.content !== CONTINUE_PROMPT).at(-1)?.content ?? "",
|
|
84098
84163
|
signal: activeAbortController.signal,
|
|
84099
84164
|
/*
|
|
84100
84165
|
* Supplied by the host, not imported by core: the binary is platform-specific and
|
|
@@ -84715,8 +84780,8 @@ ${direction}` : attachMentions(text2, mentions);
|
|
|
84715
84780
|
const fromHub = hub === void 0 || root !== workspaceRoot ? void 0 : await hubGitDiff(hub);
|
|
84716
84781
|
if (typeof fromHub === "string")
|
|
84717
84782
|
throw new Error(fromHub);
|
|
84718
|
-
const
|
|
84719
|
-
const child = (0,
|
|
84783
|
+
const git3 = (args) => new Promise((resolve) => {
|
|
84784
|
+
const child = (0, import_node_child_process16.spawn)("git", ["--no-optional-locks", "-C", root, ...args], {
|
|
84720
84785
|
env: { ...process.env, GIT_TERMINAL_PROMPT: "0" },
|
|
84721
84786
|
windowsHide: true
|
|
84722
84787
|
});
|
|
@@ -84732,15 +84797,15 @@ ${direction}` : attachMentions(text2, mentions);
|
|
|
84732
84797
|
resolve({ ok: code === 0, out });
|
|
84733
84798
|
});
|
|
84734
84799
|
});
|
|
84735
|
-
const status2 = fromHub !== void 0 ? { ok: true, out: fromHub.status } : await
|
|
84800
|
+
const status2 = fromHub !== void 0 ? { ok: true, out: fromHub.status } : await git3(["status", "--short", "--untracked-files=normal"]);
|
|
84736
84801
|
if (!status2.ok)
|
|
84737
84802
|
throw new Error("This folder is not a git repository, or git could not be run.");
|
|
84738
84803
|
if (status2.out.trim().length === 0)
|
|
84739
84804
|
throw new Error("Nothing has changed, so there is nothing to describe.");
|
|
84740
|
-
const staged = fromHub === void 0 && options.preferStaged === true ? await
|
|
84741
|
-
let diff = fromHub !== void 0 ? { ok: true, out: fromHub.diff } : staged !== void 0 && staged.ok && staged.out.trim().length > 0 ? staged : await
|
|
84805
|
+
const staged = fromHub === void 0 && options.preferStaged === true ? await git3(["diff", "--cached", "--no-color", "--no-ext-diff", "--stat", "--patch"]) : void 0;
|
|
84806
|
+
let diff = fromHub !== void 0 ? { ok: true, out: fromHub.diff } : staged !== void 0 && staged.ok && staged.out.trim().length > 0 ? staged : await git3(["diff", "HEAD", "--no-color", "--no-ext-diff", "--stat", "--patch"]);
|
|
84742
84807
|
if (!diff.ok)
|
|
84743
|
-
diff = await
|
|
84808
|
+
diff = await git3(["diff", "--no-color", "--no-ext-diff", "--stat", "--patch"]);
|
|
84744
84809
|
const shown2 = diff.out.length > 24e3 ? `${diff.out.slice(0, 24e3)}
|
|
84745
84810
|
... (diff cut here)` : diff.out;
|
|
84746
84811
|
const config2 = await loadSettings();
|
|
@@ -85347,7 +85412,7 @@ ${redact(shown2, cachedSecretValues)}` }
|
|
|
85347
85412
|
return { mode: cachedSearchScope, author: cachedAttribution.author };
|
|
85348
85413
|
}
|
|
85349
85414
|
function currentProjectNames() {
|
|
85350
|
-
const names = [cachedAttribution.project, workspaceRoot !== void 0 ?
|
|
85415
|
+
const names = [cachedAttribution.project, workspaceRoot !== void 0 ? import_node_path53.default.basename(workspaceRoot) : void 0];
|
|
85351
85416
|
return names.filter((name) => name !== void 0 && name.length > 0);
|
|
85352
85417
|
}
|
|
85353
85418
|
function indexProject(config2) {
|
|
@@ -85450,8 +85515,8 @@ ${redact(shown2, cachedSecretValues)}` }
|
|
|
85450
85515
|
limit: limits.limit,
|
|
85451
85516
|
previewChars: limits.previewChars
|
|
85452
85517
|
});
|
|
85453
|
-
for (const
|
|
85454
|
-
skipped.add(
|
|
85518
|
+
for (const path64 of answer.skipped ?? [])
|
|
85519
|
+
skipped.add(path64);
|
|
85455
85520
|
return { messages: answer.messages, truncated: answer.truncated };
|
|
85456
85521
|
},
|
|
85457
85522
|
...embedder !== void 0 && search !== void 0 && collection !== void 0 ? {
|
|
@@ -85750,9 +85815,9 @@ ${redact(shown2, cachedSecretValues)}` }
|
|
|
85750
85815
|
});
|
|
85751
85816
|
const all = result.folders.map((entry) => entry.path);
|
|
85752
85817
|
const wanted = new Set(chosen);
|
|
85753
|
-
for (const
|
|
85754
|
-
if (chosen.some((root) =>
|
|
85755
|
-
wanted.add(
|
|
85818
|
+
for (const path64 of all) {
|
|
85819
|
+
if (chosen.some((root) => path64 === root || path64.startsWith(`${root}\\`)))
|
|
85820
|
+
wanted.add(path64);
|
|
85756
85821
|
}
|
|
85757
85822
|
return [...wanted];
|
|
85758
85823
|
} catch {
|
|
@@ -85760,7 +85825,7 @@ ${redact(shown2, cachedSecretValues)}` }
|
|
|
85760
85825
|
}
|
|
85761
85826
|
}
|
|
85762
85827
|
async function handleRequestOutlookFolders(depth, force = false) {
|
|
85763
|
-
const cachePath =
|
|
85828
|
+
const cachePath = import_node_path53.default.join(storageDir, "outlook-folders.json");
|
|
85764
85829
|
let served = false;
|
|
85765
85830
|
try {
|
|
85766
85831
|
const cached2 = JSON.parse(await import_promises29.default.readFile(cachePath, "utf8"));
|
|
@@ -85780,7 +85845,7 @@ ${redact(shown2, cachedSecretValues)}` }
|
|
|
85780
85845
|
const scannedAt = Date.now();
|
|
85781
85846
|
post({ type: "outlookFolders", folders: result.folders, scannedAt });
|
|
85782
85847
|
try {
|
|
85783
|
-
await import_promises29.default.mkdir(
|
|
85848
|
+
await import_promises29.default.mkdir(import_node_path53.default.dirname(cachePath), { recursive: true });
|
|
85784
85849
|
await import_promises29.default.writeFile(cachePath, JSON.stringify({ scannedAt, folders: result.folders }), "utf8");
|
|
85785
85850
|
} catch {
|
|
85786
85851
|
}
|
|
@@ -86324,6 +86389,8 @@ ${redact(shown2, cachedSecretValues)}` }
|
|
|
86324
86389
|
}
|
|
86325
86390
|
return { ok: true, data: { synced } };
|
|
86326
86391
|
}
|
|
86392
|
+
case "history":
|
|
86393
|
+
return { ok: true, data: await fileHistory(request.file) ?? null };
|
|
86327
86394
|
case "skill": {
|
|
86328
86395
|
const done = request.op === "write" ? await writeTeamMonitorSkill(request.file, request.content ?? "") : await deleteEverywhere(await planDeleteEverywhere("skill", request.name));
|
|
86329
86396
|
return done.ok ? { ok: true, data: done.message } : { ok: false, error: done.message };
|
|
@@ -86691,12 +86758,12 @@ ${redact(shown2, cachedSecretValues)}` }
|
|
|
86691
86758
|
if (!isSafeSegment(settings.project) || !isSafeSegment(settings.repo))
|
|
86692
86759
|
return { reason: "Enter the project key and repository slug." };
|
|
86693
86760
|
const digest = (0, import_node_crypto17.createHash)("sha256").update(JSON.stringify([bitbucket.baseUrl, settings.project, settings.repo, settings.branch, settings.folder]).toLowerCase()).digest("hex").slice(0, 12);
|
|
86694
|
-
const root =
|
|
86761
|
+
const root = import_node_path53.default.join(mirrorRoot, "teamrepo", `${settings.project}-${settings.repo}-${digest}`.toLowerCase());
|
|
86695
86762
|
return {
|
|
86696
|
-
dirs: { skills:
|
|
86763
|
+
dirs: { skills: import_node_path53.default.join(root, "skills"), tools: import_node_path53.default.join(root, "tools") },
|
|
86697
86764
|
// Where new skills and tools are saved while the repository is on - see loadSettings and pythonFolders.
|
|
86698
|
-
own: { skills:
|
|
86699
|
-
stateFile:
|
|
86765
|
+
own: { skills: import_node_path53.default.join(root, "saved-here", "skills"), tools: import_node_path53.default.join(root, "saved-here", "tools") },
|
|
86766
|
+
stateFile: import_node_path53.default.join(root, TEAM_REPO_STATE_FILE),
|
|
86700
86767
|
settings
|
|
86701
86768
|
};
|
|
86702
86769
|
}
|
|
@@ -86735,6 +86802,31 @@ ${redact(shown2, cachedSecretValues)}` }
|
|
|
86735
86802
|
commitFile: (file2) => client.commitFile(repoRef, file2)
|
|
86736
86803
|
};
|
|
86737
86804
|
}
|
|
86805
|
+
async function fileHistory(file2) {
|
|
86806
|
+
const config2 = await loadSettings();
|
|
86807
|
+
const plan3 = teamRepoPlan(config2);
|
|
86808
|
+
if (!("reason" in plan3)) {
|
|
86809
|
+
const norm2 = (value) => process.platform === "win32" ? import_node_path53.default.resolve(value).toLowerCase() : import_node_path53.default.resolve(value);
|
|
86810
|
+
const folders = [
|
|
86811
|
+
...[plan3.dirs.skills, plan3.own.skills, ...skillSearchPath()].map((dir) => [dir, "skills"]),
|
|
86812
|
+
...[plan3.dirs.tools, plan3.own.tools, ...python.toolDirectories()].map((dir) => [dir, "tools"])
|
|
86813
|
+
];
|
|
86814
|
+
const holder = folders.find(([dir]) => norm2(file2).startsWith(norm2(dir) + import_node_path53.default.sep));
|
|
86815
|
+
if (holder !== void 0) {
|
|
86816
|
+
const relative = import_node_path53.default.relative(import_node_path53.default.resolve(holder[0]), import_node_path53.default.resolve(file2)).split(import_node_path53.default.sep).join("/");
|
|
86817
|
+
const where = repoPathFor(plan3.settings.folder, holder[1], relative);
|
|
86818
|
+
try {
|
|
86819
|
+
const client = await bitbucketClient();
|
|
86820
|
+
const commits = await client.fileCommits({ project: plan3.settings.project, repo: plan3.settings.repo }, where, plan3.settings.branch);
|
|
86821
|
+
if (commits.length > 0)
|
|
86822
|
+
return { source: "bitbucket", commits, where: `${plan3.settings.project}/${plan3.settings.repo} ${where}` };
|
|
86823
|
+
} catch (error51) {
|
|
86824
|
+
logger.warn("reading a file history from the team repository failed", error51 instanceof Error ? error51.message : String(error51));
|
|
86825
|
+
}
|
|
86826
|
+
}
|
|
86827
|
+
}
|
|
86828
|
+
return gitFileHistory(file2);
|
|
86829
|
+
}
|
|
86738
86830
|
async function planDeleteEverywhere(kind, name) {
|
|
86739
86831
|
const plan3 = { kind, name, local: [], buckets: [], repo: [], notes: [] };
|
|
86740
86832
|
const valid = kind === "skill" ? isValidSkillName(name) : isValidToolName(name);
|
|
@@ -86753,21 +86845,21 @@ ${redact(shown2, cachedSecretValues)}` }
|
|
|
86753
86845
|
const has2 = async (target) => import_promises29.default.stat(target).then(() => true, () => false);
|
|
86754
86846
|
if (kind === "skill") {
|
|
86755
86847
|
for (const dir of unique([skillsDir, localSkillsDir, personalSkillsDir, ...mirroredSkillsDirs])) {
|
|
86756
|
-
if (await has2(
|
|
86757
|
-
plan3.local.push(
|
|
86758
|
-
if (await has2(
|
|
86759
|
-
plan3.local.push(
|
|
86848
|
+
if (await has2(import_node_path53.default.join(dir, skillFileName(name))))
|
|
86849
|
+
plan3.local.push(import_node_path53.default.join(dir, skillFileName(name)));
|
|
86850
|
+
if (await has2(import_node_path53.default.join(dir, name, "SKILL.md")))
|
|
86851
|
+
plan3.local.push(import_node_path53.default.join(dir, name));
|
|
86760
86852
|
}
|
|
86761
86853
|
for (const extra of config2.skills?.paths ?? []) {
|
|
86762
86854
|
const dir = resolveSkillDir(extra);
|
|
86763
|
-
if (dir !== void 0 && (await has2(
|
|
86855
|
+
if (dir !== void 0 && (await has2(import_node_path53.default.join(dir, skillFileName(name))) || await has2(import_node_path53.default.join(dir, name, "SKILL.md")))) {
|
|
86764
86856
|
plan3.notes.push(`Also in ${dir}, a folder you added in Settings -> Skills - not removed; delete it there.`);
|
|
86765
86857
|
}
|
|
86766
86858
|
}
|
|
86767
86859
|
} else {
|
|
86768
86860
|
for (const dir of unique([pythonFolders(config2).toolsDir, localToolsDir(config2), personalToolsDir, ...mirroredToolsDirs])) {
|
|
86769
|
-
if (await has2(
|
|
86770
|
-
plan3.local.push(
|
|
86861
|
+
if (await has2(import_node_path53.default.join(dir, toolFileName(name))))
|
|
86862
|
+
plan3.local.push(import_node_path53.default.join(dir, toolFileName(name)));
|
|
86771
86863
|
}
|
|
86772
86864
|
}
|
|
86773
86865
|
const mirrors = (kind === "skill" ? cachedSkillMirrors : cachedToolMirrors).filter((mirror) => mirror.enabled === true);
|
|
@@ -86858,7 +86950,7 @@ ${redact(shown2, cachedSecretValues)}` }
|
|
|
86858
86950
|
try {
|
|
86859
86951
|
await import_promises29.default.rm(entry, { recursive: true, force: true });
|
|
86860
86952
|
if (kind === "tool")
|
|
86861
|
-
await forgetTool(
|
|
86953
|
+
await forgetTool(import_node_path53.default.dirname(entry), name).catch(() => void 0);
|
|
86862
86954
|
} catch (error51) {
|
|
86863
86955
|
localProblems.push(`${entry} (${error51 instanceof Error ? error51.message : String(error51)})`);
|
|
86864
86956
|
}
|
|
@@ -86884,24 +86976,24 @@ ${redact(shown2, cachedSecretValues)}` }
|
|
|
86884
86976
|
}
|
|
86885
86977
|
async function writeTeamMonitorSkill(file2, content) {
|
|
86886
86978
|
const config2 = await loadSettings();
|
|
86887
|
-
const norm2 = (value) => process.platform === "win32" ?
|
|
86979
|
+
const norm2 = (value) => process.platform === "win32" ? import_node_path53.default.resolve(value).toLowerCase() : import_node_path53.default.resolve(value);
|
|
86888
86980
|
const inside = (dir) => {
|
|
86889
86981
|
const target = norm2(file2);
|
|
86890
86982
|
const root = norm2(dir);
|
|
86891
|
-
return target.startsWith(root +
|
|
86983
|
+
return target.startsWith(root + import_node_path53.default.sep) ? import_node_path53.default.relative(import_node_path53.default.resolve(dir), import_node_path53.default.resolve(file2)) : void 0;
|
|
86892
86984
|
};
|
|
86893
86985
|
const saveIn = async (dir, relative) => {
|
|
86894
|
-
const destination =
|
|
86986
|
+
const destination = import_node_path53.default.join(dir, relative);
|
|
86895
86987
|
const enabled = cachedSkillMirrors.filter((each) => each.enabled === true);
|
|
86896
86988
|
const mirror = enabled.find((_, i) => samePath(mirroredSkillsDirs[i], dir));
|
|
86897
86989
|
const target = mirror !== void 0 ? targetById(cachedS3, mirror.connectionId) : void 0;
|
|
86898
86990
|
if (mirror !== void 0 && (target === void 0 || target.readOnly === true)) {
|
|
86899
86991
|
throw new Error(`${target?.label ?? mirror.connectionId} is read-only here, so this team monitor cannot be changed from this computer - ask whoever owns that bucket.`);
|
|
86900
86992
|
}
|
|
86901
|
-
await import_promises29.default.mkdir(
|
|
86993
|
+
await import_promises29.default.mkdir(import_node_path53.default.dirname(destination), { recursive: true });
|
|
86902
86994
|
await writeFileAtomically(destination, content);
|
|
86903
86995
|
if (mirror !== void 0 && target !== void 0) {
|
|
86904
|
-
await uploadToS3({ target, ...mirror.prefix !== void 0 ? { prefix: mirror.prefix } : {}, relative: relative.split(
|
|
86996
|
+
await uploadToS3({ target, ...mirror.prefix !== void 0 ? { prefix: mirror.prefix } : {}, relative: relative.split(import_node_path53.default.sep).join("/"), contents: Buffer.from(content, "utf8") });
|
|
86905
86997
|
return `uploaded to the bucket ${target.label}`;
|
|
86906
86998
|
}
|
|
86907
86999
|
return `saved in ${dir}`;
|
|
@@ -86923,7 +87015,7 @@ ${redact(shown2, cachedSecretValues)}` }
|
|
|
86923
87015
|
throw new Error("There is no folder to save skills in, so the change cannot reach the team repository.");
|
|
86924
87016
|
const where = await saveIn(skillsDir, relative);
|
|
86925
87017
|
await handleTeamRepoSync("a monitor changed on the dashboard");
|
|
86926
|
-
const problem = teamRepoStatus?.error ?? teamRepoStatus?.conflicts.find((c2) => c2.path.endsWith(relative.split(
|
|
87018
|
+
const problem = teamRepoStatus?.error ?? teamRepoStatus?.conflicts.find((c2) => c2.path.endsWith(relative.split(import_node_path53.default.sep).join("/")))?.reason;
|
|
86927
87019
|
if (problem !== void 0) {
|
|
86928
87020
|
return { ok: false, message: `Saved here (${where}), but not committed to the team repository: ${problem}. Nothing was overwritten - see Settings \u2192 DevOps \u2192 Team repository.` };
|
|
86929
87021
|
}
|
|
@@ -86953,8 +87045,8 @@ ${redact(shown2, cachedSecretValues)}` }
|
|
|
86953
87045
|
function isPersonalSkill(skill) {
|
|
86954
87046
|
if (personalSkillsDir === void 0)
|
|
86955
87047
|
return false;
|
|
86956
|
-
const norm2 = (value) => process.platform === "win32" ?
|
|
86957
|
-
return norm2(skill.filePath).startsWith(norm2(personalSkillsDir) +
|
|
87048
|
+
const norm2 = (value) => process.platform === "win32" ? import_node_path53.default.resolve(value).toLowerCase() : import_node_path53.default.resolve(value);
|
|
87049
|
+
return norm2(skill.filePath).startsWith(norm2(personalSkillsDir) + import_node_path53.default.sep);
|
|
86958
87050
|
}
|
|
86959
87051
|
function bucketFolderLabels(config2) {
|
|
86960
87052
|
const label = (kind, mirror) => {
|
|
@@ -87202,7 +87294,7 @@ ${redact(shown2, cachedSecretValues)}` }
|
|
|
87202
87294
|
}
|
|
87203
87295
|
const command = config2.branches?.setupCommand?.trim();
|
|
87204
87296
|
if (command !== void 0 && command.length > 0) {
|
|
87205
|
-
const label = workspaceBranch ??
|
|
87297
|
+
const label = workspaceBranch ?? import_node_path53.default.basename(workspaceRoot);
|
|
87206
87298
|
if (ui.runInTerminal !== void 0) {
|
|
87207
87299
|
ui.runInTerminal({ name: `Set up ${label}`, command, cwd: workspaceRoot, env: branchEnv });
|
|
87208
87300
|
parts.push(`running "${command}" in a terminal`);
|
|
@@ -87276,7 +87368,7 @@ ${last}` : ""}`);
|
|
|
87276
87368
|
approvalStamps.set("machine", stamp2);
|
|
87277
87369
|
}
|
|
87278
87370
|
for (const dir of python.toolDirectories()) {
|
|
87279
|
-
const file2 =
|
|
87371
|
+
const file2 = import_node_path53.default.join(dir, REGISTRY_FILE);
|
|
87280
87372
|
const stamp2 = await import_promises29.default.stat(file2).then((stat) => stat.mtimeMs, () => 0);
|
|
87281
87373
|
if (approvalStamps.has(file2) && approvalStamps.get(file2) !== stamp2)
|
|
87282
87374
|
changed = true;
|
|
@@ -87378,7 +87470,7 @@ ${last}` : ""}`);
|
|
|
87378
87470
|
return;
|
|
87379
87471
|
}
|
|
87380
87472
|
const folder = skill.filePath.slice(0, skill.filePath.length - "SKILL.md".length);
|
|
87381
|
-
const bytes = await import_promises29.default.readFile(
|
|
87473
|
+
const bytes = await import_promises29.default.readFile(import_node_path53.default.join(folder, SKILL_IMAGE_DIR, image));
|
|
87382
87474
|
const dataUri = skillImageDataUri(image, bytes);
|
|
87383
87475
|
post({
|
|
87384
87476
|
type: "skillImage",
|
|
@@ -87705,7 +87797,7 @@ ${last}` : ""}`);
|
|
|
87705
87797
|
return withoutRipgrep();
|
|
87706
87798
|
try {
|
|
87707
87799
|
const listed = await new Promise((resolve, reject2) => {
|
|
87708
|
-
const child = (0,
|
|
87800
|
+
const child = (0, import_node_child_process16.spawn)(ripgrepPath, ["--files", "--hidden", "--glob", "!.git"], {
|
|
87709
87801
|
cwd: workspaceRoot
|
|
87710
87802
|
});
|
|
87711
87803
|
let out = "";
|
|
@@ -87744,13 +87836,13 @@ ${last}` : ""}`);
|
|
|
87744
87836
|
}
|
|
87745
87837
|
function docsFingerprintPath(index, storeId, kind) {
|
|
87746
87838
|
const suffix = kind === void 0 ? "docs" : `docs.${kind}`;
|
|
87747
|
-
return
|
|
87839
|
+
return import_node_path53.default.join(manifestsRoot, "index-manifests", `${manifestKey(index, storeId)}.${suffix}.json`);
|
|
87748
87840
|
}
|
|
87749
87841
|
function manifestKey(index, storeId) {
|
|
87750
87842
|
return `${index}@${storeId}`;
|
|
87751
87843
|
}
|
|
87752
87844
|
function manifestPath(index, storeId) {
|
|
87753
|
-
return
|
|
87845
|
+
return import_node_path53.default.join(manifestsRoot, "index-manifests", `${manifestKey(index, storeId)}.json`);
|
|
87754
87846
|
}
|
|
87755
87847
|
async function readDocsFingerprint(index, storeId, kind) {
|
|
87756
87848
|
try {
|
|
@@ -87814,7 +87906,7 @@ ${last}` : ""}`);
|
|
|
87814
87906
|
}
|
|
87815
87907
|
options.report?.("Writing", { done: 0, total: documents.length });
|
|
87816
87908
|
await writer.upsert(index, documents);
|
|
87817
|
-
await import_promises29.default.mkdir(
|
|
87909
|
+
await import_promises29.default.mkdir(import_node_path53.default.dirname(docsFingerprintPath(index, search.id, wanted)), {
|
|
87818
87910
|
recursive: true
|
|
87819
87911
|
});
|
|
87820
87912
|
await import_promises29.default.writeFile(docsFingerprintPath(index, search.id, wanted), JSON.stringify({ fingerprint, indexedAt: Date.now(), count: documents.length }), "utf8");
|
|
@@ -88004,7 +88096,7 @@ ${last}` : ""}`);
|
|
|
88004
88096
|
});
|
|
88005
88097
|
if (manifest !== void 0) {
|
|
88006
88098
|
const targetPath = manifestPath(index, target.id);
|
|
88007
|
-
await import_promises29.default.mkdir(
|
|
88099
|
+
await import_promises29.default.mkdir(import_node_path53.default.dirname(targetPath), { recursive: true });
|
|
88008
88100
|
await import_promises29.default.writeFile(targetPath, JSON.stringify(manifest), "utf8");
|
|
88009
88101
|
}
|
|
88010
88102
|
post({ type: "storeSync", running: false, copied: result.copied, fromLabel: source.label });
|
|
@@ -88053,7 +88145,7 @@ ${last}` : ""}`);
|
|
|
88053
88145
|
type: "project",
|
|
88054
88146
|
hasWorkspace: workspaceRoot !== void 0,
|
|
88055
88147
|
...configured !== void 0 ? { configured } : {},
|
|
88056
|
-
...workspaceRoot !== void 0 ? { folder:
|
|
88148
|
+
...workspaceRoot !== void 0 ? { folder: import_node_path53.default.basename(workspaceRoot) } : {},
|
|
88057
88149
|
...author !== void 0 ? { author } : {},
|
|
88058
88150
|
...index !== void 0 ? { indexName: index } : {},
|
|
88059
88151
|
...ownerConfigured !== void 0 && ownerConfigured.length > 0 ? { ownerConfigured } : {},
|
|
@@ -88193,11 +88285,11 @@ ${last}` : ""}`);
|
|
|
88193
88285
|
if (workspaceRoot === void 0)
|
|
88194
88286
|
return found2;
|
|
88195
88287
|
const root = workspaceRoot;
|
|
88196
|
-
const relative =
|
|
88197
|
-
if (relative.startsWith("..") ||
|
|
88288
|
+
const relative = import_node_path53.default.relative(root, folder);
|
|
88289
|
+
if (relative.startsWith("..") || import_node_path53.default.isAbsolute(relative))
|
|
88198
88290
|
return found2;
|
|
88199
88291
|
const output = await new Promise((resolve) => {
|
|
88200
|
-
const child = (0,
|
|
88292
|
+
const child = (0, import_node_child_process16.spawn)("git", ["-c", "core.quotePath=false", "log", "--diff-filter=A", "--relative", "--format=@@%an", "--name-only", "--", relative.length > 0 ? relative : "."], {
|
|
88201
88293
|
cwd: root,
|
|
88202
88294
|
windowsHide: true
|
|
88203
88295
|
});
|
|
@@ -88211,7 +88303,7 @@ ${last}` : ""}`);
|
|
|
88211
88303
|
if (line.startsWith("@@"))
|
|
88212
88304
|
author = line.slice(2).trim();
|
|
88213
88305
|
else if (line.trim().length > 0 && author !== void 0 && author.length > 0) {
|
|
88214
|
-
found2.set(normalizeForComparison(
|
|
88306
|
+
found2.set(normalizeForComparison(import_node_path53.default.resolve(root, line.trim())), author);
|
|
88215
88307
|
}
|
|
88216
88308
|
}
|
|
88217
88309
|
return found2;
|
|
@@ -88255,7 +88347,7 @@ ${last}` : ""}`);
|
|
|
88255
88347
|
},
|
|
88256
88348
|
source,
|
|
88257
88349
|
folder,
|
|
88258
|
-
relative:
|
|
88350
|
+
relative: import_node_path53.default.relative(folder, filePath).split(import_node_path53.default.sep).join("/")
|
|
88259
88351
|
});
|
|
88260
88352
|
};
|
|
88261
88353
|
for (const folder of skillFolders) {
|
|
@@ -88273,7 +88365,7 @@ ${last}` : ""}`);
|
|
|
88273
88365
|
const name = entry.slice(0, -3);
|
|
88274
88366
|
if (!isValidToolName(name))
|
|
88275
88367
|
continue;
|
|
88276
|
-
await consider("tool", name,
|
|
88368
|
+
await consider("tool", name, import_node_path53.default.join(folder, entry), folder, location);
|
|
88277
88369
|
}
|
|
88278
88370
|
}
|
|
88279
88371
|
const readOnly = skills.filter((skill) => skill.sourceDir !== void 0 && !skillFolders.some((folder) => samePath(folder, skill.sourceDir))).length;
|
|
@@ -88305,7 +88397,7 @@ ${last}` : ""}`);
|
|
|
88305
88397
|
} catch {
|
|
88306
88398
|
}
|
|
88307
88399
|
}
|
|
88308
|
-
const gitAuthor = gitAuthors.get(normalizeForComparison(
|
|
88400
|
+
const gitAuthor = gitAuthors.get(normalizeForComparison(import_node_path53.default.resolve(candidate.entry.filePath)));
|
|
88309
88401
|
if (gitAuthor !== void 0) {
|
|
88310
88402
|
candidate.entry.suggestion = { author: gitAuthor, source: "git: the commit that added this file" };
|
|
88311
88403
|
}
|
|
@@ -88414,7 +88506,7 @@ ${last}` : ""}`);
|
|
|
88414
88506
|
aliases: plan3.kind === "codebase" ? codebaseAliases(config2) : plan3.kind === "skills" ? skillAliases(config2) : [],
|
|
88415
88507
|
onProgress: (count3) => post({ type: "indexRenames", running: true, plans, store, current: plan3.to, copied: count3 })
|
|
88416
88508
|
});
|
|
88417
|
-
await copyBookkeeping(
|
|
88509
|
+
await copyBookkeeping(import_node_path53.default.join(manifestsRoot, "index-manifests"), plan3.from, plan3.to, search.id);
|
|
88418
88510
|
done.push({ ...plan3, copied });
|
|
88419
88511
|
}
|
|
88420
88512
|
post({ type: "indexRenames", running: false, plans: [], store, done });
|
|
@@ -88444,7 +88536,7 @@ ${last}` : ""}`);
|
|
|
88444
88536
|
project: projectName(config2, workspaceRoot),
|
|
88445
88537
|
aliases: codebaseAliases(config2)
|
|
88446
88538
|
});
|
|
88447
|
-
await copyBookkeeping(
|
|
88539
|
+
await copyBookkeeping(import_node_path53.default.join(manifestsRoot, "index-manifests"), legacy, current, search.id);
|
|
88448
88540
|
post({ type: "indexRenames", running: false, plans: [], done: [{ kind: "codebase", from: legacy, to: current, copied }] });
|
|
88449
88541
|
logger.info(`copied ${String(copied)} chunks from ${legacy} to ${current} rather than re-embedding them`);
|
|
88450
88542
|
}
|
|
@@ -88610,7 +88702,7 @@ ${last}` : ""}`);
|
|
|
88610
88702
|
denylist,
|
|
88611
88703
|
manifest,
|
|
88612
88704
|
saveManifest: async (next) => {
|
|
88613
|
-
await import_promises29.default.mkdir(
|
|
88705
|
+
await import_promises29.default.mkdir(import_node_path53.default.dirname(manifestFile), { recursive: true });
|
|
88614
88706
|
await import_promises29.default.writeFile(manifestFile, JSON.stringify(next), "utf8");
|
|
88615
88707
|
},
|
|
88616
88708
|
...isIgnored2 !== void 0 ? { isIgnored: isIgnored2 } : {},
|
|
@@ -88696,9 +88788,9 @@ ${last}` : ""}`);
|
|
|
88696
88788
|
}
|
|
88697
88789
|
const usageLog = new UsageLog(storageDir);
|
|
88698
88790
|
const usageInstance = usageInstanceId(storageDir);
|
|
88699
|
-
const usageProfileFile =
|
|
88700
|
-
const legacyBackfillFile =
|
|
88701
|
-
const usageDir =
|
|
88791
|
+
const usageProfileFile = import_node_path53.default.join(storageDir, "usage-profile.json");
|
|
88792
|
+
const legacyBackfillFile = import_node_path53.default.join(storageDir, "usage-backfill.json");
|
|
88793
|
+
const usageDir = import_node_path53.default.join(storageDir, "usage");
|
|
88702
88794
|
const toolStartedAt = /* @__PURE__ */ new Map();
|
|
88703
88795
|
let usagePushTimer;
|
|
88704
88796
|
let usagePushing;
|
|
@@ -88716,7 +88808,7 @@ ${last}` : ""}`);
|
|
|
88716
88808
|
return (request) => runFastFs(exe, request);
|
|
88717
88809
|
}
|
|
88718
88810
|
function skillAtPath(requested2) {
|
|
88719
|
-
const absolute =
|
|
88811
|
+
const absolute = import_node_path53.default.isAbsolute(requested2) ? requested2 : workspaceRoot === void 0 ? void 0 : import_node_path53.default.resolve(workspaceRoot, requested2);
|
|
88720
88812
|
if (absolute === void 0)
|
|
88721
88813
|
return void 0;
|
|
88722
88814
|
return skills.find((skill) => samePath(skill.filePath, absolute));
|
|
@@ -88789,7 +88881,7 @@ ${last}` : ""}`);
|
|
|
88789
88881
|
const folder = chosen.path?.trim();
|
|
88790
88882
|
if (folder === void 0 || folder.length === 0)
|
|
88791
88883
|
return { problem: "The shared folder has no path." };
|
|
88792
|
-
if (!
|
|
88884
|
+
if (!import_node_path53.default.isAbsolute(folder))
|
|
88793
88885
|
return { problem: `"${folder}" is not an absolute path. Use the full path of a folder everybody can reach, such as a network share.` };
|
|
88794
88886
|
const helper = usageHelper();
|
|
88795
88887
|
return { store: new FolderShardStore(folder, ...helper !== void 0 ? [helper] : []), target };
|
|
@@ -88818,7 +88910,7 @@ ${last}` : ""}`);
|
|
|
88818
88910
|
}
|
|
88819
88911
|
async function readUsageBackfill() {
|
|
88820
88912
|
try {
|
|
88821
|
-
const text2 = await import_promises29.default.readFile(
|
|
88913
|
+
const text2 = await import_promises29.default.readFile(import_node_path53.default.join(usageDir, "backfill.json"), "utf8").catch(() => import_promises29.default.readFile(legacyBackfillFile, "utf8"));
|
|
88822
88914
|
const saved = JSON.parse(text2);
|
|
88823
88915
|
if (typeof saved.at !== "number")
|
|
88824
88916
|
return void 0;
|
|
@@ -88834,7 +88926,7 @@ ${last}` : ""}`);
|
|
|
88834
88926
|
legacyDoneFile: legacyBackfillFile,
|
|
88835
88927
|
run: async (before) => {
|
|
88836
88928
|
const status2 = python.status();
|
|
88837
|
-
return backfillFromTasks(
|
|
88929
|
+
return backfillFromTasks(import_node_path53.default.join(storageDir, "tasks"), {
|
|
88838
88930
|
user: cachedAttribution.author ?? "unknown",
|
|
88839
88931
|
project: cachedAttribution.project,
|
|
88840
88932
|
workspaceRoot,
|
|
@@ -89007,14 +89099,14 @@ ${last}` : ""}`);
|
|
|
89007
89099
|
kind: "tool",
|
|
89008
89100
|
name: issue2.name,
|
|
89009
89101
|
filePath: issue2.filePath,
|
|
89010
|
-
deletable: samePath(
|
|
89011
|
-
location: where(
|
|
89102
|
+
deletable: samePath(import_node_path53.default.dirname(issue2.filePath), status2.toolsDir),
|
|
89103
|
+
location: where(import_node_path53.default.dirname(issue2.filePath), status2.toolsDir),
|
|
89012
89104
|
issue: issue2.kind === "unapproved" ? "waiting for approval" : issue2.kind === "hash-mismatch" ? "changed since approval" : issue2.detail.split("\n")[0] ?? "not loaded"
|
|
89013
89105
|
});
|
|
89014
89106
|
}
|
|
89015
89107
|
return items;
|
|
89016
89108
|
}
|
|
89017
|
-
const usageDirectoryFile =
|
|
89109
|
+
const usageDirectoryFile = import_node_path53.default.join(storageDir, "usage-directory.json");
|
|
89018
89110
|
let directoryRunning;
|
|
89019
89111
|
async function readDirectoryCache() {
|
|
89020
89112
|
try {
|
|
@@ -89349,7 +89441,7 @@ ${last}` : ""}`);
|
|
|
89349
89441
|
let indexedFiles = 0;
|
|
89350
89442
|
if (index !== void 0) {
|
|
89351
89443
|
try {
|
|
89352
|
-
const manifest = JSON.parse(await import_promises29.default.readFile(
|
|
89444
|
+
const manifest = JSON.parse(await import_promises29.default.readFile(import_node_path53.default.join(manifestsRoot, "index-manifests", `${index}.json`), "utf8"));
|
|
89353
89445
|
indexedFiles = Object.keys(manifest.files ?? {}).length;
|
|
89354
89446
|
} catch {
|
|
89355
89447
|
}
|
|
@@ -89824,11 +89916,11 @@ ${last}` : ""}`);
|
|
|
89824
89916
|
answer({ error: bytes.length === 0 ? "There was nothing to save." : "That file is too large to save from here." });
|
|
89825
89917
|
return;
|
|
89826
89918
|
}
|
|
89827
|
-
const safeName = [...
|
|
89828
|
-
const extension =
|
|
89919
|
+
const safeName = [...import_node_path53.default.basename(name)].map((c2) => c2.charCodeAt(0) < 32 || '<>:"/\\|?*'.includes(c2) ? "-" : c2).join("") || "file";
|
|
89920
|
+
const extension = import_node_path53.default.extname(safeName).slice(1);
|
|
89829
89921
|
try {
|
|
89830
89922
|
const target = await ui.showSaveDialog({
|
|
89831
|
-
defaultName: workspaceRoot !== void 0 ?
|
|
89923
|
+
defaultName: workspaceRoot !== void 0 ? import_node_path53.default.join(workspaceRoot, safeName) : safeName,
|
|
89832
89924
|
...extension.length > 0 ? { extensions: [extension] } : {}
|
|
89833
89925
|
});
|
|
89834
89926
|
if (target === void 0) {
|
|
@@ -89909,8 +90001,8 @@ ${last}` : ""}`);
|
|
|
89909
90001
|
continue;
|
|
89910
90002
|
for (const key3 of section.keys)
|
|
89911
90003
|
patch[key3] = key3 === "profiles" && merged.profiles !== void 0 ? reconciled : merged[key3];
|
|
89912
|
-
for (const
|
|
89913
|
-
const head =
|
|
90004
|
+
for (const path64 of section.nested ?? []) {
|
|
90005
|
+
const head = path64.split(".")[0];
|
|
89914
90006
|
patch[head] = merged[head];
|
|
89915
90007
|
}
|
|
89916
90008
|
}
|
|
@@ -89946,7 +90038,7 @@ ${last}` : ""}`);
|
|
|
89946
90038
|
if (changeLedger !== void 0) {
|
|
89947
90039
|
const shared = await changeLedger.othersSince(targets, taskCheckpoint.createdAt);
|
|
89948
90040
|
if (shared.size > 0) {
|
|
89949
|
-
const shown2 = (file2) =>
|
|
90041
|
+
const shown2 = (file2) => import_node_path53.default.relative(workspaceRoot ?? "", file2).split(import_node_path53.default.sep).join("/");
|
|
89950
90042
|
const detail = [...shared].map(([file2, chats]) => `${shown2(file2)} (${chats.join(", ")})`).join("; ");
|
|
89951
90043
|
const all = await ui.showActionMessage(`Another chat also changed ${String(shared.size)} of these files after this chat started: ${detail}. Rolling them back would undo that chat's changes too.`, "Roll those back too", "warning");
|
|
89952
90044
|
if (!all) {
|
|
@@ -90144,7 +90236,7 @@ ${last}` : ""}`);
|
|
|
90144
90236
|
const pathRequest = pendingPathApprovals.get(id);
|
|
90145
90237
|
userGate.resolve(id, "approve");
|
|
90146
90238
|
if (pathRequest !== void 0) {
|
|
90147
|
-
const folder =
|
|
90239
|
+
const folder = import_node_path53.default.dirname(pathRequest);
|
|
90148
90240
|
sessionPathGrants.add(normalizeForComparison(pathRequest));
|
|
90149
90241
|
if (scope === "folder" && !cachedReadRoots.includes(folder)) {
|
|
90150
90242
|
const { config: config2 } = await configManager.load();
|
|
@@ -90384,10 +90476,10 @@ ${last}` : ""}`);
|
|
|
90384
90476
|
});
|
|
90385
90477
|
return;
|
|
90386
90478
|
}
|
|
90387
|
-
let dir =
|
|
90479
|
+
let dir = import_node_path53.default.dirname(import_node_path53.default.resolve(scriptPath));
|
|
90388
90480
|
for (let depth = 0; depth < 3; depth++) {
|
|
90389
90481
|
for (const name of VENV_DIR_NAMES) {
|
|
90390
|
-
const candidate =
|
|
90482
|
+
const candidate = import_node_path53.default.join(dir, name);
|
|
90391
90483
|
const found2 = await search(candidate);
|
|
90392
90484
|
if (found2 !== void 0) {
|
|
90393
90485
|
post({
|
|
@@ -90399,7 +90491,7 @@ ${last}` : ""}`);
|
|
|
90399
90491
|
return;
|
|
90400
90492
|
}
|
|
90401
90493
|
}
|
|
90402
|
-
const parent =
|
|
90494
|
+
const parent = import_node_path53.default.dirname(dir);
|
|
90403
90495
|
if (parent === dir)
|
|
90404
90496
|
break;
|
|
90405
90497
|
dir = parent;
|
|
@@ -91281,11 +91373,11 @@ Could not be drawn: ${entry.message}`);
|
|
|
91281
91373
|
let lastReportPath;
|
|
91282
91374
|
async function saveReport(title, contents) {
|
|
91283
91375
|
try {
|
|
91284
|
-
const directory =
|
|
91376
|
+
const directory = import_node_path53.default.join(storageDir, "reports");
|
|
91285
91377
|
await import_promises29.default.mkdir(directory, { recursive: true });
|
|
91286
91378
|
const stamp2 = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-");
|
|
91287
91379
|
const slug = title.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "").slice(0, 60);
|
|
91288
|
-
const target =
|
|
91380
|
+
const target = import_node_path53.default.join(directory, `${stamp2}${slug.length > 0 ? `-${slug}` : ""}.md`);
|
|
91289
91381
|
await import_promises29.default.writeFile(target, `# ${title}
|
|
91290
91382
|
|
|
91291
91383
|
${contents}
|
|
@@ -91301,7 +91393,7 @@ ${contents}
|
|
|
91301
91393
|
const keep = 100;
|
|
91302
91394
|
const entries = (await import_promises29.default.readdir(directory)).filter((name) => name.endsWith(".md")).sort();
|
|
91303
91395
|
for (const name of entries.slice(0, Math.max(0, entries.length - keep))) {
|
|
91304
|
-
await import_promises29.default.rm(
|
|
91396
|
+
await import_promises29.default.rm(import_node_path53.default.join(directory, name), { force: true });
|
|
91305
91397
|
}
|
|
91306
91398
|
}
|
|
91307
91399
|
let scheduleTimer;
|
|
@@ -91414,10 +91506,10 @@ ${contents}
|
|
|
91414
91506
|
}
|
|
91415
91507
|
const CLAIM_STALE_MS = 60 * 60 * 1e3;
|
|
91416
91508
|
async function claimSchedule(id) {
|
|
91417
|
-
const claimPath =
|
|
91509
|
+
const claimPath = import_node_path53.default.join(storageDir, "schedule-claims", `${id}.json`);
|
|
91418
91510
|
const mine = JSON.stringify({ pid: process.pid, at: Date.now() });
|
|
91419
91511
|
try {
|
|
91420
|
-
await import_promises29.default.mkdir(
|
|
91512
|
+
await import_promises29.default.mkdir(import_node_path53.default.dirname(claimPath), { recursive: true });
|
|
91421
91513
|
await import_promises29.default.writeFile(claimPath, mine, { encoding: "utf8", flag: "wx" });
|
|
91422
91514
|
return true;
|
|
91423
91515
|
} catch (error51) {
|
|
@@ -91442,7 +91534,7 @@ ${contents}
|
|
|
91442
91534
|
}
|
|
91443
91535
|
}
|
|
91444
91536
|
async function releaseSchedule(id) {
|
|
91445
|
-
await import_promises29.default.rm(
|
|
91537
|
+
await import_promises29.default.rm(import_node_path53.default.join(storageDir, "schedule-claims", `${id}.json`), { force: true }).catch(() => void 0);
|
|
91446
91538
|
}
|
|
91447
91539
|
async function runSchedule(id, reason) {
|
|
91448
91540
|
if (reason === "due" && !await claimSchedule(id))
|
|
@@ -92113,11 +92205,11 @@ function createShowDiagramTool() {
|
|
|
92113
92205
|
|
|
92114
92206
|
// ../../packages/core/dist/lsp/manager.js
|
|
92115
92207
|
var import_promises30 = __toESM(require("node:fs/promises"), 1);
|
|
92116
|
-
var
|
|
92208
|
+
var import_node_path55 = __toESM(require("node:path"), 1);
|
|
92117
92209
|
|
|
92118
92210
|
// ../../packages/core/dist/lsp/catalog.js
|
|
92119
92211
|
var import_node_fs13 = require("node:fs");
|
|
92120
|
-
var
|
|
92212
|
+
var import_node_path54 = __toESM(require("node:path"), 1);
|
|
92121
92213
|
var c = (command, ...args) => ({ command, args });
|
|
92122
92214
|
var LSP_LANGUAGES = [
|
|
92123
92215
|
{ id: "python", label: "Python", extensions: ["py", "pyi"], candidates: [c("pyright-langserver", "--stdio"), c("basedpyright-langserver", "--stdio"), c("pylsp"), c("jedi-language-server")] },
|
|
@@ -92165,16 +92257,16 @@ var LSP_LANGUAGES = [
|
|
|
92165
92257
|
{ id: "sql", label: "SQL", extensions: ["sql"], candidates: [c("sql-language-server", "up", "--method", "stdio")] }
|
|
92166
92258
|
];
|
|
92167
92259
|
function languageFor(file2) {
|
|
92168
|
-
const ext =
|
|
92260
|
+
const ext = import_node_path54.default.extname(file2).slice(1).toLowerCase();
|
|
92169
92261
|
return LSP_LANGUAGES.find((l) => l.extensions.includes(ext));
|
|
92170
92262
|
}
|
|
92171
92263
|
function languageIdFor(language, file2) {
|
|
92172
|
-
const ext =
|
|
92264
|
+
const ext = import_node_path54.default.extname(file2).slice(1).toLowerCase();
|
|
92173
92265
|
return language.languageIdFor?.(ext) ?? language.id;
|
|
92174
92266
|
}
|
|
92175
92267
|
var found = /* @__PURE__ */ new Map();
|
|
92176
92268
|
function findOnPath(command, env2 = process.env) {
|
|
92177
|
-
if (
|
|
92269
|
+
if (import_node_path54.default.isAbsolute(command))
|
|
92178
92270
|
return (0, import_node_fs13.existsSync)(command) ? command : void 0;
|
|
92179
92271
|
if (env2 !== process.env)
|
|
92180
92272
|
return searchPath(command, env2);
|
|
@@ -92186,11 +92278,11 @@ function findOnPath(command, env2 = process.env) {
|
|
|
92186
92278
|
return value;
|
|
92187
92279
|
}
|
|
92188
92280
|
function searchPath(command, env2) {
|
|
92189
|
-
const dirs = (env2.PATH ?? env2.Path ?? "").split(
|
|
92281
|
+
const dirs = (env2.PATH ?? env2.Path ?? "").split(import_node_path54.default.delimiter).filter((d) => d.length > 0);
|
|
92190
92282
|
const exts = process.platform === "win32" ? ["", ...(env2.PATHEXT ?? ".EXE;.CMD;.BAT").toLowerCase().split(";")] : [""];
|
|
92191
92283
|
for (const dir of dirs) {
|
|
92192
92284
|
for (const ext of exts) {
|
|
92193
|
-
const candidate =
|
|
92285
|
+
const candidate = import_node_path54.default.join(dir, command + ext);
|
|
92194
92286
|
if ((0, import_node_fs13.existsSync)(candidate) && (process.platform !== "win32" || ext !== "" || /\.(exe|cmd|bat)$/i.test(candidate)))
|
|
92195
92287
|
return candidate;
|
|
92196
92288
|
}
|
|
@@ -92199,7 +92291,7 @@ function searchPath(command, env2) {
|
|
|
92199
92291
|
}
|
|
92200
92292
|
|
|
92201
92293
|
// ../../packages/core/dist/lsp/client.js
|
|
92202
|
-
var
|
|
92294
|
+
var import_node_child_process17 = require("node:child_process");
|
|
92203
92295
|
var import_node_url = require("node:url");
|
|
92204
92296
|
function keyFor(uri) {
|
|
92205
92297
|
try {
|
|
@@ -92229,7 +92321,7 @@ var LspClient = class {
|
|
|
92229
92321
|
this.root = root;
|
|
92230
92322
|
this.log = log;
|
|
92231
92323
|
const shim = /\.(cmd|bat)$/i.test(executable);
|
|
92232
|
-
this.child = shim ? (0,
|
|
92324
|
+
this.child = shim ? (0, import_node_child_process17.spawn)(process.env.ComSpec ?? "cmd.exe", ["/d", "/s", "/c", `"${executable}"`, ...args], { cwd: root, windowsHide: true, windowsVerbatimArguments: true }) : (0, import_node_child_process17.spawn)(executable, args, { cwd: root, windowsHide: true });
|
|
92233
92325
|
this.child.stdout?.on("data", (chunk) => this.onData(chunk));
|
|
92234
92326
|
this.child.stderr?.on("data", (chunk) => {
|
|
92235
92327
|
const text2 = chunk.toString("utf8").trim();
|
|
@@ -92422,7 +92514,7 @@ var LspManager = class {
|
|
|
92422
92514
|
return void 0;
|
|
92423
92515
|
const args = [...found2.candidate.args];
|
|
92424
92516
|
if (language.id === "java" && !args.includes("-data"))
|
|
92425
|
-
args.push("-data",
|
|
92517
|
+
args.push("-data", import_node_path55.default.join(this.storageDir, "jdtls-workspace"));
|
|
92426
92518
|
try {
|
|
92427
92519
|
client = new LspClient(found2.executable, args, this.root, this.log);
|
|
92428
92520
|
this.clients.set(language.id, client);
|
|
@@ -92443,7 +92535,7 @@ var LspManager = class {
|
|
|
92443
92535
|
this.failed.set(language.id, client.lastError ?? "stopped");
|
|
92444
92536
|
return void 0;
|
|
92445
92537
|
}
|
|
92446
|
-
return { server:
|
|
92538
|
+
return { server: import_node_path55.default.basename(client.executable).replace(/\.(exe|cmd|bat)$/i, ""), diagnostics: diagnostics ?? [] };
|
|
92447
92539
|
} catch (error51) {
|
|
92448
92540
|
this.failed.set(language.id, error51 instanceof Error ? error51.message : String(error51));
|
|
92449
92541
|
client.dispose();
|
|
@@ -92681,7 +92773,7 @@ ${snippet}`;
|
|
|
92681
92773
|
|
|
92682
92774
|
// ../../packages/core/dist/tools/applyDiff/parse.js
|
|
92683
92775
|
var SEARCH_MARKER = "<<<<<<< SEARCH";
|
|
92684
|
-
var
|
|
92776
|
+
var SEPARATOR2 = "=======";
|
|
92685
92777
|
var REPLACE_MARKER = ">>>>>>> REPLACE";
|
|
92686
92778
|
var DASH_SEPARATOR = "-------";
|
|
92687
92779
|
var START_LINE_PATTERN = /^:start_line:(\d+)$/;
|
|
@@ -92709,7 +92801,7 @@ function parseDiff(diffText) {
|
|
|
92709
92801
|
i++;
|
|
92710
92802
|
}
|
|
92711
92803
|
const searchLines = [];
|
|
92712
|
-
while (i < lines2.length && lines2[i] !==
|
|
92804
|
+
while (i < lines2.length && lines2[i] !== SEPARATOR2) {
|
|
92713
92805
|
const line = lines2[i] ?? "";
|
|
92714
92806
|
if (line === SEARCH_MARKER || line === REPLACE_MARKER || START_LINE_PATTERN.test(line)) {
|
|
92715
92807
|
return { ok: false, error: `Unexpected marker inside the SEARCH block at line ${i + 1}: "${line}"` };
|
|
@@ -92718,13 +92810,13 @@ function parseDiff(diffText) {
|
|
|
92718
92810
|
i++;
|
|
92719
92811
|
}
|
|
92720
92812
|
if (i >= lines2.length) {
|
|
92721
|
-
return { ok: false, error: `Missing "${
|
|
92813
|
+
return { ok: false, error: `Missing "${SEPARATOR2}" to end the SEARCH block.` };
|
|
92722
92814
|
}
|
|
92723
92815
|
i++;
|
|
92724
92816
|
const replaceLines = [];
|
|
92725
92817
|
while (i < lines2.length && lines2[i] !== REPLACE_MARKER) {
|
|
92726
92818
|
const line = lines2[i] ?? "";
|
|
92727
|
-
if (line === SEARCH_MARKER || line ===
|
|
92819
|
+
if (line === SEARCH_MARKER || line === SEPARATOR2 || START_LINE_PATTERN.test(line)) {
|
|
92728
92820
|
return { ok: false, error: `Unexpected marker inside the REPLACE block at line ${i + 1}: "${line}"` };
|
|
92729
92821
|
}
|
|
92730
92822
|
replaceLines.push(line);
|
|
@@ -94958,7 +95050,17 @@ edits made outside the agent (in VS Code, say) are saved with \`hub_sync\` "push
|
|
|
94958
95050
|
"changes to the monitor",
|
|
94959
95051
|
"audit of changes",
|
|
94960
95052
|
"updated_by",
|
|
94961
|
-
"takeover"
|
|
95053
|
+
"takeover",
|
|
95054
|
+
"due since",
|
|
95055
|
+
"who changed this monitor",
|
|
95056
|
+
"commits",
|
|
95057
|
+
"bitbucket history",
|
|
95058
|
+
"git history",
|
|
95059
|
+
"personal check created as team",
|
|
95060
|
+
"copy from the grid",
|
|
95061
|
+
"copy cell",
|
|
95062
|
+
"copy the grid",
|
|
95063
|
+
"copy rows"
|
|
94962
95064
|
],
|
|
94963
95065
|
body: `
|
|
94964
95066
|
**Fire Code only.** Settings \u2192 Monitoring switches it on; a Monitoring button then appears at the top of the
|
|
@@ -95054,7 +95156,8 @@ a window, when it tries again rather than leave it unrun.
|
|
|
95054
95156
|
|
|
95055
95157
|
**When a check has not run on time**, its tile says so: **waiting\u2026** with the reason on hover (making sure it can run
|
|
95056
95158
|
here first, its turn behind 4 checks already running, a colleague's Fire Code has this window, the monitoring
|
|
95057
|
-
executor still starting), or **due N min ago** when it is past its time
|
|
95159
|
+
executor still starting), or **due N min ago** when it is past its time; its grid window says **Due since** the time
|
|
95160
|
+
it should have started (never "Next \u2026 ago"). The executor is started as soon as a monitor
|
|
95058
95161
|
uses a tool, not when the check falls due, and a tool's timeout counts from when the executor is up. A file or
|
|
95059
95162
|
database path on a share is checked in the background, so a share that does not answer never holds the dashboard up.
|
|
95060
95163
|
**If the colleague who won a window never reports** (their Fire Code closed or failed mid-check), one other member
|
|
@@ -95063,28 +95166,36 @@ takes the window over once its timeout and three more minutes have passed - by a
|
|
|
95063
95166
|
**Is the scheduler working?** A line at the top of the dashboard says **Scheduler running** and when it last looked
|
|
95064
95167
|
(every 3 seconds), with **Stop**; stopped, it says so, with **Start**; not heard from for 90 seconds it says **not
|
|
95065
95168
|
responding**, with **Start again**, which lets go of anything stuck and restarts its timer. Stopped means no check
|
|
95066
|
-
starts by itself - Run now still works and colleagues' checks still show -
|
|
95067
|
-
|
|
95169
|
+
starts by itself - Run now still works and colleagues' checks still show - until you start it again or Fire Code
|
|
95170
|
+
restarts: **it always starts with Fire Code**. Only you stop or start it, never an agent.
|
|
95068
95171
|
|
|
95069
95172
|
**Refresh** (the circular arrow at the top of the dashboard) brings the team's skills down now - its bucket folders and
|
|
95070
95173
|
the team repository - instead of at the next timed sync, reads the folders again, and says which monitors are new
|
|
95071
95174
|
and which are gone.
|
|
95072
95175
|
|
|
95073
|
-
**Who wrote it, and who changed it
|
|
95074
|
-
|
|
95075
|
-
|
|
95176
|
+
**Who wrote it, and who changed it** come from the file's history first: its commits in the **team repository
|
|
95177
|
+
(Bitbucket)** when it is kept there, else in the **git checkout** holding it - the newest commit says who changed it
|
|
95178
|
+
and when, unless the file has changed here since. Otherwise from its labels: every save Light Code or Fire Code makes
|
|
95179
|
+
labels a skill with \`version\`, \`updated\` and \`updated_by\` (who saved it), and a new one with its \`author\`; a
|
|
95180
|
+
file saved before \`updated_by\` existed shows no "by" rather than its author. The tile's tooltip and the grid
|
|
95181
|
+
window's header show them, with "(Bitbucket)" or "(git)" when from a commit; **Changes** (the grid window's arrow button, or "Updated \u2026 by \u2026" in its header) lists every
|
|
95076
95182
|
version - when, by whom, what changed (the schedule, which fields, or only the text around the monitor) and the
|
|
95077
|
-
monitor as it was. Each Fire Code records a version as it arrives; a team monitor's changes are also kept in the team
|
|
95183
|
+
monitor as it was - and the file's commits, with who, when and the commit message. Each Fire Code records a version as it arrives; a team monitor's changes are also kept in the team
|
|
95078
95184
|
index, so every member sees the same list however long their Fire Code was closed. Cleaning up history keeps them;
|
|
95079
95185
|
deleting the monitor removes your own record of it. The grid window's buttons are icons - hover one to see what it does.
|
|
95080
95186
|
|
|
95187
|
+
**Copying from the grid**: click a cell to select it, Shift+click another for the block between, Ctrl+C to copy;
|
|
95188
|
+
right-click a cell for Copy cell / row / column / whole grid; the grid window's copy button takes every row the filters
|
|
95189
|
+
show, with headers. It pastes into Excel as cells and into Word or Outlook as a table, in the text the grid shows.
|
|
95190
|
+
|
|
95081
95191
|
**Offline**: when the team history cannot be reached, a team monitor still runs on this computer - its tile, colours
|
|
95082
95192
|
and notifications stay current - and the tile says **Offline \xB7 N not shared**. Once the history answers again, each
|
|
95083
95193
|
offline check claims its window: written if nobody had it, dropped if a colleague already checked that window. At
|
|
95084
95194
|
most 50 per monitor are kept for this, on disk.
|
|
95085
95195
|
|
|
95086
95196
|
**Personal monitors need nothing set up.** Ask for "a personal check" (or just a check, before team history exists)
|
|
95087
|
-
and the agent makes one only on this computer.
|
|
95197
|
+
and the agent makes one only on this computer. Your own words decide: a request saying personal, private or just
|
|
95198
|
+
for me is made personal whatever the agent passes.
|
|
95088
95199
|
|
|
95089
95200
|
**Team monitors need OpenSearch** (Settings \u2192 Monitoring \u2192 Team history): choose an OpenSearch connection from the
|
|
95090
95201
|
codebase monitoring runs with, and an index name the whole team shares. Without it a team monitor stays grey
|
|
@@ -96047,6 +96158,8 @@ transcript was written.
|
|
|
96047
96158
|
"light mode",
|
|
96048
96159
|
"change the colour",
|
|
96049
96160
|
"change the color",
|
|
96161
|
+
"pycharm dark",
|
|
96162
|
+
"intellij dark",
|
|
96050
96163
|
"copy",
|
|
96051
96164
|
"paste",
|
|
96052
96165
|
"word",
|
|
@@ -96078,6 +96191,10 @@ is \`system\`, \`light\` or \`dark\`, because \`prefers-color-scheme\` follows t
|
|
|
96078
96191
|
setting, and a corporate browser pinned to light shows a light panel on a dark desktop with no way
|
|
96079
96192
|
out.
|
|
96080
96193
|
|
|
96194
|
+
**In IntelliJ and PyCharm the panel follows the IDE's theme**, and changes with it (plugin 0.4.63 on).
|
|
96195
|
+
There \`system\` means the IDE's theme - the embedded browser on its own always reports light - and
|
|
96196
|
+
Light or Dark in Settings \u2192 Appearance overrides it.
|
|
96197
|
+
|
|
96081
96198
|
Everything else follows the editor's theme through its own CSS variables, so Light Code tracks
|
|
96082
96199
|
whatever you have active rather than a fixed palette.
|
|
96083
96200
|
|
|
@@ -96405,8 +96522,8 @@ function createLightCodeHelpTool() {
|
|
|
96405
96522
|
}
|
|
96406
96523
|
|
|
96407
96524
|
// ../../packages/core/dist/tools/listFiles.js
|
|
96408
|
-
var
|
|
96409
|
-
var
|
|
96525
|
+
var import_node_child_process18 = require("node:child_process");
|
|
96526
|
+
var import_node_path56 = __toESM(require("node:path"), 1);
|
|
96410
96527
|
|
|
96411
96528
|
// ../../packages/core/dist/tools/ripgrepError.js
|
|
96412
96529
|
function ripgrepDidNotStart(error51) {
|
|
@@ -96439,7 +96556,7 @@ function isRipgrepNoMatchError(error51) {
|
|
|
96439
96556
|
}
|
|
96440
96557
|
function runRipgrepFiles(rgPath, dir, signal, includeIgnored) {
|
|
96441
96558
|
return new Promise((resolve, reject2) => {
|
|
96442
|
-
(0,
|
|
96559
|
+
(0, import_node_child_process18.execFile)(rgPath, [
|
|
96443
96560
|
"--files",
|
|
96444
96561
|
"--hidden",
|
|
96445
96562
|
...includeIgnored ? ["--no-ignore-vcs"] : [],
|
|
@@ -96487,7 +96604,7 @@ var listFilesTool = {
|
|
|
96487
96604
|
});
|
|
96488
96605
|
if (files.length === 0)
|
|
96489
96606
|
return noFiles;
|
|
96490
|
-
const listed = files.map((file2) => file2.split("/").join(
|
|
96607
|
+
const listed = files.map((file2) => file2.split("/").join(import_node_path56.default.sep)).join("\n");
|
|
96491
96608
|
return { content: truncated ? `${listed}
|
|
96492
96609
|
(listing cut short \u2014 list a narrower folder)` : listed };
|
|
96493
96610
|
}
|
|
@@ -96649,7 +96766,7 @@ var readDocumentTool = {
|
|
|
96649
96766
|
};
|
|
96650
96767
|
|
|
96651
96768
|
// ../../packages/core/dist/tools/searchFiles.js
|
|
96652
|
-
var
|
|
96769
|
+
var import_node_child_process19 = require("node:child_process");
|
|
96653
96770
|
var paramsSchema22 = external_exports.object({
|
|
96654
96771
|
path: external_exports.string().min(1).default(".").describe("Directory to search, relative to the workspace root."),
|
|
96655
96772
|
pattern: external_exports.string().min(1).describe("Regular expression to search for."),
|
|
@@ -96668,7 +96785,7 @@ function runRipgrepSearch(rgPath, dir, pattern, filePattern, signal, includeIgno
|
|
|
96668
96785
|
args.push("-g", filePattern);
|
|
96669
96786
|
args.push("--regexp", pattern, ".");
|
|
96670
96787
|
return new Promise((resolve, reject2) => {
|
|
96671
|
-
(0,
|
|
96788
|
+
(0, import_node_child_process19.execFile)(rgPath, args, { cwd: dir, signal, maxBuffer: 10 * 1024 * 1024 }, (error51, stdout) => {
|
|
96672
96789
|
if (error51 && !isRipgrepNoMatchError2(error51)) {
|
|
96673
96790
|
reject2(error51);
|
|
96674
96791
|
return;
|
|
@@ -96716,7 +96833,7 @@ var searchFilesTool = {
|
|
|
96716
96833
|
};
|
|
96717
96834
|
|
|
96718
96835
|
// ../../packages/core/dist/tools/writeToFile.js
|
|
96719
|
-
var
|
|
96836
|
+
var import_node_path57 = __toESM(require("node:path"), 1);
|
|
96720
96837
|
var paramsSchema23 = external_exports.object({
|
|
96721
96838
|
path: external_exports.string().min(1).describe("Path to the file, relative to the workspace root."),
|
|
96722
96839
|
content: external_exports.string().describe("Full file content to write.")
|
|
@@ -96744,7 +96861,7 @@ var writeToFileTool = {
|
|
|
96744
96861
|
return { content: changed, isError: true, path: params3.path };
|
|
96745
96862
|
}
|
|
96746
96863
|
if (!exists2) {
|
|
96747
|
-
await context.fs.mkdir(
|
|
96864
|
+
await context.fs.mkdir(import_node_path57.default.dirname(resolved.realPath));
|
|
96748
96865
|
}
|
|
96749
96866
|
await context.fs.writeFile(resolved.realPath, params3.content);
|
|
96750
96867
|
await recordWrite(context, resolved.realPath);
|
|
@@ -96846,14 +96963,14 @@ function createDefaultToolRegistry() {
|
|
|
96846
96963
|
|
|
96847
96964
|
// ../../packages/core/dist/dataset/store.js
|
|
96848
96965
|
var import_promises31 = __toESM(require("node:fs/promises"), 1);
|
|
96849
|
-
var
|
|
96966
|
+
var import_node_path58 = __toESM(require("node:path"), 1);
|
|
96850
96967
|
var DatasetStore = class {
|
|
96851
96968
|
filePath;
|
|
96852
96969
|
statePath;
|
|
96853
96970
|
constructor(storageDir, datasetId) {
|
|
96854
96971
|
const safe = datasetId.replace(/[^A-Za-z0-9._-]/g, "_");
|
|
96855
|
-
this.filePath =
|
|
96856
|
-
this.statePath =
|
|
96972
|
+
this.filePath = import_node_path58.default.join(storageDir, "datasets", `${safe}.jsonl`);
|
|
96973
|
+
this.statePath = import_node_path58.default.join(storageDir, "datasets", `${safe}.state.json`);
|
|
96857
96974
|
}
|
|
96858
96975
|
/** Every record. A malformed line is skipped — one bad line costs one record, not the corpus. */
|
|
96859
96976
|
async load() {
|
|
@@ -96881,7 +96998,7 @@ var DatasetStore = class {
|
|
|
96881
96998
|
async append(records) {
|
|
96882
96999
|
if (records.length === 0)
|
|
96883
97000
|
return;
|
|
96884
|
-
await import_promises31.default.mkdir(
|
|
97001
|
+
await import_promises31.default.mkdir(import_node_path58.default.dirname(this.filePath), { recursive: true });
|
|
96885
97002
|
await import_promises31.default.writeFile(this.filePath, "", { flag: "a" });
|
|
96886
97003
|
const lines2 = records.map((record2) => JSON.stringify(record2)).join("\n");
|
|
96887
97004
|
await import_promises31.default.appendFile(this.filePath, `${lines2}
|
|
@@ -96889,7 +97006,7 @@ var DatasetStore = class {
|
|
|
96889
97006
|
}
|
|
96890
97007
|
/** Rewrites with exactly these. Temp-and-rename, so an interrupted prune leaves the old file. */
|
|
96891
97008
|
async replace(records) {
|
|
96892
|
-
await import_promises31.default.mkdir(
|
|
97009
|
+
await import_promises31.default.mkdir(import_node_path58.default.dirname(this.filePath), { recursive: true });
|
|
96893
97010
|
const temporary = `${this.filePath}.tmp`;
|
|
96894
97011
|
const body = records.map((record2) => JSON.stringify(record2)).join("\n");
|
|
96895
97012
|
await import_promises31.default.writeFile(temporary, records.length === 0 ? "" : `${body}
|
|
@@ -96943,7 +97060,7 @@ var DatasetStore = class {
|
|
|
96943
97060
|
}
|
|
96944
97061
|
}
|
|
96945
97062
|
async recordSync(at) {
|
|
96946
|
-
await import_promises31.default.mkdir(
|
|
97063
|
+
await import_promises31.default.mkdir(import_node_path58.default.dirname(this.statePath), { recursive: true });
|
|
96947
97064
|
const temporary = `${this.statePath}.tmp`;
|
|
96948
97065
|
await import_promises31.default.writeFile(temporary, JSON.stringify({ lastSyncedAt: at }), "utf8");
|
|
96949
97066
|
await replaceFile(temporary, this.statePath);
|
|
@@ -97375,8 +97492,8 @@ var S3Client = class {
|
|
|
97375
97492
|
const host = inPath ? origin.host : `${bucket}.${origin.host}`;
|
|
97376
97493
|
const mount = origin.pathname === "/" ? "" : origin.pathname.replace(/\/+$/, "");
|
|
97377
97494
|
const prefix = inPath ? `${mount}/${bucket}` : mount;
|
|
97378
|
-
const
|
|
97379
|
-
const url2 = new URL(`${origin.protocol}//${host}${prefix}${
|
|
97495
|
+
const path64 = key3 === "" ? "" : `/${key3.split("/").map((part) => encodeURIComponent(part)).join("/")}`;
|
|
97496
|
+
const url2 = new URL(`${origin.protocol}//${host}${prefix}${path64}`);
|
|
97380
97497
|
for (const [name, value] of Object.entries(call.query ?? {}))
|
|
97381
97498
|
url2.searchParams.set(name, value);
|
|
97382
97499
|
return url2.toString();
|
|
@@ -98354,7 +98471,7 @@ async function readJsonBody(request, maxBytes = 32 * 1024 * 1024) {
|
|
|
98354
98471
|
|
|
98355
98472
|
// src/fileSecretStore.ts
|
|
98356
98473
|
var import_promises32 = __toESM(require("node:fs/promises"), 1);
|
|
98357
|
-
var
|
|
98474
|
+
var import_node_path59 = __toESM(require("node:path"), 1);
|
|
98358
98475
|
|
|
98359
98476
|
// src/vaultCrypto.ts
|
|
98360
98477
|
var import_node_crypto21 = require("node:crypto");
|
|
@@ -98452,7 +98569,7 @@ var FileSecretStore = class {
|
|
|
98452
98569
|
);
|
|
98453
98570
|
}
|
|
98454
98571
|
mutate(secrets);
|
|
98455
|
-
await import_promises32.default.mkdir(
|
|
98572
|
+
await import_promises32.default.mkdir(import_node_path59.default.dirname(this.filePath), { recursive: true });
|
|
98456
98573
|
const temp = `${this.filePath}.${process.pid}.tmp`;
|
|
98457
98574
|
const body = this.key === void 0 ? secrets : sealSecrets(secrets, this.key);
|
|
98458
98575
|
await import_promises32.default.writeFile(temp, JSON.stringify(body, null, 2), { encoding: "utf8", mode: 384 });
|
|
@@ -98489,7 +98606,7 @@ var FileSecretStore = class {
|
|
|
98489
98606
|
// src/reviewQueue.ts
|
|
98490
98607
|
var import_node_crypto22 = __toESM(require("node:crypto"), 1);
|
|
98491
98608
|
var import_promises33 = __toESM(require("node:fs/promises"), 1);
|
|
98492
|
-
var
|
|
98609
|
+
var import_node_path60 = __toESM(require("node:path"), 1);
|
|
98493
98610
|
var ReviewQueue = class {
|
|
98494
98611
|
constructor(filePath) {
|
|
98495
98612
|
this.filePath = filePath;
|
|
@@ -98508,7 +98625,7 @@ var ReviewQueue = class {
|
|
|
98508
98625
|
}
|
|
98509
98626
|
async persist(items) {
|
|
98510
98627
|
this.cache = items;
|
|
98511
|
-
await import_promises33.default.mkdir(
|
|
98628
|
+
await import_promises33.default.mkdir(import_node_path60.default.dirname(this.filePath), { recursive: true });
|
|
98512
98629
|
const temporary = `${this.filePath}.tmp`;
|
|
98513
98630
|
await import_promises33.default.writeFile(temporary, JSON.stringify(items, null, 2), { encoding: "utf8", mode: 384 });
|
|
98514
98631
|
await replaceFile(temporary, this.filePath);
|
|
@@ -98750,7 +98867,7 @@ var RoutedSecretStore = class {
|
|
|
98750
98867
|
// src/userVariables.ts
|
|
98751
98868
|
var import_promises34 = __toESM(require("node:fs/promises"), 1);
|
|
98752
98869
|
var import_node_fs14 = require("node:fs");
|
|
98753
|
-
var
|
|
98870
|
+
var import_node_path61 = __toESM(require("node:path"), 1);
|
|
98754
98871
|
var UserVariableStore = class {
|
|
98755
98872
|
constructor(filePath) {
|
|
98756
98873
|
this.filePath = filePath;
|
|
@@ -98765,7 +98882,7 @@ var UserVariableStore = class {
|
|
|
98765
98882
|
}
|
|
98766
98883
|
async save(variables) {
|
|
98767
98884
|
const parsed = sessionVariablesSchema.parse(variables);
|
|
98768
|
-
await import_promises34.default.mkdir(
|
|
98885
|
+
await import_promises34.default.mkdir(import_node_path61.default.dirname(this.filePath), { recursive: true });
|
|
98769
98886
|
const temporary = `${this.filePath}.tmp`;
|
|
98770
98887
|
await import_promises34.default.writeFile(temporary, JSON.stringify({ variables: parsed }, null, 2), {
|
|
98771
98888
|
encoding: "utf8",
|
|
@@ -98776,10 +98893,10 @@ var UserVariableStore = class {
|
|
|
98776
98893
|
}
|
|
98777
98894
|
};
|
|
98778
98895
|
function userVariableStoreFor(dataDir, principal) {
|
|
98779
|
-
return new UserVariableStore(userVariablesPath(
|
|
98896
|
+
return new UserVariableStore(userVariablesPath(import_node_path61.default.join(dataDir, "users", storageKeyFor(principal))));
|
|
98780
98897
|
}
|
|
98781
98898
|
function userVariablesPath(userDir) {
|
|
98782
|
-
return
|
|
98899
|
+
return import_node_path61.default.join(userDir, "variables.json");
|
|
98783
98900
|
}
|
|
98784
98901
|
function readVariablesFile(filePath) {
|
|
98785
98902
|
try {
|
|
@@ -98809,11 +98926,11 @@ function hostedUser(env2 = process.env) {
|
|
|
98809
98926
|
// src/session.ts
|
|
98810
98927
|
var import_node_fs15 = require("node:fs");
|
|
98811
98928
|
var import_promises35 = __toESM(require("node:fs/promises"), 1);
|
|
98812
|
-
var
|
|
98929
|
+
var import_node_path63 = __toESM(require("node:path"), 1);
|
|
98813
98930
|
|
|
98814
98931
|
// src/credentialTool.ts
|
|
98815
|
-
var
|
|
98816
|
-
var
|
|
98932
|
+
var import_node_child_process20 = require("node:child_process");
|
|
98933
|
+
var import_node_path62 = __toESM(require("node:path"), 1);
|
|
98817
98934
|
var CREDENTIAL_PREFIX2 = "tool:";
|
|
98818
98935
|
var WRAPPER = [
|
|
98819
98936
|
"import importlib.util, json, sys",
|
|
@@ -98833,7 +98950,7 @@ async function fetchCredential(options, reference) {
|
|
|
98833
98950
|
if (name.length === 0) return { problem: "A credential reference needs a name: tool:<name>." };
|
|
98834
98951
|
const budget = options.timeoutMs ?? 3e4;
|
|
98835
98952
|
const run3 = await new Promise((resolve) => {
|
|
98836
|
-
const child = (0,
|
|
98953
|
+
const child = (0, import_node_child_process20.spawn)(options.interpreter, ["-c", WRAPPER, import_node_path62.default.resolve(options.file), name], {
|
|
98837
98954
|
windowsHide: true,
|
|
98838
98955
|
// The environment this was started in, as with the identity function: the libraries that
|
|
98839
98956
|
// hold credentials are configured through it, and nothing here is model-authored.
|
|
@@ -99029,7 +99146,7 @@ var FileConfigStore = class {
|
|
|
99029
99146
|
const filePath = this.pathFor(scope);
|
|
99030
99147
|
if (filePath === void 0)
|
|
99031
99148
|
throw new Error(`Cannot write ${scope} config: no workspace is open`);
|
|
99032
|
-
await import_promises35.default.mkdir(
|
|
99149
|
+
await import_promises35.default.mkdir(import_node_path63.default.dirname(filePath), { recursive: true });
|
|
99033
99150
|
const temporary = `${filePath}.${process.pid.toString(36)}.tmp`;
|
|
99034
99151
|
await import_promises35.default.writeFile(temporary, contents, { encoding: "utf8", mode: 384 });
|
|
99035
99152
|
await replaceFile(temporary, filePath);
|
|
@@ -99066,8 +99183,8 @@ var FileConfigStore = class {
|
|
|
99066
99183
|
};
|
|
99067
99184
|
let watcher;
|
|
99068
99185
|
try {
|
|
99069
|
-
watcher = (0, import_node_fs15.watch)(
|
|
99070
|
-
if (filename ===
|
|
99186
|
+
watcher = (0, import_node_fs15.watch)(import_node_path63.default.dirname(filePath), (_event, filename) => {
|
|
99187
|
+
if (filename === import_node_path63.default.basename(filePath)) onChange();
|
|
99071
99188
|
});
|
|
99072
99189
|
} catch {
|
|
99073
99190
|
}
|
|
@@ -99095,7 +99212,7 @@ var FileWorkspaceState = class {
|
|
|
99095
99212
|
async set(key3, value) {
|
|
99096
99213
|
if (value === void 0) delete this.values[key3];
|
|
99097
99214
|
else this.values[key3] = value;
|
|
99098
|
-
await import_promises35.default.mkdir(
|
|
99215
|
+
await import_promises35.default.mkdir(import_node_path63.default.dirname(this.filePath), { recursive: true });
|
|
99099
99216
|
await import_promises35.default.writeFile(this.filePath, JSON.stringify(this.values, null, 2), {
|
|
99100
99217
|
encoding: "utf8",
|
|
99101
99218
|
mode: 384
|
|
@@ -99144,7 +99261,7 @@ function createBrowserUi(workspaceRoot, post, fastFs) {
|
|
|
99144
99261
|
openFile: async (filePath) => {
|
|
99145
99262
|
try {
|
|
99146
99263
|
post(
|
|
99147
|
-
[`[info] ${
|
|
99264
|
+
[`[info] ${import_node_path63.default.basename(filePath)}`, "", await import_promises35.default.readFile(filePath, "utf8")].join("\n")
|
|
99148
99265
|
);
|
|
99149
99266
|
} catch (error51) {
|
|
99150
99267
|
post(`[warning] Could not read ${filePath}: ${String(error51)}`);
|
|
@@ -99186,7 +99303,7 @@ function createBrowserUi(workspaceRoot, post, fastFs) {
|
|
|
99186
99303
|
for (const entry of entries) {
|
|
99187
99304
|
if (found2.length >= limit) return;
|
|
99188
99305
|
if (entry.name.startsWith(".") && entry.name !== ".env") continue;
|
|
99189
|
-
const full =
|
|
99306
|
+
const full = import_node_path63.default.join(dir, entry.name);
|
|
99190
99307
|
if (entry.isDirectory()) {
|
|
99191
99308
|
if (!skip.has(entry.name)) await walk(full, level2 + 1);
|
|
99192
99309
|
} else if (depth !== void 0 && level2 !== depth) {
|
|
@@ -99222,11 +99339,11 @@ var SHARED_COLLECTIONS = [
|
|
|
99222
99339
|
{ key: "mcpServers" }
|
|
99223
99340
|
];
|
|
99224
99341
|
async function createSession(options) {
|
|
99225
|
-
const userDir =
|
|
99342
|
+
const userDir = import_node_path63.default.join(options.dataDir, "users", storageKeyFor(options.principal));
|
|
99226
99343
|
await import_promises35.default.mkdir(userDir, { recursive: true, mode: 448 });
|
|
99227
99344
|
const variableStore = new UserVariableStore(userVariablesPath(userDir));
|
|
99228
99345
|
const userVariables = () => variableStore.read();
|
|
99229
|
-
const workspaceState = new FileWorkspaceState(
|
|
99346
|
+
const workspaceState = new FileWorkspaceState(import_node_path63.default.join(userDir, "workspace-state.json"));
|
|
99230
99347
|
await workspaceState.load();
|
|
99231
99348
|
const services = {
|
|
99232
99349
|
/*
|
|
@@ -99318,16 +99435,16 @@ async function createSession(options) {
|
|
|
99318
99435
|
*/
|
|
99319
99436
|
secrets: new CredentialPointerStore(
|
|
99320
99437
|
withCredentialTool(
|
|
99321
|
-
options.sharedSecrets === void 0 ? new FileSecretStore(options.secretsFile ??
|
|
99322
|
-
new FileSecretStore(options.secretsFile ??
|
|
99438
|
+
options.sharedSecrets === void 0 ? new FileSecretStore(options.secretsFile ?? import_node_path63.default.join(userDir, "secrets.json"), options.secretsKey) : new RoutedSecretStore(
|
|
99439
|
+
new FileSecretStore(options.secretsFile ?? import_node_path63.default.join(userDir, "secrets.json"), options.secretsKey),
|
|
99323
99440
|
options.sharedSecrets
|
|
99324
99441
|
),
|
|
99325
99442
|
options
|
|
99326
99443
|
)
|
|
99327
99444
|
),
|
|
99328
99445
|
configStore: withSharedEntries(
|
|
99329
|
-
options.sharedProfiles === void 0 ? new FileConfigStore(options.configFile ??
|
|
99330
|
-
new FileConfigStore(options.configFile ??
|
|
99446
|
+
options.sharedProfiles === void 0 ? new FileConfigStore(options.configFile ?? import_node_path63.default.join(userDir, "config.json"), options.workspaceRoot) : new SharedProfileConfigStore(
|
|
99447
|
+
new FileConfigStore(options.configFile ?? import_node_path63.default.join(userDir, "config.json"), options.workspaceRoot),
|
|
99331
99448
|
options.sharedProfiles
|
|
99332
99449
|
),
|
|
99333
99450
|
options
|
|
@@ -99445,8 +99562,8 @@ async function startServer(options) {
|
|
|
99445
99562
|
));
|
|
99446
99563
|
const roles = options.roles ?? SINGLE_USER_POLICY;
|
|
99447
99564
|
const sharedStore = options.sharedConfig;
|
|
99448
|
-
const sharedSecretStore = new FileSecretStore(
|
|
99449
|
-
const reviews = new ReviewQueue(
|
|
99565
|
+
const sharedSecretStore = new FileSecretStore(import_node_path64.default.join(options.dataDir, "shared-secrets.json"));
|
|
99566
|
+
const reviews = new ReviewQueue(import_node_path64.default.join(options.dataDir, "reviews.json"));
|
|
99450
99567
|
let sharedCache = {
|
|
99451
99568
|
variables: [],
|
|
99452
99569
|
adminIds: [],
|
|
@@ -99825,14 +99942,14 @@ async function startServer(options) {
|
|
|
99825
99942
|
return "No workspace is open, so there is nowhere to write it.";
|
|
99826
99943
|
try {
|
|
99827
99944
|
if (item.kind === "skill") {
|
|
99828
|
-
const dir2 =
|
|
99945
|
+
const dir2 = import_node_path64.default.join(options.workspaceRoot, ".lightcode", "skills");
|
|
99829
99946
|
await import_promises36.default.mkdir(dir2, { recursive: true });
|
|
99830
|
-
await import_promises36.default.writeFile(
|
|
99947
|
+
await import_promises36.default.writeFile(import_node_path64.default.join(dir2, `${item.name}.md`), item.content, "utf8");
|
|
99831
99948
|
return void 0;
|
|
99832
99949
|
}
|
|
99833
|
-
const dir =
|
|
99950
|
+
const dir = import_node_path64.default.join(options.workspaceRoot, ".lightcode", "tools");
|
|
99834
99951
|
await import_promises36.default.mkdir(dir, { recursive: true });
|
|
99835
|
-
await import_promises36.default.writeFile(
|
|
99952
|
+
await import_promises36.default.writeFile(import_node_path64.default.join(dir, `${item.name}.py`), item.content, "utf8");
|
|
99836
99953
|
return void 0;
|
|
99837
99954
|
} catch (error51) {
|
|
99838
99955
|
return error51 instanceof Error ? error51.message : String(error51);
|
|
@@ -99981,7 +100098,7 @@ async function startServer(options) {
|
|
|
99981
100098
|
return;
|
|
99982
100099
|
}
|
|
99983
100100
|
response.writeHead(200, {
|
|
99984
|
-
"Content-Type": CONTENT_TYPES2[
|
|
100101
|
+
"Content-Type": CONTENT_TYPES2[import_node_path64.default.extname(asset)] ?? "application/octet-stream",
|
|
99985
100102
|
...securityHeaders()
|
|
99986
100103
|
});
|
|
99987
100104
|
response.end(body);
|