@kitsuden/shared 0.0.0-stage → 0.9.0-beta
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/LICENSE +21 -0
- package/README.md +65 -2
- package/dist/admin-registry-contract.d.ts +99 -0
- package/dist/admin-registry-contract.d.ts.map +1 -0
- package/dist/admin-view.d.ts +123 -0
- package/dist/admin-view.d.ts.map +1 -0
- package/dist/agent-permission.d.ts +161 -0
- package/dist/agent-permission.d.ts.map +1 -0
- package/dist/approvals.d.ts +164 -0
- package/dist/approvals.d.ts.map +1 -0
- package/dist/automation.d.ts +175 -0
- package/dist/automation.d.ts.map +1 -0
- package/dist/block-keys.d.ts +82 -0
- package/dist/block-keys.d.ts.map +1 -0
- package/dist/code-scan.d.ts +64 -0
- package/dist/code-scan.d.ts.map +1 -0
- package/dist/comment-subjects.d.ts +129 -0
- package/dist/comment-subjects.d.ts.map +1 -0
- package/dist/connections.d.ts +96 -0
- package/dist/connections.d.ts.map +1 -0
- package/dist/constants.d.ts +37 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/content-publishing.d.ts +34 -0
- package/dist/content-publishing.d.ts.map +1 -0
- package/dist/contracts.d.ts +87 -0
- package/dist/contracts.d.ts.map +1 -0
- package/dist/dataset-catalog.d.ts +91 -0
- package/dist/dataset-catalog.d.ts.map +1 -0
- package/dist/deck-analysis.d.ts +63 -0
- package/dist/deck-analysis.d.ts.map +1 -0
- package/dist/env.d.ts +2 -0
- package/dist/env.d.ts.map +1 -0
- package/dist/errors.d.ts +275 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/field-types.d.ts +304 -0
- package/dist/field-types.d.ts.map +1 -0
- package/dist/index.d.ts +79 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +7785 -0
- package/dist/kon-api.d.ts +914 -0
- package/dist/kon-api.d.ts.map +1 -0
- package/dist/kon-entities.d.ts +204 -0
- package/dist/kon-entities.d.ts.map +1 -0
- package/dist/kon-events.d.ts +103 -0
- package/dist/kon-events.d.ts.map +1 -0
- package/dist/kon-package.d.ts +124 -0
- package/dist/kon-package.d.ts.map +1 -0
- package/dist/link-relations.d.ts +73 -0
- package/dist/link-relations.d.ts.map +1 -0
- package/dist/meta-levels.d.ts +81 -0
- package/dist/meta-levels.d.ts.map +1 -0
- package/dist/models-sql.d.ts +110 -0
- package/dist/models-sql.d.ts.map +1 -0
- package/dist/models.d.ts +354 -0
- package/dist/models.d.ts.map +1 -0
- package/dist/operations.d.ts +428 -0
- package/dist/operations.d.ts.map +1 -0
- package/dist/promotion.d.ts +244 -0
- package/dist/promotion.d.ts.map +1 -0
- package/dist/public-site.d.ts +106 -0
- package/dist/public-site.d.ts.map +1 -0
- package/dist/render-blocks.d.ts +150 -0
- package/dist/render-blocks.d.ts.map +1 -0
- package/dist/reports.d.ts +109 -0
- package/dist/reports.d.ts.map +1 -0
- package/dist/rls-builder.d.ts +136 -0
- package/dist/rls-builder.d.ts.map +1 -0
- package/dist/safe-pattern.d.ts +47 -0
- package/dist/safe-pattern.d.ts.map +1 -0
- package/dist/schemas.d.ts +977 -0
- package/dist/schemas.d.ts.map +1 -0
- package/dist/sensitivity.d.ts +37 -0
- package/dist/sensitivity.d.ts.map +1 -0
- package/dist/signer.d.ts +67 -0
- package/dist/signer.d.ts.map +1 -0
- package/dist/tier-ranges.d.ts +37 -0
- package/dist/tier-ranges.d.ts.map +1 -0
- package/dist/types.d.ts +261 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/utils.d.ts +71 -0
- package/dist/utils.d.ts.map +1 -0
- package/dist/wiki-links.d.ts +56 -0
- package/dist/wiki-links.d.ts.map +1 -0
- package/package.json +53 -3
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* defineModel → SQL: the table, the RLS and the `makemigrations` diff (pure)
|
|
3
|
+
* ============================================================================
|
|
4
|
+
*
|
|
5
|
+
* `kitsuden makemigrations` stores next to the migrations a SNAPSHOT of
|
|
6
|
+
* the models as they stood after the last generated migration
|
|
7
|
+
* (`migrations/models.snapshot.json`). The next time it compares the
|
|
8
|
+
* snapshot with the declared models and writes ONLY the difference:
|
|
9
|
+
*
|
|
10
|
+
* new model CREATE TABLE + indexes + RLS
|
|
11
|
+
* new field ADD COLUMN (required without a default: it is
|
|
12
|
+
* refused, like Django, because it would fail with rows)
|
|
13
|
+
* `before: "oldKey"` RENAME COLUMN (instead of dropping and creating)
|
|
14
|
+
* type / length ALTER COLUMN … TYPE … USING
|
|
15
|
+
* required SET / DROP NOT NULL (filling in the default
|
|
16
|
+
* before SET NOT NULL, if there is one)
|
|
17
|
+
* default value SET / DROP DEFAULT
|
|
18
|
+
* values, min, max the named CHECK is rebuilt
|
|
19
|
+
* unique / index ADD / DROP CONSTRAINT, CREATE / DROP INDEX
|
|
20
|
+
* access policy the four RLS policies are rebuilt
|
|
21
|
+
* removed field or model DESTRUCTIVE: comes out COMMENTED unless
|
|
22
|
+
* `allowDestructive` (and the required column
|
|
23
|
+
* that is left behind becomes NULL, so the app can
|
|
24
|
+
* keep inserting)
|
|
25
|
+
*
|
|
26
|
+
* Nothing is ever executed here: the text is returned. It is applied by the usual runner
|
|
27
|
+
* (`bun run scripts/migrate.ts`, or the panel when enabling the kon) with the
|
|
28
|
+
* DDL connection, in file order.
|
|
29
|
+
*
|
|
30
|
+
* The RLS uses the core functions `kitsuden_effective_admin(kon)` and
|
|
31
|
+
* `kitsuden_effective_staff(kon)` (apps/api/src/db/agent-functions.sql, which
|
|
32
|
+
* the runner applies BEFORE each kon's migrations): so an agent that
|
|
33
|
+
* opens the whole kon (`<kon>:*`, `admin`) is treated the same as in TypeScript.
|
|
34
|
+
*/
|
|
35
|
+
import { type ModelAccess, type Field, type Model } from "./models";
|
|
36
|
+
export declare const SNAPSHOT_VERSION = 1;
|
|
37
|
+
export interface SnapshotColumn {
|
|
38
|
+
/** Key of the field (camelCase). */
|
|
39
|
+
key: string;
|
|
40
|
+
column: string;
|
|
41
|
+
type: string;
|
|
42
|
+
nullable: boolean;
|
|
43
|
+
defaultValue: string | null;
|
|
44
|
+
check: string | null;
|
|
45
|
+
unique: boolean;
|
|
46
|
+
index: boolean;
|
|
47
|
+
}
|
|
48
|
+
export interface ModelSnapshot {
|
|
49
|
+
name: string;
|
|
50
|
+
table: string;
|
|
51
|
+
kon: string;
|
|
52
|
+
access: ModelAccess;
|
|
53
|
+
columns: SnapshotColumn[];
|
|
54
|
+
/** Semantic search. Absent = without it (so old snapshots do not change). */
|
|
55
|
+
semantics?: {
|
|
56
|
+
fields: string[];
|
|
57
|
+
dimensions: number;
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
export interface Snapshot {
|
|
61
|
+
version: number;
|
|
62
|
+
models: Record<string, ModelSnapshot>;
|
|
63
|
+
}
|
|
64
|
+
/** A persisted snapshot, or an empty one. */
|
|
65
|
+
export declare function normalizeSnapshot(raw: unknown): Snapshot;
|
|
66
|
+
export declare function emptySnapshot(): Snapshot;
|
|
67
|
+
export declare function sqlType(c: Field): string;
|
|
68
|
+
/** The snapshot of ONE model (what is stored and compared). */
|
|
69
|
+
export declare function modelSnapshot(m: Model, kon: string): ModelSnapshot;
|
|
70
|
+
export declare function modelsSnapshot(models: readonly Model[], kon: string): Snapshot;
|
|
71
|
+
/**
|
|
72
|
+
* The expressions of an access policy. `write` is who can touch
|
|
73
|
+
* a row; whoever can touch it can also read it.
|
|
74
|
+
*
|
|
75
|
+
* In "staff", an agent with the model's scope (`<model>:read|write`) gets in
|
|
76
|
+
* too (`kitsuden_agent_can_in_kon`): the scope that opens the operation has to
|
|
77
|
+
* open the rows, or the agent would get 200 with an empty list. In "owner"
|
|
78
|
+
* the scope opens the door, not the rows: the agent sees ITS OWN.
|
|
79
|
+
*/
|
|
80
|
+
export declare function rlsExpressions(access: ModelAccess, kon: string, name: string): {
|
|
81
|
+
read: string;
|
|
82
|
+
write: string;
|
|
83
|
+
};
|
|
84
|
+
/** The table's policies: ENABLE + FORCE and the four (idempotent). */
|
|
85
|
+
export declare function rlsPolicies(m: Pick<ModelSnapshot, "name" | "table" | "access" | "kon">): string[];
|
|
86
|
+
export interface MigrationOptions {
|
|
87
|
+
/** Short name of the kon (`notes` for `kon-notes`; `app` for the app). */
|
|
88
|
+
kon: string;
|
|
89
|
+
/** Actually emit the DROPs (by default they come out commented). */
|
|
90
|
+
allowDestructive?: boolean;
|
|
91
|
+
}
|
|
92
|
+
export interface ModelMigration {
|
|
93
|
+
/** The SQL (empty if there are no changes). */
|
|
94
|
+
sql: string;
|
|
95
|
+
/** The new snapshot (the one that is stored if the file is written). */
|
|
96
|
+
snapshot: Snapshot;
|
|
97
|
+
/** Readable summary, one line per change. */
|
|
98
|
+
changes: string[];
|
|
99
|
+
/** What is worth reviewing (destructive omitted, lossy types…). */
|
|
100
|
+
warnings: string[];
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Compares the previous snapshot with the declared models and returns the
|
|
104
|
+
* migration. Throws if the change cannot be made without deciding something (a new
|
|
105
|
+
* required field with no default on a table that already exists).
|
|
106
|
+
*/
|
|
107
|
+
export declare function generateModelMigration(previous: unknown, models: readonly Model[], options: MigrationOptions): ModelMigration;
|
|
108
|
+
/** The header of a generated migration file. */
|
|
109
|
+
export declare function migrationHeader(changes: string[], warnings: string[]): string;
|
|
110
|
+
//# sourceMappingURL=models-sql.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"models-sql.d.ts","sourceRoot":"","sources":["../src/models-sql.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAEH,OAAO,EAAyB,KAAK,WAAW,EAAE,KAAK,KAAK,EAAE,KAAK,KAAK,EAAE,MAAM,UAAU,CAAC;AAE3F,eAAO,MAAM,gBAAgB,IAAI,CAAC;AAElC,MAAM,WAAW,cAAc;IAC7B,oCAAoC;IACpC,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC;IACf,I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wBAAgB,WAAW,CAAC,CAAC,EAAE,IAAI,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO,GAAG,QAAQ,GAAG,KAAK,CAAC,GAAG,MAAM,EAAE,CAiBjG;AAID,MAAM,WAAW,gBAAgB;IAC/B,0EAA0E;IAC1E,GAAG,EAAE,MAAM,CAAC;IACZ,oEAAoE;IACpE,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B;AAED,MAAM,WAAW,cAAc;IAC7B,+CAA+C;IAC/C,GAAG,EAAE,MAAM,CAAC;IACZ,wEAAwE;IACxE,QAAQ,EAAE,QAAQ,CAAC;IACnB,6CAA6C;IAC7C,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,mEAAmE;IACnE,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,CACpC,QAAQ,EAAE,OAAO,EACjB,MAAM,EAAE,SAAS,KAAK,EAAE,EACxB,OAAO,EAAE,gBAAgB,GACxB,cAAc,CAiQhB;AAOD,gDAAgD;AAChD,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,MAAM,CAS7E"}
|
package/dist/models.d.ts
ADDED
|
@@ -0,0 +1,354 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* defineModel: declare a model once
|
|
3
|
+
* ============================================================================
|
|
4
|
+
*
|
|
5
|
+
* A kon (or the app) declares a model with its fields and its ACCESS POLICY,
|
|
6
|
+
* and everything else comes out of that declaration:
|
|
7
|
+
*
|
|
8
|
+
* · the Drizzle table (`modelTable`, in @kitsuden/engine);
|
|
9
|
+
* · the SQL migration and the `makemigrations`-style diff (`models-sql.ts`):
|
|
10
|
+
* it is GENERATED in the kon's or the app's migrations folder, and is never
|
|
11
|
+
* run on its own against anything;
|
|
12
|
+
* · the kon SDK operations (`defineOperation`): REST, OpenAPI 3.1 and
|
|
13
|
+
* MCP tools come out of them, with the zod validation from here;
|
|
14
|
+
* · Postgres RLS according to the declared policy (owner / team /
|
|
15
|
+
* public), with the core's agent functions;
|
|
16
|
+
* · the agent scopes `<model>:read` and `<model>:write` (an agent NEVER
|
|
17
|
+
* writes by default: it needs the write scope, a fine one of the kon,
|
|
18
|
+
* the broad one of the kon or `admin`) and the sensitivity (DELETE is sensitive);
|
|
19
|
+
* · the panel view (`modelDescriptor`: list, create and edit).
|
|
20
|
+
*
|
|
21
|
+
* This file is CONTRACT and is pure (no database, no Hono, no Drizzle): the
|
|
22
|
+
* engine, the API, the panel, the CLI (`kitsuden makemigrations`, which
|
|
23
|
+
* loads it with bun) and the tests read it.
|
|
24
|
+
*
|
|
25
|
+
* Safe by default: there is no model without `access`. `defineModel` throws if
|
|
26
|
+
* it is missing or if it asks for something that does not exist; there is no "open for now".
|
|
27
|
+
*
|
|
28
|
+
* Public guide: docs/agents/models.md.
|
|
29
|
+
*/
|
|
30
|
+
import { z, type ZodTypeAny } from "zod";
|
|
31
|
+
/** Version of the model format (descriptor and snapshot). Integer. */
|
|
32
|
+
export declare const MODELS_VERSION = 1;
|
|
33
|
+
export type FieldType = "text" | "longText" | "integer" | "number" | "boolean" | "date" | "enum" | "json" | "uuid";
|
|
34
|
+
export declare const FIELD_TYPES: readonly FieldType[];
|
|
35
|
+
/** A default value that can be written in SQL and in JSON. */
|
|
36
|
+
export type DefaultValue = string | number | boolean | null | Record<string, unknown> | unknown[];
|
|
37
|
+
/** The declaration of a field (what the `field` constructors return). */
|
|
38
|
+
export interface Field {
|
|
39
|
+
type: FieldType;
|
|
40
|
+
/** NOT NULL and required on create (unless it has `defaultValue`). */
|
|
41
|
+
required: boolean;
|
|
42
|
+
/** UNIQUE in the table (409 KITSUDEN_E_CONFLICT on repeat). */
|
|
43
|
+
unique: boolean;
|
|
44
|
+
/**
|
|
45
|
+
* Default value. It lives in the COLUMN (`DEFAULT`), not in zod: that way rows
|
|
46
|
+
* that come in through SQL respect it too. In `date`, `"now"` is
|
|
47
|
+
* `now()`.
|
|
48
|
+
*/
|
|
49
|
+
defaultValue?: DefaultValue;
|
|
50
|
+
/** Text: minimum/maximum length. Integer/number: minimum/maximum value. */
|
|
51
|
+
min?: number;
|
|
52
|
+
max?: number;
|
|
53
|
+
/** `enum` only. */
|
|
54
|
+
values?: readonly string[];
|
|
55
|
+
/** For the panel (by default, the key). */
|
|
56
|
+
tag?: string;
|
|
57
|
+
/** For humans and agents (OpenAPI, MCP, panel). */
|
|
58
|
+
description?: string;
|
|
59
|
+
/** Simple index on the column. */
|
|
60
|
+
index?: boolean;
|
|
61
|
+
/**
|
|
62
|
+
* PREVIOUS name of the field: `makemigrations` renames it (RENAME COLUMN)
|
|
63
|
+
* instead of dropping and creating. Remove it once the migration is already applied.
|
|
64
|
+
*/
|
|
65
|
+
before?: string;
|
|
66
|
+
}
|
|
67
|
+
type CommonOptions = Partial<Pick<Field, "required" | "unique" | "tag" | "description" | "index" | "before">>;
|
|
68
|
+
/** Field constructors: `field.text({ max: 200, required: true })`. */
|
|
69
|
+
export declare const field: {
|
|
70
|
+
text: (o?: CommonOptions & {
|
|
71
|
+
min?: number;
|
|
72
|
+
max?: number;
|
|
73
|
+
defaultValue?: string;
|
|
74
|
+
}) => Field;
|
|
75
|
+
longText: (o?: CommonOptions & {
|
|
76
|
+
max?: number;
|
|
77
|
+
defaultValue?: string;
|
|
78
|
+
}) => Field;
|
|
79
|
+
integer: (o?: CommonOptions & {
|
|
80
|
+
min?: number;
|
|
81
|
+
max?: number;
|
|
82
|
+
defaultValue?: number;
|
|
83
|
+
}) => Field;
|
|
84
|
+
number: (o?: CommonOptions & {
|
|
85
|
+
min?: number;
|
|
86
|
+
max?: number;
|
|
87
|
+
defaultValue?: number;
|
|
88
|
+
}) => Field;
|
|
89
|
+
boolean: (o?: CommonOptions & {
|
|
90
|
+
defaultValue?: boolean;
|
|
91
|
+
}) => Field;
|
|
92
|
+
date: (o?: CommonOptions & {
|
|
93
|
+
defaultValue?: "now";
|
|
94
|
+
}) => Field;
|
|
95
|
+
enum: (values: readonly string[], o?: CommonOptions & {
|
|
96
|
+
defaultValue?: string;
|
|
97
|
+
}) => Field;
|
|
98
|
+
json: (o?: CommonOptions & {
|
|
99
|
+
defaultValue?: Record<string, unknown> | unknown[];
|
|
100
|
+
}) => Field;
|
|
101
|
+
uuid: (o?: CommonOptions) => Field;
|
|
102
|
+
};
|
|
103
|
+
/**
|
|
104
|
+
* Who READS the rows:
|
|
105
|
+
* public anyone, including without a session (and any agent).
|
|
106
|
+
* owner each account sees its own (`owner_id` column); the admin (or the
|
|
107
|
+
* agent that opens the whole kon) sees them all.
|
|
108
|
+
* staff admin and editor (or the agent that opens the whole kon).
|
|
109
|
+
*
|
|
110
|
+
* There is no "any signed-in account sees everything": `verify-rls` treats as
|
|
111
|
+
* a leak whatever an unknown user sees and the anonymous one does not, and it is right.
|
|
112
|
+
*/
|
|
113
|
+
export type ModelRead = "public" | "owner" | "staff";
|
|
114
|
+
/**
|
|
115
|
+
* Who WRITES (create, edit, delete):
|
|
116
|
+
* owner any account creates; edits and deletes only its own (admin: everything).
|
|
117
|
+
* staff admin and editor (or the agent that opens the whole kon).
|
|
118
|
+
*
|
|
119
|
+
* Never "public": a model is not written without a session. An agent additionally
|
|
120
|
+
* needs `<model>:write` (or a fine/broad scope of the kon, or `admin`).
|
|
121
|
+
*/
|
|
122
|
+
export type ModelWrite = "owner" | "staff";
|
|
123
|
+
export interface ModelAccess {
|
|
124
|
+
read: ModelRead;
|
|
125
|
+
write: ModelWrite;
|
|
126
|
+
}
|
|
127
|
+
export declare const MODEL_READS: readonly ModelRead[];
|
|
128
|
+
export declare const MODEL_WRITES: readonly ModelWrite[];
|
|
129
|
+
export interface ModelDeclaration<C extends Record<string, Field> = Record<string, Field>> {
|
|
130
|
+
/** Singular, kebab-case: `note`, `task-item`. It is contract (scopes, tools). */
|
|
131
|
+
name: string;
|
|
132
|
+
/** Plural, kebab-case (by default `name + "s"`): routes and the list operation. */
|
|
133
|
+
plural?: string;
|
|
134
|
+
/** Table (by default, the plural in snake_case). */
|
|
135
|
+
table?: string;
|
|
136
|
+
/** For humans and agents: what a row is. */
|
|
137
|
+
description: string;
|
|
138
|
+
/** For the panel (by default, the name). */
|
|
139
|
+
tag?: string;
|
|
140
|
+
fields: C;
|
|
141
|
+
/** REQUIRED. Without an access policy there is no model. */
|
|
142
|
+
access: ModelAccess;
|
|
143
|
+
/** The field shown as the title of a row in the panel (by default, the first text one). */
|
|
144
|
+
title?: Extract<keyof C, string>;
|
|
145
|
+
/**
|
|
146
|
+
* Which operations end up as a PROPOSAL when an agent requests them in
|
|
147
|
+
* selective mode. By default only delete (like the SDK: DELETE is sensitive).
|
|
148
|
+
*/
|
|
149
|
+
sensitive?: {
|
|
150
|
+
create?: boolean;
|
|
151
|
+
update?: boolean;
|
|
152
|
+
remove?: boolean;
|
|
153
|
+
};
|
|
154
|
+
/**
|
|
155
|
+
* SEMANTIC search : one embedding per row, computed in the
|
|
156
|
+
* background (the Postgres queue) from these text fields, in
|
|
157
|
+
* an `embedding vector(dimensions)` pgvector column with an HNSW index. It gives
|
|
158
|
+
* the operation `search-<plural>` (`GET /<plural>/search?q=`), with the same
|
|
159
|
+
* access policy as listing. `dimensions` (default 1536) must
|
|
160
|
+
* match the embeddings model configured in the API.
|
|
161
|
+
*/
|
|
162
|
+
semantics?: {
|
|
163
|
+
fields: Extract<keyof C, string>[];
|
|
164
|
+
dimensions?: number;
|
|
165
|
+
};
|
|
166
|
+
}
|
|
167
|
+
declare const MARK: unique symbol;
|
|
168
|
+
/** A model already checked, with everything resolved. It is a data object (JSON-able except for the mark). */
|
|
169
|
+
export interface Model<C extends Record<string, Field> = Record<string, Field>> {
|
|
170
|
+
readonly [MARK]: true;
|
|
171
|
+
readonly version: typeof MODELS_VERSION;
|
|
172
|
+
readonly name: string;
|
|
173
|
+
readonly plural: string;
|
|
174
|
+
readonly table: string;
|
|
175
|
+
readonly description: string;
|
|
176
|
+
readonly tag: string;
|
|
177
|
+
readonly fields: C;
|
|
178
|
+
readonly access: ModelAccess;
|
|
179
|
+
readonly title: string | null;
|
|
180
|
+
readonly sensitive: {
|
|
181
|
+
create: boolean;
|
|
182
|
+
update: boolean;
|
|
183
|
+
remove: boolean;
|
|
184
|
+
};
|
|
185
|
+
/** `null` = no semantic search. */
|
|
186
|
+
readonly semantics: {
|
|
187
|
+
fields: string[];
|
|
188
|
+
dimensions: number;
|
|
189
|
+
} | null;
|
|
190
|
+
}
|
|
191
|
+
export declare function isModel(x: unknown): x is Model;
|
|
192
|
+
/** Columns the model adds: they cannot be declared as fields. */
|
|
193
|
+
export declare const SYSTEM_COLUMNS: readonly ["id", "owner_id", "created_at", "updated_at"];
|
|
194
|
+
/** Keys (camelCase) of those columns in the API. */
|
|
195
|
+
export declare const SYSTEM_KEYS: readonly ["id", "ownerId", "createdAt", "updatedAt"];
|
|
196
|
+
/**
|
|
197
|
+
* Names that cannot be models: their scope (`<name>:read`) would clash with
|
|
198
|
+
* a broad one of the core (`admin:*`, `mcp:read`, `datasets:*`…).
|
|
199
|
+
*/
|
|
200
|
+
export declare const RESERVED_NAMES: readonly ["admin", "mcp", "kon", "datasets", "user", "content", "memory", "brain", "promotion", "mail", "gate", "models", "model"];
|
|
201
|
+
/** `dueDate` → `due_date`. */
|
|
202
|
+
export declare function fieldColumn(key: string): string;
|
|
203
|
+
/** The id of a model's semantic search operation. */
|
|
204
|
+
export declare function modelSearchId(m: Pick<Model, "plural">): string;
|
|
205
|
+
export declare function defineModel<C extends Record<string, Field>>(d: ModelDeclaration<C>): Model<C>;
|
|
206
|
+
/** Does it carry an `owner_id` column? Whenever any rule talks about the owner. */
|
|
207
|
+
export declare function hasOwner(m: Pick<Model, "access">): boolean;
|
|
208
|
+
/**
|
|
209
|
+
* Can the creator choose the owner? Only in "the team writes rows that
|
|
210
|
+
* each owner reads" (e.g. the team assigns tasks): the team says whose it is.
|
|
211
|
+
*/
|
|
212
|
+
export declare function choosesOwner(m: Pick<Model, "access">): boolean;
|
|
213
|
+
/** The model's agent scopes. They are contract. */
|
|
214
|
+
export declare function modelScopes(m: Pick<Model, "name">): {
|
|
215
|
+
read: string;
|
|
216
|
+
write: string;
|
|
217
|
+
};
|
|
218
|
+
/** The ids (kebab-case, they are contract) of the model's operations. */
|
|
219
|
+
export declare function modelOperationIds(m: Pick<Model, "name" | "plural">): {
|
|
220
|
+
readonly describe: `describe-${string}`;
|
|
221
|
+
readonly list: `list-${string}`;
|
|
222
|
+
readonly get: `get-${string}`;
|
|
223
|
+
readonly create: `create-${string}`;
|
|
224
|
+
readonly update: `update-${string}`;
|
|
225
|
+
readonly remove: `delete-${string}`;
|
|
226
|
+
};
|
|
227
|
+
/** The routes, relative to the kon's mount. */
|
|
228
|
+
export declare function modelRoutes(m: Pick<Model, "plural">): {
|
|
229
|
+
readonly describe: `/${string}/_model`;
|
|
230
|
+
readonly collection: `/${string}`;
|
|
231
|
+
readonly row: `/${string}/:id`;
|
|
232
|
+
};
|
|
233
|
+
/** The zod schema of a field value (input), without optionality. */
|
|
234
|
+
export declare function fieldSchema(c: Field): ZodTypeAny;
|
|
235
|
+
/** Sortable fields in the list (everything except json and long text). */
|
|
236
|
+
export declare function sortableFields(m: Pick<Model, "fields">): string[];
|
|
237
|
+
/** Fields filtered by equality in the list. */
|
|
238
|
+
export declare function filterableFields(m: Pick<Model, "fields">): string[];
|
|
239
|
+
export declare const DEFAULT_LIMIT = 20;
|
|
240
|
+
export declare const MAX_LIMIT = 100;
|
|
241
|
+
/**
|
|
242
|
+
* The model's zod schemas. No `.default()` after a `transform` (a zod 4
|
|
243
|
+
* trap): default values are set by the column, and the list applies
|
|
244
|
+
* its own in the handler.
|
|
245
|
+
*/
|
|
246
|
+
export declare function modelSchemas(m: Model): {
|
|
247
|
+
create: z.ZodObject<{
|
|
248
|
+
[x: string]: z.ZodTypeAny;
|
|
249
|
+
}, z.core.$strip>;
|
|
250
|
+
update: z.ZodObject<{
|
|
251
|
+
[x: string]: z.ZodTypeAny;
|
|
252
|
+
}, z.core.$strip>;
|
|
253
|
+
row: z.ZodObject<{
|
|
254
|
+
[x: string]: z.ZodTypeAny;
|
|
255
|
+
}, z.core.$strip>;
|
|
256
|
+
list: z.ZodObject<{
|
|
257
|
+
data: z.ZodArray<z.ZodObject<{
|
|
258
|
+
[x: string]: z.ZodTypeAny;
|
|
259
|
+
}, z.core.$strip>>;
|
|
260
|
+
total: z.ZodNumber;
|
|
261
|
+
limit: z.ZodNumber;
|
|
262
|
+
offset: z.ZodNumber;
|
|
263
|
+
}, z.core.$strip>;
|
|
264
|
+
query: z.ZodObject<{
|
|
265
|
+
[x: string]: z.ZodTypeAny;
|
|
266
|
+
}, z.core.$strip>;
|
|
267
|
+
params: z.ZodObject<{
|
|
268
|
+
id: z.ZodGUID;
|
|
269
|
+
}, z.core.$strip>;
|
|
270
|
+
};
|
|
271
|
+
export interface DescribedField {
|
|
272
|
+
key: string;
|
|
273
|
+
column: string;
|
|
274
|
+
type: FieldType;
|
|
275
|
+
required: boolean;
|
|
276
|
+
unique: boolean;
|
|
277
|
+
tag: string;
|
|
278
|
+
description?: string;
|
|
279
|
+
min?: number;
|
|
280
|
+
max?: number;
|
|
281
|
+
values?: string[];
|
|
282
|
+
defaultValue?: DefaultValue;
|
|
283
|
+
}
|
|
284
|
+
export interface ModelDescriptor {
|
|
285
|
+
version: number;
|
|
286
|
+
name: string;
|
|
287
|
+
plural: string;
|
|
288
|
+
table: string;
|
|
289
|
+
tag: string;
|
|
290
|
+
description: string;
|
|
291
|
+
title: string | null;
|
|
292
|
+
access: ModelAccess;
|
|
293
|
+
withOwner: boolean;
|
|
294
|
+
choosesOwner: boolean;
|
|
295
|
+
scopes: {
|
|
296
|
+
read: string;
|
|
297
|
+
write: string;
|
|
298
|
+
};
|
|
299
|
+
operations: ReturnType<typeof modelOperationIds>;
|
|
300
|
+
fields: DescribedField[];
|
|
301
|
+
sortable: string[];
|
|
302
|
+
filterable: string[];
|
|
303
|
+
}
|
|
304
|
+
export declare function modelDescriptor(m: Model): ModelDescriptor;
|
|
305
|
+
/** The descriptor's schema (output of `describe-<model>` and of `/api/models`). */
|
|
306
|
+
export declare const modelDescriptorSchema: z.ZodObject<{
|
|
307
|
+
version: z.ZodNumber;
|
|
308
|
+
name: z.ZodString;
|
|
309
|
+
plural: z.ZodString;
|
|
310
|
+
table: z.ZodString;
|
|
311
|
+
tag: z.ZodString;
|
|
312
|
+
description: z.ZodString;
|
|
313
|
+
title: z.ZodNullable<z.ZodString>;
|
|
314
|
+
access: z.ZodObject<{
|
|
315
|
+
read: z.ZodEnum<{
|
|
316
|
+
public: "public";
|
|
317
|
+
owner: "owner";
|
|
318
|
+
staff: "staff";
|
|
319
|
+
}>;
|
|
320
|
+
write: z.ZodEnum<{
|
|
321
|
+
owner: "owner";
|
|
322
|
+
staff: "staff";
|
|
323
|
+
}>;
|
|
324
|
+
}, z.core.$strip>;
|
|
325
|
+
withOwner: z.ZodBoolean;
|
|
326
|
+
choosesOwner: z.ZodBoolean;
|
|
327
|
+
scopes: z.ZodObject<{
|
|
328
|
+
read: z.ZodString;
|
|
329
|
+
write: z.ZodString;
|
|
330
|
+
}, z.core.$strip>;
|
|
331
|
+
operations: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
332
|
+
fields: z.ZodArray<z.ZodObject<{
|
|
333
|
+
key: z.ZodString;
|
|
334
|
+
column: z.ZodString;
|
|
335
|
+
type: z.ZodEnum<{
|
|
336
|
+
number: "number";
|
|
337
|
+
boolean: "boolean";
|
|
338
|
+
json: "json";
|
|
339
|
+
date: "date";
|
|
340
|
+
enum: "enum";
|
|
341
|
+
text: "text";
|
|
342
|
+
uuid: "uuid";
|
|
343
|
+
integer: "integer";
|
|
344
|
+
longText: "longText";
|
|
345
|
+
}>;
|
|
346
|
+
required: z.ZodBoolean;
|
|
347
|
+
unique: z.ZodBoolean;
|
|
348
|
+
tag: z.ZodString;
|
|
349
|
+
}, z.core.$loose>>;
|
|
350
|
+
sortable: z.ZodArray<z.ZodString>;
|
|
351
|
+
filterable: z.ZodArray<z.ZodString>;
|
|
352
|
+
}, z.core.$loose>;
|
|
353
|
+
export {};
|
|
354
|
+
//# sourceMappingURL=models.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"models.d.ts","sourceRoot":"","sources":["../src/models.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,OAAO,EAAE,CAAC,EAAE,KAAK,UAAU,EAAE,MAAM,KAAK,CAAC;AAIzC,sEAAsE;AACtE,eAAO,MAAM,cAAc,IAAI,CAAC;AAIhC,MAAM,MAAM,SAAS,GACnB,MAAM,GAAG,UAAU,GAAG,SAAS,GAAG,QAAQ,GAAG,SAAS,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC;AAE7F,eAAO,MAAM,WAAW,EAAE,SAAS,SAAS,EAU3C,CAAC;AAEF,8DAA8D;AAC9D,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,EAAE,CAAC;AAElG,yEAAyE;AACzE,MAAM,WAAW,KAAK;IACpB,IAAI,EAAE,SAAS,CAAC;IAChB,sEAAsE;IACtE,QAAQ,EAAE,OAAO,CAAC;IAClB,+DAA+D;IAC/D,MAAM,EAAE,OAAO,CAAC;IAChB;;;;OAIG;IACH,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B,2EAA2E;IAC3E,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,mBAAmB;IACnB,MAAM,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC3B,2CAA2C;IAC3C,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,mDAAmD;IACnD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,kCAAkC;IAClC,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB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