@parall/sdk 1.52.0 → 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/dist/client.d.ts +43 -4
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +59 -7
- package/dist/constants.d.ts +6 -1
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +9 -4
- package/dist/types.d.ts +118 -34
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/client.ts +75 -9
- package/src/constants.ts +13 -5
- package/src/types.ts +126 -39
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;
|
|
@@ -3453,10 +3469,11 @@ export interface DispatchReceivedData {
|
|
|
3453
3469
|
/**
|
|
3454
3470
|
* Terminal counterpart of DispatchReceivedData: published on org:{orgId} when
|
|
3455
3471
|
* a message WorkItem reaches a terminal resolution, so the message-level
|
|
3456
|
-
* Activity
|
|
3457
|
-
* for `redrive_exhausted
|
|
3458
|
-
*
|
|
3459
|
-
*
|
|
3472
|
+
* Activity state flips active→done — or, per indicator v2.1, active→failed
|
|
3473
|
+
* for `redrive_exhausted`. Failed history remains available through Activity;
|
|
3474
|
+
* only a live event produces the transient inline failure indicator. Only
|
|
3475
|
+
* `cancelled` clears the activity — without inferring completion from agent
|
|
3476
|
+
* session state. Message WorkItems only.
|
|
3460
3477
|
*/
|
|
3461
3478
|
export interface DispatchResolvedData {
|
|
3462
3479
|
agent_id: string;
|
|
@@ -4510,32 +4527,6 @@ export interface MachineClip {
|
|
|
4510
4527
|
browser_profile_id?: string | null;
|
|
4511
4528
|
}
|
|
4512
4529
|
|
|
4513
|
-
// Pinix registry catalog clip info (from GET /clip/v1/registry/clips,
|
|
4514
|
-
// which proxies the public Pinix registry GET /search).
|
|
4515
|
-
export interface RegistryCommandInfo {
|
|
4516
|
-
name: string;
|
|
4517
|
-
description: string;
|
|
4518
|
-
input?: string;
|
|
4519
|
-
output?: string;
|
|
4520
|
-
}
|
|
4521
|
-
|
|
4522
|
-
export interface RegistryDependencyInfo {
|
|
4523
|
-
package: string;
|
|
4524
|
-
version: string;
|
|
4525
|
-
}
|
|
4526
|
-
|
|
4527
|
-
export interface RegistryClipInfo {
|
|
4528
|
-
name: string; // @scope/name (canonical package id)
|
|
4529
|
-
package: string; // @scope/name (alias derivation + install source_ref)
|
|
4530
|
-
version: string;
|
|
4531
|
-
type: string; // registry package type (e.g. "clip")
|
|
4532
|
-
description?: string;
|
|
4533
|
-
domain?: string;
|
|
4534
|
-
author?: string;
|
|
4535
|
-
commands: RegistryCommandInfo[];
|
|
4536
|
-
dependencies: Record<string, RegistryDependencyInfo>;
|
|
4537
|
-
}
|
|
4538
|
-
|
|
4539
4530
|
// Clip WS event data types
|
|
4540
4531
|
export type ClipCreatedData = Clip;
|
|
4541
4532
|
export type ClipUpdatedData = Clip;
|
|
@@ -4749,9 +4740,66 @@ export interface ClipConnection {
|
|
|
4749
4740
|
updated_at: string;
|
|
4750
4741
|
}
|
|
4751
4742
|
|
|
4752
|
-
/**
|
|
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
|
+
*/
|
|
4753
4752
|
export type MCPAuthType = 'none' | 'bearer' | 'api_key';
|
|
4754
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
|
+
|
|
4755
4803
|
/**
|
|
4756
4804
|
* One tool from the cached tools/list snapshot. The full remote tool object is
|
|
4757
4805
|
* snapshotted verbatim (inputSchema etc. ride along in the index signature).
|
|
@@ -4773,12 +4821,14 @@ export interface MCPToolInfo {
|
|
|
4773
4821
|
*/
|
|
4774
4822
|
export interface MCPConfigResponse {
|
|
4775
4823
|
server_url: string;
|
|
4776
|
-
auth_type:
|
|
4824
|
+
auth_type: MCPConfigAuthType;
|
|
4777
4825
|
/** Whether a credential is stored (write-only; the value is never returned). */
|
|
4778
4826
|
credential_set: boolean;
|
|
4779
4827
|
/** Cached tools/list snapshot; untrusted remote metadata (see MCPToolInfo). */
|
|
4780
4828
|
tools?: MCPToolInfo[];
|
|
4781
4829
|
tools_refreshed_at?: string;
|
|
4830
|
+
/** Present only when `auth_type` is `oauth`. */
|
|
4831
|
+
oauth_status?: MCPOAuthStatus;
|
|
4782
4832
|
/**
|
|
4783
4833
|
* Opaque CAS token for If-Match on PUT/DELETE (lost-update protection).
|
|
4784
4834
|
* Version mismatch answers `409 MCP_CONFIG_STALE`.
|
|
@@ -4801,9 +4851,7 @@ export interface MCPConfigPutRequest {
|
|
|
4801
4851
|
|
|
4802
4852
|
/**
|
|
4803
4853
|
* A clip in the api-server org registry (`crg_…`, table `clip_registry`) — the
|
|
4804
|
-
* v3 registry that install and clip connections operate on.
|
|
4805
|
-
* {@link RegistryClipInfo}, which is the clip-service → Pinix Hub catalog proxy
|
|
4806
|
-
* and carries no registry id.
|
|
4854
|
+
* v3 registry that publish, install, and clip connections operate on.
|
|
4807
4855
|
*/
|
|
4808
4856
|
export interface ClipRegistryEntry {
|
|
4809
4857
|
id: string;
|
|
@@ -4830,6 +4878,45 @@ export interface InstallRegistryClipResponse {
|
|
|
4830
4878
|
name: string;
|
|
4831
4879
|
}
|
|
4832
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
|
+
|
|
4833
4920
|
/**
|
|
4834
4921
|
* Execute a registry (Edge) clip command on an Edge device
|
|
4835
4922
|
* (`POST /orgs/{orgId}/edge/exec`).
|