@happyvertical/smrt-inference 0.60.15 → 0.60.16

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 (57) 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-Dat4TrK5.js} +29 -4
  6. package/dist/chunks/InferenceOverrideCollection-Dat4TrK5.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/InferenceFusionList.svelte +6 -0
  40. package/dist/svelte/components/InferenceFusionList.svelte.d.ts.map +1 -1
  41. package/dist/svelte/components/InferenceSettingsPanel.svelte +49 -2
  42. package/dist/svelte/components/InferenceSettingsPanel.svelte.d.ts +21 -2
  43. package/dist/svelte/components/InferenceSettingsPanel.svelte.d.ts.map +1 -1
  44. package/dist/svelte/components/InferenceTranscriptSettings.svelte +165 -0
  45. package/dist/svelte/components/InferenceTranscriptSettings.svelte.d.ts +18 -0
  46. package/dist/svelte/components/InferenceTranscriptSettings.svelte.d.ts.map +1 -0
  47. package/dist/svelte/components/InferenceUsageTable.svelte +64 -14
  48. package/dist/svelte/components/InferenceUsageTable.svelte.d.ts +10 -4
  49. package/dist/svelte/components/InferenceUsageTable.svelte.d.ts.map +1 -1
  50. package/dist/svelte/index.d.ts +1 -1
  51. package/dist/svelte/index.d.ts.map +1 -1
  52. package/dist/svelte/index.js +1 -1
  53. package/dist/svelte/types.d.ts +66 -1
  54. package/dist/svelte/types.d.ts.map +1 -1
  55. package/dist/svelte/types.js +28 -0
  56. package/package.json +10 -10
  57. 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');
@@ -182,7 +211,13 @@ 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
223
  <div role={showUsage ? 'tabpanel' : undefined} class="isp-settings">
@@ -288,6 +323,18 @@ function tierAllowed(tier: InferenceSettingsTier): boolean {
288
323
  {onSaveFusion}
289
324
  />
290
325
  </section>
326
+
327
+ {#if transcripts}
328
+ <section class="isp-section">
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}
@@ -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,sBAAsB,EACtB,qBAAqB,EACrB,mBAAmB,EACnB,kBAAkB,EAClB,qBAAqB,EACrB,sBAAsB,EAEtB,uBAAuB,EACvB,mBAAmB,EACnB,iBAAiB,EACjB,uBAAuB,EACvB,kBAAkB,EACnB,MAAM,aAAa,CAAC;AAcrB,MAAM,WAAW,2BAA2B;IAC1C,iEAAiE;IACjE,QAAQ,CAAC,EAAE,qBAAqB,CAAC;IACjC,2EAA2E;IAC3E,SAAS,CAAC,EAAE,qBAAqB,EAAE,CAAC;IACpC,kEAAkE;IAClE,gBAAgB,CAAC,EAAE,sBAAsB,EAAE,CAAC;IAC5C,6CAA6C;IAC7C,KAAK,CAAC,EAAE,iBAAiB,EAAE,CAAC;IAC5B,yDAAyD;IACzD,WAAW,CAAC,EAAE,wBAAwB,G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AE,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,EAAE,qBAAqB,CAAC;IACjC,2EAA2E;IAC3E,SAAS,CAAC,EAAE,qBAAqB,EAAE,CAAC;IACpC,kEAAkE;IAClE,gBAAgB,CAAC,EAAE,sBAAsB,EAAE,CAAC;IAC5C,6CAA6C;IAC7C,KAAK,CAAC,EAAE,iBAAiB,EAAE,CAAC;IAC5B,yDAAyD;IACzD,WAAW,CAAC,EAAE,wBAAwB,GAAG,IAAI,CAAC;IAC9C,0CAA0C;IAC1C,OAAO,CAAC,EAAE,kBAAkB,EAAE,CAAC;IAC/B,2EAA2E;IAC3E,OAAO,CAAC,EAAE,mBAAmB,EAAE,CAAC;IAChC,0FAA0F;IAC1F,KAAK,CAAC,EAAE,kBAAkB,GAAG,IAAI,CAAC;IAClC;;;OAGG;IACH,WAAW,CAAC,EAAE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AK,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"}
@@ -0,0 +1,165 @@
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="its" data-testid="inference-transcripts">
64
+ {#if settings.envEnabled !== null && settings.envEnabled !== undefined}
65
+ <p class="its-hint" 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="its-form" 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="its-hint">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="its-hint">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="its-values">
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="its-hint">
128
+ Config sets its own sample rate for {settings.promptOverrides.length} prompt key(s).
129
+ </p>
130
+ {/if}
131
+ {#if !editable}
132
+ <p class="its-hint">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.theme {
139
+ .its {
140
+ display: flex;
141
+ flex-direction: column;
142
+ gap: 0.5rem;
143
+ }
144
+ .its-form {
145
+ display: flex;
146
+ gap: 0.75rem;
147
+ align-items: flex-end;
148
+ flex-wrap: wrap;
149
+ }
150
+ .its-values {
151
+ display: grid;
152
+ grid-template-columns: max-content 1fr;
153
+ gap: 0.25rem 0.75rem;
154
+ margin: 0;
155
+ }
156
+ .its-values dd {
157
+ margin: 0;
158
+ }
159
+ .its-hint {
160
+ margin: 0;
161
+ font-size: 0.8125rem;
162
+ color: var(--smrt-color-on-surface-variant);
163
+ }
164
+ }
165
+ </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
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InferenceTranscriptSettings.svelte.d.ts","sourceRoot":"","sources":["../../../src/svelte/components/InferenceTranscriptSettings.svelte.ts"],"names":[],"mappings":"AAGA;;;;;;GAMG;AACH,OAAO,KAAK,EACV,iCAAiC,EACjC,+BAA+B,EAChC,MAAM,aAAa,CAAC;AAGrB,UAAU,gCAAgC;IACxC,QAAQ,EAAE,+BAA+B,CAAC;IAC1C,QAAQ,EAAE,OAAO,CAAC;IAClB,IAAI,EAAE,OAAO,CAAC;IACd,iBAAiB,CAAC,EAAE,CAAC,MAAM,EAAE,iCAAiC,KAAK,IAAI,CAAC;CACzE;AA4GD,QAAA,MAAM,2BAA2B,sEAAwC,CAAC;AAC1E,KAAK,2BAA2B,GAAG,UAAU,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAClF,eAAe,2BAA2B,CAAC"}
@@ -1,27 +1,64 @@
1
1
  <script lang="ts">
2
2
  /**
3
- * The Usage tab: `reportAiUsage()` buckets (#4751) by model, tier and/or
4
- * prompt key. Renders only the dimensions the report was grouped by, so it
5
- * works with the model dimension alone.
3
+ * The Usage tab: `reportAiUsage()` buckets (#4751) by model, tier, prompt
4
+ * key, fusion and/or template hash. Renders only the dimensions the report
5
+ * was grouped by, so it works with the model dimension alone. With
6
+ * transcript counts (#4781) each row shows how many calls have a stored
7
+ * transcript and links them (and each outcome label) to the host's
8
+ * transcript route; transcript content is never rendered here.
6
9
  */
7
- import type { InferenceUsageDimension, InferenceUsageView } from '../types.js';
8
- import { usageColumns } from '../types.js';
10
+ import type {
11
+ InferenceTranscriptLinkFilters,
12
+ InferenceUsageDimension,
13
+ InferenceUsageView,
14
+ } from '../types.js';
15
+ import { transcriptLinkFilters, usageColumns } from '../types.js';
9
16
 
10
17
  interface InferenceUsageTableProps {
11
18
  usage: InferenceUsageView | null;
12
19
  busy: boolean;
20
+ /** Whether the app stores transcripts; `false` shows the status line. */
21
+ transcriptsEnabled?: boolean | null;
22
+ transcriptHref?: (
23
+ filters: InferenceTranscriptLinkFilters,
24
+ ) => string | null | undefined;
13
25
  onUsageGroupBy?: (by: InferenceUsageDimension[]) => void;
14
26
  }
15
27
 
16
- const { usage, busy, onUsageGroupBy }: InferenceUsageTableProps = $props();
28
+ const {
29
+ usage,
30
+ busy,
31
+ transcriptsEnabled = null,
32
+ transcriptHref,
33
+ onUsageGroupBy,
34
+ }: InferenceUsageTableProps = $props();
17
35
 
18
36
  const DIMENSIONS: Array<{ id: InferenceUsageDimension; label: string }> = [
19
37
  { id: 'model', label: 'Model' },
20
38
  { id: 'tier', label: 'Tier' },
21
39
  { id: 'prompt', label: 'Prompt key' },
40
+ { id: 'fusion', label: 'Fusion' },
41
+ { id: 'template', label: 'Template' },
22
42
  ];
23
43
 
24
44
  const columns = $derived(usage ? usageColumns(usage) : []);
45
+ const showTranscripts = $derived(
46
+ !!usage?.buckets.some((bucket) => typeof bucket.transcripts === 'number'),
47
+ );
48
+
49
+ function href(
50
+ key: Record<string, string | null | undefined>,
51
+ outcome?: string,
52
+ ): string | null {
53
+ if (!usage || !transcriptHref) return null;
54
+ return transcriptHref(transcriptLinkFilters(usage, key, outcome)) || null;
55
+ }
56
+
57
+ function outcomeEntries(
58
+ value: Record<string, number> | undefined,
59
+ ): Array<[string, number]> {
60
+ return Object.entries(value ?? {});
61
+ }
25
62
 
26
63
  function regroup(event: Event): void {
27
64
  const form = (event.currentTarget as HTMLInputElement).form;
@@ -31,16 +68,14 @@ function regroup(event: Event): void {
31
68
  .map(String) as InferenceUsageDimension[];
32
69
  onUsageGroupBy(by.length > 0 ? by : ['model']);
33
70
  }
34
-
35
- function outcomes(value: Record<string, number> | undefined): string {
36
- const entries = Object.entries(value ?? {});
37
- return entries.length > 0
38
- ? entries.map(([label, count]) => `${label} ${count}`).join(', ')
39
- : '–';
40
- }
41
71
  </script>
42
72
 
43
73
  <div class="iut" data-testid="inference-usage">
74
+ {#if transcriptsEnabled === false}
75
+ <p class="iut-label" role="status" data-testid="inference-transcripts-off">
76
+ Transcripts are off; turn them on with <code>inference.transcripts.enabled</code> (Advanced, Transcripts) or <code>SMRT_INFERENCE_TRANSCRIPTS=1</code>.
77
+ </p>
78
+ {/if}
44
79
  {#if onUsageGroupBy}
45
80
  <form class="iut-group">
46
81
  <span class="iut-label">Group by</span>
@@ -72,6 +107,7 @@ function outcomes(value: Record<string, number> | undefined): string {
72
107
  <th scope="col">Tokens</th>
73
108
  <th scope="col">Est. cost</th>
74
109
  <th scope="col">Outcomes</th>
110
+ {#if showTranscripts}<th scope="col">Transcripts</th>{/if}
75
111
  </tr>
76
112
  </thead>
77
113
  <tbody>
@@ -86,7 +122,21 @@ function outcomes(value: Record<string, number> | undefined): string {
86
122
  ${bucket.estimatedCost.toFixed(4)}
87
123
  {#if bucket.uncostedCalls}<span class="iut-label">({bucket.uncostedCalls} uncosted)</span>{/if}
88
124
  </td>
89
- <td>{outcomes(bucket.outcomes)}</td>
125
+ <td>
126
+ {#each outcomeEntries(bucket.outcomes) as [label, count], position (label)}
127
+ {@const link = (bucket.transcripts ?? 0) > 0 ? href(bucket.key, label) : null}
128
+ {#if position > 0}, {/if}
129
+ {#if link}<a href={link} data-testid="inference-transcript-outcome-link">{label} {count}</a>{:else}{label} {count}{/if}
130
+ {:else}
131
+ –
132
+ {/each}
133
+ </td>
134
+ {#if showTranscripts}
135
+ {@const link = (bucket.transcripts ?? 0) > 0 ? href(bucket.key) : null}
136
+ <td data-testid="inference-transcript-count">
137
+ {#if link}<a href={link} data-testid="inference-transcript-link">{bucket.transcripts}</a>{:else}{bucket.transcripts ?? 0}{/if}
138
+ </td>
139
+ {/if}
90
140
  </tr>
91
141
  {/each}
92
142
  </tbody>
@@ -1,12 +1,18 @@
1
1
  /**
2
- * The Usage tab: `reportAiUsage()` buckets (#4751) by model, tier and/or
3
- * prompt key. Renders only the dimensions the report was grouped by, so it
4
- * works with the model dimension alone.
2
+ * The Usage tab: `reportAiUsage()` buckets (#4751) by model, tier, prompt
3
+ * key, fusion and/or template hash. Renders only the dimensions the report
4
+ * was grouped by, so it works with the model dimension alone. With
5
+ * transcript counts (#4781) each row shows how many calls have a stored
6
+ * transcript and links them (and each outcome label) to the host's
7
+ * transcript route; transcript content is never rendered here.
5
8
  */
6
- import type { InferenceUsageDimension, InferenceUsageView } from '../types.js';
9
+ import type { InferenceTranscriptLinkFilters, InferenceUsageDimension, InferenceUsageView } from '../types.js';
7
10
  interface InferenceUsageTableProps {
8
11
  usage: InferenceUsageView | null;
9
12
  busy: boolean;
13
+ /** Whether the app stores transcripts; `false` shows the status line. */
14
+ transcriptsEnabled?: boolean | null;
15
+ transcriptHref?: (filters: InferenceTranscriptLinkFilters) => string | null | undefined;
10
16
  onUsageGroupBy?: (by: InferenceUsageDimension[]) => void;
11
17
  }
12
18
  declare const InferenceUsageTable: import("svelte").Component<InferenceUsageTableProps, {}, "">;
@@ -1 +1 @@
1
- {"version":3,"file":"InferenceUsageTable.svelte.d.ts","sourceRoot":"","sources":["../../../src/svelte/components/InferenceUsageTable.svelte.ts"],"names":[],"mappings":"AAGA;;;;GAIG;AACH,OAAO,KAAK,EAAE,uBAAuB,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAI/E,UAAU,wBAAwB;IAChC,KAAK,EAAE,kBAAkB,GAAG,IAAI,CAAC;IACjC,IAAI,EAAE,OAAO,CAAC;IACd,cAAc,CAAC,EAAE,CAAC,EAAE,EAAE,uBAAuB,EAAE,KAAK,IAAI,CAAC;CAC1D;AAsFD,QAAA,MAAM,mBAAmB,8DAAwC,CAAC;AAClE,KAAK,mBAAmB,GAAG,UAAU,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAClE,eAAe,mBAAmB,CAAC"}
1
+ {"version":3,"file":"InferenceUsageTable.svelte.d.ts","sourceRoot":"","sources":["../../../src/svelte/components/InferenceUsageTable.svelte.ts"],"names":[],"mappings":"AAGA;;;;;;;GAOG;AACH,OAAO,KAAK,EACV,8BAA8B,EAC9B,uBAAuB,EACvB,kBAAkB,EACnB,MAAM,aAAa,CAAC;AAIrB,UAAU,wBAAwB;IAChC,KAAK,EAAE,kBAAkB,GAAG,IAAI,CAAC;IACjC,IAAI,EAAE,OAAO,CAAC;IACd,yEAAyE;IACzE,kBAAkB,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;IACpC,cAAc,CAAC,EAAE,CACf,OAAO,EAAE,8BAA8B,KACpC,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IAC/B,cAAc,CAAC,EAAE,CAAC,EAAE,EAAE,uBAAuB,EAAE,KAAK,IAAI,CAAC;CAC1D;AA0HD,QAAA,MAAM,mBAAmB,8DAAwC,CAAC;AAClE,KAAK,mBAAmB,GAAG,UAAU,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAClE,eAAe,mBAAmB,CAAC"}
@@ -13,5 +13,5 @@ import type { ComponentProps } from 'svelte';
13
13
  import InferenceSettingsPanel from './components/InferenceSettingsPanel.svelte';
14
14
  export { InferenceSettingsPanel };
15
15
  export type InferenceSettingsPanelProps = ComponentProps<typeof InferenceSettingsPanel>;
16
- export { candidateViewLabel, defaultTierRevertPreview, describeTargetView, INFERENCE_SETTINGS_MODES, INFERENCE_SETTINGS_TIERS, type InferenceAliasChange, type InferenceAliasView, type InferenceCandidateView, type InferenceConnectionRequest, type InferenceDefaultsChange, type InferenceDefaultsView, type InferenceDefaultTierChange, type InferenceDefaultTierView, type InferenceDiscoveryView, type InferenceFusionChange, type InferenceFusionView, type InferenceKeyChange, type InferenceProviderView, type InferenceSettingsLevelView, type InferenceSettingsMode, type InferenceSettingsScope, type InferenceSettingsTier, type InferenceTargetView, type InferenceTestResultView, type InferenceTierChange, type InferenceTierView, type InferenceUsageDimension, type InferenceUsageView, inferenceLevelLabel, isRefAllowed, targetViewRef, tierRevertPreview, usageColumns, } from './types.js';
16
+ export { candidateViewLabel, defaultTierRevertPreview, describeTargetView, INFERENCE_SETTINGS_MODES, INFERENCE_SETTINGS_TIERS, type InferenceAliasChange, type InferenceAliasView, type InferenceCandidateView, type InferenceConnectionRequest, type InferenceDefaultsChange, type InferenceDefaultsView, type InferenceDefaultTierChange, type InferenceDefaultTierView, type InferenceDiscoveryView, type InferenceFusionChange, type InferenceFusionView, type InferenceKeyChange, type InferenceProviderView, type InferenceSettingsLevelView, type InferenceSettingsMode, type InferenceSettingsScope, type InferenceSettingsTier, type InferenceTargetView, type InferenceTestResultView, type InferenceTierChange, type InferenceTierView, type InferenceTranscriptLinkFilters, type InferenceTranscriptSettingsChange, type InferenceTranscriptSettingsView, type InferenceTranscriptValuesView, type InferenceUsageDimension, type InferenceUsageView, inferenceLevelLabel, isRefAllowed, targetViewRef, tierRevertPreview, transcriptLinkFilters, usageColumns, } from './types.js';
17
17
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/svelte/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAC;AAC7C,OAAO,sBAAsB,MAAM,4CAA4C,CAAC;AAEhF,OAAO,EAAE,sBAAsB,EAAE,CAAC;AAClC,MAAM,MAAM,2BAA2B,GAAG,cAAc,CACtD,OAAO,sBAAsB,CAC9B,CAAC;AAEF,OAAO,EACL,kBAAkB,EAClB,wBAAwB,EACxB,kBAAkB,EAClB,wBAAwB,EACxB,wBAAwB,EACxB,KAAK,oBAAoB,EACzB,KAAK,kBAAkB,EACvB,KAAK,sBAAsB,EAC3B,KAAK,0BAA0B,EAC/B,KAAK,uBAAuB,EAC5B,KAAK,qBAAqB,EAC1B,KAAK,0BAA0B,EAC/B,KAAK,wBAAwB,EAC7B,KAAK,sBAAsB,EAC3B,KAAK,qBAAqB,EAC1B,KAAK,mBAAmB,EACxB,KAAK,kBAAkB,EACvB,KAA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,KAAK,uBAAuB,EAC5B,KAAK,kBAAkB,EACvB,mBAAmB,EACnB,YAAY,EACZ,aAAa,EACb,iBAAiB,EACjB,qBAAqB,EACrB,YAAY,GACb,MAAM,YAAY,CAAC"}
@@ -11,4 +11,4 @@
11
11
  */
12
12
  import InferenceSettingsPanel from './components/InferenceSettingsPanel.svelte';
13
13
  export { InferenceSettingsPanel };
14
- export { candidateViewLabel, defaultTierRevertPreview, describeTargetView, INFERENCE_SETTINGS_MODES, INFERENCE_SETTINGS_TIERS, inferenceLevelLabel, isRefAllowed, targetViewRef, tierRevertPreview, usageColumns, } from './types.js';
14
+ export { candidateViewLabel, defaultTierRevertPreview, describeTargetView, INFERENCE_SETTINGS_MODES, INFERENCE_SETTINGS_TIERS, inferenceLevelLabel, isRefAllowed, targetViewRef, tierRevertPreview, transcriptLinkFilters, usageColumns, } from './types.js';
@@ -140,11 +140,21 @@ export interface InferenceFusionView {
140
140
  definition: Record<string, unknown>;
141
141
  description?: string;
142
142
  editable?: boolean;
143
+ /** Lower sources this definition replaces by name (#4800). */
144
+ shadows?: Array<'registry' | 'config'>;
145
+ /** Why the executor would refuse to run it (#4800); absent when it runs. */
146
+ issues?: Array<{
147
+ path: string;
148
+ message: string;
149
+ }>;
143
150
  }
144
151
  /** Usage report (`reportAiUsage()`, #4751), structurally. */
145
152
  export interface InferenceUsageView {
146
153
  by: string[];
147
154
  costBasis?: string;
155
+ /** The report window, passed on to transcript links. */
156
+ since?: Date | string | null;
157
+ until?: Date | string | null;
148
158
  buckets: Array<{
149
159
  key: Record<string, string | null | undefined>;
150
160
  calls: number;
@@ -152,9 +162,58 @@ export interface InferenceUsageView {
152
162
  estimatedCost: number;
153
163
  uncostedCalls?: number;
154
164
  outcomes?: Record<string, number>;
165
+ /** Calls with a stored transcript (`usage({ transcripts: true })`, #4781). */
166
+ transcripts?: number;
155
167
  }>;
156
168
  }
157
- export type InferenceUsageDimension = 'model' | 'tier' | 'prompt';
169
+ export type InferenceUsageDimension = 'model' | 'tier' | 'prompt' | 'fusion' | 'template';
170
+ /** The app's transcript setting values (#4781). */
171
+ export interface InferenceTranscriptValuesView {
172
+ enabled?: boolean;
173
+ sample?: number;
174
+ maxBytes?: number;
175
+ }
176
+ /**
177
+ * The app's transcript setting (`getTranscriptSettings()`, #4781). App
178
+ * level only; tenants cannot override it. Never transcript content.
179
+ */
180
+ export interface InferenceTranscriptSettingsView {
181
+ enabled: boolean;
182
+ sample: number;
183
+ maxBytes: number;
184
+ supplyingLevel?: 'default' | 'config' | 'app' | 'env';
185
+ appValue?: InferenceTranscriptValuesView | null;
186
+ appRevert?: {
187
+ enabled: boolean;
188
+ sample: number;
189
+ maxBytes: number;
190
+ };
191
+ /** `SMRT_INFERENCE_TRANSCRIPTS` forces `enabled` (`null`: unset). */
192
+ envEnabled?: boolean | null;
193
+ /** Retention sweep window in days; `null`: not pruned. Read-only. */
194
+ retentionDays?: number | null;
195
+ promptOverrides?: string[];
196
+ }
197
+ /** What saving the transcript setting emits. Always the app row; `null` reverts it. */
198
+ export interface InferenceTranscriptSettingsChange {
199
+ settings: {
200
+ enabled: boolean;
201
+ sample: number;
202
+ maxBytes: number;
203
+ } | null;
204
+ }
205
+ /**
206
+ * Filters a Usage-tab row hands the host's transcript route (#4781): the
207
+ * `listAiTranscripts()` filters a bucket can name, plus the report window.
208
+ */
209
+ export interface InferenceTranscriptLinkFilters {
210
+ promptKey?: string;
211
+ templateHash?: string;
212
+ outcome?: string;
213
+ /** ISO timestamps of the report window. */
214
+ since?: string;
215
+ until?: string;
216
+ }
158
217
  export interface InferenceTierChange {
159
218
  tier: InferenceSettingsTier;
160
219
  scope: InferenceSettingsScope;
@@ -192,6 +251,12 @@ export declare function isRefAllowed(ref: string, allowList: readonly string[] |
192
251
  export declare function tierRevertPreview(row: InferenceTierView, scope: InferenceSettingsScope): string;
193
252
  /** The tier `auto` returns to when the scope reverts. */
194
253
  export declare function defaultTierRevertPreview(view: InferenceDefaultTierView, scope: InferenceSettingsScope): InferenceSettingsTier;
254
+ /**
255
+ * The transcript-route filters for one usage bucket (and, optionally, one
256
+ * outcome label): the prompt key and template hash when the report was
257
+ * grouped by them, and the report window.
258
+ */
259
+ export declare function transcriptLinkFilters(view: Pick<InferenceUsageView, 'since' | 'until'>, key: Record<string, string | null | undefined>, outcome?: string): InferenceTranscriptLinkFilters;
195
260
  /** Usage columns to render: only the dimensions the report was grouped by. */
196
261
  export declare function usageColumns(view: InferenceUsageView): string[];
197
262
  //# sourceMappingURL=types.d.ts.map