@sigrun/shared 0.1.2 → 0.2.1

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.
Files changed (48) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/package.json +1 -1
  3. package/dist/access.d.ts +0 -55
  4. package/dist/access.js +0 -72
  5. package/dist/ambient.d.ts +0 -111
  6. package/dist/ambient.js +0 -23
  7. package/dist/blocks/format.d.ts +0 -28
  8. package/dist/blocks/format.js +0 -199
  9. package/dist/blocks/icons.d.ts +0 -12
  10. package/dist/blocks/icons.js +0 -64
  11. package/dist/blocks/index.d.ts +0 -25
  12. package/dist/blocks/index.js +0 -21
  13. package/dist/blocks/instance.d.ts +0 -29
  14. package/dist/blocks/instance.js +0 -51
  15. package/dist/blocks/lttb.d.ts +0 -16
  16. package/dist/blocks/lttb.js +0 -67
  17. package/dist/blocks/ops.d.ts +0 -44
  18. package/dist/blocks/ops.js +0 -294
  19. package/dist/blocks/text.d.ts +0 -43
  20. package/dist/blocks/text.js +0 -790
  21. package/dist/blocks/transport.d.ts +0 -77
  22. package/dist/blocks/transport.js +0 -11
  23. package/dist/blocks/types.d.ts +0 -541
  24. package/dist/blocks/types.js +0 -17
  25. package/dist/commands.d.ts +0 -75
  26. package/dist/commands.js +0 -25
  27. package/dist/conversations.d.ts +0 -31
  28. package/dist/conversations.js +0 -94
  29. package/dist/interactions.d.ts +0 -91
  30. package/dist/interactions.js +0 -21
  31. package/dist/jobs.d.ts +0 -109
  32. package/dist/jobs.js +0 -19
  33. package/dist/json.d.ts +0 -20
  34. package/dist/json.js +0 -13
  35. package/dist/live.d.ts +0 -71
  36. package/dist/live.js +0 -82
  37. package/dist/session-meta.d.ts +0 -119
  38. package/dist/session-meta.js +0 -13
  39. package/dist/settings.d.ts +0 -408
  40. package/dist/settings.js +0 -19
  41. package/dist/themes.d.ts +0 -50
  42. package/dist/themes.js +0 -156
  43. package/dist/turns.d.ts +0 -119
  44. package/dist/turns.js +0 -197
  45. package/dist/view-delta.d.ts +0 -54
  46. package/dist/view-delta.js +0 -135
  47. package/dist/views.d.ts +0 -822
  48. package/dist/views.js +0 -38
@@ -1,119 +0,0 @@
1
- /**
2
- * The session-meta WIRE types (spec §5) — the client-facing half of
3
- * `src/server/session-meta.ts` (which owns the document/patch runtime).
4
- *
5
- * This module is part of the shared leaf package (`@sigrun/shared`): the
6
- * tui and webui import these shapes from here, never from server source
7
- * (the load-bearing decoupling — the tui is a pure client of the wire).
8
- *
9
- * PURE module: no imports at all (the views-purity guard enforces this
10
- * across `shared/src`) — the `import type` below is the sanctioned wire-
11
- * module exception: sibling-only (`./access.js`), type-only.
12
- */
13
- import type { Sharing } from "./access.js";
14
- export type { Sharing } from "./access.js";
15
- /**
16
- * Doc header (from the server module — the runtime semantics live there):
17
- *
18
- * One latest-only singleton doc per conversation (kind
19
- * `"sigrun.session-meta"`): pin/tag/archive flags, the composer draft
20
- * (survives reloads — `draft.attachments` are workspace-relative paths
21
- * from the uploads endpoint), the session source, the user-facing session
22
- * name (T5d), the multi-user `owner` seam, and the §5.9 `sharing` state.
23
- * `owner` and `source` are SERVER-ONLY: the auth hook stamps the owner at
24
- * create/fork/import, and a client PATCH carrying either key is a 400
25
- * `invalid_field`.
26
- *
27
- * Server-owned fields (`autoName`, `autoNameAttempts`,
28
- * `lastActivityAt`, `jobId`, `deliver`) are written by host code only
29
- * (activity.ts, the A2 auto-namer, fire.ts's job stamp); they are NOT
30
- * patch surface — the strict validator keeps rejecting them as
31
- * `invalid_field`.
32
- */
33
- /** The per-conversation session metadata (spec §5). */
34
- export type SessionMeta = {
35
- /** Sidebar pin (pinned conversations float to the top). */
36
- pinned: boolean;
37
- /** Sidebar tags; a PATCH replaces the array wholesale. */
38
- tagged: string[];
39
- /** Archived/hidden from the default sidebar listing. */
40
- archived: boolean;
41
- /** The composer draft; survives a reload. */
42
- draft: {
43
- text: string;
44
- attachments: string[];
45
- };
46
- /** Who created the session: an interactive user, a cron job, a channel
47
- * adapter — a free-form server-owned label (spec §5.9: no longer a
48
- * closed enum; never patchable). */
49
- source: string;
50
- /**
51
- * Multi-user seam (spec §5.9): the caller identity the auth hook
52
- * stamped at create/fork/import, read by the listing route and the
53
- * access checks. SERVER-ONLY — a PATCH carrying the key is a 400
54
- * `invalid_field`.
55
- */
56
- owner?: string;
57
- /** The user-facing session name; absent = unnamed (T5d). */
58
- name?: string;
59
- /**
60
- * Server-owned automatic name (the auto-namer writes it, A2); the
61
- * listing serves it only while `name` is unset. NEVER patchable — the
62
- * strict validator rejects the key as `invalid_field`.
63
- */
64
- autoName?: string;
65
- /** Server-owned: the auto-namer's attempt count (A2). Never patchable. */
66
- autoNameAttempts?: number;
67
- /**
68
- * Server-owned: the last activity instant, ISO 8601 (`activity.ts`
69
- * stamps it at submission admission and run settlement). Never
70
- * patchable — the strict validator rejects the key as `invalid_field`.
71
- */
72
- lastActivityAt?: string;
73
- /**
74
- * Server-owned job stamp (gateway C7, spec §8.0): the id of the job
75
- * whose fire created this conversation (`fire.ts` writes it inside the
76
- * creating commit). Never patchable — the strict validator rejects
77
- * the key as `invalid_field`.
78
- */
79
- jobId?: string;
80
- /**
81
- * Server-owned job delivery targets (gateway C7, spec §8.0): the job
82
- * action's `deliver` array, stamped onto the run conversation by
83
- * `fire.ts` in the creating commit — the gateway's runSettled delivery
84
- * reads it to route the answer to chats. Never patchable — the
85
- * strict validator rejects the key as `invalid_field`.
86
- */
87
- deliver?: string[];
88
- /**
89
- * The §5.9 per-resource sharing state; absent = private (owner and
90
- * superuser only). Patchable by the OWNER or a superuser (403
91
- * otherwise); `sharing: null` clears back to private.
92
- */
93
- sharing?: Sharing;
94
- };
95
- /** A validated PATCH body: present keys apply, `null` clears to default. */
96
- export interface SessionMetaPatch {
97
- readonly pinned?: boolean | null;
98
- readonly tagged?: readonly string[] | null;
99
- readonly archived?: boolean | null;
100
- readonly draft?: {
101
- readonly text?: string | null;
102
- readonly attachments?: readonly string[] | null;
103
- } | null;
104
- readonly name?: string | null;
105
- /**
106
- * The §5.9 sharing set/clear (`null` → private). `owner` and `source`
107
- * are deliberately ABSENT — the validator rejects them as
108
- * `invalid_field`, so a patch type that cannot express them keeps the
109
- * apply step honest by construction.
110
- */
111
- readonly sharing?: Sharing | null;
112
- }
113
- /** Why a PATCH body was rejected (the configure endpoint's error contract). */
114
- export type SessionMetaPatchError = {
115
- readonly error: "invalid_body";
116
- } | {
117
- readonly error: "invalid_field";
118
- readonly field: string;
119
- };
@@ -1,13 +0,0 @@
1
- /**
2
- * The session-meta WIRE types (spec §5) — the client-facing half of
3
- * `src/server/session-meta.ts` (which owns the document/patch runtime).
4
- *
5
- * This module is part of the shared leaf package (`@sigrun/shared`): the
6
- * tui and webui import these shapes from here, never from server source
7
- * (the load-bearing decoupling — the tui is a pure client of the wire).
8
- *
9
- * PURE module: no imports at all (the views-purity guard enforces this
10
- * across `shared/src`) — the `import type` below is the sanctioned wire-
11
- * module exception: sibling-only (`./access.js`), type-only.
12
- */
13
- export {};
@@ -1,408 +0,0 @@
1
- /**
2
- * The settings-file TYPES (Task 8a, pi parity spec: the settings file) —
3
- * the persisted `SettingsFile` shape and its sections.
4
- *
5
- * The CANONICAL type declarations live here (the shared leaf package);
6
- * `src/harness/settings.ts` imports them (type-only) for the store/
7
- * validation runtime. The `GET/PATCH /v1/settings` wire serves this
8
- * shape verbatim (`SettingsResponse` = `SettingsFile` + the
9
- * server-computed `toolRoster`; see `@sigrun/shared/views`), so both
10
- * clients read these fields straight off the wire.
11
- *
12
- * The file is a JSON document at `<config-dir>/settings.json`. It
13
- * carries the `HarnessSettings` pass-throughs (`steeringMode`,
14
- * `followUpMode`, `retry`, `stream`) plus sigrun's own resolved fields
15
- * (`defaultTools`, `perModelThinking`, `extensions`, `jobs`, `jobHistory`,
16
- * `defaultModel`, `namingModel`, `defaultProvider`, `server`). Credentials
17
- * never live here (they live in the sibling `auth.json`).
18
- */
19
- import type { JobSpec } from "./jobs.js";
20
- /**
21
- * One entry of the unified `extensions` list: an install-and-load
22
- * declaration. The string form is shorthand for `{source}`; the object
23
- * form adds the git/entry/enabled knobs. See the `extensions` field
24
- * docblock on {@link SettingsFile} for the full grammar.
25
- */
26
- export type ExtensionSpec = string | {
27
- /** The source: npm specifier, bare name, file:/path, or git source. */
28
- readonly source: string;
29
- /** Entry-point override (path relative to the resolved source root). */
30
- readonly entry?: string;
31
- /** Git ref (same as the `@ref` suffix, spelled out). */
32
- readonly ref?: string;
33
- /** Default true; `false` = directory state retained, not loaded. */
34
- readonly enabled?: boolean;
35
- };
36
- /**
37
- * The job-history retention limits (spec §8.1, ruling 14), applied per
38
- * job at run-settle and revision-write: keep the newest `runs` run
39
- * records and the newest `revisions` revisions (plus any revision a
40
- * retained run references). Live settings — both positive integers,
41
- * default 50.
42
- */
43
- export interface JobHistorySettings {
44
- readonly runs?: number;
45
- readonly revisions?: number;
46
- }
47
- /**
48
- * The `server` section: static boot configuration mirrored from the
49
- * `SIGRUN_*` env knobs. Every field is optional; a present field is the
50
- * deployment default applied when the corresponding env var is ABSENT
51
- * (env always wins, validated first). Not here: the extensions list and
52
- * the model (top-level fields of {@link SettingsFile}).
53
- */
54
- export interface ServerSettings {
55
- /** `SIGRUN_PORT` — a positive integer. */
56
- readonly port?: number;
57
- /** `SIGRUN_WORKSPACE_PATH` — a non-empty path. */
58
- readonly workspacePath?: string;
59
- /** `SIGRUN_STORAGE_PATH` — a non-empty path. */
60
- readonly storagePath?: string;
61
- /** `SIGRUN_EXTENSIONS_DIR` — a non-empty path. */
62
- readonly extensionsDir?: string;
63
- /**
64
- * `SIGRUN_MAX_UPLOAD_BYTES` — a positive integer. The raw-upload
65
- * PUT route's body limit; the base64 POST and the JSONL import derive
66
- * theirs from it (the 4/3 base64 inflation plus the JSON wrapper).
67
- * Default 64 MiB (spec §6.2).
68
- */
69
- readonly maxUploadBytes?: number;
70
- /**
71
- * `SIGRUN_MAX_FILE_READ_BYTES` — a positive integer. The raw
72
- * file-read cap (`GET .../files/raw`): 413 `file_too_large` beyond
73
- * it. Default 16 MiB (spec §7.8) — the agent writes workspace
74
- * files, so nothing else bounds them.
75
- */
76
- readonly maxFileReadBytes?: number;
77
- /**
78
- * `SIGRUN_DATA_DIR` — a non-empty path. Applied where the env var is
79
- * absent; the env-or-file value wins VERBATIM (no `/sigrun` suffix),
80
- * exactly like the stores resolver's explicit tier. The DB default
81
- * and relative `SIGRUN_STORAGE_PATH` values resolve under this root.
82
- */
83
- readonly dataDir?: string;
84
- /** `SIGRUN_CACHE_DIR` — a non-empty path, verbatim (see `dataDir`). */
85
- readonly cacheDir?: string;
86
- /** `SIGRUN_STATE_DIR` — a non-empty path, verbatim (see `dataDir`). */
87
- readonly stateDir?: string;
88
- /**
89
- * `SIGRUN_PUBLIC_URL` (core hardening W5 Task 2, spec §9.2): the
90
- * deployment's absolute base URL — http(s) with a hostname, any
91
- * trailing slash stripped at resolution. `undefined` when neither
92
- * env nor file sets it; the extension-route adapter bases handlers'
93
- * absolute `Request` URLs on it and notification deep links are
94
- * omitted without it.
95
- */
96
- publicUrl?: string;
97
- /**
98
- * The webui channel's gate + bundle selector (build-and-webui Task 4):
99
- * `SIGRUN_WEBUI` maps to `enabled` (strict true/false parse), the
100
- * selector comes from `SIGRUN_WEBUI_BUNDLE` over `bundle` over the
101
- * legacy `webuiBundle` (deprecated alias, one release). Both keys are
102
- * OPTIONAL — the settings bootstrap OMITS the section entirely when
103
- * fully defaulted (a mirrored default would read as an explicit
104
- * selection on the next boot and make absent-default → API-only
105
- * unreachable).
106
- */
107
- readonly webui?: {
108
- /** `SIGRUN_WEBUI` — boolean, default true. `false` = API-only. */
109
- readonly enabled?: boolean;
110
- /**
111
- * The bundle selector (non-empty string): a contributed-bundle NAME
112
- * or a PATH, discriminated syntactically at serve time (Task 5).
113
- * Absent = the built-in default bundle.
114
- */
115
- readonly bundle?: string;
116
- };
117
- /**
118
- * DEPRECATED ALIAS for `webui.bundle` (build-and-webui Task 4), kept
119
- * for one release: `SIGRUN_WEBUI_BUNDLE` over `webui.bundle` over THIS
120
- * key over the default. Accepted by validation with a deprecation
121
- * warn; the bootstrap never writes it.
122
- *
123
- * @deprecated use `webui.bundle`
124
- */
125
- readonly webuiBundle?: string;
126
- /**
127
- * The timezone `SIGRUN_TIMEZONE` mirrors (jobs §8.2): an IANA name —
128
- * the default timezone for cron schedules that declare none (default:
129
- * the process TZ). Validated as an IANA name (an `Intl.DateTimeFormat`
130
- * construction succeeds).
131
- */
132
- readonly timezone?: string;
133
- /** The `SIGRUN_COMPACTION_*` policy knobs. */
134
- readonly compaction?: {
135
- readonly enabled?: boolean;
136
- readonly reserveTokens?: number;
137
- readonly keepRecentTokens?: number;
138
- readonly backgroundTokens?: number;
139
- };
140
- /**
141
- * The memory-seam bounds (memory-seam Task 6), mirroring the
142
- * `SIGRUN_{HOOK_DEADLINE,IDLE_THRESHOLD,WORKER_DEADLINE,QUEUE_MAX}`
143
- * env knobs — each a positive integer applied per-field where the
144
- * corresponding env var is absent.
145
- */
146
- readonly memorySeam?: {
147
- readonly hookDeadlineMs?: number;
148
- readonly idleThresholdMs?: number;
149
- readonly workerDeadlineMs?: number;
150
- readonly queueMax?: number;
151
- };
152
- /**
153
- * The provider plugins' runtime knobs (provider plugins Task 5):
154
- * `SIGRUN_PROVIDER_REFRESH_MINUTES` — the interval refresh cadence
155
- * in minutes, a non-negative integer where `0` disables the
156
- * scheduler. Applied per-field where the env var is absent.
157
- */
158
- readonly providers?: {
159
- readonly refreshIntervalMinutes?: number;
160
- };
161
- /**
162
- * The auth surface (core-hardening W1, spec §5.2/§5.3): the
163
- * authenticator method list, the forward-auth (proxy) config, the
164
- * admin group mapping, and the Host/Origin allowlists. Mirrors the
165
- * `SIGRUN_AUTH`/`SIGRUN_AUTH_TRUSTED_PROXIES` env knobs (the env
166
- * service token `SIGRUN_API_TOKEN` and the shared secret
167
- * `SIGRUN_PROXY_SECRET` are ENV-ONLY credentials — validation rejects
168
- * a `secret` key here, key material never lives in this file).
169
- * `methods` ABSENT means derive from the listen host (`[]` on
170
- * loopback, `["token"]` otherwise) — which is why a defaulted auth
171
- * section is omitted from the bootstrap projection entirely (an
172
- * explicit `methods: []` would read as intent on the next boot).
173
- */
174
- readonly auth?: {
175
- /** `SIGRUN_AUTH` — csv of `token`/`proxy`; absent = derive from the listen host. */
176
- readonly methods?: readonly ("token" | "proxy")[];
177
- readonly proxy?: {
178
- readonly trustedProxies?: readonly string[];
179
- readonly secretHeader?: string;
180
- readonly userHeader?: string;
181
- readonly groupsHeader?: string;
182
- readonly nameHeader?: string;
183
- readonly emailHeader?: string;
184
- readonly autoProvision?: boolean;
185
- };
186
- readonly adminGroups?: readonly string[];
187
- readonly allowedHosts?: readonly string[];
188
- readonly allowedOrigins?: readonly string[];
189
- };
190
- /**
191
- * `/metrics` exposure (core-hardening W1): `SIGRUN_METRICS_PUBLIC`
192
- * over this key, default `false` (a principal is required). Omitted
193
- * from the bootstrap projection when defaulted (the webui pattern).
194
- */
195
- readonly metrics?: {
196
- readonly public?: boolean;
197
- };
198
- /**
199
- * The development flag (spec §14.2/§14.4): `SIGRUN_DEV` (strict
200
- * true/false — the spec's `SIGRUN_DEV=1` form reads as true) over this
201
- * key, default `false`. Surfaces on `GET /v1/meta` (`dev`); gates the
202
- * U1 blocks gallery, U3's development error bodies, and U4.
203
- */
204
- readonly dev?: boolean;
205
- /**
206
- * The backup target — exactly one of the two shapes (mirroring the
207
- * env rule: `SIGRUN_BACKUP_PATH` XOR `SIGRUN_BACKUP_S3_BUCKET`), plus
208
- * the §6.8 honesty knob: `staleAfterHours`, how old the
209
- * `backup/last-success.json` marker may be before `health.backup`
210
- * reports `"degraded"` (positive number; no env var exists — file or
211
- * the 36 h code default).
212
- */
213
- readonly backup?: {
214
- readonly path?: string;
215
- readonly staleAfterHours?: number;
216
- } | {
217
- readonly s3?: {
218
- readonly bucket?: string;
219
- readonly prefix?: string;
220
- readonly endpoint?: string;
221
- };
222
- readonly staleAfterHours?: number;
223
- };
224
- }
225
- /**
226
- * Which tier supplied a resolved server key (the `/v1/settings`
227
- * `effective` block, spec §6.6): the env var was set (`"env"`), the
228
- * settings file's `server` section set it (`"file"`), or neither and
229
- * the code default applied (`"default"`).
230
- */
231
- export type ServerSettingSource = "env" | "file" | "default";
232
- /**
233
- * One `effective` entry: the RESOLVED value (what boot actually used)
234
- * plus the {@link ServerSettingSource} that won. Keys are flattened
235
- * dotted paths (`"server.port"`, `"server.compaction.reserveTokens"`).
236
- */
237
- export interface EffectiveServerSetting {
238
- readonly value: unknown;
239
- readonly source: ServerSettingSource;
240
- }
241
- /**
242
- * The degenerate env-driven provider's static configuration (ruling 7).
243
- * Only the endpoint is here — credentials live in `auth.json`.
244
- */
245
- export interface DefaultProviderSettings {
246
- /** `OPENAI_BASE_URL` — a non-empty URL. */
247
- readonly baseUrl?: string;
248
- }
249
- /**
250
- * The skills surface's settings (core hardening W5 Task 4, spec §9.4) —
251
- * live, read per skills-section render.
252
- */
253
- export interface SkillsSettings {
254
- /** The rendered-section byte cap (default 4096, notice included). */
255
- readonly sectionMaxBytes?: number;
256
- }
257
- /**
258
- * The notifications surface's settings (core hardening W5 Task 6, spec
259
- * §9.6) — live, read per event.
260
- */
261
- export interface NotificationsSettings {
262
- /**
263
- * When a `run.settled` notification fires: `"unwatched"` (default)
264
- * only when no client stream is attached to the conversation (the
265
- * away-from-desk case), `"cron"` only for job-run conversations,
266
- * `"always"` every settle, `"never"` none.
267
- */
268
- readonly runSettled?: "unwatched" | "cron" | "always" | "never";
269
- }
270
- /**
271
- * The built-in extensions toggles (Task 2, pi parity): codemode, MCP and
272
- * tool search ship WITH core. Each key defaults to `true`; `false`
273
- * removes the built-in entirely (absent from `/v1/extensions`, its config
274
- * ignored with one log line). RESTART-REQUIRED: the built-in set resolves
275
- * at boot, like `extensions`.
276
- */
277
- export interface BuiltinExtensionsSettings {
278
- readonly codemode?: boolean;
279
- readonly mcp?: boolean;
280
- readonly toolSearch?: boolean;
281
- }
282
- /**
283
- * The persisted shape: HarnessSettings pass-throughs + sigrun fields.
284
- */
285
- export interface SettingsFile {
286
- /** pi-durable `HarnessSettings.steeringMode`. */
287
- readonly steeringMode?: "all" | "one-at-a-time";
288
- /** pi-durable `HarnessSettings.followUpMode`. */
289
- readonly followUpMode?: "all" | "one-at-a-time";
290
- /** pi-durable `HarnessSettings.retry` (partial policy, merged over defaults). */
291
- readonly retry?: {
292
- readonly enabled?: boolean;
293
- readonly maxRetries?: number;
294
- readonly baseDelayMs?: number;
295
- readonly maxAgentDelayMs?: number;
296
- };
297
- /** pi-durable `HarnessSettings.stream` (partial, merged over defaults). */
298
- readonly stream?: {
299
- readonly timeoutMs?: number;
300
- readonly maxRetries?: number;
301
- readonly maxRetryDelayMs?: number;
302
- };
303
- /**
304
- * Sigrun: tool-name filter applied at conversation creation; maps to
305
- * pi-durable 1.3.0's `AgentChange.modelTools` (the model-offered
306
- * filter — never the enabled filter `AgentChange.tools`).
307
- */
308
- readonly defaultTools?: readonly string[];
309
- /**
310
- * Sigrun: per-model thinking-level overrides, keyed by
311
- * `"provider/modelId"`.
312
- */
313
- readonly perModelThinking?: Readonly<Record<string, string>>;
314
- /**
315
- * Sigrun: the unified extension list — each entry is the DESIRED
316
- * INSTALL+LOAD state (one list, no install/load split). Entry forms:
317
- *
318
- * - a string: an npm specifier ("name", "name@range",
319
- * "@scope/name@range"), a bare name (app-tree/vendor shorthand,
320
- * load-only), a `file:`/absolute path (loaded in place, nothing
321
- * installed), or a git source ("git:host/path" or an https git
322
- * URL, with an optional `@ref` suffix) — cloned into
323
- * `<config-dir>/git/` and loaded after entry discovery.
324
- * - an object: `{ source, entry?, ref?, enabled? }` — the explicit
325
- * form. `entry` overrides entry discovery (path relative to the
326
- * resolved source root); `ref` is the git ref (same as the `@ref`
327
- * suffix, spelled out); `enabled: false` keeps the directory
328
- * state but does not load (the installed-but-disabled case).
329
- *
330
- * npm + git entries are installed/fetched at boot by `syncPackages`
331
- * into the packages/git dirs under the config dir; REMOVING an entry
332
- * uninstalls it. Applied when `SIGRUN_EXTENSIONS` is absent.
333
- * Changes require a restart.
334
- */
335
- readonly extensions?: readonly ExtensionSpec[];
336
- /**
337
- * Sigrun: the file-declared job list (spec §8.3 — the `file` source).
338
- * Each entry is a `JobSpec` validated with `validateJobSpec` (the
339
- * jobs §8.2 grammar); names double as the id suffix (`file:<name>`).
340
- * Duplicate names are a validation error. Restart-required: like
341
- * `extensions`, the list resolves at boot reconciliation.
342
- */
343
- readonly jobs?: readonly JobSpec[];
344
- /**
345
- * Sigrun: per-job history retention (spec §8.1, ruling 14) — LIVE
346
- * (read per prune, not restart-required): keep the newest `runs` run
347
- * records and the newest `revisions` revisions per job, plus any
348
- * revision a retained run references. Both positive integers,
349
- * default 50 each.
350
- */
351
- readonly jobHistory?: JobHistorySettings;
352
- /**
353
- * Sigrun: the boot default model (ruling 3), a non-empty
354
- * `provider/model-id` spec parsed exactly like `SIGRUN_DEFAULT_MODEL`
355
- * (bare id implies the `openai` provider). Applied when the env var is
356
- * absent; REQUIRED overall — neither env nor file is a fail-loud boot
357
- * error, no code default.
358
- */
359
- readonly defaultModel?: string;
360
- /**
361
- * Sigrun: the model the auto-namer (UI refresh A2) completes through, a
362
- * non-empty `provider/model-id` spec validated exactly like
363
- * `defaultModel`, or `false` to disable automatic naming. Absent = the
364
- * boot default model. Read live per settled run, so a PATCH reaches the
365
- * next naming call without a restart.
366
- */
367
- readonly namingModel?: string | false;
368
- /**
369
- * Sigrun: the env-driven OpenAI-compatible provider's endpoint
370
- * (ruling 7), applied when `OPENAI_BASE_URL` is absent.
371
- */
372
- readonly defaultProvider?: DefaultProviderSettings;
373
- /**
374
- * Sigrun: the skills surface's knob (core hardening W5 Task 4, spec
375
- * §9.4). `sectionMaxBytes` caps the rendered skills section (default
376
- * 4096, truncation notice included). LIVE — read per render, so a
377
- * PATCH reaches the next prompt without a restart.
378
- */
379
- readonly skills?: SkillsSettings;
380
- /**
381
- * Sigrun: the notifications surface's knob (core hardening W5 Task 6,
382
- * spec §9.6). `runSettled` gates when a settled run notifies (default
383
- * `"unwatched"`). LIVE — read per event, so a PATCH reaches the next
384
- * settle without a restart.
385
- */
386
- readonly notifications?: NotificationsSettings;
387
- /**
388
- * Sigrun: the built-in extensions toggles (Task 2). Each defaults to
389
- * `true`. RESTART-REQUIRED (resolved at boot).
390
- */
391
- readonly builtinExtensions?: BuiltinExtensionsSettings;
392
- /**
393
- * Sigrun: the MCP-driven auto-enable (Task 2, ruling 4). Default
394
- * `true`: when at least one enabled MCP server's effective exposure is
395
- * `codemode`, the `codemode` tool stays in the default model-offered
396
- * set for newly created conversations; when any is `deferred`,
397
- * `tool_search` stays offered. `false` turns both arms off. An
398
- * explicit `defaultTools` filter always wins (auto-enable only edits
399
- * the DEFAULT set). LIVE — read at conversation create, like
400
- * `defaultTools`.
401
- */
402
- readonly autoEnableCodemode?: boolean;
403
- /**
404
- * Sigrun: the static boot configuration (see {@link ServerSettings}).
405
- * Deployment defaults under env — changes require a restart.
406
- */
407
- readonly server?: ServerSettings;
408
- }
package/dist/settings.js DELETED
@@ -1,19 +0,0 @@
1
- /**
2
- * The settings-file TYPES (Task 8a, pi parity spec: the settings file) —
3
- * the persisted `SettingsFile` shape and its sections.
4
- *
5
- * The CANONICAL type declarations live here (the shared leaf package);
6
- * `src/harness/settings.ts` imports them (type-only) for the store/
7
- * validation runtime. The `GET/PATCH /v1/settings` wire serves this
8
- * shape verbatim (`SettingsResponse` = `SettingsFile` + the
9
- * server-computed `toolRoster`; see `@sigrun/shared/views`), so both
10
- * clients read these fields straight off the wire.
11
- *
12
- * The file is a JSON document at `<config-dir>/settings.json`. It
13
- * carries the `HarnessSettings` pass-throughs (`steeringMode`,
14
- * `followUpMode`, `retry`, `stream`) plus sigrun's own resolved fields
15
- * (`defaultTools`, `perModelThinking`, `extensions`, `jobs`, `jobHistory`,
16
- * `defaultModel`, `namingModel`, `defaultProvider`, `server`). Credentials
17
- * never live here (they live in the sibling `auth.json`).
18
- */
19
- export {};
package/dist/themes.d.ts DELETED
@@ -1,50 +0,0 @@
1
- /**
2
- * The shared theme data (Task B1, UI refresh): the four palettes and
3
- * seven accents of the UI refresh, plus their name guards.
4
- *
5
- * PURE module: no imports at all (test/views-purity.test.ts enforces
6
- * this). Both clients — webui (bundler, DOM) and tui (NodeNext) —
7
- * consume this file from a single source; any import would drag a
8
- * dependency only one client can load or resolve.
9
- *
10
- * Colour values are copied verbatim from the palette mockup
11
- * (docs/superpowers/specs/assets/2026-10-17-ui-refresh/palettes.html),
12
- * with the mockup ids renamed to the plan ids: palette `iron` →
13
- * `iron-ember`, `aurora` → `polar-night`, `birch` → `birch-moss`;
14
- * accent `amber` → `baltic-amber`; token key `surface-2` → `surface2`.
15
- */
16
- export type PaletteName = "fjord" | "iron-ember" | "polar-night" | "birch-moss";
17
- export type AccentName = "baltic-amber" | "ember" | "lingonberry" | "glacier" | "aurora" | "lichen" | "heather";
18
- export type ModeName = "dark" | "light";
19
- /** One mode's tokens: every value a CSS colour literal. */
20
- export interface PaletteTokens {
21
- readonly bg: string;
22
- readonly surface: string;
23
- readonly surface2: string;
24
- readonly border: string;
25
- readonly text: string;
26
- readonly muted: string;
27
- readonly faint: string;
28
- readonly ok: string;
29
- readonly code: string;
30
- }
31
- export interface Palette {
32
- readonly label: string;
33
- readonly defaultAccent: AccentName;
34
- readonly dark: PaletteTokens;
35
- readonly light: PaletteTokens;
36
- }
37
- export interface Accent {
38
- readonly label: string;
39
- readonly dark: string;
40
- readonly light: string;
41
- }
42
- export declare const PALETTES: Readonly<Record<PaletteName, Palette>>;
43
- export declare const ACCENTS: Readonly<Record<AccentName, Accent>>;
44
- export declare const PALETTE_NAMES: readonly PaletteName[];
45
- export declare const ACCENT_NAMES: readonly AccentName[];
46
- /** The shipped default: Polar Night + Baltic Amber. */
47
- export declare const DEFAULT_PALETTE: PaletteName;
48
- export declare const DEFAULT_ACCENT: AccentName;
49
- export declare function isPaletteName(value: unknown): value is PaletteName;
50
- export declare function isAccentName(value: unknown): value is AccentName;