@deepseek-harness-tui/dsh-tui 0.17.0 → 0.18.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/README.md +10 -8
- package/cli/adapters/dsh/index.mjs +2 -2
- package/guide/dsh-tui-guide/cli.en.md +1 -1
- package/guide/dsh-tui-guide/cli.md +1 -1
- package/guide/dsh-tui-guide/configuration.en.md +3 -2
- package/guide/dsh-tui-guide/configuration.md +3 -2
- package/guide/dsh-tui-guide/getting-started.en.md +6 -2
- package/guide/dsh-tui-guide/getting-started.md +4 -1
- package/guide/dsh-tui-guide/interaction.en.md +28 -7
- package/guide/dsh-tui-guide/interaction.md +17 -5
- package/guide/dsh-tui-guide/plugins.en.md +28 -7
- package/guide/dsh-tui-guide/plugins.md +18 -5
- package/guide/dsh-tui-guide/user-guide.en.md +29 -15
- package/guide/dsh-tui-guide/user-guide.md +20 -10
- package/lib/settings.json +3 -3
- package/lib/types/adapter/channel/ui-policy.d.ts +1 -0
- package/lib/types/adapter/channel/ui-policy.d.ts.map +1 -1
- package/lib/types/adapter/channel/ui-policy.js +1 -0
- package/lib/types/adapter/ports/channel-ui.d.ts +5 -0
- package/lib/types/adapter/ports/channel-ui.d.ts.map +1 -1
- package/lib/types/adapter/ports/channel-view.d.ts +3 -0
- package/lib/types/adapter/ports/channel-view.d.ts.map +1 -1
- package/lib/types/adapter/standard/grants.d.ts +60 -0
- package/lib/types/adapter/standard/grants.d.ts.map +1 -1
- package/lib/types/adapter/standard/grants.js +74 -0
- package/lib/types/agent/events.d.ts +7 -1
- package/lib/types/agent/events.d.ts.map +1 -1
- package/lib/types/commands.js +1 -1
- package/lib/types/components/GoalTodoPanel.d.ts +71 -6
- package/lib/types/components/GoalTodoPanel.d.ts.map +1 -1
- package/lib/types/components/GoalTodoPanel.js +165 -17
- package/lib/types/components/MessageList.d.ts.map +1 -1
- package/lib/types/components/MessageList.js +3 -2
- package/lib/types/components/PluginGrantList.d.ts +45 -0
- package/lib/types/components/PluginGrantList.d.ts.map +1 -0
- package/lib/types/components/PluginGrantList.js +126 -0
- package/lib/types/components/PluginInstallPane.d.ts.map +1 -1
- package/lib/types/components/PluginInstallPane.js +35 -6
- package/lib/types/components/PluginManagePane.d.ts.map +1 -1
- package/lib/types/components/PluginManagePane.js +65 -8
- package/lib/types/components/PromptInput.js +2 -2
- package/lib/types/components/SubagentDashboard.d.ts.map +1 -1
- package/lib/types/components/SubagentDashboard.js +10 -0
- package/lib/types/components/SubagentDetailScene.d.ts.map +1 -1
- package/lib/types/components/SubagentDetailScene.js +12 -0
- package/lib/types/components/messages/AssistantToolUseMessage.d.ts +2 -1
- package/lib/types/components/messages/AssistantToolUseMessage.d.ts.map +1 -1
- package/lib/types/components/messages/AssistantToolUseMessage.js +11 -5
- package/lib/types/components/onboardingModel.d.ts +2 -2
- package/lib/types/components/onboardingModel.js +3 -3
- package/lib/types/components/onboardingProviderPlan.d.ts +110 -0
- package/lib/types/components/onboardingProviderPlan.d.ts.map +1 -0
- package/lib/types/components/onboardingProviderPlan.js +78 -0
- package/lib/types/components/sidePanel/btw/BtwComposer.d.ts +7 -0
- package/lib/types/components/sidePanel/btw/BtwComposer.d.ts.map +1 -1
- package/lib/types/components/sidePanel/btw/BtwComposer.js +16 -0
- package/lib/types/components/sidePanel/btw/BtwPanelAdapter.d.ts.map +1 -1
- package/lib/types/components/sidePanel/btw/BtwPanelAdapter.js +8 -1
- package/lib/types/components/sidePanel/btw/BtwThreadScene.d.ts +7 -1
- package/lib/types/components/sidePanel/btw/BtwThreadScene.d.ts.map +1 -1
- package/lib/types/components/sidePanel/btw/BtwThreadScene.js +8 -1
- package/lib/types/components/sidePanel/btw/useBtwComposerPaste.d.ts +30 -0
- package/lib/types/components/sidePanel/btw/useBtwComposerPaste.d.ts.map +1 -0
- package/lib/types/components/sidePanel/btw/useBtwComposerPaste.js +94 -0
- package/lib/types/components/sidePanel/builtinPanels.d.ts.map +1 -1
- package/lib/types/components/sidePanel/builtinPanels.js +14 -2
- package/lib/types/components/sidePanel/types.d.ts +2 -0
- package/lib/types/components/sidePanel/types.d.ts.map +1 -1
- package/lib/types/components/sidePanel/useSidePanel.d.ts.map +1 -1
- package/lib/types/components/sidePanel/useSidePanel.js +15 -1
- package/lib/types/dsh-adapter/backend/session.d.ts +7 -1
- package/lib/types/dsh-adapter/backend/session.d.ts.map +1 -1
- package/lib/types/dsh-adapter/backend/session.js +62 -6
- package/lib/types/dsh-adapter/backend/translate.d.ts.map +1 -1
- package/lib/types/dsh-adapter/backend/translate.js +9 -5
- package/lib/types/dsh-adapter/channel/agent-view-projection.d.ts +1 -1
- package/lib/types/dsh-adapter/channel/agent-view-projection.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/agent-view-projection.js +3 -1
- package/lib/types/dsh-adapter/channel/composer-images.d.ts +2 -0
- package/lib/types/dsh-adapter/channel/composer-images.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/composer-images.js +10 -2
- package/lib/types/dsh-adapter/channel/composer-mentions.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/composer-mentions.js +22 -7
- package/lib/types/dsh-adapter/channel/context-bookkeeping.d.ts +1 -1
- package/lib/types/dsh-adapter/channel/context-bookkeeping.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/context-bookkeeping.js +9 -5
- package/lib/types/dsh-adapter/channel/core/binding-feed.d.ts +6 -0
- package/lib/types/dsh-adapter/channel/core/binding-feed.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/core/binding-feed.js +35 -1
- package/lib/types/dsh-adapter/channel/core/compose.d.ts +1 -1
- package/lib/types/dsh-adapter/channel/core/compose.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/core/compose.js +5 -0
- package/lib/types/dsh-adapter/channel/input-actions.d.ts +2 -2
- package/lib/types/dsh-adapter/channel/input-actions.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/input-actions.js +30 -0
- package/lib/types/dsh-adapter/channel/input-delivery.d.ts +1 -1
- package/lib/types/dsh-adapter/channel/input-delivery.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/input-delivery.js +8 -4
- package/lib/types/dsh-adapter/channel/mentions.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/mentions.js +21 -7
- package/lib/types/dsh-adapter/channel/paths.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/paths.js +11 -9
- package/lib/types/dsh-adapter/channel/session-live-adoption.d.ts +1 -1
- package/lib/types/dsh-adapter/channel/session-live-adoption.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/session-live-adoption.js +6 -1
- package/lib/types/dsh-adapter/channel/session-reset.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/session-reset.js +3 -1
- package/lib/types/dsh-adapter/channel/session-resume.d.ts +1 -1
- package/lib/types/dsh-adapter/channel/session-resume.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/session-resume.js +10 -3
- package/lib/types/dsh-adapter/channel/session-rewind.d.ts +1 -1
- package/lib/types/dsh-adapter/channel/session-rewind.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/session-rewind.js +3 -1
- package/lib/types/dsh-adapter/channel/session-tree-actions.d.ts +1 -1
- package/lib/types/dsh-adapter/channel/session-tree-actions.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/session-tree-actions.js +3 -1
- package/lib/types/dsh-adapter/contract.d.ts +4 -3
- package/lib/types/dsh-adapter/contract.d.ts.map +1 -1
- package/lib/types/dsh-adapter/contract.js +6 -3
- package/lib/types/dsh-adapter/entry-slot.d.ts +6 -0
- package/lib/types/dsh-adapter/entry-slot.d.ts.map +1 -1
- package/lib/types/dsh-adapter/experimental-bundles.d.ts +3 -0
- package/lib/types/dsh-adapter/experimental-bundles.d.ts.map +1 -1
- package/lib/types/dsh-adapter/experimental-bundles.js +4 -0
- package/lib/types/dsh-adapter/grant-file.d.ts +70 -0
- package/lib/types/dsh-adapter/grant-file.d.ts.map +1 -0
- package/lib/types/dsh-adapter/grant-file.js +178 -0
- package/lib/types/dsh-adapter/host-access.d.ts +4 -0
- package/lib/types/dsh-adapter/host-access.d.ts.map +1 -1
- package/lib/types/dsh-adapter/host-access.js +54 -4
- package/lib/types/dsh-adapter/host-contract.d.ts +1 -1
- package/lib/types/dsh-adapter/host-contract.js +2 -2
- package/lib/types/dsh-adapter/host-dsh.js +3 -3
- package/lib/types/dsh-adapter/index.d.ts.map +1 -1
- package/lib/types/dsh-adapter/index.js +8 -5
- package/lib/types/dsh-adapter/panels.d.ts +7 -1
- package/lib/types/dsh-adapter/panels.d.ts.map +1 -1
- package/lib/types/dsh-adapter/plugin-declaration.d.ts +28 -0
- package/lib/types/dsh-adapter/plugin-declaration.d.ts.map +1 -1
- package/lib/types/dsh-adapter/plugin-declaration.js +43 -1
- package/lib/types/dsh-adapter/plugin-install.d.ts +28 -1
- package/lib/types/dsh-adapter/plugin-install.d.ts.map +1 -1
- package/lib/types/dsh-adapter/plugin-install.js +160 -13
- package/lib/types/dsh-adapter/plugin-manage.d.ts +53 -10
- package/lib/types/dsh-adapter/plugin-manage.d.ts.map +1 -1
- package/lib/types/dsh-adapter/plugin-manage.js +240 -51
- package/lib/types/dsh-adapter/plugin.d.ts.map +1 -1
- package/lib/types/dsh-adapter/plugin.js +64 -18
- package/lib/types/dsh-adapter/plugins-info.d.ts +6 -7
- package/lib/types/dsh-adapter/plugins-info.d.ts.map +1 -1
- package/lib/types/dsh-adapter/plugins-info.js +34 -21
- package/lib/types/dsh-adapter/presets.d.ts +6 -2
- package/lib/types/dsh-adapter/presets.d.ts.map +1 -1
- package/lib/types/dsh-adapter/presets.js +23 -5
- package/lib/types/dsh-adapter/process-exit.d.ts +1 -1
- package/lib/types/dsh-adapter/process-exit.js +1 -1
- package/lib/types/dsh-adapter/providerWizard.d.ts +2 -0
- package/lib/types/dsh-adapter/providerWizard.d.ts.map +1 -1
- package/lib/types/dsh-adapter/providerWizard.js +11 -5
- package/lib/types/dsh-adapter/row-attachment.d.ts +30 -0
- package/lib/types/dsh-adapter/row-attachment.d.ts.map +1 -0
- package/lib/types/dsh-adapter/row-attachment.js +29 -0
- package/lib/types/dsh-adapter/worktree-tool.d.ts +27 -0
- package/lib/types/dsh-adapter/worktree-tool.d.ts.map +1 -0
- package/lib/types/dsh-adapter/worktree-tool.js +87 -0
- package/lib/types/heldInputs.d.ts +36 -0
- package/lib/types/heldInputs.d.ts.map +1 -0
- package/lib/types/heldInputs.js +173 -0
- package/lib/types/i18n.d.ts +352 -25
- package/lib/types/i18n.d.ts.map +1 -1
- package/lib/types/i18n.js +171 -18
- package/lib/types/onboardingDraft.d.ts +143 -0
- package/lib/types/onboardingDraft.d.ts.map +1 -0
- package/lib/types/onboardingDraft.js +71 -0
- package/lib/types/screens/Chat.d.ts.map +1 -1
- package/lib/types/screens/Chat.js +90 -30
- package/lib/types/screens/Onboarding.d.ts +22 -3
- package/lib/types/screens/Onboarding.d.ts.map +1 -1
- package/lib/types/screens/Onboarding.js +606 -36
- package/lib/types/settings/definitions.js +2 -2
- package/lib/types/utils/paths.d.ts +15 -0
- package/lib/types/utils/paths.d.ts.map +1 -1
- package/lib/types/utils/paths.js +25 -0
- package/package.json +111 -108
- package/tui-profile/feed/README.md +1 -1
- package/tui-profile/feed/first-party.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugins-info.d.ts","sourceRoot":"","sources":["../../../src/dsh-adapter/plugins-info.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAYH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAA;AAC/D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAA;AAC5E,OAAO,EAA2C,KAAK,iBAAiB,EAAE,KAAK,mBAAmB,EAAE,MAAM,yBAAyB,CAAA;AAEnI,OAAO,EAAqC,KAAK,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AAI/F,iEAAiE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AE,MAAM,GAAG,UAAU,CAaxD;AAED,0DAA0D;AAC1D,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,eAAe,GAAG,MAAM,EAAE,CAuG9E;AA4DD;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,oBAAoB,CAClC,MAAM,EAAE;IAAE,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CAAE,GAClD,mBAAmB,CAMrB;AA+ND,sFAAsF;AACtF,wBAAsB,kBAAkB,CACtC,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,eAAe,EACrB,OAAO,EAAE,iBAAiB,GAAG,SAAS,GACrC,OAAO,CAAC,MAAM,EAAE,CAAC,CA0BnB;AAED,+EAA+E;AAC/E,wBAAsB,YAAY,CAChC,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,eAAe,EACrB,OAAO,EAAE,iBAAiB,GAAG,SAAS,GACrC,OAAO,CAAC,MAAM,EAAE,CAAC,CAEnB"}
|
|
@@ -136,11 +136,16 @@ function readLedgerRecords(file) {
|
|
|
136
136
|
}
|
|
137
137
|
return records;
|
|
138
138
|
}
|
|
139
|
-
/**
|
|
140
|
-
*
|
|
141
|
-
*
|
|
142
|
-
|
|
143
|
-
|
|
139
|
+
/**
|
|
140
|
+
* Read the three sources once. {@link pluginFootprints} and
|
|
141
|
+
* {@link pluginFootprintSourcesOf} both go through this, so the matrix, the
|
|
142
|
+
* "is anything left" check and the per-source residue report cannot disagree
|
|
143
|
+
* about what counts as a footprint.
|
|
144
|
+
*/
|
|
145
|
+
function pluginFootprintSourceSets(paths) {
|
|
146
|
+
const grants = new Set();
|
|
147
|
+
const ledger = new Set();
|
|
148
|
+
const storage = new Set();
|
|
144
149
|
try {
|
|
145
150
|
const raw = JSON.parse(readFileSync(join(paths.dataDir, 'extension-grants.json'), 'utf8'));
|
|
146
151
|
if (raw !== null && typeof raw === 'object') {
|
|
@@ -148,7 +153,7 @@ export function pluginFootprints(paths) {
|
|
|
148
153
|
for (const section of [table.grants, table.denies]) {
|
|
149
154
|
if (section !== null && typeof section === 'object') {
|
|
150
155
|
for (const plugin of Object.keys(section))
|
|
151
|
-
|
|
156
|
+
grants.add(plugin);
|
|
152
157
|
}
|
|
153
158
|
}
|
|
154
159
|
}
|
|
@@ -159,7 +164,7 @@ export function pluginFootprints(paths) {
|
|
|
159
164
|
}
|
|
160
165
|
for (const record of readLedgerRecords(paths.ledgerFile)) {
|
|
161
166
|
if (typeof record.pluginId === 'string' && record.pluginId !== '' && record.pluginId !== 'host' && record.pluginId !== 'undeclared') {
|
|
162
|
-
|
|
167
|
+
ledger.add(record.pluginId);
|
|
163
168
|
}
|
|
164
169
|
}
|
|
165
170
|
try {
|
|
@@ -168,13 +173,29 @@ export function pluginFootprints(paths) {
|
|
|
168
173
|
continue;
|
|
169
174
|
const namespace = decodeURIComponent(entry.slice(0, -'.json'.length));
|
|
170
175
|
if (namespace !== '')
|
|
171
|
-
|
|
176
|
+
storage.add(namespace);
|
|
172
177
|
}
|
|
173
178
|
}
|
|
174
179
|
catch {
|
|
175
180
|
// No storage directory yet: no rows from this source.
|
|
176
181
|
}
|
|
177
|
-
return
|
|
182
|
+
return { grants, ledger, storage };
|
|
183
|
+
}
|
|
184
|
+
/** The plugin set for the matrix: grants-file keys ∪ ledger pluginIds ∪
|
|
185
|
+
* storage namespaces ('host'/'undeclared' ledger identities are not
|
|
186
|
+
* plugins and are excluded). */
|
|
187
|
+
export function pluginFootprints(paths) {
|
|
188
|
+
const sources = pluginFootprintSourceSets(paths);
|
|
189
|
+
return [...new Set([...sources.grants, ...sources.ledger, ...sources.storage])].sort();
|
|
190
|
+
}
|
|
191
|
+
/** Which of the three sources still names one plugin id. */
|
|
192
|
+
export function pluginFootprintSourcesOf(pluginId, overrides = {}) {
|
|
193
|
+
const sources = pluginFootprintSourceSets(pluginFootprintPaths(overrides));
|
|
194
|
+
return {
|
|
195
|
+
grants: sources.grants.has(pluginId),
|
|
196
|
+
ledger: sources.ledger.has(pluginId),
|
|
197
|
+
storage: sources.storage.has(pluginId),
|
|
198
|
+
};
|
|
178
199
|
}
|
|
179
200
|
/**
|
|
180
201
|
* The three footprint sources, resolved the way the diagnostics resolve them
|
|
@@ -188,15 +209,6 @@ export function pluginFootprintPaths(overrides = {}) {
|
|
|
188
209
|
storageDir: overrides.storageDir ?? join(dataDir, PLUGIN_STORAGE_DIR),
|
|
189
210
|
};
|
|
190
211
|
}
|
|
191
|
-
/**
|
|
192
|
-
* Whether one plugin id still has a footprint in this profile: a grants-file
|
|
193
|
-
* key, an effect-ledger record, or a storage namespace. The same three sources
|
|
194
|
-
* the matrix unions — a removal that left something behind is read here rather
|
|
195
|
-
* than by a second reader that could disagree with the report (C-5).
|
|
196
|
-
*/
|
|
197
|
-
export function pluginFootprintContains(pluginId, overrides = {}) {
|
|
198
|
-
return pluginFootprints(pluginFootprintPaths(overrides)).includes(pluginId);
|
|
199
|
-
}
|
|
200
212
|
/** `/plugin check <path>`: official parse/projection + profile validation + negotiation. */
|
|
201
213
|
function checkManifestLines(pathArg, deps) {
|
|
202
214
|
const lines = [];
|
|
@@ -261,9 +273,10 @@ function checkManifestLines(pathArg, deps) {
|
|
|
261
273
|
const decision = negotiate(index, manifest, host.descriptor, granted);
|
|
262
274
|
lines.push(...decisionLines(decision));
|
|
263
275
|
if (decision.decision === 'waiting_authorization') {
|
|
264
|
-
// Close the loop on the five-state vocabulary: the user sees not just
|
|
265
|
-
//
|
|
266
|
-
//
|
|
276
|
+
// Close the loop on the five-state vocabulary: the user sees not just the
|
|
277
|
+
// state but the exact file + shape that flips it. `/plugin install` and
|
|
278
|
+
// `/plugin enable` are the interactive grant path; this hint stays for the
|
|
279
|
+
// static `check <path>` route, which may run with no live service.
|
|
267
280
|
lines.push(t('plugins-check-grant-hint', {
|
|
268
281
|
id: cell(manifest.id),
|
|
269
282
|
perms: cell(decision.deniedPermissions.join(', ')),
|
|
@@ -106,14 +106,18 @@ export declare function presetHidesHostAskTool(presetId: string | undefined): bo
|
|
|
106
106
|
* exactly one persistent shell tool, and host-layer contributors the person
|
|
107
107
|
* switched on elsewhere must not become extra ones.
|
|
108
108
|
*
|
|
109
|
-
*
|
|
109
|
+
* Three such contributors are carved out here (the last one for liangshen
|
|
110
|
+
* too, see `PERSISTENT_SHELL_PRESETS`):
|
|
110
111
|
* - the host-mounted `ask_user_question` (see `presetHidesHostAskTool`);
|
|
111
112
|
* - `@deepseek-ai/dsh-experimental-session-search`, which registers five
|
|
112
113
|
* read-only tools AND a usage-guidance section. The upstream bundle promises
|
|
113
114
|
* "every preset including minimal"; this app intentionally deviates, because
|
|
114
115
|
* Minimal's published promise is one persistent shell and a TUI process runs
|
|
115
116
|
* sessions under several presets at once — hence an assembly-boundary filter
|
|
116
|
-
* rather than a registry (or shell-whitelist) decision that would leak
|
|
117
|
+
* rather than a registry (or shell-whitelist) decision that would leak;
|
|
118
|
+
* - `@deepseek-ai/dsh-experimental-tool-worktree`'s `create_worktree` (one
|
|
119
|
+
* host-layer tool, no section), which would move the session away from the
|
|
120
|
+
* persistent shell.
|
|
117
121
|
*
|
|
118
122
|
* This is per-assembly because one TUI process can resume, create, or
|
|
119
123
|
* recompose sessions under different presets. The session log remains the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"presets.d.ts","sourceRoot":"","sources":["../../../src/dsh-adapter/presets.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAClD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AACxD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAA;AACzD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA;AACpE,OAAO,EAAsB,KAAK,UAAU,EAAE,MAAM,kBAAkB,CAAA;
|
|
1
|
+
{"version":3,"file":"pres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wBAAgB,wBAAwB,CAAC,QAAQ,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,GAAG,SAAS,GAAG,cAAc,CAU/G;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,eAAe,CAAC,CAAC,EAAE,GAAG,EAAE,OAAO,EAAE,KAAK,EAAE;IAAE,GAAG,EAAE,OAAO,CAAA;CAAE,EAAE,GAAG,EAAE,MAAM,GAAG,CAAC,GAAG,SAAS,CAKpG"}
|
|
@@ -19,6 +19,7 @@ import { recordedModelRoute } from '../modelRoute.js';
|
|
|
19
19
|
import { snapshotLiveSessionEvents } from './compat/liveSession.js';
|
|
20
20
|
import { readPersistedSession } from './compat/persistence.js';
|
|
21
21
|
import { resolveCompatiblePreset, resolveRecordedPreset, rosterOf, } from './preset-resolution.js';
|
|
22
|
+
import { WORKTREE_TOOL } from './worktree-tool.js';
|
|
22
23
|
const ASK_USER_TOOL = 'ask_user_question';
|
|
23
24
|
/**
|
|
24
25
|
* The prompt section `@deepseek-ai/dsh-experimental-session-search` contributes
|
|
@@ -49,6 +50,16 @@ const SESSION_SEARCH_TOOLS = new Set([
|
|
|
49
50
|
function isMinimalPreset(presetId) {
|
|
50
51
|
return presetId === 'minimal';
|
|
51
52
|
}
|
|
53
|
+
/**
|
|
54
|
+
* Presets whose `bash` is the official persistent shell, which starts in the
|
|
55
|
+
* directory of its first call and never follows a later move: Minimal, and
|
|
56
|
+
* the bundled liangshen preset (the same shell on POSIX; its Windows
|
|
57
|
+
* `custom-bash` does follow, but one rule for both platforms keeps this a
|
|
58
|
+
* preset decision). After a worktree switch that shell would keep editing the
|
|
59
|
+
* source checkout, so these presets are not offered `create_worktree` until the
|
|
60
|
+
* shell follows the session directory (#1738).
|
|
61
|
+
*/
|
|
62
|
+
const PERSISTENT_SHELL_PRESETS = new Set(['minimal', 'liangshen']);
|
|
52
63
|
/**
|
|
53
64
|
* Resolve the preset one new/resumed session will run under and the setup
|
|
54
65
|
* that installs it. `requested` undefined adopts the roster default.
|
|
@@ -178,14 +189,18 @@ export function presetHidesHostAskTool(presetId) {
|
|
|
178
189
|
* exactly one persistent shell tool, and host-layer contributors the person
|
|
179
190
|
* switched on elsewhere must not become extra ones.
|
|
180
191
|
*
|
|
181
|
-
*
|
|
192
|
+
* Three such contributors are carved out here (the last one for liangshen
|
|
193
|
+
* too, see `PERSISTENT_SHELL_PRESETS`):
|
|
182
194
|
* - the host-mounted `ask_user_question` (see `presetHidesHostAskTool`);
|
|
183
195
|
* - `@deepseek-ai/dsh-experimental-session-search`, which registers five
|
|
184
196
|
* read-only tools AND a usage-guidance section. The upstream bundle promises
|
|
185
197
|
* "every preset including minimal"; this app intentionally deviates, because
|
|
186
198
|
* Minimal's published promise is one persistent shell and a TUI process runs
|
|
187
199
|
* sessions under several presets at once — hence an assembly-boundary filter
|
|
188
|
-
* rather than a registry (or shell-whitelist) decision that would leak
|
|
200
|
+
* rather than a registry (or shell-whitelist) decision that would leak;
|
|
201
|
+
* - `@deepseek-ai/dsh-experimental-tool-worktree`'s `create_worktree` (one
|
|
202
|
+
* host-layer tool, no section), which would move the session away from the
|
|
203
|
+
* persistent shell.
|
|
189
204
|
*
|
|
190
205
|
* This is per-assembly because one TUI process can resume, create, or
|
|
191
206
|
* recompose sessions under different presets. The session log remains the
|
|
@@ -196,10 +211,13 @@ export function presetHidesHostAskTool(presetId) {
|
|
|
196
211
|
* @returns The original assembly when nothing is carved out, else the filtered copy.
|
|
197
212
|
*/
|
|
198
213
|
export function filterMinimalPresetTools(assembly, presetId) {
|
|
199
|
-
|
|
214
|
+
const minimal = isMinimalPreset(presetId);
|
|
215
|
+
const persistentShell = presetId !== undefined && PERSISTENT_SHELL_PRESETS.has(presetId);
|
|
216
|
+
if (!minimal && !persistentShell)
|
|
200
217
|
return assembly;
|
|
201
|
-
const tools = assembly.tools.filter(tool => tool.name
|
|
202
|
-
|
|
218
|
+
const tools = assembly.tools.filter(tool => !(persistentShell && tool.name === WORKTREE_TOOL) &&
|
|
219
|
+
!(minimal && (tool.name === ASK_USER_TOOL || SESSION_SEARCH_TOOLS.has(tool.name))));
|
|
220
|
+
const sections = minimal ? assembly.sections.filter(section => section.name !== SESSION_SEARCH_SECTION) : assembly.sections;
|
|
203
221
|
if (tools.length === assembly.tools.length && sections.length === assembly.sections.length)
|
|
204
222
|
return assembly;
|
|
205
223
|
return { ...assembly, tools, sections };
|
|
@@ -23,7 +23,7 @@ export type ExitRequestAnswer = 'exiting' | 'pending' | 'supervising' | 'refused
|
|
|
23
23
|
export interface ProcessExitSeam {
|
|
24
24
|
request?: (request: ExitRequest) => ExitRequestAnswer;
|
|
25
25
|
}
|
|
26
|
-
/** dsh `process-shutdown` PROCESS_SHUTDOWN_TIMEOUT_MS (0.2.1-rc.
|
|
26
|
+
/** dsh `process-shutdown` PROCESS_SHUTDOWN_TIMEOUT_MS (0.2.1-rc.5): the dispose bound. */
|
|
27
27
|
export declare const PROCESS_SHUTDOWN_TIMEOUT_MS = 5000;
|
|
28
28
|
/**
|
|
29
29
|
* End the process by `signal`. Only the entry's own listeners come off, so the
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* tmux and service managers); a second signal forces the exit at once.
|
|
7
7
|
*/
|
|
8
8
|
export const TERMINATION_SIGNALS = ['SIGTERM', 'SIGHUP', 'SIGINT'];
|
|
9
|
-
/** dsh `process-shutdown` PROCESS_SHUTDOWN_TIMEOUT_MS (0.2.1-rc.
|
|
9
|
+
/** dsh `process-shutdown` PROCESS_SHUTDOWN_TIMEOUT_MS (0.2.1-rc.5): the dispose bound. */
|
|
10
10
|
export const PROCESS_SHUTDOWN_TIMEOUT_MS = 5000;
|
|
11
11
|
/** Last-resort bound for a funnel exit: outlasts its terminal cleanup plus the dispose bound. */
|
|
12
12
|
const BACKSTOP_MS = PROCESS_SHUTDOWN_TIMEOUT_MS + 2000;
|
|
@@ -24,6 +24,8 @@ export interface ProviderWizardDeps {
|
|
|
24
24
|
/** Live turn state; the model-switch question is skipped while working. */
|
|
25
25
|
readonly working: () => boolean;
|
|
26
26
|
readonly switchModel: (provider: string, model: string) => Promise<boolean>;
|
|
27
|
+
/** The live model id, named on the switch question's keep option when known. */
|
|
28
|
+
readonly currentModel?: () => string | undefined;
|
|
27
29
|
}
|
|
28
30
|
export type ProviderWizardOutcome = 'added' | 'updated' | 'deleted' | 'signed-out' | 'cancelled' | 'failed';
|
|
29
31
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"providerWizard.d.ts","sourceRoot":"","sources":["../../../src/dsh-adapter/providerWizard.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAA+D,cAAc,EAA8D,MAAM,sCAAsC,CAAA;AACtN,YAAY,EAAE,iBAAiB,EAAE,wBAAwB,EAAE,kBAAkB,EAAE,aAAa,EAAE,cAAc,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAA;AAsBjM,OAAO,EAEL,KAAK,qBAAqB,EAE1B,KAAK,sBAAsB,EAC5B,MAAM,iCAAiC,CAAA;AACxC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAA;AAO1E,iFAAiF;AACjF,eAAO,MAAM,iBAAiB,QAAoC,CAAA;AAElE,2EAA2E;AAC3E,eAAO,MAAM,kBAAkB,2EAIrB,CAAA;AAEV;;;GAGG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAElD;AAED,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,IAAI,EAAE,iBAAiB,CAAA;IAChC,QAAQ,CAAC,GAAG,EAAE,CACZ,OAAO,EAAE,sBAAsB,EAC/B,OAAO,CAAC,EAAE;QAAE,MAAM,CAAC,EAAE,OAAO,CAAA;KAAE,KAC3B,OAAO,CAAC,qBAAqB,CAAC,CAAA;IACnC,QAAQ,CAAC,MAAM,EAAE,CACf,IAAI,EAAE,MAAM,EACZ,OAAO,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,OAAO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BAAqB,GACrB,gBAAgB,CAAA;AAEpB,qEAAqE;AACrE,MAAM,WAAW,cAAc;IAC7B;uEACmE;IACnE,QAAQ,CAAC,IAAI,EAAE,SAAS,kBAAkB,EAAE,CAAA;IAC5C,6EAA6E;IAC7E,QAAQ,CAAC,UAAU,EAAE,WAAW,CAAC,MAAM,CAAC,CAAA;IACxC,8DAA8D;IAC9D,QAAQ,CAAC,OAAO,EAAE,qBAAqB,CAAA;IACvC,QAAQ,CAAC,IAAI,EAAE,kBAAkB,CAAA;IACjC,QAAQ,CAAC,MAAM,CAAC,EAAE,oBAAoB,CAAA;CACvC"}
|
|
@@ -335,16 +335,22 @@ async function runAddFlow(deps) {
|
|
|
335
335
|
]);
|
|
336
336
|
notify(t('provider-success', { route }), { color: 'success' });
|
|
337
337
|
if (!deps.working() && models.length > 0) {
|
|
338
|
-
|
|
338
|
+
// Every enabled model is offered, so with several the user names the
|
|
339
|
+
// default explicitly instead of getting the first one or nothing (#1646).
|
|
340
|
+
const current = deps.currentModel?.();
|
|
339
341
|
const switchAnswer = await ask({
|
|
340
342
|
questions: [optionQuestion('switch', t('provider-q-switch'), [
|
|
341
|
-
{ label: t('provider-opt-switch-now', { model
|
|
342
|
-
{
|
|
343
|
+
...models.map(model => ({ label: t('provider-opt-switch-now', { model }) })),
|
|
344
|
+
{
|
|
345
|
+
label: t('provider-opt-switch-keep'),
|
|
346
|
+
...(current === undefined ? {} : { description: t('provider-opt-switch-keep-desc', { model: current }) }),
|
|
347
|
+
},
|
|
343
348
|
], { hideCustomInput: true })],
|
|
344
349
|
});
|
|
345
|
-
|
|
350
|
+
const picked = answerSelected(switchAnswer, 'switch')[0];
|
|
351
|
+
const target = models.find(model => picked === t('provider-opt-switch-now', { model }));
|
|
352
|
+
if (target !== undefined)
|
|
346
353
|
await deps.switchModel(route, target);
|
|
347
|
-
}
|
|
348
354
|
}
|
|
349
355
|
return 'added';
|
|
350
356
|
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { Context } from '@deepseek-ai/cordis';
|
|
2
|
+
import type { EntrySlot } from './entry-slot.js';
|
|
3
|
+
/** What the entry's runtime lends the `dsh-tui` row hand-off (#1651). */
|
|
4
|
+
export interface RowAttachmentDeps {
|
|
5
|
+
/** The composition failed or the process is leaving: no row takes over. */
|
|
6
|
+
closed(): boolean;
|
|
7
|
+
/** The screen's channel can resume a session. */
|
|
8
|
+
ready(): boolean;
|
|
9
|
+
/** Mount the row's seams (presets, ask_user, approvals, the assembly
|
|
10
|
+
* filters) on its context; they unload with it. */
|
|
11
|
+
mountSeams(rowCtx: Context): Promise<void>;
|
|
12
|
+
/** A returning row's config becomes the screen's. */
|
|
13
|
+
readConfig(rowRuntimeConfig: unknown): void;
|
|
14
|
+
/** The screen's session ended with the previous row. */
|
|
15
|
+
ended(): boolean;
|
|
16
|
+
/** Reopen the ended session; it outlives the row that triggered it. */
|
|
17
|
+
reopen(): Promise<void>;
|
|
18
|
+
/** A reattach failed: the screen keeps the ended session. */
|
|
19
|
+
failed(error: unknown): void;
|
|
20
|
+
}
|
|
21
|
+
export interface RowAttachment {
|
|
22
|
+
/** Mount a row's seams; the row counts as mounted until its context unloads. */
|
|
23
|
+
mount(rowCtx: Context): Promise<void>;
|
|
24
|
+
/** The `EntrySlot.reattachDsh` hook: undefined while a row is mounted. */
|
|
25
|
+
reattach(): EntrySlot['attachDsh'];
|
|
26
|
+
}
|
|
27
|
+
/** The row seams the entry's DSH side mounts on the first `dsh-tui` row and
|
|
28
|
+
* again on any row that applies after the previous one unloaded. */
|
|
29
|
+
export declare function createRowAttachment(deps: RowAttachmentDeps): RowAttachment;
|
|
30
|
+
//# sourceMappingURL=row-attachment.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"row-attachment.d.ts","sourceRoot":"","sources":["../../../src/dsh-adapter/row-attachment.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAClD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAEhD,yEAAyE;AACzE,MAAM,WAAW,iBAAiB;IAChC,2EAA2E;IAC3E,MAAM,IAAI,OAAO,CAAA;IACjB,iDAAiD;IACjD,KAAK,IAAI,OAAO,CAAA;IAChB;wDACoD;IACpD,UAAU,CAAC,MAAM,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAC1C,qDAAqD;IACrD,UAAU,CAAC,gBAAgB,EAAE,OAAO,GAAG,IAAI,CAAA;IAC3C,wDAAwD;IACxD,KAAK,IAAI,OAAO,CAAA;IAChB,uEAAuE;IACvE,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC,CAAA;IACvB,6DAA6D;IAC7D,MAAM,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI,CAAA;CAC7B;AAED,MAAM,WAAW,aAAa;IAC5B,gFAAgF;IAChF,KAAK,CAAC,MAAM,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IACrC,0EAA0E;IAC1E,QAAQ,IAAI,SAAS,CAAC,WAAW,CAAC,CAAA;CACnC;AAED;qEACqE;AACrE,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,iBAAiB,GAAG,aAAa,CAsB1E"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/** The row seams the entry's DSH side mounts on the first `dsh-tui` row and
|
|
2
|
+
* again on any row that applies after the previous one unloaded. */
|
|
3
|
+
export function createRowAttachment(deps) {
|
|
4
|
+
let mounted = false;
|
|
5
|
+
const mount = async (rowCtx) => {
|
|
6
|
+
mounted = true;
|
|
7
|
+
rowCtx.effect(() => () => { mounted = false; });
|
|
8
|
+
await deps.mountSeams(rowCtx);
|
|
9
|
+
};
|
|
10
|
+
const reattach = () => {
|
|
11
|
+
if (deps.closed() || mounted || !deps.ready())
|
|
12
|
+
return undefined;
|
|
13
|
+
return async (rowCtx, rowRuntimeConfig) => {
|
|
14
|
+
if (deps.closed() || mounted)
|
|
15
|
+
return;
|
|
16
|
+
try {
|
|
17
|
+
// The row may come back with a changed config: read it like the first.
|
|
18
|
+
deps.readConfig(rowRuntimeConfig);
|
|
19
|
+
await mount(rowCtx);
|
|
20
|
+
if (deps.ended())
|
|
21
|
+
await deps.reopen();
|
|
22
|
+
}
|
|
23
|
+
catch (error) {
|
|
24
|
+
deps.failed(error);
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
return { mount, reattach };
|
|
29
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { ToolCallView, ToolResultView } from './channel/types.js';
|
|
2
|
+
/** The tool name, which is also its pinned upstream call title. */
|
|
3
|
+
export declare const WORKTREE_TOOL = "create_worktree";
|
|
4
|
+
/**
|
|
5
|
+
* Put the requested branch name in a `create_worktree` call card's header.
|
|
6
|
+
*
|
|
7
|
+
* @param name - Tool name.
|
|
8
|
+
* @param view - The upstream presentation view for this call, if any.
|
|
9
|
+
* @param rawArgs - The call's JSON arguments, as persisted.
|
|
10
|
+
* @returns The upstream view untouched unless the tool, the pinned title and a
|
|
11
|
+
* non-empty string `name` all line up; else a retitled copy. A call
|
|
12
|
+
* without a name keeps the plain title until its result names the
|
|
13
|
+
* generated branch.
|
|
14
|
+
*/
|
|
15
|
+
export declare function refineWorktreeCallTitle(name: string, view: ToolCallView | undefined, rawArgs: string): ToolCallView | undefined;
|
|
16
|
+
/**
|
|
17
|
+
* Summarize a settled `create_worktree` result.
|
|
18
|
+
*
|
|
19
|
+
* @param name - Tool name.
|
|
20
|
+
* @param rawArgs - The call's JSON arguments, as persisted.
|
|
21
|
+
* @param text - The result's text payload (the tool's JSON output).
|
|
22
|
+
* @returns A generic card titled with the created branch, whose body is the
|
|
23
|
+
* checkout path (relative to the repository when inside it) and the
|
|
24
|
+
* revision it started from; undefined for any other tool or shape.
|
|
25
|
+
*/
|
|
26
|
+
export declare function worktreeResultView(name: string, rawArgs: string, text: string): ToolResultView | undefined;
|
|
27
|
+
//# sourceMappingURL=worktree-tool.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"worktree-tool.d.ts","sourceRoot":"","sources":["../../../src/dsh-adapter/worktree-tool.ts"],"names":[],"mappings":"AAqBA,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAA;AAEtE,mEAAmE;AACnE,eAAO,MAAM,aAAa,oBAAoB,CAAA;AAgB9C;;;;;;;;;;GAUG;AACH,wBAAgB,uBAAuB,CACrC,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,YAAY,GAAG,SAAS,EAC9B,OAAO,EAAE,MAAM,GACd,YAAY,GAAG,SAAS,CAK1B;AAED;;;;;;;;;GASG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,cAAc,GAAG,SAAS,CAmB1G"}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Card shape for the experimental `create_worktree` tool.
|
|
3
|
+
*
|
|
4
|
+
* `@deepseek-ai/dsh-experimental-tool-worktree@0.2.1-rc.3` titles every call
|
|
5
|
+
* with the bare tool name and ships no result presenter, so the card reads
|
|
6
|
+
* `create_worktree` over one line of JSON (`path`, `branch`, `baseCommit`,
|
|
7
|
+
* `repositoryRoot`) that a narrow terminal breaks mid-field. This adapter is
|
|
8
|
+
* the layer allowed to decide presentation (`agent/presentation.ts`), so the
|
|
9
|
+
* call header names the branch the way the session-search cards name their
|
|
10
|
+
* query (`session-tools.ts`), and a settled result becomes two lines: where
|
|
11
|
+
* the checkout is and what it started from.
|
|
12
|
+
*
|
|
13
|
+
* Self-expiring like those cards: the header is rewritten only while the
|
|
14
|
+
* upstream title is still the pinned tool name, and the result only while the
|
|
15
|
+
* tool has no presenter of its own (the caller checks), so an upstream
|
|
16
|
+
* presentation wins without editing this app.
|
|
17
|
+
*
|
|
18
|
+
* @module
|
|
19
|
+
*/
|
|
20
|
+
import { displayPath } from '../backends/shared/display-path.js';
|
|
21
|
+
import { t } from '../i18n.js';
|
|
22
|
+
/** The tool name, which is also its pinned upstream call title. */
|
|
23
|
+
export const WORKTREE_TOOL = 'create_worktree';
|
|
24
|
+
/** `Worktree("name")`: JSON-encoding keeps the one-line header printable
|
|
25
|
+
* whatever the model put in the name (`session-tools.ts`). */
|
|
26
|
+
const header = (branch) => `Worktree(${JSON.stringify(branch)})`;
|
|
27
|
+
/** The model's `{ name?, from? }` arguments, or undefined when unparseable. */
|
|
28
|
+
function argsOf(rawArgs) {
|
|
29
|
+
try {
|
|
30
|
+
const args = JSON.parse(rawArgs);
|
|
31
|
+
return typeof args === 'object' && args !== null ? args : undefined;
|
|
32
|
+
}
|
|
33
|
+
catch {
|
|
34
|
+
return undefined;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Put the requested branch name in a `create_worktree` call card's header.
|
|
39
|
+
*
|
|
40
|
+
* @param name - Tool name.
|
|
41
|
+
* @param view - The upstream presentation view for this call, if any.
|
|
42
|
+
* @param rawArgs - The call's JSON arguments, as persisted.
|
|
43
|
+
* @returns The upstream view untouched unless the tool, the pinned title and a
|
|
44
|
+
* non-empty string `name` all line up; else a retitled copy. A call
|
|
45
|
+
* without a name keeps the plain title until its result names the
|
|
46
|
+
* generated branch.
|
|
47
|
+
*/
|
|
48
|
+
export function refineWorktreeCallTitle(name, view, rawArgs) {
|
|
49
|
+
if (name !== WORKTREE_TOOL || view === undefined || view.card !== 'generic' || view.title !== WORKTREE_TOOL)
|
|
50
|
+
return view;
|
|
51
|
+
const branch = argsOf(rawArgs)?.name;
|
|
52
|
+
if (typeof branch !== 'string' || branch.trim() === '')
|
|
53
|
+
return view;
|
|
54
|
+
return { ...view, title: header(branch.trim()) };
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Summarize a settled `create_worktree` result.
|
|
58
|
+
*
|
|
59
|
+
* @param name - Tool name.
|
|
60
|
+
* @param rawArgs - The call's JSON arguments, as persisted.
|
|
61
|
+
* @param text - The result's text payload (the tool's JSON output).
|
|
62
|
+
* @returns A generic card titled with the created branch, whose body is the
|
|
63
|
+
* checkout path (relative to the repository when inside it) and the
|
|
64
|
+
* revision it started from; undefined for any other tool or shape.
|
|
65
|
+
*/
|
|
66
|
+
export function worktreeResultView(name, rawArgs, text) {
|
|
67
|
+
if (name !== WORKTREE_TOOL)
|
|
68
|
+
return undefined;
|
|
69
|
+
let value;
|
|
70
|
+
try {
|
|
71
|
+
value = JSON.parse(text);
|
|
72
|
+
}
|
|
73
|
+
catch {
|
|
74
|
+
return undefined;
|
|
75
|
+
}
|
|
76
|
+
const { path, branch, baseCommit, repositoryRoot } = (value ?? {});
|
|
77
|
+
if (typeof path !== 'string' || typeof branch !== 'string' || typeof baseCommit !== 'string' || typeof repositoryRoot !== 'string') {
|
|
78
|
+
return undefined;
|
|
79
|
+
}
|
|
80
|
+
const from = argsOf(rawArgs)?.from;
|
|
81
|
+
const lines = [
|
|
82
|
+
displayPath(path, repositoryRoot),
|
|
83
|
+
t('worktree-result-base', { from: typeof from === 'string' && from !== '' ? from : 'HEAD', commit: baseCommit.slice(0, 7) }),
|
|
84
|
+
];
|
|
85
|
+
// One block: a generic card joins its text blocks without a separator.
|
|
86
|
+
return { card: 'generic', title: header(branch), content: [{ type: 'text', text: lines.join('\n') }] };
|
|
87
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/** env marker naming the file the replacement takes its held texts from. */
|
|
2
|
+
export declare const HELD_INPUTS_ENV = "DSH_TUI_HELD_INPUTS";
|
|
3
|
+
/**
|
|
4
|
+
* Write the texts for a replacement process to take.
|
|
5
|
+
* @returns The env marker to hand the replacement, or undefined when there
|
|
6
|
+
* is nothing to carry or the write failed (best effort: a restart never
|
|
7
|
+
* waits on it).
|
|
8
|
+
*/
|
|
9
|
+
export declare function writeHeldInputs(texts: readonly string[], dir?: string, pid?: number): Record<string, string> | undefined;
|
|
10
|
+
/**
|
|
11
|
+
* The replacement's side: park the texts a `/restart` handed this process as
|
|
12
|
+
* held rows once the screen's channel is ready (never sent by themselves).
|
|
13
|
+
* A pass that cannot reach a ready channel leaves the handoff pending for the
|
|
14
|
+
* next `apply()` instead of dropping it.
|
|
15
|
+
* @returns What stops waiting for a channel that is not ready yet.
|
|
16
|
+
*/
|
|
17
|
+
export declare function adoptHeldInputs(channel: {
|
|
18
|
+
readonly ready: boolean;
|
|
19
|
+
subscribe(listener: () => void): () => void;
|
|
20
|
+
holdInputs(texts: readonly string[]): number;
|
|
21
|
+
}, env?: NodeJS.ProcessEnv, dir?: string): (() => void) | undefined;
|
|
22
|
+
/**
|
|
23
|
+
* The resume command after a restart that ended before any replacement took
|
|
24
|
+
* the held texts (a stall, a failed spawn): their file stays, and the command
|
|
25
|
+
* hands it to the next launch. Windows has no shared env-assignment syntax:
|
|
26
|
+
* PowerShell and cmd.exe each get their own copy-pasteable line.
|
|
27
|
+
*/
|
|
28
|
+
export declare function heldInputsResumeCommand(command: string, env: Readonly<Record<string, string>> | undefined, platform?: NodeJS.Platform): string;
|
|
29
|
+
/**
|
|
30
|
+
* Take (read and delete) the texts a `/restart` handed this process. One
|
|
31
|
+
* shot: the env marker is consumed too, so no child inherits it.
|
|
32
|
+
*/
|
|
33
|
+
export declare function takeHeldInputs(env?: NodeJS.ProcessEnv, dir?: string): string[];
|
|
34
|
+
/** Remove held-input files older than the resume window (best effort). */
|
|
35
|
+
export declare function sweepHeldInputs(dir?: string, now?: number): void;
|
|
36
|
+
//# sourceMappingURL=heldInputs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"heldInputs.d.ts","sourceRoot":"","sources":["../../src/heldInputs.ts"],"names":[],"mappings":"AAaA,4EAA4E;AAC5E,eAAO,MAAM,eAAe,wBAAwB,CAAA;AAOpD;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,EAAE,GAAG,GAAE,MAAiB,EAAE,GAAG,GAAE,MAAoB,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,CAc/I;AAyBD;;;;;;GAMG;AACH,wBAAgB,eAAe,CAC7B,OAAO,EAAE;IAAE,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;IAAC,SAAS,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC;IAAC,UAAU,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,CAAA;CAAE,EAC/H,GAAG,GAAE,MAAM,CAAC,UAAwB,EACpC,GAAG,GAAE,MAAiB,GACrB,CAAC,MAAM,IAAI,CAAC,GAAG,SAAS,CA8B1B;AAED;;;;;GAKG;AACH,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,GAAG,SAAS,EAAE,QAAQ,GAAE,MAAM,CAAC,QAA2B,GAAG,MAAM,CAShK;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,GAAG,GAAE,MAAM,CAAC,UAAwB,EAAE,GAAG,GAAE,MAAiB,GAAG,MAAM,EAAE,CAMrG;AAmBD,0EAA0E;AAC1E,wBAAgB,eAAe,CAAC,GAAG,GAAE,MAAiB,EAAE,GAAG,GAAE,MAAmB,GAAG,IAAI,CAetF"}
|