@howaboua/pi-shepherdr 0.2.12 → 0.2.14
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 +14 -0
- package/README.md +18 -10
- package/package.json +6 -6
- package/src/agents-answer.ts +22 -0
- package/src/agents-discovery.ts +3 -3
- package/src/agents-tool.ts +2 -1
- package/src/ask-answer.ts +32 -18
- package/src/attachment-notes.ts +49 -0
- package/src/attachment-protocol.ts +14 -1
- package/src/attachment-routing.ts +27 -10
- package/src/attachment-target.ts +70 -20
- package/src/attachment.ts +48 -20
- package/src/board/awareness.ts +115 -0
- package/src/board/host.ts +46 -6
- package/src/board/tool.ts +0 -3
- package/src/context-briefing.ts +226 -0
- package/src/controller.ts +81 -14
- package/src/delivery.ts +33 -0
- package/src/messages.ts +86 -15
- package/src/monitor-questions.ts +249 -0
- package/src/monitor-record.ts +6 -0
- package/src/monitor-state.ts +10 -4
- package/src/monitor.ts +40 -2
- package/src/remote/shepherdr-session-watch.mjs +72 -0
- package/src/remote/shepherdr-session.mjs +32 -2
- package/src/remote/shepherdr.mjs +21 -1
- package/src/remote-client.ts +66 -24
- package/src/session-reader.ts +49 -3
- package/src/shared-context.ts +46 -8
- package/src/types.ts +2 -0
package/src/shared-context.ts
CHANGED
|
@@ -10,7 +10,11 @@ import type {
|
|
|
10
10
|
} from "@howaboua/pi-codex-conversion/context-sharing";
|
|
11
11
|
import { Check } from "typebox/value";
|
|
12
12
|
import { AgentAttachment } from "./attachment.js";
|
|
13
|
-
import {
|
|
13
|
+
import {
|
|
14
|
+
attachmentOwner,
|
|
15
|
+
attachmentRoutes,
|
|
16
|
+
Identity,
|
|
17
|
+
} from "./attachment-protocol.js";
|
|
14
18
|
import type { AgentBoard } from "./board/host.js";
|
|
15
19
|
import { isBoardEnvelope } from "./board/protocol.js";
|
|
16
20
|
import type { AgentFleet, ConnectedMachine } from "./fleet.js";
|
|
@@ -82,7 +86,7 @@ export class SharedAgentContext {
|
|
|
82
86
|
value.operation === "attachment-export-notes" ||
|
|
83
87
|
value.operation === "detach-commit")
|
|
84
88
|
)
|
|
85
|
-
return this.attachment.target.handle(ctx, value);
|
|
89
|
+
return this.attachment.target.handle(ctx, value, signal);
|
|
86
90
|
const service = this.getService();
|
|
87
91
|
const identity = service?.describe(ctx);
|
|
88
92
|
if (
|
|
@@ -311,12 +315,46 @@ export async function registerSharedAgentContext(
|
|
|
311
315
|
close = undefined;
|
|
312
316
|
unregister?.();
|
|
313
317
|
unregister = connection?.service?.registerRouter(
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
context,
|
|
317
|
-
|
|
318
|
-
signal,
|
|
319
|
-
)
|
|
318
|
+
Object.assign(
|
|
319
|
+
async (
|
|
320
|
+
context: ExtensionContext,
|
|
321
|
+
request: SharedContextRequest,
|
|
322
|
+
signal?: AbortSignal,
|
|
323
|
+
) => {
|
|
324
|
+
const attached = await shared.attachment.routing.route(
|
|
325
|
+
context,
|
|
326
|
+
request,
|
|
327
|
+
[],
|
|
328
|
+
(route, next) =>
|
|
329
|
+
fleet
|
|
330
|
+
.connected(route.machine)
|
|
331
|
+
.client.requestContext(
|
|
332
|
+
sessionContextPath(route.sessionFile),
|
|
333
|
+
next,
|
|
334
|
+
signal,
|
|
335
|
+
),
|
|
336
|
+
signal,
|
|
337
|
+
);
|
|
338
|
+
if (attached) return attached;
|
|
339
|
+
if (connection?.service?.describe(context)?.storage === "remote")
|
|
340
|
+
return undefined;
|
|
341
|
+
return shared.handle(
|
|
342
|
+
context,
|
|
343
|
+
{ operation: "context", request, visited: [] },
|
|
344
|
+
signal,
|
|
345
|
+
) as Promise<SharedContextResult>;
|
|
346
|
+
},
|
|
347
|
+
{
|
|
348
|
+
requiresRemoteScope: (context: ExtensionContext) =>
|
|
349
|
+
attachmentOwner(context)?.context?.controller.storage ===
|
|
350
|
+
"remote" ||
|
|
351
|
+
attachmentRoutes(context).some(
|
|
352
|
+
(route) =>
|
|
353
|
+
route.phase === "ready" &&
|
|
354
|
+
route.plan.context?.target.storage === "remote",
|
|
355
|
+
),
|
|
356
|
+
},
|
|
357
|
+
),
|
|
320
358
|
);
|
|
321
359
|
const file = ctx.sessionManager.getSessionFile();
|
|
322
360
|
if (file)
|
package/src/types.ts
CHANGED
|
@@ -78,6 +78,7 @@ export interface MonitoredAgent {
|
|
|
78
78
|
readonly activity: AgentActivity;
|
|
79
79
|
readonly cwd?: string;
|
|
80
80
|
readonly lastAssistantId?: string;
|
|
81
|
+
readonly lastQuestionId?: string;
|
|
81
82
|
readonly name?: string;
|
|
82
83
|
readonly paneId: string;
|
|
83
84
|
readonly tabId: string;
|
|
@@ -119,6 +120,7 @@ export interface LatestInput {
|
|
|
119
120
|
}
|
|
120
121
|
|
|
121
122
|
export interface PendingAsk {
|
|
123
|
+
delivery?: "steer";
|
|
122
124
|
handoff: boolean;
|
|
123
125
|
prompts: Array<{
|
|
124
126
|
body?: string;
|