@aiti-ai/aiti-configs 0.1.10 → 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/README.md +2 -3
- package/README.zh-CN.md +2 -3
- package/client/src/configs-app.tsx +16 -16
- package/dist/aiti-configs-client.mjs +16 -16
- package/icon.svg +1 -1
- package/index.ts +10 -4
- package/package.json +12 -3
- package/vite.config.ts +4 -0
package/README.md
CHANGED
|
@@ -6,10 +6,9 @@ English · [简体中文](./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: AI capabilities · Tags: `config` · `versioning` · `git` · `watchdog` · `restore` · `safety`
|
package/README.zh-CN.md
CHANGED
|
@@ -6,10 +6,9 @@
|
|
|
6
6
|
|
|
7
7
|
## 关于 aiti
|
|
8
8
|
|
|
9
|
-
本包是 **aiti** 生态的组成部分——以 [pi](https://pi.dev) 为引擎的个人 AI 开发工作台与本地调试注入生态:**aiti-agent**(自托管 Web 工作台,基于开源项目 [pi-web](https://github.com/aiti-ai/
|
|
9
|
+
本包是 **aiti** 生态的组成部分——以 [pi](https://pi.dev) 为引擎的个人 AI 开发工作台与本地调试注入生态:**aiti-agent**(自托管 Web 工作台,基于开源项目 [pi-web](https://github.com/aiti-ai/aiti-ai) 构建,浏览器为主操作面)+ 各开发工具内的调试注入(aiti-devtools)+ 丰富的扩展体系。
|
|
10
10
|
|
|
11
|
-
-
|
|
12
|
-
- 生态仓库: <https://github.com/aiti-ai/aiti-ai>
|
|
11
|
+
- 工作台 / 生态仓库(aiti-agent,基于 pi-web): <https://github.com/aiti-ai/aiti-ai>
|
|
13
12
|
- 官网: <https://aiti.pw>
|
|
14
13
|
|
|
15
14
|
分类: AI 能力 · tags: `config` · `versioning` · `git` · `watchdog` · `restore` · `safety`
|
|
@@ -41,15 +41,15 @@ const C: Record<string, any> = {
|
|
|
41
41
|
head: { display: "flex", alignItems: "center", gap: 8, padding: "10px 14px", borderBottom: "1px solid var(--border,#e0e0e0)", background: "var(--bg-subtle,#f5f5f5)" },
|
|
42
42
|
tabs: { display: "flex", gap: 4, flex: 1, overflowX: "auto" },
|
|
43
43
|
tab: { padding: "5px 12px", border: "none", borderRadius: 8, cursor: "pointer", background: "transparent", color: "var(--text,#1a1a1a)", fontWeight: 500 },
|
|
44
|
-
tabOn: { background: "var(--accent,#2563eb)", color: "#fff" },
|
|
44
|
+
tabOn: { background: "var(--accent,#2563eb)", color: "var(--accent-contrast, #fff)" },
|
|
45
45
|
body: { padding: 12, overflow: "auto", flex: 1 },
|
|
46
46
|
btn: { padding: "5px 12px", border: "1px solid var(--border,#e0e0e0)", borderRadius: 8, cursor: "pointer", background: "var(--bg,#fff)", color: "var(--text,#1a1a1a)", fontWeight: 500 },
|
|
47
|
-
btnPrimary: { background: "var(--accent,#2563eb)", borderColor: "var(--accent,#2563eb)", color: "#fff" },
|
|
47
|
+
btnPrimary: { background: "var(--accent,#2563eb)", borderColor: "var(--accent,#2563eb)", color: "var(--accent-contrast, #fff)" },
|
|
48
48
|
row: { padding: "6px 8px", borderBottom: "1px solid var(--border,#e0e0e0)", cursor: "pointer" },
|
|
49
49
|
mono: { font: "11.5px/1.5 ui-monospace, monospace", wordBreak: "break-all" },
|
|
50
50
|
pre: { background: "var(--bg-subtle,#f5f5f5)", border: "1px solid var(--border,#e0e0e0)", borderRadius: 8, padding: 10, overflow: "auto", maxHeight: 260, whiteSpace: "pre-wrap", wordBreak: "break-all", font: "11.5px/1.5 ui-monospace, monospace" },
|
|
51
51
|
// 黄色错误提示样式:当有错误时显示黄色警告框
|
|
52
|
-
errorMsg: { padding: "6px 10px", borderRadius: 8, background: "#
|
|
52
|
+
errorMsg: { padding: "6px 10px", borderRadius: 8, background: "color-mix(in srgb, var(--warn, #f59e0b) 14%, transparent)", color: "var(--warn, #b45309)", marginBottom: 8, fontSize: 12, border: "1px solid color-mix(in srgb, var(--warn, #f59e0b) 38%, transparent)" },
|
|
53
53
|
msg: { padding: "6px 10px", borderRadius: 8, background: "var(--bg-subtle,#f5f5f5)", marginBottom: 8, fontSize: 12 },
|
|
54
54
|
};
|
|
55
55
|
|
|
@@ -177,7 +177,7 @@ function App({ open, onClose }: { open: boolean; onClose: () => void }) {
|
|
|
177
177
|
return (
|
|
178
178
|
<div>
|
|
179
179
|
{rs && rs.url ? (
|
|
180
|
-
<div style={{ fontSize: 12, marginBottom: 8, padding: "6px 8px", borderRadius: 8, background: "#
|
|
180
|
+
<div style={{ fontSize: 12, marginBottom: 8, padding: "6px 8px", borderRadius: 8, background: "color-mix(in srgb, var(--accent, #2563eb) 8%, transparent)", border: "1px solid color-mix(in srgb, var(--accent, #2563eb) 30%, transparent)", color: "var(--accent, #2563eb)" }}>
|
|
181
181
|
{t("远端同步:") + (rs.push ? t("启用") : t("停用")) + " · " + rs.url + (rs.autoPull ? " · pull --rebase" : "") + " · branch=" + (rs.branch || "main")}
|
|
182
182
|
</div>
|
|
183
183
|
) : null}
|
|
@@ -188,14 +188,14 @@ function App({ open, onClose }: { open: boolean; onClose: () => void }) {
|
|
|
188
188
|
<button style={C.btn} onClick={() => load("status")}>{t("↻ 刷新")}</button>
|
|
189
189
|
</div>
|
|
190
190
|
{d.clean === true ? (
|
|
191
|
-
<div style={{ color: "#16a34a", fontWeight: 600 }}>{t("工作区干净(无可提交变更)")}</div>
|
|
191
|
+
<div style={{ color: "var(--ok, #16a34a)", fontWeight: 600 }}>{t("工作区干净(无可提交变更)")}</div>
|
|
192
192
|
) : (d.changed && d.changed.length ? (
|
|
193
193
|
<div>
|
|
194
194
|
<div style={{ fontWeight: 600, marginBottom: 6 }}>{t("待提交 ") + d.changed.length + t(" 个文件:")}</div>
|
|
195
195
|
{d.changed.map((c: any, i: number) => (
|
|
196
196
|
<div key={i} style={{ ...C.row, background: fileDiff?.path === c.path ? "var(--bg-subtle,#f5f5f5)" : undefined }}
|
|
197
197
|
onClick={() => showFileDiff(c.path)} title={t("点击查看该文件未提交 diff")}>
|
|
198
|
-
<span style={{ color: c.status === "D" ? "#dc2626" : c.status === "??" ? "#16a34a" : "#2563eb", fontWeight: 700, marginRight: 6 }}>
|
|
198
|
+
<span style={{ color: c.status === "D" ? "var(--danger, #dc2626)" : c.status === "??" ? "var(--ok, #16a34a)" : "var(--accent, #2563eb)", fontWeight: 700, marginRight: 6 }}>
|
|
199
199
|
{c.status === "D" ? "DEL" : c.status === "??" ? "NEW" : "MOD"}
|
|
200
200
|
</span>
|
|
201
201
|
<span style={C.mono}>{c.path}</span>
|
|
@@ -210,7 +210,7 @@ function App({ open, onClose }: { open: boolean; onClose: () => void }) {
|
|
|
210
210
|
</div>
|
|
211
211
|
) : null)}
|
|
212
212
|
{d.skipped && d.skipped.length > 0 ? (
|
|
213
|
-
<div style={{ marginTop: 8, fontSize: 12, color: "#d97706" }}>
|
|
213
|
+
<div style={{ marginTop: 8, fontSize: 12, color: "var(--warn, #d97706)" }}>
|
|
214
214
|
{t("拦截 ") + d.skipped.length + t(" 项:") + d.skipped.map((s: any) => s.reason).slice(0, 5).join(";") + (d.skipped.length > 5 ? "…" : "")}
|
|
215
215
|
</div>
|
|
216
216
|
) : null}
|
|
@@ -233,9 +233,9 @@ function App({ open, onClose }: { open: boolean; onClose: () => void }) {
|
|
|
233
233
|
{tagList && tagList.tags && tagList.tags.length > 0 ? (
|
|
234
234
|
<div style={{ marginBottom: 8 }}>
|
|
235
235
|
{tagList.tags.map((tag: any) => (
|
|
236
|
-
<span key={tag.name} style={{ display: "inline-flex", alignItems: "center", gap: 4, margin: "0 6px 4px 0", padding: "2px 8px", borderRadius: 10, background: "#
|
|
236
|
+
<span key={tag.name} style={{ display: "inline-flex", alignItems: "center", gap: 4, margin: "0 6px 4px 0", padding: "2px 8px", borderRadius: 10, background: "color-mix(in srgb, var(--warn, #f59e0b) 14%, transparent)", color: "var(--warn, #b45309)", fontSize: 11, border: "1px solid color-mix(in srgb, var(--warn, #f59e0b) 38%, transparent)" }}>
|
|
237
237
|
<Ic size={11} paths={ICONS.tag} />{" "}{tag.name}
|
|
238
|
-
<button style={{ border: "none", background: "transparent", cursor: "pointer", color: "#
|
|
238
|
+
<button style={{ border: "none", background: "transparent", cursor: "pointer", color: "var(--warn, #b45309)", display: "flex" }} onClick={() => doDelTag(t.name)} aria-label={t("删除 tag")}>
|
|
239
239
|
<Ic size={10} paths={ICONS.x} />
|
|
240
240
|
</button>
|
|
241
241
|
</span>
|
|
@@ -246,9 +246,9 @@ function App({ open, onClose }: { open: boolean; onClose: () => void }) {
|
|
|
246
246
|
<div key={r.hash} style={C.row} onClick={() => showDiff(r.hash)}>
|
|
247
247
|
<div>
|
|
248
248
|
<span style={{ color: "var(--accent,#2563eb)", fontWeight: 700, marginRight: 6 }}>{r.hash}</span>
|
|
249
|
-
<span style={{ color: "var(--text-
|
|
249
|
+
<span style={{ color: "var(--text-dim,#666)", marginRight: 6 }}>{String(r.date || "").slice(5, 16)}</span>
|
|
250
250
|
{(r.tags || []).map((tag: string) => (
|
|
251
|
-
<span key={tag} style={{ marginRight: 4, padding: "1px 6px", borderRadius: 8, background: "#
|
|
251
|
+
<span key={tag} style={{ marginRight: 4, padding: "1px 6px", borderRadius: 8, background: "color-mix(in srgb, var(--warn, #f59e0b) 14%, transparent)", color: "var(--warn, #b45309)", fontSize: 10 }}>
|
|
252
252
|
<Ic size={10} paths={ICONS.tag} />{tag}
|
|
253
253
|
</span>
|
|
254
254
|
))}
|
|
@@ -276,14 +276,14 @@ function App({ open, onClose }: { open: boolean; onClose: () => void }) {
|
|
|
276
276
|
const d = data || {};
|
|
277
277
|
return (
|
|
278
278
|
<div>
|
|
279
|
-
<div style={{ fontWeight: 600, marginBottom: 6, color: d.ok ? "#16a34a" : "#dc2626" }}>
|
|
279
|
+
<div style={{ fontWeight: 600, marginBottom: 6, color: d.ok ? "var(--ok, #16a34a)" : "var(--danger, #dc2626)" }}>
|
|
280
280
|
{d.ok ? t("自检通过") : t("自检未通过(") + ((d.bad || []).length) + t(" 项)")}
|
|
281
281
|
</div>
|
|
282
282
|
{(d.rows || []).map((r: any, i: number) => (
|
|
283
283
|
<div key={i} style={C.row}>
|
|
284
284
|
<span style={{ marginRight: 6, display: "inline-flex" }}><Ic size={13} paths={r.ok ? ICONS.check : ICONS.x} /></span>
|
|
285
285
|
<b>{r.name}</b>
|
|
286
|
-
<span style={{ color: "var(--text-
|
|
286
|
+
<span style={{ color: "var(--text-dim,#666)", marginLeft: 6 }}>{r.detail}</span>
|
|
287
287
|
</div>
|
|
288
288
|
))}
|
|
289
289
|
<button style={{ ...C.btn, marginTop: 8 }} onClick={() => load("selfcheck")}>{t("↻ 重新自检")}</button>
|
|
@@ -307,7 +307,7 @@ function App({ open, onClose }: { open: boolean; onClose: () => void }) {
|
|
|
307
307
|
const rc = (d.config && d.config.remote) || {};
|
|
308
308
|
const en = (d.config && d.config.encrypt) || {};
|
|
309
309
|
const es = encStatus && encStatus.encrypt ? encStatus.encrypt : {};
|
|
310
|
-
const warn = { padding: "8px 10px", borderRadius: 8, background: "#
|
|
310
|
+
const warn = { padding: "8px 10px", borderRadius: 8, background: "color-mix(in srgb, var(--danger, #ef4444) 10%, transparent)", border: "1px solid color-mix(in srgb, var(--danger, #ef4444) 32%, transparent)", color: "var(--danger, #b91c1c)", fontSize: 12, marginBottom: 8, lineHeight: 1.6 };
|
|
311
311
|
const inp = { padding: "5px 8px", border: "1px solid var(--border,#e0e0e0)", borderRadius: 6, background: "var(--bg,#fff)", color: "var(--text,#1a1a1a)", fontSize: 12 };
|
|
312
312
|
const g = (id: string) => document.getElementById(id) as HTMLInputElement | null;
|
|
313
313
|
return (
|
|
@@ -338,7 +338,7 @@ function App({ open, onClose }: { open: boolean; onClose: () => void }) {
|
|
|
338
338
|
</div>
|
|
339
339
|
<div style={{ display: "flex", gap: 14, marginBottom: 6, fontSize: 12, alignItems: "center" }}>
|
|
340
340
|
<label style={{ display: "flex", alignItems: "center", gap: 4 }}><input id="cfg-enc-enabled" type="checkbox" defaultChecked={en.enabled === true} />{t("启用密文")} commit</label>
|
|
341
|
-
<span style={{ color: es.keyExists === true ? "#16a34a" : "#dc2626" }}>{es.keyExists === true ? t("密钥已生成(") + (es.keyFile || "") + ")" : t("密钥未生成(先点生成密钥)")}</span>
|
|
341
|
+
<span style={{ color: es.keyExists === true ? "var(--ok, #16a34a)" : "var(--danger, #dc2626)" }}>{es.keyExists === true ? t("密钥已生成(") + (es.keyFile || "") + ")" : t("密钥未生成(先点生成密钥)")}</span>
|
|
342
342
|
</div>
|
|
343
343
|
<div style={{ display: "flex", gap: 6, marginBottom: 6 }}>
|
|
344
344
|
<input id="cfg-enc-patterns" type="text" defaultValue={(en.patterns || ["pi/agent/**"]).join(",")} placeholder={t("加密文件 glob(逗号分隔,如 pi/agent/**)")} style={{ flex: 1, ...inp }} />
|
|
@@ -382,7 +382,7 @@ function App({ open, onClose }: { open: boolean; onClose: () => void }) {
|
|
|
382
382
|
<button style={C.btn} onClick={() => onClose()} aria-label={t("关闭")}><Ic size={12} paths={ICONS.x} /></button>
|
|
383
383
|
</div>
|
|
384
384
|
<div style={bodyStyle}>
|
|
385
|
-
{busy ? <div style={{ color: "var(--text-
|
|
385
|
+
{busy ? <div style={{ color: "var(--text-dim,#666)", marginBottom: 6 }}>{t("处理中…")}</div> : null}
|
|
386
386
|
{msg ? (<div style={C.msg}>{msg.startsWith("❌") || msg.startsWith("⚠") || msg.startsWith("错误") || msg.startsWith("失败") || msg.startsWith("\u274c") ? <div style={C.errorMsg}>{msg}</div> : <div style={C.msg}>{msg}</div>}</div>) : null}
|
|
387
387
|
{tab === "status" ? renderStatus() : tab === "log" ? renderLog() : tab === "selfcheck" ? renderSelfcheck() : renderConfig()}
|
|
388
388
|
</div>
|
|
@@ -356,15 +356,15 @@ const C = {
|
|
|
356
356
|
head: { display: "flex", alignItems: "center", gap: 8, padding: "10px 14px", borderBottom: "1px solid var(--border,#e0e0e0)", background: "var(--bg-subtle,#f5f5f5)" },
|
|
357
357
|
tabs: { display: "flex", gap: 4, flex: 1, overflowX: "auto" },
|
|
358
358
|
tab: { padding: "5px 12px", border: "none", borderRadius: 8, cursor: "pointer", background: "transparent", color: "var(--text,#1a1a1a)", fontWeight: 500 },
|
|
359
|
-
tabOn: { background: "var(--accent,#2563eb)", color: "#fff" },
|
|
359
|
+
tabOn: { background: "var(--accent,#2563eb)", color: "var(--accent-contrast, #fff)" },
|
|
360
360
|
body: { padding: 12, overflow: "auto", flex: 1 },
|
|
361
361
|
btn: { padding: "5px 12px", border: "1px solid var(--border,#e0e0e0)", borderRadius: 8, cursor: "pointer", background: "var(--bg,#fff)", color: "var(--text,#1a1a1a)", fontWeight: 500 },
|
|
362
|
-
btnPrimary: { background: "var(--accent,#2563eb)", borderColor: "var(--accent,#2563eb)", color: "#fff" },
|
|
362
|
+
btnPrimary: { background: "var(--accent,#2563eb)", borderColor: "var(--accent,#2563eb)", color: "var(--accent-contrast, #fff)" },
|
|
363
363
|
row: { padding: "6px 8px", borderBottom: "1px solid var(--border,#e0e0e0)", cursor: "pointer" },
|
|
364
364
|
mono: { font: "11.5px/1.5 ui-monospace, monospace", wordBreak: "break-all" },
|
|
365
365
|
pre: { background: "var(--bg-subtle,#f5f5f5)", border: "1px solid var(--border,#e0e0e0)", borderRadius: 8, padding: 10, overflow: "auto", maxHeight: 260, whiteSpace: "pre-wrap", wordBreak: "break-all", font: "11.5px/1.5 ui-monospace, monospace" },
|
|
366
366
|
// 黄色错误提示样式:当有错误时显示黄色警告框
|
|
367
|
-
errorMsg: { padding: "6px 10px", borderRadius: 8, background: "#
|
|
367
|
+
errorMsg: { padding: "6px 10px", borderRadius: 8, background: "color-mix(in srgb, var(--warn, #f59e0b) 14%, transparent)", color: "var(--warn, #b45309)", marginBottom: 8, fontSize: 12, border: "1px solid color-mix(in srgb, var(--warn, #f59e0b) 38%, transparent)" },
|
|
368
368
|
msg: { padding: "6px 10px", borderRadius: 8, background: "var(--bg-subtle,#f5f5f5)", marginBottom: 8, fontSize: 12 }
|
|
369
369
|
};
|
|
370
370
|
function App({ open, onClose }) {
|
|
@@ -533,7 +533,7 @@ function App({ open, onClose }) {
|
|
|
533
533
|
const d = data || {};
|
|
534
534
|
const rs = d.remote || {};
|
|
535
535
|
return /* @__PURE__ */ jsxs("div", { children: [
|
|
536
|
-
rs && rs.url ? /* @__PURE__ */ jsx("div", { style: { fontSize: 12, marginBottom: 8, padding: "6px 8px", borderRadius: 8, background: "#
|
|
536
|
+
rs && rs.url ? /* @__PURE__ */ jsx("div", { style: { fontSize: 12, marginBottom: 8, padding: "6px 8px", borderRadius: 8, background: "color-mix(in srgb, var(--accent, #2563eb) 8%, transparent)", border: "1px solid color-mix(in srgb, var(--accent, #2563eb) 30%, transparent)", color: "var(--accent, #2563eb)" }, children: t("远端同步:") + (rs.push ? t("启用") : t("停用")) + " · " + rs.url + (rs.autoPull ? " · pull --rebase" : "") + " · branch=" + (rs.branch || "main") }) : null,
|
|
537
537
|
/* @__PURE__ */ jsxs("div", { style: { display: "flex", gap: 8, marginBottom: 8 }, children: [
|
|
538
538
|
/* @__PURE__ */ jsxs("button", { style: { ...C.btn, ...C.btnPrimary, display: "inline-flex", alignItems: "center", gap: 5 }, onClick: doCommit, children: [
|
|
539
539
|
/* @__PURE__ */ jsx(Ic, { size: 13, paths: ICONS.package }),
|
|
@@ -541,7 +541,7 @@ function App({ open, onClose }) {
|
|
|
541
541
|
] }),
|
|
542
542
|
/* @__PURE__ */ jsx("button", { style: C.btn, onClick: () => load("status"), children: t("↻ 刷新") })
|
|
543
543
|
] }),
|
|
544
|
-
d.clean === true ? /* @__PURE__ */ jsx("div", { style: { color: "#16a34a", fontWeight: 600 }, children: t("工作区干净(无可提交变更)") }) : d.changed && d.changed.length ? /* @__PURE__ */ jsxs("div", { children: [
|
|
544
|
+
d.clean === true ? /* @__PURE__ */ jsx("div", { style: { color: "var(--ok, #16a34a)", fontWeight: 600 }, children: t("工作区干净(无可提交变更)") }) : d.changed && d.changed.length ? /* @__PURE__ */ jsxs("div", { children: [
|
|
545
545
|
/* @__PURE__ */ jsx("div", { style: { fontWeight: 600, marginBottom: 6 }, children: t("待提交 ") + d.changed.length + t(" 个文件:") }),
|
|
546
546
|
d.changed.map((c2, i) => /* @__PURE__ */ jsxs(
|
|
547
547
|
"div",
|
|
@@ -550,7 +550,7 @@ function App({ open, onClose }) {
|
|
|
550
550
|
onClick: () => showFileDiff(c2.path),
|
|
551
551
|
title: t("点击查看该文件未提交 diff"),
|
|
552
552
|
children: [
|
|
553
|
-
/* @__PURE__ */ jsx("span", { style: { color: c2.status === "D" ? "#dc2626" : c2.status === "??" ? "#16a34a" : "#2563eb", fontWeight: 700, marginRight: 6 }, children: c2.status === "D" ? "DEL" : c2.status === "??" ? "NEW" : "MOD" }),
|
|
553
|
+
/* @__PURE__ */ jsx("span", { style: { color: c2.status === "D" ? "var(--danger, #dc2626)" : c2.status === "??" ? "var(--ok, #16a34a)" : "var(--accent, #2563eb)", fontWeight: 700, marginRight: 6 }, children: c2.status === "D" ? "DEL" : c2.status === "??" ? "NEW" : "MOD" }),
|
|
554
554
|
/* @__PURE__ */ jsx("span", { style: C.mono, children: c2.path })
|
|
555
555
|
]
|
|
556
556
|
},
|
|
@@ -561,7 +561,7 @@ function App({ open, onClose }) {
|
|
|
561
561
|
/* @__PURE__ */ jsx("pre", { style: C.pre, children: String(fileDiff.diff).slice(0, 3e3) })
|
|
562
562
|
] }) : null
|
|
563
563
|
] }) : null,
|
|
564
|
-
d.skipped && d.skipped.length > 0 ? /* @__PURE__ */ jsx("div", { style: { marginTop: 8, fontSize: 12, color: "#d97706" }, children: t("拦截 ") + d.skipped.length + t(" 项:") + d.skipped.map((s) => s.reason).slice(0, 5).join(";") + (d.skipped.length > 5 ? "…" : "") }) : null
|
|
564
|
+
d.skipped && d.skipped.length > 0 ? /* @__PURE__ */ jsx("div", { style: { marginTop: 8, fontSize: 12, color: "var(--warn, #d97706)" }, children: t("拦截 ") + d.skipped.length + t(" 项:") + d.skipped.map((s) => s.reason).slice(0, 5).join(";") + (d.skipped.length > 5 ? "…" : "") }) : null
|
|
565
565
|
] });
|
|
566
566
|
};
|
|
567
567
|
const renderLog = () => {
|
|
@@ -577,17 +577,17 @@ function App({ open, onClose }) {
|
|
|
577
577
|
t("固化现场")
|
|
578
578
|
] })
|
|
579
579
|
] }),
|
|
580
|
-
tagList && tagList.tags && tagList.tags.length > 0 ? /* @__PURE__ */ jsx("div", { style: { marginBottom: 8 }, children: tagList.tags.map((tag) => /* @__PURE__ */ jsxs("span", { style: { display: "inline-flex", alignItems: "center", gap: 4, margin: "0 6px 4px 0", padding: "2px 8px", borderRadius: 10, background: "#
|
|
580
|
+
tagList && tagList.tags && tagList.tags.length > 0 ? /* @__PURE__ */ jsx("div", { style: { marginBottom: 8 }, children: tagList.tags.map((tag) => /* @__PURE__ */ jsxs("span", { style: { display: "inline-flex", alignItems: "center", gap: 4, margin: "0 6px 4px 0", padding: "2px 8px", borderRadius: 10, background: "color-mix(in srgb, var(--warn, #f59e0b) 14%, transparent)", color: "var(--warn, #b45309)", fontSize: 11, border: "1px solid color-mix(in srgb, var(--warn, #f59e0b) 38%, transparent)" }, children: [
|
|
581
581
|
/* @__PURE__ */ jsx(Ic, { size: 11, paths: ICONS.tag }),
|
|
582
582
|
" ",
|
|
583
583
|
tag.name,
|
|
584
|
-
/* @__PURE__ */ jsx("button", { style: { border: "none", background: "transparent", cursor: "pointer", color: "#
|
|
584
|
+
/* @__PURE__ */ jsx("button", { style: { border: "none", background: "transparent", cursor: "pointer", color: "var(--warn, #b45309)", display: "flex" }, onClick: () => doDelTag(t.name), "aria-label": t("删除 tag"), children: /* @__PURE__ */ jsx(Ic, { size: 10, paths: ICONS.x }) })
|
|
585
585
|
] }, tag.name)) }) : null,
|
|
586
586
|
(d.log || []).map((r) => /* @__PURE__ */ jsxs("div", { style: C.row, onClick: () => showDiff(r.hash), children: [
|
|
587
587
|
/* @__PURE__ */ jsxs("div", { children: [
|
|
588
588
|
/* @__PURE__ */ jsx("span", { style: { color: "var(--accent,#2563eb)", fontWeight: 700, marginRight: 6 }, children: r.hash }),
|
|
589
|
-
/* @__PURE__ */ jsx("span", { style: { color: "var(--text-
|
|
590
|
-
(r.tags || []).map((tag) => /* @__PURE__ */ jsxs("span", { style: { marginRight: 4, padding: "1px 6px", borderRadius: 8, background: "#
|
|
589
|
+
/* @__PURE__ */ jsx("span", { style: { color: "var(--text-dim,#666)", marginRight: 6 }, children: String(r.date || "").slice(5, 16) }),
|
|
590
|
+
(r.tags || []).map((tag) => /* @__PURE__ */ jsxs("span", { style: { marginRight: 4, padding: "1px 6px", borderRadius: 8, background: "color-mix(in srgb, var(--warn, #f59e0b) 14%, transparent)", color: "var(--warn, #b45309)", fontSize: 10 }, children: [
|
|
591
591
|
/* @__PURE__ */ jsx(Ic, { size: 10, paths: ICONS.tag }),
|
|
592
592
|
tag
|
|
593
593
|
] }, tag)),
|
|
@@ -619,11 +619,11 @@ function App({ open, onClose }) {
|
|
|
619
619
|
const renderSelfcheck = () => {
|
|
620
620
|
const d = data || {};
|
|
621
621
|
return /* @__PURE__ */ jsxs("div", { children: [
|
|
622
|
-
/* @__PURE__ */ jsx("div", { style: { fontWeight: 600, marginBottom: 6, color: d.ok ? "#16a34a" : "#dc2626" }, children: d.ok ? t("自检通过") : t("自检未通过(") + (d.bad || []).length + t(" 项)") }),
|
|
622
|
+
/* @__PURE__ */ jsx("div", { style: { fontWeight: 600, marginBottom: 6, color: d.ok ? "var(--ok, #16a34a)" : "var(--danger, #dc2626)" }, children: d.ok ? t("自检通过") : t("自检未通过(") + (d.bad || []).length + t(" 项)") }),
|
|
623
623
|
(d.rows || []).map((r, i) => /* @__PURE__ */ jsxs("div", { style: C.row, children: [
|
|
624
624
|
/* @__PURE__ */ jsx("span", { style: { marginRight: 6, display: "inline-flex" }, children: /* @__PURE__ */ jsx(Ic, { size: 13, paths: r.ok ? ICONS.check : ICONS.x }) }),
|
|
625
625
|
/* @__PURE__ */ jsx("b", { children: r.name }),
|
|
626
|
-
/* @__PURE__ */ jsx("span", { style: { color: "var(--text-
|
|
626
|
+
/* @__PURE__ */ jsx("span", { style: { color: "var(--text-dim,#666)", marginLeft: 6 }, children: r.detail })
|
|
627
627
|
] }, i)),
|
|
628
628
|
/* @__PURE__ */ jsx("button", { style: { ...C.btn, marginTop: 8 }, onClick: () => load("selfcheck"), children: t("↻ 重新自检") })
|
|
629
629
|
] });
|
|
@@ -646,7 +646,7 @@ function App({ open, onClose }) {
|
|
|
646
646
|
const rc = d.config && d.config.remote || {};
|
|
647
647
|
const en = d.config && d.config.encrypt || {};
|
|
648
648
|
const es = encStatus && encStatus.encrypt ? encStatus.encrypt : {};
|
|
649
|
-
const warn = { padding: "8px 10px", borderRadius: 8, background: "#
|
|
649
|
+
const warn = { padding: "8px 10px", borderRadius: 8, background: "color-mix(in srgb, var(--danger, #ef4444) 10%, transparent)", border: "1px solid color-mix(in srgb, var(--danger, #ef4444) 32%, transparent)", color: "var(--danger, #b91c1c)", fontSize: 12, marginBottom: 8, lineHeight: 1.6 };
|
|
650
650
|
const inp = { padding: "5px 8px", border: "1px solid var(--border,#e0e0e0)", borderRadius: 6, background: "var(--bg,#fff)", color: "var(--text,#1a1a1a)", fontSize: 12 };
|
|
651
651
|
const g = (id) => document.getElementById(id);
|
|
652
652
|
return /* @__PURE__ */ jsxs("div", { children: [
|
|
@@ -695,7 +695,7 @@ function App({ open, onClose }) {
|
|
|
695
695
|
t("启用密文"),
|
|
696
696
|
" commit"
|
|
697
697
|
] }),
|
|
698
|
-
/* @__PURE__ */ jsx("span", { style: { color: es.keyExists === true ? "#16a34a" : "#dc2626" }, children: es.keyExists === true ? t("密钥已生成(") + (es.keyFile || "") + ")" : t("密钥未生成(先点生成密钥)") })
|
|
698
|
+
/* @__PURE__ */ jsx("span", { style: { color: es.keyExists === true ? "var(--ok, #16a34a)" : "var(--danger, #dc2626)" }, children: es.keyExists === true ? t("密钥已生成(") + (es.keyFile || "") + ")" : t("密钥未生成(先点生成密钥)") })
|
|
699
699
|
] }),
|
|
700
700
|
/* @__PURE__ */ jsx("div", { style: { display: "flex", gap: 6, marginBottom: 6 }, children: /* @__PURE__ */ jsx("input", { id: "cfg-enc-patterns", type: "text", defaultValue: (en.patterns || ["pi/agent/**"]).join(","), placeholder: t("加密文件 glob(逗号分隔,如 pi/agent/**)"), style: { flex: 1, ...inp } }) }),
|
|
701
701
|
/* @__PURE__ */ jsxs("div", { style: { display: "flex", gap: 8, marginBottom: 8 }, children: [
|
|
@@ -739,7 +739,7 @@ function App({ open, onClose }) {
|
|
|
739
739
|
/* @__PURE__ */ jsx("button", { style: C.btn, onClick: () => onClose(), "aria-label": t("关闭"), children: /* @__PURE__ */ jsx(Ic, { size: 12, paths: ICONS.x }) })
|
|
740
740
|
] }),
|
|
741
741
|
/* @__PURE__ */ jsxs("div", { style: bodyStyle, children: [
|
|
742
|
-
busy ? /* @__PURE__ */ jsx("div", { style: { color: "var(--text-
|
|
742
|
+
busy ? /* @__PURE__ */ jsx("div", { style: { color: "var(--text-dim,#666)", marginBottom: 6 }, children: t("处理中…") }) : null,
|
|
743
743
|
msg ? /* @__PURE__ */ jsx("div", { style: C.msg, children: msg.startsWith("❌") || msg.startsWith("⚠") || msg.startsWith("错误") || msg.startsWith("失败") || msg.startsWith("❌") ? /* @__PURE__ */ jsx("div", { style: C.errorMsg, children: msg }) : /* @__PURE__ */ jsx("div", { style: C.msg, children: msg }) }) : null,
|
|
744
744
|
tab === "status" ? renderStatus() : tab === "log" ? renderLog() : tab === "selfcheck" ? renderSelfcheck() : renderConfig()
|
|
745
745
|
] })
|
package/icon.svg
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="
|
|
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"><path d="M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z"/><path d="m9 12 2 2 4-4"/></svg>
|
package/index.ts
CHANGED
|
@@ -333,9 +333,9 @@ export default {
|
|
|
333
333
|
|
|
334
334
|
// 定时任务(注册给 aiti-ai-schedule 聚合执行;不重复造 setInterval)——具体行为由 ai-configs.json 的 sentry 段控制
|
|
335
335
|
schedules: [
|
|
336
|
-
{ id: "configs-sentry", name: "
|
|
337
|
-
{ id: "configs-stale-warn", name: "
|
|
338
|
-
{ id: "configs-auto-commit", name: "
|
|
336
|
+
{ id: "configs-sentry", name: "i18n:cfg.sch.sentry", intervalSec: 60, enabled: true, run: sentryTaskRun },
|
|
337
|
+
{ id: "configs-stale-warn", name: "i18n:cfg.sch.staleWarn", intervalSec: 3600, enabled: true, run: staleWarnRun },
|
|
338
|
+
{ id: "configs-auto-commit", name: "i18n:cfg.sch.autoCommit", intervalSec: 86400, enabled: true, run: autoCommitRun },
|
|
339
339
|
],
|
|
340
340
|
|
|
341
341
|
// AI 自管理清单(ai-helper 主动聚合):AI 可说「帮我提交配置 / 回滚配置」
|
|
@@ -363,6 +363,10 @@ export default {
|
|
|
363
363
|
// short code → en → first table" would wrongly hit the en table, mixing languages in reverse).
|
|
364
364
|
// en table = translations. Static-slot entries (it.* / cfg.* / ext.*) get one copy in each table.
|
|
365
365
|
"zh-CN": {
|
|
366
|
+
// Hook-task display names (consumed by aiti-ai-schedule page via the "i18n:" prefix)
|
|
367
|
+
"cfg.sch.sentry": "配置崩溃哨兵(自检指纹 + 可选桥检测)",
|
|
368
|
+
"cfg.sch.staleWarn": "配置变更滞留提醒",
|
|
369
|
+
"cfg.sch.autoCommit": "配置定时兜底提交",
|
|
366
370
|
"it.open.label": "配置",
|
|
367
371
|
"cfg.open.label": "配置",
|
|
368
372
|
"cfg.open.title": "aiti-configs:配置版本化(status/commit/恢复)+ 自检报告 + 历史版本安全盾",
|
|
@@ -440,6 +444,9 @@ export default {
|
|
|
440
444
|
"(请立即备份!)": "(请立即备份!)",
|
|
441
445
|
},
|
|
442
446
|
en: {
|
|
447
|
+
"cfg.sch.sentry": "Config crash sentinel (self-check fingerprint + optional bridge probe)",
|
|
448
|
+
"cfg.sch.staleWarn": "Uncommitted config-change reminder",
|
|
449
|
+
"cfg.sch.autoCommit": "Scheduled config fallback commit",
|
|
443
450
|
"it.open.label": "Configs",
|
|
444
451
|
"cfg.open.label": "Config",
|
|
445
452
|
"cfg.open.title": "aiti-configs: config versioning (status/commit/restore) + self-check + history shield",
|
|
@@ -452,7 +459,6 @@ export default {
|
|
|
452
459
|
"开启自动哨兵": "Enable auto sentry",
|
|
453
460
|
"删除 tag": "Delete tag",
|
|
454
461
|
"ext.displayName": "Config Versioning & Self-check",
|
|
455
|
-
"ext.description": "Injects aiti_configs_* tools into sessions (off by default; enable temporarily via the AI helper 🤖 or the extension manager)",
|
|
456
462
|
"feat.agentTools.enabled": "AI tool (config management)",
|
|
457
463
|
"feat.agentTools.enabled.desc": "Injects aiti_configs_* tools into sessions (off by default; enable temporarily via the AI helper 🤖 or the extension manager)",
|
|
458
464
|
"恢复": "Restore",
|
package/package.json
CHANGED
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aiti-ai/aiti-configs",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.13",
|
|
4
4
|
"type": "module",
|
|
5
|
-
"description": "; if the system crashes, a command-line watchdog recovers without relying on the broken system",
|
|
5
|
+
"description": "A safety net for configuration — when AI/humans or extension changes break the config, there is a commit to revert, a diff to inspect, one-click restore; if the system crashes, a command-line watchdog recovers without relying on the broken system itself",
|
|
6
|
+
"displayNameI18n": {
|
|
7
|
+
"en": "Config Versioning & Self-check"
|
|
8
|
+
},
|
|
9
|
+
"descriptionI18n": {
|
|
10
|
+
"zh-CN": "配置的安全网 —— AI/人改配置、改扩展改坏了,有锅可回、有 diff 可看、一键恢复;系统崩了,命令行哨兵不依赖出问题系统本身兜底恢复"
|
|
11
|
+
},
|
|
6
12
|
"scripts": {
|
|
7
13
|
"build:client": "vite build --config vite.config.ts",
|
|
8
14
|
"watch": "vite build --watch --config vite.config.ts",
|
|
@@ -12,9 +18,12 @@
|
|
|
12
18
|
"vite": "^6.4.3"
|
|
13
19
|
},
|
|
14
20
|
"soul": "AI 敢乱改,因为身后有一整个 git 当后悔药。",
|
|
21
|
+
"soulI18n": {
|
|
22
|
+
"en": "The AI dares to change recklessly, because an entire git repo stands behind it as the undo button."
|
|
23
|
+
},
|
|
15
24
|
"aitiExtProtocol": "1.0",
|
|
16
25
|
"license": "MIT",
|
|
17
|
-
"contentHash": "
|
|
26
|
+
"contentHash": "3664711b3268952e",
|
|
18
27
|
"repository": {
|
|
19
28
|
"type": "git",
|
|
20
29
|
"url": "git+https://github.com/aiti-ai/aiti-ai.git",
|
package/vite.config.ts
CHANGED
|
@@ -14,6 +14,10 @@ export default defineConfig({
|
|
|
14
14
|
esbuild: {
|
|
15
15
|
jsx: "automatic",
|
|
16
16
|
jsxImportSource: "react",
|
|
17
|
+
// Production lib bundle: never let the JSX runtime follow the build shell's NODE_ENV.
|
|
18
|
+
// Vite infers jsxDev from NODE_ENV; a build from a dev-instance shell inherits
|
|
19
|
+
// NODE_ENV=development -> jsxDEV(), but jsx-runtime.ts only exports jsx/jsxs/Fragment.
|
|
20
|
+
jsxDev: false,
|
|
17
21
|
},
|
|
18
22
|
resolve: {
|
|
19
23
|
alias: [
|