agent-cms 0.1.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.
@@ -0,0 +1,118 @@
1
+ CREATE TABLE IF NOT EXISTS "assets" (
2
+ "id" text PRIMARY KEY,
3
+ "filename" text NOT NULL,
4
+ "basename" text,
5
+ "format" text,
6
+ "mime_type" text NOT NULL,
7
+ "size" integer NOT NULL,
8
+ "width" integer,
9
+ "height" integer,
10
+ "alt" text,
11
+ "title" text,
12
+ "r2_key" text NOT NULL,
13
+ "blurhash" text,
14
+ "colors" text,
15
+ "focal_point" text,
16
+ "tags" text DEFAULT '[]',
17
+ "custom_data" text DEFAULT '{}',
18
+ "created_at" text NOT NULL,
19
+ "updated_at" text NOT NULL,
20
+ "created_by" text,
21
+ "updated_by" text
22
+ );
23
+
24
+ CREATE TABLE IF NOT EXISTS "models" (
25
+ "id" text PRIMARY KEY,
26
+ "name" text NOT NULL,
27
+ "api_key" text NOT NULL UNIQUE,
28
+ "is_block" integer DEFAULT false NOT NULL,
29
+ "singleton" integer DEFAULT false NOT NULL,
30
+ "sortable" integer DEFAULT false NOT NULL,
31
+ "tree" integer DEFAULT false NOT NULL,
32
+ "has_draft" integer DEFAULT true NOT NULL,
33
+ "all_locales_required" integer DEFAULT 0 NOT NULL,
34
+ "ordering" text,
35
+ "created_at" text NOT NULL,
36
+ "updated_at" text NOT NULL
37
+ );
38
+
39
+ CREATE TABLE IF NOT EXISTS "fieldsets" (
40
+ "id" text PRIMARY KEY,
41
+ "model_id" text NOT NULL,
42
+ "title" text NOT NULL,
43
+ "position" integer DEFAULT 0 NOT NULL,
44
+ CONSTRAINT "fk_fieldsets_model_id_models_id_fk" FOREIGN KEY ("model_id") REFERENCES "models"("id") ON DELETE CASCADE
45
+ );
46
+
47
+ CREATE TABLE IF NOT EXISTS "fields" (
48
+ "id" text PRIMARY KEY,
49
+ "model_id" text NOT NULL,
50
+ "label" text NOT NULL,
51
+ "api_key" text NOT NULL,
52
+ "field_type" text NOT NULL,
53
+ "position" integer DEFAULT 0 NOT NULL,
54
+ "localized" integer DEFAULT false NOT NULL,
55
+ "validators" text DEFAULT '{}',
56
+ "default_value" text,
57
+ "appearance" text,
58
+ "hint" text,
59
+ "fieldset_id" text,
60
+ "created_at" text NOT NULL,
61
+ "updated_at" text NOT NULL,
62
+ CONSTRAINT "fk_fields_model_id_models_id_fk" FOREIGN KEY ("model_id") REFERENCES "models"("id") ON DELETE CASCADE,
63
+ CONSTRAINT "fk_fields_fieldset_id_fieldsets_id_fk" FOREIGN KEY ("fieldset_id") REFERENCES "fieldsets"("id") ON DELETE SET NULL
64
+ );
65
+
66
+ CREATE TABLE IF NOT EXISTS "locales" (
67
+ "id" text PRIMARY KEY,
68
+ "code" text NOT NULL UNIQUE,
69
+ "position" integer DEFAULT 0 NOT NULL,
70
+ "fallback_locale_id" text,
71
+ CONSTRAINT "fk_locales_fallback_locale_id_locales_id_fk" FOREIGN KEY ("fallback_locale_id") REFERENCES "locales"("id") ON DELETE SET NULL
72
+ );
73
+
74
+ CREATE TABLE IF NOT EXISTS "site_settings" (
75
+ "id" text PRIMARY KEY DEFAULT 'default',
76
+ "site_name" text,
77
+ "title_suffix" text,
78
+ "no_index" integer DEFAULT 0 NOT NULL,
79
+ "favicon_id" text,
80
+ "facebook_page_url" text,
81
+ "twitter_account" text,
82
+ "fallback_seo_title" text,
83
+ "fallback_seo_description" text,
84
+ "fallback_seo_image_id" text,
85
+ "fallback_seo_twitter_card" text DEFAULT 'summary',
86
+ "updated_at" text NOT NULL DEFAULT (datetime('now')),
87
+ CONSTRAINT "fk_site_settings_favicon" FOREIGN KEY ("favicon_id") REFERENCES "assets"("id") ON DELETE SET NULL,
88
+ CONSTRAINT "fk_site_settings_seo_image" FOREIGN KEY ("fallback_seo_image_id") REFERENCES "assets"("id") ON DELETE SET NULL
89
+ );
90
+
91
+ CREATE TABLE IF NOT EXISTS "record_versions" (
92
+ "id" text PRIMARY KEY,
93
+ "model_api_key" text NOT NULL,
94
+ "record_id" text NOT NULL,
95
+ "version_number" integer NOT NULL,
96
+ "snapshot" text NOT NULL,
97
+ "action" text NOT NULL DEFAULT 'publish',
98
+ "actor_type" text,
99
+ "actor_label" text,
100
+ "actor_token_id" text,
101
+ "created_at" text NOT NULL
102
+ );
103
+
104
+ CREATE INDEX IF NOT EXISTS "idx_record_versions_lookup"
105
+ ON "record_versions" ("model_api_key", "record_id", "version_number" DESC);
106
+
107
+ CREATE TABLE IF NOT EXISTS "editor_tokens" (
108
+ "id" TEXT PRIMARY KEY,
109
+ "name" TEXT NOT NULL,
110
+ "token_prefix" TEXT NOT NULL,
111
+ "secret_hash" TEXT NOT NULL,
112
+ "created_at" TEXT NOT NULL DEFAULT (datetime('now')),
113
+ "last_used_at" TEXT,
114
+ "expires_at" TEXT
115
+ );
116
+
117
+ CREATE UNIQUE INDEX IF NOT EXISTS "idx_editor_tokens_secret_hash"
118
+ ON "editor_tokens" ("secret_hash");
package/package.json ADDED
@@ -0,0 +1,98 @@
1
+ {
2
+ "name": "agent-cms",
3
+ "version": "0.1.0",
4
+ "description": "Agent-first headless CMS for Cloudflare Workers. Schema, content, and assets via MCP. GraphQL delivery.",
5
+ "type": "module",
6
+ "packageManager": "pnpm@10.32.1",
7
+ "main": "./dist/index.mjs",
8
+ "types": "./dist/index.d.mts",
9
+ "exports": {
10
+ ".": {
11
+ "import": "./dist/index.mjs",
12
+ "types": "./dist/index.d.mts"
13
+ }
14
+ },
15
+ "files": [
16
+ "dist/*.mjs",
17
+ "dist/*.mts",
18
+ "migrations",
19
+ "README.md",
20
+ "PROMPT.md",
21
+ "LICENSE"
22
+ ],
23
+ "scripts": {
24
+ "build": "tsdown",
25
+ "dev": "wrangler dev",
26
+ "test": "vitest",
27
+ "test:run": "vitest run",
28
+ "lint": "oxlint --type-check src/",
29
+ "typecheck": "tsc --noEmit",
30
+ "bench:blog": "node scripts/bench-blog.mjs",
31
+ "dato:import": "node scripts/dato-import/cli.mjs",
32
+ "prepublishOnly": "pnpm run build",
33
+ "db:migrate": "wrangler d1 migrations apply agent-cms-db --local",
34
+ "prepare": "effect-language-service patch"
35
+ },
36
+ "keywords": [
37
+ "cms",
38
+ "headless-cms",
39
+ "mcp",
40
+ "cloudflare-workers",
41
+ "d1",
42
+ "graphql",
43
+ "agent",
44
+ "ai"
45
+ ],
46
+ "author": "Jokull Solberg <jokull@solberg.is>",
47
+ "license": "MIT",
48
+ "repository": {
49
+ "type": "git",
50
+ "url": "git+https://github.com/jokull/agent-cms.git"
51
+ },
52
+ "pnpm": {
53
+ "onlyBuiltDependencies": [
54
+ "better-sqlite3",
55
+ "esbuild",
56
+ "workerd"
57
+ ]
58
+ },
59
+ "dependencies": {
60
+ "@aws-sdk/client-s3": "^3.1014.0",
61
+ "@aws-sdk/s3-request-presigner": "^3.1014.0",
62
+ "@effect/ai": "^0.35.0",
63
+ "@effect/cli": "^0.75.0",
64
+ "@effect/experimental": "^0.60.0",
65
+ "@effect/platform": "^0.96.0",
66
+ "@effect/platform-node": "^0.106.0",
67
+ "@effect/printer": "^0.49.0",
68
+ "@effect/printer-ansi": "^0.49.0",
69
+ "@effect/rpc": "^0.75.0",
70
+ "@effect/sql": "^0.51.0",
71
+ "@effect/sql-d1": "^0.49.0",
72
+ "effect": "^3.21.0",
73
+ "graphql": "^16.13.1",
74
+ "graphql-yoga": "^5.18.1",
75
+ "remark-gfm": "^4.0.1",
76
+ "remark-parse": "^11.0.0",
77
+ "remark-stringify": "^11.0.0",
78
+ "nanoid": "^5.1.7",
79
+ "slugify": "^1.6.8",
80
+ "unified": "^11.0.5"
81
+ },
82
+ "devDependencies": {
83
+ "@cloudflare/workers-types": "^4.20260317.1",
84
+ "@effect/language-service": "^0.81.0",
85
+ "@effect/sql-sqlite-node": "^0.52.0",
86
+ "@modelcontextprotocol/sdk": "^1.27.1",
87
+ "@types/better-sqlite3": "^7.6.13",
88
+ "@types/mdast": "^4.0.4",
89
+ "better-sqlite3": "^12.8.0",
90
+ "miniflare": "^4.20260317.1",
91
+ "oxlint": "^1.56.0",
92
+ "oxlint-tsgolint": "^0.17.1",
93
+ "tsdown": "^0.21.4",
94
+ "typescript": "^5.9.3",
95
+ "vitest": "^4.1.0",
96
+ "wrangler": "^4.76.0"
97
+ }
98
+ }