@intentius/chant 0.124.20 → 0.124.22

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.
@@ -16,6 +16,7 @@
16
16
  * - `group`: a nested subgroup label inside the quadrant (e.g. "Vendor Composites").
17
17
  * - `order`: number; lower sorts first within its group. Unordered pages follow, by label.
18
18
  * - `hidden`: `true` keeps the page out of the sidebar (reachable by URL only).
19
+ * - `prompt`: optional `|` block; the agent prompt shown under the title. Kept.
19
20
  *
20
21
  * `group` / `order` / `hidden` / `label` are stripped from the written copy so
21
22
  * Starlight's schema never sees them; `diataxis` stays, and the generated
@@ -1 +1 @@
1
- {"version":3,"file":"docs-pages.d.ts","sourceRoot":"","sources":["../../src/codegen/docs-pages.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAMH,OAAO,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAEtE,eAAO,MAAM,SAAS,EAAE,SAAS,QAAQ,EAAuD,CAAC;AAEjG,+DAA+D;AAC/D,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,QAAQ,EAAE,MAAM,CAKpD,CAAC;AAEF,MAAM,WAAW,YAAa,SAAQ,WAAW;IAC/C,qEAAqE;IACrE,IAAI,EAAE,MAAM,CAAC;IACb,kEAAkE;IAClE,OAAO,EAAE,MAAM,CAAC;CACjB;AAyCD;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,UAAU,GAAG,YAAY,EAAE,CA+CpE"}
1
+ {"version":3,"file":"docs-pages.d.ts","sourceRoot":"","sources":["../../src/codegen/docs-pages.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAMH,OAAO,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAEtE,eAAO,MAAM,SAAS,EAAE,SAAS,QAAQ,EAAuD,CAAC;AAEjG,+DAA+D;AAC/D,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,QAAQ,EAAE,MAAM,CAKpD,CAAC;AAEF,MAAM,WAAW,YAAa,SAAQ,WAAW;IAC/C,qEAAqE;IACrE,IAAI,EAAE,MAAM,CAAC;IACb,kEAAkE;IAClE,OAAO,EAAE,MAAM,CAAC;CACjB;AAyCD;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,UAAU,GAAG,YAAY,EAAE,CA+CpE"}
@@ -16,6 +16,7 @@
16
16
  * - `group`: a nested subgroup label inside the quadrant (e.g. "Vendor Composites").
17
17
  * - `order`: number; lower sorts first within its group. Unordered pages follow, by label.
18
18
  * - `hidden`: `true` keeps the page out of the sidebar (reachable by URL only).
19
+ * - `prompt`: optional `|` block; the agent prompt shown under the title. Kept.
19
20
  *
20
21
  * `group` / `order` / `hidden` / `label` are stripped from the written copy so
21
22
  * Starlight's schema never sees them; `diataxis` stays, and the generated
@@ -4,6 +4,8 @@
4
4
  * Each function produces a complete MDX page string with frontmatter.
5
5
  */
6
6
  import type { DocsConfig, ManifestJSON, MetaEntry, RuleMeta } from "./docs-types.js";
7
+ /** A `prompt: |` block scalar for a page's front matter, or nothing. */
8
+ export declare function promptFrontmatter(prompt: string | undefined): string[];
7
9
  export declare function generateOverview(config: DocsConfig, manifest: ManifestJSON, resources: Map<string, MetaEntry>, properties: Map<string, MetaEntry>, serviceGroups: Map<string, Map<string, MetaEntry>>, rules: RuleMeta[]): string;
8
10
  export declare function generateIntrinsics(config: DocsConfig, manifest: ManifestJSON): string;
9
11
  export declare function generatePseudoParameters(config: DocsConfig, manifest: ManifestJSON): string;
@@ -1 +1 @@
1
- {"version":3,"file":"docs-sections.d.ts","sourceRoot":"","sources":["../../src/codegen/docs-sections.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,KAAK,EAAE,UAAU,EAAE,YAAY,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,cAAc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EAAE,YAAY,GACrB,MAAM,CA0BR;AAED,wBAAgB,wBAAwB,CACtC,MAAM,EAAE,UAAU,EAClB,QAAQ,EAAE,YAAY,GACrB,MAAM,CAqBR;AAED,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,UAAU,GAAG,MAAM,CAqBhE"}
@@ -5,11 +5,19 @@
5
5
  */
6
6
  import { escapeMdx } from "./docs-file-markers.js";
7
7
  import { intrinsicFolds } from "../lexicon.js";
8
+ /** A `prompt: |` block scalar for a page's front matter, or nothing. */
9
+ export function promptFrontmatter(prompt) {
10
+ const text = prompt?.trim();
11
+ if (!text)
12
+ return [];
13
+ return ["prompt: |", ...text.split("\n").map((line) => (line ? ` ${line}` : ""))];
14
+ }
8
15
  export function generateOverview(config, manifest, resources, properties, serviceGroups, rules) {
9
16
  const lines = [
10
17
  "---",
11
18
  `title: "${config.displayName}"`,
12
19
  `description: "${config.description}"`,
20
+ ...promptFrontmatter(config.prompt),
13
21
  "---",
14
22
  "",
15
23
  config.overview ?? `Reference documentation for the **${config.displayName}** lexicon.`,
@@ -20,6 +20,13 @@ export interface DocsConfig {
20
20
  packageJsonPath?: string;
21
21
  /** Lexicon-specific overview content (markdown) */
22
22
  overview?: string;
23
+ /**
24
+ * The overview page's agent prompt: "Optional: hand this page to your coding
25
+ * agent", shown under the title (docs-site/AgentPrompt.astro). Imperative
26
+ * steps, what to report back, and a line starting "Never". An authored page
27
+ * under `pagesDir` carries its own as a `prompt:` front-matter field.
28
+ */
29
+ prompt?: string;
23
30
  /** Output format description (e.g. "CloudFormation JSON template") */
24
31
  outputFormat?: string;
25
32
  /** Custom service grouping from resource type (e.g. "AWS::S3::Bucket" → "S3") */
@@ -1 +1 @@
1
- {"version":3,"file":"docs-types.d.ts","sourceRoot":"","sources":["../../src/codegen/docs-types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,MAAM,WAAW,UAAU;IACzB,oDAAoD;IACpD,IAAI,EAAE,MAAM,CAAC;IACb,+CAA+C;IAC/C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AAM,EAAE,OAAO,CAAC,CAAC,GAAG,GAAG,CAAC,MAAM,CAAC,CAUtF;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAC9B,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,GACtC,MAAM,EAAE,CAQV;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI,CAQvE;AAED;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,UAAU,GAAG,IAAI,CAsK1E"}
@@ -326,6 +326,13 @@ export const collections = {
326
326
  extend: z.object({
327
327
  // Diátaxis quadrant (https://diataxis.fr), chant #1731.
328
328
  diataxis: z.enum(['tutorial', 'how-to', 'reference', 'explanation']).optional(),
329
+ // "Optional: hand this page to your coding agent", shown under the
330
+ // title by src/components/AgentPrompt.astro. It has to say what the
331
+ // agent must never do.
332
+ prompt: z
333
+ .string()
334
+ .optional()
335
+ .refine((p) => !p || /^Never\\b/m.test(p), 'a prompt needs a line that starts with "Never" (what the agent must not do)'),
329
336
  }),
330
337
  }),
331
338
  }),
@@ -335,6 +342,18 @@ export const collections = {
335
342
  // without the generated docs site needing a workspace dep on @intentius/chant.
336
343
  const pluginSrcPath = fileURLToPath(new URL("./rehype-base-url.mjs", import.meta.url));
337
344
  copyFileSync(pluginSrcPath, join(outDir, "src", "rehype-base-url.mjs"));
345
+ // src/components/: the agent prompt card from chant core, and a PageTitle
346
+ // override that puts it under Starlight's title on every page with a `prompt:`.
347
+ mkdirSync(join(outDir, "src", "components"), { recursive: true });
348
+ copyFileSync(fileURLToPath(new URL("./docs-site/AgentPrompt.astro", import.meta.url)), join(outDir, "src", "components", "AgentPrompt.astro"));
349
+ writeFileSync(join(outDir, "src", "components", "PageTitle.astro"), `---
350
+ // Generated by chant's writeDocsSite. Starlight's page title, then the page's agent prompt.
351
+ import Default from '@astrojs/starlight/components/PageTitle.astro';
352
+ import AgentPrompt from './AgentPrompt.astro';
353
+ ---
354
+ <Default />
355
+ <AgentPrompt />
356
+ `);
338
357
  // astro.config.mjs
339
358
  const rehypeLine = config.basePath
340
359
  ? `\n markdown: {\n rehypePlugins: [[rehypeBaseUrl, { base: '${config.basePath}', projectBase: '/chant' }]],\n },`
@@ -348,6 +367,7 @@ export default defineConfig({${config.basePath ? `\n base: '${config.basePath}'
348
367
  integrations: [
349
368
  starlight({
350
369
  title: '${config.displayName}',
370
+ components: { PageTitle: './src/components/PageTitle.astro' },
351
371
  sidebar: ${JSON.stringify(sidebar, null, 6).replace(/\n/g, "\n ")},
352
372
  }),
353
373
  ],
@@ -139,7 +139,9 @@ import { type IntrinsicDef } from "../lexicon.js";
139
139
  * (`{...n}`) is shape-valid (`n` is a plain identifier) but `fold()`
140
140
  * rejects it once it discovers `n` folds to a number, not an object.
141
141
  * Only real evaluation catches this; EVL004 independently narrows
142
- * spread sources to a stricter "traceable to a const" shape, which
142
+ * spread sources to a stricter "traceable to a const" shape (a const
143
+ * declared in the file, or an imported binding, which fold() resolves
144
+ * from the exporting module's folded value), which
143
145
  * catches most real-world misuse without evaluating, but is not a
144
146
  * full substitute.
145
147
  *
@@ -1 +1 @@
1
- {"version":3,"file":"subset.d.ts","sourceRoot":"","sources":["../../src/fold/subset.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,YAAY,CAAC;AAEjC,OAAO,EAAiD,KAAK,YAAY,EAAE,MAAM,YAAY,CAAC;AAE9F;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwKG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;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,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,EAAE,CAAC,cAAc,GAAG,MAAM,CAErE;AAED,wBAAgB,4BAA4B,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,GAAG,MAAM,CAElE;AAED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,EAAE,CAAC,wBAAwB,EACjC,UAAU,CAAC,EAAE,SAAS,YAAY,EAAE,GACnC,eAAe,GAAG,SAAS,CAc7B;AAWD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,EAAE,CAAC,IAAI,EACb,UAAU,CAAC,EAAE,SAAS,YAAY,EAAE,GACnC,eAAe,GAAG,SAAS,CAkO7B"}
@@ -140,7 +140,9 @@ import { intrinsicCallFolds, intrinsicCallFoldsEagerly } from "../lexicon.js";
140
140
  * (`{...n}`) is shape-valid (`n` is a plain identifier) but `fold()`
141
141
  * rejects it once it discovers `n` folds to a number, not an object.
142
142
  * Only real evaluation catches this; EVL004 independently narrows
143
- * spread sources to a stricter "traceable to a const" shape, which
143
+ * spread sources to a stricter "traceable to a const" shape (a const
144
+ * declared in the file, or an imported binding, which fold() resolves
145
+ * from the exporting module's folded value), which
144
146
  * catches most real-world misuse without evaluating, but is not a
145
147
  * full substitute.
146
148
  *
@@ -1 +1 @@
1
- {"version":3,"file":"evl004-spread-non-const.d.ts","sourceRoot":"","sources":["../../../src/lint/rules/evl004-spread-non-const.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAA+B,MAAM,SAAS,CAAC;AAoGrE,eAAO,MAAM,wBAAwB,EAAE,QAUtC,CAAC"}
1
+ {"version":3,"file":"evl004-spread-non-const.d.ts","sourceRoot":"","sources":["../../../src/lint/rules/evl004-spread-non-const.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAA+B,MAAM,SAAS,CAAC;AAmHrE,eAAO,MAAM,wBAAwB,EAAE,QAUtC,CAAC"}
@@ -6,6 +6,11 @@ import { isInsideCompositeFactory } from "./composite-scope.js";
6
6
  * Spread expressions ({...x} or [...x]) must reference a const-declared
7
7
  * variable, object literal, or property access chain from a const.
8
8
  * Spreading from function calls or non-traceable sources is blocked.
9
+ *
10
+ * A binding imported from another module counts as const: an import can't
11
+ * be reassigned, and sharing an exported const (a preset, a list of
12
+ * Dockerfile steps) across modules is the point of exporting it. Whether the
13
+ * exporting module declared it `const` is that module's own EVL concern.
9
14
  */
10
15
  function isTraceableToConst(node, sourceFile) {
11
16
  // Object or array literals are fine
@@ -31,8 +36,21 @@ function isTraceableToConst(node, sourceFile) {
31
36
  return false;
32
37
  }
33
38
  function isConstIdentifier(id, sourceFile) {
34
- // Walk all statements looking for a const declaration of this identifier
39
+ // Walk all statements looking for a const declaration or an import of this identifier
35
40
  for (const stmt of sourceFile.statements) {
41
+ if (ts.isImportDeclaration(stmt) && stmt.importClause && !stmt.importClause.isTypeOnly) {
42
+ const clause = stmt.importClause;
43
+ if (clause.name?.text === id.text)
44
+ return true;
45
+ const bindings = clause.namedBindings;
46
+ if (bindings && ts.isNamedImports(bindings)) {
47
+ if (bindings.elements.some((el) => !el.isTypeOnly && el.name.text === id.text))
48
+ return true;
49
+ }
50
+ else if (bindings && ts.isNamespaceImport(bindings) && bindings.name.text === id.text) {
51
+ return true;
52
+ }
53
+ }
36
54
  if (ts.isVariableStatement(stmt)) {
37
55
  if (stmt.declarationList.flags & ts.NodeFlags.Const) {
38
56
  for (const decl of stmt.declarationList.declarations) {