dsh-prompt-vcs 0.2.0 → 0.3.0

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.
@@ -1,14 +1,15 @@
1
1
  /**
2
- * Browser half of dsh-prompt-vcs: the Prompt VCS page inside Settings.
2
+ * Browser half of dsh-prompt-vcs: its page inside Settings.
3
3
  *
4
- * Services are named by their runtime identity, not by the package that provides them:
5
- * the settings shell is the `slots` service and the host bridge is `connection`. A
6
- * fiber that injects package names never resolves and the plugin stays pending, which
7
- * the loader reports as "did not activate".
4
+ * Two services are injected by their runtime identity, not by the packages that provide
5
+ * them: the settings shell is `slots`, the dictionary registry is `locale`. The label and
6
+ * every string inside the component are translated through this plugin's own namespace,
7
+ * which is why the page follows the UI language instead of the plugin author's.
8
8
  *
9
9
  * @module client
10
10
  */
11
11
  import type { ComponentType } from 'react';
12
+ export declare const inject: string[];
12
13
  interface SlotsService {
13
14
  inject(name: string, register: () => void): void;
14
15
  register(options: {
@@ -16,11 +17,21 @@ interface SlotsService {
16
17
  id: string;
17
18
  order: number;
18
19
  label: () => string;
19
- }, component: ComponentType): unknown;
20
+ locale: string;
21
+ }, component: ComponentType<{
22
+ t: (key: string, params?: Record<string, unknown>) => string;
23
+ }>): unknown;
20
24
  }
21
- /** The slots service is what the settings shell exposes. */
22
- export declare const inject: string[];
23
- export declare function apply(ctx: {
25
+ interface ClientContext {
24
26
  slots: SlotsService;
25
- }): void;
27
+ locale: {
28
+ register(ns: string, dicts: {
29
+ zh: unknown;
30
+ en: unknown;
31
+ }): () => void;
32
+ bind(ns: string): (key: string, params?: Record<string, unknown>) => string;
33
+ };
34
+ effect(callback: () => unknown, label?: string): unknown;
35
+ }
36
+ export declare function apply(ctx: ClientContext): void;
26
37
  export {};
@@ -1,65 +1,24 @@
1
- import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
2
1
  /**
3
- * Browser half of dsh-prompt-vcs: the Prompt VCS page inside Settings.
2
+ * Browser half of dsh-prompt-vcs: its page inside Settings.
4
3
  *
5
- * Services are named by their runtime identity, not by the package that provides them:
6
- * the settings shell is the `slots` service and the host bridge is `connection`. A
7
- * fiber that injects package names never resolves and the plugin stays pending, which
8
- * the loader reports as "did not activate".
4
+ * Two services are injected by their runtime identity, not by the packages that provide
5
+ * them: the settings shell is `slots`, the dictionary registry is `locale`. The label and
6
+ * every string inside the component are translated through this plugin's own namespace,
7
+ * which is why the page follows the UI language instead of the plugin author's.
9
8
  *
10
9
  * @module client
11
10
  */
12
- import { useCallback, useEffect, useState } from 'react';
13
- import { renderPanel } from './view.js';
14
- /** Path the host half registers on the web connection. */
15
- const PANEL_PATH = '/api/vcs.panel';
16
- /** Fetch the panel payload; `reload` re-runs the request. */
17
- function usePanel() {
18
- const [html, setHtml] = useState(null);
19
- const [error, setError] = useState(null);
20
- const [tick, setTick] = useState(0);
21
- const reload = useCallback(() => setTick((t) => t + 1), []);
22
- useEffect(() => {
23
- const controller = new AbortController();
24
- setError(null);
25
- fetch(PANEL_PATH, { signal: controller.signal })
26
- .then(async (response) => {
27
- if (!response.ok)
28
- throw new Error(`panel request failed with ${response.status}`);
29
- return response.json();
30
- })
31
- .then((payload) => {
32
- if (!controller.signal.aborted)
33
- setHtml(renderPanel(payload));
34
- })
35
- .catch((cause) => {
36
- if (controller.signal.aborted)
37
- return;
38
- // Say what failed rather than rendering an empty panel, which would read as
39
- // "nothing recorded" — a different and wrong answer.
40
- setError(cause instanceof Error ? cause.message : String(cause));
41
- });
42
- return () => controller.abort();
43
- }, [tick]);
44
- return { html, error, reload };
45
- }
46
- function PromptVCSPage() {
47
- const { html, error, reload } = usePanel();
48
- if (error !== null) {
49
- return (_jsxs("section", { children: [_jsxs("p", { role: "alert", children: ["Prompt VCS panel failed to load: ", error] }), _jsx("button", { type: "button", onClick: reload, children: "Retry" })] }));
50
- }
51
- if (html === null)
52
- return _jsx("p", { "aria-live": "polite", children: "Loading the Prompt VCS panel\u2026" });
53
- // The markup is produced by `renderPanel`, which escapes every interpolated value.
54
- return _jsx("div", { dangerouslySetInnerHTML: { __html: html } });
55
- }
56
- /** The slots service is what the settings shell exposes. */
57
- export const inject = ['slots'];
11
+ import { NS, en, zh } from './locales.js';
12
+ import { PromptVcsPanel } from './view.js';
13
+ export const inject = ['slots', 'locale'];
58
14
  export function apply(ctx) {
15
+ // `zh` is the key-set source of truth, matching the official client plugins.
16
+ ctx.effect(() => ctx.locale.register(NS, { zh, en }), 'dsh-prompt-vcs: dictionaries');
59
17
  ctx.slots.inject('settings.section', () => ctx.slots.register({
60
18
  name: 'settings.section',
61
19
  id: 'prompt-vcs',
62
20
  order: 44,
63
- label: () => 'Prompt VCS',
64
- }, PromptVCSPage));
21
+ label: () => ctx.locale.bind(NS)('nav'),
22
+ locale: NS,
23
+ }, PromptVcsPanel));
65
24
  }
@@ -0,0 +1,43 @@
1
+ /**
2
+ * Dictionaries for the Prompt VCS page.
3
+ *
4
+ * `zh` is the key-set source of truth, as in the official client plugins, and `en` is
5
+ * typed against it: a key translated in one language but not the other fails the build
6
+ * instead of silently rendering the raw key.
7
+ *
8
+ * @module client/locales
9
+ */
10
+ /** Dictionary namespace owned by this plugin. */
11
+ export declare const NS = "promptVcs";
12
+ /** Simplified Chinese dictionary (the key-set source of truth). */
13
+ export declare const zh: {
14
+ nav: string;
15
+ title: string;
16
+ hash: string;
17
+ date: string;
18
+ by: string;
19
+ file: string;
20
+ added: string;
21
+ removed: string;
22
+ empty: string;
23
+ refresh: string;
24
+ loading: string;
25
+ failed: string;
26
+ retry: string;
27
+ totalChanges: string;
28
+ filesTracked: string;
29
+ watched: string;
30
+ files: string;
31
+ changes: string;
32
+ lastChanged: string;
33
+ size: string;
34
+ timeline: string;
35
+ diff: string;
36
+ before: string;
37
+ after: string;
38
+ rollback: string;
39
+ confirmRollback: string;
40
+ notFound: string;
41
+ };
42
+ /** English dictionary, checked complete against the zh key set. */
43
+ export declare const en: typeof zh;
@@ -0,0 +1,71 @@
1
+ /**
2
+ * Dictionaries for the Prompt VCS page.
3
+ *
4
+ * `zh` is the key-set source of truth, as in the official client plugins, and `en` is
5
+ * typed against it: a key translated in one language but not the other fails the build
6
+ * instead of silently rendering the raw key.
7
+ *
8
+ * @module client/locales
9
+ */
10
+ /** Dictionary namespace owned by this plugin. */
11
+ export const NS = 'promptVcs';
12
+ /** Simplified Chinese dictionary (the key-set source of truth). */
13
+ export const zh = {
14
+ 'nav': '提示词版本',
15
+ 'title': '提示词版本',
16
+ 'hash': '版本号',
17
+ 'date': '时间',
18
+ 'by': '修改方',
19
+ 'file': '文件',
20
+ 'added': '新增',
21
+ 'removed': '删除',
22
+ 'empty': '还没有记录到指令改动。',
23
+ 'refresh': '刷新',
24
+ 'loading': '正在加载…',
25
+ 'failed': '加载失败',
26
+ 'retry': '重试',
27
+ 'totalChanges': '总变更数',
28
+ 'filesTracked': '跟踪文件数',
29
+ 'watched': '监控文件',
30
+ 'files': '文件',
31
+ 'changes': '变更次数',
32
+ 'lastChanged': '最后变更',
33
+ 'size': '大小',
34
+ 'timeline': '时间线',
35
+ 'diff': '差异',
36
+ 'before': '变更前',
37
+ 'after': '变更后',
38
+ 'rollback': '回滚',
39
+ 'confirmRollback': '确定回滚到此变更之前的状态?',
40
+ 'notFound': '未找到变更记录',
41
+ };
42
+ /** English dictionary, checked complete against the zh key set. */
43
+ export const en = {
44
+ 'nav': 'Prompt VCS',
45
+ 'title': 'Prompt VCS',
46
+ 'hash': 'Hash',
47
+ 'date': 'Date',
48
+ 'by': 'Changed by',
49
+ 'file': 'File',
50
+ 'added': 'Added',
51
+ 'removed': 'Removed',
52
+ 'empty': 'No instruction changes recorded yet.',
53
+ 'refresh': 'Refresh',
54
+ 'loading': 'Loading…',
55
+ 'failed': 'Failed to load',
56
+ 'retry': 'Retry',
57
+ 'totalChanges': 'Total Changes',
58
+ 'filesTracked': 'Files Tracked',
59
+ 'watched': 'Watched',
60
+ 'files': 'Files',
61
+ 'changes': 'Changes',
62
+ 'lastChanged': 'Last Changed',
63
+ 'size': 'Size',
64
+ 'timeline': 'Timeline',
65
+ 'diff': 'Diff',
66
+ 'before': 'Before',
67
+ 'after': 'After',
68
+ 'rollback': 'Rollback',
69
+ 'confirmRollback': 'Rollback to before this change?',
70
+ 'notFound': 'Change not found',
71
+ };
@@ -1,2 +1,24 @@
1
+ /**
2
+ * Pure rendering half of the promptVcs page.
3
+ *
4
+ * Separate from `index.tsx` so a static render can assert in Node what the page draws —
5
+ * the shipped bundle is a loader factory only a browser can run. Every user-visible
6
+ * string comes from the `t` seat the renderer binds from this plugin's namespace, so the
7
+ * page follows the UI language; no copy is hardcoded here.
8
+ *
9
+ * @module client/view
10
+ */
1
11
  import type { PanelPayload } from '../types.js';
2
- export declare function renderPanel(payload: PanelPayload): string;
12
+ export type Translate = (key: string, params?: Record<string, unknown>) => string;
13
+ export interface PanelProps {
14
+ t: Translate;
15
+ }
16
+ interface PanelState {
17
+ payload: PanelPayload | null;
18
+ error: string | null;
19
+ }
20
+ export declare function usePanel(): PanelState & {
21
+ reload: () => void;
22
+ };
23
+ export declare function PromptVcsPanel({ t }: PanelProps): import("react").JSX.Element;
24
+ export {};
@@ -1,6 +1,96 @@
1
- export function renderPanel(payload) {
2
- const rows = payload.timeline
3
- .map((e) => `<tr><td>${e.hash}</td><td>${new Date(e.timestamp).toLocaleString()}</td><td>${e.changedBy}</td><td>${e.file}</td><td>+${e.addedLines}</td><td>-${e.removedLines}</td></tr>`)
4
- .join('');
5
- return `<div class="vcs-panel"><h2>Prompt VCS</h2>${rows ? `<table><thead><tr><th>Hash</th><th>Date</th><th>By</th><th>File</th><th>+</th><th>-</th></tr></thead><tbody>${rows}</tbody></table>` : '<p>No changes recorded.</p>'}</div>`;
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ /**
3
+ * Pure rendering half of the promptVcs page.
4
+ *
5
+ * Separate from `index.tsx` so a static render can assert in Node what the page draws —
6
+ * the shipped bundle is a loader factory only a browser can run. Every user-visible
7
+ * string comes from the `t` seat the renderer binds from this plugin's namespace, so the
8
+ * page follows the UI language; no copy is hardcoded here.
9
+ *
10
+ * @module client/view
11
+ */
12
+ import { useCallback, useEffect, useState } from 'react';
13
+ const PANEL_PATH = '/api/vcs.panel';
14
+ const CHANGE_PATH = '/api/vcs.change';
15
+ const ROLLBACK_PATH = '/api/vcs.rollback';
16
+ const wrap = { display: 'flex', flexDirection: 'column', gap: 12, maxWidth: 820, fontFamily: 'inherit' };
17
+ const head = { display: 'flex', alignItems: 'baseline', gap: 12, flexWrap: 'wrap' };
18
+ const muted = { fontSize: 12, opacity: 0.75 };
19
+ const table = { borderCollapse: 'collapse', width: '100%' };
20
+ const th = { textAlign: 'left', padding: '4px 10px 4px 0', fontWeight: 600, fontSize: 12, opacity: 0.8, borderBottom: '0.5px solid rgba(128,128,128,0.4)' };
21
+ const td = { padding: '6px 10px 6px 0', fontSize: 13, borderBottom: '0.5px solid rgba(128,128,128,0.18)' };
22
+ const card = { padding: '8px 12px', borderRadius: 6, border: '1px solid rgba(128,128,128,0.2)', fontSize: 13 };
23
+ const btn = { fontSize: 12, cursor: 'pointer', padding: '3px 10px', borderRadius: 4, border: '0.5px solid rgba(128,128,128,0.4)' };
24
+ const dangerBtn = { ...btn, color: '#e55', borderColor: '#e55' };
25
+ const preBlock = { whiteSpace: 'pre-wrap', wordBreak: 'break-word', fontSize: 11, maxHeight: 200, overflow: 'auto', padding: 8, borderRadius: 4, background: 'rgba(128,128,128,0.06)', border: '1px solid rgba(128,128,128,0.15)' };
26
+ const clickRow = { cursor: 'pointer' };
27
+ const statRow = { display: 'flex', gap: 12, flexWrap: 'wrap' };
28
+ const statBox = { ...card, flex: 1, minWidth: 100, textAlign: 'center' };
29
+ export function usePanel() {
30
+ const [state, setState] = useState({ payload: null, error: null });
31
+ const [tick, setTick] = useState(0);
32
+ const reload = useCallback(() => setTick((v) => v + 1), []);
33
+ useEffect(() => {
34
+ const c = new AbortController();
35
+ setState((p) => ({ ...p, error: null }));
36
+ fetch(PANEL_PATH, { signal: c.signal })
37
+ .then(async (r) => { if (!r.ok)
38
+ throw new Error(String(r.status)); return r.json(); })
39
+ .then((payload) => { if (!c.signal.aborted)
40
+ setState({ payload, error: null }); })
41
+ .catch((e) => { if (!c.signal.aborted)
42
+ setState({ payload: null, error: e instanceof Error ? e.message : String(e) }); });
43
+ return () => c.abort();
44
+ }, [tick]);
45
+ return { ...state, reload };
46
+ }
47
+ // --- Change detail expansion with diff and rollback ---
48
+ function ChangeDetail({ hash, t, onRollback }) {
49
+ const [change, setChange] = useState(null);
50
+ const [loading, setLoading] = useState(false);
51
+ const [rolling, setRolling] = useState(false);
52
+ const load = useCallback(async () => {
53
+ setLoading(true);
54
+ try {
55
+ const r = await fetch(`${CHANGE_PATH}?hash=${hash}`);
56
+ if (r.ok)
57
+ setChange(await r.json());
58
+ }
59
+ finally {
60
+ setLoading(false);
61
+ }
62
+ }, [hash]);
63
+ useEffect(() => { load(); }, [load]);
64
+ const handleRollback = useCallback(async () => {
65
+ if (!confirm(t('confirmRollback')))
66
+ return;
67
+ setRolling(true);
68
+ try {
69
+ await fetch(ROLLBACK_PATH, {
70
+ method: 'POST',
71
+ headers: { 'content-type': 'application/json' },
72
+ body: JSON.stringify({ hash }),
73
+ });
74
+ onRollback();
75
+ }
76
+ finally {
77
+ setRolling(false);
78
+ }
79
+ }, [hash, t, onRollback]);
80
+ if (loading)
81
+ return _jsx("p", { style: muted, children: t('loading') });
82
+ if (!change)
83
+ return _jsx("p", { style: muted, children: t('notFound') });
84
+ return (_jsxs("div", { style: { ...card, marginTop: 4 }, children: [_jsxs("div", { style: { display: 'flex', justifyContent: 'space-between', alignItems: 'center', marginBottom: 8 }, children: [_jsx("strong", { children: change.file }), _jsx("button", { type: "button", style: dangerBtn, disabled: rolling, onClick: handleRollback, children: rolling ? '…' : `↩ ${t('rollback')}` })] }), _jsxs("div", { style: { marginBottom: 8 }, children: [_jsx("strong", { style: { fontSize: 12 }, children: t('diff') }), _jsx("pre", { style: preBlock, children: change.diff })] }), _jsxs("div", { style: { display: 'flex', gap: 8, flexWrap: 'wrap' }, children: [_jsxs("div", { style: { flex: 1, minWidth: 250 }, children: [_jsx("strong", { style: { fontSize: 12, color: '#e55' }, children: t('before') }), _jsxs("pre", { style: { ...preBlock, maxHeight: 150 }, children: [change.oldContent.slice(0, 2000), change.oldContent.length > 2000 ? '\n…' : ''] })] }), _jsxs("div", { style: { flex: 1, minWidth: 250 }, children: [_jsx("strong", { style: { fontSize: 12, color: '#4a4' }, children: t('after') }), _jsxs("pre", { style: { ...preBlock, maxHeight: 150 }, children: [change.newContent.slice(0, 2000), change.newContent.length > 2000 ? '\n…' : ''] })] })] })] }));
85
+ }
86
+ export function PromptVcsPanel({ t }) {
87
+ const { payload, error, reload } = usePanel();
88
+ const [expandedHash, setExpandedHash] = useState(null);
89
+ const header = (_jsxs("header", { style: head, children: [_jsxs("strong", { style: { fontSize: 13 }, children: ["\uD83D\uDCDD ", t('title')] }), _jsx("span", { style: { flex: 1 } }), _jsx("button", { type: "button", style: btn, onClick: reload, children: t('refresh') })] }));
90
+ if (error !== null) {
91
+ return (_jsxs("div", { style: wrap, children: [header, _jsxs("p", { role: "alert", style: { margin: 0, fontSize: 13 }, children: [t('failed'), ": ", error] }), _jsx("button", { type: "button", onClick: reload, style: { ...btn, alignSelf: 'flex-start' }, children: t('retry') })] }));
92
+ }
93
+ if (payload === null)
94
+ return _jsx("p", { style: muted, "aria-live": "polite", children: t('loading') });
95
+ return (_jsxs("div", { style: wrap, children: [header, _jsxs("div", { style: statRow, children: [_jsxs("div", { style: statBox, children: [_jsx("div", { style: { fontSize: 18, fontWeight: 700 }, children: payload.totalChanges }), _jsx("div", { style: muted, children: t('totalChanges') })] }), _jsxs("div", { style: statBox, children: [_jsx("div", { style: { fontSize: 18, fontWeight: 700 }, children: payload.files.length }), _jsx("div", { style: muted, children: t('filesTracked') })] }), _jsxs("div", { style: statBox, children: [_jsx("div", { style: { fontSize: 14, fontWeight: 600 }, children: payload.watchedFiles.join(', ') }), _jsx("div", { style: muted, children: t('watched') })] })] }), payload.files.length > 0 && (_jsxs("div", { children: [_jsxs("strong", { style: { fontSize: 13 }, children: ["\uD83D\uDCC1 ", t('files')] }), _jsxs("table", { style: { ...table, marginTop: 4 }, children: [_jsx("thead", { children: _jsxs("tr", { children: [_jsx("th", { style: th, children: t('file') }), _jsx("th", { style: th, children: t('changes') }), _jsx("th", { style: th, children: t('lastChanged') }), _jsx("th", { style: th, children: t('size') })] }) }), _jsx("tbody", { children: payload.files.map((f) => (_jsxs("tr", { children: [_jsx("td", { style: td, children: _jsx("code", { style: { fontSize: 11 }, children: f.file }) }), _jsx("td", { style: td, children: f.changes }), _jsx("td", { style: td, children: new Date(f.lastChanged).toLocaleString() }), _jsxs("td", { style: td, children: [f.currentSize, "B"] })] }, f.file))) })] })] })), payload.timeline.length === 0 ? (_jsx("p", { style: { margin: 0, fontSize: 13, opacity: 0.8 }, children: t('empty') })) : (_jsxs("div", { children: [_jsxs("strong", { style: { fontSize: 13 }, children: ["\uD83D\uDD52 ", t('timeline')] }), _jsxs("table", { style: { ...table, marginTop: 4 }, children: [_jsx("thead", { children: _jsxs("tr", { children: [_jsx("th", { style: th }), _jsx("th", { style: th, children: t('hash') }), _jsx("th", { style: th, children: t('date') }), _jsx("th", { style: th, children: t('by') }), _jsx("th", { style: th, children: t('file') }), _jsx("th", { style: th, children: t('added') }), _jsx("th", { style: th, children: t('removed') })] }) }), _jsx("tbody", { children: payload.timeline.map((row) => (_jsxs(_Fragment, { children: [_jsxs("tr", { style: clickRow, onClick: () => setExpandedHash(expandedHash === row.hash ? null : row.hash), children: [_jsx("td", { style: td, children: expandedHash === row.hash ? '▼' : '▶' }), _jsx("td", { style: td, children: _jsx("code", { style: { fontSize: 11 }, children: row.hash }) }), _jsx("td", { style: td, children: new Date(row.timestamp).toLocaleString() }), _jsx("td", { style: td, children: row.changedBy }), _jsx("td", { style: td, children: row.file }), _jsxs("td", { style: { ...td, color: '#4a4' }, children: ["+", row.addedLines] }), _jsxs("td", { style: { ...td, color: '#e55' }, children: ["-", row.removedLines] })] }, row.hash), expandedHash === row.hash && (_jsx("tr", { children: _jsx("td", { colSpan: 7, style: { padding: '4px 0' }, children: _jsx(ChangeDetail, { hash: row.hash, t: t, onRollback: () => { setExpandedHash(null); reload(); } }) }) }, `${row.hash}-detail`))] }))) })] })] }))] }));
6
96
  }
package/lib/index.d.ts CHANGED
@@ -5,7 +5,9 @@ export interface VcsService {
5
5
  recordChange(file: string, oldContent: string, newContent: string, changedBy?: 'user' | 'plugin' | 'agent', pluginId?: string): ReturnType<PromptVcs['recordChange']>;
6
6
  timeline(): ReturnType<PromptVcs['timeline']>;
7
7
  getDiff(hash: string): ReturnType<PromptVcs['getDiff']>;
8
+ getChange(hash: string): ReturnType<PromptVcs['getChange']>;
8
9
  rollback(hash: string): boolean;
9
10
  panel(): ReturnType<PromptVcs['panel']>;
11
+ fileStats(): ReturnType<PromptVcs['fileStats']>;
10
12
  }
11
13
  export declare function apply(ctx: Context): void;
package/lib/index.js CHANGED
@@ -9,8 +9,10 @@ export function apply(ctx) {
9
9
  recordChange: (file, oldContent, newContent, changedBy, pluginId) => vcs.recordChange(file, oldContent, newContent, changedBy, pluginId),
10
10
  timeline: () => vcs.timeline(),
11
11
  getDiff: (hash) => vcs.getDiff(hash),
12
+ getChange: (hash) => vcs.getChange(hash),
12
13
  rollback: (hash) => vcs.rollback(hash),
13
14
  panel: () => vcs.panel(),
15
+ fileStats: () => vcs.fileStats(),
14
16
  };
15
17
  ctx.provide('promptVcs', service);
16
18
  registerVcsRoutes(ctx, service);
package/lib/routes.d.ts CHANGED
@@ -2,4 +2,7 @@ import type { Context } from '@deepseek-ai/cordis';
2
2
  import type { VcsService } from './index.js';
3
3
  import { VCS_PANEL_PATH } from './vcs.js';
4
4
  export { VCS_PANEL_PATH };
5
+ export declare const VCS_DIFF_PATH = "/api/vcs.diff";
6
+ export declare const VCS_ROLLBACK_PATH = "/api/vcs.rollback";
7
+ export declare const VCS_CHANGE_PATH = "/api/vcs.change";
5
8
  export declare function registerVcsRoutes(ctx: Context, vcs: VcsService): void;
package/lib/routes.js CHANGED
@@ -1,5 +1,8 @@
1
1
  import { VCS_PANEL_PATH } from './vcs.js';
2
2
  export { VCS_PANEL_PATH };
3
+ export const VCS_DIFF_PATH = '/api/vcs.diff';
4
+ export const VCS_ROLLBACK_PATH = '/api/vcs.rollback';
5
+ export const VCS_CHANGE_PATH = '/api/vcs.change';
3
6
  export function registerVcsRoutes(ctx, vcs) {
4
7
  ctx.inject(['connection'], (connectionCtx) => {
5
8
  const connection = connectionCtx.connection;
@@ -46,5 +49,21 @@ export function registerVcsRoutes(ctx, vcs) {
46
49
  return Response.json({ ok: true });
47
50
  },
48
51
  });
52
+ // Full change detail (with old/new content)
53
+ connection.fetch.register({
54
+ path: VCS_CHANGE_PATH,
55
+ methods: ['GET'],
56
+ requestBody: 'buffered',
57
+ fetch: async (request) => {
58
+ const url = new URL(request.url);
59
+ const hash = url.searchParams.get('hash');
60
+ if (!hash)
61
+ return Response.json({ error: 'missing hash' }, { status: 400 });
62
+ const change = vcs.getChange(hash);
63
+ if (!change)
64
+ return Response.json({ error: 'not found' }, { status: 404 });
65
+ return Response.json(change, { headers: { 'cache-control': 'no-store' } });
66
+ },
67
+ });
49
68
  });
50
69
  }
package/lib/types.d.ts CHANGED
@@ -18,6 +18,15 @@ export interface TimelineEntry {
18
18
  addedLines: number;
19
19
  removedLines: number;
20
20
  }
21
+ export interface FileStat {
22
+ file: string;
23
+ changes: number;
24
+ lastChanged: number;
25
+ currentSize: number;
26
+ }
21
27
  export interface PanelPayload {
22
28
  timeline: TimelineEntry[];
29
+ files: FileStat[];
30
+ totalChanges: number;
31
+ watchedFiles: string[];
23
32
  }
package/lib/vcs.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { Change, TimelineEntry, PanelPayload } from './types.js';
1
+ import type { Change, TimelineEntry, PanelPayload, FileStat } from './types.js';
2
2
  export declare const VCS_PANEL_PATH = "/api/vcs.panel";
3
3
  export declare class PromptVcs {
4
4
  private projectDir;
@@ -10,8 +10,12 @@ export declare class PromptVcs {
10
10
  checkFile(file: string, lastKnownContent: string | null): Change | null;
11
11
  timeline(): TimelineEntry[];
12
12
  getDiff(hash: string): string | null;
13
+ /** Get full change detail by hash. */
14
+ getChange(hash: string): Change | null;
13
15
  /** Rollback a file to its state before the given change. */
14
16
  rollback(hash: string): boolean;
17
+ /** Get stats per file. */
18
+ fileStats(): FileStat[];
15
19
  panel(): PanelPayload;
16
20
  static get watchedFiles(): string[];
17
21
  }
package/lib/vcs.js CHANGED
@@ -59,6 +59,11 @@ export class PromptVcs {
59
59
  const change = this.store.readAll().find((c) => c.hash === hash);
60
60
  return change?.diff ?? null;
61
61
  }
62
+ /** Get full change detail by hash. */
63
+ getChange(hash) {
64
+ const change = this.store.readAll().find((c) => c.hash === hash);
65
+ return change ?? null;
66
+ }
62
67
  /** Rollback a file to its state before the given change. */
63
68
  rollback(hash) {
64
69
  const changes = this.store.readAll();
@@ -71,8 +76,34 @@ export class PromptVcs {
71
76
  this.recordChange(fullPath, change.newContent, change.oldContent, 'user');
72
77
  return true;
73
78
  }
79
+ /** Get stats per file. */
80
+ fileStats() {
81
+ const changes = this.store.readAll();
82
+ const byFile = new Map();
83
+ for (const c of changes) {
84
+ const f = byFile.get(c.file) ?? { changes: 0, lastChanged: 0 };
85
+ f.changes++;
86
+ f.lastChanged = Math.max(f.lastChanged, c.timestamp);
87
+ byFile.set(c.file, f);
88
+ }
89
+ return [...byFile.entries()].map(([file, v]) => {
90
+ const fullPath = join(this.projectDir, file);
91
+ let currentSize = 0;
92
+ try {
93
+ currentSize = existsSync(fullPath) ? readFileSync(fullPath, 'utf8').length : 0;
94
+ }
95
+ catch { /* */ }
96
+ return { file, ...v, currentSize };
97
+ }).sort((a, b) => b.lastChanged - a.lastChanged);
98
+ }
74
99
  panel() {
75
- return { timeline: this.timeline() };
100
+ const changes = this.store.readAll();
101
+ return {
102
+ timeline: this.timeline(),
103
+ files: this.fileStats(),
104
+ totalChanges: changes.length,
105
+ watchedFiles: WATCHED_FILES,
106
+ };
76
107
  }
77
108
  static get watchedFiles() {
78
109
  return WATCHED_FILES;
package/lib/vcs.web.js CHANGED
@@ -26,62 +26,281 @@ __export(index_exports, {
26
26
  inject: () => inject
27
27
  });
28
28
  module.exports = __toCommonJS(index_exports);
29
- var import_react = require("react");
30
29
 
31
- // src/client/view.tsx
32
- function renderPanel(payload) {
33
- const rows = payload.timeline.map((e) => `<tr><td>${e.hash}</td><td>${new Date(e.timestamp).toLocaleString()}</td><td>${e.changedBy}</td><td>${e.file}</td><td>+${e.addedLines}</td><td>-${e.removedLines}</td></tr>`).join("");
34
- return `<div class="vcs-panel"><h2>Prompt VCS</h2>${rows ? `<table><thead><tr><th>Hash</th><th>Date</th><th>By</th><th>File</th><th>+</th><th>-</th></tr></thead><tbody>${rows}</tbody></table>` : "<p>No changes recorded.</p>"}</div>`;
35
- }
30
+ // src/client/locales.ts
31
+ var NS = "promptVcs";
32
+ var zh = {
33
+ "nav": "\u63D0\u793A\u8BCD\u7248\u672C",
34
+ "title": "\u63D0\u793A\u8BCD\u7248\u672C",
35
+ "hash": "\u7248\u672C\u53F7",
36
+ "date": "\u65F6\u95F4",
37
+ "by": "\u4FEE\u6539\u65B9",
38
+ "file": "\u6587\u4EF6",
39
+ "added": "\u65B0\u589E",
40
+ "removed": "\u5220\u9664",
41
+ "empty": "\u8FD8\u6CA1\u6709\u8BB0\u5F55\u5230\u6307\u4EE4\u6539\u52A8\u3002",
42
+ "refresh": "\u5237\u65B0",
43
+ "loading": "\u6B63\u5728\u52A0\u8F7D\u2026",
44
+ "failed": "\u52A0\u8F7D\u5931\u8D25",
45
+ "retry": "\u91CD\u8BD5",
46
+ "totalChanges": "\u603B\u53D8\u66F4\u6570",
47
+ "filesTracked": "\u8DDF\u8E2A\u6587\u4EF6\u6570",
48
+ "watched": "\u76D1\u63A7\u6587\u4EF6",
49
+ "files": "\u6587\u4EF6",
50
+ "changes": "\u53D8\u66F4\u6B21\u6570",
51
+ "lastChanged": "\u6700\u540E\u53D8\u66F4",
52
+ "size": "\u5927\u5C0F",
53
+ "timeline": "\u65F6\u95F4\u7EBF",
54
+ "diff": "\u5DEE\u5F02",
55
+ "before": "\u53D8\u66F4\u524D",
56
+ "after": "\u53D8\u66F4\u540E",
57
+ "rollback": "\u56DE\u6EDA",
58
+ "confirmRollback": "\u786E\u5B9A\u56DE\u6EDA\u5230\u6B64\u53D8\u66F4\u4E4B\u524D\u7684\u72B6\u6001\uFF1F",
59
+ "notFound": "\u672A\u627E\u5230\u53D8\u66F4\u8BB0\u5F55"
60
+ };
61
+ var en = {
62
+ "nav": "Prompt VCS",
63
+ "title": "Prompt VCS",
64
+ "hash": "Hash",
65
+ "date": "Date",
66
+ "by": "Changed by",
67
+ "file": "File",
68
+ "added": "Added",
69
+ "removed": "Removed",
70
+ "empty": "No instruction changes recorded yet.",
71
+ "refresh": "Refresh",
72
+ "loading": "Loading\u2026",
73
+ "failed": "Failed to load",
74
+ "retry": "Retry",
75
+ "totalChanges": "Total Changes",
76
+ "filesTracked": "Files Tracked",
77
+ "watched": "Watched",
78
+ "files": "Files",
79
+ "changes": "Changes",
80
+ "lastChanged": "Last Changed",
81
+ "size": "Size",
82
+ "timeline": "Timeline",
83
+ "diff": "Diff",
84
+ "before": "Before",
85
+ "after": "After",
86
+ "rollback": "Rollback",
87
+ "confirmRollback": "Rollback to before this change?",
88
+ "notFound": "Change not found"
89
+ };
36
90
 
37
- // src/client/index.tsx
91
+ // src/client/view.tsx
92
+ var import_react = require("react");
38
93
  var import_jsx_runtime = require("react/jsx-runtime");
39
94
  var PANEL_PATH = "/api/vcs.panel";
95
+ var CHANGE_PATH = "/api/vcs.change";
96
+ var ROLLBACK_PATH = "/api/vcs.rollback";
97
+ var wrap = { display: "flex", flexDirection: "column", gap: 12, maxWidth: 820, fontFamily: "inherit" };
98
+ var head = { display: "flex", alignItems: "baseline", gap: 12, flexWrap: "wrap" };
99
+ var muted = { fontSize: 12, opacity: 0.75 };
100
+ var table = { borderCollapse: "collapse", width: "100%" };
101
+ var th = { textAlign: "left", padding: "4px 10px 4px 0", fontWeight: 600, fontSize: 12, opacity: 0.8, borderBottom: "0.5px solid rgba(128,128,128,0.4)" };
102
+ var td = { padding: "6px 10px 6px 0", fontSize: 13, borderBottom: "0.5px solid rgba(128,128,128,0.18)" };
103
+ var card = { padding: "8px 12px", borderRadius: 6, border: "1px solid rgba(128,128,128,0.2)", fontSize: 13 };
104
+ var btn = { fontSize: 12, cursor: "pointer", padding: "3px 10px", borderRadius: 4, border: "0.5px solid rgba(128,128,128,0.4)" };
105
+ var dangerBtn = { ...btn, color: "#e55", borderColor: "#e55" };
106
+ var preBlock = { whiteSpace: "pre-wrap", wordBreak: "break-word", fontSize: 11, maxHeight: 200, overflow: "auto", padding: 8, borderRadius: 4, background: "rgba(128,128,128,0.06)", border: "1px solid rgba(128,128,128,0.15)" };
107
+ var clickRow = { cursor: "pointer" };
108
+ var statRow = { display: "flex", gap: 12, flexWrap: "wrap" };
109
+ var statBox = { ...card, flex: 1, minWidth: 100, textAlign: "center" };
40
110
  function usePanel() {
41
- const [html, setHtml] = (0, import_react.useState)(null);
42
- const [error, setError] = (0, import_react.useState)(null);
111
+ const [state, setState] = (0, import_react.useState)({ payload: null, error: null });
43
112
  const [tick, setTick] = (0, import_react.useState)(0);
44
- const reload = (0, import_react.useCallback)(() => setTick((t) => t + 1), []);
113
+ const reload = (0, import_react.useCallback)(() => setTick((v) => v + 1), []);
45
114
  (0, import_react.useEffect)(() => {
46
- const controller = new AbortController();
47
- setError(null);
48
- fetch(PANEL_PATH, { signal: controller.signal }).then(async (response) => {
49
- if (!response.ok) throw new Error(`panel request failed with ${response.status}`);
50
- return response.json();
115
+ const c = new AbortController();
116
+ setState((p) => ({ ...p, error: null }));
117
+ fetch(PANEL_PATH, { signal: c.signal }).then(async (r) => {
118
+ if (!r.ok) throw new Error(String(r.status));
119
+ return r.json();
51
120
  }).then((payload) => {
52
- if (!controller.signal.aborted) setHtml(renderPanel(payload));
53
- }).catch((cause) => {
54
- if (controller.signal.aborted) return;
55
- setError(cause instanceof Error ? cause.message : String(cause));
121
+ if (!c.signal.aborted) setState({ payload, error: null });
122
+ }).catch((e) => {
123
+ if (!c.signal.aborted) setState({ payload: null, error: e instanceof Error ? e.message : String(e) });
56
124
  });
57
- return () => controller.abort();
125
+ return () => c.abort();
58
126
  }, [tick]);
59
- return { html, error, reload };
127
+ return { ...state, reload };
60
128
  }
61
- function PromptVCSPage() {
62
- const { html, error, reload } = usePanel();
129
+ function ChangeDetail({ hash, t, onRollback }) {
130
+ const [change, setChange] = (0, import_react.useState)(null);
131
+ const [loading, setLoading] = (0, import_react.useState)(false);
132
+ const [rolling, setRolling] = (0, import_react.useState)(false);
133
+ const load = (0, import_react.useCallback)(async () => {
134
+ setLoading(true);
135
+ try {
136
+ const r = await fetch(`${CHANGE_PATH}?hash=${hash}`);
137
+ if (r.ok) setChange(await r.json());
138
+ } finally {
139
+ setLoading(false);
140
+ }
141
+ }, [hash]);
142
+ (0, import_react.useEffect)(() => {
143
+ load();
144
+ }, [load]);
145
+ const handleRollback = (0, import_react.useCallback)(async () => {
146
+ if (!confirm(t("confirmRollback"))) return;
147
+ setRolling(true);
148
+ try {
149
+ await fetch(ROLLBACK_PATH, {
150
+ method: "POST",
151
+ headers: { "content-type": "application/json" },
152
+ body: JSON.stringify({ hash })
153
+ });
154
+ onRollback();
155
+ } finally {
156
+ setRolling(false);
157
+ }
158
+ }, [hash, t, onRollback]);
159
+ if (loading) return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { style: muted, children: t("loading") });
160
+ if (!change) return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { style: muted, children: t("notFound") });
161
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { style: { ...card, marginTop: 4 }, children: [
162
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { style: { display: "flex", justifyContent: "space-between", alignItems: "center", marginBottom: 8 }, children: [
163
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("strong", { children: change.file }),
164
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", { type: "button", style: dangerBtn, disabled: rolling, onClick: handleRollback, children: rolling ? "\u2026" : `\u21A9 ${t("rollback")}` })
165
+ ] }),
166
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { style: { marginBottom: 8 }, children: [
167
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("strong", { style: { fontSize: 12 }, children: t("diff") }),
168
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("pre", { style: preBlock, children: change.diff })
169
+ ] }),
170
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { style: { display: "flex", gap: 8, flexWrap: "wrap" }, children: [
171
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { style: { flex: 1, minWidth: 250 }, children: [
172
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("strong", { style: { fontSize: 12, color: "#e55" }, children: t("before") }),
173
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("pre", { style: { ...preBlock, maxHeight: 150 }, children: [
174
+ change.oldContent.slice(0, 2e3),
175
+ change.oldContent.length > 2e3 ? "\n\u2026" : ""
176
+ ] })
177
+ ] }),
178
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { style: { flex: 1, minWidth: 250 }, children: [
179
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("strong", { style: { fontSize: 12, color: "#4a4" }, children: t("after") }),
180
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("pre", { style: { ...preBlock, maxHeight: 150 }, children: [
181
+ change.newContent.slice(0, 2e3),
182
+ change.newContent.length > 2e3 ? "\n\u2026" : ""
183
+ ] })
184
+ ] })
185
+ ] })
186
+ ] });
187
+ }
188
+ function PromptVcsPanel({ t }) {
189
+ const { payload, error, reload } = usePanel();
190
+ const [expandedHash, setExpandedHash] = (0, import_react.useState)(null);
191
+ const header = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("header", { style: head, children: [
192
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("strong", { style: { fontSize: 13 }, children: [
193
+ "\u{1F4DD} ",
194
+ t("title")
195
+ ] }),
196
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { style: { flex: 1 } }),
197
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", { type: "button", style: btn, onClick: reload, children: t("refresh") })
198
+ ] });
63
199
  if (error !== null) {
64
- return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("section", { children: [
65
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("p", { role: "alert", children: [
66
- "Prompt VCS panel failed to load: ",
200
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { style: wrap, children: [
201
+ header,
202
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("p", { role: "alert", style: { margin: 0, fontSize: 13 }, children: [
203
+ t("failed"),
204
+ ": ",
67
205
  error
68
206
  ] }),
69
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", { type: "button", onClick: reload, children: "Retry" })
207
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", { type: "button", onClick: reload, style: { ...btn, alignSelf: "flex-start" }, children: t("retry") })
70
208
  ] });
71
209
  }
72
- if (html === null) return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { "aria-live": "polite", children: "Loading the Prompt VCS panel\u2026" });
73
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { dangerouslySetInnerHTML: { __html: html } });
210
+ if (payload === null) return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { style: muted, "aria-live": "polite", children: t("loading") });
211
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { style: wrap, children: [
212
+ header,
213
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { style: statRow, children: [
214
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { style: statBox, children: [
215
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { style: { fontSize: 18, fontWeight: 700 }, children: payload.totalChanges }),
216
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { style: muted, children: t("totalChanges") })
217
+ ] }),
218
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { style: statBox, children: [
219
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { style: { fontSize: 18, fontWeight: 700 }, children: payload.files.length }),
220
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { style: muted, children: t("filesTracked") })
221
+ ] }),
222
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { style: statBox, children: [
223
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { style: { fontSize: 14, fontWeight: 600 }, children: payload.watchedFiles.join(", ") }),
224
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { style: muted, children: t("watched") })
225
+ ] })
226
+ ] }),
227
+ payload.files.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { children: [
228
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("strong", { style: { fontSize: 13 }, children: [
229
+ "\u{1F4C1} ",
230
+ t("files")
231
+ ] }),
232
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("table", { style: { ...table, marginTop: 4 }, children: [
233
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("thead", { children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("tr", { children: [
234
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("th", { style: th, children: t("file") }),
235
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("th", { style: th, children: t("changes") }),
236
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("th", { style: th, children: t("lastChanged") }),
237
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("th", { style: th, children: t("size") })
238
+ ] }) }),
239
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("tbody", { children: payload.files.map((f) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("tr", { children: [
240
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("td", { style: td, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("code", { style: { fontSize: 11 }, children: f.file }) }),
241
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("td", { style: td, children: f.changes }),
242
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("td", { style: td, children: new Date(f.lastChanged).toLocaleString() }),
243
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("td", { style: td, children: [
244
+ f.currentSize,
245
+ "B"
246
+ ] })
247
+ ] }, f.file)) })
248
+ ] })
249
+ ] }),
250
+ payload.timeline.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { style: { margin: 0, fontSize: 13, opacity: 0.8 }, children: t("empty") }) : /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { children: [
251
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("strong", { style: { fontSize: 13 }, children: [
252
+ "\u{1F552} ",
253
+ t("timeline")
254
+ ] }),
255
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("table", { style: { ...table, marginTop: 4 }, children: [
256
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("thead", { children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("tr", { children: [
257
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("th", { style: th }),
258
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("th", { style: th, children: t("hash") }),
259
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("th", { style: th, children: t("date") }),
260
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("th", { style: th, children: t("by") }),
261
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("th", { style: th, children: t("file") }),
262
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("th", { style: th, children: t("added") }),
263
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("th", { style: th, children: t("removed") })
264
+ ] }) }),
265
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("tbody", { children: payload.timeline.map((row) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
266
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("tr", { style: clickRow, onClick: () => setExpandedHash(expandedHash === row.hash ? null : row.hash), children: [
267
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("td", { style: td, children: expandedHash === row.hash ? "\u25BC" : "\u25B6" }),
268
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("td", { style: td, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("code", { style: { fontSize: 11 }, children: row.hash }) }),
269
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("td", { style: td, children: new Date(row.timestamp).toLocaleString() }),
270
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("td", { style: td, children: row.changedBy }),
271
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("td", { style: td, children: row.file }),
272
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("td", { style: { ...td, color: "#4a4" }, children: [
273
+ "+",
274
+ row.addedLines
275
+ ] }),
276
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("td", { style: { ...td, color: "#e55" }, children: [
277
+ "-",
278
+ row.removedLines
279
+ ] })
280
+ ] }, row.hash),
281
+ expandedHash === row.hash && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("tr", { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("td", { colSpan: 7, style: { padding: "4px 0" }, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ChangeDetail, { hash: row.hash, t, onRollback: () => {
282
+ setExpandedHash(null);
283
+ reload();
284
+ } }) }) }, `${row.hash}-detail`)
285
+ ] })) })
286
+ ] })
287
+ ] })
288
+ ] });
74
289
  }
75
- var inject = ["slots"];
290
+
291
+ // src/client/index.tsx
292
+ var inject = ["slots", "locale"];
76
293
  function apply(ctx) {
294
+ ctx.effect(() => ctx.locale.register(NS, { zh, en }), "dsh-prompt-vcs: dictionaries");
77
295
  ctx.slots.inject("settings.section", () => ctx.slots.register(
78
296
  {
79
297
  name: "settings.section",
80
298
  id: "prompt-vcs",
81
299
  order: 44,
82
- label: () => "Prompt VCS"
300
+ label: () => ctx.locale.bind(NS)("nav"),
301
+ locale: NS
83
302
  },
84
- PromptVCSPage
303
+ PromptVcsPanel
85
304
  ));
86
305
  }
87
306
  return module.exports; } });
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../src/client/index.tsx", "../src/client/view.tsx"],
4
- "sourcesContent": ["/**\n * Browser half of dsh-prompt-vcs: the Prompt VCS page inside Settings.\n *\n * Services are named by their runtime identity, not by the package that provides them:\n * the settings shell is the `slots` service and the host bridge is `connection`. A\n * fiber that injects package names never resolves and the plugin stays pending, which\n * the loader reports as \"did not activate\".\n *\n * @module client\n */\n\nimport { useCallback, useEffect, useState } from 'react'\nimport type { ComponentType } from 'react'\nimport type { PanelPayload } from '../types.js'\nimport { renderPanel } from './view.js'\n\n/** Path the host half registers on the web connection. */\nconst PANEL_PATH = '/api/vcs.panel'\n\ninterface SlotsService {\n inject(name: string, register: () => void): void\n register(options: { name: string; id: string; order: number; label: () => string }, component: ComponentType): unknown\n}\n\n/** Fetch the panel payload; `reload` re-runs the request. */\nfunction usePanel() {\n const [html, setHtml] = useState<string | null>(null)\n const [error, setError] = useState<string | null>(null)\n const [tick, setTick] = useState(0)\n const reload = useCallback(() => setTick((t) => t + 1), [])\n\n useEffect(() => {\n const controller = new AbortController()\n setError(null)\n fetch(PANEL_PATH, { signal: controller.signal })\n .then(async (response) => {\n if (!response.ok) throw new Error(`panel request failed with ${response.status}`)\n return response.json() as Promise<PanelPayload>\n })\n .then((payload) => {\n if (!controller.signal.aborted) setHtml(renderPanel(payload))\n })\n .catch((cause: unknown) => {\n if (controller.signal.aborted) return\n // Say what failed rather than rendering an empty panel, which would read as\n // \"nothing recorded\" \u2014 a different and wrong answer.\n setError(cause instanceof Error ? cause.message : String(cause))\n })\n return () => controller.abort()\n }, [tick])\n\n return { html, error, reload }\n}\n\nfunction PromptVCSPage() {\n const { html, error, reload } = usePanel()\n if (error !== null) {\n return (\n <section>\n <p role=\"alert\">Prompt VCS panel failed to load: {error}</p>\n <button type=\"button\" onClick={reload}>Retry</button>\n </section>\n )\n }\n if (html === null) return <p aria-live=\"polite\">Loading the Prompt VCS panel\u2026</p>\n // The markup is produced by `renderPanel`, which escapes every interpolated value.\n return <div dangerouslySetInnerHTML={{ __html: html }} />\n}\n\n/** The slots service is what the settings shell exposes. */\nexport const inject = ['slots']\n\nexport function apply(ctx: { slots: SlotsService }): void {\n ctx.slots.inject('settings.section', () => ctx.slots.register(\n {\n name: 'settings.section',\n id: 'prompt-vcs',\n order: 44,\n label: () => 'Prompt VCS',\n },\n PromptVCSPage,\n ))\n}\n", "import type { PanelPayload } from '../types.js';\n\nexport function renderPanel(payload: PanelPayload): string {\n const rows = payload.timeline\n .map((e) => `<tr><td>${e.hash}</td><td>${new Date(e.timestamp).toLocaleString()}</td><td>${e.changedBy}</td><td>${e.file}</td><td>+${e.addedLines}</td><td>-${e.removedLines}</td></tr>`)\n .join('');\n return `<div class=\"vcs-panel\"><h2>Prompt VCS</h2>${rows ? `<table><thead><tr><th>Hash</th><th>Date</th><th>By</th><th>File</th><th>+</th><th>-</th></tr></thead><tbody>${rows}</tbody></table>` : '<p>No changes recorded.</p>'}</div>`;\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAWA,mBAAiD;;;ACT1C,SAAS,YAAY,SAA+B;AACzD,QAAM,OAAO,QAAQ,SAClB,IAAI,CAAC,MAAM,WAAW,E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AE,MAAK,SAAQ;AAAA;AAAA,QAAkC;AAAA,SAAM;AAAA,MACxD,4CAAC,YAAO,MAAK,UAAS,SAAS,QAAQ,mBAAK;AAAA,OAC9C;AAAA,EAEJ;AACA,MAAI,SAAS,KAAM,QAAO,4CAAC,OAAE,aAAU,UAAS,gDAA6B;AAE7E,SAAO,4CAAC,SAAI,yBAAyB,EAAE,QAAQ,KAAK,GAAG;AACzD;AAGO,IAAM,SAAS,CAAC,OAAO;AAEvB,SAAS,MAAM,KAAoC;AACxD,MAAI,MAAM,OAAO,oBAAoB,MAAM,IAAI,MAAM;AAAA,IACnD;AAAA,MACE,MAAM;AAAA,MACN,IAAI;AAAA,MACJ,OAAO;AAAA,MACP,OAAO,MAAM;AAAA,IACf;AAAA,IACA;AAAA,EACF,CAAC;AACH;",
3
+ "sources": ["../src/client/index.tsx", "../src/client/locales.ts", "../src/client/view.tsx"],
4
+ "sourcesContent": ["/**\n * Browser half of dsh-prompt-vcs: its page inside Settings.\n *\n * Two services are injected by their runtime identity, not by the packages that provide\n * them: the settings shell is `slots`, the dictionary registry is `locale`. The label and\n * every string inside the component are translated through this plugin's own namespace,\n * which is why the page follows the UI language instead of the plugin author's.\n *\n * @module client\n */\n\nimport type { ComponentType } from 'react'\n\nimport { NS, en, zh } from './locales.js'\nimport { PromptVcsPanel } from './view.js'\n\nexport const inject = ['slots', 'locale']\n\ninterface SlotsService {\n inject(name: string, register: () => void): void\n register(\n options: { name: string; id: string; order: number; label: () => string; locale: string },\n component: ComponentType<{ t: (key: string, params?: Record<string, unknown>) => string }>,\n ): unknown\n}\n\ninterface ClientContext {\n slots: SlotsService\n locale: {\n register(ns: string, dicts: { zh: unknown; en: unknown }): () => void\n bind(ns: string): (key: string, params?: Record<string, unknown>) => string\n }\n effect(callback: () => unknown, label?: string): unknown\n}\n\nexport function apply(ctx: ClientContext): void {\n // `zh` is the key-set source of truth, matching the official client plugins.\n ctx.effect(() => ctx.locale.register(NS, { zh, en }), 'dsh-prompt-vcs: dictionaries')\n\n ctx.slots.inject('settings.section', () => ctx.slots.register(\n {\n name: 'settings.section',\n id: 'prompt-vcs',\n order: 44,\n label: () => ctx.locale.bind(NS)('nav'),\n locale: NS,\n },\n PromptVcsPanel,\n ))\n}\n", "/**\n * Dictionaries for the Prompt VCS page.\n *\n * `zh` is the key-set source of truth, as in the official client plugins, and `en` is\n * typed against it: a key translated in one language but not the other fails the build\n * instead of silently rendering the raw key.\n *\n * @module client/locales\n */\n\n/** Dictionary namespace owned by this plugin. */\nexport const NS = 'promptVcs'\n\n/** Simplified Chinese dictionary (the key-set source of truth). */\nexport const zh = {\n 'nav': '\u63D0\u793A\u8BCD\u7248\u672C',\n 'title': '\u63D0\u793A\u8BCD\u7248\u672C',\n 'hash': '\u7248\u672C\u53F7',\n 'date': '\u65F6\u95F4',\n 'by': '\u4FEE\u6539\u65B9',\n 'file': '\u6587\u4EF6',\n 'added': '\u65B0\u589E',\n 'removed': '\u5220\u9664',\n 'empty': '\u8FD8\u6CA1\u6709\u8BB0\u5F55\u5230\u6307\u4EE4\u6539\u52A8\u3002',\n 'refresh': '\u5237\u65B0',\n 'loading': '\u6B63\u5728\u52A0\u8F7D\u2026',\n 'failed': '\u52A0\u8F7D\u5931\u8D25',\n 'retry': '\u91CD\u8BD5',\n 'totalChanges': '\u603B\u53D8\u66F4\u6570',\n 'filesTracked': '\u8DDF\u8E2A\u6587\u4EF6\u6570',\n 'watched': '\u76D1\u63A7\u6587\u4EF6',\n 'files': '\u6587\u4EF6',\n 'changes': '\u53D8\u66F4\u6B21\u6570',\n 'lastChanged': '\u6700\u540E\u53D8\u66F4',\n 'size': '\u5927\u5C0F',\n 'timeline': '\u65F6\u95F4\u7EBF',\n 'diff': '\u5DEE\u5F02',\n 'before': '\u53D8\u66F4\u524D',\n 'after': '\u53D8\u66F4\u540E',\n 'rollback': '\u56DE\u6EDA',\n 'confirmRollback': '\u786E\u5B9A\u56DE\u6EDA\u5230\u6B64\u53D8\u66F4\u4E4B\u524D\u7684\u72B6\u6001\uFF1F',\n 'notFound': '\u672A\u627E\u5230\u53D8\u66F4\u8BB0\u5F55',\n}\n\n/** English dictionary, checked complete against the zh key set. */\nexport const en: typeof zh = {\n 'nav': 'Prompt VCS',\n 'title': 'Prompt VCS',\n 'hash': 'Hash',\n 'date': 'Date',\n 'by': 'Changed by',\n 'file': 'File',\n 'added': 'Added',\n 'removed': 'Removed',\n 'empty': 'No instruction changes recorded yet.',\n 'refresh': 'Refresh',\n 'loading': 'Loading\u2026',\n 'failed': 'Failed to load',\n 'retry': 'Retry',\n 'totalChanges': 'Total Changes',\n 'filesTracked': 'Files Tracked',\n 'watched': 'Watched',\n 'files': 'Files',\n 'changes': 'Changes',\n 'lastChanged': 'Last Changed',\n 'size': 'Size',\n 'timeline': 'Timeline',\n 'diff': 'Diff',\n 'before': 'Before',\n 'after': 'After',\n 'rollback': 'Rollback',\n 'confirmRollback': 'Rollback to before this change?',\n 'notFound': 'Change not found',\n}\n", "/**\n * Pure rendering half of the promptVcs page.\n *\n * Separate from `index.tsx` so a static render can assert in Node what the page draws \u2014\n * the shipped bundle is a loader factory only a browser can run. Every user-visible\n * string comes from the `t` seat the renderer binds from this plugin's namespace, so the\n * page follows the UI language; no copy is hardcoded here.\n *\n * @module client/view\n */\n\nimport { useCallback, useEffect, useState } from 'react'\nimport type { CSSProperties } from 'react'\n\nimport type { PanelPayload, Change } from '../types.js'\n\nexport type Translate = (key: string, params?: Record<string, unknown>) => string\n\nexport interface PanelProps {\n t: Translate\n}\n\nconst PANEL_PATH = '/api/vcs.panel'\nconst CHANGE_PATH = '/api/vcs.change'\nconst ROLLBACK_PATH = '/api/vcs.rollback'\n\nconst wrap: CSSProperties = { display: 'flex', flexDirection: 'column', gap: 12, maxWidth: 820, fontFamily: 'inherit' }\nconst head: CSSProperties = { display: 'flex', alignItems: 'baseline', gap: 12, flexWrap: 'wrap' }\nconst muted: CSSProperties = { fontSize: 12, opacity: 0.75 }\nconst table: CSSProperties = { borderCollapse: 'collapse', width: '100%' }\nconst th: CSSProperties = { textAlign: 'left', padding: '4px 10px 4px 0', fontWeight: 600, fontSize: 12, opacity: 0.8, borderBottom: '0.5px solid rgba(128,128,128,0.4)' }\nconst td: CSSProperties = { padding: '6px 10px 6px 0', fontSize: 13, borderBottom: '0.5px solid rgba(128,128,128,0.18)' }\nconst card: CSSProperties = { padding: '8px 12px', borderRadius: 6, border: '1px solid rgba(128,128,128,0.2)', fontSize: 13 }\nconst btn: CSSProperties = { fontSize: 12, cursor: 'pointer', padding: '3px 10px', borderRadius: 4, border: '0.5px solid rgba(128,128,128,0.4)' }\nconst dangerBtn: CSSProperties = { ...btn, color: '#e55', borderColor: '#e55' }\nconst preBlock: CSSProperties = { whiteSpace: 'pre-wrap', wordBreak: 'break-word', fontSize: 11, maxHeight: 200, overflow: 'auto', padding: 8, borderRadius: 4, background: 'rgba(128,128,128,0.06)', border: '1px solid rgba(128,128,128,0.15)' }\nconst clickRow: CSSProperties = { cursor: 'pointer' }\nconst statRow: CSSProperties = { display: 'flex', gap: 12, flexWrap: 'wrap' }\nconst statBox: CSSProperties = { ...card, flex: 1, minWidth: 100, textAlign: 'center' as const }\n\ninterface PanelState {\n payload: PanelPayload | null\n error: string | null\n}\n\nexport function usePanel(): PanelState & { reload: () => void } {\n const [state, setState] = useState<PanelState>({ payload: null, error: null })\n const [tick, setTick] = useState(0)\n const reload = useCallback(() => setTick((v) => v + 1), [])\n useEffect(() => {\n const c = new AbortController()\n setState((p) => ({ ...p, error: null }))\n fetch(PANEL_PATH, { signal: c.signal })\n .then(async (r) => { if (!r.ok) throw new Error(String(r.status)); return r.json() as Promise<PanelPayload> })\n .then((payload) => { if (!c.signal.aborted) setState({ payload, error: null }) })\n .catch((e: unknown) => { if (!c.signal.aborted) setState({ payload: null, error: e instanceof Error ? e.message : String(e) }) })\n return () => c.abort()\n }, [tick])\n return { ...state, reload }\n}\n\n// --- Change detail expansion with diff and rollback ---\nfunction ChangeDetail({ hash, t, onRollback }: { hash: string; t: Translate; onRollback: () => void }) {\n const [change, setChange] = useState<Change | null>(null)\n const [loading, setLoading] = useState(false)\n const [rolling, setRolling] = useState(false)\n\n const load = useCallback(async () => {\n setLoading(true)\n try {\n const r = await fetch(`${CHANGE_PATH}?hash=${hash}`)\n if (r.ok) setChange(await r.json() as Change)\n } finally { setLoading(false) }\n }, [hash])\n\n useEffect(() => { load() }, [load])\n\n const handleRollback = useCallback(async () => {\n if (!confirm(t('confirmRollback'))) return\n setRolling(true)\n try {\n await fetch(ROLLBACK_PATH, {\n method: 'POST',\n headers: { 'content-type': 'application/json' },\n body: JSON.stringify({ hash }),\n })\n onRollback()\n } finally { setRolling(false) }\n }, [hash, t, onRollback])\n\n if (loading) return <p style={muted}>{t('loading')}</p>\n if (!change) return <p style={muted}>{t('notFound')}</p>\n return (\n <div style={{ ...card, marginTop: 4 }}>\n <div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center', marginBottom: 8 }}>\n <strong>{change.file}</strong>\n <button type=\"button\" style={dangerBtn} disabled={rolling} onClick={handleRollback}>\n {rolling ? '\u2026' : `\u21A9 ${t('rollback')}`}\n </button>\n </div>\n {/* Diff display */}\n <div style={{ marginBottom: 8 }}>\n <strong style={{ fontSize: 12 }}>{t('diff')}</strong>\n <pre style={preBlock}>{change.diff}</pre>\n </div>\n {/* Old / New content */}\n <div style={{ display: 'flex', gap: 8, flexWrap: 'wrap' }}>\n <div style={{ flex: 1, minWidth: 250 }}>\n <strong style={{ fontSize: 12, color: '#e55' }}>{t('before')}</strong>\n <pre style={{ ...preBlock, maxHeight: 150 }}>{change.oldContent.slice(0, 2000)}{change.oldContent.length > 2000 ? '\\n\u2026' : ''}</pre>\n </div>\n <div style={{ flex: 1, minWidth: 250 }}>\n <strong style={{ fontSize: 12, color: '#4a4' }}>{t('after')}</strong>\n <pre style={{ ...preBlock, maxHeight: 150 }}>{change.newContent.slice(0, 2000)}{change.newContent.length > 2000 ? '\\n\u2026' : ''}</pre>\n </div>\n </div>\n </div>\n )\n}\n\nexport function PromptVcsPanel({ t }: PanelProps) {\n const { payload, error, reload } = usePanel()\n const [expandedHash, setExpandedHash] = useState<string | null>(null)\n\n const header = (\n <header style={head}>\n <strong style={{ fontSize: 13 }}>\uD83D\uDCDD {t('title')}</strong>\n <span style={{ flex: 1 }} />\n <button type=\"button\" style={btn} onClick={reload}>{t('refresh')}</button>\n </header>\n )\n if (error !== null) {\n return (\n <div style={wrap}>\n {header}\n <p role=\"alert\" style={{ margin: 0, fontSize: 13 }}>{t('failed')}: {error}</p>\n <button type=\"button\" onClick={reload} style={{ ...btn, alignSelf: 'flex-start' }}>{t('retry')}</button>\n </div>\n )\n }\n if (payload === null) return <p style={muted} aria-live=\"polite\">{t('loading')}</p>\n return (\n <div style={wrap}>\n {header}\n\n {/* Overview */}\n <div style={statRow}>\n <div style={statBox}><div style={{ fontSize: 18, fontWeight: 700 }}>{payload.totalChanges}</div><div style={muted}>{t('totalChanges')}</div></div>\n <div style={statBox}><div style={{ fontSize: 18, fontWeight: 700 }}>{payload.files.length}</div><div style={muted}>{t('filesTracked')}</div></div>\n <div style={statBox}><div style={{ fontSize: 14, fontWeight: 600 }}>{payload.watchedFiles.join(', ')}</div><div style={muted}>{t('watched')}</div></div>\n </div>\n\n {/* File stats */}\n {payload.files.length > 0 && (\n <div>\n <strong style={{ fontSize: 13 }}>\uD83D\uDCC1 {t('files')}</strong>\n <table style={{ ...table, marginTop: 4 }}>\n <thead>\n <tr><th style={th}>{t('file')}</th><th style={th}>{t('changes')}</th><th style={th}>{t('lastChanged')}</th><th style={th}>{t('size')}</th></tr>\n </thead>\n <tbody>\n {payload.files.map((f) => (\n <tr key={f.file}>\n <td style={td}><code style={{ fontSize: 11 }}>{f.file}</code></td>\n <td style={td}>{f.changes}</td>\n <td style={td}>{new Date(f.lastChanged).toLocaleString()}</td>\n <td style={td}>{f.currentSize}B</td>\n </tr>\n ))}\n </tbody>\n </table>\n </div>\n )}\n\n {/* Timeline (expandable with diff + rollback) */}\n {payload.timeline.length === 0 ? (\n <p style={{ margin: 0, fontSize: 13, opacity: 0.8 }}>{t('empty')}</p>\n ) : (\n <div>\n <strong style={{ fontSize: 13 }}>\uD83D\uDD52 {t('timeline')}</strong>\n <table style={{ ...table, marginTop: 4 }}>\n <thead>\n <tr>\n <th style={th} /><th style={th}>{t('hash')}</th><th style={th}>{t('date')}</th><th style={th}>{t('by')}</th>\n <th style={th}>{t('file')}</th><th style={th}>{t('added')}</th><th style={th}>{t('removed')}</th>\n </tr>\n </thead>\n <tbody>\n {payload.timeline.map((row) => (\n <>\n <tr key={row.hash} style={clickRow} onClick={() => setExpandedHash(expandedHash === row.hash ? null : row.hash)}>\n <td style={td}>{expandedHash === row.hash ? '\u25BC' : '\u25B6'}</td>\n <td style={td}><code style={{ fontSize: 11 }}>{row.hash}</code></td>\n <td style={td}>{new Date(row.timestamp).toLocaleString()}</td>\n <td style={td}>{row.changedBy}</td>\n <td style={td}>{row.file}</td>\n <td style={{ ...td, color: '#4a4' }}>+{row.addedLines}</td>\n <td style={{ ...td, color: '#e55' }}>-{row.removedLines}</td>\n </tr>\n {expandedHash === row.hash && (\n <tr key={`${row.hash}-detail`}>\n <td colSpan={7} style={{ padding: '4px 0' }}>\n <ChangeDetail hash={row.hash} t={t} onRollback={() => { setExpandedHash(null); reload() }} />\n </td>\n </tr>\n )}\n </>\n ))}\n </tbody>\n </table>\n </div>\n )}\n </div>\n )\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACWO,IAAM,KAAK;AAGX,IAAM,KAAK;AAAA,EAChB,OAAO;AAAA,EACP,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,MAAM;AAAA,EACN,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,WAAW;AAAA,EACX,SAAS;AAAA,EACT,WAAW;AAAA,EACX,WAAW;AAAA,EACX,UAAU;AAAA,EACV,SAAS;AAAA,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G,OAAO,IAAK,cAAI,MAAK;AAAA,YACzB,6CAAC,QAAG,OAAO,EAAE,GAAG,IAAI,OAAO,OAAO,GAAG;AAAA;AAAA,cAAE,IAAI;AAAA,eAAW;AAAA,YACtD,6CAAC,QAAG,OAAO,EAAE,GAAG,IAAI,OAAO,OAAO,GAAG;AAAA;AAAA,cAAE,IAAI;AAAA,eAAa;AAAA,eAPjD,IAAI,IAQb;AAAA,UACC,iBAAiB,IAAI,QACpB,4CAAC,QACC,sDAAC,QAAG,SAAS,GAAG,OAAO,EAAE,SAAS,QAAQ,GACxC,sDAAC,gBAAa,MAAM,IAAI,MAAM,GAAM,YAAY,MAAM;AAAE,4BAAgB,IAAI;AAAG,mBAAO;AAAA,UAAE,GAAG,GAC7F,KAHO,GAAG,IAAI,IAAI,SAIpB;AAAA,WAEJ,CACD,GACH;AAAA,SACF;AAAA,OACF;AAAA,KAEJ;AAEJ;;;AFtMO,IAAM,SAAS,CAAC,SAAS,QAAQ;AAmBjC,SAAS,MAAM,KAA0B;AAE9C,MAAI,OAAO,MAAM,IAAI,OAAO,SAAS,IAAI,EAAE,IAAI,GAAG,CAAC,GAAG,8BAA8B;AAEpF,MAAI,MAAM,OAAO,oBAAoB,MAAM,IAAI,MAAM;AAAA,IACnD;AAAA,MACE,MAAM;AAAA,MACN,IAAI;AAAA,MACJ,OAAO;AAAA,MACP,OAAO,MAAM,IAAI,OAAO,KAAK,EAAE,EAAE,KAAK;AAAA,MACtC,QAAQ;AAAA,IACV;AAAA,IACA;AAAA,EACF,CAAC;AACH;",
6
6
  "names": []
7
7
  }
package/package.json CHANGED
@@ -1,32 +1,68 @@
1
1
  {
2
2
  "name": "dsh-prompt-vcs",
3
- "version": "0.2.0",
3
+ "version": "0.3.0",
4
4
  "description": "Every change to your agent's instructions is recorded with a diff, and any change can be undone.",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",
7
7
  "types": "lib/index.d.ts",
8
- "bin": { "dsh-prompt-vcs": "lib/bin.js" },
8
+ "bin": {
9
+ "dsh-prompt-vcs": "lib/bin.js"
10
+ },
9
11
  "exports": {
10
- ".": { "types": "./lib/index.d.ts", "default": "./lib/index.js" },
11
- "./client": { "types": "./lib/client/index.d.ts", "default": "./lib/vcs.web.js" },
12
+ ".": {
13
+ "types": "./lib/index.d.ts",
14
+ "default": "./lib/index.js"
15
+ },
16
+ "./client": {
17
+ "types": "./lib/client/index.d.ts",
18
+ "default": "./lib/vcs.web.js"
19
+ },
12
20
  "./package.json": "./package.json"
13
21
  },
14
- "files": ["lib", "cordis.patch.yml", "README.md", "CHANGELOG.md"],
15
- "keywords": ["dsh", "dsh-plugin", "deepseek-harness", "prompt", "vcs", "version-control", "diff"],
22
+ "files": [
23
+ "lib",
24
+ "cordis.patch.yml",
25
+ "README.md",
26
+ "CHANGELOG.md"
27
+ ],
28
+ "keywords": [
29
+ "dsh",
30
+ "dsh-plugin",
31
+ "deepseek-harness",
32
+ "prompt",
33
+ "vcs",
34
+ "version-control",
35
+ "diff"
36
+ ],
16
37
  "dsh": {
17
- "bundle": { "patch": "./cordis.patch.yml" },
38
+ "bundle": {
39
+ "patch": "./cordis.patch.yml"
40
+ },
18
41
  "client": {
19
42
  "platform": "web",
20
- "inject": ["slots", "connection"]
43
+ "inject": [
44
+ "@deepseek-ai/dsh-client-ui-renderer",
45
+ "@deepseek-ai/dsh-client-locale",
46
+ "@deepseek-ai/dsh-client-ui-settings"
47
+ ]
21
48
  }
22
49
  },
23
50
  "license": "MIT",
24
51
  "author": "hj01857655",
25
- "repository": { "type": "git", "url": "git+https://github.com/hj01857655/dsh-prompt-vcs.git" },
26
- "bugs": { "url": "https://github.com/hj01857655/dsh-prompt-vcs/issues" },
52
+ "repository": {
53
+ "type": "git",
54
+ "url": "git+https://github.com/hj01857655/dsh-prompt-vcs.git"
55
+ },
56
+ "bugs": {
57
+ "url": "https://github.com/hj01857655/dsh-prompt-vcs/issues"
58
+ },
27
59
  "homepage": "https://github.com/hj01857655/dsh-prompt-vcs#readme",
28
- "engines": { "node": ">=20" },
29
- "peerDependencies": { "@deepseek-ai/cordis": "^4.0.1" },
60
+ "engines": {
61
+ "node": ">=20"
62
+ },
63
+ "peerDependencies": {
64
+ "@deepseek-ai/cordis": "^4.0.1"
65
+ },
30
66
  "devDependencies": {
31
67
  "@deepseek-ai/cordis": "^4.0.2",
32
68
  "@types/node": "^22.20.3",