@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.
- package/AGENTS.md +10 -5
- package/agents/fusions.md +16 -3
- package/agents/hosted.md +29 -13
- package/agents/settings.md +30 -7
- package/dist/chunks/{InferenceOverrideCollection-wl7sI-3C.js → InferenceOverrideCollection-ZpxhP0Zl.js} +29 -4
- package/dist/chunks/InferenceOverrideCollection-ZpxhP0Zl.js.map +1 -0
- package/dist/chunks/{provider-config-4Bx8N52X.js → provider-config-BSpIQRVM.js} +37 -11
- package/dist/chunks/{provider-config-4Bx8N52X.js.map → provider-config-BSpIQRVM.js.map} +1 -1
- package/dist/fusion.d.ts.map +1 -1
- package/dist/hosted.d.ts +31 -24
- package/dist/hosted.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/manifest.json +1 -1
- package/dist/models/InferenceOverride.d.ts.map +1 -1
- package/dist/models.js +1 -1
- package/dist/node.js +86 -33
- package/dist/node.js.map +1 -1
- package/dist/register.d.ts.map +1 -1
- package/dist/resolver.d.ts.map +1 -1
- package/dist/resolver.js +4 -1
- package/dist/resolver.js.map +1 -1
- package/dist/server.d.ts +3 -2
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +194 -41
- package/dist/server.js.map +1 -1
- package/dist/settings/layers.d.ts +14 -0
- package/dist/settings/layers.d.ts.map +1 -1
- package/dist/settings/override-service.d.ts.map +1 -1
- package/dist/settings/resolver.d.ts +7 -0
- package/dist/settings/resolver.d.ts.map +1 -1
- package/dist/settings/settings-service.d.ts +80 -7
- package/dist/settings/settings-service.d.ts.map +1 -1
- package/dist/settings/targets.d.ts +21 -2
- package/dist/settings/targets.d.ts.map +1 -1
- package/dist/settings/transcripts.d.ts +33 -0
- package/dist/settings/transcripts.d.ts.map +1 -0
- package/dist/smrt-knowledge.json +17 -11
- package/dist/smrt-knowledge.okf.md +2 -2
- package/dist/svelte/components/InferenceAliasEditor.svelte +31 -23
- package/dist/svelte/components/InferenceDefaultView.svelte +58 -42
- package/dist/svelte/components/InferenceFusionList.svelte +37 -22
- package/dist/svelte/components/InferenceFusionList.svelte.d.ts.map +1 -1
- package/dist/svelte/components/InferenceSettingsPanel.svelte +97 -38
- package/dist/svelte/components/InferenceSettingsPanel.svelte.d.ts +21 -2
- package/dist/svelte/components/InferenceSettingsPanel.svelte.d.ts.map +1 -1
- package/dist/svelte/components/InferenceTierRow.svelte +38 -30
- package/dist/svelte/components/InferenceTranscriptSettings.svelte +171 -0
- package/dist/svelte/components/InferenceTranscriptSettings.svelte.d.ts +18 -0
- package/dist/svelte/components/InferenceTranscriptSettings.svelte.d.ts.map +1 -0
- package/dist/svelte/components/InferenceUsageTable.svelte +91 -32
- package/dist/svelte/components/InferenceUsageTable.svelte.d.ts +10 -4
- package/dist/svelte/components/InferenceUsageTable.svelte.d.ts.map +1 -1
- package/dist/svelte/index.d.ts +1 -1
- package/dist/svelte/index.d.ts.map +1 -1
- package/dist/svelte/index.js +1 -1
- package/dist/svelte/types.d.ts +66 -1
- package/dist/svelte/types.d.ts.map +1 -1
- package/dist/svelte/types.js +28 -0
- package/package.json +10 -10
- package/dist/chunks/InferenceOverrideCollection-wl7sI-3C.js.map +0 -1
|
@@ -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
|
|
4
|
-
*
|
|
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 {
|
|
8
|
-
|
|
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 {
|
|
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,19 +68,17 @@ 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
|
-
<div class="
|
|
73
|
+
<div class="smrt-inference-usage-table__root" data-testid="inference-usage" data-smrt-component="InferenceUsageTable">
|
|
74
|
+
{#if transcriptsEnabled === false}
|
|
75
|
+
<p class="smrt-inference-usage-table__label" data-smrt-part="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
|
-
<form class="
|
|
46
|
-
<span class="
|
|
80
|
+
<form class="smrt-inference-usage-table__group" data-smrt-part="field">
|
|
81
|
+
<span class="smrt-inference-usage-table__label" data-smrt-part="label">Group by</span>
|
|
47
82
|
{#each DIMENSIONS as dimension (dimension.id)}
|
|
48
83
|
<label>
|
|
49
84
|
<input
|
|
@@ -60,10 +95,10 @@ function outcomes(value: Record<string, number> | undefined): string {
|
|
|
60
95
|
</form>
|
|
61
96
|
{/if}
|
|
62
97
|
{#if !usage || usage.buckets.length === 0}
|
|
63
|
-
<p class="
|
|
98
|
+
<p class="smrt-inference-usage-table__label" data-smrt-part="label">No usage recorded yet.</p>
|
|
64
99
|
{:else}
|
|
65
|
-
<table class="
|
|
66
|
-
<thead>
|
|
100
|
+
<table class="smrt-inference-usage-table__table" data-smrt-part="table">
|
|
101
|
+
<thead data-smrt-part="header">
|
|
67
102
|
<tr>
|
|
68
103
|
{#each columns as column (column)}
|
|
69
104
|
<th scope="col">{DIMENSIONS.find((entry) => entry.id === column)?.label ?? column}</th>
|
|
@@ -72,9 +107,10 @@ 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
|
-
<tbody>
|
|
113
|
+
<tbody data-smrt-part="body">
|
|
78
114
|
{#each usage.buckets as bucket, index (index)}
|
|
79
115
|
<tr>
|
|
80
116
|
{#each columns as column (column)}
|
|
@@ -84,44 +120,67 @@ function outcomes(value: Record<string, number> | undefined): string {
|
|
|
84
120
|
<td>{bucket.totalTokens}</td>
|
|
85
121
|
<td>
|
|
86
122
|
${bucket.estimatedCost.toFixed(4)}
|
|
87
|
-
{#if bucket.uncostedCalls}<span class="
|
|
123
|
+
{#if bucket.uncostedCalls}<span class="smrt-inference-usage-table__label" data-smrt-part="label">({bucket.uncostedCalls} uncosted)</span>{/if}
|
|
88
124
|
</td>
|
|
89
|
-
<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>
|
|
93
143
|
</table>
|
|
94
|
-
{#if usage.costBasis}<p class="
|
|
144
|
+
{#if usage.costBasis}<p class="smrt-inference-usage-table__label" data-smrt-part="label">{usage.costBasis}</p>{/if}
|
|
95
145
|
{/if}
|
|
96
146
|
</div>
|
|
97
147
|
|
|
98
148
|
<style>
|
|
99
149
|
@layer smrt.reset, smrt.structure, smrt.theme;
|
|
100
|
-
@layer smrt.
|
|
101
|
-
.
|
|
150
|
+
@layer smrt.structure {
|
|
151
|
+
.smrt-inference-usage-table__root {
|
|
102
152
|
display: flex;
|
|
103
153
|
flex-direction: column;
|
|
104
154
|
gap: 0.75rem;
|
|
105
155
|
}
|
|
106
|
-
.
|
|
156
|
+
.smrt-inference-usage-table__group {
|
|
107
157
|
display: flex;
|
|
108
158
|
gap: 0.75rem;
|
|
109
159
|
align-items: center;
|
|
110
160
|
}
|
|
111
|
-
.
|
|
161
|
+
.smrt-inference-usage-table__table th,
|
|
162
|
+
.smrt-inference-usage-table__table td {
|
|
163
|
+
padding: 0.25rem 0.75rem 0.25rem 0;
|
|
164
|
+
}
|
|
165
|
+
.smrt-inference-usage-table__label {
|
|
166
|
+
margin: 0;
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
@layer smrt.theme {
|
|
171
|
+
.smrt-inference-usage-table__table {
|
|
112
172
|
border-collapse: collapse;
|
|
113
173
|
font-size: 0.875rem;
|
|
114
174
|
}
|
|
115
|
-
.
|
|
116
|
-
.
|
|
175
|
+
.smrt-inference-usage-table__table th,
|
|
176
|
+
.smrt-inference-usage-table__table td {
|
|
117
177
|
text-align: left;
|
|
118
|
-
padding: 0.25rem 0.75rem 0.25rem 0;
|
|
119
178
|
border-bottom: var(--smrt-hairline);
|
|
120
179
|
}
|
|
121
|
-
.
|
|
122
|
-
margin: 0;
|
|
180
|
+
.smrt-inference-usage-table__label {
|
|
123
181
|
font-size: 0.8125rem;
|
|
124
182
|
color: var(--smrt-color-on-surface-variant);
|
|
125
183
|
}
|
|
126
184
|
}
|
|
185
|
+
|
|
127
186
|
</style>
|
|
@@ -1,12 +1,18 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The Usage tab: `reportAiUsage()` buckets (#4751) by model, tier
|
|
3
|
-
*
|
|
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
|
|
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"}
|
package/dist/svelte/index.d.ts
CHANGED
|
@@ -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,KAAK,qBAAqB,EAC1B,KAAK,0BAA0B,EAC/B,KAAK,qBAAqB,EAC1B,KAAK,sBAAsB,EAC3B,KAAK,qBAAqB,EAC1B,KAAK,mBAAmB,EACxB,KAAK,uBAAuB,EAC5B,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,EACtB,KAAK,uBAAuB,EAC5B,KAAK,kBAAkB,EACvB,mBAAmB,EACnB,YAAY,EACZ,aAAa,EACb,iBAAiB,EACjB,YAAY,GACb,MAAM,YAAY,CAAC"}
|
|
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,KAAK,qBAAqB,EAC1B,KAAK,0BAA0B,EAC/B,KAAK,qBAAqB,EAC1B,KAAK,sBAAsB,EAC3B,KAAK,qBAAqB,EAC1B,KAAK,mBAAmB,EACxB,KAAK,uBAAuB,EAC5B,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,EACtB,KAAK,8BAA8B,EACnC,KAAK,iCAAiC,EACtC,KAAK,+BAA+B,EACpC,KAAK,6BAA6B,EAClC,KAAK,uBAAuB,EAC5B,KAAK,kBAAkB,EACvB,mBAAmB,EACnB,YAAY,EACZ,aAAa,EACb,iBAAiB,EACjB,qBAAqB,EACrB,YAAY,GACb,MAAM,YAAY,CAAC"}
|
package/dist/svelte/index.js
CHANGED
|
@@ -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';
|
package/dist/svelte/types.d.ts
CHANGED
|
@@ -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
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/svelte/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,eAAO,MAAM,wBAAwB,6CAK3B,CAAC;AACX,MAAM,MAAM,qBAAqB,GAAG,CAAC,OAAO,wBAAwB,CAAC,CAAC,MAAM,CAAC,CAAC;AAE9E,eAAO,MAAM,wBAAwB,4CAK3B,CAAC;AACX,MAAM,MAAM,qBAAqB,GAAG,CAAC,OAAO,wBAAwB,CAAC,CAAC,MAAM,CAAC,CAAC;AAE9E,MAAM,MAAM,0BAA0B,GAClC,SAAS,GACT,QAAQ,GACR,K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AI,EAAE,IAAI,CAAC,kBAAkB,EAAE,OAAO,GAAG,OAAO,CAAC,EACjD,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC,EAC9C,OAAO,CAAC,EAAE,MAAM,GACf,8BAA8B,CAoBhC;AAED,8EAA8E;AAC9E,wBAAgB,YAAY,CAAC,IAAI,EAAE,kBAAkB,GAAG,MAAM,EAAE,CAE/D"}
|
package/dist/svelte/types.js
CHANGED
|
@@ -90,6 +90,34 @@ export function defaultTierRevertPreview(view, scope) {
|
|
|
90
90
|
return view.appRevertTier ?? view.effectiveTier;
|
|
91
91
|
return view.inheritedTier ?? view.appRevertTier ?? view.effectiveTier;
|
|
92
92
|
}
|
|
93
|
+
/**
|
|
94
|
+
* The transcript-route filters for one usage bucket (and, optionally, one
|
|
95
|
+
* outcome label): the prompt key and template hash when the report was
|
|
96
|
+
* grouped by them, and the report window.
|
|
97
|
+
*/
|
|
98
|
+
export function transcriptLinkFilters(view, key, outcome) {
|
|
99
|
+
const filters = {};
|
|
100
|
+
if (typeof key.prompt === 'string' && key.prompt) {
|
|
101
|
+
filters.promptKey = key.prompt;
|
|
102
|
+
}
|
|
103
|
+
if (typeof key.template === 'string' && key.template) {
|
|
104
|
+
filters.templateHash = key.template;
|
|
105
|
+
}
|
|
106
|
+
if (outcome)
|
|
107
|
+
filters.outcome = outcome;
|
|
108
|
+
const iso = (value) => value instanceof Date
|
|
109
|
+
? value.toISOString()
|
|
110
|
+
: typeof value === 'string' && value
|
|
111
|
+
? value
|
|
112
|
+
: undefined;
|
|
113
|
+
const since = iso(view.since);
|
|
114
|
+
const until = iso(view.until);
|
|
115
|
+
if (since)
|
|
116
|
+
filters.since = since;
|
|
117
|
+
if (until)
|
|
118
|
+
filters.until = until;
|
|
119
|
+
return filters;
|
|
120
|
+
}
|
|
93
121
|
/** Usage columns to render: only the dimensions the report was grouped by. */
|
|
94
122
|
export function usageColumns(view) {
|
|
95
123
|
return view.by.filter((dimension) => dimension.length > 0);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@happyvertical/smrt-inference",
|
|
3
|
-
"version": "0.60.
|
|
3
|
+
"version": "0.60.17",
|
|
4
4
|
"description": "Inference alias chains with classified failures, recorded fallback and ladder degradation, consumer-defined fusions, per-user and per-tenant bindings, the InferenceSettingsPanel, hosted provisioning and spend gate, and the smrt doctor --ai binding check, for SMRT inference tiers",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -45,17 +45,17 @@
|
|
|
45
45
|
}
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"@happyvertical/ai": "^0.
|
|
49
|
-
"@happyvertical/smrt-config": "0.60.
|
|
50
|
-
"@happyvertical/smrt-core": "0.60.
|
|
51
|
-
"@happyvertical/smrt-prompts": "0.60.
|
|
52
|
-
"@happyvertical/smrt-secrets": "0.60.
|
|
53
|
-
"@happyvertical/smrt-tenancy": "0.60.
|
|
54
|
-
"@happyvertical/smrt-users": "0.60.
|
|
55
|
-
"@happyvertical/sql": "^0.
|
|
48
|
+
"@happyvertical/ai": "^0.112.2",
|
|
49
|
+
"@happyvertical/smrt-config": "0.60.17",
|
|
50
|
+
"@happyvertical/smrt-core": "0.60.17",
|
|
51
|
+
"@happyvertical/smrt-prompts": "0.60.17",
|
|
52
|
+
"@happyvertical/smrt-secrets": "0.60.17",
|
|
53
|
+
"@happyvertical/smrt-tenancy": "0.60.17",
|
|
54
|
+
"@happyvertical/smrt-users": "0.60.17",
|
|
55
|
+
"@happyvertical/sql": "^0.112.2"
|
|
56
56
|
},
|
|
57
57
|
"devDependencies": {
|
|
58
|
-
"@happyvertical/smrt-vitest": "0.60.
|
|
58
|
+
"@happyvertical/smrt-vitest": "0.60.17",
|
|
59
59
|
"@sveltejs/package": "^2.5.8",
|
|
60
60
|
"@sveltejs/vite-plugin-svelte": "^7.3.0",
|
|
61
61
|
"@types/node": "24.13.6",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"InferenceOverrideCollection-wl7sI-3C.js","names":[],"sources":["../../src/__smrt-register__.ts","../../src/settings/cache.ts","../../src/settings/targets.ts","../../src/models/InferenceOverride.ts","../../src/models/InferenceOverrideCollection.ts"],"sourcesContent":["// Generated by @happyvertical/smrt-core smrtPlugin at library build time.\n// The package manifest is inlined so self-registration cannot miss when a\n// downstream bundler relocates this module away from dist/manifest.json\n// (https://github.com/happyvertical/smrt/issues/1506,\n// https://github.com/happyvertical/smrt/issues/1507).\nimport { ObjectRegistry } from '@happyvertical/smrt-core';\n\nObjectRegistry.registerPackageManifest(JSON.parse(\"{\\\"version\\\":\\\"1.0.0\\\",\\\"timestamp\\\":0,\\\"packageName\\\":\\\"@happyvertical/smrt-inference\\\",\\\"packageVersion\\\":\\\"0.60.15\\\",\\\"objects\\\":{\\\"@happyvertical/smrt-inference:InferenceOverride\\\":{\\\"name\\\":\\\"inferenceoverride\\\",\\\"className\\\":\\\"InferenceOverride\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-inference:InferenceOverride\\\",\\\"collection\\\":\\\"inferenceoverrides\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/inference/src/models/InferenceOverride.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-inference\\\",\\\"fields\\\":{\\\"binding\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"default\\\":\\\"\\\",\\\"_meta\\\":{\\\"required\\\":true}},\\\"tenantId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"_meta\\\":{\\\"sqlType\\\":\\\"UUID\\\",\\\"nullable\\\":true}},\\\"target\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"_meta\\\":{\\\"nullable\\\":true}},\\\"tenantAllowList\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"_meta\\\":{\\\"nullable\\\":true}}},\\\"methods\\\":{\\\"getValue\\\":{\\\"name\\\":\\\"getValue\\\",\\\"async\\\":false,\\\"parameters\\\":[],\\\"returnType\\\":\\\"unknown\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"getTenantAllowList\\\":{\\\"name\\\":\\\"getTenantAllowList\\\",\\\"async\\\":false,\\\"parameters\\\":[],\\\"returnType\\\":\\\"string[] | null\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"save\\\":{\\\"name\\\":\\\"save\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"options\\\",\\\"type\\\":\\\"SmrtSaveOptions\\\",\\\"optional\\\":true}],\\\"returnType\\\":\\\"Promise<this>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"delete\\\":{\\\"name\\\":\\\"delete\\\",\\\"async\\\":true,\\\"parameters\\\":[],\\\"returnType\\\":\\\"Promise<void>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true}},\\\"decoratorConfig\\\":{\\\"tableName\\\":\\\"_smrt_inference_overrides\\\",\\\"conflictColumns\\\":[\\\"binding\\\",\\\"context\\\"],\\\"api\\\":false,\\\"cli\\\":false,\\\"mcp\\\":false,\\\"indexes\\\":[{\\\"name\\\":\\\"idx_smrt_inference_overrides_tenant\\\",\\\"columns\\\":[\\\"tenantId\\\",\\\"binding\\\"]}]},\\\"extends\\\":\\\"SmrtObject\\\",\\\"exportName\\\":\\\"InferenceOverride\\\",\\\"collectionExportName\\\":\\\"InferenceOverrideCollection\\\",\\\"validationRules\\\":[{\\\"field\\\":\\\"binding\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"text\\\"}],\\\"schema\\\":{\\\"tableName\\\":\\\"_smrt_inference_overrides\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"_smrt_inference_overrides\\\\\\\" (\\\\n \\\\\\\"_sync_origin_device_id\\\\\\\" TEXT,\\\\n \\\\\\\"_sync_revision\\\\\\\" INTEGER,\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"binding\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"tenant_id\\\\\\\" UUID,\\\\n \\\\\\\"target\\\\\\\" TEXT,\\\\n \\\\\\\"tenant_allow_list\\\\\\\" TEXT\\\\n);\\\",\\\"columns\\\":{\\\"_sync_origin_device_id\\\":{\\\"type\\\":\\\"TEXT\\\"},\\\"_sync_revision\\\":{\\\"type\\\":\\\"INTEGER\\\"},\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"binding\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"default\\\":\\\"\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"target\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"tenant_allow_list\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false}},\\\"indexes\\\":[{\\\"name\\\":\\\"_smrt_inference_overrides_binding_context_idx\\\",\\\"columns\\\":[\\\"binding\\\",\\\"context\\\"],\\\"unique\\\":true},{\\\"name\\\":\\\"_smrt_inference_overrides_slug_context_idx\\\",\\\"columns\\\":[\\\"slug\\\",\\\"context\\\"]},{\\\"name\\\":\\\"idx_smrt_inference_overrides_tenant\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"binding\\\"]},{\\\"name\\\":\\\"_smrt_inference_overrides_created_at_idx\\\",\\\"columns\\\":[\\\"created_at\\\"]}],\\\"version\\\":\\\"4868b81b\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-inference/models\\\"},\\\"@happyvertical/smrt-inference:InferenceOverrideCollection\\\":{\\\"name\\\":\\\"inferenceoverridecollection\\\",\\\"className\\\":\\\"InferenceOverrideCollection\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-inference:InferenceOverrideCollection\\\",\\\"collection\\\":\\\"inferenceoverrides\\\",\\\"description\\\":\\\"Reads and unauthorized writes of _smrt_inference_overrides.\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/inference/src/models/InferenceOverrideCollection.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-inference\\\",\\\"fields\\\":{},\\\"methods\\\":{\\\"getScopeMap\\\":{\\\"name\\\":\\\"getScopeMap\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"scopeType\\\",\\\"type\\\":\\\"InferenceOverrideScopeType\\\",\\\"optional\\\":false,\\\"resolvedType\\\":\\\"'app' | 'tenant'\\\"},{\\\"name\\\":\\\"scopeId\\\",\\\"type\\\":\\\"string\\\",\\\"optional\\\":false}],\\\"returnType\\\":\\\"Promise<Map<string, InferenceOverride>>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"findByScope\\\":{\\\"name\\\":\\\"findByScope\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"binding\\\",\\\"type\\\":\\\"string\\\",\\\"optional\\\":false},{\\\"name\\\":\\\"scopeType\\\",\\\"type\\\":\\\"InferenceOverrideScopeType\\\",\\\"optional\\\":false,\\\"resolvedType\\\":\\\"'app' | 'tenant'\\\"},{\\\"name\\\":\\\"scopeId\\\",\\\"type\\\":\\\"string\\\",\\\"optional\\\":false}],\\\"returnType\\\":\\\"Promise<InferenceOverride | null>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"setOverride\\\":{\\\"name\\\":\\\"setOverride\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"binding\\\",\\\"type\\\":\\\"string\\\",\\\"optional\\\":false},{\\\"name\\\":\\\"scopeType\\\",\\\"type\\\":\\\"InferenceOverrideScopeType\\\",\\\"optional\\\":false,\\\"resolvedType\\\":\\\"'app' | 'tenant'\\\"},{\\\"name\\\":\\\"scopeId\\\",\\\"type\\\":\\\"string\\\",\\\"optional\\\":false},{\\\"name\\\":\\\"change\\\",\\\"type\\\":\\\"object\\\",\\\"optional\\\":false,\\\"memberTypes\\\":[\\\"unknown\\\",\\\"string[] | null\\\"]}],\\\"returnType\\\":\\\"Promise<InferenceOverride | null>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"removeOverride\\\":{\\\"name\\\":\\\"removeOverride\\\",\\\"async\\\":true,\\\"parameters\\\":[{\\\"name\\\":\\\"binding\\\",\\\"type\\\":\\\"string\\\",\\\"optional\\\":false},{\\\"name\\\":\\\"scopeType\\\",\\\"type\\\":\\\"InferenceOverrideScopeType\\\",\\\"optional\\\":false,\\\"resolvedType\\\":\\\"'app' | 'tenant'\\\"},{\\\"name\\\":\\\"scopeId\\\",\\\"type\\\":\\\"string\\\",\\\"optional\\\":false}],\\\"returnType\\\":\\\"Promise<boolean>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true}},\\\"decoratorConfig\\\":{\\\"tableName\\\":\\\"_smrt_inference_overrides\\\",\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false},\\\"extends\\\":\\\"SmrtCollection\\\",\\\"extendsTypeArg\\\":\\\"InferenceOverride\\\",\\\"exportName\\\":\\\"InferenceOverrideCollection\\\",\\\"collectionExportName\\\":\\\"InferenceOverrideCollectionCollection\\\",\\\"collectionOf\\\":\\\"@happyvertical/smrt-inference:InferenceOverride\\\",\\\"inheritedExposure\\\":[\\\"api\\\",\\\"mcp\\\",\\\"cli\\\"],\\\"schema\\\":{\\\"tableName\\\":\\\"_smrt_inference_overrides\\\",\\\"ddl\\\":\\\"CREATE TABLE IF NOT EXISTS \\\\\\\"_smrt_inference_overrides\\\\\\\" (\\\\n \\\\\\\"_sync_origin_device_id\\\\\\\" TEXT,\\\\n \\\\\\\"_sync_revision\\\\\\\" INTEGER,\\\\n \\\\\\\"id\\\\\\\" UUID PRIMARY KEY NOT NULL,\\\\n \\\\\\\"slug\\\\\\\" TEXT NOT NULL,\\\\n \\\\\\\"context\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"created_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"updated_at\\\\\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\\\n \\\\\\\"binding\\\\\\\" TEXT NOT NULL DEFAULT '',\\\\n \\\\\\\"tenant_id\\\\\\\" UUID,\\\\n \\\\\\\"target\\\\\\\" TEXT,\\\\n \\\\\\\"tenant_allow_list\\\\\\\" TEXT\\\\n);\\\",\\\"columns\\\":{\\\"_sync_origin_device_id\\\":{\\\"type\\\":\\\"TEXT\\\"},\\\"_sync_revision\\\":{\\\"type\\\":\\\"INTEGER\\\"},\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"binding\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"default\\\":\\\"\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"target\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"tenant_allow_list\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false}},\\\"indexes\\\":[{\\\"name\\\":\\\"_smrt_inference_overrides_binding_context_idx\\\",\\\"columns\\\":[\\\"binding\\\",\\\"context\\\"],\\\"unique\\\":true},{\\\"name\\\":\\\"_smrt_inference_overrides_slug_context_idx\\\",\\\"columns\\\":[\\\"slug\\\",\\\"context\\\"]},{\\\"name\\\":\\\"idx_smrt_inference_overrides_tenant\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"binding\\\"]},{\\\"name\\\":\\\"_smrt_inference_overrides_created_at_idx\\\",\\\"columns\\\":[\\\"created_at\\\"]}],\\\"version\\\":\\\"4868b81b\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-inference/models\\\"}},\\\"moduleType\\\":\\\"smrt\\\",\\\"smrtDependencies\\\":[\\\"@happyvertical/smrt-core\\\",\\\"@happyvertical/smrt-prompts\\\",\\\"@happyvertical/smrt-secrets\\\",\\\"@happyvertical/smrt-tenancy\\\",\\\"@happyvertical/smrt-users\\\"],\\\"browser\\\":{\\\"status\\\":\\\"server-only\\\",\\\"issues\\\":[\\\"#3617\\\",\\\"#3624\\\",\\\"#3626\\\",\\\"#3627\\\"],\\\"via\\\":[\\\"@happyvertical/smrt-profiles\\\",\\\"@happyvertical/smrt-secrets\\\",\\\"@happyvertical/smrt-tenancy\\\",\\\"@happyvertical/smrt-users\\\"]},\\\"stampsConstructors\\\":true}\"));\n","/**\n * Process-wide write generation for `_smrt_inference_overrides` (#4754).\n * Every save or delete of an override row bumps it, so the override\n * resolver's short-lived layer cache never serves a value read before a\n * write in the same process. Kept on `globalThis` so duplicate module copies\n * (HMR, two bundles) share it, like core's resolver registration.\n */\nconst GENERATION_KEY = Symbol.for('smrt.inference.overrideGeneration');\n\ntype GenerationHolder = { [GENERATION_KEY]?: number };\n\n/** The current write generation. */\nexport function getInferenceOverrideGeneration(): number {\n return (globalThis as GenerationHolder)[GENERATION_KEY] ?? 0;\n}\n\n/** Record a write: cached layers read before it are stale. */\nexport function bumpInferenceOverrideGeneration(): void {\n const holder = globalThis as GenerationHolder;\n holder[GENERATION_KEY] = (holder[GENERATION_KEY] ?? 0) + 1;\n}\n","/**\n * The vocabulary of stored inference bindings (#4754): binding ids, the\n * target shapes a settings write may store, the allow-list references a\n * tenant write is checked against, and key-free labels.\n *\n * Pure and browser-safe: no `node:`, no SDK, no smrt-config.\n */\nimport {\n INFERENCE_TIERS,\n type InferenceAlias,\n type InferenceCandidate,\n type InferenceTarget,\n type InferenceTier,\n inferenceTargetKind,\n isInferenceTier,\n} from '@happyvertical/smrt-core';\n\n/** How a user or app gets inference. Stored as a user choice, never a binding. */\nexport const INFERENCE_MODES = ['byo', 'local', 'hosted', 'off'] as const;\nexport type InferenceMode = (typeof INFERENCE_MODES)[number];\n\n/** Binding id of `auto`'s default tier. */\nexport const DEFAULT_TIER_BINDING = 'default-tier';\n\n/** A binding id stored in `_smrt_inference_overrides.binding`. */\nexport type InferenceBindingId =\n | `tier:${InferenceTier}`\n | typeof DEFAULT_TIER_BINDING\n | `alias:${string}`\n | `fusion:${string}`;\n\n/** `inference.aliases` / fusion names: what a binding id may carry after its prefix. */\nexport const INFERENCE_BINDING_NAME_PATTERN = /^[a-z0-9][a-z0-9._-]{0,63}$/i;\n\nexport type InferenceBindingKind = 'tier' | 'default-tier' | 'alias' | 'fusion';\n\n/** A parsed binding id. */\nexport interface ParsedInferenceBinding {\n kind: InferenceBindingKind;\n /** The tier, alias or fusion name (absent for `default-tier`). */\n name?: string;\n}\n\n/** Thrown for a malformed binding id or an invalid stored value. Nothing is written. */\nexport class InferenceBindingValueError extends Error {\n readonly status = 400;\n constructor(\n readonly binding: string,\n reason: string,\n ) {\n super(`Invalid inference binding \"${binding}\": ${reason}`);\n this.name = 'InferenceBindingValueError';\n }\n}\n\n/** Parse a binding id, or `null` when it is not one this package stores. */\nexport function parseInferenceBinding(\n binding: unknown,\n): ParsedInferenceBinding | null {\n if (typeof binding !== 'string') return null;\n if (binding === DEFAULT_TIER_BINDING) return { kind: 'default-tier' };\n const match = /^(tier|alias|fusion):(.+)$/.exec(binding);\n if (!match) return null;\n const [, kind, name] = match as unknown as [string, string, string];\n if (kind === 'tier') {\n return isInferenceTier(name) ? { kind: 'tier', name } : null;\n }\n if (!INFERENCE_BINDING_NAME_PATTERN.test(name)) return null;\n return { kind: kind as 'alias' | 'fusion', name };\n}\n\n/** The binding id of one tier. */\nexport function tierBinding(tier: InferenceTier): `tier:${InferenceTier}` {\n return `tier:${tier}`;\n}\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return !!value && typeof value === 'object' && !Array.isArray(value);\n}\n\nfunction text(value: unknown): string | undefined {\n return typeof value === 'string' && value.trim() !== ''\n ? value.trim()\n : undefined;\n}\n\n/**\n * Key-shaped members are never stored in a binding row: keys live only in\n * smrt-secrets, written by the host (#4754 storage split). `apiKeyEnv` (the\n * name of a variable) is allowed, and so is `key`: #4753 fusion\n * definitions carry one as their identifier.\n */\nconst KEY_MEMBERS = new Set([\n 'apikey',\n 'api_key',\n 'apikeys',\n 'secret',\n 'token',\n 'password',\n 'authorization',\n 'bearer',\n]);\n\n/**\n * A deep copy of `value` with every credential-shaped member removed. Used\n * on every config-backed value a settings screen receives: config tiers and\n * alias candidates may legitimately carry a literal `apiKey` (resolvers and\n * endpoint-bound config), and none of it may reach a browser.\n */\nexport function stripKeyMembers<T>(value: T): T {\n if (Array.isArray(value)) return value.map(stripKeyMembers) as T;\n if (!isRecord(value)) return value;\n const out: Record<string, unknown> = {};\n for (const [member, inner] of Object.entries(value)) {\n if (KEY_MEMBERS.has(member.toLowerCase())) continue;\n out[member] = stripKeyMembers(inner);\n }\n return out as T;\n}\n\n/** Dotted path of the first key-shaped member anywhere in `value`, or `null`. */\nexport function findKeyMember(value: unknown, path = ''): string | null {\n if (Array.isArray(value)) {\n for (const [index, item] of value.entries()) {\n const found = findKeyMember(item, `${path}[${index}]`);\n if (found) return found;\n }\n return null;\n }\n if (!isRecord(value)) return null;\n for (const [member, inner] of Object.entries(value)) {\n const here = path ? `${path}.${member}` : member;\n if (KEY_MEMBERS.has(member.toLowerCase())) return here;\n const found = findKeyMember(inner, here);\n if (found) return found;\n }\n return null;\n}\n\n/**\n * The tier target a settings write may store. A tier binds exactly one of:\n *\n * - a model: `{ provider?, model }` (no `baseUrl`: an endpoint needs its own\n * key, and keys are never stored here; bind an alias whose candidate names\n * `baseUrl` + `apiKeyEnv` or a preset instead);\n * - an alias: `{ alias }`;\n * - a fusion (#4753): `{ kind: 'fusion', fusion }`.\n *\n * `null` means \"same as default\" (inherit the lower layer).\n */\nexport function normalizeTierTarget(\n binding: string,\n value: unknown,\n): InferenceTarget | null {\n if (value === null || value === undefined) return null;\n if (!isRecord(value)) {\n throw new InferenceBindingValueError(binding, 'a tier target is an object');\n }\n const keyMember = findKeyMember(value);\n if (keyMember) {\n throw new InferenceBindingValueError(\n binding,\n `\"${keyMember}\" looks like a credential; keys are stored only through smrt-secrets`,\n );\n }\n const fusion = text(value.fusion);\n const alias = text(value.alias);\n const model = text(value.model);\n const provider = text(value.provider);\n const kind = value.kind;\n const allowed = new Set(['kind', 'fusion', 'alias', 'model', 'provider']);\n const extra = Object.keys(value).filter((member) => !allowed.has(member));\n if (extra.length > 0) {\n throw new InferenceBindingValueError(\n binding,\n `unsupported member(s) ${extra.join(', ')} (endpoints and inline candidates belong in an alias)`,\n );\n }\n const shapes = [fusion, alias, model].filter(Boolean).length;\n if (shapes !== 1) {\n throw new InferenceBindingValueError(\n binding,\n 'a tier target is exactly one of { model, provider? }, { alias } or { kind: \"fusion\", fusion }',\n );\n }\n if (fusion) {\n if (kind !== undefined && kind !== 'fusion') {\n throw new InferenceBindingValueError(binding, 'fusion kind mismatch');\n }\n if (!INFERENCE_BINDING_NAME_PATTERN.test(fusion)) {\n throw new InferenceBindingValueError(binding, 'invalid fusion name');\n }\n return { kind: 'fusion', fusion } as unknown as InferenceTarget;\n }\n if (alias) {\n if (kind !== undefined && kind !== 'alias') {\n throw new InferenceBindingValueError(binding, 'alias kind mismatch');\n }\n if (!INFERENCE_BINDING_NAME_PATTERN.test(alias)) {\n throw new InferenceBindingValueError(binding, 'invalid alias name');\n }\n return { alias };\n }\n if (kind !== undefined && kind !== 'single') {\n throw new InferenceBindingValueError(binding, 'model kind mismatch');\n }\n return provider ? { provider, model } : { model };\n}\n\n/**\n * An alias definition a settings write may store: `{ candidates, description? }`,\n * every candidate exactly one of provider/model, preset/model or alias, and\n * never a literal key (`apiKeyEnv` names a variable and needs `baseUrl`).\n * Structural checks only; cross-references are checked against the layered\n * config by the settings service.\n */\nexport function normalizeAliasDefinition(\n binding: string,\n value: unknown,\n): InferenceAlias | null {\n if (value === null || value === undefined) return null;\n if (!isRecord(value) || !Array.isArray(value.candidates)) {\n throw new InferenceBindingValueError(\n binding,\n 'an alias is { candidates: [...], description? }',\n );\n }\n const keyMember = findKeyMember(value);\n if (keyMember) {\n throw new InferenceBindingValueError(\n binding,\n `\"${keyMember}\" looks like a credential; keys are stored only through smrt-secrets`,\n );\n }\n if (value.candidates.length === 0) {\n throw new InferenceBindingValueError(binding, 'an alias needs candidates');\n }\n const allowed = new Set([\n 'provider',\n 'model',\n 'baseUrl',\n 'apiKeyEnv',\n 'preset',\n 'alias',\n 'params',\n ]);\n const candidates: InferenceCandidate[] = value.candidates.map(\n (candidate: unknown, index: number) => {\n if (!isRecord(candidate)) {\n throw new InferenceBindingValueError(\n binding,\n `candidates[${index}] must be an object`,\n );\n }\n const extra = Object.keys(candidate).filter(\n (member) => !allowed.has(member),\n );\n if (extra.length > 0) {\n throw new InferenceBindingValueError(\n binding,\n `candidates[${index}] has unsupported member(s) ${extra.join(', ')}`,\n );\n }\n const out: InferenceCandidate = {};\n for (const member of allowed) {\n if (member === 'params') continue;\n const inner = text(candidate[member]);\n if (inner) (out as Record<string, string>)[member] = inner;\n }\n if (candidate.params !== undefined) {\n if (!isRecord(candidate.params)) {\n throw new InferenceBindingValueError(\n binding,\n `candidates[${index}].params must be an object`,\n );\n }\n out.params = { ...candidate.params };\n }\n return out;\n },\n );\n const description = text(value.description);\n return description ? { candidates, description } : { candidates };\n}\n\n/**\n * A fusion config entry (#4753) a settings write may store: a JSON object\n * with no credential members. Its meaning belongs to the fusion interpreter;\n * this package only stores it (app scope only).\n */\nexport function normalizeFusionDefinition(\n binding: string,\n value: unknown,\n): Record<string, unknown> | null {\n if (value === null || value === undefined) return null;\n if (!isRecord(value)) {\n throw new InferenceBindingValueError(binding, 'a fusion is a JSON object');\n }\n const keyMember = findKeyMember(value);\n if (keyMember) {\n throw new InferenceBindingValueError(\n binding,\n `\"${keyMember}\" looks like a credential; keys are stored only through smrt-secrets`,\n );\n }\n return JSON.parse(JSON.stringify(value)) as Record<string, unknown>;\n}\n\n/** `default-tier` stores `{ tier }`. */\nexport function normalizeDefaultTier(\n binding: string,\n value: unknown,\n): InferenceTier | null {\n if (value === null || value === undefined) return null;\n const tier = isRecord(value) ? value.tier : value;\n if (!isInferenceTier(tier)) {\n throw new InferenceBindingValueError(\n binding,\n `the default tier must be one of ${INFERENCE_TIERS.join(', ')}`,\n );\n }\n return tier;\n}\n\n/**\n * The allow-list reference of a tier target: `model:<provider>/<model>`\n * (`model:default/<model>` without a provider), `alias:<name>` or\n * `fusion:<name>`; for the default tier, `tier:<name>`. Key-free.\n */\nexport function inferenceTargetRef(target: InferenceTarget): string {\n const kind = inferenceTargetKind(target);\n const record = target as InferenceTarget & { fusion?: string };\n if (kind === 'fusion') return `fusion:${record.fusion ?? ''}`;\n if (kind === 'alias') return `alias:${target.alias ?? ''}`;\n if (kind === 'candidates') return 'candidates';\n return `model:${target.provider ?? 'default'}/${target.model ?? 'default'}`;\n}\n\n/**\n * Whether `ref` matches one allow-list pattern. A pattern is an exact\n * reference, a prefix ending in `*` (`model:openai/*`, `alias:*`), or `*`.\n */\nexport function matchesAllowPattern(ref: string, pattern: string): boolean {\n if (pattern === '*') return true;\n if (pattern.endsWith('*')) return ref.startsWith(pattern.slice(0, -1));\n return ref === pattern;\n}\n\n/**\n * The tenant allow-list check: a tenant may bind only a reference the app\n * row's list matches. No list (or an empty one) allows nothing, so a tenant\n * cannot bind a tier the operator has not opened.\n */\nexport function isAllowedByList(\n ref: string,\n allowList: readonly string[] | null | undefined,\n): boolean {\n return (allowList ?? []).some((pattern) => matchesAllowPattern(ref, pattern));\n}\n\n/** Validate and normalize an allow-list (patterns are short, key-free references). */\nexport function normalizeAllowList(\n binding: string,\n value: unknown,\n): string[] | null {\n if (value === null || value === undefined) return null;\n if (!Array.isArray(value)) {\n throw new InferenceBindingValueError(\n binding,\n 'an allow-list is an array of references',\n );\n }\n const out: string[] = [];\n for (const entry of value) {\n if (\n typeof entry !== 'string' ||\n !/^(\\*|(model|alias|fusion|tier):[A-Za-z0-9._/:*-]{1,160})$/.test(entry)\n ) {\n throw new InferenceBindingValueError(\n binding,\n `invalid allow-list entry ${JSON.stringify(entry)}`,\n );\n }\n if (!out.includes(entry)) out.push(entry);\n }\n return out;\n}\n\n/** Key-free description of a tier target for screens and reports. */\nexport function describeInferenceTarget(\n target: InferenceTarget | null | undefined,\n): string {\n if (!target || Object.keys(target).length === 0) {\n return 'Same as default (configured client)';\n }\n const kind = inferenceTargetKind(target);\n const record = target as InferenceTarget & { fusion?: string };\n if (kind === 'fusion') return `Fusion ${record.fusion ?? '?'}`;\n if (kind === 'alias') return `Alias ${target.alias ?? '?'}`;\n if (kind === 'candidates') {\n return `${target.candidates?.length ?? 0} inline candidate(s)`;\n }\n return `${target.provider ?? 'default'}/${target.model ?? 'default model'}`;\n}\n","import {\n field,\n SmrtObject,\n type SmrtObjectOptions,\n type SmrtSaveOptions,\n smrt,\n} from '@happyvertical/smrt-core';\nimport { bumpInferenceOverrideGeneration } from '../settings/cache.js';\nimport {\n InferenceBindingValueError,\n normalizeAliasDefinition,\n normalizeAllowList,\n normalizeDefaultTier,\n normalizeFusionDefinition,\n normalizeTierTarget,\n parseInferenceBinding,\n} from '../settings/targets.js';\n\n/** `context` (and `scopeId`) of the app-wide row. */\nexport const APP_INFERENCE_SCOPE_ID = '__app__';\n\nexport interface InferenceOverrideOptions extends SmrtObjectOptions {\n binding?: string;\n tenantId?: string | null;\n target?: string | null;\n tenantAllowList?: string | null;\n}\n\nfunction parseJson(binding: string, raw: string | null, what: string): unknown {\n if (raw === null) return null;\n try {\n return JSON.parse(raw);\n } catch {\n throw new InferenceBindingValueError(binding, `${what} is not valid JSON`);\n }\n}\n\n// One row per (binding, scope): `tier:<tier>`, `default-tier`,\n// `alias:<name>` or `fusion:<name>`, at the app scope (`tenantId = null`) or\n// one tenant's. Rows are authorization state for every scope and `tenantId`\n// is an ordinary settable field, not request-derived tenant scoping, so the\n// generated REST, CLI and MCP surfaces are closed (mirrors\n// `_smrt_prompt_overrides`, #3013). Hosts write through\n// `InferenceOverrideService`, which asks a host authorizer before every write\n// and fails closed. Keys never live here: `save()` refuses any credential-\n// shaped member; keys go to smrt-secrets through the host.\n@smrt({\n tableName: '_smrt_inference_overrides',\n conflictColumns: ['binding', 'context'],\n api: false,\n cli: false,\n mcp: false,\n indexes: [\n {\n name: 'idx_smrt_inference_overrides_tenant',\n columns: ['tenantId', 'binding'],\n },\n ],\n})\nexport class InferenceOverride extends SmrtObject { static __smrtPackage__ = \"@happyvertical/smrt-inference\";\n @field({ required: true })\n binding: string = '';\n\n // Not tenant-scoped (any scope is writable through the authorized service),\n // but the value is a tenant id: uuid on PostgreSQL, like every tenant_id.\n @field({ sqlType: 'UUID', nullable: true })\n tenantId: string | null = null;\n\n /**\n * JSON of the bound value; `null` inherits the lower layer. Tier rows hold\n * a tier target, `default-tier` holds `{ tier }`, alias rows an alias, and\n * fusion rows a fusion config entry.\n */\n @field({ type: 'text', nullable: true })\n target: string | null = null;\n\n /**\n * App rows of `tier:*` and `default-tier` only: JSON array of the target\n * references a tenant may bind (`model:openai/*`, `alias:local`,\n * `fusion:review-pair`, `tier:good`, `*`). No list allows nothing. This is\n * the stored half of the tenant allow-list; the service's\n * `tenantTargetPolicy` hook is the code half (#4667 caps the maximum\n * hosted tier there).\n */\n @field({ type: 'text', nullable: true })\n tenantAllowList: string | null = null;\n\n constructor(options: InferenceOverrideOptions = {}) {\n super(options);\n if (options.binding !== undefined) this.binding = options.binding;\n if (options.tenantId !== undefined) this.tenantId = options.tenantId;\n if (options.target !== undefined) this.target = options.target;\n if (options.tenantAllowList !== undefined) {\n this.tenantAllowList = options.tenantAllowList;\n }\n }\n\n /** The parsed, validated stored value (`null` inherits). */\n getValue(): unknown {\n return this.normalizedValue();\n }\n\n /** The parsed allow-list (`null` when the row carries none). */\n getTenantAllowList(): string[] | null {\n return normalizeAllowList(\n this.binding,\n parseJson(this.binding, this.tenantAllowList, 'tenantAllowList'),\n );\n }\n\n override async save(options?: SmrtSaveOptions): Promise<this> {\n this.validateOverride();\n // `context` is the uniqueness scope so the app row stays unique even\n // though `tenantId` is nullable (as in `_smrt_prompt_overrides`).\n this.context = this.tenantId ?? APP_INFERENCE_SCOPE_ID;\n const result = await super.save(options);\n bumpInferenceOverrideGeneration();\n return result;\n }\n\n override async delete(): Promise<void> {\n await super.delete();\n bumpInferenceOverrideGeneration();\n }\n\n private normalizedValue(): unknown {\n const parsed = parseInferenceBinding(this.binding);\n if (!parsed) {\n throw new InferenceBindingValueError(\n String(this.binding),\n 'unknown binding id',\n );\n }\n const raw = parseJson(this.binding, this.target, 'target');\n switch (parsed.kind) {\n case 'tier':\n return normalizeTierTarget(this.binding, raw);\n case 'default-tier':\n return normalizeDefaultTier(this.binding, raw);\n case 'alias':\n return normalizeAliasDefinition(this.binding, raw);\n case 'fusion':\n return normalizeFusionDefinition(this.binding, raw);\n }\n }\n\n private validateOverride(): void {\n const parsed = parseInferenceBinding(this.binding);\n if (!parsed) {\n throw new InferenceBindingValueError(\n String(this.binding),\n 'unknown binding id',\n );\n }\n if (this.tenantId !== null) {\n if (\n typeof this.tenantId !== 'string' ||\n !this.tenantId.trim() ||\n this.tenantId !== this.tenantId.trim() ||\n this.tenantId === APP_INFERENCE_SCOPE_ID\n ) {\n throw new InferenceBindingValueError(this.binding, 'invalid tenant id');\n }\n // Tenants bind tiers to allow-listed targets; they never define what a\n // name means. A tenant alias or fusion could redefine an allow-listed\n // name and bypass the list.\n if (parsed.kind === 'alias' || parsed.kind === 'fusion') {\n throw new InferenceBindingValueError(\n this.binding,\n 'aliases and fusions are defined at the app scope only',\n );\n }\n if (this.tenantAllowList !== null) {\n throw new InferenceBindingValueError(\n this.binding,\n 'the tenant allow-list lives on the app row',\n );\n }\n }\n if (\n this.tenantAllowList !== null &&\n parsed.kind !== 'tier' &&\n parsed.kind !== 'default-tier'\n ) {\n throw new InferenceBindingValueError(\n this.binding,\n 'only tier and default-tier bindings carry a tenant allow-list',\n );\n }\n const value = this.normalizedValue();\n this.target = value === null ? null : JSON.stringify(value);\n const allowList = this.getTenantAllowList();\n this.tenantAllowList =\n allowList === null ? null : JSON.stringify(allowList);\n }\n}\n","import { SmrtCollection } from '@happyvertical/smrt-core';\nimport {\n APP_INFERENCE_SCOPE_ID,\n InferenceOverride,\n} from './InferenceOverride.js';\n\n/** `app` (the `__app__` row) or one tenant. */\nexport type InferenceOverrideScopeType = 'app' | 'tenant';\n\n/**\n * Reads and unauthorized writes of `_smrt_inference_overrides`. Hosts write\n * through `InferenceOverrideService` (authorizer-gated, fails closed); call\n * {@link setOverride} / {@link removeOverride} directly only after your own\n * authorization decision.\n */\nexport class InferenceOverrideCollection extends SmrtCollection<InferenceOverride> {\n static readonly _itemClass = InferenceOverride;\n\n /**\n * Every row of one scope, keyed by binding id: one bounded read. An\n * enumeration read: build the collection without list bounds (the\n * settings service does) so a host-wide `maxListLimit` cannot drop a row.\n */\n async getScopeMap(\n scopeType: InferenceOverrideScopeType,\n scopeId: string,\n ): Promise<Map<string, InferenceOverride>> {\n const tenantId = scopeType === 'app' ? null : scopeId;\n const rows = await this.list({ where: { tenantId } });\n const result = new Map<string, InferenceOverride>();\n for (const row of rows) result.set(row.binding, row);\n return result;\n }\n\n /** The row for one binding at one scope. */\n async findByScope(\n binding: string,\n scopeType: InferenceOverrideScopeType,\n scopeId: string,\n ): Promise<InferenceOverride | null> {\n const tenantId = scopeType === 'app' ? null : scopeId;\n const rows = await this.list({ where: { binding, tenantId }, limit: 1 });\n return rows[0] ?? null;\n }\n\n /**\n * Set the stored value (and, for app rows, optionally the tenant\n * allow-list) of one binding at one scope, creating the row when needed.\n * `undefined` leaves a column untouched; `null` clears it. A row left with\n * neither a value nor an allow-list is deleted.\n */\n async setOverride(\n binding: string,\n scopeType: InferenceOverrideScopeType,\n scopeId: string,\n change: { target?: unknown; tenantAllowList?: string[] | null },\n ): Promise<InferenceOverride | null> {\n const existing = await this.findByScope(binding, scopeType, scopeId);\n const target =\n change.target === undefined\n ? (existing?.target ?? null)\n : change.target === null\n ? null\n : JSON.stringify(change.target);\n const tenantAllowList =\n change.tenantAllowList === undefined\n ? (existing?.tenantAllowList ?? null)\n : change.tenantAllowList === null\n ? null\n : JSON.stringify(change.tenantAllowList);\n\n if (target === null && tenantAllowList === null) {\n if (existing) await existing.delete();\n return null;\n }\n if (existing) {\n existing.target = target;\n existing.tenantAllowList = tenantAllowList;\n await existing.save();\n return existing;\n }\n const created = await this.create({\n binding,\n tenantId: scopeType === 'app' ? null : scopeId,\n target,\n tenantAllowList,\n });\n await created.save();\n return created;\n }\n\n /** Delete the row for one binding at one scope, if any. */\n async removeOverride(\n binding: string,\n scopeType: InferenceOverrideScopeType,\n scopeId: string,\n ): Promise<boolean> {\n const existing = await this.findByScope(binding, scopeType, scopeId);\n if (!existing) return false;\n await existing.delete();\n return true;\n }\n}\n\nexport { APP_INFERENCE_SCOPE_ID };\n"],"mappings":";;AAOA,eAAe,wBAAwB,KAAK,MAAM,yrPAAqoR,CAAC;;;ACAxrR,IAAM,iBAAiB,uBAAO,IAAI,mCAAmC;AAK9D,SAAS,iCAAyC;CACvD,OAAQ,WAAgC,mBAAmB;AAC7D;AAGO,SAAS,kCAAwC;CACtD,MAAM,SAAS;CACf,OAAO,mBAAmB,OAAO,mBAAmB,KAAK;AAC3D;;;ACFO,IAAM,oBAAkB;CAAC;CAAO;CAAS;CAAU;AAAK;AAIxD,IAAM,uBAAuB;AAU7B,IAAM,iCAAiC;AAYvC,IAAM,6BAAN,cAAyC,MAAM;CAEpD,YACW,SACT,QACA;EACA,MAAM,8BAA8B,QAAO,KAAM,QAAQ;EAHhD,KAAA,UAAA;EAIT,KAAK,OAAO;CACd;CALW;CAFF,SAAS;AAQpB;AAGO,SAAS,sBACd,SAC+B;CAC/B,IAAI,OAAO,YAAY,UAAU,OAAO;CACxC,IAAI,YAAA,gBAAkC,OAAO,EAAE,MAAM,eAAe;CACpE,MAAM,QAAQ,6BAA6B,KAAK,OAAO;CACvD,IAAI,CAAC,OAAO,OAAO;CACnB,MAAM,GAAG,MAAM,QAAQ;CACvB,IAAI,SAAS,QACX,OAAO,gBAAgB,IAAI,IAAI;EAAE,MAAM;EAAQ;CAAK,IAAI;CAE1D,IAAI,CAAC,+BAA+B,KAAK,IAAI,GAAG,OAAO;CACvD,OAAO;EAAE;EAAkC;CAAK;AAClD;AAGO,SAAS,YAAY,MAA8C;CACxE,OAAO,QAAQ;AACjB;AAEA,SAAS,SAAS,OAAkD;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