@deepwatch/dsh-client-settings 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,207 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { BINDING_STATUS_LABEL, ROLE_LABEL, blockerMessage, isExecutable, } from '@deepwatch/dsh-contracts';
3
+ import { StatusChip } from './components.js';
4
+ export const READINESS_STATUS_LABEL = {
5
+ loading: 'Loading…', ready: 'Ready', degraded: 'Degraded',
6
+ unconfigured: 'Not configured', unavailable: 'Unavailable',
7
+ not_tested: 'Not tested', error: 'Error',
8
+ };
9
+ export const READINESS = [
10
+ {
11
+ name: 'Watch Core',
12
+ detail: 'The engine that mints evidence and issues verdicts. Runs as a child of this workspace.',
13
+ section: 'watch-diagnostics',
14
+ },
15
+ {
16
+ name: 'Memory', detail: 'Durable, correctable memory with provenance on every record.',
17
+ section: 'watch-memory', coreCapabilities: ['watch.memory.recall'],
18
+ },
19
+ {
20
+ name: 'Verification', detail: 'Deterministic checks against the world. Needs no model.',
21
+ section: 'watch-verification', coreCapabilities: ['watch.verification.run'],
22
+ },
23
+ {
24
+ name: 'Browser',
25
+ detail: 'A supervised browser that acts and returns Core-owned evidence and a receipt.',
26
+ section: 'watch-sources',
27
+ coreCapabilities: ['watch.browser.observe', 'watch.browser.operate', 'watch.evidence.resolve'],
28
+ },
29
+ {
30
+ name: 'Agent Model', role: 'agent_model',
31
+ detail: 'Plans, reasons and writes. Any provider DSH supports — DeepSeek is one of them.',
32
+ section: 'watch-roles',
33
+ },
34
+ {
35
+ name: 'Visual Perception', role: 'visual_perception',
36
+ detail: 'Reads what is on screen or in a frame. A local model works.', section: 'watch-roles',
37
+ },
38
+ {
39
+ name: 'OCR', detail: 'Text out of images and pages. A CPU engine is available.',
40
+ section: 'watch-engines', defaultStatus: 'not_tested',
41
+ },
42
+ {
43
+ name: 'ASR', role: 'asr',
44
+ detail: 'Speech to text, with timings a citation can point at.', section: 'watch-roles',
45
+ },
46
+ {
47
+ name: 'Audio Understanding', role: 'audio_understanding',
48
+ detail: 'Non-speech audio: events, tone, music.', section: 'watch-roles',
49
+ },
50
+ {
51
+ name: 'Speaker / Diarization', detail: 'Who spoke, and when.',
52
+ section: 'watch-roles', defaultStatus: 'unconfigured',
53
+ },
54
+ {
55
+ name: 'Embeddings / Retrieval', role: 'embeddings',
56
+ detail: 'Search over the library and over memory. Falls back to lexical matching.',
57
+ section: 'watch-roles',
58
+ },
59
+ {
60
+ name: 'Capture',
61
+ detail: 'Screen, window, camera and microphone. Permission is asked at first use.',
62
+ section: 'watch-sources', defaultStatus: 'unconfigured',
63
+ },
64
+ ];
65
+ function toneFor(status) {
66
+ if (status === 'ready')
67
+ return 'active';
68
+ if (status === 'degraded' || status === 'unavailable' || status === 'error')
69
+ return 'caution';
70
+ return 'neutral';
71
+ }
72
+ function coreStatus(health, reading) {
73
+ if (reading)
74
+ return 'loading';
75
+ if (health === null || health === undefined)
76
+ return 'error';
77
+ if (health.isTestOnlyMock)
78
+ return 'degraded';
79
+ if (health.blocker === 'connected')
80
+ return health.phase === 'ready' ? 'ready' : 'degraded';
81
+ if (health.blocker === 'core_missing' || health.blocker === 'bridge_surface_missing') {
82
+ return 'unavailable';
83
+ }
84
+ return health.phase === 'degraded' ? 'degraded' : 'error';
85
+ }
86
+ /**
87
+ * Core's evidence level, said in the vocabulary a surface may use.
88
+ *
89
+ * The interesting line is `probed`. Core separates three facts on purpose:
90
+ * the code exists, its dependencies were found (`probed`), and a real request
91
+ * ran here and succeeded (`machine_tested`). Only the third is *ready*.
92
+ *
93
+ * `probed` was drawn as **Degraded** for one release, and that was a false
94
+ * alarm in the opposite direction to the green dot: a machine with Chromium
95
+ * installed and a healthy memory index reported two capabilities as impaired
96
+ * when nothing was wrong with either — they simply had not been exercised.
97
+ * Degraded means working and hurt. Ignorance is `not_tested`, which is a
98
+ * neutral word and the accurate one.
99
+ */
100
+ function capabilityStatus(detail) {
101
+ if (detail === undefined)
102
+ return 'not_tested';
103
+ if (!detail.usable)
104
+ return detail.status === 'unavailable' ? 'unavailable' : 'degraded';
105
+ if (detail.status === 'machine_tested')
106
+ return 'ready';
107
+ if (detail.status === 'unavailable')
108
+ return 'unavailable';
109
+ return 'not_tested';
110
+ }
111
+ const STATUS_PRIORITY = {
112
+ error: 7, unavailable: 6, degraded: 5, loading: 4,
113
+ not_tested: 3, unconfigured: 2, ready: 1,
114
+ };
115
+ /** Of two states, the one that promises less. */
116
+ function worse(left, right) {
117
+ return STATUS_PRIORITY[right] > STATUS_PRIORITY[left] ? right : left;
118
+ }
119
+ /** Derive every row from runtime facts. Used by both first-run and Diagnostics. */
120
+ export function deriveReadiness(facts) {
121
+ const reading = facts.reading === true;
122
+ const health = facts.health;
123
+ const details = new Map((health?.capabilityDetails ?? []).map(item => [item.capabilityId, item]));
124
+ const roles = new Map((facts.roles ?? []).map(row => [row.role, row]));
125
+ const core = coreStatus(health, reading);
126
+ return READINESS.map((definition, index) => {
127
+ let status;
128
+ let detail = definition.detail;
129
+ let statusLabel;
130
+ if (index === 0) {
131
+ status = core;
132
+ if (health !== null && health !== undefined && health.blocker !== 'connected' && health.fix !== '') {
133
+ detail = health.fix;
134
+ }
135
+ }
136
+ else if (definition.coreCapabilities !== undefined) {
137
+ // Core is the floor, not a separate row that happens to sit above these.
138
+ // A capability cannot be in better shape than the engine carrying it,
139
+ // and the case that proves it is the in-process fixture: it reports five
140
+ // machine-tested capabilities, and without this fold a mock backend
141
+ // renders as a working installation. Folding also means a group is only
142
+ // as good as its weakest member — two thirds of a browser is not a
143
+ // browser that can finish the job.
144
+ const states = definition.coreCapabilities.map(id => capabilityStatus(details.get(id)));
145
+ status = states.reduce(worse, core);
146
+ const problem = definition.coreCapabilities
147
+ .map(id => details.get(id))
148
+ .find(item => item !== undefined && (!item.usable || item.status !== 'machine_tested'));
149
+ if (problem !== undefined) {
150
+ detail = problem.fixes[0] ?? (problem.missing.length === 0
151
+ ? definition.detail
152
+ : `Missing: ${problem.missing.join(', ')}.`);
153
+ }
154
+ else if (status !== 'ready' && health !== null && health !== undefined
155
+ && health.fix !== '') {
156
+ // Core could not be read, so these rows have nothing of their own to
157
+ // report. What to do about Core is the only actionable sentence there is.
158
+ detail = health.fix;
159
+ }
160
+ }
161
+ else if (definition.role !== undefined) {
162
+ const role = roles.get(definition.role);
163
+ if (role === undefined)
164
+ status = 'unconfigured';
165
+ else if (isExecutable(role.readiness))
166
+ status = 'ready';
167
+ else if (role.readiness.status === 'bound_unverified')
168
+ status = 'not_tested';
169
+ else if (role.readiness.status === 'unbound')
170
+ status = 'unconfigured';
171
+ else
172
+ status = 'error';
173
+ if (role !== undefined) {
174
+ statusLabel = BINDING_STATUS_LABEL[role.readiness.status];
175
+ if (!isExecutable(role.readiness))
176
+ detail = blockerMessage(role.readiness) ?? detail;
177
+ }
178
+ }
179
+ else {
180
+ status = definition.defaultStatus ?? 'not_tested';
181
+ }
182
+ return {
183
+ ...definition, detail, status,
184
+ statusLabel: statusLabel ?? READINESS_STATUS_LABEL[status], tone: toneFor(status),
185
+ };
186
+ });
187
+ }
188
+ export function ReadinessList({ openSection, roles, health, reading }) {
189
+ const rows = deriveReadiness({ roles, health, reading });
190
+ return (_jsx("div", { style: {
191
+ border: '1px solid color-mix(in srgb, var(--watch-accent) 10%, var(--dsw-alias-border-l2))',
192
+ borderRadius: '14px', overflow: 'hidden',
193
+ background: 'linear-gradient(145deg, color-mix(in srgb, var(--watch-accent) 3%, var(--dsw-alias-bg-layer-2)), var(--dsw-alias-bg-base))',
194
+ boxShadow: '0 10px 28px color-mix(in srgb, black 8%, transparent)',
195
+ }, children: rows.map((item, index) => (_jsxs("div", { style: {
196
+ display: 'flex', alignItems: 'flex-start', gap: '12px', padding: '12px 16px',
197
+ borderTop: index === 0 ? 'none' : '1px solid var(--dsw-alias-border-l2)',
198
+ }, children: [_jsxs("div", { style: { flex: 1, minWidth: 0 }, children: [_jsx("div", { style: { fontSize: '13px', fontWeight: 500 }, children: item.role === undefined ? item.name : ROLE_LABEL[item.role] }), _jsx("div", { style: {
199
+ fontSize: '12px', lineHeight: 1.5, marginTop: '2px',
200
+ color: 'var(--dsw-alias-label-tertiary)',
201
+ }, children: item.detail })] }), _jsxs("span", { style: { display: 'flex', gap: '8px', alignItems: 'center', flexShrink: 0 }, children: [_jsx(StatusChip, { tone: item.tone, children: item.statusLabel }), item.section === undefined || openSection === undefined ? null : (_jsx("button", { type: "button", onClick: () => { openSection(item.section); }, style: {
202
+ background: 'none', border: 'none', cursor: 'pointer', fontSize: '11px',
203
+ padding: '2px 4px', color: 'var(--dsw-alias-label-secondary)',
204
+ textDecoration: 'underline',
205
+ }, children: "Configure" }))] })] }, item.name))) }));
206
+ }
207
+ //# sourceMappingURL=readiness.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"readiness.js","sourceRoot":"","sources":["../../src/client/readiness.tsx"],"names":[],"mappings":";AAGA,OAAO,EACL,oBAAoB,EAAE,UAAU,EAAE,cAAc,EAAE,YAAY,GAC/D,MAAM,0BAA0B,CAAA;AAKjC,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAc5C,MAAM,CAAC,MAAM,sBAAsB,GAA8C;IAC/E,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,UAAU;IACzD,YAAY,EAAE,gBAAgB,EAAE,WAAW,EAAE,aAAa;IAC1D,UAAU,EAAE,YAAY,EAAE,KAAK,EAAE,OAAO;CACzC,CAAA;AAmBD,MAAM,CAAC,MAAM,SAAS,GAAmC;IACvD;QACE,IAAI,EAAE,YAAY;QAClB,MAAM,EAAE,wFAAwF;QAChG,OAAO,EAAE,mBAAmB;KAC7B;IACD;QACE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,8DAA8D;QACtF,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,CAAC,qBAAqB,CAAC;KACnE;IACD;QACE,IAAI,EAAE,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AAO,KAAK,SAAS,IAAI,WAAW,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAChE,iBAAQ,IAAI,EAAC,QAAQ,EAAC,OAAO,EAAE,GAAG,EAAE,GAAG,WAAW,CAAC,IAAI,CAAC,OAAiB,CAAC,CAAA,CAAC,CAAC,EAC1E,KAAK,EAAE;gCACL,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM;gCACvE,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,kCAAkC;gCAC7D,cAAc,EAAE,WAAW;6BAC5B,0BAGM,CACV,IACI,KA9BC,IAAI,CAAC,IAAI,CA+Bb,CACP,CAAC,GACE,CACP,CAAA;AACH,CAAC"}
@@ -0,0 +1,118 @@
1
+ /**
2
+ * Role Bindings, as a screen somebody can actually finish setup on.
3
+ *
4
+ * This surface used to be four rows of static copy saying "Not bound" and a
5
+ * paragraph explaining that bindings were stored by DSH. Both true. Neither
6
+ * gave anybody a way to bind anything — so a person who had saved an OpenRouter
7
+ * credential arrived here, read that nothing was bound, and had no control to
8
+ * change it. The screen described the product's design instead of operating it.
9
+ *
10
+ * What it does now is the four steps in order, because they *are* ordered and
11
+ * pretending otherwise is what made a saved credential look like a finished
12
+ * setup:
13
+ *
14
+ * 1. a provider has a credential — stored, and nothing more
15
+ * 2. that provider advertises models — asked for, never assumed
16
+ * 3. a model is assigned to a capability — explicitly, by a person
17
+ * 4. the capability can run — derived, never stored
18
+ *
19
+ * **Nothing here is signalled by colour alone.** Every state carries the word
20
+ * for it, and the chip is decoration on top of that word. A status conveyed by
21
+ * a green dot is a status a screen reader does not have, and — as the incident
22
+ * that produced this file showed — one a sighted reader misreads too.
23
+ *
24
+ * **Nothing is chosen implicitly.** There is no "use my only credential", no
25
+ * defaulting to the first model in the list, and no provider that becomes
26
+ * bound because it was configured. Every binding here is a button somebody
27
+ * pressed.
28
+ *
29
+ * @module @deepwatch/dsh-client-settings/role-bindings
30
+ */
31
+ import type { ReactNode } from 'react';
32
+ import type { BindingStore, ProviderRow, RoleRow } from './binding-state.js';
33
+ /** What the section is handed by whoever mounts it. */
34
+ export interface RoleBindingsProps {
35
+ readonly store: BindingStore;
36
+ }
37
+ export declare const CONTROL: {
38
+ select: {
39
+ font: string;
40
+ fontSize: string;
41
+ padding: string;
42
+ borderRadius: string;
43
+ border: string;
44
+ background: string;
45
+ color: string;
46
+ minWidth: string;
47
+ maxWidth: string;
48
+ };
49
+ primary: {
50
+ font: string;
51
+ fontSize: string;
52
+ fontWeight: number;
53
+ padding: string;
54
+ borderRadius: string;
55
+ cursor: string;
56
+ border: string;
57
+ background: string;
58
+ color: string;
59
+ boxShadow: string;
60
+ };
61
+ quiet: {
62
+ font: string;
63
+ fontSize: string;
64
+ padding: string;
65
+ borderRadius: string;
66
+ cursor: string;
67
+ border: string;
68
+ background: string;
69
+ color: string;
70
+ };
71
+ field: {
72
+ display: string;
73
+ flexDirection: "column";
74
+ gap: string;
75
+ minWidth: number;
76
+ };
77
+ label: {
78
+ fontSize: string;
79
+ letterSpacing: string;
80
+ textTransform: "uppercase";
81
+ color: string;
82
+ };
83
+ row: {
84
+ display: string;
85
+ flexWrap: "wrap";
86
+ gap: string;
87
+ alignItems: string;
88
+ marginTop: string;
89
+ };
90
+ };
91
+ /**
92
+ * The editor for one role: pick a provider, pick one of its models, assign it.
93
+ *
94
+ * Two selects rather than one combined list, because the two choices fail
95
+ * differently. A provider with no credential is a different problem from a
96
+ * provider whose catalogue is empty, and a single flattened list would report
97
+ * both as "nothing to choose".
98
+ *
99
+ * Exported because the blocked composer offers the same choice in place. A
100
+ * person who is stopped from sending should be able to fix it where they are
101
+ * standing, and offering them a *second* picker written separately is how two
102
+ * screens end up disagreeing about what a provider offers.
103
+ */
104
+ export declare function BindingEditor({ row, providers, saving, onBind, onCancel }: {
105
+ readonly row: RoleRow;
106
+ readonly providers: readonly ProviderRow[];
107
+ readonly saving: boolean;
108
+ readonly onBind: (provider: string, model: string) => void;
109
+ readonly onCancel: () => void;
110
+ }): ReactNode;
111
+ /**
112
+ * Role Bindings.
113
+ *
114
+ * @param props.store - the binding store this surface reads and writes.
115
+ * @returns the section body.
116
+ */
117
+ export declare function RoleBindings({ store }: RoleBindingsProps): ReactNode;
118
+ //# sourceMappingURL=role-bindings.d.ts.map
@@ -0,0 +1,211 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ /**
3
+ * Role Bindings, as a screen somebody can actually finish setup on.
4
+ *
5
+ * This surface used to be four rows of static copy saying "Not bound" and a
6
+ * paragraph explaining that bindings were stored by DSH. Both true. Neither
7
+ * gave anybody a way to bind anything — so a person who had saved an OpenRouter
8
+ * credential arrived here, read that nothing was bound, and had no control to
9
+ * change it. The screen described the product's design instead of operating it.
10
+ *
11
+ * What it does now is the four steps in order, because they *are* ordered and
12
+ * pretending otherwise is what made a saved credential look like a finished
13
+ * setup:
14
+ *
15
+ * 1. a provider has a credential — stored, and nothing more
16
+ * 2. that provider advertises models — asked for, never assumed
17
+ * 3. a model is assigned to a capability — explicitly, by a person
18
+ * 4. the capability can run — derived, never stored
19
+ *
20
+ * **Nothing here is signalled by colour alone.** Every state carries the word
21
+ * for it, and the chip is decoration on top of that word. A status conveyed by
22
+ * a green dot is a status a screen reader does not have, and — as the incident
23
+ * that produced this file showed — one a sighted reader misreads too.
24
+ *
25
+ * **Nothing is chosen implicitly.** There is no "use my only credential", no
26
+ * defaulting to the first model in the list, and no provider that becomes
27
+ * bound because it was configured. Every binding here is a button somebody
28
+ * pressed.
29
+ *
30
+ * @module @deepwatch/dsh-client-settings/role-bindings
31
+ */
32
+ import { useCallback, useEffect, useId, useMemo, useRef, useState, useSyncExternalStore } from 'react';
33
+ import { BINDABLE_ROLES, BINDING_STATUS_LABEL, CREDENTIAL_STATUS_LABEL, PRIMARY_ROLE, ROLE_LABEL, ROLE_PURPOSE, blockerMessage, isExecutable, } from '@deepwatch/dsh-contracts';
34
+ import { StatusChip, T } from './components.js';
35
+ import { DEEPSEEK_IS_OPTIONAL, HOSTED_COUNT, PROVIDER_COUNT, SAMPLE_PROVIDERS, SELF_HOSTED_COUNT, } from '../providers.js';
36
+ /**
37
+ * The tone a readiness status earns.
38
+ *
39
+ * `bound_unverified` is deliberately not `active`. That is precisely the state
40
+ * a green dot used to claim, and claiming it is what sent a prompt to a
41
+ * provider nobody had configured.
42
+ */
43
+ function toneFor(readiness) {
44
+ if (isExecutable(readiness))
45
+ return 'active';
46
+ return readiness.status === 'blocked' ? 'caution' : 'neutral';
47
+ }
48
+ /** The tone a credential state earns. Stored is not working. */
49
+ function credentialTone(status) {
50
+ if (status === 'verified')
51
+ return 'active';
52
+ if (status === 'rejected' || status === 'inaccessible')
53
+ return 'caution';
54
+ return 'neutral';
55
+ }
56
+ export const CONTROL = {
57
+ select: {
58
+ font: 'inherit', fontSize: '13px', padding: '7px 10px', borderRadius: '10px',
59
+ border: '1px solid color-mix(in srgb, var(--watch-accent) 12%, var(--dsw-alias-border-l2))',
60
+ background: 'var(--dsw-alias-bg-layer-2)', color: 'var(--dsw-alias-label-primary)',
61
+ minWidth: '180px', maxWidth: '100%',
62
+ },
63
+ primary: {
64
+ font: 'inherit', fontSize: '13px', fontWeight: 600, padding: '8px 15px',
65
+ borderRadius: '10px', cursor: 'pointer',
66
+ border: '1px solid var(--watch-accent)',
67
+ background: 'var(--watch-accent)', color: 'white',
68
+ boxShadow: '0 6px 18px color-mix(in srgb, var(--watch-accent) 22%, transparent)',
69
+ },
70
+ quiet: {
71
+ font: 'inherit', fontSize: '13px', padding: '8px 13px', borderRadius: '10px',
72
+ cursor: 'pointer', border: '1px solid var(--dsw-alias-border-l2)',
73
+ background: 'color-mix(in srgb, var(--dsw-alias-bg-layer-2) 80%, transparent)', color: 'var(--dsw-alias-label-secondary)',
74
+ },
75
+ field: {
76
+ display: 'flex', flexDirection: 'column', gap: '4px', minWidth: 0,
77
+ },
78
+ label: {
79
+ fontSize: '11px', letterSpacing: '0.03em', textTransform: 'uppercase',
80
+ color: 'var(--dsw-alias-label-tertiary)',
81
+ },
82
+ // Wraps rather than scrolls: a narrow settings panel is the common case, and
83
+ // a row of controls that overflows horizontally hides the one on the right.
84
+ row: {
85
+ display: 'flex', flexWrap: 'wrap', gap: '10px',
86
+ alignItems: 'flex-end', marginTop: '12px',
87
+ },
88
+ };
89
+ /**
90
+ * The editor for one role: pick a provider, pick one of its models, assign it.
91
+ *
92
+ * Two selects rather than one combined list, because the two choices fail
93
+ * differently. A provider with no credential is a different problem from a
94
+ * provider whose catalogue is empty, and a single flattened list would report
95
+ * both as "nothing to choose".
96
+ *
97
+ * Exported because the blocked composer offers the same choice in place. A
98
+ * person who is stopped from sending should be able to fix it where they are
99
+ * standing, and offering them a *second* picker written separately is how two
100
+ * screens end up disagreeing about what a provider offers.
101
+ */
102
+ export function BindingEditor({ row, providers, saving, onBind, onCancel }) {
103
+ const providerId = useId();
104
+ const modelId = useId();
105
+ const noticeId = useId();
106
+ const first = useRef(null);
107
+ const [provider, setProvider] = useState(row.provider ?? '');
108
+ const [model, setModel] = useState(row.model ?? '');
109
+ // Focus the first control when the editor opens: a person who pressed
110
+ // "Choose a model" is already looking here, and leaving focus on the button
111
+ // they just activated means the next Tab goes backwards through the card.
112
+ useEffect(() => { first.current?.focus(); }, []);
113
+ const chosen = providers.find(entry => entry.provider === provider);
114
+ const models = chosen?.models ?? [];
115
+ // The chosen model is cleared when the provider changes, rather than carried
116
+ // over. A model id from one provider is not a model id for another, and
117
+ // keeping it produced bindings that looked complete and could not run.
118
+ const pickProvider = (next) => {
119
+ setProvider(next);
120
+ setModel('');
121
+ };
122
+ const notice = chosen === undefined
123
+ ? 'Choose a provider to see the models it offers.'
124
+ : chosen.credential === 'absent'
125
+ ? `${chosen.displayName} has no credential yet. Add one in Models & Providers, then come back.`
126
+ : chosen.catalogError !== null
127
+ ? `${chosen.displayName} did not return a model list.`
128
+ : models.length === 0
129
+ ? `${chosen.displayName} advertised no models.`
130
+ : `${String(models.length)} model(s) offered by ${chosen.displayName}.`;
131
+ return (_jsxs("div", { style: CONTROL.row, children: [_jsxs("span", { style: CONTROL.field, children: [_jsx("label", { htmlFor: providerId, style: CONTROL.label, children: "Provider" }), _jsxs("select", { id: providerId, ref: first, style: CONTROL.select, value: provider, disabled: saving, "aria-describedby": noticeId, onChange: event => { pickProvider(event.target.value); }, children: [_jsx("option", { value: "", children: "Choose a provider\u2026" }), providers.map(entry => (_jsx("option", { value: entry.provider, children: `${entry.displayName} — ${CREDENTIAL_STATUS_LABEL[entry.credential]}` }, entry.provider)))] })] }), _jsxs("span", { style: CONTROL.field, children: [_jsx("label", { htmlFor: modelId, style: CONTROL.label, children: "Model" }), _jsxs("select", { id: modelId, style: CONTROL.select, value: model, disabled: saving || models.length === 0, "aria-describedby": noticeId, onChange: event => { setModel(event.target.value); }, children: [_jsx("option", { value: "", children: "Choose a model\u2026" }), models.map(entry => (_jsx("option", { value: entry.id, children: entry.name === '' ? entry.id : entry.name }, entry.id)))] })] }), _jsx("button", { type: "button", style: { ...CONTROL.primary, opacity: provider === '' || model === '' || saving ? 0.5 : 1 }, disabled: provider === '' || model === '' || saving, onClick: () => { onBind(provider, model); }, children: saving ? 'Assigning…' : `Assign to ${ROLE_LABEL[row.role]}` }), _jsx("button", { type: "button", style: CONTROL.quiet, onClick: onCancel, disabled: saving, children: "Cancel" }), _jsx("p", { id: noticeId, style: {
132
+ flexBasis: '100%', margin: '2px 0 0', fontSize: '12px', lineHeight: 1.5,
133
+ color: 'var(--dsw-alias-label-tertiary)',
134
+ }, children: notice })] }));
135
+ }
136
+ /** One role: what it is, what it is bound to, and whether that can run. */
137
+ function RoleCard({ row, providers, snapshot, store, openEditor, editing, onEdit, onClose }) {
138
+ const provider = providers.find(entry => entry.provider === row.provider);
139
+ const blocker = blockerMessage(row.readiness);
140
+ const ready = isExecutable(row.readiness);
141
+ return (_jsxs("div", { style: T.card, children: [_jsxs("div", { style: T.cardHead, children: [_jsx("h3", { style: T.title, children: ROLE_LABEL[row.role] }), _jsx(StatusChip, { tone: toneFor(row.readiness), children: BINDING_STATUS_LABEL[row.readiness.status] })] }), _jsx("p", { style: { ...T.lead, margin: '6px 0 0' }, children: ROLE_PURPOSE[row.role] }), _jsxs("div", { style: T.meta, children: [_jsx("span", { style: T.key, children: "Provider" }), _jsx("span", { style: T.value, children: provider?.displayName ?? row.provider ?? 'Nothing assigned' }), _jsx("span", { style: T.key, children: "Model" }), _jsx("span", { style: T.value, children: row.model ?? 'Nothing assigned' }), _jsx("span", { style: T.key, children: "Status" }), _jsx("span", { style: T.value, children: ready
142
+ ? `${ROLE_LABEL[row.role]} can run.`
143
+ : blocker ?? 'Not configured.' })] }), openEditor && editing === row.role
144
+ ? (_jsx(BindingEditor, { row: row, providers: providers, saving: snapshot.saving, onBind: (chosenProvider, chosenModel) => {
145
+ void store.bind(row.role, chosenProvider, chosenModel).then(onClose);
146
+ }, onCancel: onClose }))
147
+ : (_jsxs("div", { style: CONTROL.row, children: [_jsx("button", { type: "button", style: CONTROL.primary, disabled: !snapshot.writable, "aria-describedby": snapshot.writable ? undefined : 'watch-bindings-readonly', onClick: () => { onEdit(row.role); }, children: row.model === null ? 'Choose a model' : 'Change model' }), row.model === null
148
+ ? null
149
+ : (_jsx("button", { type: "button", style: CONTROL.quiet, disabled: (snapshot.testingRole !== null && snapshot.testingRole !== row.role) || snapshot.saving, onClick: () => {
150
+ if (snapshot.testingRole === row.role)
151
+ store.cancelProviderTest();
152
+ else
153
+ void store.testRole(row.role);
154
+ }, children: snapshot.testingRole === row.role ? 'Cancel provider test' : 'Run provider test' })), row.model === null
155
+ ? null
156
+ : (_jsx("button", { type: "button", style: CONTROL.quiet, disabled: !snapshot.writable || snapshot.saving, "aria-describedby": snapshot.writable ? undefined : 'watch-bindings-readonly', onClick: () => { void store.unbind(row.role); }, children: `Unassign ${ROLE_LABEL[row.role]}` }))] }))] }));
157
+ }
158
+ /** The providers a person has actually configured, and what is known of each. */
159
+ function ProviderList({ providers }) {
160
+ const configured = providers.filter(entry => entry.credential !== 'absent');
161
+ if (configured.length === 0) {
162
+ return (_jsxs("div", { style: { ...T.card, borderStyle: 'dashed' }, children: [_jsxs("div", { style: T.cardHead, children: [_jsx("h3", { style: T.title, children: "No provider is configured yet" }), _jsx(StatusChip, { tone: "neutral", children: "No credential" })] }), _jsx("p", { style: { ...T.lead, margin: '8px 0 0' }, children: "Add a credential in the Harness\u2019s own Models & Providers screen. A saved credential is the first of four steps \u2014 it stores a key and assigns nothing." })] }));
163
+ }
164
+ return (_jsxs(_Fragment, { children: [_jsxs("div", { style: T.card, children: [_jsxs("div", { style: T.cardHead, children: [_jsx("h3", { style: T.title, children: `${String(PROVIDER_COUNT)} routes are available` }), _jsx(StatusChip, { tone: "neutral", children: `${String(configured.length)} configured` })] }), _jsxs("p", { style: { ...T.lead, margin: '8px 0 0' }, children: [`${String(HOSTED_COUNT)} hosted and ${String(SELF_HOSTED_COUNT)} where you supply the endpoint — `, SAMPLE_PROVIDERS.join(', '), ' and others. Watch adds none of these and removes none of them: the ', 'catalogue is the Harness’s, reached through its own Models & Providers screen.'] }), _jsxs("div", { style: T.meta, children: [_jsx("span", { style: T.key, children: "A local model" }), _jsx("span", { style: T.value, children: "An OpenAI-compatible server you run \u2014 Ollama, vLLM, LM Studio, llama.cpp \u2014 is a base URL you supply, not a separate feature." }), _jsx("span", { style: T.key, children: "DeepSeek" }), _jsx("span", { style: T.value, children: DEEPSEEK_IS_OPTIONAL
165
+ ? 'One route among many. Nothing here requires it, and nothing selects it for you.'
166
+ : 'The only route in this catalogue.' })] })] }), configured.map(entry => (_jsxs("div", { style: T.card, children: [_jsxs("div", { style: T.cardHead, children: [_jsx("h3", { style: T.title, children: entry.displayName }), _jsx(StatusChip, { tone: credentialTone(entry.credential), children: CREDENTIAL_STATUS_LABEL[entry.credential] })] }), _jsxs("div", { style: T.meta, children: [_jsx("span", { style: T.key, children: "Route" }), _jsx("span", { style: T.value, children: entry.active ? 'Served by an adapter' : 'Not currently served' }), _jsx("span", { style: T.key, children: "Models offered" }), _jsx("span", { style: T.value, children: entry.catalogError !== null
167
+ ? 'The provider did not return a list.'
168
+ : entry.models.length === 0
169
+ ? 'None advertised.'
170
+ : String(entry.models.length) }), _jsx("span", { style: T.key, children: "Credential save" }), _jsx("span", { style: T.value, children: "Does not contact the provider. Tests are explicit and apply to one exact provider/model binding." })] })] }, entry.provider)))] }));
171
+ }
172
+ /**
173
+ * Role Bindings.
174
+ *
175
+ * @param props.store - the binding store this surface reads and writes.
176
+ * @returns the section body.
177
+ */
178
+ export function RoleBindings({ store }) {
179
+ const snapshot = useSyncExternalStore(store.subscribe, store.getSnapshot, store.getSnapshot);
180
+ const [editing, setEditing] = useState(null);
181
+ useEffect(() => { void store.load(); }, [store]);
182
+ const onEdit = useCallback((role) => { setEditing(role); }, []);
183
+ const onClose = useCallback(() => { setEditing(null); }, []);
184
+ const chat = useMemo(() => snapshot.roles.find(row => row.role === PRIMARY_ROLE) ?? null, [snapshot.roles]);
185
+ if (snapshot.status === 'error') {
186
+ return (_jsx("div", { style: T.page, children: _jsxs("div", { style: { ...T.card, borderStyle: 'dashed' }, children: [_jsxs("div", { style: T.cardHead, children: [_jsx("h3", { style: T.title, children: "Settings could not be read" }), _jsx(StatusChip, { tone: "caution", children: "Unavailable" })] }), _jsx("p", { style: { ...T.lead, margin: '8px 0 0' }, children: "The Harness did not answer. Nothing has been changed, and no capability has been reconfigured." }), _jsx("div", { style: CONTROL.row, children: _jsx("button", { type: "button", style: CONTROL.primary, onClick: () => { void store.load(); }, children: "Try again" }) })] }) }));
187
+ }
188
+ return (_jsxs("div", { style: T.page, children: [_jsx("p", { style: T.lead, children: "A capability is assigned per role, not per provider. One provider may serve several roles, and a role with nothing assigned says so \u2014 it never falls back to another role\u2019s model, and a stored credential never assigns itself." }), snapshot.writable
189
+ ? null
190
+ : (_jsxs("div", { id: "watch-bindings-readonly", style: { ...T.card, borderStyle: 'dashed' }, children: [_jsxs("div", { style: T.cardHead, children: [_jsx("h3", { style: T.title, children: "Settings are read-only" }), _jsx(StatusChip, { tone: "caution", children: "Not writable" })] }), _jsx("p", { style: { ...T.lead, margin: '8px 0 0' }, children: "This Workspace was opened against a configuration the Harness will not let it change, so assignments cannot be edited here. Nothing is wrong with the capabilities themselves \u2014 what is shown below is accurate and read from the running system." })] })), chat !== null && !isExecutable(chat.readiness)
191
+ ? (_jsxs("div", { style: { ...T.card, borderColor: 'var(--watch-accent)' }, children: [_jsxs("div", { style: T.cardHead, children: [_jsx("h3", { style: T.title, children: "Chat is not ready yet" }), _jsx(StatusChip, { tone: "neutral", children: BINDING_STATUS_LABEL[chat.readiness.status] })] }), _jsxs("p", { style: { ...T.lead, margin: '8px 0 0' }, children: [blockerMessage(chat.readiness) ?? 'Choose a provider and model for Chat.', ' Until then the composer stays closed and nothing is sent.'] }), _jsx("div", { style: CONTROL.row, children: _jsx("button", { type: "button", style: CONTROL.primary, disabled: !snapshot.writable, "aria-describedby": snapshot.writable ? undefined : 'watch-bindings-readonly', onClick: () => { setEditing(PRIMARY_ROLE); }, children: "Choose models and roles" }) })] }))
192
+ : null, _jsx("p", { role: "status", "aria-live": "polite", style: {
193
+ margin: '0 0 10px', fontSize: '12px',
194
+ color: 'var(--dsw-alias-label-tertiary)',
195
+ minHeight: '1em',
196
+ }, children: snapshot.saving
197
+ ? 'Saving the assignment…'
198
+ : snapshot.testingRole !== null
199
+ ? `Testing ${ROLE_LABEL[snapshot.testingRole]} with one bounded provider request…`
200
+ : snapshot.testMessage !== null
201
+ ? snapshot.testMessage
202
+ : snapshot.error !== null
203
+ ? snapshot.error
204
+ : '' }), _jsx("h2", { style: T.h2, children: "Capabilities" }), BINDABLE_ROLES.map((role) => {
205
+ const row = snapshot.roles.find(entry => entry.role === role);
206
+ return row === undefined
207
+ ? null
208
+ : (_jsx(RoleCard, { row: row, providers: snapshot.providers, snapshot: snapshot, store: store, openEditor: editing === role, editing: editing, onEdit: onEdit, onClose: onClose }, role));
209
+ }), _jsx("h2", { style: T.h2, children: "Providers" }), _jsx(ProviderList, { providers: snapshot.providers }), _jsx("p", { style: T.note, children: "Assignments are stored beside the Harness\u2019s own settings, and reference a credential rather than holding one. Watch keeps no second credential store and never sees a key." })] }));
210
+ }
211
+ //# sourceMappingURL=role-bindings.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"role-bindings.js","sourceRoot":"","sources":["../../src/client/role-bindings.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAEH,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,oBAAoB,EAAE,MAAM,OAAO,CAAA;AAEtG,OAAO,EACL,cAAc,EAAE,oBAAoB,EAAE,uBAAuB,EAAE,YAAY,EAC3E,UAAU,EAAE,YAAY,EAAE,cAAc,EAAE,YAAY,GACvD,MAAM,0BAA0B,CAAA;AAEjC,OAAO,EAAE,UAAU,EAAE,CAAC,EAAE,MAAM,iBAAiB,CAAA;AAC/C,OAAO,EACL,oBAAoB,EAAE,YAAY,EAAE,cAAc,EAAE,gBAAgB,EAAE,iBAAiB,GACxF,MAAM,iBAAiB,CAAA;AASxB;;;;;;GAMG;AACH,SAAS,OAAO,CAAC,SAAwB;IACvC,IAAI,YAAY,CAAC,SAAS,CAAC;QAAE,OAAO,QAAQ,CAAA;IAC5C,OAAO,SAAS,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,CAAA;AAC/D,CAAC;AAED,gEAAgE;AAChE,SAAS,cAAc,CAAC,MAAc;IACpC,IAAI,MAAM,KAAK,UAAU;QAAE,OAAO,QAAQ,CAAA;IAC1C,IAAI,MAAM,KAAK,UAAU,IAAI,MAAM,KAAK,cAAc;QAAE,OAAO,SAAS,CAAA;IACxE,OAAO,SAAS,CAAA;AAClB,CAAC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