@parall/daemon 1.89.0 → 1.91.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundle/manifest.json +11 -11
- package/bundle/parall-browser-pod.js +67 -25
- package/bundle/parall-claude-agent.js +310 -227
- package/bundle/parall-codex-agent.js +321 -235
- package/bundle/parall-daemon.js +84 -26
- package/package.json +6 -6
|
@@ -17719,9 +17719,9 @@ var require_getMachineId_linux = __commonJS({
|
|
|
17719
17719
|
var api_1 = (init_esm(), __toCommonJS(esm_exports));
|
|
17720
17720
|
async function getMachineId() {
|
|
17721
17721
|
const paths = ["/etc/machine-id", "/var/lib/dbus/machine-id"];
|
|
17722
|
-
for (const
|
|
17722
|
+
for (const path16 of paths) {
|
|
17723
17723
|
try {
|
|
17724
|
-
const result = await fs_1.promises.readFile(
|
|
17724
|
+
const result = await fs_1.promises.readFile(path16, { encoding: "utf8" });
|
|
17725
17725
|
return result.trim();
|
|
17726
17726
|
} catch (e) {
|
|
17727
17727
|
api_1.diag.debug(`error reading machine id: ${e}`);
|
|
@@ -21124,7 +21124,7 @@ function appendRootPathToUrlIfNeeded(url) {
|
|
|
21124
21124
|
return void 0;
|
|
21125
21125
|
}
|
|
21126
21126
|
}
|
|
21127
|
-
function appendResourcePathToUrl(url,
|
|
21127
|
+
function appendResourcePathToUrl(url, path16) {
|
|
21128
21128
|
try {
|
|
21129
21129
|
new URL(url);
|
|
21130
21130
|
} catch (_a) {
|
|
@@ -21134,11 +21134,11 @@ function appendResourcePathToUrl(url, path15) {
|
|
|
21134
21134
|
if (!url.endsWith("/")) {
|
|
21135
21135
|
url = url + "/";
|
|
21136
21136
|
}
|
|
21137
|
-
url +=
|
|
21137
|
+
url += path16;
|
|
21138
21138
|
try {
|
|
21139
21139
|
new URL(url);
|
|
21140
21140
|
} catch (_b) {
|
|
21141
|
-
diag2.warn("Configuration: Provided URL appended with '" +
|
|
21141
|
+
diag2.warn("Configuration: Provided URL appended with '" + path16 + "' is not a valid URL, using 'undefined' instead of '" + url + "'");
|
|
21142
21142
|
return void 0;
|
|
21143
21143
|
}
|
|
21144
21144
|
return url;
|
|
@@ -27549,14 +27549,14 @@ var require_util2 = __commonJS({
|
|
|
27549
27549
|
}
|
|
27550
27550
|
const port = url.port != null ? url.port : url.protocol === "https:" ? 443 : 80;
|
|
27551
27551
|
let origin = url.origin != null ? url.origin : `${url.protocol || ""}//${url.hostname || ""}:${port}`;
|
|
27552
|
-
let
|
|
27552
|
+
let path16 = url.path != null ? url.path : `${url.pathname || ""}${url.search || ""}`;
|
|
27553
27553
|
if (origin[origin.length - 1] === "/") {
|
|
27554
27554
|
origin = origin.slice(0, origin.length - 1);
|
|
27555
27555
|
}
|
|
27556
|
-
if (
|
|
27557
|
-
|
|
27556
|
+
if (path16 && path16[0] !== "/") {
|
|
27557
|
+
path16 = `/${path16}`;
|
|
27558
27558
|
}
|
|
27559
|
-
return new URL(`${origin}${
|
|
27559
|
+
return new URL(`${origin}${path16}`);
|
|
27560
27560
|
}
|
|
27561
27561
|
if (!isHttpOrHttpsPrefixed(url.origin || url.protocol)) {
|
|
27562
27562
|
throw new InvalidArgumentError("Invalid URL protocol: the URL must start with `http:` or `https:`.");
|
|
@@ -28377,9 +28377,9 @@ var require_diagnostics = __commonJS({
|
|
|
28377
28377
|
"undici:client:sendHeaders",
|
|
28378
28378
|
(evt) => {
|
|
28379
28379
|
const {
|
|
28380
|
-
request: { method, path:
|
|
28380
|
+
request: { method, path: path16, origin }
|
|
28381
28381
|
} = evt;
|
|
28382
|
-
debugLog("sending request to %s %s%s", method, origin,
|
|
28382
|
+
debugLog("sending request to %s %s%s", method, origin, path16);
|
|
28383
28383
|
}
|
|
28384
28384
|
);
|
|
28385
28385
|
}
|
|
@@ -28397,14 +28397,14 @@ var require_diagnostics = __commonJS({
|
|
|
28397
28397
|
"undici:request:headers",
|
|
28398
28398
|
(evt) => {
|
|
28399
28399
|
const {
|
|
28400
|
-
request: { method, path:
|
|
28400
|
+
request: { method, path: path16, origin },
|
|
28401
28401
|
response: { statusCode }
|
|
28402
28402
|
} = evt;
|
|
28403
28403
|
debugLog(
|
|
28404
28404
|
"received response to %s %s%s - HTTP %d",
|
|
28405
28405
|
method,
|
|
28406
28406
|
origin,
|
|
28407
|
-
|
|
28407
|
+
path16,
|
|
28408
28408
|
statusCode
|
|
28409
28409
|
);
|
|
28410
28410
|
}
|
|
@@ -28413,23 +28413,23 @@ var require_diagnostics = __commonJS({
|
|
|
28413
28413
|
"undici:request:trailers",
|
|
28414
28414
|
(evt) => {
|
|
28415
28415
|
const {
|
|
28416
|
-
request: { method, path:
|
|
28416
|
+
request: { method, path: path16, origin }
|
|
28417
28417
|
} = evt;
|
|
28418
|
-
debugLog("trailers received from %s %s%s", method, origin,
|
|
28418
|
+
debugLog("trailers received from %s %s%s", method, origin, path16);
|
|
28419
28419
|
}
|
|
28420
28420
|
);
|
|
28421
28421
|
diagnosticsChannel.subscribe(
|
|
28422
28422
|
"undici:request:error",
|
|
28423
28423
|
(evt) => {
|
|
28424
28424
|
const {
|
|
28425
|
-
request: { method, path:
|
|
28425
|
+
request: { method, path: path16, origin },
|
|
28426
28426
|
error
|
|
28427
28427
|
} = evt;
|
|
28428
28428
|
debugLog(
|
|
28429
28429
|
"request to %s %s%s errored - %s",
|
|
28430
28430
|
method,
|
|
28431
28431
|
origin,
|
|
28432
|
-
|
|
28432
|
+
path16,
|
|
28433
28433
|
error.message
|
|
28434
28434
|
);
|
|
28435
28435
|
}
|
|
@@ -28544,7 +28544,7 @@ var require_request = __commonJS({
|
|
|
28544
28544
|
var kHandler = Symbol("handler");
|
|
28545
28545
|
var Request = class {
|
|
28546
28546
|
constructor(origin, {
|
|
28547
|
-
path:
|
|
28547
|
+
path: path16,
|
|
28548
28548
|
method,
|
|
28549
28549
|
body,
|
|
28550
28550
|
headers,
|
|
@@ -28561,11 +28561,11 @@ var require_request = __commonJS({
|
|
|
28561
28561
|
maxRedirections,
|
|
28562
28562
|
typeOfService
|
|
28563
28563
|
}, handler) {
|
|
28564
|
-
if (typeof
|
|
28564
|
+
if (typeof path16 !== "string") {
|
|
28565
28565
|
throw new InvalidArgumentError("path must be a string");
|
|
28566
|
-
} else if (
|
|
28566
|
+
} else if (path16[0] !== "/" && !(path16.startsWith("http://") || path16.startsWith("https://")) && method !== "CONNECT") {
|
|
28567
28567
|
throw new InvalidArgumentError("path must be an absolute URL or start with a slash");
|
|
28568
|
-
} else if (invalidPathRegex.test(
|
|
28568
|
+
} else if (invalidPathRegex.test(path16)) {
|
|
28569
28569
|
throw new InvalidArgumentError("invalid request path");
|
|
28570
28570
|
}
|
|
28571
28571
|
if (typeof method !== "string") {
|
|
@@ -28640,7 +28640,7 @@ var require_request = __commonJS({
|
|
|
28640
28640
|
this.completed = false;
|
|
28641
28641
|
this.aborted = false;
|
|
28642
28642
|
this.upgrade = upgrade || null;
|
|
28643
|
-
this.path = query ? serializePathWithQuery(
|
|
28643
|
+
this.path = query ? serializePathWithQuery(path16, query) : path16;
|
|
28644
28644
|
this.origin = origin;
|
|
28645
28645
|
this.protocol = getProtocolFromUrlString(origin);
|
|
28646
28646
|
this.idempotent = idempotent == null ? method === "HEAD" || method === "GET" : idempotent;
|
|
@@ -33823,7 +33823,7 @@ var require_client_h1 = __commonJS({
|
|
|
33823
33823
|
return method !== "GET" && method !== "HEAD" && method !== "OPTIONS" && method !== "TRACE" && method !== "CONNECT";
|
|
33824
33824
|
}
|
|
33825
33825
|
function writeH1(client, request3) {
|
|
33826
|
-
const { method, path:
|
|
33826
|
+
const { method, path: path16, host, upgrade, blocking, reset } = request3;
|
|
33827
33827
|
let { body, headers, contentLength } = request3;
|
|
33828
33828
|
const expectsPayload = method === "PUT" || method === "POST" || method === "PATCH" || method === "QUERY" || method === "PROPFIND" || method === "PROPPATCH";
|
|
33829
33829
|
if (util.isFormDataLike(body)) {
|
|
@@ -33901,7 +33901,7 @@ var require_client_h1 = __commonJS({
|
|
|
33901
33901
|
if (socket.setTypeOfService) {
|
|
33902
33902
|
socket.setTypeOfService(request3.typeOfService);
|
|
33903
33903
|
}
|
|
33904
|
-
let header = `${method} ${
|
|
33904
|
+
let header = `${method} ${path16} HTTP/1.1\r
|
|
33905
33905
|
`;
|
|
33906
33906
|
if (typeof host === "string") {
|
|
33907
33907
|
header += `host: ${host}\r
|
|
@@ -34554,7 +34554,7 @@ var require_client_h2 = __commonJS({
|
|
|
34554
34554
|
function writeH2(client, request3) {
|
|
34555
34555
|
const requestTimeout = request3.bodyTimeout ?? client[kBodyTimeout];
|
|
34556
34556
|
const session = client[kHTTP2Session];
|
|
34557
|
-
const { method, path:
|
|
34557
|
+
const { method, path: path16, host, upgrade, expectContinue, signal, protocol, headers: reqHeaders } = request3;
|
|
34558
34558
|
let { body } = request3;
|
|
34559
34559
|
if (upgrade != null && upgrade !== "websocket") {
|
|
34560
34560
|
util.errorRequest(client, request3, new InvalidArgumentError(`Custom upgrade "${upgrade}" not supported over HTTP/2`));
|
|
@@ -34622,7 +34622,7 @@ var require_client_h2 = __commonJS({
|
|
|
34622
34622
|
}
|
|
34623
34623
|
headers[HTTP2_HEADER_METHOD] = "CONNECT";
|
|
34624
34624
|
headers[HTTP2_HEADER_PROTOCOL] = "websocket";
|
|
34625
|
-
headers[HTTP2_HEADER_PATH] =
|
|
34625
|
+
headers[HTTP2_HEADER_PATH] = path16;
|
|
34626
34626
|
if (protocol === "ws:" || protocol === "wss:") {
|
|
34627
34627
|
headers[HTTP2_HEADER_SCHEME] = protocol === "ws:" ? "http" : "https";
|
|
34628
34628
|
} else {
|
|
@@ -34663,7 +34663,7 @@ var require_client_h2 = __commonJS({
|
|
|
34663
34663
|
stream.setTimeout(requestTimeout);
|
|
34664
34664
|
return true;
|
|
34665
34665
|
}
|
|
34666
|
-
headers[HTTP2_HEADER_PATH] =
|
|
34666
|
+
headers[HTTP2_HEADER_PATH] = path16;
|
|
34667
34667
|
headers[HTTP2_HEADER_SCHEME] = protocol === "http:" ? "http" : "https";
|
|
34668
34668
|
const expectsPayload = method === "PUT" || method === "POST" || method === "PATCH";
|
|
34669
34669
|
if (body && typeof body.read === "function") {
|
|
@@ -37006,10 +37006,10 @@ var require_proxy_agent = __commonJS({
|
|
|
37006
37006
|
};
|
|
37007
37007
|
const {
|
|
37008
37008
|
origin,
|
|
37009
|
-
path:
|
|
37009
|
+
path: path16 = "/",
|
|
37010
37010
|
headers = {}
|
|
37011
37011
|
} = opts;
|
|
37012
|
-
opts.path = origin +
|
|
37012
|
+
opts.path = origin + path16;
|
|
37013
37013
|
if (!("host" in headers) && !("Host" in headers)) {
|
|
37014
37014
|
const { host } = new URL(origin);
|
|
37015
37015
|
headers.host = host;
|
|
@@ -39092,20 +39092,20 @@ var require_mock_utils = __commonJS({
|
|
|
39092
39092
|
}
|
|
39093
39093
|
return normalizedQp;
|
|
39094
39094
|
}
|
|
39095
|
-
function safeUrl(
|
|
39096
|
-
if (typeof
|
|
39097
|
-
return
|
|
39095
|
+
function safeUrl(path16) {
|
|
39096
|
+
if (typeof path16 !== "string") {
|
|
39097
|
+
return path16;
|
|
39098
39098
|
}
|
|
39099
|
-
const pathSegments =
|
|
39099
|
+
const pathSegments = path16.split("?", 3);
|
|
39100
39100
|
if (pathSegments.length !== 2) {
|
|
39101
|
-
return
|
|
39101
|
+
return path16;
|
|
39102
39102
|
}
|
|
39103
39103
|
const qp = new URLSearchParams(pathSegments.pop());
|
|
39104
39104
|
qp.sort();
|
|
39105
39105
|
return [...pathSegments, qp.toString()].join("?");
|
|
39106
39106
|
}
|
|
39107
|
-
function matchKey(mockDispatch2, { path:
|
|
39108
|
-
const pathMatch = matchValue(mockDispatch2.path,
|
|
39107
|
+
function matchKey(mockDispatch2, { path: path16, method, body, headers }) {
|
|
39108
|
+
const pathMatch = matchValue(mockDispatch2.path, path16);
|
|
39109
39109
|
const methodMatch = matchValue(mockDispatch2.method, method);
|
|
39110
39110
|
const bodyMatch = typeof mockDispatch2.body !== "undefined" ? matchValue(mockDispatch2.body, body) : true;
|
|
39111
39111
|
const headersMatch = matchHeaders(mockDispatch2, headers);
|
|
@@ -39130,8 +39130,8 @@ var require_mock_utils = __commonJS({
|
|
|
39130
39130
|
const basePath = key.query ? serializePathWithQuery(key.path, key.query) : key.path;
|
|
39131
39131
|
const resolvedPath = typeof basePath === "string" ? safeUrl(basePath) : basePath;
|
|
39132
39132
|
const resolvedPathWithoutTrailingSlash = removeTrailingSlash(resolvedPath);
|
|
39133
|
-
let matchedMockDispatches = mockDispatches.filter(({ consumed }) => !consumed).filter(({ path:
|
|
39134
|
-
return ignoreTrailingSlash ? matchValue(removeTrailingSlash(safeUrl(
|
|
39133
|
+
let matchedMockDispatches = mockDispatches.filter(({ consumed }) => !consumed).filter(({ path: path16, ignoreTrailingSlash }) => {
|
|
39134
|
+
return ignoreTrailingSlash ? matchValue(removeTrailingSlash(safeUrl(path16)), resolvedPathWithoutTrailingSlash) : matchValue(safeUrl(path16), resolvedPath);
|
|
39135
39135
|
});
|
|
39136
39136
|
if (matchedMockDispatches.length === 0) {
|
|
39137
39137
|
throw new MockNotMatchedError(`Mock dispatch not matched for path '${resolvedPath}'`);
|
|
@@ -39170,19 +39170,19 @@ var require_mock_utils = __commonJS({
|
|
|
39170
39170
|
mockDispatches.splice(index, 1);
|
|
39171
39171
|
}
|
|
39172
39172
|
}
|
|
39173
|
-
function removeTrailingSlash(
|
|
39174
|
-
while (
|
|
39175
|
-
|
|
39173
|
+
function removeTrailingSlash(path16) {
|
|
39174
|
+
while (path16.endsWith("/")) {
|
|
39175
|
+
path16 = path16.slice(0, -1);
|
|
39176
39176
|
}
|
|
39177
|
-
if (
|
|
39178
|
-
|
|
39177
|
+
if (path16.length === 0) {
|
|
39178
|
+
path16 = "/";
|
|
39179
39179
|
}
|
|
39180
|
-
return
|
|
39180
|
+
return path16;
|
|
39181
39181
|
}
|
|
39182
39182
|
function buildKey(opts) {
|
|
39183
|
-
const { path:
|
|
39183
|
+
const { path: path16, method, body, headers, query } = opts;
|
|
39184
39184
|
return {
|
|
39185
|
-
path:
|
|
39185
|
+
path: path16,
|
|
39186
39186
|
method,
|
|
39187
39187
|
body,
|
|
39188
39188
|
headers,
|
|
@@ -39872,10 +39872,10 @@ var require_pending_interceptors_formatter = __commonJS({
|
|
|
39872
39872
|
}
|
|
39873
39873
|
format(pendingInterceptors) {
|
|
39874
39874
|
const withPrettyHeaders = pendingInterceptors.map(
|
|
39875
|
-
({ method, path:
|
|
39875
|
+
({ method, path: path16, data: { statusCode }, persist, times, timesInvoked, origin }) => ({
|
|
39876
39876
|
Method: method,
|
|
39877
39877
|
Origin: origin,
|
|
39878
|
-
Path:
|
|
39878
|
+
Path: path16,
|
|
39879
39879
|
"Status code": statusCode,
|
|
39880
39880
|
Persistent: persist ? PERSISTENT : NOT_PERSISTENT,
|
|
39881
39881
|
Invocations: timesInvoked,
|
|
@@ -39957,9 +39957,9 @@ var require_mock_agent = __commonJS({
|
|
|
39957
39957
|
const acceptNonStandardSearchParameters = this[kMockAgentAcceptsNonStandardSearchParameters];
|
|
39958
39958
|
const dispatchOpts = { ...opts };
|
|
39959
39959
|
if (acceptNonStandardSearchParameters && dispatchOpts.path) {
|
|
39960
|
-
const [
|
|
39960
|
+
const [path16, searchParams] = dispatchOpts.path.split("?");
|
|
39961
39961
|
const normalizedSearchParams = normalizeSearchParams(searchParams, acceptNonStandardSearchParameters);
|
|
39962
|
-
dispatchOpts.path = `${
|
|
39962
|
+
dispatchOpts.path = `${path16}?${normalizedSearchParams}`;
|
|
39963
39963
|
}
|
|
39964
39964
|
return this[kAgent].dispatch(dispatchOpts, handler);
|
|
39965
39965
|
}
|
|
@@ -40360,12 +40360,12 @@ var require_snapshot_recorder = __commonJS({
|
|
|
40360
40360
|
* @return {Promise<void>} - Resolves when snapshots are loaded
|
|
40361
40361
|
*/
|
|
40362
40362
|
async loadSnapshots(filePath) {
|
|
40363
|
-
const
|
|
40364
|
-
if (!
|
|
40363
|
+
const path16 = filePath || this.#snapshotPath;
|
|
40364
|
+
if (!path16) {
|
|
40365
40365
|
throw new InvalidArgumentError("Snapshot path is required");
|
|
40366
40366
|
}
|
|
40367
40367
|
try {
|
|
40368
|
-
const data = await readFile2(resolve3(
|
|
40368
|
+
const data = await readFile2(resolve3(path16), "utf8");
|
|
40369
40369
|
const parsed = JSON.parse(data);
|
|
40370
40370
|
if (Array.isArray(parsed)) {
|
|
40371
40371
|
this.#snapshots.clear();
|
|
@@ -40379,7 +40379,7 @@ var require_snapshot_recorder = __commonJS({
|
|
|
40379
40379
|
if (error.code === "ENOENT") {
|
|
40380
40380
|
this.#snapshots.clear();
|
|
40381
40381
|
} else {
|
|
40382
|
-
throw new UndiciError(`Failed to load snapshots from ${
|
|
40382
|
+
throw new UndiciError(`Failed to load snapshots from ${path16}`, { cause: error });
|
|
40383
40383
|
}
|
|
40384
40384
|
}
|
|
40385
40385
|
}
|
|
@@ -40390,11 +40390,11 @@ var require_snapshot_recorder = __commonJS({
|
|
|
40390
40390
|
* @returns {Promise<void>} - Resolves when snapshots are saved
|
|
40391
40391
|
*/
|
|
40392
40392
|
async saveSnapshots(filePath) {
|
|
40393
|
-
const
|
|
40394
|
-
if (!
|
|
40393
|
+
const path16 = filePath || this.#snapshotPath;
|
|
40394
|
+
if (!path16) {
|
|
40395
40395
|
throw new InvalidArgumentError("Snapshot path is required");
|
|
40396
40396
|
}
|
|
40397
|
-
const resolvedPath = resolve3(
|
|
40397
|
+
const resolvedPath = resolve3(path16);
|
|
40398
40398
|
await mkdir3(dirname7(resolvedPath), { recursive: true });
|
|
40399
40399
|
const data = Array.from(this.#snapshots.entries()).map(([hash, snapshot]) => ({
|
|
40400
40400
|
hash,
|
|
@@ -41026,15 +41026,15 @@ var require_redirect_handler = __commonJS({
|
|
|
41026
41026
|
return;
|
|
41027
41027
|
}
|
|
41028
41028
|
const { origin, pathname, search } = util.parseURL(new URL(this.location, this.opts.origin && new URL(this.opts.path, this.opts.origin)));
|
|
41029
|
-
const
|
|
41030
|
-
const redirectUrlString = `${origin}${
|
|
41029
|
+
const path16 = search ? `${pathname}${search}` : pathname;
|
|
41030
|
+
const redirectUrlString = `${origin}${path16}`;
|
|
41031
41031
|
for (const historyUrl of this.history) {
|
|
41032
41032
|
if (historyUrl.toString() === redirectUrlString) {
|
|
41033
41033
|
throw new InvalidArgumentError(`Redirect loop detected. Cannot redirect to ${origin}. This typically happens when using a Client or Pool with cross-origin redirects. Use an Agent for cross-origin redirects.`);
|
|
41034
41034
|
}
|
|
41035
41035
|
}
|
|
41036
41036
|
this.opts.headers = cleanRequestHeaders(this.opts.headers, statusCode === 303, this.opts.origin !== origin);
|
|
41037
|
-
this.opts.path =
|
|
41037
|
+
this.opts.path = path16;
|
|
41038
41038
|
this.opts.origin = origin;
|
|
41039
41039
|
this.opts.query = null;
|
|
41040
41040
|
}
|
|
@@ -42803,10 +42803,10 @@ var require_cache_handler = __commonJS({
|
|
|
42803
42803
|
}
|
|
42804
42804
|
return locationUrl.pathname + locationUrl.search;
|
|
42805
42805
|
}
|
|
42806
|
-
function deleteCachedUri(store, cacheKey,
|
|
42806
|
+
function deleteCachedUri(store, cacheKey, path16) {
|
|
42807
42807
|
deleteCachedValue(store, {
|
|
42808
42808
|
...cacheKey,
|
|
42809
|
-
path:
|
|
42809
|
+
path: path16
|
|
42810
42810
|
});
|
|
42811
42811
|
for (let i = 0; i < util.safeHTTPMethods.length; i++) {
|
|
42812
42812
|
const method = util.safeHTTPMethods[i];
|
|
@@ -42814,7 +42814,7 @@ var require_cache_handler = __commonJS({
|
|
|
42814
42814
|
deleteCachedValue(store, {
|
|
42815
42815
|
...cacheKey,
|
|
42816
42816
|
method,
|
|
42817
|
-
path:
|
|
42817
|
+
path: path16
|
|
42818
42818
|
});
|
|
42819
42819
|
}
|
|
42820
42820
|
}
|
|
@@ -42825,9 +42825,9 @@ var require_cache_handler = __commonJS({
|
|
|
42825
42825
|
}
|
|
42826
42826
|
const values = Array.isArray(headerValue) ? headerValue : [headerValue];
|
|
42827
42827
|
for (let i = 0; i < values.length; i++) {
|
|
42828
|
-
const
|
|
42829
|
-
if (
|
|
42830
|
-
deleteCachedUri(store, cacheKey,
|
|
42828
|
+
const path16 = getSameOriginPath(cacheKey, values[i]);
|
|
42829
|
+
if (path16 !== void 0) {
|
|
42830
|
+
deleteCachedUri(store, cacheKey, path16);
|
|
42831
42831
|
}
|
|
42832
42832
|
}
|
|
42833
42833
|
}
|
|
@@ -47705,11 +47705,11 @@ var require_fetch = __commonJS({
|
|
|
47705
47705
|
function dispatch({ body }) {
|
|
47706
47706
|
const url = requestCurrentURL(request3);
|
|
47707
47707
|
const agent = fetchParams.controller.dispatcher;
|
|
47708
|
-
const
|
|
47708
|
+
const path16 = url.pathname + url.search;
|
|
47709
47709
|
const hasTrailingQuestionMark = url.search.length === 0 && url.href[url.href.length - url.hash.length - 1] === "?";
|
|
47710
47710
|
return new Promise((resolve3, reject) => agent.dispatch(
|
|
47711
47711
|
{
|
|
47712
|
-
path: hasTrailingQuestionMark ? `${
|
|
47712
|
+
path: hasTrailingQuestionMark ? `${path16}?` : path16,
|
|
47713
47713
|
origin: url.origin,
|
|
47714
47714
|
method: request3.method,
|
|
47715
47715
|
body: agent.isMockActive ? request3.body && (request3.body.source || request3.body.stream) : body,
|
|
@@ -48656,9 +48656,9 @@ var require_util5 = __commonJS({
|
|
|
48656
48656
|
}
|
|
48657
48657
|
}
|
|
48658
48658
|
}
|
|
48659
|
-
function validateCookiePath(
|
|
48660
|
-
for (let i = 0; i <
|
|
48661
|
-
const code =
|
|
48659
|
+
function validateCookiePath(path16) {
|
|
48660
|
+
for (let i = 0; i < path16.length; ++i) {
|
|
48661
|
+
const code = path16.charCodeAt(i);
|
|
48662
48662
|
if (code < 32 || // exclude CTLs (0-31)
|
|
48663
48663
|
code > 126 || // exclude DEL and non-ascii
|
|
48664
48664
|
code === 59) {
|
|
@@ -51895,11 +51895,11 @@ var require_undici = __commonJS({
|
|
|
51895
51895
|
if (typeof opts.path !== "string") {
|
|
51896
51896
|
throw new InvalidArgumentError("invalid opts.path");
|
|
51897
51897
|
}
|
|
51898
|
-
let
|
|
51898
|
+
let path16 = opts.path;
|
|
51899
51899
|
if (!opts.path.startsWith("/")) {
|
|
51900
|
-
|
|
51900
|
+
path16 = `/${path16}`;
|
|
51901
51901
|
}
|
|
51902
|
-
url = new URL(util.parseOrigin(url).origin +
|
|
51902
|
+
url = new URL(util.parseOrigin(url).origin + path16);
|
|
51903
51903
|
} else {
|
|
51904
51904
|
if (!opts) {
|
|
51905
51905
|
opts = typeof url === "object" ? url : {};
|
|
@@ -52697,6 +52697,7 @@ var ENDPOINTS = {
|
|
|
52697
52697
|
WIKI_UPLOADS: (orgId, wikiId) => `${WIKI_BASE}/orgs/${orgId}/wikis/${wikiId}/uploads`,
|
|
52698
52698
|
WIKI_FILES: (orgId, wikiId) => `${WIKI_BASE}/orgs/${orgId}/wikis/${wikiId}/files`,
|
|
52699
52699
|
WIKI_FILE_PREVIEW_URL: (orgId, wikiId) => `${WIKI_BASE}/orgs/${orgId}/wikis/${wikiId}/files/preview-url`,
|
|
52700
|
+
WIKI_DOCUMENT_IMAGE_PREVIEW_URL: (orgId, wikiId) => `${WIKI_BASE}/orgs/${orgId}/wikis/${wikiId}/document-images/preview-url`,
|
|
52700
52701
|
// Wiki Path Scopes (AFCS ACL)
|
|
52701
52702
|
WIKI_PATH_SCOPES: (orgId, wikiId) => `${WIKI_BASE}/orgs/${orgId}/wikis/${wikiId}/path-scopes`,
|
|
52702
52703
|
WIKI_PATH_SCOPE: (orgId, wikiId, scopeId) => `${WIKI_BASE}/orgs/${orgId}/wikis/${wikiId}/path-scopes/${scopeId}`,
|
|
@@ -52916,6 +52917,7 @@ var WS_EVENTS = {
|
|
|
52916
52917
|
CHAT_INVITATION_REVOKED: "chat_invitation.revoked",
|
|
52917
52918
|
ORG_JOIN_REQUEST_NEW: "org.join_request.new",
|
|
52918
52919
|
ORG_INVITE_LINK_JOINED: "org.invite_link.joined",
|
|
52920
|
+
ORG_MEMBER_JOINED: "org.member.joined",
|
|
52919
52921
|
ORG_MEMBER_REMOVED: "org.member.removed",
|
|
52920
52922
|
ORG_MEMBER_PROFILE_UPDATED: "org.member.profile.updated",
|
|
52921
52923
|
APP_DATA_CHANGED: "app.data.changed",
|
|
@@ -52975,7 +52977,20 @@ var WS_EVENTS = {
|
|
|
52975
52977
|
CLIP_UPDATED: "clip.updated"
|
|
52976
52978
|
};
|
|
52977
52979
|
|
|
52980
|
+
// ts/sdk/dist/pagination.js
|
|
52981
|
+
async function readAllPages(fetchPage) {
|
|
52982
|
+
const all = [];
|
|
52983
|
+
let cursor;
|
|
52984
|
+
do {
|
|
52985
|
+
const page = await fetchPage(cursor);
|
|
52986
|
+
all.push(...page.data);
|
|
52987
|
+
cursor = page.has_more ? page.next_cursor : void 0;
|
|
52988
|
+
} while (cursor);
|
|
52989
|
+
return all;
|
|
52990
|
+
}
|
|
52991
|
+
|
|
52978
52992
|
// ts/sdk/dist/project-task-client.js
|
|
52993
|
+
var SUBTASK_PAGE_SIZE = 200;
|
|
52979
52994
|
var ProjectTaskClient = class {
|
|
52980
52995
|
async createTask(orgId, data) {
|
|
52981
52996
|
return this.request("POST", ENDPOINTS.TASKS(orgId), data);
|
|
@@ -53064,9 +53079,13 @@ var ProjectTaskClient = class {
|
|
|
53064
53079
|
const res = await this.request("GET", ENDPOINTS.MESSAGE_WATCHING(threadRootId));
|
|
53065
53080
|
return res.watching;
|
|
53066
53081
|
}
|
|
53082
|
+
/**
|
|
53083
|
+
* Every direct child of a task. The endpoint pages (50 rows by default), so
|
|
53084
|
+
* this reads all pages: a caller that stopped at the first page would drop
|
|
53085
|
+
* the newest subtasks once a parent passes one page.
|
|
53086
|
+
*/
|
|
53067
53087
|
async getSubtasks(orgId, taskId) {
|
|
53068
|
-
|
|
53069
|
-
return res.data;
|
|
53088
|
+
return readAllPages((cursor) => this.request("GET", ENDPOINTS.TASK_SUBTASKS(orgId, taskId), void 0, { limit: SUBTASK_PAGE_SIZE, cursor }));
|
|
53070
53089
|
}
|
|
53071
53090
|
async createTaskRelation(orgId, taskId, data) {
|
|
53072
53091
|
return this.request("POST", ENDPOINTS.TASK_RELATIONS(orgId, taskId), data);
|
|
@@ -53607,8 +53626,8 @@ var SlackFilesClient = class extends AttachmentClient {
|
|
|
53607
53626
|
* raw bytes plus the vendor-declared name/MIME.
|
|
53608
53627
|
*/
|
|
53609
53628
|
async downloadSlackFile(orgId, fileId) {
|
|
53610
|
-
const
|
|
53611
|
-
const res = await this.rawAuthorizedFetch(
|
|
53629
|
+
const path16 = `${ENDPOINTS.SLACK_FILE(orgId)}?id=${encodeURIComponent(fileId)}`;
|
|
53630
|
+
const res = await this.rawAuthorizedFetch(path16, { timeoutMs: 5 * 60 * 1e3 });
|
|
53612
53631
|
let fileName = "";
|
|
53613
53632
|
const disposition = res.headers.get("content-disposition") ?? "";
|
|
53614
53633
|
const ext = /filename\*=(?:UTF-8'')?([^";]+)/i.exec(disposition);
|
|
@@ -53813,18 +53832,37 @@ var BrowserProfileClient = class extends HostedProfileCreationClient {
|
|
|
53813
53832
|
const me = await this.request("GET", ENDPOINTS.USERS_ME);
|
|
53814
53833
|
const devices = await this.request("GET", ENDPOINTS.ORG_EDGE_DEVICES(orgId));
|
|
53815
53834
|
const data = [];
|
|
53835
|
+
const warnings = [];
|
|
53816
53836
|
for (const device of devices.data) {
|
|
53817
53837
|
const personal = device.managed_by === "member";
|
|
53818
53838
|
if (personal && device.owner_user_id !== me.id)
|
|
53819
53839
|
continue;
|
|
53820
|
-
|
|
53840
|
+
if (!profileId && device.hosted_state === "deleting") {
|
|
53841
|
+
warnings.push({ device_id: device.id, code: "DEVICE_DELETING" });
|
|
53842
|
+
continue;
|
|
53843
|
+
}
|
|
53844
|
+
const skipMissingDevice = (err) => {
|
|
53845
|
+
const status = typeof err === "object" && err !== null ? err.status : void 0;
|
|
53846
|
+
if (profileId || status !== 404)
|
|
53847
|
+
throw err;
|
|
53848
|
+
warnings.push({ device_id: device.id, code: "DEVICE_NOT_FOUND" });
|
|
53849
|
+
return void 0;
|
|
53850
|
+
};
|
|
53851
|
+
const profiles = await this.request("GET", ENDPOINTS.ORG_EDGE_PROFILES(orgId, device.id)).catch(skipMissingDevice);
|
|
53852
|
+
if (!profiles)
|
|
53853
|
+
continue;
|
|
53854
|
+
const deviceData = [];
|
|
53821
53855
|
for (const profile of profiles) {
|
|
53822
53856
|
if (profileId && profile.id !== profileId)
|
|
53823
53857
|
continue;
|
|
53824
|
-
const access2 = personal ? null : await this.getBrowserProfileAccess(orgId, device.id, profile.name);
|
|
53858
|
+
const access2 = personal ? null : await this.getBrowserProfileAccess(orgId, device.id, profile.name).catch(skipMissingDevice);
|
|
53859
|
+
if (access2 === void 0) {
|
|
53860
|
+
deviceData.length = 0;
|
|
53861
|
+
break;
|
|
53862
|
+
}
|
|
53825
53863
|
if (!personal && !access2?.org_public && !(access2?.grants ?? []).some((g) => g.user_id === me.id && g.grants.length > 0))
|
|
53826
53864
|
continue;
|
|
53827
|
-
|
|
53865
|
+
deviceData.push({
|
|
53828
53866
|
profile_id: profile.id,
|
|
53829
53867
|
name: profile.name,
|
|
53830
53868
|
device_name: device.name,
|
|
@@ -53834,8 +53872,9 @@ var BrowserProfileClient = class extends HostedProfileCreationClient {
|
|
|
53834
53872
|
availability: device.placement === "hosted" ? device.hosted_state ?? "unknown" : device.status
|
|
53835
53873
|
});
|
|
53836
53874
|
}
|
|
53875
|
+
data.push(...deviceData);
|
|
53837
53876
|
}
|
|
53838
|
-
return { data };
|
|
53877
|
+
return { data, ...warnings.length ? { warnings } : {} };
|
|
53839
53878
|
}
|
|
53840
53879
|
/** Submit once: even refresh-enabled clients must not replay browser actions. */
|
|
53841
53880
|
async createBrowserUseOperation(orgId, request3) {
|
|
@@ -53913,9 +53952,9 @@ var WikiDraftClient = class extends BrowserProfileClient {
|
|
|
53913
53952
|
* schema this client edits (default {@link WIKI_DRAFT_SCHEMA_VERSION}); a
|
|
53914
53953
|
* reply in any other schema is refused rather than edited.
|
|
53915
53954
|
*/
|
|
53916
|
-
async openWikiDraft(orgId, wikiId,
|
|
53955
|
+
async openWikiDraft(orgId, wikiId, path16, opts) {
|
|
53917
53956
|
const schema = opts?.schemaVersion ?? WIKI_DRAFT_SCHEMA_VERSION;
|
|
53918
|
-
const connection = await this.request("POST", ENDPOINTS.WIKI_DRAFT_OPEN(orgId, wikiId), { path:
|
|
53957
|
+
const connection = await this.request("POST", ENDPOINTS.WIKI_DRAFT_OPEN(orgId, wikiId), { path: path16, schema_version: schema }, void 0, false, opts);
|
|
53919
53958
|
if (!isWikiDraftConnection(connection) || connection.scope.org_id !== orgId || connection.scope.wiki_id !== wikiId) {
|
|
53920
53959
|
throw new Error("DRAFT_SCOPE");
|
|
53921
53960
|
}
|
|
@@ -54093,10 +54132,10 @@ var ApprovalApproversClient = class extends AgentSecretClient {
|
|
|
54093
54132
|
// ts/sdk/dist/app-template-client.js
|
|
54094
54133
|
var VERSION_HASH = /^[0-9a-f]{64}$/;
|
|
54095
54134
|
var PATH_SEGMENT = /^[A-Za-z0-9._@+-]+$/;
|
|
54096
|
-
function isAppTemplateFilePath(
|
|
54097
|
-
if (!
|
|
54135
|
+
function isAppTemplateFilePath(path16) {
|
|
54136
|
+
if (!path16.startsWith(ENDPOINTS.APP_TEMPLATE_FILES))
|
|
54098
54137
|
return false;
|
|
54099
|
-
const [hash, ...segments] =
|
|
54138
|
+
const [hash, ...segments] = path16.slice(ENDPOINTS.APP_TEMPLATE_FILES.length).split("/");
|
|
54100
54139
|
return VERSION_HASH.test(hash) && segments.length > 0 && segments.every((s) => PATH_SEGMENT.test(s) && s !== "." && s !== "..");
|
|
54101
54140
|
}
|
|
54102
54141
|
var AppTemplateClient = class extends ApprovalApproversClient {
|
|
@@ -54115,11 +54154,11 @@ var AppTemplateClient = class extends ApprovalApproversClient {
|
|
|
54115
54154
|
* above gives for it (`project.archive`, a thumbnail, the demo). Only
|
|
54116
54155
|
* those paths: this is not a way to fetch anything else with the
|
|
54117
54156
|
* client's credentials. */
|
|
54118
|
-
async getAppTemplateFile(
|
|
54119
|
-
if (!isAppTemplateFilePath(
|
|
54120
|
-
throw new Error(`not an app template file path: ${
|
|
54157
|
+
async getAppTemplateFile(path16, opts) {
|
|
54158
|
+
if (!isAppTemplateFilePath(path16)) {
|
|
54159
|
+
throw new Error(`not an app template file path: ${path16}`);
|
|
54121
54160
|
}
|
|
54122
|
-
const res = await this.rawAuthorizedFetch(
|
|
54161
|
+
const res = await this.rawAuthorizedFetch(path16, { timeoutMs: opts?.timeoutMs ?? 6e4 });
|
|
54123
54162
|
return new Uint8Array(await res.arrayBuffer());
|
|
54124
54163
|
}
|
|
54125
54164
|
};
|
|
@@ -54167,6 +54206,14 @@ var AgentTeamOnlyClient = class extends AgentCallerScopeClient {
|
|
|
54167
54206
|
async setAgentTeamOnly(orgId, enabled) {
|
|
54168
54207
|
return this.request("PUT", agentTeamOnlyPath(orgId), { enabled });
|
|
54169
54208
|
}
|
|
54209
|
+
/**
|
|
54210
|
+
* The agents the signed-in person cannot reach while the switch is on, each
|
|
54211
|
+
* with the Team it works for (design §3.5). Empty while it is off, and for
|
|
54212
|
+
* the organization's owners and admins.
|
|
54213
|
+
*/
|
|
54214
|
+
async getUnreachableAgents(orgId) {
|
|
54215
|
+
return this.request("GET", `${API_BASE2}/orgs/${orgId}/me/unreachable-agents`);
|
|
54216
|
+
}
|
|
54170
54217
|
};
|
|
54171
54218
|
|
|
54172
54219
|
// ts/sdk/dist/agent-owning-team-client.js
|
|
@@ -54417,18 +54464,18 @@ var MemberFieldClient = class extends TeamInviteClient {
|
|
|
54417
54464
|
|
|
54418
54465
|
// ts/sdk/dist/wiki-page-share-client.js
|
|
54419
54466
|
var WikiPageShareClient = class extends MemberFieldClient {
|
|
54420
|
-
async listWikiPageShares(orgId, wikiId,
|
|
54421
|
-
const res = await this.request("GET", ENDPOINTS.WIKI_PAGE_SHARES(orgId, wikiId), void 0, { path:
|
|
54467
|
+
async listWikiPageShares(orgId, wikiId, path16) {
|
|
54468
|
+
const res = await this.request("GET", ENDPOINTS.WIKI_PAGE_SHARES(orgId, wikiId), void 0, { path: path16 });
|
|
54422
54469
|
return res.data;
|
|
54423
54470
|
}
|
|
54424
|
-
async createWikiPageShare(orgId, wikiId,
|
|
54425
|
-
return this.request("POST", ENDPOINTS.WIKI_PAGE_SHARES(orgId, wikiId), { user_id: userId }, { path:
|
|
54471
|
+
async createWikiPageShare(orgId, wikiId, path16, userId) {
|
|
54472
|
+
return this.request("POST", ENDPOINTS.WIKI_PAGE_SHARES(orgId, wikiId), { user_id: userId }, { path: path16 });
|
|
54426
54473
|
}
|
|
54427
|
-
async revokeWikiPageShare(orgId, wikiId,
|
|
54428
|
-
return this.request("DELETE", `${ENDPOINTS.WIKI_PAGE_SHARES(orgId, wikiId)}/${encodeURIComponent(shareId)}`, void 0, { path:
|
|
54474
|
+
async revokeWikiPageShare(orgId, wikiId, path16, shareId) {
|
|
54475
|
+
return this.request("DELETE", `${ENDPOINTS.WIKI_PAGE_SHARES(orgId, wikiId)}/${encodeURIComponent(shareId)}`, void 0, { path: path16 });
|
|
54429
54476
|
}
|
|
54430
|
-
async listWikiShareCandidates(orgId, wikiId,
|
|
54431
|
-
const res = await this.request("GET", ENDPOINTS.WIKI_PAGE_SHARE_CANDIDATES(orgId, wikiId), void 0, { path:
|
|
54477
|
+
async listWikiShareCandidates(orgId, wikiId, path16, q = "") {
|
|
54478
|
+
const res = await this.request("GET", ENDPOINTS.WIKI_PAGE_SHARE_CANDIDATES(orgId, wikiId), void 0, { path: path16, q });
|
|
54432
54479
|
return res.data;
|
|
54433
54480
|
}
|
|
54434
54481
|
/** No path or ref override: the server always reads the shared page on main. */
|
|
@@ -54530,7 +54577,7 @@ var ParallClient = class _ParallClient extends ChatBookmarksClient {
|
|
|
54530
54577
|
return apiError;
|
|
54531
54578
|
}
|
|
54532
54579
|
/** Build headers common to all requests (auth, swimlane). */
|
|
54533
|
-
buildHeaders(
|
|
54580
|
+
buildHeaders(path16, extra) {
|
|
54534
54581
|
const headers = {
|
|
54535
54582
|
"Content-Type": "application/json",
|
|
54536
54583
|
...extra
|
|
@@ -54541,11 +54588,11 @@ var ParallClient = class _ParallClient extends ChatBookmarksClient {
|
|
|
54541
54588
|
if (this.swimlaneName) {
|
|
54542
54589
|
headers["X-Prll-Swimlane"] = this.swimlaneName;
|
|
54543
54590
|
}
|
|
54544
|
-
if (
|
|
54591
|
+
if (path16.startsWith(API_BASE2)) {
|
|
54545
54592
|
const overrides = this.getFeatureFlagOverrides?.();
|
|
54546
54593
|
if (overrides)
|
|
54547
54594
|
headers["X-Prll-FF-Override"] = overrides;
|
|
54548
|
-
Object.assign(headers, this.getRequestHeaders?.(
|
|
54595
|
+
Object.assign(headers, this.getRequestHeaders?.(path16), extra);
|
|
54549
54596
|
}
|
|
54550
54597
|
return headers;
|
|
54551
54598
|
}
|
|
@@ -54567,8 +54614,8 @@ var ParallClient = class _ParallClient extends ChatBookmarksClient {
|
|
|
54567
54614
|
* is authoritative, so wiki vs api routing can't drift from how a caller
|
|
54568
54615
|
* happens to invoke the client.
|
|
54569
54616
|
*/
|
|
54570
|
-
baseUrlFor(
|
|
54571
|
-
return
|
|
54617
|
+
baseUrlFor(path16) {
|
|
54618
|
+
return path16.startsWith(WIKI_BASE) ? this.wikiBaseUrl : this.baseUrl;
|
|
54572
54619
|
}
|
|
54573
54620
|
setToken(token) {
|
|
54574
54621
|
this.token = token;
|
|
@@ -54595,10 +54642,10 @@ var ParallClient = class _ParallClient extends ChatBookmarksClient {
|
|
|
54595
54642
|
* REFRESH_THRESHOLD_S, refresh it **before** sending the request.
|
|
54596
54643
|
* No-op when the token is still fresh, missing, or un-parseable.
|
|
54597
54644
|
*/
|
|
54598
|
-
async ensureFreshToken(
|
|
54645
|
+
async ensureFreshToken(path16) {
|
|
54599
54646
|
if (!this.token || !this.getRefreshToken)
|
|
54600
54647
|
return;
|
|
54601
|
-
const pathSuffix =
|
|
54648
|
+
const pathSuffix = path16.replace(/^\/api\/v1/, "");
|
|
54602
54649
|
if (_ParallClient.AUTH_PATHS.has(pathSuffix))
|
|
54603
54650
|
return;
|
|
54604
54651
|
const exp = _ParallClient.decodeJwtExp(this.token);
|
|
@@ -54630,11 +54677,11 @@ var ParallClient = class _ParallClient extends ChatBookmarksClient {
|
|
|
54630
54677
|
this.refreshPromise = null;
|
|
54631
54678
|
}
|
|
54632
54679
|
}
|
|
54633
|
-
async request(method,
|
|
54680
|
+
async request(method, path16, body, query, retried = false, opts) {
|
|
54634
54681
|
if (!retried) {
|
|
54635
|
-
await this.ensureFreshToken(
|
|
54682
|
+
await this.ensureFreshToken(path16);
|
|
54636
54683
|
}
|
|
54637
|
-
let url = `${this.baseUrlFor(
|
|
54684
|
+
let url = `${this.baseUrlFor(path16)}${path16}`;
|
|
54638
54685
|
if (query) {
|
|
54639
54686
|
const params = new URLSearchParams();
|
|
54640
54687
|
for (const [key, value] of Object.entries(query)) {
|
|
@@ -54646,7 +54693,7 @@ var ParallClient = class _ParallClient extends ChatBookmarksClient {
|
|
|
54646
54693
|
if (qs)
|
|
54647
54694
|
url += `?${qs}`;
|
|
54648
54695
|
}
|
|
54649
|
-
const headers = this.buildHeaders(
|
|
54696
|
+
const headers = this.buildHeaders(path16, opts?.headers);
|
|
54650
54697
|
const timeoutSignal = AbortSignal.timeout(opts?.timeoutMs ?? 15e3);
|
|
54651
54698
|
const signal = opts?.signal ? AbortSignal.any([opts.signal, timeoutSignal]) : timeoutSignal;
|
|
54652
54699
|
let res;
|
|
@@ -54664,12 +54711,12 @@ var ParallClient = class _ParallClient extends ChatBookmarksClient {
|
|
|
54664
54711
|
throw _ParallClient.normalizeFetchError(err);
|
|
54665
54712
|
}
|
|
54666
54713
|
if (res.status === 401) {
|
|
54667
|
-
const pathSuffix =
|
|
54714
|
+
const pathSuffix = path16.replace(/^\/api\/v1/, "");
|
|
54668
54715
|
const isAuthPath = _ParallClient.AUTH_PATHS.has(pathSuffix);
|
|
54669
54716
|
if (!retried && !isAuthPath && this.getRefreshToken) {
|
|
54670
54717
|
const refreshed = await this.tryRefresh();
|
|
54671
54718
|
if (refreshed) {
|
|
54672
|
-
return this.request(method,
|
|
54719
|
+
return this.request(method, path16, body, query, true, opts);
|
|
54673
54720
|
}
|
|
54674
54721
|
}
|
|
54675
54722
|
if (this.onTokenExpired && !isAuthPath) {
|
|
@@ -54699,18 +54746,18 @@ var ParallClient = class _ParallClient extends ChatBookmarksClient {
|
|
|
54699
54746
|
* hit the 100 MiB cap, so a longer 5-minute timeout is used so a
|
|
54700
54747
|
* 50 MiB blob on a slow connection doesn't get chopped at 15 s.
|
|
54701
54748
|
*/
|
|
54702
|
-
async multipartRequest(method,
|
|
54749
|
+
async multipartRequest(method, path16, body, retried = false, opts) {
|
|
54703
54750
|
if (!retried) {
|
|
54704
|
-
await this.ensureFreshToken(
|
|
54751
|
+
await this.ensureFreshToken(path16);
|
|
54705
54752
|
}
|
|
54706
|
-
const { "Content-Type": _drop, ...headers } = this.buildHeaders(
|
|
54753
|
+
const { "Content-Type": _drop, ...headers } = this.buildHeaders(path16);
|
|
54707
54754
|
void _drop;
|
|
54708
54755
|
const timeoutMs = opts?.timeoutMs ?? 5 * 60 * 1e3;
|
|
54709
54756
|
let res;
|
|
54710
54757
|
try {
|
|
54711
54758
|
res = await sendMultipartRequest({
|
|
54712
54759
|
method,
|
|
54713
|
-
url: `${this.baseUrlFor(
|
|
54760
|
+
url: `${this.baseUrlFor(path16)}${path16}`,
|
|
54714
54761
|
headers,
|
|
54715
54762
|
body,
|
|
54716
54763
|
timeoutMs,
|
|
@@ -54721,12 +54768,12 @@ var ParallClient = class _ParallClient extends ChatBookmarksClient {
|
|
|
54721
54768
|
throw _ParallClient.normalizeFetchError(err);
|
|
54722
54769
|
}
|
|
54723
54770
|
if (res.status === 401) {
|
|
54724
|
-
const pathSuffix =
|
|
54771
|
+
const pathSuffix = path16.replace(/^\/api\/v1/, "");
|
|
54725
54772
|
const isAuthPath = _ParallClient.AUTH_PATHS.has(pathSuffix);
|
|
54726
54773
|
if (!retried && !isAuthPath && this.getRefreshToken) {
|
|
54727
54774
|
const refreshed = await this.tryRefresh();
|
|
54728
54775
|
if (refreshed) {
|
|
54729
|
-
return this.multipartRequest(method,
|
|
54776
|
+
return this.multipartRequest(method, path16, body, true, opts);
|
|
54730
54777
|
}
|
|
54731
54778
|
}
|
|
54732
54779
|
if (this.onTokenExpired && !isAuthPath) {
|
|
@@ -54999,14 +55046,7 @@ var ParallClient = class _ParallClient extends ChatBookmarksClient {
|
|
|
54999
55046
|
// command so an agent answering "what's on X's plate" sees the full
|
|
55000
55047
|
// backlog, not just the first page.
|
|
55001
55048
|
async getMemberTasksAll(orgId, memberId) {
|
|
55002
|
-
|
|
55003
|
-
let cursor;
|
|
55004
|
-
do {
|
|
55005
|
-
const res = await this.getMemberTasks(orgId, memberId, { cursor, limit: 100 });
|
|
55006
|
-
all.push(...res.data);
|
|
55007
|
-
cursor = res.has_more ? res.next_cursor : void 0;
|
|
55008
|
-
} while (cursor);
|
|
55009
|
-
return all;
|
|
55049
|
+
return readAllPages((cursor) => this.getMemberTasks(orgId, memberId, { cursor, limit: 100 }));
|
|
55010
55050
|
}
|
|
55011
55051
|
// ---- Invitations ----
|
|
55012
55052
|
async createInvitation(orgId, email, role) {
|
|
@@ -55412,17 +55452,7 @@ var ParallClient = class _ParallClient extends ChatBookmarksClient {
|
|
|
55412
55452
|
* deliberately have no WorkItem behind them.
|
|
55413
55453
|
*/
|
|
55414
55454
|
async getAgentTasks(orgId, agentId) {
|
|
55415
|
-
|
|
55416
|
-
let cursor;
|
|
55417
|
-
do {
|
|
55418
|
-
const params = { limit: "100" };
|
|
55419
|
-
if (cursor)
|
|
55420
|
-
params.cursor = cursor;
|
|
55421
|
-
const res = await this.request("GET", ENDPOINTS.AGENT_TASKS(orgId, agentId), void 0, params);
|
|
55422
|
-
all.push(...res.data);
|
|
55423
|
-
cursor = res.has_more ? res.next_cursor : void 0;
|
|
55424
|
-
} while (cursor);
|
|
55425
|
-
return all;
|
|
55455
|
+
return readAllPages((cursor) => this.request("GET", ENDPOINTS.AGENT_TASKS(orgId, agentId), void 0, { limit: 100, cursor }));
|
|
55426
55456
|
}
|
|
55427
55457
|
// ---- Machines (org-scoped) ----
|
|
55428
55458
|
async getMachines(orgId) {
|
|
@@ -55703,8 +55733,8 @@ var ParallClient = class _ParallClient extends ChatBookmarksClient {
|
|
|
55703
55733
|
* remote filesystem browse of a member's machine was remote device access.
|
|
55704
55734
|
* The endpoint now answers 409 LOCAL_BROWSE_NOT_SUPPORTED unconditionally;
|
|
55705
55735
|
* workspace paths are typed in (or picked on the machine's own Desktop). */
|
|
55706
|
-
async browseMachineFilesystem(orgId, machineId,
|
|
55707
|
-
return this.request("POST", ENDPOINTS.MACHINE_BROWSE(orgId, machineId), { path:
|
|
55736
|
+
async browseMachineFilesystem(orgId, machineId, path16) {
|
|
55737
|
+
return this.request("POST", ENDPOINTS.MACHINE_BROWSE(orgId, machineId), { path: path16 }, void 0, false, { timeoutMs: 15e3 });
|
|
55708
55738
|
}
|
|
55709
55739
|
/** Create a new machine key. Returns the raw key string (shown once) + metadata. */
|
|
55710
55740
|
async createMachineKey(orgId, machineId, name) {
|
|
@@ -56035,14 +56065,14 @@ var ParallClient = class _ParallClient extends ChatBookmarksClient {
|
|
|
56035
56065
|
* refresh-and-retry-once, and error-envelope handling as `request` — the
|
|
56036
56066
|
* transfer primitive the SlackFilesClient domain module builds on.
|
|
56037
56067
|
*/
|
|
56038
|
-
async rawAuthorizedFetch(
|
|
56068
|
+
async rawAuthorizedFetch(path16, opts, retried = false) {
|
|
56039
56069
|
if (!retried) {
|
|
56040
|
-
await this.ensureFreshToken(
|
|
56070
|
+
await this.ensureFreshToken(path16);
|
|
56041
56071
|
}
|
|
56042
|
-
const headers = this.buildHeaders(
|
|
56072
|
+
const headers = this.buildHeaders(path16);
|
|
56043
56073
|
let res;
|
|
56044
56074
|
try {
|
|
56045
|
-
res = await fetch(`${this.baseUrlFor(
|
|
56075
|
+
res = await fetch(`${this.baseUrlFor(path16)}${path16}`, {
|
|
56046
56076
|
method: "GET",
|
|
56047
56077
|
headers,
|
|
56048
56078
|
// File transfers get the multipart-tier budget, not the 15s JSON one.
|
|
@@ -56055,7 +56085,7 @@ var ParallClient = class _ParallClient extends ChatBookmarksClient {
|
|
|
56055
56085
|
if (!retried && this.getRefreshToken) {
|
|
56056
56086
|
const refreshed = await this.tryRefresh();
|
|
56057
56087
|
if (refreshed) {
|
|
56058
|
-
return this.rawAuthorizedFetch(
|
|
56088
|
+
return this.rawAuthorizedFetch(path16, opts, true);
|
|
56059
56089
|
}
|
|
56060
56090
|
}
|
|
56061
56091
|
this.onTokenExpired?.();
|
|
@@ -56307,6 +56337,19 @@ var ParallClient = class _ParallClient extends ChatBookmarksClient {
|
|
|
56307
56337
|
res.url = this.absoluteMediaUrl(res.url);
|
|
56308
56338
|
return res;
|
|
56309
56339
|
}
|
|
56340
|
+
/**
|
|
56341
|
+
* Sign the same kind of URL for a picture a Wiki document references.
|
|
56342
|
+
* `src` goes as the document's renderer hands it over (written or
|
|
56343
|
+
* percent-encoded); the server resolves it against `document_path`, applies
|
|
56344
|
+
* a `rev=` pin in it over `ref`, and checks read access on the file it
|
|
56345
|
+
* names. A src that is not a wiki path answers 400 `NOT_WIKI_FILE`.
|
|
56346
|
+
*/
|
|
56347
|
+
async getWikiDocumentImagePreviewUrl(orgId, wikiId, params) {
|
|
56348
|
+
const res = await this.request("POST", ENDPOINTS.WIKI_DOCUMENT_IMAGE_PREVIEW_URL(orgId, wikiId), params);
|
|
56349
|
+
if (res.url)
|
|
56350
|
+
res.url = this.absoluteMediaUrl(res.url);
|
|
56351
|
+
return res;
|
|
56352
|
+
}
|
|
56310
56353
|
// ---- Wiki Path Scopes (AFCS ACL) ----
|
|
56311
56354
|
async getWikiPathScopes(orgId, wikiId) {
|
|
56312
56355
|
const res = await this.request("GET", ENDPOINTS.WIKI_PATH_SCOPES(orgId, wikiId));
|
|
@@ -56329,12 +56372,12 @@ var ParallClient = class _ParallClient extends ChatBookmarksClient {
|
|
|
56329
56372
|
async deleteWikiRestriction(orgId, wikiId, restrictionId) {
|
|
56330
56373
|
await this.request("DELETE", ENDPOINTS.WIKI_RESTRICTION(orgId, wikiId, restrictionId));
|
|
56331
56374
|
}
|
|
56332
|
-
async getWikiAccessStatus(orgId, wikiId,
|
|
56333
|
-
return this.request("GET", ENDPOINTS.WIKI_ACCESS_STATUS(orgId, wikiId), void 0,
|
|
56375
|
+
async getWikiAccessStatus(orgId, wikiId, path16) {
|
|
56376
|
+
return this.request("GET", ENDPOINTS.WIKI_ACCESS_STATUS(orgId, wikiId), void 0, path16 ? { path: path16 } : void 0);
|
|
56334
56377
|
}
|
|
56335
56378
|
// ---- Wiki membership projection (who-can-access, invites, join/leave) ----
|
|
56336
|
-
async getWikiAccessPolicy(orgId, wikiId,
|
|
56337
|
-
return this.request("GET", ENDPOINTS.WIKI_ACCESS_POLICY(orgId, wikiId), void 0,
|
|
56379
|
+
async getWikiAccessPolicy(orgId, wikiId, path16 = "") {
|
|
56380
|
+
return this.request("GET", ENDPOINTS.WIKI_ACCESS_POLICY(orgId, wikiId), void 0, path16 ? { path: path16 } : void 0);
|
|
56338
56381
|
}
|
|
56339
56382
|
async putWikiAccessPolicy(orgId, wikiId, policy) {
|
|
56340
56383
|
return this.request("PUT", ENDPOINTS.WIKI_ACCESS_POLICY(orgId, wikiId), policy);
|
|
@@ -56379,18 +56422,18 @@ var ParallClient = class _ParallClient extends ChatBookmarksClient {
|
|
|
56379
56422
|
async getWikiCommits(orgId, wikiId, params) {
|
|
56380
56423
|
return this.request("GET", ENDPOINTS.WIKI_COMMITS(orgId, wikiId), void 0, params);
|
|
56381
56424
|
}
|
|
56382
|
-
async getWikiFileCommits(orgId, wikiId,
|
|
56425
|
+
async getWikiFileCommits(orgId, wikiId, path16, params) {
|
|
56383
56426
|
return this.request("GET", ENDPOINTS.WIKI_FILE_COMMITS(orgId, wikiId), void 0, {
|
|
56384
|
-
path:
|
|
56427
|
+
path: path16,
|
|
56385
56428
|
...params
|
|
56386
56429
|
});
|
|
56387
56430
|
}
|
|
56388
56431
|
/** Bounded, ACL-safe activity for one Wiki file path. */
|
|
56389
|
-
async getWikiPathActivity(orgId, wikiId,
|
|
56390
|
-
return this.request("GET", ENDPOINTS.WIKI_PATH_ACTIVITY(orgId, wikiId), void 0, { path:
|
|
56432
|
+
async getWikiPathActivity(orgId, wikiId, path16, opts) {
|
|
56433
|
+
return this.request("GET", ENDPOINTS.WIKI_PATH_ACTIVITY(orgId, wikiId), void 0, { path: path16 }, false, opts);
|
|
56391
56434
|
}
|
|
56392
|
-
async getWikiBlame(orgId, wikiId,
|
|
56393
|
-
return this.request("GET", ENDPOINTS.WIKI_BLAME(orgId, wikiId), void 0, { path:
|
|
56435
|
+
async getWikiBlame(orgId, wikiId, path16, ref) {
|
|
56436
|
+
return this.request("GET", ENDPOINTS.WIKI_BLAME(orgId, wikiId), void 0, { path: path16, ref });
|
|
56394
56437
|
}
|
|
56395
56438
|
// ---- Wiki Operations (audit log) ----
|
|
56396
56439
|
async getWikiOperations(orgId, wikiId, params) {
|
|
@@ -58014,6 +58057,42 @@ function renderCmdPointer(nodeExecPath, entryJsPath, binDir, channel) {
|
|
|
58014
58057
|
].join("\r\n");
|
|
58015
58058
|
}
|
|
58016
58059
|
|
|
58060
|
+
// ts/agent-core/dist/cli-features.js
|
|
58061
|
+
import { execFile } from "node:child_process";
|
|
58062
|
+
import path2 from "node:path";
|
|
58063
|
+
var DECLARABLE = ["wiki_read_snapshot"];
|
|
58064
|
+
var PROBE_TIMEOUT_MS = 5e3;
|
|
58065
|
+
function probeParallCliFeatures(opts = {}) {
|
|
58066
|
+
const command = opts.command ?? "parall";
|
|
58067
|
+
const env = { ...opts.env ?? process.env };
|
|
58068
|
+
if (opts.pathFirst) {
|
|
58069
|
+
const key = process.platform === "win32" ? Object.keys(env).find((k) => k.toUpperCase() === "PATH") ?? "PATH" : "PATH";
|
|
58070
|
+
env[key] = env[key] ? `${opts.pathFirst}${path2.delimiter}${env[key]}` : opts.pathFirst;
|
|
58071
|
+
}
|
|
58072
|
+
return new Promise((resolve3) => {
|
|
58073
|
+
execFile(command, ["capabilities"], {
|
|
58074
|
+
env,
|
|
58075
|
+
timeout: opts.timeoutMs ?? PROBE_TIMEOUT_MS,
|
|
58076
|
+
maxBuffer: 64 * 1024,
|
|
58077
|
+
windowsHide: true,
|
|
58078
|
+
// npm installs the CLI as a .cmd shim on Windows, which only a shell runs.
|
|
58079
|
+
shell: process.platform === "win32"
|
|
58080
|
+
}, (err, stdout) => {
|
|
58081
|
+
let listed;
|
|
58082
|
+
if (!err) {
|
|
58083
|
+
try {
|
|
58084
|
+
listed = JSON.parse(stdout).features;
|
|
58085
|
+
} catch {
|
|
58086
|
+
listed = void 0;
|
|
58087
|
+
}
|
|
58088
|
+
}
|
|
58089
|
+
const features = Array.isArray(listed) ? DECLARABLE.filter((f) => listed.includes(f)) : [];
|
|
58090
|
+
opts.log?.info?.(features.length > 0 ? `${command} declares ${features.join(", ")}` : `${command} declares no features (${err ? err.code ?? err.message : "unexpected output"})`);
|
|
58091
|
+
resolve3(features);
|
|
58092
|
+
});
|
|
58093
|
+
});
|
|
58094
|
+
}
|
|
58095
|
+
|
|
58017
58096
|
// ts/agent-core/dist/config-refresh.js
|
|
58018
58097
|
function createConfigRefresh(opts) {
|
|
58019
58098
|
const { secrets } = opts;
|
|
@@ -58151,16 +58230,16 @@ async function persistRuntimeObservation(persister, sessionId, target, event, lo
|
|
|
58151
58230
|
}
|
|
58152
58231
|
|
|
58153
58232
|
// ts/agent-core/dist/lane/key.js
|
|
58154
|
-
import * as
|
|
58233
|
+
import * as path3 from "node:path";
|
|
58155
58234
|
function laneKeyForTarget(targetUri, threadRootId) {
|
|
58156
58235
|
return Buffer.from(`${targetUri}
|
|
58157
58236
|
${threadRootId ?? ""}`, "utf8").toString("base64url");
|
|
58158
58237
|
}
|
|
58159
58238
|
function dispatchLaneContextDir(stateDir) {
|
|
58160
|
-
return
|
|
58239
|
+
return path3.join(stateDir, "dispatch-lane-context");
|
|
58161
58240
|
}
|
|
58162
58241
|
function laneContextFilePath(contextDir, targetUri, threadRootId) {
|
|
58163
|
-
return
|
|
58242
|
+
return path3.join(contextDir, `${laneKeyForTarget(targetUri, threadRootId)}.json`);
|
|
58164
58243
|
}
|
|
58165
58244
|
|
|
58166
58245
|
// ts/agent-core/dist/gateway/source-routing.js
|
|
@@ -58396,7 +58475,7 @@ function splitChangeSource(sourceId) {
|
|
|
58396
58475
|
|
|
58397
58476
|
// ts/agent-core/dist/gateway/base.js
|
|
58398
58477
|
import * as fs4 from "node:fs";
|
|
58399
|
-
import * as
|
|
58478
|
+
import * as path6 from "node:path";
|
|
58400
58479
|
|
|
58401
58480
|
// ts/agent-core/dist/gateway/fork-handoff.js
|
|
58402
58481
|
var ForkResultHandoff = class {
|
|
@@ -58536,13 +58615,13 @@ init_esm();
|
|
|
58536
58615
|
var import_api_logs = __toESM(require_src(), 1);
|
|
58537
58616
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
58538
58617
|
import { readFileSync as readFileSync2 } from "node:fs";
|
|
58539
|
-
import * as
|
|
58618
|
+
import * as path5 from "node:path";
|
|
58540
58619
|
import { fileURLToPath as fileURLToPath2 } from "node:url";
|
|
58541
58620
|
|
|
58542
58621
|
// ts/agent-core/dist/otlp-spool.js
|
|
58543
58622
|
import * as fs2 from "node:fs";
|
|
58544
58623
|
import * as fsp from "node:fs/promises";
|
|
58545
|
-
import * as
|
|
58624
|
+
import * as path4 from "node:path";
|
|
58546
58625
|
var SPOOL_SIGNALS = ["traces", "metrics", "logs"];
|
|
58547
58626
|
var DEFAULT_MAX_BYTES = {
|
|
58548
58627
|
traces: 6 << 20,
|
|
@@ -58649,9 +58728,9 @@ var OtlpSpoolStore = class {
|
|
|
58649
58728
|
const dir = this.signalDir(signal);
|
|
58650
58729
|
try {
|
|
58651
58730
|
await fsp.mkdir(dir, { recursive: true });
|
|
58652
|
-
const tmp =
|
|
58731
|
+
const tmp = path4.join(dir, `${name}.tmp`);
|
|
58653
58732
|
await fsp.writeFile(tmp, bytes);
|
|
58654
|
-
await fsp.rename(tmp,
|
|
58733
|
+
await fsp.rename(tmp, path4.join(dir, name));
|
|
58655
58734
|
} catch (err) {
|
|
58656
58735
|
this.log(`spool write failed for ${signal}: ${String(err)}`);
|
|
58657
58736
|
return drop("write_failed");
|
|
@@ -58705,7 +58784,7 @@ var OtlpSpoolStore = class {
|
|
|
58705
58784
|
}
|
|
58706
58785
|
if (this.sent.has(file.name))
|
|
58707
58786
|
continue;
|
|
58708
|
-
const full =
|
|
58787
|
+
const full = path4.join(this.signalDir(signal), file.name);
|
|
58709
58788
|
let body;
|
|
58710
58789
|
try {
|
|
58711
58790
|
body = await fsp.readFile(full);
|
|
@@ -58769,7 +58848,7 @@ var OtlpSpoolStore = class {
|
|
|
58769
58848
|
await this.replaying;
|
|
58770
58849
|
}
|
|
58771
58850
|
signalDir(signal) {
|
|
58772
|
-
return
|
|
58851
|
+
return path4.join(this.opts.dir, signal);
|
|
58773
58852
|
}
|
|
58774
58853
|
/** Read the directory once; afterwards the index is maintained in memory. */
|
|
58775
58854
|
async load(signal) {
|
|
@@ -58787,7 +58866,7 @@ var OtlpSpoolStore = class {
|
|
|
58787
58866
|
}
|
|
58788
58867
|
const now = this.now();
|
|
58789
58868
|
for (const name of names.sort()) {
|
|
58790
|
-
const full =
|
|
58869
|
+
const full = path4.join(dir, name);
|
|
58791
58870
|
const m = FILE_RE.exec(name);
|
|
58792
58871
|
if (!m) {
|
|
58793
58872
|
if (name.endsWith(".tmp")) {
|
|
@@ -58825,7 +58904,7 @@ var OtlpSpoolStore = class {
|
|
|
58825
58904
|
async remove(signal, idx, file, alreadyGone = false) {
|
|
58826
58905
|
if (!alreadyGone) {
|
|
58827
58906
|
try {
|
|
58828
|
-
await fsp.unlink(
|
|
58907
|
+
await fsp.unlink(path4.join(this.signalDir(signal), file.name));
|
|
58829
58908
|
} catch (err) {
|
|
58830
58909
|
if (err.code !== "ENOENT") {
|
|
58831
58910
|
this.log(`spool could not delete ${signal}/${file.name}: ${String(err)}`);
|
|
@@ -58968,11 +59047,11 @@ function resolveServiceVersion(importMetaUrl) {
|
|
|
58968
59047
|
const fallback = process.env.npm_package_version || "unknown";
|
|
58969
59048
|
let dir;
|
|
58970
59049
|
try {
|
|
58971
|
-
dir =
|
|
59050
|
+
dir = path5.dirname(fileURLToPath2(importMetaUrl));
|
|
58972
59051
|
} catch {
|
|
58973
59052
|
return fallback;
|
|
58974
59053
|
}
|
|
58975
|
-
for (const candidate of [
|
|
59054
|
+
for (const candidate of [path5.join(dir, "manifest.json"), path5.join(dir, "..", "package.json")]) {
|
|
58976
59055
|
try {
|
|
58977
59056
|
const parsed = JSON.parse(readFileSync2(candidate, "utf-8"));
|
|
58978
59057
|
if (typeof parsed.version === "string" && parsed.version.trim()) {
|
|
@@ -63616,7 +63695,7 @@ var ParallAgentGateway = class {
|
|
|
63616
63695
|
}
|
|
63617
63696
|
writeContextFile(filePath, ctx) {
|
|
63618
63697
|
try {
|
|
63619
|
-
fs4.mkdirSync(
|
|
63698
|
+
fs4.mkdirSync(path6.dirname(filePath), { recursive: true });
|
|
63620
63699
|
fs4.writeFileSync(filePath, JSON.stringify(ctx), "utf8");
|
|
63621
63700
|
} catch (err) {
|
|
63622
63701
|
this.opts.log?.warn(`failed to write context file ${filePath}: ${String(err)}`);
|
|
@@ -63645,7 +63724,7 @@ var ParallAgentGateway = class {
|
|
|
63645
63724
|
/** @deprecated Use writeContextFile / updateContextFileStepId. */
|
|
63646
63725
|
writeStepIdFile(filePath, stepId) {
|
|
63647
63726
|
try {
|
|
63648
|
-
fs4.mkdirSync(
|
|
63727
|
+
fs4.mkdirSync(path6.dirname(filePath), { recursive: true });
|
|
63649
63728
|
fs4.writeFileSync(filePath, stepId, "utf8");
|
|
63650
63729
|
} catch (err) {
|
|
63651
63730
|
this.opts.log?.warn(`failed to write step id file ${filePath}: ${String(err)}`);
|
|
@@ -63803,7 +63882,7 @@ function childLogger(logger, sub) {
|
|
|
63803
63882
|
|
|
63804
63883
|
// ts/agent-core/dist/platform-config.js
|
|
63805
63884
|
import * as fs5 from "node:fs";
|
|
63806
|
-
import * as
|
|
63885
|
+
import * as path7 from "node:path";
|
|
63807
63886
|
function extractCapabilities(config) {
|
|
63808
63887
|
const agents = config.agents ?? {};
|
|
63809
63888
|
const raw = agents.capabilities;
|
|
@@ -63858,7 +63937,7 @@ function deriveModelIsPin(defaults, profile) {
|
|
|
63858
63937
|
var CACHE_FILENAME = "parall-platform-config.json";
|
|
63859
63938
|
var SUPPORTED_SCHEMA_VERSION = 1;
|
|
63860
63939
|
function cachePath(stateDir) {
|
|
63861
|
-
return
|
|
63940
|
+
return path7.join(stateDir, CACHE_FILENAME);
|
|
63862
63941
|
}
|
|
63863
63942
|
function loadCache(stateDir) {
|
|
63864
63943
|
try {
|
|
@@ -63877,7 +63956,7 @@ function saveCache(stateDir, response) {
|
|
|
63877
63956
|
};
|
|
63878
63957
|
const filePath = cachePath(stateDir);
|
|
63879
63958
|
const tmpPath = `${filePath}.tmp`;
|
|
63880
|
-
fs5.mkdirSync(
|
|
63959
|
+
fs5.mkdirSync(path7.dirname(filePath), { recursive: true });
|
|
63881
63960
|
fs5.writeFileSync(tmpPath, JSON.stringify(cached, null, 2), "utf-8");
|
|
63882
63961
|
fs5.renameSync(tmpPath, filePath);
|
|
63883
63962
|
}
|
|
@@ -64086,7 +64165,7 @@ navigate \u6216 close \u4E5F\u4F1A\u5173\u6389\u5F39\u6846\u3002\u56DE\u7B54\u54
|
|
|
64086
64165
|
|
|
64087
64166
|
// ts/agent-core/dist/skills/index.js
|
|
64088
64167
|
import * as fs6 from "node:fs";
|
|
64089
|
-
import * as
|
|
64168
|
+
import * as path8 from "node:path";
|
|
64090
64169
|
|
|
64091
64170
|
// ts/agent-core/dist/skills/parall-platform.js
|
|
64092
64171
|
var PARALL_PLATFORM_SKILL = `# Parall Platform
|
|
@@ -65871,11 +65950,11 @@ var SKILLS = [
|
|
|
65871
65950
|
function writeSkillFiles(targetDir) {
|
|
65872
65951
|
fs6.mkdirSync(targetDir, { recursive: true });
|
|
65873
65952
|
for (const skill of SKILLS) {
|
|
65874
|
-
fs6.writeFileSync(
|
|
65953
|
+
fs6.writeFileSync(path8.join(targetDir, `${skill.name}.md`), skill.content, "utf8");
|
|
65875
65954
|
}
|
|
65876
65955
|
}
|
|
65877
65956
|
function buildSkillReferences(workspaceDir) {
|
|
65878
|
-
const dir =
|
|
65957
|
+
const dir = path8.join(workspaceDir, ".parall", "skills");
|
|
65879
65958
|
const lines = SKILLS.map((s) => `- ${s.description.split(":")[0]}: \`${dir}/${s.name}.md\``);
|
|
65880
65959
|
return `## Platform Skills (read on demand)
|
|
65881
65960
|
|
|
@@ -66025,7 +66104,7 @@ var RuntimeTurnBase = class {
|
|
|
66025
66104
|
|
|
66026
66105
|
// ts/claude-agent/dist/config.js
|
|
66027
66106
|
import * as os2 from "node:os";
|
|
66028
|
-
import * as
|
|
66107
|
+
import * as path9 from "node:path";
|
|
66029
66108
|
function requireEnv(env, name) {
|
|
66030
66109
|
const value = env[name]?.trim();
|
|
66031
66110
|
if (!value) {
|
|
@@ -66039,15 +66118,15 @@ function parseList(value) {
|
|
|
66039
66118
|
return value.split(/[,\n]/).map((item) => item.trim()).filter(Boolean);
|
|
66040
66119
|
}
|
|
66041
66120
|
function resolvePath(value) {
|
|
66042
|
-
return
|
|
66121
|
+
return path9.isAbsolute(value) ? value : path9.resolve(process.cwd(), value);
|
|
66043
66122
|
}
|
|
66044
66123
|
function resolveClaudeAgentConfig(env = process.env) {
|
|
66045
66124
|
const apiUrl = requireEnv(env, "PRLL_API_URL");
|
|
66046
66125
|
const apiKey = requireEnv(env, "PRLL_API_KEY");
|
|
66047
66126
|
const orgId = requireEnv(env, "PRLL_ORG_ID");
|
|
66048
66127
|
const claudeHome = resolvePath(env.PRLL_CLAUDE_HOME?.trim() || env.HOME || os2.homedir());
|
|
66049
|
-
const stateDir = resolvePath(env.PRLL_STATE_DIR?.trim() ||
|
|
66050
|
-
const workspaceDir = resolvePath(env.PRLL_WORKSPACE_DIR?.trim() ||
|
|
66128
|
+
const stateDir = resolvePath(env.PRLL_STATE_DIR?.trim() || path9.join(claudeHome, ".parall-agent"));
|
|
66129
|
+
const workspaceDir = resolvePath(env.PRLL_WORKSPACE_DIR?.trim() || path9.join(stateDir, "workspace"));
|
|
66051
66130
|
const additionalDirs = parseList(env.PRLL_CLAUDE_ADD_DIRS).map(resolvePath);
|
|
66052
66131
|
return {
|
|
66053
66132
|
apiUrl,
|
|
@@ -66082,24 +66161,24 @@ function buildClaudeRuntimeKey(agentUserId) {
|
|
|
66082
66161
|
}
|
|
66083
66162
|
function sessionStateFilePathForRuntime(stateDir, runtimeKey) {
|
|
66084
66163
|
const fileName = Buffer.from(runtimeKey).toString("base64url");
|
|
66085
|
-
return
|
|
66164
|
+
return path9.join(stateDir, "sessions", `${fileName}.json`);
|
|
66086
66165
|
}
|
|
66087
66166
|
function contextFilePathForSession(stateDir, sessionKey) {
|
|
66088
66167
|
const fileName = Buffer.from(sessionKey).toString("base64url");
|
|
66089
|
-
return
|
|
66168
|
+
return path9.join(stateDir, "dispatch-context", `${fileName}.json`);
|
|
66090
66169
|
}
|
|
66091
66170
|
function dispatchContextDirPath(stateDir) {
|
|
66092
66171
|
return dispatchLaneContextDir(stateDir);
|
|
66093
66172
|
}
|
|
66094
66173
|
function stepIdFilePathForSession(stateDir, sessionKey) {
|
|
66095
66174
|
const fileName = Buffer.from(sessionKey).toString("base64url");
|
|
66096
|
-
return
|
|
66175
|
+
return path9.join(stateDir, "step-ids", `${fileName}.txt`);
|
|
66097
66176
|
}
|
|
66098
66177
|
|
|
66099
66178
|
// ts/claude-agent/dist/command-env.js
|
|
66100
66179
|
import * as fs7 from "node:fs";
|
|
66101
66180
|
import * as os3 from "node:os";
|
|
66102
|
-
import * as
|
|
66181
|
+
import * as path10 from "node:path";
|
|
66103
66182
|
function commandEnvSupported(platform = process.platform) {
|
|
66104
66183
|
return platform !== "win32";
|
|
66105
66184
|
}
|
|
@@ -66124,15 +66203,15 @@ function createCommandEnv(opts) {
|
|
|
66124
66203
|
try {
|
|
66125
66204
|
for (const entry of fs7.readdirSync(tmpDir)) {
|
|
66126
66205
|
if (entry.startsWith(prefix)) {
|
|
66127
|
-
fs7.rmSync(
|
|
66206
|
+
fs7.rmSync(path10.join(tmpDir, entry), { recursive: true, force: true });
|
|
66128
66207
|
}
|
|
66129
66208
|
}
|
|
66130
66209
|
} catch (err) {
|
|
66131
66210
|
opts.log?.warn(`command env: could not clear leftovers in ${tmpDir}: ${String(err)}`);
|
|
66132
66211
|
}
|
|
66133
|
-
const dir = fs7.mkdtempSync(
|
|
66134
|
-
const loaderPath =
|
|
66135
|
-
const secretsPath =
|
|
66212
|
+
const dir = fs7.mkdtempSync(path10.join(tmpDir, prefix));
|
|
66213
|
+
const loaderPath = path10.join(dir, "loader.sh");
|
|
66214
|
+
const secretsPath = path10.join(dir, "secrets.sh");
|
|
66136
66215
|
const source = (file) => `if [ -r ${shellQuote(file)} ]; then . ${shellQuote(file)}; fi`;
|
|
66137
66216
|
const loader = [
|
|
66138
66217
|
"# Written by the Parall bridge at every start. Claude Code runs this before each Bash command.",
|
|
@@ -66163,14 +66242,14 @@ function createCommandEnv(opts) {
|
|
|
66163
66242
|
import { execSync as execSync2, spawn } from "node:child_process";
|
|
66164
66243
|
import { randomUUID as randomUUID10 } from "node:crypto";
|
|
66165
66244
|
import * as fs11 from "node:fs";
|
|
66166
|
-
import * as
|
|
66245
|
+
import * as path14 from "node:path";
|
|
66167
66246
|
|
|
66168
66247
|
// ts/agent-core/dist/internal/attachment-input.js
|
|
66169
66248
|
import { execSync } from "node:child_process";
|
|
66170
66249
|
import { constants } from "node:fs";
|
|
66171
66250
|
import * as fsSync from "node:fs";
|
|
66172
66251
|
import * as fs8 from "node:fs/promises";
|
|
66173
|
-
import * as
|
|
66252
|
+
import * as path11 from "node:path";
|
|
66174
66253
|
var DEFAULT_MAX_TOTAL_IMAGE_BYTES = 20 * 1024 * 1024;
|
|
66175
66254
|
var DEFAULT_ATTACHMENT_CACHE_MAX_BYTES = 512 * 1024 * 1024;
|
|
66176
66255
|
var DEFAULT_ATTACHMENT_DOWNLOAD_TIMEOUT_MS = 3e4;
|
|
@@ -66200,11 +66279,11 @@ async function prepareLocalImageAttachments(event, context2, opts) {
|
|
|
66200
66279
|
};
|
|
66201
66280
|
}
|
|
66202
66281
|
const rootDir = await ensureAttachmentRootDir(opts.workspaceDir);
|
|
66203
|
-
const messageDir =
|
|
66282
|
+
const messageDir = path11.join(rootDir, sanitizePathSegment(event.messageId));
|
|
66204
66283
|
await ensurePathIsNotSymlink(messageDir);
|
|
66205
66284
|
await fs8.mkdir(messageDir, { recursive: true });
|
|
66206
66285
|
await ensurePathIsNotSymlink(messageDir);
|
|
66207
|
-
const activeMessageDir =
|
|
66286
|
+
const activeMessageDir = path11.resolve(messageDir);
|
|
66208
66287
|
activeAttachmentDirs.add(activeMessageDir);
|
|
66209
66288
|
const maintenanceCooldownMs = opts.maintenanceCooldownMs ?? DEFAULT_MAINTENANCE_COOLDOWN_MS;
|
|
66210
66289
|
const maintenancePromise = scheduleAttachmentMaintenance(rootDir, {
|
|
@@ -66221,7 +66300,7 @@ async function prepareLocalImageAttachments(event, context2, opts) {
|
|
|
66221
66300
|
const notes = [];
|
|
66222
66301
|
let downloadedBytes = 0;
|
|
66223
66302
|
for (const att of imageAttachments) {
|
|
66224
|
-
const localPath =
|
|
66303
|
+
const localPath = path11.join(messageDir, localFileName(att.id, att.fileName, att.mimeType));
|
|
66225
66304
|
const downloadTimeoutMs = opts.downloadTimeoutMs ?? DEFAULT_ATTACHMENT_DOWNLOAD_TIMEOUT_MS;
|
|
66226
66305
|
const fetchFresh = async () => {
|
|
66227
66306
|
const fileInfo = await withTimeout(context2.client.getFileUrl(att.id), downloadTimeoutMs, `file URL lookup timed out after ${downloadTimeoutMs}ms`);
|
|
@@ -66278,7 +66357,7 @@ async function appendPreparedLocalAttachmentRefs(body, event, context2, opts) {
|
|
|
66278
66357
|
return { body: appendLocalAttachmentRefs(body, attachments), attachments };
|
|
66279
66358
|
}
|
|
66280
66359
|
function pinLocalAttachmentPaths(images) {
|
|
66281
|
-
const dirs = new Set(images.map((image) =>
|
|
66360
|
+
const dirs = new Set(images.map((image) => path11.resolve(path11.dirname(image.localPath))));
|
|
66282
66361
|
for (const dir of dirs) {
|
|
66283
66362
|
activeAttachmentDirs.add(dir);
|
|
66284
66363
|
}
|
|
@@ -66293,7 +66372,7 @@ function pinLocalAttachmentPaths(images) {
|
|
|
66293
66372
|
};
|
|
66294
66373
|
}
|
|
66295
66374
|
function attachmentRootDir(workspaceDir) {
|
|
66296
|
-
return
|
|
66375
|
+
return path11.join(path11.resolve(workspaceDir), ".parall", "attachments");
|
|
66297
66376
|
}
|
|
66298
66377
|
function ensureLocalAttachmentGitExclude(workingDirectory) {
|
|
66299
66378
|
try {
|
|
@@ -66302,8 +66381,8 @@ function ensureLocalAttachmentGitExclude(workingDirectory) {
|
|
|
66302
66381
|
encoding: "utf8",
|
|
66303
66382
|
stdio: ["ignore", "pipe", "ignore"]
|
|
66304
66383
|
}).trim();
|
|
66305
|
-
const excludePath =
|
|
66306
|
-
fsSync.mkdirSync(
|
|
66384
|
+
const excludePath = path11.isAbsolute(rel) ? rel : path11.join(workingDirectory, rel);
|
|
66385
|
+
fsSync.mkdirSync(path11.dirname(excludePath), { recursive: true });
|
|
66307
66386
|
const existing = fsSync.existsSync(excludePath) ? fsSync.readFileSync(excludePath, "utf8") : "";
|
|
66308
66387
|
if (existing.split(/\r?\n/).some((line) => line.trim() === ".parall/"))
|
|
66309
66388
|
return;
|
|
@@ -66339,8 +66418,8 @@ function scheduleAttachmentMaintenance(rootDir, opts) {
|
|
|
66339
66418
|
return run;
|
|
66340
66419
|
}
|
|
66341
66420
|
async function ensureAttachmentRootDir(workspaceDir) {
|
|
66342
|
-
const workspaceRoot =
|
|
66343
|
-
const parallDir =
|
|
66421
|
+
const workspaceRoot = path11.resolve(workspaceDir);
|
|
66422
|
+
const parallDir = path11.join(workspaceRoot, ".parall");
|
|
66344
66423
|
const rootDir = attachmentRootDir(workspaceRoot);
|
|
66345
66424
|
await fs8.mkdir(workspaceRoot, { recursive: true });
|
|
66346
66425
|
await ensurePathIsNotSymlink(parallDir);
|
|
@@ -66369,8 +66448,8 @@ async function ensurePathIsNotSymlink(filePath) {
|
|
|
66369
66448
|
}
|
|
66370
66449
|
}
|
|
66371
66450
|
function isPathInside(childPath, parentPath) {
|
|
66372
|
-
const rel =
|
|
66373
|
-
return rel === "" || !!rel && !rel.startsWith("..") && !
|
|
66451
|
+
const rel = path11.relative(parentPath, childPath);
|
|
66452
|
+
return rel === "" || !!rel && !rel.startsWith("..") && !path11.isAbsolute(rel);
|
|
66374
66453
|
}
|
|
66375
66454
|
async function existingUsableFile(filePath, expectedSize, rootDir) {
|
|
66376
66455
|
try {
|
|
@@ -66428,7 +66507,7 @@ async function openLocalFileInsideRoot(filePath, rootDir) {
|
|
|
66428
66507
|
}
|
|
66429
66508
|
}
|
|
66430
66509
|
async function openLocalTempFileInsideRoot(filePath, rootDir) {
|
|
66431
|
-
await localDirectoryStatInsideRoot(
|
|
66510
|
+
await localDirectoryStatInsideRoot(path11.dirname(filePath), rootDir);
|
|
66432
66511
|
const file = await fs8.open(filePath, constants.O_WRONLY | constants.O_CREAT | constants.O_EXCL | constants.O_NOFOLLOW, 384);
|
|
66433
66512
|
let keepOpen = false;
|
|
66434
66513
|
try {
|
|
@@ -66475,9 +66554,9 @@ async function cleanupOldAttachmentFiles(rootDir, ttlMs, log2, preserveDirs) {
|
|
|
66475
66554
|
await Promise.all(entries.map(async (entry) => {
|
|
66476
66555
|
if (!entry.isDirectory())
|
|
66477
66556
|
return;
|
|
66478
|
-
const fullPath =
|
|
66557
|
+
const fullPath = path11.join(rootDir, entry.name);
|
|
66479
66558
|
try {
|
|
66480
|
-
if (preserveDirs?.has(
|
|
66559
|
+
if (preserveDirs?.has(path11.resolve(fullPath)))
|
|
66481
66560
|
return;
|
|
66482
66561
|
const stat2 = await fs8.lstat(fullPath);
|
|
66483
66562
|
if (!stat2.isDirectory())
|
|
@@ -66504,7 +66583,7 @@ async function pruneAttachmentCache(rootDir, maxBytes, log2, preserveDirs) {
|
|
|
66504
66583
|
for (const entry of entries) {
|
|
66505
66584
|
if (!entry.isDirectory())
|
|
66506
66585
|
continue;
|
|
66507
|
-
const fullPath =
|
|
66586
|
+
const fullPath = path11.join(rootDir, entry.name);
|
|
66508
66587
|
try {
|
|
66509
66588
|
const stat2 = await fs8.lstat(fullPath);
|
|
66510
66589
|
if (!stat2.isDirectory())
|
|
@@ -66522,7 +66601,7 @@ async function pruneAttachmentCache(rootDir, maxBytes, log2, preserveDirs) {
|
|
|
66522
66601
|
for (const dir of dirs) {
|
|
66523
66602
|
if (total <= maxBytes)
|
|
66524
66603
|
break;
|
|
66525
|
-
if (preserveDirs?.has(
|
|
66604
|
+
if (preserveDirs?.has(path11.resolve(dir.path)))
|
|
66526
66605
|
continue;
|
|
66527
66606
|
try {
|
|
66528
66607
|
await fs8.rm(dir.path, { recursive: true, force: true });
|
|
@@ -66536,7 +66615,7 @@ async function directorySize(dirPath) {
|
|
|
66536
66615
|
let total = 0;
|
|
66537
66616
|
const entries = await fs8.readdir(dirPath, { withFileTypes: true });
|
|
66538
66617
|
for (const entry of entries) {
|
|
66539
|
-
const fullPath =
|
|
66618
|
+
const fullPath = path11.join(dirPath, entry.name);
|
|
66540
66619
|
let stat2;
|
|
66541
66620
|
try {
|
|
66542
66621
|
stat2 = await fs8.lstat(fullPath);
|
|
@@ -66554,10 +66633,10 @@ async function directorySize(dirPath) {
|
|
|
66554
66633
|
return total;
|
|
66555
66634
|
}
|
|
66556
66635
|
function activeDirsForRoot(rootDir) {
|
|
66557
|
-
const root =
|
|
66636
|
+
const root = path11.resolve(rootDir);
|
|
66558
66637
|
const dirs = /* @__PURE__ */ new Set();
|
|
66559
66638
|
for (const dir of activeAttachmentDirs) {
|
|
66560
|
-
if (dir === root || dir.startsWith(`${root}${
|
|
66639
|
+
if (dir === root || dir.startsWith(`${root}${path11.sep}`)) {
|
|
66561
66640
|
dirs.add(dir);
|
|
66562
66641
|
}
|
|
66563
66642
|
}
|
|
@@ -66654,7 +66733,7 @@ async function writeResponseToFileWithLimit(res, filePath, maxBytes, rootDir) {
|
|
|
66654
66733
|
}
|
|
66655
66734
|
writtenStat = await file.stat();
|
|
66656
66735
|
await closeFile();
|
|
66657
|
-
await localDirectoryStatInsideRoot(
|
|
66736
|
+
await localDirectoryStatInsideRoot(path11.dirname(filePath), rootDir);
|
|
66658
66737
|
await assertLocalFileIdentity(tmpPath, rootDir, writtenStat);
|
|
66659
66738
|
await fs8.rename(tmpPath, filePath);
|
|
66660
66739
|
completed = true;
|
|
@@ -66672,9 +66751,9 @@ async function writeResponseToFileWithLimit(res, filePath, maxBytes, rootDir) {
|
|
|
66672
66751
|
}
|
|
66673
66752
|
}
|
|
66674
66753
|
function localFileName(attachmentId, fileName, mimeType) {
|
|
66675
|
-
const safeName = sanitizePathSegment(
|
|
66676
|
-
const ext =
|
|
66677
|
-
const stem =
|
|
66754
|
+
const safeName = sanitizePathSegment(path11.basename(fileName || attachmentId));
|
|
66755
|
+
const ext = path11.extname(safeName) || extensionForMime(mimeType);
|
|
66756
|
+
const stem = path11.basename(safeName, path11.extname(safeName)) || attachmentId;
|
|
66678
66757
|
return `${sanitizePathSegment(attachmentId)}-${stem}${ext}`;
|
|
66679
66758
|
}
|
|
66680
66759
|
function extensionForMime(mimeType) {
|
|
@@ -68692,7 +68771,7 @@ function ownsFrames(delivery) {
|
|
|
68692
68771
|
|
|
68693
68772
|
// ts/claude-agent/dist/session-manager.js
|
|
68694
68773
|
import * as fs9 from "node:fs";
|
|
68695
|
-
import * as
|
|
68774
|
+
import * as path12 from "node:path";
|
|
68696
68775
|
import { randomUUID as randomUUID9 } from "node:crypto";
|
|
68697
68776
|
var ClaudeSessionManager = class _ClaudeSessionManager {
|
|
68698
68777
|
mainSessionKey;
|
|
@@ -68862,7 +68941,7 @@ var ClaudeSessionManager = class _ClaudeSessionManager {
|
|
|
68862
68941
|
}
|
|
68863
68942
|
persist(sessionId) {
|
|
68864
68943
|
try {
|
|
68865
|
-
fs9.mkdirSync(
|
|
68944
|
+
fs9.mkdirSync(path12.dirname(this.stateFilePath), { recursive: true });
|
|
68866
68945
|
fs9.writeFileSync(this.stateFilePath, JSON.stringify({
|
|
68867
68946
|
runtimeKey: this.mainSessionKey,
|
|
68868
68947
|
sessionId
|
|
@@ -68876,9 +68955,9 @@ var ClaudeSessionManager = class _ClaudeSessionManager {
|
|
|
68876
68955
|
// ts/claude-agent/dist/spawn-env.js
|
|
68877
68956
|
import * as fs10 from "node:fs";
|
|
68878
68957
|
import * as os4 from "node:os";
|
|
68879
|
-
import * as
|
|
68958
|
+
import * as path13 from "node:path";
|
|
68880
68959
|
function setAsideCorruptClaudeConfig(env, log2) {
|
|
68881
|
-
const file =
|
|
68960
|
+
const file = path13.join(env.CLAUDE_CONFIG_DIR || env.HOME || os4.homedir(), ".claude.json");
|
|
68882
68961
|
let text;
|
|
68883
68962
|
try {
|
|
68884
68963
|
text = fs10.readFileSync(file, "utf8");
|
|
@@ -68949,7 +69028,7 @@ function buildSpawnEnv(parentEnv, claudeHome, context2, opts) {
|
|
|
68949
69028
|
if (opts.capabilityBinDir) {
|
|
68950
69029
|
const pathKey = process.platform === "win32" ? Object.keys(result).find((k) => k.toUpperCase() === "PATH") ?? "PATH" : "PATH";
|
|
68951
69030
|
const existing = result[pathKey];
|
|
68952
|
-
result[pathKey] = existing ? `${opts.capabilityBinDir}${
|
|
69031
|
+
result[pathKey] = existing ? `${opts.capabilityBinDir}${path13.delimiter}${existing}` : opts.capabilityBinDir;
|
|
68953
69032
|
}
|
|
68954
69033
|
return result;
|
|
68955
69034
|
}
|
|
@@ -69205,7 +69284,7 @@ var ClaudeCodeAdapter = class {
|
|
|
69205
69284
|
if (!sessionId)
|
|
69206
69285
|
return void 0;
|
|
69207
69286
|
const projectSlug = this.opts.workspaceDir.replace(/[/.]/g, "-");
|
|
69208
|
-
const filePath =
|
|
69287
|
+
const filePath = path14.join(this.opts.claudeHome, ".claude", "projects", projectSlug, `${sessionId}.jsonl`);
|
|
69209
69288
|
return fs11.existsSync(filePath) ? filePath : void 0;
|
|
69210
69289
|
}
|
|
69211
69290
|
forkSession({ sessionKey }) {
|
|
@@ -69511,7 +69590,7 @@ var ClaudeCodeAdapter = class {
|
|
|
69511
69590
|
if (this.opts.disallowedTools.length > 0) {
|
|
69512
69591
|
args.push("--disallowedTools", this.opts.disallowedTools.join(","));
|
|
69513
69592
|
}
|
|
69514
|
-
args.push("--append-system-prompt-file",
|
|
69593
|
+
args.push("--append-system-prompt-file", path14.join(this.opts.workspaceDir, ".parall", "system-prompt.md"));
|
|
69515
69594
|
if (this.capabilityProbe.promptSnapshotOff)
|
|
69516
69595
|
args.push("--system-prompt-snapshot", "off");
|
|
69517
69596
|
if (this.opts.appendSystemPrompt) {
|
|
@@ -69547,20 +69626,20 @@ var ClaudeCodeAdapter = class {
|
|
|
69547
69626
|
|
|
69548
69627
|
// ts/claude-agent/dist/workspace.js
|
|
69549
69628
|
import * as fs12 from "node:fs";
|
|
69550
|
-
import * as
|
|
69629
|
+
import * as path15 from "node:path";
|
|
69551
69630
|
function buildClaudeSystemPrompt(workspaceDir, agentIdentity, capabilityFragments) {
|
|
69552
69631
|
return buildClaudeCodePlatformInstructions(workspaceDir, agentIdentity, capabilityFragments);
|
|
69553
69632
|
}
|
|
69554
69633
|
function writeClaudeSystemPrompt(workspaceDir, agentIdentity, capabilityFragments) {
|
|
69555
|
-
const parallDir =
|
|
69634
|
+
const parallDir = path15.join(workspaceDir, ".parall");
|
|
69556
69635
|
fs12.mkdirSync(parallDir, { recursive: true });
|
|
69557
|
-
fs12.writeFileSync(
|
|
69636
|
+
fs12.writeFileSync(path15.join(parallDir, "system-prompt.md"), buildClaudeSystemPrompt(workspaceDir, agentIdentity, capabilityFragments), "utf8");
|
|
69558
69637
|
}
|
|
69559
69638
|
function ensureClaudeWorkspace(workspaceDir, _log, agentIdentity, capabilityFragments) {
|
|
69560
69639
|
fs12.mkdirSync(workspaceDir, { recursive: true });
|
|
69561
|
-
fs12.mkdirSync(
|
|
69640
|
+
fs12.mkdirSync(path15.join(workspaceDir, ".claude"), { recursive: true });
|
|
69562
69641
|
writeClaudeSystemPrompt(workspaceDir, agentIdentity, capabilityFragments);
|
|
69563
|
-
writeSkillFiles(
|
|
69642
|
+
writeSkillFiles(path15.join(workspaceDir, ".parall", "skills"));
|
|
69564
69643
|
ensureLocalAttachmentGitExclude(workspaceDir);
|
|
69565
69644
|
}
|
|
69566
69645
|
|
|
@@ -69622,6 +69701,10 @@ async function main() {
|
|
|
69622
69701
|
const me = await getAgentMeWithLegacyFallback(client, config.orgId);
|
|
69623
69702
|
const agentUserId = me.id;
|
|
69624
69703
|
const agentLog = childLogger(activeLog, agentUserId);
|
|
69704
|
+
const cliFeatures = probeParallCliFeatures({
|
|
69705
|
+
pathFirst: capabilityBinDir(config.stateDir),
|
|
69706
|
+
log: agentLog
|
|
69707
|
+
});
|
|
69625
69708
|
activeLog = agentLog;
|
|
69626
69709
|
let agentIdentity = identityFromMe(me);
|
|
69627
69710
|
let lastIdentitySnapshot = JSON.stringify(agentIdentity);
|
|
@@ -69768,8 +69851,8 @@ async function main() {
|
|
|
69768
69851
|
agentUserId,
|
|
69769
69852
|
runtimeType: "claude-code",
|
|
69770
69853
|
runtimeVersion: serviceVersion,
|
|
69771
|
-
// Declared only where this bridge
|
|
69772
|
-
runtimeFeatures: secrets ? ["agent_secrets"] : [],
|
|
69854
|
+
// Declared only where this bridge, or the CLI its agent runs, delivers them.
|
|
69855
|
+
runtimeFeatures: [...secrets ? ["agent_secrets"] : [], ...await cliFeatures],
|
|
69773
69856
|
runtimeKey,
|
|
69774
69857
|
runtimeRef: {
|
|
69775
69858
|
hostname: os5.hostname(),
|