@nowline/mcp 0.7.0 → 0.8.0

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 (44) hide show
  1. package/dist/branding.d.ts +20 -0
  2. package/dist/branding.d.ts.map +1 -0
  3. package/dist/branding.js +27 -0
  4. package/dist/branding.js.map +1 -0
  5. package/dist/diagnostics.d.ts +59 -0
  6. package/dist/diagnostics.d.ts.map +1 -0
  7. package/dist/diagnostics.js +117 -0
  8. package/dist/diagnostics.js.map +1 -0
  9. package/dist/generated/ui-bundle.d.ts +2 -0
  10. package/dist/generated/ui-bundle.d.ts.map +1 -1
  11. package/dist/generated/ui-bundle.js +4 -3
  12. package/dist/generated/ui-bundle.js.map +1 -1
  13. package/dist/reference-cheatsheet.d.ts +2 -0
  14. package/dist/reference-cheatsheet.d.ts.map +1 -0
  15. package/dist/reference-cheatsheet.js +47 -0
  16. package/dist/reference-cheatsheet.js.map +1 -0
  17. package/dist/schema-vocab.d.ts +6 -0
  18. package/dist/schema-vocab.d.ts.map +1 -0
  19. package/dist/schema-vocab.js +55 -0
  20. package/dist/schema-vocab.js.map +1 -0
  21. package/dist/schemas.d.ts +52 -0
  22. package/dist/schemas.d.ts.map +1 -1
  23. package/dist/schemas.js +24 -1
  24. package/dist/schemas.js.map +1 -1
  25. package/dist/server.d.ts +2 -0
  26. package/dist/server.d.ts.map +1 -1
  27. package/dist/server.js +312 -165
  28. package/dist/server.js.map +1 -1
  29. package/dist/ui/entry.js +148 -110
  30. package/dist/ui/entry.js.map +1 -1
  31. package/dist/ui/payload.d.ts +30 -0
  32. package/dist/ui/payload.d.ts.map +1 -0
  33. package/dist/ui/payload.js +49 -0
  34. package/dist/ui/payload.js.map +1 -0
  35. package/package.json +11 -7
  36. package/src/branding.ts +26 -0
  37. package/src/diagnostics.ts +185 -0
  38. package/src/generated/ui-bundle.ts +5 -3
  39. package/src/reference-cheatsheet.ts +47 -0
  40. package/src/schema-vocab.ts +55 -0
  41. package/src/schemas.ts +28 -1
  42. package/src/server.ts +419 -200
  43. package/src/ui/entry.ts +167 -122
  44. package/src/ui/payload.ts +63 -0
@@ -0,0 +1,47 @@
1
+ // Condensed DSL reference for the MCP `reference` discovery tool (format: condensed).
2
+
3
+ export const REFERENCE_CHEATSHEET = `# Nowline DSL — condensed reference
4
+
5
+ Every file starts with \`nowline v1\` on line 1.
6
+
7
+ ## Roadmap directive
8
+
9
+ \`\`\`
10
+ roadmap <id> "<title>" start:YYYY-MM-DD scale:2w
11
+ \`\`\`
12
+
13
+ Common keys: \`start:\`, \`scale:\`, \`length:\`, \`locale:\`, \`theme:\`, \`author:\`, \`calendar:\`.
14
+
15
+ ## Swimlanes and items
16
+
17
+ \`\`\`
18
+ swimlane <id> "<title>"
19
+ item <id> "<title>" duration:3w
20
+ \`\`\`
21
+
22
+ Entity types: \`swimlane\`, \`group\`, \`parallel\`, \`item\`, \`milestone\`, \`anchor\`.
23
+
24
+ Items need \`duration:\` or \`size:\`. Use 2-space indentation under parents.
25
+
26
+ ## Item properties
27
+
28
+ \`duration:\` (or \`size:\`), \`status:\`, \`remaining:\`, \`owner:\`, \`after:\`, \`before:\`, \`labels:\`, \`link:\`, \`style:\`.
29
+
30
+ There is NO \`progress:\` or \`color:\` key. Show completion with \`status:\` + \`remaining:\`; set visuals with a \`style:\` reference (see full reference).
31
+
32
+ ## Progress & status
33
+
34
+ \`\`\`
35
+ item api "API redesign" duration:4w status:in-progress remaining:40%
36
+ \`\`\`
37
+
38
+ \`status:\` values: \`planned\`, \`in-progress\` (alias \`active\`), \`done\` (alias \`completed\`), \`at-risk\`, \`blocked\`, or a custom \`status\` you declare earlier.
39
+
40
+ \`remaining:\` is the work *left*, written as a percent (\`40%\`) or an effort literal (\`1w\`). So an item that is 60% complete is \`remaining:40%\`. Omit \`remaining:\` for a fully open or fully done bar.
41
+
42
+ ## Config / includes (before roadmap)
43
+
44
+ \`config\` blocks, \`include "path.nowline"\` — see full reference for ordering rules.
45
+
46
+ Call \`reference\` with \`format: "full"\` for the complete man page, or \`examples\` for sample files.
47
+ `;
@@ -0,0 +1,55 @@
1
+ // Structured key vocabulary for the MCP `schema` discovery tool.
2
+ //
3
+ // This is the one place whose whole job is to give agents ACCURATE DSL
4
+ // keys so they stop hallucinating. Every key below is a real DSL token
5
+ // (verified against specs/dsl.md and the man page) — render/CLI options
6
+ // like `theme` or `now` are deliberately excluded because they are not
7
+ // part of the `.nowline` source language.
8
+
9
+ export const SCHEMA_VOCABULARY = {
10
+ // Keys valid on the `nowline` directive line (`locale`) and the
11
+ // `roadmap` declaration line. NOT render/CLI options (`theme`, `now`).
12
+ directiveKeys: [
13
+ 'locale',
14
+ 'author',
15
+ 'start',
16
+ 'scale',
17
+ 'length',
18
+ 'calendar',
19
+ 'logo',
20
+ 'logo-size',
21
+ ],
22
+ // Roadmap-section keywords — the declarable entity types.
23
+ entityTypes: [
24
+ 'swimlane',
25
+ 'item',
26
+ 'parallel',
27
+ 'group',
28
+ 'person',
29
+ 'team',
30
+ 'anchor',
31
+ 'label',
32
+ 'size',
33
+ 'status',
34
+ 'milestone',
35
+ 'footnote',
36
+ ],
37
+ // Properties valid on `item` declarations: item-specific keys plus the
38
+ // universal properties (`labels`, `link`, `style`, `description`).
39
+ // Visual treatment is a single `style:` reference — raw color/style
40
+ // props (`bg`, `fg`, `text`, ...) live in `style`/`default` config blocks.
41
+ itemPropertyKeys: [
42
+ 'status',
43
+ 'owner',
44
+ 'after',
45
+ 'before',
46
+ 'size',
47
+ 'duration',
48
+ 'remaining',
49
+ 'capacity',
50
+ 'labels',
51
+ 'link',
52
+ 'style',
53
+ 'description',
54
+ ],
55
+ } as const;
package/src/schemas.ts CHANGED
@@ -9,9 +9,17 @@ export const DiagnosticSchema = z.object({
9
9
  file: z.string(),
10
10
  line: z.number(),
11
11
  column: z.number(),
12
- severity: z.enum(['error', 'warning']),
12
+ severity: z.enum(['error', 'warning', 'info']),
13
13
  code: z.string(),
14
14
  message: z.string(),
15
+ suggestion: z.string().optional(),
16
+ });
17
+
18
+ export const InsightSchema = z.object({
19
+ severity: z.enum(['info', 'warning']),
20
+ code: z.string(),
21
+ message: z.string(),
22
+ entityId: z.string().optional(),
15
23
  });
16
24
 
17
25
  // ---- Tool output schemas ---------------------------------------------------
@@ -19,6 +27,7 @@ export const DiagnosticSchema = z.object({
19
27
  export const ValidateOutputSchema = z.object({
20
28
  ok: z.boolean(),
21
29
  diagnostics: z.array(DiagnosticSchema),
30
+ insights: z.array(InsightSchema).optional(),
22
31
  });
23
32
 
24
33
  export const ReadOutputSchema = z.object({
@@ -52,6 +61,7 @@ export const RenderOutputSchema = z.object({
52
61
  path: z.string().optional(),
53
62
  bytes: z.number().optional(),
54
63
  shareUrl: z.string().optional(),
64
+ insights: z.array(InsightSchema).optional(),
55
65
  });
56
66
 
57
67
  export const ExportOutputSchema = z.object({
@@ -77,3 +87,20 @@ export const CapabilitiesOutputSchema = z.object({
77
87
  export const ListItemsOutputSchema = z.object({
78
88
  items: z.array(z.string()),
79
89
  });
90
+
91
+ export const ReferenceOutputSchema = z.object({
92
+ format: z.enum(['condensed', 'full']),
93
+ text: z.string(),
94
+ });
95
+
96
+ export const ExamplesOutputSchema = z.object({
97
+ names: z.array(z.string()).optional(),
98
+ name: z.string().optional(),
99
+ source: z.string().optional(),
100
+ });
101
+
102
+ export const SchemaOutputSchema = z.object({
103
+ directiveKeys: z.array(z.string()),
104
+ entityTypes: z.array(z.string()),
105
+ itemPropertyKeys: z.array(z.string()),
106
+ });