|
| 1 | +# DeepChat Plugin Packaging |
| 2 | + |
| 3 | +This guide documents `.dcplugin` packaging for official DeepChat plugins bundled with DeepChat |
| 4 | +release packages. |
| 5 | + |
| 6 | +## Package Format |
| 7 | + |
| 8 | +A `.dcplugin` file is a zip archive built from one plugin directory. |
| 9 | + |
| 10 | +Required files: |
| 11 | + |
| 12 | +- `plugin.json`: hydrated manifest used by the installer. |
| 13 | +- `checksums.json`: SHA-256 checksums for packaged files. |
| 14 | +- every file declared by manifest skills and settings contributions. |
| 15 | +- runtime payloads required by the target platform and architecture. |
| 16 | + |
| 17 | +The packager excludes development-only sources such as `vendor/`, `build/`, `node_modules/`, |
| 18 | +`.build/`, `.DS_Store`, and symlinks. |
| 19 | + |
| 20 | +Official packages keep DeepChat release asset URLs in their manifest metadata: |
| 21 | + |
| 22 | +```text |
| 23 | +https://github.com/ThinkInAIXYZ/deepchat/releases/download/v<version>/<asset-name>.dcplugin |
| 24 | +``` |
| 25 | + |
| 26 | +## CUA Plugin Artifacts |
| 27 | + |
| 28 | +The CUA plugin ships one macOS helper app per CPU architecture. The bundled package filename |
| 29 | +includes both platform and architecture: |
| 30 | + |
| 31 | +```text |
| 32 | +deepchat-plugin-cua-<version>-darwin-arm64.dcplugin |
| 33 | +deepchat-plugin-cua-<version>-darwin-x64.dcplugin |
| 34 | +``` |
| 35 | + |
| 36 | +The manifest inside each package keeps the official DeepChat release-download namespace for trust |
| 37 | +metadata. Runtime detection inside the package uses the same architecture-specific plugin path: |
| 38 | + |
| 39 | +```text |
| 40 | +plugin:runtime/darwin/<arch>/DeepChat Computer Use.app/Contents/MacOS/cua-driver |
| 41 | +``` |
| 42 | + |
| 43 | +Architecture mapping: |
| 44 | + |
| 45 | +| DeepChat arch | Swift arch | Runtime directory | |
| 46 | +| --- | --- | --- | |
| 47 | +| `arm64` | `arm64` | `runtime/darwin/arm64/` | |
| 48 | +| `x64` | `x86_64` | `runtime/darwin/x64/` | |
| 49 | + |
| 50 | +Each `.dcplugin` contains only the runtime directory for its target architecture. |
| 51 | + |
| 52 | +## Local Commands |
| 53 | + |
| 54 | +Validate the package metadata for the current host architecture: |
| 55 | + |
| 56 | +```bash |
| 57 | +pnpm run plugin:cua:validate |
| 58 | +``` |
| 59 | + |
| 60 | +Build and package the current host architecture: |
| 61 | + |
| 62 | +```bash |
| 63 | +pnpm run plugin:cua:package |
| 64 | +``` |
| 65 | + |
| 66 | +Build and package explicit macOS architectures: |
| 67 | + |
| 68 | +```bash |
| 69 | +pnpm run plugin:cua:package:mac:arm64 |
| 70 | +pnpm run plugin:cua:package:mac:x64 |
| 71 | +``` |
| 72 | + |
| 73 | +Build the package that will be embedded into the macOS app: |
| 74 | + |
| 75 | +```bash |
| 76 | +pnpm run plugin:cua:bundle:mac:arm64 |
| 77 | +pnpm run plugin:cua:bundle:mac:x64 |
| 78 | +``` |
| 79 | + |
| 80 | +Validate explicit macOS architectures after their helper runtimes have been staged: |
| 81 | + |
| 82 | +```bash |
| 83 | +pnpm run plugin:cua:validate:mac:arm64 |
| 84 | +pnpm run plugin:cua:validate:mac:x64 |
| 85 | +``` |
| 86 | + |
| 87 | +Standalone packages are written to: |
| 88 | + |
| 89 | +```text |
| 90 | +dist/plugins/ |
| 91 | +``` |
| 92 | + |
| 93 | +Bundled packages are written to: |
| 94 | + |
| 95 | +```text |
| 96 | +build/bundled-plugins/ |
| 97 | +``` |
| 98 | + |
| 99 | +## CI And Release |
| 100 | + |
| 101 | +The macOS build matrix in `.github/workflows/build.yml` builds the matching CUA plugin bundle before |
| 102 | +running `electron-builder`. Electron Builder embeds it into: |
| 103 | + |
| 104 | +```text |
| 105 | +DeepChat.app/Contents/Resources/app.asar.unpacked/plugins/ |
| 106 | +``` |
| 107 | + |
| 108 | +Each matrix job verifies the expected bundled `.dcplugin` exists inside the app before uploading |
| 109 | +artifacts. |
| 110 | + |
| 111 | +The release workflow repeats the same bundled package step. The final release uploads app artifacts |
| 112 | +only; `.dcplugin` files are not published as separate GitHub Release assets. |
| 113 | + |
| 114 | +Expected embedded files: |
| 115 | + |
| 116 | +```text |
| 117 | +app.asar.unpacked/plugins/deepchat-plugin-cua-<version>-darwin-x64.dcplugin |
| 118 | +app.asar.unpacked/plugins/deepchat-plugin-cua-<version>-darwin-arm64.dcplugin |
| 119 | +``` |
0 commit comments