@chat-js/registry 0.1.2 → 0.2.0-beta.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.
Files changed (89) hide show
  1. package/README.md +60 -8
  2. package/dist/r/ai-titles.json +47 -0
  3. package/dist/r/akamai-storage.json +44 -0
  4. package/dist/r/alibaba-storage.json +44 -0
  5. package/dist/r/appwrite-storage.json +50 -0
  6. package/dist/r/archil-storage.json +52 -0
  7. package/dist/r/attachment-uploads.json +87 -0
  8. package/dist/r/azure-storage.json +51 -0
  9. package/dist/r/backblaze-b2-storage.json +44 -0
  10. package/dist/r/bunny-storage-storage.json +48 -0
  11. package/dist/r/cloudinary-storage.json +43 -0
  12. package/dist/r/code-documents.json +96 -0
  13. package/dist/r/code-execution-runtime.json +25 -0
  14. package/dist/r/code-execution-ui.json +31 -0
  15. package/dist/r/code-execution.json +69 -0
  16. package/dist/r/credits.json +98 -0
  17. package/dist/r/daytona-sandbox.json +55 -0
  18. package/dist/r/deep-research.json +220 -0
  19. package/dist/r/delete-document.json +58 -0
  20. package/dist/r/digitalocean-spaces-storage.json +44 -0
  21. package/dist/r/dropbox-storage.json +43 -0
  22. package/dist/r/exoscale-storage.json +44 -0
  23. package/dist/r/feedback.json +105 -0
  24. package/dist/r/filebase-storage.json +43 -0
  25. package/dist/r/firebase-storage-storage.json +52 -0
  26. package/dist/r/firecrawl-search.json +72 -0
  27. package/dist/r/followup-suggestions.json +147 -0
  28. package/dist/r/ftp-storage.json +54 -0
  29. package/dist/r/gcs-storage.json +33 -0
  30. package/dist/r/generate-image.json +101 -0
  31. package/dist/r/generate-video.json +70 -0
  32. package/dist/r/get-weather.json +52 -0
  33. package/dist/r/google-drive-storage.json +47 -0
  34. package/dist/r/hetzner-storage.json +44 -0
  35. package/dist/r/ibm-cos-storage.json +44 -0
  36. package/dist/r/idrive-e2-storage.json +44 -0
  37. package/dist/r/langfuse.json +63 -0
  38. package/dist/r/litellm-gateway.json +67 -0
  39. package/dist/r/mcp.json +304 -0
  40. package/dist/r/memory-storage.json +28 -0
  41. package/dist/r/minio-storage.json +44 -0
  42. package/dist/r/model-preferences.json +125 -0
  43. package/dist/r/neon-storage.json +44 -0
  44. package/dist/r/netlify-blobs-storage.json +31 -0
  45. package/dist/r/onedrive-storage.json +48 -0
  46. package/dist/r/openai-compatible-gateway.json +69 -0
  47. package/dist/r/openai-gateway.json +67 -0
  48. package/dist/r/openrouter-gateway.json +75 -0
  49. package/dist/r/oracle-cloud-storage.json +45 -0
  50. package/dist/r/ovhcloud-storage.json +44 -0
  51. package/dist/r/pocketbase-storage.json +50 -0
  52. package/dist/r/projects.json +266 -0
  53. package/dist/r/r2-storage.json +44 -0
  54. package/dist/r/read-document.json +34 -0
  55. package/dist/r/registry.json +4870 -0
  56. package/dist/r/retrieve-url.json +67 -0
  57. package/dist/r/s3-storage.json +44 -0
  58. package/dist/r/saved-code-execution.json +81 -0
  59. package/dist/r/scaleway-storage.json +44 -0
  60. package/dist/r/search.json +140 -0
  61. package/dist/r/sftp-storage.json +58 -0
  62. package/dist/r/sharepoint-storage.json +50 -0
  63. package/dist/r/sharing.json +137 -0
  64. package/dist/r/sheet-documents.json +93 -0
  65. package/dist/r/storj-storage.json +43 -0
  66. package/dist/r/supabase-storage.json +48 -0
  67. package/dist/r/tavily-search.json +72 -0
  68. package/dist/r/tencent-storage.json +44 -0
  69. package/dist/r/text-documents.json +116 -0
  70. package/dist/r/tigris-storage.json +43 -0
  71. package/dist/r/uploadthing-storage.json +38 -0
  72. package/dist/r/vercel-analytics.json +46 -0
  73. package/dist/r/vercel-blob-storage.json +42 -0
  74. package/dist/r/vercel-gateway.json +77 -0
  75. package/dist/r/vercel-sandbox.json +67 -0
  76. package/dist/r/vercel-speed-insights.json +46 -0
  77. package/dist/r/vultr-storage.json +44 -0
  78. package/dist/r/wasabi-storage.json +44 -0
  79. package/dist/r/webdav-storage.json +52 -0
  80. package/dist/r/word-count.json +51 -0
  81. package/dist/r/yandex-storage.json +43 -0
  82. package/package.json +110 -31
  83. package/index.d.ts +0 -4
  84. package/index.js +0 -1
  85. package/index.json +0 -19
  86. package/items/get-weather.json +0 -26
  87. package/items/retrieve-url.json +0 -35
  88. package/items/toolkit-renderer.json +0 -29
  89. package/items/word-count.json +0 -22
package/README.md CHANGED
@@ -1,13 +1,65 @@
1
1
  # @chat-js/registry
2
2
 
3
- Published ChatJS registry artifacts and authoring types.
3
+ Code-first authoring and generated shadcn registry distribution for ChatJS.
4
4
 
5
- The package is distributed through npm. The CLI consumes the published
6
- `items/*.json` manifests from the package contents via the default npm-backed
7
- registry URL, so there is no separate registry deploy step.
5
+ Edit the real TypeScript sources in `src/gateways/<id>/gateway.ts` and `src/tools/<id>/`. `registry.ts` declares standard item files, targets, dependencies, and validated `meta.chatjs` metadata. Test implementations by importing those sources directly.
8
6
 
9
- This package contains:
7
+ ```sh
8
+ bun run test:types
9
+ bun run test:unit
10
+ bun run build
11
+ ```
10
12
 
11
- - `index.json` with the registry index
12
- - `items/*.json` with generated registry tool manifests
13
- - `ToolEnvVars` for typing static `toolEnvVars` exports in `tool.ts`
13
+ `build.ts` serializes the catalog and tool descriptors, then runs published `shadcn@4.21.0 build`. shadcn reads the source files and emits `dist/r/*.json`. Both the intermediate `registry.json` and output are generated, never edited. The output directory is cleared first, so deleted items cannot survive a build.
14
+
15
+ The npm package publishes `dist/r/`. The Base UI release uses `https://unpkg.com/@chat-js/registry@0.2.0-beta.0/dist/r/{name}.json`. Historical version 0 npm artifacts retain their legacy `items/` format for already-published CLIs; existing standard-registry clients retain their configured release. Base-dependent plugins and document bundles declare `contractVersion: 2` and `uiBase: "base"` so incompatible hosts are rejected before ChatJS installation or synchronization writes. Publish the shared gateway and sandbox contracts first, then the registry beta, then the matching CLI beta. Use `--tag beta` for both prereleases and keep stable `latest` unchanged. Descriptor contract version 2 is independent of npm versioning. The static Vercel deployment serves the same output.
16
+
17
+ ## Tools
18
+
19
+ Each tool item installs `tool.ts`, `renderer.tsx`, and `chatjs.json` under `~/tools/chatjs/<id>/`. All tools use native EVE definitions and a single contractVersion 1 descriptor with kind `tool`, id, named tool/renderer exports, optional plugin slot, and environment requirements. The version validates the format and never selects an execution adapter. The build derives it from the same typed metadata used in the catalog.
20
+
21
+ `chat-js add` delegates installation to shadcn, then generates typed server and client indexes. Direct `shadcn add` installs are supported by running `chat-js sync` afterward. Custom registrations belong in `custom-tools.ts` and `custom-ui.ts`. Third-party items use the same shape and standard namespaces in `components.json`.
22
+
23
+ See [gateway authoring](./src/gateways/README.md) for adapter-specific metadata.
24
+
25
+ ## Organization and naming
26
+
27
+ Source folders group items by category. Each gateway has a `gateway.ts`; each tool has a `tool.ts` and `renderer.tsx`. Receipt and renderer helpers are supplied by the ChatJS scaffold. Category-level gateway catalog, metadata, and defaults live directly under `src/gateways/`.
28
+
29
+ `meta.chatjs.kind` identifies a gateway or tool independently of its public name. Registry namespace aliases such as `@chatjs` identify a configured registry source. Public item names remain `vercel-gateway`, `word-count`, and the other existing names. Source folders do not determine registry addresses or installation targets.
30
+
31
+ The selected gateway installs into the app's `lib/ai/gateway.ts` slot. Tools install under `tools/chatjs/<id>/` with generated registrations and separate custom modules. Third-party destination namespacing is not inferred from registry aliases and is not added by this source reorganization.
32
+
33
+ `packages/gateways` owns shared runtime contracts. `packages/cli` owns installation and configuration. `apps/chat` is the reference consumer and app template source. New categories such as layouts and caches should introduce source folders and contracts when their first implementation is added, rather than empty scaffolding.
34
+
35
+ ## Ownership inventory
36
+
37
+ From the repository root, run `bun architecture:inventory` for a summary or `bun architecture:inventory --json` for every file's owners, source paths and cross-module imports. The inventory derives installable ownership from the current demo selection, local registry dependencies, explicit targets and generated tool/plugin descriptors. Core is the complement. It does not mutate installations or replace source receipts.
38
+
39
+ The scope is present Git-tracked and non-ignored untracked files in `apps/chat` plus all claimed installation targets, including absent targets marked `present: false`. Records include a `templateCopyEligible` flag for the initial template copy filter (which omits demo migration history). This flag does not describe the final scaffold: creation removes reference installables and providers before installing the selected items. The import audit describes the current reference app, not a simulated fresh installation. A file owned by an installable retains that owner even when its framework entrypoint lives outside the plugin folder. Generated composition remains core with a separate role, using generator headers and the demo baseline; app-owned customization files remain core. Inventory counts include tests/assets, while the import audit excludes test files and repository-only source. Static imports, type imports, re-exports, literal dynamic imports and literal `require` calls use the app's TypeScript resolver. Computed imports, external packages and external registry URLs are outside this audit.
40
+
41
+ `--check` exits nonzero for shared or missing targets, unresolved local imports, or import crossings needing review. Crossings through generated composition, direct declared registry dependencies, and explicitly reviewed public core contracts are distinguished from unresolved findings. This is an audit command, not yet a required CI gate: existing crossings must be reviewed before enforcing it globally. Do not accept them by recording a blanket baseline.
42
+
43
+ Session identity (`lib/eve/session-identity.ts`) is a core contract. MCP and research consume it; neither installs or overwrites it. The minimal scaffold retains it independently of those selections.
44
+
45
+ ## Plugin database schemas
46
+
47
+ A plugin may declare `databaseSchemas` in its `chatjs.json`, using app-relative TypeScript paths beneath `plugins/<id>/`. Sync validates the selected descriptors and files, then generates `composition/generated/installed-database.ts`. Drizzle consumes that list alongside `lib/db/schema.ts`. This is composition metadata, not a barrel that core runtime modules import. MCP contributes `plugins/mcp/db/mcp-schema.ts` and consumes the core user table for its foreign key.
48
+
49
+ Fresh scaffolds exclude the demo's historical migrations. After installing dependencies, create runs the offline `db:generate` script to generate the selected schema's initial migration. Only create generates a baseline, and it refuses a nonempty migration directory. Add and sync preserve the app's migration history. Schema generation and applying migrations remain separate actions. ChatJS supports new installations, without migration support for older template versions.
50
+
51
+ ## Tool configuration
52
+
53
+ Tools can declare `config: { key }` and export `configSchema` from their own `configuration-schema.ts`. Sync generates `composition/generated/installed-config.ts` from installed descriptors, rejecting duplicate or reserved keys. The core composes those schemas under `ai.tools`, deriving both input and output types. The editable interface remains `chat.config.ts`. Unknown tool keys are rejected at the type and runtime boundaries.
54
+
55
+ Gateways supply `roles.smart`, `roles.balanced`, `roles.fast`, and optional `roles.image`/`roles.video`. Tool schemas own their defaults and choose from these roles through the pure `lib/config-models.ts` core contract. They must not import runtime configuration or credentials. Document assistant actions similarly belong to document bundles and enter core through a generated registration. Follow-up suggestions and attachment limits remain core because core runtime code consumes them independently of installable tools.
56
+
57
+ ## Plugins and composition
58
+
59
+ Plugins replace the former installable feature category. Their open ID contract lives in `metadata.ts`. A plugin declares separate server and client factory exports and its router, instrumentation, layout, composer, settings, or upload contributions. The installer reads descriptors without executing plugin entrypoints. Core business logic consumes generated composition rather than importing optional implementations.
60
+
61
+ MCP and attachment uploads keep manifests beside `src/` and `adapters/`. All plugin runtime source installs under `plugins/<id>/`; Next and EVE adapters retain explicit ownership despite their framework-required locations. Plugin entrypoints use `server-plugin.ts` and `client-plugin.ts` to avoid basename collisions with host modules during shadcn installation.
62
+
63
+ Generated tool and plugin registrations live under `composition/generated/`. Editable custom tool and renderer registrations live under `composition/custom/`. `composer-controls.ts`, `settings-items.ts`, and `chat.config.ts` remain app-owned. Adding a plugin with existing contribution kinds requires no CLI whitelist change. New contribution kinds require an explicit host contract and generator support.
64
+
65
+ See [plugin authoring](../../apps/docs/plugins/authoring.mdx) for the complete source-installation contract.
@@ -0,0 +1,47 @@
1
+ {
2
+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",
3
+ "name": "ai-titles",
4
+ "description": "Automatically name new chats with AI",
5
+ "files": [
6
+ {
7
+ "path": "src/plugins/ai-titles/src/chat.ts",
8
+ "content": "import type { ChatServerIntegration } from \"@/lib/chat-plugin-contracts\";\n\nexport const aiTitlesChat = {\n afterCreate: async (context) => {\n const { persistGeneratedEveConversationTitle } =\n await import(\"./generate-title\");\n await persistGeneratedEveConversationTitle(context);\n },\n} satisfies ChatServerIntegration;\n",
9
+ "type": "registry:file",
10
+ "target": "~/plugins/ai-titles/chat.ts"
11
+ },
12
+ {
13
+ "path": "src/plugins/ai-titles/src/generate-title.ts",
14
+ "content": "import { settleEveRootFallbackTitle } from \"@/lib/db/eve-title\";\nimport { generateText } from \"ai\";\n\nimport { getLanguageModel } from \"@/lib/ai/providers\";\nimport { chatTelemetry } from \"@/lib/ai/telemetry\";\nimport { config } from \"@/lib/config\";\nimport {\n isEveRootTitlePending,\n replaceEveRootFallbackTitle,\n} from \"./title-queries\";\nimport { createModuleLogger } from \"@/lib/logger\";\n\nimport {\n compactTitle,\n eveConversationTitleFallback,\n} from \"@/lib/eve/conversation-title\";\nimport type { ReadonlyEveMessageInput } from \"@/lib/eve/readonly-message-types\";\n\nconst TITLE_GENERATION_TIMEOUT_MS = 15_000;\nconst surroundingQuotes = /^[\\s\"'“”‘’]+|[\\s\"'“”‘’]+$/gu;\nconst log = createModuleLogger(\"eve.ai-titles\");\ntype EveTitleResult =\n | { source: \"generated\"; title: string }\n | { source: \"fallback\"; title: string };\n\nconst normalizeGeneratedTitle = (title: string): string =>\n compactTitle(title.replace(surroundingQuotes, \"\"));\n\n/**\n * Auxiliary title generation must never prevent a conversation from starting.\n * @param {ReadonlyEveMessageInput} message First user message supplied to the auxiliary title model.\n * @returns {Promise<EveTitleResult>} A normalized generated title, or its message-derived fallback if generation fails or is empty.\n */\nconst generateEveConversationTitleResult = async (\n message: ReadonlyEveMessageInput\n): Promise<EveTitleResult> => {\n const fallback = eveConversationTitleFallback(message);\n try {\n const { text } = await generateText({\n abortSignal: AbortSignal.timeout(TITLE_GENERATION_TIMEOUT_MS),\n instructions: `Generate a concise title for a chat conversation based on the user's first message.\n\nRules (strictly follow all):\n- Maximum 40 characters — hard limit, never exceed this\n- 3-6 words is ideal\n- No quotes, colons, or punctuation at the end\n- No filler words like \"How to\" or \"Question about\"\n- Use title case\n- Return ONLY the title, nothing else`,\n maxRetries: 0,\n model: await getLanguageModel(config.ai.workflows.title),\n prompt: JSON.stringify(message),\n telemetry: { integrations: chatTelemetry, isEnabled: true },\n });\n const title = normalizeGeneratedTitle(text);\n\n if (title) {\n return { source: \"generated\", title };\n }\n return { source: \"fallback\", title: fallback };\n } catch {\n return { source: \"fallback\", title: fallback };\n }\n};\nconst persistGeneratedEveConversationTitle = async ({\n conversationId,\n message,\n ownerId,\n}: Readonly<{\n conversationId: string;\n message: ReadonlyEveMessageInput;\n ownerId: string;\n}>): Promise<EveTitleResult | undefined> => {\n const fallbackTitle = eveConversationTitleFallback(message);\n try {\n if (\n !(await isEveRootTitlePending(ownerId, conversationId, fallbackTitle))\n ) {\n return undefined;\n }\n } catch (error) {\n log.warn(\n {\n conversationId,\n errorName: error instanceof Error ? error.name : typeof error,\n },\n \"Eve title eligibility check failed\"\n );\n return undefined;\n }\n const generated = await generateEveConversationTitleResult(message);\n try {\n await (generated.source === \"generated\"\n ? replaceEveRootFallbackTitle(\n ownerId,\n conversationId,\n fallbackTitle,\n generated.title\n )\n : settleEveRootFallbackTitle(ownerId, conversationId, fallbackTitle));\n } catch (error) {\n log.warn(\n {\n conversationId,\n errorName: error instanceof Error ? error.name : typeof error,\n },\n \"Eve title persistence failed\"\n );\n }\n return generated;\n};\nexport {\n generateEveConversationTitleResult,\n persistGeneratedEveConversationTitle,\n};\n",
15
+ "type": "registry:file",
16
+ "target": "~/plugins/ai-titles/generate-title.ts"
17
+ },
18
+ {
19
+ "path": "src/plugins/ai-titles/src/title-queries.ts",
20
+ "content": "import { and, eq } from \"drizzle-orm\";\nimport { db } from \"@/lib/db/client\";\nimport { eveChat, eveConversation } from \"@/lib/db/schema\";\n\nconst SINGLE_MATCH_LIMIT = 1;\nconst isEveRootTitlePending = async (\n ownerId: string,\n conversationId: string,\n fallbackTitle: string\n): Promise<boolean> => {\n const [row] = await db\n .select({ id: eveChat.id })\n .from(eveConversation)\n .innerJoin(\n eveChat,\n and(\n eq(eveChat.id, eveConversation.chatId),\n eq(eveChat.ownerId, eveConversation.ownerId)\n )\n )\n .where(\n and(\n eq(eveConversation.id, conversationId),\n eq(eveConversation.ownerId, ownerId),\n eq(eveConversation.state, \"bound\"),\n eq(eveChat.title, fallbackTitle),\n eq(eveChat.titleStatus, \"pending\")\n )\n )\n .limit(SINGLE_MATCH_LIMIT);\n return Boolean(row);\n};\n\nconst replaceEveRootFallbackTitle = async (\n ownerId: string,\n conversationId: string,\n fallbackTitle: string,\n generatedTitle: string\n): Promise<boolean> => {\n const [row] = await db\n .update(eveChat)\n .set({ title: generatedTitle, titleStatus: \"generated\" })\n .from(eveConversation)\n .where(\n and(\n eq(eveConversation.id, conversationId),\n eq(eveConversation.ownerId, ownerId),\n eq(eveConversation.state, \"bound\"),\n eq(eveChat.id, eveConversation.chatId),\n eq(eveChat.ownerId, ownerId),\n eq(eveChat.title, fallbackTitle),\n eq(eveChat.titleStatus, \"pending\")\n )\n )\n .returning({ id: eveChat.id });\n return Boolean(row);\n};\n\nexport { isEveRootTitlePending, replaceEveRootFallbackTitle };\n",
21
+ "type": "registry:file",
22
+ "target": "~/plugins/ai-titles/title-queries.ts"
23
+ },
24
+ {
25
+ "path": "dist/source/ai-titles.json",
26
+ "content": "{\n \"id\": \"ai-titles\",\n \"kind\": \"plugin\",\n \"files\": [\n \"plugins/ai-titles/chat.ts\",\n \"plugins/ai-titles/generate-title.ts\",\n \"plugins/ai-titles/title-queries.ts\"\n ],\n \"chat\": { \"export\": \"aiTitlesChat\" },\n \"contractVersion\": 1\n}\n",
27
+ "type": "registry:file",
28
+ "target": "~/plugins/ai-titles/chatjs.json"
29
+ }
30
+ ],
31
+ "meta": {
32
+ "chatjs": {
33
+ "id": "ai-titles",
34
+ "kind": "plugin",
35
+ "files": [
36
+ "plugins/ai-titles/chat.ts",
37
+ "plugins/ai-titles/generate-title.ts",
38
+ "plugins/ai-titles/title-queries.ts"
39
+ ],
40
+ "chat": {
41
+ "export": "aiTitlesChat"
42
+ },
43
+ "contractVersion": 1
44
+ }
45
+ },
46
+ "type": "registry:item"
47
+ }
@@ -0,0 +1,44 @@
1
+ {
2
+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",
3
+ "name": "akamai-storage",
4
+ "title": "Akamai Cloud Object Storage",
5
+ "description": "Akamai Cloud Object Storage (formerly Linode) via the S3-compatible API. Endpoint derived from the region/cluster code.",
6
+ "dependencies": [
7
+ "files-sdk@2.5.0",
8
+ "@aws-sdk/client-s3@^3.1079.0",
9
+ "@aws-sdk/s3-presigned-post@^3.700.0",
10
+ "@aws-sdk/s3-request-presigner@^3.700.0"
11
+ ],
12
+ "files": [
13
+ {
14
+ "path": "src/storage/akamai/storage-provider.ts",
15
+ "content": "export { akamai as createStorageAdapter } from \"files-sdk/akamai\";\n",
16
+ "type": "registry:file",
17
+ "target": "~/lib/storage-provider.ts"
18
+ }
19
+ ],
20
+ "meta": {
21
+ "chatjs": {
22
+ "configKeys": [
23
+ "bucket",
24
+ "endpoint"
25
+ ],
26
+ "contractVersion": 1,
27
+ "envRequirements": [
28
+ {
29
+ "description": "Akamai Cloud Object Storage credentials",
30
+ "options": [
31
+ [
32
+ "AKAMAI_ACCESS_KEY_ID",
33
+ "AKAMAI_SECRET_ACCESS_KEY"
34
+ ]
35
+ ]
36
+ }
37
+ ],
38
+ "id": "akamai",
39
+ "kind": "storage",
40
+ "optionalEnv": []
41
+ }
42
+ },
43
+ "type": "registry:item"
44
+ }
@@ -0,0 +1,44 @@
1
+ {
2
+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",
3
+ "name": "alibaba-storage",
4
+ "title": "Alibaba Cloud OSS",
5
+ "description": "Alibaba Cloud Object Storage Service (OSS) via the S3-compatible API. Endpoint derived from the region code (cn-hangzhou, ap-southeast-1, ...).",
6
+ "dependencies": [
7
+ "files-sdk@2.5.0",
8
+ "@aws-sdk/client-s3@^3.1079.0",
9
+ "@aws-sdk/s3-presigned-post@^3.700.0",
10
+ "@aws-sdk/s3-request-presigner@^3.700.0"
11
+ ],
12
+ "files": [
13
+ {
14
+ "path": "src/storage/alibaba/storage-provider.ts",
15
+ "content": "export { alibaba as createStorageAdapter } from \"files-sdk/alibaba\";\n",
16
+ "type": "registry:file",
17
+ "target": "~/lib/storage-provider.ts"
18
+ }
19
+ ],
20
+ "meta": {
21
+ "chatjs": {
22
+ "configKeys": [
23
+ "bucket",
24
+ "region"
25
+ ],
26
+ "contractVersion": 1,
27
+ "envRequirements": [
28
+ {
29
+ "description": "Alibaba Cloud OSS credentials",
30
+ "options": [
31
+ [
32
+ "ALIBABA_ACCESS_KEY_ID",
33
+ "ALIBABA_ACCESS_KEY_SECRET"
34
+ ]
35
+ ]
36
+ }
37
+ ],
38
+ "id": "alibaba",
39
+ "kind": "storage",
40
+ "optionalEnv": []
41
+ }
42
+ },
43
+ "type": "registry:item"
44
+ }
@@ -0,0 +1,50 @@
1
+ {
2
+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",
3
+ "name": "appwrite-storage",
4
+ "title": "Appwrite",
5
+ "description": "Appwrite Storage via the official Node.js SDK. Auto-loads configuration from environment variables.",
6
+ "dependencies": [
7
+ "files-sdk@2.5.0",
8
+ "node-appwrite@^26.0.0 || ^27.0.0 || ^28.0.0 || ^29.0.0"
9
+ ],
10
+ "files": [
11
+ {
12
+ "path": "src/storage/appwrite/storage-provider.ts",
13
+ "content": "export { appwrite as createStorageAdapter } from \"files-sdk/appwrite\";\n",
14
+ "type": "registry:file",
15
+ "target": "~/lib/storage-provider.ts"
16
+ }
17
+ ],
18
+ "meta": {
19
+ "chatjs": {
20
+ "configKeys": [
21
+ "bucket"
22
+ ],
23
+ "contractVersion": 1,
24
+ "envRequirements": [
25
+ {
26
+ "description": "Appwrite configuration",
27
+ "options": [
28
+ [
29
+ "APPWRITE_PROJECT_ID"
30
+ ]
31
+ ]
32
+ },
33
+ {
34
+ "description": "Appwrite credentials",
35
+ "options": [
36
+ [
37
+ "APPWRITE_API_KEY"
38
+ ]
39
+ ]
40
+ }
41
+ ],
42
+ "id": "appwrite",
43
+ "kind": "storage",
44
+ "optionalEnv": [
45
+ "APPWRITE_ENDPOINT"
46
+ ]
47
+ }
48
+ },
49
+ "type": "registry:item"
50
+ }
@@ -0,0 +1,52 @@
1
+ {
2
+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",
3
+ "name": "archil-storage",
4
+ "title": "Archil",
5
+ "description": "Archil disks via the S3-compatible API. The disk id is the bucket and the endpoint is derived from the Archil region (aws-us-east-1, gcp-us-central1, ...).",
6
+ "dependencies": [
7
+ "files-sdk@2.5.0",
8
+ "@aws-sdk/client-s3@^3.1079.0",
9
+ "@aws-sdk/s3-presigned-post@^3.700.0",
10
+ "@aws-sdk/s3-request-presigner@^3.700.0",
11
+ "disk@^0.8.18 || ^1.0.0"
12
+ ],
13
+ "files": [
14
+ {
15
+ "path": "src/storage/archil/storage-provider.ts",
16
+ "content": "export { archil as createStorageAdapter } from \"files-sdk/archil\";\n",
17
+ "type": "registry:file",
18
+ "target": "~/lib/storage-provider.ts"
19
+ }
20
+ ],
21
+ "meta": {
22
+ "chatjs": {
23
+ "configKeys": [
24
+ "bucket"
25
+ ],
26
+ "contractVersion": 1,
27
+ "envRequirements": [
28
+ {
29
+ "description": "Archil configuration",
30
+ "options": [
31
+ [
32
+ "ARCHIL_REGION"
33
+ ]
34
+ ]
35
+ },
36
+ {
37
+ "description": "Archil credentials",
38
+ "options": [
39
+ [
40
+ "ARCHIL_S3_ACCESS_KEY_ID",
41
+ "ARCHIL_S3_SECRET_ACCESS_KEY"
42
+ ]
43
+ ]
44
+ }
45
+ ],
46
+ "id": "archil",
47
+ "kind": "storage",
48
+ "optionalEnv": []
49
+ }
50
+ },
51
+ "type": "registry:item"
52
+ }
@@ -0,0 +1,87 @@
1
+ {
2
+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",
3
+ "name": "attachment-uploads",
4
+ "description": "User attachment picker, camera, paste/drop, preprocessing and upload endpoint",
5
+ "dependencies": [
6
+ "browser-image-compression",
7
+ "react-dropzone"
8
+ ],
9
+ "files": [
10
+ {
11
+ "path": "src/plugins/attachment-uploads/src/controls.tsx",
12
+ "content": "\"use client\";\nimport { Camera, Paperclip } from \"lucide-react\";\nimport type { ComposerControlProps } from \"@/components/composer/control\";\nimport React from \"react\";\nimport { toast } from \"sonner\";\n\nimport { DropdownMenuItem } from \"@/components/ui/dropdown-menu\";\nimport { LoginPrompt } from \"@/components/upgrade-cta/login-prompt\";\nimport { installedPlugins } from \"@/composition/generated/installed\";\nimport { useIsMobile } from \"@/hooks/use-mobile\";\nimport { config } from \"@/lib/config\";\nimport { useSession } from \"@/providers/session-provider\";\n\ntype AttachControlProps = Readonly<\n Pick<ComposerControlProps, \"disabled\" | \"onAttach\">\n>;\n\nconst loginPrompt = (\n <LoginPrompt\n title=\"Sign in to attach files\"\n description=\"Sign in to use this plugin in your conversation.\"\n />\n);\n\nconst AttachFilesControl = ({\n disabled,\n onAttach,\n}: AttachControlProps): React.JSX.Element | null => {\n const { data: session } = useSession();\n if (!installedPlugins.has(\"attachment-uploads\")) {\n return null;\n }\n return (\n <DropdownMenuItem\n disabled={disabled}\n onClick={(): void => {\n if (!session?.user) {\n toast(loginPrompt);\n return;\n }\n onAttach(Object.keys(config.attachments.acceptedTypes).join(\",\"));\n }}\n >\n <Paperclip />\n Attach files\n </DropdownMenuItem>\n );\n};\n\nconst TakePhotoControl = ({\n disabled,\n onAttach,\n}: AttachControlProps): React.JSX.Element | null => {\n const mobile = useIsMobile();\n const { data: session } = useSession();\n if (!installedPlugins.has(\"attachment-uploads\") || !mobile) {\n return null;\n }\n return (\n <DropdownMenuItem\n disabled={disabled}\n onClick={(): void => {\n if (!session?.user) {\n toast(loginPrompt);\n return;\n }\n onAttach(\"image/jpeg,image/png\", \"environment\");\n }}\n >\n <Camera />\n Take photo\n </DropdownMenuItem>\n );\n};\n\nAttachFilesControl.isAvailable = (): boolean =>\n installedPlugins.has(\"attachment-uploads\");\nTakePhotoControl.isAvailable = (mobile: boolean): boolean =>\n installedPlugins.has(\"attachment-uploads\") && mobile;\nexport { AttachFilesControl, TakePhotoControl };\n",
13
+ "type": "registry:file",
14
+ "target": "~/plugins/attachment-uploads/controls.tsx"
15
+ },
16
+ {
17
+ "path": "src/plugins/attachment-uploads/src/integration.tsx",
18
+ "content": "\"use client\";\n\nimport type {\n AttachmentUploadInput,\n AttachmentUploadIntegration,\n} from \"@/lib/installation-contracts\";\n\nimport React, { useEffect, useRef, useState } from \"react\";\nimport type { ReadonlyNativeSurface } from \"@/lib/readonly-native-surface\";\nimport { useDropzone } from \"react-dropzone\";\nimport { toast } from \"sonner\";\n\nimport { config } from \"@/lib/config\";\nimport { useSession } from \"@/providers/session-provider\";\n\nimport { AttachFilesControl, TakePhotoControl } from \"./controls\";\nimport { uploadAttachment } from \"./upload\";\nimport { processFilesForUpload } from \"./upload-prep\";\n\nconst withUploadCleanup = async (\n upload: () => Promise<void>,\n release: () => void\n): Promise<void> => {\n try {\n await upload();\n } finally {\n release();\n }\n};\n\ntype UploadPasteCaptureEvent = Readonly<{\n clipboardData: Readonly<{\n files: Readonly<Pick<FileList, \"length\" | typeof Symbol.iterator>>;\n }>;\n preventDefault: () => void;\n stopPropagation: () => void;\n}>;\n\ninterface UploadComposer {\n input: React.JSX.Element;\n onAttach: (accept: string, capture?: \"user\" | \"environment\") => void;\n rootProps: Readonly<Record<string, never>> | UploadComposerRootProps;\n}\n\ninterface UploadComposerRootProps {\n onPasteCapture: (event: UploadPasteCaptureEvent) => void;\n role: \"group\";\n}\n\ninterface UploadsResult {\n composer: (disabled: boolean) => UploadComposer;\n uploadQueue: string[];\n}\n\nconst useUploads = ({\n attachmentCount,\n onUploaded,\n}: ReadonlyNativeSurface<AttachmentUploadInput>): UploadsResult => {\n const [, startEventAction] = React.useTransition();\n const input = useRef<HTMLInputElement>(null);\n const { data: session } = useSession();\n const [uploadQueue, setUploadQueue] = useState<string[]>([]);\n const lock = useRef(false);\n const currentCount = useRef(attachmentCount);\n useEffect((): void => {\n currentCount.current = attachmentCount;\n }, [attachmentCount]);\n const upload = async (\n files: ReadonlyNativeSurface<File[]>\n ): Promise<void> => {\n if (lock.current || files.length === 0) {\n return;\n }\n if (!session?.user) {\n toast.error(\"Sign in to attach files.\");\n return;\n }\n if (files.length + currentCount.current > 16) {\n toast.error(\"Attach at most 16 files per message.\");\n return;\n }\n lock.current = true;\n setUploadQueue(\n files.map((file: ReadonlyNativeSurface<File>): string => file.name)\n );\n await withUploadCleanup(\n async () => {\n const result = await processFilesForUpload(files, config.attachments);\n if (\n result.stillOversized.length > 0 ||\n result.unsupportedFiles.length > 0\n ) {\n toast.error(\n \"Some files could not be attached. Use images or PDFs within the upload size limit.\"\n );\n }\n for (const file of result.files) {\n try {\n // oxlint-disable-next-line eslint/no-await-in-loop -- Serialize uploads to preserve order and bound memory.\n const attachment = await uploadAttachment(file);\n currentCount.current += 1;\n onUploaded(attachment);\n } catch (error) {\n toast.error(\n error instanceof Error ? error.message : \"Upload failed.\"\n );\n }\n }\n },\n () => {\n lock.current = false;\n setUploadQueue([]);\n }\n );\n };\n const { getRootProps } = useDropzone({\n disabled: uploadQueue.length > 0,\n noClick: true,\n noKeyboard: true,\n\n onDrop: (files: ReadonlyNativeSurface<File[]>) => {\n // Start outside the transition so the upload queue locks Send immediately.\n const completion = upload(files);\n startEventAction(async () => {\n await completion;\n });\n },\n });\n return {\n composer: (disabled: boolean) => ({\n input: (\n <input\n aria-label=\"Attach files\"\n className=\"hidden\"\n disabled={disabled}\n multiple\n ref={input}\n type=\"file\"\n\n onChange={(event: React.ChangeEvent<HTMLInputElement>) => {\n if (disabled) {\n event.target.value = \"\";\n return;\n }\n const completion = upload([...(event.target.files ?? [])]);\n startEventAction(async () => {\n await completion;\n event.target.value = \"\";\n });\n }}\n />\n ),\n onAttach: (accept: string, capture?: \"user\" | \"environment\"): void => {\n if (disabled || !input.current) {\n return;\n }\n input.current.accept = accept;\n if (capture) {\n input.current.capture = capture;\n } else {\n input.current.removeAttribute(\"capture\");\n }\n input.current.click();\n },\n rootProps: disabled\n ? {}\n : {\n ...getRootProps({ role: \"group\" }),\n onPasteCapture: (event: UploadPasteCaptureEvent): void => {\n if (event.clipboardData.files.length > 0) {\n event.preventDefault();\n event.stopPropagation();\n const completion = upload([...event.clipboardData.files]);\n startEventAction(async () => {\n await completion;\n });\n }\n },\n },\n }),\n uploadQueue,\n };\n};\n\nexport const attachmentUploads = {\n controls: [\n { Component: AttachFilesControl, id: \"attach-files\" },\n { Component: TakePhotoControl, id: \"take-photo\" },\n ],\n useUploads,\n} satisfies AttachmentUploadIntegration;\n",
19
+ "type": "registry:file",
20
+ "target": "~/plugins/attachment-uploads/integration.tsx"
21
+ },
22
+ {
23
+ "path": "src/plugins/attachment-uploads/src/upload.ts",
24
+ "content": "import { attachmentDigest, draftAttachment } from \"@/lib/eve/draft\";\nimport type { z } from \"zod\";\n\nexport const uploadAttachment = async (\n file: Readonly<File>\n): Promise<z.infer<typeof draftAttachment>> => {\n const body = new FormData();\n body.append(\"file\", file);\n const response = await fetch(\"/api/files/upload\", {\n body,\n method: \"POST\",\n });\n if (!response.ok) {\n const failure: unknown = await response.json().catch(() => null);\n throw new Error(\n failure !== null &&\n typeof failure === \"object\" &&\n \"error\" in failure &&\n typeof failure.error === \"string\"\n ? failure.error\n : `Unable to upload ${file.name}.`\n );\n }\n const uploaded: unknown = await response.json();\n if (uploaded === null || typeof uploaded !== \"object\") {\n throw new Error(`Invalid upload response for ${file.name}.`);\n }\n return draftAttachment.parse({\n ...uploaded,\n contentType: file.type,\n digest: await attachmentDigest(await file.arrayBuffer()),\n name: file.name,\n });\n};\n",
25
+ "type": "registry:file",
26
+ "target": "~/plugins/attachment-uploads/upload.ts"
27
+ },
28
+ {
29
+ "path": "src/plugins/attachment-uploads/src/upload-prep.ts",
30
+ "content": "// Utilities for client-side file preparation prior to upload\n\nimport imageCompression from \"browser-image-compression\";\n\nconst FILE_EXTENSION_REGEX = /\\.[^.]+$/u;\n\nconst imageExtension = (mimeType: string): string => {\n if (mimeType === \"image/jpeg\") {\n return \"jpg\";\n }\n if (mimeType === \"image/png\") {\n return \"png\";\n }\n const [, extension] = mimeType.split(\"/\");\n return extension ?? \"jpg\";\n};\n\nconst compressImageIfNeeded = async (\n file: Readonly<File>,\n {\n maxBytes,\n maxDimension,\n minQuality = 0.5,\n }: Readonly<{\n maxBytes: number;\n maxDimension: number;\n minQuality?: number;\n }>\n): Promise<File> => {\n if (!file.type.startsWith(\"image/\")) {\n return file;\n }\n if (file.size <= maxBytes) {\n return file;\n }\n\n // Only compress JPEG/PNG. Leave others unchanged.\n if (![\"image/jpeg\", \"image/png\"].includes(file.type)) {\n return file;\n }\n\n const outputMime = file.type;\n\n const options = {\n fileType: outputMime,\n initialQuality: Math.min(0.9, Math.max(minQuality, 0.1)),\n maxSizeMB: maxBytes / (1024 * 1024),\n maxWidthOrHeight: maxDimension,\n useWebWorker: true,\n } as const;\n\n try {\n const maybeResult = await imageCompression(file, options);\n const resultBlob =\n maybeResult instanceof File\n ? maybeResult\n : new File([maybeResult], file.name, {\n lastModified: Date.now(),\n type: outputMime,\n });\n if (resultBlob.size >= file.size) {\n return file;\n }\n\n const base = file.name.replace(FILE_EXTENSION_REGEX, \"\");\n return new File([resultBlob], `${base}.${imageExtension(outputMime)}`, {\n lastModified: Date.now(),\n type: outputMime,\n });\n } catch {\n return file;\n }\n};\n\nexport const processFilesForUpload = async (\n files: readonly Readonly<File>[],\n options: Readonly<{\n maxBytes: number;\n maxDimension: number;\n acceptedTypes: Readonly<Record<string, readonly string[]>>;\n }>\n): Promise<{\n files: File[];\n stillOversized: File[];\n unsupportedFiles: File[];\n}> => {\n const prepared: File[] = [];\n const stillOversized: File[] = [];\n const unsupportedFiles: File[] = [];\n const { maxBytes } = options;\n\n for (const file of files) {\n if (!Object.hasOwn(options.acceptedTypes, file.type)) {\n unsupportedFiles.push(file);\n } else if (file.type.startsWith(\"image/\")) {\n // oxlint-disable-next-line no-await-in-loop -- Compress one image at a time to bound browser worker and memory use.\n const maybeCompressed = await compressImageIfNeeded(file, options);\n if (maybeCompressed.size > maxBytes) {\n stillOversized.push(file);\n } else {\n prepared.push(maybeCompressed);\n }\n } else if (file.type === \"application/pdf\") {\n if (file.size > maxBytes) {\n stillOversized.push(file);\n } else {\n prepared.push(file);\n }\n } else {\n unsupportedFiles.push(file);\n }\n }\n\n return { files: prepared, stillOversized, unsupportedFiles };\n};\n",
31
+ "type": "registry:file",
32
+ "target": "~/plugins/attachment-uploads/upload-prep.ts"
33
+ },
34
+ {
35
+ "path": "src/plugins/attachment-uploads/adapters/app/(chat)/api/files/upload/route.ts",
36
+ "content": "export { POST } from \"@/plugins/attachment-uploads/routes/upload\";\n",
37
+ "type": "registry:file",
38
+ "target": "~/app/(chat)/api/files/upload/route.ts"
39
+ },
40
+ {
41
+ "path": "src/plugins/attachment-uploads/src/routes/upload.ts",
42
+ "content": "import type { ReadonlyNativeSurface } from \"@/lib/readonly-native-surface\";\nimport { headers } from \"next/headers\";\nimport { NextResponse } from \"next/server\";\nimport { z } from \"zod\";\n\nimport { auth } from \"@/lib/auth\";\nimport { config } from \"@/lib/config\";\nimport { reserveEveUpload, writeEveUpload } from \"@/lib/db/eve-files\";\nimport { createFileId, uploadFileAtKey } from \"@/lib/file-storage\";\n\n// Allow multipart headers and fields without buffering an unbounded request.\nconst MAX_MULTIPART_OVERHEAD_BYTES = 65_536;\nconst requestTooLarge = (): NextResponse<{ error: string }> =>\n NextResponse.json(\n { error: \"Upload request exceeds the size limit\" },\n { status: 413 }\n );\n\n// Validate uploaded bytes through the Blob interface; File extends Blob.\nconst FileSchema = z.object({\n file: z\n .instanceof(Blob)\n .refine(\n (file: Readonly<Pick<Blob, \"size\">>): boolean =>\n file.size <= config.attachments.maxBytes,\n {\n message: \"File exceeds the upload size limit\",\n }\n )\n .refine(\n (file: Readonly<Pick<Blob, \"type\">>): boolean =>\n Object.hasOwn(config.attachments.acceptedTypes, file.type),\n {\n message: \"Unsupported file type\",\n }\n ),\n});\n// Keep stream accounting synchronous; the getter observes the counter after parsing.\nconst limitUploadBody = (\n request: ReadonlyNativeSurface<Pick<Request, \"body\">>,\n maxRequestBytes: number\n): {\n readonly body: ReadableStream<Uint8Array> | undefined;\n readonly exceeded: boolean;\n} => {\n let receivedBytes = 0;\n let exceedsLimit = false;\n const body = request.body?.pipeThrough(\n new TransformStream<Uint8Array, Uint8Array>({\n transform(\n chunk: ReadonlyNativeSurface<Uint8Array>,\n controller: Readonly<\n Pick<\n TransformStreamDefaultController<Uint8Array>,\n \"error\" | \"enqueue\"\n >\n >\n ): void {\n receivedBytes += chunk.byteLength;\n if (receivedBytes > maxRequestBytes) {\n exceedsLimit = true;\n controller.error(new Error(\"Upload request exceeds the size limit\"));\n return;\n }\n controller.enqueue(chunk);\n },\n })\n );\n return {\n body,\n get exceeded(): boolean {\n return exceedsLimit;\n },\n };\n};\n\nconst validateUploadForm = (\n formData: ReadonlyNativeSurface<Pick<FormData, \"get\">>\n):\n | { readonly file: File }\n | { readonly response: ReturnType<typeof requestTooLarge> } => {\n const file = formData.get(\"file\");\n\n if (!(file instanceof File)) {\n return {\n response: NextResponse.json(\n { error: \"No file uploaded\" },\n { status: 400 }\n ),\n };\n }\n\n const validatedFile = FileSchema.safeParse({ file });\n\n if (!validatedFile.success) {\n const errorMessage = validatedFile.error.issues\n .map(\n (issue: Readonly<Pick<z.core.$ZodIssue, \"message\">>): string =>\n issue.message\n )\n .join(\", \");\n\n return {\n response: NextResponse.json({ error: errorMessage }, { status: 400 }),\n };\n }\n\n return { file };\n};\n\nexport const POST = async (\n request: ReadonlyNativeSurface<Request>\n): Promise<\n | ReturnType<typeof requestTooLarge>\n | NextResponse<Awaited<ReturnType<typeof uploadFileAtKey>>>\n> => {\n const session = await auth.api.getSession({ headers: await headers() });\n\n if (!session) {\n return NextResponse.json({ error: \"Unauthorized\" }, { status: 401 });\n }\n\n const maxRequestBytes =\n config.attachments.maxBytes + MAX_MULTIPART_OVERHEAD_BYTES;\n if (Number(request.headers.get(\"content-length\")) > maxRequestBytes) {\n return requestTooLarge();\n }\n\n const limitedBody = limitUploadBody(request, maxRequestBytes);\n const formData = await new Response(limitedBody.body, {\n headers: request.headers,\n })\n .formData()\n .catch(() => null);\n if (limitedBody.exceeded) {\n return requestTooLarge();\n }\n if (!formData) {\n return NextResponse.json({ error: \"Invalid upload form\" }, { status: 400 });\n }\n\n try {\n const validated = validateUploadForm(formData);\n if (\"response\" in validated) {\n return validated.response;\n }\n const { file } = validated;\n\n // Get filename from formData since Blob doesn't have name property\n const filename = file.name;\n const fileBuffer = await file.arrayBuffer();\n\n try {\n const key = createFileId();\n await reserveEveUpload(session.user.id, key);\n // Keep the reservation if storage fails: an uncertain write can still finish.\n const write = async (): ReturnType<typeof uploadFileAtKey> =>\n await uploadFileAtKey(key, filename, fileBuffer, file.type);\n const data = await writeEveUpload(session.user.id, key, write);\n return NextResponse.json(data);\n } catch {\n return NextResponse.json({ error: \"Upload failed\" }, { status: 500 });\n }\n } catch {\n return NextResponse.json(\n { error: \"Failed to process request\" },\n { status: 500 }\n );\n }\n};\n",
43
+ "type": "registry:file",
44
+ "target": "~/plugins/attachment-uploads/routes/upload.ts"
45
+ },
46
+ {
47
+ "path": "src/plugins/attachment-uploads/src/client-plugin.ts",
48
+ "content": "import type { ChatClientPlugin } from \"@/lib/plugin-contracts\";\nimport { attachmentUploads } from \"./integration\";\n\nexport const attachmentUploadsClient = () =>\n ({\n id: \"attachment-uploads\",\n composerControls: attachmentUploads.controls,\n uploads: attachmentUploads,\n }) satisfies ChatClientPlugin;\n",
49
+ "type": "registry:file",
50
+ "target": "~/plugins/attachment-uploads/client-plugin.ts"
51
+ },
52
+ {
53
+ "path": "dist/source/attachment-uploads.json",
54
+ "content": "{\n \"id\": \"attachment-uploads\",\n \"kind\": \"plugin\",\n \"files\": [\n \"plugins/attachment-uploads/controls.tsx\",\n \"plugins/attachment-uploads/integration.tsx\",\n \"plugins/attachment-uploads/upload.ts\",\n \"plugins/attachment-uploads/upload-prep.ts\",\n \"app/(chat)/api/files/upload/route.ts\",\n \"plugins/attachment-uploads/routes/upload.ts\",\n \"plugins/attachment-uploads/client-plugin.ts\"\n ],\n \"requiresStorage\": true,\n \"client\": {\n \"export\": \"attachmentUploadsClient\",\n \"composerControls\": [\"attach-files\", \"take-photo\"],\n \"settingsItems\": [],\n \"uploads\": true\n },\n \"contractVersion\": 2,\n \"uiBase\": \"base\"\n}\n",
55
+ "type": "registry:file",
56
+ "target": "~/plugins/attachment-uploads/chatjs.json"
57
+ }
58
+ ],
59
+ "meta": {
60
+ "chatjs": {
61
+ "id": "attachment-uploads",
62
+ "kind": "plugin",
63
+ "files": [
64
+ "plugins/attachment-uploads/controls.tsx",
65
+ "plugins/attachment-uploads/integration.tsx",
66
+ "plugins/attachment-uploads/upload.ts",
67
+ "plugins/attachment-uploads/upload-prep.ts",
68
+ "app/(chat)/api/files/upload/route.ts",
69
+ "plugins/attachment-uploads/routes/upload.ts",
70
+ "plugins/attachment-uploads/client-plugin.ts"
71
+ ],
72
+ "requiresStorage": true,
73
+ "client": {
74
+ "export": "attachmentUploadsClient",
75
+ "composerControls": [
76
+ "attach-files",
77
+ "take-photo"
78
+ ],
79
+ "settingsItems": [],
80
+ "uploads": true
81
+ },
82
+ "contractVersion": 2,
83
+ "uiBase": "base"
84
+ }
85
+ },
86
+ "type": "registry:item"
87
+ }
@@ -0,0 +1,51 @@
1
+ {
2
+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",
3
+ "name": "azure-storage",
4
+ "title": "Azure Blob Storage",
5
+ "description": "Azure Blob Storage via @azure/storage-blob. Four credential modes - connection string, account key, SAS token, or anonymous.",
6
+ "dependencies": [
7
+ "files-sdk@2.5.0",
8
+ "@azure/storage-blob@^12.26.0"
9
+ ],
10
+ "files": [
11
+ {
12
+ "path": "src/storage/azure/storage-provider.ts",
13
+ "content": "export { azure as createStorageAdapter } from \"files-sdk/azure\";\n",
14
+ "type": "registry:file",
15
+ "target": "~/lib/storage-provider.ts"
16
+ }
17
+ ],
18
+ "meta": {
19
+ "chatjs": {
20
+ "configKeys": [
21
+ "container"
22
+ ],
23
+ "contractVersion": 1,
24
+ "envRequirements": [
25
+ {
26
+ "description": "Azure Blob Storage credentials",
27
+ "options": [
28
+ [
29
+ "AZURE_STORAGE_CONNECTION_STRING"
30
+ ],
31
+ [
32
+ "AZURE_STORAGE_ACCOUNT_NAME",
33
+ "AZURE_STORAGE_ACCOUNT_KEY"
34
+ ],
35
+ [
36
+ "AZURE_STORAGE_ACCOUNT_NAME",
37
+ "AZURE_STORAGE_SAS_TOKEN"
38
+ ],
39
+ [
40
+ "AZURE_STORAGE_ACCOUNT_NAME"
41
+ ]
42
+ ]
43
+ }
44
+ ],
45
+ "id": "azure",
46
+ "kind": "storage",
47
+ "optionalEnv": []
48
+ }
49
+ },
50
+ "type": "registry:item"
51
+ }
@@ -0,0 +1,44 @@
1
+ {
2
+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",
3
+ "name": "backblaze-b2-storage",
4
+ "title": "Backblaze B2",
5
+ "description": "Backblaze B2 via the S3-compatible API. Endpoint derived from the cluster code (us-west-002, us-east-005, eu-central-003, ...).",
6
+ "dependencies": [
7
+ "files-sdk@2.5.0",
8
+ "@aws-sdk/client-s3@^3.1079.0",
9
+ "@aws-sdk/s3-presigned-post@^3.700.0",
10
+ "@aws-sdk/s3-request-presigner@^3.700.0"
11
+ ],
12
+ "files": [
13
+ {
14
+ "path": "src/storage/backblaze-b2/storage-provider.ts",
15
+ "content": "export { backblazeB2 as createStorageAdapter } from \"files-sdk/backblaze-b2\";\n",
16
+ "type": "registry:file",
17
+ "target": "~/lib/storage-provider.ts"
18
+ }
19
+ ],
20
+ "meta": {
21
+ "chatjs": {
22
+ "configKeys": [
23
+ "bucket",
24
+ "region"
25
+ ],
26
+ "contractVersion": 1,
27
+ "envRequirements": [
28
+ {
29
+ "description": "Backblaze B2 credentials",
30
+ "options": [
31
+ [
32
+ "B2_APPLICATION_KEY_ID",
33
+ "B2_APPLICATION_KEY"
34
+ ]
35
+ ]
36
+ }
37
+ ],
38
+ "id": "backblaze-b2",
39
+ "kind": "storage",
40
+ "optionalEnv": []
41
+ }
42
+ },
43
+ "type": "registry:item"
44
+ }
@@ -0,0 +1,48 @@
1
+ {
2
+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",
3
+ "name": "bunny-storage-storage",
4
+ "title": "Bunny Storage",
5
+ "description": "Bunny Storage via @bunny.net/storage-sdk. Connects to a Storage Zone with its zone password / access key; auto-loads BUNNY_STORAGE_* env vars (STORAGE_* as aliases).",
6
+ "dependencies": [
7
+ "files-sdk@2.5.0",
8
+ "@bunny.net/storage-sdk@^0.3.1"
9
+ ],
10
+ "files": [
11
+ {
12
+ "path": "src/storage/bunny-storage/storage-provider.ts",
13
+ "content": "export { bunnyStorage as createStorageAdapter } from \"files-sdk/bunny-storage\";\n",
14
+ "type": "registry:file",
15
+ "target": "~/lib/storage-provider.ts"
16
+ }
17
+ ],
18
+ "meta": {
19
+ "chatjs": {
20
+ "configKeys": [],
21
+ "contractVersion": 1,
22
+ "envRequirements": [
23
+ {
24
+ "description": "Bunny Storage configuration",
25
+ "options": [
26
+ [
27
+ "BUNNY_STORAGE_ZONE"
28
+ ]
29
+ ]
30
+ },
31
+ {
32
+ "description": "Bunny Storage credentials",
33
+ "options": [
34
+ [
35
+ "BUNNY_STORAGE_ACCESS_KEY"
36
+ ]
37
+ ]
38
+ }
39
+ ],
40
+ "id": "bunny-storage",
41
+ "kind": "storage",
42
+ "optionalEnv": [
43
+ "BUNNY_STORAGE_REGION"
44
+ ]
45
+ }
46
+ },
47
+ "type": "registry:item"
48
+ }
@@ -0,0 +1,43 @@
1
+ {
2
+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",
3
+ "name": "cloudinary-storage",
4
+ "title": "Cloudinary",
5
+ "description": "Cloudinary asset CDN via the official Node SDK. Defaults to resource_type: raw for arbitrary-bytes storage; switch to image/video for transforms.",
6
+ "dependencies": [
7
+ "files-sdk@2.5.0",
8
+ "cloudinary@^2.10.0"
9
+ ],
10
+ "files": [
11
+ {
12
+ "path": "src/storage/cloudinary/storage-provider.ts",
13
+ "content": "export { cloudinary as createStorageAdapter } from \"files-sdk/cloudinary\";\n",
14
+ "type": "registry:file",
15
+ "target": "~/lib/storage-provider.ts"
16
+ }
17
+ ],
18
+ "meta": {
19
+ "chatjs": {
20
+ "configKeys": [],
21
+ "contractVersion": 1,
22
+ "envRequirements": [
23
+ {
24
+ "description": "Cloudinary credentials",
25
+ "options": [
26
+ [
27
+ "CLOUDINARY_URL"
28
+ ],
29
+ [
30
+ "CLOUDINARY_CLOUD_NAME",
31
+ "CLOUDINARY_API_KEY",
32
+ "CLOUDINARY_API_SECRET"
33
+ ]
34
+ ]
35
+ }
36
+ ],
37
+ "id": "cloudinary",
38
+ "kind": "storage",
39
+ "optionalEnv": []
40
+ }
41
+ },
42
+ "type": "registry:item"
43
+ }