@aiti-ai/aiti-msg-share 0.1.12 → 0.1.13
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/package.json +4 -3
- package/tools/deploy.mjs +1 -1
- package/deploy-commit.mjs +0 -52
- package/icons/share-2.svg +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aiti-ai/aiti-msg-share",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.13",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Share sessions, messages, selections, files and images through pluggable targets with secret redaction and QR codes",
|
|
6
6
|
"displayNameI18n": {
|
|
@@ -18,7 +18,8 @@
|
|
|
18
18
|
"dependencies": {
|
|
19
19
|
"@aiti-ai/content-share": "^0.1.16",
|
|
20
20
|
"@aiti-ai/secret-mask-core": "^0.1.0",
|
|
21
|
-
"qrcode": "^1.5.4"
|
|
21
|
+
"qrcode": "^1.5.4",
|
|
22
|
+
"@aiti-ai/ext-shared": "^0.1.22"
|
|
22
23
|
},
|
|
23
24
|
"devDependencies": {
|
|
24
25
|
"esbuild": "^0.24.2"
|
|
@@ -36,5 +37,5 @@
|
|
|
36
37
|
"bugs": {
|
|
37
38
|
"url": "https://github.com/aiti-ai/aiti-ai/issues"
|
|
38
39
|
},
|
|
39
|
-
"contentHash": "
|
|
40
|
+
"contentHash": "45073204e61c37eb"
|
|
40
41
|
}
|
package/tools/deploy.mjs
CHANGED
|
@@ -4,7 +4,7 @@ import { cpSync, rmSync, mkdirSync, existsSync } from "node:fs";
|
|
|
4
4
|
import { resolve } from "node:path";
|
|
5
5
|
import { homedir } from "node:os";
|
|
6
6
|
import { execSync } from "node:child_process";
|
|
7
|
-
import { deployCommit } from "
|
|
7
|
+
import { deployCommit } from "@aiti-ai/ext-shared/deploy-commit";
|
|
8
8
|
|
|
9
9
|
const root = resolve(import.meta.dirname, "..");
|
|
10
10
|
console.log("[deploy] build client…");
|
package/deploy-commit.mjs
DELETED
|
@@ -1,52 +0,0 @@
|
|
|
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/icons/share-2.svg
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.6" 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>
|