@gentiq/core 1.0.0-beta.1 → 1.0.0-beta.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.
@@ -0,0 +1,22 @@
1
+ const n = "/api/public/branding/";
2
+ function s(e, t = "/api") {
3
+ return e.startsWith(n) ? `${t.replace(/\/+$/, "")}${e.slice(4)}` : e;
4
+ }
5
+ function o(e) {
6
+ const t = e.trim();
7
+ if (!t || t.length > 2048 || [...t].some((r) => /\s/.test(r) || r.charCodeAt(0) < 32))
8
+ return !1;
9
+ if (t.startsWith("/") && !t.startsWith("//"))
10
+ return !0;
11
+ try {
12
+ const r = new URL(t);
13
+ return (r.protocol === "http:" || r.protocol === "https:") && !!r.host;
14
+ } catch {
15
+ return !1;
16
+ }
17
+ }
18
+ export {
19
+ n as BRANDING_URL_PREFIX,
20
+ o as isValidIconUrl,
21
+ s as resolveBrandingUrl
22
+ };
package/dist/index.d.ts CHANGED
@@ -290,6 +290,8 @@ declare function buildApi(http: HttpClient, auth: ResolvedAuthAdapter, options:
290
290
  }>;
291
291
  getAppConfig: (signal?: AbortSignal) => Promise<{
292
292
  admin_title?: string | null;
293
+ app_favicon?: string | null;
294
+ app_logo?: string | components["schemas"]["AppLogo"] | null;
293
295
  app_name?: string | null;
294
296
  app_version: string | null;
295
297
  attachments: components["schemas"]["AttachmentLimits"];
@@ -703,7 +705,7 @@ export declare type ChatAttachment = AttachmentUpload & {
703
705
  };
704
706
 
705
707
  /** The answer is stored, and whether a title is still coming (`data-chat-finished`). */
706
- declare type ChatFinishedData = Schemas['ChatFinishedData'];
708
+ export declare type ChatFinishedData = Schemas['ChatFinishedData'];
707
709
 
708
710
  /**
709
711
  * Structured reference context selected from an earlier message or explicit UI card.
@@ -1806,6 +1808,16 @@ declare interface components {
1806
1808
  /** Scopes */
1807
1809
  scopes: string[];
1808
1810
  };
1811
+ /**
1812
+ * AppLogo
1813
+ * @description Light and dark theme URLs for the application logo.
1814
+ */
1815
+ AppLogo: {
1816
+ /** Dark */
1817
+ dark: string;
1818
+ /** Light */
1819
+ light: string;
1820
+ };
1809
1821
  /**
1810
1822
  * AppSettings
1811
1823
  * @description What an admin changed in the app's configuration, from the settings page.
@@ -1816,6 +1828,10 @@ declare interface components {
1816
1828
  AppSettings: {
1817
1829
  /** Admin Title */
1818
1830
  admin_title?: string | null;
1831
+ /** App Favicon */
1832
+ app_favicon?: string | null;
1833
+ /** App Logo */
1834
+ app_logo?: string | components["schemas"]["AppLogo"] | null;
1819
1835
  /** App Name */
1820
1836
  app_name?: string | null;
1821
1837
  /** Auth Page Enabled */
@@ -1925,6 +1941,10 @@ declare interface components {
1925
1941
  AppSettingsUpdateInput: {
1926
1942
  /** Admin Title */
1927
1943
  admin_title?: string | null;
1944
+ /** App Favicon */
1945
+ app_favicon?: string | null;
1946
+ /** App Logo */
1947
+ app_logo?: string | components["schemas"]["AppLogo"] | null;
1928
1948
  /** App Name */
1929
1949
  app_name?: string | null;
1930
1950
  /** Auth Page Enabled */
@@ -2092,45 +2112,21 @@ declare interface components {
2092
2112
  /** Username */
2093
2113
  username: string | null;
2094
2114
  };
2095
- /** BackgroundJob */
2096
- BackgroundJob: {
2097
- /**
2098
- * Created At
2099
- * Format: date-time
2100
- */
2101
- created_at: string;
2102
- /** Error */
2103
- error: string | null;
2115
+ /**
2116
+ * BrandingIconUpload
2117
+ * @description Metadata and public path of an uploaded app logo or favicon.
2118
+ */
2119
+ BrandingIconUpload: {
2120
+ /** Filename */
2121
+ filename: string;
2104
2122
  /** Id */
2105
2123
  id: string;
2106
- /** Message */
2107
- message: string | null;
2108
- /** Metadata */
2109
- metadata: {
2110
- [key: string]: unknown;
2111
- };
2112
- /** Progress */
2113
- progress: number | null;
2114
- /** Result */
2115
- result: unknown;
2116
- /** Status */
2117
- status: string;
2118
- /** Type */
2119
- type: string;
2120
- /**
2121
- * Updated At
2122
- * Format: date-time
2123
- */
2124
- updated_at: string;
2125
- /** User Id */
2126
- user_id: string | null;
2127
- };
2128
- /** BackgroundJobList */
2129
- BackgroundJobList: {
2130
- /** Count */
2131
- count: number;
2132
- /** Jobs */
2133
- jobs: components["schemas"]["BackgroundJob"][];
2124
+ /** Media Type */
2125
+ media_type: string;
2126
+ /** Size */
2127
+ size: number;
2128
+ /** Url */
2129
+ url: string;
2134
2130
  };
2135
2131
  /** BulkAccessResponse */
2136
2132
  BulkAccessResponse: {
@@ -3530,6 +3526,10 @@ declare interface components {
3530
3526
  PublicConfig: {
3531
3527
  /** Admin Title */
3532
3528
  admin_title?: string | null;
3529
+ /** App Favicon */
3530
+ app_favicon?: string | null;
3531
+ /** App Logo */
3532
+ app_logo?: string | components["schemas"]["AppLogo"] | null;
3533
3533
  /** App Name */
3534
3534
  app_name?: string | null;
3535
3535
  /** App Version */
@@ -5580,13 +5580,14 @@ export declare type MaintenanceDisplay = MaintenanceStatus['display'];
5580
5580
  /** The maintenance notice, as the public `/status` and `/config` report it. */
5581
5581
  export declare type MaintenanceStatus = Schemas['MaintenanceNotice'];
5582
5582
 
5583
- declare type MaybePromise<T> = T | Promise<T>;
5583
+ /** Either a synchronous value or a Promise resolving to it. */
5584
+ export declare type MaybePromise<T> = T | Promise<T>;
5584
5585
 
5585
5586
  /** What the user thought of an answer. */
5586
5587
  export declare type MessageFeedback = 'like' | 'dislike';
5587
5588
 
5588
5589
  /** The id the answer being streamed is stored under (`data-message-id`). */
5589
- declare type MessageIdData = Schemas['MessageIdData'];
5590
+ export declare type MessageIdData = Schemas['MessageIdData'];
5590
5591
 
5591
5592
  /** A message's text as one string: every text part, in order, separated by a blank line. */
5592
5593
  export declare function messageText(message: Pick<UIMessage, 'parts'>): string;
@@ -6852,47 +6853,6 @@ declare interface operations {
6852
6853
  };
6853
6854
  };
6854
6855
  };
6855
- list_jobs_api_admin_jobs_get: {
6856
- parameters: {
6857
- query?: {
6858
- limit?: number;
6859
- type?: string | null;
6860
- };
6861
- header?: never;
6862
- path?: never;
6863
- cookie?: never;
6864
- };
6865
- requestBody?: never;
6866
- responses: {
6867
- /** @description Successful Response */
6868
- 200: {
6869
- headers: {
6870
- [name: string]: unknown;
6871
- };
6872
- content: {
6873
- "application/json": components["schemas"]["BackgroundJobList"];
6874
- };
6875
- };
6876
- /** @description Client Error */
6877
- "4XX": {
6878
- headers: {
6879
- [name: string]: unknown;
6880
- };
6881
- content: {
6882
- "application/json": components["schemas"]["ErrorResponse"];
6883
- };
6884
- };
6885
- /** @description Server Error */
6886
- "5XX": {
6887
- headers: {
6888
- [name: string]: unknown;
6889
- };
6890
- content: {
6891
- "application/json": components["schemas"]["ErrorResponse"];
6892
- };
6893
- };
6894
- };
6895
- };
6896
6856
  run_raw_job_api_admin_jobs_raw_post: {
6897
6857
  parameters: {
6898
6858
  query?: never;
@@ -7219,46 +7179,6 @@ declare interface operations {
7219
7179
  };
7220
7180
  };
7221
7181
  };
7222
- cancel_job_api_admin_jobs__job_id__cancel_post: {
7223
- parameters: {
7224
- query?: never;
7225
- header?: never;
7226
- path: {
7227
- job_id: string;
7228
- };
7229
- cookie?: never;
7230
- };
7231
- requestBody?: never;
7232
- responses: {
7233
- /** @description Successful Response */
7234
- 200: {
7235
- headers: {
7236
- [name: string]: unknown;
7237
- };
7238
- content: {
7239
- "application/json": components["schemas"]["StatusMessageResponse"];
7240
- };
7241
- };
7242
- /** @description Client Error */
7243
- "4XX": {
7244
- headers: {
7245
- [name: string]: unknown;
7246
- };
7247
- content: {
7248
- "application/json": components["schemas"]["ErrorResponse"];
7249
- };
7250
- };
7251
- /** @description Server Error */
7252
- "5XX": {
7253
- headers: {
7254
- [name: string]: unknown;
7255
- };
7256
- content: {
7257
- "application/json": components["schemas"]["ErrorResponse"];
7258
- };
7259
- };
7260
- };
7261
- };
7262
7182
  login_admin_api_admin_login_post: {
7263
7183
  parameters: {
7264
7184
  query?: never;
@@ -8115,6 +8035,51 @@ declare interface operations {
8115
8035
  };
8116
8036
  };
8117
8037
  };
8038
+ upload_branding_icon_api_admin_settings_icon_post: {
8039
+ parameters: {
8040
+ query?: {
8041
+ filename?: string;
8042
+ };
8043
+ header?: never;
8044
+ path?: never;
8045
+ cookie?: never;
8046
+ };
8047
+ /** @description The raster icon file itself, with its image media type as the `Content-Type`. */
8048
+ requestBody: {
8049
+ content: {
8050
+ "application/octet-stream": string;
8051
+ };
8052
+ };
8053
+ responses: {
8054
+ /** @description Successful Response */
8055
+ 200: {
8056
+ headers: {
8057
+ [name: string]: unknown;
8058
+ };
8059
+ content: {
8060
+ "application/json": components["schemas"]["BrandingIconUpload"];
8061
+ };
8062
+ };
8063
+ /** @description Client Error */
8064
+ "4XX": {
8065
+ headers: {
8066
+ [name: string]: unknown;
8067
+ };
8068
+ content: {
8069
+ "application/json": components["schemas"]["ErrorResponse"];
8070
+ };
8071
+ };
8072
+ /** @description Server Error */
8073
+ "5XX": {
8074
+ headers: {
8075
+ [name: string]: unknown;
8076
+ };
8077
+ content: {
8078
+ "application/json": components["schemas"]["ErrorResponse"];
8079
+ };
8080
+ };
8081
+ };
8082
+ };
8118
8083
  get_setup_status_api_admin_setup_status_get: {
8119
8084
  parameters: {
8120
8085
  query?: never;
@@ -10421,6 +10386,46 @@ declare interface operations {
10421
10386
  };
10422
10387
  };
10423
10388
  };
10389
+ get_branding_icon_api_public_branding__asset_id__get: {
10390
+ parameters: {
10391
+ query?: never;
10392
+ header?: never;
10393
+ path: {
10394
+ asset_id: string;
10395
+ };
10396
+ cookie?: never;
10397
+ };
10398
+ requestBody?: never;
10399
+ responses: {
10400
+ /** @description The uploaded branding icon, with the media type recorded at upload */
10401
+ 200: {
10402
+ headers: {
10403
+ [name: string]: unknown;
10404
+ };
10405
+ content: {
10406
+ "application/octet-stream": unknown;
10407
+ };
10408
+ };
10409
+ /** @description Client Error */
10410
+ "4XX": {
10411
+ headers: {
10412
+ [name: string]: unknown;
10413
+ };
10414
+ content: {
10415
+ "application/json": components["schemas"]["ErrorResponse"];
10416
+ };
10417
+ };
10418
+ /** @description Server Error */
10419
+ "5XX": {
10420
+ headers: {
10421
+ [name: string]: unknown;
10422
+ };
10423
+ content: {
10424
+ "application/json": components["schemas"]["ErrorResponse"];
10425
+ };
10426
+ };
10427
+ };
10428
+ };
10424
10429
  get_shared_thread_api_public_shared__share_id__get: {
10425
10430
  parameters: {
10426
10431
  query?: never;
@@ -11668,26 +11673,6 @@ declare interface paths {
11668
11673
  patch?: never;
11669
11674
  trace?: never;
11670
11675
  };
11671
- "/api/admin/jobs": {
11672
- parameters: {
11673
- query?: never;
11674
- header?: never;
11675
- path?: never;
11676
- cookie?: never;
11677
- };
11678
- /**
11679
- * List Jobs
11680
- * @description List recent background jobs.
11681
- */
11682
- get: operations["list_jobs_api_admin_jobs_get"];
11683
- put?: never;
11684
- post?: never;
11685
- delete?: never;
11686
- options?: never;
11687
- head?: never;
11688
- patch?: never;
11689
- trace?: never;
11690
- };
11691
11676
  "/api/admin/jobs/raw": {
11692
11677
  parameters: {
11693
11678
  query?: never;
@@ -11865,26 +11850,6 @@ declare interface paths {
11865
11850
  patch?: never;
11866
11851
  trace?: never;
11867
11852
  };
11868
- "/api/admin/jobs/{job_id}/cancel": {
11869
- parameters: {
11870
- query?: never;
11871
- header?: never;
11872
- path?: never;
11873
- cookie?: never;
11874
- };
11875
- get?: never;
11876
- put?: never;
11877
- /**
11878
- * Cancel Job
11879
- * @description Cancel a background job.
11880
- */
11881
- post: operations["cancel_job_api_admin_jobs__job_id__cancel_post"];
11882
- delete?: never;
11883
- options?: never;
11884
- head?: never;
11885
- patch?: never;
11886
- trace?: never;
11887
- };
11888
11853
  "/api/admin/login": {
11889
11854
  parameters: {
11890
11855
  query?: never;
@@ -12224,6 +12189,26 @@ declare interface paths {
12224
12189
  patch: operations["update_app_settings_api_admin_settings_patch"];
12225
12190
  trace?: never;
12226
12191
  };
12192
+ "/api/admin/settings/icon": {
12193
+ parameters: {
12194
+ query?: never;
12195
+ header?: never;
12196
+ path?: never;
12197
+ cookie?: never;
12198
+ };
12199
+ get?: never;
12200
+ put?: never;
12201
+ /**
12202
+ * Upload Branding Icon
12203
+ * @description Upload a raster image (PNG, JPEG, GIF, WebP or ICO) for the app logo or favicon.
12204
+ */
12205
+ post: operations["upload_branding_icon_api_admin_settings_icon_post"];
12206
+ delete?: never;
12207
+ options?: never;
12208
+ head?: never;
12209
+ patch?: never;
12210
+ trace?: never;
12211
+ };
12227
12212
  "/api/admin/setup-status": {
12228
12213
  parameters: {
12229
12214
  query?: never;
@@ -13274,6 +13259,26 @@ declare interface paths {
13274
13259
  patch?: never;
13275
13260
  trace?: never;
13276
13261
  };
13262
+ "/api/public/branding/{asset_id}": {
13263
+ parameters: {
13264
+ query?: never;
13265
+ header?: never;
13266
+ path?: never;
13267
+ cookie?: never;
13268
+ };
13269
+ /**
13270
+ * Get Branding Icon
13271
+ * @description Serves an uploaded app logo or favicon as a sandboxed raster image.
13272
+ */
13273
+ get: operations["get_branding_icon_api_public_branding__asset_id__get"];
13274
+ put?: never;
13275
+ post?: never;
13276
+ delete?: never;
13277
+ options?: never;
13278
+ head?: never;
13279
+ patch?: never;
13280
+ trace?: never;
13281
+ };
13277
13282
  "/api/public/shared/{share_id}": {
13278
13283
  parameters: {
13279
13284
  query?: never;
@@ -13588,7 +13593,7 @@ export declare type PlanDuration = Schemas['PlanDuration'];
13588
13593
  export declare function presetToCron(preset: SchedulePreset): string;
13589
13594
 
13590
13595
  /** A running tool's progress (`data-progress-update`). */
13591
- declare type ProgressUpdateData = Schemas['ProgressUpdateEvent'];
13596
+ export declare type ProgressUpdateData = Schemas['ProgressUpdateEvent'];
13592
13597
 
13593
13598
  declare type QueryParams<O> = ParametersOf<O> extends {
13594
13599
  query?: infer Q;
@@ -13623,7 +13628,7 @@ export declare interface ReferenceAdapterContext {
13623
13628
  }
13624
13629
 
13625
13630
  /** Context the user attached to a message, as a `data-reference` part carries it. */
13626
- declare type ReferenceData = Schemas['ReferenceData'];
13631
+ export declare type ReferenceData = Schemas['ReferenceData'];
13627
13632
 
13628
13633
  /** Response from registering. */
13629
13634
  export declare type RegisterResponse = Schemas['AuthTokenResponse'];
@@ -13805,7 +13810,7 @@ export declare type ThreadSummary = Schemas['ThreadSummary'];
13805
13810
  declare type Timeout = number | false;
13806
13811
 
13807
13812
  /** The thread's new title (`data-title`). */
13808
- declare type TitleData = Schemas['TitleData'];
13813
+ export declare type TitleData = Schemas['TitleData'];
13809
13814
 
13810
13815
  /**
13811
13816
  * A thread's stored messages as the chat renders them, the same parts a streamed reply has.
@@ -13868,7 +13873,7 @@ export declare interface ToolOutputResponse {
13868
13873
  export declare type TranscriptionResponse = Schemas['TranscriptionResponse'];
13869
13874
 
13870
13875
  /** The turn being streamed, which its stream can be read again by (`data-turn`, transient). */
13871
- declare type TurnData = Schemas['TurnData'];
13876
+ export declare type TurnData = Schemas['TurnData'];
13872
13877
 
13873
13878
  /** Options for {@link GentiqApi.uploadAttachment}. */
13874
13879
  export declare interface UploadAttachmentOptions {
@@ -61,6 +61,9 @@ declare interface AuthAdapter {
61
61
  credentials?: RequestCredentials;
62
62
  }
63
63
 
64
+ /** Prefix for branding icons uploaded through `POST /admin/settings/icon`. */
65
+ export declare const BRANDING_URL_PREFIX = "/api/public/branding/";
66
+
64
67
  declare function buildApi(http: HttpClient, auth: ResolvedAuthAdapter, options: GentiqApiOptions): {
65
68
  /**
66
69
  * Call `listener` whenever a request is refused with a 401, which may mean the session has
@@ -252,6 +255,8 @@ declare function buildApi(http: HttpClient, auth: ResolvedAuthAdapter, options:
252
255
  }>;
253
256
  getAppConfig: (signal?: AbortSignal) => Promise<{
254
257
  admin_title?: string | null;
258
+ app_favicon?: string | null;
259
+ app_logo?: string | components["schemas"]["AppLogo"] | null;
255
260
  app_name?: string | null;
256
261
  app_version: string | null;
257
262
  attachments: components["schemas"]["AttachmentLimits"];
@@ -1792,6 +1797,16 @@ export declare interface components {
1792
1797
  /** Scopes */
1793
1798
  scopes: string[];
1794
1799
  };
1800
+ /**
1801
+ * AppLogo
1802
+ * @description Light and dark theme URLs for the application logo.
1803
+ */
1804
+ AppLogo: {
1805
+ /** Dark */
1806
+ dark: string;
1807
+ /** Light */
1808
+ light: string;
1809
+ };
1795
1810
  /**
1796
1811
  * AppSettings
1797
1812
  * @description What an admin changed in the app's configuration, from the settings page.
@@ -1802,6 +1817,10 @@ export declare interface components {
1802
1817
  AppSettings: {
1803
1818
  /** Admin Title */
1804
1819
  admin_title?: string | null;
1820
+ /** App Favicon */
1821
+ app_favicon?: string | null;
1822
+ /** App Logo */
1823
+ app_logo?: string | components["schemas"]["AppLogo"] | null;
1805
1824
  /** App Name */
1806
1825
  app_name?: string | null;
1807
1826
  /** Auth Page Enabled */
@@ -1911,6 +1930,10 @@ export declare interface components {
1911
1930
  AppSettingsUpdateInput: {
1912
1931
  /** Admin Title */
1913
1932
  admin_title?: string | null;
1933
+ /** App Favicon */
1934
+ app_favicon?: string | null;
1935
+ /** App Logo */
1936
+ app_logo?: string | components["schemas"]["AppLogo"] | null;
1914
1937
  /** App Name */
1915
1938
  app_name?: string | null;
1916
1939
  /** Auth Page Enabled */
@@ -2078,45 +2101,21 @@ export declare interface components {
2078
2101
  /** Username */
2079
2102
  username: string | null;
2080
2103
  };
2081
- /** BackgroundJob */
2082
- BackgroundJob: {
2083
- /**
2084
- * Created At
2085
- * Format: date-time
2086
- */
2087
- created_at: string;
2088
- /** Error */
2089
- error: string | null;
2104
+ /**
2105
+ * BrandingIconUpload
2106
+ * @description Metadata and public path of an uploaded app logo or favicon.
2107
+ */
2108
+ BrandingIconUpload: {
2109
+ /** Filename */
2110
+ filename: string;
2090
2111
  /** Id */
2091
2112
  id: string;
2092
- /** Message */
2093
- message: string | null;
2094
- /** Metadata */
2095
- metadata: {
2096
- [key: string]: unknown;
2097
- };
2098
- /** Progress */
2099
- progress: number | null;
2100
- /** Result */
2101
- result: unknown;
2102
- /** Status */
2103
- status: string;
2104
- /** Type */
2105
- type: string;
2106
- /**
2107
- * Updated At
2108
- * Format: date-time
2109
- */
2110
- updated_at: string;
2111
- /** User Id */
2112
- user_id: string | null;
2113
- };
2114
- /** BackgroundJobList */
2115
- BackgroundJobList: {
2116
- /** Count */
2117
- count: number;
2118
- /** Jobs */
2119
- jobs: components["schemas"]["BackgroundJob"][];
2113
+ /** Media Type */
2114
+ media_type: string;
2115
+ /** Size */
2116
+ size: number;
2117
+ /** Url */
2118
+ url: string;
2120
2119
  };
2121
2120
  /** BulkAccessResponse */
2122
2121
  BulkAccessResponse: {
@@ -3516,6 +3515,10 @@ export declare interface components {
3516
3515
  PublicConfig: {
3517
3516
  /** Admin Title */
3518
3517
  admin_title?: string | null;
3518
+ /** App Favicon */
3519
+ app_favicon?: string | null;
3520
+ /** App Logo */
3521
+ app_logo?: string | components["schemas"]["AppLogo"] | null;
3519
3522
  /** App Name */
3520
3523
  app_name?: string | null;
3521
3524
  /** App Version */
@@ -5450,6 +5453,12 @@ export declare function isStoredPart<T extends FixedPartType>(part: StoredMessag
5450
5453
  /** Whether a stored part is a tool call. */
5451
5454
  export declare function isStoredToolPart(part: StoredMessagePart): part is StoredToolPart;
5452
5455
 
5456
+ /**
5457
+ * Checks whether a string is a safe icon URL (`http(s)://...`) or relative path (`/...`).
5458
+ * Rejects protocol-relative URLs (`//...`), whitespace, control characters, and `javascript:`/`data:` schemes.
5459
+ */
5460
+ export declare function isValidIconUrl(value: string): boolean;
5461
+
5453
5462
  /** Whether this browser can record: it needs a secure origin and `MediaRecorder`. */
5454
5463
  export declare function isVoiceRecordingSupported(): boolean;
5455
5464
 
@@ -5465,6 +5474,7 @@ declare type LoginCodeExchangeResponse = Schemas['LoginCodeExchangeResponse'];
5465
5474
  /** A user field that can be used as a login handle. */
5466
5475
  declare type LoginField = AppConfigResponse['login_fields'][number];
5467
5476
 
5477
+ /** Either a synchronous value or a Promise resolving to it. */
5468
5478
  declare type MaybePromise<T> = T | Promise<T>;
5469
5479
 
5470
5480
  /** What the user thought of an answer. */
@@ -6741,47 +6751,6 @@ declare interface operations {
6741
6751
  };
6742
6752
  };
6743
6753
  };
6744
- list_jobs_api_admin_jobs_get: {
6745
- parameters: {
6746
- query?: {
6747
- limit?: number;
6748
- type?: string | null;
6749
- };
6750
- header?: never;
6751
- path?: never;
6752
- cookie?: never;
6753
- };
6754
- requestBody?: never;
6755
- responses: {
6756
- /** @description Successful Response */
6757
- 200: {
6758
- headers: {
6759
- [name: string]: unknown;
6760
- };
6761
- content: {
6762
- "application/json": components["schemas"]["BackgroundJobList"];
6763
- };
6764
- };
6765
- /** @description Client Error */
6766
- "4XX": {
6767
- headers: {
6768
- [name: string]: unknown;
6769
- };
6770
- content: {
6771
- "application/json": components["schemas"]["ErrorResponse"];
6772
- };
6773
- };
6774
- /** @description Server Error */
6775
- "5XX": {
6776
- headers: {
6777
- [name: string]: unknown;
6778
- };
6779
- content: {
6780
- "application/json": components["schemas"]["ErrorResponse"];
6781
- };
6782
- };
6783
- };
6784
- };
6785
6754
  run_raw_job_api_admin_jobs_raw_post: {
6786
6755
  parameters: {
6787
6756
  query?: never;
@@ -7108,46 +7077,6 @@ declare interface operations {
7108
7077
  };
7109
7078
  };
7110
7079
  };
7111
- cancel_job_api_admin_jobs__job_id__cancel_post: {
7112
- parameters: {
7113
- query?: never;
7114
- header?: never;
7115
- path: {
7116
- job_id: string;
7117
- };
7118
- cookie?: never;
7119
- };
7120
- requestBody?: never;
7121
- responses: {
7122
- /** @description Successful Response */
7123
- 200: {
7124
- headers: {
7125
- [name: string]: unknown;
7126
- };
7127
- content: {
7128
- "application/json": components["schemas"]["StatusMessageResponse"];
7129
- };
7130
- };
7131
- /** @description Client Error */
7132
- "4XX": {
7133
- headers: {
7134
- [name: string]: unknown;
7135
- };
7136
- content: {
7137
- "application/json": components["schemas"]["ErrorResponse"];
7138
- };
7139
- };
7140
- /** @description Server Error */
7141
- "5XX": {
7142
- headers: {
7143
- [name: string]: unknown;
7144
- };
7145
- content: {
7146
- "application/json": components["schemas"]["ErrorResponse"];
7147
- };
7148
- };
7149
- };
7150
- };
7151
7080
  login_admin_api_admin_login_post: {
7152
7081
  parameters: {
7153
7082
  query?: never;
@@ -8004,6 +7933,51 @@ declare interface operations {
8004
7933
  };
8005
7934
  };
8006
7935
  };
7936
+ upload_branding_icon_api_admin_settings_icon_post: {
7937
+ parameters: {
7938
+ query?: {
7939
+ filename?: string;
7940
+ };
7941
+ header?: never;
7942
+ path?: never;
7943
+ cookie?: never;
7944
+ };
7945
+ /** @description The raster icon file itself, with its image media type as the `Content-Type`. */
7946
+ requestBody: {
7947
+ content: {
7948
+ "application/octet-stream": string;
7949
+ };
7950
+ };
7951
+ responses: {
7952
+ /** @description Successful Response */
7953
+ 200: {
7954
+ headers: {
7955
+ [name: string]: unknown;
7956
+ };
7957
+ content: {
7958
+ "application/json": components["schemas"]["BrandingIconUpload"];
7959
+ };
7960
+ };
7961
+ /** @description Client Error */
7962
+ "4XX": {
7963
+ headers: {
7964
+ [name: string]: unknown;
7965
+ };
7966
+ content: {
7967
+ "application/json": components["schemas"]["ErrorResponse"];
7968
+ };
7969
+ };
7970
+ /** @description Server Error */
7971
+ "5XX": {
7972
+ headers: {
7973
+ [name: string]: unknown;
7974
+ };
7975
+ content: {
7976
+ "application/json": components["schemas"]["ErrorResponse"];
7977
+ };
7978
+ };
7979
+ };
7980
+ };
8007
7981
  get_setup_status_api_admin_setup_status_get: {
8008
7982
  parameters: {
8009
7983
  query?: never;
@@ -10310,6 +10284,46 @@ declare interface operations {
10310
10284
  };
10311
10285
  };
10312
10286
  };
10287
+ get_branding_icon_api_public_branding__asset_id__get: {
10288
+ parameters: {
10289
+ query?: never;
10290
+ header?: never;
10291
+ path: {
10292
+ asset_id: string;
10293
+ };
10294
+ cookie?: never;
10295
+ };
10296
+ requestBody?: never;
10297
+ responses: {
10298
+ /** @description The uploaded branding icon, with the media type recorded at upload */
10299
+ 200: {
10300
+ headers: {
10301
+ [name: string]: unknown;
10302
+ };
10303
+ content: {
10304
+ "application/octet-stream": unknown;
10305
+ };
10306
+ };
10307
+ /** @description Client Error */
10308
+ "4XX": {
10309
+ headers: {
10310
+ [name: string]: unknown;
10311
+ };
10312
+ content: {
10313
+ "application/json": components["schemas"]["ErrorResponse"];
10314
+ };
10315
+ };
10316
+ /** @description Server Error */
10317
+ "5XX": {
10318
+ headers: {
10319
+ [name: string]: unknown;
10320
+ };
10321
+ content: {
10322
+ "application/json": components["schemas"]["ErrorResponse"];
10323
+ };
10324
+ };
10325
+ };
10326
+ };
10313
10327
  get_shared_thread_api_public_shared__share_id__get: {
10314
10328
  parameters: {
10315
10329
  query?: never;
@@ -11557,26 +11571,6 @@ declare interface paths {
11557
11571
  patch?: never;
11558
11572
  trace?: never;
11559
11573
  };
11560
- "/api/admin/jobs": {
11561
- parameters: {
11562
- query?: never;
11563
- header?: never;
11564
- path?: never;
11565
- cookie?: never;
11566
- };
11567
- /**
11568
- * List Jobs
11569
- * @description List recent background jobs.
11570
- */
11571
- get: operations["list_jobs_api_admin_jobs_get"];
11572
- put?: never;
11573
- post?: never;
11574
- delete?: never;
11575
- options?: never;
11576
- head?: never;
11577
- patch?: never;
11578
- trace?: never;
11579
- };
11580
11574
  "/api/admin/jobs/raw": {
11581
11575
  parameters: {
11582
11576
  query?: never;
@@ -11754,26 +11748,6 @@ declare interface paths {
11754
11748
  patch?: never;
11755
11749
  trace?: never;
11756
11750
  };
11757
- "/api/admin/jobs/{job_id}/cancel": {
11758
- parameters: {
11759
- query?: never;
11760
- header?: never;
11761
- path?: never;
11762
- cookie?: never;
11763
- };
11764
- get?: never;
11765
- put?: never;
11766
- /**
11767
- * Cancel Job
11768
- * @description Cancel a background job.
11769
- */
11770
- post: operations["cancel_job_api_admin_jobs__job_id__cancel_post"];
11771
- delete?: never;
11772
- options?: never;
11773
- head?: never;
11774
- patch?: never;
11775
- trace?: never;
11776
- };
11777
11751
  "/api/admin/login": {
11778
11752
  parameters: {
11779
11753
  query?: never;
@@ -12113,6 +12087,26 @@ declare interface paths {
12113
12087
  patch: operations["update_app_settings_api_admin_settings_patch"];
12114
12088
  trace?: never;
12115
12089
  };
12090
+ "/api/admin/settings/icon": {
12091
+ parameters: {
12092
+ query?: never;
12093
+ header?: never;
12094
+ path?: never;
12095
+ cookie?: never;
12096
+ };
12097
+ get?: never;
12098
+ put?: never;
12099
+ /**
12100
+ * Upload Branding Icon
12101
+ * @description Upload a raster image (PNG, JPEG, GIF, WebP or ICO) for the app logo or favicon.
12102
+ */
12103
+ post: operations["upload_branding_icon_api_admin_settings_icon_post"];
12104
+ delete?: never;
12105
+ options?: never;
12106
+ head?: never;
12107
+ patch?: never;
12108
+ trace?: never;
12109
+ };
12116
12110
  "/api/admin/setup-status": {
12117
12111
  parameters: {
12118
12112
  query?: never;
@@ -13163,6 +13157,26 @@ declare interface paths {
13163
13157
  patch?: never;
13164
13158
  trace?: never;
13165
13159
  };
13160
+ "/api/public/branding/{asset_id}": {
13161
+ parameters: {
13162
+ query?: never;
13163
+ header?: never;
13164
+ path?: never;
13165
+ cookie?: never;
13166
+ };
13167
+ /**
13168
+ * Get Branding Icon
13169
+ * @description Serves an uploaded app logo or favicon as a sandboxed raster image.
13170
+ */
13171
+ get: operations["get_branding_icon_api_public_branding__asset_id__get"];
13172
+ put?: never;
13173
+ post?: never;
13174
+ delete?: never;
13175
+ options?: never;
13176
+ head?: never;
13177
+ patch?: never;
13178
+ trace?: never;
13179
+ };
13166
13180
  "/api/public/shared/{share_id}": {
13167
13181
  parameters: {
13168
13182
  query?: never;
@@ -13504,6 +13518,15 @@ declare type RequestOptions<M extends HttpMethod, P extends RoutePath<M>> = {
13504
13518
  /** Fill in what `adapter` leaves out. */
13505
13519
  export declare function resolveAuthAdapter(adapter: AuthAdapter): ResolvedAuthAdapter;
13506
13520
 
13521
+ /**
13522
+ * Resolves an app icon or favicon URL against the API's `basePath`.
13523
+ *
13524
+ * Uploaded branding icons are stored as `/api/public/branding/<id>`, so an app
13525
+ * whose API lives on another origin or subpath (e.g. `https://api.example.com/api`)
13526
+ * resolves them under `basePath` while external URLs and app-origin paths stay intact.
13527
+ */
13528
+ export declare function resolveBrandingUrl(value: string, basePath?: string): string;
13529
+
13507
13530
  /** An {@link AuthAdapter} with every member the client calls filled in. */
13508
13531
  declare interface ResolvedAuthAdapter {
13509
13532
  getHeaders: () => Promise<Record<string, string>>;
@@ -1,42 +1,46 @@
1
1
  import { createGentiqRuntime as o } from "./client/api.es.js";
2
2
  import { createLocalStorageAuthAdapter as a, resolveAuthAdapter as p } from "./client/auth.es.js";
3
- import { createHttpClient as m } from "./client/http.es.js";
4
- import { exchangeLoginCodeOnce as x } from "./client/loginCode.es.js";
5
- import { composerScope as d } from "./composer/composerDrafts.es.js";
6
- import { normalizeReference as i, normalizeWhitespace as u, sourceTextSignature as s, truncateReferenceText as l } from "./composer/references.es.js";
7
- import { createVoiceRecorder as S, isVoiceRecordingSupported as L } from "./composer/voiceRecorder.es.js";
8
- import { getDateLocale as T, getNumberLocale as A } from "./datetime.es.js";
9
- import { debugLog as q } from "./debugLog.es.js";
10
- import { warnOnceInDevelopment as w } from "./devWarning.es.js";
11
- import { getLanguageBadge as B } from "./languages.es.js";
12
- import { messageFeedback as D } from "./protocol/messages.es.js";
13
- import { isStoredPart as P, isStoredToolPart as V } from "./protocol/storedMessages.es.js";
14
- import { shareUnchanged as y } from "./thread/shareUnchanged.es.js";
15
- import { newThreadState as G, storedThreadState as H } from "./thread/threadReducer.es.js";
16
- import { uniqueBy as N } from "./uniqueBy.es.js";
3
+ import { BRANDING_URL_PREFIX as c, isValidIconUrl as m, resolveBrandingUrl as x } from "./client/brandingUrl.es.js";
4
+ import { createHttpClient as i } from "./client/http.es.js";
5
+ import { exchangeLoginCodeOnce as g } from "./client/loginCode.es.js";
6
+ import { composerScope as s } from "./composer/composerDrafts.es.js";
7
+ import { normalizeReference as h, normalizeWhitespace as R, sourceTextSignature as S, truncateReferenceText as L } from "./composer/references.es.js";
8
+ import { createVoiceRecorder as T, isVoiceRecordingSupported as B } from "./composer/voiceRecorder.es.js";
9
+ import { getDateLocale as U, getNumberLocale as b } from "./datetime.es.js";
10
+ import { debugLog as D } from "./debugLog.es.js";
11
+ import { warnOnceInDevelopment as P } from "./devWarning.es.js";
12
+ import { getLanguageBadge as q } from "./languages.es.js";
13
+ import { messageFeedback as z } from "./protocol/messages.es.js";
14
+ import { isStoredPart as F, isStoredToolPart as G } from "./protocol/storedMessages.es.js";
15
+ import { shareUnchanged as _ } from "./thread/shareUnchanged.es.js";
16
+ import { newThreadState as y, storedThreadState as E } from "./thread/threadReducer.es.js";
17
+ import { uniqueBy as W } from "./uniqueBy.es.js";
17
18
  export {
18
- d as composerScope,
19
+ c as BRANDING_URL_PREFIX,
20
+ s as composerScope,
19
21
  o as createGentiqRuntime,
20
- m as createHttpClient,
22
+ i as createHttpClient,
21
23
  a as createLocalStorageAuthAdapter,
22
- S as createVoiceRecorder,
23
- q as debugLog,
24
- x as exchangeLoginCodeOnce,
25
- T as getDateLocale,
26
- B as getLanguageBadge,
27
- A as getNumberLocale,
28
- P as isStoredPart,
29
- V as isStoredToolPart,
30
- L as isVoiceRecordingSupported,
31
- D as messageFeedback,
32
- G as newThreadState,
33
- i as normalizeReference,
34
- u as normalizeWhitespace,
24
+ T as createVoiceRecorder,
25
+ D as debugLog,
26
+ g as exchangeLoginCodeOnce,
27
+ U as getDateLocale,
28
+ q as getLanguageBadge,
29
+ b as getNumberLocale,
30
+ F as isStoredPart,
31
+ G as isStoredToolPart,
32
+ m as isValidIconUrl,
33
+ B as isVoiceRecordingSupported,
34
+ z as messageFeedback,
35
+ y as newThreadState,
36
+ h as normalizeReference,
37
+ R as normalizeWhitespace,
35
38
  p as resolveAuthAdapter,
36
- y as shareUnchanged,
37
- s as sourceTextSignature,
38
- H as storedThreadState,
39
- l as truncateReferenceText,
40
- N as uniqueBy,
41
- w as warnOnceInDevelopment
39
+ x as resolveBrandingUrl,
40
+ _ as shareUnchanged,
41
+ S as sourceTextSignature,
42
+ E as storedThreadState,
43
+ L as truncateReferenceText,
44
+ W as uniqueBy,
45
+ P as warnOnceInDevelopment
42
46
  };
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "provenance": false
12
12
  },
13
13
  "description": "Framework-free core of the Gentiq SDK: the API client, the chat protocol and the thread controller.",
14
- "version": "1.0.0-beta.1",
14
+ "version": "1.0.0-beta.2",
15
15
  "license": "Apache-2.0",
16
16
  "type": "module",
17
17
  "files": [