@happyvertical/smrt-inference 0.60.15 → 0.60.17

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 (60) hide show
  1. package/AGENTS.md +10 -5
  2. package/agents/fusions.md +16 -3
  3. package/agents/hosted.md +29 -13
  4. package/agents/settings.md +30 -7
  5. package/dist/chunks/{InferenceOverrideCollection-wl7sI-3C.js → InferenceOverrideCollection-ZpxhP0Zl.js} +29 -4
  6. package/dist/chunks/InferenceOverrideCollection-ZpxhP0Zl.js.map +1 -0
  7. package/dist/chunks/{provider-config-4Bx8N52X.js → provider-config-BSpIQRVM.js} +37 -11
  8. package/dist/chunks/{provider-config-4Bx8N52X.js.map → provider-config-BSpIQRVM.js.map} +1 -1
  9. package/dist/fusion.d.ts.map +1 -1
  10. package/dist/hosted.d.ts +31 -24
  11. package/dist/hosted.d.ts.map +1 -1
  12. package/dist/index.js +1 -1
  13. package/dist/manifest.json +1 -1
  14. package/dist/models/InferenceOverride.d.ts.map +1 -1
  15. package/dist/models.js +1 -1
  16. package/dist/node.js +86 -33
  17. package/dist/node.js.map +1 -1
  18. package/dist/register.d.ts.map +1 -1
  19. package/dist/resolver.d.ts.map +1 -1
  20. package/dist/resolver.js +4 -1
  21. package/dist/resolver.js.map +1 -1
  22. package/dist/server.d.ts +3 -2
  23. package/dist/server.d.ts.map +1 -1
  24. package/dist/server.js +194 -41
  25. package/dist/server.js.map +1 -1
  26. package/dist/settings/layers.d.ts +14 -0
  27. package/dist/settings/layers.d.ts.map +1 -1
  28. package/dist/settings/override-service.d.ts.map +1 -1
  29. package/dist/settings/resolver.d.ts +7 -0
  30. package/dist/settings/resolver.d.ts.map +1 -1
  31. package/dist/settings/settings-service.d.ts +80 -7
  32. package/dist/settings/settings-service.d.ts.map +1 -1
  33. package/dist/settings/targets.d.ts +21 -2
  34. package/dist/settings/targets.d.ts.map +1 -1
  35. package/dist/settings/transcripts.d.ts +33 -0
  36. package/dist/settings/transcripts.d.ts.map +1 -0
  37. package/dist/smrt-knowledge.json +17 -11
  38. package/dist/smrt-knowledge.okf.md +2 -2
  39. package/dist/svelte/components/InferenceAliasEditor.svelte +31 -23
  40. package/dist/svelte/components/InferenceDefaultView.svelte +58 -42
  41. package/dist/svelte/components/InferenceFusionList.svelte +37 -22
  42. package/dist/svelte/components/InferenceFusionList.svelte.d.ts.map +1 -1
  43. package/dist/svelte/components/InferenceSettingsPanel.svelte +97 -38
  44. package/dist/svelte/components/InferenceSettingsPanel.svelte.d.ts +21 -2
  45. package/dist/svelte/components/InferenceSettingsPanel.svelte.d.ts.map +1 -1
  46. package/dist/svelte/components/InferenceTierRow.svelte +38 -30
  47. package/dist/svelte/components/InferenceTranscriptSettings.svelte +171 -0
  48. package/dist/svelte/components/InferenceTranscriptSettings.svelte.d.ts +18 -0
  49. package/dist/svelte/components/InferenceTranscriptSettings.svelte.d.ts.map +1 -0
  50. package/dist/svelte/components/InferenceUsageTable.svelte +91 -32
  51. package/dist/svelte/components/InferenceUsageTable.svelte.d.ts +10 -4
  52. package/dist/svelte/components/InferenceUsageTable.svelte.d.ts.map +1 -1
  53. package/dist/svelte/index.d.ts +1 -1
  54. package/dist/svelte/index.d.ts.map +1 -1
  55. package/dist/svelte/index.js +1 -1
  56. package/dist/svelte/types.d.ts +66 -1
  57. package/dist/svelte/types.d.ts.map +1 -1
  58. package/dist/svelte/types.js +28 -0
  59. package/package.json +10 -10
  60. package/dist/chunks/InferenceOverrideCollection-wl7sI-3C.js.map +0 -1
@@ -8,7 +8,7 @@
8
8
  * and wires each callback to its own permission-checked server action.
9
9
  *
10
10
  * The default view is the whole screen for a one-provider app. Advanced
11
- * (tier ladder, `auto`'s default tier, aliases, fusions) is collapsed and
11
+ * (tier ladder, `auto`'s default tier, aliases, fusions, transcripts) is collapsed and
12
12
  * not rendered until opened. Keys leave only through `onSaveKey`; the panel
13
13
  * never receives one back (`defaults.keySet` says whether one is stored).
14
14
  */
@@ -31,6 +31,9 @@ import type {
31
31
  InferenceTestResultView,
32
32
  InferenceTierChange,
33
33
  InferenceTierView,
34
+ InferenceTranscriptLinkFilters,
35
+ InferenceTranscriptSettingsChange,
36
+ InferenceTranscriptSettingsView,
34
37
  InferenceUsageDimension,
35
38
  InferenceUsageView,
36
39
  } from '../types.js';
@@ -44,6 +47,7 @@ import InferenceAliasEditor from './InferenceAliasEditor.svelte';
44
47
  import InferenceDefaultView from './InferenceDefaultView.svelte';
45
48
  import InferenceFusionList from './InferenceFusionList.svelte';
46
49
  import InferenceTierRow from './InferenceTierRow.svelte';
50
+ import InferenceTranscriptSettings from './InferenceTranscriptSettings.svelte';
47
51
  import InferenceUsageTable from './InferenceUsageTable.svelte';
48
52
 
49
53
  export interface InferenceSettingsPanelProps {
@@ -63,6 +67,25 @@ export interface InferenceSettingsPanelProps {
63
67
  fusions?: InferenceFusionView[];
64
68
  /** Usage report (`usage()`); the Usage tab shows when this or `onUsageGroupBy` is set. */
65
69
  usage?: InferenceUsageView | null;
70
+ /**
71
+ * The app's transcript setting (`getTranscriptSettings()`, #4781), shown
72
+ * in Advanced and, when off, as a status line in the Usage tab.
73
+ */
74
+ transcripts?: InferenceTranscriptSettingsView | null;
75
+ /**
76
+ * The host is a platform admin that may change app-level settings
77
+ * (#4781). Only then is the transcript setting editable (with
78
+ * `onSaveTranscripts`); tenants cannot override it. Default `false`.
79
+ */
80
+ appEditable?: boolean;
81
+ /**
82
+ * The host's transcript route for a Usage-tab row (#4781). Rows with
83
+ * stored transcripts link their count and outcome labels there; the panel
84
+ * renders no transcript content.
85
+ */
86
+ transcriptHref?: (
87
+ filters: InferenceTranscriptLinkFilters,
88
+ ) => string | null | undefined;
66
89
  /**
67
90
  * Which scope Advanced edits write. `tenant` restricts choices to the
68
91
  * allow-list (display only; the server enforces it) and makes aliases and
@@ -96,6 +119,8 @@ export interface InferenceSettingsPanelProps {
96
119
  ) => Promise<InferenceTestResultView>;
97
120
  onSaveFusion?: (change: InferenceFusionChange) => void;
98
121
  onUsageGroupBy?: (by: InferenceUsageDimension[]) => void;
122
+ /** Writes the app row (never a tenant row). Used only with `appEditable`. */
123
+ onSaveTranscripts?: (change: InferenceTranscriptSettingsChange) => void;
99
124
  }
100
125
 
101
126
  const {
@@ -107,6 +132,9 @@ const {
107
132
  aliases = [],
108
133
  fusions = [],
109
134
  usage = null,
135
+ transcripts = null,
136
+ appEditable = false,
137
+ transcriptHref,
110
138
  scope = 'app',
111
139
  advancedOpen = false,
112
140
  busy = false,
@@ -123,6 +151,7 @@ const {
123
151
  onTestCandidate,
124
152
  onSaveFusion,
125
153
  onUsageGroupBy,
154
+ onSaveTranscripts,
126
155
  }: InferenceSettingsPanelProps = $props();
127
156
 
128
157
  let tab = $state<'settings' | 'usage'>('settings');
@@ -155,12 +184,12 @@ function tierAllowed(tier: InferenceSettingsTier): boolean {
155
184
  }
156
185
  </script>
157
186
 
158
- <section class="isp" data-testid="inference-settings-panel" data-smrt-component="InferenceSettingsPanel">
159
- {#if message}<p class="isp-flash" role="status">{message}</p>{/if}
160
- {#if error}<p class="isp-flash isp-flash-error" role="alert">{error}</p>{/if}
187
+ <section class="smrt-inference-settings-panel__root" data-testid="inference-settings-panel" data-smrt-component="InferenceSettingsPanel">
188
+ {#if message}<p class="smrt-inference-settings-panel__flash" data-smrt-part="message" role="status">{message}</p>{/if}
189
+ {#if error}<p class="smrt-inference-settings-panel__flash smrt-inference-settings-panel__flash-error" data-smrt-part="message" role="alert">{error}</p>{/if}
161
190
 
162
191
  {#if showUsage}
163
- <div class="isp-tabs" role="tablist">
192
+ <div class="smrt-inference-settings-panel__tabs" data-smrt-part="list" role="tablist">
164
193
  <button
165
194
  type="button"
166
195
  role="tab"
@@ -182,10 +211,16 @@ function tierAllowed(tier: InferenceSettingsTier): boolean {
182
211
 
183
212
  {#if tab === 'usage' && showUsage}
184
213
  <div role="tabpanel">
185
- <InferenceUsageTable {usage} {busy} {onUsageGroupBy} />
214
+ <InferenceUsageTable
215
+ {usage}
216
+ {busy}
217
+ transcriptsEnabled={transcripts ? transcripts.enabled : null}
218
+ {transcriptHref}
219
+ {onUsageGroupBy}
220
+ />
186
221
  </div>
187
222
  {:else}
188
- <div role={showUsage ? 'tabpanel' : undefined} class="isp-settings">
223
+ <div role={showUsage ? 'tabpanel' : undefined} class="smrt-inference-settings-panel__settings" data-smrt-part="body">
189
224
  {#key defaultsKey}
190
225
  <InferenceDefaultView
191
226
  {defaults}
@@ -201,7 +236,7 @@ function tierAllowed(tier: InferenceSettingsTier): boolean {
201
236
 
202
237
  <button
203
238
  type="button"
204
- class="isp-advanced-toggle"
239
+ class="smrt-inference-settings-panel__advanced-toggle" data-smrt-part="trigger"
205
240
  aria-expanded={advanced}
206
241
  aria-controls="isp-advanced"
207
242
  onclick={() => (advanced = !advanced)}
@@ -210,9 +245,9 @@ function tierAllowed(tier: InferenceSettingsTier): boolean {
210
245
  </button>
211
246
 
212
247
  {#if advanced}
213
- <div id="isp-advanced" class="isp-advanced" data-testid="inference-advanced">
248
+ <div id="isp-advanced" class="smrt-inference-settings-panel__advanced" data-smrt-part="panel" data-testid="inference-advanced">
214
249
  {#key advancedKey}
215
- <section class="isp-section">
250
+ <section class="smrt-inference-settings-panel__section" data-smrt-part="group">
216
251
  <h3>Tier ladder</h3>
217
252
  {#each tiers as row (row.tier)}
218
253
  <InferenceTierRow
@@ -225,19 +260,19 @@ function tierAllowed(tier: InferenceSettingsTier): boolean {
225
260
  {onSaveTier}
226
261
  />
227
262
  {:else}
228
- <p class="isp-hint">No tier rows were provided.</p>
263
+ <p class="smrt-inference-settings-panel__hint" data-smrt-part="description">No tier rows were provided.</p>
229
264
  {/each}
230
265
  </section>
231
266
 
232
267
  {#if defaultTier}
233
- <section class="isp-section">
268
+ <section class="smrt-inference-settings-panel__section" data-smrt-part="group">
234
269
  <h3><code>auto</code> default tier</h3>
235
- <form class="isp-auto" onsubmit={saveDefaultTier} data-testid="inference-auto-tier">
270
+ <form class="smrt-inference-settings-panel__auto" data-smrt-part="field" onsubmit={saveDefaultTier} data-testid="inference-auto-tier">
236
271
  <span>
237
272
  Now {defaultTier.effectiveTier} ({inferenceLevelLabel(defaultTier.supplyingLevel)})
238
273
  </span>
239
274
  <label>
240
- <span class="isp-hint">auto resolves to</span>
275
+ <span class="smrt-inference-settings-panel__hint" data-smrt-part="description">auto resolves to</span>
241
276
  <select
242
277
  name="autoTier"
243
278
  disabled={busy}
@@ -254,7 +289,7 @@ function tierAllowed(tier: InferenceSettingsTier): boolean {
254
289
  </section>
255
290
  {/if}
256
291
 
257
- <section class="isp-section">
292
+ <section class="smrt-inference-settings-panel__section" data-smrt-part="group">
258
293
  <h3>Aliases</h3>
259
294
  {#each aliases as alias (alias.name)}
260
295
  <InferenceAliasEditor
@@ -265,7 +300,7 @@ function tierAllowed(tier: InferenceSettingsTier): boolean {
265
300
  {onTestCandidate}
266
301
  />
267
302
  {:else}
268
- <p class="isp-hint">No aliases are defined.</p>
303
+ <p class="smrt-inference-settings-panel__hint" data-smrt-part="description">No aliases are defined.</p>
269
304
  {/each}
270
305
  {#if definitionsEditable && onSaveAlias}
271
306
  <InferenceAliasEditor
@@ -279,7 +314,7 @@ function tierAllowed(tier: InferenceSettingsTier): boolean {
279
314
  {/if}
280
315
  </section>
281
316
 
282
- <section class="isp-section">
317
+ <section class="smrt-inference-settings-panel__section" data-smrt-part="group">
283
318
  <h3>Fusions</h3>
284
319
  <InferenceFusionList
285
320
  {fusions}
@@ -288,6 +323,18 @@ function tierAllowed(tier: InferenceSettingsTier): boolean {
288
323
  {onSaveFusion}
289
324
  />
290
325
  </section>
326
+
327
+ {#if transcripts}
328
+ <section class="smrt-inference-settings-panel__section" data-smrt-part="group">
329
+ <h3>Transcripts</h3>
330
+ <InferenceTranscriptSettings
331
+ settings={transcripts}
332
+ editable={appEditable && !!onSaveTranscripts}
333
+ {busy}
334
+ {onSaveTranscripts}
335
+ />
336
+ </section>
337
+ {/if}
291
338
  {/key}
292
339
  </div>
293
340
  {/if}
@@ -297,49 +344,61 @@ function tierAllowed(tier: InferenceSettingsTier): boolean {
297
344
 
298
345
  <style>
299
346
  @layer smrt.reset, smrt.structure, smrt.theme;
300
- @layer smrt.theme {
301
- .isp,
302
- .isp-settings,
303
- .isp-advanced {
347
+ @layer smrt.structure {
348
+ .smrt-inference-settings-panel__root,
349
+ .smrt-inference-settings-panel__settings,
350
+ .smrt-inference-settings-panel__advanced {
304
351
  display: flex;
305
352
  flex-direction: column;
306
353
  gap: 1rem;
307
354
  }
308
- .isp-tabs {
355
+ .smrt-inference-settings-panel__tabs {
309
356
  display: flex;
310
357
  gap: 0.5rem;
311
- border-bottom: var(--smrt-hairline);
312
- }
313
- .isp-tabs [aria-selected='true'] {
314
- font-weight: 600;
315
358
  }
316
- .isp-flash {
359
+ .smrt-inference-settings-panel__flash {
317
360
  margin: 0;
318
361
  padding: 0.625rem 0.75rem;
319
- border-radius: 0.375rem;
320
- background: var(--smrt-color-surface-variant);
321
- }
322
- .isp-flash-error {
323
- color: var(--smrt-color-error);
324
- background: var(--smrt-color-error-container);
325
362
  }
326
- .isp-advanced-toggle {
363
+ .smrt-inference-settings-panel__advanced-toggle {
327
364
  align-self: flex-start;
328
365
  }
329
- .isp-section h3 {
366
+ .smrt-inference-settings-panel__section h3 {
330
367
  margin: 0 0 0.5rem;
331
- font-size: 1rem;
332
368
  }
333
- .isp-auto {
369
+ .smrt-inference-settings-panel__auto {
334
370
  display: flex;
335
371
  gap: 0.75rem;
336
372
  align-items: flex-end;
337
373
  flex-wrap: wrap;
338
374
  }
339
- .isp-hint {
375
+ .smrt-inference-settings-panel__hint {
340
376
  margin: 0;
377
+ }
378
+ }
379
+
380
+ @layer smrt.theme {
381
+ .smrt-inference-settings-panel__tabs {
382
+ border-bottom: var(--smrt-hairline);
383
+ }
384
+ .smrt-inference-settings-panel__tabs [aria-selected='true'] {
385
+ font-weight: 600;
386
+ }
387
+ .smrt-inference-settings-panel__flash {
388
+ border-radius: 0.375rem;
389
+ background: var(--smrt-color-surface-variant);
390
+ }
391
+ .smrt-inference-settings-panel__flash-error {
392
+ color: var(--smrt-color-error);
393
+ background: var(--smrt-color-error-container);
394
+ }
395
+ .smrt-inference-settings-panel__section h3 {
396
+ font-size: 1rem;
397
+ }
398
+ .smrt-inference-settings-panel__hint {
341
399
  font-size: 0.8125rem;
342
400
  color: var(--smrt-color-on-surface-variant);
343
401
  }
344
402
  }
403
+
345
404
  </style>
@@ -7,11 +7,11 @@
7
7
  * and wires each callback to its own permission-checked server action.
8
8
  *
9
9
  * The default view is the whole screen for a one-provider app. Advanced
10
- * (tier ladder, `auto`'s default tier, aliases, fusions) is collapsed and
10
+ * (tier ladder, `auto`'s default tier, aliases, fusions, transcripts) is collapsed and
11
11
  * not rendered until opened. Keys leave only through `onSaveKey`; the panel
12
12
  * never receives one back (`defaults.keySet` says whether one is stored).
13
13
  */
14
- import type { InferenceAliasChange, InferenceAliasView, InferenceCandidateView, InferenceConnectionRequest, InferenceDefaultsChange, InferenceDefaultsView, InferenceDefaultTierChange, InferenceDefaultTierView, InferenceDiscoveryView, InferenceFusionChange, InferenceFusionView, InferenceKeyChange, InferenceProviderView, InferenceSettingsScope, InferenceTestResultView, InferenceTierChange, InferenceTierView, InferenceUsageDimension, InferenceUsageView } from '../types.js';
14
+ import type { InferenceAliasChange, InferenceAliasView, InferenceCandidateView, InferenceConnectionRequest, InferenceDefaultsChange, InferenceDefaultsView, InferenceDefaultTierChange, InferenceDefaultTierView, InferenceDiscoveryView, InferenceFusionChange, InferenceFusionView, InferenceKeyChange, InferenceProviderView, InferenceSettingsScope, InferenceTestResultView, InferenceTierChange, InferenceTierView, InferenceTranscriptLinkFilters, InferenceTranscriptSettingsChange, InferenceTranscriptSettingsView, InferenceUsageDimension, InferenceUsageView } from '../types.js';
15
15
  export interface InferenceSettingsPanelProps {
16
16
  /** The current user (or tenant) choices for the default view. */
17
17
  defaults?: InferenceDefaultsView;
@@ -29,6 +29,23 @@ export interface InferenceSettingsPanelProps {
29
29
  fusions?: InferenceFusionView[];
30
30
  /** Usage report (`usage()`); the Usage tab shows when this or `onUsageGroupBy` is set. */
31
31
  usage?: InferenceUsageView | null;
32
+ /**
33
+ * The app's transcript setting (`getTranscriptSettings()`, #4781), shown
34
+ * in Advanced and, when off, as a status line in the Usage tab.
35
+ */
36
+ transcripts?: InferenceTranscriptSettingsView | null;
37
+ /**
38
+ * The host is a platform admin that may change app-level settings
39
+ * (#4781). Only then is the transcript setting editable (with
40
+ * `onSaveTranscripts`); tenants cannot override it. Default `false`.
41
+ */
42
+ appEditable?: boolean;
43
+ /**
44
+ * The host's transcript route for a Usage-tab row (#4781). Rows with
45
+ * stored transcripts link their count and outcome labels there; the panel
46
+ * renders no transcript content.
47
+ */
48
+ transcriptHref?: (filters: InferenceTranscriptLinkFilters) => string | null | undefined;
32
49
  /**
33
50
  * Which scope Advanced edits write. `tenant` restricts choices to the
34
51
  * allow-list (display only; the server enforces it) and makes aliases and
@@ -58,6 +75,8 @@ export interface InferenceSettingsPanelProps {
58
75
  onTestCandidate?: (candidate: InferenceCandidateView) => Promise<InferenceTestResultView>;
59
76
  onSaveFusion?: (change: InferenceFusionChange) => void;
60
77
  onUsageGroupBy?: (by: InferenceUsageDimension[]) => void;
78
+ /** Writes the app row (never a tenant row). Used only with `appEditable`. */
79
+ onSaveTranscripts?: (change: InferenceTranscriptSettingsChange) => void;
61
80
  }
62
81
  declare const InferenceSettingsPanel: import("svelte").Component<InferenceSettingsPanelProps, {}, "">;
63
82
  type InferenceSettingsPanel = ReturnType<typeof InferenceSettingsPanel>;
@@ -1 +1 @@
1
- {"version":3,"file":"InferenceSettingsPanel.svelte.d.ts","sourceRoot":"","sources":["../../../src/svelte/components/InferenceSettingsPanel.svelte.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;GAYG;AACH,OAAO,KAAK,EACV,oBAAoB,EACpB,kBAAkB,EAClB,sBAAsB,EACtB,0BAA0B,EAC1B,uBAAuB,EACvB,qBAAqB,EACrB,0BAA0B,EAC1B,wBAAwB,EACxB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A0B,KAChC,OAAO,CAAC,uBAAuB,CAAC,CAAC;IACtC,gBAAgB,CAAC,EAAE,MAAM,IAAI,CAAC;IAC9B,UAAU,CAAC,EAAE,CAAC,MAAM,EAAE,mBAAmB,KAAK,IAAI,CAAC;IACnD,iBAAiB,CAAC,EAAE,CAAC,MAAM,EAAE,0BAA0B,KAAK,IAAI,CAAC;IACjE,WAAW,CAAC,EAAE,CAAC,MAAM,EAAE,oBAAoB,KAAK,IAAI,CAAC;IACrD,eAAe,CAAC,EAAE,CAChB,SAAS,EAAE,sBAAsB,KAC9B,OAAO,CAAC,uBAAuB,CAAC,CAAC;IACtC,YAAY,CAAC,EAAE,CAAC,MAAM,EAAE,qBAAqB,KAAK,IAAI,CAAC;IACvD,cAAc,CAAC,EAAE,CAAC,EAAE,EAAE,uBAAuB,EAAE,KAAK,IAAI,CAAC;CAC1D;AA8JD,QAAA,MAAM,sBAAsB,iEAAwC,CAAC;AACrE,KAAK,sBAAsB,GAAG,UAAU,CAAC,OAAO,sBAAsB,CAAC,CAAC;AACxE,eAAe,sBAAsB,CAAC"}
1
+ {"version":3,"file":"InferenceSettingsPanel.svelte.d.ts","sourceRoot":"","sources":["../../../src/svelte/components/InferenceSettingsPanel.svelte.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;GAYG;AACH,OAAO,KAAK,EACV,oBAAoB,EACpB,kBAAkB,EAClB,sBAAsB,EACtB,0BAA0B,EAC1B,uBAAuB,EACvB,qBAAqB,EACrB,0BAA0B,EAC1B,wBAAwB,EACxB,sBAAsB,EACtB,qBAAqB,EACrB,mBAAmB,EACnB,kBAAkB,EAClB,qBAAqB,EACrB,sBAAsB,EAEtB,uBAAuB,EACvB,mBAAmB,EACnB,iBAAiB,EACjB,8BAA8B,EAC9B,iCAAiC,EACjC,+BAA+B,EAC/B,uBAAuB,EACvB,kBAAkB,EACnB,MAAM,aAAa,CAAC;AAerB,MAAM,WAAW,2BAA2B;IAC1C,iEAAiE;IACjE,QAAQ,CAAC,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C,uBAAuB,CAAC,CAAC;IACtC,gBAAgB,CAAC,EAAE,MAAM,IAAI,CAAC;IAC9B,UAAU,CAAC,EAAE,CAAC,MAAM,EAAE,mBAAmB,KAAK,IAAI,CAAC;IACnD,iBAAiB,CAAC,EAAE,CAAC,MAAM,EAAE,0BAA0B,KAAK,IAAI,CAAC;IACjE,WAAW,CAAC,EAAE,CAAC,MAAM,EAAE,oBAAoB,KAAK,IAAI,CAAC;IACrD,eAAe,CAAC,EAAE,CAChB,SAAS,EAAE,sBAAsB,KAC9B,OAAO,CAAC,uBAAuB,CAAC,CAAC;IACtC,YAAY,CAAC,EAAE,CAAC,MAAM,EAAE,qBAAqB,KAAK,IAAI,CAAC;IACvD,cAAc,CAAC,EAAE,CAAC,EAAE,EAAE,uBAAuB,EAAE,KAAK,IAAI,CAAC;IACzD,6EAA6E;IAC7E,iBAAiB,CAAC,EAAE,CAAC,MAAM,EAAE,iCAAiC,KAAK,IAAI,CAAC;CACzE;AA0KD,QAAA,MAAM,sBAAsB,iEAAwC,CAAC;AACrE,KAAK,sBAAsB,GAAG,UAAU,CAAC,OAAO,sBAAsB,CAAC,CAAC;AACxE,eAAe,sBAAsB,CAAC"}
@@ -92,20 +92,20 @@ function submit(event: SubmitEvent): void {
92
92
  }
93
93
  </script>
94
94
 
95
- <form class="itr" onsubmit={submit} data-testid={`inference-tier-${row.tier}`}>
96
- <div class="itr-head">
97
- <strong class="itr-tier">{row.tier}</strong>
98
- <span class="itr-effective">{row.effectiveLabel}</span>
99
- <span class="itr-level">{inferenceLevelLabel(row.supplyingLevel)}</span>
95
+ <form class="smrt-inference-tier-row__root" onsubmit={submit} data-testid={`inference-tier-${row.tier}`} data-smrt-component="InferenceTierRow">
96
+ <div class="smrt-inference-tier-row__header" data-smrt-part="header">
97
+ <strong class="smrt-inference-tier-row__tier" data-smrt-part="title">{row.tier}</strong>
98
+ <span class="smrt-inference-tier-row__effective" data-smrt-part="value">{row.effectiveLabel}</span>
99
+ <span class="smrt-inference-tier-row__level" data-smrt-part="progress">{inferenceLevelLabel(row.supplyingLevel)}</span>
100
100
  </div>
101
101
  {#if restricted && row.tenantBlocked}
102
- <p class="itr-note" role="note">
102
+ <p class="smrt-inference-tier-row__note" data-smrt-part="description" role="note">
103
103
  This tenant binding is no longer on the allow-list and is not in effect.
104
104
  </p>
105
105
  {/if}
106
- <div class="itr-controls">
106
+ <div class="smrt-inference-tier-row__controls" data-smrt-part="actions">
107
107
  <label>
108
- <span class="itr-label">Target for {row.tier}</span>
108
+ <span class="smrt-inference-tier-row__label" data-smrt-part="label">Target for {row.tier}</span>
109
109
  <select name="kind" bind:value={kind} disabled={busy}>
110
110
  <option value="default">Same as default</option>
111
111
  <option value="model" disabled={!modelAllowed}>Model</option>
@@ -115,7 +115,7 @@ function submit(event: SubmitEvent): void {
115
115
  </label>
116
116
  {#if kind === 'model'}
117
117
  <label>
118
- <span class="itr-label">Provider</span>
118
+ <span class="smrt-inference-tier-row__label" data-smrt-part="label">Provider</span>
119
119
  <select name="provider" bind:value={provider} disabled={busy}>
120
120
  <option value="">Configured provider</option>
121
121
  {#each providers.filter((option) => option.kind === 'provider') as option (option.id)}
@@ -124,12 +124,12 @@ function submit(event: SubmitEvent): void {
124
124
  </select>
125
125
  </label>
126
126
  <label>
127
- <span class="itr-label">Model</span>
127
+ <span class="smrt-inference-tier-row__label" data-smrt-part="label">Model</span>
128
128
  <input name="model" bind:value={model} required disabled={busy} />
129
129
  </label>
130
130
  {:else if kind === 'alias'}
131
131
  <label>
132
- <span class="itr-label">Alias</span>
132
+ <span class="smrt-inference-tier-row__label" data-smrt-part="label">Alias</span>
133
133
  <select name="alias" bind:value={alias} required disabled={busy}>
134
134
  <option value="" disabled>Choose an alias</option>
135
135
  {#each aliases as entry (entry.name)}
@@ -139,7 +139,7 @@ function submit(event: SubmitEvent): void {
139
139
  </label>
140
140
  {:else if kind === 'fusion'}
141
141
  <label>
142
- <span class="itr-label">Fusion</span>
142
+ <span class="smrt-inference-tier-row__label" data-smrt-part="label">Fusion</span>
143
143
  <select name="fusion" bind:value={fusion} required disabled={busy}>
144
144
  <option value="" disabled>Choose a fusion</option>
145
145
  {#each fusions as entry (entry.name)}
@@ -152,48 +152,56 @@ function submit(event: SubmitEvent): void {
152
152
  {/if}
153
153
  <button type="submit" disabled={busy || !onSaveTier}>Save</button>
154
154
  </div>
155
- <p class="itr-hint">"Same as default" reverts to: {tierRevertPreview(row, scope)}</p>
155
+ <p class="smrt-inference-tier-row__hint" data-smrt-part="description">"Same as default" reverts to: {tierRevertPreview(row, scope)}</p>
156
156
  </form>
157
157
 
158
158
  <style>
159
159
  @layer smrt.reset, smrt.structure, smrt.theme;
160
- @layer smrt.theme {
161
- .itr {
160
+ @layer smrt.structure {
161
+ .smrt-inference-tier-row__root {
162
162
  display: flex;
163
163
  flex-direction: column;
164
164
  gap: 0.375rem;
165
165
  padding: 0.5rem 0;
166
- border-bottom: var(--smrt-hairline);
167
166
  }
168
- .itr-head {
167
+ .smrt-inference-tier-row__header {
169
168
  display: flex;
170
169
  gap: 0.75rem;
171
170
  align-items: baseline;
172
171
  flex-wrap: wrap;
173
172
  }
174
- .itr-tier {
175
- text-transform: capitalize;
173
+ .smrt-inference-tier-row__tier {
176
174
  min-width: 4rem;
177
175
  }
178
- .itr-level,
179
- .itr-hint,
180
- .itr-note,
181
- .itr-label {
182
- font-size: 0.8125rem;
183
- color: var(--smrt-color-on-surface-variant);
184
- }
185
- .itr-hint,
186
- .itr-note {
176
+ .smrt-inference-tier-row__hint,
177
+ .smrt-inference-tier-row__note {
187
178
  margin: 0;
188
179
  }
189
- .itr-label {
180
+ .smrt-inference-tier-row__label {
190
181
  display: block;
191
182
  }
192
- .itr-controls {
183
+ .smrt-inference-tier-row__controls {
193
184
  display: flex;
194
185
  gap: 0.5rem;
195
186
  align-items: flex-end;
196
187
  flex-wrap: wrap;
197
188
  }
198
189
  }
190
+
191
+ @layer smrt.theme {
192
+ .smrt-inference-tier-row__root {
193
+ border-bottom: var(--smrt-hairline);
194
+ }
195
+ .smrt-inference-tier-row__tier {
196
+ text-transform: capitalize;
197
+ }
198
+ .smrt-inference-tier-row__level,
199
+ .smrt-inference-tier-row__hint,
200
+ .smrt-inference-tier-row__note,
201
+ .smrt-inference-tier-row__label {
202
+ font-size: 0.8125rem;
203
+ color: var(--smrt-color-on-surface-variant);
204
+ }
205
+ }
206
+
199
207
  </style>
@@ -0,0 +1,171 @@
1
+ <script lang="ts">
2
+ /**
3
+ * The app's transcript setting in Advanced (#4781). Read-only unless the
4
+ * host passes `editable` (platform admin, `appEditable` on the panel):
5
+ * tenants cannot override transcripts, and a save always writes the app
6
+ * row. Retention is the sweep's policy and stays read-only. Renders no
7
+ * transcript content.
8
+ */
9
+ import type {
10
+ InferenceTranscriptSettingsChange,
11
+ InferenceTranscriptSettingsView,
12
+ } from '../types.js';
13
+
14
+ interface InferenceTranscriptSettingsProps {
15
+ settings: InferenceTranscriptSettingsView;
16
+ editable: boolean;
17
+ busy: boolean;
18
+ onSaveTranscripts?: (change: InferenceTranscriptSettingsChange) => void;
19
+ }
20
+
21
+ const {
22
+ settings,
23
+ editable,
24
+ busy,
25
+ onSaveTranscripts,
26
+ }: InferenceTranscriptSettingsProps = $props();
27
+
28
+ const LEVELS: Record<string, string> = {
29
+ env: 'SMRT_INFERENCE_TRANSCRIPTS',
30
+ app: 'App setting',
31
+ config: 'Config',
32
+ default: 'Default',
33
+ };
34
+
35
+ const retention = $derived(
36
+ settings.retentionDays === null || settings.retentionDays === undefined
37
+ ? 'not pruned'
38
+ : `${settings.retentionDays} days`,
39
+ );
40
+
41
+ function percent(value: number): string {
42
+ return `${Math.round(value * 1000) / 10}%`;
43
+ }
44
+
45
+ function save(event: SubmitEvent): void {
46
+ event.preventDefault();
47
+ if (!onSaveTranscripts) return;
48
+ const data = new FormData(event.currentTarget as HTMLFormElement);
49
+ onSaveTranscripts({
50
+ settings: {
51
+ enabled: data.get('enabled') === 'on',
52
+ sample: Number(data.get('sample')),
53
+ maxBytes: Number(data.get('maxBytes')),
54
+ },
55
+ });
56
+ }
57
+
58
+ function revert(): void {
59
+ onSaveTranscripts?.({ settings: null });
60
+ }
61
+ </script>
62
+
63
+ <div class="smrt-inference-transcript-settings__root" data-testid="inference-transcripts" data-smrt-component="InferenceTranscriptSettings">
64
+ {#if settings.envEnabled !== null && settings.envEnabled !== undefined}
65
+ <p class="smrt-inference-transcript-settings__hint" data-smrt-part="description" data-testid="inference-transcripts-env">
66
+ SMRT_INFERENCE_TRANSCRIPTS turns transcripts {settings.envEnabled ? 'on' : 'off'} over this setting.
67
+ </p>
68
+ {/if}
69
+ {#if editable}
70
+ <form class="smrt-inference-transcript-settings__form" data-smrt-part="field" onsubmit={save} data-testid="inference-transcripts-form">
71
+ <label>
72
+ <input type="checkbox" name="enabled" checked={settings.enabled} disabled={busy} />
73
+ Store transcripts
74
+ </label>
75
+ <label>
76
+ <span class="smrt-inference-transcript-settings__hint" data-smrt-part="description">Success sample rate (0–1)</span>
77
+ <input
78
+ type="number"
79
+ name="sample"
80
+ min="0"
81
+ max="1"
82
+ step="0.01"
83
+ value={settings.sample}
84
+ disabled={busy}
85
+ required
86
+ />
87
+ </label>
88
+ <label>
89
+ <span class="smrt-inference-transcript-settings__hint" data-smrt-part="description">Max bytes per call</span>
90
+ <input
91
+ type="number"
92
+ name="maxBytes"
93
+ min="1024"
94
+ step="1"
95
+ value={settings.maxBytes}
96
+ disabled={busy}
97
+ required
98
+ />
99
+ </label>
100
+ <button type="submit" disabled={busy}>Save</button>
101
+ {#if settings.appValue}
102
+ <button type="button" disabled={busy} onclick={revert}>
103
+ Revert to config{settings.appRevert
104
+ ? ` (${settings.appRevert.enabled ? 'on' : 'off'})`
105
+ : ''}
106
+ </button>
107
+ {/if}
108
+ </form>
109
+ {/if}
110
+ <dl class="smrt-inference-transcript-settings__values" data-smrt-part="list">
111
+ {#if !editable}
112
+ <dt>Stored</dt>
113
+ <dd data-testid="inference-transcripts-enabled">{settings.enabled ? 'On' : 'Off'}</dd>
114
+ <dt>Success sample rate</dt>
115
+ <dd>{percent(settings.sample)}</dd>
116
+ <dt>Max bytes per call</dt>
117
+ <dd>{settings.maxBytes}</dd>
118
+ {/if}
119
+ <dt>Retention</dt>
120
+ <dd data-testid="inference-transcripts-retention">{retention}</dd>
121
+ {#if settings.supplyingLevel}
122
+ <dt>Set by</dt>
123
+ <dd>{LEVELS[settings.supplyingLevel] ?? settings.supplyingLevel}</dd>
124
+ {/if}
125
+ </dl>
126
+ {#if settings.promptOverrides && settings.promptOverrides.length > 0}
127
+ <p class="smrt-inference-transcript-settings__hint" data-smrt-part="description">
128
+ Config sets its own sample rate for {settings.promptOverrides.length} prompt key(s).
129
+ </p>
130
+ {/if}
131
+ {#if !editable}
132
+ <p class="smrt-inference-transcript-settings__hint" data-smrt-part="description">App-wide setting; tenants cannot change it.</p>
133
+ {/if}
134
+ </div>
135
+
136
+ <style>
137
+ @layer smrt.reset, smrt.structure, smrt.theme;
138
+ @layer smrt.structure {
139
+ .smrt-inference-transcript-settings__root {
140
+ display: flex;
141
+ flex-direction: column;
142
+ gap: 0.5rem;
143
+ }
144
+ .smrt-inference-transcript-settings__form {
145
+ display: flex;
146
+ gap: 0.75rem;
147
+ align-items: flex-end;
148
+ flex-wrap: wrap;
149
+ }
150
+ .smrt-inference-transcript-settings__values {
151
+ display: grid;
152
+ grid-template-columns: max-content 1fr;
153
+ gap: 0.25rem 0.75rem;
154
+ margin: 0;
155
+ }
156
+ .smrt-inference-transcript-settings__values dd {
157
+ margin: 0;
158
+ }
159
+ .smrt-inference-transcript-settings__hint {
160
+ margin: 0;
161
+ }
162
+ }
163
+
164
+ @layer smrt.theme {
165
+ .smrt-inference-transcript-settings__hint {
166
+ font-size: 0.8125rem;
167
+ color: var(--smrt-color-on-surface-variant);
168
+ }
169
+ }
170
+
171
+ </style>
@@ -0,0 +1,18 @@
1
+ /**
2
+ * The app's transcript setting in Advanced (#4781). Read-only unless the
3
+ * host passes `editable` (platform admin, `appEditable` on the panel):
4
+ * tenants cannot override transcripts, and a save always writes the app
5
+ * row. Retention is the sweep's policy and stays read-only. Renders no
6
+ * transcript content.
7
+ */
8
+ import type { InferenceTranscriptSettingsChange, InferenceTranscriptSettingsView } from '../types.js';
9
+ interface InferenceTranscriptSettingsProps {
10
+ settings: InferenceTranscriptSettingsView;
11
+ editable: boolean;
12
+ busy: boolean;
13
+ onSaveTranscripts?: (change: InferenceTranscriptSettingsChange) => void;
14
+ }
15
+ declare const InferenceTranscriptSettings: import("svelte").Component<InferenceTranscriptSettingsProps, {}, "">;
16
+ type InferenceTranscriptSettings = ReturnType<typeof InferenceTranscriptSettings>;
17
+ export default InferenceTranscriptSettings;
18
+ //# sourceMappingURL=InferenceTranscriptSettings.svelte.d.ts.map