create-agntcms-app 0.2.2 → 0.3.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/index.mjs +1 -1
- package/dist/template/CLAUDE.md +1 -1
- package/dist/template/app/api/agntcms/[...path]/route.dev.ts +49 -0
- package/dist/template/package.json +1 -1
- package/package.json +2 -2
- package/dist/template/app/admin/AdminPageClient.tsx +0 -77
- package/dist/template/app/admin/AdminPageDynamic.tsx +0 -24
- package/dist/template/app/admin/page.tsx +0 -14
- package/dist/template/app/api/agntcms/assets/route.ts +0 -11
- package/dist/template/app/api/agntcms/assets/upload/route.ts +0 -11
- package/dist/template/app/api/agntcms/draft/discard/route.ts +0 -12
- package/dist/template/app/api/agntcms/draft/list/route.ts +0 -11
- package/dist/template/app/api/agntcms/draft/publish/route.ts +0 -11
- package/dist/template/app/api/agntcms/draft/reorder/route.ts +0 -10
- package/dist/template/app/api/agntcms/draft/save/route.ts +0 -11
- package/dist/template/app/api/agntcms/events/route.ts +0 -12
- package/dist/template/app/api/agntcms/forms/delete/route.ts +0 -17
- package/dist/template/app/api/agntcms/forms/list/route.ts +0 -24
- package/dist/template/app/api/agntcms/forms/read/route.ts +0 -23
- package/dist/template/app/api/agntcms/global/delete/route.ts +0 -13
- package/dist/template/app/api/agntcms/global/history/route.ts +0 -10
- package/dist/template/app/api/agntcms/global/list/route.ts +0 -14
- package/dist/template/app/api/agntcms/global/read/route.ts +0 -11
- package/dist/template/app/api/agntcms/global/rollback/route.ts +0 -10
- package/dist/template/app/api/agntcms/global/save/route.ts +0 -14
- package/dist/template/app/api/agntcms/mcp/route.ts +0 -12
- package/dist/template/app/api/agntcms/page/delete/route.ts +0 -10
- package/dist/template/app/api/agntcms/page/duplicate/route.ts +0 -11
- package/dist/template/app/api/agntcms/page/history/route.ts +0 -10
- package/dist/template/app/api/agntcms/page/list/route.ts +0 -10
- package/dist/template/app/api/agntcms/page/read/route.ts +0 -11
- package/dist/template/app/api/agntcms/page/rename/route.ts +0 -10
- package/dist/template/app/api/agntcms/page/rollback/route.ts +0 -10
- package/dist/template/app/api/agntcms/page/unpublish/route.ts +0 -11
- package/dist/template/app/api/agntcms/preview/enter/route.ts +0 -13
- package/dist/template/app/api/agntcms/preview/exit/route.ts +0 -10
- package/dist/template/app/api/agntcms/preview/issue/route.ts +0 -12
- package/dist/template/app/api/agntcms/template/list/route.ts +0 -15
package/dist/index.mjs
CHANGED
package/dist/template/CLAUDE.md
CHANGED
|
@@ -80,7 +80,7 @@ Skills are a gate, not a suggestion. No action without a skill check first.
|
|
|
80
80
|
## Project zones
|
|
81
81
|
|
|
82
82
|
**Frozen zone** — framework-owned, do not modify:
|
|
83
|
-
`app/api/agntcms/`, `app/[[...slug]]/`, `app/not-found.tsx`, `app/
|
|
83
|
+
`app/api/agntcms/`, `app/[[...slug]]/`, `app/not-found.tsx`, `app/sitemap.ts`,
|
|
84
84
|
`app/robots.ts`, `.claude/`, `.claude-plugin/`
|
|
85
85
|
|
|
86
86
|
**User zone** — section definitions and framework config:
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
// FROZEN — do not edit. Framework file managed by agntcms.
|
|
2
|
+
//
|
|
3
|
+
// Single catch-all dispatcher for every admin/agent endpoint under
|
|
4
|
+
// /api/agntcms/* except forms/submit (which must remain available in
|
|
5
|
+
// production and therefore lives on its own route.ts without the .dev suffix).
|
|
6
|
+
//
|
|
7
|
+
// Before v0.3 the template carried ~30 thin proxy files, one per endpoint.
|
|
8
|
+
// A new endpoint in the framework required users to copy the new file into
|
|
9
|
+
// their frozen zone. With this catch-all the routing table lives inside
|
|
10
|
+
// @agntcms/next/handlers (dispatcher.ts) and new endpoints flow to users
|
|
11
|
+
// through a regular `pnpm up @agntcms/next`. See ARCHITECTURE.md §3.
|
|
12
|
+
//
|
|
13
|
+
// Next.js .dev.ts extension: withagntcms() strips .dev.ts routes from the
|
|
14
|
+
// pageExtensions list so this file is never compiled into a production build.
|
|
15
|
+
// That is what keeps the admin surface dev-only.
|
|
16
|
+
|
|
17
|
+
import { createagntcmsRouteHandler } from '@agntcms/next/handlers'
|
|
18
|
+
import config from '@/agntcms/config'
|
|
19
|
+
import {
|
|
20
|
+
contentAdapter,
|
|
21
|
+
assetAdapter,
|
|
22
|
+
submissionAdapter,
|
|
23
|
+
runtime,
|
|
24
|
+
taskStore,
|
|
25
|
+
bridge,
|
|
26
|
+
previewTokenStore,
|
|
27
|
+
} from '../_shared'
|
|
28
|
+
|
|
29
|
+
// Pre-compute section-derived maps once at module evaluation time.
|
|
30
|
+
// These are needed by the global and template handlers; building them here
|
|
31
|
+
// avoids repeating the map construction inside per-request paths.
|
|
32
|
+
const allowedTypes = new Set(config.sections.map((s) => s.name))
|
|
33
|
+
const sectionDefaults = new Map(config.sections.map((s) => [s.name, s.defaults]))
|
|
34
|
+
|
|
35
|
+
export const { GET, POST, PUT, DELETE } = createagntcmsRouteHandler({
|
|
36
|
+
assets: { assetAdapter },
|
|
37
|
+
draft: { contentAdapter, runtime },
|
|
38
|
+
page: { contentAdapter, runtime },
|
|
39
|
+
global: { contentAdapter, allowedTypes, sectionDefaults },
|
|
40
|
+
preview: { tokenStore: previewTokenStore },
|
|
41
|
+
events: { taskStore },
|
|
42
|
+
mcp: { bridge, taskStore },
|
|
43
|
+
template: { sectionDefaults, templates: config.templates },
|
|
44
|
+
formsList: {
|
|
45
|
+
forms: config.forms,
|
|
46
|
+
adapter: submissionAdapter.info,
|
|
47
|
+
},
|
|
48
|
+
formsRead: { submissionAdapter, knownForms: new Set(config.forms.map((f) => f.name)) },
|
|
49
|
+
})
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-agntcms-app",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "create-agntcms-app: scaffold a new agntcms project from the canonical template",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"private": false,
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
],
|
|
17
17
|
"dependencies": {
|
|
18
18
|
"commander": "^12.1.0",
|
|
19
|
-
"@agntcms/skills": "0.
|
|
19
|
+
"@agntcms/skills": "0.3.0"
|
|
20
20
|
},
|
|
21
21
|
"devDependencies": {
|
|
22
22
|
"tsup": "^8.3.5",
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
// FROZEN — do not edit. Framework file managed by agntcms.
|
|
2
|
-
'use client'
|
|
3
|
-
|
|
4
|
-
// Client body for the admin page. Receives `definitions` injected by the
|
|
5
|
-
// server wrapper (page.tsx) so that the server-side config import never
|
|
6
|
-
// lands in the client bundle.
|
|
7
|
-
//
|
|
8
|
-
// PreviewProvider must wrap the toolbar so usePreviewMode() resolves to
|
|
9
|
-
// 'preview'. mode is hardcoded because this page always renders in the
|
|
10
|
-
// preview context.
|
|
11
|
-
|
|
12
|
-
import { useState } from 'react'
|
|
13
|
-
import { PreviewProvider, PreviewToolbar } from '@agntcms/next/client'
|
|
14
|
-
import type { PreviewToolbarProps } from '@agntcms/next/client'
|
|
15
|
-
|
|
16
|
-
interface AdminPageClientProps {
|
|
17
|
-
readonly definitions: PreviewToolbarProps['definitions']
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
function AdminContent(): React.ReactElement {
|
|
21
|
-
const [entering, setEntering] = useState(false)
|
|
22
|
-
const [error, setError] = useState<string | null>(null)
|
|
23
|
-
|
|
24
|
-
const handleEnterPreview = (): void => {
|
|
25
|
-
setEntering(true)
|
|
26
|
-
setError(null)
|
|
27
|
-
|
|
28
|
-
fetch('/api/agntcms/preview/enter', { method: 'POST' })
|
|
29
|
-
.then((res) => {
|
|
30
|
-
if (!res.ok) {
|
|
31
|
-
throw new Error(`Server responded with ${res.status}`)
|
|
32
|
-
}
|
|
33
|
-
// Redirect to homepage where PreviewToolbar will be visible
|
|
34
|
-
window.location.href = '/'
|
|
35
|
-
})
|
|
36
|
-
.catch((err: unknown) => {
|
|
37
|
-
const message = err instanceof Error ? err.message : 'Unknown error'
|
|
38
|
-
setError(`Failed to enter preview mode: ${message}`)
|
|
39
|
-
setEntering(false)
|
|
40
|
-
})
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
return (
|
|
44
|
-
<main className="flex flex-col items-center justify-center min-h-svh px-6 gap-4">
|
|
45
|
-
<h1 className="font-display text-display-sm text-text-primary font-medium m-0">
|
|
46
|
-
agntcms Admin
|
|
47
|
-
</h1>
|
|
48
|
-
<p className="text-md text-text-secondary m-0 text-center max-w-sm">
|
|
49
|
-
Enter preview mode to see unpublished content and use the editing toolbar.
|
|
50
|
-
</p>
|
|
51
|
-
<button
|
|
52
|
-
type="button"
|
|
53
|
-
onClick={handleEnterPreview}
|
|
54
|
-
disabled={entering}
|
|
55
|
-
className="px-6 py-2.5 bg-bg-brand-solid text-text-primary_on-brand rounded-lg text-md font-medium cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed"
|
|
56
|
-
>
|
|
57
|
-
{entering ? 'Entering preview\u2026' : 'Enter Preview Mode'}
|
|
58
|
-
</button>
|
|
59
|
-
{error !== null && (
|
|
60
|
-
<p className="text-sm text-text-error-primary m-0">{error}</p>
|
|
61
|
-
)}
|
|
62
|
-
</main>
|
|
63
|
-
)
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
export function AdminPageClient({ definitions }: AdminPageClientProps): React.ReactElement {
|
|
67
|
-
// Conditional spread avoids passing `undefined` to an optional prop under
|
|
68
|
-
// exactOptionalPropertyTypes — passing `undefined` explicitly is a type error
|
|
69
|
-
// even though the prop is optional.
|
|
70
|
-
const toolbarProps = definitions !== undefined ? { definitions } : {}
|
|
71
|
-
return (
|
|
72
|
-
<PreviewProvider mode="preview">
|
|
73
|
-
<AdminContent />
|
|
74
|
-
<PreviewToolbar {...toolbarProps} />
|
|
75
|
-
</PreviewProvider>
|
|
76
|
-
)
|
|
77
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
// FROZEN — do not edit. Framework file managed by agntcms.
|
|
2
|
-
'use client'
|
|
3
|
-
|
|
4
|
-
// Thin client-component wrapper that disables SSR for AdminPageClient.
|
|
5
|
-
// `ssr: false` is only allowed inside client components (Next.js constraint),
|
|
6
|
-
// so this shim sits between the server page.tsx and the actual client body.
|
|
7
|
-
// Suppressing SSR is required because AdminPageClient renders PreviewToolbar,
|
|
8
|
-
// which accesses window at render time and would crash during prerendering.
|
|
9
|
-
|
|
10
|
-
import dynamic from 'next/dynamic'
|
|
11
|
-
import type { PreviewToolbarProps } from '@agntcms/next/client'
|
|
12
|
-
|
|
13
|
-
interface AdminPageClientProps {
|
|
14
|
-
readonly definitions: PreviewToolbarProps['definitions']
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
const AdminPageClientNoSSR = dynamic<AdminPageClientProps>(
|
|
18
|
-
() => import('./AdminPageClient').then((m) => m.AdminPageClient),
|
|
19
|
-
{ ssr: false },
|
|
20
|
-
)
|
|
21
|
-
|
|
22
|
-
export function AdminPageDynamic(props: AdminPageClientProps): React.ReactElement {
|
|
23
|
-
return <AdminPageClientNoSSR {...props} />
|
|
24
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
// FROZEN — do not edit. Framework file managed by agntcms.
|
|
2
|
-
|
|
3
|
-
// Server component: reads `config.sections` on the server so that the
|
|
4
|
-
// config module (which transitively imports fs/promises via adapters) never
|
|
5
|
-
// lands in the client bundle. Passes `definitions` down to AdminPageDynamic,
|
|
6
|
-
// which suppresses SSR for the interactive admin tree (required because
|
|
7
|
-
// PreviewToolbar accesses window at render time).
|
|
8
|
-
|
|
9
|
-
import config from '@/agntcms/config'
|
|
10
|
-
import { AdminPageDynamic } from './AdminPageDynamic'
|
|
11
|
-
|
|
12
|
-
export default function AdminPage(): React.ReactElement {
|
|
13
|
-
return <AdminPageDynamic definitions={config.sections} />
|
|
14
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
// FROZEN — do not edit. Framework file managed by agntcms.
|
|
2
|
-
//
|
|
3
|
-
// Lists all uploaded assets for the image picker modal.
|
|
4
|
-
// Delegates to createAssetsHandler; see packages/next/src/handlers/assets/.
|
|
5
|
-
|
|
6
|
-
import { createAssetsHandler } from '@agntcms/next/handlers'
|
|
7
|
-
import { assetAdapter } from '../_shared'
|
|
8
|
-
|
|
9
|
-
const { list: GET } = createAssetsHandler({ assetAdapter })
|
|
10
|
-
|
|
11
|
-
export { GET }
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
// FROZEN — do not edit. Framework file managed by agntcms.
|
|
2
|
-
//
|
|
3
|
-
// Uploads a new image asset (multipart/form-data: file + alt).
|
|
4
|
-
// Delegates to createAssetsHandler; see packages/next/src/handlers/assets/.
|
|
5
|
-
|
|
6
|
-
import { createAssetsHandler } from '@agntcms/next/handlers'
|
|
7
|
-
import { assetAdapter } from '../../_shared'
|
|
8
|
-
|
|
9
|
-
const { upload: POST } = createAssetsHandler({ assetAdapter })
|
|
10
|
-
|
|
11
|
-
export { POST }
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
// FROZEN — do not edit. Framework file managed by agntcms.
|
|
2
|
-
//
|
|
3
|
-
// Discards a draft. A published version must exist for the slug;
|
|
4
|
-
// discarding a draft with no published fallback is blocked (would lose
|
|
5
|
-
// all data). The request body must contain { slug }.
|
|
6
|
-
|
|
7
|
-
import { createDraftHandler } from '@agntcms/next/handlers'
|
|
8
|
-
import { contentAdapter, runtime } from '../../_shared'
|
|
9
|
-
|
|
10
|
-
const { discard: POST } = createDraftHandler({ contentAdapter, runtime })
|
|
11
|
-
|
|
12
|
-
export { POST }
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
// FROZEN — do not edit. Framework file managed by agntcms.
|
|
2
|
-
//
|
|
3
|
-
// Returns the list of all pending drafts with their slugs and last-updated
|
|
4
|
-
// timestamps. Used by the admin UI to show the drafts panel.
|
|
5
|
-
|
|
6
|
-
import { createDraftHandler } from '@agntcms/next/handlers'
|
|
7
|
-
import { contentAdapter, runtime } from '../../_shared'
|
|
8
|
-
|
|
9
|
-
const { list: GET } = createDraftHandler({ contentAdapter, runtime })
|
|
10
|
-
|
|
11
|
-
export { GET }
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
// FROZEN — do not edit. Framework file managed by agntcms.
|
|
2
|
-
//
|
|
3
|
-
// Promotes a draft to published. The request body must contain { slug }.
|
|
4
|
-
// On success the draft is deleted and the page content file is updated.
|
|
5
|
-
|
|
6
|
-
import { createDraftHandler } from '@agntcms/next/handlers'
|
|
7
|
-
import { contentAdapter, runtime } from '../../_shared'
|
|
8
|
-
|
|
9
|
-
const { publish: POST } = createDraftHandler({ contentAdapter, runtime })
|
|
10
|
-
|
|
11
|
-
export { POST }
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
// FROZEN — do not edit. Framework file managed by agntcms.
|
|
2
|
-
//
|
|
3
|
-
// Reorders sections within a draft page.
|
|
4
|
-
|
|
5
|
-
import { createDraftHandler } from '@agntcms/next/handlers'
|
|
6
|
-
import { contentAdapter, runtime } from '../../_shared'
|
|
7
|
-
|
|
8
|
-
const { reorder: POST } = createDraftHandler({ contentAdapter, runtime })
|
|
9
|
-
|
|
10
|
-
export { POST }
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
// FROZEN — do not edit. Framework file managed by agntcms.
|
|
2
|
-
//
|
|
3
|
-
// Saves a full-page draft. The request body must be a JSON-serialised
|
|
4
|
-
// Page object (slug + sections array, optional seo).
|
|
5
|
-
|
|
6
|
-
import { createDraftHandler } from '@agntcms/next/handlers'
|
|
7
|
-
import { contentAdapter, runtime } from '../../_shared'
|
|
8
|
-
|
|
9
|
-
const { save: POST } = createDraftHandler({ contentAdapter, runtime })
|
|
10
|
-
|
|
11
|
-
export { POST }
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
// FROZEN — do not edit. Framework file managed by agntcms.
|
|
2
|
-
//
|
|
3
|
-
// SSE stream for task lifecycle events. Clients subscribe with
|
|
4
|
-
// GET /api/agntcms/events?taskId=<id> and receive progress, completed,
|
|
5
|
-
// and failed frames. The stream closes automatically on terminal events.
|
|
6
|
-
|
|
7
|
-
import { createEventsHandler } from '@agntcms/next/handlers'
|
|
8
|
-
import { taskStore } from '../_shared'
|
|
9
|
-
|
|
10
|
-
const { GET } = createEventsHandler({ taskStore })
|
|
11
|
-
|
|
12
|
-
export { GET }
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
// FROZEN — do not edit. Framework file managed by agntcms.
|
|
2
|
-
//
|
|
3
|
-
// Reserved route. Submission delete via UI is feature-gated off in v1.
|
|
4
|
-
// Always returns HTTP 501 with a clear message so the AdminModal can show
|
|
5
|
-
// a "not yet available" hint without crashing.
|
|
6
|
-
//
|
|
7
|
-
// The route surface is registered now so a future patch can enable the
|
|
8
|
-
// feature without touching this frozen file (which would be a breaking
|
|
9
|
-
// framework change). See ARCHITECTURE.md §6.5 and §12.
|
|
10
|
-
|
|
11
|
-
import { createFormsDeleteHandler } from '@agntcms/next/handlers'
|
|
12
|
-
|
|
13
|
-
const handle = createFormsDeleteHandler()
|
|
14
|
-
|
|
15
|
-
export async function POST(_req: Request): Promise<Response> {
|
|
16
|
-
return handle(_req)
|
|
17
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
// FROZEN — do not edit. Framework file managed by agntcms.
|
|
2
|
-
//
|
|
3
|
-
// Returns the list of registered form definitions (name + schema) and the
|
|
4
|
-
// configured adapter kind. Consumed by the AdminModal "Submissions" tab to
|
|
5
|
-
// render the form picker and decide whether local submissions are readable.
|
|
6
|
-
//
|
|
7
|
-
// See ARCHITECTURE.md §6.5.
|
|
8
|
-
|
|
9
|
-
import { createFormsListHandler } from '@agntcms/next/handlers'
|
|
10
|
-
import config from '@/agntcms/config'
|
|
11
|
-
import { submissionAdapter } from '../../_shared'
|
|
12
|
-
|
|
13
|
-
// `adapter: submissionAdapter.info` is wired so the AdminModal knows whether
|
|
14
|
-
// submissions are locally readable. Without it the handler would default to
|
|
15
|
-
// `{ kind: 'fs' }` and the modal would issue 501-returning fetches against a
|
|
16
|
-
// webhook adapter.
|
|
17
|
-
const handle = createFormsListHandler({
|
|
18
|
-
forms: config.forms,
|
|
19
|
-
adapter: submissionAdapter.info,
|
|
20
|
-
})
|
|
21
|
-
|
|
22
|
-
export async function GET(req: Request): Promise<Response> {
|
|
23
|
-
return handle(req)
|
|
24
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
// FROZEN — do not edit. Framework file managed by agntcms.
|
|
2
|
-
//
|
|
3
|
-
// Two modes:
|
|
4
|
-
// GET /api/agntcms/forms/read?form=X — list submissions for form X
|
|
5
|
-
// GET /api/agntcms/forms/read?form=X&id=Y — read one submission by ID
|
|
6
|
-
//
|
|
7
|
-
// Returns 501 when the configured SubmissionStorageAdapter is webhook-only
|
|
8
|
-
// (no local copies). The AdminModal "Submissions" tab uses this to surface
|
|
9
|
-
// a "no local copy" hint.
|
|
10
|
-
//
|
|
11
|
-
// See ARCHITECTURE.md §6.5.
|
|
12
|
-
|
|
13
|
-
import { createFormsReadHandler } from '@agntcms/next/handlers'
|
|
14
|
-
import { submissionAdapter } from '../../_shared'
|
|
15
|
-
import config from '@/agntcms/config'
|
|
16
|
-
|
|
17
|
-
const knownForms = new Set(config.forms.map((f) => f.name))
|
|
18
|
-
|
|
19
|
-
const handle = createFormsReadHandler({ submissionAdapter, knownForms })
|
|
20
|
-
|
|
21
|
-
export async function GET(req: Request): Promise<Response> {
|
|
22
|
-
return handle(req)
|
|
23
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
// FROZEN — do not edit. Framework file managed by agntcms.
|
|
2
|
-
//
|
|
3
|
-
// Deletes a global content block by name.
|
|
4
|
-
|
|
5
|
-
import { createGlobalHandler } from '@agntcms/next/handlers'
|
|
6
|
-
import { contentAdapter } from '../../_shared'
|
|
7
|
-
import config from '@/agntcms/config'
|
|
8
|
-
|
|
9
|
-
const allowedTypes = new Set(config.sections.map((s) => s.name))
|
|
10
|
-
|
|
11
|
-
const { delete: DELETE } = createGlobalHandler({ contentAdapter, allowedTypes })
|
|
12
|
-
|
|
13
|
-
export { DELETE }
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
// FROZEN — do not edit. Framework file managed by agntcms.
|
|
2
|
-
//
|
|
3
|
-
// Lists version history snapshots for a global.
|
|
4
|
-
|
|
5
|
-
import { createGlobalHandler } from '@agntcms/next/handlers'
|
|
6
|
-
import { contentAdapter } from '../../_shared'
|
|
7
|
-
|
|
8
|
-
const { listHistory: GET } = createGlobalHandler({ contentAdapter })
|
|
9
|
-
|
|
10
|
-
export { GET }
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
// FROZEN — do not edit. Framework file managed by agntcms.
|
|
2
|
-
//
|
|
3
|
-
// Returns the list of all globals with their names, types, and timestamps.
|
|
4
|
-
// Includes registered section type names for the admin UI picker.
|
|
5
|
-
|
|
6
|
-
import { createGlobalHandler } from '@agntcms/next/handlers'
|
|
7
|
-
import { contentAdapter } from '../../_shared'
|
|
8
|
-
import config from '@/agntcms/config'
|
|
9
|
-
|
|
10
|
-
const allowedTypes = new Set(config.sections.map((s) => s.name))
|
|
11
|
-
|
|
12
|
-
const { list: GET } = createGlobalHandler({ contentAdapter, allowedTypes })
|
|
13
|
-
|
|
14
|
-
export { GET }
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
// FROZEN — do not edit. Framework file managed by agntcms.
|
|
2
|
-
//
|
|
3
|
-
// Returns a single global content block by name.
|
|
4
|
-
// Accepts: GET /api/agntcms/global/read?name=<name>
|
|
5
|
-
|
|
6
|
-
import { createGlobalHandler } from '@agntcms/next/handlers'
|
|
7
|
-
import { contentAdapter } from '../../_shared'
|
|
8
|
-
|
|
9
|
-
const { read: GET } = createGlobalHandler({ contentAdapter })
|
|
10
|
-
|
|
11
|
-
export { GET }
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
// FROZEN — do not edit. Framework file managed by agntcms.
|
|
2
|
-
//
|
|
3
|
-
// Rolls back a global to a previous version snapshot.
|
|
4
|
-
|
|
5
|
-
import { createGlobalHandler } from '@agntcms/next/handlers'
|
|
6
|
-
import { contentAdapter } from '../../_shared'
|
|
7
|
-
|
|
8
|
-
const { rollback: POST } = createGlobalHandler({ contentAdapter })
|
|
9
|
-
|
|
10
|
-
export { POST }
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
// FROZEN — do not edit. Framework file managed by agntcms.
|
|
2
|
-
//
|
|
3
|
-
// Creates or updates a global content block.
|
|
4
|
-
|
|
5
|
-
import { createGlobalHandler } from '@agntcms/next/handlers'
|
|
6
|
-
import { contentAdapter } from '../../_shared'
|
|
7
|
-
import config from '@/agntcms/config'
|
|
8
|
-
|
|
9
|
-
const allowedTypes = new Set(config.sections.map((s) => s.name))
|
|
10
|
-
const sectionDefaults = new Map(config.sections.map((s) => [s.name, s.defaults]))
|
|
11
|
-
|
|
12
|
-
const { save: POST } = createGlobalHandler({ contentAdapter, allowedTypes, sectionDefaults })
|
|
13
|
-
|
|
14
|
-
export { POST }
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
// FROZEN — do not edit. Framework file managed by agntcms.
|
|
2
|
-
//
|
|
3
|
-
// Action-discriminated endpoint for the AgentBridge lifecycle and task
|
|
4
|
-
// dispatch. Accepts { action: "start" | "stop" | "status" | "push_task" }.
|
|
5
|
-
// The bridge starts lazily: call { action: "start" } before pushing tasks.
|
|
6
|
-
|
|
7
|
-
import { createMcpHandler } from '@agntcms/next/handlers'
|
|
8
|
-
import { bridge, taskStore } from '../_shared'
|
|
9
|
-
|
|
10
|
-
const { POST } = createMcpHandler({ bridge, taskStore })
|
|
11
|
-
|
|
12
|
-
export { POST }
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
// FROZEN — do not edit. Framework file managed by agntcms.
|
|
2
|
-
//
|
|
3
|
-
// Deletes a published page and its draft (if any). History is preserved.
|
|
4
|
-
|
|
5
|
-
import { createPageHandler } from '@agntcms/next/handlers'
|
|
6
|
-
import { contentAdapter, runtime } from '../../_shared'
|
|
7
|
-
|
|
8
|
-
const { deletePage: POST } = createPageHandler({ contentAdapter, runtime })
|
|
9
|
-
|
|
10
|
-
export { POST }
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
// FROZEN — do not edit. Framework file managed by agntcms.
|
|
2
|
-
//
|
|
3
|
-
// Duplicates a page under a new slug, saving the clone as a draft.
|
|
4
|
-
// The request body must contain { slug, newSlug }.
|
|
5
|
-
|
|
6
|
-
import { createPageHandler } from '@agntcms/next/handlers'
|
|
7
|
-
import { contentAdapter, runtime } from '../../_shared'
|
|
8
|
-
|
|
9
|
-
const { duplicate: POST } = createPageHandler({ contentAdapter, runtime })
|
|
10
|
-
|
|
11
|
-
export { POST }
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
// FROZEN — do not edit. Framework file managed by agntcms.
|
|
2
|
-
//
|
|
3
|
-
// Lists version history snapshots for a page.
|
|
4
|
-
|
|
5
|
-
import { createPageHandler } from '@agntcms/next/handlers'
|
|
6
|
-
import { contentAdapter, runtime } from '../../_shared'
|
|
7
|
-
|
|
8
|
-
const { listHistory: GET } = createPageHandler({ contentAdapter, runtime })
|
|
9
|
-
|
|
10
|
-
export { GET }
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
// FROZEN — do not edit. Framework file managed by agntcms.
|
|
2
|
-
//
|
|
3
|
-
// Returns the list of all pages (published and drafts) with their status.
|
|
4
|
-
|
|
5
|
-
import { createPageHandler } from '@agntcms/next/handlers'
|
|
6
|
-
import { contentAdapter, runtime } from '../../_shared'
|
|
7
|
-
|
|
8
|
-
const { list: GET } = createPageHandler({ contentAdapter, runtime })
|
|
9
|
-
|
|
10
|
-
export { GET }
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
// FROZEN — do not edit. Framework file managed by agntcms.
|
|
2
|
-
//
|
|
3
|
-
// Returns a single page by slug. Draft is returned if one exists,
|
|
4
|
-
// otherwise the published version is returned.
|
|
5
|
-
|
|
6
|
-
import { createPageHandler } from '@agntcms/next/handlers'
|
|
7
|
-
import { contentAdapter, runtime } from '../../_shared'
|
|
8
|
-
|
|
9
|
-
const { read: GET } = createPageHandler({ contentAdapter, runtime })
|
|
10
|
-
|
|
11
|
-
export { GET }
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
// FROZEN — do not edit. Framework file managed by agntcms.
|
|
2
|
-
//
|
|
3
|
-
// Atomically renames a page slug.
|
|
4
|
-
|
|
5
|
-
import { createPageHandler } from '@agntcms/next/handlers'
|
|
6
|
-
import { contentAdapter, runtime } from '../../_shared'
|
|
7
|
-
|
|
8
|
-
const { rename: POST } = createPageHandler({ contentAdapter, runtime })
|
|
9
|
-
|
|
10
|
-
export { POST }
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
// FROZEN — do not edit. Framework file managed by agntcms.
|
|
2
|
-
//
|
|
3
|
-
// Rolls back a page to a previous version snapshot.
|
|
4
|
-
|
|
5
|
-
import { createPageHandler } from '@agntcms/next/handlers'
|
|
6
|
-
import { contentAdapter, runtime } from '../../_shared'
|
|
7
|
-
|
|
8
|
-
const { rollback: POST } = createPageHandler({ contentAdapter, runtime })
|
|
9
|
-
|
|
10
|
-
export { POST }
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
// FROZEN — do not edit. Framework file managed by agntcms.
|
|
2
|
-
//
|
|
3
|
-
// Unpublishes a page. If only a published version exists, its content is preserved as a draft.
|
|
4
|
-
// Draft (if any) is kept. History is preserved.
|
|
5
|
-
|
|
6
|
-
import { createPageHandler } from '@agntcms/next/handlers'
|
|
7
|
-
import { contentAdapter, runtime } from '../../_shared'
|
|
8
|
-
|
|
9
|
-
const { unpublish: POST } = createPageHandler({ contentAdapter, runtime })
|
|
10
|
-
|
|
11
|
-
export { POST }
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
// FROZEN — do not edit. Framework file managed by agntcms.
|
|
2
|
-
//
|
|
3
|
-
// Preview mode entry. POST sets the cookie directly; GET exchanges a
|
|
4
|
-
// one-time token for the cookie and redirects to the page.
|
|
5
|
-
|
|
6
|
-
import { createPreviewHandler } from '@agntcms/next/handlers'
|
|
7
|
-
import { previewTokenStore } from '../../_shared'
|
|
8
|
-
|
|
9
|
-
const handler = createPreviewHandler({ tokenStore: previewTokenStore })
|
|
10
|
-
const POST = handler.enter
|
|
11
|
-
const GET = handler.enterWithToken
|
|
12
|
-
|
|
13
|
-
export { POST, GET }
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
// FROZEN — do not edit. Framework file managed by agntcms.
|
|
2
|
-
//
|
|
3
|
-
// Clears the preview-mode cookie, returning the site to published-only
|
|
4
|
-
// content rendering.
|
|
5
|
-
|
|
6
|
-
import { createPreviewHandler } from '@agntcms/next/handlers'
|
|
7
|
-
|
|
8
|
-
const { exit: POST } = createPreviewHandler()
|
|
9
|
-
|
|
10
|
-
export { POST }
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
// FROZEN — do not edit. Framework file managed by agntcms.
|
|
2
|
-
//
|
|
3
|
-
// Issues a one-time preview token for a given slug. The agent calls this
|
|
4
|
-
// after creating or updating a page, then sends the resulting URL to the
|
|
5
|
-
// editor.
|
|
6
|
-
|
|
7
|
-
import { createPreviewHandler } from '@agntcms/next/handlers'
|
|
8
|
-
import { previewTokenStore } from '../../_shared'
|
|
9
|
-
|
|
10
|
-
const { issueToken: POST } = createPreviewHandler({ tokenStore: previewTokenStore })
|
|
11
|
-
|
|
12
|
-
export { POST }
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
// FROZEN — do not edit. Framework file managed by agntcms.
|
|
2
|
-
//
|
|
3
|
-
// Returns the list of configured page-creation templates with each section's
|
|
4
|
-
// default field values pre-resolved from the registered section definitions.
|
|
5
|
-
|
|
6
|
-
import { createTemplateHandler } from '@agntcms/next/handlers'
|
|
7
|
-
import config from '@/agntcms/config'
|
|
8
|
-
|
|
9
|
-
// Build a map from section type name to its pre-computed default data so
|
|
10
|
-
// the handler can resolve template sections without importing from config/.
|
|
11
|
-
const sectionDefaults = new Map(config.sections.map((s) => [s.name, s.defaults]))
|
|
12
|
-
|
|
13
|
-
const { list: GET } = createTemplateHandler({ sectionDefaults, templates: config.templates })
|
|
14
|
-
|
|
15
|
-
export { GET }
|