kozou 0.1.0 → 0.2.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 (41) hide show
  1. package/README.md +85 -14
  2. package/dist/cli.js +37 -5
  3. package/dist/cli.js.map +1 -1
  4. package/dist/commands/codegen.d.ts +8 -0
  5. package/dist/commands/codegen.d.ts.map +1 -0
  6. package/dist/commands/codegen.js +54 -0
  7. package/dist/commands/codegen.js.map +1 -0
  8. package/dist/commands/dev-runtime.d.ts +21 -0
  9. package/dist/commands/dev-runtime.d.ts.map +1 -0
  10. package/dist/commands/dev-runtime.js +111 -0
  11. package/dist/commands/dev-runtime.js.map +1 -0
  12. package/dist/commands/dev.d.ts +5 -1
  13. package/dist/commands/dev.d.ts.map +1 -1
  14. package/dist/commands/dev.js +168 -17
  15. package/dist/commands/dev.js.map +1 -1
  16. package/dist/commands/docs.d.ts +8 -0
  17. package/dist/commands/docs.d.ts.map +1 -0
  18. package/dist/commands/docs.js +44 -0
  19. package/dist/commands/docs.js.map +1 -0
  20. package/dist/commands/mcp.d.ts +1 -0
  21. package/dist/commands/mcp.d.ts.map +1 -1
  22. package/dist/commands/mcp.js +12 -12
  23. package/dist/commands/mcp.js.map +1 -1
  24. package/dist/config.d.ts +39 -141
  25. package/dist/config.d.ts.map +1 -1
  26. package/dist/config.js +127 -10
  27. package/dist/config.js.map +1 -1
  28. package/dist/docs.d.ts +3 -0
  29. package/dist/docs.d.ts.map +1 -0
  30. package/dist/docs.js +204 -0
  31. package/dist/docs.js.map +1 -0
  32. package/dist/index.d.ts +1 -1
  33. package/dist/index.d.ts.map +1 -1
  34. package/dist/index.js +12 -1
  35. package/dist/index.js.map +1 -1
  36. package/dist/scaffold.d.ts.map +1 -1
  37. package/dist/scaffold.js +17 -6
  38. package/dist/scaffold.js.map +1 -1
  39. package/dist/templates/docker-compose.yml +27 -26
  40. package/dist/templates/env.example +14 -0
  41. package/package.json +19 -7
@@ -1,21 +1,172 @@
1
1
  // `kozou dev` command implementation.
2
2
  //
3
- // In v0.1 this is a deliberate stub: the Admin UI (`@kozou/svelte-ui`) is
4
- // scheduled for v0.1.1 per the Kozou v0.1 design spec §16.1.1 B, so there is nothing for the
5
- // dev server to host yet. Until the UI lands, we print a hand-off message
6
- // pointing adopters at `kozou mcp --stdio` for AI agent access.
7
- const DEV_HANDOFF_MESSAGE = 'kozou dev: the bundled Admin UI is scheduled for v0.1.1.\n' +
8
- ' See Kozou v0.1 design spec §16.1.1 B for the roadmap and §8 for the\n' +
9
- ' @kozou/svelte-ui specification.\n' +
10
- '\n' +
11
- ' Available today:\n' +
12
- ' kozou mcp --stdio Run the MCP server for AI agent access.\n' +
13
- ' kozou inspect Dump the Schema Context as JSON or YAML.\n';
14
- // The leading underscore on `_opts` flags this as a deliberately ignored
15
- // parameter (eslint argsIgnorePattern: ^_). The full DevOptions shape is
16
- // kept in the signature so it matches the v0.1.1 implementation that
17
- // will actually consume the config.
18
- export async function devCommand(_opts = {}) {
19
- process.stderr.write(DEV_HANDOFF_MESSAGE);
3
+ // Brings up the full local runtime described in Kozou v0.1 spec §9.1:
4
+ // - the bundled @kozou/svelte-ui Admin UI, spawned as a child process
5
+ // (`node <svelte-ui>/build/index.js` the adapter-node standalone
6
+ // server, the same entry the svelte-ui E2E suite exercises);
7
+ // - the MCP Streamable HTTP server, run in-process via @kozou/mcp's
8
+ // startHttpServer (spec §7.1).
9
+ //
10
+ // Both default to 0.0.0.0 (spec §9.1, so `docker compose` port mapping
11
+ // works); a loud warning fires on a non-loopback bind because neither
12
+ // surface authenticates in v0.1 (spec §18.5).
13
+ //
14
+ // The Admin UI is an adapter-node (SvelteKit) server: without ORIGIN it
15
+ // assumes https and rejects every form POST over plain http with a 403.
16
+ // We default ORIGIN to http://localhost:<ui-port>; override via the
17
+ // ORIGIN / KOZOU_ORIGIN env when serving on a different public URL.
18
+ import { spawn } from 'node:child_process';
19
+ import { existsSync } from 'node:fs';
20
+ import { SchemaCache, startHttpServer, isLoopbackHost } from '@kozou/mcp';
21
+ import { loadConfig } from '../config.js';
22
+ import { buildAdminUiEnv, resolveAdminUiEntry, resolveAdminUiToken, resolveOrigin, } from './dev-runtime.js';
23
+ const PREFIX = '[kozou dev]';
24
+ // The in-house @kozou/api server is reached only by the Admin UI's
25
+ // server-side fetch (same host), so bind it to loopback — no need to
26
+ // expose it to the browser or the network.
27
+ const API_HOST = '127.0.0.1';
28
+ const DEFAULT_API_PORT = 3335;
29
+ // Start the in-house @kozou/api server in-process: introspect the
30
+ // configured database, build its SchemaContext, and serve it over a pg
31
+ // pool. @kozou/api is an experimental, unpublished workspace package, so
32
+ // it is imported dynamically and is only resolvable from a source /
33
+ // workspace checkout — a published `kozou` install gets a clear error.
34
+ async function startInhouseApi(config, port) {
35
+ let apiModule;
36
+ try {
37
+ apiModule = await import('@kozou/api');
38
+ }
39
+ catch {
40
+ throw new Error(`${PREFIX} --adapter api needs the experimental @kozou/api package, which is ` +
41
+ 'not bundled in this release. Run kozou from a source / workspace checkout ' +
42
+ 'to use it, or drop --adapter api to use the default REST adapter.');
43
+ }
44
+ const { introspect } = await import('@kozou/introspect');
45
+ const { buildSchemaContext } = await import('@kozou/core');
46
+ const { default: pg } = await import('pg');
47
+ const raw = await introspect({
48
+ connection: config.database.url,
49
+ schemas: config.database.schemas,
50
+ });
51
+ const schema = await buildSchemaContext({ raw });
52
+ const pool = new pg.Pool({ connectionString: config.database.url });
53
+ const server = await apiModule.startApiServer({
54
+ schema,
55
+ db: { query: (text, values) => pool.query(text, values) },
56
+ // When `auth` is configured the API verifies a JWT and runs each request
57
+ // under SET LOCAL ROLE, which needs a dedicated client per request — pass
58
+ // the pool. With no `auth`, the pool is unused and the API stays
59
+ // unauthenticated (loopback-only), exactly as before.
60
+ pool,
61
+ auth: config.auth,
62
+ host: API_HOST,
63
+ port,
64
+ logPrefix: `${PREFIX} api`,
65
+ });
66
+ return {
67
+ url: `http://${API_HOST}:${server.port}`,
68
+ close: async () => {
69
+ await server.close();
70
+ await pool.end();
71
+ },
72
+ };
73
+ }
74
+ function warnIfPublic(label, host) {
75
+ if (isLoopbackHost(host))
76
+ return;
77
+ process.stderr.write(`${PREFIX} WARNING: ${label} bound to non-loopback host "${host}".\n` +
78
+ `${PREFIX} v0.1 has NO authentication (spec §18.5). Anyone who can reach\n` +
79
+ `${PREFIX} ${host} can use it. This is expected inside docker compose;\n` +
80
+ `${PREFIX} avoid it on an untrusted network or put an auth proxy in front.\n`);
81
+ }
82
+ export async function devCommand(opts = {}) {
83
+ if (opts.adapter !== undefined && opts.adapter !== 'api') {
84
+ throw new Error(`${PREFIX} unknown --adapter "${opts.adapter}" ` +
85
+ '(the only supported value is "api"; omit it for the default REST adapter).');
86
+ }
87
+ const config = await loadConfig({ path: opts.config });
88
+ const adminUiEntry = resolveAdminUiEntry();
89
+ if (!existsSync(adminUiEntry)) {
90
+ throw new Error(`${PREFIX} Admin UI build not found at ${adminUiEntry}. ` +
91
+ 'Reinstall @kozou/svelte-ui (its `build/` output ships in the package), ' +
92
+ 'or in a workspace checkout run `pnpm --filter @kozou/svelte-ui run build`.');
93
+ }
94
+ // Optional in-house @kozou/api backend (--adapter api), started before
95
+ // the other servers so its URL can be wired into the UI environment.
96
+ const api = opts.adapter === 'api'
97
+ ? await startInhouseApi(config, opts.apiPort ?? DEFAULT_API_PORT)
98
+ : null;
99
+ if (api) {
100
+ process.stderr.write(`${PREFIX} in-house @kozou/api on ${api.url}\n`);
101
+ }
102
+ // When the in-house API enforces auth, resolve the token the bundled Admin
103
+ // UI presents to it: a minted HS256 token, a supplied RS256 / external one,
104
+ // or none (with a warning) when neither is available. @kozou/api is already
105
+ // imported (startInhouseApi succeeded), so this dynamic import is cached.
106
+ let apiToken;
107
+ if (api && config.auth) {
108
+ const apiModule = await import('@kozou/api');
109
+ const resolved = await resolveAdminUiToken(config, apiModule, process.env);
110
+ if (resolved.warning) {
111
+ process.stderr.write(`${PREFIX} WARNING: ${resolved.warning}\n`);
112
+ }
113
+ apiToken = resolved.token;
114
+ }
115
+ const cache = new SchemaCache({
116
+ connection: config.database.url,
117
+ schemas: config.database.schemas,
118
+ ttlMs: config.cache.ttlMs,
119
+ });
120
+ // 1. MCP HTTP, in-process. startHttpServer already warns on a
121
+ // non-loopback bind, so we do not double-warn for it.
122
+ const mcp = await startHttpServer(cache, {
123
+ port: config.server.mcp.http.port,
124
+ host: config.server.mcp.http.host,
125
+ logPrefix: `${PREFIX} mcp`,
126
+ });
127
+ // 2. Admin UI, as a child process.
128
+ warnIfPublic('Admin UI', config.server.ui.host);
129
+ const origin = resolveOrigin(config, process.env);
130
+ const child = spawn('node', [adminUiEntry], {
131
+ env: buildAdminUiEnv(config, origin, process.env, api?.url, apiToken),
132
+ stdio: ['ignore', 'pipe', 'pipe'],
133
+ });
134
+ child.stdout?.on('data', (b) => process.stdout.write(`${PREFIX} ui | ${b}`));
135
+ child.stderr?.on('data', (b) => process.stderr.write(`${PREFIX} ui | ${b}`));
136
+ process.stderr.write(`${PREFIX} Admin UI on http://${config.server.ui.host}:${config.server.ui.port}` +
137
+ ` (origin ${origin})\n`);
138
+ // 3. Lifecycle: tear everything down together. Resolve the promise (and
139
+ // thus let the CLI exit) only once everything has stopped.
140
+ const closeBackends = () => Promise.allSettled([mcp.close(), api ? api.close() : Promise.resolve()]);
141
+ await new Promise((resolve) => {
142
+ let shuttingDown = false;
143
+ const shutdown = (reason) => {
144
+ if (shuttingDown)
145
+ return;
146
+ shuttingDown = true;
147
+ process.stderr.write(`${PREFIX} ${reason}, shutting down\n`);
148
+ if (child.exitCode === null && child.signalCode === null) {
149
+ child.kill('SIGTERM');
150
+ }
151
+ void closeBackends().finally(() => resolve());
152
+ };
153
+ process.on('SIGINT', () => shutdown('SIGINT received'));
154
+ process.on('SIGTERM', () => shutdown('SIGTERM received'));
155
+ child.on('exit', (code, signal) => {
156
+ if (shuttingDown)
157
+ return;
158
+ // The Admin UI process died on its own — surface its exit status
159
+ // and bring the MCP server down with it.
160
+ process.stderr.write(`${PREFIX} Admin UI exited (code=${code ?? 'null'}, signal=${signal ?? 'null'})\n`);
161
+ process.exitCode = code ?? 1;
162
+ shuttingDown = true;
163
+ void closeBackends().finally(() => resolve());
164
+ });
165
+ child.on('error', (err) => {
166
+ process.stderr.write(`${PREFIX} failed to spawn Admin UI: ${err.message}\n`);
167
+ process.exitCode = 1;
168
+ shutdown('spawn error');
169
+ });
170
+ });
20
171
  }
21
172
  //# sourceMappingURL=dev.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"dev.js","sourceRoot":"","sources":["../../src/commands/dev.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,EAAE;AACF,0EAA0E;AAC1E,6FAA6F;AAC7F,0EAA0E;AAC1E,gEAAgE;AAMhE,MAAM,mBAAmB,GACvB,4DAA4D;IAC5D,yEAAyE;IACzE,qCAAqC;IACrC,IAAI;IACJ,sBAAsB;IACtB,mEAAmE;IACnE,oEAAoE,CAAC;AAEvE,yEAAyE;AACzE,yEAAyE;AACzE,qEAAqE;AACrE,oCAAoC;AACpC,MAAM,CAAC,KAAK,UAAU,UAAU,CAAC,QAAoB,EAAE;IACrD,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,mBAAmB,CAAC,CAAC;AAC5C,CAAC"}
1
+ {"version":3,"file":"dev.js","sourceRoot":"","sources":["../../src/commands/dev.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,EAAE;AACF,sEAAsE;AACtE,wEAAwE;AACxE,uEAAuE;AACvE,iEAAiE;AACjE,sEAAsE;AACtE,mCAAmC;AACnC,EAAE;AACF,uEAAuE;AACvE,sEAAsE;AACtE,8CAA8C;AAC9C,EAAE;AACF,wEAAwE;AACxE,wEAAwE;AACxE,oEAAoE;AACpE,oEAAoE;AAEpE,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAErC,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,cAAc,EA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I,YAAY;gBAAE,OAAO;YACzB,iEAAiE;YACjE,yCAAyC;YACzC,OAAO,CAAC,MAAM,CAAC,KAAK,CAClB,GAAG,MAAM,0BAA0B,IAAI,IAAI,MAAM,YAAY,MAAM,IAAI,MAAM,KAAK,CACnF,CAAC;YACF,OAAO,CAAC,QAAQ,GAAG,IAAI,IAAI,CAAC,CAAC;YAC7B,YAAY,GAAG,IAAI,CAAC;YACpB,KAAK,aAAa,EAAE,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,OAAO,EAAE,CAAC,CAAC;QAChD,CAAC,CAAC,CAAC;QAEH,KAAK,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,GAAG,EAAE,EAAE;YACxB,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,MAAM,8BAA8B,GAAG,CAAC,OAAO,IAAI,CAAC,CAAC;YAC7E,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;YACrB,QAAQ,CAAC,aAAa,CAAC,CAAC;QAC1B,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,8 @@
1
+ export type DocsOptions = {
2
+ /** Output destination. '-' = stdout (default), otherwise a file path. */
3
+ output?: string;
4
+ /** Path to kozou.config.yaml. Default: ./kozou.config.yaml. */
5
+ config?: string;
6
+ };
7
+ export declare function docsCommand(opts?: DocsOptions): Promise<void>;
8
+ //# sourceMappingURL=docs.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"docs.d.ts","sourceRoot":"","sources":["../../src/commands/docs.ts"],"names":[],"mappings":"AAoBA,MAAM,MAAM,WAAW,GAAG;IACxB,yEAAyE;IACzE,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,+DAA+D;IAC/D,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,wBAAsB,WAAW,CAAC,IAAI,GAAE,WAAgB,GAAG,OAAO,CAAC,IAAI,CAAC,CA8BvE"}
@@ -0,0 +1,44 @@
1
+ // `kozou docs` command implementation.
2
+ //
3
+ // Pipeline (mirrors `kozou inspect`):
4
+ // 1. Load the kozou.config.yaml (or fall back to defaults).
5
+ // 2. Introspect the target Postgres schema (@kozou/introspect).
6
+ // 3. Optionally load UI hints (@kozou/core.loadUIHints).
7
+ // 4. Build a SchemaContext (@kozou/core.buildSchemaContext).
8
+ // 5. Render a Markdown schema document and write it out.
9
+ //
10
+ // See product_architecture_v3 §3.4 (the "docs" emit target).
11
+ import { writeFile } from 'node:fs/promises';
12
+ import { buildSchemaContext, loadUIHints } from '@kozou/core';
13
+ import { introspect } from '@kozou/introspect';
14
+ import { loadConfig } from '../config.js';
15
+ import { emitMarkdown } from '../docs.js';
16
+ const PREFIX = '[kozou docs]';
17
+ export async function docsCommand(opts = {}) {
18
+ const output = opts.output ?? '-';
19
+ const config = await loadConfig({ path: opts.config });
20
+ const raw = await introspect({
21
+ connection: config.database.url,
22
+ schemas: config.database.schemas,
23
+ });
24
+ let uiHints;
25
+ if (config.uiHints.path !== null && config.uiHints.path !== '') {
26
+ try {
27
+ uiHints = await loadUIHints(config.uiHints.path);
28
+ }
29
+ catch (err) {
30
+ // UI hints are optional; warn but continue without them.
31
+ const message = err instanceof Error ? err.message : String(err);
32
+ process.stderr.write(`${PREFIX} could not load UI hints: ${message}\n`);
33
+ }
34
+ }
35
+ const ctx = await buildSchemaContext({ raw, uiHints });
36
+ const serialized = emitMarkdown(ctx);
37
+ const payload = serialized.endsWith('\n') ? serialized : serialized + '\n';
38
+ if (output === '-') {
39
+ process.stdout.write(payload);
40
+ return;
41
+ }
42
+ await writeFile(output, payload, 'utf8');
43
+ }
44
+ //# sourceMappingURL=docs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"docs.js","sourceRoot":"","sources":["../../src/commands/docs.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,EAAE;AACF,sCAAsC;AACtC,8DAA8D;AAC9D,kEAAkE;AAClE,2DAA2D;AAC3D,+DAA+D;AAC/D,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ACH,CAAC;IAED,MAAM,GAAG,GAAG,MAAM,kBAAkB,CAAC,EAAE,GAAG,EAAE,OAAO,EAAE,CAAC,CAAC;IACvD,MAAM,UAAU,GAAG,YAAY,CAAC,GAAG,CAAC,CAAC;IACrC,MAAM,OAAO,GAAG,UAAU,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,UAAU,GAAG,IAAI,CAAC;IAE3E,IAAI,MAAM,KAAK,GAAG,EAAE,CAAC;QACnB,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QAC9B,OAAO;IACT,CAAC;IACD,MAAM,SAAS,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;AAC3C,CAAC"}
@@ -2,6 +2,7 @@ export type McpOptions = {
2
2
  stdio?: boolean;
3
3
  http?: boolean;
4
4
  port?: number;
5
+ host?: string;
5
6
  config?: string;
6
7
  };
7
8
  export declare function mcpCommand(opts?: McpOptions): Promise<void>;
@@ -1 +1 @@
1
- {"version":3,"file":"mcp.d.ts","sourceRoot":"","sources":["../../src/commands/mcp.ts"],"names":[],"mappings":"AAYA,MAAM,MAAM,UAAU,GAAG;IACvB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAOF,wBAAsB,UAAU,CAAC,IAAI,GAAE,UAAe,GAAG,OAAO,CAAC,IAAI,CAAC,CAiBrE"}
1
+ {"version":3,"file":"mcp.d.ts","sourceRoot":"","sources":["../../src/commands/mcp.ts"],"names":[],"mappings":"AAaA,MAAM,MAAM,UAAU,GAAG;IACvB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,wBAAsB,UAAU,CAAC,IAAI,GAAE,UAAe,GAAG,OAAO,CAAC,IAAI,CAAC,CAmBrE"}
@@ -2,28 +2,28 @@
2
2
  //
3
3
  // --stdio: spins up the @kozou/mcp server with a stdio transport, reading
4
4
  // connection details from kozou.config.yaml / environment.
5
- // --http: deferred to v0.1.1 per the Kozou v0.1 design spec §16.1.1 B.
6
- // Prints a hand-off note to stderr and exits cleanly.
5
+ // --http: spins up the @kozou/mcp server with the Streamable HTTP
6
+ // transport (Kozou v0.1 spec §7.1), binding to localhost by default and
7
+ // exposing POST /admin/refresh for cache invalidation (§7.5).
7
8
  //
8
9
  // See Kozou v0.1 design spec §9.1 and §7.
9
- import { SchemaCache, startStdioServer } from '@kozou/mcp';
10
+ import { SchemaCache, startHttpServer, startStdioServer } from '@kozou/mcp';
10
11
  import { loadConfig } from '../config.js';
11
- const HTTP_HANDOFF_MESSAGE = 'kozou mcp --http: HTTP transport is scheduled for v0.1.1.\n' +
12
- ' See Kozou v0.1 design spec §16.1.1 B for the roadmap.\n' +
13
- ' Use --stdio for now (the default).\n';
14
12
  export async function mcpCommand(opts = {}) {
15
- // --http is deferred to v0.1.1 (HTTP transport not yet implemented in
16
- // the underlying @kozou/mcp package).
17
- if (opts.http === true) {
18
- process.stderr.write(HTTP_HANDOFF_MESSAGE);
19
- return;
20
- }
21
13
  const config = await loadConfig({ path: opts.config });
22
14
  const cache = new SchemaCache({
23
15
  connection: config.database.url,
24
16
  schemas: config.database.schemas,
25
17
  ttlMs: config.cache.ttlMs,
26
18
  });
19
+ if (opts.http === true) {
20
+ await startHttpServer(cache, {
21
+ port: opts.port,
22
+ host: opts.host,
23
+ logPrefix: '[kozou mcp]',
24
+ });
25
+ return;
26
+ }
27
27
  await startStdioServer(cache, { logPrefix: '[kozou mcp]' });
28
28
  }
29
29
  //# sourceMappingURL=mcp.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"mcp.js","sourceRoot":"","sources":["../../src/commands/mcp.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,EAAE;AACF,0EAA0E;AAC1E,6DAA6D;AAC7D,uEAAuE;AACvE,wDAAwD;AACxD,EAAE;AACF,0CAA0C;AAE1C,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAC3D,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAS1C,MAAM,oBAAoB,GACxB,6DAA6D;IAC7D,2DAA2D;IAC3D,wCAAwC,CAAC;AAE3C,MAAM,CAAC,KAAK,UAAU,UAAU,CAAC,OAAmB,EAAE;IACpD,sEAAsE;IACtE,sCAAsC;IACtC,IAAI,IAAI,CAAC,IAAI,KAAK,IAAI,EAAE,CAAC;QACvB,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,oBAAoB,CAAC,CAAC;QAC3C,OAAO;IACT,CAAC;IAED,MAAM,MAAM,GAAG,MAAM,UAAU,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC;IAEvD,MAAM,KAAK,GAAG,IAAI,WAAW,CAAC;QAC5B,UAAU,EAAE,MAAM,CAAC,QAAQ,CAAC,GAAG;QAC/B,OAAO,EAAE,MAAM,CAAC,QAAQ,CAAC,OAAO;QAChC,KAAK,EAAE,MAAM,CAAC,KAAK,CAAC,KAAK;KAC1B,CAAC,CAAC;IAEH,MAAM,gBAAgB,CAAC,KAAK,EAAE,EAAE,SAAS,EAAE,aAAa,EAAE,CAAC,CAAC;AAC9D,CAAC"}
1
+ {"version":3,"file":"mcp.js","sourceRoot":"","sources":["../../src/commands/mcp.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,EAAE;AACF,0EAA0E;AAC1E,6DAA6D;AAC7D,kEAAkE;AAClE,0EAA0E;AAC1E,gEAAgE;AAChE,EAAE;AACF,0CAA0C;AAE1C,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAC5E,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAU1C,MAAM,CAAC,KAAK,UAAU,UAAU,CAAC,OAAmB,EAAE;IACpD,MAAM,MAAM,GAAG,MAAM,UAAU,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC;IAEvD,MAAM,KAAK,GAAG,IAAI,WAAW,CAAC;QAC5B,UAAU,EAAE,MAAM,CAAC,QAAQ,CAAC,GAAG;QAC/B,OAAO,EAAE,MAAM,CAAC,QAAQ,CAAC,OAAO;QAChC,KAAK,EAAE,MAAM,CAAC,KAAK,CAAC,KAAK;KAC1B,CAAC,CAAC;IAEH,IAAI,IAAI,CAAC,IAAI,KAAK,IAAI,EAAE,CAAC;QACvB,MAAM,eAAe,CAAC,KAAK,EAAE;YAC3B,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,SAAS,EAAE,aAAa;SACzB,CAAC,CAAC;QACH,OAAO;IACT,CAAC;IAED,MAAM,gBAAgB,CAAC,KAAK,EAAE,EAAE,SAAS,EAAE,aAAa,EAAE,CAAC,CAAC;AAC9D,CAAC"}
package/dist/config.d.ts CHANGED
@@ -2,156 +2,54 @@ import { z } from 'zod';
2
2
  declare const configSchema: z.ZodObject<{
3
3
  database: z.ZodObject<{
4
4
  url: z.ZodString;
5
- schemas: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
6
- }, "strip", z.ZodTypeAny, {
7
- url: string;
8
- schemas: string[];
9
- }, {
10
- url: string;
11
- schemas?: string[] | undefined;
12
- }>;
13
- server: z.ZodDefault<z.ZodObject<{
14
- ui: z.ZodDefault<z.ZodObject<{
5
+ schemas: z.ZodDefault<z.ZodArray<z.ZodString>>;
6
+ }, z.core.$strip>;
7
+ server: z.ZodPrefault<z.ZodObject<{
8
+ ui: z.ZodPrefault<z.ZodObject<{
15
9
  port: z.ZodDefault<z.ZodNumber>;
16
10
  host: z.ZodDefault<z.ZodString>;
17
- }, "strip", z.ZodTypeAny, {
18
- port: number;
19
- host: string;
20
- }, {
21
- port?: number | undefined;
22
- host?: string | undefined;
23
- }>>;
24
- mcp: z.ZodDefault<z.ZodObject<{
25
- http: z.ZodDefault<z.ZodObject<{
11
+ }, z.core.$strip>>;
12
+ mcp: z.ZodPrefault<z.ZodObject<{
13
+ http: z.ZodPrefault<z.ZodObject<{
26
14
  port: z.ZodDefault<z.ZodNumber>;
27
15
  host: z.ZodDefault<z.ZodString>;
28
- }, "strip", z.ZodTypeAny, {
29
- port: number;
30
- host: string;
31
- }, {
32
- port?: number | undefined;
33
- host?: string | undefined;
34
- }>>;
16
+ }, z.core.$strip>>;
35
17
  stdio: z.ZodDefault<z.ZodBoolean>;
36
- }, "strip", z.ZodTypeAny, {
37
- http: {
38
- port: number;
39
- host: string;
40
- };
41
- stdio: boolean;
42
- }, {
43
- http?: {
44
- port?: number | undefined;
45
- host?: string | undefined;
46
- } | undefined;
47
- stdio?: boolean | undefined;
48
- }>>;
49
- }, "strip", z.ZodTypeAny, {
50
- ui: {
51
- port: number;
52
- host: string;
53
- };
54
- mcp: {
55
- http: {
56
- port: number;
57
- host: string;
58
- };
59
- stdio: boolean;
60
- };
61
- }, {
62
- ui?: {
63
- port?: number | undefined;
64
- host?: string | undefined;
65
- } | undefined;
66
- mcp?: {
67
- http?: {
68
- port?: number | undefined;
69
- host?: string | undefined;
70
- } | undefined;
71
- stdio?: boolean | undefined;
72
- } | undefined;
73
- }>>;
74
- adapter: z.ZodDefault<z.ZodObject<{
18
+ }, z.core.$strip>>;
19
+ }, z.core.$strip>>;
20
+ adapter: z.ZodPrefault<z.ZodObject<{
75
21
  type: z.ZodDefault<z.ZodLiteral<"postgrest">>;
76
22
  url: z.ZodDefault<z.ZodString>;
77
- }, "strip", z.ZodTypeAny, {
78
- type: "postgrest";
79
- url: string;
80
- }, {
81
- type?: "postgrest" | undefined;
82
- url?: string | undefined;
83
- }>>;
84
- uiHints: z.ZodDefault<z.ZodObject<{
23
+ }, z.core.$strip>>;
24
+ uiHints: z.ZodPrefault<z.ZodObject<{
85
25
  path: z.ZodDefault<z.ZodNullable<z.ZodString>>;
86
- }, "strip", z.ZodTypeAny, {
87
- path: string | null;
88
- }, {
89
- path?: string | null | undefined;
90
- }>>;
91
- cache: z.ZodDefault<z.ZodObject<{
26
+ }, z.core.$strip>>;
27
+ cache: z.ZodPrefault<z.ZodObject<{
92
28
  ttlMs: z.ZodDefault<z.ZodNumber>;
93
- }, "strip", z.ZodTypeAny, {
94
- ttlMs: number;
95
- }, {
96
- ttlMs?: number | undefined;
97
- }>>;
98
- }, "strip", z.ZodTypeAny, {
99
- database: {
100
- url: string;
101
- schemas: string[];
102
- };
103
- server: {
104
- ui: {
105
- port: number;
106
- host: string;
107
- };
108
- mcp: {
109
- http: {
110
- port: number;
111
- host: string;
112
- };
113
- stdio: boolean;
114
- };
115
- };
116
- adapter: {
117
- type: "postgrest";
118
- url: string;
119
- };
120
- uiHints: {
121
- path: string | null;
122
- };
123
- cache: {
124
- ttlMs: number;
125
- };
126
- }, {
127
- database: {
128
- url: string;
129
- schemas?: string[] | undefined;
130
- };
131
- server?: {
132
- ui?: {
133
- port?: number | undefined;
134
- host?: string | undefined;
135
- } | undefined;
136
- mcp?: {
137
- http?: {
138
- port?: number | undefined;
139
- host?: string | undefined;
140
- } | undefined;
141
- stdio?: boolean | undefined;
142
- } | undefined;
143
- } | undefined;
144
- adapter?: {
145
- type?: "postgrest" | undefined;
146
- url?: string | undefined;
147
- } | undefined;
148
- uiHints?: {
149
- path?: string | null | undefined;
150
- } | undefined;
151
- cache?: {
152
- ttlMs?: number | undefined;
153
- } | undefined;
154
- }>;
29
+ }, z.core.$strip>>;
30
+ auth: z.ZodOptional<z.ZodObject<{
31
+ jwt: z.ZodObject<{
32
+ secret: z.ZodOptional<z.ZodString>;
33
+ publicKey: z.ZodOptional<z.ZodString>;
34
+ jwksUri: z.ZodOptional<z.ZodString>;
35
+ algorithms: z.ZodOptional<z.ZodArray<z.ZodEnum<{
36
+ HS256: "HS256";
37
+ RS256: "RS256";
38
+ }>>>;
39
+ issuer: z.ZodOptional<z.ZodString>;
40
+ audience: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
41
+ }, z.core.$strip>;
42
+ roleClaim: z.ZodOptional<z.ZodString>;
43
+ allowedRoles: z.ZodOptional<z.ZodArray<z.ZodString>>;
44
+ defaultRole: z.ZodOptional<z.ZodString>;
45
+ anonRole: z.ZodOptional<z.ZodString>;
46
+ claimsGuc: z.ZodOptional<z.ZodString>;
47
+ ui: z.ZodOptional<z.ZodObject<{
48
+ role: z.ZodOptional<z.ZodString>;
49
+ token: z.ZodOptional<z.ZodString>;
50
+ }, z.core.$strip>>;
51
+ }, z.core.$strip>>;
52
+ }, z.core.$strip>;
155
53
  export type KozouConfig = z.infer<typeof configSchema>;
156
54
  export type KozouConfigIssue = {
157
55
  path: string;
@@ -1 +1 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAwDxB,QAAA,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAMhB,CAAC;AAEH,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC;AAIvD,MAAM,MAAM,gBAAgB,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC;AAEjE,qBAAa,gBAAiB,SAAQ,KAAK;IACzC,QAAQ,CAAC,MAAM,EAAE,gBAAgB,EAAE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