@happyvertical/smrt-inference 0.0.0-stage → 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.
- package/AGENTS.md +206 -0
- package/CLAUDE.md +1 -0
- package/LICENSE +7 -0
- package/README.md +73 -2
- package/agents/fusions.md +105 -0
- package/agents/hosted.md +161 -0
- package/agents/resolver.md +65 -0
- package/agents/settings.md +107 -0
- package/dist/__smrt-register__.d.ts +2 -0
- package/dist/__smrt-register__.d.ts.map +1 -0
- package/dist/chunks/InferenceOverrideCollection-Dat4TrK5.js +423 -0
- package/dist/chunks/InferenceOverrideCollection-Dat4TrK5.js.map +1 -0
- package/dist/chunks/provider-config-BSpIQRVM.js +1873 -0
- package/dist/chunks/provider-config-BSpIQRVM.js.map +1 -0
- package/dist/classify.d.ts +32 -0
- package/dist/classify.d.ts.map +1 -0
- package/dist/config.d.ts +89 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/errors.d.ts +51 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/executor.d.ts +45 -0
- package/dist/executor.d.ts.map +1 -0
- package/dist/fusion-store.d.ts +16 -0
- package/dist/fusion-store.d.ts.map +1 -0
- package/dist/fusion.d.ts +155 -0
- package/dist/fusion.d.ts.map +1 -0
- package/dist/gate.d.ts +143 -0
- package/dist/gate.d.ts.map +1 -0
- package/dist/gate.js +94 -0
- package/dist/gate.js.map +1 -0
- package/dist/hosted.d.ts +461 -0
- package/dist/hosted.d.ts.map +1 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +8 -0
- package/dist/index.js.map +1 -0
- package/dist/manifest.json +453 -0
- package/dist/models/InferenceOverride.d.ts +38 -0
- package/dist/models/InferenceOverride.d.ts.map +1 -0
- package/dist/models/InferenceOverrideCollection.d.ts +35 -0
- package/dist/models/InferenceOverrideCollection.d.ts.map +1 -0
- package/dist/models.d.ts +11 -0
- package/dist/models.d.ts.map +1 -0
- package/dist/models.js +2 -0
- package/dist/node.d.ts +110 -0
- package/dist/node.d.ts.map +1 -0
- package/dist/node.js +1414 -0
- package/dist/node.js.map +1 -0
- package/dist/provider-config.d.ts +113 -0
- package/dist/provider-config.d.ts.map +1 -0
- package/dist/register.d.ts +30 -0
- package/dist/register.d.ts.map +1 -0
- package/dist/resolver.d.ts +166 -0
- package/dist/resolver.d.ts.map +1 -0
- package/dist/resolver.js +291 -0
- package/dist/resolver.js.map +1 -0
- package/dist/server.d.ts +25 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/server.js +1138 -0
- package/dist/server.js.map +1 -0
- package/dist/settings/cache.d.ts +5 -0
- package/dist/settings/cache.d.ts.map +1 -0
- package/dist/settings/keys.d.ts +70 -0
- package/dist/settings/keys.d.ts.map +1 -0
- package/dist/settings/layers.d.ts +68 -0
- package/dist/settings/layers.d.ts.map +1 -0
- package/dist/settings/override-service.d.ts +119 -0
- package/dist/settings/override-service.d.ts.map +1 -0
- package/dist/settings/preferences.d.ts +137 -0
- package/dist/settings/preferences.d.ts.map +1 -0
- package/dist/settings/resolver.d.ts +41 -0
- package/dist/settings/resolver.d.ts.map +1 -0
- package/dist/settings/settings-service.d.ts +355 -0
- package/dist/settings/settings-service.d.ts.map +1 -0
- package/dist/settings/targets.d.ts +112 -0
- package/dist/settings/targets.d.ts.map +1 -0
- package/dist/settings/transcripts.d.ts +33 -0
- package/dist/settings/transcripts.d.ts.map +1 -0
- package/dist/smrt-knowledge.json +341 -0
- package/dist/smrt-knowledge.okf.md +80 -0
- package/dist/svelte/components/InferenceAliasEditor.svelte +210 -0
- package/dist/svelte/components/InferenceAliasEditor.svelte.d.ts +13 -0
- package/dist/svelte/components/InferenceAliasEditor.svelte.d.ts.map +1 -0
- package/dist/svelte/components/InferenceDefaultView.svelte +330 -0
- package/dist/svelte/components/InferenceDefaultView.svelte.d.ts +15 -0
- package/dist/svelte/components/InferenceDefaultView.svelte.d.ts.map +1 -0
- package/dist/svelte/components/InferenceFusionList.svelte +141 -0
- package/dist/svelte/components/InferenceFusionList.svelte.d.ts +16 -0
- package/dist/svelte/components/InferenceFusionList.svelte.d.ts.map +1 -0
- package/dist/svelte/components/InferenceSettingsPanel.svelte +392 -0
- package/dist/svelte/components/InferenceSettingsPanel.svelte.d.ts +84 -0
- package/dist/svelte/components/InferenceSettingsPanel.svelte.d.ts.map +1 -0
- package/dist/svelte/components/InferenceTierRow.svelte +199 -0
- package/dist/svelte/components/InferenceTierRow.svelte.d.ts +14 -0
- package/dist/svelte/components/InferenceTierRow.svelte.d.ts.map +1 -0
- package/dist/svelte/components/InferenceTranscriptSettings.svelte +165 -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 +177 -0
- package/dist/svelte/components/InferenceUsageTable.svelte.d.ts +21 -0
- package/dist/svelte/components/InferenceUsageTable.svelte.d.ts.map +1 -0
- package/dist/svelte/index.d.ts +17 -0
- package/dist/svelte/index.d.ts.map +1 -0
- package/dist/svelte/index.js +14 -0
- package/dist/svelte/types.d.ts +262 -0
- package/dist/svelte/types.d.ts.map +1 -0
- package/dist/svelte/types.js +124 -0
- package/dist/types.d.ts +47 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +13 -0
- package/dist/types.js.map +1 -0
- package/package.json +105 -3
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* User inference choices as the smrt-preferences kind `inference` (#4754):
|
|
3
|
+
* mode, provider, base URL, model and default tier, at the tenant default
|
|
4
|
+
* and per user. Never a key: the validator refuses credential-shaped members
|
|
5
|
+
* (keys go to smrt-secrets through the host).
|
|
6
|
+
*
|
|
7
|
+
* smrt-preferences is not a dependency: the kind is a plain definition the
|
|
8
|
+
* host registers with `registerPreferenceKind(inferencePreferenceKind)` (and
|
|
9
|
+
* the two permissions with smrt-users' `registerPermissionDefinitions`), and
|
|
10
|
+
* {@link createInferencePreferences} takes the store structurally.
|
|
11
|
+
*/
|
|
12
|
+
import { type InferenceTier } from '@happyvertical/smrt-core';
|
|
13
|
+
import { type InferenceMode } from './targets.js';
|
|
14
|
+
export declare const INFERENCE_PREFERENCE_KIND = "inference";
|
|
15
|
+
/** Default surface id: one inference choice per tenant and user. */
|
|
16
|
+
export declare const INFERENCE_PREFERENCE_SURFACE = "default";
|
|
17
|
+
/** Authorizes changing the tenant's default inference choices. */
|
|
18
|
+
export declare const CUSTOMIZE_INFERENCE_PERMISSION = "inference.customize";
|
|
19
|
+
/** Authorizes a user to keep their own inference choices. */
|
|
20
|
+
export declare const PERSONALIZE_INFERENCE_PERMISSION = "inference.personalize";
|
|
21
|
+
/** For smrt-users' `registerPermissionDefinitions()`. */
|
|
22
|
+
export declare const INFERENCE_PERMISSION_DEFINITIONS: readonly [{
|
|
23
|
+
readonly slug: "inference.customize";
|
|
24
|
+
readonly category: "inference";
|
|
25
|
+
readonly name: "Customize Inference";
|
|
26
|
+
readonly description: "Change the default inference mode, provider and model everyone in the tenant uses";
|
|
27
|
+
}, {
|
|
28
|
+
readonly slug: "inference.personalize";
|
|
29
|
+
readonly category: "inference";
|
|
30
|
+
readonly name: "Personalize Inference";
|
|
31
|
+
readonly description: "Keep a personal inference mode, provider and model on top of the tenant default";
|
|
32
|
+
}];
|
|
33
|
+
/** The `inference` preference payload. Every member is optional. */
|
|
34
|
+
export interface InferencePreferences {
|
|
35
|
+
mode?: InferenceMode;
|
|
36
|
+
provider?: string;
|
|
37
|
+
baseUrl?: string;
|
|
38
|
+
model?: string;
|
|
39
|
+
defaultTier?: InferenceTier;
|
|
40
|
+
}
|
|
41
|
+
/** Structural copy of smrt-preferences' issue shape. */
|
|
42
|
+
export interface InferencePreferenceIssue {
|
|
43
|
+
path: string | null;
|
|
44
|
+
code: string;
|
|
45
|
+
message: string;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Validate an `inference` payload: unknown or invalid members are removed
|
|
49
|
+
* and reported, credential-shaped members refuse the whole payload.
|
|
50
|
+
*/
|
|
51
|
+
export declare function validateInferencePreferences(payload: unknown): {
|
|
52
|
+
ok: boolean;
|
|
53
|
+
canonical: InferencePreferences | null;
|
|
54
|
+
issues: InferencePreferenceIssue[];
|
|
55
|
+
};
|
|
56
|
+
/** The kind definition for smrt-preferences' `registerPreferenceKind()`. */
|
|
57
|
+
export declare const inferencePreferenceKind: {
|
|
58
|
+
kind: string;
|
|
59
|
+
formatVersion: number;
|
|
60
|
+
permissions: {
|
|
61
|
+
tenant: string;
|
|
62
|
+
user: string;
|
|
63
|
+
};
|
|
64
|
+
validate(payload: unknown): {
|
|
65
|
+
ok: boolean;
|
|
66
|
+
canonical: InferencePreferences | null;
|
|
67
|
+
issues: InferencePreferenceIssue[];
|
|
68
|
+
};
|
|
69
|
+
};
|
|
70
|
+
type WriteResult = {
|
|
71
|
+
ok: true;
|
|
72
|
+
revision?: string | null;
|
|
73
|
+
[extra: string]: unknown;
|
|
74
|
+
} | {
|
|
75
|
+
ok: false;
|
|
76
|
+
reason: string;
|
|
77
|
+
[extra: string]: unknown;
|
|
78
|
+
};
|
|
79
|
+
/** The slice of smrt-preferences' `PreferenceStore` this layer uses. */
|
|
80
|
+
export interface InferencePreferenceStoreLike {
|
|
81
|
+
load(kind: string, surfaceId: string): Promise<{
|
|
82
|
+
tenant: {
|
|
83
|
+
payload: unknown;
|
|
84
|
+
revision: string | null;
|
|
85
|
+
};
|
|
86
|
+
user?: {
|
|
87
|
+
payload: unknown;
|
|
88
|
+
revision: string | null;
|
|
89
|
+
} | null;
|
|
90
|
+
issues: InferencePreferenceIssue[];
|
|
91
|
+
canCustomize: {
|
|
92
|
+
tenant: boolean;
|
|
93
|
+
user: boolean;
|
|
94
|
+
};
|
|
95
|
+
}>;
|
|
96
|
+
save(kind: string, surfaceId: string, input: {
|
|
97
|
+
scope: 'tenant' | 'user';
|
|
98
|
+
payload: unknown;
|
|
99
|
+
revision: string | null;
|
|
100
|
+
}): Promise<WriteResult>;
|
|
101
|
+
reset(kind: string, surfaceId: string, input: {
|
|
102
|
+
scope: 'tenant' | 'user';
|
|
103
|
+
revision?: string | null;
|
|
104
|
+
}): Promise<WriteResult>;
|
|
105
|
+
}
|
|
106
|
+
/** What a settings screen reads. */
|
|
107
|
+
export interface InferencePreferenceRead {
|
|
108
|
+
/** Tenant default with the user's choices on top (member by member). */
|
|
109
|
+
choices: InferencePreferences;
|
|
110
|
+
tenant: InferencePreferences | null;
|
|
111
|
+
user: InferencePreferences | null;
|
|
112
|
+
revisions: {
|
|
113
|
+
tenant: string | null;
|
|
114
|
+
user: string | null;
|
|
115
|
+
};
|
|
116
|
+
issues: InferencePreferenceIssue[];
|
|
117
|
+
canCustomize: {
|
|
118
|
+
tenant: boolean;
|
|
119
|
+
user: boolean;
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
/** Read and write the `inference` preference over a preference store. */
|
|
123
|
+
export declare function createInferencePreferences(store: InferencePreferenceStoreLike, surfaceId?: string): {
|
|
124
|
+
read(): Promise<InferencePreferenceRead>;
|
|
125
|
+
/** Save choices at a scope (default `user`); `revision` is the one the client loaded. */
|
|
126
|
+
write(choices: InferencePreferences, options: {
|
|
127
|
+
scope?: "tenant" | "user";
|
|
128
|
+
revision: string | null;
|
|
129
|
+
}): Promise<WriteResult>;
|
|
130
|
+
reset(options?: {
|
|
131
|
+
scope?: "tenant" | "user";
|
|
132
|
+
revision?: string | null;
|
|
133
|
+
}): Promise<WriteResult>;
|
|
134
|
+
};
|
|
135
|
+
export type InferencePreferencesApi = ReturnType<typeof createInferencePreferences>;
|
|
136
|
+
export {};
|
|
137
|
+
//# sourceMappingURL=preferences.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"preferences.d.ts","sourceRoot":"","sources":["../../src/settings/preferences.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EAEL,KAAK,aAAa,EAEnB,MAAM,0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S,EAAE;QAAE,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;QAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAA;KAAE,CAAC;IAC1D,MAAM,EAAE,wBAAwB,EAAE,CAAC;IACnC,YAAY,EAAE;QAAE,MAAM,EAAE,OAAO,CAAC;QAAC,IAAI,EAAE,OAAO,CAAA;KAAE,CAAC;CAClD;AAED,yEAAyE;AACzE,wBAAgB,0BAA0B,CACxC,KAAK,EAAE,4BAA4B,EACnC,SAAS,GAAE,MAAqC;YAGhC,OAAO,CAAC,uBAAuB,CAAC;IAkB9C,yFAAyF;mBAE9E,oBAAoB,WACpB;QAAE,KAAK,CAAC,EAAE,QAAQ,GAAG,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAA;KAAE,GAC9D,OAAO,CAAC,WAAW,CAAC;oBASZ;QAAE,KAAK,CAAC,EAAE,QAAQ,GAAG,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;KAAE,GAC/D,OAAO,CAAC,WAAW,CAAC;EAO1B;AAED,MAAM,MAAM,uBAAuB,GAAG,UAAU,CAC9C,OAAO,0BAA0B,CAClC,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* An `InferenceResolver` that applies the stored app and tenant bindings
|
|
3
|
+
* (#4754) at call time: config < app row < allowed tenant row. A tier with
|
|
4
|
+
* no stored binding defers to `base` (another resolver, e.g. #4756's
|
|
5
|
+
* per-user one) or to core's built-in config resolution, so an empty table
|
|
6
|
+
* changes nothing.
|
|
7
|
+
*
|
|
8
|
+
* Aliases defined only in app rows are not visible to the executor (it reads
|
|
9
|
+
* the process config), so a stored binding to such an alias is returned as
|
|
10
|
+
* the alias's inline candidate chain, expanded recursively; aliases that the
|
|
11
|
+
* config defines stay references.
|
|
12
|
+
*
|
|
13
|
+
* Fusions defined in app rows reach the executor through `lookupFusion()`
|
|
14
|
+
* (#4800, core's `InferenceExecutionContext.lookupFusion`): read from the
|
|
15
|
+
* app scope only (a tenant never defines a fusion), validated against
|
|
16
|
+
* config + app rows including every seat's prompt key (an invalid row throws
|
|
17
|
+
* `InferenceConfigError`, never runs), with app-only seat aliases inlined
|
|
18
|
+
* the same way. An app row shadows a config fusion of the same name.
|
|
19
|
+
*/
|
|
20
|
+
import { type InferenceResolver, type SmrtClassOptions } from '@happyvertical/smrt-core';
|
|
21
|
+
import { InferenceOverrideCollection } from '../models/InferenceOverrideCollection.js';
|
|
22
|
+
import type { InferenceTenantTargetPolicy } from './override-service.js';
|
|
23
|
+
/** Options for {@link createInferenceOverrideResolver}. */
|
|
24
|
+
export interface InferenceOverrideResolverOptions {
|
|
25
|
+
/** Database options for the override collection (list bounds are stripped). */
|
|
26
|
+
db?: SmrtClassOptions;
|
|
27
|
+
/** An existing collection instead of `db`. */
|
|
28
|
+
overrides?: InferenceOverrideCollection;
|
|
29
|
+
/** Resolver to defer to for tiers with no stored binding. */
|
|
30
|
+
base?: InferenceResolver;
|
|
31
|
+
/** The code half of the tenant allow-list (same hook as the settings service). */
|
|
32
|
+
tenantTargetPolicy?: InferenceTenantTargetPolicy;
|
|
33
|
+
/**
|
|
34
|
+
* How long a tenant's layers are reused, ms. Default 30 000. Any write in
|
|
35
|
+
* this process invalidates immediately; other processes see it after TTL.
|
|
36
|
+
*/
|
|
37
|
+
ttlMs?: number;
|
|
38
|
+
}
|
|
39
|
+
/** See the module doc. */
|
|
40
|
+
export declare function createInferenceOverrideResolver(options?: InferenceOverrideResolverOptions): InferenceResolver;
|
|
41
|
+
//# sourceMappingURL=resolver.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolver.d.ts","sourceRoot":"","sources":["../../src/settings/resolver.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,OAAO,EAIL,KAAK,iBAAiB,EAKtB,KAAK,gBAAgB,EAEtB,MAAM,0BAA0B,CAAC;AAOlC,OAAO,EAAE,2BAA2B,EAAE,MAAM,0CAA0C,CAAC;AAUvF,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,uBAAuB,CAAC;AAGzE,2DAA2D;AAC3D,MAAM,WAAW,gCAAgC;IAC/C,+EAA+E;IAC/E,EAAE,CAAC,EAAE,gBAAgB,CAAC;IACtB,8CAA8C;IAC9C,SAAS,CAAC,EAAE,2BAA2B,CAAC;IACxC,6DAA6D;IAC7D,IAAI,CAAC,EAAE,iBAAiB,CAAC;IACzB,kFAAkF;IAClF,kBAAkB,CAAC,EAAE,2BAA2B,CAAC;IACjD;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAkED,0BAA0B;AAC1B,wBAAgB,+BAA+B,CAC7C,OAAO,GAAE,gCAAqC,GAC7C,iBAAiB,CA0HnB"}
|
|
@@ -0,0 +1,355 @@
|
|
|
1
|
+
import { type AiUsageReport, type AiUsageReportDimension, type InferenceAlias, type InferenceCandidate, type InferenceConfig, type InferenceTarget, type InferenceTier, type InferenceTranscriptsConfig, type RetentionPolicy, type SmrtClassOptions } from '@happyvertical/smrt-core';
|
|
2
|
+
import { InferenceOverrideCollection, type InferenceOverrideScopeType } from '../models/InferenceOverrideCollection.js';
|
|
3
|
+
import { type InferenceDoctorReport } from '../node.js';
|
|
4
|
+
import type { InferenceConfigIssue } from '../types.js';
|
|
5
|
+
import { type InferenceKeyRecord } from './keys.js';
|
|
6
|
+
import { type InferenceSettingsConfig } from './layers.js';
|
|
7
|
+
import { type InferenceOverrideAuthorizer, type InferenceTenantTargetPolicy } from './override-service.js';
|
|
8
|
+
import { DEFAULT_TIER_BINDING, type InferenceTranscriptSettingsValue, TRANSCRIPTS_BINDING } from './targets.js';
|
|
9
|
+
/** Which level supplied an effective value. */
|
|
10
|
+
export type InferenceSettingsLevel = 'default' | 'config' | 'app' | 'tenant';
|
|
11
|
+
/** One tier, rendered for a settings screen. */
|
|
12
|
+
export interface InferenceTierSettingsRow {
|
|
13
|
+
binding: `tier:${InferenceTier}`;
|
|
14
|
+
tier: InferenceTier;
|
|
15
|
+
/** What the tier resolves to for the requested tenant; `null` is the configured client. */
|
|
16
|
+
effectiveTarget: InferenceTarget | null;
|
|
17
|
+
effectiveLabel: string;
|
|
18
|
+
supplyingLevel: InferenceSettingsLevel;
|
|
19
|
+
/** The `inference` config's binding (code default + config files + env). */
|
|
20
|
+
configTarget: InferenceTarget | null;
|
|
21
|
+
/** The app row's raw value, `null` when none. */
|
|
22
|
+
appTarget: InferenceTarget | null;
|
|
23
|
+
/**
|
|
24
|
+
* The tenant row's raw value, `null` when none or no tenant was requested.
|
|
25
|
+
* Present even when {@link tenantBlocked}: the screen shows why it is not
|
|
26
|
+
* in effect.
|
|
27
|
+
*/
|
|
28
|
+
tenantTarget: InferenceTarget | null;
|
|
29
|
+
/** What reverting the **app** scope produces: the config binding. */
|
|
30
|
+
appRevertTarget: InferenceTarget | null;
|
|
31
|
+
appRevertLabel: string;
|
|
32
|
+
/**
|
|
33
|
+
* What reverting the **tenant** scope produces: config plus the app row.
|
|
34
|
+
* `null` label when no tenant was requested (nothing computed it).
|
|
35
|
+
*/
|
|
36
|
+
inheritedTarget: InferenceTarget | null;
|
|
37
|
+
inheritedLabel: string | null;
|
|
38
|
+
/** The tenant allow-list on the app row (`null`: tenants may bind nothing). */
|
|
39
|
+
tenantAllowList: string[] | null;
|
|
40
|
+
/** A tenant row exists but the allow-list or policy refuses it now. */
|
|
41
|
+
tenantBlocked: boolean;
|
|
42
|
+
}
|
|
43
|
+
/** `auto`'s default tier, rendered for a settings screen. */
|
|
44
|
+
export interface InferenceDefaultTierSetting {
|
|
45
|
+
binding: typeof DEFAULT_TIER_BINDING;
|
|
46
|
+
effectiveTier: InferenceTier;
|
|
47
|
+
supplyingLevel: InferenceSettingsLevel;
|
|
48
|
+
configTier: InferenceTier | null;
|
|
49
|
+
appTier: InferenceTier | null;
|
|
50
|
+
tenantTier: InferenceTier | null;
|
|
51
|
+
/** What reverting the app scope produces (config, else `good`). */
|
|
52
|
+
appRevertTier: InferenceTier;
|
|
53
|
+
/** What reverting the tenant scope produces; `null` when no tenant was requested. */
|
|
54
|
+
inheritedTier: InferenceTier | null;
|
|
55
|
+
tenantAllowList: string[] | null;
|
|
56
|
+
tenantBlocked: boolean;
|
|
57
|
+
}
|
|
58
|
+
/** One alias for the alias editor. */
|
|
59
|
+
export interface InferenceAliasSetting {
|
|
60
|
+
name: string;
|
|
61
|
+
/** Where the effective definition comes from (an app row replaces config whole). */
|
|
62
|
+
source: 'config' | 'app';
|
|
63
|
+
candidates: InferenceCandidate[];
|
|
64
|
+
description?: string;
|
|
65
|
+
/** True when config also defines it (reverting the app row restores that). */
|
|
66
|
+
inConfig: boolean;
|
|
67
|
+
}
|
|
68
|
+
/** One fusion for the fusion list (#4753 owns their meaning). */
|
|
69
|
+
export interface InferenceFusionSetting {
|
|
70
|
+
name: string;
|
|
71
|
+
source: 'registry' | 'config' | 'app';
|
|
72
|
+
/** The definition as JSON-safe data. */
|
|
73
|
+
definition: Record<string, unknown>;
|
|
74
|
+
description?: string;
|
|
75
|
+
/** Config entries (app rows) can be edited as JSON; registry fusions are code. */
|
|
76
|
+
editable: boolean;
|
|
77
|
+
/**
|
|
78
|
+
* Lower sources this definition replaces by name (#4800): an app row
|
|
79
|
+
* shadows config and the registry, config shadows the registry, exactly
|
|
80
|
+
* as the executor picks. Absent when nothing is shadowed.
|
|
81
|
+
*/
|
|
82
|
+
shadows?: Array<'registry' | 'config'>;
|
|
83
|
+
/**
|
|
84
|
+
* Why the executor would refuse to run this definition (structure,
|
|
85
|
+
* aliases, unregistered seat prompt keys), checked as the executor
|
|
86
|
+
* checks it (#4800). Absent when it would run.
|
|
87
|
+
*/
|
|
88
|
+
issues?: InferenceConfigIssue[];
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* The app's transcript setting (#4781), for the panel's Advanced section.
|
|
92
|
+
* App level only: tenants cannot override it, so it is the same for every
|
|
93
|
+
* tenant. Never carries transcript content.
|
|
94
|
+
*/
|
|
95
|
+
export interface InferenceTranscriptSettings {
|
|
96
|
+
binding: typeof TRANSCRIPTS_BINDING;
|
|
97
|
+
/** Effective values: config < app row < `SMRT_INFERENCE_TRANSCRIPTS`. */
|
|
98
|
+
enabled: boolean;
|
|
99
|
+
sample: number;
|
|
100
|
+
maxBytes: number;
|
|
101
|
+
/** Which level supplied `enabled`. */
|
|
102
|
+
supplyingLevel: 'default' | 'config' | 'app' | 'env';
|
|
103
|
+
/** The app row's stored value (`null`: none). */
|
|
104
|
+
appValue: InferenceTranscriptSettingsValue | null;
|
|
105
|
+
/** What reverting the app row produces (config and env only). */
|
|
106
|
+
appRevert: {
|
|
107
|
+
enabled: boolean;
|
|
108
|
+
sample: number;
|
|
109
|
+
maxBytes: number;
|
|
110
|
+
};
|
|
111
|
+
/** `SMRT_INFERENCE_TRANSCRIPTS` forces `enabled` to this (`null`: unset). */
|
|
112
|
+
envEnabled: boolean | null;
|
|
113
|
+
/**
|
|
114
|
+
* Days transcripts are kept by the retention sweep
|
|
115
|
+
* (`retention.aiTranscripts.maxAgeDays`); `null` when the sweep skips
|
|
116
|
+
* them. Read-only here: the sweep runs with its caller's policy.
|
|
117
|
+
*/
|
|
118
|
+
retentionDays: number | null;
|
|
119
|
+
/** Prompt keys with their own sample rate in config (read-only). */
|
|
120
|
+
promptOverrides: string[];
|
|
121
|
+
}
|
|
122
|
+
/** One provider choice for the default view. */
|
|
123
|
+
export interface InferenceProviderOption {
|
|
124
|
+
id: string;
|
|
125
|
+
label: string;
|
|
126
|
+
/** `preset` (#4674 endpoint presets) or `provider` (the AI SDK list). */
|
|
127
|
+
kind: 'preset' | 'provider';
|
|
128
|
+
baseUrl?: string;
|
|
129
|
+
requiresApiKey: boolean;
|
|
130
|
+
/** Needs a base URL before a key can be bound (gateways). */
|
|
131
|
+
needsBaseUrl?: boolean;
|
|
132
|
+
/** A loopback server (local discovery applies). */
|
|
133
|
+
local?: boolean;
|
|
134
|
+
}
|
|
135
|
+
/** What Test connection probes. Never carries a key: the host supplies the stored record. */
|
|
136
|
+
export interface InferenceConnectionInput {
|
|
137
|
+
provider?: string;
|
|
138
|
+
preset?: string;
|
|
139
|
+
baseUrl?: string;
|
|
140
|
+
model?: string;
|
|
141
|
+
}
|
|
142
|
+
/** Key-free result of a test. */
|
|
143
|
+
export interface InferenceConnectionResult {
|
|
144
|
+
reachable: boolean;
|
|
145
|
+
skipped?: boolean;
|
|
146
|
+
status?: number;
|
|
147
|
+
durationMs: number;
|
|
148
|
+
detail: string;
|
|
149
|
+
/** Whether a stored key was sent (only ever to its bound origin). */
|
|
150
|
+
keySent: boolean;
|
|
151
|
+
}
|
|
152
|
+
/** A fusion the host's registry knows (soft dependency on #4753's `defineFusion`). */
|
|
153
|
+
export interface RegisteredFusionLike {
|
|
154
|
+
key: string;
|
|
155
|
+
description?: string;
|
|
156
|
+
[member: string]: unknown;
|
|
157
|
+
}
|
|
158
|
+
/** Options for {@link InferenceSettingsService.create}. */
|
|
159
|
+
export interface InferenceSettingsServiceOptions {
|
|
160
|
+
/** Host authorizer. Omit for a read-only (load-function) service: writes fail closed. */
|
|
161
|
+
authorize?: InferenceOverrideAuthorizer;
|
|
162
|
+
/** The code half of the tenant allow-list (#4667 caps hosted tiers here). */
|
|
163
|
+
tenantTargetPolicy?: InferenceTenantTargetPolicy;
|
|
164
|
+
/** The config layer. Default core's merged `getInferenceConfig()`. */
|
|
165
|
+
config?: () => InferenceConfig | undefined;
|
|
166
|
+
/**
|
|
167
|
+
* Registered fusions. Default: #4753's process registry (`defineFusion()`).
|
|
168
|
+
*/
|
|
169
|
+
registryFusions?: () => Iterable<RegisteredFusionLike>;
|
|
170
|
+
/**
|
|
171
|
+
* The transcript config with an app layer (#4781). Default core's
|
|
172
|
+
* `getInferenceTranscriptsConfig()` (config < app < env).
|
|
173
|
+
*/
|
|
174
|
+
transcriptsConfig?: (app: InferenceTranscriptsConfig | null) => InferenceTranscriptsConfig | undefined;
|
|
175
|
+
/** The retention policy the sweep runs with. Default core `config().retention`. */
|
|
176
|
+
retention?: () => RetentionPolicy | undefined;
|
|
177
|
+
}
|
|
178
|
+
/** Thrown when a write would leave the layered config invalid. Nothing is written. */
|
|
179
|
+
export declare class InferenceSettingsConfigError extends Error {
|
|
180
|
+
readonly issues: InferenceConfigIssue[];
|
|
181
|
+
readonly status = 400;
|
|
182
|
+
constructor(issues: InferenceConfigIssue[]);
|
|
183
|
+
}
|
|
184
|
+
/** Thrown when removing an alias or fusion that something still names. Nothing is written. */
|
|
185
|
+
export declare class InferenceBindingInUseError extends Error {
|
|
186
|
+
readonly binding: string;
|
|
187
|
+
/** App-scope and config referrers. */
|
|
188
|
+
readonly referrers: string[];
|
|
189
|
+
/** How many tenant rows name it (never which tenants). */
|
|
190
|
+
readonly tenantReferences: number;
|
|
191
|
+
readonly status = 409;
|
|
192
|
+
constructor(binding: string,
|
|
193
|
+
/** App-scope and config referrers. */
|
|
194
|
+
referrers: string[],
|
|
195
|
+
/** How many tenant rows name it (never which tenants). */
|
|
196
|
+
tenantReferences: number);
|
|
197
|
+
}
|
|
198
|
+
/** Usage tab dimensions (`usage()`). */
|
|
199
|
+
export type InferenceUsageReportDimension = Extract<AiUsageReportDimension, 'model' | 'tier' | 'prompt' | 'fusion' | 'template'>;
|
|
200
|
+
/**
|
|
201
|
+
* Read and write side of an inference settings screen. See the module doc.
|
|
202
|
+
*/
|
|
203
|
+
export declare class InferenceSettingsService {
|
|
204
|
+
private readonly overrides;
|
|
205
|
+
private readonly options;
|
|
206
|
+
private readonly writes;
|
|
207
|
+
private readonly readConfig;
|
|
208
|
+
constructor(overrides: InferenceOverrideCollection, options?: InferenceSettingsServiceOptions);
|
|
209
|
+
/** Build a service over the given database options (list bounds stripped). */
|
|
210
|
+
static create(options?: SmrtClassOptions, serviceOptions?: InferenceSettingsServiceOptions): Promise<InferenceSettingsService>;
|
|
211
|
+
private loadLayers;
|
|
212
|
+
/**
|
|
213
|
+
* The effective config for a tenant: config < app rows < allowed tenant
|
|
214
|
+
* rows. What the override resolver binds and the doctor checks.
|
|
215
|
+
* Server-side only: config layers may carry literal keys, so never send
|
|
216
|
+
* this to a browser (the row methods strip them).
|
|
217
|
+
*/
|
|
218
|
+
getEffectiveConfig(options?: {
|
|
219
|
+
tenantId?: string | null;
|
|
220
|
+
}): Promise<InferenceSettingsConfig | undefined>;
|
|
221
|
+
/**
|
|
222
|
+
* One row per tier (`cheap`, `good`, `great`, `best`): the effective
|
|
223
|
+
* target, each scope's raw override, and both revert previews.
|
|
224
|
+
*/
|
|
225
|
+
listInferenceSettings(options?: {
|
|
226
|
+
tenantId?: string | null;
|
|
227
|
+
}): Promise<InferenceTierSettingsRow[]>;
|
|
228
|
+
/** `auto`'s default tier with the same per-scope shape. */
|
|
229
|
+
getDefaultTierSetting(options?: {
|
|
230
|
+
tenantId?: string | null;
|
|
231
|
+
}): Promise<InferenceDefaultTierSetting>;
|
|
232
|
+
/** Every alias: config entries, replaced whole by app rows. Sorted by name. */
|
|
233
|
+
listInferenceAliases(): Promise<InferenceAliasSetting[]>;
|
|
234
|
+
/**
|
|
235
|
+
* Fusions from the host's registry (code, read-only), the config's
|
|
236
|
+
* `inference.fusions`, and app rows (editable JSON). A later source
|
|
237
|
+
* shadows an earlier one by name, the executor's precedence (#4800): app
|
|
238
|
+
* row, then config, then registry. Each entry carries the issues that
|
|
239
|
+
* would make the executor refuse it, so the list shows what would run.
|
|
240
|
+
*/
|
|
241
|
+
listInferenceFusions(): Promise<InferenceFusionSetting[]>;
|
|
242
|
+
/**
|
|
243
|
+
* Bind (or, with `null`, revert) one tier at one scope. Tenant writes must
|
|
244
|
+
* pass the allow-list; every write goes through the authorizer.
|
|
245
|
+
*/
|
|
246
|
+
setTierOverride(request: {
|
|
247
|
+
tier: InferenceTier;
|
|
248
|
+
scopeType: InferenceOverrideScopeType;
|
|
249
|
+
scopeId: string;
|
|
250
|
+
target: InferenceTarget | null;
|
|
251
|
+
}): Promise<void>;
|
|
252
|
+
/** Set (or revert) `auto`'s default tier at one scope. */
|
|
253
|
+
setDefaultTierOverride(request: {
|
|
254
|
+
scopeType: InferenceOverrideScopeType;
|
|
255
|
+
scopeId: string;
|
|
256
|
+
tier: InferenceTier | null;
|
|
257
|
+
}): Promise<void>;
|
|
258
|
+
/** Set (or remove) the tenant allow-list of a tier or of the default tier. */
|
|
259
|
+
setTenantAllowList(request: {
|
|
260
|
+
binding: `tier:${InferenceTier}` | typeof DEFAULT_TIER_BINDING;
|
|
261
|
+
allowList: string[] | null;
|
|
262
|
+
}): Promise<void>;
|
|
263
|
+
/** Define (or, with `null`, remove) an app-level alias. */
|
|
264
|
+
setAlias(request: {
|
|
265
|
+
name: string;
|
|
266
|
+
alias: InferenceAlias | null;
|
|
267
|
+
}): Promise<void>;
|
|
268
|
+
/** Store (or, with `null`, remove) an app-level fusion config entry (#4753 shape). */
|
|
269
|
+
setFusion(request: {
|
|
270
|
+
name: string;
|
|
271
|
+
definition: Record<string, unknown> | null;
|
|
272
|
+
}): Promise<void>;
|
|
273
|
+
/**
|
|
274
|
+
* Refuse removing an app alias or fusion that a stored binding (any
|
|
275
|
+
* scope, any tenant) or the config still names, unless config or the
|
|
276
|
+
* registry keeps defining it. Otherwise the removal would leave dangling
|
|
277
|
+
* references that fail at call time.
|
|
278
|
+
*/
|
|
279
|
+
private assertNotReferenced;
|
|
280
|
+
/**
|
|
281
|
+
* Refuse a write that adds a config issue (unknown alias, cycle, key
|
|
282
|
+
* without endpoint, unknown preset) to the layered config it lands in.
|
|
283
|
+
* Issues that already existed do not block unrelated writes.
|
|
284
|
+
*/
|
|
285
|
+
private assertConfigStaysValid;
|
|
286
|
+
/**
|
|
287
|
+
* Test connection for the default view: probe the endpoint's cheapest
|
|
288
|
+
* list call (`./node`'s `probeInferenceCandidate`, 3 s). The stored key
|
|
289
|
+
* record (from the host's `SecretService`) is sent only when the probe URL
|
|
290
|
+
* is on the key's bound origin; no environment key is read.
|
|
291
|
+
*/
|
|
292
|
+
testConnection(input: InferenceConnectionInput, options?: {
|
|
293
|
+
key?: InferenceKeyRecord | null;
|
|
294
|
+
fetch?: typeof fetch;
|
|
295
|
+
timeoutMs?: number;
|
|
296
|
+
}): Promise<InferenceConnectionResult>;
|
|
297
|
+
/**
|
|
298
|
+
* Per-candidate test for the alias editor. A candidate already in the
|
|
299
|
+
* effective config (config file or an app row) reads its key from
|
|
300
|
+
* `apiKeyEnv` (or its provider's variable) exactly as the doctor does,
|
|
301
|
+
* sent only to its own endpoint; any other candidate (an unsaved edit) is
|
|
302
|
+
* probed with no key at all.
|
|
303
|
+
*/
|
|
304
|
+
testCandidate(candidate: InferenceCandidate, options?: {
|
|
305
|
+
env?: Record<string, string | undefined>;
|
|
306
|
+
fetch?: typeof fetch;
|
|
307
|
+
timeoutMs?: number;
|
|
308
|
+
}): Promise<InferenceConnectionResult>;
|
|
309
|
+
private isConfiguredCandidate;
|
|
310
|
+
/** `smrt doctor --ai` over the effective config for a tenant. */
|
|
311
|
+
doctor(options?: {
|
|
312
|
+
tenantId?: string | null;
|
|
313
|
+
probe?: boolean;
|
|
314
|
+
env?: Record<string, string | undefined>;
|
|
315
|
+
fetch?: typeof fetch;
|
|
316
|
+
}): Promise<InferenceDoctorReport>;
|
|
317
|
+
/**
|
|
318
|
+
* The app's transcript setting (#4781): effective values, the stored app
|
|
319
|
+
* row, its revert preview, the env override and the retention window.
|
|
320
|
+
* The same for every tenant (no tenant override).
|
|
321
|
+
*/
|
|
322
|
+
getTranscriptSettings(): Promise<InferenceTranscriptSettings>;
|
|
323
|
+
/**
|
|
324
|
+
* Store (or, with `null`, remove) the app's transcript setting. Always
|
|
325
|
+
* the app row: there is no tenant scope. Goes through the authorizer
|
|
326
|
+
* (request `{ binding: 'transcripts', scopeType: 'app' }`); on success the
|
|
327
|
+
* value is installed as core's app settings layer in this process.
|
|
328
|
+
*/
|
|
329
|
+
setTranscriptSettings(request: {
|
|
330
|
+
settings: InferenceTranscriptSettingsValue | null;
|
|
331
|
+
}): Promise<void>;
|
|
332
|
+
/**
|
|
333
|
+
* The Usage tab: `reportAiUsage()` (#4751) grouped by model, tier, prompt
|
|
334
|
+
* key, fusion and/or template hash. Pass `by: ['model']` where tier and
|
|
335
|
+
* prompt tags do not exist yet; NULL dimensions are their own bucket,
|
|
336
|
+
* never dropped. `transcripts: true` adds per-bucket transcript counts
|
|
337
|
+
* (#4781; ids only, never content).
|
|
338
|
+
*/
|
|
339
|
+
usage(options?: {
|
|
340
|
+
by?: InferenceUsageReportDimension[];
|
|
341
|
+
since?: Date;
|
|
342
|
+
until?: Date;
|
|
343
|
+
tenantId?: string | null;
|
|
344
|
+
transcripts?: boolean;
|
|
345
|
+
}): Promise<AiUsageReport>;
|
|
346
|
+
/** Local discovery for the model field (#4674's loopback probe). */
|
|
347
|
+
discoverModels(): Promise<Array<{
|
|
348
|
+
service: string;
|
|
349
|
+
baseUrl: string;
|
|
350
|
+
models: string[];
|
|
351
|
+
}>>;
|
|
352
|
+
/** Provider choices: #4674 presets, then the AI SDK provider list. */
|
|
353
|
+
listProviderOptions(): InferenceProviderOption[];
|
|
354
|
+
}
|
|
355
|
+
//# sourceMappingURL=settings-service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"settings-service.d.ts","sourceRoot":"","sources":["../../src/settings/settings-service.ts"],"names":[],"mappings":"AAYA,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,sBAAsB,EAU3B,KAAK,cAAc,EACnB,KAAK,kBAAkB,EACvB,KAAK,eAAe,EAEpB,KAAK,eAAe,EACpB,KAAK,aAAa,EAClB,KAAK,0BAA0B,EAC/B,KAAK,eAAe,EAGpB,KAAK,gBAAgB,EAEtB,MAAM,0BAA0B,CAAC;AAQlC,OAAO,EACL,2BAA2B,EAC3B,KAAK,0BAA0B,EAChC,MAAM,0CAA0C,CAAC;AAClD,OAAO,EAEL,KAAK,qBAAqB,EAG3B,MAAM,YAAY,CAAC;AACpB,OAAO,KAAK,EA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