@ai-matrx/agents 0.59.271 → 0.59.272
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/CHANGELOG.md +12 -2
- package/context/rules-corpus.json +238 -0
- package/dist/models/index.cjs +29 -11
- package/dist/models/index.d.cts +19 -6
- package/dist/models/index.d.ts +19 -6
- package/dist/models/index.js +29 -11
- package/dist/models/react/index.d.cts +1 -1
- package/dist/models/react/index.d.ts +1 -1
- package/dist/settings/index.cjs +11 -3
- package/dist/settings/index.d.cts +12 -6
- package/dist/settings/index.d.ts +12 -6
- package/dist/settings/index.js +11 -3
- package/package.json +4 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,9 +1,19 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.59.272
|
|
4
|
+
|
|
5
|
+
- New export `./context/rules-corpus.json` (shipped in `files`): the context-rules parity corpus, so a consumer test (chat) reads it through the dependency instead of a path into this package. Additive; no consumer action required.
|
|
6
|
+
|
|
7
|
+
- `./settings`: `reasoning_effort` leaves `AUTO_MEANS_UNSET_KEYS` — a person's "auto" is saved and
|
|
8
|
+
sent (owner ruling 2026-10-24: unset effort runs at the platform default "low"; "auto" only when a
|
|
9
|
+
person picks it). New `NEVER_IMPLICIT_AUTO_KEYS` + `isNeverImplicitChoice`; `startingValueFor`
|
|
10
|
+
never starts a row at "auto". Consumer action: none beyond adopting latest — every writer reads
|
|
11
|
+
`isUnsetChoice` already.
|
|
12
|
+
|
|
3
13
|
## 0.59.271
|
|
4
14
|
|
|
5
|
-
|
|
6
|
-
|
|
15
|
+
Automatic changed-only republish (docs/metadata drift since the last published version; verified: `git diff 8a4ed656ea 2c48e64133 -- apps/shared/matrx-agents/src`
|
|
16
|
+
has no shipped-source changes outside tests, fixtures and docs). No consumer action required.
|
|
7
17
|
|
|
8
18
|
## 0.59.270
|
|
9
19
|
|
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 1,
|
|
3
|
+
"about": "THE parity corpus for context value rules (common-docs/systems/data/scopes-context/context-delivery/RULES.md). Run by the package vitest (context/rules.test.ts) AND aidream pytest (tests/test_context_rules_corpus.py). Expectations are hand-derived from RULES.md section 2 — never regenerate them from either implementation.",
|
|
4
|
+
"defaults": { "cap": 50000 },
|
|
5
|
+
"rules_cases": [
|
|
6
|
+
{ "name": "bare value under default", "input": { "chars": 150 }, "expect": { "include": true, "max_inline_chars": 200, "delivery": "inline", "decided_by": { "include": "default", "max_inline_chars": "default" }, "clamped": false } },
|
|
7
|
+
{ "name": "bare value at the default is inline (<=)", "input": { "chars": 200 }, "expect": { "include": true, "max_inline_chars": 200, "delivery": "inline", "decided_by": { "include": "default", "max_inline_chars": "default" }, "clamped": false } },
|
|
8
|
+
{ "name": "bare value one over the default", "input": { "chars": 201 }, "expect": { "include": true, "max_inline_chars": 200, "delivery": "on_request", "decided_by": { "include": "default", "max_inline_chars": "default" }, "clamped": false } },
|
|
9
|
+
{ "name": "unresolved lazy source is on request", "input": { "chars": null }, "expect": { "include": true, "max_inline_chars": 200, "delivery": "on_request", "decided_by": { "include": "default", "max_inline_chars": "default" }, "clamped": false } },
|
|
10
|
+
{ "name": "server per-key default (small lazy document)", "input": { "default_max": 6000, "chars": 5000 }, "expect": { "include": true, "max_inline_chars": 6000, "delivery": "inline", "decided_by": { "include": "default", "max_inline_chars": "default" }, "clamped": false } },
|
|
11
|
+
{ "name": "server per-key default zero (IDE diagnostics)", "input": { "default_max": 0, "chars": 10 }, "expect": { "include": true, "max_inline_chars": 0, "delivery": "on_request", "decided_by": { "include": "default", "max_inline_chars": "default" }, "clamped": false } },
|
|
12
|
+
{ "name": "page limit raises the default", "input": { "surface": { "declared": true, "auto_context": true, "max_inline_chars": 8000 }, "chars": 7000 }, "expect": { "include": true, "max_inline_chars": 8000, "delivery": "inline", "decided_by": { "include": "default", "max_inline_chars": "page" }, "clamped": false } },
|
|
13
|
+
{ "name": "agent ceiling below page limit wins", "input": { "agent": { "declared": true, "max_inline_chars": 1000 }, "surface": { "declared": true, "auto_context": true, "max_inline_chars": 8000 }, "chars": 5000 }, "expect": { "include": true, "max_inline_chars": 1000, "delivery": "on_request", "decided_by": { "include": "default", "max_inline_chars": "agent" }, "clamped": false } },
|
|
14
|
+
{ "name": "page limit below agent ceiling wins", "input": { "agent": { "declared": true, "max_inline_chars": 1000 }, "surface": { "declared": true, "auto_context": true, "max_inline_chars": 500 }, "chars": 400 }, "expect": { "include": true, "max_inline_chars": 500, "delivery": "inline", "decided_by": { "include": "default", "max_inline_chars": "page" }, "clamped": false } },
|
|
15
|
+
{ "name": "agent and page tie — agent named", "input": { "agent": { "declared": true, "max_inline_chars": 1000 }, "surface": { "declared": true, "auto_context": true, "max_inline_chars": 1000 }, "chars": 1000 }, "expect": { "include": true, "max_inline_chars": 1000, "delivery": "inline", "decided_by": { "include": "default", "max_inline_chars": "agent" }, "clamped": false } },
|
|
16
|
+
{ "name": "agent declares key without a limit — page limit applies", "input": { "agent": { "declared": true, "max_inline_chars": null }, "surface": { "declared": true, "auto_context": true, "max_inline_chars": 8000 }, "chars": 3000 }, "expect": { "include": true, "max_inline_chars": 8000, "delivery": "inline", "decided_by": { "include": "default", "max_inline_chars": "page" }, "clamped": false } },
|
|
17
|
+
{ "name": "agent limit ignored when the key is not declared", "input": { "agent": { "declared": false, "max_inline_chars": 1000 }, "chars": 300 }, "expect": { "include": true, "max_inline_chars": 200, "delivery": "on_request", "decided_by": { "include": "default", "max_inline_chars": "default" }, "clamped": false } },
|
|
18
|
+
{ "name": "page zero beats agent ceiling", "input": { "agent": { "declared": true, "max_inline_chars": 1000 }, "surface": { "declared": true, "auto_context": true, "max_inline_chars": 0 }, "chars": 5 }, "expect": { "include": true, "max_inline_chars": 0, "delivery": "on_request", "decided_by": { "include": "default", "max_inline_chars": "page" }, "clamped": false } },
|
|
19
|
+
{ "name": "agent zero with no page", "input": { "agent": { "declared": true, "max_inline_chars": 0 }, "chars": 5 }, "expect": { "include": true, "max_inline_chars": 0, "delivery": "on_request", "decided_by": { "include": "default", "max_inline_chars": "agent" }, "clamped": false } },
|
|
20
|
+
{ "name": "page auto_context off drops an undeclared value", "input": { "surface": { "declared": true, "auto_context": false, "max_inline_chars": null }, "chars": 50 }, "expect": { "include": false, "max_inline_chars": 200, "delivery": "off", "decided_by": { "include": "page", "max_inline_chars": "default" }, "clamped": false } },
|
|
21
|
+
{ "name": "agent declaration re-admits a page auto_context off value", "input": { "agent": { "declared": true }, "surface": { "declared": true, "auto_context": false }, "chars": 50 }, "expect": { "include": true, "max_inline_chars": 200, "delivery": "inline", "decided_by": { "include": "agent", "max_inline_chars": "default" }, "clamped": false } },
|
|
22
|
+
{ "name": "auto_context off on an undeclared surface value is not a page rule", "input": { "surface": { "declared": false, "auto_context": false }, "chars": 50 }, "expect": { "include": true, "max_inline_chars": 200, "delivery": "inline", "decided_by": { "include": "default", "max_inline_chars": "default" }, "clamped": false } },
|
|
23
|
+
{ "name": "kill switch drops an undeclared key", "input": { "agent": { "declared": false, "kill_switch": true }, "chars": 50 }, "expect": { "include": false, "max_inline_chars": 200, "delivery": "off", "decided_by": { "include": "agent", "max_inline_chars": "default" }, "clamped": false } },
|
|
24
|
+
{ "name": "kill switch keeps a declared key", "input": { "agent": { "declared": true, "kill_switch": true }, "chars": 50 }, "expect": { "include": true, "max_inline_chars": 200, "delivery": "inline", "decided_by": { "include": "default", "max_inline_chars": "default" }, "clamped": false } },
|
|
25
|
+
{ "name": "kill switch beats a page auto_context on", "input": { "agent": { "declared": false, "kill_switch": true }, "surface": { "declared": true, "auto_context": true, "max_inline_chars": 8000 }, "chars": 50 }, "expect": { "include": false, "max_inline_chars": 8000, "delivery": "off", "decided_by": { "include": "agent", "max_inline_chars": "page" }, "clamped": false } },
|
|
26
|
+
{ "name": "YOU re-admit past the kill switch", "input": { "agent": { "declared": false, "kill_switch": true }, "user": { "include": true }, "chars": 100 }, "expect": { "include": true, "max_inline_chars": 200, "delivery": "inline", "decided_by": { "include": "you", "max_inline_chars": "default" }, "clamped": false } },
|
|
27
|
+
{ "name": "YOU re-admit past page auto_context off", "input": { "surface": { "declared": true, "auto_context": false }, "user": { "include": true }, "chars": 100 }, "expect": { "include": true, "max_inline_chars": 200, "delivery": "inline", "decided_by": { "include": "you", "max_inline_chars": "default" }, "clamped": false } },
|
|
28
|
+
{ "name": "YOU turn a value off", "input": { "user": { "include": false }, "chars": 100 }, "expect": { "include": false, "max_inline_chars": 200, "delivery": "off", "decided_by": { "include": "you", "max_inline_chars": "default" }, "clamped": false } },
|
|
29
|
+
{ "name": "YOU turn off an agent-declared value", "input": { "agent": { "declared": true, "max_inline_chars": 5000 }, "user": { "include": false }, "chars": 100 }, "expect": { "include": false, "max_inline_chars": 5000, "delivery": "off", "decided_by": { "include": "you", "max_inline_chars": "agent" }, "clamped": false } },
|
|
30
|
+
{ "name": "YOUR limit beats a lower agent ceiling", "input": { "agent": { "declared": true, "max_inline_chars": 1000 }, "surface": { "declared": true, "auto_context": true, "max_inline_chars": 500 }, "user": { "max_inline_chars": 20000 }, "chars": 15000 }, "expect": { "include": true, "max_inline_chars": 20000, "delivery": "inline", "decided_by": { "include": "default", "max_inline_chars": "you" }, "clamped": false } },
|
|
31
|
+
{ "name": "YOUR limit zero means never inline", "input": { "user": { "max_inline_chars": 0 }, "chars": 5 }, "expect": { "include": true, "max_inline_chars": 0, "delivery": "on_request", "decided_by": { "include": "default", "max_inline_chars": "you" }, "clamped": false } },
|
|
32
|
+
{ "name": "YOUR limit at exact size is inline", "input": { "user": { "max_inline_chars": 300 }, "chars": 300 }, "expect": { "include": true, "max_inline_chars": 300, "delivery": "inline", "decided_by": { "include": "default", "max_inline_chars": "you" }, "clamped": false } },
|
|
33
|
+
{ "name": "YOUR limit above the cap is clamped and says so", "input": { "user": { "max_inline_chars": 60000 }, "chars": 55000 }, "expect": { "include": true, "max_inline_chars": 50000, "delivery": "on_request", "decided_by": { "include": "default", "max_inline_chars": "you" }, "clamped": true } },
|
|
34
|
+
{ "name": "agent limit above the cap is clamped", "input": { "agent": { "declared": true, "max_inline_chars": 70000 }, "chars": 100 }, "expect": { "include": true, "max_inline_chars": 50000, "delivery": "inline", "decided_by": { "include": "default", "max_inline_chars": "agent" }, "clamped": true } },
|
|
35
|
+
{ "name": "lowered cap knob clamps a page limit", "input": { "cap": 1000, "surface": { "declared": true, "auto_context": true, "max_inline_chars": 8000 }, "chars": 900 }, "expect": { "include": true, "max_inline_chars": 1000, "delivery": "inline", "decided_by": { "include": "default", "max_inline_chars": "page" }, "clamped": true } },
|
|
36
|
+
{ "name": "negative user limit is ignored", "input": { "user": { "max_inline_chars": -5 }, "chars": 100 }, "expect": { "include": true, "max_inline_chars": 200, "delivery": "inline", "decided_by": { "include": "default", "max_inline_chars": "default" }, "clamped": false } },
|
|
37
|
+
{ "name": "fractional user limit is ignored", "input": { "user": { "max_inline_chars": 12.5 }, "chars": 100 }, "expect": { "include": true, "max_inline_chars": 200, "delivery": "inline", "decided_by": { "include": "default", "max_inline_chars": "default" }, "clamped": false } },
|
|
38
|
+
{ "name": "non-boolean user include is ignored", "input": { "user": { "include": "no" }, "chars": 100 }, "expect": { "include": true, "max_inline_chars": 200, "delivery": "inline", "decided_by": { "include": "default", "max_inline_chars": "default" }, "clamped": false } },
|
|
39
|
+
{ "name": "user limit only — include still decided by the page", "input": { "surface": { "declared": true, "auto_context": false }, "user": { "max_inline_chars": 900 }, "chars": 100 }, "expect": { "include": false, "max_inline_chars": 900, "delivery": "off", "decided_by": { "include": "page", "max_inline_chars": "you" }, "clamped": false } },
|
|
40
|
+
{ "name": "user limit on an unresolved lazy source stays on request", "input": { "user": { "max_inline_chars": 20000 }, "chars": null }, "expect": { "include": true, "max_inline_chars": 20000, "delivery": "on_request", "decided_by": { "include": "default", "max_inline_chars": "you" }, "clamped": false } },
|
|
41
|
+
{ "name": "identity survives the agent kill switch", "input": { "identity": true, "agent": { "declared": false, "kill_switch": true }, "chars": 120 }, "expect": { "include": true, "max_inline_chars": 200, "delivery": "inline", "decided_by": { "include": "default", "max_inline_chars": "default" }, "clamped": false } },
|
|
42
|
+
{ "name": "identity survives a page that switched auto context off", "input": { "identity": true, "surface": { "declared": true, "auto_context": false }, "chars": 120 }, "expect": { "include": true, "max_inline_chars": 200, "delivery": "inline", "decided_by": { "include": "default", "max_inline_chars": "default" }, "clamped": false } },
|
|
43
|
+
{ "name": "identity under the kill switch: the person's off rule still wins", "input": { "identity": true, "agent": { "declared": false, "kill_switch": true }, "user": { "include": false }, "chars": 120 }, "expect": { "include": false, "max_inline_chars": 200, "delivery": "off", "decided_by": { "include": "you", "max_inline_chars": "default" }, "clamped": false } },
|
|
44
|
+
{ "name": "a page's own conversation never gets the page: the lock turns it off", "input": { "surface": { "declared": true, "auto_context": false, "own": true }, "chars": 10 }, "expect": { "include": false, "max_inline_chars": 200, "delivery": "off", "decided_by": { "include": "page", "max_inline_chars": "default" }, "clamped": false } },
|
|
45
|
+
{ "name": "the person's saved on rule cannot reopen a page's own conversation", "input": { "surface": { "declared": true, "auto_context": false, "own": true }, "user": { "include": true }, "chars": 10 }, "expect": { "include": false, "max_inline_chars": 200, "delivery": "off", "decided_by": { "include": "page", "max_inline_chars": "default" }, "clamped": false } },
|
|
46
|
+
{ "name": "the agent's own declaration cannot reopen a page's own conversation", "input": { "agent": { "declared": true, "kill_switch": false }, "surface": { "declared": true, "auto_context": false, "own": true }, "chars": 10 }, "expect": { "include": false, "max_inline_chars": 200, "delivery": "off", "decided_by": { "include": "page", "max_inline_chars": "default" }, "clamped": false } },
|
|
47
|
+
{ "name": "identity is never locked by a page's own conversation", "input": { "identity": true, "surface": { "declared": true, "auto_context": false, "own": true }, "chars": 10 }, "expect": { "include": true, "max_inline_chars": 200, "delivery": "inline", "decided_by": { "include": "default", "max_inline_chars": "default" }, "clamped": false } },
|
|
48
|
+
{ "name": "identity under a switched-off page: the person's off rule still wins", "input": { "identity": true, "surface": { "declared": true, "auto_context": false }, "user": { "include": false }, "chars": 120 }, "expect": { "include": false, "max_inline_chars": 200, "delivery": "off", "decided_by": { "include": "you", "max_inline_chars": "default" }, "clamped": false } },
|
|
49
|
+
{ "name": "identity on the page's own conversation with the person's on rule is sent", "input": { "identity": true, "surface": { "declared": true, "auto_context": false }, "user": { "include": true }, "chars": 120 }, "expect": { "include": true, "max_inline_chars": 200, "delivery": "inline", "decided_by": { "include": "you", "max_inline_chars": "default" }, "clamped": false } },
|
|
50
|
+
{ "name": "the same page-off layer closes a value that is not identity", "input": { "surface": { "declared": true, "auto_context": false }, "chars": 120 }, "expect": { "include": false, "max_inline_chars": 200, "delivery": "off", "decided_by": { "include": "page", "max_inline_chars": "default" }, "clamped": false } },
|
|
51
|
+
{ "name": "identity's limit still resolves like any value", "input": { "identity": true, "agent": { "declared": false, "kill_switch": true }, "surface": { "declared": true, "auto_context": false, "max_inline_chars": 100 }, "chars": 120 }, "expect": { "include": true, "max_inline_chars": 100, "delivery": "on_request", "decided_by": { "include": "default", "max_inline_chars": "page" }, "clamped": false } },
|
|
52
|
+
{ "name": "a value that is not identity is still closed by the kill switch", "input": { "identity": false, "agent": { "declared": false, "kill_switch": true }, "chars": 120 }, "expect": { "include": false, "max_inline_chars": 200, "delivery": "off", "decided_by": { "include": "agent", "max_inline_chars": "default" }, "clamped": false } }
|
|
53
|
+
],
|
|
54
|
+
"lookup_cases": [
|
|
55
|
+
{ "name": "no rows", "rows": {}, "surface_key": "matrx-user/notes", "key": "note_bundle", "expect": null },
|
|
56
|
+
{ "name": "default row only", "rows": { "_default": { "note_bundle": { "include": false } } }, "surface_key": "matrx-user/notes", "key": "note_bundle", "expect": { "include": false } },
|
|
57
|
+
{ "name": "surface row merges over default per field", "rows": { "_default": { "note_bundle": { "max_inline_chars": 1000 } }, "matrx-user/notes": { "note_bundle": { "include": false } } }, "surface_key": "matrx-user/notes", "key": "note_bundle", "expect": { "include": false, "max_inline_chars": 1000 } },
|
|
58
|
+
{ "name": "surface row field wins over default field", "rows": { "_default": { "note_bundle": { "include": false } }, "matrx-user/notes": { "note_bundle": { "include": true } } }, "surface_key": "matrx-user/notes", "key": "note_bundle", "expect": { "include": true } },
|
|
59
|
+
{ "name": "other surface rows never apply", "rows": { "matrx-user/tasks": { "note_bundle": { "include": false } } }, "surface_key": "matrx-user/notes", "key": "note_bundle", "expect": null },
|
|
60
|
+
{ "name": "no-surface value reads the default row", "rows": { "_default": { "attached_document_1": { "max_inline_chars": 9000 } } }, "surface_key": "_default", "key": "attached_document_1", "expect": { "max_inline_chars": 9000 } },
|
|
61
|
+
{ "name": "other key absent", "rows": { "_default": { "a": { "include": false } } }, "surface_key": "_default", "key": "b", "expect": null }
|
|
62
|
+
],
|
|
63
|
+
"chars_cases": [
|
|
64
|
+
{ "name": "plain string", "value": "hello", "chars": 5 },
|
|
65
|
+
{ "name": "empty string", "value": "", "chars": 0 },
|
|
66
|
+
{ "name": "accented string counts code points", "value": "héllo", "chars": 5 },
|
|
67
|
+
{ "name": "astral emoji is ONE code point (JS .length would say 2)", "value": "😀ab", "chars": 3 },
|
|
68
|
+
{ "name": "string with a raw newline is itself", "value": "a\nb", "chars": 3 },
|
|
69
|
+
{ "name": "object pretty-printed at indent 2", "value": { "a": 1 }, "chars": 12 },
|
|
70
|
+
{ "name": "empty object", "value": {}, "chars": 2 },
|
|
71
|
+
{ "name": "empty array", "value": [], "chars": 2 },
|
|
72
|
+
{ "name": "array pretty-printed", "value": [1, 2], "chars": 12 },
|
|
73
|
+
{ "name": "nested with empty array", "value": { "a": { "b": [] } }, "chars": 28 },
|
|
74
|
+
{ "name": "object with non-ASCII value (ensure_ascii off)", "value": { "k": "é😀" }, "chars": 15 },
|
|
75
|
+
{ "name": "object with newline in a string escapes it", "value": { "t": "a\nb" }, "chars": 17 },
|
|
76
|
+
{ "name": "boolean", "value": true, "chars": 4 },
|
|
77
|
+
{ "name": "null", "value": null, "chars": 4 },
|
|
78
|
+
{ "name": "integer", "value": 42, "chars": 2 }
|
|
79
|
+
],
|
|
80
|
+
"server_default_cases": [
|
|
81
|
+
{ "name": "plain string has no server default", "value": "hello", "expect": null },
|
|
82
|
+
{ "name": "plain object has no server default", "value": {"a": 1}, "expect": null },
|
|
83
|
+
{ "name": "envelope with content only", "value": {"content": "x", "label": "Note"}, "expect": null },
|
|
84
|
+
{ "name": "envelope default_max_inline_chars is the server default", "value": {"content": "x", "default_max_inline_chars": 9000}, "expect": 9000 },
|
|
85
|
+
{ "name": "envelope default zero (IDE diagnostics)", "value": {"content": "x", "default_max_inline_chars": 0}, "expect": 0 },
|
|
86
|
+
{ "name": "negative envelope default is ignored", "value": {"content": "x", "default_max_inline_chars": -1}, "expect": null },
|
|
87
|
+
{ "name": "boolean envelope default is ignored", "value": {"content": "x", "default_max_inline_chars": true}, "expect": null },
|
|
88
|
+
{ "name": "fractional envelope default is ignored", "value": {"content": "x", "default_max_inline_chars": 12.5}, "expect": null },
|
|
89
|
+
{ "name": "string envelope default is ignored", "value": {"content": "x", "default_max_inline_chars": "9000"}, "expect": null },
|
|
90
|
+
{ "name": "a page limit is not a server default", "value": {"content": "x", "max_inline_chars": 8000}, "expect": null },
|
|
91
|
+
{ "name": "lazy source pointer (no content) is 6000", "value": {"source": {"kind": "note", "id": "11111111-1111-4111-8111-111111111111", "field": "content"}, "type": "json", "label": "Doc"}, "expect": 6000 },
|
|
92
|
+
{ "name": "lazy source with null content is 6000", "value": {"content": null, "source": {"kind": "note", "id": "11111111-1111-4111-8111-111111111111"}}, "expect": 6000 },
|
|
93
|
+
{ "name": "a source with content is not lazy", "value": {"content": "body", "source": {"kind": "note", "id": "11111111-1111-4111-8111-111111111111"}}, "expect": null },
|
|
94
|
+
{ "name": "normalized resource source is descriptor-first", "value": {"source": {"kind": "file", "id": "11111111-1111-4111-8111-111111111111", "extra": {"resource_type": "file"}}, "type": "json"}, "expect": 0 },
|
|
95
|
+
{ "name": "explicit default beats the lazy default", "value": {"source": {"kind": "note", "id": "11111111-1111-4111-8111-111111111111"}, "default_max_inline_chars": 100}, "expect": 100 },
|
|
96
|
+
{ "name": "a source without kind is raw content", "value": {"source": {"id": "11111111-1111-4111-8111-111111111111"}}, "expect": null },
|
|
97
|
+
{ "name": "an unknown key makes the dict raw JSON", "value": {"content": "x", "default_max_inline_chars": 9000, "other": 1}, "expect": null },
|
|
98
|
+
{ "name": "bare resource reference is descriptor-first", "value": {"__kind": "resource_ref", "resource_type": "file", "resource_id": "11111111-1111-4111-8111-111111111111"}, "expect": 0 },
|
|
99
|
+
{ "name": "resource reference nested as envelope content is not promoted", "value": {"content": {"__kind": "resource_ref", "resource_type": "file", "resource_id": "11111111-1111-4111-8111-111111111111"}}, "expect": null },
|
|
100
|
+
{ "name": "resource reference without a UUID id is raw content", "value": {"__kind": "resource_ref", "resource_type": "file", "resource_id": "not-a-uuid"}, "expect": null }
|
|
101
|
+
],
|
|
102
|
+
"envelope_cases": [
|
|
103
|
+
{ "name": "a record that merely has content is raw content", "value": {"id": "11111111-1111-4111-8111-111111111111", "title": "Q3 vendor review", "content": "Follow up with Acme"}, "expect": {"content": {"id": "11111111-1111-4111-8111-111111111111", "title": "Q3 vendor review", "content": "Follow up with Acme"}, "overrides": {}} },
|
|
104
|
+
{ "name": "a true envelope splits content from its fields", "value": {"content": "Follow up with Acme", "label": "Current note", "max_inline_chars": 8000}, "expect": {"content": "Follow up with Acme", "overrides": {"label": "Current note", "max_inline_chars": 8000}} },
|
|
105
|
+
{ "name": "an envelope with an unknown key is raw content", "value": {"content": "x", "label": "L", "pinned": true}, "expect": {"content": {"content": "x", "label": "L", "pinned": true}, "overrides": {}} },
|
|
106
|
+
{ "name": "an envelope keeps default_max_inline_chars as a field", "value": {"content": "2 errors", "default_max_inline_chars": 0}, "expect": {"content": "2 errors", "overrides": {"default_max_inline_chars": 0}} },
|
|
107
|
+
{ "name": "a lazy source pointer has null content", "value": {"source": {"kind": "note", "id": "11111111-1111-4111-8111-111111111111"}, "type": "json", "label": "Doc"}, "expect": {"content": null, "overrides": {"source": {"kind": "note", "id": "11111111-1111-4111-8111-111111111111"}, "type": "json", "label": "Doc"}} },
|
|
108
|
+
{ "name": "a source without kind and no content is raw content", "value": {"source": {"id": "11111111-1111-4111-8111-111111111111"}, "label": "Doc"}, "expect": {"content": {"source": {"id": "11111111-1111-4111-8111-111111111111"}, "label": "Doc"}, "overrides": {}} },
|
|
109
|
+
{ "name": "a plain string is content", "value": "hello", "expect": {"content": "hello", "overrides": {}} },
|
|
110
|
+
{ "name": "an array is content", "value": [1, 2], "expect": {"content": [1, 2], "overrides": {}} }
|
|
111
|
+
],
|
|
112
|
+
"wire_passthrough_cases": [
|
|
113
|
+
{ "name": "an attached file reference ships as-is", "key": "attached_file_22222222-2222-4222-8222-222222222222", "value": {"__kind": "resource_ref", "resource_type": "file", "resource_id": "22222222-2222-4222-8222-222222222222"}, "passthrough": true },
|
|
114
|
+
{ "name": "a reference with its own policy ships as-is", "key": "attached_file_22222222-2222-4222-8222-222222222222", "value": {"__kind": "resource_ref", "resource_type": "file", "resource_id": "22222222-2222-4222-8222-222222222222", "promote": [{"representation": "clean_text", "max_chars": 5000}], "exclude": ["image"]}, "passthrough": true },
|
|
115
|
+
{ "name": "a processed document reference ships as-is", "key": "source_doc", "value": {"__kind": "resource_ref", "resource_type": "processed_document", "resource_id": "22222222-2222-4222-8222-222222222222"}, "passthrough": true },
|
|
116
|
+
{ "name": "a bare file id under file_id ships as-is", "key": "file_id", "value": "22222222-2222-4222-8222-222222222222", "passthrough": true },
|
|
117
|
+
{ "name": "a bare file id under a *_file_id key ships as-is", "key": "attached_file_id", "value": "22222222-2222-4222-8222-222222222222", "passthrough": true },
|
|
118
|
+
{ "name": "a record with content is wrapped", "key": "current_note", "value": {"id": "22222222-2222-4222-8222-222222222222", "title": "Q3 vendor review", "content": "Follow up"}, "passthrough": false },
|
|
119
|
+
{ "name": "a plain string is wrapped", "key": "current_note", "value": "Follow up with Acme", "passthrough": false }
|
|
120
|
+
],
|
|
121
|
+
"server_resolved_cases": [
|
|
122
|
+
{ "name": "bare note id is server-resolved", "key": "note_id", "value": "33333333-3333-4333-8333-333333333333", "expect": true, "server_promotes": true },
|
|
123
|
+
{ "name": "prefixed note id is server-resolved", "key": "current_note_id", "value": "33333333-3333-4333-8333-333333333333", "expect": true, "server_promotes": true },
|
|
124
|
+
{ "name": "an id key is case-insensitive", "key": "Note_ID", "value": "33333333-3333-4333-8333-333333333333", "expect": true, "server_promotes": true },
|
|
125
|
+
{ "name": "a braced UUID is a UUID", "key": "file_id", "value": "{33333333-3333-4333-8333-333333333333}", "expect": true, "server_promotes": true },
|
|
126
|
+
{ "name": "a hyphenless UUID is a UUID", "key": "file_id", "value": "33333333333343338333333333333333", "expect": true, "server_promotes": true },
|
|
127
|
+
{ "name": "a urn UUID is a UUID", "key": "note_id", "value": "urn:uuid:33333333-3333-4333-8333-333333333333", "expect": true, "server_promotes": true },
|
|
128
|
+
{ "name": "a top-level resource reference is server-resolved", "key": "current_note", "value": {"__kind": "resource_ref", "resource_type": "note", "resource_id": "33333333-3333-4333-8333-333333333333"}, "expect": true, "server_promotes": true },
|
|
129
|
+
{ "name": "an unregistered id noun: the client stops predicting, the server keeps it raw", "key": "model_id", "value": "33333333-3333-4333-8333-333333333333", "expect": true, "server_promotes": false },
|
|
130
|
+
{ "name": "a resource reference as envelope content: the client stops predicting", "key": "current_note", "value": {"content": {"__kind": "resource_ref", "resource_type": "note", "resource_id": "33333333-3333-4333-8333-333333333333"}, "label": "Note"}, "expect": true, "server_promotes": false },
|
|
131
|
+
{ "name": "a UUID under a non-id key is plain text", "key": "note", "value": "33333333-3333-4333-8333-333333333333", "expect": false, "server_promotes": false },
|
|
132
|
+
{ "name": "a non-UUID under an id key is plain text", "key": "note_id", "value": "not-a-uuid", "expect": false, "server_promotes": false },
|
|
133
|
+
{ "name": "a plain record is not server-resolved", "key": "current_note", "value": {"id": "33333333-3333-4333-8333-333333333333", "title": "Q3 vendor review", "content": "Follow up"}, "expect": false, "server_promotes": false }
|
|
134
|
+
],
|
|
135
|
+
"effective_lookup_cases": [
|
|
136
|
+
{ "name": "declared on both sides: page key", "rows": {"matrx-user/notes": {"current_note_published_to_web": {"include": false}}}, "primary_surface": "matrx-user/notes", "surface_key": "matrx-user/notes", "key": "current_note_published_to_web", "expect": {"include": false} },
|
|
137
|
+
{ "name": "declared client-only: the server files it under _default and still reads the page rule", "rows": {"matrx-user/notes": {"current_note_published_to_web": {"include": false}}}, "primary_surface": "matrx-user/notes", "surface_key": "_default", "key": "current_note_published_to_web", "expect": {"include": false} },
|
|
138
|
+
{ "name": "rule in _default only, page key", "rows": {"_default": {"current_note_published_to_web": {"max_inline_chars": 1000}}}, "primary_surface": "matrx-user/notes", "surface_key": "matrx-user/notes", "key": "current_note_published_to_web", "expect": {"max_inline_chars": 1000} },
|
|
139
|
+
{ "name": "rule in _default only, _default key", "rows": {"_default": {"current_note_published_to_web": {"max_inline_chars": 1000}}}, "primary_surface": "matrx-user/notes", "surface_key": "_default", "key": "current_note_published_to_web", "expect": {"max_inline_chars": 1000} },
|
|
140
|
+
{ "name": "rule in P only, _default key", "rows": {"matrx-user/notes": {"attached_document_1": {"max_inline_chars": 9000}}}, "primary_surface": "matrx-user/notes", "surface_key": "_default", "key": "attached_document_1", "expect": {"max_inline_chars": 9000} },
|
|
141
|
+
{ "name": "both rows merge per field, page key", "rows": {"_default": {"current_note_published_to_web": {"max_inline_chars": 1000}}, "matrx-user/notes": {"current_note_published_to_web": {"include": false}}}, "primary_surface": "matrx-user/notes", "surface_key": "matrx-user/notes", "key": "current_note_published_to_web", "expect": {"include": false, "max_inline_chars": 1000} },
|
|
142
|
+
{ "name": "both rows merge per field, _default key", "rows": {"_default": {"current_note_published_to_web": {"max_inline_chars": 1000}}, "matrx-user/notes": {"current_note_published_to_web": {"include": false}}}, "primary_surface": "matrx-user/notes", "surface_key": "_default", "key": "current_note_published_to_web", "expect": {"include": false, "max_inline_chars": 1000} },
|
|
143
|
+
{ "name": "P wins a field both rows set", "rows": {"_default": {"current_note_published_to_web": {"include": true, "max_inline_chars": 1000}}, "matrx-user/notes": {"current_note_published_to_web": {"include": false}}}, "primary_surface": "matrx-user/notes", "surface_key": "_default", "key": "current_note_published_to_web", "expect": {"include": false, "max_inline_chars": 1000} },
|
|
144
|
+
{ "name": "a surroundings key keeps its own surface", "rows": {"matrx-user/sidebar": {"sidebar_filter": {"include": false}}, "matrx-user/notes": {"sidebar_filter": {"include": true}}}, "primary_surface": "matrx-user/notes", "surface_key": "matrx-user/sidebar", "key": "sidebar_filter", "expect": {"include": false} },
|
|
145
|
+
{ "name": "a surroundings key never reads P", "rows": {"matrx-user/notes": {"sidebar_filter": {"include": false}}}, "primary_surface": "matrx-user/notes", "surface_key": "matrx-user/sidebar", "key": "sidebar_filter", "expect": null },
|
|
146
|
+
{ "name": "no primary surface: _default key reads _default only", "rows": {"matrx-user/notes": {"current_note_published_to_web": {"include": false}}}, "primary_surface": null, "surface_key": "_default", "key": "current_note_published_to_web", "expect": null },
|
|
147
|
+
{ "name": "no primary surface: surface key merges as before", "rows": {"_default": {"current_note_published_to_web": {"max_inline_chars": 1000}}, "matrx-user/notes": {"current_note_published_to_web": {"include": false}}}, "primary_surface": null, "surface_key": "matrx-user/notes", "key": "current_note_published_to_web", "expect": {"include": false, "max_inline_chars": 1000} },
|
|
148
|
+
{ "name": "other surfaces' rows never apply", "rows": {"matrx-user/tasks": {"current_note_published_to_web": {"include": false}}}, "primary_surface": "matrx-user/notes", "surface_key": "_default", "key": "current_note_published_to_web", "expect": null },
|
|
149
|
+
{ "name": "a value a screen mounted inside the page published keeps that screen's surface", "rows": {"matrx-user/transcripts": {"transcript_title": {"include": false}}, "matrx-user/knowledge": {"transcript_title": {"include": true, "max_inline_chars": 9}}, "_default": {"transcript_title": {"max_inline_chars": 700}}}, "primary_surface": "matrx-user/knowledge", "surface_key": "matrx-user/transcripts", "origin": "client", "key": "transcript_title", "expect": {"include": false, "max_inline_chars": 700} },
|
|
150
|
+
{ "name": "a mounted screen's value never reads the primary's row", "rows": {"matrx-user/knowledge": {"transcript_title": {"include": false}}}, "primary_surface": "matrx-user/knowledge", "surface_key": "matrx-user/transcripts", "origin": "client", "key": "transcript_title", "expect": null }
|
|
151
|
+
],
|
|
152
|
+
"humanize_cases": [
|
|
153
|
+
{ "name": "snake case to title words", "key": "current_note", "expect": "Current Note" },
|
|
154
|
+
{ "name": "id is an acronym", "key": "note_id", "expect": "Note ID" },
|
|
155
|
+
{ "name": "a long page key", "key": "current_note_published_to_web", "expect": "Current Note Published To Web" },
|
|
156
|
+
{ "name": "several acronyms", "key": "source_url_pdf", "expect": "Source URL PDF" },
|
|
157
|
+
{ "name": "acronyms are whole parts only", "key": "url2pdf_source", "expect": "Url2pdf Source" },
|
|
158
|
+
{ "name": "hyphens split like underscores", "key": "ai-model-settings", "expect": "AI Model Settings" },
|
|
159
|
+
{ "name": "runs of separators collapse", "key": "attached__file--id", "expect": "Attached File ID" },
|
|
160
|
+
{ "name": "leading and trailing separators drop", "key": "_internal_key_", "expect": "Internal Key" },
|
|
161
|
+
{ "name": "upper-case input is normalized", "key": "API_KEY_STATUS", "expect": "API Key Status" },
|
|
162
|
+
{ "name": "camelCase splits into words", "key": "myValue_ID", "expect": "My Value ID" },
|
|
163
|
+
{ "name": "uuid and json", "key": "resource_uuid_json", "expect": "Resource UUID JSON" },
|
|
164
|
+
{ "name": "every listed acronym", "key": "id_url_pdf_html_json_api_ai_ui_csv_sms_seo_llm_mcp_uuid_iso", "expect": "ID URL PDF HTML JSON API AI UI CSV SMS SEO LLM MCP UUID ISO" },
|
|
165
|
+
{ "name": "a word that only contains an acronym stays a word", "key": "idea_guide", "expect": "Idea Guide" },
|
|
166
|
+
{ "name": "digits stay", "key": "attached_document_2", "expect": "Attached Document 2" },
|
|
167
|
+
{ "name": "a single word", "key": "notes", "expect": "Notes" },
|
|
168
|
+
{ "name": "empty key", "key": "", "expect": "" },
|
|
169
|
+
{ "name": "already words stay as written", "key": "Normal Text", "expect": "Normal Text" },
|
|
170
|
+
{ "name": "a person's phrase keeps its casing and apostrophe", "key": "Customer's iPhone model", "expect": "Customer's iPhone model" },
|
|
171
|
+
{ "name": "a phrase with a version number is not split on the dot", "key": "Version 2.0", "expect": "Version 2.0" },
|
|
172
|
+
{ "name": "a lowercase phrase gains only a capital first letter", "key": "lowercase words here", "expect": "Lowercase words here" },
|
|
173
|
+
{ "name": "a plural acronym tail stays whole", "key": "userIDs", "expect": "User IDs" },
|
|
174
|
+
{ "name": "a plural acronym part", "key": "user_ids", "expect": "User IDs" },
|
|
175
|
+
{ "name": "api key", "key": "api_key", "expect": "API Key" },
|
|
176
|
+
{ "name": "user id", "key": "user_id", "expect": "User ID" },
|
|
177
|
+
{ "name": "an upper-case run before a word splits", "key": "HTMLParser", "expect": "HTML Parser" },
|
|
178
|
+
{ "name": "digits stay inside a part", "key": "step2_output", "expect": "Step2 Output" },
|
|
179
|
+
{ "name": "a short versioned key", "key": "v2", "expect": "V2" },
|
|
180
|
+
{ "name": "no key at all", "key": null, "expect": "" }
|
|
181
|
+
],
|
|
182
|
+
"attachment_key_cases_about": "attached_resource_ + encode(provider + ':' + resource_ref): ASCII letters, digits and '-' kept; every other UTF-8 byte is '_' + two lowercase hex digits ('_' itself is _5f), so the key is unique across providers, case-preserving and stable, and every client derives it from GET /conversations/{id}/attachments (provider, resource_ref).",
|
|
183
|
+
"attachment_key_cases": [
|
|
184
|
+
{ "name": "a GitHub repository", "provider": "github", "resource_ref": "harbor-point/work-orders", "expect": "attached_resource_github_3aharbor-point_2fwork-orders" },
|
|
185
|
+
{ "name": "a Drive file id keeps its case", "provider": "google", "resource_ref": "1AbCvendorSchedule", "expect": "attached_resource_google_3a1AbCvendorSchedule" },
|
|
186
|
+
{ "name": "ids that differ only by case stay distinct", "provider": "google", "resource_ref": "1abcvendorschedule", "expect": "attached_resource_google_3a1abcvendorschedule" },
|
|
187
|
+
{ "name": "an underscore is escaped, so it never collides with a slash", "provider": "github", "resource_ref": "harbor_point/ops", "expect": "attached_resource_github_3aharbor_5fpoint_2fops" },
|
|
188
|
+
{ "name": "slash form", "provider": "github", "resource_ref": "a/b", "expect": "attached_resource_github_3aa_2fb" },
|
|
189
|
+
{ "name": "underscore form", "provider": "github", "resource_ref": "a_b", "expect": "attached_resource_github_3aa_5fb" },
|
|
190
|
+
{ "name": "the same ref under another provider is another key", "provider": "microsoft", "resource_ref": "1AbC", "expect": "attached_resource_microsoft_3a1AbC" },
|
|
191
|
+
{ "name": "the same ref under Google", "provider": "google", "resource_ref": "1AbC", "expect": "attached_resource_google_3a1AbC" },
|
|
192
|
+
{ "name": "a synced record ref with dots, colons and @", "provider": "google", "resource_ref": "calendar.events:abc123@google.com", "expect": "attached_resource_google_3acalendar_2eevents_3aabc123_40google_2ecom" },
|
|
193
|
+
{ "name": "non-ASCII is escaped byte by byte (UTF-8)", "provider": "github", "resource_ref": "café", "expect": "attached_resource_github_3acaf_c3_a9" },
|
|
194
|
+
{ "name": "spaces and dots", "provider": "microsoft", "resource_ref": "Q4 Budget.xlsx", "expect": "attached_resource_microsoft_3aQ4_20Budget_2exlsx" },
|
|
195
|
+
{ "name": "an empty ref still names the provider", "provider": "github", "resource_ref": "", "expect": "attached_resource_github_3a" }
|
|
196
|
+
],
|
|
197
|
+
"server_authoritative_keys_about": "The keys whose value the SERVER states itself, never the client's copy (RULES.md section 5a, owner ruling 2026-10-01: identity is the server's truth, never the page's claim), and where it states each: active_context = the turn's <active_context> block; manifest = a server-built context value. aidream SERVER_AUTHORITATIVE_KEYS and the package SERVER_AUTHORITATIVE_KEYS must equal this table exactly.",
|
|
198
|
+
"server_authoritative_keys": { "user": "manifest", "client": "manifest", "organization": "active_context", "active_scopes": "active_context" },
|
|
199
|
+
"pointer_inline_ceilings_about": "The page-layer limits the client DERIVES instead of reading from the page (owner ruling 2026-09-30, the person's pointer): a selection and the text around it inline up to these sizes on every page, never below the page's own number; pageless_content is a launch with no page behind it. A sent value carries the number on its envelope; a WITHHELD value does not, so the server holds the same table for its receipt row. matrx-frontend POINTER_INLINE_CEILINGS / PAGELESS_CONTENT_INLINE_CEILING and aidream POINTER_INLINE_CEILINGS / PAGELESS_CONTENT_INLINE_CEILING must equal this table exactly.",
|
|
200
|
+
"pointer_inline_ceilings": { "selection": 10000, "text_before": 2500, "text_after": 2500 },
|
|
201
|
+
"pageless_content_inline_ceiling": 6000,
|
|
202
|
+
"consumed_key_cases_about": "The reserved keys the server never keeps under their own name (RULES.md section 5 consumed_as): each still gets a receipt row naming what became of it. aidream RESERVED_CONSUMED_KEYS and the package RESERVED_CONSUMED_KEYS must equal this table exactly.",
|
|
203
|
+
"consumed_key_cases": [
|
|
204
|
+
{ "name": "the registered screens around the page expand into <surface>::<value> rows", "key": "surface_chain", "consumed_as": "expanded" },
|
|
205
|
+
{ "name": "open unregistered windows expand into window::<title> rows", "key": "window_forms", "consumed_as": "expanded" },
|
|
206
|
+
{ "name": "a table-access grant is a directive the server acts on", "key": "__table_access", "consumed_as": "directive" },
|
|
207
|
+
{ "name": "attached Google files are a directive the server acts on", "key": "__google_files", "consumed_as": "directive" },
|
|
208
|
+
{ "name": "an Orchestra member step's connection is a directive the server acts on", "key": "__orchestra_member", "consumed_as": "directive" }
|
|
209
|
+
],
|
|
210
|
+
"surroundings_key_cases_about": "The key the server delivers each value of a surface_chain level under (aidream chain_context_key), which the composer lists before the send (expandSurroundingsForDisplay): one key, so the composer, the person's rule and the receipt name the same value.",
|
|
211
|
+
"surroundings_key_cases": [
|
|
212
|
+
{ "name": "the canvas beside the chat delivers its active organization id under its own surface", "surface": "matrx-user/canvas", "value": "active_organization_id", "key": "matrx-user/canvas::active_organization_id" },
|
|
213
|
+
{ "name": "a window's value keeps its window surface", "surface": "matrx-user/data-tables-row-editor", "value": "row_draft", "key": "matrx-user/data-tables-row-editor::row_draft" }
|
|
214
|
+
],
|
|
215
|
+
"page_context_cases_about": "RULES.md section 0: a page's OWN conversation (mode own) and a conversation whose page switch is off (mode off) never receive the page. The listed keys are withheld at the PAGE layer (declared, auto_context off), as is any value from the screens around the page (origin surroundings) and any value the page itself declared; the person values are never withheld. withheld null = the default list for the mode. aidream page_context.py and the package's pageContextWithholds must agree with every case.",
|
|
216
|
+
"page_context_defaults": {
|
|
217
|
+
"off": ["route_brief", "surface_chain", "window_forms", "surface_closed"],
|
|
218
|
+
"own": ["route_brief", "surface_chain", "window_forms", "surface_closed", "conversation"],
|
|
219
|
+
"person_values": ["user", "client", "organization", "project", "task", "active_scopes"]
|
|
220
|
+
},
|
|
221
|
+
"page_context_cases": [
|
|
222
|
+
{ "name": "an own conversation never gets its route", "mode": "own", "withheld": null, "key": "route_brief", "origin": "client", "surface_declared": false, "surface_key": "_default", "expect": true },
|
|
223
|
+
{ "name": "an own conversation never gets its own id", "mode": "own", "withheld": null, "key": "conversation", "origin": "client", "surface_declared": false, "surface_key": "_default", "expect": true },
|
|
224
|
+
{ "name": "a switched-off page still lets the conversation know its id", "mode": "off", "withheld": null, "key": "conversation", "origin": "client", "surface_declared": false, "surface_key": "_default", "expect": false },
|
|
225
|
+
{ "name": "a switched-off page withholds its route", "mode": "off", "withheld": null, "key": "route_brief", "origin": "client", "surface_declared": false, "surface_key": "_default", "expect": true },
|
|
226
|
+
{ "name": "the person is never withheld", "mode": "own", "withheld": null, "key": "user", "origin": "client", "surface_declared": false, "surface_key": "_default", "expect": false },
|
|
227
|
+
{ "name": "the organization is never withheld, even when the page declares it", "mode": "own", "withheld": null, "key": "organization", "origin": "client", "surface_declared": true, "surface_key": "matrx-user/chat", "expect": false },
|
|
228
|
+
{ "name": "the conversation's working document is never withheld, even when the page declares the name", "mode": "own", "withheld": null, "key": "working_document", "origin": "client", "surface_declared": true, "surface_key": "matrx-user/chat", "expect": false },
|
|
229
|
+
{ "name": "the conversation's scratchpad is never withheld from its own conversation", "mode": "own", "withheld": null, "key": "user_scratchpad", "origin": "client", "surface_declared": true, "surface_key": "matrx-user/chat", "expect": false },
|
|
230
|
+
{ "name": "an attached scratchpad is never withheld by a switched-off page", "mode": "off", "withheld": null, "key": "user_scratchpad_ab12cd34", "origin": "client", "surface_declared": true, "surface_key": "matrx-user/chat", "expect": false },
|
|
231
|
+
{ "name": "a page's own declared value is withheld from its own conversation", "mode": "own", "withheld": null, "key": "battle_columns", "origin": "client", "surface_declared": true, "surface_key": "matrx-user/agent-battle", "expect": true },
|
|
232
|
+
{ "name": "a screen around the page is withheld", "mode": "own", "withheld": null, "key": "matrx-user/notes::content", "origin": "surroundings", "surface_declared": true, "surface_key": "matrx-user/notes", "expect": true },
|
|
233
|
+
{ "name": "an attachment is not the page", "mode": "own", "withheld": null, "key": "attached_document_x", "origin": "client", "surface_declared": false, "surface_key": "_default", "expect": false },
|
|
234
|
+
{ "name": "a page that declares its own list overrides the default", "mode": "own", "withheld": ["conversation"], "key": "route_brief", "origin": "client", "surface_declared": false, "surface_key": "_default", "expect": false },
|
|
235
|
+
{ "name": "a declared list can never withhold the person", "mode": "own", "withheld": ["user", "conversation"], "key": "user", "origin": "client", "surface_declared": false, "surface_key": "_default", "expect": false },
|
|
236
|
+
{ "name": "a switched-off page withholds what a screen mounted inside it published", "mode": "off", "withheld": null, "key": "transcript_title", "origin": "client", "surface_declared": true, "surface_key": "matrx-user/transcripts", "expect": true }
|
|
237
|
+
]
|
|
238
|
+
}
|
package/dist/models/index.cjs
CHANGED
|
@@ -38,6 +38,7 @@ __export(models_exports, {
|
|
|
38
38
|
GgufError: () => GgufError,
|
|
39
39
|
INPUT_MODALITIES: () => INPUT_MODALITIES,
|
|
40
40
|
INTERACTION_MODES: () => INTERACTION_MODES,
|
|
41
|
+
LLM_INTERACTIONS: () => LLM_INTERACTIONS,
|
|
41
42
|
MAX_SUCCESSION_HOPS: () => MAX_SUCCESSION_HOPS,
|
|
42
43
|
MODEL_CATALOG_KINDS: () => MODEL_CATALOG_KINDS,
|
|
43
44
|
MODEL_FAVORITE_ENTITY_TYPE: () => MODEL_FAVORITE_ENTITY_TYPE,
|
|
@@ -47,6 +48,7 @@ __export(models_exports, {
|
|
|
47
48
|
SERVICE_LABEL_PLURAL: () => SERVICE_LABEL_PLURAL,
|
|
48
49
|
TOP_TIER_COST_RATING: () => TOP_TIER_COST_RATING,
|
|
49
50
|
TOP_TIER_LOCKED_TITLE: () => TOP_TIER_LOCKED_TITLE,
|
|
51
|
+
UNKNOWN_MODEL_KIND: () => UNKNOWN_MODEL_KIND,
|
|
50
52
|
acceptsTextInstructions: () => acceptsTextInstructions,
|
|
51
53
|
announceModelCatalogChanged: () => announceModelCatalogChanged,
|
|
52
54
|
availableOnDevices: () => availableOnDevices,
|
|
@@ -57,6 +59,7 @@ __export(models_exports, {
|
|
|
57
59
|
catalogForApp: () => catalogForApp,
|
|
58
60
|
catalogKeyColumn: () => catalogKeyColumn,
|
|
59
61
|
catalogKindOf: () => catalogKindOf,
|
|
62
|
+
catalogKindVerdict: () => catalogKindVerdict,
|
|
60
63
|
cheapestAdequateModel: () => cheapestAdequateModel,
|
|
61
64
|
classConfigKey: () => classConfigKey,
|
|
62
65
|
collapseTiersByClass: () => collapseTiersByClass,
|
|
@@ -2881,6 +2884,7 @@ var DeviceModelUnavailableError = class extends Error {
|
|
|
2881
2884
|
};
|
|
2882
2885
|
|
|
2883
2886
|
// models/catalog-reader.ts
|
|
2887
|
+
var UNKNOWN_MODEL_KIND = "unknown";
|
|
2884
2888
|
var MODEL_CATALOG_KINDS = /* @__PURE__ */ new Set([
|
|
2885
2889
|
"llm_model",
|
|
2886
2890
|
"whisper_model",
|
|
@@ -2889,23 +2893,35 @@ var MODEL_CATALOG_KINDS = /* @__PURE__ */ new Set([
|
|
|
2889
2893
|
"video_gen_model",
|
|
2890
2894
|
"ner_model",
|
|
2891
2895
|
"wake_word_model",
|
|
2892
|
-
"lora"
|
|
2896
|
+
"lora",
|
|
2897
|
+
"embedding_model",
|
|
2898
|
+
UNKNOWN_MODEL_KIND
|
|
2893
2899
|
]);
|
|
2894
|
-
|
|
2900
|
+
var LLM_INTERACTIONS = /* @__PURE__ */ new Set(["turn", "single", "agent"]);
|
|
2901
|
+
function catalogKindVerdict(m, kindOfEntry) {
|
|
2895
2902
|
for (const v of m.variants)
|
|
2896
2903
|
for (const id of v.catalog_entry_ids ?? []) {
|
|
2897
2904
|
const k = kindOfEntry.get(id);
|
|
2898
|
-
if (k && MODEL_CATALOG_KINDS.has(k)) return k;
|
|
2905
|
+
if (k && k !== UNKNOWN_MODEL_KIND && MODEL_CATALOG_KINDS.has(k)) return { kind: k, reason: null };
|
|
2899
2906
|
}
|
|
2900
2907
|
const out = m.capabilities.output ?? [];
|
|
2901
2908
|
const inp = m.capabilities.input ?? [];
|
|
2902
|
-
|
|
2903
|
-
|
|
2904
|
-
if (
|
|
2905
|
-
if (out.includes("
|
|
2906
|
-
if (
|
|
2907
|
-
if (
|
|
2908
|
-
return "
|
|
2909
|
+
const interaction = m.capabilities.interaction ?? "";
|
|
2910
|
+
const placed = (kind) => ({ kind, reason: null });
|
|
2911
|
+
if (m.presentation?.shelf === "loras" || interaction === "adapter") return placed("lora");
|
|
2912
|
+
if (out.includes("video")) return placed("video_gen_model");
|
|
2913
|
+
if (out.includes("image")) return placed("image_gen_model");
|
|
2914
|
+
if (out.includes("embedding")) return placed("embedding_model");
|
|
2915
|
+
if (out.includes("audio")) return placed("tts_model_file");
|
|
2916
|
+
if (inp.includes("audio") && (out.includes("decision") || interaction === "detection")) return placed("wake_word_model");
|
|
2917
|
+
if (inp.includes("audio") && out.includes("text")) return placed("whisper_model");
|
|
2918
|
+
if (interaction === "extraction") return placed("ner_model");
|
|
2919
|
+
if (inp.includes("text") && out.includes("text") && LLM_INTERACTIONS.has(interaction)) return placed("llm_model");
|
|
2920
|
+
const shape = `input [${inp.join(", ")}], output [${out.join(", ")}], interaction ${interaction || "(none)"}`;
|
|
2921
|
+
return { kind: UNKNOWN_MODEL_KIND, reason: `no kind rule places ${shape}` };
|
|
2922
|
+
}
|
|
2923
|
+
function catalogKindOf(m, kindOfEntry) {
|
|
2924
|
+
return catalogKindVerdict(m, kindOfEntry).kind;
|
|
2909
2925
|
}
|
|
2910
2926
|
function canonicalJson(value) {
|
|
2911
2927
|
if (value === void 0) return "null";
|
|
@@ -2984,6 +3000,8 @@ async function readCatalogWith(client, opts, preread) {
|
|
|
2984
3000
|
const p = presentationOf.get(c.id);
|
|
2985
3001
|
stamp(p);
|
|
2986
3002
|
const maker = providerById.get(s3(m.provider_id));
|
|
3003
|
+
const verdict = catalogKindVerdict(c, kindOfEntry);
|
|
3004
|
+
if (verdict.reason) warnings.push(`${s3(m.name)}: kind unknown: ${verdict.reason}`);
|
|
2987
3005
|
return [
|
|
2988
3006
|
{
|
|
2989
3007
|
id: s3(m.id),
|
|
@@ -2994,7 +3012,7 @@ async function readCatalogWith(client, opts, preread) {
|
|
|
2994
3012
|
maker_logo_file_id: sn3(maker?.logo_file_id),
|
|
2995
3013
|
description: sn3(m.description),
|
|
2996
3014
|
capabilities: m.capabilities ?? {},
|
|
2997
|
-
kind:
|
|
3015
|
+
kind: verdict.kind,
|
|
2998
3016
|
offered: c.offered,
|
|
2999
3017
|
updated_at: c.updated_at,
|
|
3000
3018
|
presentation: p ? {
|
package/dist/models/index.d.cts
CHANGED
|
@@ -1109,7 +1109,7 @@ interface LocalModel {
|
|
|
1109
1109
|
/** Matrx 2's 1.48 id for a model seeded from its old list (metadata.desktop_id). */
|
|
1110
1110
|
desktop_id?: string | null;
|
|
1111
1111
|
maker_logo_file_id?: string | null;
|
|
1112
|
-
/** The admin Catalogs kind (`catalogKindOf`): llm_model, whisper_model, tts_model_file, image_gen_model, video_gen_model, ner_model, wake_word_model, lora. */
|
|
1112
|
+
/** The admin Catalogs kind (`catalogKindOf`): llm_model, whisper_model, tts_model_file, image_gen_model, video_gen_model, ner_model, wake_word_model, lora, embedding_model, or unknown (no rule places it; `catalogKindVerdict` says why). */
|
|
1113
1113
|
kind?: string;
|
|
1114
1114
|
/** At least one variant is offered (Matrx 2 lists it). */
|
|
1115
1115
|
offered?: boolean;
|
|
@@ -1845,8 +1845,12 @@ interface ReadModelCatalogOptions {
|
|
|
1845
1845
|
appInstanceIds?: readonly string[];
|
|
1846
1846
|
};
|
|
1847
1847
|
}
|
|
1848
|
+
/** The kind of a model the catalog cannot place by its capabilities: shown loudly, never offered to a chat. */
|
|
1849
|
+
declare const UNKNOWN_MODEL_KIND: "unknown";
|
|
1848
1850
|
/** The catalog kinds whose rows live in the unified catalog (ai.*): the admin Catalogs page's model kinds. */
|
|
1849
1851
|
declare const MODEL_CATALOG_KINDS: ReadonlySet<string>;
|
|
1852
|
+
/** The interactions a text-in, text-out model answers a person in: only these make an llm_model. */
|
|
1853
|
+
declare const LLM_INTERACTIONS: ReadonlySet<string>;
|
|
1850
1854
|
/** What `catalogKindOf` reads from a model (a CuratedModel or a LocalModel from `readModelCatalog` both fit). */
|
|
1851
1855
|
interface CatalogKindInput {
|
|
1852
1856
|
readonly variants: ReadonlyArray<{
|
|
@@ -1861,11 +1865,20 @@ interface CatalogKindInput {
|
|
|
1861
1865
|
readonly shelf?: string | null;
|
|
1862
1866
|
} | null;
|
|
1863
1867
|
}
|
|
1868
|
+
/** A model's admin kind and, when it is `unknown`, why (one line, said on the admin page and in reader warnings). */
|
|
1869
|
+
interface CatalogKindVerdict {
|
|
1870
|
+
kind: string;
|
|
1871
|
+
reason: string | null;
|
|
1872
|
+
}
|
|
1864
1873
|
/**
|
|
1865
|
-
* THE admin Catalogs kind of a unified model
|
|
1866
|
-
* carry (the list migration stamps them), when that is a
|
|
1867
|
-
*
|
|
1874
|
+
* THE admin Catalogs kind of a unified model, with the reason when it cannot be placed: the kind of the
|
|
1875
|
+
* old public.catalog_entries rows its variants carry (the list migration stamps them), when that is a
|
|
1876
|
+
* model kind; else placed by what it does (capabilities, never a name list). There is NO default: a model
|
|
1877
|
+
* is an llm_model only when it takes text, gives text and answers in a chat-like interaction
|
|
1878
|
+
* (LLM_INTERACTIONS); anything the rules cannot place is `unknown`, with the reason.
|
|
1868
1879
|
*/
|
|
1880
|
+
declare function catalogKindVerdict(m: CatalogKindInput, kindOfEntry: ReadonlyMap<string, string>): CatalogKindVerdict;
|
|
1881
|
+
/** THE admin Catalogs kind of a unified model (`catalogKindVerdict(...).kind`); `unknown` when it cannot be placed. */
|
|
1869
1882
|
declare function catalogKindOf(m: CatalogKindInput, kindOfEntry: ReadonlyMap<string, string>): string;
|
|
1870
1883
|
/** sha256 (hex) of the catalog's canonical JSON, its own `catalog_fingerprint` left out. Isomorphic (pure JS). */
|
|
1871
1884
|
declare function catalogFingerprint(catalog: LocalModelCatalog): string;
|
|
@@ -2087,5 +2100,5 @@ interface ModelCatalogVisibilityOptions {
|
|
|
2087
2100
|
*/
|
|
2088
2101
|
declare function followModelCatalogVisibility(options: ModelCatalogVisibilityOptions): () => void;
|
|
2089
2102
|
|
|
2090
|
-
export { CHAT_DEFAULT_MODEL_KNOB, CONTENT_TYPES, DEFAULT_CAPABILITIES, DEVICE_FILE_USABLE_STATES, DEVICE_OWN_FILE_USABLE_STATES, DEVICE_RULE_TWIN_FIXTURE, DEVICE_SERVED_SETTINGS_KEY, DEVICE_SERVED_VIA, DeviceModelUnavailableError, EMPTY_MODEL_RECORDS, EXCLUDED_REVIEW_STATES, FEATURE_BUCKETS, FEATURE_BUCKET_ORDER, FEATURE_KEYS, FILE_TYPE_QUANT, GgufError, INPUT_MODALITIES, INTERACTION_MODES, MAX_SUCCESSION_HOPS, MODEL_CATALOG_KINDS, MODEL_FAVORITE_ENTITY_TYPE, NEW_AGENT_DEFAULT_MODEL_KNOB, OUTPUT_MODALITIES, SERVICE_LABEL, SERVICE_LABEL_PLURAL, TOP_TIER_COST_RATING, TOP_TIER_LOCKED_TITLE, acceptsTextInstructions, announceModelCatalogChanged, availableOnDevices, blendedPrice, buildModelClassIndex, buildSuccessionIndex, catalogFingerprint, catalogForApp, catalogKeyColumn, catalogKindOf, cheapestAdequateModel, classConfigKey, collapseTiersByClass, costRatingTier, costRatingWord, createModelCatalog, createModelFavorites, createModelRecords, curatedList, displayOrderOf, favoriteIdsEqual, fetchCuratedModels, findNonCanonicalCapabilityValues, fitsMemory, fitsNeed, fitsThisComputer, followModelCatalogChanges, followModelCatalogVisibility, formatMemoryBytes, fromDiscovery, ggufEngine, ggufFacts, groupFeatures, hardwareClassesOf, hasCompatibleDecisionInteraction, isChatModelCapability, isContentType, isConversationalModelCapability, isDecisionModelCapability, isFeatureKey, isHelperGguf, isInteractionMode, isListedVariant, isLocalModelCatalog, isManagedAgentModelCapability, isModelCatalogChange, isProjectorName, isSupersedable, isTopTierRating, judgeHeaderFacts, mergeAuditRecordIntoCapabilities, missingShards, modelCatalogRevision, modelClassKnobFor, modelClassName, modelClassPinOf, modelDisplayLabel, modelsForSelectionPurpose, normalizeArch, normalizeModel, normalizeModels, normalizeOs, normalizePromptSettings, onModelCatalogChanged, orderCatalogGroups, orderCatalogModels, outputFormatControlKey, parseCapabilities, pickProjector, priceTierRating, quantFromName, rankVariants, readCuratedRows, readDeviceModelFiles, readGgufHeader, readModelCatalog, readModelCatalogStamp, readModelIdentities, readPublicModel, reconcileModelFavoriteIds, reportModelDiagnostic, requireCanonicalCapabilities, requiredArtifactIds, requiredArtifacts, resetSuccessionLogForTests, resolveDeviceModel, resolveLiveModelId, resolveModelMapKnob, resolveNewAgentModelId, resolvePreferredModelChoice, resolveSuccessor, runtimesOnEngine, seesImages, selectActiveModels, selectActiveModelsReady, selectAllModelOptions, selectAllModels, selectAllModelsReady, selectDeprecatedModels, selectDeprecatedModelsReady, selectModelById, selectModelClassConfig, selectModelClassName, selectModelControls, selectModelDetailError, selectModelFetchType, selectModelFullyLoaded, selectModelIdentityById, selectModelIdentityLookupStatus, selectModelLabelById, selectModelLabelWithClass, selectModelNameById, selectModelOptions, selectVariant, serviceCountLabel, setModelDiagnosticsSink, shapeCuratedModels, shardFileName, shardName, speedRatingLabel, speedRatingWord, splitSetProblems, takesInput, toAuditRecord, toDeviceModelFile, validateModelSet, variantVerdict, withModelClass };
|
|
2091
|
-
export type { AdminOffering, AdminPricingBand, ArtifactUse, AuditCapabilitiesRecord, AvailabilityVariant, CapabilitiesParseContext, CatalogKeyColumn, CatalogKindInput, CatalogModel, CatalogTier, CheapestAdequateOptions, CompatStatus, ContentType, CuratedCatalogClient, CuratedModel, CuratedPresentation, CuratedRows, CuratedVariant, DecidedBy, DeviceAvailability, DeviceGraphics, DeviceHardware, DeviceModelFile, DeviceModelResolution, DeviceServedSettings, DiscoveryAmbiguity, DiscoveryArtifact, DiscoveryMedia, DiscoveryResult, DiscoveryRuntime, DiscoverySource, DiscoveryVariant, FeatureBucket, FeatureBucketMeta, FeatureKey, FitCapabilities, GgufHeader, GgufRead, GgufTensor, GroupedFeatures, HardwareClass, HardwareClasses, HeaderFlag, HeaderJudgement, HeaderRefusal, Interaction, InteractionMode, LocalArtifact, LocalCatalogClient, LocalCatalogQuery, LocalCompatRow, LocalModel, LocalModelCatalog, LocalPresentation, LocalRuntime, LocalRuntimeBuild, LocalVariant, Modality, ModelCapabilities, ModelCatalog, ModelCatalogChangePayload, ModelCatalogClient, ModelCatalogConfig, ModelCatalogDirectiveSubscribe, ModelCatalogErrorSink, ModelCatalogPgError, ModelCatalogPgResult, ModelCatalogQuery, ModelCatalogState, ModelCatalogVariant, ModelCatalogVariantState, ModelCatalogVisibilityOptions, ModelClassConfig, ModelClassEntry, ModelClassIndex, ModelDiagnosticEntry, ModelDiagnosticsSink, ModelFavorites, ModelFavoritesCache, ModelFavoritesClient, ModelFavoritesConfig, ModelFavoritesErrorSink, ModelFavoritesState, ModelFetchScope, ModelFileHandle, ModelFit, ModelIdentityRow, ModelJson, ModelLabelSource, ModelNeed, ModelOfferingRow, ModelOption, ModelOptionWithLifecycle, ModelRecord, ModelRecordFetchType, ModelRecords, ModelRecordsClient, ModelRecordsConfig, ModelRecordsState, ModelSelectionPurpose, ModelSetEnv, ModelSetFacts, ModelSetValidation, NewAgentModel, NoSelection, OrderedLike, PreferredModelChoice, PreferredModelChoicePorts, PriceTier, PricedCatalogModel, PublicModelClient, RankOptions, RankedVariant, ReadModelCatalogOptions, SelectDevice, Selection, ShardName, SuccessionClient, SuccessionIndex, SuccessionNode, VariantDiscovery, VariantVerdict, Want };
|
|
2103
|
+
export { CHAT_DEFAULT_MODEL_KNOB, CONTENT_TYPES, DEFAULT_CAPABILITIES, DEVICE_FILE_USABLE_STATES, DEVICE_OWN_FILE_USABLE_STATES, DEVICE_RULE_TWIN_FIXTURE, DEVICE_SERVED_SETTINGS_KEY, DEVICE_SERVED_VIA, DeviceModelUnavailableError, EMPTY_MODEL_RECORDS, EXCLUDED_REVIEW_STATES, FEATURE_BUCKETS, FEATURE_BUCKET_ORDER, FEATURE_KEYS, FILE_TYPE_QUANT, GgufError, INPUT_MODALITIES, INTERACTION_MODES, LLM_INTERACTIONS, MAX_SUCCESSION_HOPS, MODEL_CATALOG_KINDS, MODEL_FAVORITE_ENTITY_TYPE, NEW_AGENT_DEFAULT_MODEL_KNOB, OUTPUT_MODALITIES, SERVICE_LABEL, SERVICE_LABEL_PLURAL, TOP_TIER_COST_RATING, TOP_TIER_LOCKED_TITLE, UNKNOWN_MODEL_KIND, acceptsTextInstructions, announceModelCatalogChanged, availableOnDevices, blendedPrice, buildModelClassIndex, buildSuccessionIndex, catalogFingerprint, catalogForApp, catalogKeyColumn, catalogKindOf, catalogKindVerdict, cheapestAdequateModel, classConfigKey, collapseTiersByClass, costRatingTier, costRatingWord, createModelCatalog, createModelFavorites, createModelRecords, curatedList, displayOrderOf, favoriteIdsEqual, fetchCuratedModels, findNonCanonicalCapabilityValues, fitsMemory, fitsNeed, fitsThisComputer, followModelCatalogChanges, followModelCatalogVisibility, formatMemoryBytes, fromDiscovery, ggufEngine, ggufFacts, groupFeatures, hardwareClassesOf, hasCompatibleDecisionInteraction, isChatModelCapability, isContentType, isConversationalModelCapability, isDecisionModelCapability, isFeatureKey, isHelperGguf, isInteractionMode, isListedVariant, isLocalModelCatalog, isManagedAgentModelCapability, isModelCatalogChange, isProjectorName, isSupersedable, isTopTierRating, judgeHeaderFacts, mergeAuditRecordIntoCapabilities, missingShards, modelCatalogRevision, modelClassKnobFor, modelClassName, modelClassPinOf, modelDisplayLabel, modelsForSelectionPurpose, normalizeArch, normalizeModel, normalizeModels, normalizeOs, normalizePromptSettings, onModelCatalogChanged, orderCatalogGroups, orderCatalogModels, outputFormatControlKey, parseCapabilities, pickProjector, priceTierRating, quantFromName, rankVariants, readCuratedRows, readDeviceModelFiles, readGgufHeader, readModelCatalog, readModelCatalogStamp, readModelIdentities, readPublicModel, reconcileModelFavoriteIds, reportModelDiagnostic, requireCanonicalCapabilities, requiredArtifactIds, requiredArtifacts, resetSuccessionLogForTests, resolveDeviceModel, resolveLiveModelId, resolveModelMapKnob, resolveNewAgentModelId, resolvePreferredModelChoice, resolveSuccessor, runtimesOnEngine, seesImages, selectActiveModels, selectActiveModelsReady, selectAllModelOptions, selectAllModels, selectAllModelsReady, selectDeprecatedModels, selectDeprecatedModelsReady, selectModelById, selectModelClassConfig, selectModelClassName, selectModelControls, selectModelDetailError, selectModelFetchType, selectModelFullyLoaded, selectModelIdentityById, selectModelIdentityLookupStatus, selectModelLabelById, selectModelLabelWithClass, selectModelNameById, selectModelOptions, selectVariant, serviceCountLabel, setModelDiagnosticsSink, shapeCuratedModels, shardFileName, shardName, speedRatingLabel, speedRatingWord, splitSetProblems, takesInput, toAuditRecord, toDeviceModelFile, validateModelSet, variantVerdict, withModelClass };
|
|
2104
|
+
export type { AdminOffering, AdminPricingBand, ArtifactUse, AuditCapabilitiesRecord, AvailabilityVariant, CapabilitiesParseContext, CatalogKeyColumn, CatalogKindInput, CatalogKindVerdict, CatalogModel, CatalogTier, CheapestAdequateOptions, CompatStatus, ContentType, CuratedCatalogClient, CuratedModel, CuratedPresentation, CuratedRows, CuratedVariant, DecidedBy, DeviceAvailability, DeviceGraphics, DeviceHardware, DeviceModelFile, DeviceModelResolution, DeviceServedSettings, DiscoveryAmbiguity, DiscoveryArtifact, DiscoveryMedia, DiscoveryResult, DiscoveryRuntime, DiscoverySource, DiscoveryVariant, FeatureBucket, FeatureBucketMeta, FeatureKey, FitCapabilities, GgufHeader, GgufRead, GgufTensor, GroupedFeatures, HardwareClass, HardwareClasses, HeaderFlag, HeaderJudgement, HeaderRefusal, Interaction, InteractionMode, LocalArtifact, LocalCatalogClient, LocalCatalogQuery, LocalCompatRow, LocalModel, LocalModelCatalog, LocalPresentation, LocalRuntime, LocalRuntimeBuild, LocalVariant, Modality, ModelCapabilities, ModelCatalog, ModelCatalogChangePayload, ModelCatalogClient, ModelCatalogConfig, ModelCatalogDirectiveSubscribe, ModelCatalogErrorSink, ModelCatalogPgError, ModelCatalogPgResult, ModelCatalogQuery, ModelCatalogState, ModelCatalogVariant, ModelCatalogVariantState, ModelCatalogVisibilityOptions, ModelClassConfig, ModelClassEntry, ModelClassIndex, ModelDiagnosticEntry, ModelDiagnosticsSink, ModelFavorites, ModelFavoritesCache, ModelFavoritesClient, ModelFavoritesConfig, ModelFavoritesErrorSink, ModelFavoritesState, ModelFetchScope, ModelFileHandle, ModelFit, ModelIdentityRow, ModelJson, ModelLabelSource, ModelNeed, ModelOfferingRow, ModelOption, ModelOptionWithLifecycle, ModelRecord, ModelRecordFetchType, ModelRecords, ModelRecordsClient, ModelRecordsConfig, ModelRecordsState, ModelSelectionPurpose, ModelSetEnv, ModelSetFacts, ModelSetValidation, NewAgentModel, NoSelection, OrderedLike, PreferredModelChoice, PreferredModelChoicePorts, PriceTier, PricedCatalogModel, PublicModelClient, RankOptions, RankedVariant, ReadModelCatalogOptions, SelectDevice, Selection, ShardName, SuccessionClient, SuccessionIndex, SuccessionNode, VariantDiscovery, VariantVerdict, Want };
|
package/dist/models/index.d.ts
CHANGED
|
@@ -1109,7 +1109,7 @@ interface LocalModel {
|
|
|
1109
1109
|
/** Matrx 2's 1.48 id for a model seeded from its old list (metadata.desktop_id). */
|
|
1110
1110
|
desktop_id?: string | null;
|
|
1111
1111
|
maker_logo_file_id?: string | null;
|
|
1112
|
-
/** The admin Catalogs kind (`catalogKindOf`): llm_model, whisper_model, tts_model_file, image_gen_model, video_gen_model, ner_model, wake_word_model, lora. */
|
|
1112
|
+
/** The admin Catalogs kind (`catalogKindOf`): llm_model, whisper_model, tts_model_file, image_gen_model, video_gen_model, ner_model, wake_word_model, lora, embedding_model, or unknown (no rule places it; `catalogKindVerdict` says why). */
|
|
1113
1113
|
kind?: string;
|
|
1114
1114
|
/** At least one variant is offered (Matrx 2 lists it). */
|
|
1115
1115
|
offered?: boolean;
|
|
@@ -1845,8 +1845,12 @@ interface ReadModelCatalogOptions {
|
|
|
1845
1845
|
appInstanceIds?: readonly string[];
|
|
1846
1846
|
};
|
|
1847
1847
|
}
|
|
1848
|
+
/** The kind of a model the catalog cannot place by its capabilities: shown loudly, never offered to a chat. */
|
|
1849
|
+
declare const UNKNOWN_MODEL_KIND: "unknown";
|
|
1848
1850
|
/** The catalog kinds whose rows live in the unified catalog (ai.*): the admin Catalogs page's model kinds. */
|
|
1849
1851
|
declare const MODEL_CATALOG_KINDS: ReadonlySet<string>;
|
|
1852
|
+
/** The interactions a text-in, text-out model answers a person in: only these make an llm_model. */
|
|
1853
|
+
declare const LLM_INTERACTIONS: ReadonlySet<string>;
|
|
1850
1854
|
/** What `catalogKindOf` reads from a model (a CuratedModel or a LocalModel from `readModelCatalog` both fit). */
|
|
1851
1855
|
interface CatalogKindInput {
|
|
1852
1856
|
readonly variants: ReadonlyArray<{
|
|
@@ -1861,11 +1865,20 @@ interface CatalogKindInput {
|
|
|
1861
1865
|
readonly shelf?: string | null;
|
|
1862
1866
|
} | null;
|
|
1863
1867
|
}
|
|
1868
|
+
/** A model's admin kind and, when it is `unknown`, why (one line, said on the admin page and in reader warnings). */
|
|
1869
|
+
interface CatalogKindVerdict {
|
|
1870
|
+
kind: string;
|
|
1871
|
+
reason: string | null;
|
|
1872
|
+
}
|
|
1864
1873
|
/**
|
|
1865
|
-
* THE admin Catalogs kind of a unified model
|
|
1866
|
-
* carry (the list migration stamps them), when that is a
|
|
1867
|
-
*
|
|
1874
|
+
* THE admin Catalogs kind of a unified model, with the reason when it cannot be placed: the kind of the
|
|
1875
|
+
* old public.catalog_entries rows its variants carry (the list migration stamps them), when that is a
|
|
1876
|
+
* model kind; else placed by what it does (capabilities, never a name list). There is NO default: a model
|
|
1877
|
+
* is an llm_model only when it takes text, gives text and answers in a chat-like interaction
|
|
1878
|
+
* (LLM_INTERACTIONS); anything the rules cannot place is `unknown`, with the reason.
|
|
1868
1879
|
*/
|
|
1880
|
+
declare function catalogKindVerdict(m: CatalogKindInput, kindOfEntry: ReadonlyMap<string, string>): CatalogKindVerdict;
|
|
1881
|
+
/** THE admin Catalogs kind of a unified model (`catalogKindVerdict(...).kind`); `unknown` when it cannot be placed. */
|
|
1869
1882
|
declare function catalogKindOf(m: CatalogKindInput, kindOfEntry: ReadonlyMap<string, string>): string;
|
|
1870
1883
|
/** sha256 (hex) of the catalog's canonical JSON, its own `catalog_fingerprint` left out. Isomorphic (pure JS). */
|
|
1871
1884
|
declare function catalogFingerprint(catalog: LocalModelCatalog): string;
|
|
@@ -2087,5 +2100,5 @@ interface ModelCatalogVisibilityOptions {
|
|
|
2087
2100
|
*/
|
|
2088
2101
|
declare function followModelCatalogVisibility(options: ModelCatalogVisibilityOptions): () => void;
|
|
2089
2102
|
|
|
2090
|
-
export { CHAT_DEFAULT_MODEL_KNOB, CONTENT_TYPES, DEFAULT_CAPABILITIES, DEVICE_FILE_USABLE_STATES, DEVICE_OWN_FILE_USABLE_STATES, DEVICE_RULE_TWIN_FIXTURE, DEVICE_SERVED_SETTINGS_KEY, DEVICE_SERVED_VIA, DeviceModelUnavailableError, EMPTY_MODEL_RECORDS, EXCLUDED_REVIEW_STATES, FEATURE_BUCKETS, FEATURE_BUCKET_ORDER, FEATURE_KEYS, FILE_TYPE_QUANT, GgufError, INPUT_MODALITIES, INTERACTION_MODES, MAX_SUCCESSION_HOPS, MODEL_CATALOG_KINDS, MODEL_FAVORITE_ENTITY_TYPE, NEW_AGENT_DEFAULT_MODEL_KNOB, OUTPUT_MODALITIES, SERVICE_LABEL, SERVICE_LABEL_PLURAL, TOP_TIER_COST_RATING, TOP_TIER_LOCKED_TITLE, acceptsTextInstructions, announceModelCatalogChanged, availableOnDevices, blendedPrice, buildModelClassIndex, buildSuccessionIndex, catalogFingerprint, catalogForApp, catalogKeyColumn, catalogKindOf, cheapestAdequateModel, classConfigKey, collapseTiersByClass, costRatingTier, costRatingWord, createModelCatalog, createModelFavorites, createModelRecords, curatedList, displayOrderOf, favoriteIdsEqual, fetchCuratedModels, findNonCanonicalCapabilityValues, fitsMemory, fitsNeed, fitsThisComputer, followModelCatalogChanges, followModelCatalogVisibility, formatMemoryBytes, fromDiscovery, ggufEngine, ggufFacts, groupFeatures, hardwareClassesOf, hasCompatibleDecisionInteraction, isChatModelCapability, isContentType, isConversationalModelCapability, isDecisionModelCapability, isFeatureKey, isHelperGguf, isInteractionMode, isListedVariant, isLocalModelCatalog, isManagedAgentModelCapability, isModelCatalogChange, isProjectorName, isSupersedable, isTopTierRating, judgeHeaderFacts, mergeAuditRecordIntoCapabilities, missingShards, modelCatalogRevision, modelClassKnobFor, modelClassName, modelClassPinOf, modelDisplayLabel, modelsForSelectionPurpose, normalizeArch, normalizeModel, normalizeModels, normalizeOs, normalizePromptSettings, onModelCatalogChanged, orderCatalogGroups, orderCatalogModels, outputFormatControlKey, parseCapabilities, pickProjector, priceTierRating, quantFromName, rankVariants, readCuratedRows, readDeviceModelFiles, readGgufHeader, readModelCatalog, readModelCatalogStamp, readModelIdentities, readPublicModel, reconcileModelFavoriteIds, reportModelDiagnostic, requireCanonicalCapabilities, requiredArtifactIds, requiredArtifacts, resetSuccessionLogForTests, resolveDeviceModel, resolveLiveModelId, resolveModelMapKnob, resolveNewAgentModelId, resolvePreferredModelChoice, resolveSuccessor, runtimesOnEngine, seesImages, selectActiveModels, selectActiveModelsReady, selectAllModelOptions, selectAllModels, selectAllModelsReady, selectDeprecatedModels, selectDeprecatedModelsReady, selectModelById, selectModelClassConfig, selectModelClassName, selectModelControls, selectModelDetailError, selectModelFetchType, selectModelFullyLoaded, selectModelIdentityById, selectModelIdentityLookupStatus, selectModelLabelById, selectModelLabelWithClass, selectModelNameById, selectModelOptions, selectVariant, serviceCountLabel, setModelDiagnosticsSink, shapeCuratedModels, shardFileName, shardName, speedRatingLabel, speedRatingWord, splitSetProblems, takesInput, toAuditRecord, toDeviceModelFile, validateModelSet, variantVerdict, withModelClass };
|
|
2091
|
-
export type { AdminOffering, AdminPricingBand, ArtifactUse, AuditCapabilitiesRecord, AvailabilityVariant, CapabilitiesParseContext, CatalogKeyColumn, CatalogKindInput, CatalogModel, CatalogTier, CheapestAdequateOptions, CompatStatus, ContentType, CuratedCatalogClient, CuratedModel, CuratedPresentation, CuratedRows, CuratedVariant, DecidedBy, DeviceAvailability, DeviceGraphics, DeviceHardware, DeviceModelFile, DeviceModelResolution, DeviceServedSettings, DiscoveryAmbiguity, DiscoveryArtifact, DiscoveryMedia, DiscoveryResult, DiscoveryRuntime, DiscoverySource, DiscoveryVariant, FeatureBucket, FeatureBucketMeta, FeatureKey, FitCapabilities, GgufHeader, GgufRead, GgufTensor, GroupedFeatures, HardwareClass, HardwareClasses, HeaderFlag, HeaderJudgement, HeaderRefusal, Interaction, InteractionMode, LocalArtifact, LocalCatalogClient, LocalCatalogQuery, LocalCompatRow, LocalModel, LocalModelCatalog, LocalPresentation, LocalRuntime, LocalRuntimeBuild, LocalVariant, Modality, ModelCapabilities, ModelCatalog, ModelCatalogChangePayload, ModelCatalogClient, ModelCatalogConfig, ModelCatalogDirectiveSubscribe, ModelCatalogErrorSink, ModelCatalogPgError, ModelCatalogPgResult, ModelCatalogQuery, ModelCatalogState, ModelCatalogVariant, ModelCatalogVariantState, ModelCatalogVisibilityOptions, ModelClassConfig, ModelClassEntry, ModelClassIndex, ModelDiagnosticEntry, ModelDiagnosticsSink, ModelFavorites, ModelFavoritesCache, ModelFavoritesClient, ModelFavoritesConfig, ModelFavoritesErrorSink, ModelFavoritesState, ModelFetchScope, ModelFileHandle, ModelFit, ModelIdentityRow, ModelJson, ModelLabelSource, ModelNeed, ModelOfferingRow, ModelOption, ModelOptionWithLifecycle, ModelRecord, ModelRecordFetchType, ModelRecords, ModelRecordsClient, ModelRecordsConfig, ModelRecordsState, ModelSelectionPurpose, ModelSetEnv, ModelSetFacts, ModelSetValidation, NewAgentModel, NoSelection, OrderedLike, PreferredModelChoice, PreferredModelChoicePorts, PriceTier, PricedCatalogModel, PublicModelClient, RankOptions, RankedVariant, ReadModelCatalogOptions, SelectDevice, Selection, ShardName, SuccessionClient, SuccessionIndex, SuccessionNode, VariantDiscovery, VariantVerdict, Want };
|
|
2103
|
+
export { CHAT_DEFAULT_MODEL_KNOB, CONTENT_TYPES, DEFAULT_CAPABILITIES, DEVICE_FILE_USABLE_STATES, DEVICE_OWN_FILE_USABLE_STATES, DEVICE_RULE_TWIN_FIXTURE, DEVICE_SERVED_SETTINGS_KEY, DEVICE_SERVED_VIA, DeviceModelUnavailableError, EMPTY_MODEL_RECORDS, EXCLUDED_REVIEW_STATES, FEATURE_BUCKETS, FEATURE_BUCKET_ORDER, FEATURE_KEYS, FILE_TYPE_QUANT, GgufError, INPUT_MODALITIES, INTERACTION_MODES, LLM_INTERACTIONS, MAX_SUCCESSION_HOPS, MODEL_CATALOG_KINDS, MODEL_FAVORITE_ENTITY_TYPE, NEW_AGENT_DEFAULT_MODEL_KNOB, OUTPUT_MODALITIES, SERVICE_LABEL, SERVICE_LABEL_PLURAL, TOP_TIER_COST_RATING, TOP_TIER_LOCKED_TITLE, UNKNOWN_MODEL_KIND, acceptsTextInstructions, announceModelCatalogChanged, availableOnDevices, blendedPrice, buildModelClassIndex, buildSuccessionIndex, catalogFingerprint, catalogForApp, catalogKeyColumn, catalogKindOf, catalogKindVerdict, cheapestAdequateModel, classConfigKey, collapseTiersByClass, costRatingTier, costRatingWord, createModelCatalog, createModelFavorites, createModelRecords, curatedList, displayOrderOf, favoriteIdsEqual, fetchCuratedModels, findNonCanonicalCapabilityValues, fitsMemory, fitsNeed, fitsThisComputer, followModelCatalogChanges, followModelCatalogVisibility, formatMemoryBytes, fromDiscovery, ggufEngine, ggufFacts, groupFeatures, hardwareClassesOf, hasCompatibleDecisionInteraction, isChatModelCapability, isContentType, isConversationalModelCapability, isDecisionModelCapability, isFeatureKey, isHelperGguf, isInteractionMode, isListedVariant, isLocalModelCatalog, isManagedAgentModelCapability, isModelCatalogChange, isProjectorName, isSupersedable, isTopTierRating, judgeHeaderFacts, mergeAuditRecordIntoCapabilities, missingShards, modelCatalogRevision, modelClassKnobFor, modelClassName, modelClassPinOf, modelDisplayLabel, modelsForSelectionPurpose, normalizeArch, normalizeModel, normalizeModels, normalizeOs, normalizePromptSettings, onModelCatalogChanged, orderCatalogGroups, orderCatalogModels, outputFormatControlKey, parseCapabilities, pickProjector, priceTierRating, quantFromName, rankVariants, readCuratedRows, readDeviceModelFiles, readGgufHeader, readModelCatalog, readModelCatalogStamp, readModelIdentities, readPublicModel, reconcileModelFavoriteIds, reportModelDiagnostic, requireCanonicalCapabilities, requiredArtifactIds, requiredArtifacts, resetSuccessionLogForTests, resolveDeviceModel, resolveLiveModelId, resolveModelMapKnob, resolveNewAgentModelId, resolvePreferredModelChoice, resolveSuccessor, runtimesOnEngine, seesImages, selectActiveModels, selectActiveModelsReady, selectAllModelOptions, selectAllModels, selectAllModelsReady, selectDeprecatedModels, selectDeprecatedModelsReady, selectModelById, selectModelClassConfig, selectModelClassName, selectModelControls, selectModelDetailError, selectModelFetchType, selectModelFullyLoaded, selectModelIdentityById, selectModelIdentityLookupStatus, selectModelLabelById, selectModelLabelWithClass, selectModelNameById, selectModelOptions, selectVariant, serviceCountLabel, setModelDiagnosticsSink, shapeCuratedModels, shardFileName, shardName, speedRatingLabel, speedRatingWord, splitSetProblems, takesInput, toAuditRecord, toDeviceModelFile, validateModelSet, variantVerdict, withModelClass };
|
|
2104
|
+
export type { AdminOffering, AdminPricingBand, ArtifactUse, AuditCapabilitiesRecord, AvailabilityVariant, CapabilitiesParseContext, CatalogKeyColumn, CatalogKindInput, CatalogKindVerdict, CatalogModel, CatalogTier, CheapestAdequateOptions, CompatStatus, ContentType, CuratedCatalogClient, CuratedModel, CuratedPresentation, CuratedRows, CuratedVariant, DecidedBy, DeviceAvailability, DeviceGraphics, DeviceHardware, DeviceModelFile, DeviceModelResolution, DeviceServedSettings, DiscoveryAmbiguity, DiscoveryArtifact, DiscoveryMedia, DiscoveryResult, DiscoveryRuntime, DiscoverySource, DiscoveryVariant, FeatureBucket, FeatureBucketMeta, FeatureKey, FitCapabilities, GgufHeader, GgufRead, GgufTensor, GroupedFeatures, HardwareClass, HardwareClasses, HeaderFlag, HeaderJudgement, HeaderRefusal, Interaction, InteractionMode, LocalArtifact, LocalCatalogClient, LocalCatalogQuery, LocalCompatRow, LocalModel, LocalModelCatalog, LocalPresentation, LocalRuntime, LocalRuntimeBuild, LocalVariant, Modality, ModelCapabilities, ModelCatalog, ModelCatalogChangePayload, ModelCatalogClient, ModelCatalogConfig, ModelCatalogDirectiveSubscribe, ModelCatalogErrorSink, ModelCatalogPgError, ModelCatalogPgResult, ModelCatalogQuery, ModelCatalogState, ModelCatalogVariant, ModelCatalogVariantState, ModelCatalogVisibilityOptions, ModelClassConfig, ModelClassEntry, ModelClassIndex, ModelDiagnosticEntry, ModelDiagnosticsSink, ModelFavorites, ModelFavoritesCache, ModelFavoritesClient, ModelFavoritesConfig, ModelFavoritesErrorSink, ModelFavoritesState, ModelFetchScope, ModelFileHandle, ModelFit, ModelIdentityRow, ModelJson, ModelLabelSource, ModelNeed, ModelOfferingRow, ModelOption, ModelOptionWithLifecycle, ModelRecord, ModelRecordFetchType, ModelRecords, ModelRecordsClient, ModelRecordsConfig, ModelRecordsState, ModelSelectionPurpose, ModelSetEnv, ModelSetFacts, ModelSetValidation, NewAgentModel, NoSelection, OrderedLike, PreferredModelChoice, PreferredModelChoicePorts, PriceTier, PricedCatalogModel, PublicModelClient, RankOptions, RankedVariant, ReadModelCatalogOptions, SelectDevice, Selection, ShardName, SuccessionClient, SuccessionIndex, SuccessionNode, VariantDiscovery, VariantVerdict, Want };
|
package/dist/models/index.js
CHANGED
|
@@ -2701,6 +2701,7 @@ var DeviceModelUnavailableError = class extends Error {
|
|
|
2701
2701
|
};
|
|
2702
2702
|
|
|
2703
2703
|
// models/catalog-reader.ts
|
|
2704
|
+
var UNKNOWN_MODEL_KIND = "unknown";
|
|
2704
2705
|
var MODEL_CATALOG_KINDS = /* @__PURE__ */ new Set([
|
|
2705
2706
|
"llm_model",
|
|
2706
2707
|
"whisper_model",
|
|
@@ -2709,23 +2710,35 @@ var MODEL_CATALOG_KINDS = /* @__PURE__ */ new Set([
|
|
|
2709
2710
|
"video_gen_model",
|
|
2710
2711
|
"ner_model",
|
|
2711
2712
|
"wake_word_model",
|
|
2712
|
-
"lora"
|
|
2713
|
+
"lora",
|
|
2714
|
+
"embedding_model",
|
|
2715
|
+
UNKNOWN_MODEL_KIND
|
|
2713
2716
|
]);
|
|
2714
|
-
|
|
2717
|
+
var LLM_INTERACTIONS = /* @__PURE__ */ new Set(["turn", "single", "agent"]);
|
|
2718
|
+
function catalogKindVerdict(m, kindOfEntry) {
|
|
2715
2719
|
for (const v of m.variants)
|
|
2716
2720
|
for (const id of v.catalog_entry_ids ?? []) {
|
|
2717
2721
|
const k = kindOfEntry.get(id);
|
|
2718
|
-
if (k && MODEL_CATALOG_KINDS.has(k)) return k;
|
|
2722
|
+
if (k && k !== UNKNOWN_MODEL_KIND && MODEL_CATALOG_KINDS.has(k)) return { kind: k, reason: null };
|
|
2719
2723
|
}
|
|
2720
2724
|
const out = m.capabilities.output ?? [];
|
|
2721
2725
|
const inp = m.capabilities.input ?? [];
|
|
2722
|
-
|
|
2723
|
-
|
|
2724
|
-
if (
|
|
2725
|
-
if (out.includes("
|
|
2726
|
-
if (
|
|
2727
|
-
if (
|
|
2728
|
-
return "
|
|
2726
|
+
const interaction = m.capabilities.interaction ?? "";
|
|
2727
|
+
const placed = (kind) => ({ kind, reason: null });
|
|
2728
|
+
if (m.presentation?.shelf === "loras" || interaction === "adapter") return placed("lora");
|
|
2729
|
+
if (out.includes("video")) return placed("video_gen_model");
|
|
2730
|
+
if (out.includes("image")) return placed("image_gen_model");
|
|
2731
|
+
if (out.includes("embedding")) return placed("embedding_model");
|
|
2732
|
+
if (out.includes("audio")) return placed("tts_model_file");
|
|
2733
|
+
if (inp.includes("audio") && (out.includes("decision") || interaction === "detection")) return placed("wake_word_model");
|
|
2734
|
+
if (inp.includes("audio") && out.includes("text")) return placed("whisper_model");
|
|
2735
|
+
if (interaction === "extraction") return placed("ner_model");
|
|
2736
|
+
if (inp.includes("text") && out.includes("text") && LLM_INTERACTIONS.has(interaction)) return placed("llm_model");
|
|
2737
|
+
const shape = `input [${inp.join(", ")}], output [${out.join(", ")}], interaction ${interaction || "(none)"}`;
|
|
2738
|
+
return { kind: UNKNOWN_MODEL_KIND, reason: `no kind rule places ${shape}` };
|
|
2739
|
+
}
|
|
2740
|
+
function catalogKindOf(m, kindOfEntry) {
|
|
2741
|
+
return catalogKindVerdict(m, kindOfEntry).kind;
|
|
2729
2742
|
}
|
|
2730
2743
|
function canonicalJson(value) {
|
|
2731
2744
|
if (value === void 0) return "null";
|
|
@@ -2804,6 +2817,8 @@ async function readCatalogWith(client, opts, preread) {
|
|
|
2804
2817
|
const p = presentationOf.get(c.id);
|
|
2805
2818
|
stamp(p);
|
|
2806
2819
|
const maker = providerById.get(s3(m.provider_id));
|
|
2820
|
+
const verdict = catalogKindVerdict(c, kindOfEntry);
|
|
2821
|
+
if (verdict.reason) warnings.push(`${s3(m.name)}: kind unknown: ${verdict.reason}`);
|
|
2807
2822
|
return [
|
|
2808
2823
|
{
|
|
2809
2824
|
id: s3(m.id),
|
|
@@ -2814,7 +2829,7 @@ async function readCatalogWith(client, opts, preread) {
|
|
|
2814
2829
|
maker_logo_file_id: sn3(maker?.logo_file_id),
|
|
2815
2830
|
description: sn3(m.description),
|
|
2816
2831
|
capabilities: m.capabilities ?? {},
|
|
2817
|
-
kind:
|
|
2832
|
+
kind: verdict.kind,
|
|
2818
2833
|
offered: c.offered,
|
|
2819
2834
|
updated_at: c.updated_at,
|
|
2820
2835
|
presentation: p ? {
|
|
@@ -3055,6 +3070,7 @@ export {
|
|
|
3055
3070
|
GgufError,
|
|
3056
3071
|
INPUT_MODALITIES,
|
|
3057
3072
|
INTERACTION_MODES,
|
|
3073
|
+
LLM_INTERACTIONS,
|
|
3058
3074
|
MAX_SUCCESSION_HOPS,
|
|
3059
3075
|
MODEL_CATALOG_KINDS,
|
|
3060
3076
|
MODEL_FAVORITE_ENTITY_TYPE,
|
|
@@ -3064,6 +3080,7 @@ export {
|
|
|
3064
3080
|
SERVICE_LABEL_PLURAL,
|
|
3065
3081
|
TOP_TIER_COST_RATING,
|
|
3066
3082
|
TOP_TIER_LOCKED_TITLE,
|
|
3083
|
+
UNKNOWN_MODEL_KIND,
|
|
3067
3084
|
acceptsTextInstructions,
|
|
3068
3085
|
announceModelCatalogChanged,
|
|
3069
3086
|
availableOnDevices,
|
|
@@ -3074,6 +3091,7 @@ export {
|
|
|
3074
3091
|
catalogForApp,
|
|
3075
3092
|
catalogKeyColumn,
|
|
3076
3093
|
catalogKindOf,
|
|
3094
|
+
catalogKindVerdict,
|
|
3077
3095
|
cheapestAdequateModel,
|
|
3078
3096
|
classConfigKey,
|
|
3079
3097
|
collapseTiersByClass,
|
|
@@ -804,7 +804,7 @@ interface LocalModel {
|
|
|
804
804
|
/** Matrx 2's 1.48 id for a model seeded from its old list (metadata.desktop_id). */
|
|
805
805
|
desktop_id?: string | null;
|
|
806
806
|
maker_logo_file_id?: string | null;
|
|
807
|
-
/** The admin Catalogs kind (`catalogKindOf`): llm_model, whisper_model, tts_model_file, image_gen_model, video_gen_model, ner_model, wake_word_model, lora. */
|
|
807
|
+
/** The admin Catalogs kind (`catalogKindOf`): llm_model, whisper_model, tts_model_file, image_gen_model, video_gen_model, ner_model, wake_word_model, lora, embedding_model, or unknown (no rule places it; `catalogKindVerdict` says why). */
|
|
808
808
|
kind?: string;
|
|
809
809
|
/** At least one variant is offered (Matrx 2 lists it). */
|
|
810
810
|
offered?: boolean;
|
|
@@ -804,7 +804,7 @@ interface LocalModel {
|
|
|
804
804
|
/** Matrx 2's 1.48 id for a model seeded from its old list (metadata.desktop_id). */
|
|
805
805
|
desktop_id?: string | null;
|
|
806
806
|
maker_logo_file_id?: string | null;
|
|
807
|
-
/** The admin Catalogs kind (`catalogKindOf`): llm_model, whisper_model, tts_model_file, image_gen_model, video_gen_model, ner_model, wake_word_model, lora. */
|
|
807
|
+
/** The admin Catalogs kind (`catalogKindOf`): llm_model, whisper_model, tts_model_file, image_gen_model, video_gen_model, ner_model, wake_word_model, lora, embedding_model, or unknown (no rule places it; `catalogKindVerdict` says why). */
|
|
808
808
|
kind?: string;
|
|
809
809
|
/** At least one variant is offered (Matrx 2 lists it). */
|
|
810
810
|
offered?: boolean;
|
package/dist/settings/index.cjs
CHANGED
|
@@ -25,6 +25,7 @@ __export(settings_exports, {
|
|
|
25
25
|
CATALOGUE_KEYS: () => CATALOGUE_KEYS,
|
|
26
26
|
EMPTY_UI_GATES: () => EMPTY_UI_GATES,
|
|
27
27
|
ENUM_OFF_VALUE: () => ENUM_OFF_VALUE,
|
|
28
|
+
NEVER_IMPLICIT_AUTO_KEYS: () => NEVER_IMPLICIT_AUTO_KEYS,
|
|
28
29
|
PARAM_ALIASES: () => PARAM_ALIASES,
|
|
29
30
|
SETTINGS_CATALOGUE: () => SETTINGS_CATALOGUE,
|
|
30
31
|
UI_GATE_EDITABLE_KEYS: () => UI_GATE_EDITABLE_KEYS,
|
|
@@ -39,6 +40,7 @@ __export(settings_exports, {
|
|
|
39
40
|
extractModelDefaults: () => extractModelDefaults,
|
|
40
41
|
gateEnabled: () => gateEnabled,
|
|
41
42
|
getActionForMode: () => getActionForMode,
|
|
43
|
+
isNeverImplicitChoice: () => isNeverImplicitChoice,
|
|
42
44
|
isOffValue: () => isOffValue,
|
|
43
45
|
isUiGateKey: () => isUiGateKey,
|
|
44
46
|
isUnsetChoice: () => isUnsetChoice,
|
|
@@ -1032,13 +1034,19 @@ function withSettingState(settings, key, state, control, value) {
|
|
|
1032
1034
|
// settings/auto-means-unset.ts
|
|
1033
1035
|
var AUTO_VALUE = "auto";
|
|
1034
1036
|
var AUTO_MEANS_UNSET_KEYS = /* @__PURE__ */ new Set([
|
|
1035
|
-
"reasoning_effort",
|
|
1036
1037
|
"visualization"
|
|
1037
1038
|
]);
|
|
1039
|
+
var NEVER_IMPLICIT_AUTO_KEYS = /* @__PURE__ */ new Set([
|
|
1040
|
+
"reasoning_effort"
|
|
1041
|
+
]);
|
|
1038
1042
|
function isUnsetChoice(key, value) {
|
|
1039
1043
|
if (value === void 0 || value === null) return true;
|
|
1040
1044
|
return value === AUTO_VALUE && AUTO_MEANS_UNSET_KEYS.has(key);
|
|
1041
1045
|
}
|
|
1046
|
+
function isNeverImplicitChoice(key, value) {
|
|
1047
|
+
if (isUnsetChoice(key, value)) return true;
|
|
1048
|
+
return value === AUTO_VALUE && NEVER_IMPLICIT_AUTO_KEYS.has(key);
|
|
1049
|
+
}
|
|
1042
1050
|
|
|
1043
1051
|
// settings/starting-value.ts
|
|
1044
1052
|
function startingValueFor(key, control) {
|
|
@@ -1056,8 +1064,8 @@ function startingValueFor(key, control) {
|
|
|
1056
1064
|
value = [];
|
|
1057
1065
|
}
|
|
1058
1066
|
}
|
|
1059
|
-
if (
|
|
1060
|
-
value = control.enum.find((choice) => !
|
|
1067
|
+
if (isNeverImplicitChoice(key, value) && control.type === "enum" && control.enum?.length) {
|
|
1068
|
+
value = control.enum.find((choice) => !isNeverImplicitChoice(key, choice));
|
|
1061
1069
|
}
|
|
1062
1070
|
if (key === "response_format" && typeof value === "string") {
|
|
1063
1071
|
value = value === "" ? void 0 : { type: value };
|
|
@@ -516,14 +516,16 @@ declare function withSettingState<T extends Record<string, unknown>>(settings: T
|
|
|
516
516
|
* included at all").
|
|
517
517
|
*
|
|
518
518
|
* For these keys the house "auto" posture IS the unset state on the server:
|
|
519
|
-
* - reasoning_effort — aidream `matrx_ai/catalog/canonicalize.py` normalizes
|
|
520
|
-
* "auto" to None before any rule or processor sees it (ai_041).
|
|
521
519
|
* - visualization — the Google research agent reads an unset value as "auto"
|
|
522
520
|
* (`providers/google/google_research_agent.py`).
|
|
523
521
|
* So a control that offers "auto" for one of them must CLEAR the key, never
|
|
524
|
-
* save the word
|
|
525
|
-
*
|
|
526
|
-
*
|
|
522
|
+
* save the word.
|
|
523
|
+
*
|
|
524
|
+
* `reasoning_effort` is NOT here (owner ruling 2026-10-24): unset runs at the
|
|
525
|
+
* platform default ("low"), and "auto" is a PERSON's explicit choice that the
|
|
526
|
+
* server sends as the provider's own auto where it has one
|
|
527
|
+
* (`matrx_ai/catalog/controls.py::apply_reasoning_default`). So a person picking
|
|
528
|
+
* "auto" SAVES "auto"; it is never a starting value (`NEVER_IMPLICIT_AUTO_KEYS`).
|
|
527
529
|
*
|
|
528
530
|
* Every settings writer reads this one rule: the agent builder
|
|
529
531
|
* (AgentSettingsCore), the conversation settings target (useConversationSettingsTarget), the
|
|
@@ -531,8 +533,12 @@ declare function withSettingState<T extends Record<string, unknown>>(settings: T
|
|
|
531
533
|
*/
|
|
532
534
|
declare const AUTO_VALUE = "auto";
|
|
533
535
|
declare const AUTO_MEANS_UNSET_KEYS: ReadonlySet<string>;
|
|
536
|
+
/** Keys whose "auto" is a real choice that only a person makes — never a default. */
|
|
537
|
+
declare const NEVER_IMPLICIT_AUTO_KEYS: ReadonlySet<string>;
|
|
534
538
|
/** True when writing `value` to `key` means "not set" — the key is removed. */
|
|
535
539
|
declare function isUnsetChoice(key: string, value: unknown): boolean;
|
|
540
|
+
/** True when `value` may not be chosen FOR a person (a starting value / default). */
|
|
541
|
+
declare function isNeverImplicitChoice(key: string, value: unknown): boolean;
|
|
536
542
|
|
|
537
543
|
/**
|
|
538
544
|
* THE starting value of a setting a person turns on (ticks its box). One rule
|
|
@@ -746,5 +752,5 @@ interface CapabilitiesWriteTarget {
|
|
|
746
752
|
error?: string | null;
|
|
747
753
|
}
|
|
748
754
|
|
|
749
|
-
export { AUTO_MEANS_UNSET_KEYS, AUTO_VALUE, CATALOGUE_KEYS, EMPTY_UI_GATES, ENUM_OFF_VALUE, PARAM_ALIASES, SETTINGS_CATALOGUE, UI_GATE_EDITABLE_KEYS, UI_GATE_KEYS, buildApiPayload, buildSettingsRows, computeOverrideDiff, createSettingsStore, detectConflicts, effectiveOfferingPinOf, extraSettingKeys, extractModelDefaults, gateEnabled, getActionForMode, isOffValue, isUiGateKey, isUnsetChoice, mergeEffectiveSettings, mergeVariableValues, offValueFor, parseModelControls, parseUiGates, readApiPayload, readConflictActions, readConflictSummary, readEffectiveModelId, readEffectiveSettings, readEffectiveVariableValues, readPreviewedResolution, readSettingsEntry, resolveConflicts, sanitizeSettings, settingControl, settingLabel, settingStateOf, startingValueFor, withSettingState };
|
|
755
|
+
export { AUTO_MEANS_UNSET_KEYS, AUTO_VALUE, CATALOGUE_KEYS, EMPTY_UI_GATES, ENUM_OFF_VALUE, NEVER_IMPLICIT_AUTO_KEYS, PARAM_ALIASES, SETTINGS_CATALOGUE, UI_GATE_EDITABLE_KEYS, UI_GATE_KEYS, buildApiPayload, buildSettingsRows, computeOverrideDiff, createSettingsStore, detectConflicts, effectiveOfferingPinOf, extraSettingKeys, extractModelDefaults, gateEnabled, getActionForMode, isNeverImplicitChoice, isOffValue, isUiGateKey, isUnsetChoice, mergeEffectiveSettings, mergeVariableValues, offValueFor, parseModelControls, parseUiGates, readApiPayload, readConflictActions, readConflictSummary, readEffectiveModelId, readEffectiveSettings, readEffectiveVariableValues, readPreviewedResolution, readSettingsEntry, resolveConflicts, sanitizeSettings, settingControl, settingLabel, settingStateOf, startingValueFor, withSettingState };
|
|
750
756
|
export type { AgentContext, AgentSettings, AgentSettingsEntry, AgentSettingsState, AgentSource, AgentVariable, CapabilitiesWriteTarget, CatalogueEntry, CatalogueGroup, ConflictAction, ConflictItem, ConflictReason, ConflictSummary, ControlDefinition, ControlType, ExtraSettingKeys, InitializeSettingsInput, LLMParams, ModelRowTarget, ModelSettingRow, NormalizedControls, PendingModelSwitch, RenderGroup, ResolutionMode, SettingRowFacts, SettingRowRead, SettingRowView, SettingState, SettingsGroupId, SettingsModelInfo, SettingsStore, SettingsStoreConfig, SettingsWriteTarget, UiGateEditableKey, UiGateKey, UiGates, VariableCustomComponentRef };
|
package/dist/settings/index.d.ts
CHANGED
|
@@ -516,14 +516,16 @@ declare function withSettingState<T extends Record<string, unknown>>(settings: T
|
|
|
516
516
|
* included at all").
|
|
517
517
|
*
|
|
518
518
|
* For these keys the house "auto" posture IS the unset state on the server:
|
|
519
|
-
* - reasoning_effort — aidream `matrx_ai/catalog/canonicalize.py` normalizes
|
|
520
|
-
* "auto" to None before any rule or processor sees it (ai_041).
|
|
521
519
|
* - visualization — the Google research agent reads an unset value as "auto"
|
|
522
520
|
* (`providers/google/google_research_agent.py`).
|
|
523
521
|
* So a control that offers "auto" for one of them must CLEAR the key, never
|
|
524
|
-
* save the word
|
|
525
|
-
*
|
|
526
|
-
*
|
|
522
|
+
* save the word.
|
|
523
|
+
*
|
|
524
|
+
* `reasoning_effort` is NOT here (owner ruling 2026-10-24): unset runs at the
|
|
525
|
+
* platform default ("low"), and "auto" is a PERSON's explicit choice that the
|
|
526
|
+
* server sends as the provider's own auto where it has one
|
|
527
|
+
* (`matrx_ai/catalog/controls.py::apply_reasoning_default`). So a person picking
|
|
528
|
+
* "auto" SAVES "auto"; it is never a starting value (`NEVER_IMPLICIT_AUTO_KEYS`).
|
|
527
529
|
*
|
|
528
530
|
* Every settings writer reads this one rule: the agent builder
|
|
529
531
|
* (AgentSettingsCore), the conversation settings target (useConversationSettingsTarget), the
|
|
@@ -531,8 +533,12 @@ declare function withSettingState<T extends Record<string, unknown>>(settings: T
|
|
|
531
533
|
*/
|
|
532
534
|
declare const AUTO_VALUE = "auto";
|
|
533
535
|
declare const AUTO_MEANS_UNSET_KEYS: ReadonlySet<string>;
|
|
536
|
+
/** Keys whose "auto" is a real choice that only a person makes — never a default. */
|
|
537
|
+
declare const NEVER_IMPLICIT_AUTO_KEYS: ReadonlySet<string>;
|
|
534
538
|
/** True when writing `value` to `key` means "not set" — the key is removed. */
|
|
535
539
|
declare function isUnsetChoice(key: string, value: unknown): boolean;
|
|
540
|
+
/** True when `value` may not be chosen FOR a person (a starting value / default). */
|
|
541
|
+
declare function isNeverImplicitChoice(key: string, value: unknown): boolean;
|
|
536
542
|
|
|
537
543
|
/**
|
|
538
544
|
* THE starting value of a setting a person turns on (ticks its box). One rule
|
|
@@ -746,5 +752,5 @@ interface CapabilitiesWriteTarget {
|
|
|
746
752
|
error?: string | null;
|
|
747
753
|
}
|
|
748
754
|
|
|
749
|
-
export { AUTO_MEANS_UNSET_KEYS, AUTO_VALUE, CATALOGUE_KEYS, EMPTY_UI_GATES, ENUM_OFF_VALUE, PARAM_ALIASES, SETTINGS_CATALOGUE, UI_GATE_EDITABLE_KEYS, UI_GATE_KEYS, buildApiPayload, buildSettingsRows, computeOverrideDiff, createSettingsStore, detectConflicts, effectiveOfferingPinOf, extraSettingKeys, extractModelDefaults, gateEnabled, getActionForMode, isOffValue, isUiGateKey, isUnsetChoice, mergeEffectiveSettings, mergeVariableValues, offValueFor, parseModelControls, parseUiGates, readApiPayload, readConflictActions, readConflictSummary, readEffectiveModelId, readEffectiveSettings, readEffectiveVariableValues, readPreviewedResolution, readSettingsEntry, resolveConflicts, sanitizeSettings, settingControl, settingLabel, settingStateOf, startingValueFor, withSettingState };
|
|
755
|
+
export { AUTO_MEANS_UNSET_KEYS, AUTO_VALUE, CATALOGUE_KEYS, EMPTY_UI_GATES, ENUM_OFF_VALUE, NEVER_IMPLICIT_AUTO_KEYS, PARAM_ALIASES, SETTINGS_CATALOGUE, UI_GATE_EDITABLE_KEYS, UI_GATE_KEYS, buildApiPayload, buildSettingsRows, computeOverrideDiff, createSettingsStore, detectConflicts, effectiveOfferingPinOf, extraSettingKeys, extractModelDefaults, gateEnabled, getActionForMode, isNeverImplicitChoice, isOffValue, isUiGateKey, isUnsetChoice, mergeEffectiveSettings, mergeVariableValues, offValueFor, parseModelControls, parseUiGates, readApiPayload, readConflictActions, readConflictSummary, readEffectiveModelId, readEffectiveSettings, readEffectiveVariableValues, readPreviewedResolution, readSettingsEntry, resolveConflicts, sanitizeSettings, settingControl, settingLabel, settingStateOf, startingValueFor, withSettingState };
|
|
750
756
|
export type { AgentContext, AgentSettings, AgentSettingsEntry, AgentSettingsState, AgentSource, AgentVariable, CapabilitiesWriteTarget, CatalogueEntry, CatalogueGroup, ConflictAction, ConflictItem, ConflictReason, ConflictSummary, ControlDefinition, ControlType, ExtraSettingKeys, InitializeSettingsInput, LLMParams, ModelRowTarget, ModelSettingRow, NormalizedControls, PendingModelSwitch, RenderGroup, ResolutionMode, SettingRowFacts, SettingRowRead, SettingRowView, SettingState, SettingsGroupId, SettingsModelInfo, SettingsStore, SettingsStoreConfig, SettingsWriteTarget, UiGateEditableKey, UiGateKey, UiGates, VariableCustomComponentRef };
|
package/dist/settings/index.js
CHANGED
|
@@ -965,13 +965,19 @@ function withSettingState(settings, key, state, control, value) {
|
|
|
965
965
|
// settings/auto-means-unset.ts
|
|
966
966
|
var AUTO_VALUE = "auto";
|
|
967
967
|
var AUTO_MEANS_UNSET_KEYS = /* @__PURE__ */ new Set([
|
|
968
|
-
"reasoning_effort",
|
|
969
968
|
"visualization"
|
|
970
969
|
]);
|
|
970
|
+
var NEVER_IMPLICIT_AUTO_KEYS = /* @__PURE__ */ new Set([
|
|
971
|
+
"reasoning_effort"
|
|
972
|
+
]);
|
|
971
973
|
function isUnsetChoice(key, value) {
|
|
972
974
|
if (value === void 0 || value === null) return true;
|
|
973
975
|
return value === AUTO_VALUE && AUTO_MEANS_UNSET_KEYS.has(key);
|
|
974
976
|
}
|
|
977
|
+
function isNeverImplicitChoice(key, value) {
|
|
978
|
+
if (isUnsetChoice(key, value)) return true;
|
|
979
|
+
return value === AUTO_VALUE && NEVER_IMPLICIT_AUTO_KEYS.has(key);
|
|
980
|
+
}
|
|
975
981
|
|
|
976
982
|
// settings/starting-value.ts
|
|
977
983
|
function startingValueFor(key, control) {
|
|
@@ -989,8 +995,8 @@ function startingValueFor(key, control) {
|
|
|
989
995
|
value = [];
|
|
990
996
|
}
|
|
991
997
|
}
|
|
992
|
-
if (
|
|
993
|
-
value = control.enum.find((choice) => !
|
|
998
|
+
if (isNeverImplicitChoice(key, value) && control.type === "enum" && control.enum?.length) {
|
|
999
|
+
value = control.enum.find((choice) => !isNeverImplicitChoice(key, choice));
|
|
994
1000
|
}
|
|
995
1001
|
if (key === "response_format" && typeof value === "string") {
|
|
996
1002
|
value = value === "" ? void 0 : { type: value };
|
|
@@ -1003,6 +1009,7 @@ export {
|
|
|
1003
1009
|
CATALOGUE_KEYS,
|
|
1004
1010
|
EMPTY_UI_GATES,
|
|
1005
1011
|
ENUM_OFF_VALUE,
|
|
1012
|
+
NEVER_IMPLICIT_AUTO_KEYS,
|
|
1006
1013
|
PARAM_ALIASES,
|
|
1007
1014
|
SETTINGS_CATALOGUE,
|
|
1008
1015
|
UI_GATE_EDITABLE_KEYS,
|
|
@@ -1017,6 +1024,7 @@ export {
|
|
|
1017
1024
|
extractModelDefaults,
|
|
1018
1025
|
gateEnabled,
|
|
1019
1026
|
getActionForMode,
|
|
1027
|
+
isNeverImplicitChoice,
|
|
1020
1028
|
isOffValue,
|
|
1021
1029
|
isUiGateKey,
|
|
1022
1030
|
isUnsetChoice,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ai-matrx/agents",
|
|
3
|
-
"version": "0.59.
|
|
3
|
+
"version": "0.59.272",
|
|
4
4
|
"description": "Portable AI Matrx agent stream protocol, event projection, and safe result-presentation primitives.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -25,6 +25,7 @@
|
|
|
25
25
|
"files": [
|
|
26
26
|
"dist",
|
|
27
27
|
"scripts/check-model-catalog-reads.mjs",
|
|
28
|
+
"context/rules-corpus.json",
|
|
28
29
|
"README.md",
|
|
29
30
|
"LICENSE",
|
|
30
31
|
"CHANGELOG.md"
|
|
@@ -171,6 +172,7 @@
|
|
|
171
172
|
"default": "./dist/context/react/index.cjs"
|
|
172
173
|
}
|
|
173
174
|
},
|
|
175
|
+
"./context/rules-corpus.json": "./context/rules-corpus.json",
|
|
174
176
|
"./react": {
|
|
175
177
|
"import": {
|
|
176
178
|
"types": "./dist/react/index.d.ts",
|
|
@@ -518,5 +520,5 @@
|
|
|
518
520
|
"optional": true
|
|
519
521
|
}
|
|
520
522
|
},
|
|
521
|
-
"gitHead": "
|
|
523
|
+
"gitHead": "467bc8f11239e00d4bcd8d27c85861b0165cd0bd"
|
|
522
524
|
}
|