@parall/daemon 1.50.1 → 1.52.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.
@@ -438,6 +438,7 @@ var init_constants = __esm({
438
438
  DISPATCH_BY_MESSAGES: (orgId) => `${API_BASE}/orgs/${orgId}/dispatch/by-messages`,
439
439
  DISPATCH_CLAIM: (orgId) => `${API_BASE}/orgs/${orgId}/dispatch/claim`,
440
440
  DISPATCH_STEER: (orgId) => `${API_BASE}/orgs/${orgId}/dispatch/steer`,
441
+ DISPATCH_INPUT_STATE: (orgId) => `${API_BASE}/orgs/${orgId}/dispatch/input-state`,
441
442
  DISPATCH_COMPLETE: (orgId) => `${API_BASE}/orgs/${orgId}/dispatch/complete`,
442
443
  DISPATCH_COMPLETE_SOURCES: (orgId) => `${API_BASE}/orgs/${orgId}/dispatch/complete-sources`,
443
444
  DISPATCH_RELEASE: (orgId) => `${API_BASE}/orgs/${orgId}/dispatch/release`,
@@ -472,6 +473,9 @@ var init_constants = __esm({
472
473
  TEMPLATE: (orgId, templateId) => `${API_BASE}/orgs/${orgId}/templates/${templateId}`,
473
474
  TEMPLATE_DEPLOYMENTS: (orgId) => `${API_BASE}/orgs/${orgId}/template-deployments`,
474
475
  TEMPLATE_DEPLOYMENT: (orgId, deploymentId) => `${API_BASE}/orgs/${orgId}/template-deployments/${deploymentId}`,
476
+ CLIP_DEPENDENCIES_CHECK: (orgId) => `${API_BASE}/orgs/${orgId}/clip-dependencies/check`,
477
+ // Onboarding wizard progress (org-scoped, self)
478
+ ONBOARDING_PROGRESS: (orgId) => `${API_BASE}/orgs/${orgId}/onboarding`,
475
479
  // Billing & Credits (org-scoped)
476
480
  BILLING: (orgId) => `${API_BASE}/orgs/${orgId}/billing`,
477
481
  BILLING_TRANSACTIONS: (orgId) => `${API_BASE}/orgs/${orgId}/billing/transactions`,
@@ -532,7 +536,11 @@ var init_constants = __esm({
532
536
  // Pinix Hub catalog proxy above is a different, id-less surface)
533
537
  ORG_CLIP_REGISTRY: (orgId) => `/api/v1/orgs/${orgId}/clip-registry`,
534
538
  ORG_CLIP_INSTALL: (orgId) => `/api/v1/orgs/${orgId}/clips/install`,
535
- ORG_CLIPS_INSTALLED: (orgId) => `/api/v1/orgs/${orgId}/clips/installed`
539
+ ORG_CLIPS_INSTALLED: (orgId) => `/api/v1/orgs/${orgId}/clips/installed`,
540
+ // MCP clip server config (cap:clip-mcp; publisher-org only — cross-org gets
541
+ // 403 MCP_CROSS_ORG_DISABLED on the whole family, reads included)
542
+ ORG_CLIP_MCP_CONFIG: (orgId, clipId) => `/api/v1/orgs/${orgId}/clip-registry/${clipId}/mcp-config`,
543
+ ORG_CLIP_MCP_TOOLS_REFRESH: (orgId, clipId) => `/api/v1/orgs/${orgId}/clip-registry/${clipId}/mcp-config/tools/refresh`
536
544
  };
537
545
  WS_EVENTS = {
538
546
  // Client -> Server
@@ -1071,8 +1079,10 @@ var init_client = __esm({
1071
1079
  q.limit = String(params.limit);
1072
1080
  return this.request("GET", ENDPOINTS.ORG_MEMBER_CHATS(orgId, memberId), void 0, q);
1073
1081
  }
1074
- // Pending tasks (todo + in_progress) assigned to a member. Powers both
1075
- // member profile Activity and the agent startup catch-up flow.
1082
+ // Pending tasks (todo + in_progress) assigned to a member. On-demand listing
1083
+ // (member profile Activity; agents via `parall tasks`) — startup catch-up
1084
+ // runs on dispatch redrive, not this endpoint. Self-assigned tasks appear
1085
+ // here without any dispatch WorkItem (self-assign is deliberately silent).
1076
1086
  async getMemberTasks(orgId, memberId, params) {
1077
1087
  const q = {};
1078
1088
  if (params?.cursor)
@@ -1414,7 +1424,12 @@ var init_client = __esm({
1414
1424
  async getAgentRuntimeRelease(orgId, agentId, tag) {
1415
1425
  return this.request("GET", ENDPOINTS.AGENT_RUNTIME_RELEASE(orgId, agentId, tag));
1416
1426
  }
1417
- /** Fetch all pending tasks (todo/in_progress) assigned to an agent. Pages automatically. */
1427
+ /**
1428
+ * Fetch all pending tasks (todo/in_progress) assigned to an agent. Pages
1429
+ * automatically. On-demand listing only — not a dispatch source: startup
1430
+ * catch-up runs on dispatch redrive, and self-assigned tasks listed here
1431
+ * deliberately have no WorkItem behind them.
1432
+ */
1418
1433
  async getAgentTasks(orgId, agentId) {
1419
1434
  const all = [];
1420
1435
  let cursor;
@@ -1758,6 +1773,10 @@ var init_client = __esm({
1758
1773
  async steerDispatch(orgId, req) {
1759
1774
  return this.request("POST", ENDPOINTS.DISPATCH_STEER(orgId), req);
1760
1775
  }
1776
+ /** Advance exact runtime-input lifecycle for members of an explicit lane. */
1777
+ async updateDispatchInputState(orgId, req) {
1778
+ return this.request("POST", ENDPOINTS.DISPATCH_INPUT_STATE(orgId), req);
1779
+ }
1761
1780
  async completeDispatch(orgId, req) {
1762
1781
  return this.request("POST", ENDPOINTS.DISPATCH_COMPLETE(orgId), req);
1763
1782
  }
@@ -2416,6 +2435,19 @@ var init_client = __esm({
2416
2435
  async getTemplateDeployment(orgId, deploymentId) {
2417
2436
  return this.request("GET", ENDPOINTS.TEMPLATE_DEPLOYMENT(orgId, deploymentId));
2418
2437
  }
2438
+ /** Pre-deploy dependency connection state (wizard S3). Live answer, no
2439
+ * cache — poll it the way getTemplateDeployment is polled. */
2440
+ async checkClipDependencies(orgId, refs) {
2441
+ const response = await this.request("POST", ENDPOINTS.CLIP_DEPENDENCIES_CHECK(orgId), { refs });
2442
+ return response.results ?? [];
2443
+ }
2444
+ // ---- Onboarding wizard progress (org-scoped, self) ----
2445
+ async getOnboardingProgress(orgId) {
2446
+ return this.request("GET", ENDPOINTS.ONBOARDING_PROGRESS(orgId));
2447
+ }
2448
+ async updateOnboardingProgress(orgId, request3) {
2449
+ return this.request("PATCH", ENDPOINTS.ONBOARDING_PROGRESS(orgId), request3);
2450
+ }
2419
2451
  // ---- Billing & Credits (org-scoped) ----
2420
2452
  async getBilling(orgId) {
2421
2453
  return this.request("GET", ENDPOINTS.BILLING(orgId));
@@ -2710,12 +2742,17 @@ var init_client = __esm({
2710
2742
  * command RAN and failed — `error`/`error_code` describe why). Everything
2711
2743
  * else throws a typed {@link ApiError}; match on `err.code`:
2712
2744
  *
2713
- * Safe to retry (guaranteed nothing was dispatched):
2714
- * - `EDGE_ACTIVATING` 503 + `Retry-After` — cold cloud profile is starting.
2715
- * Bounded backoff, same `correlation_id` across the loop.
2716
- * - `EDGE_BUSY` 409the device is executing another request.
2717
- * - `EDGE_CONCURRENCY_LIMIT` 429 org at its concurrent-session limit.
2718
- * - `EDGE_UNAVAILABLE` 503session torn down / replaced mid-dispatch.
2745
+ * Safe to retry (provably not executed). Exactly three carry `Retry-After`
2746
+ * pacing ({@link ApiError.retryAfterSeconds}) `EDGE_ACTIVATING`,
2747
+ * `EDGE_BUSY`, `EDGE_CONCURRENCY_LIMIT`:
2748
+ * - `EDGE_ACTIVATING` 503cold cloud profile is starting. Answered before
2749
+ * any dispatch. Bounded backoff, same `correlation_id` across the loop.
2750
+ * - `EDGE_BUSY` 409the device is executing another request; the pod
2751
+ * refused this one before starting any script.
2752
+ * - `EDGE_CONCURRENCY_LIMIT` 429 — org at its concurrent-session limit,
2753
+ * answered before any dispatch.
2754
+ * - `EDGE_UNAVAILABLE` 503 — session torn down / replaced mid-dispatch. No
2755
+ * `Retry-After` (no slot to wait for — retry re-resolves routing).
2719
2756
  *
2720
2757
  * NOT retryable:
2721
2758
  * - `OUTCOME_UNKNOWN` 504 — dispatched, but no result arrived. The command
@@ -2754,6 +2791,60 @@ var init_client = __esm({
2754
2791
  async deleteClipConnection(orgId, connId) {
2755
2792
  return this.request("DELETE", ENDPOINTS.CLIP_CONNECTION(orgId, connId));
2756
2793
  }
2794
+ // ---- MCP clip server config (cap:clip-mcp; publisher-org only) ----
2795
+ /**
2796
+ * Read the redacted MCP config. 404 NOT_FOUND when the clip has none yet;
2797
+ * 403 MCP_CROSS_ORG_DISABLED for a cross-org installed clip (the whole
2798
+ * mcp-config family is publisher-org property, reads included). `version`
2799
+ * is the CAS token the mutations echo via If-Match.
2800
+ */
2801
+ async getClipMCPConfig(orgId, clipId) {
2802
+ return this.request("GET", ENDPOINTS.ORG_CLIP_MCP_CONFIG(orgId, clipId));
2803
+ }
2804
+ /**
2805
+ * Upsert the MCP config (human org-admin JWT only). Pass `expectedVersion`
2806
+ * from the last GET; omit it ONLY on first create (no config exists yet).
2807
+ * Save probes the remote server first — a probe failure persists nothing and
2808
+ * surfaces as MCP_URL_FORBIDDEN / MCP_AUTH_FAILED / MCP_SERVER_UNREACHABLE /
2809
+ * MCP_PROTOCOL_ERROR. Other typed conflicts: MCP_CONFIG_STALE (reload, then
2810
+ * retry with the current version), MCP_CONFIG_BUSY (another change in
2811
+ * flight — retry), MCP_CONNECTION_CONFLICT (a device-targeted default
2812
+ * connection must be unbound first), SECRETBOX_UNCONFIGURED (503 — the
2813
+ * server cannot store credentials safely).
2814
+ */
2815
+ async putClipMCPConfig(orgId, clipId, req, expectedVersion) {
2816
+ return this.request("PUT", ENDPOINTS.ORG_CLIP_MCP_CONFIG(orgId, clipId), req, void 0, false, {
2817
+ headers: expectedVersion ? { "If-Match": `"${expectedVersion}"` } : void 0,
2818
+ // The server probes the remote MCP server inside the request on a fixed
2819
+ // 30s budget; give the HTTP layer headroom past it so a slow-but-valid
2820
+ // save isn't chopped locally into a fake transport error.
2821
+ timeoutMs: 4e4
2822
+ });
2823
+ }
2824
+ /**
2825
+ * Delete the MCP config and every connection routed through it (one
2826
+ * transaction — no orphaned target-less connections). `expectedVersion` is
2827
+ * mandatory: deleting always mutates an existing config.
2828
+ */
2829
+ async deleteClipMCPConfig(orgId, clipId, expectedVersion) {
2830
+ return this.request("DELETE", ENDPOINTS.ORG_CLIP_MCP_CONFIG(orgId, clipId), void 0, void 0, false, { headers: { "If-Match": `"${expectedVersion}"` } });
2831
+ }
2832
+ /**
2833
+ * Re-run tools/list and replace the cached snapshot (org-admin only).
2834
+ * Deliberately does NOT advance the CAS version, so an in-flight edit in
2835
+ * another tab stays valid; on probe failure the old snapshot survives.
2836
+ */
2837
+ async refreshClipMCPTools(orgId, clipId) {
2838
+ return this.request(
2839
+ "POST",
2840
+ ENDPOINTS.ORG_CLIP_MCP_TOOLS_REFRESH(orgId, clipId),
2841
+ void 0,
2842
+ void 0,
2843
+ false,
2844
+ // Same fixed 30s server-side probe budget as PUT (see putClipMCPConfig).
2845
+ { timeoutMs: 4e4 }
2846
+ );
2847
+ }
2757
2848
  };
2758
2849
  ApiError = class extends Error {
2759
2850
  status;
@@ -3136,6 +3227,13 @@ var init_dist = __esm({
3136
3227
  }
3137
3228
  });
3138
3229
 
3230
+ // ts/agent-core/dist/event-format.js
3231
+ var init_event_format = __esm({
3232
+ "ts/agent-core/dist/event-format.js"() {
3233
+ "use strict";
3234
+ }
3235
+ });
3236
+
3139
3237
  // ts/agent-core/dist/lane-ledger.js
3140
3238
  var init_lane_ledger = __esm({
3141
3239
  "ts/agent-core/dist/lane-ledger.js"() {
@@ -3151,6 +3249,7 @@ var init_gateway_lane_flow = __esm({
3151
3249
  "ts/agent-core/dist/gateway-lane-flow.js"() {
3152
3250
  "use strict";
3153
3251
  init_dist();
3252
+ init_event_format();
3154
3253
  init_lane_ledger();
3155
3254
  TYPED_BACKOFF_CAP_MS = 5 * 6e4;
3156
3255
  }
@@ -3170,13 +3269,6 @@ var init_routing = __esm({
3170
3269
  }
3171
3270
  });
3172
3271
 
3173
- // ts/agent-core/dist/event-format.js
3174
- var init_event_format = __esm({
3175
- "ts/agent-core/dist/event-format.js"() {
3176
- "use strict";
3177
- }
3178
- });
3179
-
3180
3272
  // ts/agent-core/dist/prompt-fragments.js
3181
3273
  var init_prompt_fragments = __esm({
3182
3274
  "ts/agent-core/dist/prompt-fragments.js"() {
@@ -3198,6 +3290,13 @@ var init_dispatch_adapter = __esm({
3198
3290
  }
3199
3291
  });
3200
3292
 
3293
+ // ts/agent-core/dist/redact.js
3294
+ var init_redact = __esm({
3295
+ "ts/agent-core/dist/redact.js"() {
3296
+ "use strict";
3297
+ }
3298
+ });
3299
+
3201
3300
  // ts/agent-core/dist/logger.js
3202
3301
  function createLogger(prefix) {
3203
3302
  return {
@@ -29717,6 +29816,12 @@ async function initAgentTelemetry(serviceName, runtimeType) {
29717
29816
  missingReplyCounter = meter.createCounter("parall.dispatch.missing_reply", {
29718
29817
  description: "Dispatches where agent produced text but sent no reply message"
29719
29818
  });
29819
+ turnTokensCounter = meter.createCounter("parall.turn.tokens", {
29820
+ description: "LLM tokens consumed per turn, by kind (input/output/cache_read/cache_creation)"
29821
+ });
29822
+ turnCostCounter = meter.createCounter("parall.turn.cost_usd", {
29823
+ description: "LLM cost per turn in USD (when the runtime reports it)"
29824
+ });
29720
29825
  initialized = true;
29721
29826
  shutdownFn = async () => {
29722
29827
  await tracerProvider.forceFlush();
@@ -29769,18 +29874,21 @@ function createOtelLogger(layer, prefix) {
29769
29874
  child: (sub) => createOtelLogger(layer, `${prefix}:${sub}`)
29770
29875
  };
29771
29876
  }
29772
- var import_api_logs, initialized, shutdownFn, tracer, dispatchCounter, dispatchDuration, missingReplyCounter, otelLogger, sessionKeyStorage;
29877
+ var import_api_logs, initialized, shutdownFn, tracer, dispatchCounter, dispatchDuration, missingReplyCounter, turnTokensCounter, turnCostCounter, otelLogger, sessionKeyStorage;
29773
29878
  var init_telemetry = __esm({
29774
29879
  "ts/agent-core/dist/telemetry.js"() {
29775
29880
  "use strict";
29776
29881
  init_esm();
29777
29882
  import_api_logs = __toESM(require_src(), 1);
29883
+ init_redact();
29778
29884
  initialized = false;
29779
29885
  shutdownFn = null;
29780
29886
  tracer = null;
29781
29887
  dispatchCounter = null;
29782
29888
  dispatchDuration = null;
29783
29889
  missingReplyCounter = null;
29890
+ turnTokensCounter = null;
29891
+ turnCostCounter = null;
29784
29892
  otelLogger = null;
29785
29893
  sessionKeyStorage = new AsyncLocalStorage();
29786
29894
  }
@@ -29797,6 +29905,7 @@ var init_gateway_base = __esm({
29797
29905
  init_gateway_lane_flow();
29798
29906
  init_lane_ledger();
29799
29907
  init_routing();
29908
+ init_redact();
29800
29909
  init_step_persister();
29801
29910
  init_session_lifecycle();
29802
29911
  init_fork_session_finalizer();
@@ -54719,8 +54828,10 @@ var init_dist2 = __esm({
54719
54828
  init_prompt_fragments();
54720
54829
  init_bridge_workspace();
54721
54830
  init_dispatch_adapter();
54831
+ init_redact();
54722
54832
  init_logger();
54723
54833
  init_gateway_base();
54834
+ init_lane_ledger();
54724
54835
  init_http_keepalive();
54725
54836
  init_platform_config();
54726
54837
  init_channel_capability();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@parall/daemon",
3
- "version": "1.50.1",
3
+ "version": "1.52.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/agent-core": "1.50.1",
37
- "@parall/sdk": "1.50.1",
38
- "@parall/codex-agent": "1.50.1",
39
- "@parall/openclaw-agent": "1.50.1",
40
- "@parall/claude-agent": "1.50.1"
36
+ "@parall/agent-core": "1.52.0",
37
+ "@parall/sdk": "1.52.0",
38
+ "@parall/claude-agent": "1.52.0",
39
+ "@parall/codex-agent": "1.52.0",
40
+ "@parall/openclaw-agent": "1.52.0"
41
41
  },
42
42
  "devDependencies": {
43
43
  "@types/node": "^22.0.0",