@aiti-ai/aiti-msg-share 0.0.0-stage → 0.1.8
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 +21 -0
- package/README.md +115 -2
- package/client/src/index.js +806 -0
- package/dist/aiti-msg-share-client.mjs +3346 -0
- package/docs/README.zh-CN.md +83 -0
- package/icon.svg +1 -0
- package/icons/share-2.svg +1 -0
- package/index.ts +602 -0
- package/lib/share-core.mjs +144 -0
- package/package.json +29 -4
- package/skills/configure-target/SKILL.md +56 -0
- package/skills/import-sxcu/SKILL.md +30 -0
- package/skills/index.json +1 -0
- package/skills/troubleshoot/SKILL.md +35 -0
- package/test/share-core.test.mjs +61 -0
- package/tools/build-client.mjs +10 -0
- package/tools/deploy.mjs +32 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 aiti-ai contributors
|
|
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,116 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @aiti-ai/aiti-msg-share
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
> Share sessions, single messages, selections, files and images through pluggable targets — Gitee / image hosts / object storage / note archives — with secret redaction before upload and a QR code for the resulting URL
|
|
4
|
+
|
|
5
|
+
English · [简体中文](./docs/README.zh-CN.md)
|
|
6
|
+
|
|
7
|
+
## About aiti
|
|
8
|
+
|
|
9
|
+
This package is part of the **aiti** ecosystem — a personal AI development workbench powered by [pi](https://pi.dev): **aiti-agent** (a self-hosted web workbench built on the open-source [pi-web](https://github.com/aiti-ai/pi-web)) plus debug injection into mainstream dev tools (aiti-devtools) and a rich extension system.
|
|
10
|
+
|
|
11
|
+
- Workbench (aiti-agent, built on pi-web): <https://github.com/aiti-ai/pi-web>
|
|
12
|
+
- Ecosystem monorepo: <https://github.com/aiti-ai/aiti-ai>
|
|
13
|
+
- Site: <https://aiti.pw>
|
|
14
|
+
|
|
15
|
+
Category: Content & sharing · Tags: `share` · `session` · `message` · `qrcode` · `redaction` · `sxcu` · `gitee` · `oss` · `joplin`
|
|
16
|
+
|
|
17
|
+
## What it does
|
|
18
|
+
|
|
19
|
+
The workbench runs on your own machine, so a session URL is not reachable from outside. This extension uploads the content you pick through a **configurable share target** and gives you back a public URL — plus a QR code, clipboard copy and (where supported) the OS share sheet.
|
|
20
|
+
|
|
21
|
+
Sharing happens only when you say so, and the preview is always editable first.
|
|
22
|
+
|
|
23
|
+
## Where you can share from
|
|
24
|
+
|
|
25
|
+
| Entry | What gets shared |
|
|
26
|
+
| --- | --- |
|
|
27
|
+
| Message hover actions | That single message |
|
|
28
|
+
| `msg-smart` selection popover (copy/quote/new-session row) | The selected text |
|
|
29
|
+
| `msg-smart` file card | The referenced file |
|
|
30
|
+
| Session row → `⋯` more menu | The whole session (markdown export) |
|
|
31
|
+
| File editor toolbar | The open file, or the current selection |
|
|
32
|
+
| Image preview window | The image |
|
|
33
|
+
| Command palette | Share center |
|
|
34
|
+
|
|
35
|
+
Every entry is a **host slot or extension topic** — this extension registers providers, other extensions render them. No hard-coded buttons.
|
|
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
|
+
|
|
70
|
+
## Targets
|
|
71
|
+
|
|
72
|
+
161 built-in targets come from [`@aiti-ai/content-share`](https://www.npmjs.com/package/@aiti-ai/content-share):
|
|
73
|
+
|
|
74
|
+
- **Publish** (public URL): Gitee Snippet, Lsky Pro, SM.MS, Pastebin, Rentry, paste.rs, Alibaba Cloud OSS, plus the full ShareX `.sxcu` catalog (catbox, imgbb, gofile, 0x0.st, …)
|
|
75
|
+
- **Archive** (deep link into your own notes): Joplin, Obsidian Local REST, memos, SiYuan, Flomo
|
|
76
|
+
- **Local** (no upload): a link to the session on your own workbench
|
|
77
|
+
- **Custom**: any HTTP endpoint via a `.sxcu` config or the template provider
|
|
78
|
+
|
|
79
|
+
The share dialog shows a **recommended set** by default; "Add more…" opens the full catalog with search, config-state badges (🟢 anonymous / 🟠 needs setup / ✓ configured / 💀 dead) and a one-click **Use** action.
|
|
80
|
+
|
|
81
|
+
## Redaction
|
|
82
|
+
|
|
83
|
+
Before uploading, the text passes through [`@aiti-ai/secret-mask-core`](https://www.npmjs.com/package/@aiti-ai/secret-mask-core) — the same deterministic credential-detection engine that powers `pi-secret-mask`. Hits become `[REDACTED:RULE#hash]` placeholders, shown in the preview; the toggle re-renders the textarea immediately and restores the original when unchecked.
|
|
84
|
+
|
|
85
|
+
Binary content (images/files) is not scanned — the UI says so.
|
|
86
|
+
|
|
87
|
+
## Page info stamp
|
|
88
|
+
|
|
89
|
+
A multi-select in the preview header prepends optional context to the shared text: **OS**, **browser**, **URL**, **session id**, **session name**. Handy when sharing a screenshot-free snippet with someone who needs to know which machine/browser/session it came from.
|
|
90
|
+
|
|
91
|
+
## AI skills
|
|
92
|
+
|
|
93
|
+
Declared through `aiti-helper`'s standard `skills/` mechanism:
|
|
94
|
+
|
|
95
|
+
- `configure-target` — walk through obtaining and storing a token/key for a provider, then verify it
|
|
96
|
+
- `troubleshoot` — read share history, classify the failure, recommend a fix or another target
|
|
97
|
+
- `import-sxcu` — validate a ShareX config and register it as a target
|
|
98
|
+
|
|
99
|
+
## Install
|
|
100
|
+
|
|
101
|
+
Bundled with **aiti-agent** (`@aiti-ai/pi-web`) — enable it from the in-app extension manager (ExtMan / App Center).
|
|
102
|
+
|
|
103
|
+
Standalone use requires the pi-web host; this package is not a general-purpose library (see [`@aiti-ai/content-share`](https://www.npmjs.com/package/@aiti-ai/content-share) for that).
|
|
104
|
+
|
|
105
|
+
## Data & privacy
|
|
106
|
+
|
|
107
|
+
- Target credentials live in `<configDir>/targets.json` with mode `0600`; API responses are masked.
|
|
108
|
+
- Uploads go through the extension's own server route — the browser never holds a token and there are no CORS workarounds.
|
|
109
|
+
- Share history is stored in `<stateDir>/shares.json` (last 200 entries).
|
|
110
|
+
- File shares respect the host's allowed-roots policy (`ctx.core.fileAccess`).
|
|
111
|
+
|
|
112
|
+
## License
|
|
113
|
+
|
|
114
|
+
MIT
|
|
115
|
+
|
|
116
|
+
[简体中文](./docs/README.zh-CN.md)
|