@hanzo/rooms 0.1.53 → 0.1.54
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/dist/lib/ai.d.ts +4 -1
- package/dist/lib/ai.js +12 -21
- package/package.json +1 -1
package/dist/lib/ai.d.ts
CHANGED
|
@@ -18,7 +18,10 @@ export declare const FREE = "enso-free";
|
|
|
18
18
|
/** Enso routes a signed-in turn: enso-auto when logged in. */
|
|
19
19
|
export declare const ENSO = "enso-auto";
|
|
20
20
|
/**
|
|
21
|
-
* The model that will actually ANSWER, given what the gateway serves
|
|
21
|
+
* The model that will actually ANSWER, given what the gateway serves: the one
|
|
22
|
+
* asked for when the gateway serves it, else the free pool for a free turn,
|
|
23
|
+
* else a house router (Enso or Zen), else the first model served. An id is read
|
|
24
|
+
* by its own name; one the gateway does not serve is never relabelled.
|
|
22
25
|
*/
|
|
23
26
|
export declare function served(models: {
|
|
24
27
|
id: string;
|
package/dist/lib/ai.js
CHANGED
|
@@ -46,31 +46,22 @@ export const FREE = 'enso-free';
|
|
|
46
46
|
/** Enso routes a signed-in turn: enso-auto when logged in. */
|
|
47
47
|
export const ENSO = 'enso-auto';
|
|
48
48
|
/**
|
|
49
|
-
* The model that will actually ANSWER, given what the gateway serves
|
|
49
|
+
* The model that will actually ANSWER, given what the gateway serves: the one
|
|
50
|
+
* asked for when the gateway serves it, else the free pool for a free turn,
|
|
51
|
+
* else a house router (Enso or Zen), else the first model served. An id is read
|
|
52
|
+
* by its own name; one the gateway does not serve is never relabelled.
|
|
50
53
|
*/
|
|
51
54
|
export function served(models, prefer) {
|
|
52
|
-
const cleanPrefer = prefer === 'openrouter/auto' || prefer?.includes('openrouter') ? 'enso-auto' : prefer;
|
|
53
55
|
if (models.length === 0)
|
|
54
|
-
return
|
|
55
|
-
if (
|
|
56
|
-
return
|
|
57
|
-
if (
|
|
58
|
-
|
|
59
|
-
if (free)
|
|
60
|
-
return free.id;
|
|
61
|
-
return 'enso-free';
|
|
56
|
+
return prefer || ENSO;
|
|
57
|
+
if (prefer && models.some((m) => m.id === prefer))
|
|
58
|
+
return prefer;
|
|
59
|
+
if (prefer === FREE || prefer === 'free' || prefer?.includes('free')) {
|
|
60
|
+
return models.find((m) => m.id === FREE || m.id === 'zen-free')?.id ?? FREE;
|
|
62
61
|
}
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
return houseAuto.id;
|
|
67
|
-
const houseModel = models.find((m) => (m.id.startsWith('enso') || m.id.startsWith('zen')) && !m.id.includes('openrouter'));
|
|
68
|
-
if (houseModel)
|
|
69
|
-
return houseModel.id;
|
|
70
|
-
const clean = models.find((m) => !m.id.includes('openrouter'));
|
|
71
|
-
if (clean)
|
|
72
|
-
return clean.id;
|
|
73
|
-
return 'enso-auto';
|
|
62
|
+
const house = models.find((m) => m.id === ENSO || m.id === 'zen-auto' || m.id === 'enso' || m.id === 'zen') ??
|
|
63
|
+
models.find((m) => m.id.startsWith('enso') || m.id.startsWith('zen'));
|
|
64
|
+
return house?.id ?? models[0].id;
|
|
74
65
|
}
|
|
75
66
|
/**
|
|
76
67
|
* The gateway's address in the shape `createAiClient` takes it.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hanzo/rooms",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.54",
|
|
4
4
|
"description": "The workspace rooms — Home, Chat, Inbox, Contacts, Meet, Cal, Drive, Board, Work, Bots — and the frame that holds them, once, for every Hanzo surface.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|