@parall/daemon 1.51.0 → 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`,
@@ -535,7 +536,11 @@ var init_constants = __esm({
535
536
  // Pinix Hub catalog proxy above is a different, id-less surface)
536
537
  ORG_CLIP_REGISTRY: (orgId) => `/api/v1/orgs/${orgId}/clip-registry`,
537
538
  ORG_CLIP_INSTALL: (orgId) => `/api/v1/orgs/${orgId}/clips/install`,
538
- 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`
539
544
  };
540
545
  WS_EVENTS = {
541
546
  // Client -> Server
@@ -1768,6 +1773,10 @@ var init_client = __esm({
1768
1773
  async steerDispatch(orgId, req) {
1769
1774
  return this.request("POST", ENDPOINTS.DISPATCH_STEER(orgId), req);
1770
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
+ }
1771
1780
  async completeDispatch(orgId, req) {
1772
1781
  return this.request("POST", ENDPOINTS.DISPATCH_COMPLETE(orgId), req);
1773
1782
  }
@@ -2733,12 +2742,17 @@ var init_client = __esm({
2733
2742
  * command RAN and failed — `error`/`error_code` describe why). Everything
2734
2743
  * else throws a typed {@link ApiError}; match on `err.code`:
2735
2744
  *
2736
- * Safe to retry (guaranteed nothing was dispatched):
2737
- * - `EDGE_ACTIVATING` 503 + `Retry-After` — cold cloud profile is starting.
2738
- * Bounded backoff, same `correlation_id` across the loop.
2739
- * - `EDGE_BUSY` 409the device is executing another request.
2740
- * - `EDGE_CONCURRENCY_LIMIT` 429 org at its concurrent-session limit.
2741
- * - `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).
2742
2756
  *
2743
2757
  * NOT retryable:
2744
2758
  * - `OUTCOME_UNKNOWN` 504 — dispatched, but no result arrived. The command
@@ -2777,6 +2791,60 @@ var init_client = __esm({
2777
2791
  async deleteClipConnection(orgId, connId) {
2778
2792
  return this.request("DELETE", ENDPOINTS.CLIP_CONNECTION(orgId, connId));
2779
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
+ }
2780
2848
  };
2781
2849
  ApiError = class extends Error {
2782
2850
  status;
@@ -3159,6 +3227,13 @@ var init_dist = __esm({
3159
3227
  }
3160
3228
  });
3161
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
+
3162
3237
  // ts/agent-core/dist/lane-ledger.js
3163
3238
  var init_lane_ledger = __esm({
3164
3239
  "ts/agent-core/dist/lane-ledger.js"() {
@@ -3174,6 +3249,7 @@ var init_gateway_lane_flow = __esm({
3174
3249
  "ts/agent-core/dist/gateway-lane-flow.js"() {
3175
3250
  "use strict";
3176
3251
  init_dist();
3252
+ init_event_format();
3177
3253
  init_lane_ledger();
3178
3254
  TYPED_BACKOFF_CAP_MS = 5 * 6e4;
3179
3255
  }
@@ -3193,13 +3269,6 @@ var init_routing = __esm({
3193
3269
  }
3194
3270
  });
3195
3271
 
3196
- // ts/agent-core/dist/event-format.js
3197
- var init_event_format = __esm({
3198
- "ts/agent-core/dist/event-format.js"() {
3199
- "use strict";
3200
- }
3201
- });
3202
-
3203
3272
  // ts/agent-core/dist/prompt-fragments.js
3204
3273
  var init_prompt_fragments = __esm({
3205
3274
  "ts/agent-core/dist/prompt-fragments.js"() {
@@ -3221,6 +3290,13 @@ var init_dispatch_adapter = __esm({
3221
3290
  }
3222
3291
  });
3223
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
+
3224
3300
  // ts/agent-core/dist/logger.js
3225
3301
  function createLogger(prefix) {
3226
3302
  return {
@@ -29740,6 +29816,12 @@ async function initAgentTelemetry(serviceName, runtimeType) {
29740
29816
  missingReplyCounter = meter.createCounter("parall.dispatch.missing_reply", {
29741
29817
  description: "Dispatches where agent produced text but sent no reply message"
29742
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
+ });
29743
29825
  initialized = true;
29744
29826
  shutdownFn = async () => {
29745
29827
  await tracerProvider.forceFlush();
@@ -29792,18 +29874,21 @@ function createOtelLogger(layer, prefix) {
29792
29874
  child: (sub) => createOtelLogger(layer, `${prefix}:${sub}`)
29793
29875
  };
29794
29876
  }
29795
- 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;
29796
29878
  var init_telemetry = __esm({
29797
29879
  "ts/agent-core/dist/telemetry.js"() {
29798
29880
  "use strict";
29799
29881
  init_esm();
29800
29882
  import_api_logs = __toESM(require_src(), 1);
29883
+ init_redact();
29801
29884
  initialized = false;
29802
29885
  shutdownFn = null;
29803
29886
  tracer = null;
29804
29887
  dispatchCounter = null;
29805
29888
  dispatchDuration = null;
29806
29889
  missingReplyCounter = null;
29890
+ turnTokensCounter = null;
29891
+ turnCostCounter = null;
29807
29892
  otelLogger = null;
29808
29893
  sessionKeyStorage = new AsyncLocalStorage();
29809
29894
  }
@@ -29820,6 +29905,7 @@ var init_gateway_base = __esm({
29820
29905
  init_gateway_lane_flow();
29821
29906
  init_lane_ledger();
29822
29907
  init_routing();
29908
+ init_redact();
29823
29909
  init_step_persister();
29824
29910
  init_session_lifecycle();
29825
29911
  init_fork_session_finalizer();
@@ -54742,8 +54828,10 @@ var init_dist2 = __esm({
54742
54828
  init_prompt_fragments();
54743
54829
  init_bridge_workspace();
54744
54830
  init_dispatch_adapter();
54831
+ init_redact();
54745
54832
  init_logger();
54746
54833
  init_gateway_base();
54834
+ init_lane_ledger();
54747
54835
  init_http_keepalive();
54748
54836
  init_platform_config();
54749
54837
  init_channel_capability();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@parall/daemon",
3
- "version": "1.51.0",
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/sdk": "1.51.0",
37
- "@parall/claude-agent": "1.51.0",
38
- "@parall/agent-core": "1.51.0",
39
- "@parall/codex-agent": "1.51.0",
40
- "@parall/openclaw-agent": "1.51.0"
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",