@acryldev/plugin-share 0.0.0-stage → 0.1.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 acrylblends
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,86 @@
1
- # Temporary Holding Version
1
+ # plugin-share
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Share plugins between people. Pull a plugin someone released into your running app, and publish your own as a plan a person confirms.
4
+
5
+ ## Pull
6
+
7
+ ```
8
+ npm run acryl -- plugin pull github:<owner>/<repo>@<version>
9
+ ```
10
+
11
+ The line someone gives you after publishing also carries `@sha256:<digest>`. Then a release with different bytes is refused, with exit 1, and nothing changes.
12
+
13
+ The app must be running (`npm run dev`), because the pull installs into it live. A stopped app never installs offline: the line exits 3 and asks you to start the app and run the same line again.
14
+
15
+ The app remembers where each pulled plugin came from, in the `plugin-share` row of `blend.yaml`. A copy of the app fetches the same bytes at its next start.
16
+
17
+ A plugin whose route or home widget another plugin already has is refused, and the message names that plugin. A different copy of a plugin with the same name is refused too, and the message says where the copy in the app came from.
18
+
19
+ ### Native packages
20
+
21
+ A pull installs no `dependencies`. A plugin that needs a large, per-OS npm package (an engine, a native library) declares it instead,
22
+ one entry per OS and CPU, each pinned by npm's sha512 of the tarball (`npm view <package>@<version> dist.integrity dist.unpackedSize`):
23
+
24
+ ```json
25
+ "acrylblends": {
26
+ "native": [
27
+ { "package": "@deepseek-ai/libreoffice-kit-darwin-arm64", "version": "0.1.5", "os": "darwin", "cpu": "arm64",
28
+ "integrity": "sha512-...", "size": 153171456 }
29
+ ]
30
+ }
31
+ ```
32
+
33
+ Leave `cpu` out for a build that runs on any CPU of that OS (a WebAssembly one). The pull downloads only this computer's entry, from the
34
+ npm registry, checks its sha512, unpacks it into the app's home (`native/`) and links `node_modules/<package>` to it before the plugin
35
+ starts. It replaces only a missing package or the frame's empty placeholder (`@acryldev/absent`); a copy npm installed stays. Removing
36
+ the plugin removes the link and the download. An `npm install` puts the placeholder back; the app's next start links the download again.
37
+ A plugin's entries may unpack to 1 GB at most. The code is `native.ts`.
38
+
39
+ ## List and remove
40
+
41
+ ```
42
+ npm run acryl -- plugin list
43
+ npm run acryl -- plugin remove <name>
44
+ ```
45
+
46
+ The list names each plugin installed while the app runs, its version and state. A pulled one also shows the source it came from and its author, the GitHub account that released it.
47
+
48
+ Remove takes the plugin out of the running app and forgets its record. Its folder goes too when it still holds the release exactly as pulled; the pull line brings it back. A folder with someone's work in it stays, and the answer says so: the app's own plugin, or a pulled one changed since. The app then starts it again at its next start unless you delete the folder.
49
+
50
+ Both work in the frame as well.
51
+
52
+ ## Publish
53
+
54
+ ```
55
+ npm run acryl -- plugin publish <name> [--owner <account>] [--license <id>]
56
+ ```
57
+
58
+ It prints the plan: account, repository, version, visibility and license. Only a person's yes at the terminal publishes. Declining sends nothing. An agent gets the plan and cannot say yes. The output ends with the pull line to give to others.
59
+
60
+ ## An app made by an older version
61
+
62
+ Every new app has this plugin, except one made from the todo template, which installs nothing live. `upgrade` does not add it to an older app, so add it and mount it by hand:
63
+
64
+ ```
65
+ npx acrylblends add plugin-share
66
+ npm install
67
+ ```
68
+
69
+ In `src/app.ts`, import it, add it to the registry and give it the plugins folder:
70
+
71
+ ```ts
72
+ import { pluginShare } from '../plugins/plugin-share/index.ts'
73
+ // in the registry
74
+ 'plugin-share': pluginShare,
75
+ // in the configuration passed to compose
76
+ 'plugin-share': { dir: extensionsDir },
77
+ ```
78
+
79
+ In `blend.yaml`, add the row after `builder`:
80
+
81
+ ```yaml
82
+ - id: plugin-share
83
+ name: plugin-share
84
+ ```
85
+
86
+ Then restart the app.