@parall/daemon 1.48.0 → 1.50.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.
@@ -168,6 +168,12 @@ var init_constants = __esm({
168
168
  ORG_MEMBER: (orgId, userId) => `${API_BASE}/orgs/${orgId}/members/${userId}`,
169
169
  ORG_MEMBER_CHATS: (orgId, memberId) => `${API_BASE}/orgs/${orgId}/members/${memberId}/chats`,
170
170
  ORG_MEMBER_TASKS: (orgId, memberId) => `${API_BASE}/orgs/${orgId}/members/${memberId}/tasks`,
171
+ // Org-scoped public profile (title / description). GET readable by every
172
+ // active member; PATCH is CAS-guarded (expected_version).
173
+ ORG_MEMBER_PROFILE: (orgId, userId) => `${API_BASE}/orgs/${orgId}/members/${userId}/profile`,
174
+ // Private agent Instructions — visibility gated server-side
175
+ // (agent self + Human org admin/owner). Never cached.
176
+ AGENT_INSTRUCTIONS: (orgId, agentId) => `${API_BASE}/orgs/${orgId}/agents/${agentId}/instructions`,
171
177
  REF_SEARCH: (orgId) => `${API_BASE}/orgs/${orgId}/refs/search`,
172
178
  // Direct messages (org-scoped, atomic find-or-create + send)
173
179
  DM: (orgId) => `${API_BASE}/orgs/${orgId}/dm`,
@@ -191,6 +197,8 @@ var init_constants = __esm({
191
197
  MESSAGE_WATCH: (id) => `${API_BASE}/messages/${id}/watch`,
192
198
  MESSAGE_WATCHERS: (id) => `${API_BASE}/messages/${id}/watchers`,
193
199
  MESSAGE_WATCHING: (id) => `${API_BASE}/messages/${id}/watching`,
200
+ MESSAGE_REACTIONS: (id) => `${API_BASE}/messages/${id}/reactions`,
201
+ MESSAGE_REACTION: (id, emoji) => `${API_BASE}/messages/${id}/reactions/${encodeURIComponent(emoji)}`,
194
202
  // Upload (org-scoped)
195
203
  UPLOAD_PRESIGN: (orgId) => `${API_BASE}/orgs/${orgId}/upload/presign`,
196
204
  UPLOAD_COMPLETE: (orgId) => `${API_BASE}/orgs/${orgId}/upload/complete`,
@@ -428,11 +436,13 @@ var init_constants = __esm({
428
436
  UNREAD: `${API_BASE}/me/unread`,
429
437
  ORG_UNREAD: (orgId) => `${API_BASE}/orgs/${orgId}/unread`,
430
438
  CHAT_READ: (orgId, chatId) => `${API_BASE}/orgs/${orgId}/chats/${chatId}/read`,
439
+ CHAT_READ_ALL: (orgId, chatId) => `${API_BASE}/orgs/${orgId}/chats/${chatId}/read-all`,
431
440
  THREAD_UNREAD: (orgId, chatId, threadRootId) => `${API_BASE}/orgs/${orgId}/chats/${chatId}/threads/${threadRootId}/unread`,
432
441
  THREAD_READ: (orgId, chatId, threadRootId) => `${API_BASE}/orgs/${orgId}/chats/${chatId}/threads/${threadRootId}/read`,
433
442
  // References (org-scoped)
434
443
  REFS_RESOLVE: (orgId) => `${API_BASE}/orgs/${orgId}/refs/resolve`,
435
444
  REFS_BACKLINKS: (orgId) => `${API_BASE}/orgs/${orgId}/refs/backlinks`,
445
+ REFS_OUTBOUND: (orgId) => `${API_BASE}/orgs/${orgId}/refs/outbound`,
436
446
  REFS_GRAPH: (orgId) => `${API_BASE}/orgs/${orgId}/refs/graph`,
437
447
  REFS_CHECK: (orgId) => `${API_BASE}/orgs/${orgId}/refs/check`,
438
448
  // Platform config (agent-scoped, not org-scoped)
@@ -447,6 +457,11 @@ var init_constants = __esm({
447
457
  SEARCH: (orgId) => `${API_BASE}/orgs/${orgId}/search`,
448
458
  // Feature flags (org-scoped, server-evaluated)
449
459
  FEATURE_FLAGS: (orgId) => `${API_BASE}/orgs/${orgId}/feature-flags`,
460
+ // Team templates (org-scoped, owner/admin only)
461
+ TEMPLATES: (orgId) => `${API_BASE}/orgs/${orgId}/templates`,
462
+ TEMPLATE: (orgId, templateId) => `${API_BASE}/orgs/${orgId}/templates/${templateId}`,
463
+ TEMPLATE_DEPLOYMENTS: (orgId) => `${API_BASE}/orgs/${orgId}/template-deployments`,
464
+ TEMPLATE_DEPLOYMENT: (orgId, deploymentId) => `${API_BASE}/orgs/${orgId}/template-deployments/${deploymentId}`,
450
465
  // Billing & Credits (org-scoped)
451
466
  BILLING: (orgId) => `${API_BASE}/orgs/${orgId}/billing`,
452
467
  BILLING_TRANSACTIONS: (orgId) => `${API_BASE}/orgs/${orgId}/billing/transactions`,
@@ -494,7 +509,13 @@ var init_constants = __esm({
494
509
  ORG_EDGE_DEVICE_UNREGISTER: (orgId, edgeId) => `/api/v1/orgs/${orgId}/edge/${edgeId}/unregister`,
495
510
  ORG_EDGE_ONBOARDING: (orgId) => `/api/v1/orgs/${orgId}/edge/onboarding`,
496
511
  ORG_EDGE_PROFILES: (orgId, edgeId) => `/api/v1/orgs/${orgId}/edge/${edgeId}/profiles`,
512
+ // Per-profile egress proxy (hosted Cloud Profiles; manager-only, human-only).
513
+ ORG_EDGE_PROFILE_PROXY: (orgId, edgeId, profileName) => `/api/v1/orgs/${orgId}/edge/${edgeId}/profiles/${encodeURIComponent(profileName)}/proxy`,
497
514
  ORG_EDGE_EXEC: (orgId) => `/api/v1/orgs/${orgId}/edge/exec`,
515
+ // Cloud Edge live viewer command (V1b) — api-server, gated on cap:edge-viewer.
516
+ // Same request/reply shape as the v2 browser-profile viewer, on the v3 edge
517
+ // pipe. Additive: does NOT replace BROWSER_PROFILE_VIEWER_COMMAND.
518
+ ORG_EDGE_VIEWER_COMMAND: (orgId, edgeId) => `/api/v1/orgs/${orgId}/edge/${edgeId}/viewer/command`,
498
519
  CLIP_CONNECTIONS: (orgId, clipId) => `/api/v1/orgs/${orgId}/clip-registry/${clipId}/connections`,
499
520
  CLIP_CONNECTION: (orgId, connId) => `/api/v1/orgs/${orgId}/clip-connections/${connId}`,
500
521
  // Clip registry (v3, org-scoped, served by api-server — `crg_` entries; the
@@ -517,6 +538,7 @@ var init_constants = __esm({
517
538
  MESSAGE_PATCH: "message.patch",
518
539
  MESSAGE_EDIT: "message.edit",
519
540
  MESSAGE_DELETE: "message.delete",
541
+ MESSAGE_REACTION_UPDATED: "message.reaction.updated",
520
542
  TYPING_UPDATE: "typing.update",
521
543
  CHAT_UPDATE: "chat.update",
522
544
  CHAT_DELETED: "chat.deleted",
@@ -558,6 +580,7 @@ var init_constants = __esm({
558
580
  INBOX_UPDATE: "inbox.update",
559
581
  INBOX_BULK_UPDATE: "inbox.bulk_update",
560
582
  READ_POSITION_UPDATED: "read_position.updated",
583
+ THREAD_READ_POSITION_UPDATED: "thread_read_position.updated",
561
584
  DISPATCH_NEW: "dispatch.new",
562
585
  DISPATCH_RECEIVED: "dispatch.received",
563
586
  DISPATCH_RESOLVED: "dispatch.resolved",
@@ -604,6 +627,9 @@ function buildApiError(res, rawErrorBody) {
604
627
  const errMsg = (typeof errorObj?.message === "string" ? errorObj.message : void 0) ?? (typeof errorBody.message === "string" ? errorBody.message : void 0) ?? (typeof errorBody.error === "string" ? errorBody.error : void 0);
605
628
  const errCode = (typeof errorObj?.code === "string" ? errorObj.code : void 0) ?? (typeof errorBody.code === "string" ? errorBody.code : void 0);
606
629
  const apiError = new ApiError(res.status, errMsg ?? res.statusText, errCode);
630
+ const retryAfter = Number(res.headers?.get("Retry-After"));
631
+ if (Number.isFinite(retryAfter) && retryAfter > 0)
632
+ apiError.retryAfterSeconds = retryAfter;
607
633
  const anchors = errorObj ?? errorBody;
608
634
  if (typeof anchors.action === "string")
609
635
  apiError.action = anchors.action;
@@ -784,7 +810,7 @@ var init_client = __esm({
784
810
  if (qs)
785
811
  url += `?${qs}`;
786
812
  }
787
- const headers = this.buildHeaders(path23);
813
+ const headers = this.buildHeaders(path23, opts?.headers);
788
814
  const timeoutSignal = AbortSignal.timeout(opts?.timeoutMs ?? 15e3);
789
815
  const signal = opts?.signal ? AbortSignal.any([opts.signal, timeoutSignal]) : timeoutSignal;
790
816
  let res;
@@ -1000,6 +1026,30 @@ var init_client = __esm({
1000
1026
  async updateOrgMember(orgId, userId, role) {
1001
1027
  return this.request("PATCH", ENDPOINTS.ORG_MEMBER(orgId, userId), { role });
1002
1028
  }
1029
+ /** Org-scoped public profile (title / description) of any active member. */
1030
+ async getMemberProfile(orgId, userId) {
1031
+ return this.request("GET", ENDPOINTS.ORG_MEMBER_PROFILE(orgId, userId));
1032
+ }
1033
+ /**
1034
+ * CAS full-replacement of a member's public profile. Humans edit their
1035
+ * own; Human org admins/owners edit agents'. A stale expected_version
1036
+ * gets 409 PROFILE_VERSION_CONFLICT with error.details.current_version.
1037
+ */
1038
+ async updateMemberProfile(orgId, userId, req) {
1039
+ return this.request("PATCH", ENDPOINTS.ORG_MEMBER_PROFILE(orgId, userId), req);
1040
+ }
1041
+ /** Private agent Instructions — agent self or Human org admin/owner only. */
1042
+ async getAgentInstructions(orgId, agentId) {
1043
+ return this.request("GET", ENDPOINTS.AGENT_INSTRUCTIONS(orgId, agentId));
1044
+ }
1045
+ /**
1046
+ * CAS update of the private Instructions (Human org admin/owner only).
1047
+ * A stale expected_version gets 409 INSTRUCTIONS_VERSION_CONFLICT with
1048
+ * error.details.current_version.
1049
+ */
1050
+ async updateAgentInstructions(orgId, agentId, req) {
1051
+ return this.request("PATCH", ENDPOINTS.AGENT_INSTRUCTIONS(orgId, agentId), req);
1052
+ }
1003
1053
  // Member activity surfaces — chats the member participates in within this org,
1004
1054
  // ordered by most recent activity. Powers the member profile Activity tab.
1005
1055
  async getMemberChats(orgId, memberId, params) {
@@ -1190,6 +1240,14 @@ var init_client = __esm({
1190
1240
  async getMessageReplies(id, params) {
1191
1241
  return this.request("GET", ENDPOINTS.MESSAGE_REPLIES(id), void 0, params);
1192
1242
  }
1243
+ // ---- Reactions ----
1244
+ async toggleReaction(messageId, emoji) {
1245
+ return this.request("PUT", ENDPOINTS.MESSAGE_REACTION(messageId, emoji));
1246
+ }
1247
+ async listReactions(messageId) {
1248
+ const res = await this.request("GET", ENDPOINTS.MESSAGE_REACTIONS(messageId));
1249
+ return res.reactions;
1250
+ }
1193
1251
  // ---- File Upload ----
1194
1252
  async getUploadPresignUrl(orgId, req) {
1195
1253
  return this.request("POST", ENDPOINTS.UPLOAD_PRESIGN(orgId), req);
@@ -1565,6 +1623,15 @@ var init_client = __esm({
1565
1623
  async browserViewerCommand(orgId, profileId, req, opts) {
1566
1624
  return this.request("POST", ENDPOINTS.BROWSER_PROFILE_VIEWER_COMMAND(orgId, profileId), req, void 0, false, opts);
1567
1625
  }
1626
+ /**
1627
+ * Drive the Cloud Edge live viewer (V1b, design §6): WebRTC signaling + input +
1628
+ * tab nav for a hosted browser (Cloud Profile). Same request/reply shape as
1629
+ * browserViewerCommand, on the v3 edge pipe; additive — the v2 browser-profile
1630
+ * viewer is unchanged.
1631
+ */
1632
+ async edgeViewerCommand(orgId, edgeId, req, opts) {
1633
+ return this.request("POST", ENDPOINTS.ORG_EDGE_VIEWER_COMMAND(orgId, edgeId), req, void 0, false, opts);
1634
+ }
1568
1635
  async resizeMachine(orgId, machineId, spec) {
1569
1636
  return this.request("PATCH", ENDPOINTS.MACHINE_SPEC(orgId, machineId), spec);
1570
1637
  }
@@ -1591,14 +1658,23 @@ var init_client = __esm({
1591
1658
  }
1592
1659
  // Wiki mount/token methods removed — wiki-service handles all wiki endpoints.
1593
1660
  // ---- Unread ----
1594
- async getUnreadCounts(orgId) {
1661
+ async getUnreadCounts(orgId, opts) {
1595
1662
  const endpoint = orgId ? ENDPOINTS.ORG_UNREAD(orgId) : ENDPOINTS.UNREAD;
1596
- const res = await this.request("GET", endpoint);
1663
+ const res = await this.request("GET", endpoint, void 0, {
1664
+ include_thread_replies: opts?.includeThreadReplies ? "true" : void 0
1665
+ });
1597
1666
  return res.data;
1598
1667
  }
1599
1668
  async markRead(orgId, chatId, messageId) {
1600
1669
  return this.request("POST", ENDPOINTS.CHAT_READ(orgId, chatId), { message_id: messageId });
1601
1670
  }
1671
+ /** Mark everything in a chat read: the channel cursor jumps to the latest
1672
+ * top-level message and every thread cursor to its latest reply, in one
1673
+ * idempotent call. The server echoes the same per-cursor WS events the
1674
+ * single-cursor routes emit and auto-clears covered inbox items. */
1675
+ async markAllRead(orgId, chatId) {
1676
+ return this.request("POST", ENDPOINTS.CHAT_READ_ALL(orgId, chatId));
1677
+ }
1602
1678
  async getThreadUnread(orgId, chatId, threadRootId) {
1603
1679
  return this.request("GET", ENDPOINTS.THREAD_UNREAD(orgId, chatId, threadRootId));
1604
1680
  }
@@ -2273,6 +2349,16 @@ var init_client = __esm({
2273
2349
  async getBacklinks(orgId, params) {
2274
2350
  return this.request("GET", ENDPOINTS.REFS_BACKLINKS(orgId), void 0, params);
2275
2351
  }
2352
+ /**
2353
+ * Outbound prll:// refs authored in a set of sources, as raw ref_links rows
2354
+ * (dedupe/group client-side). Pass `{ thread_root_id }` to list a whole
2355
+ * thread's refs (root + all replies, resolved server-side — the client's
2356
+ * reply window may be partial), or `{ source_type, source_ids }` for
2357
+ * explicit sources (max 500; v1 accepts only message sources).
2358
+ */
2359
+ async listOutboundRefs(orgId, req) {
2360
+ return this.request("POST", ENDPOINTS.REFS_OUTBOUND(orgId), req);
2361
+ }
2276
2362
  /**
2277
2363
  * Bounded multi-hop walk of the prll:// reference graph around `uri`. `uri`
2278
2364
  * must be an entity-level prll:// URI — a refined URI (path/query/fragment) is
@@ -2307,6 +2393,22 @@ var init_client = __esm({
2307
2393
  async getFeatureFlags(orgId) {
2308
2394
  return this.request("GET", ENDPOINTS.FEATURE_FLAGS(orgId));
2309
2395
  }
2396
+ // ---- Official Template catalog (org-contextual owner/admin reads + Hire) ----
2397
+ async listOfficialTemplates(orgId) {
2398
+ const response = await this.request("GET", ENDPOINTS.TEMPLATES(orgId));
2399
+ return response.templates ?? [];
2400
+ }
2401
+ async getOfficialTemplate(orgId, templateId) {
2402
+ return this.request("GET", ENDPOINTS.TEMPLATE(orgId, templateId));
2403
+ }
2404
+ async deployTemplate(orgId, request3) {
2405
+ return this.request("POST", ENDPOINTS.TEMPLATE_DEPLOYMENTS(orgId), request3, void 0, false, {
2406
+ timeoutMs: 185e3
2407
+ });
2408
+ }
2409
+ async getTemplateDeployment(orgId, deploymentId) {
2410
+ return this.request("GET", ENDPOINTS.TEMPLATE_DEPLOYMENT(orgId, deploymentId));
2411
+ }
2310
2412
  // ---- Billing & Credits (org-scoped) ----
2311
2413
  async getBilling(orgId) {
2312
2414
  return this.request("GET", ENDPOINTS.BILLING(orgId));
@@ -2552,6 +2654,43 @@ var init_client = __esm({
2552
2654
  async listEdgeProfiles(orgId, edgeId) {
2553
2655
  return this.request("GET", ENDPOINTS.ORG_EDGE_PROFILES(orgId, edgeId));
2554
2656
  }
2657
+ /**
2658
+ * Read a hosted Cloud Profile's egress-proxy status (manager-only: hosted
2659
+ * human maintainer or org admin). Sanitized — the password never comes back.
2660
+ * Typed errors: `EDGE_NOT_HOSTED` (BYOC device), `PROXY_CONFIG_CORRUPT` /
2661
+ * validation codes as 422 when a stored config no longer passes current rules.
2662
+ * `can_mutate` and `lease_status` are the authoritative idle gate; device
2663
+ * list status is not a substitute.
2664
+ */
2665
+ async getEdgeProfileProxy(orgId, edgeId, profileName) {
2666
+ return this.request("GET", ENDPOINTS.ORG_EDGE_PROFILE_PROXY(orgId, edgeId, profileName));
2667
+ }
2668
+ /**
2669
+ * Set/replace the profile's egress proxy (full triple every time) — IDLE
2670
+ * ONLY: while the profile's hosted browser is running (a viewer session is
2671
+ * open or a pod is otherwise live) the server answers 409
2672
+ * `EDGE_PROFILE_IN_USE`; close the viewer, wait for idle scale-to-zero, and
2673
+ * retry. The next cold start uses the new egress; browser login state is
2674
+ * preserved across it. Other typed errors: the validation vocabulary
2675
+ * (`INVALID_PROXY_SERVER`, `PROXY_AUTH_INCOMPLETE`,
2676
+ * `PROXY_SERVER_FORBIDDEN_TARGET`, …), `EDGE_DELETING` (409), and
2677
+ * `SECRETBOX_UNCONFIGURED` (503 — server cannot store credentials safely),
2678
+ * and `EDGE_PROFILE_PROXY_STALE` (409 — expectedVersion lost a tab race).
2679
+ */
2680
+ async setEdgeProfileProxy(orgId, edgeId, profileName, req, expectedVersion) {
2681
+ return this.request("PUT", ENDPOINTS.ORG_EDGE_PROFILE_PROXY(orgId, edgeId, profileName), req, void 0, false, {
2682
+ headers: expectedVersion ? { "If-Match": `"proxy-${expectedVersion}"` } : void 0
2683
+ });
2684
+ }
2685
+ /**
2686
+ * Clear the profile's egress proxy; the next pod start egresses directly.
2687
+ * Idle-only like set — 409 `EDGE_PROFILE_IN_USE` while the browser is live.
2688
+ */
2689
+ async clearEdgeProfileProxy(orgId, edgeId, profileName, expectedVersion) {
2690
+ return this.request("DELETE", ENDPOINTS.ORG_EDGE_PROFILE_PROXY(orgId, edgeId, profileName), void 0, void 0, false, {
2691
+ headers: expectedVersion ? { "If-Match": `"proxy-${expectedVersion}"` } : void 0
2692
+ });
2693
+ }
2555
2694
  /**
2556
2695
  * Execute a registry clip command on an Edge device.
2557
2696
  *
@@ -2613,6 +2752,8 @@ var init_client = __esm({
2613
2752
  status;
2614
2753
  code;
2615
2754
  extras;
2755
+ /** Retry-After delta seconds when the server supplies one. */
2756
+ retryAfterSeconds;
2616
2757
  /** Attempted action (authorization denials) — e.g. "chat.add_member". */
2617
2758
  action;
2618
2759
  /** Target resource URI that was evaluated — e.g. "prll://cht_…". */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@parall/daemon",
3
- "version": "1.48.0",
3
+ "version": "1.50.0",
4
4
  "description": "Parall local agent runtime — daemon supervisor + bridge runtimes, bundled as standalone JS files",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -33,11 +33,11 @@
33
33
  "@aws-sdk/client-s3": "3.984.0",
34
34
  "@pinixai/bb-browser-pro": "0.15.0",
35
35
  "ws": "^8.18.0",
36
- "@parall/sdk": "1.48.0",
37
- "@parall/codex-agent": "1.48.0",
38
- "@parall/openclaw-agent": "1.48.0",
39
- "@parall/claude-agent": "1.48.0",
40
- "@parall/agent-core": "1.48.0"
36
+ "@parall/agent-core": "1.50.0",
37
+ "@parall/sdk": "1.50.0",
38
+ "@parall/claude-agent": "1.50.0",
39
+ "@parall/codex-agent": "1.50.0",
40
+ "@parall/openclaw-agent": "1.50.0"
41
41
  },
42
42
  "devDependencies": {
43
43
  "@types/node": "^22.0.0",