@kozou/core 0.0.1 → 0.1.1

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 (47) hide show
  1. package/LICENSE +202 -0
  2. package/dist/buildSchemaContext.d.ts +19 -0
  3. package/dist/buildSchemaContext.d.ts.map +1 -0
  4. package/dist/buildSchemaContext.js +290 -0
  5. package/dist/buildSchemaContext.js.map +1 -0
  6. package/dist/checkEnum.d.ts +3 -0
  7. package/dist/checkEnum.d.ts.map +1 -0
  8. package/dist/checkEnum.js +35 -0
  9. package/dist/checkEnum.js.map +1 -0
  10. package/dist/displayField.d.ts +7 -0
  11. package/dist/displayField.d.ts.map +1 -0
  12. package/dist/displayField.js +10 -0
  13. package/dist/displayField.js.map +1 -0
  14. package/dist/index.d.ts +11 -0
  15. package/dist/index.d.ts.map +1 -0
  16. package/dist/index.js +11 -0
  17. package/dist/index.js.map +1 -0
  18. package/dist/loadUIHints.d.ts +16 -0
  19. package/dist/loadUIHints.d.ts.map +1 -0
  20. package/dist/loadUIHints.js +50 -0
  21. package/dist/loadUIHints.js.map +1 -0
  22. package/dist/parseCommentTags.d.ts +14 -0
  23. package/dist/parseCommentTags.d.ts.map +1 -0
  24. package/dist/parseCommentTags.js +142 -0
  25. package/dist/parseCommentTags.js.map +1 -0
  26. package/dist/types/adapter.d.ts +45 -0
  27. package/dist/types/adapter.d.ts.map +1 -0
  28. package/dist/types/adapter.js +8 -0
  29. package/dist/types/adapter.js.map +1 -0
  30. package/dist/types/context.d.ts +112 -0
  31. package/dist/types/context.d.ts.map +1 -0
  32. package/dist/types/context.js +7 -0
  33. package/dist/types/context.js.map +1 -0
  34. package/dist/types/raw.d.ts +95 -0
  35. package/dist/types/raw.d.ts.map +1 -0
  36. package/dist/types/raw.js +8 -0
  37. package/dist/types/raw.js.map +1 -0
  38. package/dist/types/ui-hints.d.ts +139 -0
  39. package/dist/types/ui-hints.d.ts.map +1 -0
  40. package/dist/types/ui-hints.js +50 -0
  41. package/dist/types/ui-hints.js.map +1 -0
  42. package/dist/widget.d.ts +11 -0
  43. package/dist/widget.d.ts.map +1 -0
  44. package/dist/widget.js +31 -0
  45. package/dist/widget.js.map +1 -0
  46. package/package.json +42 -4
  47. package/README.md +0 -3
@@ -0,0 +1,16 @@
1
+ import { type UIHints } from './types/ui-hints.js';
2
+ export declare class KozouUIHintsError extends Error {
3
+ readonly filePath: string;
4
+ readonly issues: {
5
+ path: string;
6
+ message: string;
7
+ line?: number;
8
+ }[];
9
+ constructor(message: string, filePath: string, issues: {
10
+ path: string;
11
+ message: string;
12
+ line?: number;
13
+ }[]);
14
+ }
15
+ export declare function loadUIHints(filePath: string): Promise<UIHints>;
16
+ //# sourceMappingURL=loadUIHints.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"loadUIHints.d.ts","sourceRoot":"","sources":["../src/loadUIHints.ts"],"names":[],"mappings":"AAIA,OAAO,EAAiB,KAAK,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAElE,qBAAa,iBAAkB,SAAQ,KAAK;IAC1C,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,MAAM,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;gBAElE,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,EAAE;CAO7D;AAMD,wBAAsB,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAuCpE"}
@@ -0,0 +1,50 @@
1
+ import { readFile } from 'node:fs/promises';
2
+ import { basename } from 'node:path';
3
+ import { parseDocument } from 'yaml';
4
+ import { ZodError } from 'zod';
5
+ import { uiHintsSchema } from './types/ui-hints.js';
6
+ export class KozouUIHintsError extends Error {
7
+ filePath;
8
+ issues;
9
+ constructor(message, filePath, issues) {
10
+ super(message);
11
+ this.name = 'KozouUIHintsError';
12
+ this.filePath = filePath;
13
+ this.issues = issues;
14
+ }
15
+ }
16
+ // Codex N2: by default the error message only includes the file basename.
17
+ // The absolute path is kept on KozouUIHintsError.filePath; callers can decide
18
+ // whether to surface it in debug logs. This prevents user-environment paths
19
+ // from leaking through CLI / MCP error responses.
20
+ export async function loadUIHints(filePath) {
21
+ const content = await readFile(filePath, 'utf8');
22
+ const fileLabel = basename(filePath);
23
+ const doc = parseDocument(content, { prettyErrors: true });
24
+ if (doc.errors.length > 0) {
25
+ const issues = doc.errors.map((e) => ({
26
+ path: '<yaml>',
27
+ message: e.message,
28
+ line: e.linePos?.[0]?.line,
29
+ }));
30
+ throw new KozouUIHintsError(`YAML parse error (${fileLabel}): ${doc.errors.length} issue(s)`, filePath, issues);
31
+ }
32
+ const json = doc.toJS();
33
+ if (json === null || json === undefined) {
34
+ return uiHintsSchema.parse({});
35
+ }
36
+ try {
37
+ return uiHintsSchema.parse(json);
38
+ }
39
+ catch (err) {
40
+ if (err instanceof ZodError) {
41
+ const issues = err.issues.map((issue) => ({
42
+ path: issue.path.join('.') || '<root>',
43
+ message: issue.message,
44
+ }));
45
+ throw new KozouUIHintsError(`UIHints validation error (${fileLabel}): ${issues.length} issue(s)`, filePath, issues);
46
+ }
47
+ throw err;
48
+ }
49
+ }
50
+ //# sourceMappingURL=loadUIHints.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"loadUIHints.js","sourceRoot":"","sources":["../src/loadUIHints.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AACrC,OAAO,EAAE,aAAa,EAAE,MAAM,MAAM,CAAC;AACrC,OAAO,EAAE,QAAQ,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AI,IAAI,KAAK,IAAI,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;QACxC,OAAO,aAAa,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;IACjC,CAAC;IAED,IAAI,CAAC;QACH,OAAO,aAAa,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IACnC,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,IAAI,GAAG,YAAY,QAAQ,EAAE,CAAC;YAC5B,MAAM,MAAM,GAAG,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;gBACxC,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,QAAQ;gBACtC,OAAO,EAAE,KAAK,CAAC,OAAO;aACvB,CAAC,CAAC,CAAC;YACJ,MAAM,IAAI,iBAAiB,CACzB,6BAA6B,SAAS,MAAM,MAAM,CAAC,MAAM,WAAW,EACpE,QAAQ,EACR,MAAM,CACP,CAAC;QACJ,CAAC;QACD,MAAM,GAAG,CAAC;IACZ,CAAC;AACH,CAAC"}
@@ -0,0 +1,14 @@
1
+ import type { WidgetType } from './types/context.js';
2
+ export type ExampleQuery = {
3
+ description: string;
4
+ sql: string;
5
+ };
6
+ export type ParsedComment = {
7
+ body: string;
8
+ ai: string[];
9
+ widget: WidgetType | null;
10
+ policy: string[];
11
+ examples: ExampleQuery[];
12
+ };
13
+ export declare function parseCommentTags(comment: string | null): ParsedComment;
14
+ //# sourceMappingURL=parseCommentTags.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parseCommentTags.d.ts","sourceRoot":"","sources":["../src/parseCommentTags.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAqBrD,MAAM,MAAM,YAAY,GAAG;IACzB,WAAW,EAAE,MAAM,CAAC;IACpB,GAAG,EAAE,MAAM,CAAC;CACb,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,EAAE,CAAC;IACb,MAAM,EAAE,UAAU,GAAG,IAAI,CAAC;IAC1B,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,QAAQ,EAAE,YAAY,EAAE,CAAC;CAC1B,CAAC;AAWF,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,GAAG,aAAa,CAqFtE"}
@@ -0,0 +1,142 @@
1
+ // Parse Kozou v0.1 COMMENT tag conventions (`@ai:`, `@widget:`,
2
+ // `@policy:`, `@example:`). See Kozou v0.1 design spec §10.1 for the
3
+ // tag vocabulary and §7.3.6 for the `exampleQueries` MCP surface.
4
+ //
5
+ // `@example:` is the only multi-line tag in v0.1: the line itself
6
+ // carries the human-facing description (may be empty), and any
7
+ // indented continuation lines form the SQL body. The first non-
8
+ // indented line (or another `@tag:`) terminates the block, and the
9
+ // shared leading indent across continuation lines is stripped so the
10
+ // resulting `sql` reads as written without the COMMENT-imposed
11
+ // indent. The block is lifted out of `body` because the SQL is
12
+ // surfaced separately via `examples`.
13
+ const KNOWN_WIDGETS = new Set([
14
+ 'text',
15
+ 'textarea',
16
+ 'number',
17
+ 'boolean',
18
+ 'date',
19
+ 'datetime',
20
+ 'enum-select',
21
+ 'relation-select',
22
+ 'json',
23
+ 'image-url',
24
+ 'uuid',
25
+ 'currency',
26
+ ]);
27
+ const KNOWN_TAGS = new Set(['ai', 'widget', 'policy', 'example']);
28
+ const TAG_RE = /^\s*@([a-zA-Z_][a-zA-Z0-9_]*)\s*:\s*(.*)$/;
29
+ const INDENT_RE = /^[ \t]/;
30
+ function isWidgetType(value) {
31
+ return KNOWN_WIDGETS.has(value);
32
+ }
33
+ export function parseCommentTags(comment) {
34
+ const result = {
35
+ body: '',
36
+ ai: [],
37
+ widget: null,
38
+ policy: [],
39
+ examples: [],
40
+ };
41
+ if (comment === null || comment === '')
42
+ return result;
43
+ const lines = comment.split('\n');
44
+ const bodyLines = [];
45
+ let pending = null;
46
+ function flushPending() {
47
+ if (pending === null)
48
+ return;
49
+ result.examples.push({
50
+ description: pending.description,
51
+ sql: dedent(pending.sqlLines).replace(/\s+$/, ''),
52
+ });
53
+ pending = null;
54
+ }
55
+ for (const line of lines) {
56
+ // Inside an `@example:` block: indented (or blank) lines extend the
57
+ // SQL body. An empty line is treated as part of the SQL paragraph
58
+ // so callers can include blank separators inside multi-statement
59
+ // examples.
60
+ if (pending !== null) {
61
+ if (line.length === 0 || INDENT_RE.test(line)) {
62
+ pending.sqlLines.push(line);
63
+ continue;
64
+ }
65
+ // Non-indented line ends the example.
66
+ flushPending();
67
+ // Fall through to handle this line normally.
68
+ }
69
+ const match = TAG_RE.exec(line);
70
+ if (!match) {
71
+ bodyLines.push(line);
72
+ continue;
73
+ }
74
+ const tag = match[1].toLowerCase();
75
+ const value = match[2].trim();
76
+ if (tag === 'ai') {
77
+ result.ai.push(value);
78
+ bodyLines.push(line);
79
+ continue;
80
+ }
81
+ if (tag === 'widget') {
82
+ if (isWidgetType(value)) {
83
+ result.widget = value;
84
+ }
85
+ else {
86
+ console.warn(`[@kozou/core] parseCommentTags: invalid @widget value "${value}" (skip)`);
87
+ result.widget = null;
88
+ }
89
+ continue;
90
+ }
91
+ if (tag === 'policy') {
92
+ result.policy.push(value);
93
+ bodyLines.push(line);
94
+ continue;
95
+ }
96
+ if (tag === 'example') {
97
+ // Open an example block. The continuation collector above keeps
98
+ // pushing indented lines into `sqlLines` until the next non-
99
+ // indented line, the next tag, or the end of the comment.
100
+ pending = { description: value, sqlLines: [] };
101
+ continue;
102
+ }
103
+ if (!KNOWN_TAGS.has(tag)) {
104
+ console.warn(`[@kozou/core] parseCommentTags: unknown tag "@${tag}" (forward compat: kept in body)`);
105
+ bodyLines.push(line);
106
+ }
107
+ }
108
+ flushPending();
109
+ result.body = bodyLines.join('\n').replace(/\s+$/, '');
110
+ return result;
111
+ }
112
+ /** Strip the longest common leading whitespace from every non-empty
113
+ * line so multi-line SQL reads as written rather than indented by
114
+ * the COMMENT block. Blank lines are preserved as empty strings. */
115
+ function dedent(lines) {
116
+ const nonEmpty = lines.filter((l) => l.trim().length > 0);
117
+ if (nonEmpty.length === 0)
118
+ return lines.join('\n');
119
+ let commonPrefix = leadingWhitespace(nonEmpty[0]);
120
+ for (const line of nonEmpty.slice(1)) {
121
+ const prefix = leadingWhitespace(line);
122
+ let i = 0;
123
+ while (i < commonPrefix.length &&
124
+ i < prefix.length &&
125
+ commonPrefix[i] === prefix[i]) {
126
+ i++;
127
+ }
128
+ commonPrefix = commonPrefix.slice(0, i);
129
+ if (commonPrefix.length === 0)
130
+ break;
131
+ }
132
+ if (commonPrefix.length === 0)
133
+ return lines.join('\n');
134
+ return lines
135
+ .map((l) => (l.startsWith(commonPrefix) ? l.slice(commonPrefix.length) : l))
136
+ .join('\n');
137
+ }
138
+ function leadingWhitespace(line) {
139
+ const match = line.match(/^[ \t]*/);
140
+ return match ? match[0] : '';
141
+ }
142
+ //# sourceMappingURL=parseCommentTags.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parseCommentTags.js","sourceRoot":"","sources":["../src/parseCommentTags.ts"],"names":[],"mappings":"AAAA,gEAAgE;AAChE,qEAAqE;AACrE,kEAAkE;AAClE,EAAE;AACF,kEAAkE;AAClE,+DAA+D;AAC/D,gEAAgE;AAChE,mEAAmE;AACnE,qEAAqE;AACrE,+DAA+D;AAC/D,+DAA+D;AAC/D,sCAAsC;AAItC,MAAM,aAAa,GAA4B,IAAI,GAAG,CAAa;IACjE,MAAM;IACN,UAAU;IACV,QAAQ;IACR,SAAS;IACT,MAAM;IACN,UAAU;IACV,aAAa;IACb,iBAAiB;IACjB,MAAM;IACN,WAAW;IACX,MAAM;IACN,UAAU;CACX,CAAC,CAAC;AAEH,MAAM,UAAU,GAAG,IAAI,GAAG,CAAC,CAAC,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,SAAS,CAAC,CAAC,CAAC;AACl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AE,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACvD,OAAO,KAAK;SACT,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;SAC3E,IAAI,CAAC,IAAI,CAAC,CAAC;AAChB,CAAC;AAED,SAAS,iBAAiB,CAAC,IAAY;IACrC,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;IACpC,OAAO,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;AAC/B,CAAC"}
@@ -0,0 +1,45 @@
1
+ export interface DataAdapter {
2
+ /** List records (pagination, search, sort) */
3
+ list(resource: string, params: ListParams): Promise<ListResult>;
4
+ /** Fetch a single record */
5
+ get(resource: string, id: string | number): Promise<Record<string, unknown>>;
6
+ /** Create a record */
7
+ create(resource: string, data: Record<string, unknown>): Promise<Record<string, unknown>>;
8
+ /** Update a record */
9
+ update(resource: string, id: string | number, data: Record<string, unknown>): Promise<Record<string, unknown>>;
10
+ /** Delete a record */
11
+ delete(resource: string, id: string | number): Promise<void>;
12
+ /** Lightweight search used by relation-select (returns label / search fields only) */
13
+ searchRelation(resource: string, params: SearchRelationParams): Promise<RelationOption[]>;
14
+ }
15
+ export type ListParams = {
16
+ /** Free-text search query (v0.1 is `ilike`-based) */
17
+ search?: string;
18
+ /** Per-column filters; values are forwarded verbatim */
19
+ filters?: Record<string, unknown>;
20
+ sort?: SortSpec[];
21
+ /** 1-based page index */
22
+ page?: number;
23
+ pageSize?: number;
24
+ };
25
+ export type SortSpec = {
26
+ field: string;
27
+ order: 'asc' | 'desc';
28
+ };
29
+ export type ListResult = {
30
+ rows: Record<string, unknown>[];
31
+ total: number;
32
+ page: number;
33
+ pageSize: number;
34
+ };
35
+ export type SearchRelationParams = {
36
+ query: string;
37
+ labelField: string;
38
+ searchFields: string[];
39
+ limit?: number;
40
+ };
41
+ export type RelationOption = {
42
+ id: string | number;
43
+ label: string;
44
+ };
45
+ //# sourceMappingURL=adapter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"adapter.d.ts","sourceRoot":"","sources":["../../src/types/adapter.ts"],"names":[],"mappings":"AAOA,MAAM,WAAW,WAAW;IAC1B,8CAA8C;IAC9C,IAAI,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;IAEhE,4BAA4B;IAC5B,GAAG,CAAC,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IAE7E,sBAAsB;IACtB,MAAM,CACJ,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC5B,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IAEpC,sBAAsB;IACtB,MAAM,CACJ,QAAQ,EAAE,MAAM,EAChB,EAAE,EAAE,MAAM,GAAG,MAAM,EACnB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC5B,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IAEpC,sBAAsB;IACtB,MAAM,CAAC,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAE7D,sFAAsF;IACtF,cAAc,CACZ,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,oBAAoB,GAC3B,OAAO,CAAC,cAAc,EAAE,CAAC,CAAC;CAC9B;AAED,MAAM,MAAM,UAAU,GAAG;IACvB,qDAAqD;IACrD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,wDAAwD;IACxD,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAClC,IAAI,CAAC,EAAE,QAAQ,EAAE,CAAC;IAClB,yBAAyB;IACzB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,QAAQ,GAAG;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,KAAK,GAAG,MAAM,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG;IACvB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAC;IAChC,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG;IACjC,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG;IAC3B,EAAE,EAAE,MAAM,GAAG,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;CACf,CAAC"}
@@ -0,0 +1,8 @@
1
+ // DataAdapter interface as defined in Kozou v0.1 spec §4.4.
2
+ //
3
+ // In v0.1 the first concrete adapter ships under @kozou/core. Defining a
4
+ // pluggable boundary up front lets v0.2's `@kozou/api` slot in as a
5
+ // non-breaking change (see end of Kozou v0.1 spec §4.4). For the concrete
6
+ // adapter implementation names, refer to Kozou v0.1 spec §4.4.
7
+ export {};
8
+ //# sourceMappingURL=adapter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"adapter.js","sourceRoot":"","sources":["../../src/types/adapter.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,EAAE;AACF,yEAAyE;AACzE,oEAAoE;AACpE,0EAA0E;AAC1E,+DAA+D"}
@@ -0,0 +1,112 @@
1
+ import type { RawTable, RawView } from './raw.js';
2
+ /** Output of core.buildSchemaContext; input to MCP / UI. */
3
+ export type SchemaContext = {
4
+ meta: {
5
+ serverVersion: string;
6
+ builtAt: string;
7
+ sourceSchemas: string[];
8
+ };
9
+ tables: TableContext[];
10
+ views: ViewContext[];
11
+ enums: EnumContext[];
12
+ /** Domain concepts derived from views (in v0.1, every view is a concept) */
13
+ concepts: ConceptContext[];
14
+ };
15
+ export type TableContext = {
16
+ schema: string;
17
+ name: string;
18
+ /** "schema.name" */
19
+ qualifiedName: string;
20
+ /** Order: UI Hints > first line of COMMENT > name */
21
+ label: string;
22
+ /** Full COMMENT body (plain, with @ai/@widget/@policy tags stripped) */
23
+ description: string | null;
24
+ /** Lines from the COMMENT that start with `@ai:` */
25
+ aiDescription: string | null;
26
+ primaryKey: string[];
27
+ /** From UI Hints; otherwise a heuristic (Kozou v0.1 spec §6.5) */
28
+ displayField: string | null;
29
+ columns: ColumnContext[];
30
+ relations: RelationContext[];
31
+ /** Raw record kept for downstream consumers */
32
+ rawTable: RawTable;
33
+ };
34
+ export type ColumnContext = {
35
+ name: string;
36
+ dataType: string;
37
+ nullable: boolean;
38
+ defaultExpr: string | null;
39
+ isPrimaryKey: boolean;
40
+ isForeignKey: boolean;
41
+ label: string;
42
+ description: string | null;
43
+ aiDescription: string | null;
44
+ /** Order: UI Hints > @widget: tag > heuristic (Kozou v0.1 spec §6.4) */
45
+ widget: WidgetType;
46
+ /** Values extracted from CHECK constraints, or PostgreSQL ENUM members */
47
+ enumValues: string[] | null;
48
+ /** Sourced from UI Hints */
49
+ readonly: boolean;
50
+ };
51
+ /** Widget domain for Kozou v0.1 spec §6.4. */
52
+ export type WidgetType = 'text' | 'textarea' | 'number' | 'boolean' | 'date' | 'datetime' | 'enum-select' | 'relation-select' | 'json' | 'image-url' | 'uuid' | 'currency';
53
+ export type RelationContext = {
54
+ /** Column on this side of the relation (v0.1 limits this to 1) */
55
+ field: string;
56
+ references: {
57
+ schema: string;
58
+ table: string;
59
+ column: string;
60
+ };
61
+ /** v0.1 supports only these two */
62
+ cardinality: 'many-to-one' | 'one-to-one';
63
+ /** From the FK's COMMENT */
64
+ meaning: string | null;
65
+ };
66
+ export type ViewContext = {
67
+ schema: string;
68
+ name: string;
69
+ qualifiedName: string;
70
+ label: string;
71
+ description: string | null;
72
+ aiDescription: string | null;
73
+ /** First paragraph of the COMMENT */
74
+ purpose: string | null;
75
+ columns: ColumnContext[];
76
+ underlyingTables: {
77
+ schema: string;
78
+ name: string;
79
+ }[];
80
+ /** Raw record kept for downstream consumers (e.g. MCP describe_view.definition) */
81
+ rawView: RawView;
82
+ };
83
+ export type EnumContext = {
84
+ schema: string;
85
+ name: string;
86
+ values: string[];
87
+ description: string | null;
88
+ };
89
+ /** v0.1: ConceptContext is a thin wrapper around ViewContext. See end of Kozou v0.1 spec §4.2. */
90
+ export type ConceptContext = {
91
+ /** Matches ViewContext.name */
92
+ name: string;
93
+ label: string;
94
+ description: string | null;
95
+ /** Hard-coded "VIEW" in v0.1, with room to grow (e.g. "FUNCTION") */
96
+ kind: 'VIEW';
97
+ /** Suggested query path: targets the VIEW can be joined to */
98
+ joinSuggestions: {
99
+ table: string;
100
+ on: string;
101
+ }[];
102
+ /** @ai: lines from the COMMENT */
103
+ aiNotes: string[];
104
+ /** @example: blocks from the COMMENT (Kozou v0.1 spec §7.3.6). Each
105
+ * entry is `{ description, sql }`: the text on the `@example:`
106
+ * line and the indented continuation block. */
107
+ exampleQueries: {
108
+ description: string;
109
+ sql: string;
110
+ }[];
111
+ };
112
+ //# sourceMappingURL=context.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/types/context.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,QAAQ,EAA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,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5B,CAAC;AAEF,kGAAkG;AAClG,MAAM,MAAM,cAAc,GAAG;IAC3B,+BAA+B;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,qEAAqE;IACrE,IAAI,EAAE,MAAM,CAAC;IACb,8DAA8D;IAC9D,eAAe,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,EAAE,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IACjD,kCAAkC;IAClC,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB;;oDAEgD;IAChD,cAAc,EAAE;QAAE,WAAW,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;CACxD,CAAC"}
@@ -0,0 +1,7 @@
1
+ // SchemaContext type definitions per Kozou v0.1 spec §4.2.
2
+ //
3
+ // This is the output contract of @kozou/core.buildSchemaContext and the
4
+ // input contract for @kozou/mcp and @kozou/svelte-ui. Per Kozou v0.1 spec
5
+ // §0, the code is the source of truth.
6
+ export {};
7
+ //# sourceMappingURL=context.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context.js","sourceRoot":"","sources":["../../src/types/context.ts"],"names":[],"mappings":"AAAA,2DAA2D;AAC3D,EAAE;AACF,wEAAwE;AACxE,0EAA0E;AAC1E,uCAAuC"}
@@ -0,0 +1,95 @@
1
+ /** introspect output: the raw structural information pulled from PostgreSQL. */
2
+ export type RawIntrospection = {
3
+ /** PostgreSQL server version, e.g. "16.2" */
4
+ serverVersion: string;
5
+ /** When introspect ran (ISO 8601) */
6
+ introspectedAt: string;
7
+ /** Target schemas (default: ["public"]) */
8
+ schemas: string[];
9
+ tables: RawTable[];
10
+ views: RawView[];
11
+ enums: RawEnum[];
12
+ /** v0.1 collects these but uses them sparingly in UI/MCP */
13
+ functions: RawFunction[];
14
+ };
15
+ export type RawTable = {
16
+ schema: string;
17
+ name: string;
18
+ comment: string | null;
19
+ columns: RawColumn[];
20
+ /** Array of column names */
21
+ primaryKey: string[];
22
+ foreignKeys: RawForeignKey[];
23
+ checks: RawCheck[];
24
+ indexes: RawIndex[];
25
+ /** Planner-maintained row count estimate (`pg_class.reltuples`).
26
+ * PostgreSQL stores -1 for "never analyzed"; that case maps to
27
+ * null here so consumers always see "a non-negative count, or
28
+ * unknown" instead of mixing the sentinel into the numeric
29
+ * domain. Surfaced through `list_tables` (Kozou v0.1 spec §7.3.1). */
30
+ rowCountEstimate: number | null;
31
+ };
32
+ export type RawColumn = {
33
+ name: string;
34
+ /** e.g. "uuid", "text", "numeric(12,2)", "timestamptz" */
35
+ dataType: string;
36
+ /** information_schema.columns.udt_name */
37
+ udtName: string;
38
+ nullable: boolean;
39
+ defaultExpr: string | null;
40
+ comment: string | null;
41
+ /** Ordinal position (1-based, from information_schema.columns) */
42
+ position: number;
43
+ };
44
+ export type RawForeignKey = {
45
+ name: string;
46
+ /** Column name(s) on the referencing (this) side */
47
+ columns: string[];
48
+ referencedSchema: string;
49
+ referencedTable: string;
50
+ referencedColumns: string[];
51
+ onDelete: FkAction;
52
+ onUpdate: FkAction;
53
+ comment: string | null;
54
+ };
55
+ export type FkAction = 'NO ACTION' | 'RESTRICT' | 'CASCADE' | 'SET NULL' | 'SET DEFAULT';
56
+ export type RawCheck = {
57
+ name: string;
58
+ /** Raw CHECK expression, e.g. "status IN ('for_sale', 'reserved', 'sold')" */
59
+ expression: string;
60
+ };
61
+ export type RawIndex = {
62
+ name: string;
63
+ columns: string[];
64
+ unique: boolean;
65
+ };
66
+ export type RawView = {
67
+ schema: string;
68
+ name: string;
69
+ comment: string | null;
70
+ /** Inferred columns of the VIEW (with their own COMMENTs) */
71
+ columns: RawColumn[];
72
+ /** Underlying tables resolved by parsing the view definition where possible */
73
+ underlyingTables: {
74
+ schema: string;
75
+ name: string;
76
+ }[];
77
+ /** pg_views.definition */
78
+ definition: string;
79
+ };
80
+ export type RawEnum = {
81
+ schema: string;
82
+ name: string;
83
+ values: string[];
84
+ };
85
+ export type RawFunction = {
86
+ schema: string;
87
+ name: string;
88
+ returnType: string;
89
+ arguments: {
90
+ name: string;
91
+ type: string;
92
+ }[];
93
+ comment: string | null;
94
+ };
95
+ //# sourceMappingURL=raw.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"raw.d.ts","sourceRoot":"","sources":["../../src/types/raw.ts"],"names":[],"mappings":"AAOA,gFAAgF;AAChF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,6CAA6C;IAC7C,aAAa,EAAE,MAAM,CAAC;IACtB,qCAAqC;IACrC,cAAc,EAAE,MAAM,CAAC;IACvB,2CAA2C;IAC3C,OAAO,EAAE,MAAM,EAAE,CAAC;IAElB,MAAM,EAAE,QAAQ,EAAE,CAAC;IACnB,KAAK,EAAE,OAAO,EAAE,CAAC;IACjB,KAAK,EAAE,OAAO,EAAE,CAAC;IACjB,4DAA4D;IAC5D,SAAS,EAAE,WAAW,EAAE,CAAC;CAC1B,CAAC;AAEF,MAAM,MAAM,QAAQ,GAAG;IACrB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,OAAO,EAAE,SAAS,EAAE,CAAC;IACrB,4BAA4B;IAC5B,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,WAAW,EAAE,aAAa,EAAE,CAAC;IAC7B,MAAM,EAAE,QAAQ,EAAE,CAAC;IACnB,OAAO,EAAE,QAAQ,EAAE,CAAC;IACpB;;;;2EAIuE;IACvE,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;CACjC,CAAC;AAEF,MAAM,MAAM,SAAS,GAAG;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,0DAA0D;IAC1D,QAAQ,EAAE,MAAM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MAAM,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,OAAO,GAAG;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IAC5C,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;CACxB,CAAC"}
@@ -0,0 +1,8 @@
1
+ // RawIntrospection type definitions per Kozou v0.1 spec §4.1. This is the
2
+ // output contract of @kozou/introspect.
3
+ //
4
+ // Per Kozou v0.1 spec §0, this file is the source of truth on the code
5
+ // side; when type changes diverge from the spec, the same PR must update
6
+ // Kozou v0.1 spec.
7
+ export {};
8
+ //# sourceMappingURL=raw.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"raw.js","sourceRoot":"","sources":["../../src/types/raw.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,wCAAwC;AACxC,EAAE;AACF,uEAAuE;AACvE,yEAAyE;AACzE,mBAAmB"}