@contractspec/example.policy-safe-knowledge-assistant 3.7.6 → 3.7.10

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.
@@ -21,7 +21,7 @@ Bundled 14 modules in 47ms
21
21
  ./policy-safe-knowledge-assistant.feature.js 2.67 KB (entry point)
22
22
 
23
23
  [contractspec-bun-build] transpile target=node root=src entries=14 noBundle=false
24
- Bundled 14 modules in 40ms
24
+ Bundled 14 modules in 37ms
25
25
 
26
26
  docs/index.js 1.85 KB (entry point)
27
27
  seeders/index.js 506 bytes (entry point)
@@ -39,7 +39,7 @@ Bundled 14 modules in 40ms
39
39
  ./policy-safe-knowledge-assistant.feature.js 2.66 KB (entry point)
40
40
 
41
41
  [contractspec-bun-build] transpile target=browser root=src entries=14 noBundle=false
42
- Bundled 14 modules in 39ms
42
+ Bundled 14 modules in 69ms
43
43
 
44
44
  docs/index.js 1.85 KB (entry point)
45
45
  seeders/index.js 506 bytes (entry point)
package/AGENTS.md CHANGED
@@ -1,35 +1,59 @@
1
- # AI Agent Guide -- `@contractspec/example.policy-safe-knowledge-assistant`
1
+ # AI Agent Guide `@contractspec/example.policy-safe-knowledge-assistant`
2
2
 
3
3
  Scope: `packages/examples/policy-safe-knowledge-assistant/*`
4
4
 
5
- All-in-one template: policy-safe knowledge assistant with locale/jurisdiction gating, versioned KB snapshots, HITL update pipeline, and learning hub.
5
+ All-in-one template example: policy-safe knowledge assistant with locale/jurisdiction gating, versioned KB snapshots, HITL update pipeline, and learning hub.
6
6
 
7
7
  ## Quick Context
8
8
 
9
- - **Layer**: example
10
- - **Related Packages**: `example.kb-update-pipeline`, `example.learning-patterns`, `example.locale-jurisdiction-gate`, `example.versioned-knowledge-base`, `lib.contracts-spec`, `lib.design-system`, `lib.example-shared-ui`, `lib.runtime-sandbox`, `lib.ui-kit-web`, `module.learning-journey`
11
-
12
- ## What This Demonstrates
13
-
14
- - Composition of multiple example packages into a full-stack assistant
15
- - Orchestrator pattern (`buildAnswer`) for policy-gated responses
16
- - React dashboard with hooks and UI components
17
- - Seed data and fixture patterns
18
- - Feature definition aggregating sub-features
19
-
20
- ## Public Exports
21
-
22
- - `.` -- root barrel
23
- - `./orchestrator/buildAnswer` -- answer orchestration
24
- - `./handlers` -- assistant handlers
25
- - `./seed`, `./seeders` -- fixtures and seed data
26
- - `./ui` -- PolicySafeKnowledgeAssistantDashboard, hooks
27
- - `./policy-safe-knowledge-assistant.feature`
28
- - `./docs`, `./example`
9
+ - Layer: `example`.
10
+ - Package visibility: published package.
11
+ - Primary consumers are example explorers, template authors, and documentation readers.
12
+ - Related packages: `@contractspec/example.kb-update-pipeline`, `@contractspec/example.learning-patterns`, `@contractspec/example.locale-jurisdiction-gate`, `@contractspec/example.versioned-knowledge-base`, `@contractspec/lib.contracts-spec`, `@contractspec/lib.design-system`, ...
13
+
14
+ ## Architecture
15
+
16
+ - `src/docs/` contains docblocks and documentation-facing exports.
17
+ - `src/example.ts` is the runnable example entrypoint.
18
+ - `src/handlers/` contains handlers or demo adapters wired to contract surfaces.
19
+ - `src/index.ts` is the root public barrel and package entrypoint.
20
+ - `src/integration.test.ts` is part of the package's public or composition surface.
21
+ - `src/orchestrator` is part of the package's public or composition surface.
22
+ - `src/policy-safe-knowledge-assistant.feature.ts` defines a feature entrypoint.
23
+
24
+ ## Public Surface
25
+
26
+ - Export `.` resolves through `./src/index.ts`.
27
+ - Export `./docs` resolves through `./src/docs/index.ts`.
28
+ - Export `./docs/policy-safe-knowledge-assistant.docblock` resolves through `./src/docs/policy-safe-knowledge-assistant.docblock.ts`.
29
+ - Export `./example` resolves through `./src/example.ts`.
30
+ - Export `./handlers` resolves through `./src/handlers/index.ts`.
31
+ - Export `./handlers/policy-safe-knowledge-assistant.handlers` resolves through `./src/handlers/policy-safe-knowledge-assistant.handlers.ts`.
32
+ - Export `./orchestrator/buildAnswer` resolves through `./src/orchestrator/buildAnswer.ts`.
33
+ - Export `./policy-safe-knowledge-assistant.feature` resolves through `./src/policy-safe-knowledge-assistant.feature.ts`.
34
+ - Export `./seed` resolves through `./src/seed/index.ts`.
35
+ - Export `./seed/fixtures` resolves through `./src/seed/fixtures.ts`.
36
+ - The package publishes 14 total export subpaths; keep docs aligned with `package.json`.
37
+
38
+ ## Guardrails
39
+
40
+ - Keep the example package demonstrative, buildable, and aligned with the exported feature surface.
41
+ - Do not add hidden production assumptions that are not actually implemented in the example.
42
+ - Changes here can affect downstream packages such as `@contractspec/example.kb-update-pipeline`, `@contractspec/example.learning-patterns`, `@contractspec/example.locale-jurisdiction-gate`, `@contractspec/example.versioned-knowledge-base`, `@contractspec/lib.contracts-spec`, `@contractspec/lib.design-system`, ....
43
+ - Changes here can affect downstream packages such as `@contractspec/example.kb-update-pipeline`, `@contractspec/example.learning-patterns`, `@contractspec/example.locale-jurisdiction-gate`, `@contractspec/example.versioned-knowledge-base`, `@contractspec/lib.contracts-spec`, `@contractspec/lib.design-system`, ...
29
44
 
30
45
  ## Local Commands
31
46
 
32
- - Build: `bun run build`
33
- - Dev: `bun run dev`
34
- - Test: `bun test`
35
- - Typecheck: `bun run typecheck`
47
+ - `bun run dev` — contractspec-bun-build dev
48
+ - `bun run build`bun run prebuild && bun run build:bundle && bun run build:types
49
+ - `bun run test`bun test
50
+ - `bun run lint` — bun lint:fix
51
+ - `bun run lint:check` — biome check .
52
+ - `bun run lint:fix` — biome check --write --unsafe --only=nursery/useSortedClasses . && biome check --write .
53
+ - `bun run typecheck` — tsc --noEmit
54
+ - `bun run publish:pkg` — bun publish --tolerate-republish --ignore-scripts --verbose
55
+ - `bun run publish:pkg:canary` — bun publish:pkg --tag canary
56
+ - `bun run clean` — rimraf dist .turbo
57
+ - `bun run build:bundle` — contractspec-bun-build transpile
58
+ - `bun run build:types` — contractspec-bun-build types
59
+ - `bun run prebuild` — contractspec-bun-build prebuild
package/CHANGELOG.md CHANGED
@@ -1,5 +1,39 @@
1
1
  # @contractspec/example.policy-safe-knowledge-assistant
2
2
 
3
+ ## 3.7.10
4
+
5
+ ### Patch Changes
6
+
7
+ - 1a44cb6: feat: improve examples to increase coverage of Contracts type
8
+ - Updated dependencies [1a44cb6]
9
+ - @contractspec/example.locale-jurisdiction-gate@3.7.10
10
+ - @contractspec/example.versioned-knowledge-base@3.7.10
11
+ - @contractspec/example.kb-update-pipeline@3.7.10
12
+ - @contractspec/example.learning-patterns@3.7.10
13
+ - @contractspec/module.learning-journey@3.7.10
14
+ - @contractspec/lib.example-shared-ui@6.0.10
15
+ - @contractspec/lib.runtime-sandbox@2.7.9
16
+ - @contractspec/lib.contracts-spec@4.1.2
17
+ - @contractspec/lib.design-system@3.8.3
18
+ - @contractspec/lib.ui-kit-web@3.9.2
19
+
20
+ ## 3.7.9
21
+
22
+ ### Patch Changes
23
+
24
+ - fix: release
25
+ - Updated dependencies
26
+ - @contractspec/example.locale-jurisdiction-gate@3.7.9
27
+ - @contractspec/example.versioned-knowledge-base@3.7.9
28
+ - @contractspec/example.kb-update-pipeline@3.7.9
29
+ - @contractspec/example.learning-patterns@3.7.9
30
+ - @contractspec/module.learning-journey@3.7.9
31
+ - @contractspec/lib.example-shared-ui@6.0.9
32
+ - @contractspec/lib.runtime-sandbox@2.7.8
33
+ - @contractspec/lib.contracts-spec@4.1.1
34
+ - @contractspec/lib.design-system@3.8.2
35
+ - @contractspec/lib.ui-kit-web@3.9.1
36
+
3
37
  ## 3.7.6
4
38
 
5
39
  ### Patch Changes
@@ -1183,14 +1217,17 @@
1183
1217
  feat: Contract layers support (features, examples, app-configs)
1184
1218
 
1185
1219
  ### New CLI Commands
1220
+
1186
1221
  - `contractspec list layers` - List all contract layers with filtering
1187
1222
 
1188
1223
  ### Enhanced Commands
1224
+
1189
1225
  - `contractspec ci` - New `layers` check category validates features/examples/config
1190
1226
  - `contractspec doctor` - New `layers` health checks
1191
1227
  - `contractspec integrity` - Now shows layer statistics
1192
1228
 
1193
1229
  ### New APIs
1230
+
1194
1231
  - `discoverLayers()` - Scan workspace for all layer files
1195
1232
  - `scanExampleSource()` - Parse ExampleSpec from source code
1196
1233
  - `isExampleFile()` - Check if file is an example spec
package/README.md CHANGED
@@ -1,22 +1,75 @@
1
- # `@contractspec/example.policy-safe-knowledge-assistant`
1
+ # @contractspec/example.policy-safe-knowledge-assistant
2
2
 
3
- Website: https://contractspec.io/
3
+ Website: https://contractspec.io
4
4
 
5
+ **All-in-one template example: policy-safe knowledge assistant with locale/jurisdiction gating, versioned KB snapshots, HITL update pipeline, and learning hub.**
5
6
 
6
- All-in-one template example demonstrating a **policy-safe knowledge assistant** end-to-end:
7
+ ## What This Demonstrates
7
8
 
8
- - Locale + jurisdiction gating (fail-closed)
9
- - Versioned curated KB + published snapshots
10
- - Automated KB update pipeline with HITL review + traceability
11
- - Learning hub (drills, ambient coach, quests)
12
- - Cross-cutting modules wired: identity/RBAC, audit trail, notifications, jobs, feature flags, files, metering, learning journey
9
+ - Composition of multiple example packages into a full-stack assistant.
10
+ - Orchestrator pattern (`buildAnswer`) for policy-gated responses.
11
+ - React dashboard with hooks and UI components.
12
+ - Seed data and fixture patterns.
13
+ - Feature definition aggregating sub-features.
14
+ - `src/docs/` contains docblocks and documentation-facing exports.
13
15
 
14
- This package is the **spec-first** source of truth. The sandbox UI/runtime integration lives in `@contractspec/bundle.studio`.
16
+ ## Running Locally
15
17
 
16
- ## Seed scenario
17
- See `src/seed/fixtures.ts` for deterministic offline fixtures (no web dependencies).
18
+ From `packages/examples/policy-safe-knowledge-assistant`:
19
+ - `bun run dev`
20
+ - `bun run build`
21
+ - `bun run test`
22
+ - `bun run typecheck`
18
23
 
19
- ## Running tests
20
- ```bash
21
- bun test
22
- ```
24
+ ## Usage
25
+
26
+ Use `@contractspec/example.policy-safe-knowledge-assistant` as a reference implementation, or import its exported surfaces into a workspace that composes ContractSpec examples and bundles.
27
+
28
+ ## Architecture
29
+
30
+ - `src/docs/` contains docblocks and documentation-facing exports.
31
+ - `src/example.ts` is the runnable example entrypoint.
32
+ - `src/handlers/` contains handlers or demo adapters wired to contract surfaces.
33
+ - `src/index.ts` is the root public barrel and package entrypoint.
34
+ - `src/integration.test.ts` is part of the package's public or composition surface.
35
+ - `src/orchestrator` is part of the package's public or composition surface.
36
+ - `src/policy-safe-knowledge-assistant.feature.ts` defines a feature entrypoint.
37
+
38
+ ## Public Entry Points
39
+
40
+ - Export `.` resolves through `./src/index.ts`.
41
+ - Export `./docs` resolves through `./src/docs/index.ts`.
42
+ - Export `./docs/policy-safe-knowledge-assistant.docblock` resolves through `./src/docs/policy-safe-knowledge-assistant.docblock.ts`.
43
+ - Export `./example` resolves through `./src/example.ts`.
44
+ - Export `./handlers` resolves through `./src/handlers/index.ts`.
45
+ - Export `./handlers/policy-safe-knowledge-assistant.handlers` resolves through `./src/handlers/policy-safe-knowledge-assistant.handlers.ts`.
46
+ - Export `./orchestrator/buildAnswer` resolves through `./src/orchestrator/buildAnswer.ts`.
47
+ - Export `./policy-safe-knowledge-assistant.feature` resolves through `./src/policy-safe-knowledge-assistant.feature.ts`.
48
+ - Export `./seed` resolves through `./src/seed/index.ts`.
49
+ - Export `./seed/fixtures` resolves through `./src/seed/fixtures.ts`.
50
+ - The package publishes 14 total export subpaths; keep docs aligned with `package.json`.
51
+
52
+ ## Local Commands
53
+
54
+ - `bun run dev` — contractspec-bun-build dev
55
+ - `bun run build` — bun run prebuild && bun run build:bundle && bun run build:types
56
+ - `bun run test` — bun test
57
+ - `bun run lint` — bun lint:fix
58
+ - `bun run lint:check` — biome check .
59
+ - `bun run lint:fix` — biome check --write --unsafe --only=nursery/useSortedClasses . && biome check --write .
60
+ - `bun run typecheck` — tsc --noEmit
61
+ - `bun run publish:pkg` — bun publish --tolerate-republish --ignore-scripts --verbose
62
+ - `bun run publish:pkg:canary` — bun publish:pkg --tag canary
63
+ - `bun run clean` — rimraf dist .turbo
64
+ - `bun run build:bundle` — contractspec-bun-build transpile
65
+ - `bun run build:types` — contractspec-bun-build types
66
+ - `bun run prebuild` — contractspec-bun-build prebuild
67
+
68
+ ## Recent Updates
69
+
70
+ - Replace eslint+prettier by biomejs to optimize speed.
71
+ - Missing contract layers.
72
+
73
+ ## Notes
74
+
75
+ - Works alongside `@contractspec/example.kb-update-pipeline`, `@contractspec/example.learning-patterns`, `@contractspec/example.locale-jurisdiction-gate`, `@contractspec/example.versioned-knowledge-base`, `@contractspec/lib.contracts-spec`, ...
@@ -498,8 +498,8 @@ var DEMO_FIXTURES = {
498
498
  }
499
499
  };
500
500
  // src/ui/hooks/usePolicySafeKnowledgeAssistant.ts
501
- import { useCallback, useEffect, useMemo, useState } from "react";
502
501
  import { useTemplateRuntime } from "@contractspec/lib.example-shared-ui";
502
+ import { useCallback, useEffect, useMemo, useState } from "react";
503
503
  "use client";
504
504
  function isCitationLike(value) {
505
505
  if (!value || typeof value !== "object")
@@ -650,7 +650,6 @@ function usePolicySafeKnowledgeAssistant() {
650
650
  }
651
651
 
652
652
  // src/ui/PolicySafeKnowledgeAssistantDashboard.tsx
653
- import { useCallback as useCallback2, useMemo as useMemo2, useState as useState2 } from "react";
654
653
  import {
655
654
  Button,
656
655
  ErrorState,
@@ -660,7 +659,6 @@ import {
660
659
  } from "@contractspec/lib.design-system";
661
660
  import { Card } from "@contractspec/lib.ui-kit-web/ui/card";
662
661
  import { Input } from "@contractspec/lib.ui-kit-web/ui/input";
663
- import { Textarea } from "@contractspec/lib.ui-kit-web/ui/textarea";
664
662
  import {
665
663
  Select,
666
664
  SelectContent,
@@ -668,6 +666,8 @@ import {
668
666
  SelectTrigger,
669
667
  SelectValue
670
668
  } from "@contractspec/lib.ui-kit-web/ui/select";
669
+ import { Textarea } from "@contractspec/lib.ui-kit-web/ui/textarea";
670
+ import { useCallback as useCallback2, useMemo as useMemo2, useState as useState2 } from "react";
671
671
  import { jsxDEV } from "react/jsx-dev-runtime";
672
672
  "use client";
673
673
  function PolicySafeKnowledgeAssistantDashboard() {
@@ -730,7 +730,7 @@ function PolicySafeKnowledgeAssistantDashboard() {
730
730
  className: "p-4",
731
731
  children: [
732
732
  /* @__PURE__ */ jsxDEV("h3", {
733
- className: "text-lg font-semibold",
733
+ className: "font-semibold text-lg",
734
734
  children: "1) Onboarding (explicit locale + jurisdiction)"
735
735
  }, undefined, false, undefined, this),
736
736
  /* @__PURE__ */ jsxDEV("div", {
@@ -739,7 +739,7 @@ function PolicySafeKnowledgeAssistantDashboard() {
739
739
  /* @__PURE__ */ jsxDEV("div", {
740
740
  children: [
741
741
  /* @__PURE__ */ jsxDEV("div", {
742
- className: "text-muted-foreground mb-1 text-xs font-semibold tracking-wide uppercase",
742
+ className: "mb-1 font-semibold text-muted-foreground text-xs uppercase tracking-wide",
743
743
  children: "Locale"
744
744
  }, undefined, false, undefined, this),
745
745
  /* @__PURE__ */ jsxDEV(Input, {
@@ -751,7 +751,7 @@ function PolicySafeKnowledgeAssistantDashboard() {
751
751
  /* @__PURE__ */ jsxDEV("div", {
752
752
  children: [
753
753
  /* @__PURE__ */ jsxDEV("div", {
754
- className: "text-muted-foreground mb-1 text-xs font-semibold tracking-wide uppercase",
754
+ className: "mb-1 font-semibold text-muted-foreground text-xs uppercase tracking-wide",
755
755
  children: "Jurisdiction"
756
756
  }, undefined, false, undefined, this),
757
757
  /* @__PURE__ */ jsxDEV(Input, {
@@ -763,7 +763,7 @@ function PolicySafeKnowledgeAssistantDashboard() {
763
763
  /* @__PURE__ */ jsxDEV("div", {
764
764
  children: [
765
765
  /* @__PURE__ */ jsxDEV("div", {
766
- className: "text-muted-foreground mb-1 text-xs font-semibold tracking-wide uppercase",
766
+ className: "mb-1 font-semibold text-muted-foreground text-xs uppercase tracking-wide",
767
767
  children: "Allowed scope"
768
768
  }, undefined, false, undefined, this),
769
769
  /* @__PURE__ */ jsxDEV(Select, {
@@ -817,7 +817,7 @@ function PolicySafeKnowledgeAssistantDashboard() {
817
817
  className: "p-4",
818
818
  children: [
819
819
  /* @__PURE__ */ jsxDEV("h3", {
820
- className: "text-lg font-semibold",
820
+ className: "font-semibold text-lg",
821
821
  children: "2) Ask the assistant (must cite KB snapshot)"
822
822
  }, undefined, false, undefined, this),
823
823
  /* @__PURE__ */ jsxDEV("div", {
@@ -840,7 +840,7 @@ function PolicySafeKnowledgeAssistantDashboard() {
840
840
  className: "mt-4 space-y-3",
841
841
  children: [
842
842
  state.lastAnswer.refused ? /* @__PURE__ */ jsxDEV("div", {
843
- className: "text-sm text-red-600",
843
+ className: "text-red-600 text-sm",
844
844
  children: [
845
845
  "Refused: ",
846
846
  state.lastAnswer.refusalReason ?? "UNKNOWN"
@@ -849,7 +849,7 @@ function PolicySafeKnowledgeAssistantDashboard() {
849
849
  state.lastAnswer.sections.map((s, idx) => /* @__PURE__ */ jsxDEV("div", {
850
850
  children: [
851
851
  /* @__PURE__ */ jsxDEV("div", {
852
- className: "text-sm font-semibold",
852
+ className: "font-semibold text-sm",
853
853
  children: s.heading
854
854
  }, undefined, false, undefined, this),
855
855
  /* @__PURE__ */ jsxDEV("div", {
@@ -859,11 +859,11 @@ function PolicySafeKnowledgeAssistantDashboard() {
859
859
  ]
860
860
  }, `${s.heading}-${idx}`, true, undefined, this)),
861
861
  /* @__PURE__ */ jsxDEV("div", {
862
- className: "text-sm font-semibold",
862
+ className: "font-semibold text-sm",
863
863
  children: "Citations"
864
864
  }, undefined, false, undefined, this),
865
865
  /* @__PURE__ */ jsxDEV("ul", {
866
- className: "text-muted-foreground list-disc pl-5 text-sm",
866
+ className: "list-disc pl-5 text-muted-foreground text-sm",
867
867
  children: state.lastAnswer.citations.map((c) => /* @__PURE__ */ jsxDEV("li", {
868
868
  children: [
869
869
  c.kbSnapshotId,
@@ -880,7 +880,7 @@ function PolicySafeKnowledgeAssistantDashboard() {
880
880
  className: "p-4",
881
881
  children: [
882
882
  /* @__PURE__ */ jsxDEV("h3", {
883
- className: "text-lg font-semibold",
883
+ className: "font-semibold text-lg",
884
884
  children: "3) Admin: publish a new snapshot (HITL)"
885
885
  }, undefined, false, undefined, this),
886
886
  /* @__PURE__ */ jsxDEV("div", {
@@ -902,11 +902,11 @@ function PolicySafeKnowledgeAssistantDashboard() {
902
902
  className: "p-4",
903
903
  children: [
904
904
  /* @__PURE__ */ jsxDEV("h3", {
905
- className: "text-lg font-semibold",
905
+ className: "font-semibold text-lg",
906
906
  children: "4) Learning hub (patterns)"
907
907
  }, undefined, false, undefined, this),
908
908
  /* @__PURE__ */ jsxDEV("p", {
909
- className: "text-muted-foreground mt-2 text-sm",
909
+ className: "mt-2 text-muted-foreground text-sm",
910
910
  children: "This template includes drills, ambient coach, and quests as reusable Learning Journey tracks. The interactive learning UI is demonstrated in dedicated Learning Journey examples."
911
911
  }, undefined, false, undefined, this)
912
912
  ]
@@ -1,6 +1,6 @@
1
1
  // src/ui/hooks/usePolicySafeKnowledgeAssistant.ts
2
- import { useCallback, useEffect, useMemo, useState } from "react";
3
2
  import { useTemplateRuntime } from "@contractspec/lib.example-shared-ui";
3
+ import { useCallback, useEffect, useMemo, useState } from "react";
4
4
  "use client";
5
5
  function isCitationLike(value) {
6
6
  if (!value || typeof value !== "object")
@@ -151,7 +151,6 @@ function usePolicySafeKnowledgeAssistant() {
151
151
  }
152
152
 
153
153
  // src/ui/PolicySafeKnowledgeAssistantDashboard.tsx
154
- import { useCallback as useCallback2, useMemo as useMemo2, useState as useState2 } from "react";
155
154
  import {
156
155
  Button,
157
156
  ErrorState,
@@ -161,7 +160,6 @@ import {
161
160
  } from "@contractspec/lib.design-system";
162
161
  import { Card } from "@contractspec/lib.ui-kit-web/ui/card";
163
162
  import { Input } from "@contractspec/lib.ui-kit-web/ui/input";
164
- import { Textarea } from "@contractspec/lib.ui-kit-web/ui/textarea";
165
163
  import {
166
164
  Select,
167
165
  SelectContent,
@@ -169,6 +167,8 @@ import {
169
167
  SelectTrigger,
170
168
  SelectValue
171
169
  } from "@contractspec/lib.ui-kit-web/ui/select";
170
+ import { Textarea } from "@contractspec/lib.ui-kit-web/ui/textarea";
171
+ import { useCallback as useCallback2, useMemo as useMemo2, useState as useState2 } from "react";
172
172
  import { jsxDEV } from "react/jsx-dev-runtime";
173
173
  "use client";
174
174
  function PolicySafeKnowledgeAssistantDashboard() {
@@ -231,7 +231,7 @@ function PolicySafeKnowledgeAssistantDashboard() {
231
231
  className: "p-4",
232
232
  children: [
233
233
  /* @__PURE__ */ jsxDEV("h3", {
234
- className: "text-lg font-semibold",
234
+ className: "font-semibold text-lg",
235
235
  children: "1) Onboarding (explicit locale + jurisdiction)"
236
236
  }, undefined, false, undefined, this),
237
237
  /* @__PURE__ */ jsxDEV("div", {
@@ -240,7 +240,7 @@ function PolicySafeKnowledgeAssistantDashboard() {
240
240
  /* @__PURE__ */ jsxDEV("div", {
241
241
  children: [
242
242
  /* @__PURE__ */ jsxDEV("div", {
243
- className: "text-muted-foreground mb-1 text-xs font-semibold tracking-wide uppercase",
243
+ className: "mb-1 font-semibold text-muted-foreground text-xs uppercase tracking-wide",
244
244
  children: "Locale"
245
245
  }, undefined, false, undefined, this),
246
246
  /* @__PURE__ */ jsxDEV(Input, {
@@ -252,7 +252,7 @@ function PolicySafeKnowledgeAssistantDashboard() {
252
252
  /* @__PURE__ */ jsxDEV("div", {
253
253
  children: [
254
254
  /* @__PURE__ */ jsxDEV("div", {
255
- className: "text-muted-foreground mb-1 text-xs font-semibold tracking-wide uppercase",
255
+ className: "mb-1 font-semibold text-muted-foreground text-xs uppercase tracking-wide",
256
256
  children: "Jurisdiction"
257
257
  }, undefined, false, undefined, this),
258
258
  /* @__PURE__ */ jsxDEV(Input, {
@@ -264,7 +264,7 @@ function PolicySafeKnowledgeAssistantDashboard() {
264
264
  /* @__PURE__ */ jsxDEV("div", {
265
265
  children: [
266
266
  /* @__PURE__ */ jsxDEV("div", {
267
- className: "text-muted-foreground mb-1 text-xs font-semibold tracking-wide uppercase",
267
+ className: "mb-1 font-semibold text-muted-foreground text-xs uppercase tracking-wide",
268
268
  children: "Allowed scope"
269
269
  }, undefined, false, undefined, this),
270
270
  /* @__PURE__ */ jsxDEV(Select, {
@@ -318,7 +318,7 @@ function PolicySafeKnowledgeAssistantDashboard() {
318
318
  className: "p-4",
319
319
  children: [
320
320
  /* @__PURE__ */ jsxDEV("h3", {
321
- className: "text-lg font-semibold",
321
+ className: "font-semibold text-lg",
322
322
  children: "2) Ask the assistant (must cite KB snapshot)"
323
323
  }, undefined, false, undefined, this),
324
324
  /* @__PURE__ */ jsxDEV("div", {
@@ -341,7 +341,7 @@ function PolicySafeKnowledgeAssistantDashboard() {
341
341
  className: "mt-4 space-y-3",
342
342
  children: [
343
343
  state.lastAnswer.refused ? /* @__PURE__ */ jsxDEV("div", {
344
- className: "text-sm text-red-600",
344
+ className: "text-red-600 text-sm",
345
345
  children: [
346
346
  "Refused: ",
347
347
  state.lastAnswer.refusalReason ?? "UNKNOWN"
@@ -350,7 +350,7 @@ function PolicySafeKnowledgeAssistantDashboard() {
350
350
  state.lastAnswer.sections.map((s, idx) => /* @__PURE__ */ jsxDEV("div", {
351
351
  children: [
352
352
  /* @__PURE__ */ jsxDEV("div", {
353
- className: "text-sm font-semibold",
353
+ className: "font-semibold text-sm",
354
354
  children: s.heading
355
355
  }, undefined, false, undefined, this),
356
356
  /* @__PURE__ */ jsxDEV("div", {
@@ -360,11 +360,11 @@ function PolicySafeKnowledgeAssistantDashboard() {
360
360
  ]
361
361
  }, `${s.heading}-${idx}`, true, undefined, this)),
362
362
  /* @__PURE__ */ jsxDEV("div", {
363
- className: "text-sm font-semibold",
363
+ className: "font-semibold text-sm",
364
364
  children: "Citations"
365
365
  }, undefined, false, undefined, this),
366
366
  /* @__PURE__ */ jsxDEV("ul", {
367
- className: "text-muted-foreground list-disc pl-5 text-sm",
367
+ className: "list-disc pl-5 text-muted-foreground text-sm",
368
368
  children: state.lastAnswer.citations.map((c) => /* @__PURE__ */ jsxDEV("li", {
369
369
  children: [
370
370
  c.kbSnapshotId,
@@ -381,7 +381,7 @@ function PolicySafeKnowledgeAssistantDashboard() {
381
381
  className: "p-4",
382
382
  children: [
383
383
  /* @__PURE__ */ jsxDEV("h3", {
384
- className: "text-lg font-semibold",
384
+ className: "font-semibold text-lg",
385
385
  children: "3) Admin: publish a new snapshot (HITL)"
386
386
  }, undefined, false, undefined, this),
387
387
  /* @__PURE__ */ jsxDEV("div", {
@@ -403,11 +403,11 @@ function PolicySafeKnowledgeAssistantDashboard() {
403
403
  className: "p-4",
404
404
  children: [
405
405
  /* @__PURE__ */ jsxDEV("h3", {
406
- className: "text-lg font-semibold",
406
+ className: "font-semibold text-lg",
407
407
  children: "4) Learning hub (patterns)"
408
408
  }, undefined, false, undefined, this),
409
409
  /* @__PURE__ */ jsxDEV("p", {
410
- className: "text-muted-foreground mt-2 text-sm",
410
+ className: "mt-2 text-muted-foreground text-sm",
411
411
  children: "This template includes drills, ambient coach, and quests as reusable Learning Journey tracks. The interactive learning UI is demonstrated in dedicated Learning Journey examples."
412
412
  }, undefined, false, undefined, this)
413
413
  ]
@@ -1,6 +1,6 @@
1
1
  // src/ui/hooks/usePolicySafeKnowledgeAssistant.ts
2
- import { useCallback, useEffect, useMemo, useState } from "react";
3
2
  import { useTemplateRuntime } from "@contractspec/lib.example-shared-ui";
3
+ import { useCallback, useEffect, useMemo, useState } from "react";
4
4
  "use client";
5
5
  function isCitationLike(value) {
6
6
  if (!value || typeof value !== "object")