wizards 0.4.7 → 0.5.1
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 +45 -42
- package/apps/runtime/dist/agents/studio-assistant.js +8 -8
- package/apps/runtime/dist/app.js +7 -4
- package/apps/runtime/dist/assistant/primer.js +1 -1
- package/apps/runtime/dist/auth/index.js +2 -2
- package/apps/runtime/dist/authoring/guide.js +8 -8
- package/apps/runtime/dist/cli/account.js +31 -28
- package/apps/runtime/dist/cli/autostart.js +5 -3
- package/apps/runtime/dist/cli/clients.js +1 -1
- package/apps/runtime/dist/cli/connect.js +24 -24
- package/apps/runtime/dist/cli/features.js +6 -6
- package/apps/runtime/dist/cli/main.js +51 -39
- package/apps/runtime/dist/cli/mcp.js +5 -4
- package/apps/runtime/dist/cli/menu.js +32 -30
- package/apps/runtime/dist/cli/report.js +7 -9
- package/apps/runtime/dist/cli/setup.js +42 -38
- package/apps/runtime/dist/cli/start.js +16 -15
- package/apps/runtime/dist/cli/status.js +20 -20
- package/apps/runtime/dist/cli/ui.js +9 -2
- package/apps/runtime/dist/cli/update.js +6 -6
- package/apps/runtime/dist/cli/validate.js +1 -1
- package/apps/runtime/dist/connectors/external.js +3 -2
- package/apps/runtime/dist/connectors/index.js +5 -5
- package/apps/runtime/dist/connectors/plugin-connections.js +2 -2
- package/apps/runtime/dist/connectors/via-account.js +5 -5
- package/apps/runtime/dist/db/control-schema.js +14 -0
- package/apps/runtime/dist/db/migrations/control/0009_plugin_claim.sql +9 -0
- package/apps/runtime/dist/db/migrations/control/meta/0009_snapshot.json +561 -0
- package/apps/runtime/dist/db/migrations/control/meta/_journal.json +7 -0
- package/apps/runtime/dist/db/schema.js +9 -9
- package/apps/runtime/dist/docs/dev/index.md +16 -14
- package/apps/runtime/dist/docs/dev/plugins/connections.md +27 -24
- package/apps/runtime/dist/docs/dev/plugins/events.md +19 -17
- package/apps/runtime/dist/docs/dev/plugins/examples.md +13 -12
- package/apps/runtime/dist/docs/dev/plugins/index.md +29 -24
- package/apps/runtime/dist/docs/dev/plugins/layout.md +20 -19
- package/apps/runtime/dist/docs/dev/plugins/quick-start.md +16 -15
- package/apps/runtime/dist/docs/dev/plugins/reference.md +52 -40
- package/apps/runtime/dist/docs/dev/plugins/reloading.md +24 -23
- package/apps/runtime/dist/docs/dev/plugins/routes.md +26 -22
- package/apps/runtime/dist/docs/dev/plugins/runners.md +49 -44
- package/apps/runtime/dist/docs/dev/plugins/server.md +95 -43
- package/apps/runtime/dist/docs/dev/plugins/shipping.md +19 -16
- package/apps/runtime/dist/docs/dev/plugins/space.md +75 -69
- package/apps/runtime/dist/docs/dev/plugins/starters.md +22 -17
- package/apps/runtime/dist/docs/dev/plugins/studio.md +80 -37
- package/apps/runtime/dist/docs/dev/plugins/styling.md +44 -41
- package/apps/runtime/dist/docs/dev/plugins/tables.md +11 -11
- package/apps/runtime/dist/docs/dev/plugins/tools.md +26 -25
- package/apps/runtime/dist/docs/dev/wizard-format.md +35 -23
- package/apps/runtime/dist/docs/user/ai-apps.md +46 -43
- package/apps/runtime/dist/docs/user/assistant.md +41 -36
- package/apps/runtime/dist/docs/user/build-a-wizard.md +64 -39
- package/apps/runtime/dist/docs/user/command-line.md +47 -44
- package/apps/runtime/dist/docs/user/connectors.md +40 -35
- package/apps/runtime/dist/docs/user/create-account.md +27 -22
- package/apps/runtime/dist/docs/user/data.md +29 -29
- package/apps/runtime/dist/docs/user/first-start.md +26 -28
- package/apps/runtime/dist/docs/user/index.md +16 -17
- package/apps/runtime/dist/docs/user/install.md +28 -27
- package/apps/runtime/dist/docs/user/local-only.md +21 -17
- package/apps/runtime/dist/docs/user/models.md +92 -84
- package/apps/runtime/dist/docs/user/plugins.md +28 -23
- package/apps/runtime/dist/docs/user/run.md +51 -50
- package/apps/runtime/dist/docs/user/server.md +9 -9
- package/apps/runtime/dist/docs/user/space.md +87 -65
- package/apps/runtime/dist/docs/user/steps.md +73 -69
- package/apps/runtime/dist/docs/user/test-and-share.md +127 -105
- package/apps/runtime/dist/docs/user/troubleshooting.md +40 -38
- package/apps/runtime/dist/docs/user/wordpress.md +62 -54
- package/apps/runtime/dist/documents/parse.js +2 -2
- package/apps/runtime/dist/engenty/shims/web-ingest.js +17 -1
- package/apps/runtime/dist/engine/input.js +4 -4
- package/apps/runtime/dist/engine/push.js +2 -2
- package/apps/runtime/dist/engine/runner.js +8 -8
- package/apps/runtime/dist/engine/steps.js +4 -4
- package/apps/runtime/dist/engine/surface.js +1 -1
- package/apps/runtime/dist/film/step.js +3 -3
- package/apps/runtime/dist/harness/claude.js +1 -1
- package/apps/runtime/dist/harness/codex.js +1 -1
- package/apps/runtime/dist/harness/model.js +2 -2
- package/apps/runtime/dist/harness/terminal.js +3 -3
- package/apps/runtime/dist/mcp/handler.js +2 -2
- package/apps/runtime/dist/mcp/tools.js +9 -9
- package/apps/runtime/dist/models.js +15 -15
- package/apps/runtime/dist/plugins/claims.js +56 -0
- package/apps/runtime/dist/plugins/loader.js +2 -0
- package/apps/runtime/dist/plugins/public.js +2 -3
- package/apps/runtime/dist/plugins/runs.js +13 -8
- package/apps/runtime/dist/render/chromium.js +24 -11
- package/apps/runtime/dist/routes/api.js +16 -10
- package/apps/runtime/dist/routes/debug.js +1 -1
- package/apps/runtime/dist/routes/delivery.js +46 -0
- package/apps/runtime/dist/routes/lang.js +7 -0
- package/apps/runtime/dist/routes/marketplace.js +2 -1
- package/apps/runtime/dist/routes/plugin-public.js +2 -1
- package/apps/runtime/dist/routes/plugins.js +13 -14
- package/apps/runtime/dist/routes/runs.js +59 -49
- package/apps/runtime/dist/routes/studio.js +58 -28
- package/apps/runtime/dist/services/access.js +3 -3
- package/apps/runtime/dist/services/assistant-chats.js +1 -1
- package/apps/runtime/dist/services/brand.js +2 -2
- package/apps/runtime/dist/services/cloud.js +5 -4
- package/apps/runtime/dist/services/errors.js +2 -1
- package/apps/runtime/dist/services/knowledge-model.js +10 -10
- package/apps/runtime/dist/services/knowledge.js +19 -19
- package/apps/runtime/dist/services/marketplace.js +2 -2
- package/apps/runtime/dist/services/package-file.js +12 -9
- package/apps/runtime/dist/services/package.js +3 -3
- package/apps/runtime/dist/services/project-files.js +15 -17
- package/apps/runtime/dist/services/project-index.js +10 -10
- package/apps/runtime/dist/services/projects.js +13 -8
- package/apps/runtime/dist/services/relevance.js +3 -3
- package/apps/runtime/dist/services/runners.js +4 -3
- package/apps/runtime/dist/services/runs.js +3 -3
- package/apps/runtime/dist/services/site.js +10 -10
- package/apps/runtime/dist/services/space-categories.js +22 -22
- package/apps/runtime/dist/services/space-data.js +16 -16
- package/apps/runtime/dist/services/space-origin.js +4 -4
- package/apps/runtime/dist/services/spaces.js +10 -10
- package/apps/runtime/dist/services/wizards.js +5 -5
- package/apps/runtime/dist/tools/index.js +1 -1
- package/apps/runtime/dist/tools/net-guard.js +135 -24
- package/apps/runtime/dist/tools/pages.js +4 -4
- package/apps/runtime/dist/tools/plugin.js +1 -1
- package/apps/runtime/dist/tools/project.js +10 -10
- package/apps/runtime/dist/tools/store.js +1 -1
- package/apps/runtime/dist/widgets/step.js +1 -1
- package/apps/web/dist/assets/AboutDialog-DaYwk84X.js +1 -0
- package/apps/web/dist/assets/{ChangelogDialog-Cm25slr3.js → ChangelogDialog-CsYbEayb.js} +1 -1
- package/apps/web/dist/assets/{ChatView-BXtXWnqK.js → ChatView-BRD3fKZU.js} +1 -1
- package/apps/web/dist/assets/EditorPage-ocPlZD3E.js +3 -0
- package/apps/web/dist/assets/{FlowPreview-BsfjDVv8.js → FlowPreview-Bm7sv746.js} +1 -1
- package/apps/web/dist/assets/{Harness-B0hD5Pp7.js → Harness-DKE-YNA5.js} +1 -1
- package/apps/web/dist/assets/{NewWizardChannels-DMDp9Ao5.js → NewWizardChannels-CnWckqjO.js} +1 -1
- package/apps/web/dist/assets/{NewWizardPage-aOisxyk2.js → NewWizardPage-BXTpbHVM.js} +1 -1
- package/apps/web/dist/assets/{OnboardingPage-Czb0pOyy.js → OnboardingPage-3Rz5uOsa.js} +1 -1
- package/apps/web/dist/assets/{ProjectPage-DPCtb42K.js → ProjectPage-QdSJwm3k.js} +1 -1
- package/apps/web/dist/assets/{PublicRunner-CvyA-gkf.js → PublicRunner-DEpBer5g.js} +1 -1
- package/apps/web/dist/assets/ReadOnly-rr_RJD-a.js +1 -0
- package/apps/web/dist/assets/{RunDrawer-BCiPEz9g.js → RunDrawer-BsZt0tL9.js} +1 -1
- package/apps/web/dist/assets/{RunnerView-4z6DMzE6.js → RunnerView-BbRukEdE.js} +1 -1
- package/apps/web/dist/assets/SettingsPage-qkWsQIMN.js +1 -0
- package/apps/web/dist/assets/{SetupPage-YFoU_nXK.js → SetupPage-PzvPPLfM.js} +1 -1
- package/apps/web/dist/assets/{SharePage-BBHiJ34e.js → SharePage-7vdDWG1n.js} +1 -1
- package/apps/web/dist/assets/changelog-BFdAYD28.js +1 -0
- package/apps/web/dist/assets/{esm-hSq-jeOG.js → esm-g0kaGp8t.js} +1 -1
- package/apps/web/dist/assets/{index-CSeBGwy0.css → index-Bi2x2g7n.css} +1 -1
- package/apps/web/dist/assets/{index-DB_iwB35.js → index-BzPid1oQ.js} +4 -4
- package/apps/web/dist/assets/lock-BK9RYIft.js +1 -0
- package/apps/web/dist/assets/oss-credits-BJrR7BR1.js +1 -0
- package/apps/web/dist/assets/{phone-CeqyvwK-.js → phone-DtkY0NfU.js} +1 -1
- package/apps/web/dist/assets/{settings-menu-BK8WpcGv.js → settings-menu-7EJQRFOi.js} +1 -1
- package/apps/web/dist/assets/{ui-BbIh6SOJ.js → ui-B6S5hYPd.js} +3 -3
- package/apps/web/dist/assets/{upload-BQrAlHIG.js → upload-rYCAy7ox.js} +1 -1
- package/apps/web/dist/index.html +3 -3
- package/apps/web/dist/mcp/flow.html +4 -4
- package/bin/wizards.mjs +1 -1
- package/node_modules/@engenty-wizards/plugin-sdk/dist/index.d.ts +33 -14
- package/node_modules/@engenty-wizards/plugin-sdk/dist/studio.d.ts +3 -3
- package/node_modules/@engenty-wizards/shared/dist/definition.d.ts +690 -690
- package/node_modules/@engenty-wizards/shared/dist/definition.js +1 -1
- package/node_modules/@engenty-wizards/shared/dist/engenty/data-tables/columns.d.ts +76 -76
- package/node_modules/@engenty-wizards/shared/dist/feature-flags.d.ts +3 -3
- package/node_modules/@engenty-wizards/shared/dist/feature-flags.js +3 -3
- package/node_modules/@engenty-wizards/shared/dist/knowledge.d.ts +13 -13
- package/node_modules/@engenty-wizards/shared/dist/knowledge.js +4 -4
- package/node_modules/@engenty-wizards/shared/dist/marketplace.d.ts +4 -4
- package/node_modules/@engenty-wizards/shared/dist/projects.js +1 -1
- package/node_modules/@engenty-wizards/shared/dist/run.d.ts +48 -48
- package/node_modules/@engenty-wizards/shared/dist/run.js +48 -48
- package/node_modules/@engenty-wizards/shared/dist/space-data.d.ts +2 -2
- package/node_modules/@engenty-wizards/shared/dist/surface.d.ts +20 -20
- package/node_modules/@engenty-wizards/shared/dist/wizard-package.js +1 -1
- package/package.json +5 -4
- package/apps/web/dist/assets/AboutDialog-BtAuA44m.js +0 -1
- package/apps/web/dist/assets/EditorPage-B4jX_Ckc.js +0 -3
- package/apps/web/dist/assets/ReadOnly-DFysMEMF.js +0 -1
- package/apps/web/dist/assets/SettingsPage-BKkOfz6P.js +0 -1
- package/apps/web/dist/assets/changelog-D8WjOq7d.js +0 -1
- package/apps/web/dist/assets/circle-alert-BVj6idzu.js +0 -1
- package/apps/web/dist/assets/lock-BoWS-JhN.js +0 -1
- package/apps/web/dist/assets/oss-credits-BQQX0kvk.js +0 -1
|
@@ -26,7 +26,7 @@ export async function googleThroughAccount() {
|
|
|
26
26
|
async function call(path, body) {
|
|
27
27
|
const token = await accountToken();
|
|
28
28
|
if (!token) {
|
|
29
|
-
throw new AccountConnectError(bilingual("Verbinde zuerst dein engenty-Konto (Einstellungen → Konto)
|
|
29
|
+
throw new AccountConnectError(bilingual("Verbinde zuerst dein engenty-Konto (Einstellungen → Konto). Dann kannst du Google hier verbinden.", "Connect your engenty account first (Settings → Account). Then you can connect Google here."));
|
|
30
30
|
}
|
|
31
31
|
const res = await fetch(`${base()}${path}`, {
|
|
32
32
|
method: "POST",
|
|
@@ -35,15 +35,15 @@ async function call(path, body) {
|
|
|
35
35
|
signal: AbortSignal.timeout(20_000),
|
|
36
36
|
}).catch(() => null);
|
|
37
37
|
if (!res) {
|
|
38
|
-
throw new AccountConnectError(bilingual("Dein engenty-Konto ist gerade nicht erreichbar.
|
|
38
|
+
throw new AccountConnectError(bilingual("Dein engenty-Konto ist gerade nicht erreichbar. Versuch es später noch einmal.", "Your engenty account can’t be reached right now. Try again later."));
|
|
39
39
|
}
|
|
40
40
|
const data = (await res.json().catch(() => ({})));
|
|
41
41
|
if (!res.ok) {
|
|
42
42
|
throw new AccountConnectError(data.code === "invalid_grant"
|
|
43
|
-
? bilingual("Google nimmt diese Verbindung nicht mehr an.
|
|
43
|
+
? bilingual("Google nimmt diese Verbindung nicht mehr an. Verbinde das Konto neu.", "Google no longer accepts this connection. Connect the account again.")
|
|
44
44
|
: data.code === "not_configured"
|
|
45
|
-
? bilingual("Google lässt sich über dein engenty-Konto gerade nicht verbinden.", "Google
|
|
46
|
-
: bilingual(`Verbinden über dein engenty-Konto hat nicht geklappt (${data.code ?? res.status}).`, `Connecting through your engenty account
|
|
45
|
+
? bilingual("Google lässt sich über dein engenty-Konto gerade nicht verbinden.", "Google can’t be connected through your engenty account right now.")
|
|
46
|
+
: bilingual(`Verbinden über dein engenty-Konto hat nicht geklappt (${data.code ?? res.status}).`, `Connecting through your engenty account didn’t work (${data.code ?? res.status}).`));
|
|
47
47
|
}
|
|
48
48
|
return data;
|
|
49
49
|
}
|
|
@@ -107,3 +107,17 @@ export const pluginAddress = sqliteTable("plugin_address", {
|
|
|
107
107
|
plugin: text("plugin").notNull(),
|
|
108
108
|
createdAt: createdAt(),
|
|
109
109
|
}, (t) => [uniqueIndex("plugin_address_tenant").on(t.tenantId, t.plugin)]);
|
|
110
|
+
/**
|
|
111
|
+
* Keys a plugin holds across tenants (`server.claims`), each for one tenant at a time: a keyword
|
|
112
|
+
* on a number every tenant shares, who writes to it, a number a tenant connected. What a shared
|
|
113
|
+
* route asks to find the tenant of a call.
|
|
114
|
+
*/
|
|
115
|
+
export const pluginClaim = sqliteTable("plugin_claim", {
|
|
116
|
+
plugin: text("plugin").notNull(),
|
|
117
|
+
key: text("key").notNull(),
|
|
118
|
+
tenantId: text("tenant_id").notNull(),
|
|
119
|
+
updatedAt: integer("updated_at", { mode: "timestamp_ms" }).notNull().default(now),
|
|
120
|
+
}, (t) => [
|
|
121
|
+
primaryKey({ columns: [t.plugin, t.key] }),
|
|
122
|
+
index("plugin_claim_tenant").on(t.tenantId, t.plugin),
|
|
123
|
+
]);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
CREATE TABLE `plugin_claim` (
|
|
2
|
+
`plugin` text NOT NULL,
|
|
3
|
+
`key` text NOT NULL,
|
|
4
|
+
`tenant_id` text NOT NULL,
|
|
5
|
+
`updated_at` integer DEFAULT (unixepoch() * 1000) NOT NULL,
|
|
6
|
+
PRIMARY KEY(`plugin`, `key`)
|
|
7
|
+
);
|
|
8
|
+
--> statement-breakpoint
|
|
9
|
+
CREATE INDEX `plugin_claim_tenant` ON `plugin_claim` (`tenant_id`,`plugin`);
|
|
@@ -0,0 +1,561 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": "6",
|
|
3
|
+
"dialect": "sqlite",
|
|
4
|
+
"id": "9991e82d-196a-4a7b-9c90-df39a12f3aa2",
|
|
5
|
+
"prevId": "47fe3107-ea98-40f9-878c-9b504bc89e9a",
|
|
6
|
+
"tables": {
|
|
7
|
+
"link": {
|
|
8
|
+
"name": "link",
|
|
9
|
+
"columns": {
|
|
10
|
+
"token": {
|
|
11
|
+
"name": "token",
|
|
12
|
+
"type": "text",
|
|
13
|
+
"primaryKey": true,
|
|
14
|
+
"notNull": true,
|
|
15
|
+
"autoincrement": false
|
|
16
|
+
},
|
|
17
|
+
"tenant_id": {
|
|
18
|
+
"name": "tenant_id",
|
|
19
|
+
"type": "text",
|
|
20
|
+
"primaryKey": false,
|
|
21
|
+
"notNull": true,
|
|
22
|
+
"autoincrement": false
|
|
23
|
+
},
|
|
24
|
+
"kind": {
|
|
25
|
+
"name": "kind",
|
|
26
|
+
"type": "text",
|
|
27
|
+
"primaryKey": false,
|
|
28
|
+
"notNull": true,
|
|
29
|
+
"autoincrement": false
|
|
30
|
+
},
|
|
31
|
+
"ref": {
|
|
32
|
+
"name": "ref",
|
|
33
|
+
"type": "text",
|
|
34
|
+
"primaryKey": false,
|
|
35
|
+
"notNull": true,
|
|
36
|
+
"autoincrement": false
|
|
37
|
+
},
|
|
38
|
+
"created_at": {
|
|
39
|
+
"name": "created_at",
|
|
40
|
+
"type": "integer",
|
|
41
|
+
"primaryKey": false,
|
|
42
|
+
"notNull": true,
|
|
43
|
+
"autoincrement": false,
|
|
44
|
+
"default": "(unixepoch() * 1000)"
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
"indexes": {
|
|
48
|
+
"link_tenant": {
|
|
49
|
+
"name": "link_tenant",
|
|
50
|
+
"columns": [
|
|
51
|
+
"tenant_id"
|
|
52
|
+
],
|
|
53
|
+
"isUnique": false
|
|
54
|
+
},
|
|
55
|
+
"link_ref": {
|
|
56
|
+
"name": "link_ref",
|
|
57
|
+
"columns": [
|
|
58
|
+
"kind",
|
|
59
|
+
"ref"
|
|
60
|
+
],
|
|
61
|
+
"isUnique": false
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
"foreignKeys": {},
|
|
65
|
+
"compositePrimaryKeys": {},
|
|
66
|
+
"uniqueConstraints": {},
|
|
67
|
+
"checkConstraints": {}
|
|
68
|
+
},
|
|
69
|
+
"marketplace_cache": {
|
|
70
|
+
"name": "marketplace_cache",
|
|
71
|
+
"columns": {
|
|
72
|
+
"id": {
|
|
73
|
+
"name": "id",
|
|
74
|
+
"type": "text",
|
|
75
|
+
"primaryKey": true,
|
|
76
|
+
"notNull": true,
|
|
77
|
+
"autoincrement": false
|
|
78
|
+
},
|
|
79
|
+
"hash": {
|
|
80
|
+
"name": "hash",
|
|
81
|
+
"type": "text",
|
|
82
|
+
"primaryKey": false,
|
|
83
|
+
"notNull": true,
|
|
84
|
+
"autoincrement": false
|
|
85
|
+
},
|
|
86
|
+
"entry": {
|
|
87
|
+
"name": "entry",
|
|
88
|
+
"type": "text",
|
|
89
|
+
"primaryKey": false,
|
|
90
|
+
"notNull": true,
|
|
91
|
+
"autoincrement": false
|
|
92
|
+
},
|
|
93
|
+
"fetched_at": {
|
|
94
|
+
"name": "fetched_at",
|
|
95
|
+
"type": "integer",
|
|
96
|
+
"primaryKey": false,
|
|
97
|
+
"notNull": true,
|
|
98
|
+
"autoincrement": false,
|
|
99
|
+
"default": "(unixepoch() * 1000)"
|
|
100
|
+
}
|
|
101
|
+
},
|
|
102
|
+
"indexes": {},
|
|
103
|
+
"foreignKeys": {},
|
|
104
|
+
"compositePrimaryKeys": {},
|
|
105
|
+
"uniqueConstraints": {},
|
|
106
|
+
"checkConstraints": {}
|
|
107
|
+
},
|
|
108
|
+
"plugin_address": {
|
|
109
|
+
"name": "plugin_address",
|
|
110
|
+
"columns": {
|
|
111
|
+
"ref": {
|
|
112
|
+
"name": "ref",
|
|
113
|
+
"type": "text",
|
|
114
|
+
"primaryKey": true,
|
|
115
|
+
"notNull": true,
|
|
116
|
+
"autoincrement": false
|
|
117
|
+
},
|
|
118
|
+
"tenant_id": {
|
|
119
|
+
"name": "tenant_id",
|
|
120
|
+
"type": "text",
|
|
121
|
+
"primaryKey": false,
|
|
122
|
+
"notNull": true,
|
|
123
|
+
"autoincrement": false
|
|
124
|
+
},
|
|
125
|
+
"plugin": {
|
|
126
|
+
"name": "plugin",
|
|
127
|
+
"type": "text",
|
|
128
|
+
"primaryKey": false,
|
|
129
|
+
"notNull": true,
|
|
130
|
+
"autoincrement": false
|
|
131
|
+
},
|
|
132
|
+
"created_at": {
|
|
133
|
+
"name": "created_at",
|
|
134
|
+
"type": "integer",
|
|
135
|
+
"primaryKey": false,
|
|
136
|
+
"notNull": true,
|
|
137
|
+
"autoincrement": false,
|
|
138
|
+
"default": "(unixepoch() * 1000)"
|
|
139
|
+
}
|
|
140
|
+
},
|
|
141
|
+
"indexes": {
|
|
142
|
+
"plugin_address_tenant": {
|
|
143
|
+
"name": "plugin_address_tenant",
|
|
144
|
+
"columns": [
|
|
145
|
+
"tenant_id",
|
|
146
|
+
"plugin"
|
|
147
|
+
],
|
|
148
|
+
"isUnique": true
|
|
149
|
+
}
|
|
150
|
+
},
|
|
151
|
+
"foreignKeys": {},
|
|
152
|
+
"compositePrimaryKeys": {},
|
|
153
|
+
"uniqueConstraints": {},
|
|
154
|
+
"checkConstraints": {}
|
|
155
|
+
},
|
|
156
|
+
"plugin_claim": {
|
|
157
|
+
"name": "plugin_claim",
|
|
158
|
+
"columns": {
|
|
159
|
+
"plugin": {
|
|
160
|
+
"name": "plugin",
|
|
161
|
+
"type": "text",
|
|
162
|
+
"primaryKey": false,
|
|
163
|
+
"notNull": true,
|
|
164
|
+
"autoincrement": false
|
|
165
|
+
},
|
|
166
|
+
"key": {
|
|
167
|
+
"name": "key",
|
|
168
|
+
"type": "text",
|
|
169
|
+
"primaryKey": false,
|
|
170
|
+
"notNull": true,
|
|
171
|
+
"autoincrement": false
|
|
172
|
+
},
|
|
173
|
+
"tenant_id": {
|
|
174
|
+
"name": "tenant_id",
|
|
175
|
+
"type": "text",
|
|
176
|
+
"primaryKey": false,
|
|
177
|
+
"notNull": true,
|
|
178
|
+
"autoincrement": false
|
|
179
|
+
},
|
|
180
|
+
"updated_at": {
|
|
181
|
+
"name": "updated_at",
|
|
182
|
+
"type": "integer",
|
|
183
|
+
"primaryKey": false,
|
|
184
|
+
"notNull": true,
|
|
185
|
+
"autoincrement": false,
|
|
186
|
+
"default": "(unixepoch() * 1000)"
|
|
187
|
+
}
|
|
188
|
+
},
|
|
189
|
+
"indexes": {
|
|
190
|
+
"plugin_claim_tenant": {
|
|
191
|
+
"name": "plugin_claim_tenant",
|
|
192
|
+
"columns": [
|
|
193
|
+
"tenant_id",
|
|
194
|
+
"plugin"
|
|
195
|
+
],
|
|
196
|
+
"isUnique": false
|
|
197
|
+
}
|
|
198
|
+
},
|
|
199
|
+
"foreignKeys": {},
|
|
200
|
+
"compositePrimaryKeys": {
|
|
201
|
+
"plugin_claim_plugin_key_pk": {
|
|
202
|
+
"columns": [
|
|
203
|
+
"plugin",
|
|
204
|
+
"key"
|
|
205
|
+
],
|
|
206
|
+
"name": "plugin_claim_plugin_key_pk"
|
|
207
|
+
}
|
|
208
|
+
},
|
|
209
|
+
"uniqueConstraints": {},
|
|
210
|
+
"checkConstraints": {}
|
|
211
|
+
},
|
|
212
|
+
"plugin_job": {
|
|
213
|
+
"name": "plugin_job",
|
|
214
|
+
"columns": {
|
|
215
|
+
"tenant_id": {
|
|
216
|
+
"name": "tenant_id",
|
|
217
|
+
"type": "text",
|
|
218
|
+
"primaryKey": false,
|
|
219
|
+
"notNull": true,
|
|
220
|
+
"autoincrement": false
|
|
221
|
+
},
|
|
222
|
+
"plugin": {
|
|
223
|
+
"name": "plugin",
|
|
224
|
+
"type": "text",
|
|
225
|
+
"primaryKey": false,
|
|
226
|
+
"notNull": true,
|
|
227
|
+
"autoincrement": false
|
|
228
|
+
},
|
|
229
|
+
"name": {
|
|
230
|
+
"name": "name",
|
|
231
|
+
"type": "text",
|
|
232
|
+
"primaryKey": false,
|
|
233
|
+
"notNull": true,
|
|
234
|
+
"autoincrement": false
|
|
235
|
+
},
|
|
236
|
+
"last_run_at": {
|
|
237
|
+
"name": "last_run_at",
|
|
238
|
+
"type": "integer",
|
|
239
|
+
"primaryKey": false,
|
|
240
|
+
"notNull": true,
|
|
241
|
+
"autoincrement": false
|
|
242
|
+
}
|
|
243
|
+
},
|
|
244
|
+
"indexes": {},
|
|
245
|
+
"foreignKeys": {},
|
|
246
|
+
"compositePrimaryKeys": {
|
|
247
|
+
"plugin_job_tenant_id_plugin_name_pk": {
|
|
248
|
+
"columns": [
|
|
249
|
+
"tenant_id",
|
|
250
|
+
"plugin",
|
|
251
|
+
"name"
|
|
252
|
+
],
|
|
253
|
+
"name": "plugin_job_tenant_id_plugin_name_pk"
|
|
254
|
+
}
|
|
255
|
+
},
|
|
256
|
+
"uniqueConstraints": {},
|
|
257
|
+
"checkConstraints": {}
|
|
258
|
+
},
|
|
259
|
+
"run_index": {
|
|
260
|
+
"name": "run_index",
|
|
261
|
+
"columns": {
|
|
262
|
+
"run_id": {
|
|
263
|
+
"name": "run_id",
|
|
264
|
+
"type": "text",
|
|
265
|
+
"primaryKey": true,
|
|
266
|
+
"notNull": true,
|
|
267
|
+
"autoincrement": false
|
|
268
|
+
},
|
|
269
|
+
"tenant_id": {
|
|
270
|
+
"name": "tenant_id",
|
|
271
|
+
"type": "text",
|
|
272
|
+
"primaryKey": false,
|
|
273
|
+
"notNull": true,
|
|
274
|
+
"autoincrement": false
|
|
275
|
+
},
|
|
276
|
+
"visitor_id": {
|
|
277
|
+
"name": "visitor_id",
|
|
278
|
+
"type": "text",
|
|
279
|
+
"primaryKey": false,
|
|
280
|
+
"notNull": false,
|
|
281
|
+
"autoincrement": false
|
|
282
|
+
},
|
|
283
|
+
"ip_hash": {
|
|
284
|
+
"name": "ip_hash",
|
|
285
|
+
"type": "text",
|
|
286
|
+
"primaryKey": false,
|
|
287
|
+
"notNull": false,
|
|
288
|
+
"autoincrement": false
|
|
289
|
+
},
|
|
290
|
+
"active": {
|
|
291
|
+
"name": "active",
|
|
292
|
+
"type": "integer",
|
|
293
|
+
"primaryKey": false,
|
|
294
|
+
"notNull": true,
|
|
295
|
+
"autoincrement": false,
|
|
296
|
+
"default": false
|
|
297
|
+
},
|
|
298
|
+
"owner": {
|
|
299
|
+
"name": "owner",
|
|
300
|
+
"type": "text",
|
|
301
|
+
"primaryKey": false,
|
|
302
|
+
"notNull": false,
|
|
303
|
+
"autoincrement": false
|
|
304
|
+
},
|
|
305
|
+
"seen": {
|
|
306
|
+
"name": "seen",
|
|
307
|
+
"type": "integer",
|
|
308
|
+
"primaryKey": false,
|
|
309
|
+
"notNull": false,
|
|
310
|
+
"autoincrement": false
|
|
311
|
+
},
|
|
312
|
+
"push": {
|
|
313
|
+
"name": "push",
|
|
314
|
+
"type": "text",
|
|
315
|
+
"primaryKey": false,
|
|
316
|
+
"notNull": false,
|
|
317
|
+
"autoincrement": false
|
|
318
|
+
},
|
|
319
|
+
"created_at": {
|
|
320
|
+
"name": "created_at",
|
|
321
|
+
"type": "integer",
|
|
322
|
+
"primaryKey": false,
|
|
323
|
+
"notNull": true,
|
|
324
|
+
"autoincrement": false,
|
|
325
|
+
"default": "(unixepoch() * 1000)"
|
|
326
|
+
}
|
|
327
|
+
},
|
|
328
|
+
"indexes": {
|
|
329
|
+
"run_index_visitor": {
|
|
330
|
+
"name": "run_index_visitor",
|
|
331
|
+
"columns": [
|
|
332
|
+
"visitor_id",
|
|
333
|
+
"created_at"
|
|
334
|
+
],
|
|
335
|
+
"isUnique": false
|
|
336
|
+
},
|
|
337
|
+
"run_index_ip": {
|
|
338
|
+
"name": "run_index_ip",
|
|
339
|
+
"columns": [
|
|
340
|
+
"ip_hash",
|
|
341
|
+
"created_at"
|
|
342
|
+
],
|
|
343
|
+
"isUnique": false
|
|
344
|
+
},
|
|
345
|
+
"run_index_active": {
|
|
346
|
+
"name": "run_index_active",
|
|
347
|
+
"columns": [
|
|
348
|
+
"active",
|
|
349
|
+
"tenant_id"
|
|
350
|
+
],
|
|
351
|
+
"isUnique": false
|
|
352
|
+
}
|
|
353
|
+
},
|
|
354
|
+
"foreignKeys": {},
|
|
355
|
+
"compositePrimaryKeys": {},
|
|
356
|
+
"uniqueConstraints": {},
|
|
357
|
+
"checkConstraints": {}
|
|
358
|
+
},
|
|
359
|
+
"runner": {
|
|
360
|
+
"name": "runner",
|
|
361
|
+
"columns": {
|
|
362
|
+
"id": {
|
|
363
|
+
"name": "id",
|
|
364
|
+
"type": "text",
|
|
365
|
+
"primaryKey": true,
|
|
366
|
+
"notNull": true,
|
|
367
|
+
"autoincrement": false
|
|
368
|
+
},
|
|
369
|
+
"url": {
|
|
370
|
+
"name": "url",
|
|
371
|
+
"type": "text",
|
|
372
|
+
"primaryKey": false,
|
|
373
|
+
"notNull": false,
|
|
374
|
+
"autoincrement": false
|
|
375
|
+
},
|
|
376
|
+
"seen": {
|
|
377
|
+
"name": "seen",
|
|
378
|
+
"type": "integer",
|
|
379
|
+
"primaryKey": false,
|
|
380
|
+
"notNull": true,
|
|
381
|
+
"autoincrement": false
|
|
382
|
+
}
|
|
383
|
+
},
|
|
384
|
+
"indexes": {},
|
|
385
|
+
"foreignKeys": {},
|
|
386
|
+
"compositePrimaryKeys": {},
|
|
387
|
+
"uniqueConstraints": {},
|
|
388
|
+
"checkConstraints": {}
|
|
389
|
+
},
|
|
390
|
+
"session": {
|
|
391
|
+
"name": "session",
|
|
392
|
+
"columns": {
|
|
393
|
+
"id": {
|
|
394
|
+
"name": "id",
|
|
395
|
+
"type": "text",
|
|
396
|
+
"primaryKey": true,
|
|
397
|
+
"notNull": true,
|
|
398
|
+
"autoincrement": false
|
|
399
|
+
},
|
|
400
|
+
"user_id": {
|
|
401
|
+
"name": "user_id",
|
|
402
|
+
"type": "text",
|
|
403
|
+
"primaryKey": false,
|
|
404
|
+
"notNull": true,
|
|
405
|
+
"autoincrement": false
|
|
406
|
+
},
|
|
407
|
+
"tenant_id": {
|
|
408
|
+
"name": "tenant_id",
|
|
409
|
+
"type": "text",
|
|
410
|
+
"primaryKey": false,
|
|
411
|
+
"notNull": true,
|
|
412
|
+
"autoincrement": false
|
|
413
|
+
},
|
|
414
|
+
"role": {
|
|
415
|
+
"name": "role",
|
|
416
|
+
"type": "text",
|
|
417
|
+
"primaryKey": false,
|
|
418
|
+
"notNull": true,
|
|
419
|
+
"autoincrement": false
|
|
420
|
+
},
|
|
421
|
+
"name": {
|
|
422
|
+
"name": "name",
|
|
423
|
+
"type": "text",
|
|
424
|
+
"primaryKey": false,
|
|
425
|
+
"notNull": true,
|
|
426
|
+
"autoincrement": false
|
|
427
|
+
},
|
|
428
|
+
"email": {
|
|
429
|
+
"name": "email",
|
|
430
|
+
"type": "text",
|
|
431
|
+
"primaryKey": false,
|
|
432
|
+
"notNull": true,
|
|
433
|
+
"autoincrement": false
|
|
434
|
+
},
|
|
435
|
+
"image": {
|
|
436
|
+
"name": "image",
|
|
437
|
+
"type": "text",
|
|
438
|
+
"primaryKey": false,
|
|
439
|
+
"notNull": false,
|
|
440
|
+
"autoincrement": false
|
|
441
|
+
},
|
|
442
|
+
"refresh_token": {
|
|
443
|
+
"name": "refresh_token",
|
|
444
|
+
"type": "text",
|
|
445
|
+
"primaryKey": false,
|
|
446
|
+
"notNull": false,
|
|
447
|
+
"autoincrement": false
|
|
448
|
+
},
|
|
449
|
+
"claims_expire_at": {
|
|
450
|
+
"name": "claims_expire_at",
|
|
451
|
+
"type": "integer",
|
|
452
|
+
"primaryKey": false,
|
|
453
|
+
"notNull": true,
|
|
454
|
+
"autoincrement": false
|
|
455
|
+
},
|
|
456
|
+
"expires_at": {
|
|
457
|
+
"name": "expires_at",
|
|
458
|
+
"type": "integer",
|
|
459
|
+
"primaryKey": false,
|
|
460
|
+
"notNull": true,
|
|
461
|
+
"autoincrement": false
|
|
462
|
+
},
|
|
463
|
+
"created_at": {
|
|
464
|
+
"name": "created_at",
|
|
465
|
+
"type": "integer",
|
|
466
|
+
"primaryKey": false,
|
|
467
|
+
"notNull": true,
|
|
468
|
+
"autoincrement": false,
|
|
469
|
+
"default": "(unixepoch() * 1000)"
|
|
470
|
+
}
|
|
471
|
+
},
|
|
472
|
+
"indexes": {
|
|
473
|
+
"session_expires": {
|
|
474
|
+
"name": "session_expires",
|
|
475
|
+
"columns": [
|
|
476
|
+
"expires_at"
|
|
477
|
+
],
|
|
478
|
+
"isUnique": false
|
|
479
|
+
}
|
|
480
|
+
},
|
|
481
|
+
"foreignKeys": {},
|
|
482
|
+
"compositePrimaryKeys": {},
|
|
483
|
+
"uniqueConstraints": {},
|
|
484
|
+
"checkConstraints": {}
|
|
485
|
+
},
|
|
486
|
+
"setting": {
|
|
487
|
+
"name": "setting",
|
|
488
|
+
"columns": {
|
|
489
|
+
"key": {
|
|
490
|
+
"name": "key",
|
|
491
|
+
"type": "text",
|
|
492
|
+
"primaryKey": true,
|
|
493
|
+
"notNull": true,
|
|
494
|
+
"autoincrement": false
|
|
495
|
+
},
|
|
496
|
+
"value": {
|
|
497
|
+
"name": "value",
|
|
498
|
+
"type": "text",
|
|
499
|
+
"primaryKey": false,
|
|
500
|
+
"notNull": true,
|
|
501
|
+
"autoincrement": false
|
|
502
|
+
}
|
|
503
|
+
},
|
|
504
|
+
"indexes": {},
|
|
505
|
+
"foreignKeys": {},
|
|
506
|
+
"compositePrimaryKeys": {},
|
|
507
|
+
"uniqueConstraints": {},
|
|
508
|
+
"checkConstraints": {}
|
|
509
|
+
},
|
|
510
|
+
"tenant": {
|
|
511
|
+
"name": "tenant",
|
|
512
|
+
"columns": {
|
|
513
|
+
"id": {
|
|
514
|
+
"name": "id",
|
|
515
|
+
"type": "text",
|
|
516
|
+
"primaryKey": true,
|
|
517
|
+
"notNull": true,
|
|
518
|
+
"autoincrement": false
|
|
519
|
+
},
|
|
520
|
+
"status": {
|
|
521
|
+
"name": "status",
|
|
522
|
+
"type": "text",
|
|
523
|
+
"primaryKey": false,
|
|
524
|
+
"notNull": true,
|
|
525
|
+
"autoincrement": false,
|
|
526
|
+
"default": "'active'"
|
|
527
|
+
},
|
|
528
|
+
"db_url": {
|
|
529
|
+
"name": "db_url",
|
|
530
|
+
"type": "text",
|
|
531
|
+
"primaryKey": false,
|
|
532
|
+
"notNull": false,
|
|
533
|
+
"autoincrement": false
|
|
534
|
+
},
|
|
535
|
+
"created_at": {
|
|
536
|
+
"name": "created_at",
|
|
537
|
+
"type": "integer",
|
|
538
|
+
"primaryKey": false,
|
|
539
|
+
"notNull": true,
|
|
540
|
+
"autoincrement": false,
|
|
541
|
+
"default": "(unixepoch() * 1000)"
|
|
542
|
+
}
|
|
543
|
+
},
|
|
544
|
+
"indexes": {},
|
|
545
|
+
"foreignKeys": {},
|
|
546
|
+
"compositePrimaryKeys": {},
|
|
547
|
+
"uniqueConstraints": {},
|
|
548
|
+
"checkConstraints": {}
|
|
549
|
+
}
|
|
550
|
+
},
|
|
551
|
+
"views": {},
|
|
552
|
+
"enums": {},
|
|
553
|
+
"_meta": {
|
|
554
|
+
"schemas": {},
|
|
555
|
+
"tables": {},
|
|
556
|
+
"columns": {}
|
|
557
|
+
},
|
|
558
|
+
"internal": {
|
|
559
|
+
"indexes": {}
|
|
560
|
+
}
|
|
561
|
+
}
|
|
@@ -239,9 +239,9 @@ export const projectFile = sqliteTable("project_file", {
|
|
|
239
239
|
uniqueIndex("project_file_origin").on(t.projectId, t.origin, t.originKey),
|
|
240
240
|
]);
|
|
241
241
|
/**
|
|
242
|
-
* The index of
|
|
243
|
-
*
|
|
244
|
-
* (`server.index`). Each unit's text starts with where it stands and its
|
|
242
|
+
* The index of Knowledge: one unit per section of a page, row of a table, file, summary of a
|
|
243
|
+
* category's value, passage of a document read before pages, and passage of a plugin's text
|
|
244
|
+
* (`server.index`). Each unit's text starts with where it stands and its categories. Keywords
|
|
245
245
|
* live in two FTS5 tables, words (`project_chunk_fts`) and trigrams (`project_chunk_tri`), which
|
|
246
246
|
* triggers keep in step (see the migrations); `embedding` is the unit's vector as float32
|
|
247
247
|
* bytes, compared with libSQL's `vector_distance_cos`.
|
|
@@ -389,10 +389,10 @@ export const spacePage = sqliteTable("space_page", {
|
|
|
389
389
|
index("space_page_parent").on(t.parentId, t.position),
|
|
390
390
|
uniqueIndex("space_page_origin").on(t.projectId, t.origin, t.originKey),
|
|
391
391
|
]);
|
|
392
|
-
// ---
|
|
393
|
-
// Typed properties that run across
|
|
392
|
+
// --- Categories -----------------------------------------------------------------
|
|
393
|
+
// Typed properties that run across Knowledge: set on pages, rows, tables and files, any number of
|
|
394
394
|
// each, so a step filters before it searches.
|
|
395
|
-
/** A
|
|
395
|
+
/** A category of the space: a name, a type and, for a choice, the values it has met. */
|
|
396
396
|
export const spaceCategory = sqliteTable("space_category", {
|
|
397
397
|
id: text("id").primaryKey(),
|
|
398
398
|
tenantId: text("tenant_id").notNull(),
|
|
@@ -420,7 +420,7 @@ export const spaceCategory = sqliteTable("space_category", {
|
|
|
420
420
|
createdAt: createdAt(),
|
|
421
421
|
updatedAt: updatedAt(),
|
|
422
422
|
}, (t) => [uniqueIndex("space_category_name").on(t.projectId, t.name)]);
|
|
423
|
-
/** A value of a choice: grows as items arrive; its summary is the
|
|
423
|
+
/** A value of a choice: grows as items arrive; its summary is the summary of its items. */
|
|
424
424
|
export const spaceCategoryValue = sqliteTable("space_category_value", {
|
|
425
425
|
id: text("id").primaryKey(),
|
|
426
426
|
categoryId: text("category_id")
|
|
@@ -428,13 +428,13 @@ export const spaceCategoryValue = sqliteTable("space_category_value", {
|
|
|
428
428
|
.references(() => spaceCategory.id, { onDelete: "cascade" }),
|
|
429
429
|
value: text("value").notNull(),
|
|
430
430
|
position: integer("position").notNull().default(0),
|
|
431
|
-
/** The
|
|
431
|
+
/** The summary: Markdown a model wrote of the value's items, when it last did. */
|
|
432
432
|
summary: text("summary"),
|
|
433
433
|
summaryAt: integer("summary_at", { mode: "timestamp_ms" }),
|
|
434
434
|
createdAt: createdAt(),
|
|
435
435
|
}, (t) => [uniqueIndex("space_category_value_value").on(t.categoryId, t.value)]);
|
|
436
436
|
/**
|
|
437
|
-
* A
|
|
437
|
+
* A category set on an item: exactly one of page, row, table and file. A choice points to its
|
|
438
438
|
* value; the other types keep theirs typed: a date as milliseconds, a number, a short text, yes
|
|
439
439
|
* or no. A choice with several values has a row per value.
|
|
440
440
|
*/
|