@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":"translate.d.ts","sourceRoot":"","sources":["../../../../src/dsh-adapter/backend/translate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAA;AAElE,OAAO,KAAK,EAAE,YAAY,EAAqC,MAAM,0BAA0B,CAAA;AAC/F,OAAO,EAAa,KAAK,UAAU,EAAqB,KAAK,cAAc,EAA0D,MAAM,uBAAuB,CAAA;AAElK,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAA;AAI3D,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE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a,GAAG,UAAU,CAAC,OAAO,mBAAmB,CAAC,CAAA"}
|
|
@@ -6,6 +6,7 @@ import { isCompactionCheckpointSource, toolResultPayload } from '../compat/messa
|
|
|
6
6
|
import { transcriptImagesOf } from '../transcript-images.js';
|
|
7
7
|
import { isTeamToolName, TEAM_SPAWN_TOOL, teamMessageOf, teamToolCallView, teamToolResultView } from '../team-tools.js';
|
|
8
8
|
import { refineSessionSearchTitle } from '../session-tools.js';
|
|
9
|
+
import { refineWorktreeCallTitle, WORKTREE_TOOL, worktreeResultView } from '../worktree-tool.js';
|
|
9
10
|
import { teamMailboxAsRelay, withoutTeammateReminder } from '../compat/agent-team-0.2.0.js';
|
|
10
11
|
/**
|
|
11
12
|
* DeepSeek's rate windows, injected into the shared projector as its
|
|
@@ -200,8 +201,10 @@ export function createDshTranslator(deps) {
|
|
|
200
201
|
if (tool?.presentCall === undefined)
|
|
201
202
|
return teamToolCallView(name, rawArgs);
|
|
202
203
|
// The session-search calls carry a static sentence the card header would
|
|
203
|
-
// repeat verbatim; put the query back in the header (session-tools.ts)
|
|
204
|
-
|
|
204
|
+
// repeat verbatim; put the query back in the header (session-tools.ts),
|
|
205
|
+
// and the branch in a create_worktree header (worktree-tool.ts).
|
|
206
|
+
const view = tool.presentCall(JSON.parse(rawArgs));
|
|
207
|
+
return refineWorktreeCallTitle(name, refineSessionSearchTitle(name, view, rawArgs), rawArgs);
|
|
205
208
|
}
|
|
206
209
|
catch {
|
|
207
210
|
return undefined;
|
|
@@ -220,11 +223,12 @@ export function createDshTranslator(deps) {
|
|
|
220
223
|
return local;
|
|
221
224
|
const tool = deps.tools()?.get(name, deps.scope());
|
|
222
225
|
if (tool?.presentResult === undefined) {
|
|
223
|
-
// Only the team tools read the text: skip joining every
|
|
224
|
-
|
|
226
|
+
// Only the team and worktree tools read the text: skip joining every
|
|
227
|
+
// other result.
|
|
228
|
+
if (!isTeamToolName(name) && name !== WORKTREE_TOOL)
|
|
225
229
|
return undefined;
|
|
226
230
|
const text = toolResultPayload(data.message).content.map(item => (item.type === 'text' ? item.text : '')).join('').trim();
|
|
227
|
-
return teamToolResultView(name, rawArgs, text);
|
|
231
|
+
return name === WORKTREE_TOOL ? worktreeResultView(name, rawArgs, text) : teamToolResultView(name, rawArgs, text);
|
|
228
232
|
}
|
|
229
233
|
return tool.presentResult(JSON.parse(rawArgs), {
|
|
230
234
|
...toolResultPayload(data.message),
|
|
@@ -18,7 +18,7 @@ type ApprovalStore = {
|
|
|
18
18
|
/** Owns detached background handles and the agent-view projection. */
|
|
19
19
|
export declare function createAgentViewProjection(ctx: Context, deps: {
|
|
20
20
|
owner: Pick<ChannelOwner, 'current' | 'assertActive' | 'own'>;
|
|
21
|
-
binding: Pick<Binding, 'agent' | 'capture' | 'isCurrent' | 'prepare' | 'abandon' | 'waitForDisposal'>;
|
|
21
|
+
binding: Pick<Binding, 'agent' | 'session' | 'capture' | 'isCurrent' | 'prepare' | 'abandon' | 'waitForDisposal'>;
|
|
22
22
|
cwd(): string;
|
|
23
23
|
configuredPreset?: string;
|
|
24
24
|
configuredProvider?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-view-projection.d.ts","sourceRoot":"","sources":["../../../../src/dsh-adapter/channel/agent-view-projection.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,WAAW,EAAsB,MAAM,wBAAwB,CAAA;AACpF,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAqBlD,OAAO,EAAqD,KAAK,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAG7G,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAA;AACrD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAC9C,OAAO,KAAK,EAAE,uBAAuB,EAAE,YAAY,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AACvG,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM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AO,CAAC,IAAI,CAAC,CAAA;KAAE,CAAC,CAAA;IAChI,mBAAmB,CAAC,IAAI,EAAE,YAAY,EAAE,eAAe,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAA;IACnF,SAAS,CAAC,MAAM,EAAE,KAAK,GAAG,OAAO,CAAC,YAAY,CAAC,CAAA;IAC/C,UAAU,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,YAAY,EAAE,WAAW,EAAE,OAAO,GAAG,OAAO,CAAC,YAAY,CAAC,CAAA;IAC9F;+EAC2E;IAC3E,iBAAiB,CAAC,IAAI,OAAO,CAAC,gBAAgB,CAAC,CAAA;IAC/C,iBAAiB,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,WAAW,CAAC,CAAA;CAC7C;iBAsDiB,IAAI;;kBA3CH,IAAI;oBAKF,IAAI;4BAOI,IAAI;+BA4MC,aAAa,KAAG,IAAI;gBA9JrC,SAAS,YAAY,EAAE;wBA4LlB,MAAM,IAAI;uBApJA,MAAM,KAAG,OAAO,CAAC,uBAAuB,CAAC;sBA6D1C,MAAM,KAAG,OAAO,CAAC,OAAO,CAAC;wBAgBvB,MAAM,KAAG,OAAO,CAAC,YAAY,CAAC;sBAiBhC,MAAM,KAAG,OAAO,CAAC,YAAY,EAAE,CAAC;uBAQ/B,MAAM,QAAQ,MAAM,KAAG,OAAO,CAAC,OAAO,CAAC;;uBAiDlD,SAAS,cAAc,EAAE;sBAG1B,MAAM;EAE3B"}
|
|
@@ -218,7 +218,9 @@ export function createAgentViewProjection(ctx, deps) {
|
|
|
218
218
|
return true;
|
|
219
219
|
};
|
|
220
220
|
const attach = async (sessionId) => {
|
|
221
|
-
|
|
221
|
+
// Same rule as `/resume` (#1651): a foreground whose agent unloaded under
|
|
222
|
+
// the screen has ended, so attaching to its own id reopens the log.
|
|
223
|
+
if (sessionId === String(deps.binding.agent.session.id) && deps.binding.session.status !== 'disposed')
|
|
222
224
|
return { ok: true };
|
|
223
225
|
const capture = deps.binding.capture();
|
|
224
226
|
// A retiring Agent can remain in the registry until its JSONL writer has
|
|
@@ -73,5 +73,7 @@ export declare function createComposerImages(ctx: ServiceLookup, owner: ChannelO
|
|
|
73
73
|
* backend with the `images` capability); undefined = the DSH
|
|
74
74
|
* attachments service. */
|
|
75
75
|
localImages?(): LocalImageStore | undefined;
|
|
76
|
+
/** Staged images a session change keeps: those of held rows. */
|
|
77
|
+
retainedStageIds?(): ReadonlySet<string>;
|
|
76
78
|
}): ComposerImages;
|
|
77
79
|
//# sourceMappingURL=composer-images.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"composer-images.d.ts","sourceRoot":"","sources":["../../../../src/dsh-adapter/channel/composer-images.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AAOtD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AAC7D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAC9C,OAAO,KAAK,EACV,iBAAiB,EACjB,kBAAkB,EAClB,gBAAgB,EAChB,qBAAqB,EACrB,iBAAiB,EACjB,gBAAgB,EAChB,eAAe,EAChB,MAAM,YAAY,CAAA;AAEnB,iEAAiE;AACjE,eAAO,MAAM,oBAAoB,QAAqB,CAAA;AAEtD;6EAC6E;AAC7E,eAAO,MAAM,0BAA0B,QAAsB,CAAA;AAE7D,eAAO,MAAM,sBAAsB,GAAI,WAAW,MAAM,KAAG,MACe,CAAA;AAE1E;;;2EAG2E;AAC3E,wBAAgB,qBAAqB,CAAC,CAAC,EACrC,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,SAAS,gBAAgB,EAAE,EACjC,MAAM,EAAE,WAAW,CAAC,MAAM,EAAE,CAAC,CAAC,GAC7B,GAAG,CAAC,MAAM,EAAE,CAAC,CAAC,CAehB;AAED;;4EAE4E;AAC5E,wBAAgB,uBAAuB,CACrC,IA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M,EAAE,SAAS,gBAAgB,EAAE,GAAG,SAAS,gBAAgB,EAAE,CAAA;IACtG,wEAAwE;IACxE,kBAAkB,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,gBAAgB,EAAE,GAAG,SAAS,gBAAgB,EAAE,CAAA;CACnG;AA0BD,iFAAiF;AACjF,qBAAa,mBAAoB,SAAQ,KAAK;CAAG;AAEjD,oFAAoF;AACpF,wBAAsB,iBAAiB,CAAC,WAAW,EAAE,kBAAkB,EAAE,KAAK,EAAE,gBAAgB,GAAG,OAAO,CAAC;IAAE,UAAU,EAAE,iBAAiB,CAAC,YAAY,CAAC,CAAC;IAAC,UAAU,CAAC,EAAE,qBAAqB,CAAA;CAAE,CAAC,CA2G9L;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAClC,GAAG,EAAE,aAAa,EAClB,KAAK,EAAE,YAAY,EACnB,IAAI,EAAE;IACJ,UAAU,IAAI,MAAM,CAAA;IACpB,kFAAkF;IAClF,SAAS,CAAC,IAAI,MAAM,CAAA;IACpB;;+BAE2B;IAC3B,WAAW,CAAC,IAAI,eAAe,GAAG,SAAS,CAAA;IAC3C,gEAAgE;IAChE,gBAAgB,CAAC,IAAI,WAAW,CAAC,MAAM,CAAC,CAAA;CACzC,GACA,cAAc,CA8KhB"}
|
|
@@ -203,8 +203,16 @@ export function createComposerImages(ctx, owner, deps) {
|
|
|
203
203
|
};
|
|
204
204
|
const clearStagedImages = () => {
|
|
205
205
|
stagedImageEpoch += 1;
|
|
206
|
-
|
|
207
|
-
|
|
206
|
+
// Held rows are the user's messages waiting for the next session (#1651):
|
|
207
|
+
// their images go with them. References are content-addressed and
|
|
208
|
+
// durable, so only the drafts' capabilities are revoked.
|
|
209
|
+
const retained = deps.retainedStageIds?.() ?? new Set();
|
|
210
|
+
for (const stageId of [...stagedImages.keys()]) {
|
|
211
|
+
if (retained.has(stageId))
|
|
212
|
+
continue;
|
|
213
|
+
stagedImages.delete(stageId);
|
|
214
|
+
stagedImageViews.delete(stageId);
|
|
215
|
+
}
|
|
208
216
|
legacyStagedImageRefs.clear();
|
|
209
217
|
legacyStagedImageSequence = 0;
|
|
210
218
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"composer-mentions.d.ts","sourceRoot":"","sources":["../../../../src/dsh-adapter/channel/composer-mentions.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"composer-mentions.d.ts","sourceRoot":"","sources":["../../../../src/dsh-adapter/channel/composer-mentions.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,SAAS,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAA;AAEpG;;;;;;;;;;;GAWG;AACH,wBAAsB,sBAAsB,CAC1C,EAAE,EAAE,SAAS,GAAG,SAAS,EACzB,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,MAAM,EACZ,WAAW,CAAC,EAAE,kBAAkB,EAChC,YAAY,CAAC,EAAE,WAAW,CAAC,MAAM,EAAE,iBAAiB,CAAC,YAAY,CAAC,CAAC,GAClE,OAAO,CAAC,gBAAgB,CAAC,CAuM3B"}
|
|
@@ -3,6 +3,7 @@ import { extractMentions } from '../../utils/mentions.js';
|
|
|
3
3
|
import { COMPOSER_IMAGE_TOKEN, ImageAdmissionError, saveAdmittedImage } from './composer-images.js';
|
|
4
4
|
import { MENTION_MAX_DIR_ENTRIES, MENTION_MAX_FILE_CHARS, MENTION_MAX_TOTAL_CHARS, mentionImageMediaType, tryResolveMention, } from './mentions.js';
|
|
5
5
|
import { basename } from './paths.js';
|
|
6
|
+
import { expandHomePrefix } from '../../utils/paths.js';
|
|
6
7
|
/**
|
|
7
8
|
* Expand a submitted text's `@` mentions (issue #15) into model-facing
|
|
8
9
|
* attachment blocks: supported image files become durable image blocks,
|
|
@@ -82,15 +83,22 @@ export async function expandComposerMentions(fs, cwd, text, attachments, stagedI
|
|
|
82
83
|
if (budget <= 0 && imageMediaType === undefined)
|
|
83
84
|
continue;
|
|
84
85
|
// Mentions resolve against the session cwd, same as the model-facing fs
|
|
85
|
-
// tools; absolute paths pass through untouched
|
|
86
|
-
// (
|
|
87
|
-
//
|
|
88
|
-
//
|
|
89
|
-
|
|
86
|
+
// tools; absolute paths pass through untouched, and a leading literal `~/`
|
|
87
|
+
// (or `~\`) expands to the host home exactly like completion does (issue
|
|
88
|
+
// #1706 — this is the submit path, so without it a path the `@` menu
|
|
89
|
+
// listed was joined onto the workspace and silently went missing). A
|
|
90
|
+
// `#L12-14` line suffix (issue #359) is stripped before resolution; when
|
|
91
|
+
// the stripped path misses, the typed literal (suffix intact) gets ONE
|
|
92
|
+
// fallback try so filenames genuinely containing `#L…` still resolve as
|
|
93
|
+
// whole files.
|
|
94
|
+
const mentionPath = expandHomePrefix(mention.path);
|
|
95
|
+
const absolute = isAbsolute(mentionPath) ? mentionPath : join(cwd, mentionPath);
|
|
90
96
|
let resolved = await tryResolveMention(fs, absolute);
|
|
91
97
|
let literalFallback = false;
|
|
98
|
+
let literalExpanded;
|
|
92
99
|
if (resolved === undefined && mention.literal !== undefined) {
|
|
93
|
-
|
|
100
|
+
literalExpanded = expandHomePrefix(mention.literal);
|
|
101
|
+
const literalPath = isAbsolute(literalExpanded) ? literalExpanded : join(cwd, literalExpanded);
|
|
94
102
|
resolved = await tryResolveMention(fs, literalPath);
|
|
95
103
|
literalFallback = resolved !== undefined;
|
|
96
104
|
}
|
|
@@ -101,7 +109,14 @@ export async function expandComposerMentions(fs, cwd, text, attachments, stagedI
|
|
|
101
109
|
const { target, info } = resolved;
|
|
102
110
|
// On a literal-fallback hit the attached file IS the typed name — the
|
|
103
111
|
// model must see that path, not the suffix-stripped one.
|
|
104
|
-
|
|
112
|
+
//
|
|
113
|
+
// The model-facing path must also be resolvable by the fs tools, which
|
|
114
|
+
// resolve against the session cwd and do NOT expand `~` (issue #1706):
|
|
115
|
+
// when the typed path carried a home prefix, hand the model the expanded
|
|
116
|
+
// path. The user-visible `attached`/`missing` lists keep the typed string.
|
|
117
|
+
const shownPath = literalFallback
|
|
118
|
+
? (literalExpanded !== undefined && isAbsolute(literalExpanded) ? literalExpanded : display)
|
|
119
|
+
: (isAbsolute(mentionPath) ? mentionPath : mention.path);
|
|
105
120
|
// …and judge image-ness by the typed extension in that case too.
|
|
106
121
|
const imageType = literalFallback && mention.literal !== undefined
|
|
107
122
|
? mentionImageMediaType(mention.literal)
|
|
@@ -21,6 +21,6 @@ export declare function createContextBookkeeping(state: () => {
|
|
|
21
21
|
text: string;
|
|
22
22
|
images?: readonly ComposerImageRef[];
|
|
23
23
|
}, placement: PendingMessage["placement"]) => void;
|
|
24
|
-
untrackPending: (messageId: string) => void;
|
|
24
|
+
untrackPending: (messageId: string, hold?: boolean) => void;
|
|
25
25
|
};
|
|
26
26
|
//# sourceMappingURL=context-bookkeeping.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context-bookkeeping.d.ts","sourceRoot":"","sources":["../../../../src/dsh-adapter/channel/context-bookkeeping.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qCAAqC,CAAA;AAC3E,OAAO,KAAK,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAElE,+EAA+E;AAC/E,wBAAgB,wBAAwB,CACtC,KAAK,EAAE,MAAM;IACX;wEACoE;IACpE,gBAAgB,EAAE,gBAAgB,GAAG,SAAS,CAAA;IAC9C,OAAO,EAAE,cAAc,EAAE,CAAA;IACzB,IAAI,IAAI,IAAI,CAAA;CACb,EACD,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE;IAAE,KAAK,EAAE,SAAS,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,KAAK,OAAO,EACnF,cAAc,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,MAAM,EAC3C,mBAAmB,EAAE,MAAM;;;;+
|
|
1
|
+
{"version":3,"file":"context-bookkeeping.d.ts","sourceRoot":"","sources":["../../../../src/dsh-adapter/channel/context-bookkeeping.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qCAAqC,CAAA;AAC3E,OAAO,KAAK,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAElE,+EAA+E;AAC/E,wBAAgB,wBAAwB,CACtC,KAAK,EAAE,MAAM;IACX;wEACoE;IACpE,gBAAgB,EAAE,gBAAgB,GAAG,SAAS,CAAA;IAC9C,OAAO,EAAE,cAAc,EAAE,CAAA;IACzB,IAAI,IAAI,IAAI,CAAA;CACb,EACD,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE;IAAE,KAAK,EAAE,SAAS,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,KAAK,OAAO,EACnF,cAAc,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,MAAM,EAC3C,mBAAmB,EAAE,MAAM;;;;+BAiCK,IAAI;+BA9BJ,IAAI;4BAeL;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,SAAS,gBAAgB,EAAE,CAAA;KAAE,aAAa,cAAc,CAAC,WAAW,CAAC,KAAG,IAAI;gCAO7G,MAAM,qBAAiB,IAAI;EAU/D"}
|
|
@@ -24,12 +24,16 @@ export function createContextBookkeeping(state, notify, lowContextText, warningB
|
|
|
24
24
|
channel.pending = [...channel.pending, { id: message.id, text: message.text, images: message.images ?? [], placement }];
|
|
25
25
|
channel.emit();
|
|
26
26
|
};
|
|
27
|
-
|
|
27
|
+
/** Drop the preview of a message the backend never took; `hold` keeps it
|
|
28
|
+
* instead as a held, undelivered dock row (a refusal must not lose it). */
|
|
29
|
+
const untrackPending = (messageId, hold = false) => {
|
|
28
30
|
const channel = state();
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
channel.
|
|
31
|
+
if (!channel.pending.some(item => item.id === messageId))
|
|
32
|
+
return;
|
|
33
|
+
channel.pending = hold
|
|
34
|
+
? channel.pending.map(item => item.id === messageId ? { ...item, docked: true, orphaned: true } : item)
|
|
35
|
+
: channel.pending.filter(item => item.id !== messageId);
|
|
36
|
+
channel.emit();
|
|
33
37
|
};
|
|
34
38
|
const resetContextWarning = () => { warning.value = false; };
|
|
35
39
|
return { warning, resetContextWarning, checkContextWarning, trackPending, untrackPending };
|
|
@@ -70,6 +70,8 @@ export declare function createSessionBatchRouter(deps: {
|
|
|
70
70
|
onReset?(event: AgentEventOf<'session.reset'>): void;
|
|
71
71
|
ownsCompactionProgress?(): boolean;
|
|
72
72
|
warn(message: string): void;
|
|
73
|
+
/** Tell the user about inputs held for them; absent = held silently. */
|
|
74
|
+
notify?: ChannelProjectionDeps['notify'];
|
|
73
75
|
taskCompletion?: ReturnType<typeof createTaskCompletion>;
|
|
74
76
|
}): {
|
|
75
77
|
route: (batch: readonly AgentEvent[], meta: AgentEventMeta, current: () => boolean) => void;
|
|
@@ -91,6 +93,8 @@ export declare function createSessionBinder(deps: {
|
|
|
91
93
|
/** Forget the core's trajectory fold before the seed replay paints (a
|
|
92
94
|
* session swap starts an empty raw-event log, exactly like the rows). */
|
|
93
95
|
resetTrajectory?(): void;
|
|
96
|
+
/** The binding generation just changed (a session swap). */
|
|
97
|
+
rebound?(): void;
|
|
94
98
|
/** The stores a session's prompts park in (`ChannelLaunchOptions.interaction`). */
|
|
95
99
|
interaction?: ChannelLaunchOptions['interaction'];
|
|
96
100
|
/** The session-level facts kept unless the extension owns them. */
|
|
@@ -122,6 +126,8 @@ export declare function createBindingFeed(ctx: {
|
|
|
122
126
|
onReset?(event: AgentEventOf<'session.reset'>): void;
|
|
123
127
|
/** Passed to the binder: resets the core trajectory fold per bind. */
|
|
124
128
|
resetTrajectory?(): void;
|
|
129
|
+
/** Passed to the binder: the binding generation just changed. */
|
|
130
|
+
rebound?(): void;
|
|
125
131
|
}): {
|
|
126
132
|
projector: {
|
|
127
133
|
apply: (events: readonly AgentEvent[], meta: AgentEventMeta) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"binding-feed.d.ts","sourceRoot":"","sources":["../../../../../src/dsh-adapter/channel/core/binding-feed.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAA;AAC3D,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAA;AACxF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AAE7D,OAAO,EAA2B,KAAK,iBAAiB,EAAE,KAAK,qBAAqB,EAAE,MAAM,gCAAgC,CAAA;
|
|
1
|
+
{"version":3,"file":"binding-feed.d.ts","sourceRoot":"","sources":["../../../../../src/dsh-adapter/channel/core/binding-feed.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAA;AAC3D,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAA;AACxF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AAE7D,OAAO,EAA2B,KAAK,iBAAiB,EAAE,KAAK,qBAAqB,EAAE,MAAM,gCAAgC,CAAA;AAG5H,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AACnE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;AAC3D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAC/C,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAA;AACvD,OAAO,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAA;AAC5D,OAAO,K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createChannelProjection } from '../../../channel/projection.js';
|
|
3
|
+
import { t } from '../../../i18n.js';
|
|
3
4
|
import { logForDebugging } from '../../../utils/debug.js';
|
|
4
5
|
import { createTaskCompletion } from '../task-completion.js';
|
|
5
6
|
/**
|
|
@@ -20,11 +21,39 @@ export function createSessionBatchRouter(deps) {
|
|
|
20
21
|
deps.projector.settleStreaming();
|
|
21
22
|
deps.projector.updateSpinnerMode();
|
|
22
23
|
};
|
|
24
|
+
/**
|
|
25
|
+
* Hold previews no backend will run any more (#1651): the backend dropped
|
|
26
|
+
* them on its own (`ids`), or the session ended (`'all'`), possibly after
|
|
27
|
+
* its drop notices could no longer arrive. They join the dock, which never
|
|
28
|
+
* re-sends by itself, and stay across the switch to the next session.
|
|
29
|
+
*/
|
|
30
|
+
const holdOrphans = (ids) => {
|
|
31
|
+
let held = 0;
|
|
32
|
+
let changed = false;
|
|
33
|
+
deps.state.pending = deps.state.pending.map(item => {
|
|
34
|
+
if (item.orphaned === true || (ids !== 'all' && !ids.has(item.id)))
|
|
35
|
+
return item;
|
|
36
|
+
changed = true;
|
|
37
|
+
if (item.docked !== true)
|
|
38
|
+
held += 1;
|
|
39
|
+
return { ...item, docked: true, orphaned: true };
|
|
40
|
+
});
|
|
41
|
+
if (!changed)
|
|
42
|
+
return;
|
|
43
|
+
if (held > 0)
|
|
44
|
+
deps.notify?.(t('input-orphans-held', { count: held }), { color: 'warning', timeoutMs: 8000 });
|
|
45
|
+
deps.state.emit();
|
|
46
|
+
};
|
|
23
47
|
/** `session.status` as the backend reports it. */
|
|
24
48
|
const applyStatus = (status) => {
|
|
25
49
|
if (status === 'disposed') {
|
|
26
50
|
deps.state.status = 'disposed';
|
|
27
51
|
reconcileRetiredProjection('disposed');
|
|
52
|
+
// An automatic compaction's `compaction.end` will not come any more
|
|
53
|
+
// (#1651). A manual one is the transaction's: it retires its own row.
|
|
54
|
+
if (deps.state.compaction !== undefined && deps.ownsCompactionProgress?.() !== true)
|
|
55
|
+
deps.state.compaction = undefined;
|
|
56
|
+
holdOrphans('all');
|
|
28
57
|
deps.state.emit();
|
|
29
58
|
return;
|
|
30
59
|
}
|
|
@@ -42,8 +71,10 @@ export function createSessionBatchRouter(deps) {
|
|
|
42
71
|
* delete the context before it is ever injected.
|
|
43
72
|
*/
|
|
44
73
|
const applyPending = (event) => {
|
|
45
|
-
for (const messageId of event.discarded ?? [])
|
|
74
|
+
for (const messageId of [...event.discarded ?? [], ...event.dropped ?? []])
|
|
46
75
|
deps.retireAttachment?.(messageId);
|
|
76
|
+
if (event.dropped !== undefined && event.dropped.length > 0)
|
|
77
|
+
holdOrphans(new Set(event.dropped));
|
|
47
78
|
// A discard of a docked preview only drops the backend copy. The dock
|
|
48
79
|
// (where an interrupt parks inputs on the channel side) owns the row, so
|
|
49
80
|
// it stays until sent (`deliverDocked`) or retracted. A claim always
|
|
@@ -156,6 +187,7 @@ export function createSessionBinder(deps) {
|
|
|
156
187
|
try {
|
|
157
188
|
state.agentBindingGeneration = binding.bind();
|
|
158
189
|
deps.resetTrajectory?.();
|
|
190
|
+
deps.rebound?.();
|
|
159
191
|
hooks.onGeneration?.();
|
|
160
192
|
inputConvergence.cancelInFlight = false;
|
|
161
193
|
inputConvergence.interruptSeq += 1;
|
|
@@ -217,6 +249,7 @@ export function createBindingFeed(ctx, deps) {
|
|
|
217
249
|
projector,
|
|
218
250
|
inputConvergence,
|
|
219
251
|
retireAttachment: deps.retireAttachment,
|
|
252
|
+
notify: deps.projection.notify,
|
|
220
253
|
ownsCompactionProgress: () => deps.hooks().ownsCompactionProgress?.() ?? false,
|
|
221
254
|
...(deps.onReset === undefined ? {} : { onReset: deps.onReset }),
|
|
222
255
|
warn: message => ctx.logger.warn(message),
|
|
@@ -270,6 +303,7 @@ export function createBindingFeed(ctx, deps) {
|
|
|
270
303
|
route: router.route,
|
|
271
304
|
hooks: deps.hooks,
|
|
272
305
|
...(deps.resetTrajectory === undefined ? {} : { resetTrajectory: deps.resetTrajectory }),
|
|
306
|
+
...(deps.rebound === undefined ? {} : { rebound: deps.rebound }),
|
|
273
307
|
interaction: deps.options.interaction,
|
|
274
308
|
facts: {
|
|
275
309
|
observe: controls.observe,
|
|
@@ -115,7 +115,7 @@ export declare function createCoreChannel(ctx: ChannelHost, initialSession: Agen
|
|
|
115
115
|
text: string;
|
|
116
116
|
images?: readonly import("../types.js").ComposerImageRef[];
|
|
117
117
|
}, placement: import("../types.js").PendingMessage["placement"]) => void;
|
|
118
|
-
untrackPending: (messageId: string) => void;
|
|
118
|
+
untrackPending: (messageId: string, hold?: boolean) => void;
|
|
119
119
|
};
|
|
120
120
|
composer: import("../composer-images.js").ComposerImages;
|
|
121
121
|
input: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compose.d.ts","sourceRoot":"","sources":["../../../../../src/dsh-adapter/channel/core/compose.ts"],"names":[],"mappings":"AAsBA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gDAAgD,CAAA;AAGvF,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAA;AAC1D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AAW7D,OAAO,EAA4D,KAAK,sBAAsB,EAAE,MAAM,wBAAwB,CAAA;AAQ9H,OAAO,EAAsB,KAAK,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;AAG/E,OAAO,EAAwB,KAAK,YAAY,EAAE,MAAM,aAAa,CAAA;AAIrE,OAAO,EAA8C,KAAK,oBAAoB,EAAuB,MAAM,aAAa,CAAA;AACxH,OAAO,KAAK,EAAE,YAAY,EAA0B,MAAM,aAAa,CAAA;AAEvE,OAAO,EAAqB,KAAK,gBAAgB,EAAE,MAAM,mBAAmB,CAAA;AAC5E,OAAO,EAA0C,KAAK,iBAAiB,EAAE,MAAM,YAAY,CAAA;AAC3F,OAAO,EAAqE,KAAK,QAAQ,EAAE,MAAM,WAAW,CAAA;AAO5G,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBA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AG,IAAI;;;;;;;;;;kBAhJS,CAAC;;;;;;;;;;2BAyY1C,CAAP;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8BAvWqC,CAAC;uCAAqC,CAAC;;;;;;;;kBA1C/D,CAAC;gBAAmB,CAAC;;;;;;;;;6BAqQL,IAAI;;IAm1BhC,sFAAsF;iBACzE,gBAAgB,GAAG,IAAI;IAQpC,4EAA4E;wBACxD,CAAC,OAAO,EAAE,YAAY,KAAK,IAAI,GAAG,IAAI;IAK1D,gEAAgE;aACvD,YAAY;EA4BxB"}
|
|
@@ -234,6 +234,7 @@ export function createCoreChannel(ctx, initialSession, options, owner) {
|
|
|
234
234
|
generation: () => state.agentBindingGeneration,
|
|
235
235
|
sessionId: () => state.agentId,
|
|
236
236
|
localImages,
|
|
237
|
+
retainedStageIds: () => new Set(state.pending.filter(item => item.orphaned === true).flatMap(item => item.images.map(image => image.stageId))),
|
|
237
238
|
});
|
|
238
239
|
const files = createCoreFiles(ctx, {
|
|
239
240
|
owner,
|
|
@@ -747,6 +748,10 @@ export function createCoreChannel(ctx, initialSession, options, owner) {
|
|
|
747
748
|
},
|
|
748
749
|
resetTrajectory: () => { if (trajectoryOwned())
|
|
749
750
|
agentTrajectory.reset(); },
|
|
751
|
+
// The image store follows the swap now, while the held rows that keep
|
|
752
|
+
// their images are still listed (#1651): delivering or editing one
|
|
753
|
+
// later must not be what notices the swap.
|
|
754
|
+
rebound: () => { composer.stagedImageGeneration(); },
|
|
750
755
|
retireAttachment: inputDelivery.retireAttachment,
|
|
751
756
|
controls,
|
|
752
757
|
hooks: () => extension.bind ?? {},
|
|
@@ -25,12 +25,12 @@ export interface InputConvergence {
|
|
|
25
25
|
* undefined when none is. */
|
|
26
26
|
provisionalDockIds?: string[];
|
|
27
27
|
}
|
|
28
|
-
export declare function createInputActions(getState: () => Pick<ChannelState, 'agentId' | 'pending' | 'cancelPending' | 'emit' | 'notify' | 'backendCapabilities'>, getSession: () => AgentSession, owner: {
|
|
28
|
+
export declare function createInputActions(getState: () => Pick<ChannelState, 'agentId' | 'pending' | 'cancelPending' | 'emit' | 'notify' | 'backendCapabilities' | 'status'>, getSession: () => AgentSession, owner: {
|
|
29
29
|
assertActive(): void;
|
|
30
30
|
}, input: InputConvergence, composer: {
|
|
31
31
|
includeLegacyImageRefs(text: string, images: readonly ComposerImageRef[]): readonly ComposerImageRef[];
|
|
32
32
|
}, dispatchUserText: (text: string, placement: 'steer' | 'followup', images?: readonly ComposerImageRef[]) => void, runLocalCommand: (command: string, includeInContext: boolean) => Promise<void>,
|
|
33
33
|
/** Move the used session to the front of the `/resume` MRU (DSH session
|
|
34
34
|
* history); a backend whose sessions that list cannot open passes a no-op. */
|
|
35
|
-
touch?: (sessionId: string) => void): Pick<ChannelState, 'submit' | 'steer' | 'removePending' | 'cancel' | 'interruptAndDeliver' | 'interruptAndDock' | 'deliverDocked' | 'swapDockedForDraft'>;
|
|
35
|
+
touch?: (sessionId: string) => void): Pick<ChannelState, 'submit' | 'steer' | 'removePending' | 'cancel' | 'interruptAndDeliver' | 'interruptAndDock' | 'deliverDocked' | 'swapDockedForDraft' | 'holdInputs'>;
|
|
36
36
|
//# sourceMappingURL=input-actions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"input-actions.d.ts","sourceRoot":"","sources":["../../../../src/dsh-adapter/channel/input-actions.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAiB,MAAM,wBAAwB,CAAA;AAGzE,OAAO,KAAK,EAAE,YAAY,EAAE,gBAAgB,
|
|
1
|
+
{"version":3,"file":"input-actions.d.ts","sourceRoot":"","sources":["../../../../src/dsh-adapter/channel/input-actions.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAiB,MAAM,wBAAwB,CAAA;AAGzE,OAAO,KAAK,EAAE,YAAY,EAAE,gBAAgB,EAAsC,MAAM,YAAY,CAAA;AAEpG,MAAM,WA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Session) {
|
|
|
183
183
|
// not the ones this receipt speaks about.
|
|
184
184
|
if (getSession() !== session)
|
|
185
185
|
return;
|
|
186
|
+
// The session ended meanwhile: its end held every row and their
|
|
187
|
+
// backend copies went with it, so this answer neither un-docks them
|
|
188
|
+
// nor reports a queue that will still run.
|
|
189
|
+
if (session.status === 'disposed')
|
|
190
|
+
return;
|
|
186
191
|
// Every docked row this receipt cannot confirm dropped: the ids the
|
|
187
192
|
// backend says it kept, plus every row docked after the request
|
|
188
193
|
// fired (outside its snapshot). Those copies are still live: their
|
|
@@ -244,6 +249,12 @@ touch = touchSession) {
|
|
|
244
249
|
const docked = state.pending.filter(item => item.docked === true);
|
|
245
250
|
if (docked.length === 0)
|
|
246
251
|
return 0;
|
|
252
|
+
// The session ended: nothing would run them, and a refused send would
|
|
253
|
+
// lose them. They stay docked for the next session.
|
|
254
|
+
if (state.status === 'disposed') {
|
|
255
|
+
state.notify(t('input-dock-session-disposed'), { color: 'warning', timeoutMs: 6000 });
|
|
256
|
+
return 0;
|
|
257
|
+
}
|
|
247
258
|
// Provisional rows are always the newest dock batches, so the confirmed
|
|
248
259
|
// remainder is a FIFO prefix; holding the tail never reorders anyone.
|
|
249
260
|
const ready = docked.filter(item => !held(item.id));
|
|
@@ -282,6 +293,9 @@ touch = touchSession) {
|
|
|
282
293
|
// the user a second copy the late revocation cannot reach.
|
|
283
294
|
if (input.provisionalDockIds?.includes(id) === true)
|
|
284
295
|
return false;
|
|
296
|
+
// The draft takes the swapped row's place: held for the next session
|
|
297
|
+
// when that row was (its own session ended), so `/new` keeps it too.
|
|
298
|
+
const orphaned = state.pending[index].orphaned === true;
|
|
285
299
|
// A docked retract is purely local on every backend (see removePending).
|
|
286
300
|
state.pending = [
|
|
287
301
|
...state.pending.filter(item => item.id !== id),
|
|
@@ -291,11 +305,27 @@ touch = touchSession) {
|
|
|
291
305
|
images: [...(draft.images ?? [])],
|
|
292
306
|
placement: 'followup',
|
|
293
307
|
docked: true,
|
|
308
|
+
...(orphaned ? { orphaned: true } : {}),
|
|
294
309
|
},
|
|
295
310
|
];
|
|
296
311
|
state.emit();
|
|
297
312
|
return true;
|
|
298
313
|
},
|
|
314
|
+
holdInputs(texts) {
|
|
315
|
+
owner.assertActive();
|
|
316
|
+
const state = getState();
|
|
317
|
+
// Local ids like the swap's: no backend copy exists, so no inbox event
|
|
318
|
+
// can match these rows and no interrupt receipt covers them.
|
|
319
|
+
const held = texts.filter(text => text.trim() !== '').map((text) => ({
|
|
320
|
+
id: `dock-held-${randomUUID()}`, text, images: [], placement: 'followup', docked: true, orphaned: true,
|
|
321
|
+
}));
|
|
322
|
+
if (held.length === 0)
|
|
323
|
+
return 0;
|
|
324
|
+
state.pending = [...state.pending, ...held];
|
|
325
|
+
state.emit();
|
|
326
|
+
state.notify(t('input-orphans-held', { count: held.length }), { color: 'warning', timeoutMs: 8000 });
|
|
327
|
+
return held.length;
|
|
328
|
+
},
|
|
299
329
|
interruptAndDeliver(inputs) {
|
|
300
330
|
owner.assertActive();
|
|
301
331
|
const state = getState();
|
|
@@ -38,7 +38,7 @@ export declare function createInputDelivery(ctx: ChannelHost, owner: ChannelOwne
|
|
|
38
38
|
id: string;
|
|
39
39
|
text: string;
|
|
40
40
|
images?: readonly ComposerImageRef[];
|
|
41
|
-
}, placement: PendingMessage['placement']) => void, untrackPending: (id: string) => void, composer: ComposerImages, selection: () => ChannelSelection | undefined, rememberSelection: (messageId: string, info: SelectionAttachment) => void,
|
|
41
|
+
}, placement: PendingMessage['placement']) => void, untrackPending: (id: string, hold?: boolean) => void, composer: ComposerImages, selection: () => ChannelSelection | undefined, rememberSelection: (messageId: string, info: SelectionAttachment) => void,
|
|
42
42
|
/** The fs surface to use when the host mounts no `fs` service (a non-DSH
|
|
43
43
|
* composition reads the local disk); absent = no fallback. */
|
|
44
44
|
fallbackFs?: () => MentionFs | undefined,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"input-delivery.d.ts","sourceRoot":"","sources":["../../../../src/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.id, native: message, ...(images === undefined || images.length === 0 ? {} : { images }) }, placement);
|
|
180
180
|
// A backend refusal need not emit pending.changed. Retire its preview
|
|
181
181
|
// and attached context here, and show the refusal instead of queuing it.
|
|
182
|
+
// An ended session refuses every retry: its text stays as a held dock
|
|
183
|
+
// row instead (#1651), sent only when the user sends the dock.
|
|
182
184
|
if (!result.accepted) {
|
|
183
185
|
if (attach !== undefined)
|
|
184
186
|
attachedByMessageId.delete(message.id);
|
|
185
|
-
|
|
187
|
+
const hold = origin.session.status === 'disposed';
|
|
188
|
+
untrackPending(message.id, hold);
|
|
186
189
|
// A refusal with no reason is still a refusal: say so, or the send
|
|
187
190
|
// looks successful while nothing was queued.
|
|
188
|
-
|
|
189
|
-
|
|
191
|
+
const reason = result.reason !== undefined && result.reason !== '' ? result.reason : t('input-not-accepted');
|
|
192
|
+
if (hold)
|
|
193
|
+
notify(t('input-refused-held', { reason }), { color: 'warning', timeoutMs: 6000 });
|
|
190
194
|
else
|
|
191
|
-
notify(
|
|
195
|
+
notify(reason, { color: 'warning', timeoutMs: 4000 });
|
|
192
196
|
return;
|
|
193
197
|
}
|
|
194
198
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mentions.d.ts","sourceRoot":"","sources":["../../../../src/dsh-adapter/channel/mentions.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"mentions.d.ts","sourceRoot":"","sources":["../../../../src/dsh-adapter/channel/mentions.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AACtD,OAAO,KAAK,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,SAAS,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAE5I;gDACgD;AAChD,eAAO,MAAM,sBAAsB,QAAS,CAAA;AAE5C,0DAA0D;AAC1D,eAAO,MAAM,uBAAuB,SAAU,CAAA;AAE9C;eACe;AACf,eAAO,MAAM,uBAAuB,MAAM,CAAA;AAE1C;wEACwE;AACxE,wBAAgB,SAAS,CAAC,GAAG,EAAE,aAAa,GAAG,SAAS,GAAG,SAAS,CAEnE;AAED,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,aAAa,GAAG,kBAAkB,GAAG,SAAS,CAErF;AAED,eAAO,MAAM,yBAAyB,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,qBAAqB,CAAC,CAMrF,CAAA;AAED,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,GAAG,qBAAqB,GAAG,SAAS,CAErF;AAED;+EAC+E;AAC/E,wBAAsB,iBAAiB,CAAC,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,GAAG,SAAS,CAAC,CAS7G;AAED;;;;;;;GAOG;AACH,wBAAsB,cAAc,CAClC,EAAE,EAAE,SAAS,GAAG,SAAS,EACzB,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,MAAM,EACZ,WAAW,CAAC,EAAE,kBAAkB,EAChC,YAAY,CAAC,EAAE,WAAW,CAAC,MAAM,EAAE,iBAAiB,CAAC,YAAY,CAAC,CAAC,GAClE,OAAO,CAAC,gBAAgB,CAAC,CAkM3B"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { extname, isAbsolute, join } from 'node:path';
|
|
2
2
|
import { extractMentions } from '../../utils/mentions.js';
|
|
3
3
|
import { basename } from './paths.js';
|
|
4
|
+
import { expandHomePrefix } from '../../utils/paths.js';
|
|
4
5
|
import { COMPOSER_IMAGE_TOKEN } from './composer-images.js';
|
|
5
6
|
/** One attached file's contribution is capped so an absent-minded `@` of a
|
|
6
7
|
* huge file cannot blow the context window. */
|
|
@@ -115,15 +116,21 @@ export async function expandMentions(fs, cwd, text, attachments, stagedImages) {
|
|
|
115
116
|
if (budget <= 0 && imageMediaType === undefined)
|
|
116
117
|
continue;
|
|
117
118
|
// Mentions resolve against the session cwd, same as the model-facing fs
|
|
118
|
-
// tools; absolute paths pass through untouched
|
|
119
|
-
// (
|
|
120
|
-
//
|
|
121
|
-
//
|
|
122
|
-
|
|
119
|
+
// tools; absolute paths pass through untouched, and a leading literal `~/`
|
|
120
|
+
// (or `~\`) expands to the host home exactly like completion does (issue
|
|
121
|
+
// #1706 — without this the typed path was joined onto the workspace and
|
|
122
|
+
// silently went missing). A `#L12-14` line suffix (issue #359) is stripped
|
|
123
|
+
// before resolution; when the stripped path misses, the typed literal
|
|
124
|
+
// (suffix intact) gets ONE fallback try so filenames genuinely containing
|
|
125
|
+
// `#L…` still resolve as whole files.
|
|
126
|
+
const mentionPath = expandHomePrefix(mention.path);
|
|
127
|
+
const absolute = isAbsolute(mentionPath) ? mentionPath : join(cwd, mentionPath);
|
|
123
128
|
let resolved = await tryResolveMention(fs, absolute);
|
|
124
129
|
let literalFallback = false;
|
|
130
|
+
let literalExpanded;
|
|
125
131
|
if (resolved === undefined && mention.literal !== undefined) {
|
|
126
|
-
|
|
132
|
+
literalExpanded = expandHomePrefix(mention.literal);
|
|
133
|
+
const literalPath = isAbsolute(literalExpanded) ? literalExpanded : join(cwd, literalExpanded);
|
|
127
134
|
resolved = await tryResolveMention(fs, literalPath);
|
|
128
135
|
literalFallback = resolved !== undefined;
|
|
129
136
|
}
|
|
@@ -134,7 +141,14 @@ export async function expandMentions(fs, cwd, text, attachments, stagedImages) {
|
|
|
134
141
|
const { target, info } = resolved;
|
|
135
142
|
// On a literal-fallback hit the attached file IS the typed name — the
|
|
136
143
|
// model must see that path, not the suffix-stripped one.
|
|
137
|
-
|
|
144
|
+
//
|
|
145
|
+
// The model-facing path must also be resolvable by the fs tools, which
|
|
146
|
+
// resolve against the session cwd and do NOT expand `~` (issue #1706):
|
|
147
|
+
// when the typed path carried a home prefix, hand the model the expanded
|
|
148
|
+
// path. The user-visible `attached`/`missing` lists keep the typed string.
|
|
149
|
+
const shownPath = literalFallback
|
|
150
|
+
? (literalExpanded !== undefined && isAbsolute(literalExpanded) ? literalExpanded : display)
|
|
151
|
+
: (isAbsolute(mentionPath) ? mentionPath : mention.path);
|
|
138
152
|
// …and judge image-ness by the typed extension in that case too.
|
|
139
153
|
const imageType = literalFallback && mention.literal !== undefined
|
|
140
154
|
? mentionImageMediaType(mention.literal)
|