create-nisc 0.8.2 → 0.8.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# create-nisc
|
|
2
2
|
|
|
3
|
+
## 0.8.4
|
|
4
|
+
|
|
5
|
+
No changes in this release.
|
|
6
|
+
|
|
7
|
+
## 0.8.3
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- 2757814: A model-first app's AGENTS.md now names every helper in `src/dev/live-ask.ts` that only the tour's cases use (`at`, `listOf`, `tour`), so following its "Remove the tour" list leaves nothing of the tour behind. Its "the model never presses anything" line no longer gives the tour's checklist as its example.
|
|
12
|
+
|
|
3
13
|
## 0.8.2
|
|
4
14
|
|
|
5
15
|
### Patch Changes
|
|
@@ -3,7 +3,7 @@ import { join, extname, dirname } from 'path';
|
|
|
3
3
|
import { fileURLToPath } from 'url';
|
|
4
4
|
|
|
5
5
|
// <define:__NISC_SET__>
|
|
6
|
-
var define_NISC_SET_default = { "@niscorp/charter": "0.1.4", "@niscorp/cli": "0.8.
|
|
6
|
+
var define_NISC_SET_default = { "@niscorp/charter": "0.1.4", "@niscorp/cli": "0.8.2", "@niscorp/cortex": "0.1.4", "@niscorp/loom": "0.5.0", "@niscorp/moss": "0.8.2", "@niscorp/nisc": "0.8.4", "@niscorp/nova": "0.5.1", "@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.2" };
|
|
7
7
|
var isRecord = (value) => value !== null && typeof value === "object" && !Array.isArray(value);
|
|
8
8
|
var json = (path) => {
|
|
9
9
|
try {
|
|
@@ -312,5 +312,5 @@ var testedSet = () => {
|
|
|
312
312
|
};
|
|
313
313
|
|
|
314
314
|
export { TEMPLATES, completed, envOf, generate, isChoice, itemsOf, offered, readCatalog, testedSet, validName };
|
|
315
|
-
//# sourceMappingURL=chunk-
|
|
316
|
-
//# sourceMappingURL=chunk-
|
|
315
|
+
//# sourceMappingURL=chunk-7APNWIDD.js.map
|
|
316
|
+
//# sourceMappingURL=chunk-7APNWIDD.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["%3Cdefine:__NISC_SET__%3E","../src/catalog/items.ts","../src/catalog/choose.ts","../src/docs.ts","../src/generate.ts","../src/set.ts"],"names":["offered","existsSync","join","readdirSync","isRecord","readFileSync","sections"],"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,iBAAgB,OAAA,EAAQ,gBAAA,EAAiB,OAAA,EAAQ,iBAAA,EAAkB,OAAA,EAAQ,gBAAA,EAAiB,OAAA,EAAQ,iBAAA,EAAkB,OAAA,EAAQ,eAAA,EAAgB,OAAA,EAAQ,cAAA,EAAe,OAAA,EAAO;ACwCjU,IAAM,QAAA,GAAW,CAAC,KAAA,KAAqD,KAAA,KAAU,IAAA,IAAQ,OAAO,KAAA,KAAU,QAAA,IAAY,CAAC,KAAA,CAAM,OAAA,CAAQ,KAAK,CAAA;AAE1I,IAAM,IAAA,GAAO,CAAC,IAAA,KAA0B;AACtC,EAAA,IAAI;AACF,IAAA,OAAO,IAAA,CAAK,KAAA,CAAM,YAAA,CAAa,IAAA,EAAM,MAAM,CAAC,CAAA;AAAA,EAC9C,SAAS,KAAA,EAAO;AACd,IAAA,MAAM,IAAI,KAAA,CAAM,CAAA,aAAA,EAAgB,IAAI,CAAA,oBAAA,EAAkB,KAAA,YAAiB,KAAA,GAAQ,KAAA,CAAM,OAAA,GAAU,MAAA,CAAO,KAAK,CAAC,CAAA,CAAE,CAAA;AAAA,E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,EAAQ,KAAK,GAAA,EAAK,IAAA,CAAK,UAAU,CAAC,IAAA,EAAM,SAAS,CAAC,GAAG,IAAI,CAAA,CAAE,IAAA,CAAK,CAAC,MAAA,KAAW,MAAA,CAAO,WAAW,KAAA,CAAM,IAAI,CAAC,CAAC,CAAC,CAAA;AAAA,EACnH;AAEA,EAAA,KAAA,MAAW,CAAC,GAAA,EAAK,OAAO,CAAA,IAAK,OAAA,EAAS;AACpC,IAAA,MAAM,EAAA,GAAKH,IAAAA,CAAK,OAAA,CAAQ,GAAA,EAAK,GAAG,CAAA;AAChC,IAAA,SAAA,CAAU,QAAQ,EAAE,CAAA,EAAG,EAAE,SAAA,EAAW,MAAM,CAAA;AAC1C,IAAA,aAAA,CAAc,IAAI,OAAO,CAAA;AAAA,EAC3B;AACA,EAAA,OAAO,EAAE,OAAO,CAAC,GAAG,QAAQ,IAAA,EAAM,EAAE,MAAA,CAAO,CAAC,QAAQ,CAAC,QAAA,CAAS,SAAS,GAAG,CAAC,EAAE,IAAA,EAAK,EAAG,MAAM,QAAA,EAAS;AACtG;;;AClNO,IAAM,YAAY,MAAwC;AAC/D,EAAA,IAAI,OAAO,uBAAA,KAAiB,WAAA,EAAa,MAAM,IAAI,MAAM,4FAAuF,CAAA;AAChJ,EAAA,OAAO,uBAAA;AACT","file":"chunk-B3L4UJDN.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.2\",\"@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 { existsSync, readdirSync, readFileSync } from 'node:fs';\nimport { join } from 'node:path';\n\nexport type EnvKey = { name: string; message: string; required?: boolean };\nexport type EnvOption = { value: string; label: string; hint?: string; keys?: readonly EnvKey[] };\nexport type EnvChoice = { choose: string; message: string; options: readonly EnvOption[] };\nexport type EnvSpec = EnvKey | EnvChoice;\n\nexport type Docs = {\n is?: string;\n where?: readonly string[];\n runs?: readonly string[];\n decisions?: readonly string[];\n answered?: readonly string[];\n open?: readonly string[];\n order?: readonly string[];\n};\n\nexport type Part = {\n package?: Readonly<Record<string, unknown>>;\n env?: readonly EnvSpec[];\n docs?: Docs;\n};\n\nexport type Item = Part & {\n id: string;\n answers?: string;\n label?: string;\n hint?: string;\n usage?: string;\n summary?: string;\n default?: boolean;\n requires?: Readonly<Record<string, string>>;\n with?: Readonly<Record<string, Part>>;\n};\n\nexport type Question = { id: string; message: string };\n\nexport type Catalog = { root: string; questions: readonly Question[]; items: readonly Item[] };\n\nconst isRecord = (value: unknown): value is Record<string, unknown> => value !== null && typeof value === 'object' && !Array.isArray(value);\n\nconst json = (path: string): unknown => {\n try {\n return JSON.parse(readFileSync(path, 'utf8'));\n } catch (error) {\n throw new Error(`create-nisc: ${path} is not JSON — ${error instanceof Error ? error.message : String(error)}`);\n }\n};\n\nexport const isChoice = (spec: EnvSpec): spec is EnvChoice => 'choose' in spec;\n\n// The templates are ours, so a mistake in them is a bug: it is refused here with a sentence, before anything is written.\nexport const readCatalog = (root: string): Catalog => {\n const questions = json(join(root, 'questions.json'));\n if (!Array.isArray(questions) || !questions.every((q) => isRecord(q) && typeof q['id'] === 'string' && typeof q['message'] === 'string')) {\n throw new Error(`create-nisc: ${root}/questions.json is not a list of { id, message }`);\n }\n const items: Item[] = readdirSync(root, { withFileTypes: true })\n .filter((entry) => entry.isDirectory() && existsSync(join(root, entry.name, 'item.json')))\n .map((entry) => {\n const item = json(join(root, entry.name, 'item.json'));\n if (!isRecord(item) || item['id'] !== entry.name) throw new Error(`create-nisc: ${entry.name}/item.json must say \"id\": \"${entry.name}\"`);\n return item as Item;\n });\n\n const asked = new Set((questions as Question[]).map((q) => q.id));\n const known = new Set(items.map((item) => item.id));\n const answering = (question: string): Item[] => items.filter((item) => item.answers === question);\n for (const item of items) {\n if (item.answers !== undefined && !asked.has(item.answers)) throw new Error(`create-nisc: item \"${item.id}\" answers \"${item.answers}\", which questions.json does not ask`);\n if (item.answers !== undefined && item.label === undefined) throw new Error(`create-nisc: item \"${item.id}\" answers a question but has no label to offer`);\n for (const [question, wanted] of Object.entries(item.requires ?? {})) {\n if (!answering(question).some((other) => other.id === wanted)) throw new Error(`create-nisc: item \"${item.id}\" requires \"${wanted}\" for \"${question}\", which no item answering it is`);\n }\n for (const other of Object.keys(item.with ?? {})) if (!known.has(other)) throw new Error(`create-nisc: item \"${item.id}\" has a part for \"${other}\", which is no item`);\n }\n for (const question of questions as Question[]) {\n const offered = answering(question.id);\n if (offered.length === 0) throw new Error(`create-nisc: nothing answers \"${question.id}\"`);\n if (offered.filter((item) => item.default === true).length !== 1) throw new Error(`create-nisc: exactly one item answering \"${question.id}\" is its default`);\n }\n return { root, questions: questions as Question[], items };\n};\n","import type { Catalog, EnvSpec, Item, Part } from './items';\n\n// Question id → the id of the item that answers it.\nexport type Picks = Readonly<Record<string, string>>;\n\nconst itemNamed = (catalog: Catalog, id: string): Item | undefined => catalog.items.find((item) => item.id === id);\n\n// What the items picked so far say other questions must be answered with.\nexport const impliedBy = (catalog: Catalog, picks: Picks): Record<string, string> => {\n const implied: Record<string, string> = {};\n for (const id of Object.values(picks)) Object.assign(implied, itemNamed(catalog, id)?.requires ?? {});\n return implied;\n};\n\n// The items that can still answer a question, beside what is picked.\nexport const offered = (catalog: Catalog, question: string, picks: Picks): Item[] => {\n const implied = impliedBy(catalog, picks)[question];\n return catalog.items.filter(\n (item) =>\n item.answers === question &&\n (implied === undefined || implied === item.id) &&\n Object.entries(item.requires ?? {}).every(([other, wanted]) => picks[other] === undefined || picks[other] === wanted),\n );\n};\n\n// Answers every question the picks leave open the way a person who takes the defaults would.\nexport const completed = (catalog: Catalog, picks: Picks): Record<string, string> => {\n const done: Record<string, string> = { ...picks };\n for (const question of catalog.questions) {\n if (done[question.id] !== undefined) continue;\n const choices = offered(catalog, question.id, done);\n const chosen = choices.find((item) => item.default === true) ?? choices[0];\n if (chosen === undefined) throw new Error(`create-nisc: nothing can answer \"${question.message}\" beside ${Object.values(done).join(', ')}`);\n done[question.id] = chosen.id;\n }\n return done;\n};\n\n// The items an app is made of: the one answering each question, in the order they are asked, then the ones every\n// app has. Refused when a question is unanswered or an item's requirement is not met.\nexport const itemsOf = (catalog: Catalog, picks: Picks): Item[] => {\n const answering = catalog.questions.map((question) => {\n const id = picks[question.id];\n const item = id === undefined ? undefined : itemNamed(catalog, id);\n if (item === undefined || item.answers !== question.id) throw new Error(`create-nisc: \"${question.message}\" has no answer${id === undefined ? '' : ` — \"${id}\" does not answer it`}`);\n return item;\n });\n for (const item of answering) {\n for (const [question, wanted] of Object.entries(item.requires ?? {})) {\n if (picks[question] !== wanted) throw new Error(`create-nisc: \"${item.id}\" needs \"${wanted}\", not \"${picks[question] ?? 'nothing'}\"`);\n }\n }\n return [...answering, ...catalog.items.filter((item) => item.answers === undefined)];\n};\n\n// Each item's own part, followed by its part for every other item the app is made of.\nexport const partsOf = (items: readonly Item[]): Part[] => {\n const ids = new Set(items.map((item) => item.id));\n return items.flatMap((item) => [item, ...Object.entries(item.with ?? {}).flatMap(([other, part]) => (ids.has(other) ? [part] : []))]);\n};\n\nexport const envOf = (items: readonly Item[]): EnvSpec[] => partsOf(items).flatMap((part) => part.env ?? []);\n","import type { Part } from './catalog';\n\nexport type DocFacts = {\n name: string;\n today: string;\n nisc: string;\n parts: readonly Part[];\n // The sections items add to AGENTS.md, each from its own agents-section.md.\n agents: readonly string[];\n};\n\nconst all = <K extends 'is' | 'where' | 'runs' | 'decisions' | 'answered' | 'open' | 'order'>(parts: readonly Part[], key: K): string[] =>\n parts.flatMap((part) => {\n const value = part.docs?.[key];\n return value === undefined ? [] : typeof value === 'string' ? [value] : [...value];\n });\n\nconst decisionNumber = (row: string): number => Number(/^\\| D(\\d+) /.exec(row)?.[1] ?? Number.POSITIVE_INFINITY);\n\nconst sections = (texts: readonly string[]): string => texts.map((text) => `\\n${text.trim()}\\n`).join('');\n\nexport const agentsDoc = (facts: DocFacts): string => {\n const [first = 'a nisc application', ...rest] = all(facts.parts, 'is');\n return `# ${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 ${first}**${rest.map((clause) => `, ${clause}`).join('')}.\n- **Where things go:**\n\n\\`\\`\\`\n${all(facts.parts, 'where').join('\\n')}\n\\`\\`\\`\n\n- **How it runs:** ${all(facts.parts, 'runs').join(', ')} — all of them the \\`nisc\\` command — and \\`npm run strata status\\` for the grammars.\n${sections(facts.agents)}`;\n};\n\nexport const planDoc = (facts: DocFacts): 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${all(facts.parts, 'decisions')\n .sort((a, b) => decisionNumber(a) - decisionNumber(b))\n .join('\\n')}\n\n## Answered when it was made\n\n${all(facts.parts, 'answered')\n .map((line) => `- ${line}`)\n .join('\\n')}\n\n## The dial-in — open\n\n${all(facts.parts, 'open')\n .map((line) => `- ${line}`)\n .join('\\n')}\n\n## Order of work\n\n${all(facts.parts, 'order')\n .map((line, at) => `${at + 1}. ${line}`)\n .join('\\n')}\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 { envOf, isChoice, itemsOf, partsOf, readCatalog } from './catalog';\nimport type { EnvKey, EnvSpec, Item, Part, Picks } from './catalog';\nimport { agentsDoc, gitignoreLines, planDoc } from './docs';\n\nexport type CreateOptions = {\n dir: string;\n name: string;\n picks: Picks;\n // The values given for the keys the items ask for, by variable name. A key left out is written empty.\n env?: Readonly<Record<string, string>>;\n versions: Readonly<Record<string, string>>;\n // Depend on the nisc packages of the workspace the app is made in, for an app inside the nisc repository.\n workspace?: boolean;\n // YYYY-MM-DD\n today: string;\n templates?: 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\nconst TOKEN = 'nisc-template-app';\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']);\nconst DEPENDENCIES = ['dependencies', 'devDependencies'] as const;\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 existsSync(join(dir, base))\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 : [];\n\nconst isRecord = (value: unknown): value is Record<string, unknown> => value !== null && typeof value === 'object' && !Array.isArray(value);\n\n// An item's files, then its files for each other item the app is made of (`with/<other>/`).\nconst sourcesOf = (root: string, items: readonly Item[]): Map<string, { item: string; from: string }> => {\n const ids = new Set(items.map((item) => item.id));\n const sources = new Map<string, { item: string; from: string }>();\n for (const item of items) {\n const withDir = join(root, item.id, 'with');\n const others = existsSync(withDir) ? readdirSync(withDir) : [];\n for (const other of others) if (!existsSync(join(root, other, 'item.json'))) throw new Error(`create-nisc: ${item.id}/with/${other} is for \"${other}\", which is no item`);\n const dirs = [join(root, item.id, 'files'), ...others.filter((other) => ids.has(other)).map((other) => join(withDir, other))];\n for (const dir of dirs) {\n for (const rel of filesIn(dir)) {\n const there = sources.get(rel);\n if (there !== undefined) throw new Error(`create-nisc: ${rel} is written by both \"${there.item}\" and \"${item.id}\"`);\n sources.set(rel, { item: item.id, from: join(dir, rel) });\n }\n }\n }\n return sources;\n};\n\nconst pin = (name: string, spec: string, options: CreateOptions): string => {\n if (!spec.startsWith('workspace:') || options.workspace === true) return spec;\n const version = options.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 `^${version}`;\n};\n\n// The parts' package fragments as one manifest: fields in the order they come, then the scripts, then the\n// dependencies sorted. Two parts that disagree about one field, script or dependency is a mistake in the templates.\nconst manifestOf = (parts: readonly Part[], options: CreateOptions): Record<string, unknown> => {\n const fields: Record<string, unknown> = {};\n const scripts: Record<string, string> = {};\n const deps: Record<(typeof DEPENDENCIES)[number], Record<string, string>> = { dependencies: {}, devDependencies: {} };\n const agree = (where: string, key: string, have: unknown, value: unknown): void => {\n if (have !== undefined && JSON.stringify(have) !== JSON.stringify(value)) throw new Error(`create-nisc: two items disagree about ${where} \"${key}\"`);\n };\n for (const fragment of parts.map((part) => part.package ?? {})) {\n for (const [key, value] of Object.entries(fragment)) {\n if (key === 'scripts' || key === 'dependencies' || key === 'devDependencies') {\n if (!isRecord(value)) throw new Error(`create-nisc: a package fragment's ${key} is not an object`);\n const into = key === 'scripts' ? scripts : deps[key];\n for (const [name, spec] of Object.entries(value)) {\n if (typeof spec !== 'string') throw new Error(`create-nisc: ${name} in ${key} is not a string`);\n agree(key, name, into[name], spec);\n into[name] = spec;\n }\n } else {\n agree('the package field', key, fields[key], value);\n fields[key] = value;\n }\n }\n }\n const sorted = (from: Record<string, string>): Record<string, string> =>\n Object.fromEntries(\n Object.keys(from)\n .sort()\n .map((name) => [name, pin(name, from[name] ?? '', options)]),\n );\n return {\n name: options.name,\n ...fields,\n ...(Object.keys(scripts).length > 0 ? { scripts } : {}),\n dependencies: sorted(deps.dependencies),\n devDependencies: sorted(deps.devDependencies),\n };\n};\n\nconst envValue = (name: string, options: CreateOptions): string => {\n const value = (options.env?.[name] ?? '').trim();\n if (/\\s/.test(value)) throw new Error(`create-nisc: the value given for ${name} has a space or a line break in it`);\n return value;\n};\n\n// `.env` with the values given, `.env.example` with the names alone. A choice keeps its value in both: it is not a\n// secret, and it says which keys follow.\nconst envFiles = (specs: readonly EnvSpec[], options: CreateOptions): { env: string; example: string; assigned: string[] } => {\n const env: string[] = [];\n const example: string[] = [];\n const assigned: string[] = [];\n const key = (spec: EnvKey): void => {\n const comment = `# ${spec.message}${spec.required === true ? ' (required)' : ''}`;\n const line = `${spec.name}=${envValue(spec.name, options)}`;\n env.push(comment, line);\n example.push(comment, `${spec.name}=`);\n assigned.push(line);\n };\n for (const spec of specs) {\n if (!isChoice(spec)) {\n key(spec);\n continue;\n }\n const value = envValue(spec.choose, options) || (spec.options[0]?.value ?? '');\n const option = spec.options.find((candidate) => candidate.value === value);\n if (option === undefined) throw new Error(`create-nisc: ${spec.choose} is one of ${spec.options.map((candidate) => candidate.value).join(', ')} — not \"${value}\"`);\n const comment = `# ${spec.message} (${spec.options.map((candidate) => candidate.value).join(' | ')})`;\n env.push(comment, `${spec.choose}=${value}`);\n example.push(comment, `${spec.choose}=${value}`);\n assigned.push(`${spec.choose}=${value}`);\n for (const inner of option.keys ?? []) key(inner);\n }\n return { env: `${env.join('\\n')}\\n`, example: `${example.join('\\n')}\\n`, assigned };\n};\n\nexport const generate = (options: CreateOptions): Created => {\n const catalog = readCatalog(options.templates ?? TEMPLATES);\n const items = itemsOf(catalog, options.picks);\n const parts = partsOf(items);\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 planned = new Map<string, string | Buffer>();\n for (const [rel, { from }] of sourcesOf(catalog.root, items)) {\n planned.set(rel, TEXT.has(extname(rel)) ? readFileSync(from, 'utf8').split(TOKEN).join(options.name) : readFileSync(from));\n }\n planned.set('package.json', `${JSON.stringify(manifestOf(parts, options), null, 2)}\\n`);\n\n const sections = items.flatMap((item) => {\n const path = join(catalog.root, item.id, 'agents-section.md');\n return existsSync(path) ? [readFileSync(path, 'utf8').split(TOKEN).join(options.name)] : [];\n });\n const facts = { name: options.name, today: options.today, nisc: options.versions['@niscorp/nisc'] ?? 'unknown', parts, agents: sections };\n planned.set('AGENTS.md', agentsDoc(facts));\n planned.set('PLAN.md', planDoc(facts));\n\n const specs = envOf(items);\n const envs = specs.length > 0 ? envFiles(specs, options) : undefined;\n if (envs !== undefined) planned.set('.env.example', envs.example);\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 // A .gitignore or .env that is there is added to, never replaced: what it holds is theirs.\n const extended: string[] = [];\n const addTo = (rel: string, fresh: string, lines: readonly string[], has: (line: string, theirs: ReadonlySet<string>) => boolean): void => {\n const path = join(options.dir, rel);\n if (!existsSync(path)) {\n planned.set(rel, fresh);\n return;\n }\n const theirs = readFileSync(path, 'utf8');\n const have = new Set(theirs.split('\\n').map((line) => line.trim()));\n const missing = lines.filter((line) => !has(line, have));\n if (missing.length === 0) return;\n planned.set(rel, `${theirs.replace(/\\n*$/, '\\n')}${missing.join('\\n')}\\n`);\n extended.push(rel);\n };\n addTo('.gitignore', `${gitignoreLines.join('\\n')}\\n`, gitignoreLines, (line, have) => have.has(line));\n if (envs !== undefined) {\n const named = (line: string): string => line.slice(0, line.indexOf('=') + 1);\n addTo('.env', envs.env, envs.assigned, (line, have) => [...have].some((theirs) => theirs.startsWith(named(line))));\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
|
+
{"version":3,"sources":["%3Cdefine:__NISC_SET__%3E","../src/catalog/items.ts","../src/catalog/choose.ts","../src/docs.ts","../src/generate.ts","../src/set.ts"],"names":["offered","existsSync","join","readdirSync","isRecord","readFileSync","sections"],"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,iBAAgB,OAAA,EAAQ,gBAAA,EAAiB,OAAA,EAA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,CAAS,SAAS,GAAG,CAAC,EAAE,IAAA,EAAK,EAAG,MAAM,QAAA,EAAS;AACtG;;;AClNO,IAAM,YAAY,MAAwC;AAC/D,EAAA,IAAI,OAAO,uBAAA,KAAiB,WAAA,EAAa,MAAM,IAAI,MAAM,4FAAuF,CAAA;AAChJ,EAAA,OAAO,uBAAA;AACT","file":"chunk-7APNWIDD.js","sourcesContent":["{\"@niscorp/charter\":\"0.1.4\",\"@niscorp/cli\":\"0.8.2\",\"@niscorp/cortex\":\"0.1.4\",\"@niscorp/loom\":\"0.5.0\",\"@niscorp/moss\":\"0.8.2\",\"@niscorp/nisc\":\"0.8.4\",\"@niscorp/nova\":\"0.5.1\",\"@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.2\"}","import { existsSync, readdirSync, readFileSync } from 'node:fs';\nimport { join } from 'node:path';\n\nexport type EnvKey = { name: string; message: string; required?: boolean };\nexport type EnvOption = { value: string; label: string; hint?: string; keys?: readonly EnvKey[] };\nexport type EnvChoice = { choose: string; message: string; options: readonly EnvOption[] };\nexport type EnvSpec = EnvKey | EnvChoice;\n\nexport type Docs = {\n is?: string;\n where?: readonly string[];\n runs?: readonly string[];\n decisions?: readonly string[];\n answered?: readonly string[];\n open?: readonly string[];\n order?: readonly string[];\n};\n\nexport type Part = {\n package?: Readonly<Record<string, unknown>>;\n env?: readonly EnvSpec[];\n docs?: Docs;\n};\n\nexport type Item = Part & {\n id: string;\n answers?: string;\n label?: string;\n hint?: string;\n usage?: string;\n summary?: string;\n default?: boolean;\n requires?: Readonly<Record<string, string>>;\n with?: Readonly<Record<string, Part>>;\n};\n\nexport type Question = { id: string; message: string };\n\nexport type Catalog = { root: string; questions: readonly Question[]; items: readonly Item[] };\n\nconst isRecord = (value: unknown): value is Record<string, unknown> => value !== null && typeof value === 'object' && !Array.isArray(value);\n\nconst json = (path: string): unknown => {\n try {\n return JSON.parse(readFileSync(path, 'utf8'));\n } catch (error) {\n throw new Error(`create-nisc: ${path} is not JSON — ${error instanceof Error ? error.message : String(error)}`);\n }\n};\n\nexport const isChoice = (spec: EnvSpec): spec is EnvChoice => 'choose' in spec;\n\n// The templates are ours, so a mistake in them is a bug: it is refused here with a sentence, before anything is written.\nexport const readCatalog = (root: string): Catalog => {\n const questions = json(join(root, 'questions.json'));\n if (!Array.isArray(questions) || !questions.every((q) => isRecord(q) && typeof q['id'] === 'string' && typeof q['message'] === 'string')) {\n throw new Error(`create-nisc: ${root}/questions.json is not a list of { id, message }`);\n }\n const items: Item[] = readdirSync(root, { withFileTypes: true })\n .filter((entry) => entry.isDirectory() && existsSync(join(root, entry.name, 'item.json')))\n .map((entry) => {\n const item = json(join(root, entry.name, 'item.json'));\n if (!isRecord(item) || item['id'] !== entry.name) throw new Error(`create-nisc: ${entry.name}/item.json must say \"id\": \"${entry.name}\"`);\n return item as Item;\n });\n\n const asked = new Set((questions as Question[]).map((q) => q.id));\n const known = new Set(items.map((item) => item.id));\n const answering = (question: string): Item[] => items.filter((item) => item.answers === question);\n for (const item of items) {\n if (item.answers !== undefined && !asked.has(item.answers)) throw new Error(`create-nisc: item \"${item.id}\" answers \"${item.answers}\", which questions.json does not ask`);\n if (item.answers !== undefined && item.label === undefined) throw new Error(`create-nisc: item \"${item.id}\" answers a question but has no label to offer`);\n for (const [question, wanted] of Object.entries(item.requires ?? {})) {\n if (!answering(question).some((other) => other.id === wanted)) throw new Error(`create-nisc: item \"${item.id}\" requires \"${wanted}\" for \"${question}\", which no item answering it is`);\n }\n for (const other of Object.keys(item.with ?? {})) if (!known.has(other)) throw new Error(`create-nisc: item \"${item.id}\" has a part for \"${other}\", which is no item`);\n }\n for (const question of questions as Question[]) {\n const offered = answering(question.id);\n if (offered.length === 0) throw new Error(`create-nisc: nothing answers \"${question.id}\"`);\n if (offered.filter((item) => item.default === true).length !== 1) throw new Error(`create-nisc: exactly one item answering \"${question.id}\" is its default`);\n }\n return { root, questions: questions as Question[], items };\n};\n","import type { Catalog, EnvSpec, Item, Part } from './items';\n\n// Question id → the id of the item that answers it.\nexport type Picks = Readonly<Record<string, string>>;\n\nconst itemNamed = (catalog: Catalog, id: string): Item | undefined => catalog.items.find((item) => item.id === id);\n\n// What the items picked so far say other questions must be answered with.\nexport const impliedBy = (catalog: Catalog, picks: Picks): Record<string, string> => {\n const implied: Record<string, string> = {};\n for (const id of Object.values(picks)) Object.assign(implied, itemNamed(catalog, id)?.requires ?? {});\n return implied;\n};\n\n// The items that can still answer a question, beside what is picked.\nexport const offered = (catalog: Catalog, question: string, picks: Picks): Item[] => {\n const implied = impliedBy(catalog, picks)[question];\n return catalog.items.filter(\n (item) =>\n item.answers === question &&\n (implied === undefined || implied === item.id) &&\n Object.entries(item.requires ?? {}).every(([other, wanted]) => picks[other] === undefined || picks[other] === wanted),\n );\n};\n\n// Answers every question the picks leave open the way a person who takes the defaults would.\nexport const completed = (catalog: Catalog, picks: Picks): Record<string, string> => {\n const done: Record<string, string> = { ...picks };\n for (const question of catalog.questions) {\n if (done[question.id] !== undefined) continue;\n const choices = offered(catalog, question.id, done);\n const chosen = choices.find((item) => item.default === true) ?? choices[0];\n if (chosen === undefined) throw new Error(`create-nisc: nothing can answer \"${question.message}\" beside ${Object.values(done).join(', ')}`);\n done[question.id] = chosen.id;\n }\n return done;\n};\n\n// The items an app is made of: the one answering each question, in the order they are asked, then the ones every\n// app has. Refused when a question is unanswered or an item's requirement is not met.\nexport const itemsOf = (catalog: Catalog, picks: Picks): Item[] => {\n const answering = catalog.questions.map((question) => {\n const id = picks[question.id];\n const item = id === undefined ? undefined : itemNamed(catalog, id);\n if (item === undefined || item.answers !== question.id) throw new Error(`create-nisc: \"${question.message}\" has no answer${id === undefined ? '' : ` — \"${id}\" does not answer it`}`);\n return item;\n });\n for (const item of answering) {\n for (const [question, wanted] of Object.entries(item.requires ?? {})) {\n if (picks[question] !== wanted) throw new Error(`create-nisc: \"${item.id}\" needs \"${wanted}\", not \"${picks[question] ?? 'nothing'}\"`);\n }\n }\n return [...answering, ...catalog.items.filter((item) => item.answers === undefined)];\n};\n\n// Each item's own part, followed by its part for every other item the app is made of.\nexport const partsOf = (items: readonly Item[]): Part[] => {\n const ids = new Set(items.map((item) => item.id));\n return items.flatMap((item) => [item, ...Object.entries(item.with ?? {}).flatMap(([other, part]) => (ids.has(other) ? [part] : []))]);\n};\n\nexport const envOf = (items: readonly Item[]): EnvSpec[] => partsOf(items).flatMap((part) => part.env ?? []);\n","import type { Part } from './catalog';\n\nexport type DocFacts = {\n name: string;\n today: string;\n nisc: string;\n parts: readonly Part[];\n // The sections items add to AGENTS.md, each from its own agents-section.md.\n agents: readonly string[];\n};\n\nconst all = <K extends 'is' | 'where' | 'runs' | 'decisions' | 'answered' | 'open' | 'order'>(parts: readonly Part[], key: K): string[] =>\n parts.flatMap((part) => {\n const value = part.docs?.[key];\n return value === undefined ? [] : typeof value === 'string' ? [value] : [...value];\n });\n\nconst decisionNumber = (row: string): number => Number(/^\\| D(\\d+) /.exec(row)?.[1] ?? Number.POSITIVE_INFINITY);\n\nconst sections = (texts: readonly string[]): string => texts.map((text) => `\\n${text.trim()}\\n`).join('');\n\nexport const agentsDoc = (facts: DocFacts): string => {\n const [first = 'a nisc application', ...rest] = all(facts.parts, 'is');\n return `# ${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 ${first}**${rest.map((clause) => `, ${clause}`).join('')}.\n- **Where things go:**\n\n\\`\\`\\`\n${all(facts.parts, 'where').join('\\n')}\n\\`\\`\\`\n\n- **How it runs:** ${all(facts.parts, 'runs').join(', ')} — all of them the \\`nisc\\` command — and \\`npm run strata status\\` for the grammars.\n${sections(facts.agents)}`;\n};\n\nexport const planDoc = (facts: DocFacts): 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${all(facts.parts, 'decisions')\n .sort((a, b) => decisionNumber(a) - decisionNumber(b))\n .join('\\n')}\n\n## Answered when it was made\n\n${all(facts.parts, 'answered')\n .map((line) => `- ${line}`)\n .join('\\n')}\n\n## The dial-in — open\n\n${all(facts.parts, 'open')\n .map((line) => `- ${line}`)\n .join('\\n')}\n\n## Order of work\n\n${all(facts.parts, 'order')\n .map((line, at) => `${at + 1}. ${line}`)\n .join('\\n')}\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 { envOf, isChoice, itemsOf, partsOf, readCatalog } from './catalog';\nimport type { EnvKey, EnvSpec, Item, Part, Picks } from './catalog';\nimport { agentsDoc, gitignoreLines, planDoc } from './docs';\n\nexport type CreateOptions = {\n dir: string;\n name: string;\n picks: Picks;\n // The values given for the keys the items ask for, by variable name. A key left out is written empty.\n env?: Readonly<Record<string, string>>;\n versions: Readonly<Record<string, string>>;\n // Depend on the nisc packages of the workspace the app is made in, for an app inside the nisc repository.\n workspace?: boolean;\n // YYYY-MM-DD\n today: string;\n templates?: 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\nconst TOKEN = 'nisc-template-app';\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']);\nconst DEPENDENCIES = ['dependencies', 'devDependencies'] as const;\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 existsSync(join(dir, base))\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 : [];\n\nconst isRecord = (value: unknown): value is Record<string, unknown> => value !== null && typeof value === 'object' && !Array.isArray(value);\n\n// An item's files, then its files for each other item the app is made of (`with/<other>/`).\nconst sourcesOf = (root: string, items: readonly Item[]): Map<string, { item: string; from: string }> => {\n const ids = new Set(items.map((item) => item.id));\n const sources = new Map<string, { item: string; from: string }>();\n for (const item of items) {\n const withDir = join(root, item.id, 'with');\n const others = existsSync(withDir) ? readdirSync(withDir) : [];\n for (const other of others) if (!existsSync(join(root, other, 'item.json'))) throw new Error(`create-nisc: ${item.id}/with/${other} is for \"${other}\", which is no item`);\n const dirs = [join(root, item.id, 'files'), ...others.filter((other) => ids.has(other)).map((other) => join(withDir, other))];\n for (const dir of dirs) {\n for (const rel of filesIn(dir)) {\n const there = sources.get(rel);\n if (there !== undefined) throw new Error(`create-nisc: ${rel} is written by both \"${there.item}\" and \"${item.id}\"`);\n sources.set(rel, { item: item.id, from: join(dir, rel) });\n }\n }\n }\n return sources;\n};\n\nconst pin = (name: string, spec: string, options: CreateOptions): string => {\n if (!spec.startsWith('workspace:') || options.workspace === true) return spec;\n const version = options.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 `^${version}`;\n};\n\n// The parts' package fragments as one manifest: fields in the order they come, then the scripts, then the\n// dependencies sorted. Two parts that disagree about one field, script or dependency is a mistake in the templates.\nconst manifestOf = (parts: readonly Part[], options: CreateOptions): Record<string, unknown> => {\n const fields: Record<string, unknown> = {};\n const scripts: Record<string, string> = {};\n const deps: Record<(typeof DEPENDENCIES)[number], Record<string, string>> = { dependencies: {}, devDependencies: {} };\n const agree = (where: string, key: string, have: unknown, value: unknown): void => {\n if (have !== undefined && JSON.stringify(have) !== JSON.stringify(value)) throw new Error(`create-nisc: two items disagree about ${where} \"${key}\"`);\n };\n for (const fragment of parts.map((part) => part.package ?? {})) {\n for (const [key, value] of Object.entries(fragment)) {\n if (key === 'scripts' || key === 'dependencies' || key === 'devDependencies') {\n if (!isRecord(value)) throw new Error(`create-nisc: a package fragment's ${key} is not an object`);\n const into = key === 'scripts' ? scripts : deps[key];\n for (const [name, spec] of Object.entries(value)) {\n if (typeof spec !== 'string') throw new Error(`create-nisc: ${name} in ${key} is not a string`);\n agree(key, name, into[name], spec);\n into[name] = spec;\n }\n } else {\n agree('the package field', key, fields[key], value);\n fields[key] = value;\n }\n }\n }\n const sorted = (from: Record<string, string>): Record<string, string> =>\n Object.fromEntries(\n Object.keys(from)\n .sort()\n .map((name) => [name, pin(name, from[name] ?? '', options)]),\n );\n return {\n name: options.name,\n ...fields,\n ...(Object.keys(scripts).length > 0 ? { scripts } : {}),\n dependencies: sorted(deps.dependencies),\n devDependencies: sorted(deps.devDependencies),\n };\n};\n\nconst envValue = (name: string, options: CreateOptions): string => {\n const value = (options.env?.[name] ?? '').trim();\n if (/\\s/.test(value)) throw new Error(`create-nisc: the value given for ${name} has a space or a line break in it`);\n return value;\n};\n\n// `.env` with the values given, `.env.example` with the names alone. A choice keeps its value in both: it is not a\n// secret, and it says which keys follow.\nconst envFiles = (specs: readonly EnvSpec[], options: CreateOptions): { env: string; example: string; assigned: string[] } => {\n const env: string[] = [];\n const example: string[] = [];\n const assigned: string[] = [];\n const key = (spec: EnvKey): void => {\n const comment = `# ${spec.message}${spec.required === true ? ' (required)' : ''}`;\n const line = `${spec.name}=${envValue(spec.name, options)}`;\n env.push(comment, line);\n example.push(comment, `${spec.name}=`);\n assigned.push(line);\n };\n for (const spec of specs) {\n if (!isChoice(spec)) {\n key(spec);\n continue;\n }\n const value = envValue(spec.choose, options) || (spec.options[0]?.value ?? '');\n const option = spec.options.find((candidate) => candidate.value === value);\n if (option === undefined) throw new Error(`create-nisc: ${spec.choose} is one of ${spec.options.map((candidate) => candidate.value).join(', ')} — not \"${value}\"`);\n const comment = `# ${spec.message} (${spec.options.map((candidate) => candidate.value).join(' | ')})`;\n env.push(comment, `${spec.choose}=${value}`);\n example.push(comment, `${spec.choose}=${value}`);\n assigned.push(`${spec.choose}=${value}`);\n for (const inner of option.keys ?? []) key(inner);\n }\n return { env: `${env.join('\\n')}\\n`, example: `${example.join('\\n')}\\n`, assigned };\n};\n\nexport const generate = (options: CreateOptions): Created => {\n const catalog = readCatalog(options.templates ?? TEMPLATES);\n const items = itemsOf(catalog, options.picks);\n const parts = partsOf(items);\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 planned = new Map<string, string | Buffer>();\n for (const [rel, { from }] of sourcesOf(catalog.root, items)) {\n planned.set(rel, TEXT.has(extname(rel)) ? readFileSync(from, 'utf8').split(TOKEN).join(options.name) : readFileSync(from));\n }\n planned.set('package.json', `${JSON.stringify(manifestOf(parts, options), null, 2)}\\n`);\n\n const sections = items.flatMap((item) => {\n const path = join(catalog.root, item.id, 'agents-section.md');\n return existsSync(path) ? [readFileSync(path, 'utf8').split(TOKEN).join(options.name)] : [];\n });\n const facts = { name: options.name, today: options.today, nisc: options.versions['@niscorp/nisc'] ?? 'unknown', parts, agents: sections };\n planned.set('AGENTS.md', agentsDoc(facts));\n planned.set('PLAN.md', planDoc(facts));\n\n const specs = envOf(items);\n const envs = specs.length > 0 ? envFiles(specs, options) : undefined;\n if (envs !== undefined) planned.set('.env.example', envs.example);\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 // A .gitignore or .env that is there is added to, never replaced: what it holds is theirs.\n const extended: string[] = [];\n const addTo = (rel: string, fresh: string, lines: readonly string[], has: (line: string, theirs: ReadonlySet<string>) => boolean): void => {\n const path = join(options.dir, rel);\n if (!existsSync(path)) {\n planned.set(rel, fresh);\n return;\n }\n const theirs = readFileSync(path, 'utf8');\n const have = new Set(theirs.split('\\n').map((line) => line.trim()));\n const missing = lines.filter((line) => !has(line, have));\n if (missing.length === 0) return;\n planned.set(rel, `${theirs.replace(/\\n*$/, '\\n')}${missing.join('\\n')}\\n`);\n extended.push(rel);\n };\n addTo('.gitignore', `${gitignoreLines.join('\\n')}\\n`, gitignoreLines, (line, have) => have.has(line));\n if (envs !== undefined) {\n const named = (line: string): string => line.slice(0, line.indexOf('=') + 1);\n addTo('.env', envs.env, envs.assigned, (line, have) => [...have].some((theirs) => theirs.startsWith(named(line))));\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"]}
|
package/dist/cli.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { readCatalog, TEMPLATES, validName, offered, itemsOf, envOf, isChoice, generate, testedSet } from './chunk-
|
|
1
|
+
import { readCatalog, TEMPLATES, validName, offered, itemsOf, envOf, isChoice, generate, testedSet } from './chunk-7APNWIDD.js';
|
|
2
2
|
import { existsSync, readdirSync } from 'fs';
|
|
3
3
|
import { basename, resolve, relative } from 'path';
|
|
4
4
|
import { intro, text, confirm, cancel, select, note, outro, isCancel, password } from '@clack/prompts';
|
package/dist/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { TEMPLATES, completed, generate, readCatalog, testedSet, validName } from './chunk-
|
|
1
|
+
export { TEMPLATES, completed, generate, readCatalog, testedSet, validName } from './chunk-7APNWIDD.js';
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
3
3
|
//# sourceMappingURL=index.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-nisc",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.4",
|
|
4
4
|
"description": "npm create nisc — a new nisc application: a few questions, then an app with the right structure, its rulebook, and a first screen that works.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -14,7 +14,7 @@ There is no chat history: the screen open when a message arrives is the conversa
|
|
|
14
14
|
- **Every message is recorded as a run for each model it went to,** through moss (`session.recordRun`): `nisc-template-app.jev` and `nisc-template-app.compose`, each with its provider and model, the tokens it spent (`reported: false` where signal estimated them), its steps and how long it took — for the composer, cortex's run meta — and whether it ended in an answer. The server logs a line for each (`src/server/runs/`).
|
|
15
15
|
- **The app starts as a tour of nisc** (`src/app/actions/guide/`): five screens in the dock — a start, three lessons, and how to make it yours. Cards to read — points, an example in code, or steps, the text in the action's own data, no input — and cards to use: a counter, a checklist and a quick check, each with an input the model can fill. A card's link opens another screen at once, as the dock's buttons do; only what is typed, or a thing to ask pressed, goes to the model. What a person presses, ticks and picks stays on the screen; the model sees it, and can change it: "tick off the first step", "a counter that starts at 100", "quiz me on the charter". Its check is `src/dev/guide-check.ts`.
|
|
16
16
|
- **An action you add is small, with one purpose:** it says what it shows (`description`), and declares what the model may open it with as a JSON Schema written with zod, every field described; the model's answers are checked against that same schema (`z.fromJSONSchema`). A read or a write it names must be one the app ships, asked with the values it takes. The ones the model may place are `placeable`, in `src/app/action-catalog.ts`.
|
|
17
|
-
- **The model never presses anything.** It opens cards with an input — a
|
|
17
|
+
- **The model never presses anything.** It opens cards with an input — a form filled in — and only the person saves.
|
|
18
18
|
- **The keys are in `.env`:** `GROQ_API_KEY` (gpt-oss-120b; without it, a message is answered with a notice saying so), and `TYPESAFE_API_KEY` (Jev; without it there is no Jev pass).
|
|
19
19
|
- **`src/dev/compose-check.ts` runs the loop offline**, with a scripted Jev and a scripted model (`src/dev/scripted.ts`), on words, screens and actions the app does not have — so it holds whatever actions the app ships. **`src/dev/live-ask.ts` asks the real models** its cases (`RUN`), each from the screen it was asked on, and counts the screens that are what the case wants, with nothing shown twice (`--runs=<n>`, `--why`, `--prompts` for everything the models were sent, `--no-jev`, or messages of your own, each after `--screen=<id>` to ask it from that screen). It costs a Jev pass and a chat call a message, and is not part of `npm run check`.
|
|
20
20
|
|
|
@@ -34,7 +34,7 @@ The tour is a starting point, there to be deleted. First the interview: PLAN.md'
|
|
|
34
34
|
{ id: 'start', label: 'Start', description: 'What this app is.', arrangement: 'single', canvases: [{ action: 'answer.text', input: { title: 'The app', text: 'What it is, in a sentence.' }, intent: 'what this app is' }] },
|
|
35
35
|
];
|
|
36
36
|
```
|
|
37
|
-
6. `src/dev/live-ask.ts`: your cases in `RUN` instead of the tour's, and its `tour`
|
|
37
|
+
6. `src/dev/live-ask.ts`: your cases in `RUN` instead of the tour's, and the helpers only its cases use (`at`, `listOf`, `tour`).
|
|
38
38
|
7. This file: the tour's rows under "Where things go", its paragraph above, and this list; PLAN.md: the tour in D3 and in the order of work. `npm run check` passes again.
|
|
39
39
|
|
|
40
40
|
What stays is the app: the message loop, the dock, the arrangements, the kit, and `compose-check`, which needs nothing of the tour.
|