@vxil/sdk 0.28.0 → 0.30.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,13 @@ 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 → the template's own level (set
1404
+ * with `ai.templates.put`) → `features.ai.defaults.mediaResolution` → the
1405
+ * model's own default. */
1406
+ export type AiMediaResolution = 'low' | 'medium' | 'high';
1396
1407
  /** A prior conversation turn for the tool-calling round-trip: assistant turns
1397
1408
  * carry the tool_calls they made; `role:'tool'` turns carry one call's result
1398
1409
  * (`tool_call_id` correlates it; `name` is the tool's name). */
@@ -4891,10 +4902,14 @@ export declare class Vxil<S extends VxilSchemaShape = VxilSchemaShape> {
4891
4902
  * config `security.allowedRedirectOrigins` when set (else
4892
4903
  * `422 redirect_not_allowed`), and the state expires after
4893
4904
  * `expires_in` seconds (600). `anonymous_token` (a guest bearer)
4894
- * promotes or merges that guest at the callback. */
4905
+ * promotes or merges that guest at the callback. `prompt` (google and
4906
+ * oidc only; 2026-10-23) asks the provider to show its account picker
4907
+ * (`select_account`), the consent screen (`consent`) or a fresh sign-in
4908
+ * (`login`); any other value, or a prompt on another provider, is a 422. */
4895
4909
  startUrl: (provider: "google" | "apple" | "github" | "facebook" | "mock" | "oidc", input: {
4896
4910
  redirect_uri: string;
4897
4911
  anonymous_token?: string;
4912
+ prompt?: "select_account" | "consent" | "login";
4898
4913
  }) => Promise<{
4899
4914
  authorize_url: string;
4900
4915
  expires_in: number;
@@ -6718,6 +6733,12 @@ export declare class Vxil<S extends VxilSchemaShape = VxilSchemaShape> {
6718
6733
  mode?: "hybrid" | "vector" | "keyword";
6719
6734
  filter?: SearchFilter;
6720
6735
  rrf_k?: number;
6736
+ /** Hybrid mode only: per-lane RRF weights (0..100 each, not both 0).
6737
+ * Default: the config's `hybrid.weights`, else 1 / 1 (unweighted). */
6738
+ weights?: {
6739
+ vector: number;
6740
+ keyword: number;
6741
+ };
6721
6742
  vector?: number[];
6722
6743
  rerank?: boolean;
6723
6744
  /** orgScoped collections: the workspace to search — REQUIRED with a
@@ -6769,26 +6790,34 @@ export declare class Vxil<S extends VxilSchemaShape = VxilSchemaShape> {
6769
6790
  * `{{var}}` placeholders are filled from `generate`'s `input`.
6770
6791
  * `schema` (a JSON Schema) is now ENFORCED at generate time on sync/job
6771
6792
  * requests — the output is validated (with one repair pass) against it;
6772
- * a per-request `response_schema` overrides it. Ignored on streams. */
6793
+ * a per-request `response_schema` overrides it. Ignored on streams.
6794
+ * `media_resolution` (Gemini only) is this template's media resolution:
6795
+ * a request's `media_resolution` wins, else this, else
6796
+ * `features.ai.defaults.mediaResolution`. */
6773
6797
  put: (input: {
6774
6798
  template: string;
6775
6799
  user: string;
6776
6800
  system?: string;
6777
6801
  schema?: Record<string, unknown>;
6802
+ media_resolution?: AiMediaResolution;
6778
6803
  }) => Promise<{
6779
6804
  template: string;
6780
6805
  version: number;
6806
+ content_sha256?: string;
6807
+ media_resolution?: AiMediaResolution;
6781
6808
  }>;
6782
6809
  /** List stored templates (each name + its latest version). `content_sha256`
6783
6810
  * is the canonical hash of the latest version's {system, user, schema},
6784
6811
  * stored when the version was written — what `vxil push` compares a
6785
6812
  * declared `ai.templates[]` entry against; absent on a version stored
6786
- * before 2026-09-23 (the next push re-puts that template once). */
6813
+ * before 2026-09-23 (the next push re-puts that template once).
6814
+ * `media_resolution` is the latest version's level, when it has one. */
6787
6815
  list: () => Promise<Array<{
6788
6816
  name: string;
6789
6817
  latest_version: number;
6790
6818
  created_at: string;
6791
6819
  content_sha256?: string;
6820
+ media_resolution?: AiMediaResolution;
6792
6821
  }>>;
6793
6822
  /** Retire a stored template (soft): every live version of the name leaves
6794
6823
  * the list and can no longer be rendered (by name or by version → 404
@@ -6819,6 +6848,8 @@ export declare class Vxil<S extends VxilSchemaShape = VxilSchemaShape> {
6819
6848
  temperature?: number;
6820
6849
  /** Gemini thinking depth — see AiThinkingLevel. */
6821
6850
  thinking_level?: AiThinkingLevel;
6851
+ /** Gemini per-image / per-page token budget — see AiMediaResolution. */
6852
+ media_resolution?: AiMediaResolution;
6822
6853
  tools?: Array<{
6823
6854
  name: string;
6824
6855
  description?: string;
@@ -6879,6 +6910,8 @@ export declare class Vxil<S extends VxilSchemaShape = VxilSchemaShape> {
6879
6910
  temperature?: number;
6880
6911
  /** Gemini thinking depth — see AiThinkingLevel. */
6881
6912
  thinking_level?: AiThinkingLevel;
6913
+ /** Gemini per-image / per-page token budget — see AiMediaResolution. */
6914
+ media_resolution?: AiMediaResolution;
6882
6915
  tools?: Array<{
6883
6916
  name: string;
6884
6917
  description?: string;
@@ -6916,6 +6949,8 @@ export declare class Vxil<S extends VxilSchemaShape = VxilSchemaShape> {
6916
6949
  temperature?: number;
6917
6950
  /** Gemini thinking depth — see AiThinkingLevel. */
6918
6951
  thinking_level?: AiThinkingLevel;
6952
+ /** Gemini per-image / per-page token budget — see AiMediaResolution. */
6953
+ media_resolution?: AiMediaResolution;
6919
6954
  tools?: Array<{
6920
6955
  name: string;
6921
6956
  description?: string;
@@ -6977,6 +7012,12 @@ export declare class Vxil<S extends VxilSchemaShape = VxilSchemaShape> {
6977
7012
  };
6978
7013
  }, opts?: {
6979
7014
  idempotencyKey?: string;
7015
+ /** Interactive job runs: bound the run's FIRST provider call at this
7016
+ * many ms (integer 1000–17000; sent as `deadline_ms`). A run with a
7017
+ * deadline can start without the queue hop; a first call that passes
7018
+ * it is retried on the queue with the normal job-lane bound. Pair it
7019
+ * with `getGeneration(id, { wait: 25 })`. */
7020
+ deadlineMs?: number;
6980
7021
  }) => Promise<AiJobHandle>;
6981
7022
  /** One generation: status, usage, run, and — for a settled job-lane
6982
7023
  * generation — the settled answer (`result`, kept 30 days). In end-user
@@ -6985,7 +7026,7 @@ export declare class Vxil<S extends VxilSchemaShape = VxilSchemaShape> {
6985
7026
  * until the generation is `completed` / `failed` — ONE API call instead of
6986
7027
  * a poll loop; if it is still running at the deadline the current record
6987
7028
  * comes back with `wait: 'timeout'` (`'unavailable'` when the per-tenant
6988
- * budget of 60 held reads a minute declined to hold). A client
7029
+ * budget of 300 held reads a minute declined to hold). A client
6989
7030
  * `timeoutMs` shorter than `wait` × 1000 aborts the call first. */
6990
7031
  getGeneration: (generationId: string, opts?: {
6991
7032
  wait?: number;
@@ -7415,11 +7456,13 @@ export declare class Vxil<S extends VxilSchemaShape = VxilSchemaShape> {
7415
7456
  * a slow transaction can commit a row behind one already listed. `limit` 1..500 (default 100).
7416
7457
  * Needs payments:read. SERVER-SIDE KEYS ONLY — a thin-client
7417
7458
  * (`end_user_required`) key gets 403 `server_only` (use `usage` for one
7418
- * user's own rows). */
7459
+ * user's own rows). `org_id` (2026-10-23) lists one workspace's rows (the
7460
+ * same as `user_id: 'org:<id>'`); give it OR `user_id`. */
7419
7461
  ledger: (q?: {
7420
7462
  since?: string;
7421
7463
  cursor?: string;
7422
7464
  user_id?: string;
7465
+ org_id?: string;
7423
7466
  credit_type?: string;
7424
7467
  limit?: number;
7425
7468
  }) => 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`
@@ -2542,13 +2546,17 @@ export class Vxil {
2542
2546
  * `{{var}}` placeholders are filled from `generate`'s `input`.
2543
2547
  * `schema` (a JSON Schema) is now ENFORCED at generate time on sync/job
2544
2548
  * requests — the output is validated (with one repair pass) against it;
2545
- * a per-request `response_schema` overrides it. Ignored on streams. */
2549
+ * a per-request `response_schema` overrides it. Ignored on streams.
2550
+ * `media_resolution` (Gemini only) is this template's media resolution:
2551
+ * a request's `media_resolution` wins, else this, else
2552
+ * `features.ai.defaults.mediaResolution`. */
2546
2553
  put: async (input) => (await this.call('POST', '/v1/ai/templates', input)).data,
2547
2554
  /** List stored templates (each name + its latest version). `content_sha256`
2548
2555
  * is the canonical hash of the latest version's {system, user, schema},
2549
2556
  * stored when the version was written — what `vxil push` compares a
2550
2557
  * declared `ai.templates[]` entry against; absent on a version stored
2551
- * before 2026-09-23 (the next push re-puts that template once). */
2558
+ * before 2026-09-23 (the next push re-puts that template once).
2559
+ * `media_resolution` is the latest version's level, when it has one. */
2552
2560
  list: async () => (await this.call('GET', '/v1/ai/templates')).data.templates,
2553
2561
  /** Retire a stored template (soft): every live version of the name leaves
2554
2562
  * the list and can no longer be rendered (by name or by version → 404
@@ -2576,7 +2584,7 @@ export class Vxil {
2576
2584
  * `opts.idempotencyKey` deduplicates for 24 h: a re-send after a timeout
2577
2585
  * or a lost answer returns the ORIGINAL handle (`deduplicated: true`) and
2578
2586
  * 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,
2587
+ 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
2588
  /** One generation: status, usage, run, and — for a settled job-lane
2581
2589
  * generation — the settled answer (`result`, kept 30 days). In end-user
2582
2590
  * mode only the caller's own generation reads (a foreign id is a 404).
@@ -2584,7 +2592,7 @@ export class Vxil {
2584
2592
  * until the generation is `completed` / `failed` — ONE API call instead of
2585
2593
  * a poll loop; if it is still running at the deadline the current record
2586
2594
  * comes back with `wait: 'timeout'` (`'unavailable'` when the per-tenant
2587
- * budget of 60 held reads a minute declined to hold). A client
2595
+ * budget of 300 held reads a minute declined to hold). A client
2588
2596
  * `timeoutMs` shorter than `wait` × 1000 aborts the call first. */
2589
2597
  getGeneration: async (generationId, opts) => {
2590
2598
  const qs = opts?.wait !== undefined ? `?wait=${encodeURIComponent(String(opts.wait))}` : '';
@@ -2860,12 +2868,14 @@ export class Vxil {
2860
2868
  * a slow transaction can commit a row behind one already listed. `limit` 1..500 (default 100).
2861
2869
  * Needs payments:read. SERVER-SIDE KEYS ONLY — a thin-client
2862
2870
  * (`end_user_required`) key gets 403 `server_only` (use `usage` for one
2863
- * user's own rows). */
2871
+ * user's own rows). `org_id` (2026-10-23) lists one workspace's rows (the
2872
+ * same as `user_id: 'org:<id>'`); give it OR `user_id`. */
2864
2873
  ledger: async (q) => {
2865
2874
  const suffix = qs({
2866
2875
  since: q?.since || undefined,
2867
2876
  cursor: q?.cursor || undefined,
2868
2877
  user_id: q?.user_id || undefined,
2878
+ org_id: q?.org_id || undefined,
2869
2879
  credit_type: q?.credit_type || undefined,
2870
2880
  limit: q?.limit || undefined,
2871
2881
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vxil/sdk",
3
- "version": "0.28.0",
3
+ "version": "0.30.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).",