create-nisc 0.8.1 → 0.8.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (163) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/README.md +89 -13
  3. package/dist/chunk-B3L4UJDN.js +316 -0
  4. package/dist/chunk-B3L4UJDN.js.map +1 -0
  5. package/dist/cli.js +86 -42
  6. package/dist/cli.js.map +1 -1
  7. package/dist/index.d.ts +61 -6
  8. package/dist/index.js +1 -1
  9. package/package.json +1 -1
  10. package/templates/base/files/src/ui/kit.css +232 -0
  11. package/templates/base/item.json +31 -0
  12. package/templates/{moss-dom → classic/files}/src/app/actions/surfaces/welcome.action.ts +1 -1
  13. package/templates/classic/item.json +32 -0
  14. package/templates/{moss-dom → dom/files}/index.html +1 -1
  15. package/templates/dom/files/src/ui/kit.ts +109 -0
  16. package/templates/{shell-dom → dom/files}/src/ui/registry.ts +2 -2
  17. package/templates/{shell-dom → dom/files}/tsconfig.json +3 -14
  18. package/templates/dom/item.json +24 -0
  19. package/templates/model-first/agents-section.md +42 -0
  20. package/templates/model-first/files/src/app/action-catalog.ts +10 -0
  21. package/templates/model-first/files/src/app/actions/answer/text.action.ts +17 -0
  22. package/templates/model-first/files/src/app/actions/answer/text.layout.ts +3 -0
  23. package/templates/model-first/files/src/app/actions/ask/dock.action.ts +58 -0
  24. package/templates/model-first/files/src/app/actions/ask/dock.layout.ts +59 -0
  25. package/templates/model-first/files/src/app/actions/guide/checklist.action.ts +24 -0
  26. package/templates/model-first/files/src/app/actions/guide/checklist.layout.ts +17 -0
  27. package/templates/model-first/files/src/app/actions/guide/counter.action.ts +22 -0
  28. package/templates/model-first/files/src/app/actions/guide/counter.layout.ts +19 -0
  29. package/templates/model-first/files/src/app/actions/guide/guide.actions.ts +144 -0
  30. package/templates/model-first/files/src/app/actions/guide/guide.layouts.ts +31 -0
  31. package/templates/model-first/files/src/app/actions/guide/quiz.action.ts +25 -0
  32. package/templates/model-first/files/src/app/actions/guide/quiz.layout.ts +33 -0
  33. package/templates/model-first/files/src/app/app.ts +11 -0
  34. package/templates/model-first/files/src/app/arrangements.ts +17 -0
  35. package/templates/model-first/files/src/app/charter/assignments.ts +1 -0
  36. package/templates/model-first/files/src/app/charter/charter.ts +10 -0
  37. package/templates/model-first/files/src/app/screens.ts +87 -0
  38. package/templates/model-first/files/src/app/shell/areas.ts +3 -0
  39. package/templates/model-first/files/src/app/shell/frame.layout.ts +6 -0
  40. package/templates/model-first/files/src/app/shell/shell.ts +20 -0
  41. package/templates/model-first/files/src/app/vex/index.ts +3 -0
  42. package/templates/model-first/files/src/db/schema.ts +3 -0
  43. package/templates/{moss-react → model-first/files}/src/dev/all-checks.ts +3 -2
  44. package/templates/model-first/files/src/dev/artifacts-check.ts +95 -0
  45. package/templates/model-first/files/src/dev/checks.ts +13 -0
  46. package/templates/model-first/files/src/dev/compose-check.ts +191 -0
  47. package/templates/model-first/files/src/dev/guide-check.ts +90 -0
  48. package/templates/model-first/files/src/dev/live-ask.ts +185 -0
  49. package/templates/model-first/files/src/dev/scripted.ts +208 -0
  50. package/templates/{shell-dom → model-first/files}/src/dev/strata.ts +7 -1
  51. package/templates/model-first/files/src/server/boot.ts +24 -0
  52. package/templates/model-first/files/src/server/compose/answer.ts +145 -0
  53. package/templates/model-first/files/src/server/compose/catalog.ts +46 -0
  54. package/templates/model-first/files/src/server/compose/composer.agent.ts +18 -0
  55. package/templates/model-first/files/src/server/compose/history.ts +45 -0
  56. package/templates/model-first/files/src/server/compose/index.ts +170 -0
  57. package/templates/model-first/files/src/server/compose/knowledge.ts +57 -0
  58. package/templates/model-first/files/src/server/compose/layout.ts +70 -0
  59. package/templates/model-first/files/src/server/compose/pick.ts +44 -0
  60. package/templates/model-first/files/src/server/compose/plan.ts +45 -0
  61. package/templates/model-first/files/src/server/compose/record.ts +3 -0
  62. package/templates/model-first/files/src/server/compose/reply.schema.ts +70 -0
  63. package/templates/model-first/files/src/server/compose/screen.ts +40 -0
  64. package/templates/model-first/files/src/server/models/index.ts +35 -0
  65. package/templates/model-first/files/src/server/runs/index.ts +20 -0
  66. package/templates/model-first/item.json +84 -0
  67. package/templates/{moss-dom → moss/files}/README.md +1 -1
  68. package/templates/moss/item.json +40 -0
  69. package/templates/{shell-dom → page/files}/README.md +1 -1
  70. package/templates/page/item.json +37 -0
  71. package/templates/questions.json +5 -0
  72. package/templates/{moss-react → react/files}/index.html +1 -1
  73. package/templates/react/files/src/ui/kit.tsx +221 -0
  74. package/templates/{moss-react → react/files}/src/ui/registry.ts +2 -2
  75. package/templates/react/item.json +31 -0
  76. package/dist/chunk-6FL5A3LS.js +0 -174
  77. package/dist/chunk-6FL5A3LS.js.map +0 -1
  78. package/templates/moss-dom/package.json +0 -39
  79. package/templates/moss-dom/src/app/actions/surfaces/welcome.layout.ts +0 -25
  80. package/templates/moss-dom/src/ui/kit.css +0 -42
  81. package/templates/moss-dom/src/ui/kit.ts +0 -35
  82. package/templates/moss-dom/src/ui/registry.ts +0 -15
  83. package/templates/moss-dom/tsconfig.json +0 -27
  84. package/templates/moss-react/README.md +0 -15
  85. package/templates/moss-react/nisc.config.ts +0 -11
  86. package/templates/moss-react/package.json +0 -42
  87. package/templates/moss-react/src/app/action-catalog.ts +0 -6
  88. package/templates/moss-react/src/app/actions/surfaces/welcome.action.ts +0 -10
  89. package/templates/moss-react/src/app/app.ts +0 -7
  90. package/templates/moss-react/src/app/charter/assignments.ts +0 -2
  91. package/templates/moss-react/src/app/charter/charter.ts +0 -5
  92. package/templates/moss-react/src/app/shell/frame.layout.ts +0 -3
  93. package/templates/moss-react/src/app/shell/shell.ts +0 -7
  94. package/templates/moss-react/src/dev/artifacts-check.ts +0 -49
  95. package/templates/moss-react/src/dev/strata.ts +0 -21
  96. package/templates/moss-react/src/dev/welcome-check.ts +0 -38
  97. package/templates/moss-react/src/server/boot.ts +0 -6
  98. package/templates/moss-react/src/server/runtime.ts +0 -13
  99. package/templates/moss-react/src/ui/kit.css +0 -42
  100. package/templates/moss-react/src/ui/kit.tsx +0 -39
  101. package/templates/moss-react/strata.lock.json +0 -6
  102. package/templates/shell-dom/index.html +0 -12
  103. package/templates/shell-dom/package.json +0 -35
  104. package/templates/shell-dom/src/app/action-catalog.ts +0 -6
  105. package/templates/shell-dom/src/app/actions/surfaces/welcome.action.ts +0 -10
  106. package/templates/shell-dom/src/app/actions/surfaces/welcome.layout.ts +0 -32
  107. package/templates/shell-dom/src/app/shell/frame.layout.ts +0 -3
  108. package/templates/shell-dom/src/ui/kit.css +0 -42
  109. package/templates/shell-dom/src/ui/kit.ts +0 -35
  110. package/templates/shell-dom/strata.lock.json +0 -6
  111. package/templates/shell-dom/vite.config.ts +0 -5
  112. package/templates/shell-react/README.md +0 -16
  113. package/templates/shell-react/index.html +0 -12
  114. package/templates/shell-react/package.json +0 -40
  115. package/templates/shell-react/src/app/action-catalog.ts +0 -6
  116. package/templates/shell-react/src/app/actions/surfaces/welcome.action.ts +0 -10
  117. package/templates/shell-react/src/app/shell/frame.layout.ts +0 -3
  118. package/templates/shell-react/src/app/shell/shell.ts +0 -7
  119. package/templates/shell-react/src/boot.ts +0 -13
  120. package/templates/shell-react/src/dev/all-checks.ts +0 -17
  121. package/templates/shell-react/src/dev/artifacts-check.ts +0 -45
  122. package/templates/shell-react/src/dev/strata.ts +0 -21
  123. package/templates/shell-react/src/dev/welcome-check.ts +0 -21
  124. package/templates/shell-react/src/ui/kit.css +0 -42
  125. package/templates/shell-react/src/ui/kit.tsx +0 -39
  126. package/templates/shell-react/src/ui/registry.ts +0 -12
  127. package/templates/shell-react/strata.lock.json +0 -6
  128. package/templates/shell-react/tsconfig.json +0 -28
  129. package/templates/shell-react/vite.config.ts +0 -8
  130. /package/templates/{moss-dom → base/files}/strata.lock.json +0 -0
  131. /package/templates/{moss-dom → classic/files}/src/app/action-catalog.ts +0 -0
  132. /package/templates/{moss-dom → classic/files}/src/app/shell/frame.layout.ts +0 -0
  133. /package/templates/{moss-dom → classic/files}/src/dev/strata.ts +0 -0
  134. /package/templates/{moss-react → classic/with/moss}/src/app/actions/surfaces/welcome.layout.ts +0 -0
  135. /package/templates/{moss-dom → classic/with/moss}/src/app/app.ts +0 -0
  136. /package/templates/{moss-dom → classic/with/moss}/src/app/charter/assignments.ts +0 -0
  137. /package/templates/{moss-dom → classic/with/moss}/src/app/charter/charter.ts +0 -0
  138. /package/templates/{moss-dom → classic/with/moss}/src/app/shell/shell.ts +0 -0
  139. /package/templates/{moss-dom → classic/with/moss}/src/dev/all-checks.ts +0 -0
  140. /package/templates/{moss-dom → classic/with/moss}/src/dev/artifacts-check.ts +0 -0
  141. /package/templates/{moss-dom → classic/with/moss}/src/dev/welcome-check.ts +0 -0
  142. /package/templates/{moss-dom → classic/with/moss}/src/server/boot.ts +0 -0
  143. /package/templates/{shell-react → classic/with/page}/src/app/actions/surfaces/welcome.layout.ts +0 -0
  144. /package/templates/{shell-dom → classic/with/page}/src/app/shell/shell.ts +0 -0
  145. /package/templates/{shell-dom → classic/with/page}/src/boot.ts +0 -0
  146. /package/templates/{shell-dom → classic/with/page}/src/dev/all-checks.ts +0 -0
  147. /package/templates/{shell-dom → classic/with/page}/src/dev/artifacts-check.ts +0 -0
  148. /package/templates/{shell-dom → classic/with/page}/src/dev/welcome-check.ts +0 -0
  149. /package/templates/{moss-dom → dom/files}/vite.config.ts +0 -0
  150. /package/templates/{moss-dom → dom/with/moss}/src/main.ts +0 -0
  151. /package/templates/{moss-dom → dom/with/moss}/src/server/document.ts +0 -0
  152. /package/templates/{shell-dom → dom/with/page}/nisc.config.ts +0 -0
  153. /package/templates/{shell-dom → dom/with/page}/src/main.ts +0 -0
  154. /package/templates/{shell-dom → dom/with/page}/src/ui/screen.ts +0 -0
  155. /package/templates/{moss-dom → moss/files}/nisc.config.ts +0 -0
  156. /package/templates/{moss-dom → moss/files}/src/server/runtime.ts +0 -0
  157. /package/templates/{moss-react → react/files}/tsconfig.json +0 -0
  158. /package/templates/{moss-react → react/files}/vite.config.ts +0 -0
  159. /package/templates/{moss-react → react/with/moss}/src/main.tsx +0 -0
  160. /package/templates/{moss-react → react/with/moss}/src/server/document.ts +0 -0
  161. /package/templates/{shell-react → react/with/page}/nisc.config.ts +0 -0
  162. /package/templates/{shell-react → react/with/page}/src/main.tsx +0 -0
  163. /package/templates/{shell-react → react/with/page}/src/ui/screen.tsx +0 -0
@@ -0,0 +1,31 @@
1
+ import type { LayoutNode } from '@niscorp/nova';
2
+
3
+ const lead: LayoutNode = { component: 'Text', props: { tone: 'lead' }, children: '{{$.lead}}' };
4
+
5
+ const links: LayoutNode = {
6
+ if: '$.links',
7
+ then: { component: 'Row', children: [{ for: '$.links', as: 'link', do: { component: 'Button', ref: 'link', props: { label: '$link.label', tone: 'link', value: '$link.screen' } } }] },
8
+ };
9
+
10
+ const toAsk: LayoutNode = {
11
+ component: 'Row',
12
+ children: [{ for: '$.examples', as: 'example', do: { component: 'Button', ref: 'example', props: { label: '$example', tone: 'suggestion', value: '$example' } } }],
13
+ };
14
+
15
+ export const welcomeLayout: LayoutNode = {
16
+ component: 'Card',
17
+ props: { title: '{{$.title}}', tone: 'hero' },
18
+ children: [lead, links, { component: 'Text', props: { tone: 'muted' }, children: 'Or ask for something in the line below:' }, toAsk],
19
+ };
20
+
21
+ export const askLayout: LayoutNode = { component: 'Card', props: { title: '{{$.title}}' }, children: [lead, toAsk] };
22
+
23
+ export const pointsLayout: LayoutNode = { component: 'Card', props: { title: '{{$.title}}' }, children: [lead, { component: 'Points', props: { items: '$.points' } }, links] };
24
+
25
+ export const exampleLayout: LayoutNode = {
26
+ component: 'Card',
27
+ props: { title: '{{$.title}}' },
28
+ children: [lead, { component: 'Code', props: { text: '$.example' } }, { component: 'Text', props: { tone: 'muted' }, children: '{{$.text}}' }, links],
29
+ };
30
+
31
+ export const stepsLayout: LayoutNode = { component: 'Card', props: { title: '{{$.title}}' }, children: [lead, { component: 'Steps', props: { items: '$.steps' } }, links] };
@@ -0,0 +1,25 @@
1
+ import type { ActionDefinition } from '@niscorp/nova';
2
+ import { z } from 'zod';
3
+ import { quizLayout } from './quiz.layout';
4
+
5
+ export const quizAction: ActionDefinition = {
6
+ id: 'guide.quiz',
7
+ title: 'Quick check',
8
+ description: 'A question to check what was just read: a few options, one of them right; once a person picks, it shows which, and why.',
9
+ data: { title: 'Quick check', question: '', options: [], answer: 0, explanation: '', picked: -1 },
10
+ input: z.toJSONSchema(
11
+ z.object({
12
+ title: z.string().nullish().describe('A few words.'),
13
+ question: z.string().describe('One short question.'),
14
+ options: z.array(z.string()).min(2).max(4).describe('The options, each a few words.'),
15
+ answer: z.number().int().min(0).describe('Which option is right, counted from 0.'),
16
+ explanation: z.string().describe('Why that one is right, in one sentence.'),
17
+ picked: z.number().int().min(-1).nullish().describe('Which option the person picked, counted from 0; -1 while they have not.'),
18
+ }),
19
+ ),
20
+ layout: quizLayout,
21
+ triggers: [
22
+ { event: 'ui:click', ref: 'pick', do: [{ set: 'picked', value: '@event.payload' }] },
23
+ { event: 'ui:click', ref: 'again', do: [{ set: 'picked', value: -1 }] },
24
+ ],
25
+ };
@@ -0,0 +1,33 @@
1
+ import type { LayoutNode } from '@niscorp/nova';
2
+
3
+ const open = { $eq: ['$.picked', -1] };
4
+
5
+ const optionTone = {
6
+ $if: open,
7
+ $then: 'choice',
8
+ $else: { $if: { $eq: ['$index', '$.answer'] }, $then: 'right', $else: { $if: { $eq: ['$index', '$.picked'] }, $then: 'wrong', $else: 'choice' } },
9
+ };
10
+
11
+ export const quizLayout: LayoutNode = {
12
+ component: 'Card',
13
+ props: { title: '{{$.title}}' },
14
+ children: [
15
+ { component: 'Text', props: { tone: 'strong' }, children: '{{$.question}}' },
16
+ { for: '$.options', as: 'option', do: { component: 'Button', ref: 'pick', props: { label: '$option', tone: optionTone, value: '$index' } } },
17
+ {
18
+ if: open,
19
+ then: '',
20
+ else: {
21
+ component: 'Row',
22
+ children: [
23
+ {
24
+ if: { $eq: ['$.picked', '$.answer'] },
25
+ then: { component: 'Text', props: { tone: 'right' }, children: 'Right. {{$.explanation}}' },
26
+ else: { component: 'Text', props: { tone: 'wrong' }, children: 'Not quite. {{$.explanation}}' },
27
+ },
28
+ { component: 'Button', ref: 'again', props: { label: 'Try again', tone: 'step' } },
29
+ ],
30
+ },
31
+ },
32
+ ],
33
+ };
@@ -0,0 +1,11 @@
1
+ import { defineApp } from '@niscorp/moss';
2
+ import type { NiscApp, RunSink } from '@niscorp/moss';
3
+ import { actions } from './action-catalog';
4
+ import { assignments } from './charter/assignments';
5
+ import { charter } from './charter/charter';
6
+ import { shell } from './shell/shell';
7
+ import { ENTRIES } from './vex';
8
+
9
+ export type AppSeams = { functions: NonNullable<NiscApp['functions']>; runs: RunSink };
10
+
11
+ export const buildApp = (seams: AppSeams): NiscApp => defineApp({ charter, assignments, actions, entries: ENTRIES, shell, functions: seams.functions, runs: seams.runs });
@@ -0,0 +1,17 @@
1
+ import type { LayoutNode } from '@niscorp/nova';
2
+ import { AREAS } from './shell/areas';
3
+ import type { AreaId } from './shell/areas';
4
+
5
+ export type Arrangement = { id: string; description: string; areaCount: number; layout: LayoutNode };
6
+
7
+ const area = (name: AreaId, span = 1): LayoutNode => ({ component: 'Area', props: { name, span }, children: [{ component: 'CanvasSlot', props: { canvasId: name } }] });
8
+ const answers = (columns: number, areas: LayoutNode[]): LayoutNode => ({ component: 'Grid', props: { columns }, children: areas });
9
+
10
+ export const ARRANGEMENTS: readonly Arrangement[] = [
11
+ { id: 'single', description: 'One thing, the whole width.', areaCount: 1, layout: answers(1, [area('a')]) },
12
+ { id: 'pair', description: 'Two things side by side, to compare them.', areaCount: 2, layout: answers(2, [area('a'), area('b')]) },
13
+ { id: 'hero', description: 'One thing that matters most, the whole width, and the rest two to a row beneath it.', areaCount: 5, layout: answers(2, [area('a', 2), area('b'), area('c'), area('d'), area('e')]) },
14
+ { id: 'grid', description: 'Things of equal weight, two to a row.', areaCount: AREAS.length, layout: answers(2, AREAS.map((name) => area(name))) },
15
+ { id: 'trio', description: 'Three things of equal weight in one row.', areaCount: 3, layout: answers(3, [area('a'), area('b'), area('c')]) },
16
+ { id: 'strip', description: 'Everything one under the other, each the whole width, to read down.', areaCount: AREAS.length, layout: answers(1, AREAS.map((name) => area(name))) },
17
+ ];
@@ -0,0 +1 @@
1
+ export const assignments: Record<string, readonly string[]> = {};
@@ -0,0 +1,10 @@
1
+ import type { Charter } from '@niscorp/charter';
2
+
3
+ // Everybody is `public` until the app has a sign-in.
4
+ export const charter: Charter = {
5
+ public: {
6
+ actions: ['ask.*', 'answer.*', 'guide.*'],
7
+ data: [],
8
+ functions: ['ask', 'screens.open', 'answers.back', 'answers.forward', 'answers.go', 'answers.current'],
9
+ },
10
+ };
@@ -0,0 +1,87 @@
1
+ export type Canvas = { action: string; input: Record<string, unknown>; intent: string };
2
+
3
+ export type Screen = { id: string; label: string; description: string; arrangement: string; canvases: Canvas[] };
4
+
5
+ const card = (action: string, intent: string): Canvas => ({ action, input: {}, intent });
6
+
7
+ const COUNTER: Canvas = { action: 'guide.counter', input: { title: 'Press me', count: 0 }, intent: 'a counter to press' };
8
+
9
+ const quiz = (question: string, options: string[], answer: number, explanation: string): Canvas => ({
10
+ action: 'guide.quiz',
11
+ input: { title: 'Quick check', question, options, answer, explanation },
12
+ intent: `a quick check: ${question}`,
13
+ });
14
+
15
+ export const SCREENS: readonly [Screen, ...Screen[]] = [
16
+ {
17
+ id: 'start',
18
+ label: 'Start',
19
+ description: 'The welcome, a counter to press, a quick check, the tour as a checklist, and what nisc is.',
20
+ arrangement: 'hero',
21
+ canvases: [
22
+ card('guide.welcome', 'what this app is, and where to start'),
23
+ COUNTER,
24
+ quiz('You press a link on this screen. What changes the view?', ['The model', 'The app, straight away', 'Your browser, on its own'], 1, 'Links act at once. Only what you ask — typed, or a thing to ask pressed — goes to the model.'),
25
+ {
26
+ action: 'guide.checklist',
27
+ input: { title: 'Your tour', todo: ['Press the counter', 'Answer the quick check', 'Follow a link to a lesson', 'Ask for a screen in the line below', 'Ask the model to change a card'] },
28
+ intent: 'the tour, as a checklist',
29
+ },
30
+ card('guide.nisc', 'what nisc is'),
31
+ ],
32
+ },
33
+ {
34
+ id: 'actions',
35
+ label: 'Actions',
36
+ description: 'Lesson 1: what an action is, the counter that is one, a quick check, how a card is drawn, and things to try.',
37
+ arrangement: 'hero',
38
+ canvases: [
39
+ card('guide.actions', 'what an action is'),
40
+ COUNTER,
41
+ quiz('Where does the look of a card live?', ['In its layout', 'In the model’s answer', 'In the kit’s stylesheet'], 2, 'A layout only names components; the kit in src/ui/ draws them, and its stylesheet holds the look.'),
42
+ card('guide.layouts', 'how a card is drawn'),
43
+ {
44
+ action: 'guide.checklist',
45
+ input: { title: 'Try it', todo: ['Press + until the counter says 5', 'Press Reset', 'Ask for a counter that starts at 100', 'Ask for the layouts card first'] },
46
+ intent: 'things to try in this lesson',
47
+ },
48
+ ],
49
+ },
50
+ {
51
+ id: 'asking',
52
+ label: 'Asking',
53
+ description: 'Lesson 2: how a message becomes a screen, things to ask the model, and a quick check.',
54
+ arrangement: 'hero',
55
+ canvases: [
56
+ card('guide.answers', 'how a message becomes a screen'),
57
+ card('guide.ask', 'things to ask the model'),
58
+ quiz('What does the model write when you ask for a screen?', ['Which cards go where, filled in', 'React code', 'A chat reply'], 0, 'It answers with actions and their inputs, area by area, and the app checks them before they are shown.'),
59
+ ],
60
+ },
61
+ {
62
+ id: 'rules',
63
+ label: 'Rules',
64
+ description: 'Lesson 3: the charter, the shell on the server, reads and writes, and a quick check.',
65
+ arrangement: 'grid',
66
+ canvases: [
67
+ card('guide.charter', 'what the charter decides'),
68
+ card('guide.shell', 'what the shell and moss are'),
69
+ card('guide.data', 'how reads and writes work'),
70
+ quiz('Where is it decided what you may do?', ['In the browser', 'On the server, by the charter', 'In each card'], 1, 'Your browser only draws; the charter decides, on the server, what a role may reach.'),
71
+ ],
72
+ },
73
+ {
74
+ id: 'yours',
75
+ label: 'Make it yours',
76
+ description: 'What to delete to start your own app, and a checklist for its first feature.',
77
+ arrangement: 'pair',
78
+ canvases: [
79
+ card('guide.yours', 'how to make the app yours'),
80
+ {
81
+ action: 'guide.checklist',
82
+ input: { title: 'Your first feature', todo: ['Add a table in src/db/schema.ts', 'Add a read in src/app/vex/', 'Add an action that shows it', 'Grant it in the charter', 'Run npm run check'] },
83
+ intent: 'a checklist for the first feature',
84
+ },
85
+ ],
86
+ },
87
+ ];
@@ -0,0 +1,3 @@
1
+ // The canvases an answer is placed on, most important first.
2
+ export const AREAS = ['a', 'b', 'c', 'd', 'e', 'f'] as const;
3
+ export type AreaId = (typeof AREAS)[number];
@@ -0,0 +1,6 @@
1
+ import type { LayoutNode } from '@niscorp/nova';
2
+
3
+ export const frameLayout: LayoutNode = {
4
+ component: 'Frame',
5
+ children: [{ ref: 'answers' }, { component: 'CanvasSlot', props: { canvasId: 'dock' } }],
6
+ };
@@ -0,0 +1,20 @@
1
+ import type { ShellManifest } from '@niscorp/moss';
2
+ import { ARRANGEMENTS } from '../arrangements';
3
+ import { SCREENS } from '../screens';
4
+ import { AREAS } from './areas';
5
+ import { frameLayout } from './frame.layout';
6
+
7
+ const [first] = SCREENS;
8
+ const arranged = ARRANGEMENTS.find((arrangement) => arrangement.id === first.arrangement) ?? ARRANGEMENTS[0];
9
+
10
+ export const shell: ShellManifest = {
11
+ canvases: [
12
+ ...AREAS.map((area, at) => {
13
+ const canvas = first.canvases[at];
14
+ return canvas === undefined ? { id: area } : { id: area, initial: { action: canvas.action, input: canvas.input } };
15
+ }),
16
+ { id: 'dock', initial: 'ask.dock' },
17
+ ],
18
+ layout: frameLayout,
19
+ layoutStore: arranged === undefined ? {} : { answers: arranged.layout },
20
+ };
@@ -0,0 +1,3 @@
1
+ import type { SeedEntry, SeedMutation } from '@niscorp/vex';
2
+
3
+ export const ENTRIES: readonly (SeedEntry | SeedMutation)[] = [];
@@ -0,0 +1,3 @@
1
+ import type { Sequence } from '@niscorp/strata';
2
+
3
+ export const APP_SEQUENCE: Sequence = { id: 'nisc-template-app.app', migrations: [] };
@@ -1,9 +1,10 @@
1
1
  import { spawnSync } from 'node:child_process';
2
2
 
3
3
  const CHECKS: readonly (readonly [name: string, what: string, args?: readonly string[]])[] = [
4
- ['artifacts-check', 'src/app is data: pure JSON, and every artifact parses its schema'],
4
+ ['artifacts-check', 'src/app is data: pure JSON, every artifact parses its schema, every screen canvas opens an action with an input it takes'],
5
5
  ['strata', 'the source is written at the installed grammars (strata.lock.json)', ['status', '--check']],
6
- ['welcome-check', 'the welcome screen: served, drawn, and pressed'],
6
+ ['compose-check', 'a message is answered with a screen: the open screen read, picked, composed, checked, placed, written, and back again'],
7
+ ['guide-check', 'the tour: its cards pressed, ticked and picked, its links, and what the model sees and changes of them'],
7
8
  ];
8
9
 
9
10
  let failed = 0;
@@ -0,0 +1,95 @@
1
+ import { z } from 'zod';
2
+ import { ActionDefinitionSchema, LayoutNodeSchema } from '@niscorp/nova';
3
+ import type { LayoutNode } from '@niscorp/nova';
4
+ import { componentsOf, walkNodes } from '@niscorp/nova/reflect';
5
+ import { actions } from '../app/action-catalog';
6
+ import { ARRANGEMENTS } from '../app/arrangements';
7
+ import { assignments } from '../app/charter/assignments';
8
+ import { charter } from '../app/charter/charter';
9
+ import { SCREENS } from '../app/screens';
10
+ import { AREAS } from '../app/shell/areas';
11
+ import { shell } from '../app/shell/shell';
12
+ import { inputKeysOf } from '../server/compose/catalog';
13
+ import { isRecord } from '../server/compose/record';
14
+ import { buildRegistry } from '../ui/registry';
15
+ import { checks } from './checks';
16
+
17
+ const { check, finish } = checks('artifacts');
18
+
19
+ const impurity = (value: unknown, path: string): string => {
20
+ if (value === null || typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean') return '';
21
+ if (Array.isArray(value)) return value.map((item, at) => impurity(item, `${path}[${at}]`)).find((found) => found !== '') ?? '';
22
+ if (typeof value !== 'object') return `${path} is a ${typeof value}`;
23
+ if (Object.getPrototypeOf(value) !== Object.prototype) return `${path} is not a plain object`;
24
+ return Object.entries(value).map(([key, inner]) => impurity(inner, path === '' ? key : `${path}.${key}`)).find((found) => found !== '') ?? '';
25
+ };
26
+ const pure = (name: string, value: unknown): void => {
27
+ const found = impurity(value, '');
28
+ check(`${name} is pure JSON`, found === '', found);
29
+ };
30
+ const parses = (name: string, parse: () => unknown): void => {
31
+ try {
32
+ parse();
33
+ check(`${name} parses its schema`, true);
34
+ } catch (error) {
35
+ check(`${name} parses its schema`, false, error instanceof Error ? error.message.slice(0, 300) : String(error));
36
+ }
37
+ };
38
+ pure('the action catalog', actions);
39
+ pure('the charter', charter);
40
+ pure('the assignments', assignments);
41
+ pure('the shell', shell);
42
+ if (shell.layout !== undefined) parses('the shell’s frame', () => LayoutNodeSchema.parse(shell.layout));
43
+
44
+ for (const [id, definition] of Object.entries(actions)) {
45
+ check(`action "${id}" is catalogued under its own id`, definition.id === id, `its id is "${definition.id}"`);
46
+ parses(`action "${id}"`, () => ActionDefinitionSchema.parse(definition));
47
+ check(`action "${id}" says what it shows`, (definition.description ?? '') !== '');
48
+ const unknown = inputKeysOf(definition.input).filter((key) => !(key in (definition.data ?? {})));
49
+ check(`action "${id}" declares only inputs its data has`, unknown.length === 0, unknown.join(', '));
50
+ }
51
+
52
+ const registered = new Set(buildRegistry().list());
53
+ const layouts: [string, LayoutNode | undefined][] = [
54
+ ['the frame', shell.layout],
55
+ ...Object.values(actions).map((definition): [string, LayoutNode | undefined] => [`action "${definition.id}"`, definition.layout]),
56
+ ...ARRANGEMENTS.map((arrangement): [string, LayoutNode | undefined] => [`arrangement "${arrangement.id}"`, arrangement.layout]),
57
+ ];
58
+ for (const [name, layout] of layouts) {
59
+ const missing = [...componentsOf(layout)].filter((component) => !registered.has(component));
60
+ check(`${name} names only components the kit has`, missing.length === 0, missing.join(', '));
61
+ }
62
+
63
+ pure('the arrangements', ARRANGEMENTS);
64
+ const canvasesIn = (layout: unknown): string[] => {
65
+ const held: string[] = [];
66
+ walkNodes(layout, (node) => {
67
+ if (node['component'] === 'CanvasSlot' && isRecord(node['props']) && typeof node['props']['canvasId'] === 'string') held.push(node['props']['canvasId']);
68
+ });
69
+ return held;
70
+ };
71
+ for (const arrangement of ARRANGEMENTS) {
72
+ parses(`arrangement "${arrangement.id}"`, () => LayoutNodeSchema.parse(arrangement.layout));
73
+ const held = canvasesIn(arrangement.layout);
74
+ check(`arrangement "${arrangement.id}" holds only areas the shell has, each once`, held.every((name) => AREAS.some((area) => area === name)) && new Set(held).size === held.length, held.join(', '));
75
+ check(`arrangement "${arrangement.id}" holds the ${arrangement.areaCount} it says, the first areas in order`, held.join(',') === AREAS.slice(0, arrangement.areaCount).join(','), held.join(', '));
76
+ }
77
+ check('the frame has the region an arrangement is swapped into, and the first one in it', JSON.stringify(shell.layout).includes('"ref":"answers"') && shell.layoutStore?.['answers'] !== undefined);
78
+
79
+ pure('the screens', SCREENS);
80
+ for (const screen of SCREENS) {
81
+ for (const [at, canvas] of screen.canvases.entries()) {
82
+ const action = actions[canvas.action];
83
+ const named = `screen "${screen.id}" canvas ${at + 1}`;
84
+ check(`${named} opens an action the app has`, action !== undefined, canvas.action);
85
+ const extra = Object.keys(canvas.input).filter((key) => !inputKeysOf(action?.input).includes(key));
86
+ check(`${named} gives only inputs ${canvas.action} takes`, extra.length === 0, extra.join(', '));
87
+ const parsed = action?.input === undefined ? undefined : z.fromJSONSchema(action.input).safeParse(canvas.input);
88
+ check(`${named} is opened with an input its action’s schema takes`, parsed === undefined || parsed.success, parsed?.error?.message ?? '');
89
+ check(`${named} says why it is there`, canvas.intent.trim() !== '');
90
+ }
91
+ const arrangement = ARRANGEMENTS.find((candidate) => candidate.id === screen.arrangement);
92
+ check(`screen "${screen.id}" is laid out in an arrangement there is, with room for its canvases`, arrangement !== undefined && arrangement.areaCount >= screen.canvases.length, `${screen.arrangement}: ${screen.canvases.length} canvases`);
93
+ }
94
+
95
+ finish();
@@ -0,0 +1,13 @@
1
+ export const checks = (name: string): { check: (what: string, passed: boolean, detail?: string) => void; finish: () => never } => {
2
+ let failures = 0;
3
+ return {
4
+ check: (what, passed, detail = '') => {
5
+ console.log(`${passed ? '[pass]' : '[fail]'} ${what}${!passed && detail !== '' ? ` — ${detail}` : ''}`);
6
+ if (!passed) failures += 1;
7
+ },
8
+ finish: () => {
9
+ console.log(failures === 0 ? `[pass] ${name}: all checks passed` : `[fail] ${name}: ${failures} check(s) failed`);
10
+ process.exit(failures === 0 ? 0 : 1);
11
+ },
12
+ };
13
+ };
@@ -0,0 +1,191 @@
1
+ import { renderDocument } from '@niscorp/moss';
2
+ import { ARRANGEMENTS } from '../app/arrangements';
3
+ import { SCREENS } from '../app/screens';
4
+ import { AREAS } from '../app/shell/areas';
5
+ import { recordOf } from '../server/compose/record';
6
+ import { drawing } from '../server/document';
7
+ import { checks } from './checks';
8
+ import { scriptedModels, settle, startApp, until } from './scripted';
9
+ import type { Script } from './scripted';
10
+
11
+ const [FIRST] = SCREENS;
12
+
13
+ const keep = (area: string, from = area) => ({ area, keep: from });
14
+ const say = (area: string, title: string, text = `About ${title}.`) => ({ area, say: { title, text } });
15
+ const gridOf = (columns: number, ...areas: [string, number][]): unknown => ({ columns, areas: areas.map(([name, span]) => ({ name, span })) });
16
+
17
+ const SCRIPT: Script = {
18
+ 'Two things side by side': [{ response: 'Put the two side by side.', title: 'Two things', areas: [say('a', 'One'), say('b', 'Two')], arrangement: 'pair' }],
19
+ 'drop the second': [{ title: 'One thing', areas: [{ area: 'b', drop: true }] }],
20
+ 'the second again, beside it': [{ title: 'Second again', areas: [keep('a'), say('b', 'Two')] }],
21
+ 'swap them': [{ title: 'Swapped', areas: [keep('a', 'b'), keep('b', 'a')] }],
22
+ 'other words for the first': [{ title: 'Said again', areas: [say('b', 'One', 'Said again.')] }],
23
+ 'keep what is not there': [{ areas: [keep('a', 'f'), say('c', 'Three')] }, { areas: [keep('a')] }],
24
+ 'Show me the weather card': [{ areas: [{ area: 'a', action: 'weather.card', input: {}, intent: 'the weather' }] }],
25
+ 'Three things, the last wide beneath': [{ title: 'Three things', areas: [say('a', 'One'), say('b', 'Two'), say('c', 'Three')], grid: gridOf(2, ['a', 1], ['b', 1], ['c', 2]) }],
26
+ 'Two things, in a grid of my own': [
27
+ { areas: [say('a', 'One'), say('b', 'Two'), { area: 'c', drop: true }], grid: gridOf(2, ['a', 1], ['a', 1]) },
28
+ { title: 'Two again', areas: [say('a', 'One'), say('b', 'Two'), { area: 'c', drop: true }] },
29
+ ],
30
+ 'What can you do?': [{ title: 'What it does', areas: [say('a', 'What this app does', 'It answers with screens.')], arrangement: 'single' }],
31
+ 'Show the first screen': [{ screen: FIRST.id }],
32
+ 'What is the weather in Vienna?': [{ response: 'Nothing in this app shows the weather.', areas: [] }],
33
+ 'Name it at length': [{ title: 'A title that runs on well past the forty characters a title may have', areas: [] }],
34
+ 'Only one thing': [{ areas: [say('a', 'One')], arrangement: 'single' }],
35
+ };
36
+
37
+ const { check, finish } = checks('compose');
38
+ const START = FIRST.canvases.map((canvas) => canvas.action).join(' ');
39
+ const opened = AREAS.slice(0, FIRST.canvases.length);
40
+
41
+ const scripted = scriptedModels(SCRIPT);
42
+ const { prompts } = scripted;
43
+ const lastPrompt = (): string => prompts[prompts.length - 1] ?? '';
44
+ const app = await startApp(scripted.models);
45
+ const { on, current, total, grid, areas, ids, without, said, drawn, marked, runs, ask, session } = app;
46
+ try {
47
+ const template = '<!doctype html><html><head></head><body><div id="root"></div></body></html>';
48
+ const page = await renderDocument({ ...drawing, server: app.server, template, request: { path: '/', cookie: null } });
49
+ check('the page arrives drawn: the first screen, and the dock with the screens and the line to ask in', page.drawn && ['k-frame', 'k-dock', 'k-prompt'].every((part) => page.html.includes(part)), page.html.slice(0, 300));
50
+
51
+ check('the app opens on the first screen, every one of its canvases an area of its own, and the stack starts there', areas() === START && on('dock').action === 'ask.dock' && current().position === 1 && total() === 1, areas());
52
+ const room = ARRANGEMENTS.find((arrangement) => arrangement.id === FIRST.arrangement)?.areaCount;
53
+ check('the frame’s region holds the first screen’s arrangement', current().arrangement === FIRST.arrangement && grid().split(' ').length - 1 === room, `${String(current().arrangement)} — ${grid()}`);
54
+
55
+ runs.length = 0;
56
+ scripted.likely([FIRST.id]);
57
+ await ask('Two things side by side');
58
+ scripted.likely([]);
59
+ const jev = scripted.asked[scripted.asked.length - 1];
60
+ check(
61
+ 'each message is recorded as two runs: Jev\'s pass and the model\'s, each with its model, what it spent and how it ended',
62
+ runs.map((run) => `${run.agentId} ${run.model} ${run.outcome} ${run.steps} ${run.totalTokens} ${run.label}`).join(' | ') === 'nisc-template-app.jev jev ok 1 110 Two things side by side | nisc-template-app.compose chat ok 1 110 Two things side by side',
63
+ JSON.stringify(runs),
64
+ );
65
+ check('Jev is asked about the message with the open screen: an intent for each canvas', jev?.state['message'] === 'Two things side by side' && Object.keys(recordOf(jev?.state['open_screen'])).join() === opened.join(), JSON.stringify(jev?.state['open_screen']));
66
+ check(
67
+ 'the model is given the open screen by area — where each area is, what each holds — and what Jev thinks',
68
+ prompts[0]?.includes(`arrangement ${FIRST.arrangement}: `) === true && prompts[0].includes(`- a: ${FIRST.canvases[0]?.action ?? ''}`) && prompts[0].includes(`A FAST PICKER THINKS (a hint; how likely each belongs in the answer): actions none; reads none; writes none; screens ${FIRST.id} 0.90`),
69
+ prompts[0]?.slice(0, 600) ?? '',
70
+ );
71
+ check('words the model says are placed where it says, in the room it gives', areas() === 'answer.text answer.text' && on('a').data['title'] === 'One' && on('b').data['title'] === 'Two' && grid() === '2: a b', `${areas()} — ${grid()}`);
72
+ check('the areas the answer changed are outlined', marked() === 'a b', marked());
73
+ check('the chip in the dock names the answer shown by its title, and where it stands among the answers', drawn().includes('"Two things · 2/2"'), drawn().match(/"label":"[^"]*· \d+\/\d+"/)?.[0] ?? '');
74
+ session.dispatch('dock', { type: 'ui:click', ref: 'stack' });
75
+ await settle();
76
+ check(
77
+ 'opening the chip shows what was asked, what the model said it did, and the answers to go back to',
78
+ current().response === 'Put the two side by side.' && drawn().includes('side by side.') && drawn().includes(`1. ${FIRST.label}`) && drawn().includes('2. Two things') && drawn().includes('Two things side by side'),
79
+ String(current().response),
80
+ );
81
+ session.dispatch('dock', { type: 'ui:click', ref: 'stack' });
82
+
83
+ const pairIds = ids();
84
+ await ask('drop the second');
85
+ check('when Jev finds nothing likely, the model is given no hint', !lastPrompt().includes('FAST PICKER'), lastPrompt().slice(-300));
86
+ check('an answer that only empties an area outlines nothing', marked() === '', marked());
87
+ check('an area the model drops is emptied, and every other stays as it was', on('b').id === '' && without('b', ids()) === without('b', pairIds), `${ids()} vs ${pairIds}`);
88
+ const first = on('a').id;
89
+ await ask('the second again, beside it');
90
+ check('a canvas kept stays the same canvas, in its area; what is new goes where the model puts it', on('a').id === first && on('b').data['title'] === 'Two', `${ids()}`);
91
+ await ask('swap them');
92
+ check('the answer streams in: an area is placed while the rest of the reply is still being written', app.streamed() > 0, String(app.streamed()));
93
+ check('a canvas the model keeps from another area moves there', on('a').data['title'] === 'Two' && on('b').data['title'] === 'One', `${String(on('a').data['title'])} ${String(on('b').data['title'])}`);
94
+ const inB = on('b').id;
95
+ await ask('other words for the first');
96
+ check('a canvas the model writes again keeps its place and its instance, and takes what it is given', on('b').id === inB && on('b').data['text'] === 'Said again.', JSON.stringify(on('b').data));
97
+
98
+ prompts.length = 0;
99
+ await ask('keep what is not there');
100
+ check(
101
+ 'keeping an area that is empty, or using one the arrangement does not have, is sent back saying so',
102
+ (prompts[1] ?? '').includes('there is nothing in area f to keep') && (prompts[1] ?? '').includes('has no area c'),
103
+ prompts[1]?.slice(-400) ?? '',
104
+ );
105
+
106
+ const beforeWeatherCard = ids();
107
+ const stackBeforeWeatherCard = total();
108
+ prompts.length = 0;
109
+ runs.length = 0;
110
+ await ask('Show me the weather card');
111
+ check(
112
+ 'an answer refused three times leaves the screen as it was, and the line says so',
113
+ prompts.length === 3 && prompts[1]?.includes('there is no action "weather.card"') === true && ids() === beforeWeatherCard && total() === stackBeforeWeatherCard && said().includes('did not fit'),
114
+ `${ids()} — ${said()}`,
115
+ );
116
+ check('a model run refused three times is recorded as failed, with its three steps', runs[1]?.outcome === 'failed' && runs[1]?.steps === 3 && runs[1]?.totalTokens === 330, JSON.stringify(runs[1]));
117
+
118
+ await ask('Three things, the last wide beneath');
119
+ check('a layout the model wrote is the one the answer is laid out in', current().arrangement === 'written' && grid() === '2: a b c×2' && areas() === 'answer.text answer.text answer.text', `${String(current().arrangement)} — ${grid()} — ${areas()}`);
120
+ prompts.length = 0;
121
+ await ask('Two things, in a grid of my own');
122
+ check('a grid that names an area twice is sent back saying so, and the arrangement on screen stays', (prompts[1] ?? '').includes('the grid names an area twice') && current().arrangement === 'written' && areas() === 'answer.text answer.text', `${String(current().arrangement)} — ${areas()}`);
123
+
124
+ const stacked = total();
125
+ const promptsBeforeOpen = prompts.length;
126
+ session.shell.publish('open', FIRST.id);
127
+ check(
128
+ 'a screen asked for on `open` — a card’s link — is shown at once, gone back to where it is in the stack, and nothing is asked of the model',
129
+ (await until(() => current().screen === FIRST.id)) && areas() === START && current().position === 1 && total() === stacked && prompts.length === promptsBeforeOpen,
130
+ `${areas()} — ${String(current().position)} of ${total()}`,
131
+ );
132
+ await settle();
133
+
134
+ const answeredBefore = app.answered();
135
+ session.shell.publish('ask', 'What can you do?');
136
+ check('a message sent on `ask` — a card’s thing to ask — is asked as if typed', (await until(() => app.answered() > answeredBefore)) && lastPrompt().includes('MESSAGE: What can you do?'), lastPrompt().slice(-200));
137
+ await settle();
138
+ check('words the model says are shown as words', areas() === 'answer.text' && on('a').data['title'] === 'What this app does', areas());
139
+
140
+ await ask('Show the first screen');
141
+ check('the model can answer with one of the app’s screens: gone back to where it is in the stack', current().screen === FIRST.id && current().position === 1, `${String(current().position)} of ${total()}`);
142
+
143
+ const beforeWeather = ids();
144
+ const stackBeforeWeather = total();
145
+ await ask('What is the weather in Vienna?');
146
+ check('an answer that changes nothing leaves the screen as it was, and adds nothing to the stack', ids() === beforeWeather && total() === stackBeforeWeather && said() === '', `${ids()} — ${String(total())} — ${said()}`);
147
+ check('and the bar says what was asked, and why nothing changed', current().question === 'What is the weather in Vienna?' && current().response === 'Nothing in this app shows the weather.', JSON.stringify(current()).slice(0, 200));
148
+
149
+ scripted.unreachable(true);
150
+ runs.length = 0;
151
+ await ask('Only one thing');
152
+ check('a model that cannot be reached leaves the screen as it was, and the line says so', ids() === beforeWeather && said().includes('could not be reached'), said());
153
+ check('and its run is recorded as failed: one step, nothing spent', runs[1]?.agentId === 'nisc-template-app.compose' && runs[1]?.outcome === 'failed' && runs[1]?.steps === 1 && runs[1]?.totalTokens === 0, JSON.stringify(runs[1]));
154
+ scripted.unreachable(false);
155
+
156
+ runs.length = 0;
157
+ await ask('Name it at length');
158
+ check('a reply that does not fit the reply’s schema is refused: the screen stays, and the line says it did not fit', ids() === beforeWeather && said().includes('did not fit'), said());
159
+ check('and its run is recorded as failed, with its three steps', runs[1]?.outcome === 'failed' && runs[1]?.steps === 3, JSON.stringify(runs[1]));
160
+
161
+ session.dispatch('dock', { type: 'ui:click', ref: 'forward' });
162
+ check('forward from the first screen is the answer after it, as it was', await until(() => current().position === 2 && current().question === 'Two things side by side' && on('a').data['title'] === 'One'), `position ${String(current().position)}, ${areas()}`);
163
+ session.dispatch('dock', { type: 'ui:click', ref: 'back' });
164
+ check('back is the first screen again', await until(() => current().position === 1 && current().screen === FIRST.id), `position ${String(current().position)}`);
165
+
166
+ session.dispatch('dock', { type: 'ui:click', ref: 'stack' });
167
+ const stack = current().stack ?? [];
168
+ check('the chip opens the stack: every answer, by its title or the screen it is', on('dock').data['listing'] === true && stack.length === total() && stack[0]?.label === FIRST.label && stack[1]?.label === 'Two things', JSON.stringify(stack.slice(0, 3)));
169
+ session.dispatch('dock', { type: 'ui:click', ref: 'entry', payload: 4 });
170
+ check('an answer picked from the stack is shown as it was, and the list closes', await until(() => current().position === 4 && on('b').data['title'] === 'Two' && on('dock').data['listing'] === false), `${String(current().position)}, ${areas()}`);
171
+ } finally {
172
+ app.server.close();
173
+ }
174
+
175
+ const jevless = await startApp(scriptedModels(SCRIPT, { jevFails: true }).models);
176
+ try {
177
+ await jevless.ask('Only one thing');
178
+ check('when Jev cannot answer, the model answers alone', jevless.areas() === 'answer.text' && jevless.on('a').data['title'] === 'One', jevless.areas());
179
+ } finally {
180
+ jevless.server.close();
181
+ }
182
+
183
+ const keyless = await startApp(scriptedModels(SCRIPT, { keyless: true }).models);
184
+ try {
185
+ await keyless.ask('Only one thing');
186
+ check('with no key, the line names the key, and the screen stays as it was', keyless.said().includes('GROQ_API_KEY'), keyless.said());
187
+ } finally {
188
+ keyless.server.close();
189
+ }
190
+
191
+ finish();