dineway 0.1.6 → 0.1.8

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 CHANGED
@@ -1,60 +1,199 @@
1
1
  # dineway
2
2
 
3
- The core Dineway package — the Agentic Website builder for restaurants and local businesses. Combines structured content modeling with the Model Context Protocol (MCP) to create intelligent, AI-powered sites.
3
+ The Agentic Website builder for restaurants and local businesses. Dineway combines structured content modeling with the [Model Context Protocol (MCP)](https://modelcontextprotocol.io/) to create intelligent, AI-powered sites that understand your menu, manage your reputation, and act on your behalf.
4
+
5
+ ## Overview
6
+
7
+ Dineway is an [Astro](https://astro.build) integration that gives your site a full content engine, admin panel, built-in MCP server, and plugin system. It runs on Node.js with SQLite/libSQL (or PostgreSQL), deploys anywhere with a single command, and stores all schema in the database — not in code.
8
+
9
+ ### Architecture
10
+
11
+ ```
12
+ ┌──────────────────────────────────────────────────────────────────┐
13
+ │ Your Restaurant Site │
14
+ │ │
15
+ │ Astro Framework (Live Collections · Sessions · Middleware) │
16
+ │ │
17
+ │ ┌────────────┐ ┌────────────┐ ┌────────────┐ ┌───────────┐ │
18
+ │ │ Content │ │ Admin │ │ MCP │ │ Plugins │ │
19
+ │ │ Engine │ │ Panel │ │ Server │ │ │ │
20
+ │ └────────────┘ └────────────┘ └────────────┘ └───────────┘ │
21
+ │ ┌────────────┐ ┌────────────┐ ┌────────────┐ ┌───────────┐ │
22
+ │ │ Site │ │ Entity │ │ HITL │ │ CLI │ │
23
+ │ │ Context │ │ Resolution │ │ Reviews │ │ │ │
24
+ │ └────────────┘ └────────────┘ └────────────┘ └───────────┘ │
25
+ │ │
26
+ │ Data Layer: SQLite / libSQL / PostgreSQL ←→ Local / S3 Storage │
27
+ └──────────────────────────────────────────────────────────────────┘
28
+ ```
29
+
30
+ ### Core Capabilities
31
+
32
+ | Category | What It Does |
33
+ |---|---|
34
+ | **MCP Server** | 50+ tools for AI agents to interact with content, schema, media, search, taxonomies, menus, and site context |
35
+ | **Site Context Engine** | Versioned operational knowledge (brand voice, seasonal strategy, policies) — agents consult before acting |
36
+ | **Content Engine** | Structured collections with typed fields, revisions, drafts, scheduled publishing, and full-text search |
37
+ | **Entity Resolution** | Natural-language references ("the spring lamb special") resolve to exact content items |
38
+ | **Human-in-the-Loop** | Review requests ensure AI-generated changes get human approval before going live |
39
+ | **Admin Panel** | Visual schema builder, rich text editor (TipTap/Portable Text), media library, menu builder |
40
+ | **Plugin System** | Lifecycle hooks, KV storage, settings, admin pages, dashboard widgets, custom block types |
41
+ | **CLI** | Programmatic site management for content, schema, media, deployment — designed for both humans and AI agents |
4
42
 
5
43
  ## Installation
6
44
 
45
+ ```shell
46
+ npm create dineway@latest
47
+ ```
48
+
49
+ Or add to an existing Astro project:
50
+
7
51
  ```shell
8
52
  npm install dineway
9
53
  ```
10
54
 
11
- ## Features
12
-
13
- - **MCP Server** - AI agents interact with your site's content, schema, and context through the open Model Context Protocol
14
- - **Site Context Engine** - Versioned operational knowledge (brand voice, seasonal strategy, policies) that agents consult before acting
15
- - **Content Management** - Structured collections, fields, Live Collections integration
16
- - **Entity Resolution** - Natural-language references resolve to exact content items
17
- - **Review Requests** - Human-in-the-loop approval for AI-generated changes
18
- - **Media Library** - Upload via signed URLs, S3-compatible storage
19
- - **Full-Text Search** - FTS5 with Porter stemming, per-collection config
20
- - **Navigation Menus** - Hierarchical menus with URL resolution
21
- - **Taxonomies** - Categories, tags, custom taxonomies
22
- - **Widget Areas** - Content, menu, and component widgets
23
- - **Sections** - Reusable content blocks
24
- - **Plugin System** - Hooks, storage, settings, admin pages
55
+ ## CLI
56
+
57
+ The Dineway CLI (`dineway`) manages projects and instances. Commands fall into three categories:
58
+
59
+ - **Local commands** work directly on local project files or a SQLite file, no running server needed: `init`, `dev`, `seed`, `export-seed`, `auth secret`
60
+ - **Deployment commands** orchestrate platform CLIs or generate provider files: `deploy`
61
+ - **Remote commands** talk to a running Dineway instance via HTTP: `types`, `login`, `logout`, `whoami`, `content`, `schema`, `media`, `search`, `taxonomy`, `menu`
62
+
63
+ ### Authentication
64
+
65
+ Remote commands resolve auth automatically in this order:
66
+
67
+ 1. `--token` flag
68
+ 2. `DINEWAY_TOKEN` env var
69
+ 3. Stored credentials from `dineway login`
70
+ 4. Dev bypass (localhost only — no token needed)
71
+
72
+ For local dev servers, just run the command — auth is handled automatically. For remote instances, run `dineway login --url https://my-site.example.com` first.
25
73
 
26
74
  ## Quick Start
27
75
 
28
- ```typescript
29
- // astro.config.mjs
30
- import { defineConfig } from "astro/config";
31
- import dineway, { local } from "dineway/astro";
32
- import { sqlite } from "dineway/db";
33
-
34
- export default defineConfig({
35
- integrations: [
36
- dineway({
37
- database: sqlite({ url: "file:./data.db" }),
38
- storage: local({
39
- directory: "./uploads",
40
- baseUrl: "/_dineway/api/media/file",
41
- }),
42
- }),
43
- ],
44
- });
76
+ ### Create and Run
77
+
78
+ ```bash
79
+ # Create a new Dineway site
80
+ npm create dineway@latest my-restaurant
81
+ cd my-restaurant
82
+ npm install
83
+
84
+ # Start the dev server (runs migrations automatically)
85
+ npx dineway dev
86
+
87
+ # Open the admin panel at http://localhost:4321/_dineway/admin
88
+ # Complete the Setup Wizard to create your first admin account
45
89
  ```
46
90
 
47
- ```typescript
48
- // src/live.config.ts
49
- import { defineLiveCollection } from "astro:content";
50
- import { dinewayLoader } from "dineway/runtime";
91
+ ### Seed a Site
92
+
93
+ Apply a seed file to bootstrap collections, menus, taxonomies, and content:
94
+
95
+ ```bash
96
+ npx dineway seed .dineway/seed.json
97
+ ```
98
+
99
+ Export the current database as a reusable seed:
51
100
 
52
- export const collections = {
53
- _dineway: defineLiveCollection({ loader: dinewayLoader() }),
54
- };
101
+ ```bash
102
+ npx dineway export-seed > seed.json
103
+ npx dineway export-seed --with-content > seed-with-content.json
55
104
  ```
56
105
 
57
- ## API
106
+ ### Manage Content via CLI
107
+
108
+ The CLI is designed for both humans and AI agents. Create and update auto-publish by default for immediate read-after-write consistency.
109
+
110
+ ```bash
111
+ # List content
112
+ npx dineway content list posts
113
+ npx dineway content list posts --status published --limit 10
114
+
115
+ # Get a single item (Portable Text fields converted to markdown)
116
+ npx dineway content get posts my-post-slug
117
+
118
+ # Create content (auto-publishes by default)
119
+ npx dineway content create posts --data '{"title": "Spring Menu", "body": "# New Dishes"}'
120
+ npx dineway content create posts --file post.json --slug spring-menu
121
+
122
+ # Update content (requires --rev from a prior get)
123
+ npx dineway content update posts 01ABC123 --rev MToyMDI2... --data '{"title": "Updated"}'
124
+
125
+ # Lifecycle
126
+ npx dineway content publish posts 01ABC123
127
+ npx dineway content unpublish posts 01ABC123
128
+ npx dineway content schedule posts 01ABC123 --at 2026-03-01T09:00:00Z
129
+ ```
130
+
131
+ ### Manage Schema
132
+
133
+ ```bash
134
+ # List collections
135
+ npx dineway schema list
136
+
137
+ # Create a collection
138
+ npx dineway schema create menu-items --label "Menu Items"
139
+
140
+ # Add fields
141
+ npx dineway schema add-field menu-items price --type number --required
142
+ npx dineway schema add-field menu-items description --type text --label "Description"
143
+ npx dineway schema add-field menu-items photo --type image
144
+ ```
145
+
146
+ Field types: `string`, `text`, `number`, `integer`, `boolean`, `datetime`, `image`, `reference`, `portableText`, `json`.
147
+
148
+ ### Media, Search, Taxonomies, and Menus
149
+
150
+ ```bash
151
+ # Upload media
152
+ npx dineway media upload ./dish-photo.jpg --alt "Grilled lamb" --caption "Spring special"
153
+
154
+ # Search content
155
+ npx dineway search "lamb" --collection menu-items --limit 5
156
+
157
+ # Manage taxonomies
158
+ npx dineway taxonomy list
159
+ npx dineway taxonomy add-term categories --name "Seasonal" --slug seasonal
160
+
161
+ # View menus
162
+ npx dineway menu list
163
+ npx dineway menu get primary
164
+ ```
165
+
166
+ ### Generate TypeScript Types
167
+
168
+ ```bash
169
+ npx dineway types
170
+ ```
171
+
172
+ Writes `.dineway/types.ts` and `.dineway/schema.json` for full type safety in your Astro pages.
173
+
174
+ ### Deploy
175
+
176
+ One-command deployment to any Node.js host:
177
+
178
+ ```bash
179
+ npx dineway deploy railway # generates railway.json, runs railway up
180
+ npx dineway deploy docker # generates Dockerfile + .dockerignore
181
+ npx dineway deploy fly # generates Fly config, runs fly deploy
182
+ npx dineway deploy gcp # experimental: gcloud run deploy
183
+ ```
184
+
185
+ ### JSON Output
186
+
187
+ All CLI commands support `--json` for machine-readable output. Auto-enabled when stdout is piped:
188
+
189
+ ```bash
190
+ npx dineway content list posts --json | jq '.items[].slug'
191
+ ID=$(npx dineway content create posts --data '{"title":"Hello"}' --json | jq -r '.id')
192
+ ```
193
+
194
+ ## Querying Content in Astro Pages
195
+
196
+ Use Dineway's query functions in your Astro components:
58
197
 
59
198
  ```typescript
60
199
  import {
@@ -63,30 +202,17 @@ import {
63
202
  getSiteSettings,
64
203
  getMenu,
65
204
  getTaxonomyTerms,
66
- getWidgetArea,
67
205
  search,
68
206
  } from "dineway";
69
207
 
70
- // Content
71
- const { entries } = await getDinewayCollection("posts");
72
- const { entry } = await getDinewayEntry("posts", "hello-world");
73
-
74
- // Site settings
208
+ const { entries: menuItems } = await getDinewayCollection("menu-items");
209
+ const { entry: dish } = await getDinewayEntry("menu-items", "spring-lamb");
75
210
  const settings = await getSiteSettings();
76
-
77
- // Navigation
78
211
  const menu = await getMenu("primary");
79
-
80
- // Taxonomies
81
212
  const categories = await getTaxonomyTerms("categories");
82
-
83
- // Widgets
84
- const sidebar = await getWidgetArea("sidebar");
85
-
86
- // Search
87
- const results = await search("hello world", { collections: ["posts"] });
213
+ const results = await search("lamb", { collections: ["menu-items"] });
88
214
  ```
89
215
 
90
216
  ## Documentation
91
217
 
92
- See the [documentation docs](../../docs/src/content/docs/index.mdx) for guides, API reference, and plugin development.
218
+ Full documentation, guides, and API reference: [docs](../../docs/src/content/docs/index.mdx)
@@ -1,4 +1,4 @@
1
- import { n as VERSION, t as COMMIT } from "../version-hmtC3Cmv.mjs";
1
+ import { n as VERSION, t as COMMIT } from "../version-DxxaFHZ_.mjs";
2
2
  import { t as defaultSeed } from "../default-VjJyuuG9.mjs";
3
3
  import { createRequire } from "node:module";
4
4
  import { existsSync, readFileSync } from "node:fs";
@@ -4,7 +4,7 @@ import "../connection-BCNICDWN.mjs";
4
4
  import { t as validateIdentifier } from "../validate-VPnKoIzW.mjs";
5
5
  import { a as isSqlite } from "../dialect-helpers-DhTzaUxP.mjs";
6
6
  import { r as runMigrations } from "../runner-DWZm2KQm.mjs";
7
- import { $t as validateRev, B as DEV_CONSOLE_EMAIL_PLUGIN_ID, Bt as handleContentDuplicate, Ct as handleMediaDelete, Dt as handleRevisionGet, Et as handleMediaUpdate, Ft as handleContentCountScheduled, G as resolveExclusiveHooks, Gt as handleContentPermanentDelete, H as EmailPipeline, Ht as handleContentGetIncludingTrashed, It as handleContentCountTrashed, J as sanitizeHeadersForSandbox, Jt as handleContentSchedule, K as CronExecutor, Kt as handleContentPublish, Lt as handleContentCreate, Mt as hashString, Nt as PluginStateRepository, Ot as handleRevisionList, Pt as handleContentCompare, Qt as handleContentUpdate, Rt as handleContentDelete, St as handleMediaCreate, Tt as handleMediaList, Ut as handleContentList, V as devConsoleEmailDeliver, Vt as handleContentGet, W as createHookPipeline, Wt as handleContentListTrashed, X as definePlugin, Xt as handleContentUnpublish, Y as getTrustedProxyHeaders, Yt as handleContentTranslations, Zt as handleContentUnschedule, kt as handleRevisionRestore, pt as after, q as extractRequestMeta, qt as handleContentRestore, vt as createPluginBundleStore, wt as handleMediaGet, z as PluginRouteRegistry, zt as handleContentDiscardDraft } from "../search-BApX1xhM.mjs";
7
+ import { $t as validateRev, B as DEV_CONSOLE_EMAIL_PLUGIN_ID, Bt as handleContentDuplicate, Ct as handleMediaDelete, Dt as handleRevisionGet, Et as handleMediaUpdate, Ft as handleContentCountScheduled, G as resolveExclusiveHooks, Gt as handleContentPermanentDelete, H as EmailPipeline, Ht as handleContentGetIncludingTrashed, It as handleContentCountTrashed, J as sanitizeHeadersForSandbox, Jt as handleContentSchedule, K as CronExecutor, Kt as handleContentPublish, Lt as handleContentCreate, Mt as hashString, Nt as PluginStateRepository, Ot as handleRevisionList, Pt as handleContentCompare, Qt as handleContentUpdate, Rt as handleContentDelete, St as handleMediaCreate, Tt as handleMediaList, Ut as handleContentList, V as devConsoleEmailDeliver, Vt as handleContentGet, W as createHookPipeline, Wt as handleContentListTrashed, X as definePlugin, Xt as handleContentUnpublish, Y as getTrustedProxyHeaders, Yt as handleContentTranslations, Zt as handleContentUnschedule, kt as handleRevisionRestore, pt as after, q as extractRequestMeta, qt as handleContentRestore, vt as createPluginBundleStore, wt as handleMediaGet, z as PluginRouteRegistry, zt as handleContentDiscardDraft } from "../search-Hlm6g8Td.mjs";
8
8
  import { r as RevisionRepository } from "../content-DWi4d0rT.mjs";
9
9
  import "../base64-F8-DUraK.mjs";
10
10
  import "../types-BawVha09.mjs";
@@ -17,7 +17,7 @@ import { i as setI18nConfig } from "../config-BXwuX8Bx.mjs";
17
17
  import { i as FTSManager, n as SchemaRegistry } from "../registry-C0zjeB9P.mjs";
18
18
  import { n as getDb } from "../loader-sMG4TZ-u.mjs";
19
19
  import "../request-cache-Dk5qPSOx.mjs";
20
- import { n as VERSION, t as COMMIT } from "../version-hmtC3Cmv.mjs";
20
+ import { n as VERSION, t as COMMIT } from "../version-DxxaFHZ_.mjs";
21
21
  import "../taxonomies-1s5PaS_8.mjs";
22
22
  import { r as normalizeManifestRoute } from "../manifest-schema-D1MSVnoI.mjs";
23
23
  import { a as invalidateUrlPatternCache } from "../query-kDmwCsHh.mjs";
package/dist/index.mjs CHANGED
@@ -2,7 +2,7 @@ import { getRequestContext, runWithContext } from "./request-context.mjs";
2
2
  import { t as DinewayDatabaseError } from "./connection-BCNICDWN.mjs";
3
3
  import "./dialect-helpers-DhTzaUxP.mjs";
4
4
  import { t as getMigrationStatus } from "./runner-DWZm2KQm.mjs";
5
- import { $ as createFilePreviewMiddleware, A as isStandardPluginDefinition, At as generateManifest, Bt as handleContentDuplicate, C as getAllSources, Ct as handleMediaDelete, D as probeUrl, Dt as handleRevisionGet, E as getUrlSources, Et as handleMediaUpdate, F as createNoopSandboxRunner, Ft as handleContentCountScheduled, Gt as handleContentPermanentDelete, Ht as handleContentGetIncludingTrashed, I as PluginManager, It as handleContentCountTrashed, Jt as handleContentSchedule, Kt as handleContentPublish, L as createPluginManager, Lt as handleContentCreate, M as createNodeSandboxRunner, Mt as hashString, N as NoopSandboxRunner, O as registerSource, Ot as handleRevisionList, P as SandboxNotAvailableError, Pt as handleContentCompare, Q as parseWxrString, Qt as handleContentUpdate, R as PluginRouteError, Rt as handleContentDelete, S as clearSources, St as handleMediaCreate, T as getSource, Tt as handleMediaList, U as HookPipeline, Ut as handleContentList, Vt as handleContentGet, W as createHookPipeline, Wt as handleContentListTrashed, X as definePlugin, Xt as handleContentUnpublish, Yt as handleContentTranslations, Z as parseWxr, Zt as handleContentUnschedule, _ as buildPreviewUrl, _t as sanitizeHref, a as search, at as SessionDatabaseLimitError, b as parseWxrDate, bt as getSections, c as getWidgetArea, ct as buildPreviewSignatureHeader, d as getMenu, dt as signPreviewUrl, en as portableText, et as renderPreviewToolbar, f as getMenus, ft as verifyPreviewSignature, g as isPreviewRequest, gt as isSafeHref, h as getPreviewToken, ht as prosemirrorToPortableText, i as getSuggestions, it as FileSessionDatabaseFactory, j as NodeSandboxRunner, jt as computeContentHash, k as importReusableBlocksAsSections, kt as handleRevisionRestore, l as getWidgetAreas, lt as defaultPreviewSidecarClient, m as getComments, mt as portableTextToProsemirror, n as extractSearchableFields, nn as image, nt as dropSessionDatabaseTables, o as searchCollection, ot as isBlockedInPreview, p as getCommentCount, pt as after, qt as handleContentRestore, r as getSearchStats, rt as getAppliedSnapshotMeta, s as searchWithDb, st as renderPreviewLoadingPage, t as extractPlainText, tn as reference, tt as applySnapshotToDatabase, u as getWidgetComponents, ut as parsePreviewSignatureHeader, v as getPreviewUrl, w as getFileSources, wt as handleMediaGet, x as wxrSource, xt as getCollectionInfo, y as wordpressRestSource, yt as getSection, zt as handleContentDiscardDraft } from "./search-BApX1xhM.mjs";
5
+ import { $ as createFilePreviewMiddleware, A as isStandardPluginDefinition, At as generateManifest, Bt as handleContentDuplicate, C as getAllSources, Ct as handleMediaDelete, D as probeUrl, Dt as handleRevisionGet, E as getUrlSources, Et as handleMediaUpdate, F as createNoopSandboxRunner, Ft as handleContentCountScheduled, Gt as handleContentPermanentDelete, Ht as handleContentGetIncludingTrashed, I as PluginManager, It as handleContentCountTrashed, Jt as handleContentSchedule, Kt as handleContentPublish, L as createPluginManager, Lt as handleContentCreate, M as createNodeSandboxRunner, Mt as hashString, N as NoopSandboxRunner, O as registerSource, Ot as handleRevisionList, P as SandboxNotAvailableError, Pt as handleContentCompare, Q as parseWxrString, Qt as handleContentUpdate, R as PluginRouteError, Rt as handleContentDelete, S as clearSources, St as handleMediaCreate, T as getSource, Tt as handleMediaList, U as HookPipeline, Ut as handleContentList, Vt as handleContentGet, W as createHookPipeline, Wt as handleContentListTrashed, X as definePlugin, Xt as handleContentUnpublish, Yt as handleContentTranslations, Z as parseWxr, Zt as handleContentUnschedule, _ as buildPreviewUrl, _t as sanitizeHref, a as search, at as SessionDatabaseLimitError, b as parseWxrDate, bt as getSections, c as getWidgetArea, ct as buildPreviewSignatureHeader, d as getMenu, dt as signPreviewUrl, en as portableText, et as renderPreviewToolbar, f as getMenus, ft as verifyPreviewSignature, g as isPreviewRequest, gt as isSafeHref, h as getPreviewToken, ht as prosemirrorToPortableText, i as getSuggestions, it as FileSessionDatabaseFactory, j as NodeSandboxRunner, jt as computeContentHash, k as importReusableBlocksAsSections, kt as handleRevisionRestore, l as getWidgetAreas, lt as defaultPreviewSidecarClient, m as getComments, mt as portableTextToProsemirror, n as extractSearchableFields, nn as image, nt as dropSessionDatabaseTables, o as searchCollection, ot as isBlockedInPreview, p as getCommentCount, pt as after, qt as handleContentRestore, r as getSearchStats, rt as getAppliedSnapshotMeta, s as searchWithDb, st as renderPreviewLoadingPage, t as extractPlainText, tn as reference, tt as applySnapshotToDatabase, u as getWidgetComponents, ut as parsePreviewSignatureHeader, v as getPreviewUrl, w as getFileSources, wt as handleMediaGet, x as wxrSource, xt as getCollectionInfo, y as wordpressRestSource, yt as getSection, zt as handleContentDiscardDraft } from "./search-Hlm6g8Td.mjs";
6
6
  import { i as decodeSlug, t as ContentRepository } from "./content-DWi4d0rT.mjs";
7
7
  import "./base64-F8-DUraK.mjs";
8
8
  import { t as DinewayValidationError } from "./types-BawVha09.mjs";
@@ -16,7 +16,7 @@ import { i as invalidateRedirectCache } from "./cache-BdSY-gQN.mjs";
16
16
  import { i as FTSManager, n as SchemaRegistry } from "./registry-C0zjeB9P.mjs";
17
17
  import { n as getDb } from "./loader-sMG4TZ-u.mjs";
18
18
  import { n as requestCached } from "./request-cache-Dk5qPSOx.mjs";
19
- import { n as VERSION, t as COMMIT } from "./version-hmtC3Cmv.mjs";
19
+ import { n as VERSION, t as COMMIT } from "./version-DxxaFHZ_.mjs";
20
20
  import { i as pluginManifestSchema } from "./manifest-schema-D1MSVnoI.mjs";
21
21
  import { t as generatePreviewToken } from "./tokens-CJz9ubV6.mjs";
22
22
  import BetterSqlite3 from "better-sqlite3";
@@ -0,0 +1,6 @@
1
+ //#region src/version.ts
2
+ const VERSION = "0.1.8";
3
+ const COMMIT = "5e088838";
4
+
5
+ //#endregion
6
+ export { VERSION as n, COMMIT as t };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dineway",
3
- "version": "0.1.6",
3
+ "version": "0.1.8",
4
4
  "description": "Agentic Website builder for restaurants — structured content meets AI via the Model Context Protocol",
5
5
  "type": "module",
6
6
  "main": "dist/index.mjs",
@@ -1,6 +0,0 @@
1
- //#region src/version.ts
2
- const VERSION = "0.1.6";
3
- const COMMIT = "e16302a0";
4
-
5
- //#endregion
6
- export { VERSION as n, COMMIT as t };