@parall/daemon 1.56.1 → 1.57.1

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.
@@ -44539,7 +44539,7 @@ var require_headers = __commonJS({
44539
44539
  }
44540
44540
  }
44541
44541
  };
44542
- var Headers = class _Headers {
44542
+ var Headers2 = class _Headers {
44543
44543
  #guard;
44544
44544
  /**
44545
44545
  * @type {HeadersList}
@@ -44680,13 +44680,13 @@ var require_headers = __commonJS({
44680
44680
  target.#headersList = list;
44681
44681
  }
44682
44682
  };
44683
- var { getHeadersGuard, setHeadersGuard, getHeadersList, setHeadersList } = Headers;
44684
- Reflect.deleteProperty(Headers, "getHeadersGuard");
44685
- Reflect.deleteProperty(Headers, "setHeadersGuard");
44686
- Reflect.deleteProperty(Headers, "getHeadersList");
44687
- Reflect.deleteProperty(Headers, "setHeadersList");
44688
- iteratorMixin("Headers", Headers, headersListSortAndCombine, 0, 1);
44689
- Object.defineProperties(Headers.prototype, {
44683
+ var { getHeadersGuard, setHeadersGuard, getHeadersList, setHeadersList } = Headers2;
44684
+ Reflect.deleteProperty(Headers2, "getHeadersGuard");
44685
+ Reflect.deleteProperty(Headers2, "setHeadersGuard");
44686
+ Reflect.deleteProperty(Headers2, "getHeadersList");
44687
+ Reflect.deleteProperty(Headers2, "setHeadersList");
44688
+ iteratorMixin("Headers", Headers2, headersListSortAndCombine, 0, 1);
44689
+ Object.defineProperties(Headers2.prototype, {
44690
44690
  append: kEnumerableProperty,
44691
44691
  delete: kEnumerableProperty,
44692
44692
  get: kEnumerableProperty,
@@ -44704,7 +44704,7 @@ var require_headers = __commonJS({
44704
44704
  webidl.converters.HeadersInit = function(V, prefix, argument) {
44705
44705
  if (webidl.util.Type(V) === webidl.util.Types.OBJECT) {
44706
44706
  const iterator = Reflect.get(V, Symbol.iterator);
44707
- if (!util.types.isProxy(V) && iterator === Headers.prototype.entries) {
44707
+ if (!util.types.isProxy(V) && iterator === Headers2.prototype.entries) {
44708
44708
  try {
44709
44709
  return getHeadersList(V).entriesList;
44710
44710
  } catch {
@@ -44725,7 +44725,7 @@ var require_headers = __commonJS({
44725
44725
  fill,
44726
44726
  // for test.
44727
44727
  compareHeaderName,
44728
- Headers,
44728
+ Headers: Headers2,
44729
44729
  HeadersList,
44730
44730
  getHeadersGuard,
44731
44731
  setHeadersGuard,
@@ -44739,7 +44739,7 @@ var require_headers = __commonJS({
44739
44739
  var require_response = __commonJS({
44740
44740
  "ts/node_modules/.pnpm/undici@7.24.8/node_modules/undici/lib/web/fetch/response.js"(exports2, module2) {
44741
44741
  "use strict";
44742
- var { Headers, HeadersList, fill, getHeadersGuard, setHeadersGuard, setHeadersList } = require_headers();
44742
+ var { Headers: Headers2, HeadersList, fill, getHeadersGuard, setHeadersGuard, setHeadersList } = require_headers();
44743
44743
  var { extractBody, cloneBody, mixinBody, streamRegistry, bodyUnusable } = require_body();
44744
44744
  var util = require_util2();
44745
44745
  var nodeUtil = __require("node:util");
@@ -44761,7 +44761,7 @@ var require_response = __commonJS({
44761
44761
  var assert = __require("node:assert");
44762
44762
  var { isomorphicEncode, serializeJavascriptValueToJSONString } = require_infra();
44763
44763
  var textEncoder = new TextEncoder("utf-8");
44764
- var Response = class _Response {
44764
+ var Response2 = class _Response {
44765
44765
  /** @type {Headers} */
44766
44766
  #headers;
44767
44767
  #state;
@@ -44815,7 +44815,7 @@ var require_response = __commonJS({
44815
44815
  }
44816
44816
  init = webidl.converters.ResponseInit(init);
44817
44817
  this.#state = makeResponse({});
44818
- this.#headers = new Headers(kConstruct);
44818
+ this.#headers = new Headers2(kConstruct);
44819
44819
  setHeadersGuard(this.#headers, "response");
44820
44820
  setHeadersList(this.#headers, this.#state.headersList);
44821
44821
  let bodyWithType = null;
@@ -44933,13 +44933,13 @@ var require_response = __commonJS({
44933
44933
  response.#state = newState;
44934
44934
  }
44935
44935
  };
44936
- var { getResponseHeaders, setResponseHeaders, getResponseState, setResponseState } = Response;
44937
- Reflect.deleteProperty(Response, "getResponseHeaders");
44938
- Reflect.deleteProperty(Response, "setResponseHeaders");
44939
- Reflect.deleteProperty(Response, "getResponseState");
44940
- Reflect.deleteProperty(Response, "setResponseState");
44941
- mixinBody(Response, getResponseState);
44942
- Object.defineProperties(Response.prototype, {
44936
+ var { getResponseHeaders, setResponseHeaders, getResponseState, setResponseState } = Response2;
44937
+ Reflect.deleteProperty(Response2, "getResponseHeaders");
44938
+ Reflect.deleteProperty(Response2, "setResponseHeaders");
44939
+ Reflect.deleteProperty(Response2, "getResponseState");
44940
+ Reflect.deleteProperty(Response2, "setResponseState");
44941
+ mixinBody(Response2, getResponseState);
44942
+ Object.defineProperties(Response2.prototype, {
44943
44943
  type: kEnumerableProperty,
44944
44944
  url: kEnumerableProperty,
44945
44945
  status: kEnumerableProperty,
@@ -44955,7 +44955,7 @@ var require_response = __commonJS({
44955
44955
  configurable: true
44956
44956
  }
44957
44957
  });
44958
- Object.defineProperties(Response, {
44958
+ Object.defineProperties(Response2, {
44959
44959
  json: kEnumerableProperty,
44960
44960
  redirect: kEnumerableProperty,
44961
44961
  error: kEnumerableProperty
@@ -45088,9 +45088,9 @@ var require_response = __commonJS({
45088
45088
  }
45089
45089
  }
45090
45090
  function fromInnerResponse(innerResponse, guard) {
45091
- const response = new Response(kConstruct);
45091
+ const response = new Response2(kConstruct);
45092
45092
  setResponseState(response, innerResponse);
45093
- const headers = new Headers(kConstruct);
45093
+ const headers = new Headers2(kConstruct);
45094
45094
  setResponseHeaders(response, headers);
45095
45095
  setHeadersList(headers, innerResponse.headersList);
45096
45096
  setHeadersGuard(headers, guard);
@@ -45142,14 +45142,14 @@ var require_response = __commonJS({
45142
45142
  converter: webidl.converters.HeadersInit
45143
45143
  }
45144
45144
  ]);
45145
- webidl.is.Response = webidl.util.MakeTypeAssertion(Response);
45145
+ webidl.is.Response = webidl.util.MakeTypeAssertion(Response2);
45146
45146
  module2.exports = {
45147
45147
  isNetworkError,
45148
45148
  makeNetworkError,
45149
45149
  makeResponse,
45150
45150
  makeAppropriateNetworkError,
45151
45151
  filterResponse,
45152
- Response,
45152
+ Response: Response2,
45153
45153
  cloneResponse,
45154
45154
  fromInnerResponse,
45155
45155
  getResponseState
@@ -45162,7 +45162,7 @@ var require_request2 = __commonJS({
45162
45162
  "ts/node_modules/.pnpm/undici@7.24.8/node_modules/undici/lib/web/fetch/request.js"(exports2, module2) {
45163
45163
  "use strict";
45164
45164
  var { extractBody, mixinBody, cloneBody, bodyUnusable } = require_body();
45165
- var { Headers, fill: fillHeaders, HeadersList, setHeadersGuard, getHeadersGuard, setHeadersList, getHeadersList } = require_headers();
45165
+ var { Headers: Headers2, fill: fillHeaders, HeadersList, setHeadersGuard, getHeadersGuard, setHeadersList, getHeadersList } = require_headers();
45166
45166
  var util = require_util2();
45167
45167
  var nodeUtil = __require("node:util");
45168
45168
  var {
@@ -45431,7 +45431,7 @@ var require_request2 = __commonJS({
45431
45431
  requestFinalizer.register(ac, { signal, abort }, abort);
45432
45432
  }
45433
45433
  }
45434
- this.#headers = new Headers(kConstruct);
45434
+ this.#headers = new Headers2(kConstruct);
45435
45435
  setHeadersList(this.#headers, request3.headersList);
45436
45436
  setHeadersGuard(this.#headers, "request");
45437
45437
  if (mode === "no-cors") {
@@ -45772,7 +45772,7 @@ var require_request2 = __commonJS({
45772
45772
  setRequestState(request3, innerRequest);
45773
45773
  setRequestDispatcher(request3, dispatcher);
45774
45774
  setRequestSignal(request3, signal);
45775
- const headers = new Headers(kConstruct);
45775
+ const headers = new Headers2(kConstruct);
45776
45776
  setRequestHeaders(request3, headers);
45777
45777
  setHeadersList(headers, innerRequest.headersList);
45778
45778
  setHeadersGuard(headers, guard);
@@ -48216,8 +48216,8 @@ var require_cookies = __commonJS({
48216
48216
  var { parseSetCookie } = require_parse2();
48217
48217
  var { stringify } = require_util5();
48218
48218
  var { webidl } = require_webidl();
48219
- var { Headers } = require_headers();
48220
- var brandChecks = webidl.brandCheckMultiple([Headers, globalThis.Headers].filter(Boolean));
48219
+ var { Headers: Headers2 } = require_headers();
48220
+ var brandChecks = webidl.brandCheckMultiple([Headers2, globalThis.Headers].filter(Boolean));
48221
48221
  function getCookies(headers) {
48222
48222
  webidl.argumentLengthCheck(arguments, 1, "getCookies");
48223
48223
  brandChecks(headers);
@@ -48958,7 +48958,7 @@ var require_connection = __commonJS({
48958
48958
  var { parseExtensions, isClosed, isClosing, isEstablished, isConnecting, validateCloseCodeAndReason } = require_util6();
48959
48959
  var { makeRequest } = require_request2();
48960
48960
  var { fetching } = require_fetch();
48961
- var { Headers, getHeadersList } = require_headers();
48961
+ var { Headers: Headers2, getHeadersList } = require_headers();
48962
48962
  var { getDecodeSplit } = require_util3();
48963
48963
  var { WebsocketFrameSend } = require_frame();
48964
48964
  var assert = __require("node:assert");
@@ -48980,7 +48980,7 @@ var require_connection = __commonJS({
48980
48980
  useURLCredentials: true
48981
48981
  });
48982
48982
  if (options.headers) {
48983
- const headersList = getHeadersList(new Headers(options.headers));
48983
+ const headersList = getHeadersList(new Headers2(options.headers));
48984
48984
  request3.headersList = headersList;
48985
48985
  }
48986
48986
  const keyValue = crypto.randomBytes(16).toString("base64");
@@ -51566,7 +51566,10 @@ function buildEventBody(event) {
51566
51566
  } else if (event.type === "channel_message") {
51567
51567
  lines.push(`[Event: channel.message]`);
51568
51568
  const providerLabel = sanitizeMeta(event.channelProvider ?? "external IM");
51569
- const convLabel = event.channelExternalConversationId ? `${sanitizeMeta(event.channelExternalConversationId)} (${sanitizeMeta(event.channelConversationType ?? "conversation")})` : sanitizeMeta(event.channelConversationType ?? "conversation");
51569
+ const convType = sanitizeMeta(event.channelConversationType ?? "conversation");
51570
+ const convId = event.channelExternalConversationId ? sanitizeMeta(event.channelExternalConversationId) : void 0;
51571
+ const convName = event.channelExternalConversationName ? sanitizeMeta(event.channelExternalConversationName) : void 0;
51572
+ const convLabel = convName ? `${convName} (${convId ? `${convId}, ` : ""}${convType})` : convId ? `${convId} (${convType})` : convType;
51570
51573
  lines.push(`[Channel: ${providerLabel} | conversation: ${convLabel}]`);
51571
51574
  lines.push(`[From: ${sanitizeMeta(event.senderName)} (external user, not a Parall member)]`);
51572
51575
  if (event.channelExternalMessageId) {
@@ -51739,6 +51742,8 @@ var ENDPOINTS = {
51739
51742
  // Users
51740
51743
  USERS_ME: `${API_BASE}/users/me`,
51741
51744
  USER_AVATAR: `${API_BASE}/users/me/avatar`,
51745
+ PERSONAL_API_KEYS: `${API_BASE}/users/me/api-keys`,
51746
+ PERSONAL_API_KEY: (keyId) => `${API_BASE}/users/me/api-keys/${keyId}`,
51742
51747
  USER: (id) => `${API_BASE}/users/${id}`,
51743
51748
  // WebSocket ticket
51744
51749
  WS_TICKET: `${API_BASE}/ws/ticket`,
@@ -51753,6 +51758,24 @@ var ENDPOINTS = {
51753
51758
  TEAM_MEMBERS: (orgId, teamId) => `${API_BASE}/orgs/${orgId}/teams/${teamId}/members`,
51754
51759
  TEAM_MEMBER: (orgId, teamId, userId) => `${API_BASE}/orgs/${orgId}/teams/${teamId}/members/${userId}`,
51755
51760
  ORG_MEMBERS_ONLINE: (orgId) => `${API_BASE}/orgs/${orgId}/members/online`,
51761
+ LLM_PROVIDERS: (orgId) => `${API_BASE}/orgs/${orgId}/llm-providers`,
51762
+ LLM_PROVIDER: (orgId, providerId) => `${API_BASE}/orgs/${orgId}/llm-providers/${providerId}`,
51763
+ ORG_LLM_MODELS: (orgId) => `${API_BASE}/orgs/${orgId}/llm-models`,
51764
+ ORG_LLM_MODEL: (orgId, modelRowId) => `${API_BASE}/orgs/${orgId}/llm-models/${modelRowId}`,
51765
+ /**
51766
+ * Platform catalog merged with this org's own model rows. Pass `runtime` to
51767
+ * filter org-added models to the ones that runtime can actually reach —
51768
+ * without it a picker can offer a model the write path rejects.
51769
+ */
51770
+ ORG_MODEL_CATALOG: (orgId, runtime, includeModel) => {
51771
+ const params = new URLSearchParams();
51772
+ if (runtime)
51773
+ params.set("runtime", runtime);
51774
+ if (includeModel)
51775
+ params.set("include_model", includeModel);
51776
+ const qs = params.toString();
51777
+ return `${API_BASE}/orgs/${orgId}/models${qs ? `?${qs}` : ""}`;
51778
+ },
51756
51779
  ORG_MEMBER: (orgId, userId) => `${API_BASE}/orgs/${orgId}/members/${userId}`,
51757
51780
  ORG_MEMBER_CHATS: (orgId, memberId) => `${API_BASE}/orgs/${orgId}/members/${memberId}/chats`,
51758
51781
  ORG_MEMBER_TASKS: (orgId, memberId) => `${API_BASE}/orgs/${orgId}/members/${memberId}/tasks`,
@@ -52506,6 +52529,55 @@ var WechatClient = class extends TaskLabelClient {
52506
52529
  }
52507
52530
  };
52508
52531
 
52532
+ // ts/sdk/dist/llm-provider-client.js
52533
+ var LLMProviderClient = class extends WechatClient {
52534
+ async getLLMProviders(orgId) {
52535
+ const response = await this.request("GET", ENDPOINTS.LLM_PROVIDERS(orgId));
52536
+ return response.data;
52537
+ }
52538
+ async createLLMProvider(orgId, data) {
52539
+ return this.request("POST", ENDPOINTS.LLM_PROVIDERS(orgId), data);
52540
+ }
52541
+ /** Omitting `api_key` leaves the stored credential untouched. */
52542
+ async updateLLMProvider(orgId, providerId, data) {
52543
+ return this.request("PATCH", ENDPOINTS.LLM_PROVIDER(orgId, providerId), data);
52544
+ }
52545
+ /** Fails with PROVIDER_IN_USE while model rows still point at it. */
52546
+ async deleteLLMProvider(orgId, providerId) {
52547
+ return this.request("DELETE", ENDPOINTS.LLM_PROVIDER(orgId, providerId));
52548
+ }
52549
+ async getOrgLLMModels(orgId) {
52550
+ const response = await this.request("GET", ENDPOINTS.ORG_LLM_MODELS(orgId));
52551
+ return response.data;
52552
+ }
52553
+ async createOrgLLMModel(orgId, data) {
52554
+ return this.request("POST", ENDPOINTS.ORG_LLM_MODELS(orgId), data);
52555
+ }
52556
+ /**
52557
+ * Patches a model row in place. Repointing a provider or fixing an upstream
52558
+ * name this way avoids the delete-and-recreate window, during which an
52559
+ * org-only model has no upstream at all and its pinned agents fail.
52560
+ */
52561
+ async updateOrgLLMModel(orgId, modelRowId, data) {
52562
+ return this.request("PATCH", ENDPOINTS.ORG_LLM_MODEL(orgId, modelRowId), data);
52563
+ }
52564
+ async deleteOrgLLMModel(orgId, modelRowId) {
52565
+ return this.request("DELETE", ENDPOINTS.ORG_LLM_MODEL(orgId, modelRowId));
52566
+ }
52567
+ /**
52568
+ * The catalog as this org sees it: platform models with the org's rows
52569
+ * merged in. Distinct from the public model catalog, which stays org-agnostic
52570
+ * and cacheable — use this one wherever an org context exists.
52571
+ *
52572
+ * Pass `runtime` on a picker: org-added models are then filtered to what that
52573
+ * runtime's protocol can reach, matching the server-side pin validation.
52574
+ */
52575
+ async getOrgModelCatalog(orgId, runtime, includeModel) {
52576
+ const response = await this.request("GET", ENDPOINTS.ORG_MODEL_CATALOG(orgId, runtime, includeModel));
52577
+ return response.data;
52578
+ }
52579
+ };
52580
+
52509
52581
  // ts/sdk/dist/attachment-client.js
52510
52582
  var COMPLETION_RETRY_DELAYS_MS = [250, 750];
52511
52583
  function isRetryableCompletionError(error) {
@@ -52514,7 +52586,7 @@ function isRetryableCompletionError(error) {
52514
52586
  const status = error.status;
52515
52587
  return status === 0 || typeof status === "number" && status >= 500;
52516
52588
  }
52517
- var AttachmentClient = class extends WechatClient {
52589
+ var AttachmentClient = class extends LLMProviderClient {
52518
52590
  async getUploadPresignUrl(orgId, req) {
52519
52591
  return this.request("POST", ENDPOINTS.UPLOAD_PRESIGN(orgId), req);
52520
52592
  }
@@ -52542,6 +52614,99 @@ var AttachmentClient = class extends WechatClient {
52542
52614
  }
52543
52615
  };
52544
52616
 
52617
+ // ts/sdk/dist/wiki-upload.js
52618
+ function createWikiUploadFormData(params) {
52619
+ const form = new FormData();
52620
+ form.append("path", params.path);
52621
+ form.append("file", params.file);
52622
+ if (params.message)
52623
+ form.append("message", params.message);
52624
+ if (params.uploadId)
52625
+ form.append("upload_id", params.uploadId);
52626
+ if (params.conflict)
52627
+ form.append("conflict", params.conflict);
52628
+ if ("contentRoute" in params && params.contentRoute) {
52629
+ form.append("content_route", params.contentRoute);
52630
+ }
52631
+ return form;
52632
+ }
52633
+ function sendMultipartRequest(options) {
52634
+ if (options.onProgress && typeof XMLHttpRequest !== "undefined") {
52635
+ return multipartXHR(options, options.onProgress);
52636
+ }
52637
+ const timeoutSignal = AbortSignal.timeout(options.timeoutMs);
52638
+ const signal = options.signal ? AbortSignal.any([options.signal, timeoutSignal]) : timeoutSignal;
52639
+ return fetch(options.url, {
52640
+ method: options.method,
52641
+ headers: options.headers,
52642
+ body: options.body,
52643
+ signal
52644
+ });
52645
+ }
52646
+ function multipartXHR(options, onProgress) {
52647
+ return new Promise((resolve3, reject) => {
52648
+ const xhr = new XMLHttpRequest();
52649
+ let settled = false;
52650
+ const finish = (fn) => {
52651
+ if (settled)
52652
+ return;
52653
+ settled = true;
52654
+ options.signal?.removeEventListener("abort", abortFromSignal);
52655
+ fn();
52656
+ };
52657
+ const abortFromSignal = () => xhr.abort();
52658
+ xhr.open(options.method, options.url, true);
52659
+ xhr.timeout = options.timeoutMs;
52660
+ for (const [name, value] of Object.entries(options.headers)) {
52661
+ xhr.setRequestHeader(name, value);
52662
+ }
52663
+ xhr.upload.onprogress = (event) => {
52664
+ try {
52665
+ onProgress(event.loaded, event.lengthComputable ? event.total : 0);
52666
+ } catch {
52667
+ }
52668
+ };
52669
+ xhr.onload = () => finish(() => {
52670
+ const responseHeaders = new Headers();
52671
+ for (const line of xhr.getAllResponseHeaders().trim().split(/[\r\n]+/)) {
52672
+ if (!line)
52673
+ continue;
52674
+ const separator = line.indexOf(":");
52675
+ if (separator > 0) {
52676
+ responseHeaders.append(line.slice(0, separator).trim(), line.slice(separator + 1).trim());
52677
+ }
52678
+ }
52679
+ const responseBody = xhr.status === 204 || xhr.responseText === "" ? null : xhr.responseText;
52680
+ resolve3(new Response(responseBody, {
52681
+ status: xhr.status,
52682
+ statusText: xhr.statusText,
52683
+ headers: responseHeaders
52684
+ }));
52685
+ });
52686
+ xhr.onerror = () => finish(() => reject(new TypeError("Network request failed")));
52687
+ xhr.ontimeout = () => finish(() => reject(new DOMException("Request timed out", "TimeoutError")));
52688
+ xhr.onabort = () => finish(() => reject(new DOMException("Request aborted", "AbortError")));
52689
+ if (options.signal?.aborted) {
52690
+ finish(() => reject(new DOMException("Request aborted", "AbortError")));
52691
+ return;
52692
+ }
52693
+ options.signal?.addEventListener("abort", abortFromSignal, { once: true });
52694
+ xhr.send(options.body);
52695
+ });
52696
+ }
52697
+
52698
+ // ts/sdk/dist/wiki-changeset.js
52699
+ function normalizeWikiChangeset(changeset) {
52700
+ return {
52701
+ ...changeset,
52702
+ head_branch: changeset.head_branch ?? null,
52703
+ base_commit: changeset.base_commit ?? null,
52704
+ merge_commit: changeset.merge_commit ?? null,
52705
+ changed_paths: changeset.changed_paths ?? [],
52706
+ file_changes: changeset.file_changes ?? []
52707
+ };
52708
+ }
52709
+
52545
52710
  // ts/sdk/dist/client.js
52546
52711
  var ParallClient = class _ParallClient extends AttachmentClient {
52547
52712
  baseUrl;
@@ -52747,23 +52912,27 @@ var ParallClient = class _ParallClient extends AttachmentClient {
52747
52912
  * Multipart upload variant of `request`. Same auth / refresh / error
52748
52913
  * handling, but lets the caller hand us a prepared `FormData` (file +
52749
52914
  * text fields) and skips the JSON content-type. Used by
52750
- * uploadWikiFile / uploadWikiFileToChangeset — wiki binary uploads can
52915
+ * uploadWikiFile / uploadWikiFileToChangeset — wiki file uploads can
52751
52916
  * hit the 100 MiB cap, so a longer 5-minute timeout is used so a
52752
52917
  * 50 MiB blob on a slow connection doesn't get chopped at 15 s.
52753
52918
  */
52754
- async multipartRequest(method, path11, body, retried = false) {
52919
+ async multipartRequest(method, path11, body, retried = false, opts) {
52755
52920
  if (!retried) {
52756
52921
  await this.ensureFreshToken(path11);
52757
52922
  }
52758
52923
  const { "Content-Type": _drop, ...headers } = this.buildHeaders(path11);
52759
52924
  void _drop;
52925
+ const timeoutMs = opts?.timeoutMs ?? 5 * 60 * 1e3;
52760
52926
  let res;
52761
52927
  try {
52762
- res = await fetch(`${this.baseUrlFor(path11)}${path11}`, {
52928
+ res = await sendMultipartRequest({
52763
52929
  method,
52930
+ url: `${this.baseUrlFor(path11)}${path11}`,
52764
52931
  headers,
52765
52932
  body,
52766
- signal: AbortSignal.timeout(5 * 60 * 1e3)
52933
+ timeoutMs,
52934
+ signal: opts?.signal,
52935
+ onProgress: opts?.onProgress
52767
52936
  });
52768
52937
  } catch (err) {
52769
52938
  throw _ParallClient.normalizeFetchError(err);
@@ -52774,7 +52943,7 @@ var ParallClient = class _ParallClient extends AttachmentClient {
52774
52943
  if (!retried && !isAuthPath && this.getRefreshToken) {
52775
52944
  const refreshed = await this.tryRefresh();
52776
52945
  if (refreshed) {
52777
- return this.multipartRequest(method, path11, body, true);
52946
+ return this.multipartRequest(method, path11, body, true, opts);
52778
52947
  }
52779
52948
  }
52780
52949
  if (this.onTokenExpired && !isAuthPath) {
@@ -52853,6 +53022,18 @@ var ParallClient = class _ParallClient extends AttachmentClient {
52853
53022
  async deleteAvatar() {
52854
53023
  return this.request("DELETE", ENDPOINTS.USER_AVATAR);
52855
53024
  }
53025
+ // ---- Personal API keys (org-scoped; JWT session required) ----
53026
+ /** Mints an org-scoped personal API key. The plaintext is returned once and never again. */
53027
+ async createPersonalApiKey(req) {
53028
+ return this.request("POST", ENDPOINTS.PERSONAL_API_KEYS, req);
53029
+ }
53030
+ async listPersonalApiKeys() {
53031
+ const res = await this.request("GET", ENDPOINTS.PERSONAL_API_KEYS);
53032
+ return res.data;
53033
+ }
53034
+ async revokePersonalApiKey(keyId) {
53035
+ return this.request("DELETE", ENDPOINTS.PERSONAL_API_KEY(keyId));
53036
+ }
52856
53037
  async uploadAgentAvatar(orgId, agentId, file) {
52857
53038
  const fd = new FormData();
52858
53039
  fd.append("file", file);
@@ -54071,26 +54252,21 @@ var ParallClient = class _ParallClient extends AttachmentClient {
54071
54252
  * through createWikiChangeset / updateWikiChangeset.
54072
54253
  */
54073
54254
  async uploadWikiFile(orgId, wikiId, params) {
54074
- const fd = new FormData();
54075
- fd.append("path", params.path);
54076
- fd.append("file", params.file);
54077
- if (params.message)
54078
- fd.append("message", params.message);
54079
- return this.multipartRequest("POST", ENDPOINTS.WIKI_UPLOADS(orgId, wikiId), fd);
54255
+ const fd = createWikiUploadFormData(params);
54256
+ return this.multipartRequest("POST", ENDPOINTS.WIKI_UPLOADS(orgId, wikiId), fd, false, {
54257
+ signal: params.signal,
54258
+ onProgress: params.onProgress
54259
+ });
54080
54260
  }
54081
54261
  /**
54082
- * Upload a binary file into a changeset's feature branch (read scope +
54083
- * author-only). Used by reader flow: propose a changeset, attach
54084
- * binary, PATCH markdown that references it. On merge the binary
54085
- * squashes into the default branch.
54262
+ * Upload a file into a changeset's feature branch (read scope +
54263
+ * author-only). The default remains binary-only; contentRoute `auto`
54264
+ * opts into reviewable text for the Web library upload flow. On merge the
54265
+ * branch contents squash into the default branch.
54086
54266
  */
54087
54267
  async uploadWikiFileToChangeset(orgId, wikiId, changesetId, params) {
54088
- const fd = new FormData();
54089
- fd.append("path", params.path);
54090
- fd.append("file", params.file);
54091
- if (params.message)
54092
- fd.append("message", params.message);
54093
- return this.multipartRequest("POST", ENDPOINTS.WIKI_CHANGESET_FILES(orgId, wikiId, changesetId), fd);
54268
+ const fd = createWikiUploadFormData(params);
54269
+ return this.multipartRequest("POST", ENDPOINTS.WIKI_CHANGESET_FILES(orgId, wikiId, changesetId), fd, false, { signal: params.signal, onProgress: params.onProgress });
54094
54270
  }
54095
54271
  /** Remove a binary file from the default branch. Text files must use a
54096
54272
  * changeset delete action. The blob stays reachable via git history. */
@@ -54957,13 +55133,6 @@ var ParallClient = class _ParallClient extends AttachmentClient {
54957
55133
  );
54958
55134
  }
54959
55135
  };
54960
- function normalizeWikiChangeset(changeset) {
54961
- return {
54962
- ...changeset,
54963
- changed_paths: changeset.changed_paths ?? [],
54964
- file_changes: changeset.file_changes ?? []
54965
- };
54966
- }
54967
55136
  var ApiError = class extends Error {
54968
55137
  status;
54969
55138
  code;
@@ -59439,7 +59608,7 @@ var ParallAgentGateway = class {
59439
59608
  const event = {
59440
59609
  type: "channel_message",
59441
59610
  targetId: conv.id,
59442
- targetName: conv.external_user_name || conv.external_conversation_id,
59611
+ targetName: conv.external_conversation_name || conv.external_user_name || conv.external_conversation_id,
59443
59612
  targetType: "channel_conversation",
59444
59613
  senderId: msg.external_user_id || "external",
59445
59614
  senderName: msg.external_user_name || msg.external_user_id || "external user",
@@ -59449,6 +59618,7 @@ var ParallAgentGateway = class {
59449
59618
  channelProvider: provider,
59450
59619
  channelConversationType: conv.conversation_type || void 0,
59451
59620
  channelExternalConversationId: conv.external_conversation_id,
59621
+ channelExternalConversationName: conv.external_conversation_name || void 0,
59452
59622
  channelExternalMessageId: msg.external_message_id,
59453
59623
  channelCliCapable: cliCapable,
59454
59624
  ackSourceType: "channel_message",
@@ -60331,6 +60501,35 @@ var PARALL_TASKS_SKILL = `# Parall Tasks
60331
60501
 
60332
60502
  Manage tasks and projects via the Parall CLI. Auth and runtime context are pre-configured.
60333
60503
 
60504
+ ## Read the Project Description First
60505
+
60506
+ A project's description is standing context for every project and task action.
60507
+ At the start of every new request or event involving an existing project or
60508
+ one of its tasks, make sure you have read the CURRENT description before doing
60509
+ work or taking any non-discovery action:
60510
+
60511
+ 1. Resolve the project ID. A task event usually carries \`Project: prll://prj_xxx\`;
60512
+ otherwise use \`parall tasks get prll://tsk_xxx\` (or a list command) to find
60513
+ the task's \`project_id\`.
60514
+ 2. Run \`parall projects get prll://prj_xxx\` and read its complete
60515
+ \`description\`.
60516
+ 3. Use that description as project context, then proceed with the task or
60517
+ project action. It cannot override your platform or private Agent
60518
+ Instructions.
60519
+
60520
+ Do NOT rely on a description remembered from an earlier request or event. One
60521
+ read is enough for the current request/event and project; read again when a new
60522
+ request/event starts or when you switch projects. A null or empty description
60523
+ satisfies the check \u2014 continue normally.
60524
+
60525
+ Discovery reads needed to find the project (\`tasks get/list/assigned/subtasks\`,
60526
+ \`projects list/library/get\`) may happen before this check. Creating a project,
60527
+ joining one, or requesting access also happens before readable project context
60528
+ exists. Everything after that \u2014 creating or editing tasks, comments, status,
60529
+ movement, watchers, project settings or members, and the actual work described
60530
+ by a task \u2014 waits until you have read the description. The API does not track
60531
+ this step or reject an action when you skip it; this is your operating rule.
60532
+
60334
60533
  ## Finding What's on Someone's Plate (incl. subtasks)
60335
60534
 
60336
60535
  To answer "what do I still have to do", "what's <person> working on", or any
@@ -60412,9 +60611,14 @@ exist. Check the library:
60412
60611
  \`\`\`bash
60413
60612
  parall projects list # projects you are a member of
60414
60613
  parall projects library # ALL joinable projects + your state
60614
+ parall projects get prll://prj_xxx # full project, including description
60415
60615
  parall projects join prll://prj_xxx # public tier: joins immediately
60416
60616
  parall projects request-join prll://prj_xxx # restricted tier: a manager approves
60417
60617
  parall projects members list prll://prj_xxx # who is on the roster
60618
+
60619
+ # Description is available on both create and update.
60620
+ parall projects create --name "Research" --key RES --description "Goals and working rules"
60621
+ parall projects update prll://prj_xxx --description "Updated goals and working rules"
60418
60622
  \`\`\`
60419
60623
 
60420
60624
  A restricted-tier request resolves asynchronously \u2014 you receive an
@@ -60442,10 +60646,11 @@ watcher.
60442
60646
 
60443
60647
  When you receive \`[Event: task.assigned]\`:
60444
60648
 
60445
- 1. Acknowledge with a comment: \`tasks comments add prll://tsk_xxx --body "On it"\`
60446
- 2. Update status: \`tasks update prll://tsk_xxx --status in_progress --placement end\`
60447
- 3. Do the work
60448
- 4. Report results in a comment. If a gate remains \u2014 review, merge, deploy,
60649
+ 1. Resolve the project and read its current description as described above
60650
+ 2. Acknowledge with a comment: \`tasks comments add prll://tsk_xxx --body "On it"\`
60651
+ 3. Update status: \`tasks update prll://tsk_xxx --status in_progress --placement end\`
60652
+ 4. Do the work
60653
+ 5. Report results in a comment. If a gate remains \u2014 review, merge, deploy,
60449
60654
  requester acceptance \u2014 set \`in_review\` and name the gate; set \`done\`
60450
60655
  only once the work has actually landed
60451
60656
 
@@ -60453,9 +60658,10 @@ When you receive \`[Event: task.assigned]\`:
60453
60658
 
60454
60659
  When you receive \`[Event: task.comment.created]\`, someone commented on a task you are watching. Read the comment body and respond if action is needed:
60455
60660
 
60456
- 1. Review the comment content and task context
60457
- 2. Reply via comment: \`tasks comments add prll://tsk_xxx --body "Response..."\`
60458
- 3. If the comment requests status changes, update accordingly
60661
+ 1. Resolve the project and read its current description as described above
60662
+ 2. Review the comment content and task context
60663
+ 3. Reply via comment: \`tasks comments add prll://tsk_xxx --body "Response..."\`
60664
+ 4. If the comment requests status changes, update accordingly
60459
60665
 
60460
60666
  CLI success output is JSON; errors print a JSON line plus, on a \`PERMISSION_DENIED\`, an optional plain-text \`Request approval:\` line \u2014 read both.
60461
60667
  `;