replicas-engine 0.1.1655 → 0.1.1657
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-ATB76RSH.js → asp-host-FQPUDYMI.js} +5 -5
- package/dist/src/{chunk-VC5K4OFC.js → chunk-2VDQA473.js} +2 -2
- package/dist/src/{chunk-L3GEZXEL.js → chunk-43SFZW43.js} +2 -2
- package/dist/src/{chunk-EM3VMG3H.js → chunk-6CYVRLIO.js} +3 -3
- package/dist/src/{chunk-XXNXKU7V.js → chunk-7UBUKFDR.js} +1 -1
- package/dist/src/{chunk-ZJTEMDYE.js → chunk-MGHRWQZQ.js} +6 -6
- package/dist/src/{chunk-PCZB6SC5.js → chunk-PMQVLR64.js} +2 -2
- package/dist/src/{chunk-L6Y4QQM4.js → chunk-UKEZJE34.js} +1 -1
- package/dist/src/{chunk-MS5FDCSR.js → chunk-YLKNOKME.js} +14 -7
- package/dist/src/command-protection-hook.js +4 -4
- package/dist/src/headless-agent.js +4 -4
- package/dist/src/index.js +29 -18
- package/dist/src/post-tool-pr-hook.js +2 -2
- package/dist/src/subagent-mcp.js +1 -1
- package/package.json +1 -1
|
@@ -8,12 +8,12 @@ import {
|
|
|
8
8
|
listCodexModelsForDetails,
|
|
9
9
|
restartCodexAspHost,
|
|
10
10
|
restartCodexAspHostIfRunning
|
|
11
|
-
} from "./chunk-
|
|
12
|
-
import "./chunk-
|
|
13
|
-
import "./chunk-
|
|
14
|
-
import "./chunk-
|
|
11
|
+
} from "./chunk-MGHRWQZQ.js";
|
|
12
|
+
import "./chunk-PMQVLR64.js";
|
|
13
|
+
import "./chunk-6CYVRLIO.js";
|
|
14
|
+
import "./chunk-UKEZJE34.js";
|
|
15
15
|
import "./chunk-UZSNFLDQ.js";
|
|
16
|
-
import "./chunk-
|
|
16
|
+
import "./chunk-YLKNOKME.js";
|
|
17
17
|
import "./chunk-VEQXQN22.js";
|
|
18
18
|
export {
|
|
19
19
|
CODEX_ULTRAFAST_SERVICE_TIER,
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
ENGINE_ENV,
|
|
6
6
|
monolithRequest,
|
|
7
7
|
runGitCommand
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-PMQVLR64.js";
|
|
9
9
|
import {
|
|
10
10
|
COMMAND_PROTECTION_MAX_MESSAGE_FILE_BYTES,
|
|
11
11
|
COMMAND_PROTECTION_REPO_GIT_ARGS,
|
|
@@ -18,7 +18,7 @@ import {
|
|
|
18
18
|
parseCommandProtectionRequest,
|
|
19
19
|
toCommandProtectionRepoState,
|
|
20
20
|
withRetry
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-YLKNOKME.js";
|
|
22
22
|
|
|
23
23
|
// src/services/command-protection-service.ts
|
|
24
24
|
import { readFile, stat } from "fs/promises";
|
|
@@ -3,7 +3,7 @@ import { createRequire as __createRequire } from 'node:module';
|
|
|
3
3
|
const require = __createRequire(import.meta.url);
|
|
4
4
|
import {
|
|
5
5
|
AspClient
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-6CYVRLIO.js";
|
|
7
7
|
import {
|
|
8
8
|
ASTER_BASE_URL,
|
|
9
9
|
ASTER_PROVIDER,
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
isRecord,
|
|
16
16
|
readOllamaAuthEnv,
|
|
17
17
|
readOpenAICompatibleAuthEnv
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-YLKNOKME.js";
|
|
19
19
|
|
|
20
20
|
// src/managers/codex-asp/notification-dispatch.ts
|
|
21
21
|
var TURN_STARTED_METHOD = "turn/started";
|
|
@@ -3,10 +3,10 @@ import { createRequire as __createRequire } from 'node:module';
|
|
|
3
3
|
const require = __createRequire(import.meta.url);
|
|
4
4
|
import {
|
|
5
5
|
execFileAsync
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-UKEZJE34.js";
|
|
7
7
|
import {
|
|
8
8
|
isVersionBelow
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-YLKNOKME.js";
|
|
10
10
|
|
|
11
11
|
// src/utils/codex-agent-env.ts
|
|
12
12
|
function buildCodexAgentEnv(source = process.env) {
|
|
@@ -240,7 +240,7 @@ function getCodexModelProvider(method) {
|
|
|
240
240
|
if (method === "foundry") return "azure";
|
|
241
241
|
return method === "ollama" || method === "openai-compatible" ? "replicas_openai_compatible" : "openai";
|
|
242
242
|
}
|
|
243
|
-
var ENGINE_PACKAGE_VERSION = "0.1.
|
|
243
|
+
var ENGINE_PACKAGE_VERSION = "0.1.1657";
|
|
244
244
|
var INITIALIZE_METHOD = "initialize";
|
|
245
245
|
var INITIALIZED_NOTIFICATION = "initialized";
|
|
246
246
|
var ACCOUNT_LOGIN_START_METHOD = "account/login/start";
|
|
@@ -12,15 +12,15 @@ import {
|
|
|
12
12
|
resolveDiffBase,
|
|
13
13
|
runGitCommand,
|
|
14
14
|
setAgentCredentialSnapshot
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-PMQVLR64.js";
|
|
16
16
|
import {
|
|
17
17
|
AppServerProcess,
|
|
18
18
|
buildCodexAgentEnv
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-6CYVRLIO.js";
|
|
20
20
|
import {
|
|
21
21
|
SUBPROCESS_MAX_BUFFER,
|
|
22
22
|
execFileAsync
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-UKEZJE34.js";
|
|
24
24
|
import {
|
|
25
25
|
isRecord
|
|
26
26
|
} from "./chunk-UZSNFLDQ.js";
|
|
@@ -61,7 +61,7 @@ import {
|
|
|
61
61
|
shrunkImageSize,
|
|
62
62
|
splitManagerInstructions,
|
|
63
63
|
withTimeout
|
|
64
|
-
} from "./chunk-
|
|
64
|
+
} from "./chunk-YLKNOKME.js";
|
|
65
65
|
|
|
66
66
|
// src/managers/codex-token-manager.ts
|
|
67
67
|
import { promises as fs } from "fs";
|
|
@@ -461,7 +461,7 @@ var CodexTokenManager = class extends BaseRefreshManager {
|
|
|
461
461
|
await this.applyCredentialUpdate(++this.credentialGeneration, async () => {
|
|
462
462
|
await this.applyCredentialsResponse(data);
|
|
463
463
|
setAgentCredentialSnapshot("codex", data);
|
|
464
|
-
const { restartCodexAspHostIfRunning: restartCodexAspHostIfRunning2 } = await import("./asp-host-
|
|
464
|
+
const { restartCodexAspHostIfRunning: restartCodexAspHostIfRunning2 } = await import("./asp-host-FQPUDYMI.js");
|
|
465
465
|
await restartCodexAspHostIfRunning2();
|
|
466
466
|
});
|
|
467
467
|
await this.start(true);
|
|
@@ -483,7 +483,7 @@ var CodexTokenManager = class extends BaseRefreshManager {
|
|
|
483
483
|
const accountChanged = ENGINE_ENV.REPLICAS_AGENT_CREDENTIALS.codex?.credentialId !== data.credentialId;
|
|
484
484
|
await this.applyCredentialsResponse(data);
|
|
485
485
|
if (restartOnChange && (accountChanged || CODEX_AUTH_ENV_KEYS.some((key, index) => process.env[key] !== previousEnv[index]))) {
|
|
486
|
-
const { restartCodexAspHostIfRunning: restartCodexAspHostIfRunning2 } = await import("./asp-host-
|
|
486
|
+
const { restartCodexAspHostIfRunning: restartCodexAspHostIfRunning2 } = await import("./asp-host-FQPUDYMI.js");
|
|
487
487
|
await restartCodexAspHostIfRunning2();
|
|
488
488
|
}
|
|
489
489
|
setAgentCredentialSnapshot("codex", data);
|
|
@@ -4,7 +4,7 @@ const require = __createRequire(import.meta.url);
|
|
|
4
4
|
import {
|
|
5
5
|
SUBPROCESS_MAX_BUFFER,
|
|
6
6
|
execFileAsync
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-UKEZJE34.js";
|
|
8
8
|
import {
|
|
9
9
|
isRecord as isRecord2
|
|
10
10
|
} from "./chunk-UZSNFLDQ.js";
|
|
@@ -21,7 +21,7 @@ import {
|
|
|
21
21
|
provisionedDeviceSchema,
|
|
22
22
|
readReplicasRuntimeEnv,
|
|
23
23
|
serializePosixEnvFile
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-YLKNOKME.js";
|
|
25
25
|
|
|
26
26
|
// src/runtime-env-loader.ts
|
|
27
27
|
import { readFileSync } from "fs";
|
|
@@ -3,7 +3,7 @@ import { createRequire as __createRequire } from 'node:module';
|
|
|
3
3
|
const require = __createRequire(import.meta.url);
|
|
4
4
|
import {
|
|
5
5
|
HOOK_EXEC_MAX_BUFFER_BYTES
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-YLKNOKME.js";
|
|
7
7
|
|
|
8
8
|
// src/utils/exec.ts
|
|
9
9
|
import { exec, execFile } from "child_process";
|
|
@@ -15961,6 +15961,7 @@ When someone asks for a recurring task or accepts an offer to automate a repeate
|
|
|
15961
15961
|
var REPLICAS_INSTRUCTIONS_TAG = "replicas_instructions";
|
|
15962
15962
|
var MANAGER_INSTRUCTIONS_TAG = "multitask_instructions";
|
|
15963
15963
|
var PR_FIXES_NEEDS_DECISION = "Needs your decision:";
|
|
15964
|
+
var TURN_INSTRUCTIONS_TAG = "turn_instructions";
|
|
15964
15965
|
function wrapInTag(content, tag) {
|
|
15965
15966
|
return `<${tag}>
|
|
15966
15967
|
${content}
|
|
@@ -16068,13 +16069,17 @@ var BOARD_RULES = `- The board in the Ships pane beside this chat is the user's
|
|
|
16068
16069
|
- On every ship event and every answer the user gives on the board, act with tools on the answer or on any work the event unblocks, such as starting the next task once a pull request merges, and update the board if its order, notes or overview changed. The user sees nothing you write in these turns, unless a message they typed is still unanswered because it arrived during the turn: then your final reply answers it, as in any turn they start. Otherwise the only way to reach them is \`${REPLICAS_MCP_TOOLS.sendToChat}\`. Call it only for what they would want right now: a deliverable they asked for, with its media, links or answer (the finished video, the requested numbers); a failure or blocker that needs them, also on the board; or a request of theirs being done. Never for status, such as "PR #12 merged", "deploying", "it's on the board" or "I asked the ship to\u2026": the board and the chat's own rows show those. End the turn with a one-line note of what you did; only the activity log shows it.
|
|
16069
16070
|
- The chat is like texting an assistant. In a turn the user typed, they see the text you write between tool calls as it streams, your final reply, what you send with \`${REPLICAS_MCP_TOOLS.sendToChat}\`, and your \`${REPLICAS_MCP_TOOLS.setStatus}\` line, never your tool calls. Unless you can answer right away, open with one line on what you'll do first and roughly how long it takes. Then call \`${REPLICAS_MCP_TOOLS.setStatus}\` with a few words on your current step, such as "Reading the billing webhook" or "Checking npm for outdated packages", and call it again each time you move to a new step. Before your final reply, write only what they'd want to know now: a finding that changes the answer, a ship you started, or a decision you need. Never narrate tool calls or say you're still working. When they message you mid-turn, reply to it in one line before anything else, then fold it into your work. Answer every message they type in chat, even one that arrives during a ship event or board answer, and never only on the board: if they ask something while you handle an event, answer that question, not just the event. Write in a line or two with links, and include any media inline. Never restate the board in chat: no status tables, per-ship lists or summaries of what ships did.
|
|
16070
16071
|
`;
|
|
16071
|
-
|
|
16072
|
+
function splitTaggedBlock(text4, tag) {
|
|
16073
|
+
const match = text4?.match(new RegExp(`\\s*<${tag}>\\n([\\s\\S]*?)\\n</${tag}>`));
|
|
16074
|
+
return { rest: match ? text4?.replace(match[0], "").trim() || void 0 : text4, block: match?.[1] };
|
|
16075
|
+
}
|
|
16072
16076
|
function splitManagerInstructions(customInstructions) {
|
|
16073
|
-
const
|
|
16074
|
-
return {
|
|
16075
|
-
|
|
16076
|
-
|
|
16077
|
-
};
|
|
16077
|
+
const { rest, block } = splitTaggedBlock(customInstructions, MANAGER_INSTRUCTIONS_TAG);
|
|
16078
|
+
return { customInstructions: rest, managerInstructions: block };
|
|
16079
|
+
}
|
|
16080
|
+
function splitTurnInstructions(customInstructions) {
|
|
16081
|
+
const { rest, block } = splitTaggedBlock(customInstructions, TURN_INSTRUCTIONS_TAG);
|
|
16082
|
+
return { customInstructions: rest, turnInstructions: block };
|
|
16078
16083
|
}
|
|
16079
16084
|
var MANAGER_TICKET_MESSAGE_NOTE = `The user sent this from your ticket on the Manager's board and reads your answer there, not in this chat. Answer them with \`${REPLICAS_MCP_TOOLS.replyOnTicket}\`: briefly, with a link or screenshot if it helps, and a follow-up question only if you need one. Keep longer work and detail in this chat.`;
|
|
16080
16085
|
var MANAGER_TICKET_REPLY_NUDGE = `The user is still waiting for your answer on your ticket, and they only read the ticket. Answer them now with \`${REPLICAS_MCP_TOOLS.replyOnTicket}\`, briefly.`;
|
|
@@ -21189,7 +21194,7 @@ async function withRetry(label, fn, options) {
|
|
|
21189
21194
|
}
|
|
21190
21195
|
|
|
21191
21196
|
// ../shared/src/tensorlake.ts
|
|
21192
|
-
var TENSORLAKE_IMAGE_NAME = "replicas-sandbox-2026-11-19-
|
|
21197
|
+
var TENSORLAKE_IMAGE_NAME = "replicas-sandbox-2026-11-19-v16";
|
|
21193
21198
|
var TENSORLAKE_DISK_MB = 100 * 1024;
|
|
21194
21199
|
|
|
21195
21200
|
// ../shared/src/egress.ts
|
|
@@ -23680,6 +23685,7 @@ export {
|
|
|
23680
23685
|
PR_FIXES_NEEDS_DECISION,
|
|
23681
23686
|
wrapInTag,
|
|
23682
23687
|
splitManagerInstructions,
|
|
23688
|
+
splitTurnInstructions,
|
|
23683
23689
|
MANAGER_TURN_ERROR_SUMMARY,
|
|
23684
23690
|
MANAGER_EVENT_MESSAGE_TYPE,
|
|
23685
23691
|
truncateManagerEventResponse,
|
|
@@ -23804,6 +23810,7 @@ export {
|
|
|
23804
23810
|
ENVIRONMENT_HOOK_RUN_LOG_LIMIT,
|
|
23805
23811
|
normalizeChatTranscriptMetadata,
|
|
23806
23812
|
parseChatTranscriptArtifact,
|
|
23813
|
+
START_HOOKS_RUNNING_PROMPT,
|
|
23807
23814
|
buildReplicasInstructions,
|
|
23808
23815
|
readSseStream,
|
|
23809
23816
|
isSkillRegistryManifest
|
|
@@ -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-
|
|
7
|
-
import "./chunk-
|
|
8
|
-
import "./chunk-
|
|
6
|
+
} from "./chunk-2VDQA473.js";
|
|
7
|
+
import "./chunk-PMQVLR64.js";
|
|
8
|
+
import "./chunk-UKEZJE34.js";
|
|
9
9
|
import {
|
|
10
10
|
isRecord
|
|
11
11
|
} from "./chunk-UZSNFLDQ.js";
|
|
12
|
-
import "./chunk-
|
|
12
|
+
import "./chunk-YLKNOKME.js";
|
|
13
13
|
import "./chunk-VEQXQN22.js";
|
|
14
14
|
|
|
15
15
|
// src/command-protection-hook.ts
|
|
@@ -14,12 +14,12 @@ import {
|
|
|
14
14
|
recoverCompletedTurn,
|
|
15
15
|
spawnMuseMsp,
|
|
16
16
|
startMuseSession
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-43SFZW43.js";
|
|
18
18
|
import {
|
|
19
19
|
AppServerProcess,
|
|
20
20
|
buildCodexAgentEnv
|
|
21
|
-
} from "./chunk-
|
|
22
|
-
import "./chunk-
|
|
21
|
+
} from "./chunk-6CYVRLIO.js";
|
|
22
|
+
import "./chunk-UKEZJE34.js";
|
|
23
23
|
import {
|
|
24
24
|
AGENT,
|
|
25
25
|
OPENCODE_GO_PROVIDER,
|
|
@@ -29,7 +29,7 @@ import {
|
|
|
29
29
|
headlessAgentUsagePath,
|
|
30
30
|
isRecord,
|
|
31
31
|
withTimeout
|
|
32
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-YLKNOKME.js";
|
|
33
33
|
import "./chunk-VEQXQN22.js";
|
|
34
34
|
|
|
35
35
|
// 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-2VDQA473.js";
|
|
95
95
|
import {
|
|
96
96
|
ACCOUNT_RATE_LIMITS_UPDATED_METHOD,
|
|
97
97
|
AGENT_MESSAGE_DELTA_METHOD,
|
|
@@ -129,10 +129,10 @@ import {
|
|
|
129
129
|
spawnMuseMsp,
|
|
130
130
|
startMuseSession,
|
|
131
131
|
uuidV7
|
|
132
|
-
} from "./chunk-
|
|
132
|
+
} from "./chunk-43SFZW43.js";
|
|
133
133
|
import {
|
|
134
134
|
publishedPullRequestUrls
|
|
135
|
-
} from "./chunk-
|
|
135
|
+
} from "./chunk-7UBUKFDR.js";
|
|
136
136
|
import {
|
|
137
137
|
ACCOUNT_RATE_LIMITS_READ_METHOD,
|
|
138
138
|
AsyncLock,
|
|
@@ -212,7 +212,7 @@ import {
|
|
|
212
212
|
transcriptSecrets,
|
|
213
213
|
upsertCredentialFileLines,
|
|
214
214
|
writeSecureCredentialFile
|
|
215
|
-
} from "./chunk-
|
|
215
|
+
} from "./chunk-MGHRWQZQ.js";
|
|
216
216
|
import {
|
|
217
217
|
ENGINE_ENV,
|
|
218
218
|
UNQUOTED_PATHS_CONFIG,
|
|
@@ -223,16 +223,16 @@ import {
|
|
|
223
223
|
resolveDiffBase,
|
|
224
224
|
setAgentCredentialSnapshot,
|
|
225
225
|
setLinearSessionId
|
|
226
|
-
} from "./chunk-
|
|
226
|
+
} from "./chunk-PMQVLR64.js";
|
|
227
227
|
import {
|
|
228
228
|
buildCodexAgentEnv,
|
|
229
229
|
getCodexModelProvider
|
|
230
|
-
} from "./chunk-
|
|
230
|
+
} from "./chunk-6CYVRLIO.js";
|
|
231
231
|
import {
|
|
232
232
|
SUBPROCESS_MAX_BUFFER,
|
|
233
233
|
execAsync,
|
|
234
234
|
execFileAsync
|
|
235
|
-
} from "./chunk-
|
|
235
|
+
} from "./chunk-UKEZJE34.js";
|
|
236
236
|
import {
|
|
237
237
|
isRecord as isRecord2
|
|
238
238
|
} from "./chunk-UZSNFLDQ.js";
|
|
@@ -338,6 +338,7 @@ import {
|
|
|
338
338
|
REPLICAS_MCP_SERVER_NAME,
|
|
339
339
|
REPLICAS_MCP_TOOLS,
|
|
340
340
|
REPLICAS_RUNTIME_ENV_ALIASES,
|
|
341
|
+
START_HOOKS_RUNNING_PROMPT,
|
|
341
342
|
SUBAGENT_MCP_HARNESSES,
|
|
342
343
|
SUBAGENT_MCP_SERVER_NAME,
|
|
343
344
|
SUBAGENT_MCP_TOOLS,
|
|
@@ -516,6 +517,7 @@ import {
|
|
|
516
517
|
skillNamesFromCommand,
|
|
517
518
|
spawnSubagentRequestSchema,
|
|
518
519
|
splitManagerInstructions,
|
|
520
|
+
splitTurnInstructions,
|
|
519
521
|
steerQueuedInOrder,
|
|
520
522
|
stripAgentDiagnosticErrors,
|
|
521
523
|
threadHandoffText,
|
|
@@ -529,7 +531,7 @@ import {
|
|
|
529
531
|
workspaceTokenRequestSchema,
|
|
530
532
|
workspaceTokenResponseSchema,
|
|
531
533
|
wrapInTag
|
|
532
|
-
} from "./chunk-
|
|
534
|
+
} from "./chunk-YLKNOKME.js";
|
|
533
535
|
import {
|
|
534
536
|
__commonJS,
|
|
535
537
|
__export,
|
|
@@ -11958,16 +11960,27 @@ var CodingAgentManager = class _CodingAgentManager {
|
|
|
11958
11960
|
await this.saveLastSenderKey(senderKey);
|
|
11959
11961
|
if (stopped) return;
|
|
11960
11962
|
const takesNotes = takesTurnNotes(request);
|
|
11961
|
-
const
|
|
11963
|
+
const { customInstructions: standardInstructions, turnInstructions } = splitTurnInstructions(request.customInstructions);
|
|
11964
|
+
const turnFacts = [
|
|
11965
|
+
...replicasConfigService.areHooksRunning() && (replicasConfigService.getStartHookConfig()?.commands.length ?? 0) > 0 ? [START_HOOKS_RUNNING_PROMPT] : [],
|
|
11966
|
+
...turnInstructions ? [turnInstructions] : []
|
|
11967
|
+
];
|
|
11968
|
+
const instructionsChanged = takesNotes && this.sentTurn && this.lastCustomInstructions !== standardInstructions;
|
|
11962
11969
|
this.sentTurn = true;
|
|
11963
|
-
this.lastCustomInstructions =
|
|
11970
|
+
this.lastCustomInstructions = standardInstructions;
|
|
11964
11971
|
const turnLost = takesNotes && this.previousTurnLost;
|
|
11965
11972
|
if (turnLost) this.previousTurnLost = false;
|
|
11966
|
-
const notes = [
|
|
11973
|
+
const notes = takesNotes ? [
|
|
11967
11974
|
...turnLost ? [`A workspace restart cut your previous turn off, and it was not retried. The working tree may hold partial work from it.${this.restoredMessages.has(request) ? " This message was sent before the restart." : ""}`] : [],
|
|
11968
|
-
...instructionsChanged ? ["Your instructions changed since your previous turn. Earlier turns followed the old version: follow the current instructions from here on, and leave earlier replies as they are."] : []
|
|
11969
|
-
|
|
11970
|
-
|
|
11975
|
+
...instructionsChanged ? ["Your instructions changed since your previous turn. Earlier turns followed the old version: follow the current instructions from here on, and leave earlier replies as they are."] : [],
|
|
11976
|
+
...turnFacts
|
|
11977
|
+
].map((note) => wrapInTag(note, REPLICAS_INSTRUCTIONS_TAG)) : [];
|
|
11978
|
+
await processMessage({
|
|
11979
|
+
...delivered,
|
|
11980
|
+
// A goal or a slash command is sent as written, so what its turn needs to know goes in the system prompt.
|
|
11981
|
+
customInstructions: takesNotes ? standardInstructions : [standardInstructions, ...turnFacts].filter(Boolean).join("\n\n") || void 0,
|
|
11982
|
+
message: [delivered.message, ...notes].join("\n\n")
|
|
11983
|
+
}, signal);
|
|
11971
11984
|
} finally {
|
|
11972
11985
|
this.closeTurn();
|
|
11973
11986
|
}
|
|
@@ -12163,9 +12176,8 @@ ${request.message}` }, senderKey };
|
|
|
12163
12176
|
const { request: withSender, senderKey } = this.withSenderLine(taken.message);
|
|
12164
12177
|
const note = wrapInTag("You received this message while working. The chat folds everything before your last message of this turn, so that message must answer it too, even if you already did earlier.", REPLICAS_INSTRUCTIONS_TAG);
|
|
12165
12178
|
const command = !takesTurnNotes(withSender);
|
|
12166
|
-
const
|
|
12167
|
-
|
|
12168
|
-
${note}` };
|
|
12179
|
+
const { turnInstructions } = splitTurnInstructions(withSender.customInstructions);
|
|
12180
|
+
const delivered = command ? withSender : { ...withSender, message: [withSender.message, note, ...turnInstructions ? [wrapInTag(turnInstructions, REPLICAS_INSTRUCTIONS_TAG)] : []].join("\n\n") };
|
|
12169
12181
|
const inFlight = { message: taken.message, delivered, read: false };
|
|
12170
12182
|
this.steersInFlight.set(messageId, inFlight);
|
|
12171
12183
|
try {
|
|
@@ -12278,7 +12290,6 @@ ${note}` };
|
|
|
12278
12290
|
return buildReplicasInstructions({
|
|
12279
12291
|
enginePort: ENGINE_ENV.REPLICAS_ENGINE_PORT,
|
|
12280
12292
|
workspaceRoot: ENGINE_ENV.WORKSPACE_ROOT,
|
|
12281
|
-
startHooksRunning: replicasConfigService.areHooksRunning() && (replicasConfigService.getStartHookConfig()?.commands.length ?? 0) > 0,
|
|
12282
12293
|
environmentSystemPrompt: ENGINE_ENV.REPLICAS_ENV_SYSTEM_PROMPT,
|
|
12283
12294
|
devices: ENGINE_ENV.REPLICAS_ENV_DEVICES.map((device) => ({ ...device, screen: device.screen_password !== void 0 })),
|
|
12284
12295
|
tailnet: Boolean(ENGINE_ENV.TS_AUTHKEY),
|
|
@@ -3,13 +3,13 @@ import { createRequire as __createRequire } from 'node:module';
|
|
|
3
3
|
const require = __createRequire(import.meta.url);
|
|
4
4
|
import {
|
|
5
5
|
publishedPullRequestUrls
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-7UBUKFDR.js";
|
|
7
7
|
import {
|
|
8
8
|
isRecord
|
|
9
9
|
} from "./chunk-UZSNFLDQ.js";
|
|
10
10
|
import {
|
|
11
11
|
shouldRefreshPullRequests
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-YLKNOKME.js";
|
|
13
13
|
import "./chunk-VEQXQN22.js";
|
|
14
14
|
|
|
15
15
|
// src/services/post-tool-pr-notifier.ts
|
package/dist/src/subagent-mcp.js
CHANGED