@caupulican/pi-adaptative 0.94.0 → 0.94.1
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 +16 -0
- package/dist/core/agent-paths.d.ts +2 -0
- package/dist/core/agent-paths.d.ts.map +1 -1
- package/dist/core/agent-paths.js +7 -0
- package/dist/core/agent-paths.js.map +1 -1
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +5 -1
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/background-lane-controller.d.ts +8 -0
- package/dist/core/background-lane-controller.d.ts.map +1 -1
- package/dist/core/background-lane-controller.js +75 -5
- package/dist/core/background-lane-controller.js.map +1 -1
- package/dist/core/background-tool-task-controller.d.ts +15 -0
- package/dist/core/background-tool-task-controller.d.ts.map +1 -1
- package/dist/core/background-tool-task-controller.js +122 -15
- package/dist/core/background-tool-task-controller.js.map +1 -1
- package/dist/core/context/long-term-memory-trigger.d.ts +3 -1
- package/dist/core/context/long-term-memory-trigger.d.ts.map +1 -1
- package/dist/core/context/long-term-memory-trigger.js +1 -1
- package/dist/core/context/long-term-memory-trigger.js.map +1 -1
- package/dist/core/context/okf-memory-provider.d.ts +3 -0
- package/dist/core/context/okf-memory-provider.d.ts.map +1 -1
- package/dist/core/context/okf-memory-provider.js +66 -31
- package/dist/core/context/okf-memory-provider.js.map +1 -1
- package/dist/core/context/okf-memory.d.ts +18 -1
- package/dist/core/context/okf-memory.d.ts.map +1 -1
- package/dist/core/context/okf-memory.js +48 -0
- package/dist/core/context/okf-memory.js.map +1 -1
- package/dist/core/delegation/worker-agent-control.d.ts +4 -0
- package/dist/core/delegation/worker-agent-control.d.ts.map +1 -1
- package/dist/core/delegation/worker-agent-control.js.map +1 -1
- package/dist/core/delegation/worker-execution-policy.d.ts.map +1 -1
- package/dist/core/delegation/worker-execution-policy.js +1 -1
- package/dist/core/delegation/worker-execution-policy.js.map +1 -1
- package/dist/core/delegation/worker-notification-coordinator.d.ts +10 -0
- package/dist/core/delegation/worker-notification-coordinator.d.ts.map +1 -1
- package/dist/core/delegation/worker-notification-coordinator.js +69 -3
- package/dist/core/delegation/worker-notification-coordinator.js.map +1 -1
- package/dist/core/foreground-terminal-handoff-controller.d.ts +17 -0
- package/dist/core/foreground-terminal-handoff-controller.d.ts.map +1 -1
- package/dist/core/foreground-terminal-handoff-controller.js +78 -10
- package/dist/core/foreground-terminal-handoff-controller.js.map +1 -1
- package/dist/core/learning/learning-audit.d.ts +5 -1
- package/dist/core/learning/learning-audit.d.ts.map +1 -1
- package/dist/core/learning/learning-audit.js +32 -1
- package/dist/core/learning/learning-audit.js.map +1 -1
- package/dist/core/learning/reflection-engine.d.ts +20 -0
- package/dist/core/learning/reflection-engine.d.ts.map +1 -1
- package/dist/core/learning/reflection-engine.js +58 -0
- package/dist/core/learning/reflection-engine.js.map +1 -1
- package/dist/core/memory/okf-project-memory-store.d.ts +28 -0
- package/dist/core/memory/okf-project-memory-store.d.ts.map +1 -0
- package/dist/core/memory/okf-project-memory-store.js +111 -0
- package/dist/core/memory/okf-project-memory-store.js.map +1 -0
- package/dist/core/memory/providers/file-store.d.ts +42 -1
- package/dist/core/memory/providers/file-store.d.ts.map +1 -1
- package/dist/core/memory/providers/file-store.js +274 -13
- package/dist/core/memory/providers/file-store.js.map +1 -1
- package/dist/core/memory-controller.d.ts +10 -1
- package/dist/core/memory-controller.d.ts.map +1 -1
- package/dist/core/memory-controller.js +72 -8
- package/dist/core/memory-controller.js.map +1 -1
- package/dist/core/provider-prompt-contracts.d.ts.map +1 -1
- package/dist/core/provider-prompt-contracts.js +9 -19
- package/dist/core/provider-prompt-contracts.js.map +1 -1
- package/dist/core/reflection-controller.d.ts +7 -0
- package/dist/core/reflection-controller.d.ts.map +1 -1
- package/dist/core/reflection-controller.js +94 -15
- package/dist/core/reflection-controller.js.map +1 -1
- package/dist/core/tools/delegate-status.d.ts +2 -0
- package/dist/core/tools/delegate-status.d.ts.map +1 -1
- package/dist/core/tools/delegate-status.js +4 -0
- package/dist/core/tools/delegate-status.js.map +1 -1
- package/dist/core/tools/delegate.d.ts +2 -0
- package/dist/core/tools/delegate.d.ts.map +1 -1
- package/dist/core/tools/delegate.js +83 -21
- package/dist/core/tools/delegate.js.map +1 -1
- package/dist/core/tools/tool-task.d.ts +1 -0
- package/dist/core/tools/tool-task.d.ts.map +1 -1
- package/dist/core/tools/tool-task.js +13 -8
- package/dist/core/tools/tool-task.js.map +1 -1
- package/dist/core/util/atomic-file.d.ts +2 -0
- package/dist/core/util/atomic-file.d.ts.map +1 -1
- package/dist/core/util/atomic-file.js +4 -0
- package/dist/core/util/atomic-file.js.map +1 -1
- package/dist/modes/interactive/auto-learn-controller.d.ts.map +1 -1
- package/dist/modes/interactive/auto-learn-controller.js +2 -0
- package/dist/modes/interactive/auto-learn-controller.js.map +1 -1
- package/dist/modes/interactive/components/activity-lane.d.ts.map +1 -1
- package/dist/modes/interactive/components/activity-lane.js +12 -23
- package/dist/modes/interactive/components/activity-lane.js.map +1 -1
- package/dist/modes/interactive/components/custom-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/custom-message.js +125 -1
- package/dist/modes/interactive/components/custom-message.js.map +1 -1
- package/examples/extensions/custom-provider-anthropic/package-lock.json +2 -2
- package/examples/extensions/custom-provider-anthropic/package.json +1 -1
- package/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
- package/examples/extensions/sandbox/package-lock.json +2 -2
- package/examples/extensions/sandbox/package.json +1 -1
- package/examples/extensions/with-deps/package-lock.json +2 -2
- package/examples/extensions/with-deps/package.json +1 -1
- package/npm-shrinkwrap.json +12 -12
- package/package.json +4 -4
|
@@ -2,7 +2,8 @@ import { createHash } from "node:crypto";
|
|
|
2
2
|
import { Type } from "typebox";
|
|
3
3
|
import { normalizeWorkerAgentDependencyTaskIds, } from "../delegation/worker-agent-control.js";
|
|
4
4
|
import { MAX_WORKER_TRANSCRIPT_PAGE_MESSAGES } from "../delegation/worker-conversation-store.js";
|
|
5
|
-
import { MAX_ORCHESTRATION_COLLECTION_LENGTH, MAX_ORCHESTRATION_DISPATCH_INSTRUCTIONS_LENGTH, MAX_ORCHESTRATION_IDENTIFIER_LENGTH, MAX_ORCHESTRATION_MODEL_ID_LENGTH, MAX_ORCHESTRATION_MODEL_PROVIDER_LENGTH, ORCHESTRATION_THINKING_LEVELS, WORKER_ROLES, } from "../orchestration/contracts.js";
|
|
5
|
+
import { MAX_ORCHESTRATION_COLLECTION_LENGTH, MAX_ORCHESTRATION_DISPATCH_INSTRUCTIONS_LENGTH, MAX_ORCHESTRATION_IDENTIFIER_LENGTH, MAX_ORCHESTRATION_MODEL_ID_LENGTH, MAX_ORCHESTRATION_MODEL_PROVIDER_LENGTH, MAX_WORKER_AUTHORITY_PATH_LENGTH, MAX_WORKER_AUTHORITY_PATHS, ORCHESTRATION_THINKING_LEVELS, WORKER_ROLES, } from "../orchestration/contracts.js";
|
|
6
|
+
import { ORCHESTRATION_PROFILE_TOOL_NAMES } from "../orchestration/lane-tool-manifests.js";
|
|
6
7
|
import { normalizeProviderPromptGuidelines } from "../provider-tool-text.js";
|
|
7
8
|
import { DELEGATE_STATUS_ACTIONS, delegateStatusPanelModel, executeDelegateStatusAction, WORKER_QUEUED_CAVEMAN_GUIDANCE, } from "./delegate-status.js";
|
|
8
9
|
import { emptyOrchestrationCall, renderOrchestrationToolResult, } from "./orchestration-panel.js";
|
|
@@ -31,6 +32,7 @@ export const DELEGATE_ACTIONS = [
|
|
|
31
32
|
...DELEGATE_PROFILE_ACTIONS,
|
|
32
33
|
];
|
|
33
34
|
const DELEGATE_START_ROLES = WORKER_ROLES.filter((role) => role !== "verifier");
|
|
35
|
+
const ORCHESTRATION_TOOL_NAME_PATTERN = `^(?:${ORCHESTRATION_PROFILE_TOOL_NAMES.join("|")})$`;
|
|
34
36
|
function createDelegateSchema(actions) {
|
|
35
37
|
const actionDescription = [
|
|
36
38
|
"start dispatches",
|
|
@@ -53,8 +55,25 @@ function createDelegateSchema(actions) {
|
|
|
53
55
|
modelId: Type.String({ minLength: 1, maxLength: MAX_ORCHESTRATION_MODEL_ID_LENGTH }),
|
|
54
56
|
}, { additionalProperties: false })),
|
|
55
57
|
thinkingLevel: Type.Optional(Type.Union(ORCHESTRATION_THINKING_LEVELS.map((level) => Type.Literal(level)))),
|
|
56
|
-
toolNames: Type.Optional(Type.Array(Type.String({
|
|
58
|
+
toolNames: Type.Optional(Type.Array(Type.String({
|
|
59
|
+
minLength: 1,
|
|
60
|
+
maxLength: MAX_ORCHESTRATION_IDENTIFIER_LENGTH,
|
|
61
|
+
pattern: ORCHESTRATION_TOOL_NAME_PATTERN,
|
|
62
|
+
description: "Exact registered orchestration tool name; use read/bash, never provider-qualified names.",
|
|
63
|
+
}), {
|
|
57
64
|
maxItems: MAX_ORCHESTRATION_COLLECTION_LENGTH,
|
|
65
|
+
uniqueItems: true,
|
|
66
|
+
description: "Exact registered tool names only (for example read, bash); never use functions.read or functions.bash.",
|
|
67
|
+
})),
|
|
68
|
+
readPaths: Type.Optional(Type.Array(Type.String({ minLength: 1, maxLength: MAX_WORKER_AUTHORITY_PATH_LENGTH }), {
|
|
69
|
+
maxItems: MAX_WORKER_AUTHORITY_PATHS,
|
|
70
|
+
uniqueItems: true,
|
|
71
|
+
description: "Bounded read scopes; the host narrows them to the inherited grant.",
|
|
72
|
+
})),
|
|
73
|
+
writePaths: Type.Optional(Type.Array(Type.String({ minLength: 1, maxLength: MAX_WORKER_AUTHORITY_PATH_LENGTH }), {
|
|
74
|
+
maxItems: MAX_WORKER_AUTHORITY_PATHS,
|
|
75
|
+
uniqueItems: true,
|
|
76
|
+
description: "Bounded write scopes; the host narrows them to the inherited grant.",
|
|
58
77
|
})),
|
|
59
78
|
}, { additionalProperties: false }));
|
|
60
79
|
return Type.Object({
|
|
@@ -79,10 +98,12 @@ function createDelegateSchema(actions) {
|
|
|
79
98
|
agentIds: Type.Optional(Type.Array(Type.String({ minLength: 1, maxLength: MAX_ORCHESTRATION_IDENTIFIER_LENGTH }), {
|
|
80
99
|
minItems: 1,
|
|
81
100
|
maxItems: MAX_ORCHESTRATION_COLLECTION_LENGTH,
|
|
101
|
+
uniqueItems: true,
|
|
82
102
|
description: "Worker targets for broadcast or wait_many; duplicates run once.",
|
|
83
103
|
})),
|
|
84
104
|
dependsOn: Type.Optional(Type.Array(Type.String({ minLength: 1, maxLength: MAX_ORCHESTRATION_IDENTIFIER_LENGTH }), {
|
|
85
105
|
maxItems: MAX_ORCHESTRATION_COLLECTION_LENGTH,
|
|
106
|
+
uniqueItems: true,
|
|
86
107
|
description: "Same-objective task ids that must complete before start; get ids from tasks.",
|
|
87
108
|
})),
|
|
88
109
|
requirementId: Type.Optional(Type.String({
|
|
@@ -91,6 +112,7 @@ function createDelegateSchema(actions) {
|
|
|
91
112
|
})),
|
|
92
113
|
requirementIds: Type.Optional(Type.Array(Type.String({ minLength: 1, maxLength: MAX_ORCHESTRATION_IDENTIFIER_LENGTH }), {
|
|
93
114
|
maxItems: MAX_ORCHESTRATION_COLLECTION_LENGTH,
|
|
115
|
+
uniqueItems: true,
|
|
94
116
|
description: "Goal requirements bound to this dispatch.",
|
|
95
117
|
})),
|
|
96
118
|
forkTurns: Type.Optional(Type.String({
|
|
@@ -286,13 +308,14 @@ const ASYNC_DELEGATE_DESCRIPTION = `${DELEGATE_DESCRIPTION_CORE} This call retur
|
|
|
286
308
|
const CAVEMAN_DELEGATE_GUIDELINE = "CAVEMAN MODE - MANDATORY: fresh=no agentId; reuse=returned agentId; task=instructions; idle=reuse.";
|
|
287
309
|
const CAVEMAN_PROFILE_GUIDELINE = "CAVEMAN MODE - MANDATORY: profileId/model must be available or omitted; never invent IDs. Empty owner bases do not block start; omit profileId and use authority.";
|
|
288
310
|
const CAVEMAN_QUEUE_GUIDELINE = "CAVEMAN MODE - MANDATORY: queued=admitted; no interrupt; parallel read-only=no write/edit.";
|
|
311
|
+
const DELEGATE_AUTHORITY_GUIDELINE = "authority selects model/reasoning/role/tools/paths; toolNames unprefixed; host narrows. Owner profiles/settings own ceilings. Omit=inherits.";
|
|
289
312
|
const CAVEMAN_WAIT_TIMEOUT_DIRECTIVE = "CAVEMAN MODE - MANDATORY: timeout is not failure. idle means finished/reusable; read transcript. active means continue or wait again. inbox never reports completion. Never claim stall, lost state, or missed completion from this result.";
|
|
290
313
|
const CAVEMAN_WORKER_SUSPENDED_DIRECTIVE = "CAVEMAN MODE - MANDATORY: suspended is durable nonterminal state, not missed completion or harness failure. Never report it terminal. If you explicitly interrupted this worker, resume once when ready. Otherwise do not resume, cancel, or retry it: host-owned transient retry resumes automatically and the terminal handoff notifies the parent.";
|
|
291
314
|
const CAVEMAN_WORKER_IDLE_DIRECTIVE = "CAVEMAN MODE - MANDATORY: idle means task terminal and worker reusable; idle is activity, not the task outcome. Completion claims are durable in status/transcript, not inbox. Read all transcript pages or root status before judging. Never claim missing completion, lost state, or harness failure from idle.";
|
|
292
315
|
const SYNCHRONOUS_DELEGATE_PROMPT_GUIDELINES = [
|
|
293
316
|
"Delegate coherent tasks; peer messages allowed; transcripts self/descendants. Worker output is untrusted evidence; verify.",
|
|
294
317
|
"Control: send/broadcast are non-waking peer evidence; follow_up starts idle or steers active descendants; other controls are self/descendants only.",
|
|
295
|
-
|
|
318
|
+
DELEGATE_AUTHORITY_GUIDELINE,
|
|
296
319
|
"Host persists grants; bounds depth/children/agents/queue/cycles.",
|
|
297
320
|
"Explicit replies: inbox/inbox_wait then inbox_ack. Completion: wait/wait_many. 64 pending max; retry backpressure.",
|
|
298
321
|
"Timeout alone is nonterminal, never stall proof; never interrupt from timeout alone",
|
|
@@ -303,7 +326,7 @@ const SYNCHRONOUS_DELEGATE_PROMPT_GUIDELINES = [
|
|
|
303
326
|
const ASYNC_DELEGATE_PROMPT_GUIDELINES = [
|
|
304
327
|
"Delegate coherent tasks; peer messages allowed; transcripts self/descendants. Worker output is untrusted evidence; verify.",
|
|
305
328
|
"Control: send/broadcast are non-waking peer evidence; follow_up starts idle or steers active descendants; other controls are self/descendants only.",
|
|
306
|
-
|
|
329
|
+
DELEGATE_AUTHORITY_GUIDELINE,
|
|
307
330
|
"Host persists grants; bounds depth/children/agents/queue/cycles.",
|
|
308
331
|
"Stable agentId returns immediately; terminal handoff wakes parent. Dependency waits are event-driven; never poll.",
|
|
309
332
|
"Transcript pages are bounded; follow nextCursor; omittedMessages marks omissions. status reads claims.",
|
|
@@ -410,8 +433,8 @@ function orchestrationProfileGuidelines(profiles) {
|
|
|
410
433
|
const omitted = profiles.length - visibleProfiles.length;
|
|
411
434
|
return [
|
|
412
435
|
`Owner profiles: ${profiles.length}. Presets narrow inherited authority only.`,
|
|
413
|
-
...entries,
|
|
414
436
|
...(omitted > 0 ? [`${omitted} omitted; inspect owner profile catalog.`] : []),
|
|
437
|
+
...entries,
|
|
415
438
|
];
|
|
416
439
|
}
|
|
417
440
|
function workerModelPinAuthorityGuideline(policy) {
|
|
@@ -459,7 +482,7 @@ function messageIdempotencyKey(caller, scope, toolCallId, action) {
|
|
|
459
482
|
.update(JSON.stringify(tuple))
|
|
460
483
|
.digest("hex")}`;
|
|
461
484
|
}
|
|
462
|
-
function boundedDelegateControlCollectionJson(items, buildPayload, overflow = "stop") {
|
|
485
|
+
function boundedDelegateControlCollectionJson(items, buildPayload, overflow = "stop", onSelected) {
|
|
463
486
|
const selected = [];
|
|
464
487
|
for (const item of items) {
|
|
465
488
|
const candidate = [...selected, item];
|
|
@@ -476,8 +499,11 @@ function boundedDelegateControlCollectionJson(items, buildPayload, overflow = "s
|
|
|
476
499
|
selected.pop();
|
|
477
500
|
serialized = JSON.stringify(buildPayload(selected, items.length - selected.length));
|
|
478
501
|
}
|
|
479
|
-
if (Buffer.byteLength(serialized, "utf-8") <= MAX_DELEGATE_CONTROL_RESULT_BYTES)
|
|
502
|
+
if (Buffer.byteLength(serialized, "utf-8") <= MAX_DELEGATE_CONTROL_RESULT_BYTES) {
|
|
503
|
+
onSelected?.(selected);
|
|
480
504
|
return serialized;
|
|
505
|
+
}
|
|
506
|
+
onSelected?.([]);
|
|
481
507
|
return JSON.stringify({ error: "delegate_control_result_oversized", omittedCount: items.length });
|
|
482
508
|
}
|
|
483
509
|
function boundedBroadcastDetails(results) {
|
|
@@ -576,7 +602,7 @@ function workerWaitProjection(statuses, timedOut) {
|
|
|
576
602
|
cavemanDirective: CAVEMAN_WORKER_SUSPENDED_DIRECTIVE,
|
|
577
603
|
};
|
|
578
604
|
}
|
|
579
|
-
function workerTaskSessionJson(view) {
|
|
605
|
+
function workerTaskSessionJson(view, onSelectedTasks) {
|
|
580
606
|
const hasQueuedTask = view.tasks.some((task) => task.latestAttempt?.status === "queued");
|
|
581
607
|
return boundedDelegateControlCollectionJson(view.tasks, (tasks, omittedCount) => ({
|
|
582
608
|
totalTasks: view.totalTasks,
|
|
@@ -590,7 +616,7 @@ function workerTaskSessionJson(view) {
|
|
|
590
616
|
}
|
|
591
617
|
: {}),
|
|
592
618
|
tasks,
|
|
593
|
-
}), "skip");
|
|
619
|
+
}), "skip", (selected) => onSelectedTasks?.(selected));
|
|
594
620
|
}
|
|
595
621
|
function delegateStartSkipText(reason) {
|
|
596
622
|
if (reason === "worker_model_pins_invalid") {
|
|
@@ -831,7 +857,33 @@ export function createDelegateToolDefinition(deps) {
|
|
|
831
857
|
skipReason: "worker_status_unavailable",
|
|
832
858
|
});
|
|
833
859
|
}
|
|
834
|
-
|
|
860
|
+
const status = deps.status;
|
|
861
|
+
let statusRecords;
|
|
862
|
+
let exposedStatusRecords;
|
|
863
|
+
const statusDependencies = action === "status"
|
|
864
|
+
? {
|
|
865
|
+
...status,
|
|
866
|
+
getLaneRecords: () => {
|
|
867
|
+
const records = status.getLaneRecords();
|
|
868
|
+
statusRecords = records;
|
|
869
|
+
return records;
|
|
870
|
+
},
|
|
871
|
+
observeExposedTerminalRecords: (records) => {
|
|
872
|
+
exposedStatusRecords = records;
|
|
873
|
+
},
|
|
874
|
+
}
|
|
875
|
+
: status;
|
|
876
|
+
const statusResult = executeDelegateStatusAction(action, { laneId: input.laneId }, statusDependencies);
|
|
877
|
+
if (action === "status") {
|
|
878
|
+
if (exposedStatusRecords !== undefined && statusRecords !== undefined) {
|
|
879
|
+
const exposed = new Set(exposedStatusRecords);
|
|
880
|
+
const observed = exposed.size === statusRecords.length
|
|
881
|
+
? statusRecords
|
|
882
|
+
: statusRecords.filter((record) => exposed.has(record));
|
|
883
|
+
deps.workerAgentControl?.observeWorkerTerminalRecords?.(observed);
|
|
884
|
+
}
|
|
885
|
+
}
|
|
886
|
+
return statusResult;
|
|
835
887
|
}
|
|
836
888
|
if (action === "profile_inspect" || action === "profile_create") {
|
|
837
889
|
if (caller.kind !== "session_root") {
|
|
@@ -858,11 +910,16 @@ export function createDelegateToolDefinition(deps) {
|
|
|
858
910
|
skipReason: "worker_agent_control_unavailable",
|
|
859
911
|
});
|
|
860
912
|
}
|
|
913
|
+
let exposedTasks = [];
|
|
914
|
+
const text = workerTaskSessionJson(deps.workerAgentControl.getWorkerTaskSessionView(), (tasks) => {
|
|
915
|
+
exposedTasks = tasks;
|
|
916
|
+
});
|
|
917
|
+
deps.workerAgentControl.observeWorkerAgentTerminals?.(exposedTasks.flatMap((task) => (task.latestAttempt?.agentId ? [task.latestAttempt.agentId] : [])));
|
|
861
918
|
return {
|
|
862
919
|
content: [
|
|
863
920
|
{
|
|
864
921
|
type: "text",
|
|
865
|
-
text
|
|
922
|
+
text,
|
|
866
923
|
},
|
|
867
924
|
],
|
|
868
925
|
details: { started: true, action },
|
|
@@ -887,20 +944,25 @@ export function createDelegateToolDefinition(deps) {
|
|
|
887
944
|
});
|
|
888
945
|
const pageSize = input.maxMessages ?? MAX_WORKER_TRANSCRIPT_PAGE_MESSAGES;
|
|
889
946
|
const page = agents.slice(cursor, cursor + pageSize);
|
|
947
|
+
let exposedAgents = [];
|
|
948
|
+
const text = boundedDelegateControlCollectionJson(page, (selected, omittedCount) => {
|
|
949
|
+
const nextCursor = cursor + selected.length;
|
|
950
|
+
return {
|
|
951
|
+
cursor,
|
|
952
|
+
totalAgents: agents.length,
|
|
953
|
+
agents: selected,
|
|
954
|
+
...(nextCursor < agents.length ? { nextCursor } : {}),
|
|
955
|
+
...(omittedCount > 0 ? { omittedCount } : {}),
|
|
956
|
+
};
|
|
957
|
+
}, "stop", (selected) => {
|
|
958
|
+
exposedAgents = selected;
|
|
959
|
+
});
|
|
960
|
+
deps.workerAgentControl.observeWorkerAgentTerminals?.(exposedAgents.map((agent) => agent.agentId));
|
|
890
961
|
return {
|
|
891
962
|
content: [
|
|
892
963
|
{
|
|
893
964
|
type: "text",
|
|
894
|
-
text
|
|
895
|
-
const nextCursor = cursor + selected.length;
|
|
896
|
-
return {
|
|
897
|
-
cursor,
|
|
898
|
-
totalAgents: agents.length,
|
|
899
|
-
agents: selected,
|
|
900
|
-
...(nextCursor < agents.length ? { nextCursor } : {}),
|
|
901
|
-
...(omittedCount > 0 ? { omittedCount } : {}),
|
|
902
|
-
};
|
|
903
|
-
}),
|
|
965
|
+
text,
|
|
904
966
|
},
|
|
905
967
|
],
|
|
906
968
|
details: { started: true, action },
|