@parall/daemon 1.90.0 → 1.92.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 +85 -11
- package/bundle/parall-claude-agent.js +327 -213
- package/bundle/parall-codex-agent.js +338 -221
- package/bundle/parall-daemon.js +113 -12
- 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 : {};
|
|
@@ -52161,6 +52161,8 @@ var clipConnectionEndpoints = {
|
|
|
52161
52161
|
CLIP_CONNECTIONS_ALL: (orgId) => `/api/v1/orgs/${orgId}/clip-connections/all`,
|
|
52162
52162
|
CLIP_CONNECTIONS: (orgId, clipId) => `/api/v1/orgs/${orgId}/clip-registry/${clipId}/connections`,
|
|
52163
52163
|
CLIP_CONNECTION_ACCESS: (orgId, connId) => `/api/v1/orgs/${orgId}/clip-connections/${connId}/access`,
|
|
52164
|
+
/** Who among the org's agents may use one account (per-account setting). */
|
|
52165
|
+
CLIP_CONNECTION_AGENT_ACCESS: (orgId, connId) => `/api/v1/orgs/${orgId}/clip-connections/${connId}/agent-access`,
|
|
52164
52166
|
CLIP_CONNECTION: (orgId, connId) => `/api/v1/orgs/${orgId}/clip-connections/${connId}`,
|
|
52165
52167
|
/** The caller's own (person-owned) connections; login session only. */
|
|
52166
52168
|
ORG_MY_CONNECTIONS: (orgId) => `/api/v1/orgs/${orgId}/me/connections`,
|
|
@@ -52697,6 +52699,7 @@ var ENDPOINTS = {
|
|
|
52697
52699
|
WIKI_UPLOADS: (orgId, wikiId) => `${WIKI_BASE}/orgs/${orgId}/wikis/${wikiId}/uploads`,
|
|
52698
52700
|
WIKI_FILES: (orgId, wikiId) => `${WIKI_BASE}/orgs/${orgId}/wikis/${wikiId}/files`,
|
|
52699
52701
|
WIKI_FILE_PREVIEW_URL: (orgId, wikiId) => `${WIKI_BASE}/orgs/${orgId}/wikis/${wikiId}/files/preview-url`,
|
|
52702
|
+
WIKI_DOCUMENT_IMAGE_PREVIEW_URL: (orgId, wikiId) => `${WIKI_BASE}/orgs/${orgId}/wikis/${wikiId}/document-images/preview-url`,
|
|
52700
52703
|
// Wiki Path Scopes (AFCS ACL)
|
|
52701
52704
|
WIKI_PATH_SCOPES: (orgId, wikiId) => `${WIKI_BASE}/orgs/${orgId}/wikis/${wikiId}/path-scopes`,
|
|
52702
52705
|
WIKI_PATH_SCOPE: (orgId, wikiId, scopeId) => `${WIKI_BASE}/orgs/${orgId}/wikis/${wikiId}/path-scopes/${scopeId}`,
|
|
@@ -53506,8 +53509,16 @@ var MiniAppAccessClient = class extends MiniAppActionClient {
|
|
|
53506
53509
|
async removeMiniAppAccessGrant(orgId, appId, userId) {
|
|
53507
53510
|
return this.request("DELETE", `${access(orgId, appId)}/grants/${encodeURIComponent(userId)}`);
|
|
53508
53511
|
}
|
|
53509
|
-
/**
|
|
53510
|
-
* the
|
|
53512
|
+
/** Puts a team of the organization on the app's access list, or changes
|
|
53513
|
+
* its level: everyone the team reaches gets at least that much. */
|
|
53514
|
+
async setMiniAppAccessTeamGrant(orgId, appId, teamId, level) {
|
|
53515
|
+
return this.request("PUT", `${access(orgId, appId)}/team-grants/${encodeURIComponent(teamId)}`, { access: level });
|
|
53516
|
+
}
|
|
53517
|
+
async removeMiniAppAccessTeamGrant(orgId, appId, teamId) {
|
|
53518
|
+
return this.request("DELETE", `${access(orgId, appId)}/team-grants/${encodeURIComponent(teamId)}`);
|
|
53519
|
+
}
|
|
53520
|
+
/** The change record, newest first: member_access, the access list (people
|
|
53521
|
+
* and teams) and the author roster. */
|
|
53511
53522
|
async getMiniAppAccessLog(orgId, appId, query = {}) {
|
|
53512
53523
|
const response = await this.request("GET", `${access(orgId, appId)}/log`, void 0, { limit: query.limit, before_id: query.before_id });
|
|
53513
53524
|
return response.data;
|
|
@@ -53625,8 +53636,8 @@ var SlackFilesClient = class extends AttachmentClient {
|
|
|
53625
53636
|
* raw bytes plus the vendor-declared name/MIME.
|
|
53626
53637
|
*/
|
|
53627
53638
|
async downloadSlackFile(orgId, fileId) {
|
|
53628
|
-
const
|
|
53629
|
-
const res = await this.rawAuthorizedFetch(
|
|
53639
|
+
const path16 = `${ENDPOINTS.SLACK_FILE(orgId)}?id=${encodeURIComponent(fileId)}`;
|
|
53640
|
+
const res = await this.rawAuthorizedFetch(path16, { timeoutMs: 5 * 60 * 1e3 });
|
|
53630
53641
|
let fileName = "";
|
|
53631
53642
|
const disposition = res.headers.get("content-disposition") ?? "";
|
|
53632
53643
|
const ext = /filename\*=(?:UTF-8'')?([^";]+)/i.exec(disposition);
|
|
@@ -53775,6 +53786,17 @@ var ClipConnectionClient = class extends ChannelConversationClient {
|
|
|
53775
53786
|
async putClipConnectionAccess(orgId, connId, input) {
|
|
53776
53787
|
return this.request("PUT", ENDPOINTS.CLIP_CONNECTION_ACCESS(orgId, connId), input);
|
|
53777
53788
|
}
|
|
53789
|
+
/** Who among the org's agents may use this account. Any org member may read. */
|
|
53790
|
+
async getClipConnectionAgentAccess(orgId, connId) {
|
|
53791
|
+
return this.request("GET", ENDPOINTS.CLIP_CONNECTION_AGENT_ACCESS(orgId, connId));
|
|
53792
|
+
}
|
|
53793
|
+
/**
|
|
53794
|
+
* Replace this account's agent access. Human org owner/admin only (JWT or
|
|
53795
|
+
* personal key); saving `selected` also turns `org_public` off.
|
|
53796
|
+
*/
|
|
53797
|
+
async putClipConnectionAgentAccess(orgId, connId, input) {
|
|
53798
|
+
return this.request("PUT", ENDPOINTS.CLIP_CONNECTION_AGENT_ACCESS(orgId, connId), input);
|
|
53799
|
+
}
|
|
53778
53800
|
/** Start OAuth using the reviewed platform app or provider registration ladder.
|
|
53779
53801
|
* Allow discovery (30s), persistence (10s), and network overhead to finish. */
|
|
53780
53802
|
async createClipMCPOAuthConnection(orgId, clipId, serverUrl, alias, oauthClient) {
|
|
@@ -53831,18 +53853,37 @@ var BrowserProfileClient = class extends HostedProfileCreationClient {
|
|
|
53831
53853
|
const me = await this.request("GET", ENDPOINTS.USERS_ME);
|
|
53832
53854
|
const devices = await this.request("GET", ENDPOINTS.ORG_EDGE_DEVICES(orgId));
|
|
53833
53855
|
const data = [];
|
|
53856
|
+
const warnings = [];
|
|
53834
53857
|
for (const device of devices.data) {
|
|
53835
53858
|
const personal = device.managed_by === "member";
|
|
53836
53859
|
if (personal && device.owner_user_id !== me.id)
|
|
53837
53860
|
continue;
|
|
53838
|
-
|
|
53861
|
+
if (!profileId && device.hosted_state === "deleting") {
|
|
53862
|
+
warnings.push({ device_id: device.id, code: "DEVICE_DELETING" });
|
|
53863
|
+
continue;
|
|
53864
|
+
}
|
|
53865
|
+
const skipMissingDevice = (err) => {
|
|
53866
|
+
const status = typeof err === "object" && err !== null ? err.status : void 0;
|
|
53867
|
+
if (profileId || status !== 404)
|
|
53868
|
+
throw err;
|
|
53869
|
+
warnings.push({ device_id: device.id, code: "DEVICE_NOT_FOUND" });
|
|
53870
|
+
return void 0;
|
|
53871
|
+
};
|
|
53872
|
+
const profiles = await this.request("GET", ENDPOINTS.ORG_EDGE_PROFILES(orgId, device.id)).catch(skipMissingDevice);
|
|
53873
|
+
if (!profiles)
|
|
53874
|
+
continue;
|
|
53875
|
+
const deviceData = [];
|
|
53839
53876
|
for (const profile of profiles) {
|
|
53840
53877
|
if (profileId && profile.id !== profileId)
|
|
53841
53878
|
continue;
|
|
53842
|
-
const access2 = personal ? null : await this.getBrowserProfileAccess(orgId, device.id, profile.name);
|
|
53879
|
+
const access2 = personal ? null : await this.getBrowserProfileAccess(orgId, device.id, profile.name).catch(skipMissingDevice);
|
|
53880
|
+
if (access2 === void 0) {
|
|
53881
|
+
deviceData.length = 0;
|
|
53882
|
+
break;
|
|
53883
|
+
}
|
|
53843
53884
|
if (!personal && !access2?.org_public && !(access2?.grants ?? []).some((g) => g.user_id === me.id && g.grants.length > 0))
|
|
53844
53885
|
continue;
|
|
53845
|
-
|
|
53886
|
+
deviceData.push({
|
|
53846
53887
|
profile_id: profile.id,
|
|
53847
53888
|
name: profile.name,
|
|
53848
53889
|
device_name: device.name,
|
|
@@ -53852,8 +53893,9 @@ var BrowserProfileClient = class extends HostedProfileCreationClient {
|
|
|
53852
53893
|
availability: device.placement === "hosted" ? device.hosted_state ?? "unknown" : device.status
|
|
53853
53894
|
});
|
|
53854
53895
|
}
|
|
53896
|
+
data.push(...deviceData);
|
|
53855
53897
|
}
|
|
53856
|
-
return { data };
|
|
53898
|
+
return { data, ...warnings.length ? { warnings } : {} };
|
|
53857
53899
|
}
|
|
53858
53900
|
/** Submit once: even refresh-enabled clients must not replay browser actions. */
|
|
53859
53901
|
async createBrowserUseOperation(orgId, request3) {
|
|
@@ -53931,9 +53973,9 @@ var WikiDraftClient = class extends BrowserProfileClient {
|
|
|
53931
53973
|
* schema this client edits (default {@link WIKI_DRAFT_SCHEMA_VERSION}); a
|
|
53932
53974
|
* reply in any other schema is refused rather than edited.
|
|
53933
53975
|
*/
|
|
53934
|
-
async openWikiDraft(orgId, wikiId,
|
|
53976
|
+
async openWikiDraft(orgId, wikiId, path16, opts) {
|
|
53935
53977
|
const schema = opts?.schemaVersion ?? WIKI_DRAFT_SCHEMA_VERSION;
|
|
53936
|
-
const connection = await this.request("POST", ENDPOINTS.WIKI_DRAFT_OPEN(orgId, wikiId), { path:
|
|
53978
|
+
const connection = await this.request("POST", ENDPOINTS.WIKI_DRAFT_OPEN(orgId, wikiId), { path: path16, schema_version: schema }, void 0, false, opts);
|
|
53937
53979
|
if (!isWikiDraftConnection(connection) || connection.scope.org_id !== orgId || connection.scope.wiki_id !== wikiId) {
|
|
53938
53980
|
throw new Error("DRAFT_SCOPE");
|
|
53939
53981
|
}
|
|
@@ -54111,10 +54153,10 @@ var ApprovalApproversClient = class extends AgentSecretClient {
|
|
|
54111
54153
|
// ts/sdk/dist/app-template-client.js
|
|
54112
54154
|
var VERSION_HASH = /^[0-9a-f]{64}$/;
|
|
54113
54155
|
var PATH_SEGMENT = /^[A-Za-z0-9._@+-]+$/;
|
|
54114
|
-
function isAppTemplateFilePath(
|
|
54115
|
-
if (!
|
|
54156
|
+
function isAppTemplateFilePath(path16) {
|
|
54157
|
+
if (!path16.startsWith(ENDPOINTS.APP_TEMPLATE_FILES))
|
|
54116
54158
|
return false;
|
|
54117
|
-
const [hash, ...segments] =
|
|
54159
|
+
const [hash, ...segments] = path16.slice(ENDPOINTS.APP_TEMPLATE_FILES.length).split("/");
|
|
54118
54160
|
return VERSION_HASH.test(hash) && segments.length > 0 && segments.every((s) => PATH_SEGMENT.test(s) && s !== "." && s !== "..");
|
|
54119
54161
|
}
|
|
54120
54162
|
var AppTemplateClient = class extends ApprovalApproversClient {
|
|
@@ -54133,11 +54175,11 @@ var AppTemplateClient = class extends ApprovalApproversClient {
|
|
|
54133
54175
|
* above gives for it (`project.archive`, a thumbnail, the demo). Only
|
|
54134
54176
|
* those paths: this is not a way to fetch anything else with the
|
|
54135
54177
|
* client's credentials. */
|
|
54136
|
-
async getAppTemplateFile(
|
|
54137
|
-
if (!isAppTemplateFilePath(
|
|
54138
|
-
throw new Error(`not an app template file path: ${
|
|
54178
|
+
async getAppTemplateFile(path16, opts) {
|
|
54179
|
+
if (!isAppTemplateFilePath(path16)) {
|
|
54180
|
+
throw new Error(`not an app template file path: ${path16}`);
|
|
54139
54181
|
}
|
|
54140
|
-
const res = await this.rawAuthorizedFetch(
|
|
54182
|
+
const res = await this.rawAuthorizedFetch(path16, { timeoutMs: opts?.timeoutMs ?? 6e4 });
|
|
54141
54183
|
return new Uint8Array(await res.arrayBuffer());
|
|
54142
54184
|
}
|
|
54143
54185
|
};
|
|
@@ -54220,9 +54262,12 @@ var TeamGraphClient = class extends AgentOwningTeamClient {
|
|
|
54220
54262
|
* would refuse, with the same codes. 503 when it cannot compute the whole answer
|
|
54221
54263
|
* (`TEAM_MOVE_PREVIEW_WIKI_UNAVAILABLE`, `TEAM_MOVE_PREVIEW_TIMEOUT`,
|
|
54222
54264
|
* `TEAM_MOVE_PREVIEW_TOO_LARGE`). Send `tree_revision` back on `setTeamParent`.
|
|
54265
|
+
* Asks for Mini Apps too (`include=apps`): without it, a move that changes
|
|
54266
|
+
* someone's access to an app answers 503 `TEAM_MOVE_PREVIEW_APPS_UNSUPPORTED`
|
|
54267
|
+
* (mini-app-access-team-grants-design.md §5).
|
|
54223
54268
|
*/
|
|
54224
54269
|
async previewTeamMove(orgId, teamId, parentTeamId) {
|
|
54225
|
-
return this.request("POST", ENDPOINTS.TEAM_PARENT_PREVIEW(orgId, teamId)
|
|
54270
|
+
return this.request("POST", `${ENDPOINTS.TEAM_PARENT_PREVIEW(orgId, teamId)}?include=apps`, {
|
|
54226
54271
|
parent_team_id: parentTeamId
|
|
54227
54272
|
});
|
|
54228
54273
|
}
|
|
@@ -54443,18 +54488,18 @@ var MemberFieldClient = class extends TeamInviteClient {
|
|
|
54443
54488
|
|
|
54444
54489
|
// ts/sdk/dist/wiki-page-share-client.js
|
|
54445
54490
|
var WikiPageShareClient = class extends MemberFieldClient {
|
|
54446
|
-
async listWikiPageShares(orgId, wikiId,
|
|
54447
|
-
const res = await this.request("GET", ENDPOINTS.WIKI_PAGE_SHARES(orgId, wikiId), void 0, { path:
|
|
54491
|
+
async listWikiPageShares(orgId, wikiId, path16) {
|
|
54492
|
+
const res = await this.request("GET", ENDPOINTS.WIKI_PAGE_SHARES(orgId, wikiId), void 0, { path: path16 });
|
|
54448
54493
|
return res.data;
|
|
54449
54494
|
}
|
|
54450
|
-
async createWikiPageShare(orgId, wikiId,
|
|
54451
|
-
return this.request("POST", ENDPOINTS.WIKI_PAGE_SHARES(orgId, wikiId), { user_id: userId }, { path:
|
|
54495
|
+
async createWikiPageShare(orgId, wikiId, path16, userId) {
|
|
54496
|
+
return this.request("POST", ENDPOINTS.WIKI_PAGE_SHARES(orgId, wikiId), { user_id: userId }, { path: path16 });
|
|
54452
54497
|
}
|
|
54453
|
-
async revokeWikiPageShare(orgId, wikiId,
|
|
54454
|
-
return this.request("DELETE", `${ENDPOINTS.WIKI_PAGE_SHARES(orgId, wikiId)}/${encodeURIComponent(shareId)}`, void 0, { path:
|
|
54498
|
+
async revokeWikiPageShare(orgId, wikiId, path16, shareId) {
|
|
54499
|
+
return this.request("DELETE", `${ENDPOINTS.WIKI_PAGE_SHARES(orgId, wikiId)}/${encodeURIComponent(shareId)}`, void 0, { path: path16 });
|
|
54455
54500
|
}
|
|
54456
|
-
async listWikiShareCandidates(orgId, wikiId,
|
|
54457
|
-
const res = await this.request("GET", ENDPOINTS.WIKI_PAGE_SHARE_CANDIDATES(orgId, wikiId), void 0, { path:
|
|
54501
|
+
async listWikiShareCandidates(orgId, wikiId, path16, q = "") {
|
|
54502
|
+
const res = await this.request("GET", ENDPOINTS.WIKI_PAGE_SHARE_CANDIDATES(orgId, wikiId), void 0, { path: path16, q });
|
|
54458
54503
|
return res.data;
|
|
54459
54504
|
}
|
|
54460
54505
|
/** No path or ref override: the server always reads the shared page on main. */
|
|
@@ -54477,6 +54522,20 @@ var ChatBookmarksClient = class extends WikiPageShareClient {
|
|
|
54477
54522
|
}
|
|
54478
54523
|
};
|
|
54479
54524
|
|
|
54525
|
+
// ts/sdk/dist/template-catalog-client.js
|
|
54526
|
+
var templateCatalogPath = (orgId) => `${API_BASE2}/orgs/${orgId}/templates/catalog`;
|
|
54527
|
+
var TemplateCatalogClient = class extends ChatBookmarksClient {
|
|
54528
|
+
/**
|
|
54529
|
+
* The published team templates this organization can hire. Open to every
|
|
54530
|
+
* member, people and agents alike (owners and admins also have the full
|
|
54531
|
+
* definitions through `listOfficialTemplates`).
|
|
54532
|
+
*/
|
|
54533
|
+
async listTemplateCatalog(orgId) {
|
|
54534
|
+
const res = await this.request("GET", templateCatalogPath(orgId));
|
|
54535
|
+
return res.templates ?? [];
|
|
54536
|
+
}
|
|
54537
|
+
};
|
|
54538
|
+
|
|
54480
54539
|
// ts/sdk/dist/wiki-changeset.js
|
|
54481
54540
|
function normalizeWikiChangeset(changeset) {
|
|
54482
54541
|
return {
|
|
@@ -54512,7 +54571,7 @@ function legacyHeartbeatFromReport(report) {
|
|
|
54512
54571
|
detectedRuntimes
|
|
54513
54572
|
};
|
|
54514
54573
|
}
|
|
54515
|
-
var ParallClient = class _ParallClient extends
|
|
54574
|
+
var ParallClient = class _ParallClient extends TemplateCatalogClient {
|
|
54516
54575
|
baseUrl;
|
|
54517
54576
|
wikiBaseUrl;
|
|
54518
54577
|
token;
|
|
@@ -54556,7 +54615,7 @@ var ParallClient = class _ParallClient extends ChatBookmarksClient {
|
|
|
54556
54615
|
return apiError;
|
|
54557
54616
|
}
|
|
54558
54617
|
/** Build headers common to all requests (auth, swimlane). */
|
|
54559
|
-
buildHeaders(
|
|
54618
|
+
buildHeaders(path16, extra) {
|
|
54560
54619
|
const headers = {
|
|
54561
54620
|
"Content-Type": "application/json",
|
|
54562
54621
|
...extra
|
|
@@ -54567,11 +54626,11 @@ var ParallClient = class _ParallClient extends ChatBookmarksClient {
|
|
|
54567
54626
|
if (this.swimlaneName) {
|
|
54568
54627
|
headers["X-Prll-Swimlane"] = this.swimlaneName;
|
|
54569
54628
|
}
|
|
54570
|
-
if (
|
|
54629
|
+
if (path16.startsWith(API_BASE2)) {
|
|
54571
54630
|
const overrides = this.getFeatureFlagOverrides?.();
|
|
54572
54631
|
if (overrides)
|
|
54573
54632
|
headers["X-Prll-FF-Override"] = overrides;
|
|
54574
|
-
Object.assign(headers, this.getRequestHeaders?.(
|
|
54633
|
+
Object.assign(headers, this.getRequestHeaders?.(path16), extra);
|
|
54575
54634
|
}
|
|
54576
54635
|
return headers;
|
|
54577
54636
|
}
|
|
@@ -54593,8 +54652,8 @@ var ParallClient = class _ParallClient extends ChatBookmarksClient {
|
|
|
54593
54652
|
* is authoritative, so wiki vs api routing can't drift from how a caller
|
|
54594
54653
|
* happens to invoke the client.
|
|
54595
54654
|
*/
|
|
54596
|
-
baseUrlFor(
|
|
54597
|
-
return
|
|
54655
|
+
baseUrlFor(path16) {
|
|
54656
|
+
return path16.startsWith(WIKI_BASE) ? this.wikiBaseUrl : this.baseUrl;
|
|
54598
54657
|
}
|
|
54599
54658
|
setToken(token) {
|
|
54600
54659
|
this.token = token;
|
|
@@ -54621,10 +54680,10 @@ var ParallClient = class _ParallClient extends ChatBookmarksClient {
|
|
|
54621
54680
|
* REFRESH_THRESHOLD_S, refresh it **before** sending the request.
|
|
54622
54681
|
* No-op when the token is still fresh, missing, or un-parseable.
|
|
54623
54682
|
*/
|
|
54624
|
-
async ensureFreshToken(
|
|
54683
|
+
async ensureFreshToken(path16) {
|
|
54625
54684
|
if (!this.token || !this.getRefreshToken)
|
|
54626
54685
|
return;
|
|
54627
|
-
const pathSuffix =
|
|
54686
|
+
const pathSuffix = path16.replace(/^\/api\/v1/, "");
|
|
54628
54687
|
if (_ParallClient.AUTH_PATHS.has(pathSuffix))
|
|
54629
54688
|
return;
|
|
54630
54689
|
const exp = _ParallClient.decodeJwtExp(this.token);
|
|
@@ -54656,11 +54715,11 @@ var ParallClient = class _ParallClient extends ChatBookmarksClient {
|
|
|
54656
54715
|
this.refreshPromise = null;
|
|
54657
54716
|
}
|
|
54658
54717
|
}
|
|
54659
|
-
async request(method,
|
|
54718
|
+
async request(method, path16, body, query, retried = false, opts) {
|
|
54660
54719
|
if (!retried) {
|
|
54661
|
-
await this.ensureFreshToken(
|
|
54720
|
+
await this.ensureFreshToken(path16);
|
|
54662
54721
|
}
|
|
54663
|
-
let url = `${this.baseUrlFor(
|
|
54722
|
+
let url = `${this.baseUrlFor(path16)}${path16}`;
|
|
54664
54723
|
if (query) {
|
|
54665
54724
|
const params = new URLSearchParams();
|
|
54666
54725
|
for (const [key, value] of Object.entries(query)) {
|
|
@@ -54672,7 +54731,7 @@ var ParallClient = class _ParallClient extends ChatBookmarksClient {
|
|
|
54672
54731
|
if (qs)
|
|
54673
54732
|
url += `?${qs}`;
|
|
54674
54733
|
}
|
|
54675
|
-
const headers = this.buildHeaders(
|
|
54734
|
+
const headers = this.buildHeaders(path16, opts?.headers);
|
|
54676
54735
|
const timeoutSignal = AbortSignal.timeout(opts?.timeoutMs ?? 15e3);
|
|
54677
54736
|
const signal = opts?.signal ? AbortSignal.any([opts.signal, timeoutSignal]) : timeoutSignal;
|
|
54678
54737
|
let res;
|
|
@@ -54690,12 +54749,12 @@ var ParallClient = class _ParallClient extends ChatBookmarksClient {
|
|
|
54690
54749
|
throw _ParallClient.normalizeFetchError(err);
|
|
54691
54750
|
}
|
|
54692
54751
|
if (res.status === 401) {
|
|
54693
|
-
const pathSuffix =
|
|
54752
|
+
const pathSuffix = path16.replace(/^\/api\/v1/, "");
|
|
54694
54753
|
const isAuthPath = _ParallClient.AUTH_PATHS.has(pathSuffix);
|
|
54695
54754
|
if (!retried && !isAuthPath && this.getRefreshToken) {
|
|
54696
54755
|
const refreshed = await this.tryRefresh();
|
|
54697
54756
|
if (refreshed) {
|
|
54698
|
-
return this.request(method,
|
|
54757
|
+
return this.request(method, path16, body, query, true, opts);
|
|
54699
54758
|
}
|
|
54700
54759
|
}
|
|
54701
54760
|
if (this.onTokenExpired && !isAuthPath) {
|
|
@@ -54725,18 +54784,18 @@ var ParallClient = class _ParallClient extends ChatBookmarksClient {
|
|
|
54725
54784
|
* hit the 100 MiB cap, so a longer 5-minute timeout is used so a
|
|
54726
54785
|
* 50 MiB blob on a slow connection doesn't get chopped at 15 s.
|
|
54727
54786
|
*/
|
|
54728
|
-
async multipartRequest(method,
|
|
54787
|
+
async multipartRequest(method, path16, body, retried = false, opts) {
|
|
54729
54788
|
if (!retried) {
|
|
54730
|
-
await this.ensureFreshToken(
|
|
54789
|
+
await this.ensureFreshToken(path16);
|
|
54731
54790
|
}
|
|
54732
|
-
const { "Content-Type": _drop, ...headers } = this.buildHeaders(
|
|
54791
|
+
const { "Content-Type": _drop, ...headers } = this.buildHeaders(path16);
|
|
54733
54792
|
void _drop;
|
|
54734
54793
|
const timeoutMs = opts?.timeoutMs ?? 5 * 60 * 1e3;
|
|
54735
54794
|
let res;
|
|
54736
54795
|
try {
|
|
54737
54796
|
res = await sendMultipartRequest({
|
|
54738
54797
|
method,
|
|
54739
|
-
url: `${this.baseUrlFor(
|
|
54798
|
+
url: `${this.baseUrlFor(path16)}${path16}`,
|
|
54740
54799
|
headers,
|
|
54741
54800
|
body,
|
|
54742
54801
|
timeoutMs,
|
|
@@ -54747,12 +54806,12 @@ var ParallClient = class _ParallClient extends ChatBookmarksClient {
|
|
|
54747
54806
|
throw _ParallClient.normalizeFetchError(err);
|
|
54748
54807
|
}
|
|
54749
54808
|
if (res.status === 401) {
|
|
54750
|
-
const pathSuffix =
|
|
54809
|
+
const pathSuffix = path16.replace(/^\/api\/v1/, "");
|
|
54751
54810
|
const isAuthPath = _ParallClient.AUTH_PATHS.has(pathSuffix);
|
|
54752
54811
|
if (!retried && !isAuthPath && this.getRefreshToken) {
|
|
54753
54812
|
const refreshed = await this.tryRefresh();
|
|
54754
54813
|
if (refreshed) {
|
|
54755
|
-
return this.multipartRequest(method,
|
|
54814
|
+
return this.multipartRequest(method, path16, body, true, opts);
|
|
54756
54815
|
}
|
|
54757
54816
|
}
|
|
54758
54817
|
if (this.onTokenExpired && !isAuthPath) {
|
|
@@ -55712,8 +55771,8 @@ var ParallClient = class _ParallClient extends ChatBookmarksClient {
|
|
|
55712
55771
|
* remote filesystem browse of a member's machine was remote device access.
|
|
55713
55772
|
* The endpoint now answers 409 LOCAL_BROWSE_NOT_SUPPORTED unconditionally;
|
|
55714
55773
|
* workspace paths are typed in (or picked on the machine's own Desktop). */
|
|
55715
|
-
async browseMachineFilesystem(orgId, machineId,
|
|
55716
|
-
return this.request("POST", ENDPOINTS.MACHINE_BROWSE(orgId, machineId), { path:
|
|
55774
|
+
async browseMachineFilesystem(orgId, machineId, path16) {
|
|
55775
|
+
return this.request("POST", ENDPOINTS.MACHINE_BROWSE(orgId, machineId), { path: path16 }, void 0, false, { timeoutMs: 15e3 });
|
|
55717
55776
|
}
|
|
55718
55777
|
/** Create a new machine key. Returns the raw key string (shown once) + metadata. */
|
|
55719
55778
|
async createMachineKey(orgId, machineId, name) {
|
|
@@ -56044,14 +56103,14 @@ var ParallClient = class _ParallClient extends ChatBookmarksClient {
|
|
|
56044
56103
|
* refresh-and-retry-once, and error-envelope handling as `request` — the
|
|
56045
56104
|
* transfer primitive the SlackFilesClient domain module builds on.
|
|
56046
56105
|
*/
|
|
56047
|
-
async rawAuthorizedFetch(
|
|
56106
|
+
async rawAuthorizedFetch(path16, opts, retried = false) {
|
|
56048
56107
|
if (!retried) {
|
|
56049
|
-
await this.ensureFreshToken(
|
|
56108
|
+
await this.ensureFreshToken(path16);
|
|
56050
56109
|
}
|
|
56051
|
-
const headers = this.buildHeaders(
|
|
56110
|
+
const headers = this.buildHeaders(path16);
|
|
56052
56111
|
let res;
|
|
56053
56112
|
try {
|
|
56054
|
-
res = await fetch(`${this.baseUrlFor(
|
|
56113
|
+
res = await fetch(`${this.baseUrlFor(path16)}${path16}`, {
|
|
56055
56114
|
method: "GET",
|
|
56056
56115
|
headers,
|
|
56057
56116
|
// File transfers get the multipart-tier budget, not the 15s JSON one.
|
|
@@ -56064,7 +56123,7 @@ var ParallClient = class _ParallClient extends ChatBookmarksClient {
|
|
|
56064
56123
|
if (!retried && this.getRefreshToken) {
|
|
56065
56124
|
const refreshed = await this.tryRefresh();
|
|
56066
56125
|
if (refreshed) {
|
|
56067
|
-
return this.rawAuthorizedFetch(
|
|
56126
|
+
return this.rawAuthorizedFetch(path16, opts, true);
|
|
56068
56127
|
}
|
|
56069
56128
|
}
|
|
56070
56129
|
this.onTokenExpired?.();
|
|
@@ -56316,6 +56375,19 @@ var ParallClient = class _ParallClient extends ChatBookmarksClient {
|
|
|
56316
56375
|
res.url = this.absoluteMediaUrl(res.url);
|
|
56317
56376
|
return res;
|
|
56318
56377
|
}
|
|
56378
|
+
/**
|
|
56379
|
+
* Sign the same kind of URL for a picture a Wiki document references.
|
|
56380
|
+
* `src` goes as the document's renderer hands it over (written or
|
|
56381
|
+
* percent-encoded); the server resolves it against `document_path`, applies
|
|
56382
|
+
* a `rev=` pin in it over `ref`, and checks read access on the file it
|
|
56383
|
+
* names. A src that is not a wiki path answers 400 `NOT_WIKI_FILE`.
|
|
56384
|
+
*/
|
|
56385
|
+
async getWikiDocumentImagePreviewUrl(orgId, wikiId, params) {
|
|
56386
|
+
const res = await this.request("POST", ENDPOINTS.WIKI_DOCUMENT_IMAGE_PREVIEW_URL(orgId, wikiId), params);
|
|
56387
|
+
if (res.url)
|
|
56388
|
+
res.url = this.absoluteMediaUrl(res.url);
|
|
56389
|
+
return res;
|
|
56390
|
+
}
|
|
56319
56391
|
// ---- Wiki Path Scopes (AFCS ACL) ----
|
|
56320
56392
|
async getWikiPathScopes(orgId, wikiId) {
|
|
56321
56393
|
const res = await this.request("GET", ENDPOINTS.WIKI_PATH_SCOPES(orgId, wikiId));
|
|
@@ -56338,12 +56410,12 @@ var ParallClient = class _ParallClient extends ChatBookmarksClient {
|
|
|
56338
56410
|
async deleteWikiRestriction(orgId, wikiId, restrictionId) {
|
|
56339
56411
|
await this.request("DELETE", ENDPOINTS.WIKI_RESTRICTION(orgId, wikiId, restrictionId));
|
|
56340
56412
|
}
|
|
56341
|
-
async getWikiAccessStatus(orgId, wikiId,
|
|
56342
|
-
return this.request("GET", ENDPOINTS.WIKI_ACCESS_STATUS(orgId, wikiId), void 0,
|
|
56413
|
+
async getWikiAccessStatus(orgId, wikiId, path16) {
|
|
56414
|
+
return this.request("GET", ENDPOINTS.WIKI_ACCESS_STATUS(orgId, wikiId), void 0, path16 ? { path: path16 } : void 0);
|
|
56343
56415
|
}
|
|
56344
56416
|
// ---- Wiki membership projection (who-can-access, invites, join/leave) ----
|
|
56345
|
-
async getWikiAccessPolicy(orgId, wikiId,
|
|
56346
|
-
return this.request("GET", ENDPOINTS.WIKI_ACCESS_POLICY(orgId, wikiId), void 0,
|
|
56417
|
+
async getWikiAccessPolicy(orgId, wikiId, path16 = "") {
|
|
56418
|
+
return this.request("GET", ENDPOINTS.WIKI_ACCESS_POLICY(orgId, wikiId), void 0, path16 ? { path: path16 } : void 0);
|
|
56347
56419
|
}
|
|
56348
56420
|
async putWikiAccessPolicy(orgId, wikiId, policy) {
|
|
56349
56421
|
return this.request("PUT", ENDPOINTS.WIKI_ACCESS_POLICY(orgId, wikiId), policy);
|
|
@@ -56388,18 +56460,18 @@ var ParallClient = class _ParallClient extends ChatBookmarksClient {
|
|
|
56388
56460
|
async getWikiCommits(orgId, wikiId, params) {
|
|
56389
56461
|
return this.request("GET", ENDPOINTS.WIKI_COMMITS(orgId, wikiId), void 0, params);
|
|
56390
56462
|
}
|
|
56391
|
-
async getWikiFileCommits(orgId, wikiId,
|
|
56463
|
+
async getWikiFileCommits(orgId, wikiId, path16, params) {
|
|
56392
56464
|
return this.request("GET", ENDPOINTS.WIKI_FILE_COMMITS(orgId, wikiId), void 0, {
|
|
56393
|
-
path:
|
|
56465
|
+
path: path16,
|
|
56394
56466
|
...params
|
|
56395
56467
|
});
|
|
56396
56468
|
}
|
|
56397
56469
|
/** Bounded, ACL-safe activity for one Wiki file path. */
|
|
56398
|
-
async getWikiPathActivity(orgId, wikiId,
|
|
56399
|
-
return this.request("GET", ENDPOINTS.WIKI_PATH_ACTIVITY(orgId, wikiId), void 0, { path:
|
|
56470
|
+
async getWikiPathActivity(orgId, wikiId, path16, opts) {
|
|
56471
|
+
return this.request("GET", ENDPOINTS.WIKI_PATH_ACTIVITY(orgId, wikiId), void 0, { path: path16 }, false, opts);
|
|
56400
56472
|
}
|
|
56401
|
-
async getWikiBlame(orgId, wikiId,
|
|
56402
|
-
return this.request("GET", ENDPOINTS.WIKI_BLAME(orgId, wikiId), void 0, { path:
|
|
56473
|
+
async getWikiBlame(orgId, wikiId, path16, ref) {
|
|
56474
|
+
return this.request("GET", ENDPOINTS.WIKI_BLAME(orgId, wikiId), void 0, { path: path16, ref });
|
|
56403
56475
|
}
|
|
56404
56476
|
// ---- Wiki Operations (audit log) ----
|
|
56405
56477
|
async getWikiOperations(orgId, wikiId, params) {
|
|
@@ -56803,9 +56875,11 @@ var ParallClient = class _ParallClient extends ChatBookmarksClient {
|
|
|
56803
56875
|
});
|
|
56804
56876
|
}
|
|
56805
56877
|
/** Idempotently begin deleting a hosted Cloud Profile; every repeat returns
|
|
56806
|
-
* `202 deleting` until the pod and stored browser state are finalized.
|
|
56807
|
-
|
|
56808
|
-
|
|
56878
|
+
* `202 deleting` until the pod and stored browser state are finalized.
|
|
56879
|
+
* `ifUnused` deletes only when no connection runs on it and no browser
|
|
56880
|
+
* profile on it is shared or granted; otherwise `409 EDGE_IN_USE`. */
|
|
56881
|
+
async deleteEdgeDevice(orgId, edgeId, options) {
|
|
56882
|
+
return this.request("DELETE", ENDPOINTS.ORG_EDGE_DEVICE(orgId, edgeId), void 0, options?.ifUnused ? { if_unused: "true" } : void 0);
|
|
56809
56883
|
}
|
|
56810
56884
|
/** Move the human caller's OWN BYOC device between the org layer and their
|
|
56811
56885
|
* personal layer (ADR-020). `member` takes the device — and every clip
|
|
@@ -58023,6 +58097,42 @@ function renderCmdPointer(nodeExecPath, entryJsPath, binDir, channel) {
|
|
|
58023
58097
|
].join("\r\n");
|
|
58024
58098
|
}
|
|
58025
58099
|
|
|
58100
|
+
// ts/agent-core/dist/cli-features.js
|
|
58101
|
+
import { execFile } from "node:child_process";
|
|
58102
|
+
import path2 from "node:path";
|
|
58103
|
+
var DECLARABLE = ["wiki_read_snapshot"];
|
|
58104
|
+
var PROBE_TIMEOUT_MS = 5e3;
|
|
58105
|
+
function probeParallCliFeatures(opts = {}) {
|
|
58106
|
+
const command = opts.command ?? "parall";
|
|
58107
|
+
const env = { ...opts.env ?? process.env };
|
|
58108
|
+
if (opts.pathFirst) {
|
|
58109
|
+
const key = process.platform === "win32" ? Object.keys(env).find((k) => k.toUpperCase() === "PATH") ?? "PATH" : "PATH";
|
|
58110
|
+
env[key] = env[key] ? `${opts.pathFirst}${path2.delimiter}${env[key]}` : opts.pathFirst;
|
|
58111
|
+
}
|
|
58112
|
+
return new Promise((resolve3) => {
|
|
58113
|
+
execFile(command, ["capabilities"], {
|
|
58114
|
+
env,
|
|
58115
|
+
timeout: opts.timeoutMs ?? PROBE_TIMEOUT_MS,
|
|
58116
|
+
maxBuffer: 64 * 1024,
|
|
58117
|
+
windowsHide: true,
|
|
58118
|
+
// npm installs the CLI as a .cmd shim on Windows, which only a shell runs.
|
|
58119
|
+
shell: process.platform === "win32"
|
|
58120
|
+
}, (err, stdout) => {
|
|
58121
|
+
let listed;
|
|
58122
|
+
if (!err) {
|
|
58123
|
+
try {
|
|
58124
|
+
listed = JSON.parse(stdout).features;
|
|
58125
|
+
} catch {
|
|
58126
|
+
listed = void 0;
|
|
58127
|
+
}
|
|
58128
|
+
}
|
|
58129
|
+
const features = Array.isArray(listed) ? DECLARABLE.filter((f) => listed.includes(f)) : [];
|
|
58130
|
+
opts.log?.info?.(features.length > 0 ? `${command} declares ${features.join(", ")}` : `${command} declares no features (${err ? err.code ?? err.message : "unexpected output"})`);
|
|
58131
|
+
resolve3(features);
|
|
58132
|
+
});
|
|
58133
|
+
});
|
|
58134
|
+
}
|
|
58135
|
+
|
|
58026
58136
|
// ts/agent-core/dist/config-refresh.js
|
|
58027
58137
|
function createConfigRefresh(opts) {
|
|
58028
58138
|
const { secrets } = opts;
|
|
@@ -58160,16 +58270,16 @@ async function persistRuntimeObservation(persister, sessionId, target, event, lo
|
|
|
58160
58270
|
}
|
|
58161
58271
|
|
|
58162
58272
|
// ts/agent-core/dist/lane/key.js
|
|
58163
|
-
import * as
|
|
58273
|
+
import * as path3 from "node:path";
|
|
58164
58274
|
function laneKeyForTarget(targetUri, threadRootId) {
|
|
58165
58275
|
return Buffer.from(`${targetUri}
|
|
58166
58276
|
${threadRootId ?? ""}`, "utf8").toString("base64url");
|
|
58167
58277
|
}
|
|
58168
58278
|
function dispatchLaneContextDir(stateDir) {
|
|
58169
|
-
return
|
|
58279
|
+
return path3.join(stateDir, "dispatch-lane-context");
|
|
58170
58280
|
}
|
|
58171
58281
|
function laneContextFilePath(contextDir, targetUri, threadRootId) {
|
|
58172
|
-
return
|
|
58282
|
+
return path3.join(contextDir, `${laneKeyForTarget(targetUri, threadRootId)}.json`);
|
|
58173
58283
|
}
|
|
58174
58284
|
|
|
58175
58285
|
// ts/agent-core/dist/gateway/source-routing.js
|
|
@@ -58405,7 +58515,7 @@ function splitChangeSource(sourceId) {
|
|
|
58405
58515
|
|
|
58406
58516
|
// ts/agent-core/dist/gateway/base.js
|
|
58407
58517
|
import * as fs4 from "node:fs";
|
|
58408
|
-
import * as
|
|
58518
|
+
import * as path6 from "node:path";
|
|
58409
58519
|
|
|
58410
58520
|
// ts/agent-core/dist/gateway/fork-handoff.js
|
|
58411
58521
|
var ForkResultHandoff = class {
|
|
@@ -58545,13 +58655,13 @@ init_esm();
|
|
|
58545
58655
|
var import_api_logs = __toESM(require_src(), 1);
|
|
58546
58656
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
58547
58657
|
import { readFileSync as readFileSync2 } from "node:fs";
|
|
58548
|
-
import * as
|
|
58658
|
+
import * as path5 from "node:path";
|
|
58549
58659
|
import { fileURLToPath as fileURLToPath2 } from "node:url";
|
|
58550
58660
|
|
|
58551
58661
|
// ts/agent-core/dist/otlp-spool.js
|
|
58552
58662
|
import * as fs2 from "node:fs";
|
|
58553
58663
|
import * as fsp from "node:fs/promises";
|
|
58554
|
-
import * as
|
|
58664
|
+
import * as path4 from "node:path";
|
|
58555
58665
|
var SPOOL_SIGNALS = ["traces", "metrics", "logs"];
|
|
58556
58666
|
var DEFAULT_MAX_BYTES = {
|
|
58557
58667
|
traces: 6 << 20,
|
|
@@ -58658,9 +58768,9 @@ var OtlpSpoolStore = class {
|
|
|
58658
58768
|
const dir = this.signalDir(signal);
|
|
58659
58769
|
try {
|
|
58660
58770
|
await fsp.mkdir(dir, { recursive: true });
|
|
58661
|
-
const tmp =
|
|
58771
|
+
const tmp = path4.join(dir, `${name}.tmp`);
|
|
58662
58772
|
await fsp.writeFile(tmp, bytes);
|
|
58663
|
-
await fsp.rename(tmp,
|
|
58773
|
+
await fsp.rename(tmp, path4.join(dir, name));
|
|
58664
58774
|
} catch (err) {
|
|
58665
58775
|
this.log(`spool write failed for ${signal}: ${String(err)}`);
|
|
58666
58776
|
return drop("write_failed");
|
|
@@ -58714,7 +58824,7 @@ var OtlpSpoolStore = class {
|
|
|
58714
58824
|
}
|
|
58715
58825
|
if (this.sent.has(file.name))
|
|
58716
58826
|
continue;
|
|
58717
|
-
const full =
|
|
58827
|
+
const full = path4.join(this.signalDir(signal), file.name);
|
|
58718
58828
|
let body;
|
|
58719
58829
|
try {
|
|
58720
58830
|
body = await fsp.readFile(full);
|
|
@@ -58778,7 +58888,7 @@ var OtlpSpoolStore = class {
|
|
|
58778
58888
|
await this.replaying;
|
|
58779
58889
|
}
|
|
58780
58890
|
signalDir(signal) {
|
|
58781
|
-
return
|
|
58891
|
+
return path4.join(this.opts.dir, signal);
|
|
58782
58892
|
}
|
|
58783
58893
|
/** Read the directory once; afterwards the index is maintained in memory. */
|
|
58784
58894
|
async load(signal) {
|
|
@@ -58796,7 +58906,7 @@ var OtlpSpoolStore = class {
|
|
|
58796
58906
|
}
|
|
58797
58907
|
const now = this.now();
|
|
58798
58908
|
for (const name of names.sort()) {
|
|
58799
|
-
const full =
|
|
58909
|
+
const full = path4.join(dir, name);
|
|
58800
58910
|
const m = FILE_RE.exec(name);
|
|
58801
58911
|
if (!m) {
|
|
58802
58912
|
if (name.endsWith(".tmp")) {
|
|
@@ -58834,7 +58944,7 @@ var OtlpSpoolStore = class {
|
|
|
58834
58944
|
async remove(signal, idx, file, alreadyGone = false) {
|
|
58835
58945
|
if (!alreadyGone) {
|
|
58836
58946
|
try {
|
|
58837
|
-
await fsp.unlink(
|
|
58947
|
+
await fsp.unlink(path4.join(this.signalDir(signal), file.name));
|
|
58838
58948
|
} catch (err) {
|
|
58839
58949
|
if (err.code !== "ENOENT") {
|
|
58840
58950
|
this.log(`spool could not delete ${signal}/${file.name}: ${String(err)}`);
|
|
@@ -58977,11 +59087,11 @@ function resolveServiceVersion(importMetaUrl) {
|
|
|
58977
59087
|
const fallback = process.env.npm_package_version || "unknown";
|
|
58978
59088
|
let dir;
|
|
58979
59089
|
try {
|
|
58980
|
-
dir =
|
|
59090
|
+
dir = path5.dirname(fileURLToPath2(importMetaUrl));
|
|
58981
59091
|
} catch {
|
|
58982
59092
|
return fallback;
|
|
58983
59093
|
}
|
|
58984
|
-
for (const candidate of [
|
|
59094
|
+
for (const candidate of [path5.join(dir, "manifest.json"), path5.join(dir, "..", "package.json")]) {
|
|
58985
59095
|
try {
|
|
58986
59096
|
const parsed = JSON.parse(readFileSync2(candidate, "utf-8"));
|
|
58987
59097
|
if (typeof parsed.version === "string" && parsed.version.trim()) {
|
|
@@ -63625,7 +63735,7 @@ var ParallAgentGateway = class {
|
|
|
63625
63735
|
}
|
|
63626
63736
|
writeContextFile(filePath, ctx) {
|
|
63627
63737
|
try {
|
|
63628
|
-
fs4.mkdirSync(
|
|
63738
|
+
fs4.mkdirSync(path6.dirname(filePath), { recursive: true });
|
|
63629
63739
|
fs4.writeFileSync(filePath, JSON.stringify(ctx), "utf8");
|
|
63630
63740
|
} catch (err) {
|
|
63631
63741
|
this.opts.log?.warn(`failed to write context file ${filePath}: ${String(err)}`);
|
|
@@ -63654,7 +63764,7 @@ var ParallAgentGateway = class {
|
|
|
63654
63764
|
/** @deprecated Use writeContextFile / updateContextFileStepId. */
|
|
63655
63765
|
writeStepIdFile(filePath, stepId) {
|
|
63656
63766
|
try {
|
|
63657
|
-
fs4.mkdirSync(
|
|
63767
|
+
fs4.mkdirSync(path6.dirname(filePath), { recursive: true });
|
|
63658
63768
|
fs4.writeFileSync(filePath, stepId, "utf8");
|
|
63659
63769
|
} catch (err) {
|
|
63660
63770
|
this.opts.log?.warn(`failed to write step id file ${filePath}: ${String(err)}`);
|
|
@@ -63812,7 +63922,7 @@ function childLogger(logger, sub) {
|
|
|
63812
63922
|
|
|
63813
63923
|
// ts/agent-core/dist/platform-config.js
|
|
63814
63924
|
import * as fs5 from "node:fs";
|
|
63815
|
-
import * as
|
|
63925
|
+
import * as path7 from "node:path";
|
|
63816
63926
|
function extractCapabilities(config) {
|
|
63817
63927
|
const agents = config.agents ?? {};
|
|
63818
63928
|
const raw = agents.capabilities;
|
|
@@ -63867,7 +63977,7 @@ function deriveModelIsPin(defaults, profile) {
|
|
|
63867
63977
|
var CACHE_FILENAME = "parall-platform-config.json";
|
|
63868
63978
|
var SUPPORTED_SCHEMA_VERSION = 1;
|
|
63869
63979
|
function cachePath(stateDir) {
|
|
63870
|
-
return
|
|
63980
|
+
return path7.join(stateDir, CACHE_FILENAME);
|
|
63871
63981
|
}
|
|
63872
63982
|
function loadCache(stateDir) {
|
|
63873
63983
|
try {
|
|
@@ -63886,7 +63996,7 @@ function saveCache(stateDir, response) {
|
|
|
63886
63996
|
};
|
|
63887
63997
|
const filePath = cachePath(stateDir);
|
|
63888
63998
|
const tmpPath = `${filePath}.tmp`;
|
|
63889
|
-
fs5.mkdirSync(
|
|
63999
|
+
fs5.mkdirSync(path7.dirname(filePath), { recursive: true });
|
|
63890
64000
|
fs5.writeFileSync(tmpPath, JSON.stringify(cached, null, 2), "utf-8");
|
|
63891
64001
|
fs5.renameSync(tmpPath, filePath);
|
|
63892
64002
|
}
|
|
@@ -64095,7 +64205,7 @@ navigate \u6216 close \u4E5F\u4F1A\u5173\u6389\u5F39\u6846\u3002\u56DE\u7B54\u54
|
|
|
64095
64205
|
|
|
64096
64206
|
// ts/agent-core/dist/skills/index.js
|
|
64097
64207
|
import * as fs6 from "node:fs";
|
|
64098
|
-
import * as
|
|
64208
|
+
import * as path8 from "node:path";
|
|
64099
64209
|
|
|
64100
64210
|
// ts/agent-core/dist/skills/parall-platform.js
|
|
64101
64211
|
var PARALL_PLATFORM_SKILL = `# Parall Platform
|
|
@@ -65880,11 +65990,11 @@ var SKILLS = [
|
|
|
65880
65990
|
function writeSkillFiles(targetDir) {
|
|
65881
65991
|
fs6.mkdirSync(targetDir, { recursive: true });
|
|
65882
65992
|
for (const skill of SKILLS) {
|
|
65883
|
-
fs6.writeFileSync(
|
|
65993
|
+
fs6.writeFileSync(path8.join(targetDir, `${skill.name}.md`), skill.content, "utf8");
|
|
65884
65994
|
}
|
|
65885
65995
|
}
|
|
65886
65996
|
function buildSkillReferences(workspaceDir) {
|
|
65887
|
-
const dir =
|
|
65997
|
+
const dir = path8.join(workspaceDir, ".parall", "skills");
|
|
65888
65998
|
const lines = SKILLS.map((s) => `- ${s.description.split(":")[0]}: \`${dir}/${s.name}.md\``);
|
|
65889
65999
|
return `## Platform Skills (read on demand)
|
|
65890
66000
|
|
|
@@ -66034,7 +66144,7 @@ var RuntimeTurnBase = class {
|
|
|
66034
66144
|
|
|
66035
66145
|
// ts/claude-agent/dist/config.js
|
|
66036
66146
|
import * as os2 from "node:os";
|
|
66037
|
-
import * as
|
|
66147
|
+
import * as path9 from "node:path";
|
|
66038
66148
|
function requireEnv(env, name) {
|
|
66039
66149
|
const value = env[name]?.trim();
|
|
66040
66150
|
if (!value) {
|
|
@@ -66048,15 +66158,15 @@ function parseList(value) {
|
|
|
66048
66158
|
return value.split(/[,\n]/).map((item) => item.trim()).filter(Boolean);
|
|
66049
66159
|
}
|
|
66050
66160
|
function resolvePath(value) {
|
|
66051
|
-
return
|
|
66161
|
+
return path9.isAbsolute(value) ? value : path9.resolve(process.cwd(), value);
|
|
66052
66162
|
}
|
|
66053
66163
|
function resolveClaudeAgentConfig(env = process.env) {
|
|
66054
66164
|
const apiUrl = requireEnv(env, "PRLL_API_URL");
|
|
66055
66165
|
const apiKey = requireEnv(env, "PRLL_API_KEY");
|
|
66056
66166
|
const orgId = requireEnv(env, "PRLL_ORG_ID");
|
|
66057
66167
|
const claudeHome = resolvePath(env.PRLL_CLAUDE_HOME?.trim() || env.HOME || os2.homedir());
|
|
66058
|
-
const stateDir = resolvePath(env.PRLL_STATE_DIR?.trim() ||
|
|
66059
|
-
const workspaceDir = resolvePath(env.PRLL_WORKSPACE_DIR?.trim() ||
|
|
66168
|
+
const stateDir = resolvePath(env.PRLL_STATE_DIR?.trim() || path9.join(claudeHome, ".parall-agent"));
|
|
66169
|
+
const workspaceDir = resolvePath(env.PRLL_WORKSPACE_DIR?.trim() || path9.join(stateDir, "workspace"));
|
|
66060
66170
|
const additionalDirs = parseList(env.PRLL_CLAUDE_ADD_DIRS).map(resolvePath);
|
|
66061
66171
|
return {
|
|
66062
66172
|
apiUrl,
|
|
@@ -66091,24 +66201,24 @@ function buildClaudeRuntimeKey(agentUserId) {
|
|
|
66091
66201
|
}
|
|
66092
66202
|
function sessionStateFilePathForRuntime(stateDir, runtimeKey) {
|
|
66093
66203
|
const fileName = Buffer.from(runtimeKey).toString("base64url");
|
|
66094
|
-
return
|
|
66204
|
+
return path9.join(stateDir, "sessions", `${fileName}.json`);
|
|
66095
66205
|
}
|
|
66096
66206
|
function contextFilePathForSession(stateDir, sessionKey) {
|
|
66097
66207
|
const fileName = Buffer.from(sessionKey).toString("base64url");
|
|
66098
|
-
return
|
|
66208
|
+
return path9.join(stateDir, "dispatch-context", `${fileName}.json`);
|
|
66099
66209
|
}
|
|
66100
66210
|
function dispatchContextDirPath(stateDir) {
|
|
66101
66211
|
return dispatchLaneContextDir(stateDir);
|
|
66102
66212
|
}
|
|
66103
66213
|
function stepIdFilePathForSession(stateDir, sessionKey) {
|
|
66104
66214
|
const fileName = Buffer.from(sessionKey).toString("base64url");
|
|
66105
|
-
return
|
|
66215
|
+
return path9.join(stateDir, "step-ids", `${fileName}.txt`);
|
|
66106
66216
|
}
|
|
66107
66217
|
|
|
66108
66218
|
// ts/claude-agent/dist/command-env.js
|
|
66109
66219
|
import * as fs7 from "node:fs";
|
|
66110
66220
|
import * as os3 from "node:os";
|
|
66111
|
-
import * as
|
|
66221
|
+
import * as path10 from "node:path";
|
|
66112
66222
|
function commandEnvSupported(platform = process.platform) {
|
|
66113
66223
|
return platform !== "win32";
|
|
66114
66224
|
}
|
|
@@ -66133,15 +66243,15 @@ function createCommandEnv(opts) {
|
|
|
66133
66243
|
try {
|
|
66134
66244
|
for (const entry of fs7.readdirSync(tmpDir)) {
|
|
66135
66245
|
if (entry.startsWith(prefix)) {
|
|
66136
|
-
fs7.rmSync(
|
|
66246
|
+
fs7.rmSync(path10.join(tmpDir, entry), { recursive: true, force: true });
|
|
66137
66247
|
}
|
|
66138
66248
|
}
|
|
66139
66249
|
} catch (err) {
|
|
66140
66250
|
opts.log?.warn(`command env: could not clear leftovers in ${tmpDir}: ${String(err)}`);
|
|
66141
66251
|
}
|
|
66142
|
-
const dir = fs7.mkdtempSync(
|
|
66143
|
-
const loaderPath =
|
|
66144
|
-
const secretsPath =
|
|
66252
|
+
const dir = fs7.mkdtempSync(path10.join(tmpDir, prefix));
|
|
66253
|
+
const loaderPath = path10.join(dir, "loader.sh");
|
|
66254
|
+
const secretsPath = path10.join(dir, "secrets.sh");
|
|
66145
66255
|
const source = (file) => `if [ -r ${shellQuote(file)} ]; then . ${shellQuote(file)}; fi`;
|
|
66146
66256
|
const loader = [
|
|
66147
66257
|
"# Written by the Parall bridge at every start. Claude Code runs this before each Bash command.",
|
|
@@ -66172,14 +66282,14 @@ function createCommandEnv(opts) {
|
|
|
66172
66282
|
import { execSync as execSync2, spawn } from "node:child_process";
|
|
66173
66283
|
import { randomUUID as randomUUID10 } from "node:crypto";
|
|
66174
66284
|
import * as fs11 from "node:fs";
|
|
66175
|
-
import * as
|
|
66285
|
+
import * as path14 from "node:path";
|
|
66176
66286
|
|
|
66177
66287
|
// ts/agent-core/dist/internal/attachment-input.js
|
|
66178
66288
|
import { execSync } from "node:child_process";
|
|
66179
66289
|
import { constants } from "node:fs";
|
|
66180
66290
|
import * as fsSync from "node:fs";
|
|
66181
66291
|
import * as fs8 from "node:fs/promises";
|
|
66182
|
-
import * as
|
|
66292
|
+
import * as path11 from "node:path";
|
|
66183
66293
|
var DEFAULT_MAX_TOTAL_IMAGE_BYTES = 20 * 1024 * 1024;
|
|
66184
66294
|
var DEFAULT_ATTACHMENT_CACHE_MAX_BYTES = 512 * 1024 * 1024;
|
|
66185
66295
|
var DEFAULT_ATTACHMENT_DOWNLOAD_TIMEOUT_MS = 3e4;
|
|
@@ -66209,11 +66319,11 @@ async function prepareLocalImageAttachments(event, context2, opts) {
|
|
|
66209
66319
|
};
|
|
66210
66320
|
}
|
|
66211
66321
|
const rootDir = await ensureAttachmentRootDir(opts.workspaceDir);
|
|
66212
|
-
const messageDir =
|
|
66322
|
+
const messageDir = path11.join(rootDir, sanitizePathSegment(event.messageId));
|
|
66213
66323
|
await ensurePathIsNotSymlink(messageDir);
|
|
66214
66324
|
await fs8.mkdir(messageDir, { recursive: true });
|
|
66215
66325
|
await ensurePathIsNotSymlink(messageDir);
|
|
66216
|
-
const activeMessageDir =
|
|
66326
|
+
const activeMessageDir = path11.resolve(messageDir);
|
|
66217
66327
|
activeAttachmentDirs.add(activeMessageDir);
|
|
66218
66328
|
const maintenanceCooldownMs = opts.maintenanceCooldownMs ?? DEFAULT_MAINTENANCE_COOLDOWN_MS;
|
|
66219
66329
|
const maintenancePromise = scheduleAttachmentMaintenance(rootDir, {
|
|
@@ -66230,7 +66340,7 @@ async function prepareLocalImageAttachments(event, context2, opts) {
|
|
|
66230
66340
|
const notes = [];
|
|
66231
66341
|
let downloadedBytes = 0;
|
|
66232
66342
|
for (const att of imageAttachments) {
|
|
66233
|
-
const localPath =
|
|
66343
|
+
const localPath = path11.join(messageDir, localFileName(att.id, att.fileName, att.mimeType));
|
|
66234
66344
|
const downloadTimeoutMs = opts.downloadTimeoutMs ?? DEFAULT_ATTACHMENT_DOWNLOAD_TIMEOUT_MS;
|
|
66235
66345
|
const fetchFresh = async () => {
|
|
66236
66346
|
const fileInfo = await withTimeout(context2.client.getFileUrl(att.id), downloadTimeoutMs, `file URL lookup timed out after ${downloadTimeoutMs}ms`);
|
|
@@ -66287,7 +66397,7 @@ async function appendPreparedLocalAttachmentRefs(body, event, context2, opts) {
|
|
|
66287
66397
|
return { body: appendLocalAttachmentRefs(body, attachments), attachments };
|
|
66288
66398
|
}
|
|
66289
66399
|
function pinLocalAttachmentPaths(images) {
|
|
66290
|
-
const dirs = new Set(images.map((image) =>
|
|
66400
|
+
const dirs = new Set(images.map((image) => path11.resolve(path11.dirname(image.localPath))));
|
|
66291
66401
|
for (const dir of dirs) {
|
|
66292
66402
|
activeAttachmentDirs.add(dir);
|
|
66293
66403
|
}
|
|
@@ -66302,7 +66412,7 @@ function pinLocalAttachmentPaths(images) {
|
|
|
66302
66412
|
};
|
|
66303
66413
|
}
|
|
66304
66414
|
function attachmentRootDir(workspaceDir) {
|
|
66305
|
-
return
|
|
66415
|
+
return path11.join(path11.resolve(workspaceDir), ".parall", "attachments");
|
|
66306
66416
|
}
|
|
66307
66417
|
function ensureLocalAttachmentGitExclude(workingDirectory) {
|
|
66308
66418
|
try {
|
|
@@ -66311,8 +66421,8 @@ function ensureLocalAttachmentGitExclude(workingDirectory) {
|
|
|
66311
66421
|
encoding: "utf8",
|
|
66312
66422
|
stdio: ["ignore", "pipe", "ignore"]
|
|
66313
66423
|
}).trim();
|
|
66314
|
-
const excludePath =
|
|
66315
|
-
fsSync.mkdirSync(
|
|
66424
|
+
const excludePath = path11.isAbsolute(rel) ? rel : path11.join(workingDirectory, rel);
|
|
66425
|
+
fsSync.mkdirSync(path11.dirname(excludePath), { recursive: true });
|
|
66316
66426
|
const existing = fsSync.existsSync(excludePath) ? fsSync.readFileSync(excludePath, "utf8") : "";
|
|
66317
66427
|
if (existing.split(/\r?\n/).some((line) => line.trim() === ".parall/"))
|
|
66318
66428
|
return;
|
|
@@ -66348,8 +66458,8 @@ function scheduleAttachmentMaintenance(rootDir, opts) {
|
|
|
66348
66458
|
return run;
|
|
66349
66459
|
}
|
|
66350
66460
|
async function ensureAttachmentRootDir(workspaceDir) {
|
|
66351
|
-
const workspaceRoot =
|
|
66352
|
-
const parallDir =
|
|
66461
|
+
const workspaceRoot = path11.resolve(workspaceDir);
|
|
66462
|
+
const parallDir = path11.join(workspaceRoot, ".parall");
|
|
66353
66463
|
const rootDir = attachmentRootDir(workspaceRoot);
|
|
66354
66464
|
await fs8.mkdir(workspaceRoot, { recursive: true });
|
|
66355
66465
|
await ensurePathIsNotSymlink(parallDir);
|
|
@@ -66378,8 +66488,8 @@ async function ensurePathIsNotSymlink(filePath) {
|
|
|
66378
66488
|
}
|
|
66379
66489
|
}
|
|
66380
66490
|
function isPathInside(childPath, parentPath) {
|
|
66381
|
-
const rel =
|
|
66382
|
-
return rel === "" || !!rel && !rel.startsWith("..") && !
|
|
66491
|
+
const rel = path11.relative(parentPath, childPath);
|
|
66492
|
+
return rel === "" || !!rel && !rel.startsWith("..") && !path11.isAbsolute(rel);
|
|
66383
66493
|
}
|
|
66384
66494
|
async function existingUsableFile(filePath, expectedSize, rootDir) {
|
|
66385
66495
|
try {
|
|
@@ -66437,7 +66547,7 @@ async function openLocalFileInsideRoot(filePath, rootDir) {
|
|
|
66437
66547
|
}
|
|
66438
66548
|
}
|
|
66439
66549
|
async function openLocalTempFileInsideRoot(filePath, rootDir) {
|
|
66440
|
-
await localDirectoryStatInsideRoot(
|
|
66550
|
+
await localDirectoryStatInsideRoot(path11.dirname(filePath), rootDir);
|
|
66441
66551
|
const file = await fs8.open(filePath, constants.O_WRONLY | constants.O_CREAT | constants.O_EXCL | constants.O_NOFOLLOW, 384);
|
|
66442
66552
|
let keepOpen = false;
|
|
66443
66553
|
try {
|
|
@@ -66484,9 +66594,9 @@ async function cleanupOldAttachmentFiles(rootDir, ttlMs, log2, preserveDirs) {
|
|
|
66484
66594
|
await Promise.all(entries.map(async (entry) => {
|
|
66485
66595
|
if (!entry.isDirectory())
|
|
66486
66596
|
return;
|
|
66487
|
-
const fullPath =
|
|
66597
|
+
const fullPath = path11.join(rootDir, entry.name);
|
|
66488
66598
|
try {
|
|
66489
|
-
if (preserveDirs?.has(
|
|
66599
|
+
if (preserveDirs?.has(path11.resolve(fullPath)))
|
|
66490
66600
|
return;
|
|
66491
66601
|
const stat2 = await fs8.lstat(fullPath);
|
|
66492
66602
|
if (!stat2.isDirectory())
|
|
@@ -66513,7 +66623,7 @@ async function pruneAttachmentCache(rootDir, maxBytes, log2, preserveDirs) {
|
|
|
66513
66623
|
for (const entry of entries) {
|
|
66514
66624
|
if (!entry.isDirectory())
|
|
66515
66625
|
continue;
|
|
66516
|
-
const fullPath =
|
|
66626
|
+
const fullPath = path11.join(rootDir, entry.name);
|
|
66517
66627
|
try {
|
|
66518
66628
|
const stat2 = await fs8.lstat(fullPath);
|
|
66519
66629
|
if (!stat2.isDirectory())
|
|
@@ -66531,7 +66641,7 @@ async function pruneAttachmentCache(rootDir, maxBytes, log2, preserveDirs) {
|
|
|
66531
66641
|
for (const dir of dirs) {
|
|
66532
66642
|
if (total <= maxBytes)
|
|
66533
66643
|
break;
|
|
66534
|
-
if (preserveDirs?.has(
|
|
66644
|
+
if (preserveDirs?.has(path11.resolve(dir.path)))
|
|
66535
66645
|
continue;
|
|
66536
66646
|
try {
|
|
66537
66647
|
await fs8.rm(dir.path, { recursive: true, force: true });
|
|
@@ -66545,7 +66655,7 @@ async function directorySize(dirPath) {
|
|
|
66545
66655
|
let total = 0;
|
|
66546
66656
|
const entries = await fs8.readdir(dirPath, { withFileTypes: true });
|
|
66547
66657
|
for (const entry of entries) {
|
|
66548
|
-
const fullPath =
|
|
66658
|
+
const fullPath = path11.join(dirPath, entry.name);
|
|
66549
66659
|
let stat2;
|
|
66550
66660
|
try {
|
|
66551
66661
|
stat2 = await fs8.lstat(fullPath);
|
|
@@ -66563,10 +66673,10 @@ async function directorySize(dirPath) {
|
|
|
66563
66673
|
return total;
|
|
66564
66674
|
}
|
|
66565
66675
|
function activeDirsForRoot(rootDir) {
|
|
66566
|
-
const root =
|
|
66676
|
+
const root = path11.resolve(rootDir);
|
|
66567
66677
|
const dirs = /* @__PURE__ */ new Set();
|
|
66568
66678
|
for (const dir of activeAttachmentDirs) {
|
|
66569
|
-
if (dir === root || dir.startsWith(`${root}${
|
|
66679
|
+
if (dir === root || dir.startsWith(`${root}${path11.sep}`)) {
|
|
66570
66680
|
dirs.add(dir);
|
|
66571
66681
|
}
|
|
66572
66682
|
}
|
|
@@ -66663,7 +66773,7 @@ async function writeResponseToFileWithLimit(res, filePath, maxBytes, rootDir) {
|
|
|
66663
66773
|
}
|
|
66664
66774
|
writtenStat = await file.stat();
|
|
66665
66775
|
await closeFile();
|
|
66666
|
-
await localDirectoryStatInsideRoot(
|
|
66776
|
+
await localDirectoryStatInsideRoot(path11.dirname(filePath), rootDir);
|
|
66667
66777
|
await assertLocalFileIdentity(tmpPath, rootDir, writtenStat);
|
|
66668
66778
|
await fs8.rename(tmpPath, filePath);
|
|
66669
66779
|
completed = true;
|
|
@@ -66681,9 +66791,9 @@ async function writeResponseToFileWithLimit(res, filePath, maxBytes, rootDir) {
|
|
|
66681
66791
|
}
|
|
66682
66792
|
}
|
|
66683
66793
|
function localFileName(attachmentId, fileName, mimeType) {
|
|
66684
|
-
const safeName = sanitizePathSegment(
|
|
66685
|
-
const ext =
|
|
66686
|
-
const stem =
|
|
66794
|
+
const safeName = sanitizePathSegment(path11.basename(fileName || attachmentId));
|
|
66795
|
+
const ext = path11.extname(safeName) || extensionForMime(mimeType);
|
|
66796
|
+
const stem = path11.basename(safeName, path11.extname(safeName)) || attachmentId;
|
|
66687
66797
|
return `${sanitizePathSegment(attachmentId)}-${stem}${ext}`;
|
|
66688
66798
|
}
|
|
66689
66799
|
function extensionForMime(mimeType) {
|
|
@@ -68701,7 +68811,7 @@ function ownsFrames(delivery) {
|
|
|
68701
68811
|
|
|
68702
68812
|
// ts/claude-agent/dist/session-manager.js
|
|
68703
68813
|
import * as fs9 from "node:fs";
|
|
68704
|
-
import * as
|
|
68814
|
+
import * as path12 from "node:path";
|
|
68705
68815
|
import { randomUUID as randomUUID9 } from "node:crypto";
|
|
68706
68816
|
var ClaudeSessionManager = class _ClaudeSessionManager {
|
|
68707
68817
|
mainSessionKey;
|
|
@@ -68871,7 +68981,7 @@ var ClaudeSessionManager = class _ClaudeSessionManager {
|
|
|
68871
68981
|
}
|
|
68872
68982
|
persist(sessionId) {
|
|
68873
68983
|
try {
|
|
68874
|
-
fs9.mkdirSync(
|
|
68984
|
+
fs9.mkdirSync(path12.dirname(this.stateFilePath), { recursive: true });
|
|
68875
68985
|
fs9.writeFileSync(this.stateFilePath, JSON.stringify({
|
|
68876
68986
|
runtimeKey: this.mainSessionKey,
|
|
68877
68987
|
sessionId
|
|
@@ -68885,9 +68995,9 @@ var ClaudeSessionManager = class _ClaudeSessionManager {
|
|
|
68885
68995
|
// ts/claude-agent/dist/spawn-env.js
|
|
68886
68996
|
import * as fs10 from "node:fs";
|
|
68887
68997
|
import * as os4 from "node:os";
|
|
68888
|
-
import * as
|
|
68998
|
+
import * as path13 from "node:path";
|
|
68889
68999
|
function setAsideCorruptClaudeConfig(env, log2) {
|
|
68890
|
-
const file =
|
|
69000
|
+
const file = path13.join(env.CLAUDE_CONFIG_DIR || env.HOME || os4.homedir(), ".claude.json");
|
|
68891
69001
|
let text;
|
|
68892
69002
|
try {
|
|
68893
69003
|
text = fs10.readFileSync(file, "utf8");
|
|
@@ -68958,7 +69068,7 @@ function buildSpawnEnv(parentEnv, claudeHome, context2, opts) {
|
|
|
68958
69068
|
if (opts.capabilityBinDir) {
|
|
68959
69069
|
const pathKey = process.platform === "win32" ? Object.keys(result).find((k) => k.toUpperCase() === "PATH") ?? "PATH" : "PATH";
|
|
68960
69070
|
const existing = result[pathKey];
|
|
68961
|
-
result[pathKey] = existing ? `${opts.capabilityBinDir}${
|
|
69071
|
+
result[pathKey] = existing ? `${opts.capabilityBinDir}${path13.delimiter}${existing}` : opts.capabilityBinDir;
|
|
68962
69072
|
}
|
|
68963
69073
|
return result;
|
|
68964
69074
|
}
|
|
@@ -69214,7 +69324,7 @@ var ClaudeCodeAdapter = class {
|
|
|
69214
69324
|
if (!sessionId)
|
|
69215
69325
|
return void 0;
|
|
69216
69326
|
const projectSlug = this.opts.workspaceDir.replace(/[/.]/g, "-");
|
|
69217
|
-
const filePath =
|
|
69327
|
+
const filePath = path14.join(this.opts.claudeHome, ".claude", "projects", projectSlug, `${sessionId}.jsonl`);
|
|
69218
69328
|
return fs11.existsSync(filePath) ? filePath : void 0;
|
|
69219
69329
|
}
|
|
69220
69330
|
forkSession({ sessionKey }) {
|
|
@@ -69520,7 +69630,7 @@ var ClaudeCodeAdapter = class {
|
|
|
69520
69630
|
if (this.opts.disallowedTools.length > 0) {
|
|
69521
69631
|
args.push("--disallowedTools", this.opts.disallowedTools.join(","));
|
|
69522
69632
|
}
|
|
69523
|
-
args.push("--append-system-prompt-file",
|
|
69633
|
+
args.push("--append-system-prompt-file", path14.join(this.opts.workspaceDir, ".parall", "system-prompt.md"));
|
|
69524
69634
|
if (this.capabilityProbe.promptSnapshotOff)
|
|
69525
69635
|
args.push("--system-prompt-snapshot", "off");
|
|
69526
69636
|
if (this.opts.appendSystemPrompt) {
|
|
@@ -69556,20 +69666,20 @@ var ClaudeCodeAdapter = class {
|
|
|
69556
69666
|
|
|
69557
69667
|
// ts/claude-agent/dist/workspace.js
|
|
69558
69668
|
import * as fs12 from "node:fs";
|
|
69559
|
-
import * as
|
|
69669
|
+
import * as path15 from "node:path";
|
|
69560
69670
|
function buildClaudeSystemPrompt(workspaceDir, agentIdentity, capabilityFragments) {
|
|
69561
69671
|
return buildClaudeCodePlatformInstructions(workspaceDir, agentIdentity, capabilityFragments);
|
|
69562
69672
|
}
|
|
69563
69673
|
function writeClaudeSystemPrompt(workspaceDir, agentIdentity, capabilityFragments) {
|
|
69564
|
-
const parallDir =
|
|
69674
|
+
const parallDir = path15.join(workspaceDir, ".parall");
|
|
69565
69675
|
fs12.mkdirSync(parallDir, { recursive: true });
|
|
69566
|
-
fs12.writeFileSync(
|
|
69676
|
+
fs12.writeFileSync(path15.join(parallDir, "system-prompt.md"), buildClaudeSystemPrompt(workspaceDir, agentIdentity, capabilityFragments), "utf8");
|
|
69567
69677
|
}
|
|
69568
69678
|
function ensureClaudeWorkspace(workspaceDir, _log, agentIdentity, capabilityFragments) {
|
|
69569
69679
|
fs12.mkdirSync(workspaceDir, { recursive: true });
|
|
69570
|
-
fs12.mkdirSync(
|
|
69680
|
+
fs12.mkdirSync(path15.join(workspaceDir, ".claude"), { recursive: true });
|
|
69571
69681
|
writeClaudeSystemPrompt(workspaceDir, agentIdentity, capabilityFragments);
|
|
69572
|
-
writeSkillFiles(
|
|
69682
|
+
writeSkillFiles(path15.join(workspaceDir, ".parall", "skills"));
|
|
69573
69683
|
ensureLocalAttachmentGitExclude(workspaceDir);
|
|
69574
69684
|
}
|
|
69575
69685
|
|
|
@@ -69631,6 +69741,10 @@ async function main() {
|
|
|
69631
69741
|
const me = await getAgentMeWithLegacyFallback(client, config.orgId);
|
|
69632
69742
|
const agentUserId = me.id;
|
|
69633
69743
|
const agentLog = childLogger(activeLog, agentUserId);
|
|
69744
|
+
const cliFeatures = probeParallCliFeatures({
|
|
69745
|
+
pathFirst: capabilityBinDir(config.stateDir),
|
|
69746
|
+
log: agentLog
|
|
69747
|
+
});
|
|
69634
69748
|
activeLog = agentLog;
|
|
69635
69749
|
let agentIdentity = identityFromMe(me);
|
|
69636
69750
|
let lastIdentitySnapshot = JSON.stringify(agentIdentity);
|
|
@@ -69777,8 +69891,8 @@ async function main() {
|
|
|
69777
69891
|
agentUserId,
|
|
69778
69892
|
runtimeType: "claude-code",
|
|
69779
69893
|
runtimeVersion: serviceVersion,
|
|
69780
|
-
// Declared only where this bridge
|
|
69781
|
-
runtimeFeatures: secrets ? ["agent_secrets"] : [],
|
|
69894
|
+
// Declared only where this bridge, or the CLI its agent runs, delivers them.
|
|
69895
|
+
runtimeFeatures: [...secrets ? ["agent_secrets"] : [], ...await cliFeatures],
|
|
69782
69896
|
runtimeKey,
|
|
69783
69897
|
runtimeRef: {
|
|
69784
69898
|
hostname: os5.hostname(),
|