dineway 0.1.6 → 0.1.7

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,180 @@
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
 
7
45
  ```shell
8
- npm install dineway
46
+ npm create dineway@latest
9
47
  ```
10
48
 
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
49
+ Or add to an existing Astro project:
50
+
51
+ ```shell
52
+ npm install dineway
53
+ ```
25
54
 
26
55
  ## Quick Start
27
56
 
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
- });
57
+ ### Create and Run
58
+
59
+ ```bash
60
+ # Create a new Dineway site
61
+ npm create dineway@latest my-restaurant
62
+ cd my-restaurant
63
+ npm install
64
+
65
+ # Start the dev server (runs migrations automatically)
66
+ npx dineway dev
67
+
68
+ # Open the admin panel at http://localhost:4321/_dineway/admin
69
+ # Complete the Setup Wizard to create your first admin account
45
70
  ```
46
71
 
47
- ```typescript
48
- // src/live.config.ts
49
- import { defineLiveCollection } from "astro:content";
50
- import { dinewayLoader } from "dineway/runtime";
72
+ ### Seed a Site
73
+
74
+ Apply a seed file to bootstrap collections, menus, taxonomies, and content:
75
+
76
+ ```bash
77
+ npx dineway seed .dineway/seed.json
78
+ ```
79
+
80
+ Export the current database as a reusable seed:
81
+
82
+ ```bash
83
+ npx dineway export-seed > seed.json
84
+ npx dineway export-seed --with-content > seed-with-content.json
85
+ ```
86
+
87
+ ### Manage Content via CLI
88
+
89
+ The CLI is designed for both humans and AI agents. Create and update auto-publish by default for immediate read-after-write consistency.
90
+
91
+ ```bash
92
+ # List content
93
+ npx dineway content list posts
94
+ npx dineway content list posts --status published --limit 10
95
+
96
+ # Get a single item (Portable Text fields converted to markdown)
97
+ npx dineway content get posts my-post-slug
98
+
99
+ # Create content (auto-publishes by default)
100
+ npx dineway content create posts --data '{"title": "Spring Menu", "body": "# New Dishes"}'
101
+ npx dineway content create posts --file post.json --slug spring-menu
102
+
103
+ # Update content (requires --rev from a prior get)
104
+ npx dineway content update posts 01ABC123 --rev MToyMDI2... --data '{"title": "Updated"}'
51
105
 
52
- export const collections = {
53
- _dineway: defineLiveCollection({ loader: dinewayLoader() }),
54
- };
106
+ # Lifecycle
107
+ npx dineway content publish posts 01ABC123
108
+ npx dineway content unpublish posts 01ABC123
109
+ npx dineway content schedule posts 01ABC123 --at 2026-03-01T09:00:00Z
55
110
  ```
56
111
 
57
- ## API
112
+ ### Manage Schema
113
+
114
+ ```bash
115
+ # List collections
116
+ npx dineway schema list
117
+
118
+ # Create a collection
119
+ npx dineway schema create menu-items --label "Menu Items"
120
+
121
+ # Add fields
122
+ npx dineway schema add-field menu-items price --type number --required
123
+ npx dineway schema add-field menu-items description --type text --label "Description"
124
+ npx dineway schema add-field menu-items photo --type image
125
+ ```
126
+
127
+ Field types: `string`, `text`, `number`, `integer`, `boolean`, `datetime`, `image`, `reference`, `portableText`, `json`.
128
+
129
+ ### Media, Search, Taxonomies, and Menus
130
+
131
+ ```bash
132
+ # Upload media
133
+ npx dineway media upload ./dish-photo.jpg --alt "Grilled lamb" --caption "Spring special"
134
+
135
+ # Search content
136
+ npx dineway search "lamb" --collection menu-items --limit 5
137
+
138
+ # Manage taxonomies
139
+ npx dineway taxonomy list
140
+ npx dineway taxonomy add-term categories --name "Seasonal" --slug seasonal
141
+
142
+ # View menus
143
+ npx dineway menu list
144
+ npx dineway menu get primary
145
+ ```
146
+
147
+ ### Generate TypeScript Types
148
+
149
+ ```bash
150
+ npx dineway types
151
+ ```
152
+
153
+ Writes `.dineway/types.ts` and `.dineway/schema.json` for full type safety in your Astro pages.
154
+
155
+ ### Deploy
156
+
157
+ One-command deployment to any Node.js host:
158
+
159
+ ```bash
160
+ npx dineway deploy railway # generates railway.json, runs railway up
161
+ npx dineway deploy docker # generates Dockerfile + .dockerignore
162
+ npx dineway deploy fly # generates Fly config, runs fly deploy
163
+ npx dineway deploy gcp # experimental: gcloud run deploy
164
+ ```
165
+
166
+ ### JSON Output
167
+
168
+ All CLI commands support `--json` for machine-readable output. Auto-enabled when stdout is piped:
169
+
170
+ ```bash
171
+ npx dineway content list posts --json | jq '.items[].slug'
172
+ ID=$(npx dineway content create posts --data '{"title":"Hello"}' --json | jq -r '.id')
173
+ ```
174
+
175
+ ## Querying Content in Astro Pages
176
+
177
+ Use Dineway's query functions in your Astro components:
58
178
 
59
179
  ```typescript
60
180
  import {
@@ -63,30 +183,17 @@ import {
63
183
  getSiteSettings,
64
184
  getMenu,
65
185
  getTaxonomyTerms,
66
- getWidgetArea,
67
186
  search,
68
187
  } from "dineway";
69
188
 
70
- // Content
71
- const { entries } = await getDinewayCollection("posts");
72
- const { entry } = await getDinewayEntry("posts", "hello-world");
73
-
74
- // Site settings
189
+ const { entries: menuItems } = await getDinewayCollection("menu-items");
190
+ const { entry: dish } = await getDinewayEntry("menu-items", "spring-lamb");
75
191
  const settings = await getSiteSettings();
76
-
77
- // Navigation
78
192
  const menu = await getMenu("primary");
79
-
80
- // Taxonomies
81
193
  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"] });
194
+ const results = await search("lamb", { collections: ["menu-items"] });
88
195
  ```
89
196
 
90
197
  ## Documentation
91
198
 
92
- See the [documentation docs](../../docs/src/content/docs/index.mdx) for guides, API reference, and plugin development.
199
+ 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-BYz0EzvH.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-DTLEWZR1.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-BYz0EzvH.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-DTLEWZR1.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-BYz0EzvH.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.7";
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.7",
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 };