@aiti-ai/aiti-msg-share 0.1.0 → 0.1.10
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/README.md +33 -0
- package/client/src/index.js +474 -24
- package/dist/aiti-msg-share-client.mjs +679 -25
- package/index.ts +190 -28
- package/lib/provider-icons.mjs +63 -0
- package/lib/share-core.mjs +28 -0
- package/package.json +3 -3
- package/test/provider-icons.test.mjs +47 -0
- package/test/share-core.test.mjs +25 -0
package/README.md
CHANGED
|
@@ -34,6 +34,39 @@ Sharing happens only when you say so, and the preview is always editable first.
|
|
|
34
34
|
|
|
35
35
|
Every entry is a **host slot or extension topic** — this extension registers providers, other extensions render them. No hard-coded buttons.
|
|
36
36
|
|
|
37
|
+
## Save-to (local favourite sinks)
|
|
38
|
+
|
|
39
|
+
Above the network targets the dialog always shows a **Save to** row — the same idea as a mobile
|
|
40
|
+
share sheet, where "Copy" and "Save to…" sit next to the upload targets:
|
|
41
|
+
|
|
42
|
+
| Sink | Provider | Effect |
|
|
43
|
+
| --- | --- | --- |
|
|
44
|
+
| Copy | built in | Copies the content to the clipboard |
|
|
45
|
+
| Save as command | `aiti-cmd` | Adds it to the saved-commands library (one click, editable later) |
|
|
46
|
+
| Save as prompt | `aiti-prompts` | Adds it to the prompt snippet library |
|
|
47
|
+
|
|
48
|
+
Sinks are a **different provider family** from targets: they store locally — no upload, no URL,
|
|
49
|
+
no redaction — and they never appear in the target manager.
|
|
50
|
+
|
|
51
|
+
### Extension point (topic `share-sink`)
|
|
52
|
+
|
|
53
|
+
```js
|
|
54
|
+
ctx.registerTopicItem("share-sink", {
|
|
55
|
+
id: "my-ext.thing", // unique
|
|
56
|
+
order: 30, // optional, lower = further left
|
|
57
|
+
label: "Save as thing", // string or () => string
|
|
58
|
+
icon: { svg: "<path .../>" }, // optional 24×24 inner markup
|
|
59
|
+
accepts: (payload) => true, // payload = { kind, text, title, tags, ...original }
|
|
60
|
+
async save(payload) {
|
|
61
|
+
return { ok: true, message: "Saved", action: { label: "Open", run() {} } };
|
|
62
|
+
},
|
|
63
|
+
});
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
`payload.text` is the **unredacted** body with the page-info stamp removed (local storage is not an upload, and the stamp is sharing metadata — it must never end up inside a saved command). The consumer
|
|
67
|
+
(`aiti-msg-share`) renders the chips, shows the receipt and runs `action.run` on click.
|
|
68
|
+
Providers that are not loaded simply do not appear.
|
|
69
|
+
|
|
37
70
|
## Targets
|
|
38
71
|
|
|
39
72
|
161 built-in targets come from [`@aiti-ai/content-share`](https://www.npmjs.com/package/@aiti-ai/content-share):
|