replicas-engine 0.1.816 → 0.1.818
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/dist/src/{asp-host-GPNVHNDJ.js → asp-host-ENL3IA4B.js} +4 -4
- package/dist/src/{chunk-I3CLB5FS.js → chunk-6FLPUBVF.js} +2 -2
- package/dist/src/{chunk-MEPQJE5J.js → chunk-C52ENUG3.js} +1 -1
- package/dist/src/{chunk-QIDTIQQU.js → chunk-EC5Q7SK6.js} +4 -4
- package/dist/src/{chunk-T7RJYRCH.js → chunk-FNQF3TAM.js} +2 -2
- package/dist/src/{chunk-3XXPWKPE.js → chunk-JAITEGC4.js} +1 -1
- package/dist/src/{chunk-JTAIM2QE.js → chunk-OCQQ6AO3.js} +8 -4
- package/dist/src/command-protection-hook.js +3 -3
- package/dist/src/deepseek-command-protection-plugin.js +4 -4
- package/dist/src/headless-agent.js +2 -2
- package/dist/src/index.js +54 -28
- package/dist/src/post-tool-pr-hook.js +2 -2
- package/dist/src/relay-mcp.js +6 -4
- package/package.json +1 -1
|
@@ -5,11 +5,11 @@ import {
|
|
|
5
5
|
getCodexAspHost,
|
|
6
6
|
restartCodexAspHost,
|
|
7
7
|
restartCodexAspHostIfRunning
|
|
8
|
-
} from "./chunk-
|
|
9
|
-
import "./chunk-
|
|
10
|
-
import "./chunk-
|
|
8
|
+
} from "./chunk-EC5Q7SK6.js";
|
|
9
|
+
import "./chunk-JAITEGC4.js";
|
|
10
|
+
import "./chunk-FNQF3TAM.js";
|
|
11
11
|
import "./chunk-UZSNFLDQ.js";
|
|
12
|
-
import "./chunk-
|
|
12
|
+
import "./chunk-OCQQ6AO3.js";
|
|
13
13
|
import "./chunk-VEQXQN22.js";
|
|
14
14
|
export {
|
|
15
15
|
getCodexAspHost,
|
|
@@ -3,12 +3,12 @@ import { createRequire as __createRequire } from 'node:module';
|
|
|
3
3
|
const require = __createRequire(import.meta.url);
|
|
4
4
|
import {
|
|
5
5
|
monolithRequest
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-JAITEGC4.js";
|
|
7
7
|
import {
|
|
8
8
|
extractCommandProtectionCommandText,
|
|
9
9
|
findGitCommitSignals,
|
|
10
10
|
findPrMergeSignals
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-OCQQ6AO3.js";
|
|
12
12
|
|
|
13
13
|
// src/services/command-protection-service.ts
|
|
14
14
|
var DEFAULT_COMMAND_PROTECTION_BLOCK_MESSAGE = "Blocked by Replicas command protection.";
|
|
@@ -4,7 +4,7 @@ const require = __createRequire(import.meta.url);
|
|
|
4
4
|
import {
|
|
5
5
|
findCodeHostPullRequestUrls,
|
|
6
6
|
mayCreatePullRequest
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-OCQQ6AO3.js";
|
|
8
8
|
|
|
9
9
|
// src/services/post-tool-pr-notifier.ts
|
|
10
10
|
async function notifyPostToolUse(toolName, toolInput, toolResult) {
|
|
@@ -5,18 +5,18 @@ import {
|
|
|
5
5
|
ENGINE_ENV,
|
|
6
6
|
monolithRequest,
|
|
7
7
|
setAgentCredentialSnapshot
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-JAITEGC4.js";
|
|
9
9
|
import {
|
|
10
10
|
AppServerProcess,
|
|
11
11
|
buildCodexAgentEnv
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-FNQF3TAM.js";
|
|
13
13
|
import {
|
|
14
14
|
CODEX_AUTH_ENV_KEYS,
|
|
15
15
|
CODEX_AUTH_ENV_KEYS_BY_METHOD,
|
|
16
16
|
codexAuthEnvFromResponse,
|
|
17
17
|
createErrorResult,
|
|
18
18
|
createSuccessResult
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-OCQQ6AO3.js";
|
|
20
20
|
|
|
21
21
|
// src/managers/codex-token-manager.ts
|
|
22
22
|
import { promises as fs } from "fs";
|
|
@@ -232,7 +232,7 @@ var CodexTokenManager = class extends BaseRefreshManager {
|
|
|
232
232
|
const data = await response.json();
|
|
233
233
|
await this.applyCredentialsResponse(data);
|
|
234
234
|
if (restartOnChange && CODEX_AUTH_ENV_KEYS.some((key, index) => process.env[key] !== previousEnv[index])) {
|
|
235
|
-
const { restartCodexAspHostIfRunning: restartCodexAspHostIfRunning2 } = await import("./asp-host-
|
|
235
|
+
const { restartCodexAspHostIfRunning: restartCodexAspHostIfRunning2 } = await import("./asp-host-ENL3IA4B.js");
|
|
236
236
|
await restartCodexAspHostIfRunning2();
|
|
237
237
|
}
|
|
238
238
|
if (data.scope) {
|
|
@@ -4,7 +4,7 @@ const require = __createRequire(import.meta.url);
|
|
|
4
4
|
import {
|
|
5
5
|
HOOK_EXEC_MAX_BUFFER_BYTES,
|
|
6
6
|
isVersionBelow
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-OCQQ6AO3.js";
|
|
8
8
|
|
|
9
9
|
// src/utils/codex-agent-env.ts
|
|
10
10
|
function buildCodexAgentEnv(source = process.env) {
|
|
@@ -241,7 +241,7 @@ var DEFAULT_CODEX_ARGS = [
|
|
|
241
241
|
var MIN_CODEX_CLI_VERSION = "0.153.3";
|
|
242
242
|
var CODEX_UPGRADE_TIMEOUT_MS = 12e4;
|
|
243
243
|
var codexCliVersionEnsured = null;
|
|
244
|
-
var ENGINE_PACKAGE_VERSION = "0.1.
|
|
244
|
+
var ENGINE_PACKAGE_VERSION = "0.1.818";
|
|
245
245
|
var INITIALIZE_METHOD = "initialize";
|
|
246
246
|
var INITIALIZED_NOTIFICATION = "initialized";
|
|
247
247
|
var ACCOUNT_LOGIN_START_METHOD = "account/login/start";
|
|
@@ -817,6 +817,10 @@ var createChatRequestSchema = z3.object({
|
|
|
817
817
|
var spawnRelaySubagentRequestSchema = z3.object({
|
|
818
818
|
provider: z3.enum(VALID_AGENT_PROVIDERS),
|
|
819
819
|
prompt: z3.string().min(1),
|
|
820
|
+
forkTurns: z3.string().regex(/^(all|none|[1-9]\d*)$/).refine(
|
|
821
|
+
(value) => value === "all" || value === "none" || Number.isSafeInteger(Number(value)),
|
|
822
|
+
"Expected all, none, or a positive safe integer string"
|
|
823
|
+
).default("all"),
|
|
820
824
|
model: z3.string().min(1).optional(),
|
|
821
825
|
thinkingLevel: z3.enum(VALID_THINKING_LEVELS).optional(),
|
|
822
826
|
title: z3.string().min(1).optional(),
|
|
@@ -7413,15 +7417,15 @@ function formatChatForkHandoffMessage(handoff) {
|
|
|
7413
7417
|
const reason = describeChatForkReason(handoff.reason, handoff.source.provider);
|
|
7414
7418
|
const why = handoff.trigger === "auto" ? `until ${reason ?? "it stopped"}, so Replicas moved the conversation to you automatically` : "until the user forked it to you";
|
|
7415
7419
|
const body = [
|
|
7416
|
-
`# Continuing a ${sourceName} chat`,
|
|
7420
|
+
handoff.subagent ? "# Delegated task context" : `# Continuing a ${sourceName} chat`,
|
|
7417
7421
|
"",
|
|
7418
|
-
`You are picking up the chat "${handoff.source.title}" in this same workspace. It was running on ${sourceName} ${why}. Everything the previous agent changed is already on disk: the workspace files and git state are authoritative.`,
|
|
7422
|
+
handoff.subagent ? `You are a subagent of the chat "${handoff.source.title}" in this same workspace. The inherited transcript is background for your assigned task below. Follow that task and report your result to the parent; do not take over the parent's entire request. Workspace files and git state are shared and authoritative.` : `You are picking up the chat "${handoff.source.title}" in this same workspace. It was running on ${sourceName} ${why}. Everything the previous agent changed is already on disk: the workspace files and git state are authoritative.`,
|
|
7419
7423
|
"",
|
|
7420
7424
|
"## Transcript",
|
|
7421
7425
|
"",
|
|
7422
7426
|
`- Sanitized transcript: \`${handoff.transcriptPath}\` (read or grep it for anything not in the excerpt below)`,
|
|
7423
|
-
`- Raw event log: \`${handoff.rawHistoryPath}
|
|
7424
|
-
...handoff.sourceTruncated ? [
|
|
7427
|
+
...handoff.rawHistoryPath ? [`- Raw event log: \`${handoff.rawHistoryPath}\``] : [],
|
|
7428
|
+
...handoff.sourceTruncated ? [`- The chat was too large to sanitize in full; the sanitized file holds only its most recent part.${handoff.rawHistoryPath ? " Grep the raw event log for anything older." : ""}`] : [],
|
|
7425
7429
|
"",
|
|
7426
7430
|
"## Recent turns",
|
|
7427
7431
|
"",
|
|
@@ -3,12 +3,12 @@ import { createRequire as __createRequire } from 'node:module';
|
|
|
3
3
|
const require = __createRequire(import.meta.url);
|
|
4
4
|
import {
|
|
5
5
|
evaluateCommandProtection
|
|
6
|
-
} from "./chunk-
|
|
7
|
-
import "./chunk-
|
|
6
|
+
} from "./chunk-6FLPUBVF.js";
|
|
7
|
+
import "./chunk-JAITEGC4.js";
|
|
8
8
|
import {
|
|
9
9
|
isRecord
|
|
10
10
|
} from "./chunk-UZSNFLDQ.js";
|
|
11
|
-
import "./chunk-
|
|
11
|
+
import "./chunk-OCQQ6AO3.js";
|
|
12
12
|
import "./chunk-VEQXQN22.js";
|
|
13
13
|
|
|
14
14
|
// src/command-protection-hook.ts
|
|
@@ -3,13 +3,13 @@ import { createRequire as __createRequire } from 'node:module';
|
|
|
3
3
|
const require = __createRequire(import.meta.url);
|
|
4
4
|
import {
|
|
5
5
|
evaluateCommandProtection
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-6FLPUBVF.js";
|
|
7
7
|
import {
|
|
8
8
|
notifyPostToolUse
|
|
9
|
-
} from "./chunk-
|
|
10
|
-
import "./chunk-
|
|
9
|
+
} from "./chunk-C52ENUG3.js";
|
|
10
|
+
import "./chunk-JAITEGC4.js";
|
|
11
11
|
import "./chunk-UZSNFLDQ.js";
|
|
12
|
-
import "./chunk-
|
|
12
|
+
import "./chunk-OCQQ6AO3.js";
|
|
13
13
|
import "./chunk-VEQXQN22.js";
|
|
14
14
|
|
|
15
15
|
// src/deepseek-command-protection-plugin.ts
|
|
@@ -8,12 +8,12 @@ import {
|
|
|
8
8
|
import {
|
|
9
9
|
AppServerProcess,
|
|
10
10
|
buildCodexAgentEnv
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-FNQF3TAM.js";
|
|
12
12
|
import {
|
|
13
13
|
AGENT,
|
|
14
14
|
getMemoryOutputSafetyViolation,
|
|
15
15
|
headlessAgentRequestSchema
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-OCQQ6AO3.js";
|
|
17
17
|
import "./chunk-VEQXQN22.js";
|
|
18
18
|
|
|
19
19
|
// src/headless-agent.ts
|
package/dist/src/index.js
CHANGED
|
@@ -91,7 +91,7 @@ import {
|
|
|
91
91
|
evaluateCommandProtection,
|
|
92
92
|
extractToolCommand,
|
|
93
93
|
reportCommandProtectionBlock
|
|
94
|
-
} from "./chunk-
|
|
94
|
+
} from "./chunk-6FLPUBVF.js";
|
|
95
95
|
import {
|
|
96
96
|
ACCOUNT_RATE_LIMITS_UPDATED_METHOD,
|
|
97
97
|
AGENT_MESSAGE_DELTA_METHOD,
|
|
@@ -131,20 +131,20 @@ import {
|
|
|
131
131
|
recordCredentialFallback,
|
|
132
132
|
recordExhaustedCredential,
|
|
133
133
|
restartCodexAspHost
|
|
134
|
-
} from "./chunk-
|
|
134
|
+
} from "./chunk-EC5Q7SK6.js";
|
|
135
135
|
import {
|
|
136
136
|
ENGINE_ENV,
|
|
137
137
|
IS_WARMING_MODE,
|
|
138
138
|
monolithRequest,
|
|
139
139
|
monolithService,
|
|
140
140
|
setAgentCredentialSnapshot
|
|
141
|
-
} from "./chunk-
|
|
141
|
+
} from "./chunk-JAITEGC4.js";
|
|
142
142
|
import {
|
|
143
143
|
AspClient,
|
|
144
144
|
SUBPROCESS_MAX_BUFFER,
|
|
145
145
|
execAsync,
|
|
146
146
|
execFileAsync
|
|
147
|
-
} from "./chunk-
|
|
147
|
+
} from "./chunk-FNQF3TAM.js";
|
|
148
148
|
import {
|
|
149
149
|
isRecord as isRecord2
|
|
150
150
|
} from "./chunk-UZSNFLDQ.js";
|
|
@@ -350,7 +350,7 @@ import {
|
|
|
350
350
|
spawnRelaySubagentRequestSchema,
|
|
351
351
|
stripAgentDiagnosticErrors,
|
|
352
352
|
withTimeout
|
|
353
|
-
} from "./chunk-
|
|
353
|
+
} from "./chunk-OCQQ6AO3.js";
|
|
354
354
|
import {
|
|
355
355
|
__commonJS,
|
|
356
356
|
__export,
|
|
@@ -14977,6 +14977,7 @@ var CodexAspManager = class extends CodingAgentManager {
|
|
|
14977
14977
|
}
|
|
14978
14978
|
async getHistory(page2 = {}) {
|
|
14979
14979
|
await this.initialized;
|
|
14980
|
+
this.transcriptUpdateCoalescer.flushPending();
|
|
14980
14981
|
await this.historyFile?.flush();
|
|
14981
14982
|
const transcript = await this.ensureTranscriptHistory();
|
|
14982
14983
|
const events = await this.historyFile?.loadEventsPage(page2) ?? { events: [], beforeCursor: null };
|
|
@@ -59789,7 +59790,15 @@ Go straight to the point. Lead with outcomes and decisions, keep updates concise
|
|
|
59789
59790
|
|
|
59790
59791
|
Your primary constraint is context. Work directly when the task is small, tightly coupled to context you already hold, or cheaper to complete than explain. Delegate independent work that would consume substantial context, including broad investigation, multi-file implementation, iterative debugging, test-and-fix loops, and unbiased review or verification. Do not delegate trivial work or work whose full context would cost more to transfer than doing it yourself.
|
|
59791
59792
|
|
|
59792
|
-
Use the \`${RELAY_MCP_SERVER_NAME}\` MCP server exclusively for delegation; never use terminal commands or the base harness's native agent-spawning, delegation, or collaboration tools. It exposes \`get_providers\`, \`spawn_agent\`, \`message_agent\`, and \`delete_agent\`; your harness may show them with an MCP server prefix. In Pi, call them through the \`mcp\` gateway for the \`${RELAY_MCP_SERVER_NAME}\` server if direct tools are not yet visible. Check \`get_providers\` before the first delegation instead of guessing.
|
|
59793
|
+
Use the \`${RELAY_MCP_SERVER_NAME}\` MCP server exclusively for delegation; never use terminal commands or the base harness's native agent-spawning, delegation, or collaboration tools. It exposes \`get_providers\`, \`spawn_agent\`, \`message_agent\`, and \`delete_agent\`; your harness may show them with an MCP server prefix. In Pi, call them through the \`mcp\` gateway for the \`${RELAY_MCP_SERVER_NAME}\` server if direct tools are not yet visible. Check \`get_providers\` before the first delegation instead of guessing. The default timeout is 10 minutes; increase it only when the task reasonably needs longer.
|
|
59794
|
+
|
|
59795
|
+
Choose how much parent context each child inherits with \`spawn_agent.fork_turns\`:
|
|
59796
|
+
|
|
59797
|
+
- \`"all"\` (default): inherit the conversation as an extension of yourself when the task depends on prior decisions and constraints.
|
|
59798
|
+
- \`"none"\`: start with only the task prompt to reduce input tokens or get an independent assessment without your prior reasoning. Include all necessary requirements, paths, constraints, and evidence in the prompt; the child cannot infer omitted context.
|
|
59799
|
+
- A positive integer string such as \`"3"\`: inherit only the latest N user-led turns when recent context is enough. A turn includes a user message and the agent activity that follows it, including the current unfinished turn.
|
|
59800
|
+
|
|
59801
|
+
Give every child a concrete task, clear scope, and definition of done, even when it inherits the conversation. The child should use inherited history as background and focus on its assigned task.
|
|
59793
59802
|
|
|
59794
59803
|
Run truly independent child agents concurrently. Because child agents share the workspace, run modifying work sequentially unless file ownership cannot overlap. Keep dependent work sequential when one result defines another task's contract, such as schema before queries, API before its client, or implementation before its focused verification. Review child results, follow up when they are incomplete, and verify the integrated outcome yourself. Do not delete child chats unless the user asks.
|
|
59795
59804
|
|
|
@@ -61361,11 +61370,16 @@ function tailBlocks(blocks, maxChars) {
|
|
|
61361
61370
|
async function buildForkHandoff(input) {
|
|
61362
61371
|
const rawHistoryPath = join35(HISTORY_DIR_BY_PROVIDER[input.sourceProvider], `${input.sourceChatId}.jsonl`);
|
|
61363
61372
|
const { content, truncated: sourceTruncated } = await readHistoryTail(rawHistoryPath, MAX_SANITIZED_SOURCE_BYTES);
|
|
61364
|
-
|
|
61373
|
+
let blocks = canonicalizeChatTranscriptBlocks(content, input.executionProvider, input.senders);
|
|
61374
|
+
if (input.turnLimit !== void 0) {
|
|
61375
|
+
let turns = 0;
|
|
61376
|
+
const start = blocks.findLastIndex((block) => block.startsWith("## User") && ++turns === input.turnLimit);
|
|
61377
|
+
blocks = blocks.slice(Math.max(0, start));
|
|
61378
|
+
}
|
|
61365
61379
|
const forkDir = join35(FORKS_DIR, input.targetChatId);
|
|
61366
61380
|
await mkdir20(forkDir, { recursive: true });
|
|
61367
61381
|
const transcriptPath = join35(forkDir, "source-transcript.md");
|
|
61368
|
-
const header = sourceTruncated ? `_This file
|
|
61382
|
+
const header = sourceTruncated ? `_This file was generated from only the most recent ${MAX_SANITIZED_SOURCE_BYTES / 1024 / 1024} MB of the source chat.${input.turnLimit === void 0 ? ` The complete raw event log is at ${rawHistoryPath}; grep it for anything earlier.` : ""}_
|
|
61369
61383
|
|
|
61370
61384
|
` : "";
|
|
61371
61385
|
await writeFile11(transcriptPath, `${header}${blocks.join("\n\n")}
|
|
@@ -61377,7 +61391,7 @@ async function buildForkHandoff(input) {
|
|
|
61377
61391
|
sourceTruncated,
|
|
61378
61392
|
resumeRequest: unansweredRequest(blocks),
|
|
61379
61393
|
transcriptPath,
|
|
61380
|
-
rawHistoryPath
|
|
61394
|
+
rawHistoryPath: input.turnLimit === void 0 ? rawHistoryPath : void 0
|
|
61381
61395
|
};
|
|
61382
61396
|
}
|
|
61383
61397
|
|
|
@@ -61656,8 +61670,19 @@ var ChatService = class {
|
|
|
61656
61670
|
parentChatId
|
|
61657
61671
|
});
|
|
61658
61672
|
try {
|
|
61673
|
+
let message = request.prompt;
|
|
61674
|
+
if (request.forkTurns !== "none") {
|
|
61675
|
+
const parent = this.requireChat(parentChatId).persisted;
|
|
61676
|
+
message = await this.createForkHandoffMessage(chat.id, {
|
|
61677
|
+
source: { chatId: parentChatId, provider: parent.provider, title: parent.title },
|
|
61678
|
+
trigger: "manual",
|
|
61679
|
+
subagent: true,
|
|
61680
|
+
turnLimit: request.forkTurns && request.forkTurns !== "all" ? Number(request.forkTurns) : void 0,
|
|
61681
|
+
message: request.prompt
|
|
61682
|
+
});
|
|
61683
|
+
}
|
|
61659
61684
|
await this.sendMessage(chat.id, {
|
|
61660
|
-
message
|
|
61685
|
+
message,
|
|
61661
61686
|
...request.model ? { model: request.model } : {},
|
|
61662
61687
|
...request.thinkingLevel ? { thinkingLevel: request.thinkingLevel } : {}
|
|
61663
61688
|
});
|
|
@@ -62132,33 +62157,34 @@ var ChatService = class {
|
|
|
62132
62157
|
});
|
|
62133
62158
|
return target;
|
|
62134
62159
|
}
|
|
62160
|
+
async createForkHandoffMessage(targetChatId, options) {
|
|
62161
|
+
const source = this.requireChat(options.source.chatId);
|
|
62162
|
+
await source.provider.getHistory({ limit: 1 });
|
|
62163
|
+
const handoff = await buildForkHandoff({
|
|
62164
|
+
sourceChatId: options.source.chatId,
|
|
62165
|
+
sourceProvider: options.source.provider,
|
|
62166
|
+
executionProvider: getChatExecutionProvider(source.persisted),
|
|
62167
|
+
targetChatId,
|
|
62168
|
+
senders: await this.readSenders(options.source.chatId),
|
|
62169
|
+
turnLimit: options.turnLimit
|
|
62170
|
+
});
|
|
62171
|
+
return formatChatForkHandoffMessage({ ...handoff, ...options });
|
|
62172
|
+
}
|
|
62135
62173
|
async runFork(targetId, request) {
|
|
62136
62174
|
const target = this.chats.get(targetId);
|
|
62137
62175
|
const fork = target?.persisted.fork;
|
|
62138
62176
|
if (!target || !fork) return;
|
|
62139
62177
|
try {
|
|
62140
62178
|
if (!isAgentAvailable(getChatExecutionProvider(target.persisted))) throw new ChatProviderUnavailableError(request.provider);
|
|
62141
|
-
const
|
|
62142
|
-
|
|
62143
|
-
|
|
62144
|
-
|
|
62145
|
-
|
|
62146
|
-
senders: await this.readSenders(fork.source.chatId)
|
|
62179
|
+
const message = await this.createForkHandoffMessage(targetId, {
|
|
62180
|
+
source: fork.source,
|
|
62181
|
+
trigger: fork.trigger,
|
|
62182
|
+
reason: fork.reason,
|
|
62183
|
+
message: request.message
|
|
62147
62184
|
});
|
|
62148
62185
|
if (target.persisted.deletedAt) return;
|
|
62149
62186
|
await this.sendMessage(targetId, {
|
|
62150
|
-
message
|
|
62151
|
-
source: fork.source,
|
|
62152
|
-
trigger: fork.trigger,
|
|
62153
|
-
...fork.reason ? { reason: fork.reason } : {},
|
|
62154
|
-
excerpt: handoff.excerpt,
|
|
62155
|
-
excerptTruncated: handoff.excerptTruncated,
|
|
62156
|
-
sourceTruncated: handoff.sourceTruncated,
|
|
62157
|
-
transcriptPath: handoff.transcriptPath,
|
|
62158
|
-
rawHistoryPath: handoff.rawHistoryPath,
|
|
62159
|
-
resumeRequest: handoff.resumeRequest,
|
|
62160
|
-
message: request.message
|
|
62161
|
-
}),
|
|
62187
|
+
message,
|
|
62162
62188
|
model: request.model,
|
|
62163
62189
|
thinkingLevel: request.thinkingLevel,
|
|
62164
62190
|
enableInteractiveTools: request.enableInteractiveTools,
|
|
@@ -3,11 +3,11 @@ import { createRequire as __createRequire } from 'node:module';
|
|
|
3
3
|
const require = __createRequire(import.meta.url);
|
|
4
4
|
import {
|
|
5
5
|
notifyPostToolUse
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-C52ENUG3.js";
|
|
7
7
|
import {
|
|
8
8
|
isRecord
|
|
9
9
|
} from "./chunk-UZSNFLDQ.js";
|
|
10
|
-
import "./chunk-
|
|
10
|
+
import "./chunk-OCQQ6AO3.js";
|
|
11
11
|
import "./chunk-VEQXQN22.js";
|
|
12
12
|
|
|
13
13
|
// src/post-tool-pr-hook.ts
|
package/dist/src/relay-mcp.js
CHANGED
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
import {
|
|
8
8
|
messageRelaySubagentRequestSchema,
|
|
9
9
|
spawnRelaySubagentRequestSchema
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-OCQQ6AO3.js";
|
|
11
11
|
import "./chunk-VEQXQN22.js";
|
|
12
12
|
|
|
13
13
|
// src/relay-mcp.ts
|
|
@@ -46,21 +46,23 @@ server.registerTool("get_providers", {
|
|
|
46
46
|
content: [{ type: "text", text: await request(`/chats/${parentChatId}/subagents`, "GET") }]
|
|
47
47
|
}));
|
|
48
48
|
server.registerTool("spawn_agent", {
|
|
49
|
-
description: "Spawn a child agent with
|
|
49
|
+
description: "Spawn a child agent with all, none, or the latest N turns of parent context, wait for it to finish, and return its chat ID and final response.",
|
|
50
50
|
inputSchema: {
|
|
51
51
|
provider: spawnRelaySubagentRequestSchema.shape.provider.describe("Provider returned by get_providers."),
|
|
52
|
-
prompt: spawnRelaySubagentRequestSchema.shape.prompt.describe("
|
|
52
|
+
prompt: spawnRelaySubagentRequestSchema.shape.prompt.describe("The child\u2019s assigned task, scope, and expected result. Include all necessary context when fork_turns is none."),
|
|
53
|
+
fork_turns: spawnRelaySubagentRequestSchema.shape.forkTurns.describe("Parent context to inherit: all (default), none, or a positive integer string such as 3 for the latest 3 user-led turns, including the current turn."),
|
|
53
54
|
model: spawnRelaySubagentRequestSchema.shape.model,
|
|
54
55
|
thinking_level: spawnRelaySubagentRequestSchema.shape.thinkingLevel,
|
|
55
56
|
title: spawnRelaySubagentRequestSchema.shape.title,
|
|
56
57
|
timeout_minutes: spawnRelaySubagentRequestSchema.shape.timeoutMinutes
|
|
57
58
|
}
|
|
58
|
-
}, async ({ provider, prompt, model, thinking_level, title, timeout_minutes }) => ({
|
|
59
|
+
}, async ({ provider, prompt, fork_turns, model, thinking_level, title, timeout_minutes }) => ({
|
|
59
60
|
content: [{
|
|
60
61
|
type: "text",
|
|
61
62
|
text: await request(`/chats/${parentChatId}/subagents`, "POST", {
|
|
62
63
|
provider,
|
|
63
64
|
prompt,
|
|
65
|
+
forkTurns: fork_turns,
|
|
64
66
|
...model ? { model } : {},
|
|
65
67
|
...thinking_level ? { thinkingLevel: thinking_level } : {},
|
|
66
68
|
...title ? { title } : {},
|