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
@@ -1,174 +0,0 @@
1
- import { existsSync, statSync, readFileSync, mkdirSync, writeFileSync, readdirSync } from 'fs';
2
- import { join, extname, dirname } from 'path';
3
- import { fileURLToPath } from 'url';
4
-
5
- // <define:__NISC_SET__>
6
- var define_NISC_SET_default = { "@niscorp/charter": "0.1.4", "@niscorp/cli": "0.8.1", "@niscorp/cortex": "0.1.4", "@niscorp/loom": "0.5.0", "@niscorp/moss": "0.8.1", "@niscorp/nisc": "0.8.1", "@niscorp/nova": "0.5.0", "@niscorp/prism": "0.3.1", "@niscorp/signal": "0.1.5", "@niscorp/solid": "0.1.2", "@niscorp/strata": "0.1.7", "@niscorp/tide": "0.1.7", "@niscorp/vex": "0.4.1" };
7
-
8
- // src/docs.ts
9
- var uiName = (ui) => ui === "react" ? "React" : "plain DOM (nova\u2019s DOM adapter \u2014 no framework in the page)";
10
- var layoutOf = (facts) => facts.posture === "moss" ? `src/app/ ARTIFACTS ONLY \u2014 the manifest (app.ts), the charter, the actions, the shell
11
- src/server/ the environment (runtime.ts), the boot, how a screen is drawn (document.ts)
12
- src/ui/ the kit \u2014 the only renderer code, with ${facts.ui === "react" ? "src/main.tsx" : "src/main.ts"}, the terminal entry
13
- src/dev/ the checks (\`npm run check\`) \u2014 a new feature adds its own
14
- nisc.config.ts how the app boots and how a screen is drawn, for the \`nisc\` command
15
- strata.lock.json the grammar versions the source is written at (rule 20) \u2014 moved only
16
- by \`npm run strata verify\`, never by hand` : `src/app/ ARTIFACTS ONLY \u2014 the actions and the shell's canvases
17
- src/boot.ts the shell factory: the artifacts plus everything environmental
18
- src/ui/ the kit and the screen \u2014 the only renderer code, with ${facts.ui === "react" ? "src/main.tsx" : "src/main.ts"}, the entry
19
- src/dev/ the checks (\`npm run check\`) \u2014 a new feature adds its own
20
- nisc.config.ts how the app boots and how its screen is drawn and picked up, for the \`nisc\` command
21
- strata.lock.json the grammar versions the source is written at (rule 20) \u2014 moved only
22
- by \`npm run strata verify\`, never by hand`;
23
- var agentsDoc = (facts) => `# ${facts.name}
24
-
25
- A nisc application. **The rules it is built by are \`node_modules/@niscorp/nisc/AGENTS.md\`** \u2014 read all of it before changing anything here (it is there once the app's dependencies are installed). It is the rulebook for the nisc version this app has installed, and \`STYLE_GUIDE.md\` sits beside it. The grammars it names \u2014 a layout node, an \`ActionDefinition\`, a Prism config, a charter, a Vex DSL \u2014 are in each package's own \`README.md\` and \`DESIGN.md\`, under \`node_modules/@niscorp/<name>/\`.
26
-
27
- What is particular to this app:
28
-
29
- - **Its decisions are in PLAN.md.** What was answered when it was made, what was derived, and what is still open. An open decision point is asked before anything is built on it, never resolved silently.
30
- - **It is ${facts.posture === "moss" ? "behind moss" : "its own shell"}**, drawn with ${uiName(facts.ui)}.
31
- - **Where things go:**
32
-
33
- \`\`\`
34
- ${layoutOf(facts)}
35
- \`\`\`
36
-
37
- - **How it runs:** \`npm run dev\`, \`npm run build\`, \`npm run check\`${facts.posture === "page" ? ", `npm run export`" : ", `npm start`"} \u2014 all of them the \`nisc\` command \u2014 and \`npm run strata status\` for the grammars.
38
- `;
39
- var d1 = (posture) => posture === "moss" ? `| D1 Posture | answered | **A moss server app.** The shell runs on the server, one per person; the browser is a canvas terminal over a socket. The charter is enforced there: a principal reaches only the actions and the data it is granted. |` : `| D1 Posture | answered | **Its own shell, in the page \u2014 no server.** The shell, its actions and its endpoints run in the browser. Consequence, said plainly: **the charter is not enforcement here.** Whatever data and policy the page has, its user has; nothing in this posture is a security boundary. An app that needs one needs a server \u2014 moss. |`;
40
- var d2 = (posture) => posture === "moss" ? `| D2 Environment | derived \xB7 **open for deployment** | Development and the checks run on PGlite, an in-memory Postgres that starts empty every boot (\`src/server/runtime.ts\`). Open: the Postgres a deployment hands it, and where it runs. |` : `| D2 Environment | **open** | The app has no data yet. Open: what serves its endpoints \u2014 in-memory fixtures, PGlite in the page (your data lives in one browser profile: no sync, no other devices, gone if site data is cleared), a real backend, or a mix. |`;
41
- var d5 = (posture) => posture === "moss" ? `| D5 Routing | derived \xB7 **partly open** | The first screen is drawn on the server and adopted by the terminal \u2014 it costs nothing while nobody can sign in. Open: once sign-in exists, the browser keeps the session in a cookie no script can read, and the page is drawn for whoever it says (AGENTS.md rule 12) \u2014 a page drawn for somebody is theirs alone (\`private, no-store\`). Open: which paths are **pages** rather than the app, and whether the app's shell state syncs to the address bar. |` : `| D5 Routing | derived \xB7 **partly open** | The first screen is drawn at build (\`nisc export\`) \u2014 one file per path, the screen as nobody in particular sees it \u2014 and the page's own shell picks it up. Open: which paths exist beyond \`/\`, and whether shell state syncs to the address bar. |`;
42
- var planDoc = (facts) => `# PLAN \u2014 ${facts.name}
43
-
44
- Made ${facts.today} by \`npm create nisc\`, on nisc ${facts.nisc}. This is the record AGENTS.md's interview asks for ("Before any code"). The walkthrough asked what shapes the files; everything else is **open**, and an open decision blocks the build that depends on it until it is answered by the user or delegated by name. A blanket "go" delegates nothing.
45
-
46
- ## Decision points
47
-
48
- | | Tier | |
49
- |---|---|---|
50
- ${d1(facts.posture)}
51
- ${d2(facts.posture)}
52
- | D3 Reads | **open** | Vex entries (\`{ fingerprint, context }\`, the shape an AI feature can reach later) or plain endpoints with hand-written handlers. |
53
- | D4 Writes | **open** | Vex mutation entries or plain endpoint handlers. Either way a write is an endpoint, never inline. |
54
- ${d5(facts.posture)}
55
-
56
- ## Answered when it was made
57
-
58
- - **What draws the screen:** ${uiName(facts.ui)}. The kit in \`src/ui/\` is where the look lives; a layout names components, never styles.
59
-
60
- ## The dial-in \u2014 open
61
-
62
- - The entities, and how they relate.
63
- - Expected scale.
64
- - Who uses it: one person, or roles. More than one principal sketches its roles and charter now, not later.
65
- - AI features: now, later, never. (Later still shapes D3.)
66
- - Look and feel.
67
- - Where it is deployed.
68
- - What happens to the data long-term.
69
-
70
- ## Order of work
71
-
72
- 1. **The interview** \u2014 every open item above, answered or delegated by name. \u2190 here
73
- 2. **Scaffold** \u2014 done: ${facts.posture === "moss" ? "manifest, runtime and terminal" : "the shell factory and the entry"}, one action rendering, and its checks (the artifacts, the grammar lock, the welcome screen).
74
- 3. **Kit** \u2014 the primitives, against a kitchen-sink action; lock the look before any feature.
75
- 4. **Data layer** \u2014 per D2/D3: schema, seed, entries; one read end to end.
76
- 5. **Actions** \u2014 domain by domain: list \u2192 detail \u2192 form.
77
- 6. **Writes** \u2014 per D4; one round trip: create \u2192 announce \u2192 re-read.
78
- 7. **Checks and polish** \u2014 a check per feature in \`src/dev/\`; empty states and transitions last.
79
- `;
80
- var gitignoreLines = ["node_modules/", "dist/", "out/", ".strata/", "*.tsbuildinfo", ".env", ".env.*", "!.env.example"];
81
-
82
- // src/generate.ts
83
- var TEMPLATES = fileURLToPath(new URL("../templates", import.meta.url));
84
- var templateOf = (posture, ui) => `${posture === "moss" ? "moss" : "shell"}-${ui}`;
85
- var tokenOf = (template) => `nisc-template-${template}`;
86
- var SKIP = /* @__PURE__ */ new Set(["node_modules", "dist", "out", ".turbo"]);
87
- var TEXT = /* @__PURE__ */ new Set([".ts", ".tsx", ".json", ".html", ".css", ".md"]);
88
- var KEEP_THEIRS = /* @__PURE__ */ new Set(["README.md"]);
89
- var validName = (name) => /^[a-z0-9][a-z0-9._-]*$/.test(name) && name.length <= 214;
90
- var filesIn = (dir, base = "") => readdirSync(join(dir, base), { withFileTypes: true }).flatMap((entry) => {
91
- if (SKIP.has(entry.name)) return [];
92
- const rel = base === "" ? entry.name : `${base}/${entry.name}`;
93
- return entry.isDirectory() ? filesIn(dir, rel) : [rel];
94
- });
95
- var isRecord = (value) => value !== null && typeof value === "object" && !Array.isArray(value);
96
- var pinned = (deps, versions) => {
97
- if (!isRecord(deps)) return {};
98
- return Object.fromEntries(
99
- Object.entries(deps).map(([name, spec]) => {
100
- if (typeof spec !== "string") throw new Error(`create-nisc: ${name} has no version in the template`);
101
- if (!spec.startsWith("workspace:")) return [name, spec];
102
- const version = versions[name];
103
- if (version === void 0) throw new Error(`create-nisc: the nisc release has no ${name} \u2014 the set it was given is incomplete`);
104
- return [name, `^${version}`];
105
- })
106
- );
107
- };
108
- var generate = (options) => {
109
- const template = templateOf(options.posture, options.ui);
110
- const source = join(TEMPLATES, template);
111
- if (!existsSync(source)) throw new Error(`create-nisc: no template "${template}"`);
112
- if (!validName(options.name)) throw new Error(`create-nisc: "${options.name}" is not a package name (lowercase letters, digits, - . _)`);
113
- if (existsSync(options.dir) && !statSync(options.dir).isDirectory()) throw new Error(`create-nisc: ${options.dir} is a file`);
114
- const token = tokenOf(template);
115
- const planned = /* @__PURE__ */ new Map();
116
- for (const rel of filesIn(source)) {
117
- const from = join(source, rel);
118
- if (rel === "package.json") {
119
- const manifest = JSON.parse(readFileSync(from, "utf8"));
120
- if (!isRecord(manifest)) throw new Error(`create-nisc: ${template}/package.json is not an object`);
121
- const app = {
122
- ...manifest,
123
- name: options.name,
124
- dependencies: pinned(manifest["dependencies"], options.versions),
125
- devDependencies: pinned(manifest["devDependencies"], options.versions)
126
- };
127
- planned.set(rel, `${JSON.stringify(app, null, 2)}
128
- `);
129
- } else if (TEXT.has(extname(rel))) {
130
- planned.set(rel, readFileSync(from, "utf8").split(token).join(options.name));
131
- } else {
132
- planned.set(rel, readFileSync(from));
133
- }
134
- }
135
- const facts = { name: options.name, posture: options.posture, ui: options.ui, today: options.today, nisc: options.versions["@niscorp/nisc"] ?? "unknown" };
136
- planned.set("AGENTS.md", agentsDoc(facts));
137
- planned.set("PLAN.md", planDoc(facts));
138
- const there = (rel) => existsSync(join(options.dir, rel));
139
- const kept = [...planned.keys()].filter((rel) => KEEP_THEIRS.has(rel) && there(rel));
140
- const collisions = [...planned.keys()].filter((rel) => !KEEP_THEIRS.has(rel) && there(rel)).sort();
141
- if (collisions.length > 0) {
142
- throw new Error(
143
- `create-nisc: ${options.dir} already has ${collisions.length === 1 ? "a file" : "files"} a new app would write \u2014 nothing was written:
144
- ${collisions.join("\n ")}
145
- Make the app in an empty folder, or in a subfolder of this one.`
146
- );
147
- }
148
- for (const rel of kept) planned.delete(rel);
149
- const ignorePath = join(options.dir, ".gitignore");
150
- const theirs = existsSync(ignorePath) ? readFileSync(ignorePath, "utf8") : void 0;
151
- const have = new Set((theirs ?? "").split("\n").map((line) => line.trim()));
152
- const missing = gitignoreLines.filter((line) => !have.has(line));
153
- const extended = theirs !== void 0 && missing.length > 0 ? [".gitignore"] : [];
154
- if (theirs === void 0) planned.set(".gitignore", `${gitignoreLines.join("\n")}
155
- `);
156
- else if (missing.length > 0) planned.set(".gitignore", `${theirs.replace(/\n*$/, "\n")}${missing.join("\n")}
157
- `);
158
- for (const [rel, content] of planned) {
159
- const to = join(options.dir, rel);
160
- mkdirSync(dirname(to), { recursive: true });
161
- writeFileSync(to, content);
162
- }
163
- return { files: [...planned.keys()].filter((rel) => !extended.includes(rel)).sort(), kept, extended };
164
- };
165
-
166
- // src/set.ts
167
- var testedSet = () => {
168
- if (typeof define_NISC_SET_default === "undefined") throw new Error("create-nisc: this copy was not built \u2014 it carries no nisc release to pin a new app to");
169
- return define_NISC_SET_default;
170
- };
171
-
172
- export { TEMPLATES, generate, templateOf, testedSet, validName };
173
- //# sourceMappingURL=chunk-6FL5A3LS.js.map
174
- //# sourceMappingURL=chunk-6FL5A3LS.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["%3Cdefine:__NISC_SET__%3E","../src/docs.ts","../src/generate.ts","../src/set.ts"],"names":[],"mappings":";;;;;AAAA,IAAA,uBAAA,GAAA,EAAC,kBAAA,EAAmB,OAAA,EAAQ,cAAA,EAAe,OAAA,EAAQ,iBAAA,EAAkB,SAAQ,eAAA,EAAgB,OAAA,EAAQ,eAAA,EAAgB,OAAA,EAAQ,eAAA,EAAgB,OAAA,EAAQ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AAO,uBAAA,KAAiB,WAAA,EAAa,MAAM,IAAI,MAAM,4FAAuF,CAAA;AAChJ,EAAA,OAAO,uBAAA;AACT","file":"chunk-6FL5A3LS.js","sourcesContent":["{\"@niscorp/charter\":\"0.1.4\",\"@niscorp/cli\":\"0.8.1\",\"@niscorp/cortex\":\"0.1.4\",\"@niscorp/loom\":\"0.5.0\",\"@niscorp/moss\":\"0.8.1\",\"@niscorp/nisc\":\"0.8.1\",\"@niscorp/nova\":\"0.5.0\",\"@niscorp/prism\":\"0.3.1\",\"@niscorp/signal\":\"0.1.5\",\"@niscorp/solid\":\"0.1.2\",\"@niscorp/strata\":\"0.1.7\",\"@niscorp/tide\":\"0.1.7\",\"@niscorp/vex\":\"0.4.1\"}","import type { Posture, Ui } from './generate';\n\ntype Facts = { name: string; posture: Posture; ui: Ui; today: string; nisc: string };\n\nconst uiName = (ui: Ui): string => (ui === 'react' ? 'React' : 'plain DOM (nova’s DOM adapter — no framework in the page)');\n\nconst layoutOf = (facts: Facts): string =>\n facts.posture === 'moss'\n ? `src/app/ ARTIFACTS ONLY — the manifest (app.ts), the charter, the actions, the shell\nsrc/server/ the environment (runtime.ts), the boot, how a screen is drawn (document.ts)\nsrc/ui/ the kit — the only renderer code, with ${facts.ui === 'react' ? 'src/main.tsx' : 'src/main.ts'}, the terminal entry\nsrc/dev/ the checks (\\`npm run check\\`) — a new feature adds its own\nnisc.config.ts how the app boots and how a screen is drawn, for the \\`nisc\\` command\nstrata.lock.json the grammar versions the source is written at (rule 20) — moved only\n by \\`npm run strata verify\\`, never by hand`\n : `src/app/ ARTIFACTS ONLY — the actions and the shell's canvases\nsrc/boot.ts the shell factory: the artifacts plus everything environmental\nsrc/ui/ the kit and the screen — the only renderer code, with ${facts.ui === 'react' ? 'src/main.tsx' : 'src/main.ts'}, the entry\nsrc/dev/ the checks (\\`npm run check\\`) — a new feature adds its own\nnisc.config.ts how the app boots and how its screen is drawn and picked up, for the \\`nisc\\` command\nstrata.lock.json the grammar versions the source is written at (rule 20) — moved only\n by \\`npm run strata verify\\`, never by hand`;\n\nexport const agentsDoc = (facts: Facts): string => `# ${facts.name}\n\nA nisc application. **The rules it is built by are \\`node_modules/@niscorp/nisc/AGENTS.md\\`** — read all of it before changing anything here (it is there once the app's dependencies are installed). It is the rulebook for the nisc version this app has installed, and \\`STYLE_GUIDE.md\\` sits beside it. The grammars it names — a layout node, an \\`ActionDefinition\\`, a Prism config, a charter, a Vex DSL — are in each package's own \\`README.md\\` and \\`DESIGN.md\\`, under \\`node_modules/@niscorp/<name>/\\`.\n\nWhat is particular to this app:\n\n- **Its decisions are in PLAN.md.** What was answered when it was made, what was derived, and what is still open. An open decision point is asked before anything is built on it, never resolved silently.\n- **It is ${facts.posture === 'moss' ? 'behind moss' : 'its own shell'}**, drawn with ${uiName(facts.ui)}.\n- **Where things go:**\n\n\\`\\`\\`\n${layoutOf(facts)}\n\\`\\`\\`\n\n- **How it runs:** \\`npm run dev\\`, \\`npm run build\\`, \\`npm run check\\`${facts.posture === 'page' ? ', `npm run export`' : ', `npm start`'} — all of them the \\`nisc\\` command — and \\`npm run strata status\\` for the grammars.\n`;\n\nconst d1 = (posture: Posture): string =>\n posture === 'moss'\n ? `| D1 Posture | answered | **A moss server app.** The shell runs on the server, one per person; the browser is a canvas terminal over a socket. The charter is enforced there: a principal reaches only the actions and the data it is granted. |`\n : `| D1 Posture | answered | **Its own shell, in the page — no server.** The shell, its actions and its endpoints run in the browser. Consequence, said plainly: **the charter is not enforcement here.** Whatever data and policy the page has, its user has; nothing in this posture is a security boundary. An app that needs one needs a server — moss. |`;\n\nconst d2 = (posture: Posture): string =>\n posture === 'moss'\n ? `| D2 Environment | derived · **open for deployment** | Development and the checks run on PGlite, an in-memory Postgres that starts empty every boot (\\`src/server/runtime.ts\\`). Open: the Postgres a deployment hands it, and where it runs. |`\n : `| D2 Environment | **open** | The app has no data yet. Open: what serves its endpoints — in-memory fixtures, PGlite in the page (your data lives in one browser profile: no sync, no other devices, gone if site data is cleared), a real backend, or a mix. |`;\n\nconst d5 = (posture: Posture): string =>\n posture === 'moss'\n ? `| D5 Routing | derived · **partly open** | The first screen is drawn on the server and adopted by the terminal — it costs nothing while nobody can sign in. Open: once sign-in exists, the browser keeps the session in a cookie no script can read, and the page is drawn for whoever it says (AGENTS.md rule 12) — a page drawn for somebody is theirs alone (\\`private, no-store\\`). Open: which paths are **pages** rather than the app, and whether the app's shell state syncs to the address bar. |`\n : `| D5 Routing | derived · **partly open** | The first screen is drawn at build (\\`nisc export\\`) — one file per path, the screen as nobody in particular sees it — and the page's own shell picks it up. Open: which paths exist beyond \\`/\\`, and whether shell state syncs to the address bar. |`;\n\nexport const planDoc = (facts: Facts): string => `# PLAN — ${facts.name}\n\nMade ${facts.today} by \\`npm create nisc\\`, on nisc ${facts.nisc}. This is the record AGENTS.md's interview asks for (\"Before any code\"). The walkthrough asked what shapes the files; everything else is **open**, and an open decision blocks the build that depends on it until it is answered by the user or delegated by name. A blanket \"go\" delegates nothing.\n\n## Decision points\n\n| | Tier | |\n|---|---|---|\n${d1(facts.posture)}\n${d2(facts.posture)}\n| D3 Reads | **open** | Vex entries (\\`{ fingerprint, context }\\`, the shape an AI feature can reach later) or plain endpoints with hand-written handlers. |\n| D4 Writes | **open** | Vex mutation entries or plain endpoint handlers. Either way a write is an endpoint, never inline. |\n${d5(facts.posture)}\n\n## Answered when it was made\n\n- **What draws the screen:** ${uiName(facts.ui)}. The kit in \\`src/ui/\\` is where the look lives; a layout names components, never styles.\n\n## The dial-in — open\n\n- The entities, and how they relate.\n- Expected scale.\n- Who uses it: one person, or roles. More than one principal sketches its roles and charter now, not later.\n- AI features: now, later, never. (Later still shapes D3.)\n- Look and feel.\n- Where it is deployed.\n- What happens to the data long-term.\n\n## Order of work\n\n1. **The interview** — every open item above, answered or delegated by name. ← here\n2. **Scaffold** — done: ${facts.posture === 'moss' ? 'manifest, runtime and terminal' : 'the shell factory and the entry'}, one action rendering, and its checks (the artifacts, the grammar lock, the welcome screen).\n3. **Kit** — the primitives, against a kitchen-sink action; lock the look before any feature.\n4. **Data layer** — per D2/D3: schema, seed, entries; one read end to end.\n5. **Actions** — domain by domain: list → detail → form.\n6. **Writes** — per D4; one round trip: create → announce → re-read.\n7. **Checks and polish** — a check per feature in \\`src/dev/\\`; empty states and transitions last.\n`;\n\nexport const gitignoreLines = ['node_modules/', 'dist/', 'out/', '.strata/', '*.tsbuildinfo', '.env', '.env.*', '!.env.example'];\n","import { existsSync, mkdirSync, readdirSync, readFileSync, statSync, writeFileSync } from 'node:fs';\nimport { dirname, extname, join } from 'node:path';\nimport { fileURLToPath } from 'node:url';\nimport { agentsDoc, gitignoreLines, planDoc } from './docs';\n\nexport type Posture = 'moss' | 'page';\nexport type Ui = 'react' | 'dom';\n\nexport type CreateOptions = {\n dir: string;\n name: string;\n posture: Posture;\n ui: Ui;\n versions: Readonly<Record<string, string>>;\n // YYYY-MM-DD\n today: string;\n};\n\nexport type Created = {\n files: string[];\n kept: string[];\n extended: string[];\n};\n\nexport const TEMPLATES = fileURLToPath(new URL('../templates', import.meta.url));\n\nexport const templateOf = (posture: Posture, ui: Ui): string => `${posture === 'moss' ? 'moss' : 'shell'}-${ui}`;\n\nconst tokenOf = (template: string): string => `nisc-template-${template}`;\n\nconst SKIP = new Set(['node_modules', 'dist', 'out', '.turbo']);\nconst TEXT = new Set(['.ts', '.tsx', '.json', '.html', '.css', '.md']);\nconst KEEP_THEIRS = new Set(['README.md']);\n\n// npm's rule for a package name.\nexport const validName = (name: string): boolean => /^[a-z0-9][a-z0-9._-]*$/.test(name) && name.length <= 214;\n\nconst filesIn = (dir: string, base = ''): string[] =>\n readdirSync(join(dir, base), { withFileTypes: true }).flatMap((entry) => {\n if (SKIP.has(entry.name)) return [];\n const rel = base === '' ? entry.name : `${base}/${entry.name}`;\n return entry.isDirectory() ? filesIn(dir, rel) : [rel];\n });\n\nconst isRecord = (value: unknown): value is Record<string, unknown> => value !== null && typeof value === 'object' && !Array.isArray(value);\n\nconst pinned = (deps: unknown, versions: Readonly<Record<string, string>>): Record<string, string> => {\n if (!isRecord(deps)) return {};\n return Object.fromEntries(\n Object.entries(deps).map(([name, spec]): [string, string] => {\n if (typeof spec !== 'string') throw new Error(`create-nisc: ${name} has no version in the template`);\n if (!spec.startsWith('workspace:')) return [name, spec];\n const version = versions[name];\n if (version === undefined) throw new Error(`create-nisc: the nisc release has no ${name} — the set it was given is incomplete`);\n return [name, `^${version}`];\n }),\n );\n};\n\nexport const generate = (options: CreateOptions): Created => {\n const template = templateOf(options.posture, options.ui);\n const source = join(TEMPLATES, template);\n if (!existsSync(source)) throw new Error(`create-nisc: no template \"${template}\"`);\n if (!validName(options.name)) throw new Error(`create-nisc: \"${options.name}\" is not a package name (lowercase letters, digits, - . _)`);\n if (existsSync(options.dir) && !statSync(options.dir).isDirectory()) throw new Error(`create-nisc: ${options.dir} is a file`);\n\n const token = tokenOf(template);\n const planned = new Map<string, string | Buffer>();\n for (const rel of filesIn(source)) {\n const from = join(source, rel);\n if (rel === 'package.json') {\n const manifest: unknown = JSON.parse(readFileSync(from, 'utf8'));\n if (!isRecord(manifest)) throw new Error(`create-nisc: ${template}/package.json is not an object`);\n const app = {\n ...manifest,\n name: options.name,\n dependencies: pinned(manifest['dependencies'], options.versions),\n devDependencies: pinned(manifest['devDependencies'], options.versions),\n };\n planned.set(rel, `${JSON.stringify(app, null, 2)}\\n`);\n } else if (TEXT.has(extname(rel))) {\n planned.set(rel, readFileSync(from, 'utf8').split(token).join(options.name));\n } else {\n planned.set(rel, readFileSync(from));\n }\n }\n const facts = { name: options.name, posture: options.posture, ui: options.ui, today: options.today, nisc: options.versions['@niscorp/nisc'] ?? 'unknown' };\n planned.set('AGENTS.md', agentsDoc(facts));\n planned.set('PLAN.md', planDoc(facts));\n\n const there = (rel: string): boolean => existsSync(join(options.dir, rel));\n const kept = [...planned.keys()].filter((rel) => KEEP_THEIRS.has(rel) && there(rel));\n const collisions = [...planned.keys()].filter((rel) => !KEEP_THEIRS.has(rel) && there(rel)).sort();\n if (collisions.length > 0) {\n throw new Error(\n `create-nisc: ${options.dir} already has ${collisions.length === 1 ? 'a file' : 'files'} a new app would write — nothing was written:\\n ${collisions.join('\\n ')}\\nMake the app in an empty folder, or in a subfolder of this one.`,\n );\n }\n for (const rel of kept) planned.delete(rel);\n\n const ignorePath = join(options.dir, '.gitignore');\n const theirs = existsSync(ignorePath) ? readFileSync(ignorePath, 'utf8') : undefined;\n const have = new Set((theirs ?? '').split('\\n').map((line) => line.trim()));\n const missing = gitignoreLines.filter((line) => !have.has(line));\n const extended = theirs !== undefined && missing.length > 0 ? ['.gitignore'] : [];\n if (theirs === undefined) planned.set('.gitignore', `${gitignoreLines.join('\\n')}\\n`);\n else if (missing.length > 0) planned.set('.gitignore', `${theirs.replace(/\\n*$/, '\\n')}${missing.join('\\n')}\\n`);\n\n for (const [rel, content] of planned) {\n const to = join(options.dir, rel);\n mkdirSync(dirname(to), { recursive: true });\n writeFileSync(to, content);\n }\n return { files: [...planned.keys()].filter((rel) => !extended.includes(rel)).sort(), kept, extended };\n};\n","// Written in when this package is built (tsup.config.ts), never looked up:\n// \"whatever is newest on npm\" would be a set nobody tested the templates with.\ndeclare const __NISC_SET__: Readonly<Record<string, string>> | undefined;\n\nexport const testedSet = (): Readonly<Record<string, string>> => {\n if (typeof __NISC_SET__ === 'undefined') throw new Error('create-nisc: this copy was not built — it carries no nisc release to pin a new app to');\n return __NISC_SET__;\n};\n"]}
@@ -1,39 +0,0 @@
1
- {
2
- "name": "nisc-template-moss-dom",
3
- "private": true,
4
- "version": "0.0.0",
5
- "type": "module",
6
- "engines": {
7
- "node": ">=22.12"
8
- },
9
- "scripts": {
10
- "dev": "nisc dev",
11
- "build": "tsc --noEmit && nisc build",
12
- "start": "nisc start",
13
- "check": "nisc check",
14
- "test": "nisc check",
15
- "typecheck": "tsc --noEmit",
16
- "strata": "tsx src/dev/strata.ts"
17
- },
18
- "dependencies": {
19
- "@electric-sql/pglite": "^0.5.1",
20
- "@niscorp/charter": "workspace:^",
21
- "@niscorp/moss": "workspace:^",
22
- "@niscorp/nova": "workspace:^",
23
- "@niscorp/prism": "workspace:^",
24
- "@niscorp/strata": "workspace:^",
25
- "@niscorp/tide": "workspace:^",
26
- "@niscorp/vex": "workspace:^",
27
- "jsdom": "^25.0.1",
28
- "zod": "^4.6.5"
29
- },
30
- "devDependencies": {
31
- "@niscorp/cli": "workspace:^",
32
- "@niscorp/nisc": "workspace:^",
33
- "@types/jsdom": "^30.0.0",
34
- "@types/node": "^26.6.4",
35
- "tsx": "^4.23.1",
36
- "typescript": "^6.0.2",
37
- "vite": "^7.1.12"
38
- }
39
- }
@@ -1,25 +0,0 @@
1
- import type { LayoutNode } from '@niscorp/nova';
2
-
3
- export const welcomeLayout: LayoutNode = {
4
- component: 'Page',
5
- children: [
6
- { component: 'Heading', children: '{{$.name}}' },
7
- {
8
- component: 'Text',
9
- props: { tone: 'muted' },
10
- children: 'A nisc app behind moss, drawn with plain DOM — no framework in the page. This screen is an action on a canvas, served from a shell on the server; the page arrived drawn, and the browser picked it up. Nobody is signed in, so this shell lasts as long as your connection — reload, and the count starts again.',
11
- },
12
- {
13
- component: 'Row',
14
- children: [
15
- { component: 'Button', ref: 'press', props: { label: 'Press' } },
16
- { component: 'Text', children: 'Presses: {{$.presses}}' },
17
- ],
18
- },
19
- {
20
- component: 'Text',
21
- props: { tone: 'muted' },
22
- children: 'Start in PLAN.md. The rules this app is built by are in AGENTS.md.',
23
- },
24
- ],
25
- };
@@ -1,42 +0,0 @@
1
- /* The look — the only place it lives. A different look is a different
2
- stylesheet over the same layouts. */
3
-
4
- :root {
5
- --k-bg: #f6f4ef;
6
- --k-ink: #1d1d1f;
7
- --k-muted: #6b6a66;
8
- --k-accent: #2f5bea;
9
- --k-accent-ink: #ffffff;
10
- --k-radius: 10px;
11
- font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
12
- color: var(--k-ink);
13
- background: var(--k-bg);
14
- }
15
-
16
- html, body, #root { margin: 0; min-height: 100%; }
17
-
18
- .k-page {
19
- max-width: 640px;
20
- margin: 0 auto;
21
- padding: 64px 24px;
22
- display: flex;
23
- flex-direction: column;
24
- gap: 16px;
25
- }
26
-
27
- .k-row { display: flex; align-items: center; gap: 16px; }
28
- .k-heading { margin: 0; font-size: 32px; letter-spacing: -0.01em; }
29
- .k-text { margin: 0; line-height: 1.55; }
30
- .k-muted { color: var(--k-muted); }
31
-
32
- .k-button {
33
- border: 0;
34
- border-radius: var(--k-radius);
35
- padding: 10px 18px;
36
- font: inherit;
37
- font-weight: 600;
38
- background: var(--k-accent);
39
- color: var(--k-accent-ink);
40
- cursor: pointer;
41
- }
42
- .k-button:active { transform: translateY(1px); }
@@ -1,35 +0,0 @@
1
- import { z } from 'zod';
2
- import type { DomComponent } from '@niscorp/nova/adapters/dom';
3
-
4
- // nova's DOM adapter wires the clicks of an element with a `ref` itself, so
5
- // `Button` adds no listener.
6
-
7
- const parsed = <T>(schema: z.ZodType<T>, props: unknown, fallback: T): T => {
8
- const result = schema.safeParse(props);
9
- return result.success ? result.data : fallback;
10
- };
11
-
12
- const element = (tag: string, className: string, children: Node[]): HTMLElement => {
13
- const el = document.createElement(tag);
14
- el.className = className;
15
- el.append(...children);
16
- return el;
17
- };
18
-
19
- export const Page: DomComponent = ({ children }) => element('main', 'k-page', children);
20
- export const Row: DomComponent = ({ children }) => element('div', 'k-row', children);
21
- export const Heading: DomComponent = ({ children }) => element('h1', 'k-heading', children);
22
-
23
- const TextProps = z.object({ tone: z.enum(['default', 'muted']).optional() });
24
- export const Text: DomComponent = ({ props, children }) => {
25
- const { tone } = parsed(TextProps, props, {});
26
- return element('p', tone === 'muted' ? 'k-text k-muted' : 'k-text', children);
27
- };
28
-
29
- const ButtonProps = z.object({ label: z.string().optional() });
30
- export const Button: DomComponent = ({ props, children }) => {
31
- const { label } = parsed(ButtonProps, props, {});
32
- const button = element('button', 'k-button', label !== undefined ? [document.createTextNode(label)] : children);
33
- button.setAttribute('type', 'button');
34
- return button;
35
- };
@@ -1,15 +0,0 @@
1
- import { createComponentRegistry, ACTION_SLOT_NAME, CANVAS_SLOT_NAME } from '@niscorp/nova';
2
- import type { ComponentRegistry } from '@niscorp/nova';
3
- import type { DomComponent } from '@niscorp/nova/adapters/dom';
4
- import { fallback } from '@niscorp/nova/adapters/dom/components';
5
- import { Button, Heading, Page, Row, Text } from './kit';
6
-
7
- // The adapter resolves a canvas slot itself, and an action slot is a plain
8
- // wrapper: `fallback` does for both.
9
- export const buildRegistry = (): ComponentRegistry<DomComponent> => {
10
- const registry = createComponentRegistry<DomComponent>();
11
- registry.register(CANVAS_SLOT_NAME, fallback);
12
- registry.register(ACTION_SLOT_NAME, fallback);
13
- registry.registerAll({ Page, Row, Heading, Text, Button });
14
- return registry;
15
- };
@@ -1,27 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "target": "ES2022",
4
- "module": "ESNext",
5
- "moduleResolution": "Bundler",
6
- "lib": [
7
- "DOM",
8
- "DOM.Iterable",
9
- "ES2022"
10
- ],
11
- "strict": true,
12
- "noUncheckedIndexedAccess": true,
13
- "verbatimModuleSyntax": true,
14
- "isolatedModules": true,
15
- "skipLibCheck": true,
16
- "noEmit": true,
17
- "types": [
18
- "node",
19
- "vite/client"
20
- ]
21
- },
22
- "include": [
23
- "src",
24
- "nisc.config.ts",
25
- "vite.config.ts"
26
- ]
27
- }
@@ -1,15 +0,0 @@
1
- # nisc-template-moss-react
2
-
3
- A [nisc](https://github.com/moccadroid/niscorp) application behind moss — the shell runs on the server, one per person; the browser is a canvas terminal.
4
-
5
- | | |
6
- |---|---|
7
- | `npm run dev` | the app, in vite — with its server inside |
8
- | `npm run build` | typecheck, bundle, draw every path and say how it is served |
9
- | `npm start` | serve the built app, each first screen drawn |
10
- | `npm run check` | the checks in `src/dev/` |
11
- | `npm run strata status` | which grammar versions the source is written at |
12
-
13
- **Before building anything:** [PLAN.md](PLAN.md) — what was decided when this app
14
- was made and what is still open — and [AGENTS.md](AGENTS.md), which says where
15
- the rules are.
@@ -1,11 +0,0 @@
1
- import type { NiscMossProject } from '@niscorp/cli';
2
- import { boot } from './src/server/boot';
3
- import { drawing } from './src/server/document';
4
-
5
- export const project: NiscMossProject = {
6
- boot: async () => {
7
- const { server } = await boot();
8
- return { server, close: () => server.close() };
9
- },
10
- ...drawing,
11
- };
@@ -1,42 +0,0 @@
1
- {
2
- "name": "nisc-template-moss-react",
3
- "private": true,
4
- "version": "0.0.0",
5
- "type": "module",
6
- "engines": {
7
- "node": ">=22.12"
8
- },
9
- "scripts": {
10
- "dev": "nisc dev",
11
- "build": "tsc --noEmit && nisc build",
12
- "start": "nisc start",
13
- "check": "nisc check",
14
- "test": "nisc check",
15
- "typecheck": "tsc --noEmit",
16
- "strata": "tsx src/dev/strata.ts"
17
- },
18
- "dependencies": {
19
- "@electric-sql/pglite": "^0.5.1",
20
- "@niscorp/charter": "workspace:^",
21
- "@niscorp/moss": "workspace:^",
22
- "@niscorp/nova": "workspace:^",
23
- "@niscorp/prism": "workspace:^",
24
- "@niscorp/strata": "workspace:^",
25
- "@niscorp/tide": "workspace:^",
26
- "@niscorp/vex": "workspace:^",
27
- "react": "^19.2.4",
28
- "react-dom": "^19.2.4",
29
- "zod": "^4.6.5"
30
- },
31
- "devDependencies": {
32
- "@niscorp/cli": "workspace:^",
33
- "@niscorp/nisc": "workspace:^",
34
- "@types/node": "^26.6.4",
35
- "@types/react": "^19.2.14",
36
- "@types/react-dom": "^19.2.3",
37
- "@vitejs/plugin-react": "^5.0.4",
38
- "tsx": "^4.23.1",
39
- "typescript": "^6.0.2",
40
- "vite": "^7.1.12"
41
- }
42
- }
@@ -1,6 +0,0 @@
1
- import type { ActionDefinition } from '@niscorp/nova';
2
- import { welcomeAction } from './actions/surfaces/welcome.action';
3
-
4
- export const actions: Record<string, ActionDefinition> = {
5
- [welcomeAction.id]: welcomeAction,
6
- };
@@ -1,10 +0,0 @@
1
- import type { ActionDefinition } from '@niscorp/nova';
2
- import { welcomeLayout } from './welcome.layout';
3
-
4
- export const welcomeAction: ActionDefinition = {
5
- id: 'welcome',
6
- title: 'Welcome',
7
- data: { name: 'nisc-template-moss-react', presses: 0 },
8
- layout: welcomeLayout,
9
- triggers: [{ event: 'ui:click', ref: 'press', do: [{ increment: 'presses' }] }],
10
- };
@@ -1,7 +0,0 @@
1
- import { defineApp } from '@niscorp/moss';
2
- import { actions } from './action-catalog';
3
- import { assignments } from './charter/assignments';
4
- import { charter } from './charter/charter';
5
- import { shell } from './shell/shell';
6
-
7
- export const app = defineApp({ charter, assignments, actions, shell });
@@ -1,2 +0,0 @@
1
- // Principal id → role names. The anonymous principal is always `public`.
2
- export const assignments: Record<string, readonly string[]> = {};
@@ -1,5 +0,0 @@
1
- import type { Charter } from '@niscorp/charter';
2
-
3
- export const charter: Charter = {
4
- public: ['welcome'],
5
- };
@@ -1,3 +0,0 @@
1
- import type { LayoutNode } from '@niscorp/nova';
2
-
3
- export const frameLayout: LayoutNode = { component: 'CanvasSlot', props: { canvasId: 'main' } };
@@ -1,7 +0,0 @@
1
- import type { ShellManifest } from '@niscorp/moss';
2
- import { frameLayout } from './frame.layout';
3
-
4
- export const shell: ShellManifest = {
5
- canvases: [{ id: 'main', initial: 'welcome' }],
6
- layout: frameLayout,
7
- };
@@ -1,49 +0,0 @@
1
- import { ActionDefinitionSchema, LayoutNodeSchema } from '@niscorp/nova';
2
- import { actions } from '../app/action-catalog';
3
- import { assignments } from '../app/charter/assignments';
4
- import { charter } from '../app/charter/charter';
5
- import { shell } from '../app/shell/shell';
6
-
7
- let failures = 0;
8
- const check = (name: string, passed: boolean, detail = ''): void => {
9
- console.log(`${passed ? '[pass]' : '[fail]'} ${name}${!passed && detail !== '' ? ` — ${detail}` : ''}`);
10
- if (!passed) failures += 1;
11
- };
12
-
13
- const impurity = (value: unknown, path: string): string => {
14
- if (value === null || typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean') return '';
15
- if (Array.isArray(value)) return value.map((item, at) => impurity(item, `${path}[${at}]`)).find((found) => found !== '') ?? '';
16
- if (typeof value !== 'object') return `${path} is a ${typeof value}`;
17
- if (Object.getPrototypeOf(value) !== Object.prototype) return `${path} is not a plain object`;
18
- return Object.entries(value).map(([key, inner]) => impurity(inner, path === '' ? key : `${path}.${key}`)).find((found) => found !== '') ?? '';
19
- };
20
- const pure = (name: string, value: unknown): void => {
21
- const found = impurity(value, '');
22
- check(`${name} is pure JSON`, found === '', found);
23
- };
24
- const parses = (name: string, parse: () => unknown): void => {
25
- try {
26
- parse();
27
- check(`${name} parses its schema`, true);
28
- } catch (error) {
29
- check(`${name} parses its schema`, false, error instanceof Error ? error.message.slice(0, 300) : String(error));
30
- }
31
- };
32
- const isRecord = (value: unknown): value is Record<string, unknown> => typeof value === 'object' && value !== null && !Array.isArray(value);
33
-
34
- pure('the action catalog', actions);
35
- pure('the charter', charter);
36
- pure('the assignments', assignments);
37
- pure('the shell', shell);
38
- if (shell.layout !== undefined) parses('the shell’s frame', () => LayoutNodeSchema.parse(shell.layout));
39
-
40
- for (const [id, definition] of Object.entries(actions)) {
41
- check(`action "${id}" is catalogued under its own id`, definition.id === id, `its id is "${definition.id}"`);
42
- parses(`action "${id}"`, () => ActionDefinitionSchema.parse(definition));
43
- const properties = isRecord(definition.input) && isRecord(definition.input['properties']) ? Object.keys(definition.input['properties']) : [];
44
- const unknown = properties.filter((key) => !(key in (definition.data ?? {})));
45
- check(`action "${id}" declares only inputs its data has`, unknown.length === 0, unknown.join(', '));
46
- }
47
-
48
- console.log(failures === 0 ? '[pass] artifacts: all checks passed' : `[fail] artifacts: ${failures} check(s) failed`);
49
- process.exit(failures === 0 ? 0 : 1);
@@ -1,21 +0,0 @@
1
- import { fileURLToPath } from 'node:url';
2
- import { NOVA_SCHEMAS, NOVA_SEQUENCE } from '@niscorp/nova/migrations';
3
- import { evaluate } from '@niscorp/prism';
4
- import { PRISM_SCHEMAS, PRISM_SEQUENCE } from '@niscorp/prism/migrations';
5
- import { runSourceUpgrade } from '@niscorp/strata/node';
6
- import { actions } from '../app/action-catalog';
7
-
8
- const root = fileURLToPath(new URL('../..', import.meta.url));
9
-
10
- process.exit(
11
- await runSourceUpgrade(
12
- {
13
- root,
14
- grammars: [NOVA_SEQUENCE, PRISM_SEQUENCE],
15
- transform: evaluate,
16
- schemas: { ...NOVA_SCHEMAS, ...PRISM_SCHEMAS },
17
- documents: async () => Object.values(actions).map((document) => ({ kind: 'nisc.nova/action', id: document.id, document })),
18
- },
19
- process.argv.slice(2),
20
- ),
21
- );