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.
- package/README.md +85 -14
- package/dist/cli.js +37 -5
- package/dist/cli.js.map +1 -1
- package/dist/commands/codegen.d.ts +8 -0
- package/dist/commands/codegen.d.ts.map +1 -0
- package/dist/commands/codegen.js +54 -0
- package/dist/commands/codegen.js.map +1 -0
- package/dist/commands/dev-runtime.d.ts +21 -0
- package/dist/commands/dev-runtime.d.ts.map +1 -0
- package/dist/commands/dev-runtime.js +111 -0
- package/dist/commands/dev-runtime.js.map +1 -0
- package/dist/commands/dev.d.ts +5 -1
- package/dist/commands/dev.d.ts.map +1 -1
- package/dist/commands/dev.js +168 -17
- package/dist/commands/dev.js.map +1 -1
- package/dist/commands/docs.d.ts +8 -0
- package/dist/commands/docs.d.ts.map +1 -0
- package/dist/commands/docs.js +44 -0
- package/dist/commands/docs.js.map +1 -0
- package/dist/commands/mcp.d.ts +1 -0
- package/dist/commands/mcp.d.ts.map +1 -1
- package/dist/commands/mcp.js +12 -12
- package/dist/commands/mcp.js.map +1 -1
- package/dist/config.d.ts +39 -141
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +127 -10
- package/dist/config.js.map +1 -1
- package/dist/docs.d.ts +3 -0
- package/dist/docs.d.ts.map +1 -0
- package/dist/docs.js +204 -0
- package/dist/docs.js.map +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +12 -1
- package/dist/index.js.map +1 -1
- package/dist/scaffold.d.ts.map +1 -1
- package/dist/scaffold.js +17 -6
- package/dist/scaffold.js.map +1 -1
- package/dist/templates/docker-compose.yml +27 -26
- package/dist/templates/env.example +14 -0
- package/package.json +19 -7
package/README.md
CHANGED
|
@@ -21,7 +21,7 @@ npx -p kozou create-kozou my-project
|
|
|
21
21
|
|
|
22
22
|
The package publishes through `./dist/`. `bin` exposes two entries:
|
|
23
23
|
|
|
24
|
-
- `kozou` - the main multi-command CLI (`inspect` / `mcp` / `dev`)
|
|
24
|
+
- `kozou` - the main multi-command CLI (`inspect` / `docs` / `mcp` / `dev`)
|
|
25
25
|
- `create-kozou` - scaffolds a project directory with
|
|
26
26
|
`docker-compose.yml`, `kozou.config.yaml`, `ui-hints.yaml`,
|
|
27
27
|
`env.example`, and a starter migration
|
|
@@ -38,6 +38,16 @@ DATABASE_URL=postgres://kozou:kozou@localhost:5432/kozou \
|
|
|
38
38
|
kozou inspect --format yaml > schema.yaml
|
|
39
39
|
```
|
|
40
40
|
|
|
41
|
+
### `kozou docs`
|
|
42
|
+
|
|
43
|
+
Generates a single Markdown schema document from the database DDL +
|
|
44
|
+
`COMMENT` metadata to stdout (or `--output <path>`):
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
DATABASE_URL=postgres://kozou:kozou@localhost:5432/kozou \
|
|
48
|
+
kozou docs --output schema.md
|
|
49
|
+
```
|
|
50
|
+
|
|
41
51
|
### `kozou mcp --stdio`
|
|
42
52
|
|
|
43
53
|
Starts an MCP server over stdio so Claude Code / other AI agents
|
|
@@ -50,17 +60,20 @@ DATABASE_URL=postgres://kozou:kozou@localhost:5432/kozou \
|
|
|
50
60
|
|
|
51
61
|
The `${DATABASE_URL}` placeholder inside the bundled
|
|
52
62
|
`kozou.config.yaml` template is what consumes that env var; the
|
|
53
|
-
CLI does not honor `KOZOU_DATABASE_URL` directly (an alias
|
|
54
|
-
the
|
|
55
|
-
|
|
63
|
+
`kozou` CLI does not honor `KOZOU_DATABASE_URL` directly (an alias
|
|
64
|
+
is on the roadmap). HTTP transport is available via
|
|
65
|
+
`kozou mcp --http` (`--port` / `--host` configure the listener;
|
|
66
|
+
stdio stays the default).
|
|
56
67
|
|
|
57
68
|
### `kozou dev`
|
|
58
69
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
server.
|
|
70
|
+
Runs the bundled `@kozou/svelte-ui` Admin UI (adapter-node)
|
|
71
|
+
alongside an MCP HTTP server, both wired up from
|
|
72
|
+
`kozou.config.yaml`. The Admin UI listens on port 3333 and the MCP
|
|
73
|
+
HTTP server on 3334 by default (override via `server.ui` /
|
|
74
|
+
`server.mcp.http` in the config); `Ctrl-C` (SIGINT / SIGTERM)
|
|
75
|
+
tears both down. This is the command behind the `kozou` service in
|
|
76
|
+
the scaffolded `docker-compose.yml`.
|
|
64
77
|
|
|
65
78
|
### `create-kozou <dir>`
|
|
66
79
|
|
|
@@ -74,11 +87,9 @@ cp .env.example .env
|
|
|
74
87
|
docker compose up
|
|
75
88
|
```
|
|
76
89
|
|
|
77
|
-
The generated `docker-compose.yml` brings up PostgreSQL
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
once `kozou dev` ships as a real implementation rather than a
|
|
81
|
-
hand-off placeholder.
|
|
90
|
+
The generated `docker-compose.yml` brings up PostgreSQL, PostgREST,
|
|
91
|
+
and a `kozou` service that runs `kozou dev` to host the Admin UI +
|
|
92
|
+
MCP HTTP server.
|
|
82
93
|
|
|
83
94
|
## Configuration
|
|
84
95
|
|
|
@@ -104,6 +115,66 @@ The full schema also accepts `server.ui.{port,host}`,
|
|
|
104
115
|
`create-kozou` writes. `${VAR}` and `${VAR:-default}` are
|
|
105
116
|
expanded from the process environment at load time.
|
|
106
117
|
|
|
118
|
+
### Authentication (experimental, `--adapter api`)
|
|
119
|
+
|
|
120
|
+
> **Source-checkout only.** The in-house `@kozou/api` backend is
|
|
121
|
+
> experimental and not yet published to npm, so `kozou dev --adapter api`
|
|
122
|
+
> works only from a source/workspace checkout of this repository. An
|
|
123
|
+
> npm-installed `kozou` does not bundle `@kozou/api`; requesting
|
|
124
|
+
> `--adapter api` there exits with an explicit error. The default
|
|
125
|
+
> `kozou dev` (PostgREST adapter) is unaffected.
|
|
126
|
+
|
|
127
|
+
By default the in-house `@kozou/api` backend (`kozou dev --adapter api`)
|
|
128
|
+
runs **unauthenticated** on loopback. Add an `auth` section to require a
|
|
129
|
+
signed JWT on every API request: kozou verifies the token, then runs each
|
|
130
|
+
request under `SET LOCAL ROLE <role-from-claim>` with the claims published
|
|
131
|
+
to PostgreSQL, so **your own row-level-security policies** decide what each
|
|
132
|
+
request can read and write.
|
|
133
|
+
|
|
134
|
+
```yaml
|
|
135
|
+
auth:
|
|
136
|
+
jwt:
|
|
137
|
+
secret: ${KOZOU_JWT_SECRET} # HS256 — or publicKey (RS256), or jwksUri
|
|
138
|
+
# publicKey: ${KOZOU_JWT_PUBLIC_KEY}
|
|
139
|
+
# jwksUri: https://your-idp/.well-known/jwks.json # Auth0 / Clerk / Supabase
|
|
140
|
+
algorithms: [HS256]
|
|
141
|
+
issuer: my-issuer # optional
|
|
142
|
+
audience: my-api # optional
|
|
143
|
+
roleClaim: role # claim naming the DB role (default: role)
|
|
144
|
+
allowedRoles: [app_reader, app_admin] # only these roles may be assumed
|
|
145
|
+
defaultRole: app_reader # role when the token omits roleClaim
|
|
146
|
+
anonRole: web_anon # role for requests with no token (else 401)
|
|
147
|
+
ui:
|
|
148
|
+
role: app_admin # role the bundled Admin UI runs as (HS256)
|
|
149
|
+
# token: ${KOZOU_ADAPTER_TOKEN} # RS256 / external IdP: supply a token instead
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
Provide exactly one of `jwt.secret` (HS256), `jwt.publicKey` (RS256), or
|
|
153
|
+
`jwt.jwksUri` (a provider's remote JWKS endpoint — keys are selected by `kid`,
|
|
154
|
+
cached, and refreshed on rotation).
|
|
155
|
+
|
|
156
|
+
With no `auth:` block, the section is built instead from
|
|
157
|
+
`KOZOU_JWT_SECRET` / `KOZOU_JWT_PUBLIC_KEY` / `KOZOU_JWT_JWKS_URI` /
|
|
158
|
+
`KOZOU_JWT_ALGORITHMS` / `KOZOU_JWT_ISSUER` / `KOZOU_JWT_AUDIENCE` /
|
|
159
|
+
`KOZOU_JWT_ROLE_CLAIM` / `KOZOU_JWT_ALLOWED_ROLES` / `KOZOU_JWT_DEFAULT_ROLE` /
|
|
160
|
+
`KOZOU_JWT_ANON_ROLE` / `KOZOU_UI_ROLE` / `KOZOU_ADAPTER_TOKEN` (algorithms
|
|
161
|
+
and roles are comma-separated). A role outside `allowedRoles` gets `403`. A request with
|
|
162
|
+
no token gets `401` unless `anonRole` is set, in which case it runs under
|
|
163
|
+
that role and your RLS policies decide what it sees (a present but invalid
|
|
164
|
+
token is always `401`). The login role of `database.url` must be `GRANT`ed
|
|
165
|
+
membership in every allowed role, and in `anonRole` when set.
|
|
166
|
+
|
|
167
|
+
#### The bundled Admin UI
|
|
168
|
+
|
|
169
|
+
The Admin UI calls `@kozou/api` server-side, so when `auth` is on it must
|
|
170
|
+
send a token too. Under **HS256** the CLI mints one for the UI claiming
|
|
171
|
+
`auth.ui.role` (or, if unset, no role — the API then applies `defaultRole`);
|
|
172
|
+
set `auth.ui.role` to the role the console should run as. Under **RS256**
|
|
173
|
+
or an external identity provider the CLI cannot mint, so supply a
|
|
174
|
+
ready-made token via `auth.ui.token` (or the `KOZOU_ADAPTER_TOKEN` env);
|
|
175
|
+
without it the UI is rejected with `401` and the CLI logs how to fix it.
|
|
176
|
+
The minted role must satisfy `allowedRoles` or the UI gets `403`.
|
|
177
|
+
|
|
107
178
|
## License
|
|
108
179
|
|
|
109
180
|
Apache 2.0. See [LICENSE](../../LICENSE) at the repository root.
|
package/dist/cli.js
CHANGED
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
// Kozou v0.1 design spec §9.1 via commander.
|
|
4
4
|
import { Command } from 'commander';
|
|
5
5
|
import { inspectCommand } from './commands/inspect.js';
|
|
6
|
+
import { codegenCommand } from './commands/codegen.js';
|
|
7
|
+
import { docsCommand } from './commands/docs.js';
|
|
6
8
|
import { mcpCommand } from './commands/mcp.js';
|
|
7
9
|
import { devCommand } from './commands/dev.js';
|
|
8
10
|
import { PACKAGE_VERSION } from './index.js';
|
|
@@ -23,27 +25,57 @@ program
|
|
|
23
25
|
config: flags.config,
|
|
24
26
|
});
|
|
25
27
|
});
|
|
28
|
+
program
|
|
29
|
+
.command('codegen')
|
|
30
|
+
.description('Generate TypeScript row types from the database schema (experimental).')
|
|
31
|
+
.option('--output <path>', 'output file (- for stdout)', '-')
|
|
32
|
+
.option('--config <path>', 'path to kozou.config.yaml')
|
|
33
|
+
.action(async (flags) => {
|
|
34
|
+
await codegenCommand({
|
|
35
|
+
output: flags.output,
|
|
36
|
+
config: flags.config,
|
|
37
|
+
});
|
|
38
|
+
});
|
|
39
|
+
program
|
|
40
|
+
.command('docs')
|
|
41
|
+
.description('Generate a Markdown schema document from the database DDL + COMMENT.')
|
|
42
|
+
.option('--output <path>', 'output file (- for stdout)', '-')
|
|
43
|
+
.option('--config <path>', 'path to kozou.config.yaml')
|
|
44
|
+
.action(async (flags) => {
|
|
45
|
+
await docsCommand({
|
|
46
|
+
output: flags.output,
|
|
47
|
+
config: flags.config,
|
|
48
|
+
});
|
|
49
|
+
});
|
|
26
50
|
program
|
|
27
51
|
.command('mcp')
|
|
28
|
-
.description('Run the MCP server (stdio
|
|
52
|
+
.description('Run the MCP server (--stdio default, or --http).')
|
|
29
53
|
.option('--stdio', 'use stdio transport (default)')
|
|
30
|
-
.option('--http', 'use HTTP transport
|
|
31
|
-
.option('--port <n>', 'HTTP port', (raw) => parseInt(raw, 10))
|
|
54
|
+
.option('--http', 'use Streamable HTTP transport')
|
|
55
|
+
.option('--port <n>', 'HTTP port (default 3334)', (raw) => parseInt(raw, 10))
|
|
56
|
+
.option('--host <host>', 'HTTP bind host (default 127.0.0.1)')
|
|
32
57
|
.option('--config <path>', 'path to kozou.config.yaml')
|
|
33
58
|
.action(async (flags) => {
|
|
34
59
|
await mcpCommand({
|
|
35
60
|
stdio: flags.stdio,
|
|
36
61
|
http: flags.http,
|
|
37
62
|
port: flags.port,
|
|
63
|
+
host: flags.host,
|
|
38
64
|
config: flags.config,
|
|
39
65
|
});
|
|
40
66
|
});
|
|
41
67
|
program
|
|
42
68
|
.command('dev')
|
|
43
|
-
.description('Run the bundled Admin UI + MCP HTTP dev server
|
|
69
|
+
.description('Run the bundled Admin UI + MCP HTTP dev server.')
|
|
44
70
|
.option('--config <path>', 'path to kozou.config.yaml')
|
|
71
|
+
.option('--adapter <kind>', 'set to "api" for the experimental in-house @kozou/api backend (default: the bundled REST adapter)')
|
|
72
|
+
.option('--api-port <n>', 'port for the in-house @kozou/api server (with --adapter api)', (raw) => parseInt(raw, 10))
|
|
45
73
|
.action(async (flags) => {
|
|
46
|
-
await devCommand({
|
|
74
|
+
await devCommand({
|
|
75
|
+
config: flags.config,
|
|
76
|
+
adapter: flags.adapter,
|
|
77
|
+
apiPort: flags.apiPort,
|
|
78
|
+
});
|
|
47
79
|
});
|
|
48
80
|
program.parseAsync(process.argv).catch((err) => {
|
|
49
81
|
process.stderr.write(`${err instanceof Error ? err.message : String(err)}\n`);
|
package/dist/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA,gEAAgE;AAChE,6CAA6C;AAE7C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA,gEAAgE;AAChE,6CAA6C;AAE7C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE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AE;IAChC,MAAM,UAAU,CAAC;QACf,MAAM,EAAE,KAAK,CAAC,MAAM;QACpB,OAAO,EAAE,KAAK,CAAC,OAAO;QACtB,OAAO,EAAE,KAAK,CAAC,OAAO;KACvB,CAAC,CAAC;AACL,CAAC,CAAC,CAAC;AAEL,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;IAC7C,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IAC9E,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export type CodegenOptions = {
|
|
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 codegenCommand(opts?: CodegenOptions): Promise<void>;
|
|
8
|
+
//# sourceMappingURL=codegen.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"codegen.d.ts","sourceRoot":"","sources":["../../src/commands/codegen.ts"],"names":[],"mappings":"AAsBA,MAAM,MAAM,cAAc,GAAG;IAC3B,yEAAyE;IACzE,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,+DAA+D;IAC/D,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,wBAAsB,cAAc,CAAC,IAAI,GAAE,cAAmB,GAAG,OAAO,CAAC,IAAI,CAAC,CAwC7E"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
// `kozou codegen` 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. Emit TypeScript row types (@kozou/codegen) and write them out.
|
|
9
|
+
//
|
|
10
|
+
// @kozou/codegen is an experimental, unpublished workspace package, so it is
|
|
11
|
+
// imported dynamically and is only resolvable from a source / workspace
|
|
12
|
+
// checkout — a published `kozou` install gets a clear error (mirrors the
|
|
13
|
+
// `--adapter api` handling in dev.ts).
|
|
14
|
+
import { writeFile } from 'node:fs/promises';
|
|
15
|
+
import { buildSchemaContext, loadUIHints } from '@kozou/core';
|
|
16
|
+
import { introspect } from '@kozou/introspect';
|
|
17
|
+
import { loadConfig } from '../config.js';
|
|
18
|
+
const PREFIX = '[kozou codegen]';
|
|
19
|
+
export async function codegenCommand(opts = {}) {
|
|
20
|
+
const output = opts.output ?? '-';
|
|
21
|
+
let codegenModule;
|
|
22
|
+
try {
|
|
23
|
+
codegenModule = await import('@kozou/codegen');
|
|
24
|
+
}
|
|
25
|
+
catch {
|
|
26
|
+
throw new Error(`${PREFIX} needs the experimental @kozou/codegen package, which is not ` +
|
|
27
|
+
'bundled in this release. Run kozou from a source / workspace checkout to use it.');
|
|
28
|
+
}
|
|
29
|
+
const config = await loadConfig({ path: opts.config });
|
|
30
|
+
const raw = await introspect({
|
|
31
|
+
connection: config.database.url,
|
|
32
|
+
schemas: config.database.schemas,
|
|
33
|
+
});
|
|
34
|
+
let uiHints;
|
|
35
|
+
if (config.uiHints.path !== null && config.uiHints.path !== '') {
|
|
36
|
+
try {
|
|
37
|
+
uiHints = await loadUIHints(config.uiHints.path);
|
|
38
|
+
}
|
|
39
|
+
catch (err) {
|
|
40
|
+
// UI hints are optional; warn but continue without them.
|
|
41
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
42
|
+
process.stderr.write(`${PREFIX} could not load UI hints: ${message}\n`);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
const ctx = await buildSchemaContext({ raw, uiHints });
|
|
46
|
+
const serialized = codegenModule.emitRowTypes(ctx);
|
|
47
|
+
const payload = serialized.endsWith('\n') ? serialized : serialized + '\n';
|
|
48
|
+
if (output === '-') {
|
|
49
|
+
process.stdout.write(payload);
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
await writeFile(output, payload, 'utf8');
|
|
53
|
+
}
|
|
54
|
+
//# sourceMappingURL=codegen.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"codegen.js","sourceRoot":"","sources":["../../src/commands/codegen.ts"],"names":[],"mappings":"AAAA,0CAA0C;AAC1C,EAAE;AACF,sCAAsC;AACtC,8DAA8D;AAC9D,kEAAkE;AAClE,2DAA2D;AAC3D,+DAA+D;AAC/D,sEAAsE;AACtE,EAAE;AACF,6EAA6E;AAC7E,wEAAwE;AACxE,yEAAyE;AACzE,uCAAuC;AAEvC,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE9D,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,MAAM,MAAM,GAAG,iBAAiB,CAAC;AASjC,MAAM,CAAC,KAAK,UAAU,cAAc,CAAC,OAAuB,EAAE;IAC5D,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,IAAI,GAAG,CAAC;IAElC,IAAI,aAA8C,CAAC;IACnD,IAAI,CAAC;QACH,aAAa,GAAG,MAAM,MAAM,CAAC,gBAAgB,CAAC,CAAC;IACjD,CAAC;IAAC,MAAM,CAAC;QACP,MAAM,IAAI,KAAK,CACb,GAAG,MAAM,+DAA+D;YACtE,kFA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SAAS,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;AAC3C,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { KozouConfig } from '../config.js';
|
|
2
|
+
export declare function resolveAdminUiEntry(): string;
|
|
3
|
+
export declare function resolveOrigin(config: KozouConfig, env: NodeJS.ProcessEnv): string;
|
|
4
|
+
export declare function buildAdminUiEnv(config: KozouConfig, origin: string, baseEnv: NodeJS.ProcessEnv, apiAdapterUrl?: string, apiToken?: string): NodeJS.ProcessEnv;
|
|
5
|
+
export type ServiceTokenMinter = {
|
|
6
|
+
signServiceToken(opts: {
|
|
7
|
+
secret: string;
|
|
8
|
+
roleClaim?: string;
|
|
9
|
+
role?: string;
|
|
10
|
+
issuer?: string;
|
|
11
|
+
audience?: string | string[];
|
|
12
|
+
}): Promise<string>;
|
|
13
|
+
};
|
|
14
|
+
export type AdminUiTokenResult = {
|
|
15
|
+
/** Bearer token the Admin UI should send, when one could be obtained. */
|
|
16
|
+
token?: string;
|
|
17
|
+
/** Operator-facing reason the UI will be rejected, when no usable token. */
|
|
18
|
+
warning?: string;
|
|
19
|
+
};
|
|
20
|
+
export declare function resolveAdminUiToken(config: KozouConfig, minter: ServiceTokenMinter, env: NodeJS.ProcessEnv): Promise<AdminUiTokenResult>;
|
|
21
|
+
//# sourceMappingURL=dev-runtime.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dev-runtime.d.ts","sourceRoot":"","sources":["../../src/commands/dev-runtime.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAOhD,wBAAgB,mBAAmB,IAAI,MAAM,CAI5C;AAMD,wBAAgB,aAAa,CAAC,MAAM,EAAE,WAAW,EAAE,GAAG,EAAE,MAAM,CAAC,UAAU,GAAG,MAAM,CAEjF;AAWD,wBAAgB,eAAe,CAC7B,MAAM,EAAE,WAAW,EACnB,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,MAAM,CAAC,UAAU,EAC1B,aAAa,CAAC,EAAE,MAAM,EACtB,QAAQ,CAAC,EAAE,MAAM,GAChB,MAAM,CAAC,UAAU,CAsBnB;AAID,MAAM,MAAM,kBAAkB,GAAG;IAC/B,gBAAgB,CAAC,IAAI,EAAE;QACrB,MAAM,EAAE,MAAM,CAAC;QACf,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;KAC9B,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,yEAAyE;IACzE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,4EAA4E;IAC5E,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAWF,wBAAsB,mBAAmB,CACvC,MAAM,EAAE,WAAW,EACnB,MAAM,EAAE,kBAAkB,EAC1B,GAAG,EAAE,MAAM,CAAC,UAAU,GACrB,OAAO,CAAC,kBAAkB,CAAC,CA8B7B"}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
// Pure wiring helpers for `kozou dev` (see commands/dev.ts).
|
|
2
|
+
//
|
|
3
|
+
// Kept separate from the spawn / lifecycle shell in dev.ts so the
|
|
4
|
+
// config -> child-process-env / origin / entry-path mapping can be unit
|
|
5
|
+
// tested without launching any servers.
|
|
6
|
+
import { createRequire } from 'node:module';
|
|
7
|
+
import { dirname, join } from 'node:path';
|
|
8
|
+
// Resolve the Admin UI's adapter-node standalone server entry. The
|
|
9
|
+
// `build/` directory ships in @kozou/svelte-ui's published `files`, and
|
|
10
|
+
// resolving the package's own package.json works whether kozou runs from
|
|
11
|
+
// a flat node_modules tree (Docker / npm install) or a workspace symlink
|
|
12
|
+
// (local dev).
|
|
13
|
+
export function resolveAdminUiEntry() {
|
|
14
|
+
const require = createRequire(import.meta.url);
|
|
15
|
+
const pkgJsonPath = require.resolve('@kozou/svelte-ui/package.json');
|
|
16
|
+
return join(dirname(pkgJsonPath), 'build', 'index.js');
|
|
17
|
+
}
|
|
18
|
+
// The browser-facing origin the Admin UI must accept form posts from.
|
|
19
|
+
// An explicit ORIGIN / KOZOU_ORIGIN wins; otherwise default to localhost
|
|
20
|
+
// on the UI port (host stays 0.0.0.0 for binding, but browsers reach it
|
|
21
|
+
// as localhost in the common single-host case).
|
|
22
|
+
export function resolveOrigin(config, env) {
|
|
23
|
+
return env.ORIGIN ?? env.KOZOU_ORIGIN ?? `http://localhost:${config.server.ui.port}`;
|
|
24
|
+
}
|
|
25
|
+
// Build the child-process environment for the Admin UI server. Keeping
|
|
26
|
+
// it pure makes the wiring unit-testable without spawning anything.
|
|
27
|
+
//
|
|
28
|
+
// When `apiAdapterUrl` is given (`kozou dev --adapter api`), the UI is
|
|
29
|
+
// pointed at the in-house @kozou/api server via KOZOU_ADAPTER_KIND=api;
|
|
30
|
+
// otherwise it uses the default REST adapter URL from config. On the api
|
|
31
|
+
// path `apiToken` (when present) is exposed as KOZOU_ADAPTER_TOKEN so the
|
|
32
|
+
// UI attaches it as a Bearer token; any inherited value is cleared so a
|
|
33
|
+
// stray env var cannot leak in.
|
|
34
|
+
export function buildAdminUiEnv(config, origin, baseEnv, apiAdapterUrl, apiToken) {
|
|
35
|
+
const adapter = apiAdapterUrl !== undefined
|
|
36
|
+
? { KOZOU_ADAPTER_KIND: 'api', KOZOU_ADAPTER_URL: apiAdapterUrl }
|
|
37
|
+
: { KOZOU_ADAPTER_URL: config.adapter.url };
|
|
38
|
+
const env = {
|
|
39
|
+
...baseEnv,
|
|
40
|
+
DATABASE_URL: config.database.url,
|
|
41
|
+
...adapter,
|
|
42
|
+
PORT: String(config.server.ui.port),
|
|
43
|
+
HOST: config.server.ui.host,
|
|
44
|
+
ORIGIN: origin,
|
|
45
|
+
NODE_ENV: 'production',
|
|
46
|
+
};
|
|
47
|
+
if (apiAdapterUrl !== undefined) {
|
|
48
|
+
if (apiToken !== undefined && apiToken.length > 0) {
|
|
49
|
+
env.KOZOU_ADAPTER_TOKEN = apiToken;
|
|
50
|
+
}
|
|
51
|
+
else {
|
|
52
|
+
delete env.KOZOU_ADAPTER_TOKEN;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
return env;
|
|
56
|
+
}
|
|
57
|
+
// Decide what token (if any) the bundled Admin UI should send to @kozou/api,
|
|
58
|
+
// given the resolved config. Pure except for the injected minter:
|
|
59
|
+
// (a) an explicit token (auth.ui.token / KOZOU_ADAPTER_TOKEN) is passed
|
|
60
|
+
// through — the path for RS256 / an external IdP, where the CLI cannot
|
|
61
|
+
// mint;
|
|
62
|
+
// (b) otherwise, with an HS256 secret, the CLI mints a token claiming the
|
|
63
|
+
// configured role (auth.ui.role; absent -> the API's defaultRole);
|
|
64
|
+
// (c) otherwise (an RS256 key with no supplied token) no token is returned
|
|
65
|
+
// and a warning explains how to supply one.
|
|
66
|
+
export async function resolveAdminUiToken(config, minter, env) {
|
|
67
|
+
const auth = config.auth;
|
|
68
|
+
if (auth === undefined)
|
|
69
|
+
return {}; // no auth -> the UI sends no token (unchanged)
|
|
70
|
+
const supplied = auth.ui?.token ?? env.KOZOU_ADAPTER_TOKEN;
|
|
71
|
+
if (supplied !== undefined && supplied.length > 0) {
|
|
72
|
+
return { token: supplied };
|
|
73
|
+
}
|
|
74
|
+
const secret = auth.jwt.secret;
|
|
75
|
+
if (secret !== undefined && secret.length > 0) {
|
|
76
|
+
const role = auth.ui?.role;
|
|
77
|
+
const token = await minter.signServiceToken({
|
|
78
|
+
secret,
|
|
79
|
+
roleClaim: auth.roleClaim,
|
|
80
|
+
role,
|
|
81
|
+
issuer: auth.jwt.issuer,
|
|
82
|
+
audience: auth.jwt.audience,
|
|
83
|
+
});
|
|
84
|
+
const warning = mintedRoleWarning(auth, role);
|
|
85
|
+
return warning !== undefined ? { token, warning } : { token };
|
|
86
|
+
}
|
|
87
|
+
return {
|
|
88
|
+
warning: 'auth uses an RS256 public key, so the CLI cannot mint a token for the ' +
|
|
89
|
+
'bundled Admin UI; it will be rejected with 401. Set auth.ui.token (or ' +
|
|
90
|
+
'KOZOU_ADAPTER_TOKEN) to a token from your identity provider, or use an ' +
|
|
91
|
+
'HS256 secret so the CLI can mint one.',
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
// A minted Admin UI token will be rejected with 403 unless the API can
|
|
95
|
+
// resolve an allowed role for it. Surface that as a warning at startup
|
|
96
|
+
// rather than letting the UI fail opaquely.
|
|
97
|
+
function mintedRoleWarning(auth, role) {
|
|
98
|
+
const effective = role !== undefined && role.length > 0 ? role : auth.defaultRole;
|
|
99
|
+
if (effective === undefined || effective.length === 0) {
|
|
100
|
+
return 'auth.ui.role is unset and no defaultRole is configured, so the ' +
|
|
101
|
+
'minted Admin UI token carries no role and the API will reject it with ' +
|
|
102
|
+
'403. Set auth.ui.role to the role the Admin UI should assume.';
|
|
103
|
+
}
|
|
104
|
+
if (auth.allowedRoles !== undefined && !auth.allowedRoles.includes(effective)) {
|
|
105
|
+
return `the Admin UI token's role "${effective}" is not in allowedRoles, so ` +
|
|
106
|
+
'the API will reject it with 403. Add it to allowedRoles or change ' +
|
|
107
|
+
'auth.ui.role.';
|
|
108
|
+
}
|
|
109
|
+
return undefined;
|
|
110
|
+
}
|
|
111
|
+
//# sourceMappingURL=dev-runtime.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dev-runtime.js","sourceRoot":"","sources":["../../src/commands/dev-runtime.ts"],"names":[],"mappings":"AAAA,6DAA6D;AAC7D,EAAE;AACF,kEAAkE;AAClE,wEAAwE;AACxE,wCAAwC;AAExC,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAI1C,mEAAmE;AACnE,wEAAwE;AACxE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AAC,GAAG,CAAC,MAAM;YACvB,QAAQ,EAAE,IAAI,CAAC,GAAG,CAAC,QAAQ;SAC5B,CAAC,CAAC;QACH,MAAM,OAAO,GAAG,iBAAiB,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QAC9C,OAAO,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC;IAChE,CAAC;IAED,OAAO;QACL,OAAO,EACL,wEAAwE;YACxE,wEAAwE;YACxE,yEAAyE;YACzE,uCAAuC;KAC1C,CAAC;AACJ,CAAC;AAED,uEAAuE;AACvE,uEAAuE;AACvE,4CAA4C;AAC5C,SAAS,iBAAiB,CACxB,IAAsC,EACtC,IAAwB;IAExB,MAAM,SAAS,GAAG,IAAI,KAAK,SAAS,IAAI,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC;IAClF,IAAI,SAAS,KAAK,SAAS,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACtD,OAAO,iEAAiE;YACtE,wEAAwE;YACxE,+DAA+D,CAAC;IACpE,CAAC;IACD,IAAI,IAAI,CAAC,YAAY,KAAK,SAAS,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,SAAS,CAAC,EAAE,CAAC;QAC9E,OAAO,8BAA8B,SAAS,+BAA+B;YAC3E,oEAAoE;YACpE,eAAe,CAAC;IACpB,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC"}
|
package/dist/commands/dev.d.ts
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
export type DevOptions = {
|
|
2
2
|
config?: string;
|
|
3
|
+
/** Set to 'api' for the experimental in-house @kozou/api backend; omit for the default REST adapter. */
|
|
4
|
+
adapter?: string;
|
|
5
|
+
/** Port for the in-house @kozou/api server (used when adapter === 'api'). */
|
|
6
|
+
apiPort?: number;
|
|
3
7
|
};
|
|
4
|
-
export declare function devCommand(
|
|
8
|
+
export declare function devCommand(opts?: DevOptions): Promise<void>;
|
|
5
9
|
//# sourceMappingURL=dev.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dev.d.ts","sourceRoot":"","sources":["../../src/commands/dev.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"dev.d.ts","sourceRoot":"","sources":["../../src/commands/dev.ts"],"names":[],"mappings":"AA+BA,MAAM,MAAM,UAAU,GAAG;IACvB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,wGAAwG;IACxG,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,6EAA6E;IAC7E,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAwEF,wBAAsB,UAAU,CAAC,IAAI,GAAE,UAAe,GAAG,OAAO,CAAC,IAAI,CAAC,CA+GrE"}
|