wizards 0.1.9
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 +110 -0
- package/README.md +170 -0
- package/apps/runtime/dist/agents/architect.js +453 -0
- package/apps/runtime/dist/agents/project-assistant.js +354 -0
- package/apps/runtime/dist/agents/subscription.js +206 -0
- package/apps/runtime/dist/agents/thought.js +21 -0
- package/apps/runtime/dist/agents/website.js +197 -0
- package/apps/runtime/dist/app.js +153 -0
- package/apps/runtime/dist/auth/account.js +121 -0
- package/apps/runtime/dist/auth/index.js +329 -0
- package/apps/runtime/dist/auth/keys.js +55 -0
- package/apps/runtime/dist/auth/local-ticket.js +23 -0
- package/apps/runtime/dist/authoring/example.js +73 -0
- package/apps/runtime/dist/authoring/guide.js +259 -0
- package/apps/runtime/dist/authoring/ops.js +117 -0
- package/apps/runtime/dist/cli/autostart.js +134 -0
- package/apps/runtime/dist/cli/clients.js +44 -0
- package/apps/runtime/dist/cli/environment.js +81 -0
- package/apps/runtime/dist/cli/exec.js +45 -0
- package/apps/runtime/dist/cli/home.js +74 -0
- package/apps/runtime/dist/cli/machine.js +145 -0
- package/apps/runtime/dist/cli/main.js +125 -0
- package/apps/runtime/dist/cli/setup.js +273 -0
- package/apps/runtime/dist/cli/start.js +190 -0
- package/apps/runtime/dist/cli/status.js +120 -0
- package/apps/runtime/dist/cli/ui.js +12 -0
- package/apps/runtime/dist/cli/update.js +58 -0
- package/apps/runtime/dist/connectors/builtin.js +70 -0
- package/apps/runtime/dist/connectors/external.js +400 -0
- package/apps/runtime/dist/connectors/gmail.js +107 -0
- package/apps/runtime/dist/connectors/imap.js +217 -0
- package/apps/runtime/dist/connectors/index.js +266 -0
- package/apps/runtime/dist/connectors/mail.js +72 -0
- package/apps/runtime/dist/connectors/outlook.js +90 -0
- package/apps/runtime/dist/credits/credits.js +103 -0
- package/apps/runtime/dist/credits/estimate.js +132 -0
- package/apps/runtime/dist/db/adopt.js +149 -0
- package/apps/runtime/dist/db/client.js +146 -0
- package/apps/runtime/dist/db/control-schema.js +70 -0
- package/apps/runtime/dist/db/migrations/control/0000_last_absorbing_man.sql +47 -0
- package/apps/runtime/dist/db/migrations/control/0001_gorgeous_nicolaos.sql +41 -0
- package/apps/runtime/dist/db/migrations/control/0002_secret_penance.sql +1 -0
- package/apps/runtime/dist/db/migrations/control/0003_nasty_mordo.sql +3 -0
- package/apps/runtime/dist/db/migrations/control/0004_breezy_eddie_brock.sql +6 -0
- package/apps/runtime/dist/db/migrations/control/meta/0000_snapshot.json +311 -0
- package/apps/runtime/dist/db/migrations/control/meta/0001_snapshot.json +599 -0
- package/apps/runtime/dist/db/migrations/control/meta/0002_snapshot.json +607 -0
- package/apps/runtime/dist/db/migrations/control/meta/0003_snapshot.json +311 -0
- package/apps/runtime/dist/db/migrations/control/meta/0004_snapshot.json +350 -0
- package/apps/runtime/dist/db/migrations/control/meta/_journal.json +41 -0
- package/apps/runtime/dist/db/migrations/tenant/0000_eminent_freak.sql +188 -0
- package/apps/runtime/dist/db/migrations/tenant/0001_salty_master_chief.sql +1 -0
- package/apps/runtime/dist/db/migrations/tenant/0002_cloudy_firebird.sql +1 -0
- package/apps/runtime/dist/db/migrations/tenant/0003_brown_warbound.sql +52 -0
- package/apps/runtime/dist/db/migrations/tenant/0004_romantic_nocturne.sql +6 -0
- package/apps/runtime/dist/db/migrations/tenant/meta/0000_snapshot.json +1323 -0
- package/apps/runtime/dist/db/migrations/tenant/meta/0001_snapshot.json +1330 -0
- package/apps/runtime/dist/db/migrations/tenant/meta/0002_snapshot.json +1337 -0
- package/apps/runtime/dist/db/migrations/tenant/meta/0003_snapshot.json +1605 -0
- package/apps/runtime/dist/db/migrations/tenant/meta/0004_snapshot.json +1645 -0
- package/apps/runtime/dist/db/migrations/tenant/meta/_journal.json +41 -0
- package/apps/runtime/dist/db/schema.js +278 -0
- package/apps/runtime/dist/documents/parse.js +230 -0
- package/apps/runtime/dist/engenty/connections-external/build-connector.js +193 -0
- package/apps/runtime/dist/engenty/connections-external/errors.js +11 -0
- package/apps/runtime/dist/engenty/connections-external/import-service.js +270 -0
- package/apps/runtime/dist/engenty/connections-external/importer/classify.js +34 -0
- package/apps/runtime/dist/engenty/connections-external/importer/map-auth.js +185 -0
- package/apps/runtime/dist/engenty/connections-external/importer/normalize-mcp.js +63 -0
- package/apps/runtime/dist/engenty/connections-external/importer/normalize-openapi.js +130 -0
- package/apps/runtime/dist/engenty/connections-external/invoke/http-invoker.js +143 -0
- package/apps/runtime/dist/engenty/connections-external/invoke/mcp-client.js +143 -0
- package/apps/runtime/dist/engenty/connections-external/net/guarded-fetch.js +119 -0
- package/apps/runtime/dist/engenty/connections-external/oauth-dcr.js +88 -0
- package/apps/runtime/dist/engenty/connections-external/registry-client.js +336 -0
- package/apps/runtime/dist/engenty/connections-external/registry-source.js +82 -0
- package/apps/runtime/dist/engenty/connections-external/types.js +7 -0
- package/apps/runtime/dist/engenty/connections-github/connector.js +209 -0
- package/apps/runtime/dist/engenty/connections-google/connectors/calendar.js +359 -0
- package/apps/runtime/dist/engenty/connections-google/connectors/contacts.js +94 -0
- package/apps/runtime/dist/engenty/connections-google/connectors/drive.js +290 -0
- package/apps/runtime/dist/engenty/connections-google/connectors/gmail.js +567 -0
- package/apps/runtime/dist/engenty/connections-google/definitions.js +11 -0
- package/apps/runtime/dist/engenty/connections-google/shared.js +73 -0
- package/apps/runtime/dist/engenty/connections-hubspot/connector.js +140 -0
- package/apps/runtime/dist/engenty/connections-microsoft/action.js +17 -0
- package/apps/runtime/dist/engenty/connections-microsoft/graph.js +114 -0
- package/apps/runtime/dist/engenty/connections-microsoft/onedrive.js +286 -0
- package/apps/runtime/dist/engenty/connections-microsoft/outlook.js +464 -0
- package/apps/runtime/dist/engenty/connections-s3/s3.js +328 -0
- package/apps/runtime/dist/engenty/connections-sdk/files-capability.js +86 -0
- package/apps/runtime/dist/engenty/connections-sdk/oauth2.js +150 -0
- package/apps/runtime/dist/engenty/connections-sdk/registry.js +89 -0
- package/apps/runtime/dist/engenty/connections-sdk/storage-capability.js +84 -0
- package/apps/runtime/dist/engenty/connections-sdk/types.js +30 -0
- package/apps/runtime/dist/engenty/connections-slack/connector.js +360 -0
- package/apps/runtime/dist/engenty/csv-import/csv-matrix.js +178 -0
- package/apps/runtime/dist/engenty/csv-import/import-sources.js +87 -0
- package/apps/runtime/dist/engenty/csv-import/parse-csv.js +129 -0
- package/apps/runtime/dist/engenty/csv-import/serialize-csv.js +20 -0
- package/apps/runtime/dist/engenty/csv-import/types.js +1 -0
- package/apps/runtime/dist/engenty/csv-import/xlsx-workbook.js +159 -0
- package/apps/runtime/dist/engenty/doc-converter/interface.js +9 -0
- package/apps/runtime/dist/engenty/doc-converter/page-break.js +92 -0
- package/apps/runtime/dist/engenty/doc-converter/providers/local/index.js +72 -0
- package/apps/runtime/dist/engenty/document-scanner/schemas/classifier.js +30 -0
- package/apps/runtime/dist/engenty/document-scanner/schemas/index.js +4 -0
- package/apps/runtime/dist/engenty/document-scanner/schemas/invoice.js +73 -0
- package/apps/runtime/dist/engenty/document-scanner/schemas/receipt.js +63 -0
- package/apps/runtime/dist/engenty/document-scanner/schemas/shared.js +40 -0
- package/apps/runtime/dist/engenty/search-index/chunks.js +164 -0
- package/apps/runtime/dist/engenty/search-index/contracts.js +9 -0
- package/apps/runtime/dist/engenty/shims/connections-sdk.js +39 -0
- package/apps/runtime/dist/engenty/shims/plugin-sdk.js +1 -0
- package/apps/runtime/dist/engenty/shims/web-ingest.js +3 -0
- package/apps/runtime/dist/engenty/web-ingest/ssrf.js +277 -0
- package/apps/runtime/dist/engine/asks.js +60 -0
- package/apps/runtime/dist/engine/events.js +46 -0
- package/apps/runtime/dist/engine/input.js +170 -0
- package/apps/runtime/dist/engine/prepare.js +51 -0
- package/apps/runtime/dist/engine/requirements.js +124 -0
- package/apps/runtime/dist/engine/resources.js +89 -0
- package/apps/runtime/dist/engine/runner.js +560 -0
- package/apps/runtime/dist/engine/steps.js +598 -0
- package/apps/runtime/dist/engine/template.js +183 -0
- package/apps/runtime/dist/engine/types.js +3 -0
- package/apps/runtime/dist/env.js +224 -0
- package/apps/runtime/dist/files/blobs.js +22 -0
- package/apps/runtime/dist/files/objects.js +86 -0
- package/apps/runtime/dist/files/storage.js +95 -0
- package/apps/runtime/dist/geocode.js +58 -0
- package/apps/runtime/dist/harness/claude.js +138 -0
- package/apps/runtime/dist/harness/codex.js +228 -0
- package/apps/runtime/dist/harness/cursor.js +93 -0
- package/apps/runtime/dist/harness/env.js +124 -0
- package/apps/runtime/dist/harness/gemini.js +126 -0
- package/apps/runtime/dist/harness/index.js +99 -0
- package/apps/runtime/dist/harness/model.js +267 -0
- package/apps/runtime/dist/harness/prompt.js +121 -0
- package/apps/runtime/dist/harness/terminal.js +193 -0
- package/apps/runtime/dist/harness/types.js +7 -0
- package/apps/runtime/dist/index.js +76 -0
- package/apps/runtime/dist/limits.js +57 -0
- package/apps/runtime/dist/link-preview.js +59 -0
- package/apps/runtime/dist/manage.js +151 -0
- package/apps/runtime/dist/mcp/auth.js +102 -0
- package/apps/runtime/dist/mcp/bridge.js +59 -0
- package/apps/runtime/dist/mcp/handler.js +42 -0
- package/apps/runtime/dist/mcp/scopes.js +5 -0
- package/apps/runtime/dist/mcp/tools.js +401 -0
- package/apps/runtime/dist/media/ffmpeg.js +121 -0
- package/apps/runtime/dist/media/generate.js +120 -0
- package/apps/runtime/dist/media/marking.js +121 -0
- package/apps/runtime/dist/media/transcribe.js +30 -0
- package/apps/runtime/dist/model-errors.js +3 -0
- package/apps/runtime/dist/models.js +489 -0
- package/apps/runtime/dist/plugin.js +61 -0
- package/apps/runtime/dist/render/chromium.js +85 -0
- package/apps/runtime/dist/render/convert.js +161 -0
- package/apps/runtime/dist/render/downloads.js +277 -0
- package/apps/runtime/dist/render/guard.js +25 -0
- package/apps/runtime/dist/routes/api.js +74 -0
- package/apps/runtime/dist/routes/delivery.js +52 -0
- package/apps/runtime/dist/routes/internal.js +49 -0
- package/apps/runtime/dist/routes/marketplace.js +36 -0
- package/apps/runtime/dist/routes/runs.js +805 -0
- package/apps/runtime/dist/routes/studio.js +702 -0
- package/apps/runtime/dist/routes/wizard-stream.js +30 -0
- package/apps/runtime/dist/running.js +39 -0
- package/apps/runtime/dist/sandbox/agentos.js +191 -0
- package/apps/runtime/dist/sandbox/docker.js +77 -0
- package/apps/runtime/dist/sandbox/index.js +30 -0
- package/apps/runtime/dist/sandbox/types.js +1 -0
- package/apps/runtime/dist/secrets/crypto.js +28 -0
- package/apps/runtime/dist/secrets/signing.js +34 -0
- package/apps/runtime/dist/secrets/vault.js +59 -0
- package/apps/runtime/dist/services/architect.js +92 -0
- package/apps/runtime/dist/services/brand.js +20 -0
- package/apps/runtime/dist/services/cloud.js +52 -0
- package/apps/runtime/dist/services/draft-events.js +27 -0
- package/apps/runtime/dist/services/errors.js +24 -0
- package/apps/runtime/dist/services/files.js +129 -0
- package/apps/runtime/dist/services/links.js +16 -0
- package/apps/runtime/dist/services/marketplace.js +292 -0
- package/apps/runtime/dist/services/package.js +202 -0
- package/apps/runtime/dist/services/profile.js +23 -0
- package/apps/runtime/dist/services/project-files.js +266 -0
- package/apps/runtime/dist/services/project-index.js +109 -0
- package/apps/runtime/dist/services/projects.js +181 -0
- package/apps/runtime/dist/services/runs.js +224 -0
- package/apps/runtime/dist/services/shares.js +129 -0
- package/apps/runtime/dist/services/widgets.js +34 -0
- package/apps/runtime/dist/services/wizards.js +342 -0
- package/apps/runtime/dist/settings.js +16 -0
- package/apps/runtime/dist/store/index.js +279 -0
- package/apps/runtime/dist/tenants/control.js +106 -0
- package/apps/runtime/dist/tenants/tenant.js +26 -0
- package/apps/runtime/dist/tools/browser.js +380 -0
- package/apps/runtime/dist/tools/connector.js +204 -0
- package/apps/runtime/dist/tools/index.js +234 -0
- package/apps/runtime/dist/tools/mail.js +104 -0
- package/apps/runtime/dist/tools/net-guard.js +59 -0
- package/apps/runtime/dist/tools/project.js +53 -0
- package/apps/runtime/dist/tools/shared.js +42 -0
- package/apps/runtime/dist/tools/store.js +238 -0
- package/apps/runtime/dist/update.js +118 -0
- package/apps/runtime/dist/widgets/bundle.js +99 -0
- package/apps/runtime/dist/widgets/render.js +312 -0
- package/apps/runtime/dist/widgets/runtime.js +84 -0
- package/apps/runtime/dist/widgets/script.js +30 -0
- package/apps/runtime/dist/widgets/step.js +192 -0
- package/apps/web/dist/ai-labels/ai-black.svg +20 -0
- package/apps/web/dist/ai-labels/ai-generated-black.svg +31 -0
- package/apps/web/dist/ai-labels/ai-generated-white.svg +32 -0
- package/apps/web/dist/ai-labels/ai-modified-black.svg +30 -0
- package/apps/web/dist/ai-labels/ai-modified-white.svg +31 -0
- package/apps/web/dist/ai-labels/ai-white.svg +21 -0
- package/apps/web/dist/assets/ChangelogDialog-O00vEnbm.js +1 -0
- package/apps/web/dist/assets/ChatPanel-CH9ry0Hp.js +1 -0
- package/apps/web/dist/assets/CreditsDialog-DRzecwUw.js +1 -0
- package/apps/web/dist/assets/EditorPage-BRnBf02Q.js +2 -0
- package/apps/web/dist/assets/FlowPreview-DDOj8IAH.js +1 -0
- package/apps/web/dist/assets/HomePage-CAGTTG3N.js +1 -0
- package/apps/web/dist/assets/ImportWizard-0RRrAnX3.js +1 -0
- package/apps/web/dist/assets/LocalRuntime-BrP-ENHg.css +1 -0
- package/apps/web/dist/assets/LocalRuntime-C-TBYrzs.js +16 -0
- package/apps/web/dist/assets/NewWizardPage-kI90h3_9.js +2 -0
- package/apps/web/dist/assets/PublicRunner-CKRDeIVd.js +1 -0
- package/apps/web/dist/assets/RunnerView-Rc4H8wYH.js +2 -0
- package/apps/web/dist/assets/SettingsPage-CESMuZxq.js +2 -0
- package/apps/web/dist/assets/SetupPage-D1rrYU14.js +1 -0
- package/apps/web/dist/assets/SharePage-COTAmOgh.js +1 -0
- package/apps/web/dist/assets/api-BY28cjGY.js +10 -0
- package/apps/web/dist/assets/arrow-left-UpjOBfQp.js +1 -0
- package/apps/web/dist/assets/arrow-right-CucQycEy.js +1 -0
- package/apps/web/dist/assets/changelog-p3wsaDDS.js +1 -0
- package/apps/web/dist/assets/check-Bjx41xbB.js +1 -0
- package/apps/web/dist/assets/createLucideIcon-DBu2Ovxj.js +1 -0
- package/apps/web/dist/assets/definition-cy7uvY5L.js +55 -0
- package/apps/web/dist/assets/engenty-CWIFpgKq.js +1 -0
- package/apps/web/dist/assets/esm-D1OEhjTK.js +7 -0
- package/apps/web/dist/assets/external-link-CRg6DVdO.js +1 -0
- package/apps/web/dist/assets/fluffy-engenty-CJ3wCQgT.js +456 -0
- package/apps/web/dist/assets/index-CQ_q9iMO.css +1 -0
- package/apps/web/dist/assets/index-D0gxh90t.js +10 -0
- package/apps/web/dist/assets/jsx-runtime-Dk72oS4N.js +1 -0
- package/apps/web/dist/assets/meta-BbSdtTUa.js +1 -0
- package/apps/web/dist/assets/mic-CeqQ89Dj.js +1 -0
- package/apps/web/dist/assets/oss-credits-cPuZUFHD.js +1 -0
- package/apps/web/dist/assets/outputs-D6pxH6ve.js +69 -0
- package/apps/web/dist/assets/plus-HA210wXA.js +1 -0
- package/apps/web/dist/assets/preload-helper-CNEI7N0N.js +1 -0
- package/apps/web/dist/assets/qr-scanner-worker.min-CJaXo3yu.js +98 -0
- package/apps/web/dist/assets/qr-scanner.min-C_UI0gH-.js +1 -0
- package/apps/web/dist/assets/type-BzYgVWKL.js +1 -0
- package/apps/web/dist/assets/ui-Ddwl35A6.js +1 -0
- package/apps/web/dist/assets/upload-DsgLfQ3U.js +1 -0
- package/apps/web/dist/assets/video-Dk1fuTDl.js +1 -0
- package/apps/web/dist/assets/wand-sparkles-Bf97fs8T.js +1 -0
- package/apps/web/dist/embed.js +102 -0
- package/apps/web/dist/favicon.svg +1 -0
- package/apps/web/dist/icons/apple-touch-icon.png +0 -0
- package/apps/web/dist/icons/icon-192.png +0 -0
- package/apps/web/dist/icons/icon-512.png +0 -0
- package/apps/web/dist/icons/icon-maskable-512.png +0 -0
- package/apps/web/dist/index.html +46 -0
- package/apps/web/dist/install.sh +532 -0
- package/apps/web/dist/manifest.webmanifest +20 -0
- package/apps/web/dist/sw.js +15 -0
- package/bin/wizards.mjs +13 -0
- package/node_modules/@engenty-wizards/shared/dist/connectors.d.ts +77 -0
- package/node_modules/@engenty-wizards/shared/dist/connectors.js +2 -0
- package/node_modules/@engenty-wizards/shared/dist/definition.d.ts +1415 -0
- package/node_modules/@engenty-wizards/shared/dist/definition.js +762 -0
- package/node_modules/@engenty-wizards/shared/dist/engenty/data-tables/columns-format.d.ts +5 -0
- package/node_modules/@engenty-wizards/shared/dist/engenty/data-tables/columns-format.js +132 -0
- package/node_modules/@engenty-wizards/shared/dist/engenty/data-tables/columns-value.d.ts +11 -0
- package/node_modules/@engenty-wizards/shared/dist/engenty/data-tables/columns-value.js +209 -0
- package/node_modules/@engenty-wizards/shared/dist/engenty/data-tables/columns.d.ts +532 -0
- package/node_modules/@engenty-wizards/shared/dist/engenty/data-tables/columns.js +216 -0
- package/node_modules/@engenty-wizards/shared/dist/engenty/data-tables/index.d.ts +3 -0
- package/node_modules/@engenty-wizards/shared/dist/engenty/data-tables/index.js +3 -0
- package/node_modules/@engenty-wizards/shared/dist/engenty/search-index/catalog-lexical.d.ts +14 -0
- package/node_modules/@engenty-wizards/shared/dist/engenty/search-index/catalog-lexical.js +166 -0
- package/node_modules/@engenty-wizards/shared/dist/engenty/search-index/catalog-rank.d.ts +33 -0
- package/node_modules/@engenty-wizards/shared/dist/engenty/search-index/catalog-rank.js +99 -0
- package/node_modules/@engenty-wizards/shared/dist/marketplace-entry.d.ts +35 -0
- package/node_modules/@engenty-wizards/shared/dist/marketplace-entry.js +86 -0
- package/node_modules/@engenty-wizards/shared/dist/marketplace-search.d.ts +20 -0
- package/node_modules/@engenty-wizards/shared/dist/marketplace-search.js +133 -0
- package/node_modules/@engenty-wizards/shared/dist/marketplace.d.ts +298 -0
- package/node_modules/@engenty-wizards/shared/dist/marketplace.js +211 -0
- package/node_modules/@engenty-wizards/shared/dist/merge.d.ts +7 -0
- package/node_modules/@engenty-wizards/shared/dist/merge.js +40 -0
- package/node_modules/@engenty-wizards/shared/dist/projects.d.ts +74 -0
- package/node_modules/@engenty-wizards/shared/dist/projects.js +96 -0
- package/node_modules/@engenty-wizards/shared/dist/run.d.ts +219 -0
- package/node_modules/@engenty-wizards/shared/dist/run.js +1 -0
- package/node_modules/@engenty-wizards/shared/dist/store.d.ts +100 -0
- package/node_modules/@engenty-wizards/shared/dist/store.js +44 -0
- package/node_modules/@engenty-wizards/shared/dist/workspace.d.ts +16 -0
- package/node_modules/@engenty-wizards/shared/dist/workspace.js +51 -0
- package/node_modules/@engenty-wizards/shared/package.json +10 -0
- package/package.json +62 -0
- package/plugin/.claude-plugin/plugin.json +9 -0
- package/plugin/.mcp.json +8 -0
- package/plugin/commands/wizard.md +8 -0
- package/plugin/skills/build-wizard/SKILL.md +27 -0
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
export declare const FACT_TYPES: readonly ["text", "longtext", "number", "date", "url", "email", "phone", "boolean"];
|
|
2
|
+
export type FactType = (typeof FACT_TYPES)[number];
|
|
3
|
+
export interface ProjectFact {
|
|
4
|
+
/** How templates name it: `{{facts.<key>}}`. Made from the label, stable afterwards. */
|
|
5
|
+
key: string;
|
|
6
|
+
label: string;
|
|
7
|
+
value: string;
|
|
8
|
+
/** Only when chosen by hand; otherwise the type is read off the value. */
|
|
9
|
+
type?: FactType;
|
|
10
|
+
}
|
|
11
|
+
/** The type a value looks like. A value that looks like nothing in particular is text. */
|
|
12
|
+
export declare function detectFactType(value: string): FactType;
|
|
13
|
+
export declare function factType(fact: Pick<ProjectFact, "value" | "type">): FactType;
|
|
14
|
+
/** A fact's key from its label: lower case, a-z 0-9 and _, unique among `taken`. */
|
|
15
|
+
export declare function factKey(label: string, taken?: string[]): string;
|
|
16
|
+
/** Facts most projects have; offered as empty rows to fill in. */
|
|
17
|
+
export declare const BASIC_FACTS: {
|
|
18
|
+
key: string;
|
|
19
|
+
de: string;
|
|
20
|
+
en: string;
|
|
21
|
+
}[];
|
|
22
|
+
export interface BrandColor {
|
|
23
|
+
/** What the colour is for and how to use it, in the admin's words: "Primär – Buttons und Überschriften". */
|
|
24
|
+
name: string;
|
|
25
|
+
/** #rrggbb */
|
|
26
|
+
value: string;
|
|
27
|
+
}
|
|
28
|
+
export declare const PROJECT_FILE_KINDS: readonly ["logo", "asset", "document"];
|
|
29
|
+
export type ProjectFileKind = (typeof PROJECT_FILE_KINDS)[number];
|
|
30
|
+
/** `pending`: being read, described and indexed. */
|
|
31
|
+
export type ProjectFileStatus = "pending" | "ready" | "failed";
|
|
32
|
+
export interface ProjectFileView {
|
|
33
|
+
id: string;
|
|
34
|
+
kind: ProjectFileKind;
|
|
35
|
+
name: string;
|
|
36
|
+
mime: string;
|
|
37
|
+
size: number;
|
|
38
|
+
description: string;
|
|
39
|
+
/** A web address the file was fetched from, when it was not uploaded. */
|
|
40
|
+
source: string | null;
|
|
41
|
+
status: ProjectFileStatus;
|
|
42
|
+
error: string | null;
|
|
43
|
+
/** Documents: what the index holds of it. `embeddings` includes the keywords. */
|
|
44
|
+
indexed: "embeddings" | "keywords" | null;
|
|
45
|
+
pages: number | null;
|
|
46
|
+
chars: number | null;
|
|
47
|
+
createdAt: string;
|
|
48
|
+
}
|
|
49
|
+
export declare const PROJECT_LIMITS: {
|
|
50
|
+
readonly facts: 100;
|
|
51
|
+
readonly colors: 12;
|
|
52
|
+
readonly files: {
|
|
53
|
+
readonly logo: 8;
|
|
54
|
+
readonly asset: 100;
|
|
55
|
+
readonly document: 50;
|
|
56
|
+
};
|
|
57
|
+
readonly bytes: {
|
|
58
|
+
readonly logo: 5000000;
|
|
59
|
+
readonly asset: 15000000;
|
|
60
|
+
readonly video: 80000000;
|
|
61
|
+
readonly document: 30000000;
|
|
62
|
+
};
|
|
63
|
+
};
|
|
64
|
+
/** The largest file of a kind and type a project takes. */
|
|
65
|
+
export declare function projectFileLimit(kind: ProjectFileKind, mime: string): number;
|
|
66
|
+
/** One passage the document index found for a question. */
|
|
67
|
+
export interface ProjectSearchHit {
|
|
68
|
+
fileId: string;
|
|
69
|
+
name: string;
|
|
70
|
+
/** The passage's place in its document, from 0. */
|
|
71
|
+
index: number;
|
|
72
|
+
text: string;
|
|
73
|
+
score: number;
|
|
74
|
+
}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
// --- facts ---------------------------------------------------------------------
|
|
2
|
+
// What a project knows about itself as label and value: an address, a VAT id, anything. Every
|
|
3
|
+
// step of the project's wizards can read them.
|
|
4
|
+
export const FACT_TYPES = [
|
|
5
|
+
"text",
|
|
6
|
+
"longtext",
|
|
7
|
+
"number",
|
|
8
|
+
"date",
|
|
9
|
+
"url",
|
|
10
|
+
"email",
|
|
11
|
+
"phone",
|
|
12
|
+
"boolean",
|
|
13
|
+
];
|
|
14
|
+
const DATE_RE = /^(\d{4}-\d{2}-\d{2}|\d{1,2}\.\s?\d{1,2}\.\s?\d{4})$/;
|
|
15
|
+
const NUMBER_RE = /^[+-]?\d{1,3}([.,\s']?\d{3})*([.,]\d+)?$/;
|
|
16
|
+
const EMAIL_RE = /^[^\s@]+@[^\s@]+\.[^\s@]{2,}$/;
|
|
17
|
+
const URL_RE = /^(https?:\/\/|www\.)\S+$/i;
|
|
18
|
+
const PHONE_RE = /^\+?[\d\s()/.-]{7,20}$/;
|
|
19
|
+
const BOOLEAN_RE = /^(ja|nein|yes|no|true|false)$/i;
|
|
20
|
+
/** The type a value looks like. A value that looks like nothing in particular is text. */
|
|
21
|
+
export function detectFactType(value) {
|
|
22
|
+
const v = value.trim();
|
|
23
|
+
if (!v) {
|
|
24
|
+
return "text";
|
|
25
|
+
}
|
|
26
|
+
if (v.includes("\n") || v.length > 140) {
|
|
27
|
+
return "longtext";
|
|
28
|
+
}
|
|
29
|
+
if (BOOLEAN_RE.test(v)) {
|
|
30
|
+
return "boolean";
|
|
31
|
+
}
|
|
32
|
+
if (EMAIL_RE.test(v)) {
|
|
33
|
+
return "email";
|
|
34
|
+
}
|
|
35
|
+
if (URL_RE.test(v)) {
|
|
36
|
+
return "url";
|
|
37
|
+
}
|
|
38
|
+
if (DATE_RE.test(v)) {
|
|
39
|
+
return "date";
|
|
40
|
+
}
|
|
41
|
+
// A postcode or a count is a number; a phone number starts with + or 0 and is longer.
|
|
42
|
+
if (NUMBER_RE.test(v) && !/^(\+|0\d)/.test(v)) {
|
|
43
|
+
return "number";
|
|
44
|
+
}
|
|
45
|
+
if (PHONE_RE.test(v) && v.replace(/\D/g, "").length >= 7) {
|
|
46
|
+
return "phone";
|
|
47
|
+
}
|
|
48
|
+
return "text";
|
|
49
|
+
}
|
|
50
|
+
export function factType(fact) {
|
|
51
|
+
return fact.type ?? detectFactType(fact.value);
|
|
52
|
+
}
|
|
53
|
+
/** A fact's key from its label: lower case, a-z 0-9 and _, unique among `taken`. */
|
|
54
|
+
export function factKey(label, taken = []) {
|
|
55
|
+
const base = label
|
|
56
|
+
.toLowerCase()
|
|
57
|
+
.replace(/ä/g, "ae")
|
|
58
|
+
.replace(/ö/g, "oe")
|
|
59
|
+
.replace(/ü/g, "ue")
|
|
60
|
+
.replace(/ß/g, "ss")
|
|
61
|
+
.normalize("NFD")
|
|
62
|
+
.replace(/[^a-z0-9]+/g, "_")
|
|
63
|
+
.replace(/^_+|_+$/g, "")
|
|
64
|
+
.slice(0, 40) || "fakt";
|
|
65
|
+
let key = base;
|
|
66
|
+
for (let i = 2; taken.includes(key); i++) {
|
|
67
|
+
key = `${base}_${i}`;
|
|
68
|
+
}
|
|
69
|
+
return key;
|
|
70
|
+
}
|
|
71
|
+
/** Facts most projects have; offered as empty rows to fill in. */
|
|
72
|
+
export const BASIC_FACTS = [
|
|
73
|
+
{ key: "adresse", de: "Adresse", en: "Address" },
|
|
74
|
+
{ key: "plz", de: "PLZ", en: "Postcode" },
|
|
75
|
+
{ key: "ort", de: "Ort", en: "City" },
|
|
76
|
+
{ key: "uid", de: "UID", en: "VAT id" },
|
|
77
|
+
{ key: "telefon", de: "Telefon", en: "Phone" },
|
|
78
|
+
{ key: "e_mail", de: "E-Mail", en: "Email" },
|
|
79
|
+
{ key: "website", de: "Website", en: "Website" },
|
|
80
|
+
{ key: "iban", de: "IBAN", en: "IBAN" },
|
|
81
|
+
];
|
|
82
|
+
// --- files -----------------------------------------------------------------------
|
|
83
|
+
export const PROJECT_FILE_KINDS = ["logo", "asset", "document"];
|
|
84
|
+
export const PROJECT_LIMITS = {
|
|
85
|
+
facts: 100,
|
|
86
|
+
colors: 12,
|
|
87
|
+
files: { logo: 8, asset: 100, document: 50 },
|
|
88
|
+
bytes: { logo: 5_000_000, asset: 15_000_000, video: 80_000_000, document: 30_000_000 },
|
|
89
|
+
};
|
|
90
|
+
/** The largest file of a kind and type a project takes. */
|
|
91
|
+
export function projectFileLimit(kind, mime) {
|
|
92
|
+
if (kind === "asset" && mime.startsWith("video/")) {
|
|
93
|
+
return PROJECT_LIMITS.bytes.video;
|
|
94
|
+
}
|
|
95
|
+
return PROJECT_LIMITS.bytes[kind];
|
|
96
|
+
}
|
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
import type { Format, ModelClass, Step, WizardDefinition } from "./definition.js";
|
|
2
|
+
import type { ConnectionView, ListDef, ListRow } from "./store.js";
|
|
3
|
+
export type RunStatus = "waiting_input" | "running" | "done" | "failed" | "cancelled";
|
|
4
|
+
export interface AssetRef {
|
|
5
|
+
id: string;
|
|
6
|
+
/** image | video | html | text | json */
|
|
7
|
+
kind: string;
|
|
8
|
+
mime: string;
|
|
9
|
+
name: string;
|
|
10
|
+
/**
|
|
11
|
+
* Media a model made ("generated") or changed ("edited"). Shown with a label wherever it is
|
|
12
|
+
* displayed; the file itself carries the marking in its metadata (EU AI Act, Art. 50).
|
|
13
|
+
*/
|
|
14
|
+
ai?: "generated" | "edited";
|
|
15
|
+
}
|
|
16
|
+
export interface StepOutput {
|
|
17
|
+
text?: string;
|
|
18
|
+
json?: unknown;
|
|
19
|
+
assets?: AssetRef[];
|
|
20
|
+
/** Widgets: what loading it with this run's data showed. */
|
|
21
|
+
widget?: {
|
|
22
|
+
/** Seconds of animation the widget registered for video export; null = a still widget. */
|
|
23
|
+
duration: number | null;
|
|
24
|
+
errors: string[];
|
|
25
|
+
};
|
|
26
|
+
at: string;
|
|
27
|
+
}
|
|
28
|
+
export interface RunState {
|
|
29
|
+
values: Record<string, unknown>;
|
|
30
|
+
outputs: Record<string, StepOutput>;
|
|
31
|
+
/** Interactive steps answered, oldest first — "back" pops this. */
|
|
32
|
+
history: string[];
|
|
33
|
+
/** Regenerate notes per step. */
|
|
34
|
+
notes: Record<string, string>;
|
|
35
|
+
/** Steps that make several results: the entries (from 0) to make again; the others stay. */
|
|
36
|
+
redo?: Record<string, number[]>;
|
|
37
|
+
}
|
|
38
|
+
interface AskBase {
|
|
39
|
+
id: string;
|
|
40
|
+
stepId: string;
|
|
41
|
+
/** Why the wizard asks, in the person's language. */
|
|
42
|
+
reason: string;
|
|
43
|
+
at: string;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* A running step asks the person to sign in on a page the wizard's browser has open. What the
|
|
47
|
+
* person types goes into that page; the model never sees it.
|
|
48
|
+
*/
|
|
49
|
+
export interface LoginAsk extends AskBase {
|
|
50
|
+
kind: "login";
|
|
51
|
+
site: {
|
|
52
|
+
host: string;
|
|
53
|
+
title: string;
|
|
54
|
+
};
|
|
55
|
+
/** Inputs found on the page, to fill here instead of clicking into the picture. */
|
|
56
|
+
fields: {
|
|
57
|
+
id: string;
|
|
58
|
+
label: string;
|
|
59
|
+
secret: boolean;
|
|
60
|
+
}[];
|
|
61
|
+
}
|
|
62
|
+
/** A running step wants to change something in one of the person's accounts and asks first. */
|
|
63
|
+
export interface ConfirmAsk extends AskBase {
|
|
64
|
+
kind: "confirm";
|
|
65
|
+
/** The connected service, e.g. "Notion". */
|
|
66
|
+
service: string;
|
|
67
|
+
action: {
|
|
68
|
+
id: string;
|
|
69
|
+
summary: string;
|
|
70
|
+
destructive: boolean;
|
|
71
|
+
};
|
|
72
|
+
/** What would be sent, as readable JSON. */
|
|
73
|
+
input: string;
|
|
74
|
+
}
|
|
75
|
+
/** What a running step asks the person; the step waits for the answer. */
|
|
76
|
+
export type RunAsk = LoginAsk | ConfirmAsk;
|
|
77
|
+
/** A question as a step puts it; the runner adds id, step and time. */
|
|
78
|
+
export type AskInput = Omit<LoginAsk, "id" | "stepId" | "at"> | Omit<ConfirmAsk, "id" | "stepId" | "at">;
|
|
79
|
+
/**
|
|
80
|
+
* `fill` and `done` answer a sign-in (remember = keep the sign-in); `done` also allows a change
|
|
81
|
+
* (remember = allow that action for the rest of the run); `skip` declines either.
|
|
82
|
+
*/
|
|
83
|
+
export type AskAnswer = {
|
|
84
|
+
type: "fill";
|
|
85
|
+
values: Record<string, string>;
|
|
86
|
+
remember?: boolean;
|
|
87
|
+
} | {
|
|
88
|
+
type: "done";
|
|
89
|
+
remember?: boolean;
|
|
90
|
+
} | {
|
|
91
|
+
type: "skip";
|
|
92
|
+
};
|
|
93
|
+
/** One thing the person does in the wizard's browser while it waits for them. */
|
|
94
|
+
export type BrowserAct = {
|
|
95
|
+
type: "click";
|
|
96
|
+
x: number;
|
|
97
|
+
y: number;
|
|
98
|
+
} | {
|
|
99
|
+
type: "type";
|
|
100
|
+
text: string;
|
|
101
|
+
} | {
|
|
102
|
+
type: "key";
|
|
103
|
+
key: "Enter" | "Tab" | "Backspace" | "Escape";
|
|
104
|
+
} | {
|
|
105
|
+
type: "scroll";
|
|
106
|
+
dy: number;
|
|
107
|
+
};
|
|
108
|
+
/** A stored list the current step shows. */
|
|
109
|
+
export interface ShownList {
|
|
110
|
+
def: ListDef;
|
|
111
|
+
rows: ListRow[];
|
|
112
|
+
formats: Format[];
|
|
113
|
+
label: string | null;
|
|
114
|
+
}
|
|
115
|
+
export interface RunEvent {
|
|
116
|
+
id: number;
|
|
117
|
+
at: string;
|
|
118
|
+
stepId: string | null;
|
|
119
|
+
type: "step_started" | "step_done" | "tool" | "info" | "error";
|
|
120
|
+
message: string;
|
|
121
|
+
/** A picture of the run this is about (a photo being looked at, an image just made). */
|
|
122
|
+
asset?: string | null;
|
|
123
|
+
}
|
|
124
|
+
export interface RunView {
|
|
125
|
+
id: string;
|
|
126
|
+
status: RunStatus;
|
|
127
|
+
mode: "test" | "live";
|
|
128
|
+
wizard: Pick<WizardDefinition, "title" | "description" | "avatar" | "intro">;
|
|
129
|
+
/** The step the person is on (interactive) or the one running. */
|
|
130
|
+
step: Step | null;
|
|
131
|
+
values: Record<string, unknown>;
|
|
132
|
+
/** What fields of the current page start with, from earlier steps (`prefill`). */
|
|
133
|
+
prefill: Record<string, unknown>;
|
|
134
|
+
outputs: Record<string, StepOutput>;
|
|
135
|
+
/** Steps whose outputs the current step shows, with their definitions. */
|
|
136
|
+
shown: {
|
|
137
|
+
step: Step;
|
|
138
|
+
output: StepOutput | null;
|
|
139
|
+
formats: Format[];
|
|
140
|
+
label: string | null;
|
|
141
|
+
}[];
|
|
142
|
+
progress: {
|
|
143
|
+
done: number;
|
|
144
|
+
total: number;
|
|
145
|
+
};
|
|
146
|
+
canBack: boolean;
|
|
147
|
+
error: string | null;
|
|
148
|
+
events: RunEvent[];
|
|
149
|
+
brand: BrandView;
|
|
150
|
+
/** What the running step asks the person right now. */
|
|
151
|
+
ask: RunAsk | null;
|
|
152
|
+
/** Stored lists the current step shows (a page's list fields, a review, the result). */
|
|
153
|
+
lists: ShownList[];
|
|
154
|
+
/** The wizard's connections with what the person has connected. */
|
|
155
|
+
connections: ConnectionView[];
|
|
156
|
+
/** The wizard keeps things for the person between runs (lists, files, accounts). */
|
|
157
|
+
keeps: boolean;
|
|
158
|
+
/** Set once the result is shared. */
|
|
159
|
+
shareUrl: string | null;
|
|
160
|
+
/** When the run and its shared link are deleted; null = kept. */
|
|
161
|
+
expiresAt: string | null;
|
|
162
|
+
}
|
|
163
|
+
/** A shared result: what `/s/<token>` shows. Never the person's answers. */
|
|
164
|
+
export interface ShareView {
|
|
165
|
+
token: string;
|
|
166
|
+
title: string;
|
|
167
|
+
message: string | null;
|
|
168
|
+
wizard: Pick<WizardDefinition, "title" | "description" | "avatar">;
|
|
169
|
+
brand: BrandView;
|
|
170
|
+
shown: RunView["shown"];
|
|
171
|
+
createdAt: string;
|
|
172
|
+
expiresAt: string | null;
|
|
173
|
+
/** The wizard's public link, to make your own — when it is published and open. */
|
|
174
|
+
wizardUrl: string | null;
|
|
175
|
+
}
|
|
176
|
+
export interface BrandView {
|
|
177
|
+
name: string;
|
|
178
|
+
accent: string | null;
|
|
179
|
+
logoUrl: string | null;
|
|
180
|
+
}
|
|
181
|
+
export interface PublicWizard {
|
|
182
|
+
token: string;
|
|
183
|
+
title: string;
|
|
184
|
+
description: string;
|
|
185
|
+
avatar: string;
|
|
186
|
+
intro: string | null;
|
|
187
|
+
brand: BrandView;
|
|
188
|
+
turnstileSiteKey: string | null;
|
|
189
|
+
available: boolean;
|
|
190
|
+
unavailableReason: string | null;
|
|
191
|
+
}
|
|
192
|
+
/** What a step is expected to cost, in credits. `high` is the 90th percentile once measured. */
|
|
193
|
+
export interface StepEstimate {
|
|
194
|
+
credits: number;
|
|
195
|
+
high: number;
|
|
196
|
+
/** From at least five runs of this version; otherwise from a formula. */
|
|
197
|
+
measured: boolean;
|
|
198
|
+
}
|
|
199
|
+
/** What a run is expected to cost. `available` is false where no credits are involved. */
|
|
200
|
+
/** A model class a wizard needs that this runtime cannot serve, with the steps that call it. */
|
|
201
|
+
export interface MissingModel {
|
|
202
|
+
cls: ModelClass;
|
|
203
|
+
/** Why the class cannot run, as the person reads it. */
|
|
204
|
+
problem: string;
|
|
205
|
+
steps: {
|
|
206
|
+
id: string;
|
|
207
|
+
title: string;
|
|
208
|
+
}[];
|
|
209
|
+
/** A step that needs it lies on every path: the run cannot start. */
|
|
210
|
+
blocking: boolean;
|
|
211
|
+
}
|
|
212
|
+
export interface RunEstimate {
|
|
213
|
+
available: boolean;
|
|
214
|
+
credits: number;
|
|
215
|
+
/** Credits held when a run starts. */
|
|
216
|
+
reserve: number;
|
|
217
|
+
steps: Record<string, StepEstimate>;
|
|
218
|
+
}
|
|
219
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { type TableColumn } from "./engenty/data-tables/index.js";
|
|
2
|
+
/**
|
|
3
|
+
* What a wizard keeps between runs for one person: lists (tabular data), files and connected
|
|
4
|
+
* accounts. The wizard definition says which lists and connections exist; the content belongs
|
|
5
|
+
* to the person who ran it.
|
|
6
|
+
*/
|
|
7
|
+
/** A list is an engenty data table: typed columns, rows of cells keyed by column id. */
|
|
8
|
+
export interface ListDef {
|
|
9
|
+
id: string;
|
|
10
|
+
title: string;
|
|
11
|
+
description?: string;
|
|
12
|
+
columns: TableColumn[];
|
|
13
|
+
/** Column whose value identifies a row: saving a row with a known key updates it. */
|
|
14
|
+
key?: string;
|
|
15
|
+
/**
|
|
16
|
+
* The rows are gone through one by one in a review: `file` holds the path of a kept file
|
|
17
|
+
* shown beside the row, `status` is a select whose options are the answers (first = open).
|
|
18
|
+
*/
|
|
19
|
+
check?: {
|
|
20
|
+
file?: string;
|
|
21
|
+
status?: string;
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
export interface ListRow {
|
|
25
|
+
id: string;
|
|
26
|
+
cells: Record<string, unknown>;
|
|
27
|
+
updatedAt: string;
|
|
28
|
+
}
|
|
29
|
+
export interface StoreFile {
|
|
30
|
+
path: string;
|
|
31
|
+
mime: string;
|
|
32
|
+
size: number;
|
|
33
|
+
/** Where the file came from, in words: "E-Mail von billing@notion.so, 3.9.2026". */
|
|
34
|
+
source: string | null;
|
|
35
|
+
updatedAt: string;
|
|
36
|
+
}
|
|
37
|
+
export declare const STORE_LIMITS: {
|
|
38
|
+
fileBytes: number;
|
|
39
|
+
totalBytes: number;
|
|
40
|
+
files: number;
|
|
41
|
+
rowsPerList: number;
|
|
42
|
+
};
|
|
43
|
+
/** Kinds of accounts a wizard can ask the person to connect. */
|
|
44
|
+
export declare const CONNECTION_KINDS: readonly ["mail"];
|
|
45
|
+
export type ConnectionKind = (typeof CONNECTION_KINDS)[number];
|
|
46
|
+
/** An account the person connects: a built-in kind, or one of the project's imported connectors. */
|
|
47
|
+
export interface ConnectionDef {
|
|
48
|
+
id: string;
|
|
49
|
+
kind?: ConnectionKind;
|
|
50
|
+
/** Id of an imported connector of the project. */
|
|
51
|
+
connector?: string;
|
|
52
|
+
/** Imported connectors: the actions steps may call. Default: every action that only reads. */
|
|
53
|
+
actions?: string[];
|
|
54
|
+
/**
|
|
55
|
+
* Imported connectors: per action, run it without asking ("allow") or ask the person first
|
|
56
|
+
* ("ask"). Default: reading is allowed, changing asks; deleting always asks.
|
|
57
|
+
*/
|
|
58
|
+
policy?: Record<string, "allow" | "ask">;
|
|
59
|
+
title?: string;
|
|
60
|
+
description?: string;
|
|
61
|
+
}
|
|
62
|
+
/** A connector the person can pick for a connection: an OAuth sign-in or a credentials form. */
|
|
63
|
+
export interface ConnectorOption {
|
|
64
|
+
id: string;
|
|
65
|
+
name: string;
|
|
66
|
+
auth: "oauth2" | "api_key";
|
|
67
|
+
/** `api_key` connectors: the form, in order. */
|
|
68
|
+
fields?: {
|
|
69
|
+
key: string;
|
|
70
|
+
label: string;
|
|
71
|
+
secret?: boolean;
|
|
72
|
+
placeholder?: string;
|
|
73
|
+
required?: boolean;
|
|
74
|
+
}[];
|
|
75
|
+
/** Shown under the form: where to get the values. */
|
|
76
|
+
hint?: string;
|
|
77
|
+
}
|
|
78
|
+
export interface ConnectionView {
|
|
79
|
+
id: string;
|
|
80
|
+
kind: ConnectionKind | null;
|
|
81
|
+
/** The imported connector behind the connection, if it is one. */
|
|
82
|
+
connector: string | null;
|
|
83
|
+
title: string | null;
|
|
84
|
+
description: string | null;
|
|
85
|
+
/** Set when the person has connected an account. */
|
|
86
|
+
account: {
|
|
87
|
+
connector: string;
|
|
88
|
+
label: string;
|
|
89
|
+
connectedAt: string;
|
|
90
|
+
} | null;
|
|
91
|
+
connectors: ConnectorOption[];
|
|
92
|
+
}
|
|
93
|
+
/** One list as a Markdown table of raw cell values — what a model reads. */
|
|
94
|
+
export declare function listAsMarkdown(def: ListDef, rows: ListRow[], limit?: number): string;
|
|
95
|
+
/** The key a row is matched on: trimmed and lower-cased, so "Notion " and "notion" are one row. */
|
|
96
|
+
export declare function rowKey(def: ListDef, cells: Record<string, unknown>): string | null;
|
|
97
|
+
/** A new row's cells, typed by the list's columns. Throws `TableColumnValueError` on a bad value. */
|
|
98
|
+
export declare function newCells(def: ListDef, input: Record<string, unknown>): Record<string, unknown>;
|
|
99
|
+
/** An existing row's cells with some columns changed; cells of columns the list no longer has are dropped. */
|
|
100
|
+
export declare function patchCells(def: ListDef, current: Record<string, unknown>, patch: Record<string, unknown>): Record<string, unknown>;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { coerceRowValues, mergeRowValues } from "./engenty/data-tables/index.js";
|
|
2
|
+
export const STORE_LIMITS = {
|
|
3
|
+
fileBytes: 15_000_000,
|
|
4
|
+
totalBytes: 200_000_000,
|
|
5
|
+
files: 2000,
|
|
6
|
+
rowsPerList: 5000,
|
|
7
|
+
};
|
|
8
|
+
/** Kinds of accounts a wizard can ask the person to connect. */
|
|
9
|
+
export const CONNECTION_KINDS = ["mail"];
|
|
10
|
+
/** One list as a Markdown table of raw cell values — what a model reads. */
|
|
11
|
+
export function listAsMarkdown(def, rows, limit = 200) {
|
|
12
|
+
if (!rows.length) {
|
|
13
|
+
return "(empty)";
|
|
14
|
+
}
|
|
15
|
+
const cols = def.columns;
|
|
16
|
+
const cell = (v) => v === null || v === undefined
|
|
17
|
+
? ""
|
|
18
|
+
: (Array.isArray(v) ? v.join(", ") : String(v)).replace(/\|/g, "\\|").replace(/\s+/g, " ");
|
|
19
|
+
const head = `| ${cols.map((c) => c.id).join(" | ")} |\n|${cols.map(() => " --- ").join("|")}|`;
|
|
20
|
+
const body = rows
|
|
21
|
+
.slice(0, limit)
|
|
22
|
+
.map((r) => `| ${cols.map((c) => cell(r.cells[c.id])).join(" | ")} |`);
|
|
23
|
+
const more = rows.length > limit ? [`… ${rows.length - limit} more rows`] : [];
|
|
24
|
+
return [head, ...body, ...more].join("\n");
|
|
25
|
+
}
|
|
26
|
+
/** The key a row is matched on: trimmed and lower-cased, so "Notion " and "notion" are one row. */
|
|
27
|
+
export function rowKey(def, cells) {
|
|
28
|
+
if (!def.key) {
|
|
29
|
+
return null;
|
|
30
|
+
}
|
|
31
|
+
const raw = cells[def.key];
|
|
32
|
+
const key = raw === null || raw === undefined ? "" : String(raw).trim().toLowerCase();
|
|
33
|
+
return key || null;
|
|
34
|
+
}
|
|
35
|
+
/** A new row's cells, typed by the list's columns. Throws `TableColumnValueError` on a bad value. */
|
|
36
|
+
export function newCells(def, input) {
|
|
37
|
+
return coerceRowValues(def.columns, input);
|
|
38
|
+
}
|
|
39
|
+
/** An existing row's cells with some columns changed; cells of columns the list no longer has are dropped. */
|
|
40
|
+
export function patchCells(def, current, patch) {
|
|
41
|
+
const known = new Set(def.columns.map((c) => c.id));
|
|
42
|
+
const kept = Object.fromEntries(Object.entries(current).filter(([id]) => known.has(id)));
|
|
43
|
+
return mergeRowValues(def.columns, kept, patch);
|
|
44
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/** A file in a wizard's workspace. The content lives in the blob store under its hash. */
|
|
2
|
+
export interface WorkspaceFile {
|
|
3
|
+
path: string;
|
|
4
|
+
hash: string;
|
|
5
|
+
mime: string;
|
|
6
|
+
size: number;
|
|
7
|
+
}
|
|
8
|
+
export declare const WORKSPACE_LIMITS: {
|
|
9
|
+
fileBytes: number;
|
|
10
|
+
totalBytes: number;
|
|
11
|
+
files: number;
|
|
12
|
+
};
|
|
13
|
+
/** Relative, forward slashes, no `..`, no hidden files. Returns the normalised path or null. */
|
|
14
|
+
export declare function cleanPath(raw: string): string | null;
|
|
15
|
+
export declare function mimeForPath(path: string): string;
|
|
16
|
+
export declare function isTextMime(mime: string): boolean;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
export const WORKSPACE_LIMITS = {
|
|
2
|
+
fileBytes: 5_000_000,
|
|
3
|
+
totalBytes: 25_000_000,
|
|
4
|
+
files: 200,
|
|
5
|
+
};
|
|
6
|
+
const PATH_RE = /^[A-Za-z0-9_-][A-Za-z0-9_.-]*(\/[A-Za-z0-9_-][A-Za-z0-9_.-]*)*$/;
|
|
7
|
+
/** Relative, forward slashes, no `..`, no hidden files. Returns the normalised path or null. */
|
|
8
|
+
export function cleanPath(raw) {
|
|
9
|
+
const path = raw.trim().replace(/^\.?\/+/, "");
|
|
10
|
+
if (path.length > 200 || !PATH_RE.test(path) || path.split("/").some((p) => p === "..")) {
|
|
11
|
+
return null;
|
|
12
|
+
}
|
|
13
|
+
return path;
|
|
14
|
+
}
|
|
15
|
+
const MIME_BY_EXT = {
|
|
16
|
+
html: "text/html",
|
|
17
|
+
htm: "text/html",
|
|
18
|
+
js: "text/javascript",
|
|
19
|
+
mjs: "text/javascript",
|
|
20
|
+
css: "text/css",
|
|
21
|
+
json: "application/json",
|
|
22
|
+
geojson: "application/geo+json",
|
|
23
|
+
csv: "text/csv",
|
|
24
|
+
txt: "text/plain",
|
|
25
|
+
md: "text/markdown",
|
|
26
|
+
svg: "image/svg+xml",
|
|
27
|
+
png: "image/png",
|
|
28
|
+
jpg: "image/jpeg",
|
|
29
|
+
jpeg: "image/jpeg",
|
|
30
|
+
webp: "image/webp",
|
|
31
|
+
gif: "image/gif",
|
|
32
|
+
woff: "font/woff",
|
|
33
|
+
woff2: "font/woff2",
|
|
34
|
+
ttf: "font/ttf",
|
|
35
|
+
otf: "font/otf",
|
|
36
|
+
mp3: "audio/mpeg",
|
|
37
|
+
wav: "audio/wav",
|
|
38
|
+
mp4: "video/mp4",
|
|
39
|
+
webm: "video/webm",
|
|
40
|
+
pdf: "application/pdf",
|
|
41
|
+
};
|
|
42
|
+
export function mimeForPath(path) {
|
|
43
|
+
const ext = path.split(".").pop()?.toLowerCase() ?? "";
|
|
44
|
+
return MIME_BY_EXT[ext] ?? "application/octet-stream";
|
|
45
|
+
}
|
|
46
|
+
export function isTextMime(mime) {
|
|
47
|
+
return (mime.startsWith("text/") ||
|
|
48
|
+
mime === "application/json" ||
|
|
49
|
+
mime === "application/geo+json" ||
|
|
50
|
+
mime === "image/svg+xml");
|
|
51
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "wizards",
|
|
3
|
+
"version": "0.1.9",
|
|
4
|
+
"description": "Make a wish. Get your wizard. It guides you step by step. Let AI do the work. Runs on your machine, on the AI subscription you already have.",
|
|
5
|
+
"license": "FSL-1.1-MIT",
|
|
6
|
+
"homepage": "https://engenty.ai",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "git+https://github.com/engenty/engenty-wizards.git"
|
|
10
|
+
},
|
|
11
|
+
"type": "module",
|
|
12
|
+
"bin": {
|
|
13
|
+
"wizards": "bin/wizards.mjs"
|
|
14
|
+
},
|
|
15
|
+
"engines": {
|
|
16
|
+
"node": ">=24.11"
|
|
17
|
+
},
|
|
18
|
+
"files": [
|
|
19
|
+
"apps",
|
|
20
|
+
"bin",
|
|
21
|
+
"plugin"
|
|
22
|
+
],
|
|
23
|
+
"dependencies": {
|
|
24
|
+
"@ai-sdk/anthropic": "4.0.54",
|
|
25
|
+
"@ai-sdk/gateway": "4.0.82",
|
|
26
|
+
"@ai-sdk/openai": "4.0.67",
|
|
27
|
+
"@clack/prompts": "1.8.1",
|
|
28
|
+
"@engenty-wizards/shared": "0.1.0",
|
|
29
|
+
"@executor-js/plugin-openapi": "1.6.8",
|
|
30
|
+
"@hono/node-server": "2.1.3",
|
|
31
|
+
"@libsql/client": "0.18.0",
|
|
32
|
+
"@mastra/core": "1.74.0",
|
|
33
|
+
"@mastra/docker": "0.8.0",
|
|
34
|
+
"@mastra/mcp": "2.1.2",
|
|
35
|
+
"@modelcontextprotocol/client": "2.2.0",
|
|
36
|
+
"@modelcontextprotocol/server": "2.2.0",
|
|
37
|
+
"@turbodocx/html-to-docx": "1.23.1",
|
|
38
|
+
"ai": "7.0.102",
|
|
39
|
+
"aws4fetch": "1.0.20",
|
|
40
|
+
"drizzle-orm": "0.45.3",
|
|
41
|
+
"effect": "4.0.0-beta.59",
|
|
42
|
+
"exceljs": "4.4.0",
|
|
43
|
+
"fast-xml-parser": "5.11.2",
|
|
44
|
+
"fflate": "0.8.3",
|
|
45
|
+
"hono": "4.13.12",
|
|
46
|
+
"imapflow": "2.2.1",
|
|
47
|
+
"jose": "6.2.12",
|
|
48
|
+
"mammoth": "1.13.0",
|
|
49
|
+
"marked": "18.0.14",
|
|
50
|
+
"nanoid": "5.1.16",
|
|
51
|
+
"node-pty": "1.1.0",
|
|
52
|
+
"pdf-parse": "2.4.5",
|
|
53
|
+
"playwright-core": "1.63.0",
|
|
54
|
+
"postal-mime": "4.0.2",
|
|
55
|
+
"rfc6902": "5.3.0",
|
|
56
|
+
"turndown": "7.2.4",
|
|
57
|
+
"zod": "4.6.5"
|
|
58
|
+
},
|
|
59
|
+
"bundleDependencies": [
|
|
60
|
+
"@engenty-wizards/shared"
|
|
61
|
+
]
|
|
62
|
+
}
|