@happyvertical/smrt-svelte 0.61.6 → 0.62.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.
@@ -177,4 +177,4 @@ Component tests cover placement, disappearance after the AI step and unsafe URLs
177
177
  product svelte-check verifies the real cross-version boundary. No type assertion,
178
178
  new action type, helper, component or dependency override is needed.
179
179
 
180
- S1: failed engine selection stays visible across focus/status refresh. Pending ChatGPT sign-in recovers its validated link through `chatgpt-start` after reload without reopening the system browser. The link, ten-minute expiry explanation and Cancel live inside the ChatGPT card in both presentations. `chatgpt-cancel` invokes the authenticated connection's cancellation handle; unsupported SDK cancellation returns a fixed 409 and is never shown as success. No raw remote errors/URLs enter logs. WorkProfileSettings reuses Card/Toggle/ConfirmDialog for default-on removal and local-CLI protection settings; disabling protection requires the explicit command/file risk confirmation. The ChatGPT engine choice links to Connect AI when signed out.
180
+ S1: failed engine selection stays visible across focus/status refresh. Pending ChatGPT sign-in recovers its validated link through `chatgpt-start` after reload without reopening the system browser. The link, ten-minute expiry explanation and Cancel live inside the ChatGPT card in both presentations. `chatgpt-cancel` invokes the authenticated connection's cancellation handle; unsupported SDK cancellation returns a fixed 409 and is never shown as success. No raw remote errors/URLs enter logs. The default-on removal and local-CLI protection settings live in the inference settings panel's assistant section; disabling protection requires the explicit command/file risk confirmation. The ChatGPT engine choice links to Connect AI when signed out.
@@ -64,46 +64,8 @@ existing reusable titled owner settings container.
64
64
 
65
65
  ## Assistant
66
66
 
67
- `WorkProfileSettings` composes smrt-ui Card, FormGroup, Input, Select, Toggle and
68
- Button and the existing Disclosure. The host supplies sparse overrides, resolved
69
- profiles, an editable flag and authorized save/reset callbacks. Basic controls show
70
- the human engine label, selection evidence and requested effort, preview, and
71
- assist escalation. Exact requested/current model IDs, model/effort overrides and
72
- limits live in the closed Advanced disclosure. Strongest/custom/fallback labels
73
- come from inference selection metadata; an old or unverified result is only
74
- configured/provider-default, never inferred strongest from its tier. It owns no model policy, persistence or approval authority. Unknown
75
- engine/catalog resolution is shown as unavailable while editing/reset remain
76
- usable. CLI token limits are explicitly advisory where the CLI cannot enforce a
77
- per-call ceiling; app-tool count and wall-time checks remain host-enforced.
78
- The note describes own-plan/API-key billing. Safety switches are absent.
67
+ The assistant's settings (workflow handoff, preview before applying, removal
68
+ approval, local AI protection) are part of the one inference settings surface,
69
+ `InferenceSettingsPanel` in `@happyvertical/smrt-inference/svelte` (#5005).
70
+ Which model answers is the tier binding's choice, not a setting here.
79
71
 
80
- MCP architecture inventory and intent/name/purpose searches found inference's
81
- resolver, preferences' kind store, SettingsCatalog and ConnectAi. The editor adds
82
- only the missing domain composition, reusing the shared visual/form primitives
83
- and translated messages. Mounted tests exercise edit/save/reset, refused save,
84
- unavailable connection repair and accessibility.
85
-
86
- Save forwards sparse owner overrides, not the resolved defaults shown in the
87
- controls. Untouched Save and unrelated effort/preview/budget edits must not
88
- materialize `budgets.passes`; the design host can size a default run within its
89
- recommended maximum. An explicitly saved pass count, including the recommended
90
- number itself, remains an owner override. Reset removes the preference and the
91
- next loader supplies `{}`. Mounted regressions cover untouched/unrelated edits,
92
- explicit two/four-pass round trips and reset followed by sparse Save.
93
-
94
- Duration controls display seconds while persistence remains integer milliseconds.
95
- The existing Input uses decimal text for these fixed-point values; native numeric
96
- binding can otherwise lose a millisecond before parsing at the safe-integer
97
- boundary. Component-local `formatBudgetSeconds`/`changeBudgetSeconds` use exact
98
- integer arithmetic, reject nonpositive/sub-millisecond/unsafe values, and block
99
- Save until corrected without replacing the owner value with a default. Other
100
- budgets keep numeric controls. Tests retain all prior sparse-save assertions and
101
- cover 12345ms, 1001ms and MAX_SAFE_INTEGER round trips, malformed text, advanced
102
- visibility, actual human summaries and remembered fallback presentation.
103
-
104
- Reuse review/context/introspection and intent/name/purpose queries found no
105
- precision-preserving duration editor in UI/Svelte/Chat/Core/inference. The private
106
- Chat tool-duration formatter intentionally rounds and cannot edit owner budgets.
107
- The conversion stays in the existing domain component; no new utility file or
108
- primitive is introduced. Engine labels reuse inference's public pure label seam,
109
- and Advanced reuses smrt-ui Disclosure.
@@ -3,5 +3,4 @@ export { default as OwnerApprovalsSettings } from './OwnerApprovalsSettings.svel
3
3
  export { default as PrebuiltComponentsSettings } from './PrebuiltComponentsSettings.svelte';
4
4
  export { default as SettingsCatalog } from './SettingsCatalog.svelte';
5
5
  export type { PaginateSettingsCatalogOptions, SettingsCatalogItem, SettingsCatalogPage, } from './types.js';
6
- export { default as WorkProfileSettings } from './WorkProfileSettings.svelte';
7
6
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/settings/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAC;AACvD,OAAO,EAAE,OAAO,IAAI,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AACpF,OAAO,EAAE,OAAO,IAAI,0BAA0B,EAAE,MAAM,qCAAqC,CAAC;AAC5F,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,0BAA0B,CAAC;AACtE,YAAY,EACV,8BAA8B,EAC9B,mBAAmB,EACnB,mBAAmB,GACpB,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,OAAO,IAAI,mBAAmB,EAAE,MAAM,8BAA8B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/settings/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAC;AACvD,OAAO,EAAE,OAAO,IAAI,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AACpF,OAAO,EAAE,OAAO,IAAI,0BAA0B,EAAE,MAAM,qCAAqC,CAAC;AAC5F,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,0BAA0B,CAAC;AACtE,YAAY,EACV,8BAA8B,EAC9B,mBAAmB,EACnB,mBAAmB,GACpB,MAAM,YAAY,CAAC"}
@@ -2,4 +2,3 @@ export { paginateSettingsCatalog } from './catalog.js';
2
2
  export { default as OwnerApprovalsSettings } from './OwnerApprovalsSettings.svelte';
3
3
  export { default as PrebuiltComponentsSettings } from './PrebuiltComponentsSettings.svelte';
4
4
  export { default as SettingsCatalog } from './SettingsCatalog.svelte';
5
- export { default as WorkProfileSettings } from './WorkProfileSettings.svelte';
@@ -5,10 +5,10 @@ description: "Svelte 5 components for SMRT user management - auth, users, tenant
5
5
  status: "stable"
6
6
  generated:
7
7
  by: "smrt/scripts/generate-knowledge-okf.ts"
8
- at: "2026-11-13T15:00:45Z"
8
+ at: "2026-11-16T03:44:31Z"
9
9
  audience: "internal"
10
10
  evidence_level: "manifest-described"
11
- source_revision: "sha256:da2d298b4c97d8a18b1edb08a9dbd584abcdc9a9e0ee5d4bb90bf0f3b76c366b"
11
+ source_revision: "sha256:0770f6d7501250ce87d633968a08891223933bdf79183be4143ae7e690c9880e"
12
12
  sources:
13
13
  - id: "manifest"
14
14
  resource: "https://github.com/happyvertical/smrt/blob/main/packages/smrt-svelte/package.json"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@happyvertical/smrt-svelte",
3
- "version": "0.61.6",
3
+ "version": "0.62.0",
4
4
  "smrtJsdoc": "strict",
5
5
  "description": "Svelte 5 components for SMRT user management - auth, users, tenants, roles, permissions, groups",
6
6
  "type": "module",
@@ -242,18 +242,18 @@
242
242
  },
243
243
  "dependencies": {
244
244
  "@happyvertical/logger": "^0.113.0",
245
- "@happyvertical/smrt-core": "0.61.6",
246
- "@happyvertical/smrt-fields": "0.61.6",
247
- "@happyvertical/smrt-languages": "0.61.6",
248
- "@happyvertical/smrt-mcp-apps": "0.61.6",
249
- "@happyvertical/smrt-types": "0.61.6",
250
- "@happyvertical/smrt-ui": "0.61.6",
251
- "@happyvertical/smrt-web": "0.61.6",
245
+ "@happyvertical/smrt-core": "0.62.0",
246
+ "@happyvertical/smrt-fields": "0.62.0",
247
+ "@happyvertical/smrt-languages": "0.62.0",
248
+ "@happyvertical/smrt-mcp-apps": "0.62.0",
249
+ "@happyvertical/smrt-types": "0.62.0",
250
+ "@happyvertical/smrt-ui": "0.62.0",
251
+ "@happyvertical/smrt-web": "0.62.0",
252
252
  "@tanstack/db": "^1.0.0-rc.1",
253
253
  "@tanstack/svelte-db": "^1.0.0-rc.1",
254
254
  "esm-env": "^1.2.2",
255
- "@happyvertical/smrt-chat": "0.61.6",
256
- "@happyvertical/smrt-inference": "0.61.6"
255
+ "@happyvertical/smrt-chat": "0.62.0",
256
+ "@happyvertical/smrt-inference": "0.62.0"
257
257
  },
258
258
  "peerDependencies": {
259
259
  "@happyvertical/speech": ">=0.102.5",
@@ -285,12 +285,12 @@
285
285
  }
286
286
  },
287
287
  "devDependencies": {
288
- "@happyvertical/smrt-agents": "0.61.6",
289
- "@happyvertical/smrt-content": "0.61.6",
290
- "@happyvertical/smrt-reports": "0.61.6",
291
- "@happyvertical/smrt-scanner": "0.61.6",
292
- "@happyvertical/smrt-tenancy": "0.61.6",
293
- "@happyvertical/smrt-users": "0.61.6",
288
+ "@happyvertical/smrt-agents": "0.62.0",
289
+ "@happyvertical/smrt-content": "0.62.0",
290
+ "@happyvertical/smrt-reports": "0.62.0",
291
+ "@happyvertical/smrt-scanner": "0.62.0",
292
+ "@happyvertical/smrt-tenancy": "0.62.0",
293
+ "@happyvertical/smrt-users": "0.62.0",
294
294
  "@happyvertical/speech": "^0.113.0",
295
295
  "@sveltejs/package": "^2.5.8",
296
296
  "@sveltejs/vite-plugin-svelte": "^7.3.0",
@@ -1,250 +0,0 @@
1
- <script lang="ts">
2
- import type {
3
- AssistantSafetySettings,
4
- WorkProfileSettings as OwnerWorkProfileSettings,
5
- ResolvedWorkProfile,
6
- WorkProfileBudgets,
7
- WorkProfileName,
8
- } from '@happyvertical/smrt-inference';
9
- import { engineLabel } from '@happyvertical/smrt-inference';
10
- import { ConfirmDialog } from '@happyvertical/smrt-ui/feedback';
11
- import { FormGroup, Input, Select, Toggle } from '@happyvertical/smrt-ui/forms';
12
- import { defineMessages, useI18n } from '@happyvertical/smrt-ui/i18n';
13
- import { Button, Card, Disclosure } from '@happyvertical/smrt-ui/ui';
14
- import { tick } from 'svelte';
15
- import { M as connectAiMessages } from '../../i18n/strings.connect-ai.js';
16
- import { safeHref } from '../overview/markdown.js';
17
-
18
- const M = defineMessages({
19
- 'ui.work_profiles.title': 'Assistant',
20
- 'ui.work_profiles.note':
21
- 'AI work uses your connected plan or saved API key. Best intelligence is recommended.',
22
- 'ui.work_profiles.design': 'System design',
23
- 'ui.work_profiles.assist': 'Everyday assistance',
24
- 'ui.work_profiles.background': 'Background work',
25
- 'ui.work_profiles.engine': 'Engine',
26
- 'ui.work_profiles.model': 'Model',
27
- 'ui.work_profiles.effort': 'Reasoning effort',
28
- 'ui.work_profiles.recommended': 'Recommended',
29
- 'ui.work_profiles.resolved': '{engine} · {model} · {effort}',
30
- 'ui.work_profiles.strongest': 'strongest model',
31
- 'ui.work_profiles.custom': 'custom model',
32
- 'ui.work_profiles.configured': 'configured model',
33
- 'ui.work_profiles.fallback': 'fallback model',
34
- 'ui.work_profiles.default_model': 'provider default',
35
- 'ui.work_profiles.advanced': 'Advanced',
36
- 'ui.work_profiles.requested_model': 'Requested model',
37
- 'ui.work_profiles.current_model': 'Current model',
38
- 'ui.work_profiles.effort_low': 'low effort',
39
- 'ui.work_profiles.effort_medium': 'medium effort',
40
- 'ui.work_profiles.effort_high': 'high effort',
41
- 'ui.work_profiles.effort_xhigh': 'very high effort',
42
- 'ui.work_profiles.effort_max': 'maximum effort',
43
- 'ui.work_profiles.unavailable':
44
- 'This connection is unavailable. You can change its settings or reset to recommended.',
45
- 'ui.work_profiles.provider': 'Best available from your provider',
46
- 'ui.work_profiles.escalate':
47
- 'Automatically use system design for structure changes',
48
- 'ui.work_profiles.preview': 'Preview before applying design changes',
49
- 'ui.work_profiles.save': 'Save assistant settings',
50
- 'ui.work_profiles.reset': 'Reset to recommended',
51
- 'ui.work_profiles.failed':
52
- 'The change could not be saved. Refresh and try again.',
53
- 'ui.work_profiles.cli_limits':
54
- 'CLI connections enforce app tool steps and pass time limits. Token budgets depend on usage reported by the CLI; a per-call token ceiling cannot be guaranteed.',
55
- 'ui.work_profiles.safety': 'Safety',
56
- 'ui.work_profiles.removals': 'Ask before deleting or removing',
57
- 'ui.work_profiles.removals_help':
58
- 'Applies to chat in this app. Deleted records cannot be restored. Requests from outside this app and permanent purges always need owner approval. Design previews still apply.',
59
- 'ui.work_profiles.protection': 'Protect this computer from local AI tools',
60
- 'ui.work_profiles.protection_help':
61
- 'When on, Claude Code and Codex use the app’s protected tool setup. When off, they can use their own tools, settings and plugins in the app’s data folder.',
62
- 'ui.work_profiles.protection_confirm': 'Turn off local AI protection?',
63
- 'ui.work_profiles.protection_risk':
64
- "A chat message in this app can run commands and change files on this computer. That includes this app's own data, so records can be changed or deleted without asking you first.",
65
- 'ui.work_profiles.protection_off': 'Turn off protection',
66
- 'ui.work_profiles.cancel': 'Cancel',
67
- 'ui.work_profiles.connect_chatgpt': 'Sign in with ChatGPT in Connect AI',
68
- 'ui.work_profiles.maxSteps': 'Tool steps per pass',
69
- 'ui.work_profiles.maxTokens': 'Output tokens per call',
70
- 'ui.work_profiles.maxTurnTokens': 'Tokens per pass',
71
- 'ui.work_profiles.requestTimeoutMs': 'Reply time limit (seconds)',
72
- 'ui.work_profiles.turnTimeoutMs': 'Pass time limit (seconds)',
73
- 'ui.work_profiles.maxRunTokens': 'Tokens per run',
74
- 'ui.work_profiles.runTimeoutMs': 'Whole request time limit (seconds)',
75
- 'ui.work_profiles.passes': 'Passes per run',
76
- 'ui.work_profiles.repairRetries': 'Attempts to fix an incomplete reply',
77
- 'ui.work_profiles.toolResultChars': 'Maximum action detail (characters)',
78
- 'ui.work_profiles.time_precision':
79
- 'Enter a positive time in seconds with at most three decimal places.',
80
- });
81
- const { t } = useI18n();
82
- let {
83
- settings,
84
- resolved,
85
- onsave,
86
- onreset,
87
- editable = true,
88
- chatgptSignedIn = false,
89
- connectAiHref = '/settings#chatgpt',
90
- }: {
91
- settings: Partial<Record<WorkProfileName, OwnerWorkProfileSettings>> & {
92
- safety?: AssistantSafetySettings;
93
- };
94
- resolved: (ResolvedWorkProfile & { unavailable?: boolean })[];
95
- onsave(
96
- settings: Partial<Record<WorkProfileName, OwnerWorkProfileSettings>> & {
97
- safety?: AssistantSafetySettings;
98
- },
99
- confirmation?: { confirmUnprotectedCli?: boolean },
100
- ): Promise<void>;
101
- onreset(): Promise<void>;
102
- editable?: boolean;
103
- chatgptSignedIn?: boolean;
104
- connectAiHref?: string;
105
- } = $props();
106
- let protectionChecked = $state(true);
107
- let confirmingProtection = $state(false);
108
- let confirmedProtection = $state(false);
109
- let drafts = $state<
110
- Partial<Record<WorkProfileName, OwnerWorkProfileSettings>> & {
111
- safety?: AssistantSafetySettings;
112
- }
113
- >({});
114
- let busy = $state(false);
115
- let failed = $state(false);
116
- let durationEdits = $state<Record<string, { value: string; invalid: boolean }>>(
117
- {},
118
- );
119
- const invalidDuration = $derived(
120
- Object.values(durationEdits).some((edit) => edit.invalid),
121
- );
122
- $effect(() => {
123
- drafts = structuredClone(settings);
124
- confirmedProtection = false;
125
- protectionChecked = settings.safety?.protectLocalCli !== false;
126
- durationEdits = {};
127
- });
128
- const budgetKeys: (keyof WorkProfileBudgets)[] = [
129
- 'maxSteps',
130
- 'maxTokens',
131
- 'maxTurnTokens',
132
- 'requestTimeoutMs',
133
- 'turnTimeoutMs',
134
- 'maxRunTokens',
135
- 'runTimeoutMs',
136
- 'passes',
137
- 'repairRetries',
138
- 'toolResultChars',
139
- ];
140
- const effortChoices = ['low', 'medium', 'high', 'xhigh', 'max'] as const;
141
- function change(
142
- name: WorkProfileName,
143
- field: keyof OwnerWorkProfileSettings,
144
- value: unknown,
145
- ) {
146
- const next = { ...drafts[name], [field]: value };
147
- if (value === undefined) delete next[field];
148
- drafts = { ...drafts, [name]: next };
149
- }
150
- // Keep the integer-millisecond contract exact, including floating boundaries.
151
- function formatBudgetSeconds(milliseconds: number): string {
152
- if (!Number.isSafeInteger(milliseconds) || milliseconds < 1) return '';
153
- const value = BigInt(milliseconds);
154
- const fraction = String(value % 1000n)
155
- .padStart(3, '0')
156
- .replace(/0+$/, '');
157
- return `${value / 1000n}${fraction ? `.${fraction}` : ''}`;
158
- }
159
- function changeBudgetSeconds(
160
- name: WorkProfileName,
161
- key: keyof WorkProfileBudgets,
162
- value: string,
163
- ) {
164
- const match = /^(\d*)(?:\.(\d*))?$/.exec(value);
165
- const fraction = (match?.[2] ?? '').replace(/0+$/, '');
166
- const milliseconds =
167
- match && (match[1] || match[2]) && fraction.length <= 3
168
- ? BigInt(match[1] || '0') * 1000n + BigInt(fraction.padEnd(3, '0') || '0')
169
- : 0n;
170
- const invalid =
171
- milliseconds < 1n || milliseconds > BigInt(Number.MAX_SAFE_INTEGER);
172
- durationEdits = {
173
- ...durationEdits,
174
- [`${name}:${key}`]: { value, invalid },
175
- };
176
- if (!invalid)
177
- change(name, 'budgets', {
178
- ...drafts[name]?.budgets,
179
- [key]: Number(milliseconds),
180
- });
181
- }
182
- async function save(reset = false) {
183
- if (!reset && invalidDuration) return;
184
- busy = true;
185
- failed = false;
186
- try {
187
- if (reset) await onreset();
188
- else if (confirmedProtection)
189
- await onsave(drafts, { confirmUnprotectedCli: true });
190
- else await onsave(drafts);
191
- } catch {
192
- failed = true;
193
- } finally {
194
- busy = false;
195
- }
196
- }
197
- </script>
198
- <section data-smrt-component="WorkProfileSettings" aria-label={t(M['ui.work_profiles.title'])}>
199
- <h2>{t(M['ui.work_profiles.title'])}</h2>
200
- <p>{t(M['ui.work_profiles.note'])}</p>
201
- {#each resolved as profile (profile.name)}
202
- <Card>
203
- <h3>{t(M[`ui.work_profiles.${profile.name}`])}</h3>
204
- {#if profile.unavailable}<p role="status">{t(M['ui.work_profiles.unavailable'])}</p>{:else}<p>{t(M['ui.work_profiles.resolved'], { engine: engineLabel(profile.engine), model: t(M[profile.modelSelection?.kind === 'strongest' ? 'ui.work_profiles.strongest' : profile.modelSelection?.kind === 'custom' ? 'ui.work_profiles.custom' : profile.modelSelection?.kind === 'fallback' ? 'ui.work_profiles.fallback' : profile.model ? 'ui.work_profiles.configured' : 'ui.work_profiles.default_model']), effort: t(M[`ui.work_profiles.effort_${profile.effort}`]) })}</p>{/if}
205
- <FormGroup label={t(M['ui.work_profiles.engine'])}>
206
- <Select value={drafts[profile.name]?.engine ?? ''} disabled={!editable || busy} onchange={event => change(profile.name, 'engine', event.currentTarget.value || undefined)}>
207
- <option value="">{t(M['ui.work_profiles.recommended'])}</option>
208
- <option value="claude-code">{t(connectAiMessages['ui.connect_ai.claude'])}</option><option value="codex">{t(connectAiMessages['ui.connect_ai.codex'])}</option><option value="chatgpt">{t(connectAiMessages['ui.connect_ai.chatgpt'])}</option><option value="api">{t(connectAiMessages['ui.connect_ai.api'])}</option>
209
- </Select>
210
- </FormGroup>
211
- {#if !chatgptSignedIn && (drafts[profile.name]?.engine ?? profile.engine) === 'chatgpt'}
212
- <Button variant="secondary" href={safeHref(connectAiHref) ?? undefined}>{t(M['ui.work_profiles.connect_chatgpt'])}</Button>
213
- {/if}
214
- <Disclosure title={t(M['ui.work_profiles.advanced'])}>
215
- <p>{t(M['ui.work_profiles.requested_model'])}: <code>{profile.modelSelection?.requestedModel ?? profile.model ?? t(M['ui.work_profiles.default_model'])}</code></p>
216
- <p>{t(M['ui.work_profiles.current_model'])}: <code>{profile.modelSelection?.resolvedModel ?? profile.model ?? t(M['ui.work_profiles.default_model'])}</code></p>
217
- <FormGroup label={t(M['ui.work_profiles.model'])}>
218
- <Input value={drafts[profile.name]?.model ?? ''} placeholder={profile.model ?? t(M['ui.work_profiles.provider'])} disabled={!editable || busy} onchange={event => change(profile.name, 'model', event.currentTarget.value.trim() || undefined)} />
219
- </FormGroup>
220
- <FormGroup label={t(M['ui.work_profiles.effort'])}>
221
- <Select value={drafts[profile.name]?.effort ?? ''} disabled={!editable || busy} onchange={event => change(profile.name, 'effort', event.currentTarget.value || undefined)}>
222
- <option value="">{t(M['ui.work_profiles.recommended'])}</option>
223
- {#each effortChoices as effort}<option value={effort}>{t(M[`ui.work_profiles.effort_${effort}`])}</option>{/each}
224
- </Select>
225
- </FormGroup>
226
- {#each budgetKeys as key}
227
- <FormGroup label={t(M[`ui.work_profiles.${key}`])}>
228
- <Input type={key.endsWith('TimeoutMs') ? 'text' : 'number'} inputmode={key.endsWith('TimeoutMs') ? 'decimal' : undefined} min={key.endsWith('TimeoutMs') ? undefined : key === 'repairRetries' ? 0 : 1} step={key.endsWith('TimeoutMs') ? undefined : '1'} value={key.endsWith('TimeoutMs') ? durationEdits[`${profile.name}:${key}`]?.value ?? formatBudgetSeconds(drafts[profile.name]?.budgets?.[key] ?? profile.budgets[key]) : drafts[profile.name]?.budgets?.[key] ?? profile.budgets[key]} disabled={!editable || busy} onchange={event => key.endsWith('TimeoutMs') ? changeBudgetSeconds(profile.name, key, event.currentTarget.value) : change(profile.name, 'budgets', { ...drafts[profile.name]?.budgets, [key]: Number(event.currentTarget.value) })} />
229
- </FormGroup>
230
- {/each}
231
- </Disclosure>
232
- {#if profile.name === 'assist'}<Toggle label={t(M['ui.work_profiles.escalate'])} checked={drafts.assist?.autoEscalate ?? profile.autoEscalate} disabled={!editable || busy} onchange={checked => change('assist', 'autoEscalate', checked)} />{/if}
233
- <Toggle label={t(M['ui.work_profiles.preview'])} checked={drafts[profile.name]?.previewBeforeApply ?? profile.previewBeforeApply} disabled={!editable || busy} onchange={checked => change(profile.name, 'previewBeforeApply', checked)} />
234
- </Card>
235
- {/each}
236
- <Card>
237
- <h3>{t(M['ui.work_profiles.safety'])}</h3>
238
- <Toggle label={t(M['ui.work_profiles.removals'])} checked={drafts.safety?.requireRemovalApproval !== false} disabled={!editable || busy} onchange={checked => { drafts = { ...drafts, safety: { ...drafts.safety, requireRemovalApproval: checked } }; }} />
239
- <p>{t(M['ui.work_profiles.removals_help'])}</p>
240
- <Toggle label={t(M['ui.work_profiles.protection'])} bind:checked={protectionChecked} disabled={!editable || busy} onchange={async checked => { if (!checked) { confirmingProtection = true; await tick(); protectionChecked = true; } else { confirmedProtection = false; drafts = { ...drafts, safety: { ...drafts.safety, protectLocalCli: true } }; } }} />
241
- <p>{t(M['ui.work_profiles.protection_help'])}</p>
242
- </Card>
243
- {#if resolved.some(profile => profile.engine === 'claude-code' || profile.engine === 'codex')}<p>{t(M['ui.work_profiles.cli_limits'])}</p>{/if}
244
- {#if failed}<p role="alert">{t(M['ui.work_profiles.failed'])}</p>{/if}
245
- {#if invalidDuration}<p role="alert">{t(M['ui.work_profiles.time_precision'])}</p>{/if}
246
- <Button disabled={!editable || busy || invalidDuration} onclick={() => save()}>{t(M['ui.work_profiles.save'])}</Button>
247
- <Button disabled={!editable || busy} onclick={() => save(true)}>{t(M['ui.work_profiles.reset'])}</Button>
248
- </section>
249
-
250
- <ConfirmDialog open={confirmingProtection} title={t(M['ui.work_profiles.protection_confirm'])} message={t(M['ui.work_profiles.protection_risk'])} confirmLabel={t(M['ui.work_profiles.protection_off'])} cancelLabel={t(M['ui.work_profiles.cancel'])} destructive oncancel={() => { confirmingProtection = false; }} onconfirm={() => { confirmingProtection = false; confirmedProtection = true; protectionChecked = false; drafts = { ...drafts, safety: { ...drafts.safety, protectLocalCli: false } }; }} />
@@ -1,22 +0,0 @@
1
- import type { AssistantSafetySettings, WorkProfileSettings as OwnerWorkProfileSettings, ResolvedWorkProfile, WorkProfileName } from '@happyvertical/smrt-inference';
2
- type $$ComponentProps = {
3
- settings: Partial<Record<WorkProfileName, OwnerWorkProfileSettings>> & {
4
- safety?: AssistantSafetySettings;
5
- };
6
- resolved: (ResolvedWorkProfile & {
7
- unavailable?: boolean;
8
- })[];
9
- onsave(settings: Partial<Record<WorkProfileName, OwnerWorkProfileSettings>> & {
10
- safety?: AssistantSafetySettings;
11
- }, confirmation?: {
12
- confirmUnprotectedCli?: boolean;
13
- }): Promise<void>;
14
- onreset(): Promise<void>;
15
- editable?: boolean;
16
- chatgptSignedIn?: boolean;
17
- connectAiHref?: string;
18
- };
19
- declare const WorkProfileSettings: import("svelte").Component<$$ComponentProps, {}, "">;
20
- type WorkProfileSettings = ReturnType<typeof WorkProfileSettings>;
21
- export default WorkProfileSettings;
22
- //# sourceMappingURL=WorkProfileSettings.svelte.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"WorkProfileSettings.svelte.d.ts","sourceRoot":"","sources":["../../../src/components/settings/WorkProfileSettings.svelte.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,uBAAuB,EACvB,mBAAmB,IAAI,wBAAwB,EAC/C,mBAAmB,EAEnB,eAAe,EAChB,MAAM,+BAA+B,CAAC;AAUtC,KAAK,gBAAgB,GAAI;IACxB,QAAQ,EAAE,OAAO,CAAC,MAAM,CAAC,eAAe,EAAE,wBAAwB,CAAC,CAAC,GAAG;QACrE,MAAM,CAAC,EAAE,uBAAuB,CAAC;KAClC,CAAC;IACF,QAAQ,EAAE,CAAC,mBAAmB,GAAG;QAAE,WAAW,CAAC,EAAE,OAAO,CAAA;KAAE,CAAC,EAAE,CAAC;IAC9D,MAAM,CACJ,QAAQ,EAAE,OAAO,CAAC,MAAM,CAAC,eAAe,EAAE,wBAAwB,CAAC,CAAC,GAAG;QACrE,MAAM,CAAC,EAAE,uBAAuB,CAAC;KAClC,EACD,YAAY,CAAC,EAAE;QAAE,qBAAqB,CAAC,EAAE,OAAO,CAAA;KAAE,GACjD,OAAO,CAAC,IAAI,CAAC,CAAC;IACjB,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IACzB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB,CAAC;AAyOF,QAAA,MAAM,mBAAmB,sDAAwC,CAAC;AAClE,KAAK,mBAAmB,GAAG,UAAU,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAClE,eAAe,mBAAmB,CAAC"}