@vxil/sdk 0.28.0 → 0.29.0

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/index.d.ts CHANGED
@@ -219,9 +219,13 @@ export interface Delivery {
219
219
  * sunk at delivery time (an address added to `testRecipients` after the send
220
220
  * was queued): those are rendered WITHOUT the send's data (`rendered_from:
221
221
  * 'send_redacted'`), so a sign-in link, code or reset link is never stored or
222
- * readable. For every other row the template variables were never stored, so
223
- * `rendered` is the template re-rendered with no data (`rendered_from:
224
- * 'template'`), or null when it cannot be rendered. */
222
+ * readable. A `sent` row of a project with `templates.retainSentRender: true`
223
+ * carries the render of the real send the same way (`'send'`, or
224
+ * `'send_redacted'` for auth mail) for 7 days after `sent_at`. For every other
225
+ * row the template variables were never stored, so `rendered` is the template
226
+ * re-rendered with NO data — every `{{placeholder}}` empty, including the
227
+ * `transactional` subject (`rendered_from: 'template'`), or null when it
228
+ * cannot be rendered. */
225
229
  export interface DeliveryDetail extends Delivery {
226
230
  last_error_msg?: string | null;
227
231
  rendered: {
@@ -1393,6 +1397,12 @@ export interface AiToolCall {
1393
1397
  * not accept it (newer flash and Pro models; flash-lite accepts it). Thinking
1394
1398
  * tokens are billed as output tokens. */
1395
1399
  export type AiThinkingLevel = 'minimal' | 'low' | 'medium' | 'high';
1400
+ /** Gemini media resolution for `ai.generate` / `stream` / `generateAsync`
1401
+ * (`media_resolution`): the token budget Gemini spends per image or PDF page.
1402
+ * A lower level is faster and bills fewer input tokens. Sent to Gemini only —
1403
+ * every other provider ignores it; omitted →
1404
+ * `features.ai.defaults.mediaResolution` → the model's own default. */
1405
+ export type AiMediaResolution = 'low' | 'medium' | 'high';
1396
1406
  /** A prior conversation turn for the tool-calling round-trip: assistant turns
1397
1407
  * carry the tool_calls they made; `role:'tool'` turns carry one call's result
1398
1408
  * (`tool_call_id` correlates it; `name` is the tool's name). */
@@ -4891,10 +4901,14 @@ export declare class Vxil<S extends VxilSchemaShape = VxilSchemaShape> {
4891
4901
  * config `security.allowedRedirectOrigins` when set (else
4892
4902
  * `422 redirect_not_allowed`), and the state expires after
4893
4903
  * `expires_in` seconds (600). `anonymous_token` (a guest bearer)
4894
- * promotes or merges that guest at the callback. */
4904
+ * promotes or merges that guest at the callback. `prompt` (google and
4905
+ * oidc only; 2026-10-23) asks the provider to show its account picker
4906
+ * (`select_account`), the consent screen (`consent`) or a fresh sign-in
4907
+ * (`login`); any other value, or a prompt on another provider, is a 422. */
4895
4908
  startUrl: (provider: "google" | "apple" | "github" | "facebook" | "mock" | "oidc", input: {
4896
4909
  redirect_uri: string;
4897
4910
  anonymous_token?: string;
4911
+ prompt?: "select_account" | "consent" | "login";
4898
4912
  }) => Promise<{
4899
4913
  authorize_url: string;
4900
4914
  expires_in: number;
@@ -6718,6 +6732,12 @@ export declare class Vxil<S extends VxilSchemaShape = VxilSchemaShape> {
6718
6732
  mode?: "hybrid" | "vector" | "keyword";
6719
6733
  filter?: SearchFilter;
6720
6734
  rrf_k?: number;
6735
+ /** Hybrid mode only: per-lane RRF weights (0..100 each, not both 0).
6736
+ * Default: the config's `hybrid.weights`, else 1 / 1 (unweighted). */
6737
+ weights?: {
6738
+ vector: number;
6739
+ keyword: number;
6740
+ };
6721
6741
  vector?: number[];
6722
6742
  rerank?: boolean;
6723
6743
  /** orgScoped collections: the workspace to search — REQUIRED with a
@@ -6819,6 +6839,8 @@ export declare class Vxil<S extends VxilSchemaShape = VxilSchemaShape> {
6819
6839
  temperature?: number;
6820
6840
  /** Gemini thinking depth — see AiThinkingLevel. */
6821
6841
  thinking_level?: AiThinkingLevel;
6842
+ /** Gemini per-image / per-page token budget — see AiMediaResolution. */
6843
+ media_resolution?: AiMediaResolution;
6822
6844
  tools?: Array<{
6823
6845
  name: string;
6824
6846
  description?: string;
@@ -6879,6 +6901,8 @@ export declare class Vxil<S extends VxilSchemaShape = VxilSchemaShape> {
6879
6901
  temperature?: number;
6880
6902
  /** Gemini thinking depth — see AiThinkingLevel. */
6881
6903
  thinking_level?: AiThinkingLevel;
6904
+ /** Gemini per-image / per-page token budget — see AiMediaResolution. */
6905
+ media_resolution?: AiMediaResolution;
6882
6906
  tools?: Array<{
6883
6907
  name: string;
6884
6908
  description?: string;
@@ -6916,6 +6940,8 @@ export declare class Vxil<S extends VxilSchemaShape = VxilSchemaShape> {
6916
6940
  temperature?: number;
6917
6941
  /** Gemini thinking depth — see AiThinkingLevel. */
6918
6942
  thinking_level?: AiThinkingLevel;
6943
+ /** Gemini per-image / per-page token budget — see AiMediaResolution. */
6944
+ media_resolution?: AiMediaResolution;
6919
6945
  tools?: Array<{
6920
6946
  name: string;
6921
6947
  description?: string;
@@ -6977,6 +7003,12 @@ export declare class Vxil<S extends VxilSchemaShape = VxilSchemaShape> {
6977
7003
  };
6978
7004
  }, opts?: {
6979
7005
  idempotencyKey?: string;
7006
+ /** Interactive job runs: bound the run's FIRST provider call at this
7007
+ * many ms (integer 1000–17000; sent as `deadline_ms`). A run with a
7008
+ * deadline can start without the queue hop; a first call that passes
7009
+ * it is retried on the queue with the normal job-lane bound. Pair it
7010
+ * with `getGeneration(id, { wait: 25 })`. */
7011
+ deadlineMs?: number;
6980
7012
  }) => Promise<AiJobHandle>;
6981
7013
  /** One generation: status, usage, run, and — for a settled job-lane
6982
7014
  * generation — the settled answer (`result`, kept 30 days). In end-user
@@ -6985,7 +7017,7 @@ export declare class Vxil<S extends VxilSchemaShape = VxilSchemaShape> {
6985
7017
  * until the generation is `completed` / `failed` — ONE API call instead of
6986
7018
  * a poll loop; if it is still running at the deadline the current record
6987
7019
  * comes back with `wait: 'timeout'` (`'unavailable'` when the per-tenant
6988
- * budget of 60 held reads a minute declined to hold). A client
7020
+ * budget of 300 held reads a minute declined to hold). A client
6989
7021
  * `timeoutMs` shorter than `wait` × 1000 aborts the call first. */
6990
7022
  getGeneration: (generationId: string, opts?: {
6991
7023
  wait?: number;
@@ -7415,11 +7447,13 @@ export declare class Vxil<S extends VxilSchemaShape = VxilSchemaShape> {
7415
7447
  * a slow transaction can commit a row behind one already listed. `limit` 1..500 (default 100).
7416
7448
  * Needs payments:read. SERVER-SIDE KEYS ONLY — a thin-client
7417
7449
  * (`end_user_required`) key gets 403 `server_only` (use `usage` for one
7418
- * user's own rows). */
7450
+ * user's own rows). `org_id` (2026-10-23) lists one workspace's rows (the
7451
+ * same as `user_id: 'org:<id>'`); give it OR `user_id`. */
7419
7452
  ledger: (q?: {
7420
7453
  since?: string;
7421
7454
  cursor?: string;
7422
7455
  user_id?: string;
7456
+ org_id?: string;
7423
7457
  credit_type?: string;
7424
7458
  limit?: number;
7425
7459
  }) => Promise<{
package/dist/index.js CHANGED
@@ -1483,11 +1483,15 @@ export class Vxil {
1483
1483
  * config `security.allowedRedirectOrigins` when set (else
1484
1484
  * `422 redirect_not_allowed`), and the state expires after
1485
1485
  * `expires_in` seconds (600). `anonymous_token` (a guest bearer)
1486
- * promotes or merges that guest at the callback. */
1486
+ * promotes or merges that guest at the callback. `prompt` (google and
1487
+ * oidc only; 2026-10-23) asks the provider to show its account picker
1488
+ * (`select_account`), the consent screen (`consent`) or a fresh sign-in
1489
+ * (`login`); any other value, or a prompt on another provider, is a 422. */
1487
1490
  startUrl: async (provider, input) => {
1488
1491
  // plain encodeURIComponent (no URLSearchParams — React Native ≤ 0.79)
1489
1492
  const q = `redirect_uri=${encodeURIComponent(input.redirect_uri)}`
1490
- + (input.anonymous_token ? `&anonymous_token=${encodeURIComponent(input.anonymous_token)}` : '');
1493
+ + (input.anonymous_token ? `&anonymous_token=${encodeURIComponent(input.anonymous_token)}` : '')
1494
+ + (input.prompt ? `&prompt=${encodeURIComponent(input.prompt)}` : '');
1491
1495
  return (await this.call('GET', `/v1/auth/oauth/${encodeURIComponent(provider)}/start?${q}`, undefined, { accept: 'application/json' })).data;
1492
1496
  },
1493
1497
  /** Native social sign-in: exchange a provider `id_token`/`access_token`
@@ -2576,7 +2580,7 @@ export class Vxil {
2576
2580
  * `opts.idempotencyKey` deduplicates for 24 h: a re-send after a timeout
2577
2581
  * or a lost answer returns the ORIGINAL handle (`deduplicated: true`) and
2578
2582
  * never pays the provider twice. */
2579
- generateAsync: async (input, opts) => (await this.call('POST', '/v1/ai/generate', { ...input, mode: 'job' }, opts?.idempotencyKey ? { 'idempotency-key': opts.idempotencyKey } : {})).data,
2583
+ generateAsync: async (input, opts) => (await this.call('POST', '/v1/ai/generate', { ...input, mode: 'job', ...(opts?.deadlineMs !== undefined ? { deadline_ms: opts.deadlineMs } : {}) }, opts?.idempotencyKey ? { 'idempotency-key': opts.idempotencyKey } : {})).data,
2580
2584
  /** One generation: status, usage, run, and — for a settled job-lane
2581
2585
  * generation — the settled answer (`result`, kept 30 days). In end-user
2582
2586
  * mode only the caller's own generation reads (a foreign id is a 404).
@@ -2584,7 +2588,7 @@ export class Vxil {
2584
2588
  * until the generation is `completed` / `failed` — ONE API call instead of
2585
2589
  * a poll loop; if it is still running at the deadline the current record
2586
2590
  * comes back with `wait: 'timeout'` (`'unavailable'` when the per-tenant
2587
- * budget of 60 held reads a minute declined to hold). A client
2591
+ * budget of 300 held reads a minute declined to hold). A client
2588
2592
  * `timeoutMs` shorter than `wait` × 1000 aborts the call first. */
2589
2593
  getGeneration: async (generationId, opts) => {
2590
2594
  const qs = opts?.wait !== undefined ? `?wait=${encodeURIComponent(String(opts.wait))}` : '';
@@ -2860,12 +2864,14 @@ export class Vxil {
2860
2864
  * a slow transaction can commit a row behind one already listed. `limit` 1..500 (default 100).
2861
2865
  * Needs payments:read. SERVER-SIDE KEYS ONLY — a thin-client
2862
2866
  * (`end_user_required`) key gets 403 `server_only` (use `usage` for one
2863
- * user's own rows). */
2867
+ * user's own rows). `org_id` (2026-10-23) lists one workspace's rows (the
2868
+ * same as `user_id: 'org:<id>'`); give it OR `user_id`. */
2864
2869
  ledger: async (q) => {
2865
2870
  const suffix = qs({
2866
2871
  since: q?.since || undefined,
2867
2872
  cursor: q?.cursor || undefined,
2868
2873
  user_id: q?.user_id || undefined,
2874
+ org_id: q?.org_id || undefined,
2869
2875
  credit_type: q?.credit_type || undefined,
2870
2876
  limit: q?.limit || undefined,
2871
2877
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vxil/sdk",
3
- "version": "0.28.0",
3
+ "version": "0.29.0",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "description": "Typed client for the Vxil REST API (notifications, auth, jobs, files, cms, comments, webhooks, realtime, orgs, rate-limits).",