@parall/sdk 1.35.0 → 1.36.1
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 +76 -11
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +130 -11
- package/dist/constants.d.ts +11 -0
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +12 -0
- package/dist/types.d.ts +293 -8
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/client.ts +247 -14
- package/src/constants.ts +19 -0
- package/src/types.ts +325 -7
package/src/types.ts
CHANGED
|
@@ -264,6 +264,15 @@ export interface Message {
|
|
|
264
264
|
content: MessageContent;
|
|
265
265
|
version: number;
|
|
266
266
|
reply_count: number;
|
|
267
|
+
/** Timestamp of the most recent reply in this message's thread (root only). */
|
|
268
|
+
last_reply_at?: string | null;
|
|
269
|
+
/**
|
|
270
|
+
* Most-recent distinct reply authors, newest-first (root only, capped at 3).
|
|
271
|
+
* Approximate: derived from the newest ~30 replies per root, so on very long
|
|
272
|
+
* threads dominated by a few recent senders, older distinct authors may be
|
|
273
|
+
* absent from the stack. A reload re-derives it from the server's view.
|
|
274
|
+
*/
|
|
275
|
+
recent_repliers?: User[];
|
|
267
276
|
edited_at: string | null;
|
|
268
277
|
deleted_at: string | null;
|
|
269
278
|
created_at: string;
|
|
@@ -1308,6 +1317,186 @@ export interface ScheduleRunFilters {
|
|
|
1308
1317
|
limit?: number;
|
|
1309
1318
|
}
|
|
1310
1319
|
|
|
1320
|
+
// ============================================================
|
|
1321
|
+
// External Trigger Types
|
|
1322
|
+
// ============================================================
|
|
1323
|
+
|
|
1324
|
+
export type ExternalConnectionStatus = 'active' | 'disabled';
|
|
1325
|
+
export type ExternalIngressEventStatus = 'received' | 'processed' | 'failed';
|
|
1326
|
+
export type ExternalTriggerStatus = 'active' | 'paused';
|
|
1327
|
+
export type ExternalTriggerEffectiveStatus = 'active' | 'inactive';
|
|
1328
|
+
export type ExternalTriggerInactiveReason =
|
|
1329
|
+
| 'connection_disabled'
|
|
1330
|
+
| 'connection_archived'
|
|
1331
|
+
| 'trigger_paused'
|
|
1332
|
+
| 'trigger_archived'
|
|
1333
|
+
| 'expired'
|
|
1334
|
+
| 'max_runs_reached';
|
|
1335
|
+
export type ExternalTriggerRunStatus = 'delivered' | 'failed';
|
|
1336
|
+
|
|
1337
|
+
export interface ExternalConnection {
|
|
1338
|
+
id: string;
|
|
1339
|
+
org_id: string;
|
|
1340
|
+
source_type: string;
|
|
1341
|
+
display_name: string;
|
|
1342
|
+
owner_id: string;
|
|
1343
|
+
status: ExternalConnectionStatus;
|
|
1344
|
+
auth_config: Record<string, unknown>;
|
|
1345
|
+
archived_at: string | null;
|
|
1346
|
+
archive_reason: string | null;
|
|
1347
|
+
ingress_url?: string;
|
|
1348
|
+
ingress_token?: string;
|
|
1349
|
+
created_at: string;
|
|
1350
|
+
updated_at: string;
|
|
1351
|
+
}
|
|
1352
|
+
|
|
1353
|
+
export interface CreateExternalConnectionInput {
|
|
1354
|
+
source_type?: string;
|
|
1355
|
+
display_name: string;
|
|
1356
|
+
}
|
|
1357
|
+
|
|
1358
|
+
export interface UpdateExternalConnectionInput {
|
|
1359
|
+
display_name?: string;
|
|
1360
|
+
status?: ExternalConnectionStatus;
|
|
1361
|
+
}
|
|
1362
|
+
|
|
1363
|
+
export interface ExternalIngressEvent {
|
|
1364
|
+
id: string;
|
|
1365
|
+
org_id: string;
|
|
1366
|
+
connection_id: string;
|
|
1367
|
+
status: ExternalIngressEventStatus;
|
|
1368
|
+
dedupe_key: string | null;
|
|
1369
|
+
event_type: string;
|
|
1370
|
+
request_snapshot: Record<string, unknown>;
|
|
1371
|
+
body_snapshot: Record<string, unknown>;
|
|
1372
|
+
envelope_snapshot: Record<string, unknown>;
|
|
1373
|
+
raw_body_sha256: string;
|
|
1374
|
+
body_size: number;
|
|
1375
|
+
error_code: string | null;
|
|
1376
|
+
error_message: string | null;
|
|
1377
|
+
received_at: string;
|
|
1378
|
+
processed_at: string | null;
|
|
1379
|
+
}
|
|
1380
|
+
|
|
1381
|
+
export interface ExternalTrigger {
|
|
1382
|
+
id: string;
|
|
1383
|
+
org_id: string;
|
|
1384
|
+
connection_id: string;
|
|
1385
|
+
creator_id: string;
|
|
1386
|
+
name: string;
|
|
1387
|
+
description: string;
|
|
1388
|
+
status: ExternalTriggerStatus;
|
|
1389
|
+
effective_status: ExternalTriggerEffectiveStatus;
|
|
1390
|
+
inactive_reason?: ExternalTriggerInactiveReason;
|
|
1391
|
+
archived_at: string | null;
|
|
1392
|
+
archive_reason: string | null;
|
|
1393
|
+
attached_to_uri: string | null;
|
|
1394
|
+
filter_language: 'cel';
|
|
1395
|
+
filter_profile: 'parall_cel_v1';
|
|
1396
|
+
filter_expr: string;
|
|
1397
|
+
filter_display_metadata: Record<string, unknown>;
|
|
1398
|
+
template_language: 'liquid';
|
|
1399
|
+
template_profile: 'parall_safe_v1';
|
|
1400
|
+
agent_input_template: string;
|
|
1401
|
+
max_runs: number | null;
|
|
1402
|
+
run_count: number;
|
|
1403
|
+
expires_at: string | null;
|
|
1404
|
+
client_context: Record<string, unknown>;
|
|
1405
|
+
target_agent_ids: string[];
|
|
1406
|
+
created_at: string;
|
|
1407
|
+
updated_at: string;
|
|
1408
|
+
}
|
|
1409
|
+
|
|
1410
|
+
export interface CreateExternalTriggerInput {
|
|
1411
|
+
connection_id: string;
|
|
1412
|
+
name: string;
|
|
1413
|
+
description?: string;
|
|
1414
|
+
target_agent_ids: string[];
|
|
1415
|
+
attached_to_uri?: string;
|
|
1416
|
+
filter_expr: string;
|
|
1417
|
+
filter_display_metadata?: Record<string, unknown>;
|
|
1418
|
+
agent_input_template: string;
|
|
1419
|
+
max_runs?: number;
|
|
1420
|
+
expires_at?: string;
|
|
1421
|
+
client_context?: Record<string, unknown>;
|
|
1422
|
+
}
|
|
1423
|
+
|
|
1424
|
+
export interface UpdateExternalTriggerInput {
|
|
1425
|
+
name?: string;
|
|
1426
|
+
description?: string;
|
|
1427
|
+
status?: ExternalTriggerStatus;
|
|
1428
|
+
target_agent_ids?: string[];
|
|
1429
|
+
attached_to_uri?: string;
|
|
1430
|
+
attached_to_uri_clear?: boolean;
|
|
1431
|
+
filter_expr?: string;
|
|
1432
|
+
filter_display_metadata?: Record<string, unknown>;
|
|
1433
|
+
agent_input_template?: string;
|
|
1434
|
+
max_runs?: number;
|
|
1435
|
+
max_runs_clear?: boolean;
|
|
1436
|
+
expires_at?: string;
|
|
1437
|
+
expires_at_clear?: boolean;
|
|
1438
|
+
client_context?: Record<string, unknown>;
|
|
1439
|
+
}
|
|
1440
|
+
|
|
1441
|
+
export interface ExternalTriggerRun {
|
|
1442
|
+
id: string;
|
|
1443
|
+
org_id: string;
|
|
1444
|
+
connection_id: string;
|
|
1445
|
+
ingress_event_id: string;
|
|
1446
|
+
trigger_id: string;
|
|
1447
|
+
status: ExternalTriggerRunStatus;
|
|
1448
|
+
failure_stage: string | null;
|
|
1449
|
+
error_code: string | null;
|
|
1450
|
+
error_message: string | null;
|
|
1451
|
+
agent_input_body: string | null;
|
|
1452
|
+
trigger_snapshot: Record<string, unknown>;
|
|
1453
|
+
configured_target_agent_ids: string[];
|
|
1454
|
+
eligible_target_agent_ids: string[];
|
|
1455
|
+
skipped_target_agent_ids: string[];
|
|
1456
|
+
dispatch_event_ids: string[];
|
|
1457
|
+
trigger_name?: string;
|
|
1458
|
+
connection_source_type?: string;
|
|
1459
|
+
connection_display_name?: string;
|
|
1460
|
+
ingress_event_type?: string;
|
|
1461
|
+
created_at: string;
|
|
1462
|
+
delivered_at: string | null;
|
|
1463
|
+
}
|
|
1464
|
+
|
|
1465
|
+
export interface ExternalConnectionFilters {
|
|
1466
|
+
cursor?: string;
|
|
1467
|
+
limit?: number;
|
|
1468
|
+
}
|
|
1469
|
+
|
|
1470
|
+
export interface ExternalTriggerFilters {
|
|
1471
|
+
connection_id?: string;
|
|
1472
|
+
creator_id?: string;
|
|
1473
|
+
cursor?: string;
|
|
1474
|
+
limit?: number;
|
|
1475
|
+
}
|
|
1476
|
+
|
|
1477
|
+
export interface ExternalIngressEventFilters {
|
|
1478
|
+
connection_id?: string;
|
|
1479
|
+
cursor?: string;
|
|
1480
|
+
limit?: number;
|
|
1481
|
+
}
|
|
1482
|
+
|
|
1483
|
+
export interface ExternalTriggerRunFilters {
|
|
1484
|
+
trigger_id?: string;
|
|
1485
|
+
cursor?: string;
|
|
1486
|
+
limit?: number;
|
|
1487
|
+
}
|
|
1488
|
+
|
|
1489
|
+
export interface ExternalTriggerSchema {
|
|
1490
|
+
filter_language: 'cel';
|
|
1491
|
+
filter_profile: 'parall_cel_v1';
|
|
1492
|
+
template_language: 'liquid';
|
|
1493
|
+
template_profile: 'parall_safe_v1';
|
|
1494
|
+
filter_variables: string[];
|
|
1495
|
+
template_variables: string[];
|
|
1496
|
+
template_filters: string[];
|
|
1497
|
+
examples: Record<string, string>;
|
|
1498
|
+
}
|
|
1499
|
+
|
|
1311
1500
|
// Schedule WS event data
|
|
1312
1501
|
export type ScheduleCreatedData = Schedule;
|
|
1313
1502
|
export type ScheduleUpdatedData = Schedule;
|
|
@@ -2085,6 +2274,7 @@ export type DispatchEventType =
|
|
|
2085
2274
|
| 'task_comment'
|
|
2086
2275
|
| 'wiki_comment'
|
|
2087
2276
|
| 'schedule.fire'
|
|
2277
|
+
| 'external_trigger'
|
|
2088
2278
|
| 'approval_decided';
|
|
2089
2279
|
export type DispatchStatus = 'pending' | 'received' | 'acked';
|
|
2090
2280
|
export type DispatchDeliveryReason = 'mention' | 'watcher' | 'assignee' | 'creator';
|
|
@@ -2373,6 +2563,8 @@ export interface ResolvedRef {
|
|
|
2373
2563
|
// Wiki fields
|
|
2374
2564
|
file_name?: string;
|
|
2375
2565
|
wiki_name?: string;
|
|
2566
|
+
/** Frontmatter description of the referenced wiki page (OKF), when present. */
|
|
2567
|
+
wiki_description?: string;
|
|
2376
2568
|
fragment_exists?: boolean;
|
|
2377
2569
|
anchor_kind?: string;
|
|
2378
2570
|
anchor_exists?: boolean;
|
|
@@ -2411,6 +2603,38 @@ export interface BacklinksResponse {
|
|
|
2411
2603
|
next_cursor?: string;
|
|
2412
2604
|
}
|
|
2413
2605
|
|
|
2606
|
+
/**
|
|
2607
|
+
* One entity in a multi-hop ref-graph traversal (GET /refs/graph). `id`/`uri` are
|
|
2608
|
+
* the ref_links endpoint identifier: a bare prll:// entity id for most nodes
|
|
2609
|
+
* (`tsk_abc` → `prll://tsk_abc`), but a wiki_file source node carries its file
|
|
2610
|
+
* path (`wik_abc/docs/a.md` → `prll://wik_abc/docs/a.md`, type `wik`). The query
|
|
2611
|
+
* root must be entity-level (refined path/anchor URIs are rejected 400), yet
|
|
2612
|
+
* interior wiki_file nodes can legitimately be path-bearing.
|
|
2613
|
+
*/
|
|
2614
|
+
export interface RefGraphNode {
|
|
2615
|
+
uri: string; // prll://<id>; a wiki_file node's id includes its file path
|
|
2616
|
+
type: string; // bare prefix: msg, tsk, wik, …
|
|
2617
|
+
id: string; // ref_links endpoint id: bare entity id, or "<wikiID>/<path>" for wiki_file nodes
|
|
2618
|
+
depth: number; // BFS distance from root (0 = root)
|
|
2619
|
+
}
|
|
2620
|
+
|
|
2621
|
+
/** One directed prll:// reference between two nodes in the graph. */
|
|
2622
|
+
export interface RefGraphEdge {
|
|
2623
|
+
source_uri: string;
|
|
2624
|
+
target_uri: string;
|
|
2625
|
+
source_type: string; // full word: message, task, …
|
|
2626
|
+
target_type: string; // bare prefix: msg, tsk, …
|
|
2627
|
+
context?: string;
|
|
2628
|
+
}
|
|
2629
|
+
|
|
2630
|
+
export interface RefGraphResponse {
|
|
2631
|
+
root: string; // prll://<rootId>
|
|
2632
|
+
depth: number; // effective hop limit used (after server clamping)
|
|
2633
|
+
nodes: RefGraphNode[];
|
|
2634
|
+
edges: RefGraphEdge[];
|
|
2635
|
+
truncated: boolean; // a node/edge cap clipped the result
|
|
2636
|
+
}
|
|
2637
|
+
|
|
2414
2638
|
export interface BrokenRefItem {
|
|
2415
2639
|
ref_link_id: string;
|
|
2416
2640
|
source_type: string;
|
|
@@ -2778,13 +3002,28 @@ export interface InvokeClipResponse {
|
|
|
2778
3002
|
error: string | null;
|
|
2779
3003
|
}
|
|
2780
3004
|
|
|
2781
|
-
|
|
3005
|
+
/**
|
|
3006
|
+
* profile.status is owner INTENT only, never runtime readiness:
|
|
3007
|
+
* - BYOC: pending | running | stopped | error
|
|
3008
|
+
* - hosted: idle | stopped | error (idle = enabled, activates lazily on invoke/viewer)
|
|
3009
|
+
* Whether a hosted pod is registered + routable is the lease/controller/provider's
|
|
3010
|
+
* runtime state, NOT profile status — hosted profiles are never `active`.
|
|
3011
|
+
*/
|
|
3012
|
+
export type BrowserProfileStatus = 'pending' | 'running' | 'stopped' | 'error' | 'idle';
|
|
3013
|
+
|
|
3014
|
+
/**
|
|
3015
|
+
* Routing/identity discriminant: `byoc` runs on a user machine (machine_id
|
|
3016
|
+
* required), `hosted` runs on the platform pool (machine_id null).
|
|
3017
|
+
*/
|
|
3018
|
+
export type BrowserPlacement = 'byoc' | 'hosted';
|
|
2782
3019
|
|
|
2783
3020
|
export interface BrowserProfile {
|
|
2784
3021
|
id: string;
|
|
2785
3022
|
org_id: string;
|
|
2786
|
-
/**
|
|
2787
|
-
|
|
3023
|
+
/** byoc = user machine, hosted = platform pool. */
|
|
3024
|
+
placement: BrowserPlacement;
|
|
3025
|
+
/** Host machine for byoc profiles; null for hosted (the platform pool owns the pod). */
|
|
3026
|
+
machine_id: string | null;
|
|
2788
3027
|
owner_user_id: string;
|
|
2789
3028
|
display_name: string;
|
|
2790
3029
|
status: BrowserProfileStatus;
|
|
@@ -2793,6 +3032,65 @@ export interface BrowserProfile {
|
|
|
2793
3032
|
created_by?: string | null;
|
|
2794
3033
|
created_at: string;
|
|
2795
3034
|
updated_at: string;
|
|
3035
|
+
/** Control hint on the single-profile responses (create / get / lifecycle) —
|
|
3036
|
+
* always true, since reaching those endpoints means the caller passed the read
|
|
3037
|
+
* or control gate and owner/admin can always control. The org-wide list uses
|
|
3038
|
+
* {@link BrowserProfileListItem.can_open} (per-viewer) instead. */
|
|
3039
|
+
can_open?: boolean;
|
|
3040
|
+
/** Per-profile outbound proxy (BYO provider credentials). Returned to the owner /
|
|
3041
|
+
* org admin (Get) for the edit form. The password is NEVER returned —
|
|
3042
|
+
* {@link proxy_password_set} reports only whether one is configured. */
|
|
3043
|
+
proxy_server?: string | null;
|
|
3044
|
+
proxy_username?: string | null;
|
|
3045
|
+
/** True when a proxy password is stored. Drives the edit form's "leave blank to
|
|
3046
|
+
* keep" affordance; the value itself is never sent to a human-facing client. */
|
|
3047
|
+
proxy_password_set?: boolean;
|
|
3048
|
+
}
|
|
3049
|
+
|
|
3050
|
+
/** Sanitized row from `GET /orgs/{orgId}/browser-profiles` (org-wide discovery).
|
|
3051
|
+
* Carries only the fields the Browser Profiles tab needs to render + gate
|
|
3052
|
+
* actions — the full domain model (provenance, timestamps) is never returned
|
|
3053
|
+
* org-wide. `error_msg` / `last_seen` are present only for readers (the profile
|
|
3054
|
+
* owner or an org admin), not merely for own-local host owners who can `can_open`. */
|
|
3055
|
+
export interface BrowserProfileListItem {
|
|
3056
|
+
id: string;
|
|
3057
|
+
org_id: string;
|
|
3058
|
+
/** byoc = user machine, hosted = platform pool. */
|
|
3059
|
+
placement: BrowserPlacement;
|
|
3060
|
+
/** Host machine for byoc; null for hosted (the platform pool owns the pod). */
|
|
3061
|
+
machine_id: string | null;
|
|
3062
|
+
owner_user_id: string;
|
|
3063
|
+
display_name: string;
|
|
3064
|
+
status: BrowserProfileStatus;
|
|
3065
|
+
/** Per-viewer control hint computed by the server (owner / org admin / own
|
|
3066
|
+
* local host machine). Optional only for forward-compat with an older
|
|
3067
|
+
* clip-service mid web-first rollout; the current server always sets it. */
|
|
3068
|
+
can_open?: boolean;
|
|
3069
|
+
error_msg?: string | null;
|
|
3070
|
+
last_seen?: string | null;
|
|
3071
|
+
/** Non-sensitive discovery flag: does this profile egress through a proxy. The
|
|
3072
|
+
* proxy server / credentials are NOT in the org-wide list (owner/admin Get only). */
|
|
3073
|
+
proxy_configured?: boolean;
|
|
3074
|
+
}
|
|
3075
|
+
|
|
3076
|
+
/** Daemon-facing browser profile returned by `GET /machines/me/browser-profiles`
|
|
3077
|
+
* (mck_-authed, machine-scoped). Unlike {@link BrowserProfile} it carries
|
|
3078
|
+
* `proxy_password`: the local BYOC daemon must replay it to bb-browser. This is the
|
|
3079
|
+
* single intended channel for the credential to leave the server — never surface it
|
|
3080
|
+
* on a human-facing path. */
|
|
3081
|
+
export interface MachineBrowserProfile {
|
|
3082
|
+
id: string;
|
|
3083
|
+
org_id: string;
|
|
3084
|
+
placement: BrowserPlacement;
|
|
3085
|
+
machine_id: string | null;
|
|
3086
|
+
owner_user_id: string;
|
|
3087
|
+
display_name: string;
|
|
3088
|
+
status: BrowserProfileStatus;
|
|
3089
|
+
error_msg?: string | null;
|
|
3090
|
+
last_seen?: string | null;
|
|
3091
|
+
proxy_server?: string | null;
|
|
3092
|
+
proxy_username?: string | null;
|
|
3093
|
+
proxy_password?: string | null;
|
|
2796
3094
|
}
|
|
2797
3095
|
|
|
2798
3096
|
export interface BrowserProfileConsent {
|
|
@@ -2807,14 +3105,27 @@ export interface BrowserProfileConsent {
|
|
|
2807
3105
|
}
|
|
2808
3106
|
|
|
2809
3107
|
export interface CreateBrowserProfileRequest {
|
|
2810
|
-
/**
|
|
2811
|
-
|
|
3108
|
+
/** Defaults to `byoc` when omitted (backward compatible). */
|
|
3109
|
+
placement?: BrowserPlacement;
|
|
3110
|
+
/** Required for byoc; omitted for hosted (the platform pool assigns a pod). */
|
|
3111
|
+
machine_id?: string | null;
|
|
2812
3112
|
owner_user_id: string;
|
|
2813
3113
|
display_name: string;
|
|
3114
|
+
/** Optional BYO proxy. Omit all for direct egress. proxy_server is `host:port`
|
|
3115
|
+
* (optional http/https/socks5 scheme); proxy_username/password are sent together. */
|
|
3116
|
+
proxy_server?: string | null;
|
|
3117
|
+
proxy_username?: string | null;
|
|
3118
|
+
proxy_password?: string | null;
|
|
2814
3119
|
}
|
|
2815
3120
|
|
|
2816
3121
|
export interface UpdateBrowserProfileRequest {
|
|
2817
3122
|
display_name?: string;
|
|
3123
|
+
/** Per-field proxy edit (tri-state): omit = leave unchanged, "" = clear (an empty
|
|
3124
|
+
* proxy_server clears the whole proxy), value = set. Omitting proxy_password keeps
|
|
3125
|
+
* the stored one (never re-entered / echoed). */
|
|
3126
|
+
proxy_server?: string | null;
|
|
3127
|
+
proxy_username?: string | null;
|
|
3128
|
+
proxy_password?: string | null;
|
|
2818
3129
|
}
|
|
2819
3130
|
|
|
2820
3131
|
export interface BrowserProfileLifecycleRequest {
|
|
@@ -2921,12 +3232,19 @@ export interface ClipRemovedData {
|
|
|
2921
3232
|
|
|
2922
3233
|
// ─── Unified Search ───
|
|
2923
3234
|
|
|
2924
|
-
|
|
3235
|
+
// A type alias (not an interface) so it carries an implicit index signature and
|
|
3236
|
+
// can be passed straight to the query-string serializer in client.ts.
|
|
3237
|
+
export type SearchParams = {
|
|
2925
3238
|
q: string;
|
|
3239
|
+
/** Entity selector CSV: message / task / wiki. Distinct from `wiki_type`. */
|
|
2926
3240
|
types?: string;
|
|
2927
3241
|
chat_id?: string;
|
|
2928
3242
|
limit?: number;
|
|
2929
|
-
|
|
3243
|
+
/** Wiki document-type facet (frontmatter `type`) — a separate axis from `types`. */
|
|
3244
|
+
wiki_type?: string;
|
|
3245
|
+
/** RFC3339 or YYYY-MM-DD; narrows messages (created_at) and tasks (updated_at). Not applied to wiki. */
|
|
3246
|
+
since?: string;
|
|
3247
|
+
};
|
|
2930
3248
|
|
|
2931
3249
|
export interface SearchMessageResult {
|
|
2932
3250
|
message_id: string;
|