@parall/sdk 1.52.1 → 1.52.2

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
@@ -2878,7 +2878,7 @@ export interface InboxItem {
2878
2878
  // External IM Channel Types (platform-mediated Feishu/Slack channel)
2879
2879
  // ============================================================
2880
2880
 
2881
- export type ChannelProvider = 'feishu' | 'slack';
2881
+ export type ChannelProvider = 'feishu' | 'slack' | 'wechat';
2882
2882
  export type ChannelConnectionStatus = 'pending' | 'active' | 'disabled';
2883
2883
  /**
2884
2884
  * Inbound transport for a connection. Defaults to the provider's lowest-
@@ -2913,6 +2913,9 @@ export interface ChannelConnection {
2913
2913
  * hides the upgrade CTA when this is false/absent.
2914
2914
  */
2915
2915
  upgrade_eligible?: boolean;
2916
+ /** Set when the provider reported the device node offline (wechat Offline
2917
+ * event) — the connection stays active but needs a vendor-side re-login. */
2918
+ last_offline_at?: string | null;
2916
2919
  created_at: string;
2917
2920
  updated_at: string;
2918
2921
  }
@@ -2926,6 +2929,8 @@ export interface ChannelCredentialsInput {
2926
2929
  /** Slack fields (webhook-only: the signing secret is the verifier). */
2927
2930
  bot_token?: string;
2928
2931
  signing_secret?: string;
2932
+ /** WeChat field (research preview): vendor API credential. */
2933
+ token?: string;
2929
2934
  team_id?: string;
2930
2935
  }
2931
2936
 
@@ -3063,8 +3068,9 @@ export interface SlackManifestLinkResult {
3063
3068
  * generic ChannelProvider here would compile call sites that always 400.
3064
3069
  */
3065
3070
  export interface SendChannelMessageInput {
3066
- channel_type: 'slack';
3067
- /** Vendor-native conversation id from the inbound event (e.g. C…/D…). */
3071
+ channel_type: 'slack' | 'wechat';
3072
+ /** Vendor-native conversation id from the inbound event (e.g. C…/D… for
3073
+ * slack, a wxid or room id for wechat). */
3068
3074
  conversation_id: string;
3069
3075
  /**
3070
3076
  * External message id being answered (channel-domain format:
@@ -3073,13 +3079,16 @@ export interface SendChannelMessageInput {
3073
3079
  * In DMs the SESSION never forks, but reply POSITION follows the
3074
3080
  * question: a thread-child id lands the reply inside that thread, a
3075
3081
  * bare id (or omitting the field) keeps the flattened main flow.
3082
+ * WeChat has no threads — omit for wechat.
3076
3083
  */
3077
3084
  reply_to?: string;
3085
+ /** WeChat-only: @-mention a group member (wxid) in a group reply. */
3086
+ at?: string;
3078
3087
  text: string;
3079
3088
  }
3080
3089
 
3081
3090
  export interface SentChannelMessage {
3082
- channel_type: 'slack';
3091
+ channel_type: 'slack' | 'wechat';
3083
3092
  conversation_id: string;
3084
3093
  /**
3085
3094
  * Channel-domain external id — `{channel}:{ts}` for top-level posts,
@@ -3112,6 +3121,13 @@ export interface SlackChannelsPage {
3112
3121
  next_cursor?: string;
3113
3122
  }
3114
3123
 
3124
+ /** WeChat address book (id lists only — the vendor returns no names). */
3125
+ export interface WechatContactsPage {
3126
+ friends: string[];
3127
+ chatrooms: string[];
3128
+ ghs: string[];
3129
+ }
3130
+
3115
3131
  export interface SlackUserInfo {
3116
3132
  id: string;
3117
3133
  name: string;
@@ -4511,32 +4527,6 @@ export interface MachineClip {
4511
4527
  browser_profile_id?: string | null;
4512
4528
  }
4513
4529
 
4514
- // Pinix registry catalog clip info (from GET /clip/v1/registry/clips,
4515
- // which proxies the public Pinix registry GET /search).
4516
- export interface RegistryCommandInfo {
4517
- name: string;
4518
- description: string;
4519
- input?: string;
4520
- output?: string;
4521
- }
4522
-
4523
- export interface RegistryDependencyInfo {
4524
- package: string;
4525
- version: string;
4526
- }
4527
-
4528
- export interface RegistryClipInfo {
4529
- name: string; // @scope/name (canonical package id)
4530
- package: string; // @scope/name (alias derivation + install source_ref)
4531
- version: string;
4532
- type: string; // registry package type (e.g. "clip")
4533
- description?: string;
4534
- domain?: string;
4535
- author?: string;
4536
- commands: RegistryCommandInfo[];
4537
- dependencies: Record<string, RegistryDependencyInfo>;
4538
- }
4539
-
4540
4530
  // Clip WS event data types
4541
4531
  export type ClipCreatedData = Clip;
4542
4532
  export type ClipUpdatedData = Clip;
@@ -4750,9 +4740,66 @@ export interface ClipConnection {
4750
4740
  updated_at: string;
4751
4741
  }
4752
4742
 
4753
- /** v1 MCP clip auth modes. Server-side OAuth is a designed follow-up. */
4743
+ /**
4744
+ * MCP clip auth modes this SDK can WRITE: the pre-shared credential kinds a
4745
+ * `PUT …/mcp-config` may set. Deliberately excludes `oauth` — an OAuth
4746
+ * connection is created by the server-brokered browser flow (PUT → authorize
4747
+ * URL → public callback), which returns a different response shape and is
4748
+ * typed separately (MCPOAuthInitiateRequest/Response). Widening this union
4749
+ * would make `putClipMCPConfig({auth_type: 'oauth'})` type-legal while its
4750
+ * declared return type is wrong. Reads use MCPConfigAuthType.
4751
+ */
4754
4752
  export type MCPAuthType = 'none' | 'bearer' | 'api_key';
4755
4753
 
4754
+ /**
4755
+ * MCP clip auth modes a config can REPORT. A config authorized through the
4756
+ * OAuth flow reads back as `oauth`, so every reader must handle it even
4757
+ * though no typed call here produces one.
4758
+ */
4759
+ export type MCPConfigAuthType = MCPAuthType | 'oauth';
4760
+
4761
+ /**
4762
+ * Connection state of an `oauth` config (server-derived, deployment-instance
4763
+ * fenced): `connected` = a valid or lazily-refreshable token; `needs_reauth` =
4764
+ * an org admin must authorize again; `disconnected` = no authorization here.
4765
+ */
4766
+ export type MCPOAuthStatus = 'connected' | 'needs_reauth' | 'disconnected';
4767
+
4768
+ /**
4769
+ * Body of the OAuth-initiating `PUT …/mcp-config`: `auth_type` is the literal
4770
+ * `'oauth'` and there is no credential field — the authorization happens in
4771
+ * the provider's browser flow. Kept apart from MCPConfigPutRequest because
4772
+ * the response is MCPOAuthInitiateResponse, not MCPConfigResponse (see the
4773
+ * MCPAuthType note).
4774
+ */
4775
+ export interface MCPOAuthInitiateRequest {
4776
+ server_url: string;
4777
+ auth_type: 'oauth';
4778
+ }
4779
+
4780
+ /**
4781
+ * Response of an OAuth-initiating PUT. Nothing is committed yet: an org
4782
+ * admin's browser must complete `authorize_url` before `expires_at`; the
4783
+ * config (and its default connection) is committed by the public callback. A
4784
+ * repeat PUT while the attempt is live returns the SAME attempt's URL.
4785
+ */
4786
+ export interface MCPOAuthInitiateResponse {
4787
+ authorize_url: string;
4788
+ expires_at: string;
4789
+ }
4790
+
4791
+ /**
4792
+ * Response of `POST …/mcp-config/oauth/disconnect` (If-Match mandatory).
4793
+ * `revoked: false` means the provider-side grant may still exist and can need
4794
+ * manual removal at the provider — the local disconnect stands regardless;
4795
+ * `auth_type` remains `oauth` with `oauth_status: 'disconnected'`.
4796
+ */
4797
+ export interface MCPOAuthDisconnectResponse {
4798
+ disconnected: boolean;
4799
+ revoked: boolean;
4800
+ version: string;
4801
+ }
4802
+
4756
4803
  /**
4757
4804
  * One tool from the cached tools/list snapshot. The full remote tool object is
4758
4805
  * snapshotted verbatim (inputSchema etc. ride along in the index signature).
@@ -4774,12 +4821,14 @@ export interface MCPToolInfo {
4774
4821
  */
4775
4822
  export interface MCPConfigResponse {
4776
4823
  server_url: string;
4777
- auth_type: MCPAuthType;
4824
+ auth_type: MCPConfigAuthType;
4778
4825
  /** Whether a credential is stored (write-only; the value is never returned). */
4779
4826
  credential_set: boolean;
4780
4827
  /** Cached tools/list snapshot; untrusted remote metadata (see MCPToolInfo). */
4781
4828
  tools?: MCPToolInfo[];
4782
4829
  tools_refreshed_at?: string;
4830
+ /** Present only when `auth_type` is `oauth`. */
4831
+ oauth_status?: MCPOAuthStatus;
4783
4832
  /**
4784
4833
  * Opaque CAS token for If-Match on PUT/DELETE (lost-update protection).
4785
4834
  * Version mismatch answers `409 MCP_CONFIG_STALE`.
@@ -4802,9 +4851,7 @@ export interface MCPConfigPutRequest {
4802
4851
 
4803
4852
  /**
4804
4853
  * A clip in the api-server org registry (`crg_…`, table `clip_registry`) — the
4805
- * v3 registry that install and clip connections operate on. Distinct from
4806
- * {@link RegistryClipInfo}, which is the clip-service → Pinix Hub catalog proxy
4807
- * and carries no registry id.
4854
+ * v3 registry that publish, install, and clip connections operate on.
4808
4855
  */
4809
4856
  export interface ClipRegistryEntry {
4810
4857
  id: string;
@@ -4831,6 +4878,45 @@ export interface InstallRegistryClipResponse {
4831
4878
  name: string;
4832
4879
  }
4833
4880
 
4881
+ /**
4882
+ * Create or update a clip in the org registry
4883
+ * (`POST /orgs/{orgId}/clip-registry/publish`). Upsert is keyed by `name`
4884
+ * within the org; updating an existing clip is author-only (`403 FORBIDDEN`
4885
+ * otherwise). `files` REPLACES the clip's whole file set. An invalid
4886
+ * `visibility` silently falls back to `private` server-side; `public` submits
4887
+ * a pending review snapshot — cross-org installs keep serving the previously
4888
+ * approved version until platform review approves it, while the publishing
4889
+ * org itself always execs the latest working copy.
4890
+ */
4891
+ export interface PublishRegistryClipRequest {
4892
+ name: string;
4893
+ description?: string;
4894
+ visibility?: 'public' | 'private';
4895
+ version?: string;
4896
+ /** clip.json-shaped manifest (commands map + metadata). */
4897
+ manifest?: Record<string, unknown>;
4898
+ /** filename → UTF-8 content (e.g. `search.js`). */
4899
+ files: Record<string, string>;
4900
+ }
4901
+
4902
+ /**
4903
+ * A clip's per-org agent exec access (`GET/PUT /orgs/{orgId}/clips/{clipId}/exec-access`).
4904
+ *
4905
+ * - `all_agents` (default): every org agent may exec the clip.
4906
+ * - `selected_agents`: only the agents in `agent_ids` may exec; an empty list
4907
+ * blocks every agent. Denied agents also stop seeing the clip in
4908
+ * `clips/installed`, and exec answers `403 CLIP_AGENT_NOT_ALLOWED`.
4909
+ *
4910
+ * Decided by the CALLING org (an installer restricts its own agents, never the
4911
+ * publisher's). Humans are never restricted; the PUT is human-only (an agent
4912
+ * principal is refused so it can never widen its own access).
4913
+ */
4914
+ export interface ClipAgentExecAccess {
4915
+ mode: 'all_agents' | 'selected_agents';
4916
+ /** Granted agent user ids under `selected_agents`; always [] under `all_agents`. */
4917
+ agent_ids: string[];
4918
+ }
4919
+
4834
4920
  /**
4835
4921
  * Execute a registry (Edge) clip command on an Edge device
4836
4922
  * (`POST /orgs/{orgId}/edge/exec`).