@parall/sdk 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.
package/src/types.ts CHANGED
@@ -924,6 +924,13 @@ export interface DispatchSourceRef {
924
924
  */
925
925
  export interface CompleteDispatchSourcesRequest {
926
926
  sources: DispatchSourceRef[];
927
+ /**
928
+ * Optional session attribution for the swept no_action rows (message ↔
929
+ * session linking; effect-covered rows inherit their covering reply's
930
+ * session). Validated against (org, agent); a mismatch drops the
931
+ * attribution.
932
+ */
933
+ session_id?: string;
927
934
  }
928
935
 
929
936
  export interface CompleteDispatchSourcesResult {
@@ -3178,6 +3185,8 @@ export type DispatchEventType =
3178
3185
  | 'channel_message';
3179
3186
  export type DispatchStatus = 'pending' | 'received' | 'acked';
3180
3187
  export type DispatchDeliveryReason = 'mention' | 'watcher' | 'assignee' | 'creator';
3188
+ export type DispatchCoverageMode = 'implicit' | 'explicit';
3189
+ export type DispatchInputState = 'offered' | 'started' | 'completed' | 'failed';
3181
3190
 
3182
3191
  export interface DispatchEvent {
3183
3192
  id: string;
@@ -3212,6 +3221,7 @@ export interface DispatchEvent {
3212
3221
  */
3213
3222
  dedupe_key?: string | null;
3214
3223
  lease_owner?: string | null;
3224
+ input_state?: DispatchInputState | null;
3215
3225
  target_uri?: string | null;
3216
3226
  thread_root_id?: string | null;
3217
3227
  resolution_kind?:
@@ -3229,6 +3239,14 @@ export interface DispatchEvent {
3229
3239
  * redrive_exhausted. Absent on pre-budget servers.
3230
3240
  */
3231
3241
  redrive_count?: number;
3242
+ /**
3243
+ * Agent session that ultimately handled this WorkItem, stamped at resolve
3244
+ * time where deterministically known (reply commits + broad cover /
3245
+ * by-source contagion; complete endpoints' validated self-report).
3246
+ * NULL = unattributed: live rows, cancelled, legacy acks, typed effects
3247
+ * until their runtimes report it.
3248
+ */
3249
+ session_id?: string | null;
3232
3250
  /**
3233
3251
  * Reply-message provenance ("prll://msg_x") of the resolving Effect.
3234
3252
  * Populated only by GET /dispatch/by-messages (Effect join) on
@@ -3254,6 +3272,12 @@ export interface ClaimDispatchRequest {
3254
3272
  source_type?: string;
3255
3273
  source_id?: string;
3256
3274
  limit?: number;
3275
+ /**
3276
+ * Explicit requires the runtime to report exact per-WorkItem input
3277
+ * lifecycle before reply/no-action coverage. Omit for legacy implicit
3278
+ * fold-means-consumed behavior.
3279
+ */
3280
+ coverage_mode?: DispatchCoverageMode;
3257
3281
  }
3258
3282
 
3259
3283
  export interface ClaimDispatchResponse {
@@ -3267,6 +3291,7 @@ export interface ClaimDispatchResponse {
3267
3291
  reason?: 'held' | 'empty' | '';
3268
3292
  lane?: string;
3269
3293
  lease_until?: string;
3294
+ coverage_mode?: DispatchCoverageMode;
3270
3295
  events?: DispatchEvent[];
3271
3296
  }
3272
3297
 
@@ -3285,6 +3310,22 @@ export interface SteerDispatchResponse {
3285
3310
  dispatch_event_id: string;
3286
3311
  }
3287
3312
 
3313
+ /** POST /dispatch/input-state — advance exact explicit-lane input members. */
3314
+ export interface UpdateDispatchInputStateRequest {
3315
+ lane: string;
3316
+ target_uri: string;
3317
+ thread_root_id?: string;
3318
+ dispatch_event_ids: string[];
3319
+ state: Exclude<DispatchInputState, 'offered'>;
3320
+ }
3321
+
3322
+ export interface UpdateDispatchInputStateResponse {
3323
+ /** Exact IDs accepted, including idempotent same-state retries. */
3324
+ recognized: number;
3325
+ released: number;
3326
+ redriven: boolean;
3327
+ }
3328
+
3288
3329
  /**
3289
3330
  * POST /dispatch/complete — end a turn. Two mutually exclusive reference
3290
3331
  * forms (dispatch-convergence-design.md §3), each with its own result shape
@@ -3301,13 +3342,31 @@ export interface CompleteDispatchLaneRequest {
3301
3342
  target_uri: string;
3302
3343
  thread_root_id?: string;
3303
3344
  /**
3304
- * "ok" (default) or "error". An error turn's members are released back to
3305
- * pending on the redrive budget instead of being no_action-swept, so failed
3306
- * work is retried rather than silently resolved. Ignored by older servers.
3345
+ * "ok" (default), "error", or "deferred". An error turn's members are
3346
+ * released back to pending on the redrive budget instead of being
3347
+ * no_action-swept, so failed work is retried rather than silently
3348
+ * resolved. A deferred turn (self-healing LLM usage limit,
3349
+ * agent-turn-outcome-design.md §6) releases its members to pending with
3350
+ * next_redrive_at = retry_at WITHOUT burning redrive budget — the renotify
3351
+ * slow loop re-delivers them at reset time. Servers predating "deferred"
3352
+ * answer 400; the bridge falls back to "error".
3307
3353
  */
3308
- turn_outcome?: 'ok' | 'error';
3354
+ turn_outcome?: 'ok' | 'error' | 'deferred';
3355
+ /** Normalized failure class for the deferred form (observability only). */
3356
+ outcome_class?: 'usage_limit';
3357
+ /**
3358
+ * ISO 8601 re-delivery time for turn_outcome=deferred. The server clamps
3359
+ * it into [now+1min, now+6h] and defaults a missing value to now+30min.
3360
+ */
3361
+ retry_at?: string;
3309
3362
  sources?: never;
3310
3363
  dispatch_event_id?: never;
3364
+ /**
3365
+ * Optional session attribution for the swept no_action rows (message ↔
3366
+ * session linking). Validated against (org, agent); a mismatch drops the
3367
+ * attribution, never the sweep.
3368
+ */
3369
+ session_id?: string;
3311
3370
  }
3312
3371
 
3313
3372
  /**
@@ -3319,6 +3378,12 @@ export interface CompleteDispatchLaneRequest {
3319
3378
  export interface CompleteDispatchSourceFormRequest {
3320
3379
  sources: DispatchSourceRef[];
3321
3380
  turn_outcome?: 'ok' | 'error';
3381
+ /**
3382
+ * Optional session attribution for the turn's no_action rows
3383
+ * (effect-covered rows inherit their covering reply's session instead).
3384
+ * Validated against (org, agent); informational.
3385
+ */
3386
+ session_id?: string;
3322
3387
  lane?: never;
3323
3388
  target_uri?: never;
3324
3389
  thread_root_id?: never;
@@ -3346,6 +3411,8 @@ export interface CompleteDispatchByIDRequest {
3346
3411
  /** Lane-form result. */
3347
3412
  export interface CompleteDispatchResult {
3348
3413
  swept_no_action: number;
3414
+ /** Members not eligible for no-action coverage and released for retry. */
3415
+ released?: number;
3349
3416
  redriven: boolean;
3350
3417
  }
3351
3418
 
@@ -3386,9 +3453,10 @@ export interface DispatchReceivedData {
3386
3453
  /**
3387
3454
  * Terminal counterpart of DispatchReceivedData: published on org:{orgId} when
3388
3455
  * a message WorkItem reaches a terminal resolution, so the message-level
3389
- * Activity indicator flips active→done (or clears, for `cancelled` /
3390
- * `redrive_exhausted`) without inferring completion from agent session state.
3391
- * Message WorkItems only.
3456
+ * Activity indicator flips active→done or, per indicator v2.1, active→failed
3457
+ * for `redrive_exhausted` (persistent dead-letter row); only `cancelled`
3458
+ * clears the indicator — without inferring completion from agent session
3459
+ * state. Message WorkItems only.
3392
3460
  */
3393
3461
  export interface DispatchResolvedData {
3394
3462
  agent_id: string;
@@ -3404,6 +3472,12 @@ export interface DispatchResolvedData {
3404
3472
  * message. Absent for no_action / legacy_ack.
3405
3473
  */
3406
3474
  result_uri?: string | null;
3475
+ /**
3476
+ * Session attribution mirrored from the resolved rows — lets the
3477
+ * indicator's click-through open the exact session without a refetch.
3478
+ * Absent when the resolution is unattributed.
3479
+ */
3480
+ session_id?: string | null;
3407
3481
  }
3408
3482
 
3409
3483
  export type InboxNewData = InboxItem;
@@ -4675,6 +4749,56 @@ export interface ClipConnection {
4675
4749
  updated_at: string;
4676
4750
  }
4677
4751
 
4752
+ /** v1 MCP clip auth modes. Server-side OAuth is a designed follow-up. */
4753
+ export type MCPAuthType = 'none' | 'bearer' | 'api_key';
4754
+
4755
+ /**
4756
+ * One tool from the cached tools/list snapshot. The full remote tool object is
4757
+ * snapshotted verbatim (inputSchema etc. ride along in the index signature).
4758
+ * Name/description are REMOTE-CONTROLLED UNTRUSTED TEXT — render as plain text
4759
+ * only, never as markdown/HTML and never into a privileged prompt.
4760
+ */
4761
+ export interface MCPToolInfo {
4762
+ name: string;
4763
+ description?: string;
4764
+ [key: string]: unknown;
4765
+ }
4766
+
4767
+ /**
4768
+ * Redacted MCP server config of an MCP clip
4769
+ * (`GET /orgs/{orgId}/clip-registry/{clipId}/mcp-config`). The whole
4770
+ * mcp-config family is publisher-org only: cross-org installs get
4771
+ * `403 MCP_CROSS_ORG_DISABLED`, reads included. The stored credential NEVER
4772
+ * appears in any response — `credential_set` is the only credential fact.
4773
+ */
4774
+ export interface MCPConfigResponse {
4775
+ server_url: string;
4776
+ auth_type: MCPAuthType;
4777
+ /** Whether a credential is stored (write-only; the value is never returned). */
4778
+ credential_set: boolean;
4779
+ /** Cached tools/list snapshot; untrusted remote metadata (see MCPToolInfo). */
4780
+ tools?: MCPToolInfo[];
4781
+ tools_refreshed_at?: string;
4782
+ /**
4783
+ * Opaque CAS token for If-Match on PUT/DELETE (lost-update protection).
4784
+ * Version mismatch answers `409 MCP_CONFIG_STALE`.
4785
+ */
4786
+ version: string;
4787
+ }
4788
+
4789
+ /**
4790
+ * PUT body for the MCP config. Credential semantics (server-enforced):
4791
+ * omitted keeps the stored one ONLY while auth_type is unchanged; switching
4792
+ * credentialed types requires a new credential; auth_type "none" clears it.
4793
+ * Saving probes the server (initialize + tools/list) first — a failed probe
4794
+ * persists nothing.
4795
+ */
4796
+ export interface MCPConfigPutRequest {
4797
+ server_url: string;
4798
+ auth_type: MCPAuthType;
4799
+ credential?: string;
4800
+ }
4801
+
4678
4802
  /**
4679
4803
  * A clip in the api-server org registry (`crg_…`, table `clip_registry`) — the
4680
4804
  * v3 registry that install and clip connections operate on. Distinct from