@tai42/studio-sdk 16.0.1 → 17.0.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/dist/components/code-block.js +1 -1
- package/dist/components/code-block.js.map +1 -1
- package/dist/components/confirm-dialog.js +1 -1
- package/dist/components/confirm-dialog.js.map +1 -1
- package/dist/components/copy-field.js +1 -1
- package/dist/components/copy-field.js.map +1 -1
- package/dist/components/date-range-picker.d.ts.map +1 -1
- package/dist/components/date-range-picker.js.map +1 -1
- package/dist/components/dialog.d.ts.map +1 -1
- package/dist/components/dialog.js.map +1 -1
- package/dist/components/dirty-guard.d.ts.map +1 -1
- package/dist/components/dirty-guard.js +1 -1
- package/dist/components/dirty-guard.js.map +1 -1
- package/dist/components/explorer-body.d.ts +1 -1
- package/dist/components/explorer-body.d.ts.map +1 -1
- package/dist/components/explorer-body.js +1 -1
- package/dist/components/explorer-body.js.map +1 -1
- package/dist/components/explorer-view.d.ts +1 -1
- package/dist/components/explorer-view.d.ts.map +1 -1
- package/dist/components/explorer-view.js +5 -5
- package/dist/components/explorer-view.js.map +1 -1
- package/dist/components/extension-combo-builder.d.ts +1 -1
- package/dist/components/extension-combo-builder.d.ts.map +1 -1
- package/dist/components/extension-combo-builder.js +1 -38
- package/dist/components/extension-combo-builder.js.map +1 -1
- package/dist/components/extension-combo-parts.d.ts +1 -1
- package/dist/components/extension-combo-parts.d.ts.map +1 -1
- package/dist/components/extension-combo-parts.js +0 -5
- package/dist/components/extension-combo-parts.js.map +1 -1
- package/dist/components/field.d.ts +8 -0
- package/dist/components/field.d.ts.map +1 -1
- package/dist/components/field.js +0 -8
- package/dist/components/field.js.map +1 -1
- package/dist/components/fleet-report.d.ts +1 -1
- package/dist/components/fleet-report.d.ts.map +1 -1
- package/dist/components/fleet-report.js.map +1 -1
- package/dist/components/folder-nav.d.ts.map +1 -1
- package/dist/components/folder-nav.js +1 -1
- package/dist/components/folder-nav.js.map +1 -1
- package/dist/components/form-dialog.d.ts.map +1 -1
- package/dist/components/form-dialog.js +1 -1
- package/dist/components/form-dialog.js.map +1 -1
- package/dist/components/icons/index.d.ts +5 -5
- package/dist/components/icons/index.d.ts.map +1 -1
- package/dist/components/icons/index.js +37 -4
- package/dist/components/icons/index.js.map +1 -1
- package/dist/components/icons/nav-map.js +1 -1
- package/dist/components/icons/nav-map.js.map +1 -1
- package/dist/components/inputs.js.map +1 -1
- package/dist/components/json-diff.js +1 -1
- package/dist/components/json-diff.js.map +1 -1
- package/dist/components/json-tree-nodes.d.ts +5 -0
- package/dist/components/json-tree-nodes.d.ts.map +1 -1
- package/dist/components/json-tree-nodes.js +2 -7
- package/dist/components/json-tree-nodes.js.map +1 -1
- package/dist/components/json-tree.d.ts +20 -0
- package/dist/components/json-tree.d.ts.map +1 -1
- package/dist/components/json-tree.js +4 -24
- package/dist/components/json-tree.js.map +1 -1
- package/dist/components/markdown.js.map +1 -1
- package/dist/components/page-fill.d.ts.map +1 -1
- package/dist/components/page-fill.js.map +1 -1
- package/dist/components/radio-group.d.ts.map +1 -1
- package/dist/components/radio-group.js.map +1 -1
- package/dist/components/scroll-region.d.ts +24 -0
- package/dist/components/scroll-region.d.ts.map +1 -1
- package/dist/components/scroll-region.js +3 -27
- package/dist/components/scroll-region.js.map +1 -1
- package/dist/components/table.d.ts +1 -1
- package/dist/components/table.d.ts.map +1 -1
- package/dist/components/tags.d.ts.map +1 -1
- package/dist/components/tags.js +1 -1
- package/dist/components/tags.js.map +1 -1
- package/dist/components/templated-text-field.d.ts +1 -1
- package/dist/components/templated-text-field.d.ts.map +1 -1
- package/dist/components/templated-text-field.js +0 -26
- package/dist/components/templated-text-field.js.map +1 -1
- package/dist/components/templated-text-kwargs-editor.d.ts.map +1 -1
- package/dist/components/templated-text-kwargs-editor.js +2 -2
- package/dist/components/templated-text-kwargs-editor.js.map +1 -1
- package/dist/components/templated-text-source.d.ts +1 -1
- package/dist/components/templated-text-source.d.ts.map +1 -1
- package/dist/components/templated-text-source.js +2 -2
- package/dist/components/templated-text-source.js.map +1 -1
- package/dist/components/version-history-panel.d.ts.map +1 -1
- package/dist/components/version-history-panel.js.map +1 -1
- package/dist/components/view-toggle.d.ts.map +1 -1
- package/dist/components/view-toggle.js.map +1 -1
- package/dist/element-slot.d.ts +11 -0
- package/dist/element-slot.d.ts.map +1 -1
- package/dist/element-slot.js +0 -11
- package/dist/element-slot.js.map +1 -1
- package/dist/hooks/interactions-connection.d.ts +1 -1
- package/dist/hooks/interactions-connection.d.ts.map +1 -1
- package/dist/hooks/interactions-connection.js.map +1 -1
- package/dist/hooks/useApi.d.ts +77 -7
- package/dist/hooks/useApi.d.ts.map +1 -1
- package/dist/hooks/useApi.js +0 -11
- package/dist/hooks/useApi.js.map +1 -1
- package/dist/hooks/useAuth.d.ts +6 -0
- package/dist/hooks/useAuth.d.ts.map +1 -1
- package/dist/hooks/useAuth.js +0 -6
- package/dist/hooks/useAuth.js.map +1 -1
- package/dist/hooks/useCapabilities.d.ts +18 -2
- package/dist/hooks/useCapabilities.d.ts.map +1 -1
- package/dist/hooks/useCapabilities.js +1 -17
- package/dist/hooks/useCapabilities.js.map +1 -1
- package/dist/hooks/useSse.d.ts +31 -0
- package/dist/hooks/useSse.d.ts.map +1 -1
- package/dist/hooks/useSse.js +2 -33
- package/dist/hooks/useSse.js.map +1 -1
- package/dist/hooks/useSystemKinds.d.ts +1 -1
- package/dist/hooks/useSystemKinds.d.ts.map +1 -1
- package/dist/hooks/useSystemKinds.js +0 -18
- package/dist/hooks/useSystemKinds.js.map +1 -1
- package/dist/hooks/useTheme.d.ts +15 -0
- package/dist/hooks/useTheme.d.ts.map +1 -1
- package/dist/hooks/useTheme.js +0 -15
- package/dist/hooks/useTheme.js.map +1 -1
- package/dist/hooks/useToolDisplayNames.d.ts +0 -14
- package/dist/hooks/useToolDisplayNames.d.ts.map +1 -1
- package/dist/hooks/useToolDisplayNames.js +0 -14
- package/dist/hooks/useToolDisplayNames.js.map +1 -1
- package/dist/host.d.ts +3 -3
- package/dist/host.d.ts.map +1 -1
- package/dist/host.js +2 -9
- package/dist/host.js.map +1 -1
- package/dist/index.d.ts +103 -103
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +49 -62
- package/dist/index.js.map +1 -1
- package/dist/navigation/app-link.d.ts.map +1 -1
- package/dist/navigation/app-link.js.map +1 -1
- package/dist/navigation/context.d.ts.map +1 -1
- package/dist/navigation/context.js.map +1 -1
- package/dist/navigation/index.d.ts +4 -4
- package/dist/navigation/index.d.ts.map +1 -1
- package/dist/navigation/index.js +1 -1
- package/dist/navigation/index.js.map +1 -1
- package/dist/navigation/use-back-forward-guard.d.ts +7 -0
- package/dist/navigation/use-back-forward-guard.d.ts.map +1 -1
- package/dist/navigation/use-back-forward-guard.js +0 -7
- package/dist/navigation/use-back-forward-guard.js.map +1 -1
- package/dist/navigation/use-search-commit.d.ts.map +1 -1
- package/dist/navigation/use-search-commit.js.map +1 -1
- package/dist/plugin/host-state.d.ts.map +1 -1
- package/dist/plugin/host-state.js.map +1 -1
- package/dist/schema-editor/SchemaEditor.d.ts.map +1 -1
- package/dist/schema-editor/SchemaEditor.js.map +1 -1
- package/dist/schema-editor/index.d.ts +3 -3
- package/dist/schema-editor/index.d.ts.map +1 -1
- package/dist/schema-editor/index.js +1 -6
- package/dist/schema-editor/index.js.map +1 -1
- package/dist/schema-form/SecretRefField.d.ts +16 -0
- package/dist/schema-form/SecretRefField.d.ts.map +1 -1
- package/dist/schema-form/SecretRefField.js +0 -16
- package/dist/schema-form/SecretRefField.js.map +1 -1
- package/dist/schema-form/classify.d.ts +9 -0
- package/dist/schema-form/classify.d.ts.map +1 -1
- package/dist/schema-form/classify.js +0 -9
- package/dist/schema-form/classify.js.map +1 -1
- package/dist/schema-form/context.d.ts +6 -0
- package/dist/schema-form/context.d.ts.map +1 -1
- package/dist/schema-form/context.js +0 -6
- package/dist/schema-form/context.js.map +1 -1
- package/dist/schema-form/field-group.d.ts +6 -0
- package/dist/schema-form/field-group.d.ts.map +1 -1
- package/dist/schema-form/field-group.js +0 -6
- package/dist/schema-form/field-group.js.map +1 -1
- package/dist/schema-form/field-node.d.ts.map +1 -1
- package/dist/schema-form/field-node.js.map +1 -1
- package/dist/schema-form/index.d.ts +8 -8
- package/dist/schema-form/index.d.ts.map +1 -1
- package/dist/schema-form/index.js +3 -34
- package/dist/schema-form/index.js.map +1 -1
- package/dist/schema-form/json-field.d.ts +19 -0
- package/dist/schema-form/json-field.d.ts.map +1 -1
- package/dist/schema-form/json-field.js +0 -19
- package/dist/schema-form/json-field.js.map +1 -1
- package/dist/schema-form/media-field.d.ts.map +1 -1
- package/dist/schema-form/media-field.js +2 -2
- package/dist/schema-form/media-field.js.map +1 -1
- package/dist/schema-form/record-field.d.ts +12 -0
- package/dist/schema-form/record-field.d.ts.map +1 -1
- package/dist/schema-form/record-field.js +1 -13
- package/dist/schema-form/record-field.js.map +1 -1
- package/dist/schema-form/string-field.d.ts.map +1 -1
- package/dist/schema-form/string-field.js +1 -1
- package/dist/schema-form/string-field.js.map +1 -1
- package/dist/schema-form/union-field.d.ts.map +1 -1
- package/dist/schema-form/union-field.js.map +1 -1
- package/dist/schema-form/union.d.ts +7 -0
- package/dist/schema-form/union.d.ts.map +1 -1
- package/dist/schema-form/union.js +0 -7
- package/dist/schema-form/union.js.map +1 -1
- package/dist/schema-form/validate.d.ts.map +1 -1
- package/dist/schema-form/validate.js +1 -1
- package/dist/schema-form/validate.js.map +1 -1
- package/dist/state-binding/AdapterMapping.d.ts.map +1 -1
- package/dist/state-binding/AdapterMapping.js +0 -0
- package/dist/state-binding/AdapterMapping.js.map +1 -1
- package/dist/state-binding/BindingJqField.d.ts.map +1 -1
- package/dist/state-binding/BindingJqField.js +2 -2
- package/dist/state-binding/BindingJqField.js.map +1 -1
- package/dist/state-binding/InputInjectionRow.d.ts.map +1 -1
- package/dist/state-binding/InputInjectionRow.js +3 -3
- package/dist/state-binding/InputInjectionRow.js.map +1 -1
- package/dist/state-binding/StateAttachRow.d.ts.map +1 -1
- package/dist/state-binding/StateAttachRow.js +5 -5
- package/dist/state-binding/StateAttachRow.js.map +1 -1
- package/dist/state-binding/StateBindingSection.d.ts.map +1 -1
- package/dist/state-binding/StateBindingSection.js.map +1 -1
- package/dist/state-binding/SubjectScopeFields.d.ts.map +1 -1
- package/dist/state-binding/SubjectScopeFields.js.map +1 -1
- package/dist/state-binding/UpdateRow.d.ts.map +1 -1
- package/dist/state-binding/UpdateRow.js +2 -2
- package/dist/state-binding/UpdateRow.js.map +1 -1
- package/dist/state-binding/adapter-mapping-row.d.ts +1 -1
- package/dist/state-binding/adapter-mapping-row.d.ts.map +1 -1
- package/dist/state-binding/adapter-mapping-row.js +3 -3
- package/dist/state-binding/adapter-mapping-row.js.map +1 -1
- package/dist/state-binding/index.d.ts +21 -21
- package/dist/state-binding/index.d.ts.map +1 -1
- package/dist/state-binding/index.js +9 -15
- package/dist/state-binding/index.js.map +1 -1
- package/dist/state-binding/templated-text-catalog.d.ts.map +1 -1
- package/dist/state-binding/templated-text-catalog.js.map +1 -1
- package/dist/state-binding/types.d.ts +2 -2
- package/dist/state-binding/types.d.ts.map +1 -1
- package/dist/structured-output/StructuredOutput.d.ts.map +1 -1
- package/dist/structured-output/StructuredOutput.js +1 -1
- package/dist/structured-output/StructuredOutput.js.map +1 -1
- package/package.json +2 -2
- package/src/components/code-block.tsx +1 -1
- package/src/components/confirm-dialog.tsx +1 -1
- package/src/components/copy-field.tsx +1 -1
- package/src/components/date-range-picker.tsx +1 -1
- package/src/components/dialog.tsx +1 -1
- package/src/components/dirty-guard.tsx +3 -3
- package/src/components/explorer-body.tsx +3 -3
- package/src/components/explorer-view.tsx +9 -9
- package/src/components/extension-combo-builder.tsx +2 -3
- package/src/components/extension-combo-parts.tsx +1 -2
- package/src/components/field.tsx +1 -1
- package/src/components/fleet-report.tsx +3 -3
- package/src/components/folder-nav.tsx +2 -2
- package/src/components/form-dialog.tsx +2 -2
- package/src/components/icons/index.ts +38 -38
- package/src/components/icons/nav-map.ts +11 -11
- package/src/components/inputs.tsx +1 -1
- package/src/components/json-diff.tsx +1 -1
- package/src/components/json-tree-nodes.tsx +3 -3
- package/src/components/json-tree.tsx +7 -7
- package/src/components/markdown.tsx +2 -2
- package/src/components/page-fill.tsx +1 -1
- package/src/components/radio-group.tsx +1 -1
- package/src/components/scroll-region.tsx +11 -10
- package/src/components/table.tsx +1 -1
- package/src/components/tags.tsx +2 -2
- package/src/components/templated-text-field.tsx +3 -4
- package/src/components/templated-text-kwargs-editor.tsx +3 -3
- package/src/components/templated-text-source.tsx +3 -3
- package/src/components/version-history-panel.tsx +1 -1
- package/src/components/view-toggle.tsx +1 -1
- package/src/element-slot.ts +1 -1
- package/src/hooks/interactions-connection.ts +3 -3
- package/src/hooks/useApi.ts +1 -1
- package/src/hooks/useAuth.ts +1 -1
- package/src/hooks/useCapabilities.ts +3 -3
- package/src/hooks/useSse.ts +5 -5
- package/src/hooks/useSystemKinds.tsx +2 -2
- package/src/hooks/useTheme.ts +1 -1
- package/src/hooks/useToolDisplayNames.tsx +2 -2
- package/src/host.ts +7 -7
- package/src/index.ts +292 -292
- package/src/navigation/app-link.tsx +2 -2
- package/src/navigation/context.tsx +3 -3
- package/src/navigation/index.ts +14 -14
- package/src/navigation/use-back-forward-guard.ts +1 -1
- package/src/navigation/use-search-commit.ts +1 -1
- package/src/plugin/host-state.ts +1 -1
- package/src/schema-editor/SchemaEditor.tsx +1 -1
- package/src/schema-editor/index.ts +3 -3
- package/src/schema-form/SecretRefField.tsx +1 -1
- package/src/schema-form/classify.ts +2 -2
- package/src/schema-form/context.ts +1 -1
- package/src/schema-form/field-group.tsx +1 -1
- package/src/schema-form/field-node.tsx +1 -1
- package/src/schema-form/index.ts +10 -10
- package/src/schema-form/json-field.tsx +1 -1
- package/src/schema-form/media-field.tsx +3 -3
- package/src/schema-form/record-field.tsx +2 -2
- package/src/schema-form/string-field.tsx +2 -2
- package/src/schema-form/union-field.tsx +2 -2
- package/src/schema-form/union.ts +1 -1
- package/src/schema-form/validate.ts +2 -2
- package/src/state-binding/AdapterMapping.tsx +0 -0
- package/src/state-binding/BindingJqField.tsx +3 -3
- package/src/state-binding/InputInjectionRow.tsx +4 -4
- package/src/state-binding/StateAttachRow.tsx +7 -7
- package/src/state-binding/StateBindingSection.tsx +1 -1
- package/src/state-binding/SubjectScopeFields.tsx +1 -1
- package/src/state-binding/UpdateRow.tsx +3 -3
- package/src/state-binding/adapter-mapping-row.tsx +4 -4
- package/src/state-binding/index.ts +43 -43
- package/src/state-binding/templated-text-catalog.ts +0 -1
- package/src/state-binding/types.ts +2 -2
- package/src/structured-output/StructuredOutput.tsx +1 -1
|
@@ -1,5 +1,21 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* `useCapabilities` — the caller's capability projection (`GET /api/auth/me`),
|
|
3
|
+
* fetched once per auth flip and held as SDK state. The UI is a projection of
|
|
4
|
+
* this: nav, pages, and plugin loading filter on what the projection says the
|
|
5
|
+
* caller can reach, and the server stays the sole authority (projection ⊆ gate).
|
|
6
|
+
*
|
|
7
|
+
* A PLAIN fetch state machine (`loading` / `ready` / `failed`), NOT TanStack
|
|
8
|
+
* Query, and for the same reason the login page fetches its methods with plain
|
|
9
|
+
* `fetch`: the shell wipes the query cache around auth flips, so a
|
|
10
|
+
* query-cached projection would be dropped underneath the components that gate
|
|
11
|
+
* on it. This provider owns the projection lifecycle instead.
|
|
12
|
+
*
|
|
13
|
+
* FAILED IS LOUD AND BLOCKING: on a `/me` failure the shell renders an
|
|
14
|
+
* `ErrorState` with `retry` in the nav region — never an optimistic full nav on
|
|
15
|
+
* error. The UI fails closed exactly as the server would.
|
|
16
|
+
*/
|
|
2
17
|
import type { MeProjection } from '@tai42/api-client';
|
|
18
|
+
import type { ReactNode } from 'react';
|
|
3
19
|
export type CapabilityState = {
|
|
4
20
|
readonly status: 'loading';
|
|
5
21
|
} | {
|
|
@@ -20,7 +36,7 @@ export declare function CapabilityProvider({ children }: {
|
|
|
20
36
|
export declare function useCapabilities(): CapabilityContextValue;
|
|
21
37
|
/**
|
|
22
38
|
* Whether the projection is the synthetic TOTAL projection — the admin session
|
|
23
|
-
* (the condition-free
|
|
39
|
+
* (the condition-free `"*"` discriminator) and the gate-off local-dev
|
|
24
40
|
* projection alike. This is `projection.admin === true` and NOTHING else: a
|
|
25
41
|
* seeded editor/viewer carries `["*"]` scopes PLUS a jq fence, so keying on `"*"`
|
|
26
42
|
* scopes would hand every editor/viewer the unfiltered nav and a wall of 403s on
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useCapabilities.d.ts","sourceRoot":"","sources":["../../src/hooks/useCapabilities.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useCapabilities.d.ts","sourceRoot":"","sources":["../../src/hooks/useCapabilities.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAgBvC,MAAM,MAAM,eAAe,GACvB;IAAE,QAAQ,CAAC,MAAM,EAAE,SAAS,CAAA;CAAE,GAC9B;IAAE,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,UAAU,EAAE,YAAY,CAAA;CAAE,GAC/D;IAAE,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAA;CAAE,CAAC;AAE3D,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,KAAK,EAAE,eAAe,CAAC;IAChC,4EAA4E;IAC5E,QAAQ,CAAC,KAAK,EAAE,MAAM,IAAI,CAAC;CAC5B;AAID,wBAAgB,kBAAkB,CAAC,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,EAAE,SAAS,CAAA;CAAE,0GA4DvE;AAED,wBAAgB,eAAe,IAAI,sBAAsB,CAMxD;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,gBAAgB,CAAC,UAAU,EAAE,YAAY,GAAG,OAAO,CAElE;AAaD;;;;;;;;;;;;;GAaG;AACH,wBAAgB,cAAc,CAAC,UAAU,EAAE,YAAY,EAAE,QAAQ,EAAE,SAAS,MAAM,EAAE,GAAG,OAAO,CAa7F;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,WAAW,CAAC,UAAU,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAE3F;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,eAAe,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAKzF;AAED;;;;;;;;;GASG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,SAAS,GAAG,OAAO,CAGlE"}
|
|
@@ -1,19 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* `useCapabilities` — the caller's capability projection (`GET /api/auth/me`),
|
|
3
|
-
* fetched once per auth flip and held as SDK state. The UI is a projection of
|
|
4
|
-
* this: nav, pages, and plugin loading filter on what the projection says the
|
|
5
|
-
* caller can reach, and the server stays the sole authority (projection ⊆ gate).
|
|
6
|
-
*
|
|
7
|
-
* A PLAIN fetch state machine (`loading` / `ready` / `failed`), NOT TanStack
|
|
8
|
-
* Query, and for the same reason the login page fetches its methods with plain
|
|
9
|
-
* `fetch`: the shell wipes the query cache around auth flips, so a
|
|
10
|
-
* query-cached projection would be dropped underneath the components that gate
|
|
11
|
-
* on it. This provider owns the projection lifecycle instead.
|
|
12
|
-
*
|
|
13
|
-
* FAILED IS LOUD AND BLOCKING: on a `/me` failure the shell renders an
|
|
14
|
-
* `ErrorState` with `retry` in the nav region — never an optimistic full nav on
|
|
15
|
-
* error. The UI fails closed exactly as the server would.
|
|
16
|
-
*/
|
|
17
1
|
import { createContext, useCallback, useContext, useEffect, useMemo, useRef, useState, } from 'react';
|
|
18
2
|
import { createElement } from 'react';
|
|
19
3
|
import { useApi } from './useApi';
|
|
@@ -84,7 +68,7 @@ export function useCapabilities() {
|
|
|
84
68
|
}
|
|
85
69
|
/**
|
|
86
70
|
* Whether the projection is the synthetic TOTAL projection — the admin session
|
|
87
|
-
* (the condition-free
|
|
71
|
+
* (the condition-free `"*"` discriminator) and the gate-off local-dev
|
|
88
72
|
* projection alike. This is `projection.admin === true` and NOTHING else: a
|
|
89
73
|
* seeded editor/viewer carries `["*"]` scopes PLUS a jq fence, so keying on `"*"`
|
|
90
74
|
* scopes would hand every editor/viewer the unfiltered nav and a wall of 403s on
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useCapabilities.js","sourceRoot":"","sources":["../../src/hooks/useCapabilities.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useCapabilities.js","sourceRoot":"","sources":["../../src/hooks/useCapabilities.ts"],"names":[],"mappings":"AAkBA,OAAO,EACL,aAAa,EACb,WAAW,EACX,UAAU,EACV,SAAS,EACT,OAAO,EACP,MAAM,EACN,QAAQ,GACT,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAEtC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAatD,MAAM,iBAAiB,GAAG,aAAa,CAAgC,IAAI,CAAC,CAAC;AAE7E,MAAM,UAAU,kBAAkB,CAAC,EAAE,QAAQ,EAA2B;IACtE,MAAM,EAAE,eAAe,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC;IAC7C,MAAM,GAAG,GAAG,MAAM,EAAE,CAAC;IACrB,MAAM,cAAc,GAAG,iBAAiB,EAAE,CAAC;IAC3C,MAAM,CAAC,KAAK,EAAE,QAAQ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WAAW,CAAC,KAAK,CAAC,UAAU,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC,CACpF,CAAC;AACJ,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,UAAU,WAAW,CAAC,IAAY,EAAE,MAAM,GAAG,MAAM;IACvD,MAAM,EAAE,KAAK,EAAE,GAAG,eAAe,EAAE,CAAC;IACpC,OAAO,WAAW,CAAC,KAAK,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;AAC1C,CAAC;AAED,MAAM,oBAAoB,GAAG,oBAAoB,CAAC;AAElD;;;;;;GAMG;AACH,SAAS,iBAAiB,CAAC,OAAe;IACxC,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC;QAAE,OAAO,IAAI,CAAC;IAC1C,IAAI,IAAI,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IAC5B,IAAI,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC;QAAE,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IACjD,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC;QAAE,OAAO,IAAI,CAAC;IACtC,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IACzB,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,IAAI,oBAAoB,CAAC,IAAI,CAAC,IAAI,CAAC;QAAE,OAAO,IAAI,CAAC;IACtE,OAAO,IAAI,CAAC;AACd,CAAC"}
|
package/dist/hooks/useSse.d.ts
CHANGED
|
@@ -1,3 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `useInteractionsStream` — the live interactions inbox, a TAIL-ONLY SSE stream
|
|
3
|
+
* (via the api-client's `streamInteractions`: fetch + ReadableStream, never
|
|
4
|
+
* EventSource) laid over a PAGED base the caller supplies.
|
|
5
|
+
*
|
|
6
|
+
* The stream carries only the live tail: events `interaction.add` /
|
|
7
|
+
* `interaction.answered` / `interaction.removed` (no backlog, no
|
|
8
|
+
* `interaction.backlog_done`). The PENDING SET is not replayed on the stream — it
|
|
9
|
+
* is the `seed` the caller passes from the paged `GET /api/interactions` door; this
|
|
10
|
+
* hook overlays the live deltas onto it. The hook calls `onResync` on every
|
|
11
|
+
* (re)connect ONLY, so the caller refetches that base to catch up anything missed
|
|
12
|
+
* while disconnected; a live delta never triggers a refetch — the overlay updates
|
|
13
|
+
* the list and the derived `count` in place.
|
|
14
|
+
*
|
|
15
|
+
* The published list is `merge(seed, live)`: every seeded pending item, plus any
|
|
16
|
+
* item added on the tail since connect, minus any removed on the tail, with the
|
|
17
|
+
* client `answered` flag set on an item the tail reported answered. The published
|
|
18
|
+
* `count` is the live PENDING tally, derived from the same overlay without a
|
|
19
|
+
* refetch, reconciled by EPOCH so a resync never double-counts.
|
|
20
|
+
*
|
|
21
|
+
* The pure frame parsing, overlay reducer and derived projections live in
|
|
22
|
+
* `interactions-stream`; the fetch/reconnect/resync loop lives in
|
|
23
|
+
* `interactions-connection`. This hook holds the React state those two operate on
|
|
24
|
+
* and wires them together: the overlay is a ref (mutated in place by the driver),
|
|
25
|
+
* the published list is `merge(seed, overlay)` held in state and recomputed on
|
|
26
|
+
* every overlay change and every seed change, and the count is derived on render.
|
|
27
|
+
*
|
|
28
|
+
* The `Interaction` type is imported type-only (no runtime dep on api-client);
|
|
29
|
+
* `answered` is not a wire field — it is a client flag flipped on an
|
|
30
|
+
* `interaction.answered` event.
|
|
31
|
+
*/
|
|
1
32
|
import type { Interaction } from '@tai42/api-client';
|
|
2
33
|
import { type StreamInteraction } from './interactions-stream';
|
|
3
34
|
export type { StreamInteraction } from './interactions-stream';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSse.d.ts","sourceRoot":"","sources":["../../src/hooks/useSse.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useSse.d.ts","sourceRoot":"","sources":["../../src/hooks/useSse.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAIrD,OAAO,EAKL,KAAK,iBAAiB,EACvB,MAAM,uBAAuB,CAAC;AAI/B,YAAY,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAE/D,8DAA8D;AAC9D,MAAM,WAAW,yBAAyB;IACxC;;;;OAIG;IACH,QAAQ,CAAC,IAAI,EAAE,SAAS,WAAW,EAAE,CAAC;IACtC;;;;OAIG;IACH,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB;;;;;;;;;OASG;IACH,QAAQ,CAAC,QAAQ,EAAE,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;CACrD;AAED,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,YAAY,EAAE,iBAAiB,EAAE,CAAC;IAC3C;;;;;OAKG;IACH,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;IAC5B,QAAQ,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI,CAAC;IAC7B;;;;OAIG;IACH,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;CAC5B;AAED,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,yBAAyB,GAAG,uBAAuB,CAkEjG"}
|
package/dist/hooks/useSse.js
CHANGED
|
@@ -1,39 +1,8 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* `useInteractionsStream` — the live interactions inbox, a TAIL-ONLY SSE stream
|
|
3
|
-
* (via the api-client's `streamInteractions`: fetch + ReadableStream, never
|
|
4
|
-
* EventSource) laid over a PAGED base the caller supplies.
|
|
5
|
-
*
|
|
6
|
-
* The stream carries only the live tail: events `interaction.add` /
|
|
7
|
-
* `interaction.answered` / `interaction.removed` (no backlog, no
|
|
8
|
-
* `interaction.backlog_done`). The PENDING SET is not replayed on the stream — it
|
|
9
|
-
* is the `seed` the caller passes from the paged `GET /api/interactions` door; this
|
|
10
|
-
* hook overlays the live deltas onto it. The hook calls `onResync` on every
|
|
11
|
-
* (re)connect ONLY, so the caller refetches that base to catch up anything missed
|
|
12
|
-
* while disconnected; a live delta never triggers a refetch — the overlay updates
|
|
13
|
-
* the list and the derived `count` in place.
|
|
14
|
-
*
|
|
15
|
-
* The published list is `merge(seed, live)`: every seeded pending item, plus any
|
|
16
|
-
* item added on the tail since connect, minus any removed on the tail, with the
|
|
17
|
-
* client `answered` flag set on an item the tail reported answered. The published
|
|
18
|
-
* `count` is the live PENDING tally, derived from the same overlay without a
|
|
19
|
-
* refetch, reconciled by EPOCH so a resync never double-counts.
|
|
20
|
-
*
|
|
21
|
-
* The pure frame parsing, overlay reducer and derived projections live in
|
|
22
|
-
* `interactions-stream`; the fetch/reconnect/resync loop lives in
|
|
23
|
-
* `interactions-connection`. This hook holds the React state those two operate on
|
|
24
|
-
* and wires them together: the overlay is a ref (mutated in place by the driver),
|
|
25
|
-
* the published list is `merge(seed, overlay)` held in state and recomputed on
|
|
26
|
-
* every overlay change and every seed change, and the count is derived on render.
|
|
27
|
-
*
|
|
28
|
-
* The `Interaction` type is imported type-only (no runtime dep on api-client);
|
|
29
|
-
* `answered` is not a wire field — it is a client flag flipped on an
|
|
30
|
-
* `interaction.answered` event.
|
|
31
|
-
*/
|
|
32
1
|
import { useEffect, useRef, useState } from 'react';
|
|
2
|
+
import { startInteractionsStream } from './interactions-connection';
|
|
3
|
+
import { emptyOverlay, merge, pendingCount, } from './interactions-stream';
|
|
33
4
|
import { useApi } from './useApi';
|
|
34
5
|
import { useOnUnauthorized } from './useUnauthorized';
|
|
35
|
-
import { emptyOverlay, merge, pendingCount, } from './interactions-stream';
|
|
36
|
-
import { startInteractionsStream } from './interactions-connection';
|
|
37
6
|
export function useInteractionsStream(options) {
|
|
38
7
|
const { seed, total, onResync } = options;
|
|
39
8
|
const api = useApi();
|
package/dist/hooks/useSse.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSse.js","sourceRoot":"","sources":["../../src/hooks/useSse.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useSse.js","sourceRoot":"","sources":["../../src/hooks/useSse.ts"],"names":[],"mappings":"AAgCA,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEpD,OAAO,EAAwB,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAC1F,OAAO,EACL,YAAY,EAEZ,KAAK,EACL,YAAY,GAEb,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAkDtD,MAAM,UAAU,qBAAqB,CAAC,OAAkC;IACtE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,OAAO,CAAC;IAC1C,MAAM,GAAG,GAAG,MAAM,EAAE,CAAC;IACrB,MAAM,cAAc,GAAG,iBAAiB,EAAE,CAAC;IAE3C,MAAM,CAAC,eAAe,EAAE,kBAAkB,CAAC,GAAG,QAAQ,CAAkB;QACtE,SAAS,EAAE,KAAK;QAChB,KAAK,EAAE,IAAI;QACX,QAAQ,EAAE,KAAK;KAChB,CAAC,CAAC;IAEH,6EAA6E;IAC7E,8EAA8E;IAC9E,mFAAmF;IACnF,MAAM,UAAU,GAAG,MAAM,CAAc,YAAY,EAAE,CAAC,CAAC;IACvD,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,GAAG,QAAQ,CAAsB,GAAG,EAAE,CACzE,KAAK,CAAC,IAAI,EAAE,UAAU,CAAC,OAAO,CAAC,CAChC,CAAC;IAEF,mFAAmF;IACnF,iFAAiF;IACjF,kFAAkF;IAClF,8DAA8D;IAC9D,MAAM,QAAQ,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;IAC3B,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC;IAEhD,+EAA+E;IAC/E,8CAA8C;IAC9C,MAAM,OAAO,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC;IAC7B,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC;IACvB,MAAM,WAAW,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC;IACrC,WAAW,CAAC,OAAO,GAAG,QAAQ,CAAC;IAE/B,gFAAgF;IAChF,SAAS,CAAC,GAAG,EAAE;QACb,eAAe,CAAC,KAAK,CAAC,IAAI,EAAE,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC;IACnD,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC;IAEX,SAAS,CACP,GAAG,EAAE,CACH,uBAAuB,CAAC;QACtB,GAAG;QACH,UAAU;QACV,QAAQ;QACR,OAAO;QACP,WAAW;QACX,cAAc;QACd,kBAAkB;QAClB,eAAe;QACf,aAAa;KACd,CAAC,EACJ,CAAC,GAAG,EAAE,cAAc,CAAC,CACtB,CAAC;IAEF,mFAAmF;IACnF,gFAAgF;IAChF,mEAAmE;IACnE,MAAM,KAAK,GAAG,YAAY,CAAC,IAAI,EAAE,KAAK,EAAE,UAAU,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC;IAExE,OAAO;QACL,YAAY;QACZ,KAAK;QACL,SAAS,EAAE,eAAe,CAAC,SAAS;QACpC,KAAK,EAAE,eAAe,CAAC,KAAK;QAC5B,QAAQ,EAAE,eAAe,CAAC,QAAQ;KACnC,CAAC;AACJ,CAAC"}
|
|
@@ -16,8 +16,8 @@
|
|
|
16
16
|
* as not-off until the table is `ready`, and a failed fetch leaves every kind not-off
|
|
17
17
|
* so the surface falls back to its reactive 501 handling, never a hard-failed page.
|
|
18
18
|
*/
|
|
19
|
-
import { type ReactNode } from 'react';
|
|
20
19
|
import type { KindStatus } from '@tai42/api-client';
|
|
20
|
+
import { type ReactNode } from 'react';
|
|
21
21
|
export type SystemKindsState = {
|
|
22
22
|
readonly status: 'loading';
|
|
23
23
|
} | {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSystemKinds.d.ts","sourceRoot":"","sources":["../../src/hooks/useSystemKinds.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,OAAO,
|
|
1
|
+
{"version":3,"file":"useSystemKinds.d.ts","sourceRoot":"","sources":["../../src/hooks/useSystemKinds.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAGL,KAAK,SAAS,EAIf,MAAM,OAAO,CAAC;AAKf,MAAM,MAAM,gBAAgB,GACxB;IAAE,QAAQ,CAAC,MAAM,EAAE,SAAS,CAAA;CAAE,GAC9B;IAAE,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,SAAS,UAAU,EAAE,CAAA;CAAE,GACnE;IAAE,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAA;CAAE,CAAC;AAI3D;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,EAAE,SAAS,CAAA;CAAE,oGA4BxE;AAED;;;;GAIG;AACH,wBAAgB,cAAc,IAAI,gBAAgB,CAEjD;AAED;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAInD;AAED;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAKhE"}
|
|
@@ -1,21 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* `useFeatureOff` — the PROACTIVE read of a DB-backed feature's OFF state, off the
|
|
3
|
-
* system kind-status table (`GET /api/system/kinds`), fetched once per auth flip and
|
|
4
|
-
* held as SDK state.
|
|
5
|
-
*
|
|
6
|
-
* A deployment leaves a database-backed feature cleanly OFF by configuring no store
|
|
7
|
-
* for it; the kind-status table then reports that kind's `state` as `off` (rather
|
|
8
|
-
* than `active` / `default`). A write affordance for an OFF feature reads this and
|
|
9
|
-
* hides itself BEFORE the user acts, instead of learning OFF only from a write's 501
|
|
10
|
-
* refusal — the reactive `isFeatureDisabled` swallow stays as the backstop for a
|
|
11
|
-
* stale table.
|
|
12
|
-
*
|
|
13
|
-
* A PLAIN fetch state machine (`loading` / `ready` / `failed`), NOT TanStack Query:
|
|
14
|
-
* the SDK is the shared leaf across the plugin boundary and holds no query context,
|
|
15
|
-
* exactly as `useCapabilities` does. It is DELIBERATELY non-blocking — a kind counts
|
|
16
|
-
* as not-off until the table is `ready`, and a failed fetch leaves every kind not-off
|
|
17
|
-
* so the surface falls back to its reactive 501 handling, never a hard-failed page.
|
|
18
|
-
*/
|
|
19
1
|
import { createContext, createElement, useContext, useEffect, useState, } from 'react';
|
|
20
2
|
import { useApi } from './useApi';
|
|
21
3
|
import { useAuth } from './useAuth';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSystemKinds.js","sourceRoot":"","sources":["../../src/hooks/useSystemKinds.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useSystemKinds.js","sourceRoot":"","sources":["../../src/hooks/useSystemKinds.tsx"],"names":[],"mappings":"AAmBA,OAAO,EACL,aAAa,EACb,aAAa,EAEb,UAAU,EACV,SAAS,EACT,QAAQ,GACT,MAAM,OAAO,CAAC;AAEf,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAOpC,MAAM,kBAAkB,GAAG,aAAa,CAA0B,IAAI,CAAC,CAAC;AAExE;;;;;;GAMG;AACH,MAAM,UAAU,mBAAmB,CA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,CAAC,kBAAkB,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC;AACjE,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,aAAa,CAAC,IAAY;IACxC,MAAM,KAAK,GAAG,cAAc,EAAE,CAAC;IAC/B,IAAI,KAAK,CAAC,MAAM,KAAK,OAAO;QAAE,OAAO,KAAK,CAAC;IAC3C,OAAO,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,KAAK,IAAI,IAAI,GAAG,CAAC,KAAK,KAAK,KAAK,CAAC,CAAC;AAC7E,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,oBAAoB,CAAC,IAAY;IAC/C,MAAM,KAAK,GAAG,cAAc,EAAE,CAAC;IAC/B,IAAI,KAAK,CAAC,MAAM,KAAK,OAAO;QAAE,OAAO,IAAI,CAAC;IAC1C,MAAM,GAAG,GAAG,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,KAAK,IAAI,IAAI,KAAK,CAAC,KAAK,KAAK,KAAK,CAAC,CAAC;IACtF,OAAO,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC;AACjC,CAAC"}
|
package/dist/hooks/useTheme.d.ts
CHANGED
|
@@ -1,3 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `useTheme` — light/dark theme, token-driven. The active theme stamps
|
|
3
|
+
* `data-theme` on the document root, which the DS token layers key off.
|
|
4
|
+
*
|
|
5
|
+
* A three-state PREFERENCE sits behind the resolved theme: `'light'` and
|
|
6
|
+
* `'dark'` pin it, `'system'` follows `prefers-color-scheme` and tracks OS
|
|
7
|
+
* changes live. The resolved `theme` a consumer reads is always the concrete
|
|
8
|
+
* `'light' | 'dark'` the tokens need — never `'system'`.
|
|
9
|
+
*
|
|
10
|
+
* The preference persists to `localStorage`, but ONLY when the operator sets it
|
|
11
|
+
* explicitly (`setPreference` / `setTheme` / `toggle`). Boot READS the stored
|
|
12
|
+
* value; it never WRITES one, so a session that only ever renders the app leaves
|
|
13
|
+
* storage untouched. A `'system'` preference clears any pinned choice and hands
|
|
14
|
+
* the theme back to the OS.
|
|
15
|
+
*/
|
|
1
16
|
import type { ReactNode } from 'react';
|
|
2
17
|
export type Theme = 'light' | 'dark';
|
|
3
18
|
export type ThemePreference = 'light' | 'dark' | 'system';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useTheme.d.ts","sourceRoot":"","sources":["../../src/hooks/useTheme.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useTheme.d.ts","sourceRoot":"","sources":["../../src/hooks/useTheme.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAWvC,MAAM,MAAM,KAAK,GAAG,OAAO,GAAG,MAAM,CAAC;AACrC,MAAM,MAAM,eAAe,GAAG,OAAO,GAAG,MAAM,GAAG,QAAQ,CAAC;AAE1D,MAAM,WAAW,UAAU;IACzB,iFAAiF;IACjF,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC;IACtB,6EAA6E;IAC7E,QAAQ,CAAC,UAAU,EAAE,eAAe,CAAC;IACrC,4EAA4E;IAC5E,QAAQ,CAAC,aAAa,EAAE,CAAC,UAAU,EAAE,eAAe,KAAK,IAAI,CAAC;IAC9D,iFAAiF;IACjF,QAAQ,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IAC1C,oFAAoF;IACpF,QAAQ,CAAC,MAAM,EAAE,MAAM,IAAI,CAAC;CAC7B;AA4BD,wBAAgB,aAAa,CAAC,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,EAAE,SAAS,CAAA;CAAE,8FA0DlE;AAED,wBAAgB,QAAQ,IAAI,UAAU,CAIrC"}
|
package/dist/hooks/useTheme.js
CHANGED
|
@@ -1,18 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* `useTheme` — light/dark theme, token-driven. The active theme stamps
|
|
3
|
-
* `data-theme` on the document root, which the DS token layers key off.
|
|
4
|
-
*
|
|
5
|
-
* A three-state PREFERENCE sits behind the resolved theme: `'light'` and
|
|
6
|
-
* `'dark'` pin it, `'system'` follows `prefers-color-scheme` and tracks OS
|
|
7
|
-
* changes live. The resolved `theme` a consumer reads is always the concrete
|
|
8
|
-
* `'light' | 'dark'` the tokens need — never `'system'`.
|
|
9
|
-
*
|
|
10
|
-
* The preference persists to `localStorage`, but ONLY when the operator sets it
|
|
11
|
-
* explicitly (`setPreference` / `setTheme` / `toggle`). Boot READS the stored
|
|
12
|
-
* value; it never WRITES one, so a session that only ever renders the app leaves
|
|
13
|
-
* storage untouched. A `'system'` preference clears any pinned choice and hands
|
|
14
|
-
* the theme back to the OS.
|
|
15
|
-
*/
|
|
16
1
|
import { createContext, createElement, useCallback, useContext, useEffect, useMemo, useState, } from 'react';
|
|
17
2
|
const ThemeContext = createContext(null);
|
|
18
3
|
/** Where the explicit preference is stored between sessions. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useTheme.js","sourceRoot":"","sources":["../../src/hooks/useTheme.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useTheme.js","sourceRoot":"","sources":["../../src/hooks/useTheme.ts"],"names":[],"mappings":"AAgBA,OAAO,EACL,aAAa,EACb,aAAa,EACb,WAAW,EACX,UAAU,EACV,SAAS,EACT,OAAO,EACP,QAAQ,GACT,MAAM,OAAO,CAAC;AAkBf,MAAM,YAAY,GAAG,aAAa,CAAoB,IAAI,CAAC,CAAC;AAE5D,gEAAgE;AAChE,MAAM,WAAW,GAAG,6BAA6B,CAAC;AAElD,SAAS,WAAW;IAClB,IAAI,CAAC;QACH,OAAO,UAAU,CAAC,UAAU,CAAC,8BAA8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,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC,EAC9D,CAAC,KAAK,EAAE,UAAU,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,CAAC,CACrD,CAAC;IAEF,OAAO,aAAa,CAAC,YAAY,CAAC,QAAQ,EAAE,EAAE,KAAK,EAAE,EAAE,QAAQ,CAAC,CAAC;AACnE,CAAC;AAED,MAAM,UAAU,QAAQ;IACtB,MAAM,KAAK,GAAG,UAAU,CAAC,YAAY,CAAC,CAAC;IACvC,IAAI,KAAK,KAAK,IAAI;QAAE,MAAM,IAAI,KAAK,CAAC,gDAAgD,CAAC,CAAC;IACtF,OAAO,KAAK,CAAC;AACf,CAAC"}
|
|
@@ -1,17 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* `useToolDisplayNames` — the tool-meta display-name overlay (`GET /api/tool-meta`),
|
|
3
|
-
* fetched once per auth flip and held as SDK state, so every tool picker across the
|
|
4
|
-
* app labels a raw tool name with its human display name from ONE shared read rather
|
|
5
|
-
* than each picker refetching the overlay.
|
|
6
|
-
*
|
|
7
|
-
* A PLAIN fetch state machine (`loading` / `ready` / `failed`), NOT TanStack Query:
|
|
8
|
-
* the SDK is the shared leaf across the plugin boundary and holds no query context,
|
|
9
|
-
* exactly as `useSystemKinds` and `useCapabilities` do. It is DELIBERATELY
|
|
10
|
-
* non-blocking — the map reads empty until the overlay is `ready`, and a failed fetch
|
|
11
|
-
* settles into `failed` QUIETLY (no unauthorized routing, no loud error) because a
|
|
12
|
-
* display name is cosmetic: a picker with an empty map falls back to the bare raw
|
|
13
|
-
* name, never a hard-failed page.
|
|
14
|
-
*/
|
|
15
1
|
import { type ReactNode } from 'react';
|
|
16
2
|
export type ToolDisplayNamesState = {
|
|
17
3
|
readonly status: 'loading';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useToolDisplayNames.d.ts","sourceRoot":"","sources":["../../src/hooks/useToolDisplayNames.tsx"],"names":[],"mappings":"
|
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AAE,MAAM,CAAC,CAAC,CAAC;IACjD,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IAC7B,QAAQ,CAAC,QAAQ,EAAE,SAAS,CAAC;CAC9B,gHAMA"}
|
|
@@ -1,17 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* `useToolDisplayNames` — the tool-meta display-name overlay (`GET /api/tool-meta`),
|
|
3
|
-
* fetched once per auth flip and held as SDK state, so every tool picker across the
|
|
4
|
-
* app labels a raw tool name with its human display name from ONE shared read rather
|
|
5
|
-
* than each picker refetching the overlay.
|
|
6
|
-
*
|
|
7
|
-
* A PLAIN fetch state machine (`loading` / `ready` / `failed`), NOT TanStack Query:
|
|
8
|
-
* the SDK is the shared leaf across the plugin boundary and holds no query context,
|
|
9
|
-
* exactly as `useSystemKinds` and `useCapabilities` do. It is DELIBERATELY
|
|
10
|
-
* non-blocking — the map reads empty until the overlay is `ready`, and a failed fetch
|
|
11
|
-
* settles into `failed` QUIETLY (no unauthorized routing, no loud error) because a
|
|
12
|
-
* display name is cosmetic: a picker with an empty map falls back to the bare raw
|
|
13
|
-
* name, never a hard-failed page.
|
|
14
|
-
*/
|
|
15
1
|
import { createContext, createElement, useCallback, useContext, useEffect, useMemo, useState, } from 'react';
|
|
16
2
|
import { useApi } from './useApi';
|
|
17
3
|
import { useAuth } from './useAuth';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useToolDisplayNames.js","sourceRoot":"","sources":["../../src/hooks/useToolDisplayNames.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useToolDisplayNames.js","sourceRoot":"","sources":["../../src/hooks/useToolDisplayNames.tsx"],"names":[],"mappings":"AAeA,OAAO,EACL,aAAa,EACb,aAAa,EAEb,WAAW,EACX,UAAU,EACV,SAAS,EACT,OAAO,EACP,QAAQ,GACT,MAAM,OAAO,CAAC;AAEf,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO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G;AACH,MAAM,UAAU,yBAAyB;IACvC,MAAM,KAAK,GAAG,UAAU,CAAC,uBAAuB,CAAC,CAAC;IAClD,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,CAAC;AAC5C,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,gBAAgB,CAAC,KAAuC,EAAE,OAAe;IACvF,MAAM,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC,CAAC;IAC/B,OAAO,OAAO,KAAK,SAAS,IAAI,OAAO,KAAK,EAAE,IAAI,OAAO,KAAK,OAAO;QACnE,CAAC,CAAC,GAAG,OAAO,KAAK,OAAO,GAAG;QAC3B,CAAC,CAAC,OAAO,CAAC;AACd,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,8BAA8B,CAAC,EAC7C,KAAK,EACL,MAAM,GAAG,GAAG,EAAE,CAAC,SAAS,EACxB,QAAQ,GAKT;IACC,MAAM,KAAK,GAAG,OAAO,CACnB,GAAG,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,MAAM,EAAE,CAAC,EACrD,CAAC,KAAK,EAAE,MAAM,CAAC,CAChB,CAAC;IACF,OAAO,aAAa,CAAC,uBAAuB,CAAC,QAAQ,EAAE,EAAE,KAAK,EAAE,EAAE,QAAQ,CAAC,CAAC;AAC9E,CAAC"}
|
package/dist/host.d.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* carries no way to forge, wipe, or enumerate the registry. Only the host bundle
|
|
6
6
|
* imports this. See SECURITY.md for the trust boundary.
|
|
7
7
|
*/
|
|
8
|
-
export {
|
|
9
|
-
export {
|
|
10
|
-
export
|
|
8
|
+
export type { LoadedPlugin, PluginContributionsSnapshot, PluginLoaderState, } from './plugin/host-state';
|
|
9
|
+
export { getPluginHostState, setPluginHostState, subscribePluginHost, usePluginContributions, } from './plugin/host-state';
|
|
10
|
+
export { getContributions, loadPlugin } from './plugin/registry';
|
|
11
11
|
//# sourceMappingURL=host.d.ts.map
|
package/dist/host.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"host.d.ts","sourceRoot":"","sources":["../src/host.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,
|
|
1
|
+
{"version":3,"file":"host.d.ts","sourceRoot":"","sources":["../src/host.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,YAAY,EACV,YAAY,EACZ,2BAA2B,EAC3B,iBAAiB,GAClB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,kBAAkB,EAClB,kBAAkB,EAClB,mBAAmB,EACnB,sBAAsB,GACvB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC"}
|
package/dist/host.js
CHANGED
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
* through which a plugin's `register` contributes) and `getContributions` (what the
|
|
4
|
-
* shell reads) live here, apart from the plugin surface, so the served plugin asset
|
|
5
|
-
* carries no way to forge, wipe, or enumerate the registry. Only the host bundle
|
|
6
|
-
* imports this. See SECURITY.md for the trust boundary.
|
|
7
|
-
*/
|
|
8
|
-
export { loadPlugin, getContributions } from './plugin/registry';
|
|
9
|
-
export { setPluginHostState, getPluginHostState, subscribePluginHost, usePluginContributions, } from './plugin/host-state';
|
|
1
|
+
export { getPluginHostState, setPluginHostState, subscribePluginHost, usePluginContributions, } from './plugin/host-state';
|
|
2
|
+
export { getContributions, loadPlugin } from './plugin/registry';
|
|
10
3
|
//# sourceMappingURL=host.js.map
|
package/dist/host.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"host.js","sourceRoot":"","sources":["../src/host.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"host.js","sourceRoot":"","sources":["../src/host.ts"],"names":[],"mappings":"AAYA,OAAO,EACL,kBAAkB,EAClB,kBAAkB,EAClB,mBAAmB,EACnB,sBAAsB,GACvB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC"}
|