@sigrun/sigrun 0.1.6 → 0.2.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.
- package/CHANGELOG.md +104 -0
- package/README.md +352 -36
- package/dist/blocks/schema.js +9 -2
- package/dist/blocks/validate.js +57 -8
- package/dist/cli.js +26 -2
- package/dist/config.js +67 -1
- package/dist/extension.d.ts +189 -15
- package/dist/harness/ambient.js +39 -185
- package/dist/harness/blocks/entries.js +47 -0
- package/dist/harness/blocks/state.js +58 -0
- package/dist/harness/blocks/tools.js +274 -0
- package/dist/harness/boot.js +253 -20
- package/dist/harness/builtins.js +15 -11
- package/dist/harness/event-bus.js +105 -10
- package/dist/harness/identity/accounts.js +186 -0
- package/dist/harness/identity/groups.js +14 -0
- package/dist/harness/identity/index.js +13 -6
- package/dist/harness/identity/json-store.js +15 -4
- package/dist/harness/identity/setup-code-check.js +9 -0
- package/dist/harness/identity/tokens.js +28 -5
- package/dist/harness/identity/users.js +111 -12
- package/dist/harness/interactions.js +292 -136
- package/dist/harness/loader.js +271 -17
- package/dist/harness/packages.js +1 -1
- package/dist/harness/reserved-sections.js +21 -0
- package/dist/harness/seam-host.js +80 -6
- package/dist/harness/settings.js +63 -2
- package/dist/harness/stores.js +241 -4
- package/dist/harness/user-services.js +391 -0
- package/dist/harness/user-tools.js +187 -0
- package/dist/harness/workspace.js +61 -57
- package/dist/jobs/fire.js +10 -16
- package/dist/sandbox/availability.js +162 -0
- package/dist/sandbox/command-observer.js +59 -0
- package/dist/sandbox/grants.js +159 -0
- package/dist/sandbox/helper.js +29 -0
- package/dist/sandbox/isolation.js +29 -0
- package/dist/sandbox/launch.js +20 -0
- package/dist/sandbox/os-account.js +49 -0
- package/dist/sandbox/policy.js +253 -0
- package/dist/sandbox/pool.js +548 -0
- package/dist/sandbox/protocol.js +167 -0
- package/dist/sandbox/sandboxed-env.js +245 -0
- package/dist/sandbox/unavailable-env.js +49 -0
- package/dist/sandbox/worker.js +281 -0
- package/dist/serve.js +82 -7
- package/dist/server/auth/access-principal.js +16 -0
- package/dist/server/auth/pipeline.js +47 -33
- package/dist/server/blocks/answers.js +94 -0
- package/dist/server/blocks/chat-surfaces.js +393 -0
- package/dist/server/blocks/notes.js +216 -0
- package/dist/server/blocks/summaries.js +328 -0
- package/dist/server/commands.js +5 -0
- package/dist/server/content-parts-lazy.js +13 -0
- package/dist/server/conversation-handler.js +2 -5
- package/dist/server/conversation-ops.js +138 -37
- package/dist/server/helpers.js +18 -6
- package/dist/server/host-bridge.js +40 -20
- package/dist/server/images/cache.js +205 -0
- package/dist/server/images/convert.js +13 -0
- package/dist/server/images/fetch.js +302 -0
- package/dist/server/images/ranges.js +42 -0
- package/dist/server/images/rewrite.js +94 -0
- package/dist/server/images/sign.js +84 -0
- package/dist/server/images/sniff.js +62 -0
- package/dist/server/index.js +144 -4
- package/dist/server/login/flows.js +126 -0
- package/dist/server/login/http.js +31 -0
- package/dist/server/login/resolve.js +133 -0
- package/dist/server/login/setup-claim.js +55 -0
- package/dist/server/login/usernames.js +15 -0
- package/dist/server/ownership.js +13 -0
- package/dist/server/routes/admin.js +58 -0
- package/dist/server/routes/auth.js +88 -2
- package/dist/server/routes/conversations.js +3 -6
- package/dist/server/routes/events.js +28 -3
- package/dist/server/routes/extensions.js +37 -5
- package/dist/server/routes/images.js +267 -0
- package/dist/server/routes/interactions.js +57 -68
- package/dist/server/routes/jobs.js +2 -8
- package/dist/server/routes/login.js +223 -0
- package/dist/server/routes/me.js +90 -0
- package/dist/server/routes/meta.js +15 -0
- package/dist/server/routes/onboarding.js +94 -84
- package/dist/server/routes/settings-sections.js +190 -0
- package/dist/server/routes/settings.js +16 -4
- package/dist/server/routes/submissions.js +1 -1
- package/dist/server/routes/surfaces.js +175 -23
- package/dist/server/routes/users.js +116 -20
- package/dist/server/schema-fixture.js +213 -0
- package/dist/server/session-meta.js +3 -0
- package/dist/server/shutdown.js +11 -4
- package/dist/server/static.js +18 -0
- package/dist/server/surfaces/dedup.js +9 -2
- package/dist/server/surfaces/service.js +181 -13
- package/dist/server/surfaces/settings-surfaces.js +597 -0
- package/dist/server/turns/submit-turn.js +26 -0
- package/dist/server/views.js +16 -0
- package/dist/settings/core-sections.js +532 -0
- package/dist/settings/pending.js +181 -0
- package/dist/settings/registry.js +453 -0
- package/dist/skills/index.js +6 -0
- package/node_modules/@sigrun/shared/CHANGELOG.md +6 -0
- package/node_modules/@sigrun/shared/dist/access.d.ts +4 -2
- package/node_modules/@sigrun/shared/dist/access.js +11 -4
- package/node_modules/@sigrun/shared/dist/ambient.d.ts +17 -74
- package/node_modules/@sigrun/shared/dist/ambient.js +8 -6
- package/node_modules/@sigrun/shared/dist/blocks/text.js +16 -2
- package/node_modules/@sigrun/shared/dist/blocks/transport.d.ts +4 -0
- package/node_modules/@sigrun/shared/dist/blocks/types.d.ts +21 -4
- package/node_modules/@sigrun/shared/dist/interactions.d.ts +22 -48
- package/node_modules/@sigrun/shared/dist/interactions.js +9 -7
- package/node_modules/@sigrun/shared/dist/settings.d.ts +27 -2
- package/node_modules/@sigrun/shared/dist/themes.d.ts +2 -3
- package/node_modules/@sigrun/shared/dist/themes.js +2 -3
- package/node_modules/@sigrun/shared/dist/turns.d.ts +14 -0
- package/node_modules/@sigrun/shared/dist/turns.js +53 -3
- package/node_modules/@sigrun/shared/dist/views.d.ts +175 -12
- package/node_modules/@sigrun/shared/dist/views.js +16 -0
- package/node_modules/@sigrun/shared/package.json +1 -1
- package/package.json +11 -6
- package/webui/dist/assets/index-CxB969qp.js +55 -0
- package/webui/dist/assets/index-yqkL6BSS.css +1 -0
- package/webui/dist/index.html +2 -2
- package/webui/dist/assets/index-CiYInlLx.css +0 -1
- package/webui/dist/assets/index-JDfOQV9z.js +0 -52
|
@@ -37,8 +37,8 @@
|
|
|
37
37
|
import type { JsonObject } from "./json.js";
|
|
38
38
|
import type { Sharing } from "./access.js";
|
|
39
39
|
import type { JobWire } from "./jobs.js";
|
|
40
|
-
import type { InteractionAnswer,
|
|
41
|
-
import type {
|
|
40
|
+
import type { InteractionAnswer, InteractionRecord, InteractionStatus } from "./interactions.js";
|
|
41
|
+
import type { AmbientRecord } from "./ambient.js";
|
|
42
42
|
import type { EffectiveServerSetting, SettingsFile } from "./settings.js";
|
|
43
43
|
/** A model reference as served on the wire (pi-durable `ModelRef`). */
|
|
44
44
|
export interface ModelRefWire {
|
|
@@ -345,8 +345,7 @@ export type AmbientWire = AmbientRecord;
|
|
|
345
345
|
export interface AmbientList {
|
|
346
346
|
readonly ambient: readonly AmbientWire[];
|
|
347
347
|
}
|
|
348
|
-
export type { InteractionAnswer,
|
|
349
|
-
export type { AmbientBody, AmbientGauge, AmbientLedgerEntry, AmbientLine, AmbientMetrics, AmbientRow, };
|
|
348
|
+
export type { InteractionAnswer, InteractionStatus, };
|
|
350
349
|
/**
|
|
351
350
|
* The `GET/PATCH /v1/settings` payload (Task 8b): the settings file's
|
|
352
351
|
* effective contents — the `HarnessSettings` pass-throughs plus the
|
|
@@ -362,6 +361,23 @@ export type { AmbientBody, AmbientGauge, AmbientLedgerEntry, AmbientLine, Ambien
|
|
|
362
361
|
export interface SettingsResponse extends SettingsFile {
|
|
363
362
|
/** The live registry snapshot's composed tool names, deduplicated. */
|
|
364
363
|
readonly toolRoster: readonly string[];
|
|
364
|
+
/**
|
|
365
|
+
* The restart keys whose stored value differs from the boot snapshot
|
|
366
|
+
* (UI-blocks U4, spec §13.2): the pending-restart callout's key list.
|
|
367
|
+
* Computed per request over the fresh file read; `[]` when nothing
|
|
368
|
+
* waits for a restart. NOT a settable key: the store's validation
|
|
369
|
+
* rejects it on PATCH (400 `invalid_field`), and the wire patch type
|
|
370
|
+
* Omits it.
|
|
371
|
+
*/
|
|
372
|
+
readonly pendingRestart: readonly string[];
|
|
373
|
+
/**
|
|
374
|
+
* The write's own classification (§13.1) — present ONLY on a PATCH
|
|
375
|
+
* response: which touched keys applied live vs. which are pending a
|
|
376
|
+
* restart. NOT a settable key; absent on GET.
|
|
377
|
+
*/
|
|
378
|
+
readonly applied?: readonly string[];
|
|
379
|
+
/** The restart-pending companion of {@link applied}. PATCH responses only. */
|
|
380
|
+
readonly pending?: readonly string[];
|
|
365
381
|
/**
|
|
366
382
|
* The resolved server section per flattened dotted key
|
|
367
383
|
* (`"server.port"`, `"server.compaction.reserveTokens"`, …), each
|
|
@@ -472,6 +488,25 @@ export interface MetaResponse {
|
|
|
472
488
|
* U4 — a boot constant, like the rest of meta.
|
|
473
489
|
*/
|
|
474
490
|
readonly dev: boolean;
|
|
491
|
+
/** The boot-time execution-jail decision (multi-user M1). */
|
|
492
|
+
readonly isolation: {
|
|
493
|
+
readonly mode: "auto" | "always" | "off";
|
|
494
|
+
/** Whether enforcement is active; filled by the later enforcement task. */
|
|
495
|
+
readonly active: boolean;
|
|
496
|
+
readonly available: boolean;
|
|
497
|
+
readonly abi: number;
|
|
498
|
+
readonly reason?: string;
|
|
499
|
+
readonly osUsers: "available" | "off" | string;
|
|
500
|
+
};
|
|
501
|
+
/**
|
|
502
|
+
* The supervised flag (UI-blocks U4 Task 2, spec §13.3): `true` when
|
|
503
|
+
* the deployment guarantees the process is restarted after an
|
|
504
|
+
* intentional `exit 0` (the Helm chart and docker compose set
|
|
505
|
+
* `SIGRUN_SUPERVISED=1`; a bare `docker run` does not). The §13.2
|
|
506
|
+
* pendingRestart callout renders its Restart button only for a
|
|
507
|
+
* supervised admin; otherwise it says "Restart sigrun to apply".
|
|
508
|
+
*/
|
|
509
|
+
readonly supervised: boolean;
|
|
475
510
|
/**
|
|
476
511
|
* The seam inventory (docs/approval-ux-seams.md): per extension, the
|
|
477
512
|
* interaction kinds / ambient surface keys its factory declared.
|
|
@@ -584,6 +619,13 @@ export interface AuthCheckResponse {
|
|
|
584
619
|
* every served entry, empty when the extension declared none). The
|
|
585
620
|
* webui's Extensions settings section renders this list.
|
|
586
621
|
*/
|
|
622
|
+
export interface ServiceStatusWire {
|
|
623
|
+
readonly slug: string;
|
|
624
|
+
readonly name: string;
|
|
625
|
+
readonly user: string;
|
|
626
|
+
readonly state: "running" | "idle" | "failed";
|
|
627
|
+
readonly lastError?: string;
|
|
628
|
+
}
|
|
587
629
|
export interface ExtensionInfo {
|
|
588
630
|
readonly name: string;
|
|
589
631
|
readonly status: string;
|
|
@@ -597,6 +639,8 @@ export interface ExtensionInfo {
|
|
|
597
639
|
readonly workers: readonly WorkerStatus[];
|
|
598
640
|
/** The declared HTTP routes, one `{method, path, auth}` each (W5 Task 2). */
|
|
599
641
|
routes?: readonly ExtensionRouteInfo[];
|
|
642
|
+
/** Per-user service states; admin-only inventory. */
|
|
643
|
+
readonly services: readonly ServiceStatusWire[];
|
|
600
644
|
/** The declared surfaces, one `{id, title, icon, placement}` each (U3 Task 1); absent when none. */
|
|
601
645
|
surfaces?: readonly ExtensionSurfaceInfo[];
|
|
602
646
|
/**
|
|
@@ -616,7 +660,7 @@ export interface ExtensionInfo {
|
|
|
616
660
|
readonly inert?: "no gateway";
|
|
617
661
|
/**
|
|
618
662
|
* Built-in extensions (Task 2, pi parity): `true` marks a core-shipped
|
|
619
|
-
* built-in (codemode / MCP / tool search); ABSENT on configured
|
|
663
|
+
* built-in (codemode / MCP / tool search / OAuth); ABSENT on configured
|
|
620
664
|
* extensions. A replaced built-in reports its row with `builtin: true`
|
|
621
665
|
* and `replacedBy` (its status is the skip, never `"ok"`); a disabled
|
|
622
666
|
* built-in is absent from the list entirely.
|
|
@@ -656,6 +700,52 @@ export interface ExtensionSurfaceInfo {
|
|
|
656
700
|
export interface ExtensionsResponse {
|
|
657
701
|
readonly extensions: readonly ExtensionInfo[];
|
|
658
702
|
}
|
|
703
|
+
/**
|
|
704
|
+
* The `GET /v1/settings/sections` payload (UI-blocks U4 Task 4, spec
|
|
705
|
+
* §13.4): the settings panel's nav list + the search index. Core's
|
|
706
|
+
* sections come first (slug `core`), then the loaded extensions'
|
|
707
|
+
* sections ordered by slug. The index covers every searchable row —
|
|
708
|
+
* a section title, a core settings key, an extension section's field —
|
|
709
|
+
* with the section id a hit jumps to.
|
|
710
|
+
*/
|
|
711
|
+
export interface SettingsSectionsResponse {
|
|
712
|
+
readonly sections: readonly SettingsSectionEntry[];
|
|
713
|
+
readonly index: readonly SettingsSectionIndexEntry[];
|
|
714
|
+
}
|
|
715
|
+
/** One nav entry: the section's mount (slug + id) and its display. */
|
|
716
|
+
export interface SettingsSectionEntry {
|
|
717
|
+
readonly slug: string;
|
|
718
|
+
readonly id: string;
|
|
719
|
+
readonly title: string;
|
|
720
|
+
readonly icon: string;
|
|
721
|
+
/** Personal sections group under My settings and store caller-owned data. */
|
|
722
|
+
readonly scope?: "user";
|
|
723
|
+
/** Explicit admin gate (user sections are otherwise non-admin by default). */
|
|
724
|
+
readonly admin?: boolean;
|
|
725
|
+
}
|
|
726
|
+
/** One search-index row (the label search's hit shape, spec §13.4). */
|
|
727
|
+
export interface SettingsSectionIndexEntry {
|
|
728
|
+
/** The section the hit belongs to (the nav target). */
|
|
729
|
+
readonly slug: string;
|
|
730
|
+
readonly sectionId: string;
|
|
731
|
+
/** The row kind: a core settings key, an extension form field, or a section title. */
|
|
732
|
+
readonly kind: "core-key" | "field" | "section";
|
|
733
|
+
/** The searchable text (the field/section label). */
|
|
734
|
+
readonly label: string;
|
|
735
|
+
/** The field's help string, when it declares one. */
|
|
736
|
+
readonly help?: string;
|
|
737
|
+
/** The core key path / the field's form name, when the row has one. */
|
|
738
|
+
readonly key?: string;
|
|
739
|
+
}
|
|
740
|
+
/**
|
|
741
|
+
* The settings search's filter (UI-blocks U4 Task 4 round-2): the ONE
|
|
742
|
+
* implementation both channels run — the webui panel and the TUI view
|
|
743
|
+
* previously carried byte-identical copies, which drifted apart once
|
|
744
|
+
* (the TUI's lacked the key match). Case-insensitive over label + help
|
|
745
|
+
* + key; an empty query filters to nothing (the picker carries the
|
|
746
|
+
* full list).
|
|
747
|
+
*/
|
|
748
|
+
export declare function filterSettingsIndex(index: readonly SettingsSectionIndexEntry[], query: string): readonly SettingsSectionIndexEntry[];
|
|
659
749
|
/**
|
|
660
750
|
* A `GET /v1/extensions/:slug/secrets` entry: the key and its winning
|
|
661
751
|
* source — NEVER the value (the API lists and writes secrets; it never
|
|
@@ -669,6 +759,18 @@ export interface ExtensionSecret {
|
|
|
669
759
|
export interface ExtensionSecretsResponse {
|
|
670
760
|
readonly secrets: readonly ExtensionSecret[];
|
|
671
761
|
}
|
|
762
|
+
/**
|
|
763
|
+
* The `GET`/`PUT /v1/extensions/:slug/settings` payload (UI-blocks U4,
|
|
764
|
+
* spec §13.2): the stored object verbatim under `settings`, plus the
|
|
765
|
+
* pending-restart slot. Extension-declared fields default to LIVE
|
|
766
|
+
* (§13.1), so `pendingRestart` is `[]` today; the field exists so the
|
|
767
|
+
* §13.4 callout renders from one shape across core and extension
|
|
768
|
+
* settings.
|
|
769
|
+
*/
|
|
770
|
+
export interface ExtensionSettingsResponse {
|
|
771
|
+
readonly settings: Record<string, unknown>;
|
|
772
|
+
readonly pendingRestart: readonly string[];
|
|
773
|
+
}
|
|
672
774
|
export type { CommandsResponse, CommandRunResponse, SlashCommand } from "./commands.js";
|
|
673
775
|
export type { SessionMeta, SessionMetaPatch } from "./session-meta.js";
|
|
674
776
|
/**
|
|
@@ -685,9 +787,16 @@ export interface WhoamiResponse {
|
|
|
685
787
|
readonly user?: string;
|
|
686
788
|
readonly name?: string;
|
|
687
789
|
readonly email?: string;
|
|
790
|
+
/** The caller's own workspace/grants; never another directory user's. */
|
|
791
|
+
readonly workspace?: string;
|
|
792
|
+
readonly grants?: readonly {
|
|
793
|
+
readonly path: string;
|
|
794
|
+
readonly access: "ro" | "rw";
|
|
795
|
+
}[];
|
|
688
796
|
readonly admin: boolean;
|
|
689
797
|
readonly service: boolean;
|
|
690
|
-
readonly method: "none" | "token" | "proxy" | "host";
|
|
798
|
+
readonly method: "none" | "token" | "session" | "proxy" | "host";
|
|
799
|
+
readonly provider?: string;
|
|
691
800
|
}
|
|
692
801
|
/**
|
|
693
802
|
* The `GET /v1/onboarding` payload (core hardening W1 Task 4, spec
|
|
@@ -712,20 +821,29 @@ export interface OnboardingState {
|
|
|
712
821
|
* admin-visible material and the routes that serve this type are
|
|
713
822
|
* admin-gated. `createdAt` is epoch ms.
|
|
714
823
|
*
|
|
715
|
-
* `admin` is the STORED flag (the users-admin UI toggles it);
|
|
716
|
-
*
|
|
717
|
-
*
|
|
718
|
-
* counts `admin`
|
|
824
|
+
* `admin` is the STORED flag (the users-admin UI toggles it); `groups`
|
|
825
|
+
* is the deduplicated union of stored source memberships. `groupAdmin`
|
|
826
|
+
* is DERIVED from those groups and `server.auth.adminGroups`, retained
|
|
827
|
+
* for one release for the users UI; the last-admin guard counts `admin`
|
|
828
|
+
* alone.
|
|
719
829
|
*/
|
|
720
830
|
export interface UserWire {
|
|
721
831
|
readonly user: string;
|
|
722
832
|
readonly name?: string;
|
|
723
833
|
readonly email?: string;
|
|
724
834
|
readonly admin: boolean;
|
|
725
|
-
/**
|
|
835
|
+
/** DERIVED from stored groups and configured adminGroups; never persisted. */
|
|
726
836
|
readonly groupAdmin?: boolean;
|
|
837
|
+
/** The deduplicated union of groups stored by authenticating sources. */
|
|
838
|
+
readonly groups?: readonly string[];
|
|
839
|
+
readonly workspace?: string;
|
|
840
|
+
readonly grants?: readonly {
|
|
841
|
+
readonly path: string;
|
|
842
|
+
readonly access: "ro" | "rw";
|
|
843
|
+
}[];
|
|
844
|
+
readonly osUser?: string;
|
|
727
845
|
readonly createdAt: number;
|
|
728
|
-
readonly source: "proxy" | "invite" | "cli";
|
|
846
|
+
readonly source: "proxy" | "invite" | "cli" | "login";
|
|
729
847
|
}
|
|
730
848
|
/** The `POST /v1/onboarding/claim` payload (Task 4): the user (plus the
|
|
731
849
|
* minted token when `issueToken` was requested — shown once, never
|
|
@@ -751,6 +869,8 @@ export interface TokenWire {
|
|
|
751
869
|
readonly name: string;
|
|
752
870
|
readonly user: string;
|
|
753
871
|
readonly createdAt: number;
|
|
872
|
+
readonly kind?: "api" | "session";
|
|
873
|
+
readonly expiresAt?: number;
|
|
754
874
|
}
|
|
755
875
|
/** The `POST /v1/auth/tokens` payload (Task 4): the secret once, the
|
|
756
876
|
* digest-free record alongside it. */
|
|
@@ -758,6 +878,29 @@ export interface TokenCreateResponse {
|
|
|
758
878
|
readonly token: string;
|
|
759
879
|
readonly record: TokenWire;
|
|
760
880
|
}
|
|
881
|
+
/**
|
|
882
|
+
* One external identity linked to a directory user (multi-user §11.3):
|
|
883
|
+
* the `accounts.json` record verbatim. `provider` is `chat:<channel>` or
|
|
884
|
+
* `login:<slug>:<id>`; `subject` is the provider's stable subject
|
|
885
|
+
* (numeric id, `+E.164`, email-shaped — opaque to sigrun).
|
|
886
|
+
*
|
|
887
|
+
* Served to extensions as `host.accounts` and to users as
|
|
888
|
+
* `GET /v1/auth/accounts`.
|
|
889
|
+
*/
|
|
890
|
+
export interface AccountLinkWire {
|
|
891
|
+
readonly provider: string;
|
|
892
|
+
readonly subject: string;
|
|
893
|
+
readonly user: string;
|
|
894
|
+
readonly linkedAt: number;
|
|
895
|
+
readonly via: "login" | "self" | "pairing" | "admin";
|
|
896
|
+
}
|
|
897
|
+
/**
|
|
898
|
+
* The `GET /v1/auth/accounts` payload (multi-user §11.3): the caller's
|
|
899
|
+
* links, or one named user's for an admin.
|
|
900
|
+
*/
|
|
901
|
+
export interface AccountsResponse {
|
|
902
|
+
readonly accounts: readonly AccountLinkWire[];
|
|
903
|
+
}
|
|
761
904
|
/**
|
|
762
905
|
* One host event on the `GET /v1/events` SSE wire: `event: <type>` plus
|
|
763
906
|
* this object as the single-line `data:` JSON. Conversation-scoped
|
|
@@ -811,6 +954,20 @@ export type HostEventWire = {
|
|
|
811
954
|
/** W4 Task 4 (§8.4): the changed job's summary, WITHOUT `access` — the events stream computes `accessOf` per principal and adds it before delivery (a hidden job's event is withheld entirely). */
|
|
812
955
|
readonly type: "job.changed";
|
|
813
956
|
readonly job: Omit<JobWire, "access">;
|
|
957
|
+
} | {
|
|
958
|
+
/** UI-blocks U4 (spec §13.2): a settings write landed. `scope` is
|
|
959
|
+
* `"server"` for `PATCH /v1/settings` or `{extension: slug}` for
|
|
960
|
+
* an extension's settings PUT; `keys` are the flattened paths the
|
|
961
|
+
* write touched (dotted, the §13.1 registry vocabulary — extension
|
|
962
|
+
* writes name their own top-level object keys). Delivered to
|
|
963
|
+
* ADMINS only (settings are operator surface; the events route's
|
|
964
|
+
* exhaustive switch enforces it).
|
|
965
|
+
*/
|
|
966
|
+
readonly type: "settings.changed";
|
|
967
|
+
readonly scope: "server" | {
|
|
968
|
+
readonly extension: string;
|
|
969
|
+
};
|
|
970
|
+
readonly keys: readonly string[];
|
|
814
971
|
} | {
|
|
815
972
|
/** UI-blocks U3 Task 4 (spec §7.3): one surface instance changed. `k` is the hashed instance key (sha256(slug + "\0" + id + "\0" + key) hex) — the event NEVER carries params or data (render/data are principal-specific; the watcher refetches as itself). Delivered only to streams in the watcher registry whose stored access is not `"none"`. */
|
|
816
973
|
readonly type: "surface.changed";
|
|
@@ -819,4 +976,10 @@ export type HostEventWire = {
|
|
|
819
976
|
readonly k: string;
|
|
820
977
|
readonly rev: number;
|
|
821
978
|
readonly treeRev: number;
|
|
979
|
+
} | {
|
|
980
|
+
/** UI-blocks U5 Task 2 (spec §8.2): one CHAT block surface changed. The chat address is `(conversationId, entryId)` — no secret to watchers of that conversation (unlike params) — so the event names them directly instead of the hashed `k`. Delivered through the conversation-scoped path: the events route re-snapshots the SessionMeta and checks `accessOf` per event (hidden conversations see nothing). */
|
|
981
|
+
readonly type: "surface.changed";
|
|
982
|
+
readonly conversationId: number;
|
|
983
|
+
readonly entryId: string;
|
|
984
|
+
readonly rev: number;
|
|
822
985
|
};
|
|
@@ -36,3 +36,19 @@
|
|
|
36
36
|
*/
|
|
37
37
|
/** The `Content-Type` of the JSONL export/import wire (Task 5b/5c). */
|
|
38
38
|
export const JSONL_CONTENT_TYPE = "application/x-ndjson";
|
|
39
|
+
/**
|
|
40
|
+
* The settings search's filter (UI-blocks U4 Task 4 round-2): the ONE
|
|
41
|
+
* implementation both channels run — the webui panel and the TUI view
|
|
42
|
+
* previously carried byte-identical copies, which drifted apart once
|
|
43
|
+
* (the TUI's lacked the key match). Case-insensitive over label + help
|
|
44
|
+
* + key; an empty query filters to nothing (the picker carries the
|
|
45
|
+
* full list).
|
|
46
|
+
*/
|
|
47
|
+
export function filterSettingsIndex(index, query) {
|
|
48
|
+
const q = query.trim().toLowerCase();
|
|
49
|
+
if (q === "")
|
|
50
|
+
return [];
|
|
51
|
+
return index.filter((entry) => entry.label.toLowerCase().includes(q) ||
|
|
52
|
+
(entry.help ?? "").toLowerCase().includes(q) ||
|
|
53
|
+
(entry.key ?? "").toLowerCase().includes(q));
|
|
54
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sigrun/sigrun",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "Durable personal assistant on pi-durable",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -44,19 +44,24 @@
|
|
|
44
44
|
"@earendil-works/pi-durable": "1.3.0",
|
|
45
45
|
"@earendil-works/pi-tui": "^1.3.0",
|
|
46
46
|
"@fastify/static": "^10.1.7",
|
|
47
|
-
"@sigrun/ext-codemode": "0.1.
|
|
48
|
-
"@sigrun/ext-
|
|
49
|
-
"@sigrun/ext-
|
|
50
|
-
"@sigrun/
|
|
47
|
+
"@sigrun/ext-codemode": "0.1.1",
|
|
48
|
+
"@sigrun/ext-gateway": "0.1.1",
|
|
49
|
+
"@sigrun/ext-mcp": "0.2.1",
|
|
50
|
+
"@sigrun/ext-tool-search": "0.1.1",
|
|
51
|
+
"@sigrun/oauth": "0.1.1",
|
|
52
|
+
"@sigrun/shared": "0.2.0",
|
|
51
53
|
"croner": "^10.0.1",
|
|
52
54
|
"fastify": "^5.12.7",
|
|
55
|
+
"sharp": "^0.35.5",
|
|
53
56
|
"typebox": "1.3.27"
|
|
54
57
|
},
|
|
55
58
|
"bundleDependencies": [
|
|
56
59
|
"@sigrun/shared"
|
|
57
60
|
],
|
|
58
61
|
"optionalDependencies": {
|
|
59
|
-
"@sigrun/
|
|
62
|
+
"@sigrun/sandbox-linux-arm64": "0.2.0",
|
|
63
|
+
"@sigrun/sandbox-linux-x64": "0.2.0",
|
|
64
|
+
"@sigrun/tui": "0.2.0"
|
|
60
65
|
},
|
|
61
66
|
"devDependencies": {
|
|
62
67
|
"@types/node": "^26.6.4",
|