@howaboua/pi-shepherdr 0.2.10 → 0.2.12
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/CHANGELOG.md +19 -0
- package/README.md +38 -10
- package/package.json +6 -6
- package/src/agents-contract.ts +15 -0
- package/src/agents-discovery.ts +6 -0
- package/src/agents-tool.ts +11 -0
- package/src/attachment-notes.ts +132 -0
- package/src/attachment-protocol.ts +142 -0
- package/src/attachment-routing.ts +171 -0
- package/src/attachment-target.ts +271 -0
- package/src/attachment.ts +299 -0
- package/src/board/config.ts +16 -3
- package/src/board/host.ts +28 -26
- package/src/board/identity.ts +14 -0
- package/src/board/membership.ts +187 -0
- package/src/board/protocol.ts +5 -0
- package/src/board/tool.ts +3 -0
- package/src/control-panel-actions.ts +110 -0
- package/src/control-panel-items.ts +91 -0
- package/src/control-panel-view.ts +282 -0
- package/src/control-panel.ts +142 -0
- package/src/controller.ts +79 -87
- package/src/fleet.ts +19 -4
- package/src/machine-catalog.ts +19 -13
- package/src/messages.ts +39 -0
- package/src/remote/shepherdr-checkpoints.mjs +98 -0
- package/src/remote/shepherdr-context.mjs +45 -0
- package/src/remote/shepherdr.mjs +1 -1
- package/src/remote-client.ts +10 -3
- package/src/setup-process.ts +151 -0
- package/src/shared-context.ts +44 -0
- package/src/ssh-setup.ts +144 -0
- package/src/types.ts +2 -0
- package/src/widget.ts +1 -3
- package/src/board/settings.ts +0 -98
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
import { isDeepStrictEqual } from "node:util";
|
|
2
|
+
import type { ExtensionContext } from "@earendil-works/pi-coding-agent";
|
|
3
|
+
import type {
|
|
4
|
+
ContextSharingService,
|
|
5
|
+
SharedContextRequest,
|
|
6
|
+
SharedContextResult,
|
|
7
|
+
} from "@howaboua/pi-codex-conversion/context-sharing";
|
|
8
|
+
import type { AttachmentNotes } from "./attachment-notes.js";
|
|
9
|
+
import {
|
|
10
|
+
type AttachmentRoute,
|
|
11
|
+
attachmentOwner,
|
|
12
|
+
attachmentRoutes,
|
|
13
|
+
detachment,
|
|
14
|
+
inside,
|
|
15
|
+
remap,
|
|
16
|
+
remapParams,
|
|
17
|
+
remapResult,
|
|
18
|
+
} from "./attachment-protocol.js";
|
|
19
|
+
import {
|
|
20
|
+
requestContext,
|
|
21
|
+
sessionContextPath,
|
|
22
|
+
} from "./remote/shepherdr-context.mjs";
|
|
23
|
+
|
|
24
|
+
/** Routes counterpart aliases and preserves read-only checkpoint recovery policy. */
|
|
25
|
+
export class AttachmentRouting {
|
|
26
|
+
private readonly getService: () => ContextSharingService | undefined;
|
|
27
|
+
private readonly notes: AttachmentNotes;
|
|
28
|
+
constructor(
|
|
29
|
+
getService: () => ContextSharingService | undefined,
|
|
30
|
+
notes: AttachmentNotes,
|
|
31
|
+
) {
|
|
32
|
+
this.getService = getService;
|
|
33
|
+
this.notes = notes;
|
|
34
|
+
}
|
|
35
|
+
async route(
|
|
36
|
+
ctx: ExtensionContext,
|
|
37
|
+
request: SharedContextRequest,
|
|
38
|
+
visited: string[],
|
|
39
|
+
send: (route: AttachmentRoute, request: unknown) => Promise<unknown>,
|
|
40
|
+
signal?: AbortSignal,
|
|
41
|
+
): Promise<SharedContextResult | undefined> {
|
|
42
|
+
const native = this.getService()?.describe(ctx);
|
|
43
|
+
if (
|
|
44
|
+
!native ||
|
|
45
|
+
native.storage !== "session" ||
|
|
46
|
+
request.sessionId !== native.sessionId
|
|
47
|
+
)
|
|
48
|
+
return undefined;
|
|
49
|
+
const child = attachmentRoutes(ctx).find(
|
|
50
|
+
(route) =>
|
|
51
|
+
route.phase === "ready" &&
|
|
52
|
+
route.plan.context &&
|
|
53
|
+
inside(request.agentName, route.plan.context.alias),
|
|
54
|
+
);
|
|
55
|
+
if (child?.plan.context) {
|
|
56
|
+
const link = child.plan.context;
|
|
57
|
+
if (!isDeepStrictEqual(native, link.controller))
|
|
58
|
+
throw new Error(
|
|
59
|
+
"Attached controller context changed; restore its original storage",
|
|
60
|
+
);
|
|
61
|
+
const next = {
|
|
62
|
+
...request,
|
|
63
|
+
sessionId: link.target.sessionId,
|
|
64
|
+
agentName: remap(request.agentName, link.alias, link.target.agentName),
|
|
65
|
+
params: remapParams(request.params, link.alias, link.target.agentName),
|
|
66
|
+
};
|
|
67
|
+
let result: SharedContextResult;
|
|
68
|
+
if (!child.detached?.context) {
|
|
69
|
+
try {
|
|
70
|
+
result = (await send(child, {
|
|
71
|
+
operation: "context",
|
|
72
|
+
request: next,
|
|
73
|
+
visited,
|
|
74
|
+
})) as SharedContextResult;
|
|
75
|
+
} catch (error) {
|
|
76
|
+
signal?.throwIfAborted();
|
|
77
|
+
if (!this.notes.canRead(next) || !this.notes.unavailable(error))
|
|
78
|
+
throw error;
|
|
79
|
+
result = await this.notes.read(
|
|
80
|
+
next,
|
|
81
|
+
link.target,
|
|
82
|
+
link.targetNotes,
|
|
83
|
+
false,
|
|
84
|
+
() =>
|
|
85
|
+
send(child, {
|
|
86
|
+
operation: "attachment-persisted-notes",
|
|
87
|
+
identity: link.target,
|
|
88
|
+
}),
|
|
89
|
+
error,
|
|
90
|
+
);
|
|
91
|
+
}
|
|
92
|
+
} else
|
|
93
|
+
result = await this.notes.read(
|
|
94
|
+
next,
|
|
95
|
+
link.target,
|
|
96
|
+
child.detached.context,
|
|
97
|
+
true,
|
|
98
|
+
async () => undefined,
|
|
99
|
+
);
|
|
100
|
+
return remapResult(result, link.target.agentName, link.alias);
|
|
101
|
+
}
|
|
102
|
+
const owner = attachmentOwner(ctx);
|
|
103
|
+
const link = owner?.context;
|
|
104
|
+
if (owner && link && inside(request.agentName, link.controllerAlias)) {
|
|
105
|
+
if (!isDeepStrictEqual(native, link.target))
|
|
106
|
+
throw new Error(
|
|
107
|
+
"Attached target context changed; restore its original storage",
|
|
108
|
+
);
|
|
109
|
+
const next = {
|
|
110
|
+
...request,
|
|
111
|
+
sessionId: link.controller.sessionId,
|
|
112
|
+
agentName: remap(
|
|
113
|
+
request.agentName,
|
|
114
|
+
link.controllerAlias,
|
|
115
|
+
link.controller.agentName,
|
|
116
|
+
),
|
|
117
|
+
params: remapParams(
|
|
118
|
+
request.params,
|
|
119
|
+
link.controllerAlias,
|
|
120
|
+
link.controller.agentName,
|
|
121
|
+
),
|
|
122
|
+
};
|
|
123
|
+
const detached = detachment(ctx, owner)?.context;
|
|
124
|
+
let result: SharedContextResult;
|
|
125
|
+
if (!detached) {
|
|
126
|
+
try {
|
|
127
|
+
result = (await requestContext(
|
|
128
|
+
owner.upstream,
|
|
129
|
+
{ operation: "context", request: next, visited },
|
|
130
|
+
signal,
|
|
131
|
+
)) as SharedContextResult;
|
|
132
|
+
} catch (error) {
|
|
133
|
+
signal?.throwIfAborted();
|
|
134
|
+
if (!this.notes.canRead(next) || !this.notes.unavailable(error))
|
|
135
|
+
throw error;
|
|
136
|
+
result = await this.notes.read(
|
|
137
|
+
next,
|
|
138
|
+
link.controller,
|
|
139
|
+
link.controllerNotes,
|
|
140
|
+
false,
|
|
141
|
+
() =>
|
|
142
|
+
requestContext(
|
|
143
|
+
link.controllerFile
|
|
144
|
+
? sessionContextPath(link.controllerFile)
|
|
145
|
+
: owner.upstream,
|
|
146
|
+
{
|
|
147
|
+
operation: "attachment-persisted-notes",
|
|
148
|
+
identity: link.controller,
|
|
149
|
+
},
|
|
150
|
+
signal,
|
|
151
|
+
),
|
|
152
|
+
error,
|
|
153
|
+
);
|
|
154
|
+
}
|
|
155
|
+
} else
|
|
156
|
+
result = await this.notes.read(
|
|
157
|
+
next,
|
|
158
|
+
link.controller,
|
|
159
|
+
detached,
|
|
160
|
+
true,
|
|
161
|
+
async () => undefined,
|
|
162
|
+
);
|
|
163
|
+
return remapResult(
|
|
164
|
+
result,
|
|
165
|
+
link.controller.agentName,
|
|
166
|
+
link.controllerAlias,
|
|
167
|
+
);
|
|
168
|
+
}
|
|
169
|
+
return undefined;
|
|
170
|
+
}
|
|
171
|
+
}
|
|
@@ -0,0 +1,271 @@
|
|
|
1
|
+
import { isDeepStrictEqual } from "node:util";
|
|
2
|
+
import type {
|
|
3
|
+
ExtensionAPI,
|
|
4
|
+
ExtensionContext,
|
|
5
|
+
} from "@earendil-works/pi-coding-agent";
|
|
6
|
+
import type { ContextSharingService } from "@howaboua/pi-codex-conversion/context-sharing";
|
|
7
|
+
import type { Static } from "typebox";
|
|
8
|
+
import { Check } from "typebox/value";
|
|
9
|
+
import { AttachmentNotes } from "./attachment-notes.js";
|
|
10
|
+
import {
|
|
11
|
+
type AttachmentPlan,
|
|
12
|
+
attachmentOwner,
|
|
13
|
+
attachmentRoutes,
|
|
14
|
+
DETACHED,
|
|
15
|
+
Detachment,
|
|
16
|
+
detachment,
|
|
17
|
+
Identity,
|
|
18
|
+
OWNER,
|
|
19
|
+
Plan,
|
|
20
|
+
} from "./attachment-protocol.js";
|
|
21
|
+
import type { AgentBoard } from "./board/host.js";
|
|
22
|
+
import { binding } from "./board/identity.js";
|
|
23
|
+
import { sendPolicyMessage } from "./delivery.js";
|
|
24
|
+
import { attachmentMessage, detachmentMessage } from "./messages.js";
|
|
25
|
+
|
|
26
|
+
/** Validates and commits attachment membership in the settled target session. */
|
|
27
|
+
export class AttachmentTarget {
|
|
28
|
+
private readonly pi: ExtensionAPI;
|
|
29
|
+
private readonly board: AgentBoard;
|
|
30
|
+
private readonly getService: () => ContextSharingService | undefined;
|
|
31
|
+
private readonly notes: AttachmentNotes;
|
|
32
|
+
constructor(
|
|
33
|
+
pi: ExtensionAPI,
|
|
34
|
+
board: AgentBoard,
|
|
35
|
+
getService: () => ContextSharingService | undefined,
|
|
36
|
+
notes: AttachmentNotes,
|
|
37
|
+
) {
|
|
38
|
+
this.pi = pi;
|
|
39
|
+
this.board = board;
|
|
40
|
+
this.getService = getService;
|
|
41
|
+
this.notes = notes;
|
|
42
|
+
}
|
|
43
|
+
context(ctx: ExtensionContext, target: boolean) {
|
|
44
|
+
const service = this.getService();
|
|
45
|
+
if (!service?.inspectAttachment || !service.retainAttachmentIdentity)
|
|
46
|
+
throw new Error("Update Codex Conversion to attach existing context");
|
|
47
|
+
const identity = target
|
|
48
|
+
? service.inspectAttachment(ctx)
|
|
49
|
+
: service.describe(ctx);
|
|
50
|
+
if (!identity || !Check(Identity, identity))
|
|
51
|
+
throw new Error(
|
|
52
|
+
"Context attachment requires Local or Tree on both agents; Remote attachment is unsupported",
|
|
53
|
+
);
|
|
54
|
+
return identity as Static<typeof Identity>;
|
|
55
|
+
}
|
|
56
|
+
retainIdentity(ctx: ExtensionContext) {
|
|
57
|
+
const service = this.getService();
|
|
58
|
+
if (!service?.retainAttachmentIdentity)
|
|
59
|
+
throw new Error(
|
|
60
|
+
"Context attachment support became unavailable; reload and retry",
|
|
61
|
+
);
|
|
62
|
+
service.retainAttachmentIdentity(ctx);
|
|
63
|
+
}
|
|
64
|
+
private inspect(ctx: ExtensionContext) {
|
|
65
|
+
if (!ctx.isIdle()) throw new Error("Attach only after the target settles");
|
|
66
|
+
if (!ctx.sessionManager.getSessionFile())
|
|
67
|
+
throw new Error("Attachment requires a saved target session");
|
|
68
|
+
let context: Static<typeof Identity> | undefined;
|
|
69
|
+
let contextError: string | undefined;
|
|
70
|
+
let boardError: string | undefined;
|
|
71
|
+
try {
|
|
72
|
+
context = this.context(ctx, true);
|
|
73
|
+
if (
|
|
74
|
+
attachmentRoutes(ctx).some((route) => route.plan.context) ||
|
|
75
|
+
ctx.sessionManager
|
|
76
|
+
.getEntries()
|
|
77
|
+
.some(
|
|
78
|
+
(entry) =>
|
|
79
|
+
entry.type === "custom" &&
|
|
80
|
+
entry.customType === "herdr-context-child" &&
|
|
81
|
+
(entry.data as { threadId?: unknown } | undefined)?.threadId ===
|
|
82
|
+
context?.threadId,
|
|
83
|
+
)
|
|
84
|
+
)
|
|
85
|
+
throw new Error("Target already controls a context family");
|
|
86
|
+
} catch (error) {
|
|
87
|
+
context = undefined;
|
|
88
|
+
contextError = String(error);
|
|
89
|
+
}
|
|
90
|
+
try {
|
|
91
|
+
this.board.membership.inspectAttachment(ctx);
|
|
92
|
+
} catch (error) {
|
|
93
|
+
boardError = String(error);
|
|
94
|
+
}
|
|
95
|
+
return {
|
|
96
|
+
sessionId: ctx.sessionManager.getSessionId(),
|
|
97
|
+
board: binding(ctx),
|
|
98
|
+
...(context ? { context, notes: this.notes.export(ctx) } : {}),
|
|
99
|
+
...(contextError ? { contextError } : {}),
|
|
100
|
+
...(boardError ? { boardError } : {}),
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
async handle(ctx: ExtensionContext, input: unknown): Promise<unknown> {
|
|
104
|
+
if (!input || typeof input !== "object" || !("operation" in input))
|
|
105
|
+
throw new Error("Invalid attachment request");
|
|
106
|
+
if (input.operation === "attach-inspect") return this.inspect(ctx);
|
|
107
|
+
if (input.operation === "attachment-export-notes") {
|
|
108
|
+
if (
|
|
109
|
+
!("plan" in input) ||
|
|
110
|
+
!Check(Plan, input.plan) ||
|
|
111
|
+
!isDeepStrictEqual(attachmentOwner(ctx), input.plan)
|
|
112
|
+
)
|
|
113
|
+
throw new Error("Invalid checkpoint owner");
|
|
114
|
+
return this.notes.export(ctx);
|
|
115
|
+
}
|
|
116
|
+
if (input.operation === "detach-commit")
|
|
117
|
+
return this.commitDetach(ctx, input);
|
|
118
|
+
if (
|
|
119
|
+
input.operation !== "attach-commit" ||
|
|
120
|
+
!("plan" in input) ||
|
|
121
|
+
!Check(Plan, input.plan)
|
|
122
|
+
)
|
|
123
|
+
throw new Error("Invalid attachment request");
|
|
124
|
+
const plan = input.plan as AttachmentPlan;
|
|
125
|
+
if (
|
|
126
|
+
(!plan.context && !plan.board) ||
|
|
127
|
+
plan.controllerSessionId === plan.targetSessionId ||
|
|
128
|
+
(plan.context &&
|
|
129
|
+
(plan.context.controller.threadId !== plan.controllerSessionId ||
|
|
130
|
+
plan.context.target.threadId !== plan.targetSessionId ||
|
|
131
|
+
!plan.context.alias.startsWith(
|
|
132
|
+
`${plan.context.controller.agentName}/`,
|
|
133
|
+
) ||
|
|
134
|
+
!plan.context.controllerAlias.startsWith(
|
|
135
|
+
`${plan.context.target.agentName}/`,
|
|
136
|
+
))) ||
|
|
137
|
+
(plan.board &&
|
|
138
|
+
(plan.board.controller.sessionId !== plan.controllerSessionId ||
|
|
139
|
+
plan.board.previous.sessionId !== plan.targetSessionId ||
|
|
140
|
+
!isDeepStrictEqual(plan.board.desired, {
|
|
141
|
+
...plan.board.controller,
|
|
142
|
+
agentName: plan.board.desired.agentName,
|
|
143
|
+
upstream: plan.upstream,
|
|
144
|
+
}) ||
|
|
145
|
+
!plan.board.desired.agentName.startsWith(
|
|
146
|
+
`${plan.board.controller.agentName}/`,
|
|
147
|
+
)))
|
|
148
|
+
)
|
|
149
|
+
throw new Error("Invalid attachment identities or routes");
|
|
150
|
+
if (
|
|
151
|
+
!ctx.isIdle() ||
|
|
152
|
+
ctx.sessionManager.getSessionId() !== plan.targetSessionId
|
|
153
|
+
)
|
|
154
|
+
throw new Error(
|
|
155
|
+
"Target changed or started work during attachment; retry after it settles",
|
|
156
|
+
);
|
|
157
|
+
const owner = attachmentOwner(ctx);
|
|
158
|
+
if (owner && detachment(ctx, owner))
|
|
159
|
+
throw new Error("Attachment was detached; reattachment is unsupported");
|
|
160
|
+
if (owner && !isDeepStrictEqual(owner, plan))
|
|
161
|
+
throw new Error(
|
|
162
|
+
"Target is already attached; another controller or different attachment choices are unsupported",
|
|
163
|
+
);
|
|
164
|
+
if (!owner) {
|
|
165
|
+
const current = this.inspect(ctx);
|
|
166
|
+
if (
|
|
167
|
+
plan.context &&
|
|
168
|
+
(!current.context ||
|
|
169
|
+
!isDeepStrictEqual(current.context, plan.context.target))
|
|
170
|
+
)
|
|
171
|
+
throw new Error(
|
|
172
|
+
current.contextError ?? "Target context changed during attachment",
|
|
173
|
+
);
|
|
174
|
+
if (plan.board && current.boardError) throw new Error(current.boardError);
|
|
175
|
+
if (plan.board && !isDeepStrictEqual(current.board, plan.board.previous))
|
|
176
|
+
throw new Error("Target board changed during attachment");
|
|
177
|
+
// All checks precede either mutation; no await between the two commits.
|
|
178
|
+
if (plan.context) {
|
|
179
|
+
this.notes.validate(
|
|
180
|
+
plan.context.controllerNotes,
|
|
181
|
+
plan.context.controller,
|
|
182
|
+
);
|
|
183
|
+
this.notes.validate(plan.context.targetNotes, plan.context.target);
|
|
184
|
+
}
|
|
185
|
+
if (plan.context) this.retainIdentity(ctx);
|
|
186
|
+
if (plan.board)
|
|
187
|
+
this.board.membership.commitAttachment(
|
|
188
|
+
ctx,
|
|
189
|
+
plan.board.previous,
|
|
190
|
+
plan.board.desired,
|
|
191
|
+
);
|
|
192
|
+
this.pi.appendEntry(OWNER, plan);
|
|
193
|
+
sendPolicyMessage(
|
|
194
|
+
this.pi,
|
|
195
|
+
attachmentMessage(
|
|
196
|
+
plan.context?.controllerAlias,
|
|
197
|
+
plan.board?.desired.agentName,
|
|
198
|
+
),
|
|
199
|
+
{ triggerTurn: false },
|
|
200
|
+
);
|
|
201
|
+
} else {
|
|
202
|
+
if (
|
|
203
|
+
plan.context &&
|
|
204
|
+
!isDeepStrictEqual(this.context(ctx, false), plan.context.target)
|
|
205
|
+
)
|
|
206
|
+
throw new Error("Attached context changed; restore Local or Tree");
|
|
207
|
+
if (
|
|
208
|
+
plan.board &&
|
|
209
|
+
!isDeepStrictEqual(binding(ctx), {
|
|
210
|
+
...plan.board.desired,
|
|
211
|
+
sessionId: plan.targetSessionId,
|
|
212
|
+
})
|
|
213
|
+
)
|
|
214
|
+
throw new Error("Attached board changed; resolve the target again");
|
|
215
|
+
}
|
|
216
|
+
if (plan.board) await this.board.refresh(ctx);
|
|
217
|
+
if (ctx.sessionManager.getSessionId() !== plan.targetSessionId)
|
|
218
|
+
throw new Error(
|
|
219
|
+
"Target session changed after attachment; resume it and retry",
|
|
220
|
+
);
|
|
221
|
+
return plan;
|
|
222
|
+
}
|
|
223
|
+
private async commitDetach(ctx: ExtensionContext, input: unknown) {
|
|
224
|
+
if (!Check(Detachment, input)) throw new Error("Invalid detach request");
|
|
225
|
+
const requested = input as Static<typeof Detachment>;
|
|
226
|
+
const { plan } = requested;
|
|
227
|
+
if (
|
|
228
|
+
!isDeepStrictEqual(attachmentOwner(ctx), plan) ||
|
|
229
|
+
ctx.sessionManager.getSessionId() !== plan.targetSessionId ||
|
|
230
|
+
!ctx.isIdle()
|
|
231
|
+
)
|
|
232
|
+
throw new Error("Detach requires the original settled target session");
|
|
233
|
+
if (
|
|
234
|
+
(!requested.context && !requested.board) ||
|
|
235
|
+
(requested.context && !plan.context) ||
|
|
236
|
+
(requested.board && !plan.board)
|
|
237
|
+
)
|
|
238
|
+
throw new Error("Invalid detach choices");
|
|
239
|
+
const previous = detachment(ctx, plan);
|
|
240
|
+
if (requested.context && plan.context) {
|
|
241
|
+
if (!isDeepStrictEqual(this.context(ctx, false), plan.context.target))
|
|
242
|
+
throw new Error("Target context changed before detach");
|
|
243
|
+
this.notes.validate(requested.context, plan.context.controller);
|
|
244
|
+
}
|
|
245
|
+
const ownNotes = requested.context ? this.notes.export(ctx) : undefined;
|
|
246
|
+
if (ownNotes) this.notes.checkTransport(ownNotes);
|
|
247
|
+
if (requested.board && plan.board && !previous?.board)
|
|
248
|
+
this.board.membership.detachTarget(
|
|
249
|
+
ctx,
|
|
250
|
+
plan.board.desired,
|
|
251
|
+
plan.board.previous,
|
|
252
|
+
);
|
|
253
|
+
this.pi.appendEntry(DETACHED, { ...previous, ...requested });
|
|
254
|
+
const contextAlias =
|
|
255
|
+
requested.context && !previous?.context
|
|
256
|
+
? plan.context?.controllerAlias
|
|
257
|
+
: undefined;
|
|
258
|
+
const restoredBoard =
|
|
259
|
+
requested.board && !previous?.board ? plan.board?.previous : undefined;
|
|
260
|
+
if (contextAlias || restoredBoard)
|
|
261
|
+
sendPolicyMessage(
|
|
262
|
+
this.pi,
|
|
263
|
+
detachmentMessage(contextAlias, restoredBoard),
|
|
264
|
+
{ triggerTurn: false },
|
|
265
|
+
);
|
|
266
|
+
if (requested.board) await this.board.refresh(ctx);
|
|
267
|
+
if (ctx.sessionManager.getSessionId() !== plan.targetSessionId)
|
|
268
|
+
throw new Error("Target changed after detach; resume it and retry");
|
|
269
|
+
return { detached: true, ...(ownNotes ? { notes: ownNotes } : {}) };
|
|
270
|
+
}
|
|
271
|
+
}
|