@parall/sdk 1.45.0 → 1.47.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
@@ -1861,6 +1861,29 @@ export interface WikiAnchorStatusResponse {
1861
1861
  results: WikiAnchorStatus[];
1862
1862
  }
1863
1863
 
1864
+ export interface WikiAnchorResolveRequest {
1865
+ targets: string[];
1866
+ }
1867
+
1868
+ export type WikiAnchorResolveState = 'attached' | 'detached' | 'file_missing' | 'unknown';
1869
+
1870
+ export interface WikiAnchorResolveRange {
1871
+ start: number;
1872
+ end: number;
1873
+ }
1874
+
1875
+ export interface WikiAnchorResolveResult {
1876
+ target_uri: string;
1877
+ state: WikiAnchorResolveState;
1878
+ current?: WikiAnchorResolveRange;
1879
+ origin_quote?: string;
1880
+ }
1881
+
1882
+ export interface WikiAnchorResolveResponse {
1883
+ head_rev: string;
1884
+ results: WikiAnchorResolveResult[];
1885
+ }
1886
+
1864
1887
  export interface WikiRefsCheckResponse {
1865
1888
  wiki_id: string;
1866
1889
  wiki_slug: string;
@@ -2408,12 +2431,15 @@ export interface Comment {
2408
2431
  id: string;
2409
2432
  org_id: string;
2410
2433
  target_uri: string;
2434
+ target_quote?: string | null;
2411
2435
  parent_id?: string | null;
2412
2436
  author_id: string;
2413
2437
  body: string;
2414
2438
  mentions?: Mention[];
2415
2439
  hints?: MessageHints | null;
2416
2440
  agent_step_id?: string | null;
2441
+ resolved_at?: string | null;
2442
+ resolved_by_id?: string | null;
2417
2443
  created_at: string;
2418
2444
  updated_at: string;
2419
2445
  author?: User;
@@ -2421,6 +2447,7 @@ export interface Comment {
2421
2447
 
2422
2448
  export interface CreateCommentRequest {
2423
2449
  target_uri: string;
2450
+ target_quote?: string;
2424
2451
  body: string;
2425
2452
  parent_id?: string;
2426
2453
  }
@@ -2508,15 +2535,27 @@ export interface ChannelConnection {
2508
2535
  ingress_url?: string;
2509
2536
  /** Returned once at mint time (create / token regeneration). */
2510
2537
  ingress_token?: string;
2538
+ /**
2539
+ * The in-product scope-upgrade re-auth can act on this connection
2540
+ * (slack, active, provisioned-family — its auth_config carries the
2541
+ * OAuth client). Mirrors the upgrade endpoint's preconditions exactly.
2542
+ * Manual-family connections upgrade via the Slack console; the UI
2543
+ * hides the upgrade CTA when this is false/absent.
2544
+ */
2545
+ upgrade_eligible?: boolean;
2511
2546
  created_at: string;
2512
2547
  updated_at: string;
2513
2548
  }
2514
2549
 
2515
2550
  export interface ChannelCredentialsInput {
2516
- app_id: string;
2517
- app_secret: string;
2551
+ /** Feishu fields. */
2552
+ app_id?: string;
2553
+ app_secret?: string;
2518
2554
  verification_token?: string;
2519
2555
  encrypt_key?: string;
2556
+ /** Slack fields (webhook-only: the signing secret is the verifier). */
2557
+ bot_token?: string;
2558
+ signing_secret?: string;
2520
2559
  team_id?: string;
2521
2560
  }
2522
2561
 
@@ -2566,10 +2605,13 @@ export interface ChannelMessage {
2566
2605
  }
2567
2606
 
2568
2607
  /**
2569
- * Feishu one-click provisioning session (OAuth device flow). The client
2570
- * renders `verification_url` as a QR code and lazily polls the status
2571
- * endpoint every `poll_interval_seconds` each poll may forward one
2572
- * provider poll server-side, so respect the interval.
2608
+ * One-click provisioning session. Provider-specific shape:
2609
+ * - feishu (OAuth device flow): render `verification_url` as a QR code;
2610
+ * each status poll may forward one provider poll server-side, so respect
2611
+ * `poll_interval_seconds`.
2612
+ * - slack (manifest + OAuth install): `verification_url` is the authorize
2613
+ * link to open; status polls are pure state reads (completion is pushed
2614
+ * by the OAuth callback).
2573
2615
  */
2574
2616
  export type ChannelProvisioningStatus =
2575
2617
  | 'pending'
@@ -2595,14 +2637,166 @@ export interface ChannelProvisioningSession {
2595
2637
  expires_at: string;
2596
2638
  created_at: string;
2597
2639
  updated_at: string;
2598
- /** QR target — present on live (pending/polling) sessions only. */
2640
+ /**
2641
+ * Provisioning target — present on live (pending/polling) sessions only.
2642
+ * feishu: the QR-code content; slack: the OAuth authorize link.
2643
+ */
2599
2644
  verification_url?: string;
2645
+ /** feishu only. */
2600
2646
  user_code?: string;
2601
2647
  }
2602
2648
 
2603
- export interface InitiateChannelProvisioningInput {
2604
- agent_id: string;
2605
- provider: ChannelProvider;
2649
+ /**
2650
+ * Discriminated on `provider`: slack REQUIRES the config token (the server
2651
+ * 400s without it), other providers have no such field — the union makes a
2652
+ * token-less slack initiate unrepresentable at compile time.
2653
+ */
2654
+ export type InitiateChannelProvisioningInput =
2655
+ | {
2656
+ agent_id: string;
2657
+ provider: 'slack';
2658
+ /**
2659
+ * The short-lived app-configuration token (12h, generated at
2660
+ * api.slack.com/apps). Transits once into apps.manifest.create/update
2661
+ * and is never stored.
2662
+ */
2663
+ config_token: string;
2664
+ /**
2665
+ * Scope-upgrade re-auth: converge the agent's EXISTING active
2666
+ * connection's app on the current manifest and re-authorize it (bot
2667
+ * token replaced in place, app id preserved) instead of creating a
2668
+ * new app.
2669
+ */
2670
+ upgrade?: boolean;
2671
+ }
2672
+ | {
2673
+ agent_id: string;
2674
+ provider: Exclude<ChannelProvider, 'slack'>;
2675
+ };
2676
+
2677
+ /**
2678
+ * Manifest-prefill link for the guided manual slack path: the platform
2679
+ * mints a pending connection and returns an api.slack.com link that opens
2680
+ * the create-app form with everything preset (events, scopes, this
2681
+ * connection's webhook URL). The user installs the app themselves and
2682
+ * activates the SAME connection by delivering bot token + signing secret.
2683
+ */
2684
+ export interface SlackManifestLinkResult {
2685
+ connection_id: string;
2686
+ manifest_url: string;
2687
+ }
2688
+
2689
+ /**
2690
+ * Tier-B platform verb request (agent-only): send as the bound bot.
2691
+ * Deliberately narrowed to 'slack' — the verb surface is per-vendor
2692
+ * (feishu outbound is the lark-cli broker, not this endpoint), so a
2693
+ * generic ChannelProvider here would compile call sites that always 400.
2694
+ */
2695
+ export interface SendChannelMessageInput {
2696
+ channel_type: 'slack';
2697
+ /** Vendor-native conversation id from the inbound event (e.g. C…/D…). */
2698
+ conversation_id: string;
2699
+ /**
2700
+ * External message id being answered (channel-domain format:
2701
+ * `{channel}:{ts}`, thread children `{channel}:{root}#{ts}`). REQUIRED
2702
+ * for channel conversations (the reply lands in that message's thread).
2703
+ * In DMs the SESSION never forks, but reply POSITION follows the
2704
+ * question: a thread-child id lands the reply inside that thread, a
2705
+ * bare id (or omitting the field) keeps the flattened main flow.
2706
+ */
2707
+ reply_to?: string;
2708
+ text: string;
2709
+ }
2710
+
2711
+ export interface SentChannelMessage {
2712
+ channel_type: 'slack';
2713
+ conversation_id: string;
2714
+ /**
2715
+ * Channel-domain external id — `{channel}:{ts}` for top-level posts,
2716
+ * `{channel}:{root}#{ts}` when the reply landed inside a thread — usable
2717
+ * directly as a future reply_to.
2718
+ */
2719
+ message_id: string;
2720
+ thread_anchor?: string;
2721
+ sent_at: string;
2722
+ }
2723
+
2724
+ /**
2725
+ * Tier-B read verbs (agent-only): workspace visibility as the bot sees it.
2726
+ * Authorization is the bot's own Slack permissions (invite the bot to a
2727
+ * channel to make its history readable) — reads have no external side
2728
+ * effect, so the seen-conversation restriction of the send verb does not
2729
+ * apply. Cursor pagination follows Slack's contract (empty = last page).
2730
+ */
2731
+ export interface SlackChannelInfo {
2732
+ id: string;
2733
+ name: string;
2734
+ is_private: boolean;
2735
+ is_member: boolean;
2736
+ num_members?: number;
2737
+ topic?: string;
2738
+ }
2739
+
2740
+ export interface SlackChannelsPage {
2741
+ channels: SlackChannelInfo[];
2742
+ next_cursor?: string;
2743
+ }
2744
+
2745
+ export interface SlackUserInfo {
2746
+ id: string;
2747
+ name: string;
2748
+ real_name?: string;
2749
+ is_bot: boolean;
2750
+ deleted?: boolean;
2751
+ }
2752
+
2753
+ export interface SlackUsersPage {
2754
+ users: SlackUserInfo[];
2755
+ next_cursor?: string;
2756
+ }
2757
+
2758
+ export interface SlackHistoryMessage {
2759
+ /**
2760
+ * Synthesized channel-domain id — `{conversation}:{ts}`, or
2761
+ * `{conversation}:{root}#{ts}` for thread children — directly usable as
2762
+ * the send verb's `reply_to` (no client-side root#child derivation).
2763
+ */
2764
+ message_id: string;
2765
+ ts: string;
2766
+ thread_ts?: string;
2767
+ user?: string;
2768
+ bot_id?: string;
2769
+ text: string;
2770
+ }
2771
+
2772
+ export interface SlackHistoryPage {
2773
+ messages: SlackHistoryMessage[];
2774
+ next_cursor?: string;
2775
+ }
2776
+
2777
+ export interface SlackMembersPage {
2778
+ /** Bare Slack user ids — resolve display names via the users verb. */
2779
+ members: string[];
2780
+ next_cursor?: string;
2781
+ }
2782
+
2783
+ /**
2784
+ * Slack-native pagination for the read verbs. Filters are deliberately
2785
+ * FIXED server-side (channels: public+private, archived excluded) — the
2786
+ * public contract is cursor/limit only; widening it is a deliberate scope
2787
+ * decision, not a missing passthrough.
2788
+ */
2789
+ export interface SlackReadPageQuery {
2790
+ cursor?: string;
2791
+ limit?: number;
2792
+ }
2793
+
2794
+ /** Agents-pane "typing…" indicator for one assistant thread (empty status clears). */
2795
+ export interface SlackStatusInput {
2796
+ conversation: string;
2797
+ /** The assistant thread's root ts. */
2798
+ thread_ts: string;
2799
+ status?: string;
2606
2800
  }
2607
2801
 
2608
2802
  // ============================================================
@@ -3099,6 +3293,8 @@ export interface ResolvedRef {
3099
3293
  resolved_rev?: string;
3100
3294
  line_start?: number;
3101
3295
  line_end?: number;
3296
+ text_start?: number;
3297
+ text_end?: number;
3102
3298
  heading_path?: string[];
3103
3299
  symbol_name?: string;
3104
3300
 
@@ -3915,6 +4111,30 @@ export interface SearchResponse {
3915
4111
  // Edge Device Types
3916
4112
  // ============================================================
3917
4113
 
4114
+ /**
4115
+ * Where an Edge device runs — and, consequently, who it belongs to.
4116
+ *
4117
+ * - `byoc` — the user's own computer running Parall Clip. Owner-only in every
4118
+ * sense: only the owner connects it, manages it, or executes on it.
4119
+ * - `hosted` — a platform-managed Cloud Profile. The browser login it holds is an
4120
+ * ORG-SHARED credential maintained by its creator. Members and agents
4121
+ * execute against it ONLY through a clip connection its maintainer
4122
+ * bound; there is no implicit route to a hosted device.
4123
+ */
4124
+ export type EdgePlacement = 'byoc' | 'hosted';
4125
+
4126
+ /**
4127
+ * Lifecycle of a hosted Cloud Profile. Only the states the server can PROVE without
4128
+ * the runtime fence are emitted today; the fence-aware ones (`starting` / `online` /
4129
+ * `busy`) arrive with the controller.
4130
+ *
4131
+ * - `idle` — no pod running (and none requested). Creating a profile starts nothing.
4132
+ * - `deleting` — delete requested; the finalizer (pod drain, S3 state purge) is still
4133
+ * running. Deletion is async and idempotent, so this can persist for
4134
+ * several minutes.
4135
+ */
4136
+ export type EdgeHostedState = 'idle' | 'deleting';
4137
+
3918
4138
  export interface EdgeDevice {
3919
4139
  id: string;
3920
4140
  org_id: string;
@@ -3924,6 +4144,23 @@ export interface EdgeDevice {
3924
4144
  last_seen_at?: string;
3925
4145
  created_at: string;
3926
4146
  updated_at: string;
4147
+ /** Absent on responses from a pre-D1 server; treat a missing value as 'byoc'. */
4148
+ placement?: EdgePlacement;
4149
+ /** Hosted devices only. */
4150
+ hosted_state?: EdgeHostedState;
4151
+ /**
4152
+ * Whether THIS caller may sign into / rebind / delete this device
4153
+ * (hosted: human maintainer ∨ human org admin; byoc: owner). Server-computed, so a
4154
+ * client can render management affordances without reimplementing the rule and
4155
+ * drifting from it.
4156
+ */
4157
+ can_manage?: boolean;
4158
+ /**
4159
+ * True for hosted devices: clips bound to it by its maintainer may be run by other
4160
+ * org members and agents. Surface this before anyone signs in — the login being
4161
+ * shared with the whole org is the product contract, not a footnote.
4162
+ */
4163
+ shared?: boolean;
3927
4164
  }
3928
4165
 
3929
4166
  export interface EdgeBrowserProfile {
@@ -3948,10 +4185,22 @@ export interface ClipConnection {
3948
4185
  updated_at: string;
3949
4186
  }
3950
4187
 
4188
+ /**
4189
+ * Two INDEPENDENT onboarding journeys. The original fields mean what they always
4190
+ * meant — "has this org set up the desktop journey?" — and hosted-backed state
4191
+ * never counts toward them, so a Cloud Profile cannot make desktop onboarding look
4192
+ * finished and tell the user to skip installing the app they still need. Precisely:
4193
+ * device-backed fields are scoped to live `placement='byoc'` edges;
4194
+ * `connection_created` additionally counts device-less MCP bindings (MCP has no
4195
+ * device and predates hosted). The `hosted_*` fields are the second journey;
4196
+ * neither impersonates the other.
4197
+ */
3951
4198
  export interface EdgeOnboardingStatus {
3952
4199
  device_registered: boolean;
3953
4200
  device_online: boolean;
3954
4201
  clip_installed: boolean;
3955
4202
  connection_created: boolean;
3956
4203
  profile_created: boolean;
4204
+ hosted_profile_created?: boolean;
4205
+ hosted_connection_created?: boolean;
3957
4206
  }