@vellumai/assistant 0.10.10-staging.1 → 0.10.10-staging.2
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/package.json +1 -1
- package/src/__tests__/call-controller.test.ts +291 -0
- package/src/__tests__/call-site-routing-connection-auto-resolve.test.ts +165 -0
- package/src/__tests__/media-stream-output.test.ts +259 -3
- package/src/__tests__/media-stream-server-integration.test.ts +22 -1
- package/src/__tests__/media-stream-stt-session.test.ts +47 -0
- package/src/__tests__/provider-connections-backfill.test.ts +138 -0
- package/src/calls/call-constants.ts +5 -0
- package/src/calls/call-controller.ts +100 -32
- package/src/calls/call-transport.ts +9 -0
- package/src/calls/media-stream-output.ts +107 -4
- package/src/calls/media-stream-server.ts +29 -9
- package/src/calls/media-stream-stt-session.ts +7 -1
- package/src/cli/commands/__tests__/notifications.test.ts +24 -3
- package/src/cli/commands/notifications.help.ts +10 -10
- package/src/cli/commands/oauth/connect-surface-guidance.test.ts +40 -0
- package/src/cli/commands/oauth/connect-surface-guidance.ts +54 -0
- package/src/cli/commands/oauth/connect.test.ts +126 -0
- package/src/cli/commands/oauth/connect.ts +29 -6
- package/src/cli/commands/oauth/index.help.ts +7 -1
- package/src/cli/commands/oauth/status.test.ts +69 -3
- package/src/cli/commands/oauth/status.ts +50 -12
- package/src/providers/call-site-routing.ts +19 -10
- package/src/providers/inference/backfill.ts +36 -1
- package/src/runtime/routes/__tests__/conversation-query-routes.test.ts +82 -0
- package/src/runtime/routes/conversation-query-routes.ts +50 -0
|
@@ -29,6 +29,7 @@ import {
|
|
|
29
29
|
LatencyBreakdownSchema,
|
|
30
30
|
LLMRequestLogEntrySchema,
|
|
31
31
|
} from "../../api/responses/llm-request-log-entry.js";
|
|
32
|
+
import { CALL_SITE_DEFAULTS } from "../../config/call-site-defaults.js";
|
|
32
33
|
import {
|
|
33
34
|
deepMergeOverwrite,
|
|
34
35
|
fillContextDefaultsForMissingKeys,
|
|
@@ -46,6 +47,7 @@ import { AssistantConfigSchema } from "../../config/schema.js";
|
|
|
46
47
|
import { getSchemaAtPath } from "../../config/schema-utils.js";
|
|
47
48
|
import {
|
|
48
49
|
DefaultProviderSchema,
|
|
50
|
+
type LLMCallSite,
|
|
49
51
|
LLMConfigBase,
|
|
50
52
|
LLMConfigFragment,
|
|
51
53
|
ProfileEntry,
|
|
@@ -892,6 +894,53 @@ function stripWireOnlyProfileKeys(patch: unknown): void {
|
|
|
892
894
|
}
|
|
893
895
|
}
|
|
894
896
|
|
|
897
|
+
/**
|
|
898
|
+
* Backfill shipped call-site tuning into NEWLY created `llm.callSites`
|
|
899
|
+
* entries in a config-write fragment, in place.
|
|
900
|
+
*
|
|
901
|
+
* The resolver's tweak layer is `llm.callSites[id] ?? CALL_SITE_DEFAULTS[id]`
|
|
902
|
+
* — an explicit entry replaces the shipped default wholesale. Workspace
|
|
903
|
+
* migrations that materialize entries therefore mirror the shipped tuning
|
|
904
|
+
* exactly (see 090-memory-router-cost-optimized-profile); a client writing a
|
|
905
|
+
* bare `{ profile }` for a site it has no entry for would silently drop
|
|
906
|
+
* shipped knobs like `memoryRouter`'s 1M input window or `recall`'s token/
|
|
907
|
+
* effort bounds. Enforce the same invariant here: when a patch creates an
|
|
908
|
+
* entry, copy in any shipped tuning key the patch doesn't set itself.
|
|
909
|
+
*
|
|
910
|
+
* `profile` is never backfilled — it is the selection discriminator, and
|
|
911
|
+
* stamping it onto a custom provider/model entry would change winner
|
|
912
|
+
* selection. Existing on-disk entries are never touched: deep-merge already
|
|
913
|
+
* preserves their keys, and their values may be deliberate customization.
|
|
914
|
+
*/
|
|
915
|
+
function backfillNewCallSiteEntries(
|
|
916
|
+
raw: Record<string, unknown>,
|
|
917
|
+
patch: unknown,
|
|
918
|
+
): void {
|
|
919
|
+
const patchSites = readPlainObject(
|
|
920
|
+
readPlainObject(readPlainObject(patch)?.llm)?.callSites,
|
|
921
|
+
);
|
|
922
|
+
if (!patchSites) {
|
|
923
|
+
return;
|
|
924
|
+
}
|
|
925
|
+
const rawSites = readPlainObject(readPlainObject(raw.llm)?.callSites);
|
|
926
|
+
for (const [id, value] of Object.entries(patchSites)) {
|
|
927
|
+
const entry = readPlainObject(value);
|
|
928
|
+
if (!entry || rawSites?.[id] != null) {
|
|
929
|
+
continue;
|
|
930
|
+
}
|
|
931
|
+
const shipped = CALL_SITE_DEFAULTS[id as LLMCallSite];
|
|
932
|
+
if (!shipped) {
|
|
933
|
+
continue;
|
|
934
|
+
}
|
|
935
|
+
for (const [key, shippedValue] of Object.entries(shipped)) {
|
|
936
|
+
if (key === "profile" || key in entry) {
|
|
937
|
+
continue;
|
|
938
|
+
}
|
|
939
|
+
entry[key] = structuredClone(shippedValue);
|
|
940
|
+
}
|
|
941
|
+
}
|
|
942
|
+
}
|
|
943
|
+
|
|
895
944
|
/**
|
|
896
945
|
* Normalize managed default-profile entries in a config-write fragment, in
|
|
897
946
|
* place, so a `config get` → write round-trip of the enriched wire view is a
|
|
@@ -1368,6 +1417,7 @@ async function handlePatchConfig({ body }: RouteHandlerArgs) {
|
|
|
1368
1417
|
|
|
1369
1418
|
const raw = loadRawConfig();
|
|
1370
1419
|
const patch = body as Record<string, unknown>;
|
|
1420
|
+
backfillNewCallSiteEntries(raw, patch);
|
|
1371
1421
|
deepMergeOverwrite(raw, patch);
|
|
1372
1422
|
|
|
1373
1423
|
await commitConfigWrite(raw, "patch");
|