@agi-fans/dsh-tui 0.20.0 → 0.22.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.
- package/lib/CHANGELOG.md +249 -3
- package/lib/chrome/box.d.ts +47 -16
- package/lib/chrome/box.js +172 -130
- package/lib/chrome/box.js.map +1 -1
- package/lib/chrome/code-highlight.d.ts +15 -0
- package/lib/chrome/code-highlight.js +60 -4
- package/lib/chrome/code-highlight.js.map +1 -1
- package/lib/chrome/command-output.d.ts +29 -2
- package/lib/chrome/command-output.js +100 -4
- package/lib/chrome/command-output.js.map +1 -1
- package/lib/chrome/main-screen-renderer.d.ts +18 -0
- package/lib/chrome/main-screen-renderer.js +58 -5
- package/lib/chrome/main-screen-renderer.js.map +1 -1
- package/lib/chrome/markdown.js +30 -10
- package/lib/chrome/markdown.js.map +1 -1
- package/lib/chrome/relative-time.d.ts +17 -0
- package/lib/chrome/relative-time.js +36 -0
- package/lib/chrome/relative-time.js.map +1 -1
- package/lib/chrome/renderer.d.ts +9 -0
- package/lib/chrome/renderer.js +1 -1
- package/lib/chrome/renderer.js.map +1 -1
- package/lib/chrome/secret-mask.d.ts +35 -0
- package/lib/chrome/secret-mask.js +180 -0
- package/lib/chrome/secret-mask.js.map +1 -0
- package/lib/chrome/status-config.d.ts +161 -51
- package/lib/chrome/status-config.js +237 -126
- package/lib/chrome/status-config.js.map +1 -1
- package/lib/chrome/status-line.d.ts +3 -2
- package/lib/chrome/status-line.js +105 -63
- package/lib/chrome/status-line.js.map +1 -1
- package/lib/chrome/terminal-colors.d.ts +85 -0
- package/lib/chrome/terminal-colors.js +230 -0
- package/lib/chrome/terminal-colors.js.map +1 -0
- package/lib/chrome/terminal-images.d.ts +9 -1
- package/lib/chrome/terminal-images.js +27 -4
- package/lib/chrome/terminal-images.js.map +1 -1
- package/lib/chrome/theme.d.ts +32 -9
- package/lib/chrome/theme.js +616 -520
- package/lib/chrome/theme.js.map +1 -1
- package/lib/chrome/tool-args.d.ts +1 -1
- package/lib/chrome/tool-args.js +3 -1
- package/lib/chrome/tool-args.js.map +1 -1
- package/lib/chrome/tool-renderers.d.ts +2 -0
- package/lib/chrome/tool-renderers.js +69 -3
- package/lib/chrome/tool-renderers.js.map +1 -1
- package/lib/chrome/tools-list.d.ts +1 -4
- package/lib/chrome/tools-list.js +1 -41
- package/lib/chrome/tools-list.js.map +1 -1
- package/lib/chrome/welcome-tips.d.ts +20 -7
- package/lib/chrome/welcome-tips.js +22 -41
- package/lib/chrome/welcome-tips.js.map +1 -1
- package/lib/commands/auth-ids.d.ts +25 -0
- package/lib/commands/auth-ids.js +27 -0
- package/lib/commands/auth-ids.js.map +1 -0
- package/lib/commands/auth-input.d.ts +34 -0
- package/lib/commands/auth-input.js +96 -0
- package/lib/commands/auth-input.js.map +1 -0
- package/lib/commands/auth-providers.d.ts +39 -0
- package/lib/commands/auth-providers.js +125 -0
- package/lib/commands/auth-providers.js.map +1 -0
- package/lib/commands/auth.d.ts +16 -22
- package/lib/commands/auth.js +346 -299
- package/lib/commands/auth.js.map +1 -1
- package/lib/commands/btw.d.ts +27 -0
- package/lib/commands/btw.js +59 -0
- package/lib/commands/btw.js.map +1 -0
- package/lib/commands/diff.js +30 -5
- package/lib/commands/diff.js.map +1 -1
- package/lib/commands/export.d.ts +1 -1
- package/lib/commands/export.js +5 -3
- package/lib/commands/export.js.map +1 -1
- package/lib/commands/files.d.ts +17 -1
- package/lib/commands/files.js +69 -61
- package/lib/commands/files.js.map +1 -1
- package/lib/commands/integrations.js +18 -6
- package/lib/commands/integrations.js.map +1 -1
- package/lib/commands/jobs.d.ts +19 -4
- package/lib/commands/jobs.js +50 -7
- package/lib/commands/jobs.js.map +1 -1
- package/lib/commands/model.js +109 -76
- package/lib/commands/model.js.map +1 -1
- package/lib/commands/permission.js +46 -13
- package/lib/commands/permission.js.map +1 -1
- package/lib/commands/plugins.js +196 -42
- package/lib/commands/plugins.js.map +1 -1
- package/lib/commands/schedule.d.ts +29 -0
- package/lib/commands/schedule.js +228 -0
- package/lib/commands/schedule.js.map +1 -0
- package/lib/commands/session-configuration.d.ts +1 -1
- package/lib/commands/session-configuration.js +29 -28
- package/lib/commands/session-configuration.js.map +1 -1
- package/lib/commands/session.js +75 -80
- package/lib/commands/session.js.map +1 -1
- package/lib/commands/terminal.d.ts +24 -4
- package/lib/commands/terminal.js +38 -94
- package/lib/commands/terminal.js.map +1 -1
- package/lib/commands/trajectory.js +4 -1
- package/lib/commands/trajectory.js.map +1 -1
- package/lib/definition.d.ts +150 -11
- package/lib/index.d.ts +1 -0
- package/lib/index.js +1 -0
- package/lib/index.js.map +1 -1
- package/lib/input/actions.d.ts +51 -0
- package/lib/input/actions.js +120 -0
- package/lib/input/actions.js.map +1 -0
- package/lib/input/editor-discovery.js +2 -2
- package/lib/input/editor-discovery.js.map +1 -1
- package/lib/input/editor.d.ts +0 -10
- package/lib/input/editor.js +11 -9
- package/lib/input/editor.js.map +1 -1
- package/lib/input/image-paste.d.ts +19 -1
- package/lib/input/image-paste.js +82 -1
- package/lib/input/image-paste.js.map +1 -1
- package/lib/input/keybindings-config.d.ts +15 -4
- package/lib/input/keybindings-config.js +57 -35
- package/lib/input/keybindings-config.js.map +1 -1
- package/lib/input/keys.d.ts +18 -0
- package/lib/input/keys.js +48 -3
- package/lib/input/keys.js.map +1 -1
- package/lib/input/wheel-scroll.d.ts +46 -0
- package/lib/input/wheel-scroll.js +69 -0
- package/lib/input/wheel-scroll.js.map +1 -0
- package/lib/prompt-intents.d.ts +182 -0
- package/lib/prompt-intents.js +127 -0
- package/lib/prompt-intents.js.map +1 -0
- package/lib/runtime/agent-profile.d.ts +5 -0
- package/lib/runtime/agent-profile.js +12 -0
- package/lib/runtime/agent-profile.js.map +1 -1
- package/lib/runtime/approval-rules.d.ts +59 -0
- package/lib/runtime/approval-rules.js +179 -0
- package/lib/runtime/approval-rules.js.map +1 -0
- package/lib/runtime/btw-policy.d.ts +7 -0
- package/lib/runtime/btw-policy.js +18 -0
- package/lib/runtime/btw-policy.js.map +1 -0
- package/lib/runtime/btw.d.ts +47 -0
- package/lib/runtime/btw.js +200 -0
- package/lib/runtime/btw.js.map +1 -0
- package/lib/runtime/cancellable.d.ts +75 -0
- package/lib/runtime/cancellable.js +76 -0
- package/lib/runtime/cancellable.js.map +1 -0
- package/lib/runtime/composer-images.js +5 -4
- package/lib/runtime/composer-images.js.map +1 -1
- package/lib/runtime/composer-shell.d.ts +30 -0
- package/lib/runtime/composer-shell.js +150 -0
- package/lib/runtime/composer-shell.js.map +1 -0
- package/lib/runtime/file-recovery-local.d.ts +73 -0
- package/lib/runtime/file-recovery-local.js +351 -0
- package/lib/runtime/file-recovery-local.js.map +1 -0
- package/lib/runtime/file-recovery-recording.d.ts +23 -0
- package/lib/runtime/file-recovery-recording.js +131 -0
- package/lib/runtime/file-recovery-recording.js.map +1 -0
- package/lib/runtime/file-recovery-review.d.ts +3 -0
- package/lib/runtime/file-recovery-review.js +130 -0
- package/lib/runtime/file-recovery-review.js.map +1 -0
- package/lib/runtime/file-recovery-store.d.ts +83 -0
- package/lib/runtime/file-recovery-store.js +329 -0
- package/lib/runtime/file-recovery-store.js.map +1 -0
- package/lib/runtime/file-recovery-worker.d.ts +22 -0
- package/lib/runtime/file-recovery-worker.js +153 -0
- package/lib/runtime/file-recovery-worker.js.map +1 -0
- package/lib/runtime/file-review.d.ts +6 -3
- package/lib/runtime/file-review.js +44 -7
- package/lib/runtime/file-review.js.map +1 -1
- package/lib/runtime/herdr-agent.d.ts +4 -13
- package/lib/runtime/herdr-agent.js +19 -63
- package/lib/runtime/herdr-agent.js.map +1 -1
- package/lib/runtime/plain-tui.d.ts +2 -0
- package/lib/runtime/plain-tui.js +7 -1
- package/lib/runtime/plain-tui.js.map +1 -1
- package/lib/runtime/plugin-settings.d.ts +25 -2
- package/lib/runtime/plugin-settings.js +329 -31
- package/lib/runtime/plugin-settings.js.map +1 -1
- package/lib/runtime/provider-local.d.ts +81 -24
- package/lib/runtime/provider-local.js +1807 -608
- package/lib/runtime/provider-local.js.map +1 -1
- package/lib/runtime/runner.js +52 -12
- package/lib/runtime/runner.js.map +1 -1
- package/lib/runtime/session-archive.d.ts +6 -0
- package/lib/runtime/session-archive.js +129 -3
- package/lib/runtime/session-archive.js.map +1 -1
- package/lib/runtime/session-runtime.js +1 -1
- package/lib/runtime/session-runtime.js.map +1 -1
- package/lib/runtime/settings-preferences.d.ts +5 -0
- package/lib/runtime/settings-preferences.js +34 -0
- package/lib/runtime/settings-preferences.js.map +1 -0
- package/lib/runtime/startup-notices.js +2 -0
- package/lib/runtime/startup-notices.js.map +1 -1
- package/lib/runtime/terminal-modes.d.ts +47 -0
- package/lib/runtime/terminal-modes.js +86 -0
- package/lib/runtime/terminal-modes.js.map +1 -0
- package/lib/runtime/terminal-notifications.d.ts +3 -5
- package/lib/runtime/terminal-notifications.js +4 -8
- package/lib/runtime/terminal-notifications.js.map +1 -1
- package/lib/runtime/terminal-probe.d.ts +36 -0
- package/lib/runtime/terminal-probe.js +37 -0
- package/lib/runtime/terminal-probe.js.map +1 -0
- package/lib/runtime/terminal-session.d.ts +57 -0
- package/lib/runtime/terminal-session.js +164 -0
- package/lib/runtime/terminal-session.js.map +1 -0
- package/lib/runtime/terminal-state.d.ts +29 -0
- package/lib/runtime/terminal-state.js +62 -0
- package/lib/runtime/terminal-state.js.map +1 -0
- package/lib/runtime/tool-presentation.js +50 -14
- package/lib/runtime/tool-presentation.js.map +1 -1
- package/lib/session/external-agents.d.ts +5 -0
- package/lib/session/external-agents.js +27 -0
- package/lib/session/external-agents.js.map +1 -0
- package/lib/session/feature-toggles.d.ts +1 -1
- package/lib/session/feature-toggles.js +1 -1
- package/lib/session/interaction-adapter.d.ts +1 -6
- package/lib/session/interaction-adapter.js +95 -18
- package/lib/session/interaction-adapter.js.map +1 -1
- package/lib/session/message-queue.js +1 -1
- package/lib/session/message-queue.js.map +1 -1
- package/lib/session/model-readiness.d.ts +16 -0
- package/lib/session/model-readiness.js +43 -0
- package/lib/session/model-readiness.js.map +1 -0
- package/lib/session/package-metadata.d.ts +8 -0
- package/lib/session/package-metadata.js +8 -0
- package/lib/session/package-metadata.js.map +1 -1
- package/lib/session/project-context.d.ts +5 -0
- package/lib/session/project-context.js +36 -0
- package/lib/session/project-context.js.map +1 -1
- package/lib/session/session-controller.d.ts +10 -13
- package/lib/session/session-controller.js +183 -98
- package/lib/session/session-controller.js.map +1 -1
- package/lib/session/session-library.js +2 -0
- package/lib/session/session-library.js.map +1 -1
- package/lib/session/session-tree.d.ts +3 -0
- package/lib/session/session-tree.js +3 -1
- package/lib/session/session-tree.js.map +1 -1
- package/lib/session/subagent-roster.d.ts +2 -1
- package/lib/session/subagent-roster.js +24 -3
- package/lib/session/subagent-roster.js.map +1 -1
- package/lib/session/subagent-tracker.d.ts +6 -2
- package/lib/session/subagent-tracker.js +49 -2
- package/lib/session/subagent-tracker.js.map +1 -1
- package/lib/session/tui-settings.d.ts +47 -13
- package/lib/session/tui-settings.js +76 -34
- package/lib/session/tui-settings.js.map +1 -1
- package/lib/session/working-directory.d.ts +4 -0
- package/lib/session/working-directory.js +4 -0
- package/lib/session/working-directory.js.map +1 -0
- package/lib/session/worktrees.d.ts +13 -0
- package/lib/session/worktrees.js +49 -0
- package/lib/session/worktrees.js.map +1 -0
- package/lib/views/approval-rule.d.ts +3 -0
- package/lib/views/approval-rule.js +4 -0
- package/lib/views/approval-rule.js.map +1 -0
- package/lib/views/at-complete.d.ts +8 -0
- package/lib/views/at-complete.js +64 -2
- package/lib/views/at-complete.js.map +1 -1
- package/lib/views/autocomplete.d.ts +22 -2
- package/lib/views/autocomplete.js +70 -40
- package/lib/views/autocomplete.js.map +1 -1
- package/lib/views/copy-targets.d.ts +13 -14
- package/lib/views/copy-targets.js +42 -54
- package/lib/views/copy-targets.js.map +1 -1
- package/lib/views/document-reader.js +18 -5
- package/lib/views/document-reader.js.map +1 -1
- package/lib/views/event-views.d.ts +1 -1
- package/lib/views/event-views.js +60 -6
- package/lib/views/event-views.js.map +1 -1
- package/lib/views/file-actions.d.ts +12 -0
- package/lib/views/file-actions.js +72 -0
- package/lib/views/file-actions.js.map +1 -0
- package/lib/views/history-search.js +15 -21
- package/lib/views/history-search.js.map +1 -1
- package/lib/views/hotkeys.d.ts +8 -1
- package/lib/views/hotkeys.js +53 -26
- package/lib/views/hotkeys.js.map +1 -1
- package/lib/views/list-navigation.d.ts +62 -0
- package/lib/views/list-navigation.js +73 -0
- package/lib/views/list-navigation.js.map +1 -0
- package/lib/views/list-view.d.ts +99 -0
- package/lib/views/list-view.js +165 -0
- package/lib/views/list-view.js.map +1 -0
- package/lib/views/prompt-selector.d.ts +34 -4
- package/lib/views/prompt-selector.js +270 -134
- package/lib/views/prompt-selector.js.map +1 -1
- package/lib/views/session-files.d.ts +1 -2
- package/lib/views/session-files.js +1 -11
- package/lib/views/session-files.js.map +1 -1
- package/lib/views/settings-list.d.ts +51 -10
- package/lib/views/settings-list.js +267 -315
- package/lib/views/settings-list.js.map +1 -1
- package/lib/views/trajectory-timeline.d.ts +72 -0
- package/lib/views/trajectory-timeline.js +133 -0
- package/lib/views/trajectory-timeline.js.map +1 -0
- package/lib/views/trajectory.d.ts +15 -4
- package/lib/views/trajectory.js +557 -123
- package/lib/views/trajectory.js.map +1 -1
- package/lib/views/transcript-export.js +9 -0
- package/lib/views/transcript-export.js.map +1 -1
- package/lib/views/transcript-render.d.ts +97 -25
- package/lib/views/transcript-render.js +542 -170
- package/lib/views/transcript-render.js.map +1 -1
- package/lib/views/transcript-search.d.ts +39 -6
- package/lib/views/transcript-search.js +46 -11
- package/lib/views/transcript-search.js.map +1 -1
- package/lib/views/transcript-types.d.ts +63 -5
- package/lib/views/transcript-types.js +23 -11
- package/lib/views/transcript-types.js.map +1 -1
- package/package.json +95 -65
- package/lib/commands/loop.d.ts +0 -52
- package/lib/commands/loop.js +0 -307
- package/lib/commands/loop.js.map +0 -1
- package/lib/commands/steer.d.ts +0 -5
- package/lib/commands/steer.js +0 -24
- package/lib/commands/steer.js.map +0 -1
- package/lib/runtime/terminal-reader.d.ts +0 -11
- package/lib/runtime/terminal-reader.js +0 -87
- package/lib/runtime/terminal-reader.js.map +0 -1
- package/lib/views/agent-hub.d.ts +0 -32
- package/lib/views/agent-hub.js +0 -206
- package/lib/views/agent-hub.js.map +0 -1
- package/lib/views/copy-selector.d.ts +0 -51
- package/lib/views/copy-selector.js +0 -139
- package/lib/views/copy-selector.js.map +0 -1
|
@@ -12,6 +12,8 @@ export class SubagentTracker {
|
|
|
12
12
|
#roster = new SubagentRoster();
|
|
13
13
|
#published;
|
|
14
14
|
#epoch = 0;
|
|
15
|
+
#externalRuns = new Map();
|
|
16
|
+
#externalActivities = new Map();
|
|
15
17
|
constructor(deps) {
|
|
16
18
|
this.#deps = deps;
|
|
17
19
|
}
|
|
@@ -27,6 +29,8 @@ export class SubagentTracker {
|
|
|
27
29
|
reset() {
|
|
28
30
|
this.#epoch += 1;
|
|
29
31
|
this.#roster.reset();
|
|
32
|
+
this.#externalRuns.clear();
|
|
33
|
+
this.#externalActivities.clear();
|
|
30
34
|
}
|
|
31
35
|
/** Remember a freshly created session when it descends from the root. */
|
|
32
36
|
noteSession(session) {
|
|
@@ -52,7 +56,20 @@ export class SubagentTracker {
|
|
|
52
56
|
}
|
|
53
57
|
/** Add the direct children a Session's durable catalog declares. */
|
|
54
58
|
observeCatalog(session, events) {
|
|
55
|
-
|
|
59
|
+
const added = this.#roster.observeCatalog(session.id, events);
|
|
60
|
+
for (const event of events) {
|
|
61
|
+
if (event.type !== 'subagent/catalog')
|
|
62
|
+
continue;
|
|
63
|
+
const external = this.#externalRuns.get(event.data.childId);
|
|
64
|
+
if (external !== undefined)
|
|
65
|
+
this.noteExternalRun(external);
|
|
66
|
+
const activities = this.#externalActivities.get(event.data.childId);
|
|
67
|
+
if (activities !== undefined) {
|
|
68
|
+
for (const activity of activities)
|
|
69
|
+
this.#roster.noteExternalActivity(event.data.childId, activity);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
if (added)
|
|
56
73
|
this.#publish();
|
|
57
74
|
}
|
|
58
75
|
/** Apply a live agent-status change, hydrating cold children on first sight. */
|
|
@@ -75,6 +92,28 @@ export class SubagentTracker {
|
|
|
75
92
|
this.#roster.setAgentStatus(session.id, 'gone');
|
|
76
93
|
this.#publish();
|
|
77
94
|
}
|
|
95
|
+
/** External executions have lifecycle edges, but no local Agent or transcript. */
|
|
96
|
+
noteExternalRun(info) {
|
|
97
|
+
if (info.local)
|
|
98
|
+
return;
|
|
99
|
+
this.#externalRuns.set(info.id, info);
|
|
100
|
+
if (!this.#roster.owns(info.id))
|
|
101
|
+
return;
|
|
102
|
+
this.#roster.setAgentStatus(info.id, 'stopReason' in info ? 'gone' : 'running', 'stopReason' in info && info.stopReason !== 'completed' && info.stopReason !== 'aborted');
|
|
103
|
+
this.#publish();
|
|
104
|
+
}
|
|
105
|
+
/** Fold live external inspection activity into its roster row. */
|
|
106
|
+
noteExternalActivity(id, activity) {
|
|
107
|
+
const list = this.#externalActivities.get(id) ?? [];
|
|
108
|
+
list.push(activity);
|
|
109
|
+
if (list.length > 8)
|
|
110
|
+
list.shift();
|
|
111
|
+
this.#externalActivities.set(id, list);
|
|
112
|
+
if (!this.#roster.owns(id))
|
|
113
|
+
return;
|
|
114
|
+
this.#roster.noteExternalActivity(id, activity);
|
|
115
|
+
this.#publish();
|
|
116
|
+
}
|
|
78
117
|
/**
|
|
79
118
|
* Rebuild the roster around the active root: live sessions hydrate from
|
|
80
119
|
* their own events, then the durable catalog lists children that are not
|
|
@@ -110,8 +149,16 @@ export class SubagentTracker {
|
|
|
110
149
|
// A listing may declare that it does not know the child's mode.
|
|
111
150
|
...(entry.mode === 'unknown' ? {} : { mode: entry.mode }),
|
|
112
151
|
...(entry.label === undefined ? {} : { label: entry.label }),
|
|
113
|
-
phase: this.#deps.agentStatus(entry.id) === 'running' ? 'running' : 'waiting',
|
|
152
|
+
phase: this.#deps.agentStatus(entry.id) === 'running' ? 'running' : entry.mode === 'external' ? 'completed' : 'waiting',
|
|
114
153
|
});
|
|
154
|
+
const external = this.#externalRuns.get(entry.id);
|
|
155
|
+
if (entry.mode === 'external' && external !== undefined)
|
|
156
|
+
this.noteExternalRun(external);
|
|
157
|
+
const activities = this.#externalActivities.get(entry.id);
|
|
158
|
+
if (entry.mode === 'external' && activities !== undefined) {
|
|
159
|
+
for (const activity of activities)
|
|
160
|
+
this.#roster.noteExternalActivity(entry.id, activity);
|
|
161
|
+
}
|
|
115
162
|
}
|
|
116
163
|
this.#publish();
|
|
117
164
|
}, () => undefined);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"subagent-tracker.js","sourceRoot":"","sources":["../../src/session/subagent-tracker.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAKH,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAiBrD,MAAM,OAAO,eAAe;IACjB,KAAK,CAAqB;IAC1B,OAAO,GAAG,IAAI,cAAc,EAAE,CAAA;IACvC,UAAU,CAA+B;IACzC,MAAM,GAAG,CAAC,CAAA;
|
|
1
|
+
{"version":3,"file":"subagent-tracker.js","sourceRoot":"","sources":["../../src/session/subagent-tracker.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAKH,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAiBrD,MAAM,OAAO,eAAe;IACjB,KAAK,CAAqB;IAC1B,OAAO,GAAG,IAAI,cAAc,EAAE,CAAA;IACvC,UAAU,CAA+B;IACzC,MAAM,GAAG,CAAC,CAAA;IACD,aAAa,GAAG,IAAI,GAAG,EAAgD,CAAA;IACvE,mBAAmB,GAAG,IAAI,GAAG,EAAiC,CAAA;IAEvE,YAAY,IAAyB;QACnC,IAAI,CAAC,KAAK,GAAG,IAAI,CAAA;IACnB,CAAC;IAED,yDAAyD;IACzD,IAAI,CAAC,EAAU;QACb,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,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CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,CAAA;gBACzD,IAAI,KAAK,CAAC,IAAI,KAAK,UAAU,IAAI,UAAU,KAAK,SAAS,EAAE,CAAC;oBAC1D,KAAK,MAAM,QAAQ,IAAI,UAAU;wBAAE,IAAI,CAAC,OAAO,CAAC,oBAAoB,CAAC,KAAK,CAAC,EAAE,EAAE,QAAQ,CAAC,CAAA;gBAC1F,CAAC;YACH,CAAC;YACD,IAAI,CAAC,QAAQ,EAAE,CAAA;QACjB,CAAC,EAAE,GAAG,EAAE,CAAC,SAAS,CAAC,CAAA;IACrB,CAAC;IAED,8EAA8E;IAC9E,QAAQ;QACN,MAAM,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAA;QACtC,IAAI,MAAM,KAAK,IAAI,CAAC,UAAU;YAAE,OAAM;QACtC,IAAI,CAAC,UAAU,GAAG,MAAM,CAAA;QACxB,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,CAAA;IAC5B,CAAC;CACF"}
|
|
@@ -11,9 +11,38 @@ import { type StatusBarConfig, type StatusPreset } from '../chrome/status-config
|
|
|
11
11
|
import { type ThemeName } from '../chrome/theme.ts';
|
|
12
12
|
import { type MathMode } from '../chrome/math.ts';
|
|
13
13
|
import { type MermaidMode } from '../chrome/mermaid.ts';
|
|
14
|
+
import { type TerminalTitleMode, type TerminalStateMode } from '../runtime/terminal-state.ts';
|
|
14
15
|
/** Available terminal animation policies. */
|
|
15
16
|
export declare const MOTION_MODES: readonly ["full", "reduced", "off"];
|
|
16
17
|
export type MotionMode = typeof MOTION_MODES[number];
|
|
18
|
+
/**
|
|
19
|
+
* Notification detail level. Both non-`off` modes report finished turns and
|
|
20
|
+
* pending input; they differ only in whether the terminal's own focus report
|
|
21
|
+
* suppresses a notification while the reader is still watching.
|
|
22
|
+
*/
|
|
23
|
+
export declare const NOTIFICATION_MODES: readonly ["off", "unfocused", "always"];
|
|
24
|
+
export type NotificationMode = typeof NOTIFICATION_MODES[number];
|
|
25
|
+
/** Values a document may still carry; `long-running` predates the two-mode split. */
|
|
26
|
+
export declare const STORED_NOTIFICATION_MODES: readonly ["off", "long-running", "unfocused", "always"];
|
|
27
|
+
export type StoredNotificationMode = typeof STORED_NOTIFICATION_MODES[number];
|
|
28
|
+
/**
|
|
29
|
+
* A turn shorter than this never notifies. The duration is fixed rather than
|
|
30
|
+
* configurable: it only decides whether an arriving notification is noise, and
|
|
31
|
+
* a settings row was asking the reader to predict a boundary the product
|
|
32
|
+
* already knew.
|
|
33
|
+
*/
|
|
34
|
+
export declare const NOTIFICATION_THRESHOLD_MS = 30000;
|
|
35
|
+
/** Threshold values a pre-merge document could carry. */
|
|
36
|
+
export declare const LEGACY_NOTIFICATION_THRESHOLDS: readonly ["15s", "30s", "1m", "2m"];
|
|
37
|
+
export type LegacyNotificationThreshold = typeof LEGACY_NOTIFICATION_THRESHOLDS[number];
|
|
38
|
+
/** Milliseconds a legacy threshold value named. */
|
|
39
|
+
export declare function legacyThresholdMs(value: LegacyNotificationThreshold): number;
|
|
40
|
+
/**
|
|
41
|
+
* Fold a stored notification document onto one mode. A document still carrying
|
|
42
|
+
* the retired long-running policy becomes `unfocused`: that is the mode that
|
|
43
|
+
* notifies after the reader has left, which is what the policy meant.
|
|
44
|
+
*/
|
|
45
|
+
export declare function resolveNotificationMode(notifications: string | undefined, focus: 'always' | 'unfocused' | undefined): NotificationMode;
|
|
17
46
|
/**
|
|
18
47
|
* Profile entry id owning these preferences. A form edit is addressed to the
|
|
19
48
|
* entry, so this is the id of the `@agi-fans/dsh-tui` row in the composition,
|
|
@@ -27,8 +56,10 @@ export interface TuiSettings {
|
|
|
27
56
|
motion: Volatile<MotionMode>;
|
|
28
57
|
mathMode: Volatile<MathMode>;
|
|
29
58
|
mermaidMode: Volatile<MermaidMode>;
|
|
59
|
+
hideThinking: Volatile<boolean>;
|
|
30
60
|
editor: Volatile<EditorId>;
|
|
31
|
-
|
|
61
|
+
terminalTitle: Volatile<TerminalTitleMode>;
|
|
62
|
+
terminalState: Volatile<TerminalStateMode>;
|
|
32
63
|
pasteProtection: Volatile<boolean>;
|
|
33
64
|
copyOnSelect: Volatile<boolean>;
|
|
34
65
|
mouseInteraction: Volatile<'auto' | 'tui' | 'native'>;
|
|
@@ -38,10 +69,11 @@ export interface TuiSettings {
|
|
|
38
69
|
expandTools: Volatile<boolean>;
|
|
39
70
|
checkUpdates: Volatile<boolean>;
|
|
40
71
|
startupChangelog: Volatile<StartupChangelogMode>;
|
|
41
|
-
notifications: Volatile<
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
72
|
+
notifications: Volatile<StoredNotificationMode>;
|
|
73
|
+
/** Legacy inputs; read only to resolve a document written before the merge. */
|
|
74
|
+
notificationFocus: Volatile<'always' | 'unfocused' | undefined>;
|
|
75
|
+
notificationThreshold: Volatile<LegacyNotificationThreshold | undefined>;
|
|
76
|
+
statusBar: Volatile<StatusBarConfig>;
|
|
45
77
|
/** Legacy input retained so older documents can be migrated. */
|
|
46
78
|
statusPreset: Volatile<StatusPreset | undefined>;
|
|
47
79
|
}
|
|
@@ -53,23 +85,25 @@ export interface TuiSettings {
|
|
|
53
85
|
* stay undefined unless a value was written.
|
|
54
86
|
*/
|
|
55
87
|
export declare const TUI_SETTINGS_FIELDS: {
|
|
56
|
-
readonly theme: z<"dark" | "light" | "
|
|
88
|
+
readonly theme: z<"dark" | "light" | "system", "dark" | "light" | "system", "volatile-defined">;
|
|
57
89
|
readonly colors: z<boolean, boolean, "volatile">;
|
|
58
|
-
readonly motion: z<"full" | "
|
|
90
|
+
readonly motion: z<"full" | "off" | "reduced", "full" | "off" | "reduced", "volatile-defined">;
|
|
59
91
|
readonly mathMode: z<"auto" | "source", "auto" | "source", "volatile-defined">;
|
|
60
92
|
readonly mermaidMode: z<"auto" | "source", "auto" | "source", "volatile-defined">;
|
|
93
|
+
readonly hideThinking: z<boolean, boolean, "volatile-defined">;
|
|
61
94
|
readonly editor: z<"auto" | "code" | "cursor" | "codium" | "nvim" | "vim" | "nano" | "vi", "auto" | "code" | "cursor" | "codium" | "nvim" | "vim" | "nano" | "vi", "volatile-defined">;
|
|
62
|
-
readonly
|
|
95
|
+
readonly terminalTitle: z<"session" | "workspace" | "status" | "off", "session" | "workspace" | "status" | "off", "volatile-defined">;
|
|
96
|
+
readonly terminalState: z<"on" | "auto" | "off", "on" | "auto" | "off", "volatile-defined">;
|
|
63
97
|
readonly pasteProtection: z<boolean, boolean, "volatile-defined">;
|
|
64
98
|
readonly copyOnSelect: z<boolean, boolean, "volatile-defined">;
|
|
65
|
-
readonly mouseInteraction: z<"
|
|
99
|
+
readonly mouseInteraction: z<"tui" | "auto" | "native", "tui" | "auto" | "native", "volatile-defined">;
|
|
66
100
|
readonly foldDensity: z<"standard" | "compact" | "detailed" | "verbose", "standard" | "compact" | "detailed" | "verbose", "volatile-defined">;
|
|
67
101
|
readonly expandTools: z<boolean, boolean, "volatile-defined">;
|
|
68
102
|
readonly checkUpdates: z<boolean, boolean, "volatile-defined">;
|
|
69
|
-
readonly startupChangelog: z<"summary" | "
|
|
70
|
-
readonly notifications: z<"off" | "
|
|
71
|
-
readonly notificationFocus: z<"
|
|
72
|
-
readonly notificationThreshold: z<"15s" | "30s" | "1m" | "2m", "15s" | "30s" | "1m" | "2m", "volatile
|
|
103
|
+
readonly startupChangelog: z<"summary" | "hidden" | "expanded", "summary" | "hidden" | "expanded", "volatile-defined">;
|
|
104
|
+
readonly notifications: z<"off" | "unfocused" | "always" | "long-running", "off" | "unfocused" | "always" | "long-running", "volatile-defined">;
|
|
105
|
+
readonly notificationFocus: z<"unfocused" | "always", "unfocused" | "always", "volatile">;
|
|
106
|
+
readonly notificationThreshold: z<"15s" | "30s" | "1m" | "2m", "15s" | "30s" | "1m" | "2m", "volatile">;
|
|
73
107
|
readonly statusBar: z<any, any, "volatile" | "volatile-defined">;
|
|
74
108
|
readonly statusPreset: z<"minimal" | "compact" | "full", "minimal" | "compact" | "full", "volatile">;
|
|
75
109
|
};
|
|
@@ -6,12 +6,48 @@ import { EDITOR_IDS } from "../input/editor-discovery.js";
|
|
|
6
6
|
import z from '@deepseek-ai/schemastery';
|
|
7
7
|
import { STARTUP_CHANGELOG_MODES } from "./release-notes.js";
|
|
8
8
|
import { FOLD_DENSITIES, DEFAULT_FOLD_DENSITY } from "./fold-policy.js";
|
|
9
|
-
import {
|
|
9
|
+
import { STATUS_DENSITIES, STATUS_ITEM_IDS, STATUS_PRESETS, } from "../chrome/status-config.js";
|
|
10
10
|
import { THEME_NAMES } from "../chrome/theme.js";
|
|
11
11
|
import { MATH_MODES } from "../chrome/math.js";
|
|
12
12
|
import { MERMAID_MODES } from "../chrome/mermaid.js";
|
|
13
|
+
import { TERMINAL_TITLE_MODES, TERMINAL_STATE_MODES } from "../runtime/terminal-state.js";
|
|
13
14
|
/** Available terminal animation policies. */
|
|
14
15
|
export const MOTION_MODES = ['full', 'reduced', 'off'];
|
|
16
|
+
/**
|
|
17
|
+
* Notification detail level. Both non-`off` modes report finished turns and
|
|
18
|
+
* pending input; they differ only in whether the terminal's own focus report
|
|
19
|
+
* suppresses a notification while the reader is still watching.
|
|
20
|
+
*/
|
|
21
|
+
export const NOTIFICATION_MODES = ['off', 'unfocused', 'always'];
|
|
22
|
+
/** Values a document may still carry; `long-running` predates the two-mode split. */
|
|
23
|
+
export const STORED_NOTIFICATION_MODES = ['off', 'long-running', 'unfocused', 'always'];
|
|
24
|
+
/**
|
|
25
|
+
* A turn shorter than this never notifies. The duration is fixed rather than
|
|
26
|
+
* configurable: it only decides whether an arriving notification is noise, and
|
|
27
|
+
* a settings row was asking the reader to predict a boundary the product
|
|
28
|
+
* already knew.
|
|
29
|
+
*/
|
|
30
|
+
export const NOTIFICATION_THRESHOLD_MS = 30_000;
|
|
31
|
+
/** Threshold values a pre-merge document could carry. */
|
|
32
|
+
export const LEGACY_NOTIFICATION_THRESHOLDS = ['15s', '30s', '1m', '2m'];
|
|
33
|
+
/** Milliseconds a legacy threshold value named. */
|
|
34
|
+
export function legacyThresholdMs(value) {
|
|
35
|
+
return { '15s': 15_000, '30s': 30_000, '1m': 60_000, '2m': 120_000 }[value];
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Fold a stored notification document onto one mode. A document still carrying
|
|
39
|
+
* the retired long-running policy becomes `unfocused`: that is the mode that
|
|
40
|
+
* notifies after the reader has left, which is what the policy meant.
|
|
41
|
+
*/
|
|
42
|
+
export function resolveNotificationMode(notifications, focus) {
|
|
43
|
+
if (notifications === 'always')
|
|
44
|
+
return 'always';
|
|
45
|
+
if (notifications === 'unfocused')
|
|
46
|
+
return 'unfocused';
|
|
47
|
+
if (notifications === 'long-running')
|
|
48
|
+
return focus === 'always' ? 'always' : 'unfocused';
|
|
49
|
+
return 'off';
|
|
50
|
+
}
|
|
15
51
|
/**
|
|
16
52
|
* Profile entry id owning these preferences. A form edit is addressed to the
|
|
17
53
|
* entry, so this is the id of the `@agi-fans/dsh-tui` row in the composition,
|
|
@@ -19,36 +55,40 @@ export const MOTION_MODES = ['full', 'reduced', 'off'];
|
|
|
19
55
|
*/
|
|
20
56
|
export const TUI_SETTINGS_ENTRY = 'tui';
|
|
21
57
|
/**
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
|
|
26
|
-
|
|
58
|
+
* The whole status-line document is now a density and a set of narrowings, so it
|
|
59
|
+
* is a plain object rather than a nested union: there is no longer a present or
|
|
60
|
+
* absent sub-object to distinguish from a present one with default fields.
|
|
61
|
+
*/
|
|
62
|
+
/**
|
|
63
|
+
* The status line is a density plus its narrowings.
|
|
64
|
+
*
|
|
65
|
+
* `strip` removes every field the retired layout engine wrote. A profile that
|
|
66
|
+
* still carries one is read once by the resolver — which reduces it to a density
|
|
67
|
+
* — and the next write persists only these two fields, so the engine does not
|
|
68
|
+
* live on in the reader's document.
|
|
27
69
|
*/
|
|
28
|
-
const STATUS_BAR_SCHEMA = z.
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
sides: z.object(Object.fromEntries(STATUS_ITEM_IDS.map(id => [id, z.union([...STATUS_SIDES])]))),
|
|
51
|
-
})]);
|
|
70
|
+
const STATUS_BAR_SCHEMA = z.object({
|
|
71
|
+
density: z.union([...STATUS_DENSITIES]).default('standard'),
|
|
72
|
+
hidden: z.array(z.union([...STATUS_ITEM_IDS])).default([]),
|
|
73
|
+
// Parts added beyond the density. Declared so the document survives validation:
|
|
74
|
+
// `z.object` drops keys it does not know, which would make the reader's choice
|
|
75
|
+
// look like it applied and then vanish on the next load.
|
|
76
|
+
shown: z.array(z.union([...STATUS_ITEM_IDS])).default([]),
|
|
77
|
+
// Read once by the resolver, never written. A profile that still carries the
|
|
78
|
+
// old layout keeps working and is reduced to a density on the next edit; the
|
|
79
|
+
// fields stay declared because a schema that rejected them would fail the
|
|
80
|
+
// whole settings document rather than migrate it, the same reason
|
|
81
|
+
// `foldDensity`, `expandTools` and `statusPreset` are still declared below.
|
|
82
|
+
enabled: z.any(),
|
|
83
|
+
labels: z.any(),
|
|
84
|
+
contextStyle: z.any(),
|
|
85
|
+
groups: z.any(),
|
|
86
|
+
order: z.any(),
|
|
87
|
+
meta: z.any(),
|
|
88
|
+
metaOrder: z.any(),
|
|
89
|
+
colors: z.any(),
|
|
90
|
+
sides: z.any(),
|
|
91
|
+
});
|
|
52
92
|
/**
|
|
53
93
|
* Schema: palette, SGR, and status-line detail, plus legacy transcript inputs. Every field is
|
|
54
94
|
* volatile, so a settings edit commits into these references and the provider
|
|
@@ -62,8 +102,10 @@ export const TUI_SETTINGS_FIELDS = {
|
|
|
62
102
|
motion: z.union([...MOTION_MODES]).default('full').volatile(),
|
|
63
103
|
mathMode: z.union([...MATH_MODES]).default('auto').volatile(),
|
|
64
104
|
mermaidMode: z.union([...MERMAID_MODES]).default('auto').volatile(),
|
|
105
|
+
hideThinking: z.boolean().default(false).volatile(),
|
|
65
106
|
editor: z.union([...EDITOR_IDS]).default('auto').volatile(),
|
|
66
|
-
|
|
107
|
+
terminalTitle: z.union([...TERMINAL_TITLE_MODES]).default('status').volatile(),
|
|
108
|
+
terminalState: z.union([...TERMINAL_STATE_MODES]).default('auto').volatile(),
|
|
67
109
|
pasteProtection: z.boolean().default(true).volatile(),
|
|
68
110
|
copyOnSelect: z.boolean().default(true).volatile(),
|
|
69
111
|
mouseInteraction: z.union(['auto', 'tui', 'native']).default('auto').volatile(),
|
|
@@ -71,9 +113,9 @@ export const TUI_SETTINGS_FIELDS = {
|
|
|
71
113
|
expandTools: z.boolean().default(false).volatile(),
|
|
72
114
|
checkUpdates: z.boolean().default(true).volatile(),
|
|
73
115
|
startupChangelog: z.union([...STARTUP_CHANGELOG_MODES]).default('summary').volatile(),
|
|
74
|
-
notifications: z.union([
|
|
75
|
-
notificationFocus: z.union(['always', 'unfocused']).
|
|
76
|
-
notificationThreshold: z.union([
|
|
116
|
+
notifications: z.union([...STORED_NOTIFICATION_MODES]).default('off').volatile(),
|
|
117
|
+
notificationFocus: z.union(['always', 'unfocused']).volatile(),
|
|
118
|
+
notificationThreshold: z.union([...LEGACY_NOTIFICATION_THRESHOLDS]).volatile(),
|
|
77
119
|
statusBar: STATUS_BAR_SCHEMA.volatile(),
|
|
78
120
|
statusPreset: z.union([...STATUS_PRESETS]).volatile(),
|
|
79
121
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tui-settings.js","sourceRoot":"","sources":["../../src/session/tui-settings.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,UAAU,EAAiB,MAAM,8BAA8B,CAAA;AAExE,OAAO,CAAC,MAAM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AK,CAAC,CAAC,GAAG,8BAA8B,CAAC,CAAC,CAAC,QAAQ,EAAE;IAC9E,SAAS,EAAE,iBAAiB,CAAC,QAAQ,EAAE;IACvC,YAAY,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,GAAG,cAAc,CAAC,CAAC,CAAC,QAAQ,EAAE;CAC7C,CAAA"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/** Read the Harness directory projection, retaining header-based hosts as a fallback. */
|
|
2
|
+
import type { Context } from '@deepseek-ai/cordis';
|
|
3
|
+
import type { Session } from '@deepseek-ai/dsh-session';
|
|
4
|
+
export declare function currentWorkingDirectory(ctx: Context, session: Session): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"working-directory.js","sourceRoot":"","sources":["../../src/session/working-directory.ts"],"names":[],"mappings":"AAKA,MAAM,UAAU,uBAAuB,CAAC,GAAY,EAAE,OAAgB;IACpE,OAAO,GAAG,CAAC,GAAG,CAAC,kBAAkB,CAAC,EAAE,GAAG,CAAC,OAAO,CAAC,IAAI,OAAO,CAAC,MAAM,CAAC,GAAG,IAAI,OAAO,CAAC,GAAG,EAAE,CAAA;AACzF,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/** Read Git's worktree registry through the calling Agent's execution providers. */
|
|
2
|
+
import type { Context } from '@deepseek-ai/cordis';
|
|
3
|
+
import type { Agent } from '@deepseek-ai/dsh-agent';
|
|
4
|
+
export interface GitWorktree {
|
|
5
|
+
path: string;
|
|
6
|
+
branch?: string;
|
|
7
|
+
detached?: boolean;
|
|
8
|
+
locked?: boolean;
|
|
9
|
+
prunable?: boolean;
|
|
10
|
+
}
|
|
11
|
+
/** NUL porcelain preserves spaces, newlines, Unicode and Git-quoted path characters. */
|
|
12
|
+
export declare function parseWorktrees(output: string): GitWorktree[];
|
|
13
|
+
export declare function listWorktrees(ctx: Context, agent: Agent, signal: AbortSignal): Promise<GitWorktree[]>;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { currentWorkingDirectory } from "./working-directory.js";
|
|
2
|
+
/** NUL porcelain preserves spaces, newlines, Unicode and Git-quoted path characters. */
|
|
3
|
+
export function parseWorktrees(output) {
|
|
4
|
+
const rows = [];
|
|
5
|
+
let row;
|
|
6
|
+
for (const field of output.split('\0')) {
|
|
7
|
+
if (field.startsWith('worktree ')) {
|
|
8
|
+
row = { path: field.slice(9) };
|
|
9
|
+
rows.push(row);
|
|
10
|
+
}
|
|
11
|
+
else if (row !== undefined) {
|
|
12
|
+
if (field.startsWith('branch '))
|
|
13
|
+
row.branch = field.slice(7).replace(/^refs\/heads\//u, '');
|
|
14
|
+
if (field === 'detached')
|
|
15
|
+
row.detached = true;
|
|
16
|
+
if (field === 'locked' || field.startsWith('locked '))
|
|
17
|
+
row.locked = true;
|
|
18
|
+
if (field === 'prunable' || field.startsWith('prunable '))
|
|
19
|
+
row.prunable = true;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
return rows;
|
|
23
|
+
}
|
|
24
|
+
export async function listWorktrees(ctx, agent, signal) {
|
|
25
|
+
const operation = AbortSignal.any([signal, AbortSignal.timeout(10_000)]);
|
|
26
|
+
const git = await ctx.subprocess.resolveExecutable('git', undefined, operation);
|
|
27
|
+
const argv = [git, '-c', 'core.fsmonitor=false', 'worktree', 'list', '--porcelain', '-z'];
|
|
28
|
+
const policy = ctx.sandboxPolicy.resolve({ session: agent.session });
|
|
29
|
+
const confined = policy.mode === 'danger-full-access' ? argv : (await ctx.sandbox.confine(argv, { ...policy, mode: policy.mode }, operation)).argv;
|
|
30
|
+
operation.throwIfAborted();
|
|
31
|
+
const child = ctx.subprocess.spawn({ argv: confined, cwd: currentWorkingDirectory(ctx, agent.session), signal: operation,
|
|
32
|
+
env: { GIT_DIR: undefined, GIT_WORK_TREE: undefined, GIT_COMMON_DIR: undefined, GIT_CONFIG_PARAMETERS: undefined, GIT_CONFIG_COUNT: '0', GIT_TERMINAL_PROMPT: '0' },
|
|
33
|
+
graceMs: 1000, stdio: { stdin: 'ignore', stdout: { maxBytes: 262_144 }, stderr: { maxBytes: 65_536 } } });
|
|
34
|
+
try {
|
|
35
|
+
const outcome = await child.done;
|
|
36
|
+
operation.throwIfAborted();
|
|
37
|
+
const stdout = child.collected?.stdout?.readFrom(0);
|
|
38
|
+
if (outcome.exitCode !== 0)
|
|
39
|
+
throw new Error(child.collected?.stderr?.readFrom(0).text.trim() || 'Could not list Git worktrees.');
|
|
40
|
+
if (stdout === undefined || stdout.lossy)
|
|
41
|
+
throw new Error('Git worktree listing exceeded the output limit.');
|
|
42
|
+
return parseWorktrees(stdout.text);
|
|
43
|
+
}
|
|
44
|
+
finally {
|
|
45
|
+
child.terminate();
|
|
46
|
+
await child.waitForExit();
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=worktrees.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"worktrees.js","sourceRoot":"","sources":["../../src/session/worktrees.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAA;AAUhE,wFAAwF;AACxF,MAAM,UAAU,cAAc,CAAC,MAAc;IAC3C,MAAM,IAAI,GAAkB,EAAE,CAAA;IAC9B,IAAI,GAA4B,CAAA;IAChC,KAAK,MAAM,KAAK,IAAI,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC;QACvC,IAAI,KAAK,CAAC,UAAU,CAAC,WAAW,CAAC,EAAE,CAAC;YAClC,GAAG,GAAG,EAAE,IAAI,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAA;YAC9B,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;QAChB,CAAC;aAAM,IAAI,GAAG,KAAK,SAAS,EAAE,CAAC;YAC7B,IAAI,KAAK,CAAC,UAAU,CAAC,SAAS,CAAC;gBAAE,GAAG,CAAC,MAAM,GAAG,KAAK,CAAC,KAAK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,EAAE,CAAA;IAAC,CAAC;AAC5D,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export function approvalActionDetail(action) {
|
|
2
|
+
return `Tool: ${action.tool}\nDirectory: ${action.cwd}\nWorkspace: ${action.workspace}\nAccess: ${action.sandbox}\n\nArguments:\n${JSON.stringify(JSON.parse(action.arguments), null, 2)}\n\nApproval reason:\n${action.reason || '(none)'}`;
|
|
3
|
+
}
|
|
4
|
+
//# sourceMappingURL=approval-rule.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"approval-rule.js","sourceRoot":"","sources":["../../src/views/approval-rule.ts"],"names":[],"mappings":"AAGA,MAAM,UAAU,oBAAoB,CAAC,MAAsB;IACzD,OAAO,SAAS,MAAM,CAAC,IAAI,gBAAgB,MAAM,CAAC,GAAG,gBAAgB,MAAM,CAAC,SAAS,aAAa,MAAM,CAAC,OAAO,mBAAmB,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,SAAS,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,yBAAyB,MAAM,CAAC,MAAM,IAAI,QAAQ,EAAE,CAAA;AAC9O,CAAC"}
|
|
@@ -13,6 +13,13 @@ export interface SessionMentionCandidate {
|
|
|
13
13
|
export type SessionSearcher = (query: string, signal?: AbortSignal) => Promise<readonly SessionMentionCandidate[]>;
|
|
14
14
|
/** List workspace files for the live `@` token through `ctx.fileReferences`. */
|
|
15
15
|
export type FileSearcher = (query: string, signal?: AbortSignal) => Promise<readonly FileReferenceCandidate[]>;
|
|
16
|
+
/** Git status file lists used to expand `@diff`, `@staged`, and `@git` mentions. */
|
|
17
|
+
export interface AtGitContext {
|
|
18
|
+
readonly changedFiles?: readonly string[];
|
|
19
|
+
readonly stagedFiles?: readonly string[];
|
|
20
|
+
}
|
|
21
|
+
/** True when an unquoted `@query` can match a workspace context shortcut. */
|
|
22
|
+
export declare function matchesAtShortcutQuery(query: string, quoted?: boolean): boolean;
|
|
16
23
|
/** Quoted `@"` / `@'` tokens, or path fragments, stay file-only. */
|
|
17
24
|
export declare function filesOnlyAtQuery(raw: string, quoted?: boolean): boolean;
|
|
18
25
|
/** `@` suggestions: files first, then sessions, with non-selectable headings. */
|
|
@@ -24,6 +31,7 @@ export declare function searchAtSuggestions(text: string, cursor: number, opts:
|
|
|
24
31
|
searchFiles: PathSearcher;
|
|
25
32
|
searchFileMentions?: FileSearcher;
|
|
26
33
|
searchSessions?: SessionSearcher;
|
|
34
|
+
gitContext?: AtGitContext;
|
|
27
35
|
signal?: AbortSignal;
|
|
28
36
|
}, commands?: readonly SlashCommand[]): Promise<{
|
|
29
37
|
items: AutocompleteItem[];
|
package/lib/views/at-complete.js
CHANGED
|
@@ -6,8 +6,67 @@ import { activeAtToken, formatFileMention } from '@deepseek-ai/dsh-file-referenc
|
|
|
6
6
|
import { SessionId } from '@deepseek-ai/dsh-session';
|
|
7
7
|
import { formatSessionReferenceMention } from '@deepseek-ai/dsh-session-reference';
|
|
8
8
|
import { editorLineAt, searchPathSuggestions, } from "./path-complete.js";
|
|
9
|
+
const WORKSPACE_HEADING = { value: '', label: 'Workspace context', kind: 'heading' };
|
|
9
10
|
const FILE_HEADING = { value: '', label: 'Files & folders', kind: 'heading' };
|
|
10
11
|
const SESSION_HEADING = { value: '', label: 'Session conversations', kind: 'heading' };
|
|
12
|
+
const AT_SHORTCUT_KEYWORDS = ['diff', 'changes', 'staged', 'git', 'status'];
|
|
13
|
+
/** True when an unquoted `@query` can match a workspace context shortcut. */
|
|
14
|
+
export function matchesAtShortcutQuery(query, quoted = false) {
|
|
15
|
+
if (filesOnlyAtQuery(query, quoted))
|
|
16
|
+
return false;
|
|
17
|
+
const normalized = query.trim().toLowerCase();
|
|
18
|
+
if (normalized === '')
|
|
19
|
+
return false;
|
|
20
|
+
return AT_SHORTCUT_KEYWORDS.some(keyword => keyword.startsWith(normalized));
|
|
21
|
+
}
|
|
22
|
+
function formatMentionBundle(paths) {
|
|
23
|
+
const mentions = paths
|
|
24
|
+
.slice(0, 12)
|
|
25
|
+
.map(path => formatFileMention({ path, kind: 'file' }, false))
|
|
26
|
+
.filter((value) => value !== undefined);
|
|
27
|
+
return mentions.length > 0 ? mentions.join(' ') : undefined;
|
|
28
|
+
}
|
|
29
|
+
function gitContextItems(query, quoted, gitContext) {
|
|
30
|
+
if (gitContext === undefined || !matchesAtShortcutQuery(query, quoted))
|
|
31
|
+
return [];
|
|
32
|
+
const normalized = query.trim().toLowerCase();
|
|
33
|
+
const changed = gitContext.changedFiles ?? [];
|
|
34
|
+
const staged = gitContext.stagedFiles ?? [];
|
|
35
|
+
const changedBundle = formatMentionBundle(changed);
|
|
36
|
+
const stagedBundle = formatMentionBundle(staged);
|
|
37
|
+
const items = [];
|
|
38
|
+
if ('diff'.startsWith(normalized) || 'changes'.startsWith(normalized)) {
|
|
39
|
+
items.push({
|
|
40
|
+
value: changedBundle ?? '`git diff HEAD`',
|
|
41
|
+
label: '@diff',
|
|
42
|
+
description: changed.length > 0
|
|
43
|
+
? `Mention ${changed.length} changed workspace file${changed.length === 1 ? '' : 's'}`
|
|
44
|
+
: 'Reference working tree git diff',
|
|
45
|
+
kind: 'path',
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
if ('staged'.startsWith(normalized)) {
|
|
49
|
+
items.push({
|
|
50
|
+
value: stagedBundle ?? '`git diff --staged`',
|
|
51
|
+
label: '@staged',
|
|
52
|
+
description: staged.length > 0
|
|
53
|
+
? `Mention ${staged.length} staged file${staged.length === 1 ? '' : 's'}`
|
|
54
|
+
: 'Reference staged git diff',
|
|
55
|
+
kind: 'path',
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
if ('git'.startsWith(normalized) || 'status'.startsWith(normalized)) {
|
|
59
|
+
items.push({
|
|
60
|
+
value: changedBundle ?? '`git status --short`',
|
|
61
|
+
label: '@git',
|
|
62
|
+
description: changed.length > 0
|
|
63
|
+
? `Mention ${changed.length} modified/untracked file${changed.length === 1 ? '' : 's'}`
|
|
64
|
+
: 'Reference git workspace status',
|
|
65
|
+
kind: 'path',
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
return items;
|
|
69
|
+
}
|
|
11
70
|
/** Quoted `@"` / `@'` tokens, or path fragments, stay file-only. */
|
|
12
71
|
export function filesOnlyAtQuery(raw, quoted = false) {
|
|
13
72
|
return quoted || raw.startsWith('"') || raw.startsWith("'") || raw.includes('/');
|
|
@@ -42,8 +101,10 @@ function sessionItems(candidates) {
|
|
|
42
101
|
kind: 'session',
|
|
43
102
|
}));
|
|
44
103
|
}
|
|
45
|
-
function mergeAtItems(files, sessions) {
|
|
104
|
+
function mergeAtItems(shortcuts, files, sessions) {
|
|
46
105
|
const items = [];
|
|
106
|
+
if (shortcuts.length > 0)
|
|
107
|
+
items.push(WORKSPACE_HEADING, ...shortcuts);
|
|
47
108
|
if (files.length > 0)
|
|
48
109
|
items.push(FILE_HEADING, ...files);
|
|
49
110
|
if (sessions.length > 0)
|
|
@@ -59,6 +120,7 @@ export async function searchAtSuggestions(text, cursor, opts, commands = []) {
|
|
|
59
120
|
const at = activeAtToken(line, col);
|
|
60
121
|
if (at === undefined)
|
|
61
122
|
return searchPathSuggestions(text, cursor, opts, commands);
|
|
123
|
+
const shortcuts = gitContextItems(at.query, at.quoted, opts.gitContext);
|
|
62
124
|
let files = [];
|
|
63
125
|
if (opts.searchFileMentions !== undefined) {
|
|
64
126
|
try {
|
|
@@ -84,7 +146,7 @@ export async function searchAtSuggestions(text, cursor, opts, commands = []) {
|
|
|
84
146
|
sessions = [];
|
|
85
147
|
}
|
|
86
148
|
}
|
|
87
|
-
const items = mergeAtItems(files, sessions);
|
|
149
|
+
const items = mergeAtItems(shortcuts, files, sessions);
|
|
88
150
|
if (items.length === 0)
|
|
89
151
|
return null;
|
|
90
152
|
return { items, prefix: at.prefix };
|