@parall/sdk 1.56.1 → 1.57.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.
Files changed (40) hide show
  1. package/dist/attachment-client.d.ts +2 -2
  2. package/dist/attachment-client.d.ts.map +1 -1
  3. package/dist/attachment-client.js +2 -2
  4. package/dist/browser-use.d.ts +288 -0
  5. package/dist/browser-use.d.ts.map +1 -0
  6. package/dist/browser-use.js +6 -0
  7. package/dist/client.d.ts +14 -17
  8. package/dist/client.d.ts.map +1 -1
  9. package/dist/client.js +35 -29
  10. package/dist/constants.d.ts +12 -0
  11. package/dist/constants.d.ts.map +1 -1
  12. package/dist/constants.js +22 -0
  13. package/dist/index.d.ts +3 -0
  14. package/dist/index.d.ts.map +1 -1
  15. package/dist/index.js +2 -0
  16. package/dist/llm-provider-client.d.ts +38 -0
  17. package/dist/llm-provider-client.d.ts.map +1 -0
  18. package/dist/llm-provider-client.js +57 -0
  19. package/dist/llm-provider-types.d.ts +97 -0
  20. package/dist/llm-provider-types.d.ts.map +1 -0
  21. package/dist/llm-provider-types.js +6 -0
  22. package/dist/types.d.ts +56 -70
  23. package/dist/types.d.ts.map +1 -1
  24. package/dist/wiki-changeset.d.ts +4 -0
  25. package/dist/wiki-changeset.d.ts.map +1 -0
  26. package/dist/wiki-changeset.js +11 -0
  27. package/dist/wiki-upload.d.ts +43 -0
  28. package/dist/wiki-upload.d.ts.map +1 -0
  29. package/dist/wiki-upload.js +87 -0
  30. package/package.json +1 -1
  31. package/src/attachment-client.ts +2 -2
  32. package/src/browser-use.ts +217 -0
  33. package/src/client.ts +60 -30
  34. package/src/constants.ts +22 -0
  35. package/src/index.ts +8 -0
  36. package/src/llm-provider-client.ts +96 -0
  37. package/src/llm-provider-types.ts +104 -0
  38. package/src/types.ts +83 -101
  39. package/src/wiki-changeset.ts +13 -0
  40. package/src/wiki-upload.ts +142 -0
@@ -0,0 +1,97 @@
1
+ /**
2
+ * Org-configured model providers (BYOK) and the model rows bound to them.
3
+ *
4
+ * Design: docs/engineering-design/org-llm-provider-byok-design.md
5
+ */
6
+ /** Inbound protocol a provider can serve. */
7
+ export type LLMProviderEndpoint = 'chat_completions' | 'messages' | 'responses';
8
+ export type LLMProviderStatus = 'active' | 'disabled';
9
+ /**
10
+ * A provider as the server returns it. The credential is never echoed back —
11
+ * `api_key_set` is the only thing a client learns about it.
12
+ */
13
+ export interface LLMProvider {
14
+ id: string;
15
+ name: string;
16
+ base_url: string;
17
+ api_key_set: boolean;
18
+ endpoints: LLMProviderEndpoint[];
19
+ status: LLMProviderStatus;
20
+ is_platform: boolean;
21
+ /**
22
+ * Runtime types whose protocol this provider can actually serve. Anything
23
+ * absent here silently uses the platform provider — surface this, or an
24
+ * operator will assume their credential covers every agent.
25
+ */
26
+ runtimes: string[];
27
+ /** Most recent fallback-worthy failure, if any. */
28
+ last_error_at?: string | null;
29
+ last_error_status?: number | null;
30
+ created_at: string;
31
+ updated_at: string;
32
+ }
33
+ export interface CreateLLMProviderRequest {
34
+ name: string;
35
+ base_url: string;
36
+ api_key: string;
37
+ endpoints: LLMProviderEndpoint[];
38
+ }
39
+ /** Omitting `api_key` leaves the stored credential untouched. */
40
+ export interface UpdateLLMProviderRequest {
41
+ name?: string;
42
+ base_url?: string;
43
+ api_key?: string;
44
+ endpoints?: LLMProviderEndpoint[];
45
+ status?: LLMProviderStatus;
46
+ }
47
+ /**
48
+ * One org's row for a model. Overriding a platform model and adding a new one
49
+ * are the same shape: `overrides_platform` is derived by the server from
50
+ * whether the platform catalog knows this id, never stored.
51
+ */
52
+ export interface OrgLLMModel {
53
+ id: string;
54
+ model_id: string;
55
+ provider_id: string;
56
+ upstream_model_id: string;
57
+ display_name?: string | null;
58
+ context_window?: number | null;
59
+ max_tokens?: number | null;
60
+ overrides_platform: boolean;
61
+ created_at: string;
62
+ updated_at: string;
63
+ }
64
+ export interface CreateOrgLLMModelRequest {
65
+ model_id: string;
66
+ provider_id: string;
67
+ /** The name to send to this provider, which differs per provider. */
68
+ upstream_model_id: string;
69
+ /** Required when `model_id` is not in the platform catalog. */
70
+ display_name?: string;
71
+ context_window?: number;
72
+ max_tokens?: number;
73
+ effort_levels?: string[];
74
+ input_modalities?: string[];
75
+ }
76
+ /**
77
+ * Everything about a model row except its identity. `model_id` is what agents
78
+ * pin to, so changing it is a delete-and-recreate the operator performs
79
+ * deliberately; the server rejects it here.
80
+ */
81
+ export interface UpdateOrgLLMModelRequest {
82
+ provider_id?: string;
83
+ upstream_model_id?: string;
84
+ /**
85
+ * Metadata fields accept `null` to clear the org's value and go back to
86
+ * inheriting the platform entry's. Omitting a field leaves it as it is —
87
+ * the two are different requests, so do not send `undefined` meaning
88
+ * "clear". A model the platform does not have cannot clear these: it has
89
+ * nothing to inherit from, and the server rejects it.
90
+ */
91
+ display_name?: string | null;
92
+ context_window?: number | null;
93
+ max_tokens?: number | null;
94
+ effort_levels?: string[] | null;
95
+ input_modalities?: string[] | null;
96
+ }
97
+ //# sourceMappingURL=llm-provider-types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"llm-provider-types.d.ts","sourceRoot":"","sources":["../src/llm-provider-types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,6CAA6C;AAC7C,MAAM,MAAM,mBAAmB,GAAG,kBAAkB,GAAG,UAAU,GAAG,WAAW,CAAC;AAEhF,MAAM,MAAM,iBAAiB,GAAG,QAAQ,GAAG,UAAU,CAAC;AAEtD;;;GAGG;AACH,MAAM,WAAW,WAAW;IAC1B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,OAAO,CAAC;IACrB,SAAS,EAAE,mBAAmB,EAAE,CAAC;IACjC,MAAM,EAAE,iBAAiB,CAAC;IAC1B,WAAW,EAAE,OAAO,CAAC;IACrB;;;;OAIG;IACH,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,mDAAmD;IACnD,aAA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Aa,CAAC,EAAE,MAAM,EAAE,CAAC;IACzB,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAC;CAC7B;AAED;;;;GAIG;AACH,MAAM,WAAW,wBAAwB;IACvC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B;;;;;;OAMG;IACH,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,aAAa,CAAC,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IAChC,gBAAgB,CAAC,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;CACpC"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Org-configured model providers (BYOK) and the model rows bound to them.
3
+ *
4
+ * Design: docs/engineering-design/org-llm-provider-byok-design.md
5
+ */
6
+ export {};
package/dist/types.d.ts CHANGED
@@ -376,6 +376,25 @@ export interface Organization {
376
376
  onboarding_agent_id: string | null;
377
377
  /** Org-level IANA timezone (e.g. "America/New_York"). Defaults to "UTC". */
378
378
  timezone: string;
379
+ /**
380
+ * Whether this org may configure its own LLM providers (BYOK). Absent means
381
+ * it inherits the platform default, which is off.
382
+ *
383
+ * An entitlement, not a feature flag: only a platform admin changes it, and
384
+ * it is expected to become plan-driven. Turning it off also stops existing
385
+ * provider configuration from taking effect.
386
+ */
387
+ llm_byok_enabled?: boolean | null;
388
+ /**
389
+ * When an org's own model provider fails at run time, retry once on the
390
+ * platform provider — billed to this org's credit balance. Defaults to off,
391
+ * so "no fallback" is the default state and fallback is opted into.
392
+ * Does NOT gate the capability fallback: a provider that cannot serve a
393
+ * runtime's protocol always defers to the platform regardless.
394
+ * Current servers populate this field; it remains optional for source
395
+ * compatibility with cached and rolling-upgrade organization payloads.
396
+ */
397
+ llm_byok_fallback_enabled?: boolean;
379
398
  created_at: string;
380
399
  /** Per-member flag: true when the user has dismissed the onboarding popup for this org. */
381
400
  onboarding_dismissed: boolean;
@@ -561,6 +580,23 @@ export interface CreateInvitationRequest {
561
580
  export interface ApiKey {
562
581
  id: string;
563
582
  api_key: string;
583
+ org_id?: string;
584
+ }
585
+ export interface PersonalApiKey {
586
+ id: string;
587
+ user_id: string;
588
+ name?: string;
589
+ org_id: string;
590
+ last_used_at?: string;
591
+ expires_at?: string;
592
+ created_at: string;
593
+ }
594
+ export interface CreatePersonalApiKeyRequest {
595
+ name?: string;
596
+ /** The org this key is bound to; the caller must be a member. */
597
+ org_id: string;
598
+ /** RFC3339; must be in the future. Omit for a non-expiring key. */
599
+ expires_at?: string;
564
600
  }
565
601
  export interface CreateAgentResponse {
566
602
  user: User;
@@ -856,10 +892,8 @@ export interface MessageDispatchSource {
856
892
  source_type: string;
857
893
  source_id: string;
858
894
  /**
859
- * Conversation generation of the sending execution (parel v2 invocation
860
- * context). Required by the server for agents on the direct_session_v2
861
- * transport; a value older than the current New Session barrier is
862
- * rejected (STALE_GENERATION).
895
+ * @deprecated Ignored by current servers. Retained so clients compiled
896
+ * against older SDKs can upgrade without source changes.
863
897
  */
864
898
  generation?: number;
865
899
  }
@@ -1448,8 +1482,8 @@ export interface UpdateTaskRequest {
1448
1482
  * Lane-bound form (v1 consumers): dispatch_lane + dispatch_event_id bind
1449
1483
  * the update to the claimed typed lane (incumbency-checked).
1450
1484
  * By-id form (parel v2 converged consumers — no lane exists):
1451
- * dispatch_event_id + dispatch_generation bind the update to the WorkItem
1452
- * directly under the conversation-generation fence.
1485
+ * dispatch_event_id alone binds the update to the WorkItem; the server
1486
+ * admits it on the binding's transport and deletion state alone.
1453
1487
  * In both forms dispatch_effect_key additionally commits the update as
1454
1488
  * the dispatch's idempotent Effect and resolves the WorkItem in the same
1455
1489
  * transaction. Lane-bound: exactly "task_update:<dispatch_event_id>" —
@@ -1462,6 +1496,10 @@ export interface UpdateTaskRequest {
1462
1496
  dispatch_lane?: string;
1463
1497
  dispatch_event_id?: string;
1464
1498
  dispatch_effect_key?: string;
1499
+ /**
1500
+ * @deprecated Ignored by current servers. Retained so clients compiled
1501
+ * against older SDKs can upgrade without source changes.
1502
+ */
1465
1503
  dispatch_generation?: number;
1466
1504
  }
1467
1505
  export interface CreateTaskRelationRequest {
@@ -1964,6 +2002,10 @@ export interface WikiChangeset {
1964
2002
  title: string;
1965
2003
  message: string | null;
1966
2004
  status: WikiChangesetStatus;
2005
+ /** Present on current servers; optional keeps older mocked/client data source-compatible. */
2006
+ head_branch?: string | null;
2007
+ /** Present on current servers; optional keeps older mocked/client data source-compatible. */
2008
+ base_commit?: string | null;
1967
2009
  merge_commit: string | null;
1968
2010
  file_changes: WikiFileChange[];
1969
2011
  changed_paths: string[];
@@ -2195,6 +2237,8 @@ export interface CreateWikiChangesetRequest {
2195
2237
  title: string;
2196
2238
  message?: string;
2197
2239
  file_changes: WikiFileChangeInput[];
2240
+ /** Omit for the server default (`proposed`); pass `draft` for staged uploads. */
2241
+ status?: 'draft' | 'proposed';
2198
2242
  source_chat_id?: string;
2199
2243
  source_message_id?: string;
2200
2244
  source_run_id?: string;
@@ -2203,6 +2247,8 @@ export interface UpdateWikiChangesetRequest {
2203
2247
  title?: string;
2204
2248
  message?: string;
2205
2249
  file_changes?: WikiFileChangeInput[];
2250
+ /** Author-settable transitions currently include `proposed` and `closed`. */
2251
+ status?: 'proposed' | 'closed';
2206
2252
  /**
2207
2253
  * When true, file_changes define the changeset's FULL content: the server
2208
2254
  * resets the feature branch to the current default-branch HEAD before
@@ -2321,15 +2367,6 @@ export interface WikiBlob {
2321
2367
  signed_url?: string;
2322
2368
  signed_url_expires_at?: string;
2323
2369
  }
2324
- export type WikiStoredAs = 'git_blob' | 'lfs_pointer';
2325
- /** Response from POST /uploads or POST /changesets/{csId}/files. */
2326
- export interface WikiFileUploadResponse {
2327
- path: string;
2328
- size: number;
2329
- stored_as: WikiStoredAs;
2330
- commit_sha: string;
2331
- content_sha: string;
2332
- }
2333
2370
  /** Response from POST /files/preview-url — short-lived signed URL for
2334
2371
  * browser `<img>`/`<video>`/`<iframe>` src. TTL is 5 minutes by default. */
2335
2372
  export interface WikiFilePreviewUrlResponse {
@@ -2757,6 +2794,7 @@ export interface ChannelConversation {
2757
2794
  agent_id: string;
2758
2795
  agent_session_id?: string | null;
2759
2796
  external_conversation_id: string;
2797
+ external_conversation_name?: string;
2760
2798
  external_thread_id: string;
2761
2799
  conversation_type: string;
2762
2800
  external_user_id: string;
@@ -3456,6 +3494,8 @@ export interface ResolvedRef {
3456
3494
  type: string;
3457
3495
  exists: boolean;
3458
3496
  restricted?: boolean;
3497
+ /** The target could not be resolved because a dependency failed temporarily. */
3498
+ unavailable?: boolean;
3459
3499
  display_name?: string;
3460
3500
  avatar_url?: string | null;
3461
3501
  user_type?: string;
@@ -4585,61 +4625,7 @@ export interface BrowserAliasExecutionReceipt {
4585
4625
  terminal_at?: string;
4586
4626
  updated_at: string;
4587
4627
  }
4588
- export type BrowserUseAction = 'read' | 'tabs' | 'wait' | 'snapshot' | 'get' | 'screenshot' | 'open' | 'navigate' | 'viewport' | 'click' | 'fill' | 'type' | 'press' | 'scroll' | 'close' | 'recover' | 'eval';
4589
- export interface BrowserUseTarget {
4590
- tab_id?: string;
4591
- browser_generation?: number;
4592
- document_generation?: number;
4593
- snapshot_id?: string;
4594
- ref?: string;
4595
- }
4596
- export interface BrowserUseOperationRequest {
4597
- contract_version: 'browser-use-operation-v1';
4598
- request_id: string;
4599
- profile_id: string;
4600
- action: BrowserUseAction;
4601
- target?: BrowserUseTarget;
4602
- params: Record<string, unknown>;
4603
- /** Canonical RFC3339 UTC instant, no more than two minutes in the future. */
4604
- deadline: string;
4605
- }
4606
- export type BrowserUseOperationPhase = 'accepted' | 'started' | 'succeeded' | 'failed' | 'outcome_unknown';
4607
- export interface BrowserUseOperationError {
4608
- code: string;
4609
- message?: string;
4610
- hint?: string;
4611
- }
4612
- /** Durable Browser Use proof. `data` is encrypted/transient: it is present
4613
- * only while result_available is true and disappears after result_expires_at;
4614
- * the terminal receipt and result_digest remain durable. */
4615
- export interface BrowserUseOperationReceipt {
4616
- contract_version: 'browser-use-operation-v1';
4617
- operation_id: string;
4618
- request_id: string;
4619
- profile_id: string;
4620
- profile_version: number;
4621
- profile_config_revision: number;
4622
- action: BrowserUseAction;
4623
- required_grant: 'browser.read' | 'browser.interact' | 'browser.advanced';
4624
- phase: BrowserUseOperationPhase;
4625
- dispatched?: boolean;
4626
- receipt_id?: string;
4627
- receipt_digest?: string;
4628
- occurred_at?: string;
4629
- tab_id?: string;
4630
- browser_generation?: number;
4631
- duration_ms?: number;
4632
- result_digest?: string;
4633
- result_available: boolean;
4634
- result_expires_at?: string;
4635
- data?: unknown;
4636
- error?: BrowserUseOperationError;
4637
- deadline: string;
4638
- accepted_at: string;
4639
- started_at?: string;
4640
- terminal_at?: string;
4641
- updated_at: string;
4642
- }
4628
+ export type { BrowserUseAction, BrowserUseActionRequest, BrowserUseArticle, BrowserUseGrant, BrowserUseOperationError, BrowserUseOperationPhase, BrowserUseOperationReceipt, BrowserUseOperationReceiptBase, BrowserUseOperationReceiptFor, BrowserUseOperationRequest, BrowserUseRefTarget, BrowserUseSuccessDataMap, BrowserUseTabState, BrowserUseTabSummary, BrowserUseTabTarget, BrowserUseTarget, BrowserUseViewport, } from './browser-use.js';
4643
4629
  /**
4644
4630
  * Sanitized per-profile egress proxy status (hosted Cloud Profiles) — the GET
4645
4631
  * response and the PUT/DELETE result. NEVER carries the password; `password_set`