@parall/daemon 1.90.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.
@@ -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 path15 of paths) {
17722
+ for (const path16 of paths) {
17723
17723
  try {
17724
- const result = await fs_1.promises.readFile(path15, { encoding: "utf8" });
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, path15) {
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 += path15;
21137
+ url += path16;
21138
21138
  try {
21139
21139
  new URL(url);
21140
21140
  } catch (_b) {
21141
- diag2.warn("Configuration: Provided URL appended with '" + path15 + "' is not a valid URL, using 'undefined' instead of '" + url + "'");
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 path15 = url.path != null ? url.path : `${url.pathname || ""}${url.search || ""}`;
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 (path15 && path15[0] !== "/") {
27557
- path15 = `/${path15}`;
27556
+ if (path16 && path16[0] !== "/") {
27557
+ path16 = `/${path16}`;
27558
27558
  }
27559
- return new URL(`${origin}${path15}`);
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: path15, origin }
28380
+ request: { method, path: path16, origin }
28381
28381
  } = evt;
28382
- debugLog("sending request to %s %s%s", method, origin, path15);
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: path15, origin },
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
- path15,
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: path15, origin }
28416
+ request: { method, path: path16, origin }
28417
28417
  } = evt;
28418
- debugLog("trailers received from %s %s%s", method, origin, path15);
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: path15, origin },
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
- path15,
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: path15,
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 path15 !== "string") {
28564
+ if (typeof path16 !== "string") {
28565
28565
  throw new InvalidArgumentError("path must be a string");
28566
- } else if (path15[0] !== "/" && !(path15.startsWith("http://") || path15.startsWith("https://")) && method !== "CONNECT") {
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(path15)) {
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(path15, query) : path15;
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: path15, host, upgrade, blocking, reset } = request3;
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} ${path15} HTTP/1.1\r
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: path15, host, upgrade, expectContinue, signal: signal2, protocol, headers: reqHeaders } = request3;
34557
+ const { method, path: path16, host, upgrade, expectContinue, signal: signal2, 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] = path15;
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] = path15;
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: path15 = "/",
37009
+ path: path16 = "/",
37010
37010
  headers = {}
37011
37011
  } = opts;
37012
- opts.path = origin + path15;
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(path15) {
39096
- if (typeof path15 !== "string") {
39097
- return path15;
39095
+ function safeUrl(path16) {
39096
+ if (typeof path16 !== "string") {
39097
+ return path16;
39098
39098
  }
39099
- const pathSegments = path15.split("?", 3);
39099
+ const pathSegments = path16.split("?", 3);
39100
39100
  if (pathSegments.length !== 2) {
39101
- return path15;
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: path15, method, body, headers }) {
39108
- const pathMatch = matchValue(mockDispatch2.path, path15);
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: path15, ignoreTrailingSlash }) => {
39134
- return ignoreTrailingSlash ? matchValue(removeTrailingSlash(safeUrl(path15)), resolvedPathWithoutTrailingSlash) : matchValue(safeUrl(path15), resolvedPath);
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(path15) {
39174
- while (path15.endsWith("/")) {
39175
- path15 = path15.slice(0, -1);
39173
+ function removeTrailingSlash(path16) {
39174
+ while (path16.endsWith("/")) {
39175
+ path16 = path16.slice(0, -1);
39176
39176
  }
39177
- if (path15.length === 0) {
39178
- path15 = "/";
39177
+ if (path16.length === 0) {
39178
+ path16 = "/";
39179
39179
  }
39180
- return path15;
39180
+ return path16;
39181
39181
  }
39182
39182
  function buildKey(opts) {
39183
- const { path: path15, method, body, headers, query } = opts;
39183
+ const { path: path16, method, body, headers, query } = opts;
39184
39184
  return {
39185
- path: path15,
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: path15, data: { statusCode }, persist, times, timesInvoked, origin }) => ({
39875
+ ({ method, path: path16, data: { statusCode }, persist, times, timesInvoked, origin }) => ({
39876
39876
  Method: method,
39877
39877
  Origin: origin,
39878
- Path: path15,
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 [path15, searchParams] = dispatchOpts.path.split("?");
39960
+ const [path16, searchParams] = dispatchOpts.path.split("?");
39961
39961
  const normalizedSearchParams = normalizeSearchParams(searchParams, acceptNonStandardSearchParameters);
39962
- dispatchOpts.path = `${path15}?${normalizedSearchParams}`;
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 path15 = filePath || this.#snapshotPath;
40364
- if (!path15) {
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(resolve4(path15), "utf8");
40368
+ const data = await readFile2(resolve4(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 ${path15}`, { cause: error });
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 path15 = filePath || this.#snapshotPath;
40394
- if (!path15) {
40393
+ const path16 = filePath || this.#snapshotPath;
40394
+ if (!path16) {
40395
40395
  throw new InvalidArgumentError("Snapshot path is required");
40396
40396
  }
40397
- const resolvedPath = resolve4(path15);
40397
+ const resolvedPath = resolve4(path16);
40398
40398
  await mkdir3(dirname9(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 path15 = search ? `${pathname}${search}` : pathname;
41030
- const redirectUrlString = `${origin}${path15}`;
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 = path15;
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, path15) {
42806
+ function deleteCachedUri(store, cacheKey, path16) {
42807
42807
  deleteCachedValue(store, {
42808
42808
  ...cacheKey,
42809
- path: path15
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: path15
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 path15 = getSameOriginPath(cacheKey, values[i]);
42829
- if (path15 !== void 0) {
42830
- deleteCachedUri(store, cacheKey, path15);
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 path15 = url.pathname + url.search;
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((resolve4, reject) => agent.dispatch(
47711
47711
  {
47712
- path: hasTrailingQuestionMark ? `${path15}?` : path15,
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(path15) {
48660
- for (let i = 0; i < path15.length; ++i) {
48661
- const code = path15.charCodeAt(i);
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 path15 = opts.path;
51898
+ let path16 = opts.path;
51899
51899
  if (!opts.path.startsWith("/")) {
51900
- path15 = `/${path15}`;
51900
+ path16 = `/${path16}`;
51901
51901
  }
51902
- url = new URL(util.parseOrigin(url).origin + path15);
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}`,
@@ -53625,8 +53626,8 @@ var SlackFilesClient = class extends AttachmentClient {
53625
53626
  * raw bytes plus the vendor-declared name/MIME.
53626
53627
  */
53627
53628
  async downloadSlackFile(orgId, fileId) {
53628
- const path15 = `${ENDPOINTS.SLACK_FILE(orgId)}?id=${encodeURIComponent(fileId)}`;
53629
- const res = await this.rawAuthorizedFetch(path15, { timeoutMs: 5 * 60 * 1e3 });
53629
+ const path16 = `${ENDPOINTS.SLACK_FILE(orgId)}?id=${encodeURIComponent(fileId)}`;
53630
+ const res = await this.rawAuthorizedFetch(path16, { timeoutMs: 5 * 60 * 1e3 });
53630
53631
  let fileName = "";
53631
53632
  const disposition = res.headers.get("content-disposition") ?? "";
53632
53633
  const ext = /filename\*=(?:UTF-8'')?([^";]+)/i.exec(disposition);
@@ -53831,18 +53832,37 @@ var BrowserProfileClient = class extends HostedProfileCreationClient {
53831
53832
  const me = await this.request("GET", ENDPOINTS.USERS_ME);
53832
53833
  const devices = await this.request("GET", ENDPOINTS.ORG_EDGE_DEVICES(orgId));
53833
53834
  const data = [];
53835
+ const warnings = [];
53834
53836
  for (const device of devices.data) {
53835
53837
  const personal = device.managed_by === "member";
53836
53838
  if (personal && device.owner_user_id !== me.id)
53837
53839
  continue;
53838
- const profiles = await this.request("GET", ENDPOINTS.ORG_EDGE_PROFILES(orgId, device.id));
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 = [];
53839
53855
  for (const profile of profiles) {
53840
53856
  if (profileId && profile.id !== profileId)
53841
53857
  continue;
53842
- 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
+ }
53843
53863
  if (!personal && !access2?.org_public && !(access2?.grants ?? []).some((g) => g.user_id === me.id && g.grants.length > 0))
53844
53864
  continue;
53845
- data.push({
53865
+ deviceData.push({
53846
53866
  profile_id: profile.id,
53847
53867
  name: profile.name,
53848
53868
  device_name: device.name,
@@ -53852,8 +53872,9 @@ var BrowserProfileClient = class extends HostedProfileCreationClient {
53852
53872
  availability: device.placement === "hosted" ? device.hosted_state ?? "unknown" : device.status
53853
53873
  });
53854
53874
  }
53875
+ data.push(...deviceData);
53855
53876
  }
53856
- return { data };
53877
+ return { data, ...warnings.length ? { warnings } : {} };
53857
53878
  }
53858
53879
  /** Submit once: even refresh-enabled clients must not replay browser actions. */
53859
53880
  async createBrowserUseOperation(orgId, request3) {
@@ -53931,9 +53952,9 @@ var WikiDraftClient = class extends BrowserProfileClient {
53931
53952
  * schema this client edits (default {@link WIKI_DRAFT_SCHEMA_VERSION}); a
53932
53953
  * reply in any other schema is refused rather than edited.
53933
53954
  */
53934
- async openWikiDraft(orgId, wikiId, path15, opts) {
53955
+ async openWikiDraft(orgId, wikiId, path16, opts) {
53935
53956
  const schema = opts?.schemaVersion ?? WIKI_DRAFT_SCHEMA_VERSION;
53936
- const connection = await this.request("POST", ENDPOINTS.WIKI_DRAFT_OPEN(orgId, wikiId), { path: path15, schema_version: schema }, void 0, false, opts);
53957
+ const connection = await this.request("POST", ENDPOINTS.WIKI_DRAFT_OPEN(orgId, wikiId), { path: path16, schema_version: schema }, void 0, false, opts);
53937
53958
  if (!isWikiDraftConnection(connection) || connection.scope.org_id !== orgId || connection.scope.wiki_id !== wikiId) {
53938
53959
  throw new Error("DRAFT_SCOPE");
53939
53960
  }
@@ -54111,10 +54132,10 @@ var ApprovalApproversClient = class extends AgentSecretClient {
54111
54132
  // ts/sdk/dist/app-template-client.js
54112
54133
  var VERSION_HASH = /^[0-9a-f]{64}$/;
54113
54134
  var PATH_SEGMENT = /^[A-Za-z0-9._@+-]+$/;
54114
- function isAppTemplateFilePath(path15) {
54115
- if (!path15.startsWith(ENDPOINTS.APP_TEMPLATE_FILES))
54135
+ function isAppTemplateFilePath(path16) {
54136
+ if (!path16.startsWith(ENDPOINTS.APP_TEMPLATE_FILES))
54116
54137
  return false;
54117
- const [hash, ...segments] = path15.slice(ENDPOINTS.APP_TEMPLATE_FILES.length).split("/");
54138
+ const [hash, ...segments] = path16.slice(ENDPOINTS.APP_TEMPLATE_FILES.length).split("/");
54118
54139
  return VERSION_HASH.test(hash) && segments.length > 0 && segments.every((s) => PATH_SEGMENT.test(s) && s !== "." && s !== "..");
54119
54140
  }
54120
54141
  var AppTemplateClient = class extends ApprovalApproversClient {
@@ -54133,11 +54154,11 @@ var AppTemplateClient = class extends ApprovalApproversClient {
54133
54154
  * above gives for it (`project.archive`, a thumbnail, the demo). Only
54134
54155
  * those paths: this is not a way to fetch anything else with the
54135
54156
  * client's credentials. */
54136
- async getAppTemplateFile(path15, opts) {
54137
- if (!isAppTemplateFilePath(path15)) {
54138
- throw new Error(`not an app template file path: ${path15}`);
54157
+ async getAppTemplateFile(path16, opts) {
54158
+ if (!isAppTemplateFilePath(path16)) {
54159
+ throw new Error(`not an app template file path: ${path16}`);
54139
54160
  }
54140
- const res = await this.rawAuthorizedFetch(path15, { timeoutMs: opts?.timeoutMs ?? 6e4 });
54161
+ const res = await this.rawAuthorizedFetch(path16, { timeoutMs: opts?.timeoutMs ?? 6e4 });
54141
54162
  return new Uint8Array(await res.arrayBuffer());
54142
54163
  }
54143
54164
  };
@@ -54443,18 +54464,18 @@ var MemberFieldClient = class extends TeamInviteClient {
54443
54464
 
54444
54465
  // ts/sdk/dist/wiki-page-share-client.js
54445
54466
  var WikiPageShareClient = class extends MemberFieldClient {
54446
- async listWikiPageShares(orgId, wikiId, path15) {
54447
- const res = await this.request("GET", ENDPOINTS.WIKI_PAGE_SHARES(orgId, wikiId), void 0, { path: path15 });
54467
+ async listWikiPageShares(orgId, wikiId, path16) {
54468
+ const res = await this.request("GET", ENDPOINTS.WIKI_PAGE_SHARES(orgId, wikiId), void 0, { path: path16 });
54448
54469
  return res.data;
54449
54470
  }
54450
- async createWikiPageShare(orgId, wikiId, path15, userId) {
54451
- return this.request("POST", ENDPOINTS.WIKI_PAGE_SHARES(orgId, wikiId), { user_id: userId }, { path: path15 });
54471
+ async createWikiPageShare(orgId, wikiId, path16, userId) {
54472
+ return this.request("POST", ENDPOINTS.WIKI_PAGE_SHARES(orgId, wikiId), { user_id: userId }, { path: path16 });
54452
54473
  }
54453
- async revokeWikiPageShare(orgId, wikiId, path15, shareId) {
54454
- return this.request("DELETE", `${ENDPOINTS.WIKI_PAGE_SHARES(orgId, wikiId)}/${encodeURIComponent(shareId)}`, void 0, { path: path15 });
54474
+ async revokeWikiPageShare(orgId, wikiId, path16, shareId) {
54475
+ return this.request("DELETE", `${ENDPOINTS.WIKI_PAGE_SHARES(orgId, wikiId)}/${encodeURIComponent(shareId)}`, void 0, { path: path16 });
54455
54476
  }
54456
- async listWikiShareCandidates(orgId, wikiId, path15, q = "") {
54457
- const res = await this.request("GET", ENDPOINTS.WIKI_PAGE_SHARE_CANDIDATES(orgId, wikiId), void 0, { path: path15, q });
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 });
54458
54479
  return res.data;
54459
54480
  }
54460
54481
  /** No path or ref override: the server always reads the shared page on main. */
@@ -54556,7 +54577,7 @@ var ParallClient = class _ParallClient extends ChatBookmarksClient {
54556
54577
  return apiError;
54557
54578
  }
54558
54579
  /** Build headers common to all requests (auth, swimlane). */
54559
- buildHeaders(path15, extra) {
54580
+ buildHeaders(path16, extra) {
54560
54581
  const headers = {
54561
54582
  "Content-Type": "application/json",
54562
54583
  ...extra
@@ -54567,11 +54588,11 @@ var ParallClient = class _ParallClient extends ChatBookmarksClient {
54567
54588
  if (this.swimlaneName) {
54568
54589
  headers["X-Prll-Swimlane"] = this.swimlaneName;
54569
54590
  }
54570
- if (path15.startsWith(API_BASE2)) {
54591
+ if (path16.startsWith(API_BASE2)) {
54571
54592
  const overrides = this.getFeatureFlagOverrides?.();
54572
54593
  if (overrides)
54573
54594
  headers["X-Prll-FF-Override"] = overrides;
54574
- Object.assign(headers, this.getRequestHeaders?.(path15), extra);
54595
+ Object.assign(headers, this.getRequestHeaders?.(path16), extra);
54575
54596
  }
54576
54597
  return headers;
54577
54598
  }
@@ -54593,8 +54614,8 @@ var ParallClient = class _ParallClient extends ChatBookmarksClient {
54593
54614
  * is authoritative, so wiki vs api routing can't drift from how a caller
54594
54615
  * happens to invoke the client.
54595
54616
  */
54596
- baseUrlFor(path15) {
54597
- return path15.startsWith(WIKI_BASE) ? this.wikiBaseUrl : this.baseUrl;
54617
+ baseUrlFor(path16) {
54618
+ return path16.startsWith(WIKI_BASE) ? this.wikiBaseUrl : this.baseUrl;
54598
54619
  }
54599
54620
  setToken(token) {
54600
54621
  this.token = token;
@@ -54621,10 +54642,10 @@ var ParallClient = class _ParallClient extends ChatBookmarksClient {
54621
54642
  * REFRESH_THRESHOLD_S, refresh it **before** sending the request.
54622
54643
  * No-op when the token is still fresh, missing, or un-parseable.
54623
54644
  */
54624
- async ensureFreshToken(path15) {
54645
+ async ensureFreshToken(path16) {
54625
54646
  if (!this.token || !this.getRefreshToken)
54626
54647
  return;
54627
- const pathSuffix = path15.replace(/^\/api\/v1/, "");
54648
+ const pathSuffix = path16.replace(/^\/api\/v1/, "");
54628
54649
  if (_ParallClient.AUTH_PATHS.has(pathSuffix))
54629
54650
  return;
54630
54651
  const exp = _ParallClient.decodeJwtExp(this.token);
@@ -54656,11 +54677,11 @@ var ParallClient = class _ParallClient extends ChatBookmarksClient {
54656
54677
  this.refreshPromise = null;
54657
54678
  }
54658
54679
  }
54659
- async request(method, path15, body, query, retried = false, opts) {
54680
+ async request(method, path16, body, query, retried = false, opts) {
54660
54681
  if (!retried) {
54661
- await this.ensureFreshToken(path15);
54682
+ await this.ensureFreshToken(path16);
54662
54683
  }
54663
- let url = `${this.baseUrlFor(path15)}${path15}`;
54684
+ let url = `${this.baseUrlFor(path16)}${path16}`;
54664
54685
  if (query) {
54665
54686
  const params = new URLSearchParams();
54666
54687
  for (const [key, value] of Object.entries(query)) {
@@ -54672,7 +54693,7 @@ var ParallClient = class _ParallClient extends ChatBookmarksClient {
54672
54693
  if (qs)
54673
54694
  url += `?${qs}`;
54674
54695
  }
54675
- const headers = this.buildHeaders(path15, opts?.headers);
54696
+ const headers = this.buildHeaders(path16, opts?.headers);
54676
54697
  const timeoutSignal = AbortSignal.timeout(opts?.timeoutMs ?? 15e3);
54677
54698
  const signal2 = opts?.signal ? AbortSignal.any([opts.signal, timeoutSignal]) : timeoutSignal;
54678
54699
  let res;
@@ -54690,12 +54711,12 @@ var ParallClient = class _ParallClient extends ChatBookmarksClient {
54690
54711
  throw _ParallClient.normalizeFetchError(err);
54691
54712
  }
54692
54713
  if (res.status === 401) {
54693
- const pathSuffix = path15.replace(/^\/api\/v1/, "");
54714
+ const pathSuffix = path16.replace(/^\/api\/v1/, "");
54694
54715
  const isAuthPath = _ParallClient.AUTH_PATHS.has(pathSuffix);
54695
54716
  if (!retried && !isAuthPath && this.getRefreshToken) {
54696
54717
  const refreshed = await this.tryRefresh();
54697
54718
  if (refreshed) {
54698
- return this.request(method, path15, body, query, true, opts);
54719
+ return this.request(method, path16, body, query, true, opts);
54699
54720
  }
54700
54721
  }
54701
54722
  if (this.onTokenExpired && !isAuthPath) {
@@ -54725,18 +54746,18 @@ var ParallClient = class _ParallClient extends ChatBookmarksClient {
54725
54746
  * hit the 100 MiB cap, so a longer 5-minute timeout is used so a
54726
54747
  * 50 MiB blob on a slow connection doesn't get chopped at 15 s.
54727
54748
  */
54728
- async multipartRequest(method, path15, body, retried = false, opts) {
54749
+ async multipartRequest(method, path16, body, retried = false, opts) {
54729
54750
  if (!retried) {
54730
- await this.ensureFreshToken(path15);
54751
+ await this.ensureFreshToken(path16);
54731
54752
  }
54732
- const { "Content-Type": _drop, ...headers } = this.buildHeaders(path15);
54753
+ const { "Content-Type": _drop, ...headers } = this.buildHeaders(path16);
54733
54754
  void _drop;
54734
54755
  const timeoutMs = opts?.timeoutMs ?? 5 * 60 * 1e3;
54735
54756
  let res;
54736
54757
  try {
54737
54758
  res = await sendMultipartRequest({
54738
54759
  method,
54739
- url: `${this.baseUrlFor(path15)}${path15}`,
54760
+ url: `${this.baseUrlFor(path16)}${path16}`,
54740
54761
  headers,
54741
54762
  body,
54742
54763
  timeoutMs,
@@ -54747,12 +54768,12 @@ var ParallClient = class _ParallClient extends ChatBookmarksClient {
54747
54768
  throw _ParallClient.normalizeFetchError(err);
54748
54769
  }
54749
54770
  if (res.status === 401) {
54750
- const pathSuffix = path15.replace(/^\/api\/v1/, "");
54771
+ const pathSuffix = path16.replace(/^\/api\/v1/, "");
54751
54772
  const isAuthPath = _ParallClient.AUTH_PATHS.has(pathSuffix);
54752
54773
  if (!retried && !isAuthPath && this.getRefreshToken) {
54753
54774
  const refreshed = await this.tryRefresh();
54754
54775
  if (refreshed) {
54755
- return this.multipartRequest(method, path15, body, true, opts);
54776
+ return this.multipartRequest(method, path16, body, true, opts);
54756
54777
  }
54757
54778
  }
54758
54779
  if (this.onTokenExpired && !isAuthPath) {
@@ -55712,8 +55733,8 @@ var ParallClient = class _ParallClient extends ChatBookmarksClient {
55712
55733
  * remote filesystem browse of a member's machine was remote device access.
55713
55734
  * The endpoint now answers 409 LOCAL_BROWSE_NOT_SUPPORTED unconditionally;
55714
55735
  * workspace paths are typed in (or picked on the machine's own Desktop). */
55715
- async browseMachineFilesystem(orgId, machineId, path15) {
55716
- return this.request("POST", ENDPOINTS.MACHINE_BROWSE(orgId, machineId), { path: path15 }, void 0, false, { timeoutMs: 15e3 });
55736
+ async browseMachineFilesystem(orgId, machineId, path16) {
55737
+ return this.request("POST", ENDPOINTS.MACHINE_BROWSE(orgId, machineId), { path: path16 }, void 0, false, { timeoutMs: 15e3 });
55717
55738
  }
55718
55739
  /** Create a new machine key. Returns the raw key string (shown once) + metadata. */
55719
55740
  async createMachineKey(orgId, machineId, name) {
@@ -56044,14 +56065,14 @@ var ParallClient = class _ParallClient extends ChatBookmarksClient {
56044
56065
  * refresh-and-retry-once, and error-envelope handling as `request` — the
56045
56066
  * transfer primitive the SlackFilesClient domain module builds on.
56046
56067
  */
56047
- async rawAuthorizedFetch(path15, opts, retried = false) {
56068
+ async rawAuthorizedFetch(path16, opts, retried = false) {
56048
56069
  if (!retried) {
56049
- await this.ensureFreshToken(path15);
56070
+ await this.ensureFreshToken(path16);
56050
56071
  }
56051
- const headers = this.buildHeaders(path15);
56072
+ const headers = this.buildHeaders(path16);
56052
56073
  let res;
56053
56074
  try {
56054
- res = await fetch(`${this.baseUrlFor(path15)}${path15}`, {
56075
+ res = await fetch(`${this.baseUrlFor(path16)}${path16}`, {
56055
56076
  method: "GET",
56056
56077
  headers,
56057
56078
  // File transfers get the multipart-tier budget, not the 15s JSON one.
@@ -56064,7 +56085,7 @@ var ParallClient = class _ParallClient extends ChatBookmarksClient {
56064
56085
  if (!retried && this.getRefreshToken) {
56065
56086
  const refreshed = await this.tryRefresh();
56066
56087
  if (refreshed) {
56067
- return this.rawAuthorizedFetch(path15, opts, true);
56088
+ return this.rawAuthorizedFetch(path16, opts, true);
56068
56089
  }
56069
56090
  }
56070
56091
  this.onTokenExpired?.();
@@ -56316,6 +56337,19 @@ var ParallClient = class _ParallClient extends ChatBookmarksClient {
56316
56337
  res.url = this.absoluteMediaUrl(res.url);
56317
56338
  return res;
56318
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
+ }
56319
56353
  // ---- Wiki Path Scopes (AFCS ACL) ----
56320
56354
  async getWikiPathScopes(orgId, wikiId) {
56321
56355
  const res = await this.request("GET", ENDPOINTS.WIKI_PATH_SCOPES(orgId, wikiId));
@@ -56338,12 +56372,12 @@ var ParallClient = class _ParallClient extends ChatBookmarksClient {
56338
56372
  async deleteWikiRestriction(orgId, wikiId, restrictionId) {
56339
56373
  await this.request("DELETE", ENDPOINTS.WIKI_RESTRICTION(orgId, wikiId, restrictionId));
56340
56374
  }
56341
- async getWikiAccessStatus(orgId, wikiId, path15) {
56342
- return this.request("GET", ENDPOINTS.WIKI_ACCESS_STATUS(orgId, wikiId), void 0, path15 ? { path: path15 } : 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);
56343
56377
  }
56344
56378
  // ---- Wiki membership projection (who-can-access, invites, join/leave) ----
56345
- async getWikiAccessPolicy(orgId, wikiId, path15 = "") {
56346
- return this.request("GET", ENDPOINTS.WIKI_ACCESS_POLICY(orgId, wikiId), void 0, path15 ? { path: path15 } : 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);
56347
56381
  }
56348
56382
  async putWikiAccessPolicy(orgId, wikiId, policy) {
56349
56383
  return this.request("PUT", ENDPOINTS.WIKI_ACCESS_POLICY(orgId, wikiId), policy);
@@ -56388,18 +56422,18 @@ var ParallClient = class _ParallClient extends ChatBookmarksClient {
56388
56422
  async getWikiCommits(orgId, wikiId, params) {
56389
56423
  return this.request("GET", ENDPOINTS.WIKI_COMMITS(orgId, wikiId), void 0, params);
56390
56424
  }
56391
- async getWikiFileCommits(orgId, wikiId, path15, params) {
56425
+ async getWikiFileCommits(orgId, wikiId, path16, params) {
56392
56426
  return this.request("GET", ENDPOINTS.WIKI_FILE_COMMITS(orgId, wikiId), void 0, {
56393
- path: path15,
56427
+ path: path16,
56394
56428
  ...params
56395
56429
  });
56396
56430
  }
56397
56431
  /** Bounded, ACL-safe activity for one Wiki file path. */
56398
- async getWikiPathActivity(orgId, wikiId, path15, opts) {
56399
- return this.request("GET", ENDPOINTS.WIKI_PATH_ACTIVITY(orgId, wikiId), void 0, { path: path15 }, false, opts);
56432
+ async getWikiPathActivity(orgId, wikiId, path16, opts) {
56433
+ return this.request("GET", ENDPOINTS.WIKI_PATH_ACTIVITY(orgId, wikiId), void 0, { path: path16 }, false, opts);
56400
56434
  }
56401
- async getWikiBlame(orgId, wikiId, path15, ref) {
56402
- return this.request("GET", ENDPOINTS.WIKI_BLAME(orgId, wikiId), void 0, { path: path15, ref });
56435
+ async getWikiBlame(orgId, wikiId, path16, ref) {
56436
+ return this.request("GET", ENDPOINTS.WIKI_BLAME(orgId, wikiId), void 0, { path: path16, ref });
56403
56437
  }
56404
56438
  // ---- Wiki Operations (audit log) ----
56405
56439
  async getWikiOperations(orgId, wikiId, params) {
@@ -58023,6 +58057,42 @@ function renderCmdPointer(nodeExecPath, entryJsPath, binDir, channel) {
58023
58057
  ].join("\r\n");
58024
58058
  }
58025
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((resolve4) => {
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
+ resolve4(features);
58092
+ });
58093
+ });
58094
+ }
58095
+
58026
58096
  // ts/agent-core/dist/config-refresh.js
58027
58097
  function createConfigRefresh(opts) {
58028
58098
  const { secrets } = opts;
@@ -58160,16 +58230,16 @@ async function persistRuntimeObservation(persister, sessionId, target, event, lo
58160
58230
  }
58161
58231
 
58162
58232
  // ts/agent-core/dist/lane/key.js
58163
- import * as path2 from "node:path";
58233
+ import * as path3 from "node:path";
58164
58234
  function laneKeyForTarget(targetUri, threadRootId) {
58165
58235
  return Buffer.from(`${targetUri}
58166
58236
  ${threadRootId ?? ""}`, "utf8").toString("base64url");
58167
58237
  }
58168
58238
  function dispatchLaneContextDir(stateDir) {
58169
- return path2.join(stateDir, "dispatch-lane-context");
58239
+ return path3.join(stateDir, "dispatch-lane-context");
58170
58240
  }
58171
58241
  function laneContextFilePath(contextDir, targetUri, threadRootId) {
58172
- return path2.join(contextDir, `${laneKeyForTarget(targetUri, threadRootId)}.json`);
58242
+ return path3.join(contextDir, `${laneKeyForTarget(targetUri, threadRootId)}.json`);
58173
58243
  }
58174
58244
 
58175
58245
  // ts/agent-core/dist/gateway/source-routing.js
@@ -58405,7 +58475,7 @@ function splitChangeSource(sourceId) {
58405
58475
 
58406
58476
  // ts/agent-core/dist/gateway/base.js
58407
58477
  import * as fs4 from "node:fs";
58408
- import * as path5 from "node:path";
58478
+ import * as path6 from "node:path";
58409
58479
 
58410
58480
  // ts/agent-core/dist/gateway/fork-handoff.js
58411
58481
  var ForkResultHandoff = class {
@@ -58545,13 +58615,13 @@ init_esm();
58545
58615
  var import_api_logs = __toESM(require_src(), 1);
58546
58616
  import { AsyncLocalStorage } from "node:async_hooks";
58547
58617
  import { readFileSync as readFileSync2 } from "node:fs";
58548
- import * as path4 from "node:path";
58618
+ import * as path5 from "node:path";
58549
58619
  import { fileURLToPath as fileURLToPath2 } from "node:url";
58550
58620
 
58551
58621
  // ts/agent-core/dist/otlp-spool.js
58552
58622
  import * as fs2 from "node:fs";
58553
58623
  import * as fsp from "node:fs/promises";
58554
- import * as path3 from "node:path";
58624
+ import * as path4 from "node:path";
58555
58625
  var SPOOL_SIGNALS = ["traces", "metrics", "logs"];
58556
58626
  var DEFAULT_MAX_BYTES = {
58557
58627
  traces: 6 << 20,
@@ -58658,9 +58728,9 @@ var OtlpSpoolStore = class {
58658
58728
  const dir = this.signalDir(signal2);
58659
58729
  try {
58660
58730
  await fsp.mkdir(dir, { recursive: true });
58661
- const tmp = path3.join(dir, `${name}.tmp`);
58731
+ const tmp = path4.join(dir, `${name}.tmp`);
58662
58732
  await fsp.writeFile(tmp, bytes);
58663
- await fsp.rename(tmp, path3.join(dir, name));
58733
+ await fsp.rename(tmp, path4.join(dir, name));
58664
58734
  } catch (err) {
58665
58735
  this.log(`spool write failed for ${signal2}: ${String(err)}`);
58666
58736
  return drop("write_failed");
@@ -58714,7 +58784,7 @@ var OtlpSpoolStore = class {
58714
58784
  }
58715
58785
  if (this.sent.has(file.name))
58716
58786
  continue;
58717
- const full = path3.join(this.signalDir(signal2), file.name);
58787
+ const full = path4.join(this.signalDir(signal2), file.name);
58718
58788
  let body;
58719
58789
  try {
58720
58790
  body = await fsp.readFile(full);
@@ -58778,7 +58848,7 @@ var OtlpSpoolStore = class {
58778
58848
  await this.replaying;
58779
58849
  }
58780
58850
  signalDir(signal2) {
58781
- return path3.join(this.opts.dir, signal2);
58851
+ return path4.join(this.opts.dir, signal2);
58782
58852
  }
58783
58853
  /** Read the directory once; afterwards the index is maintained in memory. */
58784
58854
  async load(signal2) {
@@ -58796,7 +58866,7 @@ var OtlpSpoolStore = class {
58796
58866
  }
58797
58867
  const now = this.now();
58798
58868
  for (const name of names.sort()) {
58799
- const full = path3.join(dir, name);
58869
+ const full = path4.join(dir, name);
58800
58870
  const m = FILE_RE.exec(name);
58801
58871
  if (!m) {
58802
58872
  if (name.endsWith(".tmp")) {
@@ -58834,7 +58904,7 @@ var OtlpSpoolStore = class {
58834
58904
  async remove(signal2, idx, file, alreadyGone = false) {
58835
58905
  if (!alreadyGone) {
58836
58906
  try {
58837
- await fsp.unlink(path3.join(this.signalDir(signal2), file.name));
58907
+ await fsp.unlink(path4.join(this.signalDir(signal2), file.name));
58838
58908
  } catch (err) {
58839
58909
  if (err.code !== "ENOENT") {
58840
58910
  this.log(`spool could not delete ${signal2}/${file.name}: ${String(err)}`);
@@ -58977,11 +59047,11 @@ function resolveServiceVersion(importMetaUrl) {
58977
59047
  const fallback = process.env.npm_package_version || "unknown";
58978
59048
  let dir;
58979
59049
  try {
58980
- dir = path4.dirname(fileURLToPath2(importMetaUrl));
59050
+ dir = path5.dirname(fileURLToPath2(importMetaUrl));
58981
59051
  } catch {
58982
59052
  return fallback;
58983
59053
  }
58984
- for (const candidate of [path4.join(dir, "manifest.json"), path4.join(dir, "..", "package.json")]) {
59054
+ for (const candidate of [path5.join(dir, "manifest.json"), path5.join(dir, "..", "package.json")]) {
58985
59055
  try {
58986
59056
  const parsed = JSON.parse(readFileSync2(candidate, "utf-8"));
58987
59057
  if (typeof parsed.version === "string" && parsed.version.trim()) {
@@ -63625,7 +63695,7 @@ var ParallAgentGateway = class {
63625
63695
  }
63626
63696
  writeContextFile(filePath, ctx) {
63627
63697
  try {
63628
- fs4.mkdirSync(path5.dirname(filePath), { recursive: true });
63698
+ fs4.mkdirSync(path6.dirname(filePath), { recursive: true });
63629
63699
  fs4.writeFileSync(filePath, JSON.stringify(ctx), "utf8");
63630
63700
  } catch (err) {
63631
63701
  this.opts.log?.warn(`failed to write context file ${filePath}: ${String(err)}`);
@@ -63654,7 +63724,7 @@ var ParallAgentGateway = class {
63654
63724
  /** @deprecated Use writeContextFile / updateContextFileStepId. */
63655
63725
  writeStepIdFile(filePath, stepId) {
63656
63726
  try {
63657
- fs4.mkdirSync(path5.dirname(filePath), { recursive: true });
63727
+ fs4.mkdirSync(path6.dirname(filePath), { recursive: true });
63658
63728
  fs4.writeFileSync(filePath, stepId, "utf8");
63659
63729
  } catch (err) {
63660
63730
  this.opts.log?.warn(`failed to write step id file ${filePath}: ${String(err)}`);
@@ -63812,7 +63882,7 @@ function childLogger(logger, sub) {
63812
63882
 
63813
63883
  // ts/agent-core/dist/platform-config.js
63814
63884
  import * as fs5 from "node:fs";
63815
- import * as path6 from "node:path";
63885
+ import * as path7 from "node:path";
63816
63886
  function extractCapabilities(config) {
63817
63887
  const agents = config.agents ?? {};
63818
63888
  const raw = agents.capabilities;
@@ -63851,7 +63921,7 @@ function deriveModelIsPin(defaults, profile) {
63851
63921
  var CACHE_FILENAME = "parall-platform-config.json";
63852
63922
  var SUPPORTED_SCHEMA_VERSION = 1;
63853
63923
  function cachePath(stateDir) {
63854
- return path6.join(stateDir, CACHE_FILENAME);
63924
+ return path7.join(stateDir, CACHE_FILENAME);
63855
63925
  }
63856
63926
  function loadCache(stateDir) {
63857
63927
  try {
@@ -63870,7 +63940,7 @@ function saveCache(stateDir, response) {
63870
63940
  };
63871
63941
  const filePath = cachePath(stateDir);
63872
63942
  const tmpPath = `${filePath}.tmp`;
63873
- fs5.mkdirSync(path6.dirname(filePath), { recursive: true });
63943
+ fs5.mkdirSync(path7.dirname(filePath), { recursive: true });
63874
63944
  fs5.writeFileSync(tmpPath, JSON.stringify(cached, null, 2), "utf-8");
63875
63945
  fs5.renameSync(tmpPath, filePath);
63876
63946
  }
@@ -64082,7 +64152,7 @@ navigate \u6216 close \u4E5F\u4F1A\u5173\u6389\u5F39\u6846\u3002\u56DE\u7B54\u54
64082
64152
 
64083
64153
  // ts/agent-core/dist/skills/index.js
64084
64154
  import * as fs6 from "node:fs";
64085
- import * as path7 from "node:path";
64155
+ import * as path8 from "node:path";
64086
64156
 
64087
64157
  // ts/agent-core/dist/skills/parall-platform.js
64088
64158
  var PARALL_PLATFORM_SKILL = `# Parall Platform
@@ -65867,11 +65937,11 @@ var SKILLS = [
65867
65937
  function writeSkillFiles(targetDir) {
65868
65938
  fs6.mkdirSync(targetDir, { recursive: true });
65869
65939
  for (const skill of SKILLS) {
65870
- fs6.writeFileSync(path7.join(targetDir, `${skill.name}.md`), skill.content, "utf8");
65940
+ fs6.writeFileSync(path8.join(targetDir, `${skill.name}.md`), skill.content, "utf8");
65871
65941
  }
65872
65942
  }
65873
65943
  function buildSkillReferences(workspaceDir) {
65874
- const dir = path7.join(workspaceDir, ".parall", "skills");
65944
+ const dir = path8.join(workspaceDir, ".parall", "skills");
65875
65945
  const lines = SKILLS.map((s) => `- ${s.description.split(":")[0]}: \`${dir}/${s.name}.md\``);
65876
65946
  return `## Platform Skills (read on demand)
65877
65947
 
@@ -66025,7 +66095,7 @@ var RuntimeTurnBase = class {
66025
66095
 
66026
66096
  // ts/codex-agent/dist/config.js
66027
66097
  import * as os2 from "node:os";
66028
- import * as path8 from "node:path";
66098
+ import * as path9 from "node:path";
66029
66099
  function requireEnv(env, name) {
66030
66100
  const value = env[name]?.trim();
66031
66101
  if (!value) {
@@ -66034,15 +66104,15 @@ function requireEnv(env, name) {
66034
66104
  return value;
66035
66105
  }
66036
66106
  function resolvePath(value) {
66037
- return path8.isAbsolute(value) ? value : path8.resolve(process.cwd(), value);
66107
+ return path9.isAbsolute(value) ? value : path9.resolve(process.cwd(), value);
66038
66108
  }
66039
66109
  function resolveCodexAgentConfig(env = process.env) {
66040
66110
  const apiUrl = requireEnv(env, "PRLL_API_URL");
66041
66111
  const apiKey = requireEnv(env, "PRLL_API_KEY");
66042
66112
  const orgId = requireEnv(env, "PRLL_ORG_ID");
66043
- const codexHome = resolvePath(env.PRLL_CODEX_HOME?.trim() || env.CODEX_HOME?.trim() || path8.join(env.HOME || os2.homedir(), ".codex"));
66044
- const stateDir = resolvePath(env.PRLL_STATE_DIR?.trim() || path8.join(env.HOME || os2.homedir(), ".parall-agent"));
66045
- const workspaceDir = resolvePath(env.PRLL_WORKSPACE_DIR?.trim() || path8.join(stateDir, "workspace"));
66113
+ const codexHome = resolvePath(env.PRLL_CODEX_HOME?.trim() || env.CODEX_HOME?.trim() || path9.join(env.HOME || os2.homedir(), ".codex"));
66114
+ const stateDir = resolvePath(env.PRLL_STATE_DIR?.trim() || path9.join(env.HOME || os2.homedir(), ".parall-agent"));
66115
+ const workspaceDir = resolvePath(env.PRLL_WORKSPACE_DIR?.trim() || path9.join(stateDir, "workspace"));
66046
66116
  return {
66047
66117
  apiUrl,
66048
66118
  apiKey,
@@ -66098,18 +66168,18 @@ function buildCodexRuntimeKey(agentUserId) {
66098
66168
  }
66099
66169
  function sessionStateFilePathForRuntime(stateDir, runtimeKey) {
66100
66170
  const fileName = Buffer.from(runtimeKey).toString("base64url");
66101
- return path8.join(stateDir, "threads", `${fileName}.json`);
66171
+ return path9.join(stateDir, "threads", `${fileName}.json`);
66102
66172
  }
66103
66173
  function contextFilePathForSession(stateDir, sessionKey) {
66104
66174
  const fileName = Buffer.from(sessionKey).toString("base64url");
66105
- return path8.join(stateDir, "dispatch-context", `${fileName}.json`);
66175
+ return path9.join(stateDir, "dispatch-context", `${fileName}.json`);
66106
66176
  }
66107
66177
  function dispatchContextDirPath(stateDir) {
66108
66178
  return dispatchLaneContextDir(stateDir);
66109
66179
  }
66110
66180
  function stepIdFilePathForSession(stateDir, sessionKey) {
66111
66181
  const fileName = Buffer.from(sessionKey).toString("base64url");
66112
- return path8.join(stateDir, "step-ids", `${fileName}.txt`);
66182
+ return path9.join(stateDir, "step-ids", `${fileName}.txt`);
66113
66183
  }
66114
66184
 
66115
66185
  // ts/codex-agent/dist/app-server-protocol.js
@@ -66390,14 +66460,14 @@ function errToString(err) {
66390
66460
 
66391
66461
  // ts/codex-agent/dist/dispatch.js
66392
66462
  import { randomUUID as randomUUID7 } from "node:crypto";
66393
- import * as path12 from "node:path";
66463
+ import * as path13 from "node:path";
66394
66464
 
66395
66465
  // ts/agent-core/dist/internal/attachment-input.js
66396
66466
  import { execSync } from "node:child_process";
66397
66467
  import { constants } from "node:fs";
66398
66468
  import * as fsSync from "node:fs";
66399
66469
  import * as fs7 from "node:fs/promises";
66400
- import * as path9 from "node:path";
66470
+ import * as path10 from "node:path";
66401
66471
  var DEFAULT_MAX_TOTAL_IMAGE_BYTES = 20 * 1024 * 1024;
66402
66472
  var DEFAULT_ATTACHMENT_CACHE_MAX_BYTES = 512 * 1024 * 1024;
66403
66473
  var DEFAULT_ATTACHMENT_DOWNLOAD_TIMEOUT_MS = 3e4;
@@ -66427,11 +66497,11 @@ async function prepareLocalImageAttachments(event, context2, opts) {
66427
66497
  };
66428
66498
  }
66429
66499
  const rootDir = await ensureAttachmentRootDir(opts.workspaceDir);
66430
- const messageDir = path9.join(rootDir, sanitizePathSegment(event.messageId));
66500
+ const messageDir = path10.join(rootDir, sanitizePathSegment(event.messageId));
66431
66501
  await ensurePathIsNotSymlink(messageDir);
66432
66502
  await fs7.mkdir(messageDir, { recursive: true });
66433
66503
  await ensurePathIsNotSymlink(messageDir);
66434
- const activeMessageDir = path9.resolve(messageDir);
66504
+ const activeMessageDir = path10.resolve(messageDir);
66435
66505
  activeAttachmentDirs.add(activeMessageDir);
66436
66506
  const maintenanceCooldownMs = opts.maintenanceCooldownMs ?? DEFAULT_MAINTENANCE_COOLDOWN_MS;
66437
66507
  const maintenancePromise = scheduleAttachmentMaintenance(rootDir, {
@@ -66448,7 +66518,7 @@ async function prepareLocalImageAttachments(event, context2, opts) {
66448
66518
  const notes = [];
66449
66519
  let downloadedBytes = 0;
66450
66520
  for (const att of imageAttachments) {
66451
- const localPath = path9.join(messageDir, localFileName(att.id, att.fileName, att.mimeType));
66521
+ const localPath = path10.join(messageDir, localFileName(att.id, att.fileName, att.mimeType));
66452
66522
  const downloadTimeoutMs = opts.downloadTimeoutMs ?? DEFAULT_ATTACHMENT_DOWNLOAD_TIMEOUT_MS;
66453
66523
  const fetchFresh = async () => {
66454
66524
  const fileInfo = await withTimeout(context2.client.getFileUrl(att.id), downloadTimeoutMs, `file URL lookup timed out after ${downloadTimeoutMs}ms`);
@@ -66505,7 +66575,7 @@ async function appendPreparedLocalAttachmentRefs(body, event, context2, opts) {
66505
66575
  return { body: appendLocalAttachmentRefs(body, attachments), attachments };
66506
66576
  }
66507
66577
  function pinLocalAttachmentPaths(images) {
66508
- const dirs = new Set(images.map((image) => path9.resolve(path9.dirname(image.localPath))));
66578
+ const dirs = new Set(images.map((image) => path10.resolve(path10.dirname(image.localPath))));
66509
66579
  for (const dir of dirs) {
66510
66580
  activeAttachmentDirs.add(dir);
66511
66581
  }
@@ -66520,7 +66590,7 @@ function pinLocalAttachmentPaths(images) {
66520
66590
  };
66521
66591
  }
66522
66592
  function attachmentRootDir(workspaceDir) {
66523
- return path9.join(path9.resolve(workspaceDir), ".parall", "attachments");
66593
+ return path10.join(path10.resolve(workspaceDir), ".parall", "attachments");
66524
66594
  }
66525
66595
  function ensureLocalAttachmentGitExclude(workingDirectory) {
66526
66596
  try {
@@ -66529,8 +66599,8 @@ function ensureLocalAttachmentGitExclude(workingDirectory) {
66529
66599
  encoding: "utf8",
66530
66600
  stdio: ["ignore", "pipe", "ignore"]
66531
66601
  }).trim();
66532
- const excludePath = path9.isAbsolute(rel) ? rel : path9.join(workingDirectory, rel);
66533
- fsSync.mkdirSync(path9.dirname(excludePath), { recursive: true });
66602
+ const excludePath = path10.isAbsolute(rel) ? rel : path10.join(workingDirectory, rel);
66603
+ fsSync.mkdirSync(path10.dirname(excludePath), { recursive: true });
66534
66604
  const existing = fsSync.existsSync(excludePath) ? fsSync.readFileSync(excludePath, "utf8") : "";
66535
66605
  if (existing.split(/\r?\n/).some((line) => line.trim() === ".parall/"))
66536
66606
  return;
@@ -66566,8 +66636,8 @@ function scheduleAttachmentMaintenance(rootDir, opts) {
66566
66636
  return run;
66567
66637
  }
66568
66638
  async function ensureAttachmentRootDir(workspaceDir) {
66569
- const workspaceRoot = path9.resolve(workspaceDir);
66570
- const parallDir = path9.join(workspaceRoot, ".parall");
66639
+ const workspaceRoot = path10.resolve(workspaceDir);
66640
+ const parallDir = path10.join(workspaceRoot, ".parall");
66571
66641
  const rootDir = attachmentRootDir(workspaceRoot);
66572
66642
  await fs7.mkdir(workspaceRoot, { recursive: true });
66573
66643
  await ensurePathIsNotSymlink(parallDir);
@@ -66596,8 +66666,8 @@ async function ensurePathIsNotSymlink(filePath) {
66596
66666
  }
66597
66667
  }
66598
66668
  function isPathInside(childPath, parentPath) {
66599
- const rel = path9.relative(parentPath, childPath);
66600
- return rel === "" || !!rel && !rel.startsWith("..") && !path9.isAbsolute(rel);
66669
+ const rel = path10.relative(parentPath, childPath);
66670
+ return rel === "" || !!rel && !rel.startsWith("..") && !path10.isAbsolute(rel);
66601
66671
  }
66602
66672
  async function existingUsableFile(filePath, expectedSize, rootDir) {
66603
66673
  try {
@@ -66655,7 +66725,7 @@ async function openLocalFileInsideRoot(filePath, rootDir) {
66655
66725
  }
66656
66726
  }
66657
66727
  async function openLocalTempFileInsideRoot(filePath, rootDir) {
66658
- await localDirectoryStatInsideRoot(path9.dirname(filePath), rootDir);
66728
+ await localDirectoryStatInsideRoot(path10.dirname(filePath), rootDir);
66659
66729
  const file = await fs7.open(filePath, constants.O_WRONLY | constants.O_CREAT | constants.O_EXCL | constants.O_NOFOLLOW, 384);
66660
66730
  let keepOpen = false;
66661
66731
  try {
@@ -66702,9 +66772,9 @@ async function cleanupOldAttachmentFiles(rootDir, ttlMs, log2, preserveDirs) {
66702
66772
  await Promise.all(entries.map(async (entry) => {
66703
66773
  if (!entry.isDirectory())
66704
66774
  return;
66705
- const fullPath = path9.join(rootDir, entry.name);
66775
+ const fullPath = path10.join(rootDir, entry.name);
66706
66776
  try {
66707
- if (preserveDirs?.has(path9.resolve(fullPath)))
66777
+ if (preserveDirs?.has(path10.resolve(fullPath)))
66708
66778
  return;
66709
66779
  const stat2 = await fs7.lstat(fullPath);
66710
66780
  if (!stat2.isDirectory())
@@ -66731,7 +66801,7 @@ async function pruneAttachmentCache(rootDir, maxBytes, log2, preserveDirs) {
66731
66801
  for (const entry of entries) {
66732
66802
  if (!entry.isDirectory())
66733
66803
  continue;
66734
- const fullPath = path9.join(rootDir, entry.name);
66804
+ const fullPath = path10.join(rootDir, entry.name);
66735
66805
  try {
66736
66806
  const stat2 = await fs7.lstat(fullPath);
66737
66807
  if (!stat2.isDirectory())
@@ -66749,7 +66819,7 @@ async function pruneAttachmentCache(rootDir, maxBytes, log2, preserveDirs) {
66749
66819
  for (const dir of dirs) {
66750
66820
  if (total <= maxBytes)
66751
66821
  break;
66752
- if (preserveDirs?.has(path9.resolve(dir.path)))
66822
+ if (preserveDirs?.has(path10.resolve(dir.path)))
66753
66823
  continue;
66754
66824
  try {
66755
66825
  await fs7.rm(dir.path, { recursive: true, force: true });
@@ -66763,7 +66833,7 @@ async function directorySize(dirPath) {
66763
66833
  let total = 0;
66764
66834
  const entries = await fs7.readdir(dirPath, { withFileTypes: true });
66765
66835
  for (const entry of entries) {
66766
- const fullPath = path9.join(dirPath, entry.name);
66836
+ const fullPath = path10.join(dirPath, entry.name);
66767
66837
  let stat2;
66768
66838
  try {
66769
66839
  stat2 = await fs7.lstat(fullPath);
@@ -66781,10 +66851,10 @@ async function directorySize(dirPath) {
66781
66851
  return total;
66782
66852
  }
66783
66853
  function activeDirsForRoot(rootDir) {
66784
- const root = path9.resolve(rootDir);
66854
+ const root = path10.resolve(rootDir);
66785
66855
  const dirs = /* @__PURE__ */ new Set();
66786
66856
  for (const dir of activeAttachmentDirs) {
66787
- if (dir === root || dir.startsWith(`${root}${path9.sep}`)) {
66857
+ if (dir === root || dir.startsWith(`${root}${path10.sep}`)) {
66788
66858
  dirs.add(dir);
66789
66859
  }
66790
66860
  }
@@ -66881,7 +66951,7 @@ async function writeResponseToFileWithLimit(res, filePath, maxBytes, rootDir) {
66881
66951
  }
66882
66952
  writtenStat = await file.stat();
66883
66953
  await closeFile();
66884
- await localDirectoryStatInsideRoot(path9.dirname(filePath), rootDir);
66954
+ await localDirectoryStatInsideRoot(path10.dirname(filePath), rootDir);
66885
66955
  await assertLocalFileIdentity(tmpPath, rootDir, writtenStat);
66886
66956
  await fs7.rename(tmpPath, filePath);
66887
66957
  completed = true;
@@ -66899,9 +66969,9 @@ async function writeResponseToFileWithLimit(res, filePath, maxBytes, rootDir) {
66899
66969
  }
66900
66970
  }
66901
66971
  function localFileName(attachmentId, fileName, mimeType) {
66902
- const safeName = sanitizePathSegment(path9.basename(fileName || attachmentId));
66903
- const ext = path9.extname(safeName) || extensionForMime(mimeType);
66904
- const stem = path9.basename(safeName, path9.extname(safeName)) || attachmentId;
66972
+ const safeName = sanitizePathSegment(path10.basename(fileName || attachmentId));
66973
+ const ext = path10.extname(safeName) || extensionForMime(mimeType);
66974
+ const stem = path10.basename(safeName, path10.extname(safeName)) || attachmentId;
66905
66975
  return `${sanitizePathSegment(attachmentId)}-${stem}${ext}`;
66906
66976
  }
66907
66977
  function extensionForMime(mimeType) {
@@ -68390,7 +68460,7 @@ function answerServerRequest(method) {
68390
68460
 
68391
68461
  // ts/codex-agent/dist/session-manager.js
68392
68462
  import * as fs9 from "node:fs";
68393
- import * as path10 from "node:path";
68463
+ import * as path11 from "node:path";
68394
68464
  var CodexSessionManager = class _CodexSessionManager {
68395
68465
  mainSessionKey;
68396
68466
  stateFilePath;
@@ -68496,7 +68566,7 @@ var CodexSessionManager = class _CodexSessionManager {
68496
68566
  if (!threadId)
68497
68567
  return;
68498
68568
  try {
68499
- fs9.mkdirSync(path10.dirname(this.stateFilePath), { recursive: true });
68569
+ fs9.mkdirSync(path11.dirname(this.stateFilePath), { recursive: true });
68500
68570
  const tmpPath = `${this.stateFilePath}.tmp`;
68501
68571
  const state = { runtimeKey: this.mainSessionKey, threadId };
68502
68572
  const effectiveSha = this.effectiveInstructionsShas.get(this.mainSessionKey);
@@ -68511,7 +68581,7 @@ var CodexSessionManager = class _CodexSessionManager {
68511
68581
  };
68512
68582
 
68513
68583
  // ts/codex-agent/dist/thread-config.js
68514
- import * as path11 from "node:path";
68584
+ import * as path12 from "node:path";
68515
68585
  function buildThreadConfigOverrides({ reasoningEffort, capabilityBinDir: capabilityBinDir2, inheritedPath, platform = process.platform, commandEnv }) {
68516
68586
  const config = {};
68517
68587
  if (reasoningEffort)
@@ -68520,8 +68590,8 @@ function buildThreadConfigOverrides({ reasoningEffort, capabilityBinDir: capabil
68520
68590
  const exclude = commandEnv?.unset ?? [];
68521
68591
  const pinPath = Boolean(capabilityBinDir2) && platform !== "win32";
68522
68592
  if (capabilityBinDir2 && pinPath) {
68523
- const pathEntries = (inheritedPath ?? "").split(path11.delimiter).filter((entry) => entry && entry !== capabilityBinDir2);
68524
- set.PATH = [capabilityBinDir2, ...pathEntries].join(path11.delimiter);
68593
+ const pathEntries = (inheritedPath ?? "").split(path12.delimiter).filter((entry) => entry && entry !== capabilityBinDir2);
68594
+ set.PATH = [capabilityBinDir2, ...pathEntries].join(path12.delimiter);
68525
68595
  config.allow_login_shell = false;
68526
68596
  }
68527
68597
  if (pinPath || Object.keys(set).length > 0 || exclude.length > 0) {
@@ -69248,7 +69318,7 @@ var CodexAppServerAdapter = class {
69248
69318
  if (this.opts.capabilityBinDir) {
69249
69319
  const pathKey = IS_WIN32 ? Object.keys(env).find((k) => k.toUpperCase() === "PATH") ?? "PATH" : "PATH";
69250
69320
  const existing = env[pathKey];
69251
- env[pathKey] = existing ? `${this.opts.capabilityBinDir}${path12.delimiter}${existing}` : this.opts.capabilityBinDir;
69321
+ env[pathKey] = existing ? `${this.opts.capabilityBinDir}${path13.delimiter}${existing}` : this.opts.capabilityBinDir;
69252
69322
  }
69253
69323
  if (this.opts.contextFilePath) {
69254
69324
  env.PRLL_CONTEXT_FILE = this.opts.contextFilePath;
@@ -69359,18 +69429,18 @@ function errToString6(err) {
69359
69429
 
69360
69430
  // ts/codex-agent/dist/workspace.js
69361
69431
  import * as fs11 from "node:fs";
69362
- import * as path14 from "node:path";
69432
+ import * as path15 from "node:path";
69363
69433
 
69364
69434
  // ts/codex-agent/dist/legacy-workspace-config-migration.js
69365
69435
  import * as fs10 from "node:fs";
69366
- import * as path13 from "node:path";
69436
+ import * as path14 from "node:path";
69367
69437
  var LEGACY_CONFIG_RELPATH = [".codex", "config.toml"];
69368
69438
  var MIGRATION_SENTINEL_RELPATH = [".parall", "legacy-workspace-config-migration.v1"];
69369
69439
  function legacyWorkspaceConfigPath(workspaceDir) {
69370
- return path13.join(workspaceDir, ...LEGACY_CONFIG_RELPATH);
69440
+ return path14.join(workspaceDir, ...LEGACY_CONFIG_RELPATH);
69371
69441
  }
69372
69442
  function migrationSentinelPath(workspaceDir) {
69373
- return path13.join(workspaceDir, ...MIGRATION_SENTINEL_RELPATH);
69443
+ return path14.join(workspaceDir, ...MIGRATION_SENTINEL_RELPATH);
69374
69444
  }
69375
69445
  function legacyWorkspaceConfigToml(prompt) {
69376
69446
  return `developer_instructions = """
@@ -69422,7 +69492,7 @@ If a stale .codex/config.toml is still present, remove it by hand.
69422
69492
  `;
69423
69493
  function claimLegacyWorkspaceConfigMigration(workspaceDir) {
69424
69494
  const sentinel = migrationSentinelPath(workspaceDir);
69425
- fs10.mkdirSync(path13.dirname(sentinel), { recursive: true });
69495
+ fs10.mkdirSync(path14.dirname(sentinel), { recursive: true });
69426
69496
  try {
69427
69497
  fs10.writeFileSync(sentinel, SENTINEL_BODY, { flag: "wx" });
69428
69498
  return "claimed";
@@ -69488,9 +69558,9 @@ function sleepSync(ms) {
69488
69558
  Atomics.wait(SLEEP_SIGNAL, 0, 0, ms);
69489
69559
  }
69490
69560
  function withConfigLock(codexHome, log2, fn) {
69491
- const queueDir = path14.join(codexHome, "config.toml.lock.d");
69561
+ const queueDir = path15.join(codexHome, "config.toml.lock.d");
69492
69562
  let ticketName = bakeryEnqueue(queueDir);
69493
- let ticketPath = ticketName ? path14.join(queueDir, ticketName) : "";
69563
+ let ticketPath = ticketName ? path15.join(queueDir, ticketName) : "";
69494
69564
  let acquired = false;
69495
69565
  let heldPath = "";
69496
69566
  const deadline = Date.now() + CONFIG_LOCK_TIMINGS.waitMs;
@@ -69505,7 +69575,7 @@ function withConfigLock(codexHome, log2, fn) {
69505
69575
  ticketName = bakeryEnqueue(queueDir);
69506
69576
  if (!ticketName)
69507
69577
  break;
69508
- ticketPath = path14.join(queueDir, ticketName);
69578
+ ticketPath = path15.join(queueDir, ticketName);
69509
69579
  continue;
69510
69580
  }
69511
69581
  const now = Date.now();
@@ -69513,7 +69583,7 @@ function withConfigLock(codexHome, log2, fn) {
69513
69583
  let blocked = false;
69514
69584
  let head;
69515
69585
  for (const name of names) {
69516
- const entryPath = path14.join(queueDir, name);
69586
+ const entryPath = path15.join(queueDir, name);
69517
69587
  if (name.startsWith("held-")) {
69518
69588
  const enteredAt = Number.parseInt(name.slice(5, 20), 10);
69519
69589
  if (Number.isFinite(enteredAt) && now - enteredAt > CONFIG_LOCK_TIMINGS.staleMs) {
@@ -69556,7 +69626,7 @@ function withConfigLock(codexHome, log2, fn) {
69556
69626
  if (!blocked && head === ticketName) {
69557
69627
  CONFIG_LOCK_TEST_HOOKS.beforeTicketEntry?.();
69558
69628
  const heldName = `held-${String(Date.now()).padStart(15, "0")}-${ticketName.slice(2)}`;
69559
- const candidateHeldPath = path14.join(queueDir, heldName);
69629
+ const candidateHeldPath = path15.join(queueDir, heldName);
69560
69630
  try {
69561
69631
  fs11.renameSync(ticketPath, candidateHeldPath);
69562
69632
  } catch {
@@ -69597,7 +69667,7 @@ var CONFIG_LOCK_TEST_HOOKS = {};
69597
69667
  function bakeryEnqueue(queueDir) {
69598
69668
  for (let attempt = 0; attempt < 3; attempt++) {
69599
69669
  const token = `${process.pid}-${Math.random().toString(36).slice(2, 10)}`;
69600
- const markerPath = path14.join(queueDir, `choosing-${token}`);
69670
+ const markerPath = path15.join(queueDir, `choosing-${token}`);
69601
69671
  try {
69602
69672
  fs11.mkdirSync(queueDir, { recursive: true });
69603
69673
  CONFIG_LOCK_TEST_HOOKS.beforeChoosingMarker?.();
@@ -69615,7 +69685,7 @@ function bakeryEnqueue(queueDir) {
69615
69685
  maxSeq = seq;
69616
69686
  }
69617
69687
  const ticketName = `t-${String(maxSeq + 1).padStart(10, "0")}-${token}`;
69618
- const ticketPath = path14.join(queueDir, ticketName);
69688
+ const ticketPath = path15.join(queueDir, ticketName);
69619
69689
  CONFIG_LOCK_TEST_HOOKS.beforeTicketPublish?.();
69620
69690
  fs11.renameSync(markerPath, ticketPath);
69621
69691
  try {
@@ -69669,7 +69739,7 @@ function resolveWriteTarget(filePath) {
69669
69739
  throw err;
69670
69740
  }
69671
69741
  const seen = /* @__PURE__ */ new Set();
69672
- let p = path14.resolve(filePath);
69742
+ let p = path15.resolve(filePath);
69673
69743
  for (let depth = 0; depth < 40; depth++) {
69674
69744
  if (seen.has(p)) {
69675
69745
  throw new Error(`symlink cycle at ${p} while resolving ${filePath}`);
@@ -69684,7 +69754,7 @@ function resolveWriteTarget(filePath) {
69684
69754
  return p;
69685
69755
  throw err;
69686
69756
  }
69687
- p = path14.resolve(path14.dirname(p), link);
69757
+ p = path15.resolve(path15.dirname(p), link);
69688
69758
  }
69689
69759
  throw new Error(`symlink chain deeper than 40 while resolving ${filePath}`);
69690
69760
  }
@@ -69733,7 +69803,7 @@ function ensureParallProvider(codexHome, apiUrl, log2, opts) {
69733
69803
  withConfigLock(codexHome, log2, () => ensureParallProviderLocked(codexHome, apiUrl, opts));
69734
69804
  }
69735
69805
  function ensureParallProviderLocked(codexHome, apiUrl, opts) {
69736
- const configPath = path14.join(codexHome, "config.toml");
69806
+ const configPath = path15.join(codexHome, "config.toml");
69737
69807
  const baseUrl = apiUrl.replace(/\/$/, "") + "/api/llm/v1";
69738
69808
  try {
69739
69809
  let content = "";
@@ -69779,11 +69849,11 @@ function findSectionEnd(content, fromIndex) {
69779
69849
  return nextHeader === -1 ? content.length : nextHeader;
69780
69850
  }
69781
69851
  function systemPromptCopyPath(workspaceDir) {
69782
- return path14.join(workspaceDir, ".parall", "system-prompt.md");
69852
+ return path15.join(workspaceDir, ".parall", "system-prompt.md");
69783
69853
  }
69784
69854
  function writeCodexSystemPrompt(workspaceDir, agentIdentity, capabilityFragments) {
69785
69855
  const systemPrompt = buildCodexPlatformInstructions(workspaceDir, agentIdentity, capabilityFragments);
69786
- fs11.mkdirSync(path14.join(workspaceDir, ".parall"), { recursive: true });
69856
+ fs11.mkdirSync(path15.join(workspaceDir, ".parall"), { recursive: true });
69787
69857
  fs11.writeFileSync(systemPromptCopyPath(workspaceDir), systemPrompt, "utf8");
69788
69858
  return systemPrompt;
69789
69859
  }
@@ -69791,7 +69861,7 @@ function ensureCodexWorkspace(workspaceDir, log2, agentIdentity, capabilityFragm
69791
69861
  fs11.mkdirSync(workspaceDir, { recursive: true });
69792
69862
  runLegacyWorkspaceConfigMigration(workspaceDir, () => readAuthorshipProof(workspaceDir, log2), log2);
69793
69863
  const systemPrompt = writeCodexSystemPrompt(workspaceDir, agentIdentity, capabilityFragments);
69794
- writeSkillFiles(path14.join(workspaceDir, ".parall", "skills"));
69864
+ writeSkillFiles(path15.join(workspaceDir, ".parall", "skills"));
69795
69865
  return systemPrompt;
69796
69866
  }
69797
69867
  function readAuthorshipProof(workspaceDir, log2) {
@@ -69857,6 +69927,10 @@ async function main() {
69857
69927
  const me = await getAgentMeWithLegacyFallback(client, config.orgId);
69858
69928
  const agentUserId = me.id;
69859
69929
  const agentLog = childLogger(activeLog, agentUserId);
69930
+ const cliFeatures = probeParallCliFeatures({
69931
+ pathFirst: capabilityBinDir(config.stateDir),
69932
+ log: agentLog
69933
+ });
69860
69934
  activeLog = agentLog;
69861
69935
  const useParallProvider = isParallProxyMode();
69862
69936
  if (useParallProvider) {
@@ -69982,8 +70056,11 @@ async function main() {
69982
70056
  agentUserId,
69983
70057
  runtimeType: "codex",
69984
70058
  runtimeVersion: serviceVersion,
69985
- // Declared only where this bridge actually delivers them.
69986
- runtimeFeatures: secretsSupported ? ["agent_secrets"] : [],
70059
+ // Declared only where this bridge, or the CLI its agent runs, delivers them.
70060
+ runtimeFeatures: [
70061
+ ...secretsSupported ? ["agent_secrets"] : [],
70062
+ ...await cliFeatures
70063
+ ],
69987
70064
  runtimeKey,
69988
70065
  runtimeRef: {
69989
70066
  hostname: os3.hostname(),