@aiti-ai/aiti-msg-share 0.1.10 → 0.1.12
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 +2 -3
- package/deploy-commit.mjs +52 -0
- package/docs/README.zh-CN.md +2 -2
- package/icon.svg +1 -1
- package/package.json +11 -2
package/README.md
CHANGED
|
@@ -6,10 +6,9 @@ English · [简体中文](./docs/README.zh-CN.md)
|
|
|
6
6
|
|
|
7
7
|
## About aiti
|
|
8
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/
|
|
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/aiti-ai)) plus debug injection into mainstream dev tools (aiti-devtools) and a rich extension system.
|
|
10
10
|
|
|
11
|
-
- Workbench
|
|
12
|
-
- Ecosystem monorepo: <https://github.com/aiti-ai/aiti-ai>
|
|
11
|
+
- Workbench & monorepo: <https://github.com/aiti-ai/aiti-ai>
|
|
13
12
|
- Site: <https://aiti.pw>
|
|
14
13
|
|
|
15
14
|
Category: Content & sharing · Tags: `share` · `session` · `message` · `qrcode` · `redaction` · `sxcu` · `gitee` · `oss` · `joplin`
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* deploy 脚本共享「部署状态 commit」助手(pi-web-ext 各扩展 tools/deploy.mjs 统一用)。
|
|
3
|
+
*
|
|
4
|
+
* 背景(2026-08-30 排障,session 0cc6ad47 op264):重复部署同内容时
|
|
5
|
+
* `git add -A && git commit` 以 "nothing to commit" exit 1,而 stdio:"ignore" 吞掉
|
|
6
|
+
* stderr,输出「提交失败(忽略):Command failed: …」假报警(msg-smart 实证);
|
|
7
|
+
* 另有 --allow-empty 族每次部署都造空 commit 噪音。本助手统一三态语义:
|
|
8
|
+
* committed → 有暂存变更,已提交
|
|
9
|
+
* clean → 无变更,跳过(不算失败)
|
|
10
|
+
* failed → git 真失败(带 stderr 首行,不阻断部署——部署本体永远优先)
|
|
11
|
+
*
|
|
12
|
+
* 用法:
|
|
13
|
+
* import { deployCommit } from "../../_shared/deploy-commit.mjs";
|
|
14
|
+
* deployCommit({ repo: extRepo, name: "aiti-msg-smart", paths: ["aiti-msg-smart"],
|
|
15
|
+
* log: (m) => console.log("[deploy] " + m) });
|
|
16
|
+
*
|
|
17
|
+
* 红线:本助手永不 throw、不触碰部署产物路径之外的任何东西;只对 <repo> 做
|
|
18
|
+
* add/diff/commit(默认 --no-verify,extRepo 无 hooks,防未来误挂)。
|
|
19
|
+
*/
|
|
20
|
+
import { execFileSync } from "node:child_process";
|
|
21
|
+
|
|
22
|
+
export function deployCommit({ repo, name, paths = null, extraMsg = "", ident = false, log = console.log }) {
|
|
23
|
+
const git = (args) =>
|
|
24
|
+
execFileSync("git", args, { cwd: repo, encoding: "utf8", stdio: ["ignore", "pipe", "pipe"] });
|
|
25
|
+
const firstLine = (s) => String(s || "").trim().split("\n")[0];
|
|
26
|
+
try {
|
|
27
|
+
// 暂存:默认只收本扩展子目录(与 add <ext> 行为对齐;避免把别的扩展的
|
|
28
|
+
// 未提交改动卷进本扩展的部署 commit);paths=null 时退回 add -A 全仓。
|
|
29
|
+
git(["add", ...(paths && paths.length ? ["--", ...paths] : ["-A"])]);
|
|
30
|
+
let dirty;
|
|
31
|
+
try {
|
|
32
|
+
git(["diff", "--cached", "--quiet"]);
|
|
33
|
+
dirty = false; // exit 0 = 暂存区与 HEAD 一致
|
|
34
|
+
} catch (e) {
|
|
35
|
+
if (e.status !== 1) throw e; // 1 = 有变更;其他才是真错误
|
|
36
|
+
dirty = true;
|
|
37
|
+
}
|
|
38
|
+
if (!dirty) {
|
|
39
|
+
log("扩展仓库无变化(跳过提交)");
|
|
40
|
+
return { status: "clean" };
|
|
41
|
+
}
|
|
42
|
+
const stamp = new Date().toISOString().replace("T", " ").slice(0, 19);
|
|
43
|
+
const msg = `[deploy] ${name} · ${stamp}${extraMsg ? " · " + extraMsg : ""}`;
|
|
44
|
+
git([...(ident ? ["-c", "user.name=deploy", "-c", "user.email=deploy@local"] : []), "commit", "--no-verify", "-m", msg]);
|
|
45
|
+
log("扩展仓库已提交:" + msg);
|
|
46
|
+
return { status: "committed", msg };
|
|
47
|
+
} catch (e) {
|
|
48
|
+
const reason = firstLine(e.stderr) || firstLine(e.message) || "git error";
|
|
49
|
+
log("提交失败(忽略,不影响部署):" + reason);
|
|
50
|
+
return { status: "failed", reason };
|
|
51
|
+
}
|
|
52
|
+
}
|
package/docs/README.zh-CN.md
CHANGED
|
@@ -6,9 +6,9 @@
|
|
|
6
6
|
|
|
7
7
|
## 关于 aiti
|
|
8
8
|
|
|
9
|
-
本包是 **aiti** 生态的一部分——由 [pi](https://pi.dev) 驱动的个人 AI 开发工作台:**aiti-agent**(基于开源 [pi-web](https://github.com/aiti-ai/
|
|
9
|
+
本包是 **aiti** 生态的一部分——由 [pi](https://pi.dev) 驱动的个人 AI 开发工作台:**aiti-agent**(基于开源 [pi-web](https://github.com/aiti-ai/aiti-ai) 的自托管 Web 工作台),加上对主流开发工具的调试注入(aiti-devtools)与丰富的扩展体系。
|
|
10
10
|
|
|
11
|
-
- 工作台(aiti-agent,基于 pi-web):<https://github.com/aiti-ai/
|
|
11
|
+
- 工作台(aiti-agent,基于 pi-web):<https://github.com/aiti-ai/aiti-ai>
|
|
12
12
|
- 生态主仓:<https://github.com/aiti-ai/aiti-ai>
|
|
13
13
|
- 站点:<https://aiti.pw>
|
|
14
14
|
|
package/icon.svg
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="18" cy="5" r="3"/><circle cx="6" cy="12" r="3"/><circle cx="18" cy="19" r="3"/><line x1="8.6" y1="10.5" x2="15.4" y2="6.5"/><line x1="8.6" y1="13.5" x2="15.4" y2="17.5"/></svg>
|
package/package.json
CHANGED
|
@@ -1,11 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aiti-ai/aiti-msg-share",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.12",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Share sessions, messages, selections, files and images through pluggable targets with secret redaction and QR codes",
|
|
6
|
+
"displayNameI18n": {
|
|
7
|
+
"en": "Message Share"
|
|
8
|
+
},
|
|
9
|
+
"descriptionI18n": {
|
|
10
|
+
"zh-CN": "把会话、单条消息、划选内容、文件与图片分享出去——工作台跑在自己机器上、外网访问不到,所以经可配置的分享目标(Gitee / 图床 / 对象存储 / 笔记库,内置 161 个)上传换回公网 URL,上传前自动脱敏,结果附二维码"
|
|
11
|
+
},
|
|
6
12
|
"license": "MIT",
|
|
7
13
|
"aitiExtProtocol": "1.0",
|
|
8
14
|
"soul": "分享出去,是为了让对话继续。",
|
|
15
|
+
"soulI18n": {
|
|
16
|
+
"en": "Sharing it out is how the conversation continues."
|
|
17
|
+
},
|
|
9
18
|
"dependencies": {
|
|
10
19
|
"@aiti-ai/content-share": "^0.1.16",
|
|
11
20
|
"@aiti-ai/secret-mask-core": "^0.1.0",
|
|
@@ -27,5 +36,5 @@
|
|
|
27
36
|
"bugs": {
|
|
28
37
|
"url": "https://github.com/aiti-ai/aiti-ai/issues"
|
|
29
38
|
},
|
|
30
|
-
"contentHash": "
|
|
39
|
+
"contentHash": "d930a101f13c3986"
|
|
31
40
|
}
|