@engenty/wizards-runtime 0.15.0 → 0.16.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/apps/runtime/dist/agents/studio-assistant.js +138 -9
- package/apps/runtime/dist/agents/website.js +10 -5
- package/apps/runtime/dist/app.js +18 -0
- package/apps/runtime/dist/auth/index.js +5 -0
- package/apps/runtime/dist/broker/account.js +5 -0
- package/apps/runtime/dist/broker/index.js +5 -0
- package/apps/runtime/dist/broker/rwx.js +255 -7
- package/apps/runtime/dist/cli/main.js +7 -0
- package/apps/runtime/dist/cli/move-files.js +68 -0
- package/apps/runtime/dist/cli/move-folder-sources.js +120 -0
- package/apps/runtime/dist/connectors/plugin-connections.js +74 -4
- package/apps/runtime/dist/db/migrations/tenant/0042_client_spaces.sql +16 -0
- package/apps/runtime/dist/db/migrations/tenant/0043_space_member_invite.sql +19 -0
- package/apps/runtime/dist/db/migrations/tenant/0044_client_portal.sql +8 -0
- package/apps/runtime/dist/db/migrations/tenant/0045_client_portal_no_slug.sql +2 -0
- package/apps/runtime/dist/db/migrations/tenant/0046_space_file_hash.sql +2 -0
- package/apps/runtime/dist/db/migrations/tenant/0047_knowledge_folders.sql +3 -0
- package/apps/runtime/dist/db/migrations/tenant/0048_space_chunk_kind.sql +1 -0
- package/apps/runtime/dist/db/migrations/tenant/0049_knowledge_sources.sql +57 -0
- package/apps/runtime/dist/db/migrations/tenant/0050_dateien.sql +71 -0
- package/apps/runtime/dist/db/migrations/tenant/0051_dateien_drafts.sql +23 -0
- package/apps/runtime/dist/db/migrations/tenant/0052_dateien_plugin_kinds.sql +5 -0
- package/apps/runtime/dist/db/migrations/tenant/0053_dateien_file_title.sql +3 -0
- package/apps/runtime/dist/db/migrations/tenant/0054_dateien_ocr.sql +14 -0
- package/apps/runtime/dist/db/migrations/tenant/0055_dateien_doc_reread.sql +3 -0
- package/apps/runtime/dist/db/migrations/tenant/meta/0042_snapshot.json +5286 -0
- package/apps/runtime/dist/db/migrations/tenant/meta/0043_snapshot.json +5293 -0
- package/apps/runtime/dist/db/migrations/tenant/meta/0044_snapshot.json +5344 -0
- package/apps/runtime/dist/db/migrations/tenant/meta/0045_snapshot.json +5329 -0
- package/apps/runtime/dist/db/migrations/tenant/meta/0046_snapshot.json +5343 -0
- package/apps/runtime/dist/db/migrations/tenant/meta/0047_snapshot.json +5391 -0
- package/apps/runtime/dist/db/migrations/tenant/meta/0048_snapshot.json +5398 -0
- package/apps/runtime/dist/db/migrations/tenant/meta/0049_snapshot.json +5793 -0
- package/apps/runtime/dist/db/migrations/tenant/meta/0050_snapshot.json +6288 -0
- package/apps/runtime/dist/db/migrations/tenant/meta/0051_snapshot.json +6461 -0
- package/apps/runtime/dist/db/migrations/tenant/meta/0052_snapshot.json +6497 -0
- package/apps/runtime/dist/db/migrations/tenant/meta/0053_snapshot.json +6504 -0
- package/apps/runtime/dist/db/migrations/tenant/meta/0054_snapshot.json +6504 -0
- package/apps/runtime/dist/db/migrations/tenant/meta/0055_snapshot.json +6504 -0
- package/apps/runtime/dist/db/migrations/tenant/meta/_journal.json +98 -0
- package/apps/runtime/dist/db/schema.js +294 -5
- package/apps/runtime/dist/docs/dev/api.md +25 -0
- package/apps/runtime/dist/docs/dev/plugins/connections.md +30 -2
- package/apps/runtime/dist/docs/dev/plugins/index.md +1 -1
- package/apps/runtime/dist/docs/dev/plugins/reference.md +7 -4
- package/apps/runtime/dist/docs/dev/plugins/server.md +11 -5
- package/apps/runtime/dist/docs/dev/plugins/space.md +130 -4
- package/apps/runtime/dist/docs/dev/plugins/studio.md +13 -3
- package/apps/runtime/dist/docs/user-guide/command-line.md +2 -0
- package/apps/runtime/dist/docs/user-guide/plugins.md +1 -1
- package/apps/runtime/dist/docs/user-guide/space.md +6 -6
- package/apps/runtime/dist/docs/user-guide/steps.md +1 -1
- package/apps/runtime/dist/documents/ocr.js +72 -0
- package/apps/runtime/dist/documents/parse.js +81 -12
- package/apps/runtime/dist/elements/caller.js +5 -3
- package/apps/runtime/dist/elements/gate.js +1 -1
- package/apps/runtime/dist/elements/knowledge.js +181 -12
- package/apps/runtime/dist/elements/specs.js +1 -1
- package/apps/runtime/dist/elements/wizards.js +15 -2
- package/apps/runtime/dist/engenty/connections-google/connectors/drive.js +3 -0
- package/apps/runtime/dist/engenty/connections-microsoft/onedrive.js +3 -0
- package/apps/runtime/dist/engenty/connections-s3/s3.js +6 -0
- package/apps/runtime/dist/engine/runner.js +19 -2
- package/apps/runtime/dist/engine/steps.js +1 -1
- package/apps/runtime/dist/env.js +6 -0
- package/apps/runtime/dist/files/blobs.js +57 -1
- package/apps/runtime/dist/files/objects.js +1 -0
- package/apps/runtime/dist/files/pictures.js +41 -0
- package/apps/runtime/dist/files/storage.js +14 -26
- package/apps/runtime/dist/files/thumbs.js +77 -0
- package/apps/runtime/dist/files/upload-check.js +2 -2
- package/apps/runtime/dist/index.js +22 -0
- package/apps/runtime/dist/live/views.js +2 -1
- package/apps/runtime/dist/manage.js +4 -1
- package/apps/runtime/dist/mcp/tools.js +5 -0
- package/apps/runtime/dist/models.js +82 -13
- package/apps/runtime/dist/mounts/cache.js +71 -0
- package/apps/runtime/dist/mounts/drafts.js +367 -0
- package/apps/runtime/dist/mounts/folder.js +148 -0
- package/apps/runtime/dist/mounts/mounts.js +1315 -0
- package/apps/runtime/dist/mounts/source.js +179 -0
- package/apps/runtime/dist/mounts/units.js +97 -0
- package/apps/runtime/dist/move-files.js +4 -0
- package/apps/runtime/dist/plugins/loader.js +73 -1
- package/apps/runtime/dist/plugins/registry.js +2 -0
- package/apps/runtime/dist/prompts/goose.md +13 -1
- package/apps/runtime/dist/prompts/tools.md +5 -2
- package/apps/runtime/dist/render/convert.js +188 -1
- package/apps/runtime/dist/routes/api.js +6 -1
- package/apps/runtime/dist/routes/client-contract.js +164 -0
- package/apps/runtime/dist/routes/client-spaces.js +58 -0
- package/apps/runtime/dist/routes/dateien.js +173 -0
- package/apps/runtime/dist/routes/elements.js +2 -2
- package/apps/runtime/dist/routes/plugins.js +2 -1
- package/apps/runtime/dist/routes/runs.js +24 -10
- package/apps/runtime/dist/routes/studio.js +168 -8
- package/apps/runtime/dist/secrets/signing.js +16 -0
- package/apps/runtime/dist/services/client-portal.js +439 -0
- package/apps/runtime/dist/services/client-spaces.js +228 -0
- package/apps/runtime/dist/services/cloud.js +2 -0
- package/apps/runtime/dist/services/knowledge-model.js +24 -8
- package/apps/runtime/dist/services/knowledge.js +72 -42
- package/apps/runtime/dist/services/links.js +17 -0
- package/apps/runtime/dist/services/members-studio.js +5 -1
- package/apps/runtime/dist/services/page-pictures.js +162 -0
- package/apps/runtime/dist/services/runs.js +22 -6
- package/apps/runtime/dist/services/space-categories.js +41 -5
- package/apps/runtime/dist/services/space-data.js +165 -8
- package/apps/runtime/dist/services/space-files.js +102 -19
- package/apps/runtime/dist/services/space-index.js +384 -41
- package/apps/runtime/dist/services/space-origin.js +25 -1
- package/apps/runtime/dist/services/space-sources.js +937 -0
- package/apps/runtime/dist/services/spaces.js +60 -12
- package/apps/runtime/dist/services/synced-spaces.js +10 -1
- package/apps/runtime/dist/services/work-ai.js +29 -8
- package/apps/runtime/dist/services/work-chats.js +3 -2
- package/apps/runtime/dist/sharing/index.js +2 -0
- package/apps/runtime/dist/store/index.js +29 -8
- package/apps/runtime/dist/store/shared-lists.js +30 -17
- package/apps/runtime/dist/sync/records.js +22 -27
- package/apps/runtime/dist/texts.js +4 -0
- package/apps/runtime/dist/tools/pages.js +1 -1
- package/apps/runtime/dist/widgets/step.js +2 -1
- package/apps/web/dist/assets/AboutDialog-0q4P80yv.js +1 -0
- package/apps/web/dist/assets/BlockEditor-CUYFH_CU.js +173 -0
- package/apps/web/dist/assets/BlockEditor-CtW6lw0y.css +1 -0
- package/apps/web/dist/assets/CapabilitiesPage-BlZP8DYb.js +2 -0
- package/apps/web/dist/assets/{ChangelogDialog-Do7pwmFv.js → ChangelogDialog-CDN7kMs1.js} +1 -1
- package/apps/web/dist/assets/{CodeEditor-Cdox-51M.js → CodeEditor-D-Y16fdk.js} +1 -1
- package/apps/web/dist/assets/EditorPage-CrMVsgUt.js +3 -0
- package/apps/web/dist/assets/{FlowPreview-BPS86xzA.js → FlowPreview-DXnk7m9P.js} +1 -1
- package/apps/web/dist/assets/{LangSwitch-BRHbi_Sd.js → LangSwitch-Dkd0FBIH.js} +1 -1
- package/apps/web/dist/assets/Marketplace-Cty40VwG.js +2 -0
- package/apps/web/dist/assets/NewWizardChannels-Czool7s1.js +1 -0
- package/apps/web/dist/assets/NewWizardPage-CfVe_4a2.js +7 -0
- package/apps/web/dist/assets/OnboardingPage-D3SEpTmt.js +1 -0
- package/apps/web/dist/assets/PreviewPane-CQDKQO6z.js +7 -0
- package/apps/web/dist/assets/PublicRunner-BDZNnlQw.js +1 -0
- package/apps/web/dist/assets/ReadOnly-B7MUySpC.js +1 -0
- package/apps/web/dist/assets/SettingsPage-Bgurv3l2.js +2 -0
- package/apps/web/dist/assets/SetupPage-C3km8vqv.js +1 -0
- package/apps/web/dist/assets/{SharePage-PKHX8a8a.js → SharePage-UwEJBIzq.js} +1 -1
- package/apps/web/dist/assets/SkillEditor-BaEiqqXl.js +1 -0
- package/apps/web/dist/assets/Skills-Bv6XbKxc.js +9 -0
- package/apps/web/dist/assets/SpacePage-D9PXLSU_.js +2 -0
- package/apps/web/dist/assets/UpdateCheck-C7I43zFZ.js +2 -0
- package/apps/web/dist/assets/changelog-DwgWiSZb.js +1 -0
- package/apps/web/dist/assets/circle-check-DDLzlcXP.js +1 -0
- package/apps/web/dist/assets/code-DsnwzN1x.js +1 -0
- package/apps/web/dist/assets/code-editor-Ca5EAxmd.js +2 -0
- package/apps/web/dist/assets/code-xml-S4IFi5Jc.js +1 -0
- package/apps/web/dist/assets/connection-sign-in-hI3HXhq4.js +1 -0
- package/apps/web/dist/assets/{dist-H1UN89OA.js → dist-B3Ray2U5.js} +1 -1
- package/apps/web/dist/assets/dist-CQpLJoQZ.js +10 -0
- package/apps/web/dist/assets/{dist-GlRRx9Xl.js → dist-D1uGQ_tB.js} +1 -1
- package/apps/web/dist/assets/{dist-BdDd1FxP.js → dist-DFI-tsfx.js} +1 -1
- package/apps/web/dist/assets/eye-TJSuiHHO.js +1 -0
- package/apps/web/dist/assets/floating-ui.dom-pwdNGv4b.js +1 -0
- package/apps/web/dist/assets/host-D5hNHbhF.js +125 -0
- package/apps/web/dist/assets/i18n-BBzMbGoo.js +55 -0
- package/apps/web/dist/assets/index-CyBrvupM.js +10 -0
- package/apps/web/dist/assets/index-w-3J3ZJ9.css +1 -0
- package/apps/web/dist/assets/{json-CEsfHdlZ.js → json-Ce3iHrtf.js} +1 -1
- package/apps/web/dist/assets/link-CPL8pB1P.js +1 -0
- package/apps/web/dist/assets/list-checks-DaxmUPqK.js +1 -0
- package/apps/web/dist/assets/{markdown-5-I9_izp.js → markdown-hqKQy2pp.js} +1 -1
- package/apps/web/dist/assets/marked.esm-DQ7XA7AC.js +67 -0
- package/apps/web/dist/assets/oss-credits-BrwV0a4F.js +1 -0
- package/apps/web/dist/assets/pdf-Dg-raaUo.js +54 -0
- package/apps/web/dist/assets/pdf.worker.min-68CMzziE.js +1 -0
- package/apps/web/dist/assets/pdf.worker.min-CjEcRF4W.mjs +28 -0
- package/apps/web/dist/assets/phone-B4uKDBFq.js +1 -0
- package/apps/web/dist/assets/read-aloud-Bfp9_bUY.js +1 -0
- package/apps/web/dist/assets/{runners-BoPaPsjN.js → runners-CUpBpSji.js} +1 -1
- package/apps/web/dist/assets/scroll-text-BEnPzQEi.js +1 -0
- package/apps/web/dist/assets/session-CMQo8P-G.js +2 -0
- package/apps/web/dist/assets/table-5B9G3oA6.js +1 -0
- package/apps/web/dist/assets/theme-CdX0marK.js +11 -0
- package/apps/web/dist/assets/ui-BCfu5sia.js +16 -0
- package/apps/web/dist/assets/upload-CAlHC232.js +1 -0
- package/apps/web/dist/assets/{useMutation-7_FOHoEl.js → useMutation-1fV4Nnxq.js} +1 -1
- package/apps/web/dist/assets/viewers-ChriFcRy.js +2 -0
- package/apps/web/dist/assets/volume-2-BqlBtCIJ.js +1 -0
- package/apps/web/dist/assets/w3c-keyname-BOAvb0qz.js +1 -0
- package/apps/web/dist/assets/xlsx-CuSbHU4R.js +141 -0
- package/apps/web/dist/index.html +19 -14
- package/apps/web/dist/mcp/flow.html +2 -2
- package/node_modules/@engenty/wizards/dist/plugin/index.d.ts +223 -4
- package/node_modules/@engenty/wizards/dist/plugin/mount.d.ts +123 -0
- package/node_modules/@engenty/wizards/dist/plugin/mount.js +7 -0
- package/node_modules/@engenty/wizards/dist/plugin/studio.d.ts +110 -1
- package/node_modules/@engenty/wizards-shared/dist/connectors.d.ts +1 -1
- package/node_modules/@engenty/wizards-shared/dist/feature-flags.d.ts +24 -0
- package/node_modules/@engenty/wizards-shared/dist/feature-flags.js +24 -0
- package/node_modules/@engenty/wizards-shared/dist/knowledge.d.ts +33 -4
- package/node_modules/@engenty/wizards-shared/dist/run.d.ts +3 -0
- package/node_modules/@engenty/wizards-shared/dist/run.js +6 -0
- package/node_modules/@engenty/wizards-shared/dist/rwx.d.ts +21 -4
- package/node_modules/@engenty/wizards-shared/dist/rwx.js +27 -3
- package/node_modules/@engenty/wizards-shared/dist/spaces.d.ts +11 -1
- package/node_modules/@engenty/wizards-shared/dist/spaces.js +9 -2
- package/node_modules/@engenty/wizards-shared/dist/text-merge.d.ts +6 -0
- package/node_modules/@engenty/wizards-shared/dist/text-merge.js +25 -0
- package/package.json +3 -1
- package/plugin/.claude-plugin/plugin.json +1 -1
- package/plugin/plugin.json +1 -1
- package/apps/web/dist/assets/AboutDialog-DaWEIHFN.js +0 -1
- package/apps/web/dist/assets/CapabilitiesPage-Dt91U_sK.js +0 -2
- package/apps/web/dist/assets/EditorPage-DS_a5K3s.js +0 -3
- package/apps/web/dist/assets/Marketplace-CS7JTgiv.js +0 -2
- package/apps/web/dist/assets/NewWizardChannels-D-OLsex6.js +0 -1
- package/apps/web/dist/assets/NewWizardPage-BM_pkk41.js +0 -7
- package/apps/web/dist/assets/OnboardingPage-Cpn5pubC.js +0 -1
- package/apps/web/dist/assets/PreviewPane-BOk1-yO4.js +0 -9
- package/apps/web/dist/assets/PublicRunner-CgzMZb0r.js +0 -1
- package/apps/web/dist/assets/ReadOnly-8DEx-ly3.js +0 -1
- package/apps/web/dist/assets/SettingsPage-CcrknFcI.js +0 -2
- package/apps/web/dist/assets/SetupPage-D5nzjgPU.js +0 -1
- package/apps/web/dist/assets/SkillEditor-BsXTqNli.js +0 -1
- package/apps/web/dist/assets/Skills-C_X1ZsKg.js +0 -9
- package/apps/web/dist/assets/SpacePage-wZGqUoSQ.js +0 -2
- package/apps/web/dist/assets/UpdateCheck-D6x7MqEl.js +0 -2
- package/apps/web/dist/assets/changelog-M-eOBqgu.js +0 -1
- package/apps/web/dist/assets/circle-alert-DJbCyxcg.js +0 -1
- package/apps/web/dist/assets/circle-check-jqtsKi_b.js +0 -1
- package/apps/web/dist/assets/code-editor-BpCEnf8H.js +0 -2
- package/apps/web/dist/assets/code-xml-q88cSTV8.js +0 -1
- package/apps/web/dist/assets/connection-sign-in-UJ6xk-TD.js +0 -1
- package/apps/web/dist/assets/dist-EBVTpvRr.js +0 -10
- package/apps/web/dist/assets/eye-CgkvVlba.js +0 -1
- package/apps/web/dist/assets/host-Bd_bon_c.js +0 -118
- package/apps/web/dist/assets/i18n-0fUKyVRE.js +0 -55
- package/apps/web/dist/assets/index-D18DvnxX.css +0 -1
- package/apps/web/dist/assets/index-DOgwxnto.js +0 -10
- package/apps/web/dist/assets/oss-credits-IdX5bc71.js +0 -1
- package/apps/web/dist/assets/phone-CjPvZ0nk.js +0 -1
- package/apps/web/dist/assets/read-aloud-CLXo_asN.js +0 -1
- package/apps/web/dist/assets/scroll-text-2BhJO_W7.js +0 -1
- package/apps/web/dist/assets/session-CpYa5hwd.js +0 -2
- package/apps/web/dist/assets/theme-Bj3wNQR0.js +0 -11
- package/apps/web/dist/assets/ui-CktezodE.js +0 -82
- package/apps/web/dist/assets/upload-CHGCFVZK.js +0 -1
- package/apps/web/dist/assets/volume-2-Bw5KASy8.js +0 -1
|
@@ -65,8 +65,24 @@ export interface KnowledgeItem {
|
|
|
65
65
|
title: string;
|
|
66
66
|
/** How a step names it: `pages/handbuch/montage`, `tables/kettenprogramm`, `files/plan.dwg`. */
|
|
67
67
|
path: string;
|
|
68
|
-
/**
|
|
68
|
+
/** What a page holds: its sub-pages, and the tables and files in it. */
|
|
69
69
|
children: number;
|
|
70
|
+
/** The page it sits in, its folder; null at the top. */
|
|
71
|
+
parentId: string | null;
|
|
72
|
+
/** Its place among its folder's contents. */
|
|
73
|
+
position: number;
|
|
74
|
+
/** A page without text of its own: it shows as a folder. */
|
|
75
|
+
blank: boolean;
|
|
76
|
+
/**
|
|
77
|
+
* The start of what it says, as plain text (a page's text without its title, a file's
|
|
78
|
+
* description), about four lines' worth; null when it says nothing.
|
|
79
|
+
*/
|
|
80
|
+
excerpt: string | null;
|
|
81
|
+
/**
|
|
82
|
+
* Where a sub-page stands, its folders' titles („Handbuch › Montage“), in a list that mixes
|
|
83
|
+
* items from all over Knowledge (a value's entries); left out elsewhere.
|
|
84
|
+
*/
|
|
85
|
+
place?: string;
|
|
70
86
|
/** A table's rows. */
|
|
71
87
|
rows: number | null;
|
|
72
88
|
format: "faq" | null;
|
|
@@ -162,10 +178,11 @@ export declare const whereSchema: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [
|
|
|
162
178
|
export type Where = z.infer<typeof whereSchema>;
|
|
163
179
|
export interface KnowledgeHit {
|
|
164
180
|
/** `p:<id>`, `t:<id>` (a row of it), `f:<id>`, `v:<id>` (a value's summary), `d:<id>` (a
|
|
165
|
-
* document read before Knowledge had pages), `x:<plugin>:<key>` (a plugin's text)
|
|
181
|
+
* document read before Knowledge had pages), `x:<plugin>:<key>` (a plugin's text), `m:<id>` (a
|
|
182
|
+
* file of a mount in Dateien). */
|
|
166
183
|
key: string;
|
|
167
|
-
kind: KnowledgeKind | "summary" | "document" | "plugin";
|
|
168
|
-
/** What the studio opens for it: `p:`, `t:` (a row's table), `f:`, `v:`; null for a plugin's text. */
|
|
184
|
+
kind: KnowledgeKind | "summary" | "document" | "plugin" | "mounted";
|
|
185
|
+
/** What the studio opens for it: `p:`, `t:` (a row's table), `f:`, `v:`, `m:`; null for a plugin's text. */
|
|
169
186
|
open: string | null;
|
|
170
187
|
path: string;
|
|
171
188
|
title: string;
|
|
@@ -183,6 +200,13 @@ export interface KnowledgeHit {
|
|
|
183
200
|
/** Where the studio shows a plugin's text. */
|
|
184
201
|
link: string | null;
|
|
185
202
|
plugin: string | null;
|
|
203
|
+
/** Found by what a picture shows: a picture file (`image`), a PDF's page (`page`, at `sheet`). */
|
|
204
|
+
picture?: "image" | "page";
|
|
205
|
+
/** A file of Dateien: the mount it lives in. Its path is `dateien/<mount>/<path>`. */
|
|
206
|
+
mount?: {
|
|
207
|
+
id: string;
|
|
208
|
+
name: string;
|
|
209
|
+
};
|
|
186
210
|
}
|
|
187
211
|
export interface KnowledgeSearch {
|
|
188
212
|
hits: KnowledgeHit[];
|
|
@@ -192,6 +216,11 @@ export interface KnowledgeSearch {
|
|
|
192
216
|
checked: boolean;
|
|
193
217
|
/** Items the filter left, when there was one. */
|
|
194
218
|
filtered: number | null;
|
|
219
|
+
/**
|
|
220
|
+
* What the classifier judged not to answer the query (under the bar), one hit per item, best
|
|
221
|
+
* first: shown on request, in case it was wrong. Empty when nothing was checked.
|
|
222
|
+
*/
|
|
223
|
+
hidden: KnowledgeHit[];
|
|
195
224
|
}
|
|
196
225
|
/** A day as `YYYY-MM-DD` from what a person or a source wrote: ISO, `14.03.2026`, a timestamp. */
|
|
197
226
|
export declare function dayOf(value: unknown): string | null;
|
|
@@ -382,6 +382,7 @@ declare const NOTES_EN: {
|
|
|
382
382
|
readonly twoEntriesSameKey: "Two entries have the same key.";
|
|
383
383
|
readonly pageSlugInvalid: "A page address holds lower-case letters a–z, digits and hyphens.";
|
|
384
384
|
readonly pageSlugTaken: "Another space of your organization has this address.";
|
|
385
|
+
readonly pageSlugReserved: "This address belongs to the client portal. Choose a different one.";
|
|
385
386
|
readonly pageTaken: "The page is already at “{space}”.";
|
|
386
387
|
readonly notDeleteLastSpace: "You can’t delete the last space.";
|
|
387
388
|
readonly connectorGone: "There is no connector “{id}” in this space.";
|
|
@@ -453,9 +454,11 @@ declare const NOTES_EN: {
|
|
|
453
454
|
readonly rwxMail: "email";
|
|
454
455
|
readonly rwxHost: "host";
|
|
455
456
|
readonly rwxSandbox: "sandbox";
|
|
457
|
+
readonly clientsInCloud: "Clients are invited in the cloud, where they have accounts of their own.";
|
|
456
458
|
readonly rwxWizard: "wizard";
|
|
457
459
|
readonly rwxSkill: "skill";
|
|
458
460
|
readonly rwxSetup: "space setup";
|
|
461
|
+
readonly rwxMount: "folder in Dateien";
|
|
459
462
|
readonly rwxRead: "read";
|
|
460
463
|
readonly rwxWrite: "change";
|
|
461
464
|
readonly rwxRun: "run";
|
|
@@ -208,6 +208,7 @@ const NOTES_EN = {
|
|
|
208
208
|
twoEntriesSameKey: "Two entries have the same key.",
|
|
209
209
|
pageSlugInvalid: "A page address holds lower-case letters a–z, digits and hyphens.",
|
|
210
210
|
pageSlugTaken: "Another space of your organization has this address.",
|
|
211
|
+
pageSlugReserved: "This address belongs to the client portal. Choose a different one.",
|
|
211
212
|
pageTaken: "The page is already at “{space}”.",
|
|
212
213
|
notDeleteLastSpace: "You can’t delete the last space.",
|
|
213
214
|
connectorGone: "There is no connector “{id}” in this space.",
|
|
@@ -281,9 +282,11 @@ const NOTES_EN = {
|
|
|
281
282
|
rwxMail: "email",
|
|
282
283
|
rwxHost: "host",
|
|
283
284
|
rwxSandbox: "sandbox",
|
|
285
|
+
clientsInCloud: "Clients are invited in the cloud, where they have accounts of their own.",
|
|
284
286
|
rwxWizard: "wizard",
|
|
285
287
|
rwxSkill: "skill",
|
|
286
288
|
rwxSetup: "space setup",
|
|
289
|
+
rwxMount: "folder in Dateien",
|
|
287
290
|
rwxRead: "read",
|
|
288
291
|
rwxWrite: "change",
|
|
289
292
|
rwxRun: "run",
|
|
@@ -595,6 +598,7 @@ const NOTES_DE = {
|
|
|
595
598
|
twoEntriesSameKey: "Zwei Einträge haben denselben Schlüssel.",
|
|
596
599
|
pageSlugInvalid: "Eine Seitenadresse besteht aus Kleinbuchstaben a–z, Ziffern und Bindestrichen.",
|
|
597
600
|
pageSlugTaken: "Ein anderer Space deiner Organisation hat diese Adresse.",
|
|
601
|
+
pageSlugReserved: "Diese Adresse gehört zum Kundenportal. Wähle eine andere.",
|
|
598
602
|
pageTaken: "Die Seite ist schon bei „{space}“.",
|
|
599
603
|
notDeleteLastSpace: "Der letzte Space lässt sich nicht löschen.",
|
|
600
604
|
connectorGone: "In diesem Space gibt es keinen Connector „{id}“.",
|
|
@@ -666,9 +670,11 @@ const NOTES_DE = {
|
|
|
666
670
|
rwxMail: "E-Mail",
|
|
667
671
|
rwxHost: "Host",
|
|
668
672
|
rwxSandbox: "Sandbox",
|
|
673
|
+
clientsInCloud: "Kund:innen lädst du in der Cloud ein, wo sie ein eigenes Konto haben.",
|
|
669
674
|
rwxWizard: "Wizard",
|
|
670
675
|
rwxSkill: "Skill",
|
|
671
676
|
rwxSetup: "Einrichtung des Space",
|
|
677
|
+
rwxMount: "Ordner in Dateien",
|
|
672
678
|
rwxRead: "lesen",
|
|
673
679
|
rwxWrite: "ändern",
|
|
674
680
|
rwxRun: "ausführen",
|
|
@@ -4,17 +4,34 @@
|
|
|
4
4
|
* deny or unset. Unset means deny, and a deny wins over every allow from any other rule. The
|
|
5
5
|
* runtime decides in apps/runtime/src/broker/rwx.ts; the studio will draw the rows as sentences.
|
|
6
6
|
*/
|
|
7
|
-
/**
|
|
8
|
-
|
|
7
|
+
/**
|
|
8
|
+
* Who a rule is about. A role's id is `member`, `admin` or `owner`; a guest has none. `agent`: an
|
|
9
|
+
* AI working for a person (a Work chat, a client's chat, Claude or Codex through MCP), with no id.
|
|
10
|
+
*/
|
|
11
|
+
export declare const RWX_SUBJECT_KINDS: readonly ["guest", "person", "role", "goose", "wizard", "plugin", "agent"];
|
|
9
12
|
export type RwxSubjectKind = (typeof RWX_SUBJECT_KINDS)[number];
|
|
10
13
|
/** What a rule is about. The id is the resource's, or `*` for every resource of the kind. */
|
|
11
|
-
export declare const RWX_RESOURCE_KINDS: readonly ["document", "table", "page", "connection", "mail", "host", "sandbox", "wizard", "skill", "setup"];
|
|
14
|
+
export declare const RWX_RESOURCE_KINDS: readonly ["document", "table", "page", "connection", "mail", "host", "sandbox", "wizard", "skill", "setup", "mount"];
|
|
12
15
|
export type RwxResourceKind = (typeof RWX_RESOURCE_KINDS)[number];
|
|
13
16
|
export declare const RWX_PERMS: readonly ["r", "w", "x"];
|
|
14
17
|
export type RwxPerm = (typeof RWX_PERMS)[number];
|
|
15
18
|
export declare const RWX_FLAGS: readonly ["allow", "deny"];
|
|
16
19
|
export type RwxFlag = (typeof RWX_FLAGS)[number];
|
|
17
|
-
|
|
20
|
+
/** `client`: a client of the organization, who sees only their client spaces (docs/plans/client-spaces.md). */
|
|
21
|
+
export declare const RWX_ROLES: readonly ["member", "admin", "owner", "client"];
|
|
22
|
+
/**
|
|
23
|
+
* Who besides the space's admins sees a mounted folder of Dateien or a folder of Wissen: its team
|
|
24
|
+
* (the members, who work in Work), the organization's clients (docs/plans/client-spaces.md), and
|
|
25
|
+
* guests: people on a shared link or a published page, without an account. Admins always see it.
|
|
26
|
+
*/
|
|
27
|
+
export declare const AUDIENCES: readonly ["team", "clients", "guests"];
|
|
28
|
+
export type Audience = (typeof AUDIENCES)[number];
|
|
29
|
+
/**
|
|
30
|
+
* What an AI working for a person may do with a mounted folder: nothing, read it, or also write
|
|
31
|
+
* drafts of its files, which a person then publishes. Drafts only where the folder may be changed.
|
|
32
|
+
*/
|
|
33
|
+
export declare const AGENT_ACCESS: readonly ["none", "read", "drafts"];
|
|
34
|
+
export type AgentAccess = (typeof AGENT_ACCESS)[number];
|
|
18
35
|
/** Every resource of a kind. */
|
|
19
36
|
export declare const RWX_ALL = "*";
|
|
20
37
|
export declare const RWX_LIMITS: {
|
|
@@ -4,8 +4,19 @@
|
|
|
4
4
|
* deny or unset. Unset means deny, and a deny wins over every allow from any other rule. The
|
|
5
5
|
* runtime decides in apps/runtime/src/broker/rwx.ts; the studio will draw the rows as sentences.
|
|
6
6
|
*/
|
|
7
|
-
/**
|
|
8
|
-
|
|
7
|
+
/**
|
|
8
|
+
* Who a rule is about. A role's id is `member`, `admin` or `owner`; a guest has none. `agent`: an
|
|
9
|
+
* AI working for a person (a Work chat, a client's chat, Claude or Codex through MCP), with no id.
|
|
10
|
+
*/
|
|
11
|
+
export const RWX_SUBJECT_KINDS = [
|
|
12
|
+
"guest",
|
|
13
|
+
"person",
|
|
14
|
+
"role",
|
|
15
|
+
"goose",
|
|
16
|
+
"wizard",
|
|
17
|
+
"plugin",
|
|
18
|
+
"agent",
|
|
19
|
+
];
|
|
9
20
|
/** What a rule is about. The id is the resource's, or `*` for every resource of the kind. */
|
|
10
21
|
export const RWX_RESOURCE_KINDS = [
|
|
11
22
|
"document",
|
|
@@ -18,10 +29,23 @@ export const RWX_RESOURCE_KINDS = [
|
|
|
18
29
|
"wizard",
|
|
19
30
|
"skill",
|
|
20
31
|
"setup",
|
|
32
|
+
"mount",
|
|
21
33
|
];
|
|
22
34
|
export const RWX_PERMS = ["r", "w", "x"];
|
|
23
35
|
export const RWX_FLAGS = ["allow", "deny"];
|
|
24
|
-
|
|
36
|
+
/** `client`: a client of the organization, who sees only their client spaces (docs/plans/client-spaces.md). */
|
|
37
|
+
export const RWX_ROLES = ["member", "admin", "owner", "client"];
|
|
38
|
+
/**
|
|
39
|
+
* Who besides the space's admins sees a mounted folder of Dateien or a folder of Wissen: its team
|
|
40
|
+
* (the members, who work in Work), the organization's clients (docs/plans/client-spaces.md), and
|
|
41
|
+
* guests: people on a shared link or a published page, without an account. Admins always see it.
|
|
42
|
+
*/
|
|
43
|
+
export const AUDIENCES = ["team", "clients", "guests"];
|
|
44
|
+
/**
|
|
45
|
+
* What an AI working for a person may do with a mounted folder: nothing, read it, or also write
|
|
46
|
+
* drafts of its files, which a person then publishes. Drafts only where the folder may be changed.
|
|
47
|
+
*/
|
|
48
|
+
export const AGENT_ACCESS = ["none", "read", "drafts"];
|
|
25
49
|
/** Every resource of a kind. */
|
|
26
50
|
export const RWX_ALL = "*";
|
|
27
51
|
export const RWX_LIMITS = {
|
|
@@ -59,6 +59,11 @@ export declare const PAGE_LIMITS: {
|
|
|
59
59
|
};
|
|
60
60
|
/** A page's address: lower-case letters a–z, digits and hyphens, not at the start or end. */
|
|
61
61
|
export declare const PAGE_SLUG: RegExp;
|
|
62
|
+
/**
|
|
63
|
+
* Addresses a public space never takes on `<team>.wizards.page`: the client portal's
|
|
64
|
+
* (docs/plans/client-portal.md). The Manage-App keeps the same word reserved.
|
|
65
|
+
*/
|
|
66
|
+
export declare const RESERVED_PAGE_SLUGS: readonly string[];
|
|
62
67
|
/** A name as a page address: `Müller & Söhne GmbH` → `mueller-soehne-gmbh`. */
|
|
63
68
|
export declare function pageSlugOf(name: string): string;
|
|
64
69
|
export interface BrandColor {
|
|
@@ -246,7 +251,8 @@ export interface AssetSection {
|
|
|
246
251
|
/** The sections as stored: each file in its first section only, ids not known to `files` left out. */
|
|
247
252
|
export declare function cleanLogoSections(sections: LogoSection[], files?: string[]): LogoSection[];
|
|
248
253
|
export declare function cleanAssetSections(sections: AssetSection[], files?: string[]): AssetSection[];
|
|
249
|
-
|
|
254
|
+
/** `picture`: a picture a page of Wissen shows, copied from where the page was read. */
|
|
255
|
+
export declare const SPACE_FILE_KINDS: readonly ["logo", "asset", "document", "pattern", "picture"];
|
|
250
256
|
export type SpaceFileKind = (typeof SPACE_FILE_KINDS)[number];
|
|
251
257
|
/** `pending`: being read, described and indexed. */
|
|
252
258
|
export type SpaceFileStatus = "pending" | "ready" | "failed";
|
|
@@ -265,6 +271,8 @@ export interface SpaceFileView {
|
|
|
265
271
|
indexed: "embeddings" | "keywords" | null;
|
|
266
272
|
pages: number | null;
|
|
267
273
|
chars: number | null;
|
|
274
|
+
/** A 320 px JPEG of it is at `…/files/<id>/thumb`: pictures and PDFs. */
|
|
275
|
+
thumb: boolean;
|
|
268
276
|
createdAt: string;
|
|
269
277
|
}
|
|
270
278
|
export declare const SPACE_LIMITS: {
|
|
@@ -285,6 +293,7 @@ export declare const SPACE_LIMITS: {
|
|
|
285
293
|
readonly asset: 100;
|
|
286
294
|
readonly document: 2000;
|
|
287
295
|
readonly pattern: 24;
|
|
296
|
+
readonly picture: 20000;
|
|
288
297
|
};
|
|
289
298
|
readonly gradients: 24;
|
|
290
299
|
readonly bytes: {
|
|
@@ -293,6 +302,7 @@ export declare const SPACE_LIMITS: {
|
|
|
293
302
|
readonly video: 80000000;
|
|
294
303
|
readonly document: 30000000;
|
|
295
304
|
readonly pattern: 10000000;
|
|
305
|
+
readonly picture: 8000000;
|
|
296
306
|
};
|
|
297
307
|
};
|
|
298
308
|
/** The largest file of a kind and type a space takes. */
|
|
@@ -90,6 +90,11 @@ export const PAGE_LANGS = ["de", "en"];
|
|
|
90
90
|
export const PAGE_LIMITS = { slug: 48, title: 80, headline: 160, intro: 600 };
|
|
91
91
|
/** A page's address: lower-case letters a–z, digits and hyphens, not at the start or end. */
|
|
92
92
|
export const PAGE_SLUG = /^[a-z0-9](?:[a-z0-9-]{0,46}[a-z0-9])?$/;
|
|
93
|
+
/**
|
|
94
|
+
* Addresses a public space never takes on `<team>.wizards.page`: the client portal's
|
|
95
|
+
* (docs/plans/client-portal.md). The Manage-App keeps the same word reserved.
|
|
96
|
+
*/
|
|
97
|
+
export const RESERVED_PAGE_SLUGS = ["portal"];
|
|
93
98
|
/** A name as a page address: `Müller & Söhne GmbH` → `mueller-soehne-gmbh`. */
|
|
94
99
|
export function pageSlugOf(name) {
|
|
95
100
|
return (name
|
|
@@ -338,7 +343,8 @@ export function cleanAssetSections(sections, files) {
|
|
|
338
343
|
return sections.map((s, i) => ({ ...s, assets: lists[i] }));
|
|
339
344
|
}
|
|
340
345
|
// --- files -----------------------------------------------------------------------
|
|
341
|
-
|
|
346
|
+
/** `picture`: a picture a page of Wissen shows, copied from where the page was read. */
|
|
347
|
+
export const SPACE_FILE_KINDS = ["logo", "asset", "document", "pattern", "picture"];
|
|
342
348
|
export const SPACE_LIMITS = {
|
|
343
349
|
facts: 100,
|
|
344
350
|
colors: 32,
|
|
@@ -352,7 +358,7 @@ export const SPACE_LIMITS = {
|
|
|
352
358
|
voiceBlocks: 12,
|
|
353
359
|
voiceText: 2000,
|
|
354
360
|
links: 20,
|
|
355
|
-
files: { logo: 24, asset: 100, document: 2000, pattern: 24 },
|
|
361
|
+
files: { logo: 24, asset: 100, document: 2000, pattern: 24, picture: 20_000 },
|
|
356
362
|
gradients: 24,
|
|
357
363
|
bytes: {
|
|
358
364
|
logo: 5_000_000,
|
|
@@ -360,6 +366,7 @@ export const SPACE_LIMITS = {
|
|
|
360
366
|
video: 80_000_000,
|
|
361
367
|
document: 30_000_000,
|
|
362
368
|
pattern: 10_000_000,
|
|
369
|
+
picture: 8_000_000,
|
|
363
370
|
},
|
|
364
371
|
};
|
|
365
372
|
/** The largest file of a kind and type a space takes. */
|
|
@@ -12,3 +12,9 @@ export interface TextMerge {
|
|
|
12
12
|
conflicts: number;
|
|
13
13
|
}
|
|
14
14
|
export declare function mergeText(base: string, local: string, remote: string): TextMerge;
|
|
15
|
+
export type DiffLine = {
|
|
16
|
+
kind: "same" | "add" | "del";
|
|
17
|
+
text: string;
|
|
18
|
+
};
|
|
19
|
+
/** The lines of `after` against `before`, for showing a change. Null when too far apart. */
|
|
20
|
+
export declare function diffLines(before: string, after: string): DiffLine[] | null;
|
|
@@ -135,3 +135,28 @@ export function mergeText(base, local, remote) {
|
|
|
135
135
|
chunk(o.length, a.length, b.length);
|
|
136
136
|
return { text: out.join("\n"), clean: conflicts === 0, conflicts };
|
|
137
137
|
}
|
|
138
|
+
/** The lines of `after` against `before`, for showing a change. Null when too far apart. */
|
|
139
|
+
export function diffLines(before, after) {
|
|
140
|
+
const a = before === "" ? [] : before.split("\n");
|
|
141
|
+
const b = after === "" ? [] : after.split("\n");
|
|
142
|
+
const pairs = commonLines(a, b, MAX_EDITS);
|
|
143
|
+
if (!pairs) {
|
|
144
|
+
return null;
|
|
145
|
+
}
|
|
146
|
+
const out = [];
|
|
147
|
+
let i = 0;
|
|
148
|
+
let j = 0;
|
|
149
|
+
for (const [pi, pj] of [...pairs, [a.length, b.length]]) {
|
|
150
|
+
while (i < pi) {
|
|
151
|
+
out.push({ kind: "del", text: a[i++] ?? "" });
|
|
152
|
+
}
|
|
153
|
+
while (j < pj) {
|
|
154
|
+
out.push({ kind: "add", text: b[j++] ?? "" });
|
|
155
|
+
}
|
|
156
|
+
if (i < a.length && j < b.length) {
|
|
157
|
+
out.push({ kind: "same", text: a[i++] ?? "" });
|
|
158
|
+
j++;
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
return out;
|
|
162
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@engenty/wizards-runtime",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.16.0",
|
|
4
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. The runtime, which `npx wizards` installs.",
|
|
5
5
|
"license": "FSL-1.1-MIT AND CC-BY-4.0",
|
|
6
6
|
"homepage": "https://engenty.ai",
|
|
@@ -50,6 +50,7 @@
|
|
|
50
50
|
"@fontsource/young-serif": "5.3.0",
|
|
51
51
|
"@hono/node-server": "2.1.3",
|
|
52
52
|
"@libsql/client": "0.18.0",
|
|
53
|
+
"@llamaindex/liteparse": "2.17.0",
|
|
53
54
|
"@lydell/node-pty": "1.1.0",
|
|
54
55
|
"@mastra/ai-sdk": "1.11.2",
|
|
55
56
|
"@mastra/core": "1.80.0",
|
|
@@ -84,6 +85,7 @@
|
|
|
84
85
|
"rfc6902": "5.3.0",
|
|
85
86
|
"turndown": "7.2.4",
|
|
86
87
|
"undici": "8.12.3",
|
|
88
|
+
"word-extractor": "1.0.4",
|
|
87
89
|
"zod": "4.6.6"
|
|
88
90
|
},
|
|
89
91
|
"bundleDependencies": [
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "wizards",
|
|
3
3
|
"displayName": "engenty wizards",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.16.0",
|
|
5
5
|
"description": "Build page-by-page AI wizards that people open on a shared link — designed, tested and published from Claude Code — run your published ones in the chat, and keep them in a pane beside it.",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "engenty"
|
package/plugin/plugin.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://agent-plugins.org/schemas/1.0.0/plugin.schema.json",
|
|
3
3
|
"name": "engenty-wizards",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.16.0",
|
|
5
5
|
"description": "Build page-by-page AI wizards that people open on a shared link, test and publish them from the chat, and run your published ones here.",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "engenty",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{n as t,t as n}from"./jsx-runtime-BNakU3Ej.js";import{Hn as r,Qt as i,Xn as a,Xt as o,Yt as s,Zt as c,cn as l,ln as u,on as d,rn as f}from"./ui-CktezodE.js";import{t as p}from"./preload-helper-DpV6A1kQ.js";import{t as m}from"./logo-BpnjXTRy.js";import{s as h}from"./i18n-0fUKyVRE.js";import{g,h as _,m as v,t as y,u as b}from"./UpdateCheck-D6x7MqEl.js";import{ReleaseNotes as x,loadReleases as S,releaseDate as C,releaseLabel as w}from"./ChangelogDialog-Do7pwmFv.js";var T=e(t(),1),E=[{name:`engenty wizards`,description:`credit.engenty-wizards`,homepage:`https://github.com/engenty/wizards`,license:`FSL-1.1-MIT`},{name:`engenty`,description:`credit.engenty`,homepage:`https://github.com/engenty/engenty`,license:`FSL-1.1-MIT`}],D=[{name:`Mastra`,description:`credit.mastra`,homepage:`https://github.com/mastra-ai/mastra`,license:`Apache-2.0`},{name:`AI SDK`,description:`credit.ai-sdk`,homepage:`https://github.com/vercel/ai`,license:`Apache-2.0`},{name:`Model Context Protocol`,description:`credit.model-context-protocol`,homepage:`https://github.com/modelcontextprotocol/typescript-sdk`,license:`MIT`},{name:`Hono`,description:`credit.hono`,homepage:`https://github.com/honojs/hono`,license:`MIT`},{name:`Drizzle ORM`,description:`credit.drizzle-orm`,homepage:`https://github.com/drizzle-team/drizzle-orm`,license:`Apache-2.0`},{name:`libSQL`,description:`credit.libsql`,homepage:`https://github.com/tursodatabase/libsql`,license:`MIT`},{name:`Playwright`,description:`credit.playwright`,homepage:`https://github.com/microsoft/playwright`,license:`Apache-2.0`},{name:`React`,description:`credit.react`,homepage:`https://github.com/facebook/react`,license:`MIT`},{name:`Vite`,description:`credit.vite`,homepage:`https://github.com/vitejs/vite`,license:`MIT`},{name:`Tailwind CSS`,description:`credit.tailwind-css`,homepage:`https://github.com/tailwindlabs/tailwindcss`,license:`MIT`},{name:`React Flow`,description:`credit.react-flow`,homepage:`https://github.com/xyflow/xyflow`,license:`MIT`},{name:`TanStack Query`,description:`credit.tanstack-query`,homepage:`https://github.com/TanStack/query`,license:`MIT`},{name:`xterm.js`,description:`credit.xterm-js`,homepage:`https://github.com/xtermjs/xterm.js`,license:`MIT`},{name:`Lucide`,description:`credit.lucide`,homepage:`https://github.com/lucide-icons/lucide`,license:`ISC`},{name:`Geist & Geist Mono`,description:`credit.geist-geist-mono`,homepage:`https://github.com/vercel/geist-font`,license:`OFL-1.1`},{name:`Space Grotesk`,description:`credit.space-grotesk`,homepage:`https://github.com/floriankarsten/space-grotesk`,license:`OFL-1.1`},{name:`git-cliff`,description:`credit.git-cliff`,homepage:`https://github.com/orhun/git-cliff`,license:`MIT OR Apache-2.0`}],O=e(n(),1),k=(e,...t)=>t.some(t=>t?.toLowerCase().includes(e));function A({name:e,homepage:t,version:n,license:i,description:a}){return(0,O.jsxs)(`li`,{className:`py-2.5`,children:[(0,O.jsxs)(`div`,{className:`flex flex-wrap items-baseline gap-x-2.5 gap-y-0.5`,children:[t?(0,O.jsxs)(`a`,{href:t,target:`_blank`,rel:`noreferrer`,className:`inline-flex items-center gap-1 font-medium text-[0.875rem] text-ink underline-offset-4 hover:underline`,children:[e,(0,O.jsx)(r,{"aria-hidden":!0,className:`size-3 text-ink-4`})]}):(0,O.jsx)(`span`,{className:`font-medium text-[0.875rem] text-ink`,children:e}),n?(0,O.jsx)(`span`,{className:`text-[0.75rem] text-ink-3 tabular-nums`,children:n}):null,(0,O.jsx)(`span`,{className:`text-[0.75rem] text-ink-3`,children:i})]}),a?(0,O.jsx)(`p`,{className:`mt-0.5 text-[0.8125rem] text-ink-3`,children:a}):null]})}function j({title:e,hint:t,children:n}){return(0,O.jsxs)(`section`,{className:`mt-6`,children:[(0,O.jsx)(`h3`,{className:`border-border-soft border-b pb-2 font-display font-semibold text-[1rem]`,children:e}),t?(0,O.jsx)(`p`,{className:`mt-2 text-[0.8125rem] text-ink-3`,children:t}):null,n]})}function M({credits:e}){return(0,O.jsx)(`ul`,{className:`divide-y divide-border-soft`,children:e.map(e=>(0,O.jsx)(A,{name:e.name,homepage:e.homepage,license:e.license,description:h(e.description)},e.name))})}function N({label:e,packages:t}){return(0,O.jsxs)(`div`,{className:`mt-4`,children:[(0,O.jsx)(`h4`,{className:`font-medium text-[0.75rem] text-ink-3 tracking-wide`,children:e}),(0,O.jsx)(`ul`,{className:`divide-y divide-border-soft`,children:t.map(e=>(0,O.jsx)(A,{...e},e.name))})]})}function P({active:e}){let[t,n]=(0,T.useState)(null),[r,a]=(0,T.useState)(``);(0,T.useEffect)(()=>{if(!e||t)return;let r=!1;return p(()=>import(`./oss-credits-IdX5bc71.js`).then(e=>{r||n(e.default)}),[]),()=>{r=!0}},[e,t]),(0,T.useEffect)(()=>{e||a(``)},[e]);let s=r.trim().toLowerCase(),c=e=>s?e.filter(e=>k(s,e.name,e.license,h(e.description))):e,l=e=>s?e.filter(e=>k(s,e.name,e.license,e.version)):e,u=c(E),d=c(D),m=t?[{id:`shared`,label:h(`about.creditsShared`),packages:l(t.shared)},...t.groups.map(e=>({id:e.id,label:e.label,packages:l(e.packages)}))].filter(e=>e.packages.length>0):[],g=u.length===0&&d.length===0&&m.length===0;return(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`p`,{className:`mb-4 text-[0.875rem] text-ink-3`,children:h(`about.creditsHint`)}),(0,O.jsx)(i,{type:`search`,value:r,placeholder:h(`about.search`),onChange:e=>a(e.target.value)}),u.length>0?(0,O.jsx)(j,{title:h(`about.creditsProduct`),children:(0,O.jsx)(M,{credits:u})}):null,d.length>0?(0,O.jsx)(j,{title:h(`about.creditsBuiltWith`),children:(0,O.jsx)(M,{credits:d})}):null,t===null?(0,O.jsx)(`div`,{className:`flex justify-center py-10 text-ink-3`,children:(0,O.jsx)(f,{})}):m.length>0?(0,O.jsx)(j,{title:h(`about.creditsDeps`),hint:s?void 0:h(`about.creditsDepsHint`),children:m.map(e=>(0,O.jsx)(N,{label:e.label,packages:e.packages},e.id))}):null,t!==null&&g?(0,O.jsx)(o,{children:h(`about.noMatches`)}):null]})}var F=[`new`,`earlier`,`credits`],I=e=>h(e===`new`?`about.tab.new`:e===`earlier`?`about.tab.earlier`:`about.credits`),L=e=>e===1?h(`about.change`):h(`about.changes`,{n:e});function R({me:e,active:t,initialTab:n=`new`}){let r=e?.mode===`local`,{data:i,latest:o}=_(r&&t),[s,c]=(0,T.useState)(null),[u,p]=(0,T.useState)(n);(0,T.useEffect)(()=>p(n),[n]);let E=v(F.indexOf(u)),D=i?.newer&&o?o:g;(0,T.useEffect)(()=>{if(!t)return;let e=!1;return c(null),S(D===`0.15.0`?void 0:D).then(t=>{e||c(t)}),()=>{e=!0}},[t,D]);let k=s?.find(e=>e.version===`v${D}`)??s?.[0]??null,A=s?.filter(e=>e!==k)??[],j=r?i?.kind??null:`cloud`;return(0,O.jsxs)(O.Fragment,{children:[(0,O.jsxs)(`div`,{className:`flex flex-col items-center pt-4 text-center`,children:[(0,O.jsx)(m,{size:96}),(0,O.jsxs)(`div`,{className:`mt-4 font-display font-semibold text-[1.5rem] tracking-tight`,children:[`engenty`,(0,O.jsx)(`span`,{className:`text-ember`,children:`.`}),(0,O.jsx)(`span`,{className:`ml-1.5 font-normal text-ink-3`,children:`wizards`})]}),(0,O.jsxs)(`div`,{className:`mt-1 text-[0.9375rem] text-ink-3 tabular-nums`,children:[h(`about.version`,{v:g}),j?` · ${h(`about.kind.${j}`)}`:``]})]}),r?(0,O.jsx)(`div`,{className:`mt-5`,children:(0,O.jsx)(y,{enabled:t})}):null,(0,O.jsx)(`div`,{className:`mt-6 flex justify-center`,children:(0,O.jsx)(d,{value:u,onChange:p,options:F.map(e=>({id:e,label:I(e)})),label:h(`about.title`)})}),(0,O.jsxs)(`div`,{className:l(`mt-5`,b(E)),children:[u===`new`?s===null?(0,O.jsx)(`div`,{className:`flex justify-center py-6 text-ink-3`,children:(0,O.jsx)(f,{})}):k?(0,O.jsxs)(O.Fragment,{children:[(0,O.jsxs)(`h3`,{className:`flex items-baseline gap-3 border-border-soft border-b pb-2 font-display font-semibold text-[1rem]`,children:[w(k),(0,O.jsx)(`span`,{className:`font-normal font-sans text-[0.8125rem] text-ink-3 tabular-nums`,children:C(k)})]}),(0,O.jsx)(`div`,{className:`mt-3`,children:(0,O.jsx)(x,{release:k})})]}):(0,O.jsx)(`p`,{className:`text-[0.875rem] text-ink-3`,children:h(`about.changelogEmpty`)}):null,u===`earlier`?(0,O.jsx)(`div`,{className:`flex flex-col divide-y divide-border-soft`,children:A.map(e=>(0,O.jsxs)(`details`,{className:`group/r py-2`,children:[(0,O.jsxs)(`summary`,{className:`flex cursor-pointer list-none items-baseline gap-3 text-[0.875rem] [&::-webkit-details-marker]:hidden`,children:[(0,O.jsx)(a,{className:`size-3.5 shrink-0 self-center text-ink-4 transition group-open/r:rotate-90`}),(0,O.jsx)(`span`,{className:`font-medium text-ink tabular-nums`,children:w(e)}),(0,O.jsx)(`span`,{className:`text-[0.8125rem] text-ink-3 tabular-nums`,children:C(e)}),(0,O.jsx)(`span`,{className:`ml-auto text-[0.8125rem] text-ink-4`,children:L(e.commits.length)})]}),(0,O.jsx)(`div`,{className:`mt-2 pl-6`,children:(0,O.jsx)(x,{release:e})})]},e.version??`unreleased`))}):null,u===`credits`?(0,O.jsx)(P,{active:!0}):null]},u)]})}function z({open:e,onClose:t,me:n}){return(0,O.jsxs)(s,{open:e,onClose:t,wide:!0,height:`tall`,children:[(0,O.jsx)(`div`,{className:`-mt-2 -mr-2 sticky top-0 z-10 flex h-0 justify-end`,children:(0,O.jsx)(c,{label:h(`common.close`),onClick:t,children:(0,O.jsx)(u,{className:`size-4`})})}),(0,O.jsx)(R,{me:n,active:e})]})}export{z as AboutDialog,R as AboutPanel};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/SkillEditor-BsXTqNli.js","assets/rolldown-runtime-hePW80VL.js","assets/jsx-runtime-BNakU3Ej.js","assets/ui-CktezodE.js","assets/preload-helper-DpV6A1kQ.js","assets/i18n-0fUKyVRE.js","assets/useMutation-7_FOHoEl.js","assets/Skills-C_X1ZsKg.js","assets/circle-check-jqtsKi_b.js","assets/upload-CHGCFVZK.js","assets/code-xml-q88cSTV8.js","assets/scroll-text-2BhJO_W7.js","assets/eye-CgkvVlba.js","assets/code-editor-BpCEnf8H.js","assets/dist-EBVTpvRr.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{n as t,t as n}from"./jsx-runtime-BNakU3Ej.js";import{$n as r,$t as i,G as a,Jt as o,Kt as s,Qn as c,Qt as l,Wr as u,Xn as d,Xt as f,Yt as p,_r as m,b as h,bn as g,cn as _,dr as v,fr as y,gr as b,lr as x,m as S,nn as C,on as w,q as T,qt as E,rn as D,sr as O,vn as k,vr as A,wn as j,yr as M}from"./ui-CktezodE.js";import{t as N}from"./useMutation-7_FOHoEl.js";import{t as P}from"./preload-helper-DpV6A1kQ.js";import{Lt as F,Nt as I,Pt as ee,Qt as te,Rt as ne,a as re,l as ie,m as ae,p as L,t as oe,un as se}from"./host-Bd_bon_c.js";import{a as ce,f as le,o as ue,r as de,s as R}from"./Skills-C_X1ZsKg.js";import{n as z}from"./volume-2-Bw5KASy8.js";import{i as B,n as V,o as fe,r as pe,s as me,t as H}from"./connection-sign-in-UJ6xk-TD.js";import{t as U}from"./scroll-text-2BhJO_W7.js";import{b as he,d as W,n as ge,u as G}from"./session-CpYa5hwd.js";import{n as K,s as q}from"./i18n-0fUKyVRE.js";import{a as _e,c as ve,d as ye,f as be,i as xe,m as Se,p as Ce,r as we,u as Te}from"./UpdateCheck-D6x7MqEl.js";var Ee={name:`compass`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m16.24 7.76-1.804 5.411a2 2 0 0 1-1.265 1.265L7.76 16.24l1.804-5.411a2 2 0 0 1 1.265-1.265z`,key:`9ktpf1`}]]};Ee.node;var De=O(Ee),J=e(t(),1),Oe=[`admins`,`members`,`all`],ke=[`read`,`write`,`destructive`,`send`],Ae=[`allow`,`ask`,`deny`],je={name:80,perSpace:200},Y=e(n(),1),X=e=>[`space-connections`,e];function Me(e){return M({enabled:!!e,queryKey:X(e),queryFn:()=>T.get(`/api/studio/spaces/${e}/connections`)})}function Ne(e){return M({enabled:!!e,queryKey:a.connectors(e),queryFn:()=>T.get(`/api/studio/spaces/${e}/connectors`)})}function Pe(e,t,n){let r=new Set(t.map(e=>e.connectorId));return e.filter(e=>e.sourceKind===`builtin`&&!r.has(e.id)&&(e.usable||n))}var Z={admins:`connection.audience.admins`,members:`connection.audience.members`,all:`connection.audience.all`},Fe={admins:`connection.audience.adminsHint`,members:`connection.audience.membersHint`,all:`connection.audience.allHint`},Ie={read:`connection.kind.read`,write:`connection.kind.write`,destructive:`connection.kind.destructive`,send:`connection.kind.send`},Le={read:`connection.kind.readHint`,write:`connection.kind.writeHint`,destructive:`connection.kind.destructiveHint`,send:`connection.kind.sendHint`},Re={allow:`connection.outcome.allow`,ask:`connection.outcome.ask`,deny:`connection.outcome.deny`},ze={space:`connection.signIn.space`,person:`connection.signIn.person`},Be={space:`connection.signIn.spaceHint`,person:`connection.signIn.personHint`},Ve=e=>new Intl.DateTimeFormat(K,{dateStyle:`medium`}).format(new Date(e));function He(e){let t=Math.round((Date.parse(e)-Date.now())/1e3),n=new Intl.RelativeTimeFormat(K,{numeric:`auto`});for(let[e,r]of[[`day`,86400],[`hour`,3600],[`minute`,60]])if(Math.abs(t)>=r)return n.format(Math.round(t/r),e);return n.format(0,`minute`)}function Q(e){let t=e.connector?.name??e.connectorId;return e.name===t?e.name:`${t} · ${e.name}`}function Ue(e){return e.signIn===`space`?e.account?q(`connection.asSpaceAccount`,{label:e.account.label}):q(`connection.asSpaceNotYet`):q(`connection.eachPersonCount`,{n:e.signedIn})}function We(e){return e.lastUsedAt?q(`connection.lastUsed`,{when:He(e.lastUsedAt)}):q(`connection.neverUsed`)}function Ge(e){let t=e.toLowerCase().replace(/^https?:\/\//,``).split(`/`)[0].split(`.`);return t.length>1?t[t.length-2]:t[0]}function Ke(e,t){if(!e)return null;let n=t.find(t=>t.id===e);if(n)return{connectorId:n.id};let r=t.find(t=>t.domain&&t.domain===e.toLowerCase());if(r)return{connectorId:r.id};let i=Ge(e),a=t.find(e=>e.sourceKind===`builtin`&&(e.id===i||e.id.endsWith(`-${i}`)||e.name.toLowerCase()===i));return a?{connectorId:a.id}:e.includes(`.`)?{domain:e}:null}function qe({name:e,large:t}){return(0,Y.jsx)(`span`,{"aria-hidden":`true`,className:_(`flex shrink-0 items-center justify-center rounded-lg bg-paper-2 font-semibold text-ink-2`,t?`size-12 text-[0.9375rem]`:`size-9 text-[0.75rem]`),children:ge(e)||`?`})}function Je(){let[e,t]=v(),{space:n}=G(),r=W(),{narrow:i}=Ce(),a=u(),o=n?.id??``,s=e.get(`show`),c=e.get(`setup`),l=r&&!n?.readOnly,d=Me(o),f=Ne(o),p=d.data?.connections??[],m=p.find(e=>e.id===s)??null;ye(m?Q(m):null),pe((0,J.useCallback)(()=>{a.invalidateQueries({queryKey:[`space-connections`]}),a.invalidateQueries({queryKey:[`person-sign-ins`]})},[a])),(0,J.useEffect)(()=>{i||L().scrollTo({top:0})},[i,s]);let h=e=>i?t({show:e}):t(e===`all`?{}:{show:e},{replace:!0});return(0,Y.jsx)(Y.Fragment,{children:n?(0,Y.jsx)(`div`,{className:`flex flex-col gap-9 pb-20`,children:m?(0,Y.jsx)(Qe,{connection:m,connector:f.data?.find(e=>e.id===m.connectorId),writable:l,onGone:()=>h(`all`)},m.id):(0,Y.jsx)(Ye,{spaceId:n.id,connections:p,loading:d.isPending,error:d.error,connectors:f.data??[],writable:l,setup:c,onOpen:h,onSetUp:e=>{t({setup:e},{replace:!i}),i||L().scrollTo({top:0,behavior:`smooth`})},onSetUpDone:()=>t({},{replace:!0})})}):null})}function Ye({spaceId:e,connections:t,loading:n,error:r,connectors:i,writable:a,setup:o,onOpen:c,onSetUp:l,onSetUpDone:u}){let d=I(`unsetConnectors`),p=(0,J.useRef)(null),m=o&&i.length?Ke(o,i):null,g=m&&`domain`in m?m.domain:null;(0,J.useEffect)(()=>{g&&p.current?.scrollIntoView({block:`start`,behavior:`smooth`})},[g]);let v=Pe(i,t,d);return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)(h,{title:q(`capabilities.connectors`),hint:q(`capabilities.connectors.hint`),plain:!0,action:a&&o===null?(0,Y.jsxs)(s,{size:`sm`,onClick:()=>l(``),children:[(0,Y.jsx)(j,{className:`size-4`}),` `,q(`capabilities.connectors.add`)]}):null,children:[a&&o!==null?(0,Y.jsx)(Ze,{spaceId:e,connectors:i,initial:m&&`connectorId`in m?m.connectorId:``,onCancel:u,onDone:c},m&&`connectorId`in m?m.connectorId:`new`):null,(0,Y.jsx)(`h3`,{className:`px-1 pt-2 font-display font-semibold text-base`,children:q(`capabilities.inSpace`)}),r?(0,Y.jsx)(`p`,{className:`px-1 text-[0.875rem] text-rose`,children:r.message}):t.length?(0,Y.jsx)(E,{className:`flex flex-col divide-y divide-border-soft p-0`,children:t.map(e=>(0,Y.jsx)(Xe,{connection:e,onOpen:()=>c(e.id)},e.id))}):n?null:(0,Y.jsx)(E,{children:(0,Y.jsx)(f,{children:q(a?`capabilities.connectors.noneAdmin`:`capabilities.connectors.none`)})})]}),v.length?(0,Y.jsxs)(`div`,{className:`flex flex-col gap-2 px-1`,children:[(0,Y.jsx)(`h3`,{className:`font-semibold text-[0.875rem]`,children:q(`capabilities.connectors.builtin`)}),(0,Y.jsx)(`p`,{className:`text-[0.8125rem] text-ink-3`,children:q(a?`capabilities.connectors.builtinHint`:`capabilities.connectors.builtinHintMember`)}),(0,Y.jsx)(`ul`,{className:`flex flex-wrap gap-1.5`,children:v.map(e=>(0,Y.jsx)(`li`,{children:a&&e.usable?(0,Y.jsxs)(`button`,{type:`button`,onClick:()=>l(e.id),title:q(`capabilities.connectors.setUpNamed`,{name:e.name}),className:`inline-flex h-8 items-center gap-1.5 rounded-full bg-paper-2 px-3 text-[0.8125rem] text-ink-2 transition hover:bg-paper-3 hover:text-ink`,children:[(0,Y.jsx)(j,{className:`size-3.5`,"aria-hidden":`true`}),e.name]}):(0,Y.jsx)(`span`,{title:e.missingSetup??void 0,className:_(`inline-flex h-8 items-center rounded-full bg-paper-2 px-3 text-[0.8125rem] text-ink-3`,!e.usable&&`opacity-60`),children:e.name})},e.id))})]}):null,(0,Y.jsx)(`div`,{ref:p,className:`scroll-mt-6`,children:(0,Y.jsx)(h,{title:q(`capabilities.connectors.more`),hint:q(`capabilities.connectors.moreHint`),children:(0,Y.jsx)(me,{spaceId:e,readOnly:!a,embedded:!0,onSetUp:a?l:void 0,domain:g})})})]})}function Xe({connection:e,onOpen:t}){let n=u(),r=B(`/api/studio/connections/${encodeURIComponent(e.id)}/my-sign-in`,()=>n.invalidateQueries({queryKey:X(e.spaceId)})),i=Object.values(e.rules).includes(`ask`),a=e.signIn===`person`;return(0,Y.jsxs)(`div`,{className:`px-3.5 py-3 sm:px-5`,children:[(0,Y.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,Y.jsxs)(`button`,{type:`button`,onClick:t,className:`-my-1 -ml-1 flex min-w-0 flex-1 items-center gap-3 rounded-lg p-1 text-left transition hover:bg-paper-2`,children:[(0,Y.jsx)(qe,{name:e.connector?.name??e.connectorId}),(0,Y.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Y.jsx)(`div`,{className:`truncate text-[0.9375rem]`,children:Q(e)}),(0,Y.jsxs)(`div`,{className:`flex items-center gap-1.5 text-[0.8125rem] text-ink-3`,children:[a?(0,Y.jsx)(F,{className:`size-3.5 shrink-0`,"aria-hidden":`true`}):(0,Y.jsx)(se,{className:`size-3.5 shrink-0`,"aria-hidden":`true`}),(0,Y.jsxs)(`span`,{className:`truncate`,children:[Ue(e),` · `,We(e)]})]})]}),(0,Y.jsxs)(`span`,{className:`flex shrink-0 items-center gap-1.5 max-sm:hidden`,children:[i?(0,Y.jsx)(o,{tone:`warn`,children:q(`connection.outcome.ask`)}):null,(0,Y.jsx)(o,{children:q(Z[e.audience])})]})]}),a?(0,Y.jsx)(H,{s:r,auth:e.connector?.auth,signedIn:!!e.mySignIn}):null]}),a?(0,Y.jsx)(V,{s:r,fields:e.connector?.fields??[],signedIn:!!e.mySignIn,confirmText:q(`konto.connectionSignOutConfirm`,{name:Q(e)}),className:`ml-12`}):null]})}function Ze({spaceId:e,connectors:t,initial:n,onCancel:r,onDone:a}){let o=u(),c=t.filter(e=>e.usable),[d,f]=(0,J.useState)(c.some(e=>e.id===n)?n:``),p=c.find(e=>e.id===d),[m,h]=(0,J.useState)(p?.name??``),[g,_]=(0,J.useState)(p?.auth===`oauth2`?`person`:`space`),[v,y]=(0,J.useState)(`members`),b=N({mutationFn:()=>T.post(`/api/studio/spaces/${e}/connections`,{connectorId:d,name:m.trim()||p?.name,signIn:g,audience:v}),onSuccess:async t=>{await o.invalidateQueries({queryKey:X(e)}),await o.invalidateQueries({queryKey:[`person-sign-ins`]}),a(t.id)}});return(0,Y.jsx)(E,{className:`p-3.5 sm:p-5`,children:(0,Y.jsxs)(`form`,{onSubmit:e=>{e.preventDefault(),d&&b.mutate()},className:`flex flex-col gap-5`,children:[(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(`h3`,{className:`font-display font-semibold text-base`,children:q(`capabilities.connectors.add`)}),(0,Y.jsx)(`p`,{className:`mt-1 text-[0.8125rem] text-ink-3`,children:q(`connection.setupHint`)})]}),(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(i,{children:q(`connection.connector`)}),(0,Y.jsx)(C,{value:d,onChange:e=>{let t=c.find(t=>t.id===e);(!m.trim()||m===p?.name)&&h(t?.name??``),f(e)},placeholder:q(`connection.connectorPick`),options:c.map(e=>({value:e.id,label:e.name}))})]}),(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(i,{hint:q(`connection.nameHint`),children:q(`connection.name`)}),(0,Y.jsx)(l,{value:m,maxLength:je.name,placeholder:q(`connection.namePlaceholder`),onChange:e=>h(e.target.value)})]}),(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(i,{hint:q(Be[g]),children:q(`connection.signIn`)}),(0,Y.jsx)(w,{label:q(`connection.signIn`),value:g,onChange:_,options:[`space`,`person`].map(e=>({id:e,label:q(ze[e])}))}),(0,Y.jsx)(`p`,{className:`mt-2 text-[0.75rem] text-ink-3`,children:q(`connection.signInFixed`)})]}),(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(i,{hint:q(Fe[v]),children:q(`connection.audience`)}),(0,Y.jsx)(w,{label:q(`connection.audience`),value:v,onChange:y,options:Oe.map(e=>({id:e,label:q(Z[e])}))})]}),b.error?(0,Y.jsx)(`p`,{className:`text-[0.8125rem] text-rose`,children:b.error.message}):null,(0,Y.jsxs)(`div`,{className:`flex gap-2`,children:[(0,Y.jsx)(s,{type:`submit`,busy:b.isPending,disabled:!d,children:q(`capabilities.connectors.setUp`)}),(0,Y.jsx)(s,{type:`button`,variant:`ghost`,onClick:r,children:q(`orgSettings.cancel`)})]})]})})}function Qe({connection:e,connector:t,writable:n,onGone:r}){let i=u(),a=X(e.spaceId),c=()=>i.invalidateQueries({queryKey:a}),[d,f]=(0,J.useState)(e.name),[p,m]=(0,J.useState)(!1),h=`/api/studio/connections/${encodeURIComponent(e.id)}`,g=N({mutationFn:e=>T.patch(h,e),onSuccess:e=>{i.setQueryData(a,t=>t&&{connections:t.connections.map(t=>t.id===e.id?e:t)}),i.invalidateQueries({queryKey:[`person-sign-ins`]})}}),_=N({mutationFn:()=>T.del(h),onSuccess:async()=>{await c(),i.invalidateQueries({queryKey:[`person-sign-ins`]}),r()}}),v=B(`${h}/sign-in`,c),y=B(`${h}/my-sign-in`,c),b=()=>{let t=d.trim();t&&t!==e.name?g.mutate({name:t}):f(e.name)},x=e.connector?.name??e.connectorId,S=e.connector?.fields??[],C=e.setUpByName?q(`konto.connectionSetUpBy`,{name:e.setUpByName,when:Ve(e.setUpAt)}):q(`konto.connectionSetUpAt`,{when:Ve(e.setUpAt)}),D=n=>(t?.actions??[]).filter(e=>e.group===n).filter(t=>!e.actions.length||e.actions.includes(t.id));return(0,Y.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[(0,Y.jsxs)(`div`,{className:`flex items-center gap-4 px-1`,children:[(0,Y.jsx)(qe,{name:x,large:!0}),(0,Y.jsxs)(`div`,{className:`min-w-0`,children:[(0,Y.jsx)(`h2`,{className:`font-display font-semibold text-lg leading-tight`,children:x}),e.connector?.description?(0,Y.jsx)(`p`,{className:`mt-1 line-clamp-2 text-[0.875rem] text-ink-3`,children:e.connector.description}):null]})]}),(0,Y.jsxs)(E,{className:`flex flex-col gap-5 p-3.5 sm:p-5`,children:[(0,Y.jsxs)(`div`,{className:`flex flex-wrap items-baseline justify-between gap-x-4 gap-y-1`,children:[n?(0,Y.jsx)(l,{"aria-label":q(`connection.name`),className:`max-w-sm font-semibold`,value:d,maxLength:je.name,onChange:e=>f(e.target.value),onBlur:b,onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),b())}}):(0,Y.jsx)(`b`,{className:`text-[0.9375rem]`,children:e.name}),(0,Y.jsx)(`span`,{className:`text-[0.8125rem] text-ink-3`,children:n?C:q(`connection.adminsManage`)})]}),(0,Y.jsx)($,{label:q(`connection.signIn`),children:(0,Y.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,Y.jsxs)(`span`,{className:`flex items-center gap-1.5 text-[0.875rem]`,children:[e.signIn===`space`?(0,Y.jsx)(se,{className:`size-4 text-ink-3`,"aria-hidden":`true`}):(0,Y.jsx)(F,{className:`size-4 text-ink-3`,"aria-hidden":`true`}),q(ze[e.signIn])]}),(0,Y.jsx)(`span`,{className:`text-[0.8125rem] text-ink-3`,children:q(Be[e.signIn])})]})}),e.signIn===`space`?(0,Y.jsx)($,{label:q(`connection.account`),children:(0,Y.jsxs)(`div`,{className:`flex flex-col`,children:[(0,Y.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,Y.jsx)(`span`,{className:`text-[0.875rem]`,children:e.account?q(`connection.accountSignedIn`,{label:e.account.label}):q(n?`connection.accountNotYetAdmin`:`connection.accountNotYet`)}),n?(0,Y.jsx)(H,{s:v,auth:e.connector?.auth,signedIn:!!e.account}):null]}),n?(0,Y.jsx)(V,{s:v,fields:S,signedIn:!!e.account,confirmText:q(`connection.signOutSpaceConfirm`,{name:Q(e)})}):null]})}):(0,Y.jsx)($,{label:q(`connection.people`),children:(0,Y.jsxs)(`div`,{className:`flex flex-col`,children:[(0,Y.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,Y.jsxs)(`span`,{className:`text-[0.875rem]`,children:[q(`connection.peopleSignedIn`,{n:e.signedIn}),` · `,e.mySignIn?q(`connection.youSignedIn`,{label:e.mySignIn.label}):q(`connection.youNotYet`)]}),(0,Y.jsx)(H,{s:y,auth:e.connector?.auth,signedIn:!!e.mySignIn})]}),(0,Y.jsx)(V,{s:y,fields:S,signedIn:!!e.mySignIn,confirmText:q(`konto.connectionSignOutConfirm`,{name:Q(e)})})]})}),(0,Y.jsx)($,{label:q(`connection.audience`),children:(0,Y.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[n?(0,Y.jsx)(`div`,{children:(0,Y.jsx)(w,{label:q(`connection.audience`),value:e.audience,onChange:e=>g.mutate({audience:e}),options:Oe.map(e=>({id:e,label:q(Z[e])}))})}):(0,Y.jsx)(`span`,{children:(0,Y.jsx)(o,{children:q(Z[e.audience])})}),(0,Y.jsx)(`span`,{className:`text-[0.8125rem] text-ink-3`,children:q(Fe[e.audience])})]})}),(0,Y.jsx)(`div`,{className:`border-border-soft border-t`}),(0,Y.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,Y.jsx)(`h3`,{className:`font-semibold text-[0.875rem]`,children:q(`connection.rules`)}),ke.map(t=>{let r=D(t);return(0,Y.jsxs)(`div`,{className:`flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between sm:gap-4`,children:[(0,Y.jsxs)(`div`,{className:`min-w-0`,children:[(0,Y.jsx)(`div`,{className:`font-medium text-[0.875rem]`,children:q(Ie[t])}),(0,Y.jsx)(`div`,{className:`text-[0.8125rem] text-ink-3`,children:q(Le[t])}),r.length?(0,Y.jsx)(`div`,{className:`mt-0.5 truncate font-mono text-[0.6875rem] text-ink-4`,children:r.map(e=>e.id).join(` · `)}):null]}),(0,Y.jsx)(`div`,{className:`shrink-0`,children:n?(0,Y.jsx)(w,{label:q(Ie[t]),value:e.rules[t],onChange:n=>g.mutate({rules:{...e.rules,[t]:n}}),options:Ae.map(e=>({id:e,label:q(Re[e])}))}):(0,Y.jsx)(o,{tone:e.rules[t]===`ask`?`warn`:`neutral`,children:q(Re[e.rules[t]])})})]},t)}),(0,Y.jsx)(`p`,{className:`text-[0.8125rem] text-ink-3`,children:q(n?`connection.askHint`:`connection.askHintMember`)})]}),g.error?(0,Y.jsx)(`p`,{className:`text-[0.8125rem] text-rose`,children:g.error.message}):null]}),(0,Y.jsx)(E,{className:`flex flex-col gap-1 p-3.5 sm:p-5`,children:(0,Y.jsx)($,{label:q(`connection.use`),children:(0,Y.jsx)(`span`,{className:`text-[0.875rem]`,children:We(e)})})}),n?(0,Y.jsxs)(`div`,{className:`px-1`,children:[p?(0,Y.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3 rounded-lg bg-paper p-3 text-[0.875rem] ring-1 ring-border-soft`,children:[(0,Y.jsx)(`p`,{className:`min-w-48 flex-1`,children:q(`connection.removeConfirm`,{name:Q(e)})}),(0,Y.jsx)(s,{variant:`ghost`,onClick:()=>m(!1),children:q(`orgSettings.cancel`)}),(0,Y.jsx)(s,{variant:`danger`,busy:_.isPending,onClick:()=>_.mutate(),children:q(`connection.remove`)})]}):(0,Y.jsx)(s,{variant:`danger`,size:`sm`,onClick:()=>m(!0),children:q(`connection.remove`)}),_.error?(0,Y.jsx)(`p`,{className:`mt-2 text-[0.8125rem] text-rose`,children:_.error.message}):null]}):null]})}function $({label:e,children:t}){return(0,Y.jsxs)(`div`,{className:`grid gap-1.5 sm:grid-cols-[11rem_minmax(0,1fr)] sm:gap-4`,children:[(0,Y.jsx)(`span`,{className:`pt-0.5 text-[0.8125rem] text-ink-3`,children:e}),t]})}var $e=[`discover.example1`,`discover.example2`,`discover.example3`],et=(e,t)=>t===void 0?[`discover`,e]:[`discover`,e,t];function tt(){let[e,t]=v(),n=e.get(`q`)??``,[r,i]=(0,J.useState)(n);return(0,J.useEffect)(()=>i(e=>e.trim()===n.trim()?e:n),[n]),(0,J.useEffect)(()=>{let e=r.trim();if(e===n.trim())return;let i=setTimeout(()=>t(t=>{let n=new URLSearchParams(t);return e?n.set(`q`,e):n.delete(`q`),n},{replace:!0}),350);return()=>clearTimeout(i)},[r,n,t]),[r,i,n.trim()]}function nt({asked:e,onExample:t}){let{space:n}=G(),r=W(),i=I(`skills`),o=u(),[c,l]=(0,J.useState)(null),d=n?.id??``,f=M({queryKey:et(d,e),queryFn:()=>T.get(`/api/studio/spaces/${d}/discover?q=${encodeURIComponent(e)}`),enabled:!!d&&e.length>=2,staleTime:6e4}),m=e=>{o.setQueriesData({queryKey:et(d)},t=>t&&{...t,skills:t.skills.map(t=>t.ref===e?{...t,added:!0}:t)}),o.invalidateQueries({queryKey:a.skills(d)})},h=N({mutationFn:e=>T.post(`/api/studio/spaces/${d}/skills/registry`,{ref:e,mode:`demand`}),onSuccess:(e,t)=>m(t)}),_=f.data,v=_&&!_.skills.length&&!_.connectors.length&&!_.errors.skills&&!_.errors.connectors;return n?(0,Y.jsxs)(Y.Fragment,{children:[e.length<2?(0,Y.jsxs)(`div`,{className:`flex flex-col gap-3 px-1 text-[0.875rem] text-ink-3`,children:[(0,Y.jsx)(`p`,{children:q(`discover.start`)}),(0,Y.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:$e.map(e=>(0,Y.jsxs)(s,{variant:`secondary`,size:`sm`,onClick:()=>t(q(e)),children:[(0,Y.jsx)(g,{className:`size-3.5`}),` `,q(e)]},e))})]}):f.error?(0,Y.jsx)(`p`,{className:`px-1 text-[0.875rem] text-rose`,children:f.error.message}):_?v?(0,Y.jsx)(`p`,{className:`px-1 text-[0.875rem] text-ink-3`,children:q(`discover.none`,{q:e})}):(0,Y.jsxs)(Y.Fragment,{children:[i?(0,Y.jsx)(rt,{title:q(`space.skills`),count:_.skills.length,error:_.errors.skills,empty:q(`discover.groupNone`,{directory:`skills.sh`}),children:_.skills.map(e=>(0,Y.jsx)(ot,{hit:e,adding:h.isPending&&h.variables===e.ref,failed:h.isError&&h.variables===e.ref?h.error:null,onLook:()=>l(e.ref),onAdd:()=>h.mutate(e.ref)},e.ref))}):null,(0,Y.jsx)(rt,{title:q(`capabilities.connectors`),count:_.connectors.length,error:_.errors.connectors,empty:q(`discover.groupNone`,{directory:`integrations.sh`}),children:_.connectors.map(e=>(0,Y.jsx)(st,{hit:e,admin:r},e.domain))})]}):(0,Y.jsx)(`div`,{className:`flex justify-center py-16`,children:(0,Y.jsx)(D,{className:`size-5`})}),(0,Y.jsx)(p,{open:c!==null,onClose:()=>l(null),wide:!0,height:`tall`,title:q(`skills.registryTitle`),children:c?(0,Y.jsx)(de,{spaceId:d,skillRef:c,onAdded:()=>{m(c),l(null)}},c):null})]}):null}function rt({title:e,count:t,error:n,empty:r,children:i}){return(0,Y.jsxs)(`section`,{className:`flex flex-col gap-2.5`,children:[(0,Y.jsxs)(`div`,{className:`flex items-baseline gap-2 px-1`,children:[(0,Y.jsx)(`h2`,{className:`font-display font-semibold text-lg leading-tight`,children:e}),t?(0,Y.jsx)(`span`,{className:`text-[0.8125rem] text-ink-3`,children:t}):null]}),n?(0,Y.jsx)(`p`,{className:`px-1 text-[0.875rem] text-rose`,children:n}):t?(0,Y.jsx)(E,{className:`divide-y divide-border-soft`,children:i}):(0,Y.jsx)(`p`,{className:`px-1 text-[0.875rem] text-ink-3`,children:r})]})}function it({icon:e,name:t,mono:n,chip:r,line:i,source:a,error:o,children:s}){return(0,Y.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-4 gap-y-2 px-3 py-3 sm:flex-nowrap`,children:[(0,Y.jsx)(`span`,{className:`grid size-9 shrink-0 place-items-center rounded-lg bg-paper-2 text-ink-3`,children:(0,Y.jsx)(e,{className:`size-4`})}),(0,Y.jsxs)(`span`,{className:`min-w-0 flex-1 max-sm:basis-[calc(100%-3.25rem)]`,children:[(0,Y.jsxs)(`span`,{className:`flex flex-wrap items-center gap-2`,children:[(0,Y.jsx)(`span`,{className:n?`font-medium font-mono text-[0.8125rem]`:`font-medium`,children:t}),r]}),i?(0,Y.jsx)(`span`,{className:`mt-0.5 block truncate text-[0.8125rem] text-ink-2`,children:i}):null,(0,Y.jsx)(`span`,{className:`mt-0.5 block truncate text-[0.75rem] text-ink-3`,children:a}),o?(0,Y.jsx)(`span`,{className:`mt-1 block text-[0.8125rem] text-rose`,children:o}):null]}),(0,Y.jsx)(`span`,{className:`flex shrink-0 items-center gap-2 max-sm:ml-[3.25rem]`,children:s})]})}function at(){return(0,Y.jsxs)(`span`,{className:`inline-flex items-center gap-1 text-[0.8125rem] text-moss`,children:[(0,Y.jsx)(r,{className:`size-4`}),` `,q(`capabilities.inSpace`)]})}function ot({hit:e,adding:t,failed:n,onLook:r,onAdd:i}){return(0,Y.jsxs)(it,{icon:U,name:e.name,mono:!0,chip:e.official?(0,Y.jsx)(o,{tone:`live`,icon:(0,Y.jsx)(le,{className:`size-3`}),children:q(`skills.official`)}):(0,Y.jsx)(o,{tone:`warn`,children:q(`skills.unchecked`)}),error:n?.message,source:[`skills.sh`,e.source,q(`skills.installs`,{n:e.installs.toLocaleString(K)})].join(` · `),children:[(0,Y.jsx)(s,{variant:`ghost`,size:`sm`,onClick:r,children:q(`skills.open`)}),e.added?(0,Y.jsx)(at,{}):(0,Y.jsx)(s,{variant:`secondary`,size:`sm`,busy:t,onClick:i,children:q(`skills.add`)})]})}function st({hit:e,admin:t}){let n=m(),r=e.kinds.map(e=>e===`mcp`?`MCP`:`OpenAPI`);return(0,Y.jsx)(it,{icon:z,name:e.name,line:e.description||void 0,source:[`integrations.sh`,e.domain,...r].join(` · `),children:e.setUp?(0,Y.jsx)(at,{}):t?(0,Y.jsx)(s,{variant:`secondary`,size:`sm`,onClick:()=>n(`/capabilities/connectors?setup=${encodeURIComponent(e.domain)}`),children:q(`discover.setUp`)}):null})}var ct={skills:4,connections:5};function lt(){let{space:e}=G(),t=W(),n=m(),r=I(`skills`),i=I(`unsetConnectors`),[a,o]=v(),s=a.get(`tab`)===`discover`?`discover`:`space`,[c,l,u]=tt(),d=e?.id??``,p=R(r?e?.id:void 0),_=Me(d),y=Ne(d);if(!e)return null;let b=t&&!e.readOnly,S=c.trim().toLowerCase(),C=p.data?.skills??[],T=_.data?.connections??[],D=C.filter(e=>e.mode!==`off`).sort((e,t)=>e.mode===t.mode?0:e.mode===`always`?-1:1),O=S?C.filter(e=>e.name.includes(S)||e.description.toLowerCase().includes(S)):D,k=S?T.filter(e=>`${e.name} ${e.connector?.name??e.connectorId}`.toLowerCase().includes(S)):T,A=Pe(y.data??[],T,i),j=e=>o(t=>{let n=new URLSearchParams(t);return e===`discover`?n.set(`tab`,`discover`):n.delete(`tab`),n},{replace:!0});return(0,Y.jsxs)(`div`,{className:`flex flex-col gap-9 pb-20`,children:[(0,Y.jsx)(h,{title:q(`nav.capabilities`),hint:q(`capabilities.overview.hint`),plain:!0,action:(0,Y.jsx)(ft,{entries:[...r&&!p.data?.readOnly?[{icon:U,label:q(`capabilities.overview.addSkill`),hint:q(`capabilities.overview.addSkillHint`),to:`/capabilities/skills`}]:[],...b?[{icon:z,label:q(`capabilities.overview.addConnection`),hint:q(`capabilities.overview.addConnectionHint`),to:`/capabilities/connectors?setup=`}]:[],{icon:De,label:q(`capabilities.discover`),hint:q(`capabilities.overview.discoverHint`),to:`/capabilities/overview?tab=discover`}]}),children:(0,Y.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,Y.jsx)(w,{value:s,onChange:j,options:[{id:`space`,label:q(`capabilities.inSpace`)},{id:`discover`,label:q(`capabilities.discover`)}],label:q(`nav.capabilities`)}),(0,Y.jsxs)(`form`,{className:`flex h-10 min-w-0 flex-1 basis-60 items-center gap-2 rounded-full border border-input bg-card px-4 focus-within:border-focus focus-within:ring-4 focus-within:ring-focus-glow`,onSubmit:e=>{e.preventDefault(),s===`space`&&S&&!O.length&&!k.length&&j(`discover`)},children:[(0,Y.jsx)(g,{className:`size-4 shrink-0 text-ink-3`}),(0,Y.jsx)(`input`,{type:`search`,value:c,"aria-label":q(s===`discover`?`discover.searchLabel`:`capabilities.overview.search`),placeholder:q(s===`discover`?`discover.search`:`capabilities.overview.search`),onChange:e=>l(e.target.value),className:`min-w-0 flex-1 bg-transparent text-[0.875rem] text-ink outline-none placeholder:text-ink-4`})]})]})}),(0,Y.jsx)(`div`,{className:`flex animate-rise flex-col gap-9`,children:s===`discover`?(0,Y.jsx)(nt,{asked:u,onExample:l}):(0,Y.jsxs)(Y.Fragment,{children:[r?(0,Y.jsx)(ut,{icon:U,title:q(`space.skills`),all:C.length,to:`/capabilities/skills`,children:p.error?(0,Y.jsx)(`p`,{className:`px-1 text-[0.875rem] text-rose`,children:p.error.message}):O.length?(0,Y.jsx)(`div`,{className:`grid gap-2.5 sm:grid-cols-2`,children:O.slice(0,ct.skills).map(e=>(0,Y.jsx)(dt,{skill:e,onOpen:()=>n(`/capabilities/skills?show=k:${e.id}`)},e.id))}):p.isPending?null:(0,Y.jsx)(E,{children:(0,Y.jsx)(f,{children:S?q(`capabilities.overview.nothing`,{q:c.trim()}):q(`capabilities.overview.noSkills`)})})}):null,(0,Y.jsxs)(ut,{icon:z,title:q(`capabilities.connectors`),all:T.length,to:`/capabilities/connectors`,children:[_.error?(0,Y.jsx)(`p`,{className:`px-1 text-[0.875rem] text-rose`,children:_.error.message}):k.length?(0,Y.jsx)(E,{className:`flex flex-col divide-y divide-border-soft p-0`,children:k.slice(0,ct.connections).map(e=>(0,Y.jsx)(Xe,{connection:e,onOpen:()=>n(`/capabilities/connectors?show=${encodeURIComponent(e.id)}`)},e.id))}):_.isPending?null:(0,Y.jsx)(E,{children:(0,Y.jsx)(f,{children:S?q(`capabilities.overview.nothing`,{q:c.trim()}):q(`capabilities.overview.noConnections`)})}),A.length&&!S?(0,Y.jsxs)(`p`,{className:`px-1 text-[0.8125rem] text-ink-3`,children:[q(`capabilities.connectors.builtin`),`:`,` `,A.map((e,t)=>(0,Y.jsxs)(`span`,{children:[t?` · `:null,b&&e.usable?(0,Y.jsx)(x,{to:`/capabilities/connectors?setup=${encodeURIComponent(e.id)}`,className:`text-ink-2 hover:text-ink hover:underline`,children:e.name}):(0,Y.jsx)(`span`,{className:`text-ink-2`,children:e.name})]},e.id))]}):null]})]})},s)]})}function ut({icon:e,title:t,all:n,to:r,children:i}){return(0,Y.jsxs)(`section`,{className:`flex flex-col gap-2.5`,children:[(0,Y.jsxs)(`div`,{className:`flex items-center justify-between gap-3 px-1`,children:[(0,Y.jsxs)(`h3`,{className:`flex items-center gap-2 font-semibold text-[0.9375rem]`,children:[(0,Y.jsx)(e,{className:`size-4 text-ember-strong`,"aria-hidden":`true`}),t]}),(0,Y.jsxs)(x,{to:r,className:`inline-flex items-center gap-0.5 text-[0.8125rem] text-ink-3 transition hover:text-ink`,children:[q(`capabilities.overview.all`,{n}),(0,Y.jsx)(d,{className:`size-3.5`,"aria-hidden":`true`})]})]}),i]})}function dt({skill:e,onOpen:t}){return(0,Y.jsxs)(`button`,{type:`button`,onClick:t,className:`flex min-w-0 flex-col gap-1.5 rounded-xl bg-card px-4 py-3 text-left shadow-soft ring-1 ring-border-soft transition hover:ring-border`,children:[(0,Y.jsxs)(`span`,{className:`flex items-center justify-between gap-2`,children:[(0,Y.jsx)(`span`,{className:_(`truncate font-medium font-mono text-[0.8125rem]`,e.mode===`off`&&`text-ink-3`),children:e.name}),(0,Y.jsx)(o,{tone:e.mode===`always`?`live`:`neutral`,children:q(`skills.mode.${e.mode}`)})]}),(0,Y.jsx)(`span`,{className:`line-clamp-2 text-[0.8125rem] text-ink-2`,children:e.description}),(0,Y.jsxs)(`span`,{className:`flex flex-wrap items-center gap-2 text-[0.75rem] text-ink-3`,children:[(0,Y.jsx)(ue,{skill:e}),e.runScripts?q(`capabilities.overview.scripts`):null]})]})}function ft({entries:e}){let[t,n]=(0,J.useState)(!1),r=(0,J.useRef)(null);return(0,J.useEffect)(()=>{if(!t)return;let e=e=>{r.current?.contains(e.target)||n(!1)},i=e=>e.key===`Escape`&&n(!1);return document.addEventListener(`mousedown`,e),document.addEventListener(`keydown`,i),()=>{document.removeEventListener(`mousedown`,e),document.removeEventListener(`keydown`,i)}},[t]),(0,Y.jsxs)(`div`,{className:`relative`,ref:r,children:[(0,Y.jsxs)(s,{size:`sm`,"aria-haspopup":`menu`,"aria-expanded":t,onClick:()=>n(e=>!e),children:[(0,Y.jsx)(j,{className:`size-4`}),` `,q(`skills.add`),(0,Y.jsx)(c,{className:`-mr-1 size-4`})]}),t?(0,Y.jsx)(`div`,{role:`menu`,className:`absolute top-10 right-0 z-50 w-72 animate-rise rounded-xl bg-card p-1.5 shadow-overlay ring-1 ring-border-soft`,children:e.map(e=>(0,Y.jsxs)(x,{to:e.to,role:`menuitem`,onClick:()=>n(!1),className:`flex w-full items-start gap-2.5 rounded-lg px-2.5 py-2 text-left transition hover:bg-accent`,children:[(0,Y.jsx)(e.icon,{className:`mt-0.5 size-4 shrink-0 text-ink-3`}),(0,Y.jsxs)(`span`,{className:`min-w-0`,children:[(0,Y.jsx)(`span`,{className:`block font-medium text-[0.875rem]`,children:e.label}),(0,Y.jsx)(`span`,{className:`block text-[0.8125rem] text-ink-3`,children:e.hint})]})]},e.to))}):null]})}var pt=(0,J.lazy)(()=>P(()=>import(`./SkillEditor-BsXTqNli.js`).then(e=>({default:e.SkillEditor})),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14])));function mt(){let[e,t]=v(),{space:n}=G(),r=re(),{narrow:i}=Ce(),a=e.get(`show`),o=a?.startsWith(`k:`)?a:null,s=R(n?.id),c=ie(`skills`,r).filter(e=>e.plugin);ye(s.data?.skills.find(e=>`k:${e.id}`===o)?.name??null),(0,J.useEffect)(()=>{i||L().scrollTo({top:0})},[i,o]);let l=e=>i?t({show:e}):t(e===`all`?{}:{show:e},{replace:!0});return(0,Y.jsx)(Y.Fragment,{children:n?(0,Y.jsx)(`div`,{className:`flex flex-col gap-9 pb-20`,children:o?(0,Y.jsx)(J.Suspense,{fallback:null,children:(0,Y.jsx)(pt,{skillId:o.slice(2),onGone:()=>l(`all`),onOpen:l,filesFirst:!0},o)}):s.data?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(ce,{spaceId:n.id,data:s.data,onOpen:l,heading:q(`capabilities.inSpace`)}),c.flatMap(e=>e.sections).map(e=>r.spaceSections.find(t=>t.id===e.id)).filter(e=>e!==void 0).map(e=>(0,Y.jsx)(S,{id:e.id,children:(0,Y.jsx)(h,{title:e.label(),hint:e.hint?.(),plain:!0,children:(0,Y.jsx)(oe,{of:e,children:(0,Y.jsx)(e.component,{})})})},e.serial))]}):s.error?(0,Y.jsx)(`p`,{className:`text-[0.875rem] text-rose`,children:s.error.message}):null}):null})}var ht=[{id:`overview`,label:`capabilities.overview`,icon:te,element:lt,menu:!1},{id:`skills`,label:`space.skills`,icon:U,element:mt,feature:`skills`,menu:!1},{id:`connectors`,label:`capabilities.connectors`,icon:z,element:Je,menu:!1},{id:`protocol`,label:`capabilities.protocol`,icon:k,element:fe,admins:!0,menu:!1}];function gt(e,t=!0){return ht.filter(n=>n.element&&(!n.feature||e(n.feature))&&(t||!n.admins))}function _t(){let[e,t]=(0,J.useState)(null);return(0,J.useEffect)(()=>{let e=L(),n=()=>t(e.clientHeight);n();let r=new ResizeObserver(n);return r.observe(e),()=>r.disconnect()},[]),e}function vt(){let e=I(`capabilities`),t=ee(),{section:n}=A(),[r]=v(),i=m(),a=b(),{space:o,loading:s}=G(),c=be(),[l,u]=(0,J.useState)(null),[d,p]=(0,J.useState)(null),[h,g]=(0,J.useState)(null),x=gt(e=>he(t,e),W()),S=x.find(e=>e.id===n),C=R(x.some(e=>e.id===`skills`)?o?.id:void 0),w=Me(o?.id??``),T={skills:C.data?.skills.length,connectors:w.data?.connections.length},E=x.map(e=>({id:e.id,label:q(e.label),icon:e.icon,to:e.menu===!1&&c?`/capabilities/${e.id}?show=page`:`/capabilities/${e.id}`,count:T[e.id]})),D=E.find(e=>e.id===S?.id),O=r.get(`show`)||r.has(`setup`)?2:1,k=S&&S.menu!==!1&&h!==S.id?1:0,j=Se(k),M=Se(O),N=(0,J.useMemo)(()=>({slot:l,narrow:c,setDetail:p}),[l,c]),P=_t();if(ae([{label:q(`nav.capabilities`),to:`/capabilities`},...D?[{label:D.label,to:D.to}]:[],...D&&d?[{label:d}]:[]]),!e)return(0,Y.jsx)(y,{to:`/`,replace:!0});if(n===`discover`){let e=new URLSearchParams(a.search);return e.set(`tab`,`discover`),(0,Y.jsx)(y,{to:{pathname:`/capabilities/overview`,search:`?${e}`},replace:!0})}if(!S&&x[0])return(0,Y.jsx)(y,{to:{pathname:`/capabilities/${x[0].id}`,search:a.search},replace:!0});let F=S?.element;return(0,Y.jsx)(ve.Provider,{value:N,children:(0,Y.jsx)(`div`,{className:`animate-rise`,children:(0,Y.jsxs)(`div`,{className:`grid gap-6 md:grid-cols-[10.5rem_minmax(0,1fr)] md:gap-5 lg:grid-cols-[15rem_minmax(0,1fr)] lg:gap-10`,children:[(0,Y.jsxs)(`aside`,{className:_(`menu-scroll min-w-0 md:sticky md:top-6 md:self-start md:overflow-y-auto md:overscroll-contain`,c&&O===2&&`hidden`,c&&M===`back`&&Te(`back`)),style:!c&&P?{maxHeight:P-48,paddingBottom:`var(--assistant-dock, 0px)`}:void 0,children:[(0,Y.jsx)(xe,{title:q(`nav.capabilities`),open:k===1?D??null:null,onBack:x.length>1?()=>g(S?.id??null):void 0,root:{icon:ne,label:q(`nav.capabilities`),onOpen:()=>i(c?`/capabilities/overview?show=page`:`/capabilities/overview`),current:S?.id===`overview`}}),(0,Y.jsx)(`div`,{className:_(Te(j)),children:k===0?(0,Y.jsx)(_e,{entries:E.filter(e=>e.id!==`overview`),current:D,onPick:e=>{g(null),S?.menu===!1&&i(e.to)}}):(0,Y.jsx)(`div`,{ref:u})},k)]}),(0,Y.jsxs)(`div`,{className:_(`min-w-0`,c&&O<2&&`hidden`,c&&M===`deeper`&&Te(`deeper`)),children:[c&&D?(0,Y.jsx)(`div`,{className:`mb-3`,children:(0,Y.jsx)(we,{label:D.label,onBack:()=>i(D.to)})}):null,F?(0,Y.jsx)(F,{}):null,o||s?null:(0,Y.jsx)(f,{children:q(`settings.noSpace`)})]})]})})})}export{vt as CapabilitiesPage};
|