@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/dist/types.d.ts CHANGED
@@ -754,6 +754,13 @@ export interface DispatchSourceRef {
754
754
  */
755
755
  export interface CompleteDispatchSourcesRequest {
756
756
  sources: DispatchSourceRef[];
757
+ /**
758
+ * Optional session attribution for the swept no_action rows (message ↔
759
+ * session linking; effect-covered rows inherit their covering reply's
760
+ * session). Validated against (org, agent); a mismatch drops the
761
+ * attribution.
762
+ */
763
+ session_id?: string;
757
764
  }
758
765
  export interface CompleteDispatchSourcesResult {
759
766
  resolved_effect: number;
@@ -2588,6 +2595,8 @@ export interface SlackStatusInput {
2588
2595
  export type DispatchEventType = 'message' | 'task_assign' | 'task_update' | 'task_comment' | 'wiki_comment' | 'schedule.fire' | 'external_trigger' | 'approval_decided' | 'channel_message';
2589
2596
  export type DispatchStatus = 'pending' | 'received' | 'acked';
2590
2597
  export type DispatchDeliveryReason = 'mention' | 'watcher' | 'assignee' | 'creator';
2598
+ export type DispatchCoverageMode = 'implicit' | 'explicit';
2599
+ export type DispatchInputState = 'offered' | 'started' | 'completed' | 'failed';
2591
2600
  export interface DispatchEvent {
2592
2601
  id: string;
2593
2602
  org_id: string;
@@ -2621,6 +2630,7 @@ export interface DispatchEvent {
2621
2630
  */
2622
2631
  dedupe_key?: string | null;
2623
2632
  lease_owner?: string | null;
2633
+ input_state?: DispatchInputState | null;
2624
2634
  target_uri?: string | null;
2625
2635
  thread_root_id?: string | null;
2626
2636
  resolution_kind?: 'effect' | 'no_action' | 'cancelled' | 'legacy_ack' | 'redrive_exhausted' | null;
@@ -2632,6 +2642,14 @@ export interface DispatchEvent {
2632
2642
  * redrive_exhausted. Absent on pre-budget servers.
2633
2643
  */
2634
2644
  redrive_count?: number;
2645
+ /**
2646
+ * Agent session that ultimately handled this WorkItem, stamped at resolve
2647
+ * time where deterministically known (reply commits + broad cover /
2648
+ * by-source contagion; complete endpoints' validated self-report).
2649
+ * NULL = unattributed: live rows, cancelled, legacy acks, typed effects
2650
+ * until their runtimes report it.
2651
+ */
2652
+ session_id?: string | null;
2635
2653
  /**
2636
2654
  * Reply-message provenance ("prll://msg_x") of the resolving Effect.
2637
2655
  * Populated only by GET /dispatch/by-messages (Effect join) on
@@ -2656,6 +2674,12 @@ export interface ClaimDispatchRequest {
2656
2674
  source_type?: string;
2657
2675
  source_id?: string;
2658
2676
  limit?: number;
2677
+ /**
2678
+ * Explicit requires the runtime to report exact per-WorkItem input
2679
+ * lifecycle before reply/no-action coverage. Omit for legacy implicit
2680
+ * fold-means-consumed behavior.
2681
+ */
2682
+ coverage_mode?: DispatchCoverageMode;
2659
2683
  }
2660
2684
  export interface ClaimDispatchResponse {
2661
2685
  claimed: boolean;
@@ -2668,6 +2692,7 @@ export interface ClaimDispatchResponse {
2668
2692
  reason?: 'held' | 'empty' | '';
2669
2693
  lane?: string;
2670
2694
  lease_until?: string;
2695
+ coverage_mode?: DispatchCoverageMode;
2671
2696
  events?: DispatchEvent[];
2672
2697
  }
2673
2698
  /** POST /dispatch/steer — fold a pending same-target WorkItem into a live lane. */
@@ -2683,6 +2708,20 @@ export interface SteerDispatchRequest {
2683
2708
  export interface SteerDispatchResponse {
2684
2709
  dispatch_event_id: string;
2685
2710
  }
2711
+ /** POST /dispatch/input-state — advance exact explicit-lane input members. */
2712
+ export interface UpdateDispatchInputStateRequest {
2713
+ lane: string;
2714
+ target_uri: string;
2715
+ thread_root_id?: string;
2716
+ dispatch_event_ids: string[];
2717
+ state: Exclude<DispatchInputState, 'offered'>;
2718
+ }
2719
+ export interface UpdateDispatchInputStateResponse {
2720
+ /** Exact IDs accepted, including idempotent same-state retries. */
2721
+ recognized: number;
2722
+ released: number;
2723
+ redriven: boolean;
2724
+ }
2686
2725
  /**
2687
2726
  * POST /dispatch/complete — end a turn. Two mutually exclusive reference
2688
2727
  * forms (dispatch-convergence-design.md §3), each with its own result shape
@@ -2695,13 +2734,31 @@ export interface CompleteDispatchLaneRequest {
2695
2734
  target_uri: string;
2696
2735
  thread_root_id?: string;
2697
2736
  /**
2698
- * "ok" (default) or "error". An error turn's members are released back to
2699
- * pending on the redrive budget instead of being no_action-swept, so failed
2700
- * work is retried rather than silently resolved. Ignored by older servers.
2737
+ * "ok" (default), "error", or "deferred". An error turn's members are
2738
+ * released back to pending on the redrive budget instead of being
2739
+ * no_action-swept, so failed work is retried rather than silently
2740
+ * resolved. A deferred turn (self-healing LLM usage limit,
2741
+ * agent-turn-outcome-design.md §6) releases its members to pending with
2742
+ * next_redrive_at = retry_at WITHOUT burning redrive budget — the renotify
2743
+ * slow loop re-delivers them at reset time. Servers predating "deferred"
2744
+ * answer 400; the bridge falls back to "error".
2701
2745
  */
2702
- turn_outcome?: 'ok' | 'error';
2746
+ turn_outcome?: 'ok' | 'error' | 'deferred';
2747
+ /** Normalized failure class for the deferred form (observability only). */
2748
+ outcome_class?: 'usage_limit';
2749
+ /**
2750
+ * ISO 8601 re-delivery time for turn_outcome=deferred. The server clamps
2751
+ * it into [now+1min, now+6h] and defaults a missing value to now+30min.
2752
+ */
2753
+ retry_at?: string;
2703
2754
  sources?: never;
2704
2755
  dispatch_event_id?: never;
2756
+ /**
2757
+ * Optional session attribution for the swept no_action rows (message ↔
2758
+ * session linking). Validated against (org, agent); a mismatch drops the
2759
+ * attribution, never the sweep.
2760
+ */
2761
+ session_id?: string;
2705
2762
  }
2706
2763
  /**
2707
2764
  * Source form: the lane-less close for runtimes without a resident process —
@@ -2712,6 +2769,12 @@ export interface CompleteDispatchLaneRequest {
2712
2769
  export interface CompleteDispatchSourceFormRequest {
2713
2770
  sources: DispatchSourceRef[];
2714
2771
  turn_outcome?: 'ok' | 'error';
2772
+ /**
2773
+ * Optional session attribution for the turn's no_action rows
2774
+ * (effect-covered rows inherit their covering reply's session instead).
2775
+ * Validated against (org, agent); informational.
2776
+ */
2777
+ session_id?: string;
2715
2778
  lane?: never;
2716
2779
  target_uri?: never;
2717
2780
  thread_root_id?: never;
@@ -2737,6 +2800,8 @@ export interface CompleteDispatchByIDRequest {
2737
2800
  /** Lane-form result. */
2738
2801
  export interface CompleteDispatchResult {
2739
2802
  swept_no_action: number;
2803
+ /** Members not eligible for no-action coverage and released for retry. */
2804
+ released?: number;
2740
2805
  redriven: boolean;
2741
2806
  }
2742
2807
  /** Source-form result (mirrors CompleteDispatchSourcesResult). */
@@ -2771,9 +2836,10 @@ export interface DispatchReceivedData {
2771
2836
  /**
2772
2837
  * Terminal counterpart of DispatchReceivedData: published on org:{orgId} when
2773
2838
  * a message WorkItem reaches a terminal resolution, so the message-level
2774
- * Activity indicator flips active→done (or clears, for `cancelled` /
2775
- * `redrive_exhausted`) without inferring completion from agent session state.
2776
- * Message WorkItems only.
2839
+ * Activity indicator flips active→done or, per indicator v2.1, active→failed
2840
+ * for `redrive_exhausted` (persistent dead-letter row); only `cancelled`
2841
+ * clears the indicator — without inferring completion from agent session
2842
+ * state. Message WorkItems only.
2777
2843
  */
2778
2844
  export interface DispatchResolvedData {
2779
2845
  agent_id: string;
@@ -2789,6 +2855,12 @@ export interface DispatchResolvedData {
2789
2855
  * message. Absent for no_action / legacy_ack.
2790
2856
  */
2791
2857
  result_uri?: string | null;
2858
+ /**
2859
+ * Session attribution mirrored from the resolved rows — lets the
2860
+ * indicator's click-through open the exact session without a refetch.
2861
+ * Absent when the resolution is unattributed.
2862
+ */
2863
+ session_id?: string | null;
2792
2864
  }
2793
2865
  export type InboxNewData = InboxItem;
2794
2866
  export interface InboxUpdateData {
@@ -3882,6 +3954,52 @@ export interface ClipConnection {
3882
3954
  created_at: string;
3883
3955
  updated_at: string;
3884
3956
  }
3957
+ /** v1 MCP clip auth modes. Server-side OAuth is a designed follow-up. */
3958
+ export type MCPAuthType = 'none' | 'bearer' | 'api_key';
3959
+ /**
3960
+ * One tool from the cached tools/list snapshot. The full remote tool object is
3961
+ * snapshotted verbatim (inputSchema etc. ride along in the index signature).
3962
+ * Name/description are REMOTE-CONTROLLED UNTRUSTED TEXT — render as plain text
3963
+ * only, never as markdown/HTML and never into a privileged prompt.
3964
+ */
3965
+ export interface MCPToolInfo {
3966
+ name: string;
3967
+ description?: string;
3968
+ [key: string]: unknown;
3969
+ }
3970
+ /**
3971
+ * Redacted MCP server config of an MCP clip
3972
+ * (`GET /orgs/{orgId}/clip-registry/{clipId}/mcp-config`). The whole
3973
+ * mcp-config family is publisher-org only: cross-org installs get
3974
+ * `403 MCP_CROSS_ORG_DISABLED`, reads included. The stored credential NEVER
3975
+ * appears in any response — `credential_set` is the only credential fact.
3976
+ */
3977
+ export interface MCPConfigResponse {
3978
+ server_url: string;
3979
+ auth_type: MCPAuthType;
3980
+ /** Whether a credential is stored (write-only; the value is never returned). */
3981
+ credential_set: boolean;
3982
+ /** Cached tools/list snapshot; untrusted remote metadata (see MCPToolInfo). */
3983
+ tools?: MCPToolInfo[];
3984
+ tools_refreshed_at?: string;
3985
+ /**
3986
+ * Opaque CAS token for If-Match on PUT/DELETE (lost-update protection).
3987
+ * Version mismatch answers `409 MCP_CONFIG_STALE`.
3988
+ */
3989
+ version: string;
3990
+ }
3991
+ /**
3992
+ * PUT body for the MCP config. Credential semantics (server-enforced):
3993
+ * omitted keeps the stored one ONLY while auth_type is unchanged; switching
3994
+ * credentialed types requires a new credential; auth_type "none" clears it.
3995
+ * Saving probes the server (initialize + tools/list) first — a failed probe
3996
+ * persists nothing.
3997
+ */
3998
+ export interface MCPConfigPutRequest {
3999
+ server_url: string;
4000
+ auth_type: MCPAuthType;
4001
+ credential?: string;
4002
+ }
3885
4003
  /**
3886
4004
  * A clip in the api-server org registry (`crg_…`, table `clip_registry`) — the
3887
4005
  * v3 registry that install and clip connections operate on. Distinct from