@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/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 +113 -30
- 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 +121 -35
package/dist/types.d.ts
CHANGED
|
@@ -2332,7 +2332,7 @@ export interface InboxItem {
|
|
|
2332
2332
|
created_at: string;
|
|
2333
2333
|
updated_at: string;
|
|
2334
2334
|
}
|
|
2335
|
-
export type ChannelProvider = 'feishu' | 'slack';
|
|
2335
|
+
export type ChannelProvider = 'feishu' | 'slack' | 'wechat';
|
|
2336
2336
|
export type ChannelConnectionStatus = 'pending' | 'active' | 'disabled';
|
|
2337
2337
|
/**
|
|
2338
2338
|
* Inbound transport for a connection. Defaults to the provider's lowest-
|
|
@@ -2366,6 +2366,9 @@ export interface ChannelConnection {
|
|
|
2366
2366
|
* hides the upgrade CTA when this is false/absent.
|
|
2367
2367
|
*/
|
|
2368
2368
|
upgrade_eligible?: boolean;
|
|
2369
|
+
/** Set when the provider reported the device node offline (wechat Offline
|
|
2370
|
+
* event) — the connection stays active but needs a vendor-side re-login. */
|
|
2371
|
+
last_offline_at?: string | null;
|
|
2369
2372
|
created_at: string;
|
|
2370
2373
|
updated_at: string;
|
|
2371
2374
|
}
|
|
@@ -2378,6 +2381,8 @@ export interface ChannelCredentialsInput {
|
|
|
2378
2381
|
/** Slack fields (webhook-only: the signing secret is the verifier). */
|
|
2379
2382
|
bot_token?: string;
|
|
2380
2383
|
signing_secret?: string;
|
|
2384
|
+
/** WeChat field (research preview): vendor API credential. */
|
|
2385
|
+
token?: string;
|
|
2381
2386
|
team_id?: string;
|
|
2382
2387
|
}
|
|
2383
2388
|
export interface CreateChannelConnectionInput {
|
|
@@ -2497,8 +2502,9 @@ export interface SlackManifestLinkResult {
|
|
|
2497
2502
|
* generic ChannelProvider here would compile call sites that always 400.
|
|
2498
2503
|
*/
|
|
2499
2504
|
export interface SendChannelMessageInput {
|
|
2500
|
-
channel_type: 'slack';
|
|
2501
|
-
/** Vendor-native conversation id from the inbound event (e.g. C…/D…
|
|
2505
|
+
channel_type: 'slack' | 'wechat';
|
|
2506
|
+
/** Vendor-native conversation id from the inbound event (e.g. C…/D… for
|
|
2507
|
+
* slack, a wxid or room id for wechat). */
|
|
2502
2508
|
conversation_id: string;
|
|
2503
2509
|
/**
|
|
2504
2510
|
* External message id being answered (channel-domain format:
|
|
@@ -2507,12 +2513,15 @@ export interface SendChannelMessageInput {
|
|
|
2507
2513
|
* In DMs the SESSION never forks, but reply POSITION follows the
|
|
2508
2514
|
* question: a thread-child id lands the reply inside that thread, a
|
|
2509
2515
|
* bare id (or omitting the field) keeps the flattened main flow.
|
|
2516
|
+
* WeChat has no threads — omit for wechat.
|
|
2510
2517
|
*/
|
|
2511
2518
|
reply_to?: string;
|
|
2519
|
+
/** WeChat-only: @-mention a group member (wxid) in a group reply. */
|
|
2520
|
+
at?: string;
|
|
2512
2521
|
text: string;
|
|
2513
2522
|
}
|
|
2514
2523
|
export interface SentChannelMessage {
|
|
2515
|
-
channel_type: 'slack';
|
|
2524
|
+
channel_type: 'slack' | 'wechat';
|
|
2516
2525
|
conversation_id: string;
|
|
2517
2526
|
/**
|
|
2518
2527
|
* Channel-domain external id — `{channel}:{ts}` for top-level posts,
|
|
@@ -2542,6 +2551,12 @@ export interface SlackChannelsPage {
|
|
|
2542
2551
|
channels: SlackChannelInfo[];
|
|
2543
2552
|
next_cursor?: string;
|
|
2544
2553
|
}
|
|
2554
|
+
/** WeChat address book (id lists only — the vendor returns no names). */
|
|
2555
|
+
export interface WechatContactsPage {
|
|
2556
|
+
friends: string[];
|
|
2557
|
+
chatrooms: string[];
|
|
2558
|
+
ghs: string[];
|
|
2559
|
+
}
|
|
2545
2560
|
export interface SlackUserInfo {
|
|
2546
2561
|
id: string;
|
|
2547
2562
|
name: string;
|
|
@@ -3743,27 +3758,6 @@ export interface MachineClip {
|
|
|
3743
3758
|
version?: string;
|
|
3744
3759
|
browser_profile_id?: string | null;
|
|
3745
3760
|
}
|
|
3746
|
-
export interface RegistryCommandInfo {
|
|
3747
|
-
name: string;
|
|
3748
|
-
description: string;
|
|
3749
|
-
input?: string;
|
|
3750
|
-
output?: string;
|
|
3751
|
-
}
|
|
3752
|
-
export interface RegistryDependencyInfo {
|
|
3753
|
-
package: string;
|
|
3754
|
-
version: string;
|
|
3755
|
-
}
|
|
3756
|
-
export interface RegistryClipInfo {
|
|
3757
|
-
name: string;
|
|
3758
|
-
package: string;
|
|
3759
|
-
version: string;
|
|
3760
|
-
type: string;
|
|
3761
|
-
description?: string;
|
|
3762
|
-
domain?: string;
|
|
3763
|
-
author?: string;
|
|
3764
|
-
commands: RegistryCommandInfo[];
|
|
3765
|
-
dependencies: Record<string, RegistryDependencyInfo>;
|
|
3766
|
-
}
|
|
3767
3761
|
export type ClipCreatedData = Clip;
|
|
3768
3762
|
export type ClipUpdatedData = Clip;
|
|
3769
3763
|
export interface ClipRemovedData {
|
|
@@ -3955,8 +3949,60 @@ export interface ClipConnection {
|
|
|
3955
3949
|
created_at: string;
|
|
3956
3950
|
updated_at: string;
|
|
3957
3951
|
}
|
|
3958
|
-
/**
|
|
3952
|
+
/**
|
|
3953
|
+
* MCP clip auth modes this SDK can WRITE: the pre-shared credential kinds a
|
|
3954
|
+
* `PUT …/mcp-config` may set. Deliberately excludes `oauth` — an OAuth
|
|
3955
|
+
* connection is created by the server-brokered browser flow (PUT → authorize
|
|
3956
|
+
* URL → public callback), which returns a different response shape and is
|
|
3957
|
+
* typed separately (MCPOAuthInitiateRequest/Response). Widening this union
|
|
3958
|
+
* would make `putClipMCPConfig({auth_type: 'oauth'})` type-legal while its
|
|
3959
|
+
* declared return type is wrong. Reads use MCPConfigAuthType.
|
|
3960
|
+
*/
|
|
3959
3961
|
export type MCPAuthType = 'none' | 'bearer' | 'api_key';
|
|
3962
|
+
/**
|
|
3963
|
+
* MCP clip auth modes a config can REPORT. A config authorized through the
|
|
3964
|
+
* OAuth flow reads back as `oauth`, so every reader must handle it even
|
|
3965
|
+
* though no typed call here produces one.
|
|
3966
|
+
*/
|
|
3967
|
+
export type MCPConfigAuthType = MCPAuthType | 'oauth';
|
|
3968
|
+
/**
|
|
3969
|
+
* Connection state of an `oauth` config (server-derived, deployment-instance
|
|
3970
|
+
* fenced): `connected` = a valid or lazily-refreshable token; `needs_reauth` =
|
|
3971
|
+
* an org admin must authorize again; `disconnected` = no authorization here.
|
|
3972
|
+
*/
|
|
3973
|
+
export type MCPOAuthStatus = 'connected' | 'needs_reauth' | 'disconnected';
|
|
3974
|
+
/**
|
|
3975
|
+
* Body of the OAuth-initiating `PUT …/mcp-config`: `auth_type` is the literal
|
|
3976
|
+
* `'oauth'` and there is no credential field — the authorization happens in
|
|
3977
|
+
* the provider's browser flow. Kept apart from MCPConfigPutRequest because
|
|
3978
|
+
* the response is MCPOAuthInitiateResponse, not MCPConfigResponse (see the
|
|
3979
|
+
* MCPAuthType note).
|
|
3980
|
+
*/
|
|
3981
|
+
export interface MCPOAuthInitiateRequest {
|
|
3982
|
+
server_url: string;
|
|
3983
|
+
auth_type: 'oauth';
|
|
3984
|
+
}
|
|
3985
|
+
/**
|
|
3986
|
+
* Response of an OAuth-initiating PUT. Nothing is committed yet: an org
|
|
3987
|
+
* admin's browser must complete `authorize_url` before `expires_at`; the
|
|
3988
|
+
* config (and its default connection) is committed by the public callback. A
|
|
3989
|
+
* repeat PUT while the attempt is live returns the SAME attempt's URL.
|
|
3990
|
+
*/
|
|
3991
|
+
export interface MCPOAuthInitiateResponse {
|
|
3992
|
+
authorize_url: string;
|
|
3993
|
+
expires_at: string;
|
|
3994
|
+
}
|
|
3995
|
+
/**
|
|
3996
|
+
* Response of `POST …/mcp-config/oauth/disconnect` (If-Match mandatory).
|
|
3997
|
+
* `revoked: false` means the provider-side grant may still exist and can need
|
|
3998
|
+
* manual removal at the provider — the local disconnect stands regardless;
|
|
3999
|
+
* `auth_type` remains `oauth` with `oauth_status: 'disconnected'`.
|
|
4000
|
+
*/
|
|
4001
|
+
export interface MCPOAuthDisconnectResponse {
|
|
4002
|
+
disconnected: boolean;
|
|
4003
|
+
revoked: boolean;
|
|
4004
|
+
version: string;
|
|
4005
|
+
}
|
|
3960
4006
|
/**
|
|
3961
4007
|
* One tool from the cached tools/list snapshot. The full remote tool object is
|
|
3962
4008
|
* snapshotted verbatim (inputSchema etc. ride along in the index signature).
|
|
@@ -3977,12 +4023,14 @@ export interface MCPToolInfo {
|
|
|
3977
4023
|
*/
|
|
3978
4024
|
export interface MCPConfigResponse {
|
|
3979
4025
|
server_url: string;
|
|
3980
|
-
auth_type:
|
|
4026
|
+
auth_type: MCPConfigAuthType;
|
|
3981
4027
|
/** Whether a credential is stored (write-only; the value is never returned). */
|
|
3982
4028
|
credential_set: boolean;
|
|
3983
4029
|
/** Cached tools/list snapshot; untrusted remote metadata (see MCPToolInfo). */
|
|
3984
4030
|
tools?: MCPToolInfo[];
|
|
3985
4031
|
tools_refreshed_at?: string;
|
|
4032
|
+
/** Present only when `auth_type` is `oauth`. */
|
|
4033
|
+
oauth_status?: MCPOAuthStatus;
|
|
3986
4034
|
/**
|
|
3987
4035
|
* Opaque CAS token for If-Match on PUT/DELETE (lost-update protection).
|
|
3988
4036
|
* Version mismatch answers `409 MCP_CONFIG_STALE`.
|
|
@@ -4003,9 +4051,7 @@ export interface MCPConfigPutRequest {
|
|
|
4003
4051
|
}
|
|
4004
4052
|
/**
|
|
4005
4053
|
* A clip in the api-server org registry (`crg_…`, table `clip_registry`) — the
|
|
4006
|
-
* v3 registry that install and clip connections operate on.
|
|
4007
|
-
* {@link RegistryClipInfo}, which is the clip-service → Pinix Hub catalog proxy
|
|
4008
|
-
* and carries no registry id.
|
|
4054
|
+
* v3 registry that publish, install, and clip connections operate on.
|
|
4009
4055
|
*/
|
|
4010
4056
|
export interface ClipRegistryEntry {
|
|
4011
4057
|
id: string;
|
|
@@ -4030,6 +4076,43 @@ export interface InstallRegistryClipResponse {
|
|
|
4030
4076
|
clip_id: string;
|
|
4031
4077
|
name: string;
|
|
4032
4078
|
}
|
|
4079
|
+
/**
|
|
4080
|
+
* Create or update a clip in the org registry
|
|
4081
|
+
* (`POST /orgs/{orgId}/clip-registry/publish`). Upsert is keyed by `name`
|
|
4082
|
+
* within the org; updating an existing clip is author-only (`403 FORBIDDEN`
|
|
4083
|
+
* otherwise). `files` REPLACES the clip's whole file set. An invalid
|
|
4084
|
+
* `visibility` silently falls back to `private` server-side; `public` submits
|
|
4085
|
+
* a pending review snapshot — cross-org installs keep serving the previously
|
|
4086
|
+
* approved version until platform review approves it, while the publishing
|
|
4087
|
+
* org itself always execs the latest working copy.
|
|
4088
|
+
*/
|
|
4089
|
+
export interface PublishRegistryClipRequest {
|
|
4090
|
+
name: string;
|
|
4091
|
+
description?: string;
|
|
4092
|
+
visibility?: 'public' | 'private';
|
|
4093
|
+
version?: string;
|
|
4094
|
+
/** clip.json-shaped manifest (commands map + metadata). */
|
|
4095
|
+
manifest?: Record<string, unknown>;
|
|
4096
|
+
/** filename → UTF-8 content (e.g. `search.js`). */
|
|
4097
|
+
files: Record<string, string>;
|
|
4098
|
+
}
|
|
4099
|
+
/**
|
|
4100
|
+
* A clip's per-org agent exec access (`GET/PUT /orgs/{orgId}/clips/{clipId}/exec-access`).
|
|
4101
|
+
*
|
|
4102
|
+
* - `all_agents` (default): every org agent may exec the clip.
|
|
4103
|
+
* - `selected_agents`: only the agents in `agent_ids` may exec; an empty list
|
|
4104
|
+
* blocks every agent. Denied agents also stop seeing the clip in
|
|
4105
|
+
* `clips/installed`, and exec answers `403 CLIP_AGENT_NOT_ALLOWED`.
|
|
4106
|
+
*
|
|
4107
|
+
* Decided by the CALLING org (an installer restricts its own agents, never the
|
|
4108
|
+
* publisher's). Humans are never restricted; the PUT is human-only (an agent
|
|
4109
|
+
* principal is refused so it can never widen its own access).
|
|
4110
|
+
*/
|
|
4111
|
+
export interface ClipAgentExecAccess {
|
|
4112
|
+
mode: 'all_agents' | 'selected_agents';
|
|
4113
|
+
/** Granted agent user ids under `selected_agents`; always [] under `all_agents`. */
|
|
4114
|
+
agent_ids: string[];
|
|
4115
|
+
}
|
|
4033
4116
|
/**
|
|
4034
4117
|
* Execute a registry (Edge) clip command on an Edge device
|
|
4035
4118
|
* (`POST /orgs/{orgId}/edge/exec`).
|