create-ailk 0.12.0 → 0.13.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/dist/module-architecture.js +27 -0
- package/package.json +3 -3
- package/templates/.env.example +23 -9
- package/templates/apps/api/CLAUDE.md +21 -17
- package/templates/apps/api/src/__tests__/factories/agent-caller.ts +98 -0
- package/templates/apps/api/src/__tests__/factories/in-memory-prisma.ts +321 -0
- package/templates/apps/api/src/__tests__/schedule-forwarded-rate-limit.test.ts +117 -0
- package/templates/apps/api/src/config/__tests__/hub-require-spoke-key.test.ts +39 -14
- package/templates/apps/api/src/config/index.ts +35 -20
- package/templates/apps/api/src/lib/__mocks__/prisma-client.js +3 -0
- package/templates/apps/api/src/lib/__mocks__/prisma.ts +14 -0
- package/templates/apps/api/src/lib/__tests__/agent-store.test.ts +468 -0
- package/templates/apps/api/src/lib/__tests__/spoke-store.test.ts +32 -2
- package/templates/apps/api/src/lib/agent-store.ts +521 -0
- package/templates/apps/api/src/lib/spoke-store.ts +13 -2
- package/templates/apps/api/src/middleware/__tests__/auth.bearer-path.test.ts +384 -1
- package/templates/apps/api/src/middleware/__tests__/auth.cookie-path.test.ts +61 -0
- package/templates/apps/api/src/middleware/__tests__/default-tenant.test.ts +176 -0
- package/templates/apps/api/src/middleware/__tests__/rate-limit.test.ts +76 -0
- package/templates/apps/api/src/middleware/auth.ts +219 -5
- package/templates/apps/api/src/middleware/default-tenant.ts +29 -8
- package/templates/apps/api/src/middleware/rate-limit.ts +35 -13
- package/templates/apps/api/src/routes/leads/__tests__/spoke.test.ts +76 -15
- package/templates/apps/api/src/routes/leads/index.ts +14 -6
- package/templates/apps/api/src/routes/project-listings/__tests__/me.test.ts +5 -6
- package/templates/apps/api/src/routes/project-listings/index.ts +14 -9
- package/templates/apps/api/src/routes/project-listings/me.ts +4 -3
- package/templates/apps/api/src/routes/project-listings/patch-copy.ts +7 -5
- package/templates/apps/api/src/routes/workspaces/__tests__/inbox-wire-schemas.test.ts +198 -0
- package/templates/apps/api/src/server.ts +27 -0
- package/templates/apps/api/src/services/__tests__/audit-log.test.ts +374 -57
- package/templates/apps/api/src/services/__tests__/leads-inbox.test.ts +25 -2
- package/templates/apps/api/src/services/__tests__/spoke-resolution.test.ts +303 -17
- package/templates/apps/api/src/services/audit-log.ts +278 -47
- package/templates/apps/api/src/services/default-tenant.ts +55 -5
- package/templates/apps/api/src/services/leads-inbox.ts +12 -21
- package/templates/apps/api/src/services/project-listings.ts +1 -21
- package/templates/apps/api/src/services/public-site-resolver.ts +103 -13
- package/templates/apps/mcp/CLAUDE.md +44 -5
- package/templates/apps/mcp/__tests__/parity.test.ts +53 -1
- package/templates/apps/mcp/__tests__/workspace-surface.test.ts +364 -0
- package/templates/apps/mcp/src/http-transport.ts +107 -1
- package/templates/apps/mcp/src/workspace-server.ts +193 -0
- package/templates/apps/web/.env.example +64 -37
- package/templates/apps/web/app/v1/[...path]/route.ts +16 -0
- package/templates/apps/web/lib/__tests__/relay.test.ts +515 -0
- package/templates/apps/web/lib/relay.ts +279 -0
- package/templates/apps/web/middleware.ts +5 -4
- package/templates/apps/web/next.config.mjs +6 -0
- package/templates/database/CHANGELOG.md +25 -0
- package/templates/database/__tests__/agents.db.test.ts +235 -0
- package/templates/database/__tests__/build.test.ts +131 -0
- package/templates/database/auth/schema.prisma +61 -0
- package/templates/database/migrations/20261005120000_agents/migration.sql +84 -0
- package/templates/database/package.json +3 -3
- package/versions.json +34 -34
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file build.test.ts
|
|
3
|
+
* @description The package `build` cannot emit a stale generated client
|
|
4
|
+
* (#7565). `build` used to be `tsc -b` alone: it never ran `prisma generate`,
|
|
5
|
+
* and `tsc -b` trusts `tsconfig.build.tsbuildinfo`, so a checkout whose
|
|
6
|
+
* generated client predated a schema change built — and reported as built —
|
|
7
|
+
* a dist missing the new models (database@0.14.0 shipped without
|
|
8
|
+
* FlowCheckout, database@0.34.0 without Spoke).
|
|
9
|
+
*
|
|
10
|
+
* The suite runs the package's REAL scripts and tsconfigs against a copy of
|
|
11
|
+
* the package in a temp dir, so it never touches this package's generated
|
|
12
|
+
* client or dist (the tenancy/flows configs still build `packages/ids` and
|
|
13
|
+
* `packages/validation` in place when those are stale, as any database build
|
|
14
|
+
* does). The copy keeps the real model-free `schema.prisma`
|
|
15
|
+
* (generator + datasource) and swaps the namespace schemas for one probe
|
|
16
|
+
* model, which keeps both builds to seconds. `node_modules` and the sibling
|
|
17
|
+
* `packages/` the tenancy/flows configs reference are symlinked in, and the
|
|
18
|
+
* root `tsconfig.base.json` is copied to where `extends` expects it.
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
import { execFileSync } from "node:child_process";
|
|
22
|
+
import {
|
|
23
|
+
cpSync,
|
|
24
|
+
existsSync,
|
|
25
|
+
mkdtempSync,
|
|
26
|
+
readFileSync,
|
|
27
|
+
rmSync,
|
|
28
|
+
symlinkSync,
|
|
29
|
+
writeFileSync,
|
|
30
|
+
} from "node:fs";
|
|
31
|
+
import { tmpdir } from "node:os";
|
|
32
|
+
import { join } from "node:path";
|
|
33
|
+
|
|
34
|
+
const PACKAGE_DIR = join(__dirname, "..");
|
|
35
|
+
const REPO_ROOT = join(PACKAGE_DIR, "..");
|
|
36
|
+
|
|
37
|
+
const PACKAGE_FILES = [
|
|
38
|
+
"package.json",
|
|
39
|
+
"prisma.config.ts",
|
|
40
|
+
"schema.prisma",
|
|
41
|
+
"tenancy.ts",
|
|
42
|
+
"tsconfig.build.json",
|
|
43
|
+
"tsconfig.tenancy.json",
|
|
44
|
+
"tsconfig.flows.json",
|
|
45
|
+
];
|
|
46
|
+
|
|
47
|
+
const BUILD_TIMEOUT_MS = 180_000;
|
|
48
|
+
|
|
49
|
+
let root: string;
|
|
50
|
+
let db: string;
|
|
51
|
+
|
|
52
|
+
function run(script: string): void {
|
|
53
|
+
try {
|
|
54
|
+
execFileSync("pnpm", ["run", script], { cwd: db, stdio: "pipe" });
|
|
55
|
+
} catch (error) {
|
|
56
|
+
// tsc reports type errors on stdout, which execFileSync's message omits.
|
|
57
|
+
const { stdout } = error as { stdout?: Buffer };
|
|
58
|
+
throw new Error(`pnpm run ${script} failed:\n${stdout?.toString() ?? ""}`, {
|
|
59
|
+
cause: error,
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
function addModel(name: string): void {
|
|
65
|
+
writeFileSync(
|
|
66
|
+
join(db, `${name}.prisma`),
|
|
67
|
+
`model ${name} {\n id String @id\n}\n`,
|
|
68
|
+
);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
function emitted(file: string): string {
|
|
72
|
+
return readFileSync(join(db, "dist", "client", "internal", file), "utf8");
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
beforeAll(() => {
|
|
76
|
+
root = mkdtempSync(join(tmpdir(), "ailk-database-build-"));
|
|
77
|
+
db = join(root, "database");
|
|
78
|
+
cpSync(
|
|
79
|
+
join(REPO_ROOT, "tsconfig.base.json"),
|
|
80
|
+
join(root, "tsconfig.base.json"),
|
|
81
|
+
);
|
|
82
|
+
symlinkSync(join(REPO_ROOT, "packages"), join(root, "packages"), "dir");
|
|
83
|
+
for (const file of PACKAGE_FILES) {
|
|
84
|
+
cpSync(join(PACKAGE_DIR, file), join(db, file));
|
|
85
|
+
}
|
|
86
|
+
cpSync(join(PACKAGE_DIR, "flows"), join(db, "flows"), { recursive: true });
|
|
87
|
+
symlinkSync(
|
|
88
|
+
join(PACKAGE_DIR, "node_modules"),
|
|
89
|
+
join(db, "node_modules"),
|
|
90
|
+
"dir",
|
|
91
|
+
);
|
|
92
|
+
|
|
93
|
+
// The state every release that shipped a stale client started from: the
|
|
94
|
+
// client was generated and built once, and tsc -b recorded it as built.
|
|
95
|
+
addModel("BuildProbeAlpha");
|
|
96
|
+
run("db:generate");
|
|
97
|
+
}, BUILD_TIMEOUT_MS);
|
|
98
|
+
|
|
99
|
+
afterAll(() => {
|
|
100
|
+
if (root) rmSync(root, { recursive: true, force: true });
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
describe("@working-theory/database build", () => {
|
|
104
|
+
it(
|
|
105
|
+
"emits a model added to the schema after the last build, despite an existing tsconfig.build.tsbuildinfo",
|
|
106
|
+
() => {
|
|
107
|
+
expect(existsSync(join(db, "tsconfig.build.tsbuildinfo"))).toBe(true);
|
|
108
|
+
expect(emitted("class.d.ts")).not.toContain("buildProbeBravo");
|
|
109
|
+
|
|
110
|
+
addModel("BuildProbeBravo");
|
|
111
|
+
run("build");
|
|
112
|
+
|
|
113
|
+
expect(emitted("class.d.ts")).toContain("get buildProbeBravo()");
|
|
114
|
+
expect(emitted("class.js")).toContain("BuildProbeBravo");
|
|
115
|
+
},
|
|
116
|
+
BUILD_TIMEOUT_MS,
|
|
117
|
+
);
|
|
118
|
+
|
|
119
|
+
it(
|
|
120
|
+
"re-emits a deleted dist/client although the generated sources did not change",
|
|
121
|
+
() => {
|
|
122
|
+
rmSync(join(db, "dist", "client"), { recursive: true, force: true });
|
|
123
|
+
|
|
124
|
+
run("build");
|
|
125
|
+
|
|
126
|
+
expect(emitted("class.d.ts")).toContain("get buildProbeAlpha()");
|
|
127
|
+
expect(emitted("class.js")).toContain("BuildProbeAlpha");
|
|
128
|
+
},
|
|
129
|
+
BUILD_TIMEOUT_MS,
|
|
130
|
+
);
|
|
131
|
+
});
|
|
@@ -82,6 +82,8 @@ model Organization {
|
|
|
82
82
|
memberships Membership[]
|
|
83
83
|
invitations Invitation[]
|
|
84
84
|
workspaces Workspace[]
|
|
85
|
+
// #3591 — the agents (delegates) of this organization's members.
|
|
86
|
+
agents Agent[]
|
|
85
87
|
|
|
86
88
|
@@unique([billingProvider, billingCustomerId])
|
|
87
89
|
@@map("organizations")
|
|
@@ -102,6 +104,8 @@ model Workspace {
|
|
|
102
104
|
organization Organization @relation(fields: [organizationId], references: [id], onDelete: Cascade)
|
|
103
105
|
// #7532 — the hub's spoke registry rows bound to this workspace.
|
|
104
106
|
spokes Spoke[]
|
|
107
|
+
// #3591 — the agents bound to this workspace.
|
|
108
|
+
agents Agent[]
|
|
105
109
|
|
|
106
110
|
@@unique([organizationId, slug])
|
|
107
111
|
@@index([organizationId])
|
|
@@ -137,6 +141,59 @@ model Spoke {
|
|
|
137
141
|
@@map("spokes")
|
|
138
142
|
}
|
|
139
143
|
|
|
144
|
+
/// AgentPermissionLevel — an agent's ceiling (#3591, spec
|
|
145
|
+
/// docs/specs/3591-tenant-scoped-agent-auth-secure-spec.md D1, D5). The agent
|
|
146
|
+
/// acts with the LOWER of its person's `Role` and this. One value in v1;
|
|
147
|
+
/// raising the ceiling later is a new value here and in
|
|
148
|
+
/// `@working-theory/validation`'s `AGENT_PERMISSION_LEVELS`.
|
|
149
|
+
enum AgentPermissionLevel {
|
|
150
|
+
member
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
/// Agent — a stored delegate of ONE person, bound to ONE workspace (#3591,
|
|
154
|
+
/// spec docs/specs/3591-tenant-scoped-agent-auth-secure-spec.md D1, D2).
|
|
155
|
+
///
|
|
156
|
+
/// The agent signs in with a key (`ailk_agt_…`, shown once) and passes the
|
|
157
|
+
/// same tenant guard a browser session does, through its person's live
|
|
158
|
+
/// `Membership` (`responsibleMembershipId`). Removing that membership deletes
|
|
159
|
+
/// the agent (the FK below), so a re-invite cannot revive it.
|
|
160
|
+
///
|
|
161
|
+
/// Only the key's SHA-256 digest is stored (`credentialHash`) plus a short
|
|
162
|
+
/// recognisable `credentialPrefix`; the key itself never is.
|
|
163
|
+
/// `keyIssuedToMembershipId` is the owner or admin who created or last
|
|
164
|
+
/// re-keyed the agent — the only person who has seen its key. Removing that
|
|
165
|
+
/// membership sets the column null and the guard refuses the agent until it
|
|
166
|
+
/// is re-keyed. `createdByUserId` is a plain column with no relation, so
|
|
167
|
+
/// deleting the creator does not delete the agents they made for others.
|
|
168
|
+
/// `apps/api/src/lib/agent-store.ts` is the only file that names
|
|
169
|
+
/// `prisma.agent`.
|
|
170
|
+
model Agent {
|
|
171
|
+
id String @id @default(dbgenerated("('agent_'::text || (uuidv7())::text)")) @db.Text
|
|
172
|
+
organizationId String @map("organization_id")
|
|
173
|
+
workspaceId String @map("workspace_id")
|
|
174
|
+
responsibleMembershipId String @map("responsible_membership_id")
|
|
175
|
+
name String @db.VarChar(80)
|
|
176
|
+
permissionLevel AgentPermissionLevel @default(member) @map("permission_level")
|
|
177
|
+
enabled Boolean @default(true)
|
|
178
|
+
credentialHash String @unique @map("credential_hash") @db.Char(64)
|
|
179
|
+
credentialPrefix String @map("credential_prefix") @db.VarChar(24)
|
|
180
|
+
lastActiveAt DateTime? @map("last_active_at")
|
|
181
|
+
createdByUserId String @map("created_by_user_id")
|
|
182
|
+
keyIssuedToMembershipId String? @map("key_issued_to_membership_id")
|
|
183
|
+
createdAt DateTime @default(now()) @map("created_at")
|
|
184
|
+
updatedAt DateTime @updatedAt @map("updated_at")
|
|
185
|
+
|
|
186
|
+
organization Organization @relation(fields: [organizationId], references: [id], onDelete: Cascade)
|
|
187
|
+
workspace Workspace @relation(fields: [workspaceId], references: [id], onDelete: Cascade)
|
|
188
|
+
responsible Membership @relation("AgentResponsible", fields: [responsibleMembershipId], references: [id], onDelete: Cascade)
|
|
189
|
+
keyIssuedTo Membership? @relation("AgentKeyIssuedTo", fields: [keyIssuedToMembershipId], references: [id], onDelete: SetNull)
|
|
190
|
+
|
|
191
|
+
@@index([organizationId])
|
|
192
|
+
@@index([workspaceId])
|
|
193
|
+
@@index([responsibleMembershipId])
|
|
194
|
+
@@map("agents")
|
|
195
|
+
}
|
|
196
|
+
|
|
140
197
|
/// Membership — User ↔ Organization with a Role. Managed by the Better Auth
|
|
141
198
|
/// organization plugin (modelName "membership"). Org-level: grants visibility
|
|
142
199
|
/// into every workspace of the organization.
|
|
@@ -149,6 +206,10 @@ model Membership {
|
|
|
149
206
|
|
|
150
207
|
organization Organization @relation(fields: [organizationId], references: [id], onDelete: Cascade)
|
|
151
208
|
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
|
|
209
|
+
// #3591 — the agents this person is responsible for, and the agents whose
|
|
210
|
+
// current key this person was the one shown.
|
|
211
|
+
agents Agent[] @relation("AgentResponsible")
|
|
212
|
+
agentKeysIssued Agent[] @relation("AgentKeyIssuedTo")
|
|
152
213
|
|
|
153
214
|
@@unique([organizationId, userId])
|
|
154
215
|
@@index([userId])
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
-- #3591 — the agent seat, step A (spec
|
|
2
|
+
-- docs/specs/3591-tenant-scoped-agent-auth-secure-spec.md D1).
|
|
3
|
+
--
|
|
4
|
+
-- agents (auth) — one row per agent: a stored delegate of ONE person (its
|
|
5
|
+
-- responsible Membership), bound to ONE workspace. It stores
|
|
6
|
+
-- the SHA-256 digest of the agent's key, never the key.
|
|
7
|
+
-- Deleting the organization, the workspace or the person's
|
|
8
|
+
-- membership deletes the agent; deleting the membership of
|
|
9
|
+
-- the person who was last shown its key sets
|
|
10
|
+
-- key_issued_to_membership_id null, which the guard refuses
|
|
11
|
+
-- until the agent is re-keyed. created_by_user_id is a plain
|
|
12
|
+
-- column with no foreign key, so deleting the creator does
|
|
13
|
+
-- not delete the agents they made for someone else.
|
|
14
|
+
--
|
|
15
|
+
-- PURELY ADDITIVE: one new enum, one new table, its indexes and four FKs (to
|
|
16
|
+
-- "organizations", "workspaces" and twice to "memberships"). No statement
|
|
17
|
+
-- touches an existing table's rows or columns, so there is no pre-assertion
|
|
18
|
+
-- block — this migration cannot lose a row.
|
|
19
|
+
--
|
|
20
|
+
-- Rollback: DROP TABLE "agents"; DROP TYPE "AgentPermissionLevel". Safe while
|
|
21
|
+
-- nothing but #3591's own code reads them.
|
|
22
|
+
|
|
23
|
+
-- CreateEnum
|
|
24
|
+
CREATE TYPE "AgentPermissionLevel" AS ENUM ('member');
|
|
25
|
+
|
|
26
|
+
-- CreateTable
|
|
27
|
+
CREATE TABLE "agents" (
|
|
28
|
+
"id" TEXT NOT NULL DEFAULT ('agent_'::text || (uuidv7())::text),
|
|
29
|
+
"organization_id" TEXT NOT NULL,
|
|
30
|
+
"workspace_id" TEXT NOT NULL,
|
|
31
|
+
"responsible_membership_id" TEXT NOT NULL,
|
|
32
|
+
"name" VARCHAR(80) NOT NULL,
|
|
33
|
+
"permission_level" "AgentPermissionLevel" NOT NULL DEFAULT 'member',
|
|
34
|
+
"enabled" BOOLEAN NOT NULL DEFAULT true,
|
|
35
|
+
"credential_hash" CHAR(64) NOT NULL,
|
|
36
|
+
"credential_prefix" VARCHAR(24) NOT NULL,
|
|
37
|
+
"last_active_at" TIMESTAMP(3),
|
|
38
|
+
"created_by_user_id" TEXT NOT NULL,
|
|
39
|
+
"key_issued_to_membership_id" TEXT,
|
|
40
|
+
"created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
|
41
|
+
"updated_at" TIMESTAMP(3) NOT NULL,
|
|
42
|
+
|
|
43
|
+
CONSTRAINT "agents_pkey" PRIMARY KEY ("id")
|
|
44
|
+
);
|
|
45
|
+
|
|
46
|
+
-- CreateIndex
|
|
47
|
+
-- The lookup an agent's every request makes (`findAgentByKeyHash`).
|
|
48
|
+
CREATE UNIQUE INDEX "agents_credential_hash_key" ON "agents"("credential_hash");
|
|
49
|
+
|
|
50
|
+
-- CreateIndex
|
|
51
|
+
CREATE INDEX "agents_organization_id_idx" ON "agents"("organization_id");
|
|
52
|
+
|
|
53
|
+
-- CreateIndex
|
|
54
|
+
CREATE INDEX "agents_workspace_id_idx" ON "agents"("workspace_id");
|
|
55
|
+
|
|
56
|
+
-- CreateIndex
|
|
57
|
+
CREATE INDEX "agents_responsible_membership_id_idx" ON "agents"("responsible_membership_id");
|
|
58
|
+
|
|
59
|
+
-- AddForeignKey
|
|
60
|
+
ALTER TABLE "agents" ADD CONSTRAINT "agents_organization_id_fkey" FOREIGN KEY ("organization_id") REFERENCES "organizations"("id") ON DELETE CASCADE ON UPDATE CASCADE;
|
|
61
|
+
|
|
62
|
+
-- AddForeignKey
|
|
63
|
+
ALTER TABLE "agents" ADD CONSTRAINT "agents_workspace_id_fkey" FOREIGN KEY ("workspace_id") REFERENCES "workspaces"("id") ON DELETE CASCADE ON UPDATE CASCADE;
|
|
64
|
+
|
|
65
|
+
-- AddForeignKey
|
|
66
|
+
-- Leaving stops the agent: removing the person's membership deletes it.
|
|
67
|
+
ALTER TABLE "agents" ADD CONSTRAINT "agents_responsible_membership_id_fkey" FOREIGN KEY ("responsible_membership_id") REFERENCES "memberships"("id") ON DELETE CASCADE ON UPDATE CASCADE;
|
|
68
|
+
|
|
69
|
+
-- AddForeignKey
|
|
70
|
+
-- A key dies with the person who received it: SET NULL, which the guard refuses.
|
|
71
|
+
ALTER TABLE "agents" ADD CONSTRAINT "agents_key_issued_to_membership_id_fkey" FOREIGN KEY ("key_issued_to_membership_id") REFERENCES "memberships"("id") ON DELETE SET NULL ON UPDATE CASCADE;
|
|
72
|
+
|
|
73
|
+
-- ADR-0031 rule 3 — agents: agent_ (registered in packages/ids/src/registry.ts;
|
|
74
|
+
-- this migration's path is added to migration-sync.test.ts's
|
|
75
|
+
-- PK_CHECK_MIGRATIONS). Each reference column carries the format CHECK of the
|
|
76
|
+
-- entity it names, in the exact pattern the spoke migration uses.
|
|
77
|
+
ALTER TABLE "agents" ALTER COLUMN "id" TYPE text COLLATE "C";
|
|
78
|
+
ALTER TABLE "agents" ALTER COLUMN "id" SET DEFAULT ('agent_'::text || (uuidv7())::text);
|
|
79
|
+
ALTER TABLE "agents" ADD CONSTRAINT "agents_id_format" CHECK ("id" ~ '^agent_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$');
|
|
80
|
+
ALTER TABLE "agents" ADD CONSTRAINT "agents_organization_id_format" CHECK ("organization_id" ~ '^org_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$');
|
|
81
|
+
ALTER TABLE "agents" ADD CONSTRAINT "agents_workspace_id_format" CHECK ("workspace_id" ~ '^wksp_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$');
|
|
82
|
+
ALTER TABLE "agents" ADD CONSTRAINT "agents_responsible_membership_id_format" CHECK ("responsible_membership_id" ~ '^member_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$');
|
|
83
|
+
ALTER TABLE "agents" ADD CONSTRAINT "agents_key_issued_to_membership_id_format" CHECK ("key_issued_to_membership_id" ~ '^member_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$');
|
|
84
|
+
ALTER TABLE "agents" ADD CONSTRAINT "agents_created_by_user_id_format" CHECK ("created_by_user_id" ~ '^user_[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$');
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@working-theory/database",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.35.0",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -51,8 +51,8 @@
|
|
|
51
51
|
},
|
|
52
52
|
"scripts": {
|
|
53
53
|
"lint": "eslint .",
|
|
54
|
-
"build": "tsc -b tsconfig.build.json && tsc -b tsconfig.tenancy.json && tsc -b tsconfig.flows.json",
|
|
55
|
-
"db:generate": "
|
|
54
|
+
"build": "prisma generate && tsc -b tsconfig.build.json --force && tsc -b tsconfig.tenancy.json && tsc -b tsconfig.flows.json",
|
|
55
|
+
"db:generate": "pnpm run build",
|
|
56
56
|
"db:migrate": "prisma migrate dev",
|
|
57
57
|
"db:migrate:deploy": "prisma migrate deploy",
|
|
58
58
|
"db:push": "prisma db push",
|
package/versions.json
CHANGED
|
@@ -1,52 +1,52 @@
|
|
|
1
1
|
{
|
|
2
|
-
"@working-theory/admin-ui": "0.
|
|
3
|
-
"@working-theory/aeo": "0.
|
|
4
|
-
"@working-theory/agent-context": "0.
|
|
2
|
+
"@working-theory/admin-ui": "0.35.0",
|
|
3
|
+
"@working-theory/aeo": "0.35.0",
|
|
4
|
+
"@working-theory/agent-context": "0.35.0",
|
|
5
5
|
"@working-theory/agent-contract": "0.1.0",
|
|
6
6
|
"@working-theory/agent-memory": "0.0.0",
|
|
7
7
|
"@working-theory/ai": "0.1.0",
|
|
8
|
-
"@working-theory/analytics": "0.
|
|
9
|
-
"@working-theory/api-client": "0.
|
|
8
|
+
"@working-theory/analytics": "0.35.0",
|
|
9
|
+
"@working-theory/api-client": "0.35.0",
|
|
10
10
|
"@working-theory/cda-filesystem": "0.0.0",
|
|
11
|
-
"@working-theory/cli": "0.
|
|
12
|
-
"@working-theory/common": "0.
|
|
11
|
+
"@working-theory/cli": "0.35.0",
|
|
12
|
+
"@working-theory/common": "0.35.0",
|
|
13
13
|
"@working-theory/consent": "0.1.0",
|
|
14
|
-
"@working-theory/content-adapters": "0.
|
|
15
|
-
"@working-theory/content-projection": "0.
|
|
16
|
-
"@working-theory/email": "0.
|
|
14
|
+
"@working-theory/content-adapters": "0.35.0",
|
|
15
|
+
"@working-theory/content-projection": "0.35.0",
|
|
16
|
+
"@working-theory/email": "0.35.0",
|
|
17
17
|
"@working-theory/env": "0.0.0",
|
|
18
|
-
"@working-theory/eslint-config": "0.
|
|
19
|
-
"@working-theory/fumadocs-schema": "0.
|
|
20
|
-
"@working-theory/ids": "0.
|
|
21
|
-
"@working-theory/jsonld": "0.
|
|
22
|
-
"@working-theory/license": "0.
|
|
23
|
-
"@working-theory/metadata": "0.
|
|
24
|
-
"@working-theory/observability": "0.
|
|
25
|
-
"@working-theory/page-renderer": "0.
|
|
18
|
+
"@working-theory/eslint-config": "0.35.0",
|
|
19
|
+
"@working-theory/fumadocs-schema": "0.35.0",
|
|
20
|
+
"@working-theory/ids": "0.10.0",
|
|
21
|
+
"@working-theory/jsonld": "0.35.0",
|
|
22
|
+
"@working-theory/license": "0.35.0",
|
|
23
|
+
"@working-theory/metadata": "0.35.0",
|
|
24
|
+
"@working-theory/observability": "0.35.0",
|
|
25
|
+
"@working-theory/page-renderer": "0.35.0",
|
|
26
26
|
"@working-theory/plugin-mcp": "0.1.1",
|
|
27
|
-
"@working-theory/schema": "0.
|
|
28
|
-
"@working-theory/schema-pack-registry": "0.
|
|
29
|
-
"@working-theory/schema-validator": "0.
|
|
30
|
-
"@working-theory/sections-registry": "0.
|
|
31
|
-
"@working-theory/site-config": "0.
|
|
32
|
-
"@working-theory/stripe-client": "0.
|
|
33
|
-
"@working-theory/templates": "0.
|
|
34
|
-
"@working-theory/theme": "0.
|
|
35
|
-
"@working-theory/ui": "0.
|
|
36
|
-
"@working-theory/validation": "0.
|
|
37
|
-
"@working-theory/web-i18n": "0.
|
|
27
|
+
"@working-theory/schema": "0.35.0",
|
|
28
|
+
"@working-theory/schema-pack-registry": "0.35.0",
|
|
29
|
+
"@working-theory/schema-validator": "0.35.0",
|
|
30
|
+
"@working-theory/sections-registry": "0.35.0",
|
|
31
|
+
"@working-theory/site-config": "0.35.0",
|
|
32
|
+
"@working-theory/stripe-client": "0.35.0",
|
|
33
|
+
"@working-theory/templates": "0.35.0",
|
|
34
|
+
"@working-theory/theme": "0.35.0",
|
|
35
|
+
"@working-theory/ui": "0.35.0",
|
|
36
|
+
"@working-theory/validation": "0.35.0",
|
|
37
|
+
"@working-theory/web-i18n": "0.35.0",
|
|
38
38
|
"@working-theory/billing-client": "0.0.0",
|
|
39
39
|
"@working-theory/branding": "0.0.0",
|
|
40
40
|
"@working-theory/license-client": "0.0.0",
|
|
41
41
|
"@working-theory/license-manifest": "0.0.0",
|
|
42
42
|
"@working-theory/partner-session": "0.0.0",
|
|
43
43
|
"@working-theory/preview-protocol": "0.0.0",
|
|
44
|
-
"@working-theory/ui-commerce": "0.23.
|
|
45
|
-
"@working-theory/ui-docs-blog": "0.23.
|
|
46
|
-
"@working-theory/ui-scheduling": "0.23.
|
|
47
|
-
"@working-theory/ui-signal-collectors": "0.25.
|
|
44
|
+
"@working-theory/ui-commerce": "0.23.13",
|
|
45
|
+
"@working-theory/ui-docs-blog": "0.23.13",
|
|
46
|
+
"@working-theory/ui-scheduling": "0.23.13",
|
|
47
|
+
"@working-theory/ui-signal-collectors": "0.25.2",
|
|
48
48
|
"@working-theory/web": "0.0.0",
|
|
49
49
|
"@working-theory/api": "1.0.0",
|
|
50
50
|
"@working-theory/mcp": "0.0.0",
|
|
51
|
-
"@working-theory/database": "0.
|
|
51
|
+
"@working-theory/database": "0.35.0"
|
|
52
52
|
}
|