@heyo-sh/heyo-cms 0.0.0-stage → 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.
- package/LICENSE +21 -0
- package/README.md +44 -2
- package/dist/access/index.d.ts +9 -0
- package/dist/access/index.d.ts.map +1 -0
- package/dist/access/permissions.d.ts +54 -0
- package/dist/access/permissions.d.ts.map +1 -0
- package/dist/adapters/astro.d.ts +38 -0
- package/dist/adapters/astro.d.ts.map +1 -0
- package/dist/adapters/astro.js +1 -0
- package/dist/adapters/next.d.ts +31 -0
- package/dist/adapters/next.d.ts.map +1 -0
- package/dist/adapters/next.js +1 -0
- package/dist/adapters/nuxt.d.ts +47 -0
- package/dist/adapters/nuxt.d.ts.map +1 -0
- package/dist/adapters/nuxt.js +1 -0
- package/dist/adapters/react-router.d.ts +29 -0
- package/dist/adapters/react-router.d.ts.map +1 -0
- package/dist/adapters/react-router.js +1 -0
- package/dist/adapters/sveltekit.d.ts +37 -0
- package/dist/adapters/sveltekit.d.ts.map +1 -0
- package/dist/adapters/sveltekit.js +1 -0
- package/dist/ai/assistant/context.d.ts +64 -0
- package/dist/ai/assistant/context.d.ts.map +1 -0
- package/dist/ai/assistant/limits.d.ts +10 -0
- package/dist/ai/assistant/limits.d.ts.map +1 -0
- package/dist/ai/assistant/plans.d.ts +83 -0
- package/dist/ai/assistant/plans.d.ts.map +1 -0
- package/dist/ai/assistant/prompt.d.ts +22 -0
- package/dist/ai/assistant/prompt.d.ts.map +1 -0
- package/dist/ai/assistant/run.d.ts +59 -0
- package/dist/ai/assistant/run.d.ts.map +1 -0
- package/dist/ai/assistant/runtime.d.ts +35 -0
- package/dist/ai/assistant/runtime.d.ts.map +1 -0
- package/dist/ai/assistant/schema.d.ts +66 -0
- package/dist/ai/assistant/schema.d.ts.map +1 -0
- package/dist/ai/assistant/tools.d.ts +41 -0
- package/dist/ai/assistant/tools.d.ts.map +1 -0
- package/dist/ai/assistant/values.d.ts +33 -0
- package/dist/ai/assistant/values.d.ts.map +1 -0
- package/dist/ai/crypto.d.ts +12 -0
- package/dist/ai/crypto.d.ts.map +1 -0
- package/dist/ai/index.d.ts +19 -0
- package/dist/ai/index.d.ts.map +1 -0
- package/dist/ai/pi.d.ts +89 -0
- package/dist/ai/pi.d.ts.map +1 -0
- package/dist/ai/registry.d.ts +66 -0
- package/dist/ai/registry.d.ts.map +1 -0
- package/dist/ai/service.d.ts +31 -0
- package/dist/ai/service.d.ts.map +1 -0
- package/dist/ai/variant-translation.d.ts +6 -0
- package/dist/ai/variant-translation.d.ts.map +1 -0
- package/dist/ai.d.ts +12 -0
- package/dist/ai.d.ts.map +1 -0
- package/dist/ai.js +1 -0
- package/dist/auth/config.d.ts +65 -0
- package/dist/auth/config.d.ts.map +1 -0
- package/dist/auth/crypto.d.ts +44 -0
- package/dist/auth/crypto.d.ts.map +1 -0
- package/dist/auth/index.d.ts +15 -0
- package/dist/auth/index.d.ts.map +1 -0
- package/dist/auth/oauth.d.ts +93 -0
- package/dist/auth/oauth.d.ts.map +1 -0
- package/dist/auth/service.d.ts +38 -0
- package/dist/auth/service.d.ts.map +1 -0
- package/dist/auth/totp.d.ts +34 -0
- package/dist/auth/totp.d.ts.map +1 -0
- package/dist/auth.d.ts +9 -0
- package/dist/auth.d.ts.map +1 -0
- package/dist/auth.js +1 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +30 -0
- package/dist/client/index.d.ts +51 -0
- package/dist/client/index.d.ts.map +1 -0
- package/dist/client/types.d.ts +340 -0
- package/dist/client/types.d.ts.map +1 -0
- package/dist/client.d.ts +46 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +1 -0
- package/dist/config.d.ts +31 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +1 -0
- package/dist/content/export.d.ts +28 -0
- package/dist/content/export.d.ts.map +1 -0
- package/dist/content/import.d.ts +65 -0
- package/dist/content/import.d.ts.map +1 -0
- package/dist/content/records.d.ts +73 -0
- package/dist/content/records.d.ts.map +1 -0
- package/dist/content.d.ts +12 -0
- package/dist/content.d.ts.map +1 -0
- package/dist/content.js +1 -0
- package/dist/db/d1.d.ts +29 -0
- package/dist/db/d1.d.ts.map +1 -0
- package/dist/db/d1.js +1 -0
- package/dist/db/mongodb.d.ts +128 -0
- package/dist/db/mongodb.d.ts.map +1 -0
- package/dist/db/mongodb.js +2 -0
- package/dist/db/postgres.d.ts +37 -0
- package/dist/db/postgres.d.ts.map +1 -0
- package/dist/db/postgres.js +1 -0
- package/dist/db/sql/adapter.d.ts +57 -0
- package/dist/db/sql/adapter.d.ts.map +1 -0
- package/dist/db/sql/compile.d.ts +50 -0
- package/dist/db/sql/compile.d.ts.map +1 -0
- package/dist/db/sql/ddl.d.ts +34 -0
- package/dist/db/sql/ddl.d.ts.map +1 -0
- package/dist/db/sql/dialect.d.ts +35 -0
- package/dist/db/sql/dialect.d.ts.map +1 -0
- package/dist/db/sql/driver.d.ts +34 -0
- package/dist/db/sql/driver.d.ts.map +1 -0
- package/dist/db/sql/introspect.d.ts +15 -0
- package/dist/db/sql/introspect.d.ts.map +1 -0
- package/dist/db/sqlite.d.ts +39 -0
- package/dist/db/sqlite.d.ts.map +1 -0
- package/dist/db/sqlite.js +1 -0
- package/dist/defaults.d.ts +5 -0
- package/dist/defaults.d.ts.map +1 -0
- package/dist/duration.d.ts +12 -0
- package/dist/duration.d.ts.map +1 -0
- package/dist/editor/builtin.d.ts +45 -0
- package/dist/editor/builtin.d.ts.map +1 -0
- package/dist/editor/index.d.ts +14 -0
- package/dist/editor/index.d.ts.map +1 -0
- package/dist/editor/markdown.d.ts +19 -0
- package/dist/editor/markdown.d.ts.map +1 -0
- package/dist/editor/registry.d.ts +30 -0
- package/dist/editor/registry.d.ts.map +1 -0
- package/dist/editor/serialize.d.ts +41 -0
- package/dist/editor/serialize.d.ts.map +1 -0
- package/dist/editor.d.ts +10 -0
- package/dist/editor.d.ts.map +1 -0
- package/dist/editor.js +1 -0
- package/dist/engine/access.d.ts +33 -0
- package/dist/engine/access.d.ts.map +1 -0
- package/dist/engine/activity.d.ts +16 -0
- package/dist/engine/activity.d.ts.map +1 -0
- package/dist/engine/cursor.d.ts +19 -0
- package/dist/engine/cursor.d.ts.map +1 -0
- package/dist/engine/documents.d.ts +81 -0
- package/dist/engine/documents.d.ts.map +1 -0
- package/dist/engine/engine.d.ts +276 -0
- package/dist/engine/engine.d.ts.map +1 -0
- package/dist/engine/field-access.d.ts +21 -0
- package/dist/engine/field-access.d.ts.map +1 -0
- package/dist/engine/hooks.d.ts +58 -0
- package/dist/engine/hooks.d.ts.map +1 -0
- package/dist/engine/index.d.ts +20 -0
- package/dist/engine/index.d.ts.map +1 -0
- package/dist/engine/jobs.d.ts +63 -0
- package/dist/engine/jobs.d.ts.map +1 -0
- package/dist/engine/locales.d.ts +40 -0
- package/dist/engine/locales.d.ts.map +1 -0
- package/dist/engine/outbox.d.ts +81 -0
- package/dist/engine/outbox.d.ts.map +1 -0
- package/dist/engine/relations.d.ts +60 -0
- package/dist/engine/relations.d.ts.map +1 -0
- package/dist/engine/scoped-db.d.ts +13 -0
- package/dist/engine/scoped-db.d.ts.map +1 -0
- package/dist/engine/trash.d.ts +25 -0
- package/dist/engine/trash.d.ts.map +1 -0
- package/dist/errors.d.ts +42 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/fields/builtin.d.ts +142 -0
- package/dist/fields/builtin.d.ts.map +1 -0
- package/dist/fields/index.d.ts +3 -0
- package/dist/fields/index.d.ts.map +1 -0
- package/dist/fields/registry.d.ts +35 -0
- package/dist/fields/registry.d.ts.map +1 -0
- package/dist/fields.d.ts +8 -0
- package/dist/fields.d.ts.map +1 -0
- package/dist/fields.js +1 -0
- package/dist/http/guard.d.ts +45 -0
- package/dist/http/guard.d.ts.map +1 -0
- package/dist/http/handler.d.ts +31 -0
- package/dist/http/handler.d.ts.map +1 -0
- package/dist/http/index.d.ts +13 -0
- package/dist/http/index.d.ts.map +1 -0
- package/dist/http/openapi.d.ts +5 -0
- package/dist/http/openapi.d.ts.map +1 -0
- package/dist/http/params.d.ts +32 -0
- package/dist/http/params.d.ts.map +1 -0
- package/dist/http/request-db.d.ts +19 -0
- package/dist/http/request-db.d.ts.map +1 -0
- package/dist/http/respond.d.ts +48 -0
- package/dist/http/respond.d.ts.map +1 -0
- package/dist/http/rich-text.d.ts +30 -0
- package/dist/http/rich-text.d.ts.map +1 -0
- package/dist/http/router.d.ts +55 -0
- package/dist/http/router.d.ts.map +1 -0
- package/dist/http/routes/access.d.ts +13 -0
- package/dist/http/routes/access.d.ts.map +1 -0
- package/dist/http/routes/admin.d.ts +28 -0
- package/dist/http/routes/admin.d.ts.map +1 -0
- package/dist/http/routes/ai.d.ts +26 -0
- package/dist/http/routes/ai.d.ts.map +1 -0
- package/dist/http/routes/auth.d.ts +13 -0
- package/dist/http/routes/auth.d.ts.map +1 -0
- package/dist/http/routes/documents.d.ts +24 -0
- package/dist/http/routes/documents.d.ts.map +1 -0
- package/dist/http/routes/generate.d.ts +5 -0
- package/dist/http/routes/generate.d.ts.map +1 -0
- package/dist/http/routes/media.d.ts +28 -0
- package/dist/http/routes/media.d.ts.map +1 -0
- package/dist/http/routes/panel.d.ts +20 -0
- package/dist/http/routes/panel.d.ts.map +1 -0
- package/dist/http/routes/system.d.ts +25 -0
- package/dist/http/routes/system.d.ts.map +1 -0
- package/dist/http/routes/webhooks.d.ts +17 -0
- package/dist/http/routes/webhooks.d.ts.map +1 -0
- package/dist/http/spec.d.ts +28 -0
- package/dist/http/spec.d.ts.map +1 -0
- package/dist/http.d.ts +17 -0
- package/dist/http.d.ts.map +1 -0
- package/dist/http.js +1 -0
- package/dist/i18n/index.d.ts +12 -0
- package/dist/i18n/index.d.ts.map +1 -0
- package/dist/i18n/names.d.ts +25 -0
- package/dist/i18n/names.d.ts.map +1 -0
- package/dist/ids.d.ts +28 -0
- package/dist/ids.d.ts.map +1 -0
- package/dist/index-2757kej5.js +2 -0
- package/dist/index-2kb5nbxx.js +2 -0
- package/dist/index-2z1qe5mw.js +2 -0
- package/dist/index-34s342fz.js +2 -0
- package/dist/index-5ngtc7gy.js +2 -0
- package/dist/index-7a231xfp.js +2 -0
- package/dist/index-7k091gpe.js +2 -0
- package/dist/index-9g2n7xa6.js +2 -0
- package/dist/index-9x1z3b85.js +5 -0
- package/dist/index-9zqnf6gx.js +23 -0
- package/dist/index-b2ecggck.js +26 -0
- package/dist/index-cbwwtcm4.js +2 -0
- package/dist/index-ebtj6ebd.js +0 -0
- package/dist/index-g4crf47y.js +0 -0
- package/dist/index-gpwcmmvr.js +2 -0
- package/dist/index-hq05mc1n.js +3 -0
- package/dist/index-hy1x46nf.js +2 -0
- package/dist/index-k8wbg1dw.js +2 -0
- package/dist/index-kbsgt44t.js +2 -0
- package/dist/index-m82a0shw.js +2 -0
- package/dist/index-md79xr6h.js +5 -0
- package/dist/index-nvgwyykk.js +40 -0
- package/dist/index-ty698y02.js +2 -0
- package/dist/index-vq2978e7.js +14 -0
- package/dist/index-vxw0a03g.js +2 -0
- package/dist/index-wj8y1xcj.js +2 -0
- package/dist/index-x72d1hzh.js +2 -0
- package/dist/index-y5mwknr9.js +2 -0
- package/dist/index-ymq6jsar.js +2 -0
- package/dist/index.d.ts +25 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +1 -0
- package/dist/jobs/runner.d.ts +77 -0
- package/dist/jobs/runner.d.ts.map +1 -0
- package/dist/jobs.d.ts +11 -0
- package/dist/jobs.d.ts.map +1 -0
- package/dist/jobs.js +1 -0
- package/dist/media/document.d.ts +28 -0
- package/dist/media/document.d.ts.map +1 -0
- package/dist/media/gc.d.ts +46 -0
- package/dist/media/gc.d.ts.map +1 -0
- package/dist/media/index.d.ts +20 -0
- package/dist/media/index.d.ts.map +1 -0
- package/dist/media/pipeline.d.ts +36 -0
- package/dist/media/pipeline.d.ts.map +1 -0
- package/dist/media/probe.d.ts +6 -0
- package/dist/media/probe.d.ts.map +1 -0
- package/dist/media/service.d.ts +26 -0
- package/dist/media/service.d.ts.map +1 -0
- package/dist/media/sharp.d.ts +28 -0
- package/dist/media/sharp.d.ts.map +1 -0
- package/dist/media/strip.d.ts +16 -0
- package/dist/media/strip.d.ts.map +1 -0
- package/dist/media/usages.d.ts +69 -0
- package/dist/media/usages.d.ts.map +1 -0
- package/dist/media/variants.d.ts +50 -0
- package/dist/media/variants.d.ts.map +1 -0
- package/dist/migrations.d.ts +115 -0
- package/dist/migrations.d.ts.map +1 -0
- package/dist/migrations.js +1 -0
- package/dist/panel.d.ts +31 -0
- package/dist/panel.d.ts.map +1 -0
- package/dist/query.d.ts +40 -0
- package/dist/query.d.ts.map +1 -0
- package/dist/query.js +1 -0
- package/dist/run-3r72dwhs.js +6 -0
- package/dist/schema/describe.d.ts +19 -0
- package/dist/schema/describe.d.ts.map +1 -0
- package/dist/schema/index.d.ts +5 -0
- package/dist/schema/index.d.ts.map +1 -0
- package/dist/schema/plan.d.ts +20 -0
- package/dist/schema/plan.d.ts.map +1 -0
- package/dist/schema/snapshot.d.ts +22 -0
- package/dist/schema/snapshot.d.ts.map +1 -0
- package/dist/schema/system.d.ts +22 -0
- package/dist/schema/system.d.ts.map +1 -0
- package/dist/schema.d.ts +7 -0
- package/dist/schema.d.ts.map +1 -0
- package/dist/schema.js +1 -0
- package/dist/storage/bytes.d.ts +17 -0
- package/dist/storage/bytes.d.ts.map +1 -0
- package/dist/storage/http.d.ts +43 -0
- package/dist/storage/http.d.ts.map +1 -0
- package/dist/storage/local.d.ts +31 -0
- package/dist/storage/local.d.ts.map +1 -0
- package/dist/storage/providers.d.ts +95 -0
- package/dist/storage/providers.d.ts.map +1 -0
- package/dist/storage/sign.d.ts +53 -0
- package/dist/storage/sign.d.ts.map +1 -0
- package/dist/strings.d.ts +13 -0
- package/dist/strings.d.ts.map +1 -0
- package/dist/telemetry.d.ts +137 -0
- package/dist/telemetry.d.ts.map +1 -0
- package/dist/telemetry.js +1 -0
- package/dist/types/activity.d.ts +68 -0
- package/dist/types/activity.d.ts.map +1 -0
- package/dist/types/actor.d.ts +26 -0
- package/dist/types/actor.d.ts.map +1 -0
- package/dist/types/ai.d.ts +357 -0
- package/dist/types/ai.d.ts.map +1 -0
- package/dist/types/api.d.ts +212 -0
- package/dist/types/api.d.ts.map +1 -0
- package/dist/types/auth.d.ts +310 -0
- package/dist/types/auth.d.ts.map +1 -0
- package/dist/types/config.d.ts +632 -0
- package/dist/types/config.d.ts.map +1 -0
- package/dist/types/database.d.ts +75 -0
- package/dist/types/database.d.ts.map +1 -0
- package/dist/types/editor.d.ts +140 -0
- package/dist/types/editor.d.ts.map +1 -0
- package/dist/types/events.d.ts +72 -0
- package/dist/types/events.d.ts.map +1 -0
- package/dist/types/fields.d.ts +142 -0
- package/dist/types/fields.d.ts.map +1 -0
- package/dist/types/hooks.d.ts +142 -0
- package/dist/types/hooks.d.ts.map +1 -0
- package/dist/types/index.d.ts +25 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/instance.d.ts +263 -0
- package/dist/types/instance.d.ts.map +1 -0
- package/dist/types/jobs.d.ts +78 -0
- package/dist/types/jobs.d.ts.map +1 -0
- package/dist/types/json.d.ts +24 -0
- package/dist/types/json.d.ts.map +1 -0
- package/dist/types/locales.d.ts +30 -0
- package/dist/types/locales.d.ts.map +1 -0
- package/dist/types/media.d.ts +245 -0
- package/dist/types/media.d.ts.map +1 -0
- package/dist/types/panel.d.ts +249 -0
- package/dist/types/panel.d.ts.map +1 -0
- package/dist/types/plugin.d.ts +172 -0
- package/dist/types/plugin.d.ts.map +1 -0
- package/dist/types/query.d.ts +101 -0
- package/dist/types/query.d.ts.map +1 -0
- package/dist/types/schema.d.ts +203 -0
- package/dist/types/schema.d.ts.map +1 -0
- package/dist/types/storage.d.ts +61 -0
- package/dist/types/storage.d.ts.map +1 -0
- package/dist/types/telemetry.d.ts +14 -0
- package/dist/types/telemetry.d.ts.map +1 -0
- package/dist/types/trash.d.ts +42 -0
- package/dist/types/trash.d.ts.map +1 -0
- package/dist/types/webhooks.d.ts +133 -0
- package/dist/types/webhooks.d.ts.map +1 -0
- package/dist/types.d.ts +8 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +1 -0
- package/dist/uploads.d.ts +21 -0
- package/dist/uploads.d.ts.map +1 -0
- package/dist/uploads.js +9 -0
- package/dist/webhooks/index.d.ts +10 -0
- package/dist/webhooks/index.d.ts.map +1 -0
- package/dist/webhooks/job.d.ts +17 -0
- package/dist/webhooks/job.d.ts.map +1 -0
- package/dist/webhooks/service.d.ts +53 -0
- package/dist/webhooks/service.d.ts.map +1 -0
- package/dist/webhooks/sign.d.ts +26 -0
- package/dist/webhooks/sign.d.ts.map +1 -0
- package/dist/webhooks.d.ts +10 -0
- package/dist/webhooks.d.ts.map +1 -0
- package/dist/webhooks.js +1 -0
- package/package.json +183 -4
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Heyo.sh
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,45 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @heyo-sh/heyo-cms
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
A framework-agnostic TypeScript CMS: collections, globals, RBAC, editor auth,
|
|
4
|
+
localized content, media, hooks/events, scheduling, AI and signed webhooks.
|
|
5
|
+
Postgres, MongoDB, SQLite and Cloudflare D1. MIT.
|
|
6
|
+
|
|
7
|
+
## Start a project
|
|
8
|
+
|
|
9
|
+
Use Node 24+ or Bun:
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
bun create @heyo-sh/heyo-cms
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
Choose Next.js, Astro or React Router and Vercel or Cloudflare. The generator
|
|
16
|
+
includes `@heyo-sh/heyo-cms-admin`, migrations, a seed, a public page and one
|
|
17
|
+
catch-all route. Follow its printed setup commands.
|
|
18
|
+
|
|
19
|
+
## CLI
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
heyo-cms generate
|
|
23
|
+
heyo-cms migrate
|
|
24
|
+
heyo-cms status
|
|
25
|
+
heyo-cms create-admin --email you@example.com
|
|
26
|
+
heyo-cms seed
|
|
27
|
+
heyo-cms export --out content.ndjson
|
|
28
|
+
heyo-cms import content.ndjson --on-conflict update
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
There is no schema `push` mode. Content transfer preserves IDs and localized
|
|
32
|
+
values and runs normal hooks. It is not a backup: media bytes/rows, accounts
|
|
33
|
+
and operational history are excluded; timestamps are new and trash is skipped.
|
|
34
|
+
|
|
35
|
+
## Telemetry
|
|
36
|
+
|
|
37
|
+
Only CLI commands report adoption metadata (adapter IDs, counts, feature flags,
|
|
38
|
+
runtime/OS and a configuration-shape hash). A running CMS server never reports.
|
|
39
|
+
`heyo-cms telemetry` prints the payload. Disable with
|
|
40
|
+
`HEYO_TELEMETRY_DISABLED=1`, `DO_NOT_TRACK=1`, or
|
|
41
|
+
`telemetry: { enabled: false }` in config. CI/tests are disabled by default.
|
|
42
|
+
|
|
43
|
+
[Documentation](https://github.com/heyo-sh/heyo-cms/tree/main/docs) ·
|
|
44
|
+
[API examples and limits](https://github.com/heyo-sh/heyo-cms#readme) ·
|
|
45
|
+
[Benchmarks and methodology](https://github.com/heyo-sh/heyo-cms/tree/main/benchmarks)
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Role-based access control.
|
|
3
|
+
*
|
|
4
|
+
* Pure string work, no database and no engine: the same functions decide an
|
|
5
|
+
* actor's permissions when a session is created, when an API key is verified
|
|
6
|
+
* and when an access rule asks a question inside a configuration file.
|
|
7
|
+
*/
|
|
8
|
+
export { expandRoles, grants, intersectPermissions, isValidScope, permissionFor, permits, scopePermissions, wildcard, } from "./permissions";
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/access/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EACL,WAAW,EACX,MAAM,EACN,oBAAoB,EACpB,YAAY,EACZ,aAAa,EACb,OAAO,EACP,gBAAgB,EAChB,QAAQ,GACT,MAAM,eAAe,CAAC"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import type { Actor } from "../types/actor";
|
|
2
|
+
/**
|
|
3
|
+
* The permission grammar: `collection:action`, with `*` on either side.
|
|
4
|
+
*
|
|
5
|
+
* Deliberately tiny. A role is a list of patterns, an actor carries the
|
|
6
|
+
* flattened result, and every check in the engine is one string match — which
|
|
7
|
+
* is what lets an access rule be written as `permits(actor, "posts:publish")`
|
|
8
|
+
* in a configuration file without importing anything that touches a database.
|
|
9
|
+
*
|
|
10
|
+
* `*` on its own is the administrator: it matches every collection and every
|
|
11
|
+
* action, including the ones a plugin adds after this file was written.
|
|
12
|
+
*/
|
|
13
|
+
export declare const wildcard = "*";
|
|
14
|
+
/** `posts:create`. The only place the string is assembled. */
|
|
15
|
+
export declare function permissionFor(collection: string, action: string): string;
|
|
16
|
+
/** Does one pattern grant one concrete `collection:action`? */
|
|
17
|
+
export declare function grants(pattern: string, required: string): boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Does this actor hold the permission?
|
|
20
|
+
*
|
|
21
|
+
* Takes the actor rather than the list so an access rule reads the way the
|
|
22
|
+
* plan writes it, and so `null` — an anonymous caller — is answered here
|
|
23
|
+
* instead of at every call site.
|
|
24
|
+
*/
|
|
25
|
+
export declare function permits(actor: Actor | null | undefined, required: string): boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Flattens roles into the patterns they stand for.
|
|
28
|
+
*
|
|
29
|
+
* Unknown roles contribute nothing instead of throwing: a role can be deleted
|
|
30
|
+
* in the panel while a user still references it, and the safe reading of a
|
|
31
|
+
* grant that no longer exists is "no grant".
|
|
32
|
+
*/
|
|
33
|
+
export declare function expandRoles(roles: string[], definitions: Record<string, string[]>): string[];
|
|
34
|
+
/**
|
|
35
|
+
* The narrower of two pattern sets.
|
|
36
|
+
*
|
|
37
|
+
* An API key cannot grant more than the user it belongs to, so the key's
|
|
38
|
+
* scopes and the user's permissions are intersected pattern by pattern:
|
|
39
|
+
* `["*"]` ∩ `["*:read"]` is `["*:read"]`, and `["posts:*"]` ∩ `["*:read"]` is
|
|
40
|
+
* `["posts:read"]`. Keeping this exact is what makes a read-only key on an
|
|
41
|
+
* administrator's account actually read-only.
|
|
42
|
+
*/
|
|
43
|
+
export declare function intersectPermissions(left: string[], right: string[]): string[];
|
|
44
|
+
/**
|
|
45
|
+
* What an API key scope means in the permission grammar.
|
|
46
|
+
*
|
|
47
|
+
* `read`, `write` and `delete` are the coarse scopes the plan names; anything
|
|
48
|
+
* containing a colon is already a pattern and is taken literally, so a key can
|
|
49
|
+
* be scoped to `posts:update` without inventing a second vocabulary.
|
|
50
|
+
*/
|
|
51
|
+
export declare function scopePermissions(scopes: string[]): string[];
|
|
52
|
+
/** Is this a legal scope string? Used to reject typos at configuration time. */
|
|
53
|
+
export declare function isValidScope(scope: string): boolean;
|
|
54
|
+
//# sourceMappingURL=permissions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"permissions.d.ts","sourceRoot":"","sources":["../../src/access/permissions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAE5C;;;;;;;;;;GAUG;AAEH,eAAO,MAAM,QAAQ,MAAM,CAAC;AAE5B,8DAA8D;AAC9D,wBAAgB,aAAa,CAAC,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAExE;AAiBD,+DAA+D;AAC/D,wBAAgB,MAAM,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAIjE;AAED;;;;;;GAMG;AACH,wBAAgB,OAAO,CACrB,KAAK,EAAE,KAAK,GAAG,IAAI,GAAG,SAAS,EAC/B,QAAQ,EAAE,MAAM,GACf,OAAO,CAGT;AAED;;;;;;GAMG;AACH,wBAAgB,WAAW,CACzB,KAAK,EAAE,MAAM,EAAE,EACf,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,GACpC,MAAM,EAAE,CAQV;AAED;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,CAClC,IAAI,EAAE,MAAM,EAAE,EACd,KAAK,EAAE,MAAM,EAAE,GACd,MAAM,EAAE,CAkBV;AAQD;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,CA6B3D;AAED,gFAAgF;AAChF,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAInD"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { CmsHandler } from "../types/instance";
|
|
2
|
+
/**
|
|
3
|
+
* Astro.
|
|
4
|
+
*
|
|
5
|
+
* ```ts
|
|
6
|
+
* // src/pages/api/heyo-cms/[...path].ts
|
|
7
|
+
* import { cmsHandler } from "@heyo-sh/heyo-cms/astro";
|
|
8
|
+
* import { cms } from "../../../heyo-cms.config";
|
|
9
|
+
*
|
|
10
|
+
* export const prerender = false;
|
|
11
|
+
* export const { GET, POST, PATCH, PUT, DELETE, HEAD, OPTIONS } = cmsHandler(cms);
|
|
12
|
+
* ```
|
|
13
|
+
*
|
|
14
|
+
* Astro hands an endpoint context rather than a `Request`, so the adapter
|
|
15
|
+
* reaches for `context.request` — the one difference from the Next.js version,
|
|
16
|
+
* and the reason the import path names the framework instead of a flag doing
|
|
17
|
+
* it.
|
|
18
|
+
*/
|
|
19
|
+
export interface HandlerLike {
|
|
20
|
+
handler: CmsHandler;
|
|
21
|
+
}
|
|
22
|
+
/** The shape of what Astro passes an endpoint. */
|
|
23
|
+
export interface AstroContextLike {
|
|
24
|
+
request: Request;
|
|
25
|
+
}
|
|
26
|
+
export type AstroRoute = (context: AstroContextLike) => Promise<Response>;
|
|
27
|
+
export interface AstroRouteHandlers {
|
|
28
|
+
GET: AstroRoute;
|
|
29
|
+
POST: AstroRoute;
|
|
30
|
+
PATCH: AstroRoute;
|
|
31
|
+
PUT: AstroRoute;
|
|
32
|
+
DELETE: AstroRoute;
|
|
33
|
+
HEAD: AstroRoute;
|
|
34
|
+
OPTIONS: AstroRoute;
|
|
35
|
+
ALL: AstroRoute;
|
|
36
|
+
}
|
|
37
|
+
export declare function cmsHandler(cms: HandlerLike): AstroRouteHandlers;
|
|
38
|
+
//# sourceMappingURL=astro.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"astro.d.ts","sourceRoot":"","sources":["../../src/adapters/astro.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAEpD;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,WAAW,WAAW;IAC1B,OAAO,EAAE,UAAU,CAAC;CACrB;AAED,kDAAkD;AAClD,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,MAAM,UAAU,GAAG,CAAC,OAAO,EAAE,gBAAgB,KAAK,OAAO,CAAC,QAAQ,CAAC,CAAC;AAE1E,MAAM,WAAW,kBAAkB;IACjC,GAAG,EAAE,UAAU,CAAC;IAChB,IAAI,EAAE,UAAU,CAAC;IACjB,KAAK,EAAE,UAAU,CAAC;IAClB,GAAG,EAAE,UAAU,CAAC;IAChB,MAAM,EAAE,UAAU,CAAC;IACnB,IAAI,EAAE,UAAU,CAAC;IACjB,OAAO,EAAE,UAAU,CAAC;IACpB,GAAG,EAAE,UAAU,CAAC;CACjB;AAED,wBAAgB,UAAU,CAAC,GAAG,EAAE,WAAW,GAAG,kBAAkB,CAc/D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function r(t){let e=({request:o})=>t.handler(o);return{GET:e,POST:e,PATCH:e,PUT:e,DELETE:e,HEAD:e,OPTIONS:e,ALL:e}}export{r as cmsHandler};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { CmsHandler } from "../types/instance";
|
|
2
|
+
/**
|
|
3
|
+
* Next.js App Router.
|
|
4
|
+
*
|
|
5
|
+
* ```ts
|
|
6
|
+
* // app/api/heyo-cms/[...path]/route.ts
|
|
7
|
+
* import { cmsHandler } from "@heyo-sh/heyo-cms/next";
|
|
8
|
+
* import { cms } from "@/heyo-cms.config";
|
|
9
|
+
*
|
|
10
|
+
* export const { GET, POST, PATCH, PUT, DELETE, HEAD, OPTIONS } = cmsHandler(cms);
|
|
11
|
+
* ```
|
|
12
|
+
*
|
|
13
|
+
* One file, and it never changes again: a route added to the core or to a
|
|
14
|
+
* plugin is served by the same catch-all (section 10). The adapter is this
|
|
15
|
+
* small because the handler is already `Request → Response`, which is exactly
|
|
16
|
+
* what a Next.js route handler is.
|
|
17
|
+
*/
|
|
18
|
+
export interface HandlerLike {
|
|
19
|
+
handler: CmsHandler;
|
|
20
|
+
}
|
|
21
|
+
export interface NextRouteHandlers {
|
|
22
|
+
GET: CmsHandler;
|
|
23
|
+
POST: CmsHandler;
|
|
24
|
+
PATCH: CmsHandler;
|
|
25
|
+
PUT: CmsHandler;
|
|
26
|
+
DELETE: CmsHandler;
|
|
27
|
+
HEAD: CmsHandler;
|
|
28
|
+
OPTIONS: CmsHandler;
|
|
29
|
+
}
|
|
30
|
+
export declare function cmsHandler(cms: HandlerLike): NextRouteHandlers;
|
|
31
|
+
//# sourceMappingURL=next.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"next.d.ts","sourceRoot":"","sources":["../../src/adapters/next.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAEpD;;;;;;;;;;;;;;;GAeG;AACH,MAAM,WAAW,WAAW;IAC1B,OAAO,EAAE,UAAU,CAAC;CACrB;AAED,MAAM,WAAW,iBAAiB;IAChC,GAAG,EAAE,UAAU,CAAC;IAChB,IAAI,EAAE,UAAU,CAAC;IACjB,KAAK,EAAE,UAAU,CAAC;IAClB,GAAG,EAAE,UAAU,CAAC;IAChB,MAAM,EAAE,UAAU,CAAC;IACnB,IAAI,EAAE,UAAU,CAAC;IACjB,OAAO,EAAE,UAAU,CAAC;CACrB;AAED,wBAAgB,UAAU,CAAC,GAAG,EAAE,WAAW,GAAG,iBAAiB,CAa9D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function a(n){let e=(r)=>n.handler(r);return{GET:e,POST:e,PATCH:e,PUT:e,DELETE:e,HEAD:e,OPTIONS:e}}export{a as cmsHandler};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import type { CmsHandler } from "../types/instance";
|
|
2
|
+
/**
|
|
3
|
+
* Nuxt (h3).
|
|
4
|
+
*
|
|
5
|
+
* ```ts
|
|
6
|
+
* // server/routes/api/heyo-cms/[...path].ts
|
|
7
|
+
* import { cmsHandler } from "@heyo-sh/heyo-cms/nuxt";
|
|
8
|
+
* import { cms } from "~/heyo-cms.config";
|
|
9
|
+
*
|
|
10
|
+
* export default defineEventHandler(cmsHandler(cms));
|
|
11
|
+
* ```
|
|
12
|
+
*
|
|
13
|
+
* The one adapter that is more than a wrapper, because h3 is the one runtime
|
|
14
|
+
* in this list that does not hand over a `Request`. Three shapes are accepted,
|
|
15
|
+
* duck-typed rather than imported: `h3` is not a dependency of this package
|
|
16
|
+
* and adding one so that a Nuxt project can mount a CMS would make every
|
|
17
|
+
* other project pay for it.
|
|
18
|
+
*
|
|
19
|
+
* - **h3 v2** events carry `event.web.request` — used directly.
|
|
20
|
+
* - **h3 v1** events carry `event.node.req` — converted, including a
|
|
21
|
+
* streaming body, with `node:stream` imported only on this path.
|
|
22
|
+
* - A plain `Request`, which is what `toWebHandler()` passes.
|
|
23
|
+
*
|
|
24
|
+
* The generator has no Nuxt template in v1 (stage 10); the adapter is here
|
|
25
|
+
* because the contract is the same one every other framework gets.
|
|
26
|
+
*/
|
|
27
|
+
export interface HandlerLike {
|
|
28
|
+
handler: CmsHandler;
|
|
29
|
+
}
|
|
30
|
+
interface WebEvent {
|
|
31
|
+
web: {
|
|
32
|
+
request: Request;
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
interface NodeEvent {
|
|
36
|
+
node: {
|
|
37
|
+
req: {
|
|
38
|
+
method?: string;
|
|
39
|
+
url?: string;
|
|
40
|
+
headers: Record<string, string | string[] | undefined>;
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
export type NuxtEvent = Request | WebEvent | NodeEvent;
|
|
45
|
+
export declare function cmsHandler(cms: HandlerLike): (event: NuxtEvent) => Promise<Response>;
|
|
46
|
+
export {};
|
|
47
|
+
//# sourceMappingURL=nuxt.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nuxt.d.ts","sourceRoot":"","sources":["../../src/adapters/nuxt.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAEpD;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,WAAW,WAAW;IAC1B,OAAO,EAAE,UAAU,CAAC;CACrB;AAED,UAAU,QAAQ;IAChB,GAAG,EAAE;QAAE,OAAO,EAAE,OAAO,CAAA;KAAE,CAAC;CAC3B;AAED,UAAU,SAAS;IACjB,IAAI,EAAE;QACJ,GAAG,EAAE;YACH,MAAM,CAAC,EAAE,MAAM,CAAC;YAChB,GAAG,CAAC,EAAE,MAAM,CAAC;YACb,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS,CAAC,CAAC;SACxD,CAAC;KACH,CAAC;CACH;AAED,MAAM,MAAM,SAAS,GAAG,OAAO,GAAG,QAAQ,GAAG,SAAS,CAAC;AAEvD,wBAAgB,UAAU,CACxB,GAAG,EAAE,WAAW,GACf,CAAC,KAAK,EAAE,SAAS,KAAK,OAAO,CAAC,QAAQ,CAAC,CAEzC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{e}from"../index-x72d1hzh.js";function y(t){return async(n)=>t.handler(await p(n))}async function p(t){if(t instanceof Request)return t;if(E(t))return t.web.request;if(b(t))return h(t);throw new e("This does not look like an h3 event or a Request. Pass the event from `defineEventHandler`, or use `toWebHandler`.",{status:500,code:"unsupported_event"})}function E(t){return typeof t==="object"&&t!==null&&"web"in t&&typeof t.web?.request==="object"}function b(t){return typeof t==="object"&&t!==null&&"node"in t&&typeof t.node?.req==="object"}async function h(t){let n=t.node.req,o=new Headers;for(let[f,s]of Object.entries(n.headers)){if(s===void 0)continue;for(let l of Array.isArray(s)?s:[s])o.append(f,l)}let u=o.get("host")??"localhost",d=o.get("x-forwarded-proto")??"http",a=new URL(n.url??"/",`${d}://${u}`),r=n.method??"GET";if(!(r!=="GET"&&r!=="HEAD"))return new Request(a,{method:r,headers:o});let{Readable:i}=await import("node:stream"),c=i.toWeb(n);return new Request(a,{method:r,headers:o,body:c,duplex:"half"})}export{y as cmsHandler};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { CmsHandler } from "../types/instance";
|
|
2
|
+
/**
|
|
3
|
+
* React Router (and Remix).
|
|
4
|
+
*
|
|
5
|
+
* ```ts
|
|
6
|
+
* // app/routes/api.heyo-cms.$.ts
|
|
7
|
+
* import { cmsHandler } from "@heyo-sh/heyo-cms/react-router";
|
|
8
|
+
* import { cms } from "../../heyo-cms.config";
|
|
9
|
+
*
|
|
10
|
+
* export const { loader, action } = cmsHandler(cms);
|
|
11
|
+
* ```
|
|
12
|
+
*
|
|
13
|
+
* Two exports rather than seven: React Router routes reads through `loader`
|
|
14
|
+
* and everything else through `action`, so the CMS needs both and the method
|
|
15
|
+
* dispatch happens inside the handler where it already lives.
|
|
16
|
+
*/
|
|
17
|
+
export interface HandlerLike {
|
|
18
|
+
handler: CmsHandler;
|
|
19
|
+
}
|
|
20
|
+
export interface DataFunctionArgs {
|
|
21
|
+
request: Request;
|
|
22
|
+
}
|
|
23
|
+
export type DataFunction = (args: DataFunctionArgs) => Promise<Response>;
|
|
24
|
+
export interface ReactRouterRouteHandlers {
|
|
25
|
+
loader: DataFunction;
|
|
26
|
+
action: DataFunction;
|
|
27
|
+
}
|
|
28
|
+
export declare function cmsHandler(cms: HandlerLike): ReactRouterRouteHandlers;
|
|
29
|
+
//# sourceMappingURL=react-router.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"react-router.d.ts","sourceRoot":"","sources":["../../src/adapters/react-router.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAEpD;;;;;;;;;;;;;;GAcG;AACH,MAAM,WAAW,WAAW;IAC1B,OAAO,EAAE,UAAU,CAAC;CACrB;AAED,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,MAAM,YAAY,GAAG,CAAC,IAAI,EAAE,gBAAgB,KAAK,OAAO,CAAC,QAAQ,CAAC,CAAC;AAEzE,MAAM,WAAW,wBAAwB;IACvC,MAAM,EAAE,YAAY,CAAC;IACrB,MAAM,EAAE,YAAY,CAAC;CACtB;AAED,wBAAgB,UAAU,CAAC,GAAG,EAAE,WAAW,GAAG,wBAAwB,CAGrE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function a(t){let e=({request:n})=>t.handler(n);return{loader:e,action:e}}export{a as cmsHandler};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { CmsHandler } from "../types/instance";
|
|
2
|
+
/**
|
|
3
|
+
* SvelteKit.
|
|
4
|
+
*
|
|
5
|
+
* ```ts
|
|
6
|
+
* // src/routes/api/heyo-cms/[...path]/+server.ts
|
|
7
|
+
* import { cmsHandler } from "@heyo-sh/heyo-cms/sveltekit";
|
|
8
|
+
* import { cms } from "$lib/heyo-cms.config";
|
|
9
|
+
*
|
|
10
|
+
* export const { GET, POST, PATCH, PUT, DELETE, fallback } = cmsHandler(cms);
|
|
11
|
+
* ```
|
|
12
|
+
*
|
|
13
|
+
* The adapter exists in v1; the generator has no SvelteKit template yet
|
|
14
|
+
* (stage 10). That distinction is the point of a `Request → Response` core:
|
|
15
|
+
* supporting a framework is this file, not a port — and nothing here pulls
|
|
16
|
+
* React into a Svelte project's `node_modules`.
|
|
17
|
+
*
|
|
18
|
+
* `fallback` is SvelteKit's catch-all for the methods a `+server.ts` does not
|
|
19
|
+
* name, which is how `HEAD` and `OPTIONS` reach the router.
|
|
20
|
+
*/
|
|
21
|
+
export interface HandlerLike {
|
|
22
|
+
handler: CmsHandler;
|
|
23
|
+
}
|
|
24
|
+
export interface RequestEventLike {
|
|
25
|
+
request: Request;
|
|
26
|
+
}
|
|
27
|
+
export type SvelteKitRoute = (event: RequestEventLike) => Promise<Response>;
|
|
28
|
+
export interface SvelteKitRouteHandlers {
|
|
29
|
+
GET: SvelteKitRoute;
|
|
30
|
+
POST: SvelteKitRoute;
|
|
31
|
+
PATCH: SvelteKitRoute;
|
|
32
|
+
PUT: SvelteKitRoute;
|
|
33
|
+
DELETE: SvelteKitRoute;
|
|
34
|
+
fallback: SvelteKitRoute;
|
|
35
|
+
}
|
|
36
|
+
export declare function cmsHandler(cms: HandlerLike): SvelteKitRouteHandlers;
|
|
37
|
+
//# sourceMappingURL=sveltekit.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sveltekit.d.ts","sourceRoot":"","sources":["../../src/adapters/sveltekit.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAEpD;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,WAAW,WAAW;IAC1B,OAAO,EAAE,UAAU,CAAC;CACrB;AAED,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,MAAM,cAAc,GAAG,CAAC,KAAK,EAAE,gBAAgB,KAAK,OAAO,CAAC,QAAQ,CAAC,CAAC;AAE5E,MAAM,WAAW,sBAAsB;IACrC,GAAG,EAAE,cAAc,CAAC;IACpB,IAAI,EAAE,cAAc,CAAC;IACrB,KAAK,EAAE,cAAc,CAAC;IACtB,GAAG,EAAE,cAAc,CAAC;IACpB,MAAM,EAAE,cAAc,CAAC;IACvB,QAAQ,EAAE,cAAc,CAAC;CAC1B;AAED,wBAAgB,UAAU,CAAC,GAAG,EAAE,WAAW,GAAG,sBAAsB,CAUnE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function n(t){let e=({request:l})=>t.handler(l);return{GET:e,POST:e,PATCH:e,PUT:e,DELETE:e,fallback:e}}export{n as cmsHandler};
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import type { AiPageContext, AiPageContextKind } from "../../types/ai";
|
|
2
|
+
import type { ResolvedCmsConfig, ResolvedCollection } from "../../types/config";
|
|
3
|
+
/**
|
|
4
|
+
* The page context, taken from the browser and immediately distrusted.
|
|
5
|
+
*
|
|
6
|
+
* Everything in it is a *hint about where the editor is looking*, never a
|
|
7
|
+
* grant. The slug is re-resolved against the configuration, the locale
|
|
8
|
+
* against the registry, and the document is re-read through `cms.api` with
|
|
9
|
+
* the actor from the session. This cannot grant access to protected records;
|
|
10
|
+
* it can still point the model at a different record the caller *can* reach,
|
|
11
|
+
* so a page hint is never evidence of the user's intent to write to it.
|
|
12
|
+
*
|
|
13
|
+
* Parsed defensively rather than validated strictly: a panel version that
|
|
14
|
+
* sends a field this one does not know about should lose that field, not the
|
|
15
|
+
* conversation.
|
|
16
|
+
*/
|
|
17
|
+
export declare function parsePageContext(value: unknown): AiPageContext | undefined;
|
|
18
|
+
export interface ResolvedPageContext {
|
|
19
|
+
kind: AiPageContextKind;
|
|
20
|
+
collection: ResolvedCollection | null;
|
|
21
|
+
documentId: string | null;
|
|
22
|
+
/** The file the details pane is showing, on the media screen only. */
|
|
23
|
+
mediaId: string | null;
|
|
24
|
+
/** The sub-surface in front: a rich-text tab, a settings tab, a status. */
|
|
25
|
+
tab: string | null;
|
|
26
|
+
locale: string;
|
|
27
|
+
dirtyFields: string[];
|
|
28
|
+
baselineRevision: number | null;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* The context with its names turned into configuration objects.
|
|
32
|
+
*
|
|
33
|
+
* A slug that names nothing resolves to `null` rather than throwing: the
|
|
34
|
+
* editor may be on a screen this server version does not have, and refusing
|
|
35
|
+
* the whole conversation over it would be a worse answer than "I cannot see
|
|
36
|
+
* what you are looking at, which record did you mean".
|
|
37
|
+
*
|
|
38
|
+
* `fallbackLocale` is the language the caller named outside the context
|
|
39
|
+
* (`runAssistant({ locale })`). It sits between the context and the project
|
|
40
|
+
* default, because a screen that has no record — a list, the media library —
|
|
41
|
+
* still has a language, and defaulting to the project's would make the agent
|
|
42
|
+
* search the English column for an editor who is working in Polish.
|
|
43
|
+
*/
|
|
44
|
+
export declare function resolvePageContext(config: ResolvedCmsConfig, context: AiPageContext | undefined, fallbackLocale?: string | undefined): ResolvedPageContext;
|
|
45
|
+
/**
|
|
46
|
+
* A collection by whichever name the model used.
|
|
47
|
+
*
|
|
48
|
+
* The schema gives it both `name` and `slug` and models are not reliable about
|
|
49
|
+
* which one they echo back. Accept either unless the same string names two
|
|
50
|
+
* different collections. In that case guessing a precedence would turn a
|
|
51
|
+
* legitimate request into a write to the wrong collection. Make the agent
|
|
52
|
+
* disambiguate by using an unambiguous name or slug instead.
|
|
53
|
+
*/
|
|
54
|
+
export declare function requireCollection(config: ResolvedCmsConfig, name: string, kind?: "collection" | "global"): ResolvedCollection;
|
|
55
|
+
/**
|
|
56
|
+
* The locale a tool call should use.
|
|
57
|
+
*
|
|
58
|
+
* The model may name one; otherwise the page the editor is on decides, and
|
|
59
|
+
* only then the project default. Guessing the default when the editor is
|
|
60
|
+
* clearly editing German would write the English column, which is the kind of
|
|
61
|
+
* mistake that is invisible until somebody opens the other language.
|
|
62
|
+
*/
|
|
63
|
+
export declare function localeFor(config: ResolvedCmsConfig, page: ResolvedPageContext, requested?: string | undefined): string;
|
|
64
|
+
//# sourceMappingURL=context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../../src/ai/assistant/context.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACvE,OAAO,KAAK,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AA2BhF;;;;;;;;;;;;;GAaG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,OAAO,GAAG,aAAa,GAAG,SAAS,CAuC1E;AAED,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,iBAAiB,CAAC;IACxB,UAAU,EAAE,kBAAkB,GAAG,IAAI,CAAC;IACtC,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,sEAAsE;IACtE,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,2EAA2E;IAC3E,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;CACjC;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,iBAAiB,EACzB,OAAO,EAAE,aAAa,GAAG,SAAS,EAClC,cAAc,CAAC,EAAE,MAAM,GAAG,SAAS,GAClC,mBAAmB,CAkCrB;AAoED;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,iBAAiB,EACzB,IAAI,EAAE,MAAM,EACZ,IAAI,CAAC,EAAE,YAAY,GAAG,QAAQ,GAC7B,kBAAkB,CAmBpB;AAMD;;;;;;;GAOG;AACH,wBAAgB,SAAS,CACvB,MAAM,EAAE,iBAAiB,EACzB,IAAI,EAAE,mBAAmB,EACzB,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,GAC7B,MAAM,CAUR"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Limits enforced in code, shared with the read-only panel description.
|
|
3
|
+
* A budget the model can talk itself out of is not a budget.
|
|
4
|
+
*/
|
|
5
|
+
export declare const assistantLimits: {
|
|
6
|
+
readonly maxTurns: 8;
|
|
7
|
+
readonly maxToolCalls: 16;
|
|
8
|
+
readonly timeoutMs: 90000;
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=limits.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"limits.d.ts","sourceRoot":"","sources":["../../../src/ai/assistant/limits.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,eAAO,MAAM,eAAe;aAC1B,QAAQ,EAAE,CAAC;aACX,YAAY,EAAE,EAAE;aAChB,SAAS,EAAE,KAAM;CACT,CAAC"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import type { Actor } from "../../types/actor";
|
|
2
|
+
import type { AiPlanSummary } from "../../types/ai";
|
|
3
|
+
import type { DatabaseAdapter } from "../../types/database";
|
|
4
|
+
import type { JsonObject } from "../../types/json";
|
|
5
|
+
/** The ceiling on one plan. A bigger intention is several approvals. */
|
|
6
|
+
export declare const maxPlanOperations = 25;
|
|
7
|
+
/**
|
|
8
|
+
* One operation inside a plan, exactly as it will be executed.
|
|
9
|
+
*
|
|
10
|
+
* Normalised at the moment the plan is written: collection *names* rather than
|
|
11
|
+
* whatever the model typed, the shaped field values rather than Markdown, the
|
|
12
|
+
* revision the agent actually read. Approving a plan then means replaying this
|
|
13
|
+
* row — no second pass through the model, no re-interpretation, no chance that
|
|
14
|
+
* the thing executed differs from the thing displayed.
|
|
15
|
+
*/
|
|
16
|
+
export interface PlanOperation {
|
|
17
|
+
action: "create" | "update" | "trash" | "restore" | "purge" | "update-global" | "update-media";
|
|
18
|
+
collection?: string;
|
|
19
|
+
id?: string;
|
|
20
|
+
locale?: string | null;
|
|
21
|
+
expectedRevision?: number;
|
|
22
|
+
data?: JsonObject;
|
|
23
|
+
/** What the panel shows for this line. Server-written, never the model's. */
|
|
24
|
+
label: string;
|
|
25
|
+
fields: string[];
|
|
26
|
+
}
|
|
27
|
+
export interface StoredPlan {
|
|
28
|
+
id: string;
|
|
29
|
+
runId: string;
|
|
30
|
+
actorId: string | null;
|
|
31
|
+
kind: string;
|
|
32
|
+
summary: string;
|
|
33
|
+
operations: PlanOperation[];
|
|
34
|
+
status: "pending" | "approved" | "expired";
|
|
35
|
+
expiresAt: Date;
|
|
36
|
+
}
|
|
37
|
+
export interface PlanStoreOptions {
|
|
38
|
+
database: () => Promise<DatabaseAdapter>;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Where a plan waits for a human.
|
|
42
|
+
*
|
|
43
|
+
* In the database rather than in memory, for two reasons that both come up in
|
|
44
|
+
* ordinary use: the approval arrives on a *different* HTTP request from the
|
|
45
|
+
* one that proposed it, and a deployment with more than one instance will
|
|
46
|
+
* routinely route those two requests to different processes.
|
|
47
|
+
*/
|
|
48
|
+
export declare class PlanStore {
|
|
49
|
+
private readonly options;
|
|
50
|
+
constructor(options: PlanStoreOptions);
|
|
51
|
+
create(args: {
|
|
52
|
+
runId: string;
|
|
53
|
+
actor: Actor | null;
|
|
54
|
+
kind: string;
|
|
55
|
+
summary: string;
|
|
56
|
+
operations: PlanOperation[];
|
|
57
|
+
now?: Date;
|
|
58
|
+
}): Promise<StoredPlan>;
|
|
59
|
+
/**
|
|
60
|
+
* The plan this actor is allowed to approve, if it is still approvable.
|
|
61
|
+
*
|
|
62
|
+
* The actor check is not decoration. A plan is a stored intention to write,
|
|
63
|
+
* and an id that anybody signed in could POST would turn one editor's
|
|
64
|
+
* unapproved proposal into another editor's authority.
|
|
65
|
+
*/
|
|
66
|
+
claim(args: {
|
|
67
|
+
planId: string;
|
|
68
|
+
actor: Actor | null;
|
|
69
|
+
now?: Date;
|
|
70
|
+
}): Promise<StoredPlan>;
|
|
71
|
+
/** Records what executing the plan produced, for an interrupted approval. */
|
|
72
|
+
complete(planId: string, result: JsonObject): Promise<void>;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* The plan as the panel may see it.
|
|
76
|
+
*
|
|
77
|
+
* Field *names*, never field values. An approval dialog has to say "this will
|
|
78
|
+
* change `title` and `body` on three posts", and a dialog that printed the
|
|
79
|
+
* proposed body would be a dialog nobody reads — which is the failure mode an
|
|
80
|
+
* approval step exists to prevent.
|
|
81
|
+
*/
|
|
82
|
+
export declare function planSummary(plan: StoredPlan): AiPlanSummary;
|
|
83
|
+
//# sourceMappingURL=plans.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plans.d.ts","sourceRoot":"","sources":["../../../src/ai/assistant/plans.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,KAAK,EAAoB,aAAa,EAAE,MAAM,gBAAgB,CAAC;AACtE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,KAAK,EAAE,UAAU,EAAa,MAAM,kBAAkB,CAAC;AAO9D,wEAAwE;AACxE,eAAO,MAAM,iBAAiB,KAAK,CAAC;AAEpC;;;;;;;;GAQG;AACH,MAAM,WAAW,aAAa;IAC5B,MAAM,EACF,QAAQ,GACR,QAAQ,GACR,OAAO,GACP,SAAS,GACT,OAAO,GACP,eAAe,GACf,cAAc,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,6EAA6E;IAC7E,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB;AAED,MAAM,WAAW,UAAU;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,aAAa,EAAE,CAAC;IAC5B,MAAM,EAAE,SAAS,GAAG,UAAU,GAAG,SAAS,CAAC;IAC3C,SAAS,EAAE,IAAI,CAAC;CACjB;AAED,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,EAAE,MAAM,OAAO,CAAC,eAAe,CAAC,CAAC;CAC1C;AAED;;;;;;;GAOG;AACH,qBAAa,SAAS;IACR,OAAO,CAAC,QAAQ,CAAC,OAAO;IAApC,YAA6B,OAAO,EAAE,gBAAgB,EAAI;IAEpD,MAAM,CAAC,IAAI,EAAE;QACjB,KAAK,EAAE,MAAM,CAAC;QACd,KAAK,EAAE,KAAK,GAAG,IAAI,CAAC;QACpB,IAAI,EAAE,MAAM,CAAC;QACb,OAAO,EAAE,MAAM,CAAC;QAChB,UAAU,EAAE,aAAa,EAAE,CAAC;QAC5B,GAAG,CAAC,EAAE,IAAI,CAAC;KACZ,GAAG,OAAO,CAAC,UAAU,CAAC,CAuCtB;IAED;;;;;;OAMG;IACG,KAAK,CAAC,IAAI,EAAE;QAChB,MAAM,EAAE,MAAM,CAAC;QACf,KAAK,EAAE,KAAK,GAAG,IAAI,CAAC;QACpB,GAAG,CAAC,EAAE,IAAI,CAAC;KACZ,GAAG,OAAO,CAAC,UAAU,CAAC,CAqCtB;IAED,6EAA6E;IACvE,QAAQ,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,CAOhE;CACF;AAED;;;;;;;GAOG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,UAAU,GAAG,aAAa,CAa3D"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { ResolvedPageContext } from "./context";
|
|
2
|
+
/**
|
|
3
|
+
* The system prompt.
|
|
4
|
+
*
|
|
5
|
+
* Short and normative, and it contains no data. Not the schema, not the
|
|
6
|
+
* collection list, not the record — those arrive through tools, on demand,
|
|
7
|
+
* already filtered for this actor. A prompt that carried the project would be
|
|
8
|
+
* paid for on every turn of every conversation and would be stale the moment
|
|
9
|
+
* somebody added a field.
|
|
10
|
+
*
|
|
11
|
+
* Nothing here is load-bearing for security. Every rule it states is also
|
|
12
|
+
* enforced in the tool layer, which is the only place enforcement belongs: a
|
|
13
|
+
* prompt is a request to a system that is explicitly designed to generate
|
|
14
|
+
* plausible text, and the one thing it must never be is the gate.
|
|
15
|
+
*/
|
|
16
|
+
export declare function assistantSystemPrompt(args: {
|
|
17
|
+
title: string;
|
|
18
|
+
instructions?: string | undefined;
|
|
19
|
+
page: ResolvedPageContext;
|
|
20
|
+
defaultLocale: string;
|
|
21
|
+
}): string;
|
|
22
|
+
//# sourceMappingURL=prompt.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prompt.d.ts","sourceRoot":"","sources":["../../../src/ai/assistant/prompt.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAErD;;;;;;;;;;;;;GAaG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE;IAC1C,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAClC,IAAI,EAAE,mBAAmB,CAAC;IAC1B,aAAa,EAAE,MAAM,CAAC;CACvB,GAAG,MAAM,CAsCT"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The panel-wide AI assistant.
|
|
3
|
+
*
|
|
4
|
+
* One agent, running inside the CMS process, with a small set of typed tools
|
|
5
|
+
* that call the ordinary public API. That last part is the whole design: a
|
|
6
|
+
* mutating tool goes through `cms.api.*` / `cms.globals.*` / `cms.media.*`
|
|
7
|
+
* with the real actor and `source: "ai"`, so an agent write passes exactly the
|
|
8
|
+
* same access control, field access, validation, hooks, media accounting,
|
|
9
|
+
* events and activity log as somebody typing into the form.
|
|
10
|
+
*
|
|
11
|
+
* There is no SQL tool, no adapter access, no fetch, no file read and no
|
|
12
|
+
* credential tool. The question "what could a prompt injection make this do"
|
|
13
|
+
* has a bounded answer because the surface is bounded.
|
|
14
|
+
*
|
|
15
|
+
* Nothing re-exports this directory as a barrel on purpose: `ai/service.ts`
|
|
16
|
+
* imports `./assistant/run` lazily, so a project without the assistant never
|
|
17
|
+
* resolves the agent runtime's optional dependencies.
|
|
18
|
+
*/
|
|
19
|
+
import type { Actor } from "../../types/actor";
|
|
20
|
+
import type { AiApprovePlanArgs, AiApprovePlanResult, AiAssistantArgs, AiAssistantEvent } from "../../types/ai";
|
|
21
|
+
import type { AiAuth, ResolvedCmsConfig } from "../../types/config";
|
|
22
|
+
import type { DatabaseAdapter } from "../../types/database";
|
|
23
|
+
import type { CmsInstance } from "../../types/instance";
|
|
24
|
+
import type { JsonObject } from "../../types/json";
|
|
25
|
+
export interface AssistantRunOptions {
|
|
26
|
+
args: AiAssistantArgs;
|
|
27
|
+
config: ResolvedCmsConfig;
|
|
28
|
+
cms: CmsInstance;
|
|
29
|
+
database: () => Promise<DatabaseAdapter>;
|
|
30
|
+
authFor: (provider: string) => Promise<AiAuth>;
|
|
31
|
+
record: (type: "ai.agent.completed" | "ai.agent.failed" | "ai.agent.mutation.applied", data: JsonObject, actor: Actor | null, failure?: unknown) => Promise<void>;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* One run of the assistant, as a stream of events the panel understands.
|
|
35
|
+
*
|
|
36
|
+
* An async generator rather than a callback or a `Response`: the HTTP layer
|
|
37
|
+
* wants a stream, a test wants an array, and `cms.ai.runAssistant()` as a local
|
|
38
|
+
* API wants to be awaited in a loop. All three are the same object here, and
|
|
39
|
+
* none of them can see pi's own event vocabulary.
|
|
40
|
+
*/
|
|
41
|
+
export declare function runAssistant(options: AssistantRunOptions): AsyncGenerator<AiAssistantEvent>;
|
|
42
|
+
export interface ApprovePlanOptions {
|
|
43
|
+
args: AiApprovePlanArgs;
|
|
44
|
+
config: ResolvedCmsConfig;
|
|
45
|
+
cms: CmsInstance;
|
|
46
|
+
database: () => Promise<DatabaseAdapter>;
|
|
47
|
+
record: (type: "ai.agent.completed" | "ai.agent.failed" | "ai.agent.mutation.applied", data: JsonObject, actor: Actor | null, failure?: unknown) => Promise<void>;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Executing a plan a human approved.
|
|
51
|
+
*
|
|
52
|
+
* The model is not in this function and that is the whole point. The row is
|
|
53
|
+
* read, the session is checked again, the permissions are checked again by
|
|
54
|
+
* the engine on every write, and the operations run exactly as they were
|
|
55
|
+
* stored. An approval that went back through the model would be an approval
|
|
56
|
+
* of something the editor never saw.
|
|
57
|
+
*/
|
|
58
|
+
export declare function approvePlan(options: ApprovePlanOptions): Promise<AiApprovePlanResult>;
|
|
59
|
+
//# sourceMappingURL=run.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../../../src/ai/assistant/run.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAIH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,KAAK,EACV,iBAAiB,EACjB,mBAAmB,EACnB,eAAe,EACf,gBAAgB,EAKjB,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,EACV,MAAM,EAEN,iBAAiB,EAClB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAE5D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,KAAK,EAAE,UAAU,EAAa,MAAM,kBAAkB,CAAC;AAoB9D,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,eAAe,CAAC;IACtB,MAAM,EAAE,iBAAiB,CAAC;IAC1B,GAAG,EAAE,WAAW,CAAC;IACjB,QAAQ,EAAE,MAAM,OAAO,CAAC,eAAe,CAAC,CAAC;IACzC,OAAO,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;IAC/C,MAAM,EAAE,CACN,IAAI,EACF,oBAAoB,GAAG,iBAAiB,GAAG,2BAA2B,EACxE,IAAI,EAAE,UAAU,EAChB,KAAK,EAAE,KAAK,GAAG,IAAI,EACnB,OAAO,CAAC,EAAE,OAAO,KACd,OAAO,CAAC,IAAI,CAAC,CAAC;CACpB;AAED;;;;;;;GAOG;AACH,wBAAuB,YAAY,CACjC,OAAO,EAAE,mBAAmB,GAC3B,cAAc,CAAC,gBAAgB,CAAC,CA2OlC;AAED,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,iBAAiB,CAAC;IACxB,MAAM,EAAE,iBAAiB,CAAC;IAC1B,GAAG,EAAE,WAAW,CAAC;IACjB,QAAQ,EAAE,MAAM,OAAO,CAAC,eAAe,CAAC,CAAC;IACzC,MAAM,EAAE,CACN,IAAI,EACF,oBAAoB,GAAG,iBAAiB,GAAG,2BAA2B,EACxE,IAAI,EAAE,UAAU,EAChB,KAAK,EAAE,KAAK,GAAG,IAAI,EACnB,OAAO,CAAC,EAAE,OAAO,KACd,OAAO,CAAC,IAAI,CAAC,CAAC;CACpB;AAED;;;;;;;;GAQG;AACH,wBAAsB,WAAW,CAC/B,OAAO,EAAE,kBAAkB,GAC1B,OAAO,CAAC,mBAAmB,CAAC,CAgD9B"}
|