@fonoster/autopilot 0.26.0 → 0.30.0
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/README.md +14 -51
- package/dist/index.d.ts +0 -5
- package/dist/index.js +0 -5
- package/dist/knowledge/AbstractKnowledgeBase.d.ts +3 -2
- package/dist/knowledge/AbstractKnowledgeBase.js +2 -7
- package/dist/knowledge/FilesKnowledgeBase.d.ts +1 -1
- package/dist/knowledge/types.d.ts +1 -1
- package/dist/models/LanguageModelFactory.d.ts +5 -24
- package/dist/models/LanguageModelFactory.js +0 -1
- package/dist/models/createLanguageModel.d.ts +2 -2
- package/dist/models/evaluations/createEvalEffectiveConfig.d.ts +10 -106
- package/dist/models/evaluations/createEvalEffectiveConfig.js +47 -7
- package/dist/models/evaluations/createEvaluateIntelligence.d.ts +10 -20
- package/dist/models/evaluations/createEvaluateIntelligence.js +32 -23
- package/dist/models/evaluations/evalTestCases.d.ts +2 -2
- package/dist/models/evaluations/extractAiResponse.d.ts +2 -3
- package/dist/models/evaluations/index.d.ts +1 -0
- package/dist/models/evaluations/index.js +1 -0
- package/dist/models/evaluations/runEval.d.ts +2 -20
- package/dist/models/evaluations/session/EvalSession.d.ts +73 -0
- package/dist/models/evaluations/session/EvalSession.js +134 -0
- package/dist/models/evaluations/session/evaluateSessionScenario.d.ts +58 -0
- package/dist/models/evaluations/session/evaluateSessionScenario.js +182 -0
- package/dist/{vad → models/evaluations/session}/index.d.ts +3 -2
- package/dist/{vad → models/evaluations/session}/index.js +3 -2
- package/dist/models/evaluations/session/runSessionEval.d.ts +17 -0
- package/dist/models/evaluations/session/runSessionEval.js +59 -0
- package/dist/models/evaluations/types.d.ts +7 -6
- package/dist/models/types.d.ts +19 -1
- package/dist/session/Agent.d.ts +138 -0
- package/dist/session/Agent.js +474 -0
- package/dist/{loadAssistantFromAPI.d.ts → session/AsyncQueue.d.ts} +12 -7
- package/dist/session/AsyncQueue.js +67 -0
- package/dist/{machine/guards/index.d.ts → session/config.d.ts} +2 -2
- package/dist/session/config.js +27 -0
- package/dist/session/convertLegacyAssistant.d.ts +77 -0
- package/dist/session/convertLegacyAssistant.js +118 -0
- package/dist/session/createAutopilot.d.ts +47 -0
- package/dist/session/createAutopilot.js +119 -0
- package/dist/session/hosted.d.ts +456 -0
- package/dist/session/hosted.js +506 -0
- package/dist/{assistants → session}/index.d.ts +11 -2
- package/dist/{machine/actors → session}/index.js +11 -3
- package/dist/{machine/actions/appendSpeech.js → session/knowledge.d.ts} +14 -17
- package/dist/session/knowledge.js +10 -0
- package/dist/session/llm.d.ts +86 -0
- package/dist/session/llm.js +83 -0
- package/dist/session/machine.d.ts +206 -0
- package/dist/session/machine.js +126 -0
- package/dist/session/main.js +44 -0
- package/dist/session/sentences.d.ts +5 -0
- package/dist/session/sentences.js +53 -0
- package/dist/{machine/actors/index.d.ts → session/think.d.ts} +2 -3
- package/dist/{machine/actions/announceSystemError.js → session/think.js} +8 -10
- package/dist/session/tools.d.ts +22 -0
- package/dist/session/tools.js +83 -0
- package/dist/tools/builtin/transferToolDefinition.js +1 -1
- package/dist/voice/index.d.ts +0 -1
- package/dist/voice/index.js +0 -1
- package/dist/voice/types.d.ts +5 -18
- package/package.json +13 -14
- package/dist/Autopilot.d.ts +0 -14
- package/dist/Autopilot.js +0 -133
- package/dist/assistants/index.js +0 -36
- package/dist/assistants/loadAndValidateAssistant.d.ts +0 -3
- package/dist/assistants/loadAndValidateAssistant.js +0 -49
- package/dist/assistants/types.d.ts +0 -24
- package/dist/assistants/types.js +0 -2
- package/dist/envs.d.ts +0 -15
- package/dist/envs.js +0 -78
- package/dist/handleVoiceRequest.d.ts +0 -3
- package/dist/handleVoiceRequest.js +0 -167
- package/dist/loadAssistantConfigFromFile.d.ts +0 -3
- package/dist/loadAssistantConfigFromFile.js +0 -68
- package/dist/loadAssistantFromAPI.js +0 -98
- package/dist/machine/actions/announceSystemError.d.ts +0 -4
- package/dist/machine/actions/appendSpeech.d.ts +0 -1
- package/dist/machine/actions/cleanSpeech.d.ts +0 -1
- package/dist/machine/actions/cleanSpeech.js +0 -23
- package/dist/machine/actions/goodbye.d.ts +0 -4
- package/dist/machine/actions/goodbye.js +0 -31
- package/dist/machine/actions/increaseIdleTimeoutCount.d.ts +0 -1
- package/dist/machine/actions/increaseIdleTimeoutCount.js +0 -31
- package/dist/machine/actions/index.d.ts +0 -26
- package/dist/machine/actions/index.js +0 -37
- package/dist/machine/actions/interruptPlayback.d.ts +0 -4
- package/dist/machine/actions/interruptPlayback.js +0 -43
- package/dist/machine/actions/resetIdleTimeoutCount.d.ts +0 -1
- package/dist/machine/actions/resetIdleTimeoutCount.js +0 -31
- package/dist/machine/actions/resetState.d.ts +0 -1
- package/dist/machine/actions/resetState.js +0 -32
- package/dist/machine/actors/doAnnounceIdleTimeout.d.ts +0 -4
- package/dist/machine/actors/doAnnounceIdleTimeout.js +0 -41
- package/dist/machine/actors/doGreetUser.d.ts +0 -4
- package/dist/machine/actors/doGreetUser.js +0 -45
- package/dist/machine/actors/doProcessUserRequest.d.ts +0 -4
- package/dist/machine/actors/doProcessUserRequest.js +0 -75
- package/dist/machine/context.d.ts +0 -52
- package/dist/machine/context.js +0 -28
- package/dist/machine/delays.d.ts +0 -30
- package/dist/machine/delays.js +0 -37
- package/dist/machine/guards/hasSpeechResult.d.ts +0 -4
- package/dist/machine/guards/hasSpeechResult.js +0 -30
- package/dist/machine/guards/idleTimeoutCountExceedsMax.d.ts +0 -4
- package/dist/machine/guards/idleTimeoutCountExceedsMax.js +0 -31
- package/dist/machine/guards/index.js +0 -25
- package/dist/machine/index.d.ts +0 -19
- package/dist/machine/index.js +0 -23
- package/dist/machine/machine.d.ts +0 -408
- package/dist/machine/machine.js +0 -206
- package/dist/machine/setup.d.ts +0 -328
- package/dist/machine/setup.js +0 -116
- package/dist/machine/types.d.ts +0 -54
- package/dist/machine/types.js +0 -2
- package/dist/sendConversationEndedEvent.d.ts +0 -32
- package/dist/sendConversationEndedEvent.js +0 -66
- package/dist/sendConversationStartedEvent.d.ts +0 -6
- package/dist/sendConversationStartedEvent.js +0 -63
- package/dist/server.d.ts +0 -2
- package/dist/server.js +0 -25
- package/dist/types.d.ts +0 -40
- package/dist/types.js +0 -8
- package/dist/vad/SileroVad.d.ts +0 -18
- package/dist/vad/SileroVad.js +0 -40
- package/dist/vad/SileroVadModel.d.ts +0 -14
- package/dist/vad/SileroVadModel.js +0 -83
- package/dist/vad/chunkToFloat32Array.d.ts +0 -20
- package/dist/vad/chunkToFloat32Array.js +0 -34
- package/dist/vad/createVad.d.ts +0 -3
- package/dist/vad/createVad.js +0 -126
- package/dist/vad/types.d.ts +0 -60
- package/dist/vad/types.js +0 -2
- package/dist/vadWorker.js +0 -36
- package/dist/voice/Voice.d.ts +0 -61
- package/dist/voice/Voice.js +0 -96
- package/dist/voiceServerSetup.d.ts +0 -2
- package/dist/voiceServerSetup.js +0 -29
- /package/dist/{vadWorker.d.ts → session/main.d.ts} +0 -0
|
@@ -0,0 +1,456 @@
|
|
|
1
|
+
import { CellSecrets, Registry } from "@fonoster/common";
|
|
2
|
+
import { Session, VoiceServer } from "@fonoster/voice";
|
|
3
|
+
import { z } from "zod";
|
|
4
|
+
import { SessionAssistant } from "./config";
|
|
5
|
+
import { AutopilotOptions, LoadedAssistant } from "./createAutopilot";
|
|
6
|
+
import { KnowledgePort } from "./knowledge";
|
|
7
|
+
import { CredentialSource } from "./llm";
|
|
8
|
+
export declare const hostedConfigSchema: z.ZodObject<{
|
|
9
|
+
host: z.ZodDefault<z.ZodString>;
|
|
10
|
+
port: z.ZodDefault<z.ZodNumber>;
|
|
11
|
+
/**
|
|
12
|
+
* Private destinations HTTP tools may call (host names, IPs, CIDRs; RV-B2); defaults to
|
|
13
|
+
* FONOSTER_ALLOWED_DESTINATIONS.
|
|
14
|
+
*/
|
|
15
|
+
allowedDestinations: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
16
|
+
/** The secret the gateway signs Autopilot sessions with (one for every Autopilot app). */
|
|
17
|
+
signingSecret: z.ZodUnion<[z.ZodObject<{
|
|
18
|
+
env: z.ZodString;
|
|
19
|
+
}, "strict", z.ZodTypeAny, {
|
|
20
|
+
env?: string;
|
|
21
|
+
}, {
|
|
22
|
+
env?: string;
|
|
23
|
+
}>, z.ZodObject<{
|
|
24
|
+
value: z.ZodString;
|
|
25
|
+
}, "strict", z.ZodTypeAny, {
|
|
26
|
+
value?: string;
|
|
27
|
+
}, {
|
|
28
|
+
value?: string;
|
|
29
|
+
}>]>;
|
|
30
|
+
/**
|
|
31
|
+
* The URL Autopilot apps point to, exactly as the apps have it (the apiserver's
|
|
32
|
+
* `apps.autopilotUrl`, e.g. ws://autopilot:3000), or several. Signatures are checked against
|
|
33
|
+
* it, never against the request's Host header.
|
|
34
|
+
*/
|
|
35
|
+
publicUrl: z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>;
|
|
36
|
+
/**
|
|
37
|
+
* Apps and their assistants: a file `{apps: {<appRef>: {workspaceRef?, assistant}}}` (JSON or
|
|
38
|
+
* YAML), or `database`: the apps' Intelligence rows, cached for `cacheMs` (CP-B11).
|
|
39
|
+
*/
|
|
40
|
+
assistants: z.ZodUnion<[z.ZodObject<{
|
|
41
|
+
file: z.ZodString;
|
|
42
|
+
}, "strict", z.ZodTypeAny, {
|
|
43
|
+
file?: string;
|
|
44
|
+
}, {
|
|
45
|
+
file?: string;
|
|
46
|
+
}>, z.ZodObject<{
|
|
47
|
+
source: z.ZodLiteral<"database">;
|
|
48
|
+
cacheMs: z.ZodDefault<z.ZodNumber>;
|
|
49
|
+
}, "strict", z.ZodTypeAny, {
|
|
50
|
+
source?: "database";
|
|
51
|
+
cacheMs?: number;
|
|
52
|
+
}, {
|
|
53
|
+
source?: "database";
|
|
54
|
+
cacheMs?: number;
|
|
55
|
+
}>]>;
|
|
56
|
+
/** The provider registry's catalog: the JSON file fonoster-registry writes, or the tables. */
|
|
57
|
+
registry: z.ZodUnion<[z.ZodObject<{
|
|
58
|
+
file: z.ZodString;
|
|
59
|
+
}, "strict", z.ZodTypeAny, {
|
|
60
|
+
file?: string;
|
|
61
|
+
}, {
|
|
62
|
+
file?: string;
|
|
63
|
+
}>, z.ZodObject<{
|
|
64
|
+
source: z.ZodLiteral<"database">;
|
|
65
|
+
refreshMs: z.ZodDefault<z.ZodNumber>;
|
|
66
|
+
}, "strict", z.ZodTypeAny, {
|
|
67
|
+
source?: "database";
|
|
68
|
+
refreshMs?: number;
|
|
69
|
+
}, {
|
|
70
|
+
source?: "database";
|
|
71
|
+
refreshMs?: number;
|
|
72
|
+
}>]>;
|
|
73
|
+
/** Platform keys by credentialRef. */
|
|
74
|
+
credentials: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodObject<{
|
|
75
|
+
env: z.ZodString;
|
|
76
|
+
}, "strict", z.ZodTypeAny, {
|
|
77
|
+
env?: string;
|
|
78
|
+
}, {
|
|
79
|
+
env?: string;
|
|
80
|
+
}>, z.ZodObject<{
|
|
81
|
+
value: z.ZodString;
|
|
82
|
+
}, "strict", z.ZodTypeAny, {
|
|
83
|
+
value?: string;
|
|
84
|
+
}, {
|
|
85
|
+
value?: string;
|
|
86
|
+
}>]>>>;
|
|
87
|
+
/**
|
|
88
|
+
* Workspace Secrets (bring your own key): a JSON file by workspace and credentialRef, or
|
|
89
|
+
* `database`: the workspace's vendor keys (workspace_provider_keys).
|
|
90
|
+
*/
|
|
91
|
+
workspaceSecrets: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
|
|
92
|
+
file: z.ZodString;
|
|
93
|
+
}, "strict", z.ZodTypeAny, {
|
|
94
|
+
file?: string;
|
|
95
|
+
}, {
|
|
96
|
+
file?: string;
|
|
97
|
+
}>, z.ZodObject<{
|
|
98
|
+
source: z.ZodLiteral<"database">;
|
|
99
|
+
}, "strict", z.ZodTypeAny, {
|
|
100
|
+
source?: "database";
|
|
101
|
+
}, {
|
|
102
|
+
source?: "database";
|
|
103
|
+
}>, z.ZodObject<{
|
|
104
|
+
cellSecrets: z.ZodObject<{
|
|
105
|
+
file: z.ZodOptional<z.ZodString>;
|
|
106
|
+
dir: z.ZodOptional<z.ZodString>;
|
|
107
|
+
keyEnv: z.ZodOptional<z.ZodString>;
|
|
108
|
+
}, "strict", z.ZodTypeAny, {
|
|
109
|
+
file?: string;
|
|
110
|
+
dir?: string;
|
|
111
|
+
keyEnv?: string;
|
|
112
|
+
}, {
|
|
113
|
+
file?: string;
|
|
114
|
+
dir?: string;
|
|
115
|
+
keyEnv?: string;
|
|
116
|
+
}>;
|
|
117
|
+
}, "strict", z.ZodTypeAny, {
|
|
118
|
+
cellSecrets?: {
|
|
119
|
+
file?: string;
|
|
120
|
+
dir?: string;
|
|
121
|
+
keyEnv?: string;
|
|
122
|
+
};
|
|
123
|
+
}, {
|
|
124
|
+
cellSecrets?: {
|
|
125
|
+
file?: string;
|
|
126
|
+
dir?: string;
|
|
127
|
+
keyEnv?: string;
|
|
128
|
+
};
|
|
129
|
+
}>]>>;
|
|
130
|
+
/**
|
|
131
|
+
* The control-plane database (the apiserver's), for any `source: database`. The URL comes
|
|
132
|
+
* from this file only, usually as a placeholder: `url: "${APISERVER_DATABASE_URL}"`.
|
|
133
|
+
*/
|
|
134
|
+
database: z.ZodOptional<z.ZodObject<{
|
|
135
|
+
url: z.ZodString;
|
|
136
|
+
/** A client generated from the apiserver schema (default `@prisma/client`). */
|
|
137
|
+
clientModule: z.ZodOptional<z.ZodString>;
|
|
138
|
+
}, "strict", z.ZodTypeAny, {
|
|
139
|
+
url?: string;
|
|
140
|
+
clientModule?: string;
|
|
141
|
+
}, {
|
|
142
|
+
url?: string;
|
|
143
|
+
clientModule?: string;
|
|
144
|
+
}>>;
|
|
145
|
+
/** Endpoint overrides by adapter or provider id (e.g. a local ollama, the fake LLM). */
|
|
146
|
+
endpoints: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
147
|
+
/** The S3 + Unstructured knowledge bases; keys by credentialRef (task 4.1). */
|
|
148
|
+
knowledge: z.ZodOptional<z.ZodObject<{
|
|
149
|
+
s3: z.ZodObject<{
|
|
150
|
+
endpoint: z.ZodString;
|
|
151
|
+
region: z.ZodDefault<z.ZodString>;
|
|
152
|
+
accessKeyIdRef: z.ZodString;
|
|
153
|
+
secretAccessKeyRef: z.ZodString;
|
|
154
|
+
}, "strip", z.ZodTypeAny, {
|
|
155
|
+
endpoint?: string;
|
|
156
|
+
region?: string;
|
|
157
|
+
accessKeyIdRef?: string;
|
|
158
|
+
secretAccessKeyRef?: string;
|
|
159
|
+
}, {
|
|
160
|
+
endpoint?: string;
|
|
161
|
+
region?: string;
|
|
162
|
+
accessKeyIdRef?: string;
|
|
163
|
+
secretAccessKeyRef?: string;
|
|
164
|
+
}>;
|
|
165
|
+
unstructured: z.ZodObject<{
|
|
166
|
+
url: z.ZodString;
|
|
167
|
+
apiKeyRef: z.ZodString;
|
|
168
|
+
}, "strip", z.ZodTypeAny, {
|
|
169
|
+
url?: string;
|
|
170
|
+
apiKeyRef?: string;
|
|
171
|
+
}, {
|
|
172
|
+
url?: string;
|
|
173
|
+
apiKeyRef?: string;
|
|
174
|
+
}>;
|
|
175
|
+
embeddings: z.ZodObject<{
|
|
176
|
+
apiKeyRef: z.ZodString;
|
|
177
|
+
}, "strip", z.ZodTypeAny, {
|
|
178
|
+
apiKeyRef?: string;
|
|
179
|
+
}, {
|
|
180
|
+
apiKeyRef?: string;
|
|
181
|
+
}>;
|
|
182
|
+
}, "strip", z.ZodTypeAny, {
|
|
183
|
+
s3?: {
|
|
184
|
+
endpoint?: string;
|
|
185
|
+
region?: string;
|
|
186
|
+
accessKeyIdRef?: string;
|
|
187
|
+
secretAccessKeyRef?: string;
|
|
188
|
+
};
|
|
189
|
+
unstructured?: {
|
|
190
|
+
url?: string;
|
|
191
|
+
apiKeyRef?: string;
|
|
192
|
+
};
|
|
193
|
+
embeddings?: {
|
|
194
|
+
apiKeyRef?: string;
|
|
195
|
+
};
|
|
196
|
+
}, {
|
|
197
|
+
s3?: {
|
|
198
|
+
endpoint?: string;
|
|
199
|
+
region?: string;
|
|
200
|
+
accessKeyIdRef?: string;
|
|
201
|
+
secretAccessKeyRef?: string;
|
|
202
|
+
};
|
|
203
|
+
unstructured?: {
|
|
204
|
+
url?: string;
|
|
205
|
+
apiKeyRef?: string;
|
|
206
|
+
};
|
|
207
|
+
embeddings?: {
|
|
208
|
+
apiKeyRef?: string;
|
|
209
|
+
};
|
|
210
|
+
}>>;
|
|
211
|
+
/**
|
|
212
|
+
* The apiserver's encryption key (fonoster.yaml `encryption.key`; vendor keys are encrypted
|
|
213
|
+
* Secrets). Usually "${ENCRYPTION_KEY}".
|
|
214
|
+
*/
|
|
215
|
+
encryption: z.ZodOptional<z.ZodObject<{
|
|
216
|
+
key: z.ZodString;
|
|
217
|
+
}, "strict", z.ZodTypeAny, {
|
|
218
|
+
key?: string;
|
|
219
|
+
}, {
|
|
220
|
+
key?: string;
|
|
221
|
+
}>>;
|
|
222
|
+
/** OTLP export (empty = off): `otlpEndpoint: "${OTEL_EXPORTER_OTLP_ENDPOINT:-}"`. */
|
|
223
|
+
telemetry: z.ZodOptional<z.ZodObject<{
|
|
224
|
+
otlpEndpoint: z.ZodOptional<z.ZodString>;
|
|
225
|
+
}, "strip", z.ZodTypeAny, {
|
|
226
|
+
otlpEndpoint?: string;
|
|
227
|
+
}, {
|
|
228
|
+
otlpEndpoint?: string;
|
|
229
|
+
}>>;
|
|
230
|
+
testMode: z.ZodDefault<z.ZodBoolean>;
|
|
231
|
+
}, "strict", z.ZodTypeAny, {
|
|
232
|
+
registry?: {
|
|
233
|
+
file?: string;
|
|
234
|
+
} | {
|
|
235
|
+
source?: "database";
|
|
236
|
+
refreshMs?: number;
|
|
237
|
+
};
|
|
238
|
+
host?: string;
|
|
239
|
+
port?: number;
|
|
240
|
+
allowedDestinations?: string[];
|
|
241
|
+
signingSecret?: {
|
|
242
|
+
env?: string;
|
|
243
|
+
} | {
|
|
244
|
+
value?: string;
|
|
245
|
+
};
|
|
246
|
+
publicUrl?: string | string[];
|
|
247
|
+
assistants?: {
|
|
248
|
+
file?: string;
|
|
249
|
+
} | {
|
|
250
|
+
source?: "database";
|
|
251
|
+
cacheMs?: number;
|
|
252
|
+
};
|
|
253
|
+
database?: {
|
|
254
|
+
url?: string;
|
|
255
|
+
clientModule?: string;
|
|
256
|
+
};
|
|
257
|
+
credentials?: Record<string, {
|
|
258
|
+
env?: string;
|
|
259
|
+
} | {
|
|
260
|
+
value?: string;
|
|
261
|
+
}>;
|
|
262
|
+
workspaceSecrets?: {
|
|
263
|
+
file?: string;
|
|
264
|
+
} | {
|
|
265
|
+
source?: "database";
|
|
266
|
+
} | {
|
|
267
|
+
cellSecrets?: {
|
|
268
|
+
file?: string;
|
|
269
|
+
dir?: string;
|
|
270
|
+
keyEnv?: string;
|
|
271
|
+
};
|
|
272
|
+
};
|
|
273
|
+
endpoints?: Record<string, string>;
|
|
274
|
+
knowledge?: {
|
|
275
|
+
s3?: {
|
|
276
|
+
endpoint?: string;
|
|
277
|
+
region?: string;
|
|
278
|
+
accessKeyIdRef?: string;
|
|
279
|
+
secretAccessKeyRef?: string;
|
|
280
|
+
};
|
|
281
|
+
unstructured?: {
|
|
282
|
+
url?: string;
|
|
283
|
+
apiKeyRef?: string;
|
|
284
|
+
};
|
|
285
|
+
embeddings?: {
|
|
286
|
+
apiKeyRef?: string;
|
|
287
|
+
};
|
|
288
|
+
};
|
|
289
|
+
encryption?: {
|
|
290
|
+
key?: string;
|
|
291
|
+
};
|
|
292
|
+
telemetry?: {
|
|
293
|
+
otlpEndpoint?: string;
|
|
294
|
+
};
|
|
295
|
+
testMode?: boolean;
|
|
296
|
+
}, {
|
|
297
|
+
registry?: {
|
|
298
|
+
file?: string;
|
|
299
|
+
} | {
|
|
300
|
+
source?: "database";
|
|
301
|
+
refreshMs?: number;
|
|
302
|
+
};
|
|
303
|
+
host?: string;
|
|
304
|
+
port?: number;
|
|
305
|
+
allowedDestinations?: string[];
|
|
306
|
+
signingSecret?: {
|
|
307
|
+
env?: string;
|
|
308
|
+
} | {
|
|
309
|
+
value?: string;
|
|
310
|
+
};
|
|
311
|
+
publicUrl?: string | string[];
|
|
312
|
+
assistants?: {
|
|
313
|
+
file?: string;
|
|
314
|
+
} | {
|
|
315
|
+
source?: "database";
|
|
316
|
+
cacheMs?: number;
|
|
317
|
+
};
|
|
318
|
+
database?: {
|
|
319
|
+
url?: string;
|
|
320
|
+
clientModule?: string;
|
|
321
|
+
};
|
|
322
|
+
credentials?: Record<string, {
|
|
323
|
+
env?: string;
|
|
324
|
+
} | {
|
|
325
|
+
value?: string;
|
|
326
|
+
}>;
|
|
327
|
+
workspaceSecrets?: {
|
|
328
|
+
file?: string;
|
|
329
|
+
} | {
|
|
330
|
+
source?: "database";
|
|
331
|
+
} | {
|
|
332
|
+
cellSecrets?: {
|
|
333
|
+
file?: string;
|
|
334
|
+
dir?: string;
|
|
335
|
+
keyEnv?: string;
|
|
336
|
+
};
|
|
337
|
+
};
|
|
338
|
+
endpoints?: Record<string, string>;
|
|
339
|
+
knowledge?: {
|
|
340
|
+
s3?: {
|
|
341
|
+
endpoint?: string;
|
|
342
|
+
region?: string;
|
|
343
|
+
accessKeyIdRef?: string;
|
|
344
|
+
secretAccessKeyRef?: string;
|
|
345
|
+
};
|
|
346
|
+
unstructured?: {
|
|
347
|
+
url?: string;
|
|
348
|
+
apiKeyRef?: string;
|
|
349
|
+
};
|
|
350
|
+
embeddings?: {
|
|
351
|
+
apiKeyRef?: string;
|
|
352
|
+
};
|
|
353
|
+
};
|
|
354
|
+
encryption?: {
|
|
355
|
+
key?: string;
|
|
356
|
+
};
|
|
357
|
+
telemetry?: {
|
|
358
|
+
otlpEndpoint?: string;
|
|
359
|
+
};
|
|
360
|
+
testMode?: boolean;
|
|
361
|
+
}>;
|
|
362
|
+
export type HostedConfig = z.infer<typeof hostedConfigSchema>;
|
|
363
|
+
/** Where Autopilot looks for its file when none is named (autopilot.yaml, then the older name). */
|
|
364
|
+
export declare const AUTOPILOT_CONFIG_DIRS: string[];
|
|
365
|
+
/** The file `loadHostedConfig` reads without `--config`: the first one found, or undefined. */
|
|
366
|
+
export declare function findHostedConfig(): string | undefined;
|
|
367
|
+
/**
|
|
368
|
+
* Loads the hosted Autopilot's file the apiserver's way (unify-config-placeholders): `${VAR}`
|
|
369
|
+
* placeholders from the container environment, `secret://` references, strict validation.
|
|
370
|
+
*/
|
|
371
|
+
export declare function loadHostedConfig(file: string, env?: Record<string, string | undefined>): HostedConfig;
|
|
372
|
+
/** Apps and assistants from a file (a stand-in until assistants come from the control plane). */
|
|
373
|
+
export declare class FileAssistantSource {
|
|
374
|
+
private readonly file;
|
|
375
|
+
constructor(file: string);
|
|
376
|
+
get(appRef: string): Promise<LoadedAssistant | undefined>;
|
|
377
|
+
}
|
|
378
|
+
/**
|
|
379
|
+
* Assistants from the control plane: an Autopilot app's Intelligence row holds its assistant
|
|
380
|
+
* (CP-B3). Each app is cached for `cacheMs` (misses too), so edits show up within seconds.
|
|
381
|
+
*/
|
|
382
|
+
export declare class PrismaAssistantSource {
|
|
383
|
+
private readonly prisma;
|
|
384
|
+
private readonly options;
|
|
385
|
+
private cache;
|
|
386
|
+
constructor(prisma: any, options?: {
|
|
387
|
+
cacheMs?: number;
|
|
388
|
+
now?: () => number;
|
|
389
|
+
});
|
|
390
|
+
get(appRef: string): Promise<LoadedAssistant | undefined>;
|
|
391
|
+
}
|
|
392
|
+
/** Workspace vendor keys from the database, looked up by the credentialRef's providers. */
|
|
393
|
+
export declare class DatabaseWorkspaceSecrets implements CredentialSource {
|
|
394
|
+
private readonly keys;
|
|
395
|
+
private readonly providers;
|
|
396
|
+
constructor(keys: Registry.PrismaWorkspaceKeys, providers: () => {
|
|
397
|
+
id: string;
|
|
398
|
+
credentialRef: string;
|
|
399
|
+
}[]);
|
|
400
|
+
get(ref: string, scope: {
|
|
401
|
+
workspaceRef?: string;
|
|
402
|
+
}): Promise<string>;
|
|
403
|
+
}
|
|
404
|
+
/** A private region's cell secrets (PR-4): keys never leave the cell. */
|
|
405
|
+
export declare class CellSecretCredentials implements CredentialSource {
|
|
406
|
+
private readonly keys;
|
|
407
|
+
private readonly providers;
|
|
408
|
+
constructor(keys: CellSecrets.CellSecretKeys, providers: () => {
|
|
409
|
+
id: string;
|
|
410
|
+
credentialRef: string;
|
|
411
|
+
}[]);
|
|
412
|
+
get(ref: string): string;
|
|
413
|
+
}
|
|
414
|
+
/** Workspace Secrets from a JSON file: `{<workspaceRef>: {<credentialRef>: value}}`. */
|
|
415
|
+
export declare class FileWorkspaceSecrets implements CredentialSource {
|
|
416
|
+
private readonly file;
|
|
417
|
+
constructor(file: string);
|
|
418
|
+
get(ref: string, scope: {
|
|
419
|
+
workspaceRef?: string;
|
|
420
|
+
}): string;
|
|
421
|
+
}
|
|
422
|
+
type KnowledgeBaseLike = {
|
|
423
|
+
load(): Promise<void>;
|
|
424
|
+
queryKnowledgeBase(query: string, k?: number): Promise<string>;
|
|
425
|
+
};
|
|
426
|
+
/**
|
|
427
|
+
* Builds the knowledge port for an assistant from the operator's S3 + Unstructured settings,
|
|
428
|
+
* with keys from the credential source (never Autopilot's environment). The bucket is the
|
|
429
|
+
* workspace's, as today. `make` is the knowledge base constructor (the S3 one by default).
|
|
430
|
+
*/
|
|
431
|
+
export declare function s3Knowledge(config: NonNullable<HostedConfig["knowledge"]>, credentials: CredentialSource, make?: (params: Record<string, unknown>) => KnowledgeBaseLike): (assistant: SessionAssistant, scope: {
|
|
432
|
+
workspaceRef?: string;
|
|
433
|
+
}) => Promise<KnowledgePort | undefined>;
|
|
434
|
+
/** The handler options the hosted Autopilot runs with, built from its config. */
|
|
435
|
+
export declare function hostedOptions(config: HostedConfig, deps?: {
|
|
436
|
+
prisma?: any;
|
|
437
|
+
}): AutopilotOptions;
|
|
438
|
+
/**
|
|
439
|
+
* One knowledge port per call, built eagerly; a lookup waits for it (and gives up after 800 ms
|
|
440
|
+
* like any). A port that fails to build is logged and answers nothing: the eager promise always
|
|
441
|
+
* has a handler, so a failure never becomes an unhandled rejection (RV-B5).
|
|
442
|
+
*/
|
|
443
|
+
export declare function eagerKnowledge(build: (assistant: SessionAssistant, scope: {
|
|
444
|
+
workspaceRef?: string;
|
|
445
|
+
}) => Promise<KnowledgePort | undefined>): (assistant: SessionAssistant, scope: {
|
|
446
|
+
workspaceRef?: string;
|
|
447
|
+
}) => KnowledgePort;
|
|
448
|
+
/**
|
|
449
|
+
* The app's assistant only when the app belongs to the workspace the gateway signed for: one
|
|
450
|
+
* secret serves every Autopilot app, so a session is bound to its app and workspace
|
|
451
|
+
* (voice-session, "Connection requests are bound to the app").
|
|
452
|
+
*/
|
|
453
|
+
export declare function signedWorkspaceOnly(session: Pick<Session, "appRef" | "signedFor">, loaded: LoadedAssistant | undefined): LoadedAssistant | undefined;
|
|
454
|
+
/** Starts the hosted Autopilot. */
|
|
455
|
+
export declare function startHostedAutopilot(config: HostedConfig): Promise<VoiceServer>;
|
|
456
|
+
export {};
|