mixdog 1.3.2 → 1.3.3
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/package.json +7 -7
- package/scripts/verify-runtime-dependency-versions.mjs +158 -0
- package/src/agents/reviewer/AGENT.md +5 -7
- package/src/agents/reviewer/agent.json +1 -1
- package/src/defaults/shipped-history.json +4 -0
- package/src/defaults/skills/browser-use/SKILL.md +6 -3
- package/src/defaults/skills/local-provider/SKILL.md +33 -6
- package/src/rules/lead/LEAD.md +5 -8
- package/src/rules/shared/45-destructive.md +5 -1
- package/src/rules/shared/60-verification.md +6 -4
- package/src/runtime/agent/orchestrator/providers/anthropic-api-request.mjs +4 -1
- package/src/runtime/agent/orchestrator/providers/anthropic-max-tokens.mjs +38 -11
- package/src/runtime/agent/orchestrator/providers/anthropic-messages.mjs +15 -3
- package/src/runtime/agent/orchestrator/providers/anthropic-oauth-client-version.mjs +1 -1
- package/src/runtime/agent/orchestrator/providers/anthropic-oauth.mjs +17 -4
- package/src/runtime/agent/orchestrator/providers/anthropic.mjs +14 -1
- package/src/runtime/agent/orchestrator/providers/cursor-client-version.mjs +1 -1
- package/src/runtime/agent/orchestrator/providers/custom-provider-config.mjs +14 -1
- package/src/runtime/agent/orchestrator/providers/grok-client-version.mjs +1 -1
- package/src/runtime/agent/orchestrator/providers/registry.mjs +10 -0
- package/src/runtime/agent/orchestrator/providers/wire-gateway.mjs +13 -1
- package/src/runtime/agent/orchestrator/runtime-core/goal-runtime.mjs +5 -0
- package/src/runtime/agent/orchestrator/runtime-core/goal-turns.mjs +10 -1
- package/src/runtime/agent/orchestrator/runtime-core/tool-catalog.mjs +40 -5
- package/src/runtime/agent/orchestrator/runtime-core/tool-defs.mjs +32 -11
- package/src/runtime/agent/orchestrator/runtime-core/workflow.mjs +6 -3
- package/src/runtime/agent/orchestrator/session/agent-loop.mjs +1 -1
- package/src/runtime/agent/orchestrator/session/agent-room.d.mts +13 -0
- package/src/runtime/agent/orchestrator/session/agent-room.mjs +68 -12
- package/src/runtime/agent/orchestrator/session/compact/continuation.mjs +15 -6
- package/src/runtime/agent/orchestrator/session/compact/execution-tail.mjs +31 -8
- package/src/runtime/agent/orchestrator/session/compact/messages.mjs +44 -0
- package/src/runtime/agent/orchestrator/session/compact/runner.mjs +117 -19
- package/src/runtime/agent/orchestrator/session/compact/text-utils.mjs +1 -1
- package/src/runtime/agent/orchestrator/session/compact/user-message-kind.mjs +3 -0
- package/src/runtime/agent/orchestrator/session/human-gate/delegation.mjs +147 -137
- package/src/runtime/agent/orchestrator/session/human-gate/gate.mjs +37 -74
- package/src/runtime/agent/orchestrator/session/human-gate/requests.mjs +0 -2
- package/src/runtime/agent/orchestrator/session/human-gate/run-policy.mjs +2 -2
- package/src/runtime/agent/orchestrator/session/loop/fresh-context.mjs +13 -7
- package/src/runtime/agent/orchestrator/session/loop/loop-state.mjs +5 -0
- package/src/runtime/agent/orchestrator/session/loop/no-tool-turn/continuation.mjs +2 -0
- package/src/runtime/agent/orchestrator/session/loop/no-tool-turn/empty-nudge.mjs +1 -1
- package/src/runtime/agent/orchestrator/session/loop/no-tool-turn/output-limit.mjs +62 -13
- package/src/runtime/agent/orchestrator/session/loop/no-tool-turn.mjs +22 -6
- package/src/runtime/agent/orchestrator/session/loop/send-phase.mjs +7 -0
- package/src/runtime/agent/orchestrator/session/loop/tool-exec/before-hook.mjs +12 -20
- package/src/runtime/agent/orchestrator/session/loop/tool-exec/call-prep.mjs +5 -0
- package/src/runtime/agent/orchestrator/session/loop/tool-exec/dispatch.mjs +11 -5
- package/src/runtime/agent/orchestrator/session/manager/agent-listing-notice.mjs +102 -0
- package/src/runtime/agent/orchestrator/session/manager/ask-queue.mjs +2 -0
- package/src/runtime/agent/orchestrator/session/manager/ask-session.mjs +13 -1
- package/src/runtime/agent/orchestrator/session/manager/ask-turn-execute.mjs +24 -15
- package/src/runtime/agent/orchestrator/session/manager/ask-turn-prepare.mjs +8 -0
- package/src/runtime/agent/orchestrator/session/manager/ask-turn-steering-drain.mjs +1 -0
- package/src/runtime/agent/orchestrator/session/manager/idle-cleanup.mjs +32 -1
- package/src/runtime/agent/orchestrator/session/manager/orchestration-mode-switch-notice.mjs +17 -1
- package/src/runtime/agent/orchestrator/session/manager/pending-message-entry.mjs +6 -0
- package/src/runtime/agent/orchestrator/session/manager/prompt-utils.mjs +36 -0
- package/src/runtime/agent/orchestrator/session/manager/session-crud.mjs +28 -9
- package/src/runtime/agent/orchestrator/session/manager/session-prompt-composition.mjs +1 -1
- package/src/runtime/agent/orchestrator/session/manager/session-record.mjs +7 -5
- package/src/runtime/agent/orchestrator/session/manager/session-tool-surface.mjs +7 -3
- package/src/runtime/agent/orchestrator/session/pre-send-compact.mjs +10 -1
- package/src/runtime/agent/orchestrator/session/routine-result.mjs +7 -4
- package/src/runtime/agent/orchestrator/session/runtime-user-context.mjs +3 -1
- package/src/runtime/agent/orchestrator/session/send-with-recovery.mjs +11 -2
- package/src/runtime/agent/orchestrator/session/store/sweep/stale-sweep.mjs +5 -4
- package/src/runtime/agent/orchestrator/session/store/sweep/sub-agent-retention.mjs +140 -0
- package/src/runtime/agent/orchestrator/session/store/sweep/sweep-plan.mjs +5 -0
- package/src/runtime/agent/orchestrator/session/store/sweep/sweep-record.mjs +7 -2
- package/src/runtime/agent/orchestrator/session/store/sweep/sweep-row.mjs +13 -0
- package/src/runtime/agent/orchestrator/session/store-summary-catalog.mjs +76 -0
- package/src/runtime/agent/orchestrator/session/store-summary-reader.mjs +33 -1
- package/src/runtime/agent/orchestrator/session/store-summary-visibility.d.mts +5 -0
- package/src/runtime/agent/orchestrator/session/store-summary-visibility.mjs +37 -0
- package/src/runtime/agent/orchestrator/session/store.mjs +1 -0
- package/src/runtime/agent/orchestrator/tools/builtin/advisory-lock.mjs +18 -7
- package/src/runtime/agent/orchestrator/tools/builtin/bash-tool/backgrounded-result.mjs +2 -0
- package/src/runtime/agent/orchestrator/tools/builtin/git-command-tool.mjs +127 -20
- package/src/runtime/agent/orchestrator/tools/builtin/git-worktree-tool.mjs +557 -0
- package/src/runtime/agent/orchestrator/tools/builtin/lib/shell-job-records.mjs +6 -0
- package/src/runtime/agent/orchestrator/tools/builtin/shell-jobs.mjs +8 -2
- package/src/runtime/attachments/legacy-office.mjs +110 -0
- package/src/runtime/attachments/prompt-restore.mjs +70 -0
- package/src/runtime/attachments/store.mjs +60 -3
- package/src/runtime/effort-judge/judge-client.mjs +61 -14
- package/src/runtime/effort-judge/model-install.mjs +34 -2
- package/src/runtime/memory/lib/memory-chunk-quality.mjs +14 -2
- package/src/runtime/office/portable/portable-soffice.mjs +132 -30
- package/src/runtime/shared/agent-avatar-sprites.mjs +23 -8
- package/src/runtime/shared/agent-avatar.mjs +3 -2
- package/src/runtime/shared/agent-room-host.d.mts +31 -0
- package/src/runtime/shared/agent-room-host.mjs +58 -0
- package/src/runtime/shared/bot-hops.mjs +16 -11
- package/src/runtime/shared/redact-directories.mjs +18 -0
- package/src/runtime/shared/remove-directory.mjs +28 -0
- package/src/runtime/shared/session-sidebar-host.d.mts +11 -2
- package/src/runtime/shared/session-sidebar-host.mjs +16 -3
- package/src/runtime/shared/tool-execution-contract.mjs +4 -0
- package/src/runtime/shared/tool-work-units.mjs +12 -9
- package/src/runtime/shared/turn-snapshot.mjs +233 -122
- package/src/runtime/shared/user-data-guard.mjs +51 -19
- package/src/runtime/shared/worktrees/activity-gate.mjs +209 -227
- package/src/runtime/shared/worktrees/contract.mjs +11 -3
- package/src/runtime/shared/worktrees/maintenance.mjs +11 -2
- package/src/runtime/shared/worktrees/manager.mjs +419 -52
- package/src/runtime/shared/worktrees/registry.mjs +3 -1
- package/src/runtime/shared/worktrees/tool-host.mjs +39 -0
- package/src/runtime/tidy/process.mjs +41 -8
- package/src/runtime/tidy/resolve.mjs +10 -7
- package/src/session-runtime/agent-home-delivery.mjs +73 -91
- package/src/session-runtime/agent-profile-changes.mjs +16 -0
- package/src/session-runtime/agent-room-delivery.mjs +2 -63
- package/src/session-runtime/agent-task-sessions.mjs +194 -64
- package/src/session-runtime/boot/apis.mjs +3 -0
- package/src/session-runtime/boot/facade.mjs +5 -6
- package/src/session-runtime/boot/tools.mjs +21 -1
- package/src/session-runtime/held-requests.mjs +20 -25
- package/src/session-runtime/internal-tool-executor/workspace-tools.mjs +5 -22
- package/src/session-runtime/model-recency.mjs +1 -0
- package/src/session-runtime/provider-models/row-hydration.mjs +8 -1
- package/src/session-runtime/quick-model-rows/model-meta.mjs +2 -0
- package/src/session-runtime/quick-model-rows/provider-rows.mjs +7 -1
- package/src/session-runtime/runtime-review-api.mjs +4 -1
- package/src/session-runtime/services/agent-tool/job-views/agent-list.mjs +34 -19
- package/src/session-runtime/services/agent-tool/spawn-flow/job-start.mjs +3 -0
- package/src/session-runtime/services/provider-admin.mjs +12 -2
- package/src/session-runtime/services/worktree-access.mjs +27 -0
- package/src/session-runtime/session-hooks.mjs +9 -17
- package/src/session-runtime/settings-builtin-tools-api.mjs +2 -0
- package/src/session-runtime/setup-tool/executor.mjs +4 -0
- package/src/session-runtime/setup-tool/settings-contract.mjs +3 -0
- package/src/session-runtime/tool-policy/agent-profile-fold.mjs +98 -14
- package/src/session-runtime/tool-policy/policy-stage.mjs +23 -5
- package/src/session-runtime/tool-policy-refresh.mjs +1 -0
- package/src/session-runtime/tool-surface.mjs +9 -5
- package/src/session-runtime/turn/session-ops.mjs +8 -0
- package/src/session-runtime/turn/turn-run.mjs +5 -1
- package/src/session-runtime/workflow-agents-api/agent-editor.mjs +10 -2
- package/src/session-runtime/workflow-agents-api/agent-route.mjs +39 -17
- package/src/session-runtime/workspace/transition-steps.mjs +1 -18
- package/src/session-runtime/workspace/transitions.mjs +279 -67
- package/src/session-runtime/workspace/worktree-tool.mjs +194 -0
- package/src/standalone/daemon-lag-profiler.mjs +3 -1
- package/src/standalone/daemon-session-control.mjs +140 -23
- package/src/standalone/daemon-telemetry.mjs +9 -0
- package/src/standalone/daemon.mjs +5 -0
- package/src/standalone/local-session-runtime.mjs +11 -2
- package/src/standalone/session-protocol.mjs +1 -0
- package/src/standalone/session-runtime-inline-host/boot-loaders.mjs +2 -0
- package/src/standalone/session-service/agent-route-follow.mjs +69 -0
- package/src/standalone/session-service/session-calls/session-turns.mjs +33 -4
- package/src/standalone/session-service.mjs +10 -0
- package/src/standalone/session-tool-output.mjs +1 -0
- package/src/standalone/staged-import.mjs +47 -0
- package/src/tui/App.jsx +2 -0
- package/src/tui/app/message-selector.mjs +15 -2
- package/src/tui/app/model-options.mjs +16 -2
- package/src/tui/app/model-picker.mjs +2 -1
- package/src/tui/app/route-pickers.mjs +3 -1
- package/src/tui/dist/index.mjs +92 -40
- package/src/tui/paste-attachments.mjs +0 -1
- package/src/tui/paste-text-policy.mjs +4 -5
- package/src/tui/session/agent-job-feed/execution-delivery.mjs +4 -1
- package/src/tui/session/notice-surface.mjs +3 -0
- package/src/tui/session/session-api/intake/abort.mjs +33 -17
- package/src/tui/session/session-api/intake/rewind.mjs +39 -4
- package/src/tui/session/session-api/routes-agent-definitions.mjs +1 -0
- package/src/tui/session/tool-approval.mjs +11 -48
- package/src/session-runtime/room-member-gate.mjs +0 -61
|
@@ -420,7 +420,7 @@ function customAvatarImages(dir, avatar) {
|
|
|
420
420
|
// from Mixy's identity folder: bots/mixy once the bot store is active,
|
|
421
421
|
// agents/lead before (mixyIdentityDir, agent-store.mjs). Saved empty, the
|
|
422
422
|
// file goes. `dataDirOf()` resolves the data folder on each call.
|
|
423
|
-
function createLeadIdentityApi(dataDirOf) {
|
|
423
|
+
function createLeadIdentityApi(dataDirOf, mainRoute) {
|
|
424
424
|
const leadDir = () => mixyIdentityDir(dataDirOf());
|
|
425
425
|
function readLeadFile(file) {
|
|
426
426
|
return readTextOrEmpty(join(leadDir(), file));
|
|
@@ -462,6 +462,8 @@ function createLeadIdentityApi(dataDirOf) {
|
|
|
462
462
|
route: readMixyRoute(dataDirOf()),
|
|
463
463
|
};
|
|
464
464
|
}
|
|
465
|
+
// The route Mixy's thread follows: its own, else Main's (an override cleared).
|
|
466
|
+
const getLeadHomeRoute = () => readMixyRoute(dataDirOf()) ?? mainRoute();
|
|
465
467
|
// Mixy's name and face, chosen in the 대표 에이전트 dialog or its profile:
|
|
466
468
|
// a name '' and an avatar null go back to the defaults; absent keys are kept.
|
|
467
469
|
function saveLeadIdentity(payload = {}) {
|
|
@@ -511,6 +513,7 @@ function createLeadIdentityApi(dataDirOf) {
|
|
|
511
513
|
getLeadAgentBody: () => readLeadFile('AGENT.md'),
|
|
512
514
|
saveLeadAgentBody: (text) => saveLeadFile('AGENT.md', text),
|
|
513
515
|
getLeadStatus,
|
|
516
|
+
getLeadHomeRoute,
|
|
514
517
|
saveLeadIdentity,
|
|
515
518
|
setLeadCreated,
|
|
516
519
|
// Mixy's connector policy, in its agent.json (`next` null removes it).
|
|
@@ -932,11 +935,15 @@ export function createAgentEditorApi(deps) {
|
|
|
932
935
|
getLeadAgentBody,
|
|
933
936
|
saveLeadAgentBody,
|
|
934
937
|
getLeadStatus,
|
|
938
|
+
getLeadHomeRoute,
|
|
935
939
|
saveLeadIdentity,
|
|
936
940
|
setLeadCreated,
|
|
937
941
|
getLeadConnectorPolicy,
|
|
938
942
|
setLeadConnectorPolicy,
|
|
939
|
-
} = createLeadIdentityApi(
|
|
943
|
+
} = createLeadIdentityApi(
|
|
944
|
+
() => resolveDataDir(deps),
|
|
945
|
+
() => normalizeWorkflowRoute(deps.resolveRoute(getConfig(), {}))
|
|
946
|
+
);
|
|
940
947
|
|
|
941
948
|
// The agent's connector policy (see runtime/.../mcp/agent-connectors.mjs),
|
|
942
949
|
// or null when its definition has none: every connector is on. Read as the
|
|
@@ -979,6 +986,7 @@ export function createAgentEditorApi(deps) {
|
|
|
979
986
|
getLeadAgentBody,
|
|
980
987
|
saveLeadAgentBody,
|
|
981
988
|
getLeadStatus,
|
|
989
|
+
getLeadHomeRoute,
|
|
982
990
|
setLeadCreated,
|
|
983
991
|
saveLeadIdentity,
|
|
984
992
|
saveAgentDefinition,
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { isDeepStrictEqual } from 'node:util';
|
|
1
2
|
import { clean } from '../../runtime/agent/orchestrator/runtime-core/session-text.mjs';
|
|
2
3
|
import { hasOwn } from '../../runtime/shared/object.mjs';
|
|
3
4
|
import { isHiddenAgent } from '../../runtime/agent/orchestrator/internal-agents.mjs';
|
|
@@ -10,6 +11,7 @@ import {
|
|
|
10
11
|
withAgentDisabled,
|
|
11
12
|
} from '../../runtime/shared/agent-route-config.mjs';
|
|
12
13
|
import { agentEditorId, resolveDataDir } from './shared.mjs';
|
|
14
|
+
import { publishAgentRouteChange } from '../agent-profile-changes.mjs';
|
|
13
15
|
import {
|
|
14
16
|
isStoreBot,
|
|
15
17
|
readBotRoute,
|
|
@@ -101,21 +103,38 @@ export function createAgentRouteApi(deps) {
|
|
|
101
103
|
saveConfigAndAdopt(canonicalizeAgentRouteStorage(nextConfig));
|
|
102
104
|
}
|
|
103
105
|
|
|
106
|
+
// The route a bot saved of its own ({} when none).
|
|
107
|
+
function ownRoute(id) {
|
|
108
|
+
if (isMixy(id)) return readMixyRoute(dataDir()) || {};
|
|
109
|
+
if (storeBot(id)) return readBotRoute(dataDir(), id) || {};
|
|
110
|
+
return agentRouteFromConfig(getConfig(), id) || {};
|
|
111
|
+
}
|
|
112
|
+
// The route a bot's chats run on: its own, else Main's.
|
|
113
|
+
const chatRoute = (id) => {
|
|
114
|
+
const own = ownRoute(id);
|
|
115
|
+
return normalizeWorkflowRoute(own.provider ? own : resolveRoute(getConfig(), {}));
|
|
116
|
+
};
|
|
117
|
+
// Structural, so equivalent parameter objects in another key order are the same route.
|
|
118
|
+
const plainRoute = (route) => JSON.parse(JSON.stringify(normalizeWorkflowRoute(route) ?? null));
|
|
119
|
+
const sameRoute = (a, b) => isDeepStrictEqual(plainRoute(a), plainRoute(b));
|
|
120
|
+
|
|
104
121
|
// Only an explicitly empty provider removes an override: the agent inherits Main.
|
|
105
|
-
function clearOverride(id) {
|
|
122
|
+
async function clearOverride(id) {
|
|
123
|
+
const before = chatRoute(id);
|
|
106
124
|
if (isMixy(id) || storeBot(id)) {
|
|
107
125
|
if (isMixy(id)) writeMixyRoute(dataDir(), null);
|
|
108
126
|
else writeBotRoute(dataDir(), id, null);
|
|
109
|
-
|
|
110
|
-
|
|
127
|
+
} else {
|
|
128
|
+
const nextConfig = { ...getConfig() };
|
|
129
|
+
const agents = { ...(nextConfig.agents || {}) };
|
|
130
|
+
const hadOverride = Object.hasOwn(agents, id);
|
|
131
|
+
delete agents[id];
|
|
132
|
+
nextConfig.agents = agents;
|
|
133
|
+
if (hadOverride) saveConfigAndAdopt(canonicalizeAgentRouteStorage(nextConfig));
|
|
111
134
|
}
|
|
112
|
-
const nextConfig = { ...getConfig() };
|
|
113
|
-
const agents = { ...(nextConfig.agents || {}) };
|
|
114
|
-
const hadOverride = Object.hasOwn(agents, id);
|
|
115
|
-
delete agents[id];
|
|
116
|
-
nextConfig.agents = agents;
|
|
117
|
-
if (hadOverride) saveConfigAndAdopt(canonicalizeAgentRouteStorage(nextConfig));
|
|
118
135
|
const inherited = normalizeWorkflowRoute(resolveRoute(getConfig(), {}));
|
|
136
|
+
// The bot's chats follow Main from their next turn (unless they already do).
|
|
137
|
+
if (inherited && !sameRoute(before, inherited)) await publishAgentRouteChange(id, inherited);
|
|
119
138
|
return { ...(inherited || {}), inherited: true };
|
|
120
139
|
}
|
|
121
140
|
|
|
@@ -128,16 +147,16 @@ export function createAgentRouteApi(deps) {
|
|
|
128
147
|
// picked while the model resolved below stays (answered with `skipped`).
|
|
129
148
|
const onlyIfEmpty = requested.onlyIfEmpty === true;
|
|
130
149
|
delete requested.onlyIfEmpty;
|
|
131
|
-
const readStored = () =>
|
|
132
|
-
if (isMixy(id)) return readMixyRoute(dataDir()) || {};
|
|
133
|
-
if (storeBot(id)) return readBotRoute(dataDir(), id) || {};
|
|
134
|
-
return agentRouteFromConfig(getConfig(), id) || {};
|
|
135
|
-
};
|
|
150
|
+
const readStored = () => ownRoute(id);
|
|
136
151
|
const kept = () => ({ ...readStored(), id, skipped: true });
|
|
137
152
|
const stored = readStored();
|
|
138
153
|
if (onlyIfEmpty && clean(stored.provider)) return kept();
|
|
139
|
-
// Mixy is never off: its route request is a model pick alone
|
|
140
|
-
|
|
154
|
+
// Mixy is never off: its route request is a model pick alone, and an
|
|
155
|
+
// on/off request alone changes nothing.
|
|
156
|
+
if (isMixy(id) && hasOwn(requested, 'disabled')) {
|
|
157
|
+
delete requested.disabled;
|
|
158
|
+
if (!Object.keys(requested).length) return { ...stored, id };
|
|
159
|
+
}
|
|
141
160
|
// Off is an explicit state, stored apart from the route so the model the
|
|
142
161
|
// user picked survives and comes back when the agent is switched on. An
|
|
143
162
|
// off request that also carries a model saves that model and stays off.
|
|
@@ -147,7 +166,7 @@ export function createAgentRouteApi(deps) {
|
|
|
147
166
|
// An explicitly empty provider still asks to drop the override, as it
|
|
148
167
|
// does for an agent that stays on: off and inheriting Main.
|
|
149
168
|
if (hasOwn(requested, 'provider') && !clean(requested.provider)) {
|
|
150
|
-
return { ...clearOverride(id), id, disabled: true };
|
|
169
|
+
return { ...(await clearOverride(id)), id, disabled: true };
|
|
151
170
|
}
|
|
152
171
|
return { ...stored, id, disabled: true };
|
|
153
172
|
}
|
|
@@ -189,7 +208,10 @@ export function createAgentRouteApi(deps) {
|
|
|
189
208
|
if (onlyIfEmpty && clean(readStored().provider)) return kept();
|
|
190
209
|
const stayOff = onlyIfEmpty ? isAgentDisabled(getConfig(), id) : keepOff;
|
|
191
210
|
// Picking a model is also the "on" switch unless the request keeps it off.
|
|
211
|
+
const before = chatRoute(id);
|
|
192
212
|
saveRoute(id, routeToSave, stayOff);
|
|
213
|
+
// The bot's existing chats move onto it from their next turn (unless they already run it).
|
|
214
|
+
if (!sameRoute(before, routeToSave)) await publishAgentRouteChange(id, routeToSave);
|
|
193
215
|
return stayOff ? { ...routeToSave, id, disabled: true } : routeToSave;
|
|
194
216
|
}
|
|
195
217
|
|
|
@@ -251,7 +251,6 @@ export function createTransitionSteps({
|
|
|
251
251
|
const projectPath = previous.projectPath;
|
|
252
252
|
const project = await inspectProject(projectPath, { signal });
|
|
253
253
|
let entry = await backendApi.getSessionWorktree(session.id);
|
|
254
|
-
const created = !entry;
|
|
255
254
|
if (entry) {
|
|
256
255
|
if (!existsSync(entry.path)) {
|
|
257
256
|
throw worktreeError('WORKTREE_MISSING', undefined, { worktreeId: entry.id, path: entry.path });
|
|
@@ -333,18 +332,9 @@ export function createTransitionSteps({
|
|
|
333
332
|
await backendApi.dropCarryRecoveryRef({ projectPath, recoveryRef: entry.changes.recoveryRef }).catch(() => {});
|
|
334
333
|
}
|
|
335
334
|
// Creation notes (submodules, include entries missing or already present).
|
|
336
|
-
//
|
|
337
|
-
// (`prepared`: what creation did and what the turn still has to run).
|
|
335
|
+
// A new checkout's first-turn preparation stays pending in its registry entry.
|
|
338
336
|
return {
|
|
339
337
|
...entered,
|
|
340
|
-
...(created
|
|
341
|
-
? {
|
|
342
|
-
created: {
|
|
343
|
-
prepared: entry.prepared ?? null,
|
|
344
|
-
root: entry.prepared?.root || project.topLevel || projectPath,
|
|
345
|
-
},
|
|
346
|
-
}
|
|
347
|
-
: {}),
|
|
348
338
|
warnings: Array.isArray(entry.warnings) ? [...entry.warnings] : [],
|
|
349
339
|
...(entry.changes ? { changes: { mode: entry.changes.mode, count: entry.changes.count } } : {}),
|
|
350
340
|
};
|
|
@@ -395,13 +385,6 @@ export function createTransitionSteps({
|
|
|
395
385
|
journal.push(() => backendApi.claimWorktreeOwner(previous.worktreeId, owner(session.id)));
|
|
396
386
|
await releaseOwner(backendApi, previous.worktreeId, session.id, { forgetReference: true });
|
|
397
387
|
}
|
|
398
|
-
// A managed worktree made for the branch: its first-turn preparation awaits.
|
|
399
|
-
if (resolved.created === true && entry) {
|
|
400
|
-
return {
|
|
401
|
-
...result,
|
|
402
|
-
created: { prepared: entry.prepared ?? null, root: entry.prepared?.root || project.topLevel || projectPath },
|
|
403
|
-
};
|
|
404
|
-
}
|
|
405
388
|
return result;
|
|
406
389
|
}
|
|
407
390
|
|