replicas-engine 0.1.1047 → 0.1.1049
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-62D2DFKZ.js → asp-host-KHY6UQFR.js} +5 -5
- package/dist/src/{chunk-UUPJGKO3.js → chunk-2DGMTTR6.js} +2 -2
- package/dist/src/{chunk-4RU7OIGJ.js → chunk-5KKWYCHQ.js} +2 -2
- package/dist/src/{chunk-VD34QRH4.js → chunk-PBIQJJGB.js} +17 -1
- package/dist/src/{chunk-LUOCDBJX.js → chunk-U2W5AGOT.js} +2 -2
- package/dist/src/{chunk-4FUTHQI2.js → chunk-UGWQ3RBL.js} +10 -6
- package/dist/src/{chunk-MWBHKIKD.js → chunk-V2BER3SY.js} +3 -3
- package/dist/src/{chunk-SE27SAJI.js → chunk-VN3EAKA5.js} +1 -1
- package/dist/src/{chunk-QMTXTCE4.js → chunk-YBRC6H4C.js} +1 -1
- package/dist/src/command-protection-hook.js +4 -4
- package/dist/src/headless-agent.js +4 -4
- package/dist/src/index.js +32 -12
- 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
|
listRunningCodexModels,
|
|
9
9
|
restartCodexAspHost,
|
|
10
10
|
restartCodexAspHostIfRunning
|
|
11
|
-
} from "./chunk-
|
|
12
|
-
import "./chunk-
|
|
13
|
-
import "./chunk-
|
|
14
|
-
import "./chunk-
|
|
11
|
+
} from "./chunk-UGWQ3RBL.js";
|
|
12
|
+
import "./chunk-2DGMTTR6.js";
|
|
13
|
+
import "./chunk-V2BER3SY.js";
|
|
14
|
+
import "./chunk-YBRC6H4C.js";
|
|
15
15
|
import "./chunk-UZSNFLDQ.js";
|
|
16
|
-
import "./chunk-
|
|
16
|
+
import "./chunk-PBIQJJGB.js";
|
|
17
17
|
import "./chunk-VEQXQN22.js";
|
|
18
18
|
export {
|
|
19
19
|
CODEX_ULTRAFAST_SERVICE_TIER,
|
|
@@ -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-YBRC6H4C.js";
|
|
8
8
|
import {
|
|
9
9
|
isRecord as isRecord2
|
|
10
10
|
} from "./chunk-UZSNFLDQ.js";
|
|
@@ -18,7 +18,7 @@ import {
|
|
|
18
18
|
isValidAgentProvider,
|
|
19
19
|
parsePosixEnvFile,
|
|
20
20
|
readReplicasRuntimeEnv
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-PBIQJJGB.js";
|
|
22
22
|
|
|
23
23
|
// src/runtime-env-loader.ts
|
|
24
24
|
import { readFileSync } from "fs";
|
|
@@ -5,14 +5,14 @@ import {
|
|
|
5
5
|
getOriginDefaultBranch,
|
|
6
6
|
monolithRequest,
|
|
7
7
|
runGitCommand
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-2DGMTTR6.js";
|
|
9
9
|
import {
|
|
10
10
|
extractCommandProtectionCommandText,
|
|
11
11
|
findCommandProtectionGitLookups,
|
|
12
12
|
findGitCommitSignals,
|
|
13
13
|
findPrMergeSignals,
|
|
14
14
|
parseCommandProtectionRequest
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-PBIQJJGB.js";
|
|
16
16
|
|
|
17
17
|
// src/services/command-protection-service.ts
|
|
18
18
|
import { readFile, stat } from "fs/promises";
|
|
@@ -5254,6 +5254,7 @@ var REPLICAS_MCP_TOOLS = {
|
|
|
5254
5254
|
linearSessionIntent: "register_linear_session_intent",
|
|
5255
5255
|
listChannelSettings: "list_channel_settings",
|
|
5256
5256
|
saveChannelPreset: "save_channel_preset",
|
|
5257
|
+
deleteChannelPreset: "delete_channel_preset",
|
|
5257
5258
|
updateChannelSettings: "update_channel_settings",
|
|
5258
5259
|
spawnSubagent: "spawn_subagent",
|
|
5259
5260
|
messageSubagent: "message_subagent",
|
|
@@ -5592,6 +5593,7 @@ var DEFAULT_DEFAULT_SKILLS = {
|
|
|
5592
5593
|
|
|
5593
5594
|
// ../shared/src/prompts.ts
|
|
5594
5595
|
var REPLICAS_INSTRUCTIONS_TAG = "replicas_instructions";
|
|
5596
|
+
var MULTITASK_INSTRUCTIONS_TAG = "multitask_instructions";
|
|
5595
5597
|
function wrapInTag(content, tag) {
|
|
5596
5598
|
return `<${tag}>
|
|
5597
5599
|
${content}
|
|
@@ -5604,6 +5606,14 @@ function removeTag(text2, tag) {
|
|
|
5604
5606
|
function removeReplicasInstructions(text2) {
|
|
5605
5607
|
return removeTag(text2, REPLICAS_INSTRUCTIONS_TAG);
|
|
5606
5608
|
}
|
|
5609
|
+
var MULTITASK_INSTRUCTIONS_BLOCK = new RegExp(`\\s*<${MULTITASK_INSTRUCTIONS_TAG}>\\n([\\s\\S]*?)\\n</${MULTITASK_INSTRUCTIONS_TAG}>`);
|
|
5610
|
+
function splitMultitaskInstructions(customInstructions) {
|
|
5611
|
+
const match = customInstructions?.match(MULTITASK_INSTRUCTIONS_BLOCK);
|
|
5612
|
+
return {
|
|
5613
|
+
customInstructions: match ? customInstructions?.replace(match[0], "").trim() || void 0 : customInstructions,
|
|
5614
|
+
multitaskInstructions: match?.[1]
|
|
5615
|
+
};
|
|
5616
|
+
}
|
|
5607
5617
|
|
|
5608
5618
|
// ../shared/src/user-message-attachments.ts
|
|
5609
5619
|
var ATTACHMENT_PLACEHOLDER_REGEX = /^\[\d+ (?:(?:images?|files?)(?: and \d+ files?)? attached|(?:image )?attachments?)\]$/;
|
|
@@ -9055,10 +9065,14 @@ var mothershipSaveChannelPresetToolInputSchema = mothershipSlackConfirmationSche
|
|
|
9055
9065
|
});
|
|
9056
9066
|
var mothershipUpdateChannelSettingsToolInputSchema = mothershipSlackConfirmationSchema.extend({
|
|
9057
9067
|
source: z18.enum(MOTHERSHIP_SOURCE_TYPES).optional().describe("Defaults to `slack`."),
|
|
9058
|
-
external_id: z18.string().describe(
|
|
9068
|
+
external_id: z18.string().describe("Slack channel id or Linear team id."),
|
|
9069
|
+
monitored: z18.boolean().optional().describe("`false` stops Mothership from handling the source: it excludes a Slack channel or stops monitoring a Linear team. `true` resumes a Slack channel or starts monitoring a Linear team, and only an organization admin can ask for that. Omit to keep it."),
|
|
9059
9070
|
preset_id: z18.string().nullable().optional().describe("Preset to assign; `null` removes the preset. Omit to keep it."),
|
|
9060
9071
|
instructions: z18.string().nullable().optional().describe("Complete channel-specific instructions, applied after the preset; replaces the existing text. `null` clears them. Omit to keep them.")
|
|
9061
9072
|
});
|
|
9073
|
+
var mothershipDeleteChannelPresetToolInputSchema = mothershipSlackConfirmationSchema.extend({
|
|
9074
|
+
preset_id: z18.string().describe(`Id of the preset to delete, from \`${REPLICAS_MCP_TOOLS.listChannelSettings}\`.`)
|
|
9075
|
+
});
|
|
9062
9076
|
|
|
9063
9077
|
// ../shared/src/routes/plugin-catalog.ts
|
|
9064
9078
|
var EXPLICIT_PLUGIN_CATALOG = [
|
|
@@ -9904,7 +9918,9 @@ export {
|
|
|
9904
9918
|
isCompaction,
|
|
9905
9919
|
describeMessageSteps,
|
|
9906
9920
|
REPLICAS_INSTRUCTIONS_TAG,
|
|
9921
|
+
MULTITASK_INSTRUCTIONS_TAG,
|
|
9907
9922
|
wrapInTag,
|
|
9923
|
+
splitMultitaskInstructions,
|
|
9908
9924
|
extractErrorText,
|
|
9909
9925
|
isTransientErrorText,
|
|
9910
9926
|
extractToolResultText,
|
|
@@ -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-V2BER3SY.js";
|
|
7
7
|
import {
|
|
8
8
|
ASTER_BASE_URL,
|
|
9
9
|
ASTER_PROVIDER,
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
codexReasoningEffortForThinkingLevel,
|
|
12
12
|
isRecord,
|
|
13
13
|
readOllamaAuthEnv
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-PBIQJJGB.js";
|
|
15
15
|
|
|
16
16
|
// src/managers/codex-asp/notification-dispatch.ts
|
|
17
17
|
var TURN_STARTED_METHOD = "turn/started";
|
|
@@ -10,15 +10,15 @@ import {
|
|
|
10
10
|
resolveDiffBase,
|
|
11
11
|
runGitCommand,
|
|
12
12
|
setAgentCredentialSnapshot
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-2DGMTTR6.js";
|
|
14
14
|
import {
|
|
15
15
|
AppServerProcess,
|
|
16
16
|
buildCodexAgentEnv
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-V2BER3SY.js";
|
|
18
18
|
import {
|
|
19
19
|
SUBPROCESS_MAX_BUFFER,
|
|
20
20
|
execFileAsync
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-YBRC6H4C.js";
|
|
22
22
|
import {
|
|
23
23
|
isRecord
|
|
24
24
|
} from "./chunk-UZSNFLDQ.js";
|
|
@@ -31,6 +31,7 @@ import {
|
|
|
31
31
|
GIT_CREDENTIAL_HELPER_FILENAME,
|
|
32
32
|
IMAGE_MEDIA_TYPES,
|
|
33
33
|
InFlightMap,
|
|
34
|
+
MULTITASK_INSTRUCTIONS_TAG,
|
|
34
35
|
SUBAGENT_MCP_SERVER_NAME,
|
|
35
36
|
SUBAGENT_MCP_TOOL_NAMES,
|
|
36
37
|
buildCodeHostPrUrl,
|
|
@@ -52,8 +53,9 @@ import {
|
|
|
52
53
|
parseGitRemote,
|
|
53
54
|
readOllamaAuthEnv,
|
|
54
55
|
resolveOpenAICompatibleModelsUrl,
|
|
56
|
+
splitMultitaskInstructions,
|
|
55
57
|
withTimeout
|
|
56
|
-
} from "./chunk-
|
|
58
|
+
} from "./chunk-PBIQJJGB.js";
|
|
57
59
|
|
|
58
60
|
// src/managers/codex-token-manager.ts
|
|
59
61
|
import { promises as fs } from "fs";
|
|
@@ -289,7 +291,7 @@ var CodexTokenManager = class extends BaseRefreshManager {
|
|
|
289
291
|
await this.applyCredentialUpdate(++this.credentialGeneration, async () => {
|
|
290
292
|
await this.applyCredentialsResponse(data);
|
|
291
293
|
setAgentCredentialSnapshot("codex", data);
|
|
292
|
-
const { restartCodexAspHostIfRunning: restartCodexAspHostIfRunning2 } = await import("./asp-host-
|
|
294
|
+
const { restartCodexAspHostIfRunning: restartCodexAspHostIfRunning2 } = await import("./asp-host-KHY6UQFR.js");
|
|
293
295
|
await restartCodexAspHostIfRunning2();
|
|
294
296
|
});
|
|
295
297
|
await this.start(true);
|
|
@@ -310,7 +312,7 @@ var CodexTokenManager = class extends BaseRefreshManager {
|
|
|
310
312
|
const accountChanged = ENGINE_ENV.REPLICAS_AGENT_CREDENTIALS.codex?.credentialId !== data.credentialId;
|
|
311
313
|
await this.applyCredentialsResponse(data);
|
|
312
314
|
if (restartOnChange && (accountChanged || CODEX_AUTH_ENV_KEYS.some((key, index) => process.env[key] !== previousEnv[index]))) {
|
|
313
|
-
const { restartCodexAspHostIfRunning: restartCodexAspHostIfRunning2 } = await import("./asp-host-
|
|
315
|
+
const { restartCodexAspHostIfRunning: restartCodexAspHostIfRunning2 } = await import("./asp-host-KHY6UQFR.js");
|
|
314
316
|
await restartCodexAspHostIfRunning2();
|
|
315
317
|
}
|
|
316
318
|
setAgentCredentialSnapshot("codex", data);
|
|
@@ -1825,10 +1827,12 @@ async function buildTurnStartParams(threadId, request, serviceTier) {
|
|
|
1825
1827
|
const effort = toReasoningEffort(request.thinkingLevel);
|
|
1826
1828
|
const model = request.model ?? DEFAULT_MODEL;
|
|
1827
1829
|
const { input, tempImagePaths } = await buildTurnInput(request);
|
|
1830
|
+
const { multitaskInstructions } = splitMultitaskInstructions(request.customInstructions);
|
|
1828
1831
|
return {
|
|
1829
1832
|
params: {
|
|
1830
1833
|
threadId,
|
|
1831
1834
|
input,
|
|
1835
|
+
...multitaskInstructions ? { additionalContext: { [MULTITASK_INSTRUCTIONS_TAG]: { kind: "application", value: multitaskInstructions } } } : {},
|
|
1832
1836
|
model,
|
|
1833
1837
|
...serviceTier !== void 0 ? { serviceTier } : {},
|
|
1834
1838
|
...codexApprovalPolicyOverrides(),
|
|
@@ -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-YBRC6H4C.js";
|
|
7
7
|
import {
|
|
8
8
|
isVersionBelow
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-PBIQJJGB.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.1049";
|
|
244
244
|
var INITIALIZE_METHOD = "initialize";
|
|
245
245
|
var INITIALIZED_NOTIFICATION = "initialized";
|
|
246
246
|
var ACCOUNT_LOGIN_START_METHOD = "account/login/start";
|
|
@@ -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-PBIQJJGB.js";
|
|
7
7
|
|
|
8
8
|
// src/utils/exec.ts
|
|
9
9
|
import { exec, execFile } from "child_process";
|
|
@@ -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-5KKWYCHQ.js";
|
|
7
|
+
import "./chunk-2DGMTTR6.js";
|
|
8
|
+
import "./chunk-YBRC6H4C.js";
|
|
9
9
|
import {
|
|
10
10
|
isRecord
|
|
11
11
|
} from "./chunk-UZSNFLDQ.js";
|
|
12
|
-
import "./chunk-
|
|
12
|
+
import "./chunk-PBIQJJGB.js";
|
|
13
13
|
import "./chunk-VEQXQN22.js";
|
|
14
14
|
|
|
15
15
|
// src/command-protection-hook.ts
|
|
@@ -13,12 +13,12 @@ import {
|
|
|
13
13
|
recoverCompletedTurn,
|
|
14
14
|
spawnMuseMsp,
|
|
15
15
|
startMuseSession
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-U2W5AGOT.js";
|
|
17
17
|
import {
|
|
18
18
|
AppServerProcess,
|
|
19
19
|
buildCodexAgentEnv
|
|
20
|
-
} from "./chunk-
|
|
21
|
-
import "./chunk-
|
|
20
|
+
} from "./chunk-V2BER3SY.js";
|
|
21
|
+
import "./chunk-YBRC6H4C.js";
|
|
22
22
|
import {
|
|
23
23
|
AGENT,
|
|
24
24
|
OPENCODE_GO_PROVIDER,
|
|
@@ -28,7 +28,7 @@ import {
|
|
|
28
28
|
headlessAgentUsagePath,
|
|
29
29
|
isRecord,
|
|
30
30
|
withTimeout
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-PBIQJJGB.js";
|
|
32
32
|
import "./chunk-VEQXQN22.js";
|
|
33
33
|
|
|
34
34
|
// src/headless-agent.ts
|
package/dist/src/index.js
CHANGED
|
@@ -27,7 +27,7 @@ import {
|
|
|
27
27
|
evaluateCommandProtection,
|
|
28
28
|
extractToolCommand,
|
|
29
29
|
reportCommandProtectionBlock
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-5KKWYCHQ.js";
|
|
31
31
|
import {
|
|
32
32
|
ACCOUNT_RATE_LIMITS_UPDATED_METHOD,
|
|
33
33
|
AGENT_MESSAGE_DELTA_METHOD,
|
|
@@ -64,10 +64,10 @@ import {
|
|
|
64
64
|
spawnMuseMsp,
|
|
65
65
|
startMuseSession,
|
|
66
66
|
uuidV7
|
|
67
|
-
} from "./chunk-
|
|
67
|
+
} from "./chunk-U2W5AGOT.js";
|
|
68
68
|
import {
|
|
69
69
|
publishedPullRequestUrls
|
|
70
|
-
} from "./chunk-
|
|
70
|
+
} from "./chunk-VN3EAKA5.js";
|
|
71
71
|
import {
|
|
72
72
|
ACCOUNT_RATE_LIMITS_READ_METHOD,
|
|
73
73
|
AsyncLock,
|
|
@@ -129,7 +129,7 @@ import {
|
|
|
129
129
|
timestampFromSeconds,
|
|
130
130
|
upsertCredentialFileLines,
|
|
131
131
|
writeSecureCredentialFile
|
|
132
|
-
} from "./chunk-
|
|
132
|
+
} from "./chunk-UGWQ3RBL.js";
|
|
133
133
|
import {
|
|
134
134
|
ENGINE_ENV,
|
|
135
135
|
monolithRequest,
|
|
@@ -138,15 +138,15 @@ import {
|
|
|
138
138
|
reloadEngineEnv,
|
|
139
139
|
resolveDiffBase,
|
|
140
140
|
setAgentCredentialSnapshot
|
|
141
|
-
} from "./chunk-
|
|
141
|
+
} from "./chunk-2DGMTTR6.js";
|
|
142
142
|
import {
|
|
143
143
|
getCodexModelProvider
|
|
144
|
-
} from "./chunk-
|
|
144
|
+
} from "./chunk-V2BER3SY.js";
|
|
145
145
|
import {
|
|
146
146
|
SUBPROCESS_MAX_BUFFER,
|
|
147
147
|
execAsync,
|
|
148
148
|
execFileAsync
|
|
149
|
-
} from "./chunk-
|
|
149
|
+
} from "./chunk-YBRC6H4C.js";
|
|
150
150
|
import {
|
|
151
151
|
isRecord as isRecord2
|
|
152
152
|
} from "./chunk-UZSNFLDQ.js";
|
|
@@ -211,6 +211,7 @@ import {
|
|
|
211
211
|
MAX_CODEX_GOAL_OBJECTIVE_CHARS,
|
|
212
212
|
MAX_REPO_FILE_CONTENT_BYTES,
|
|
213
213
|
MERGED_MESSAGE_SEPARATOR,
|
|
214
|
+
MULTITASK_INSTRUCTIONS_TAG,
|
|
214
215
|
OLLAMA_AGENTS,
|
|
215
216
|
OPENCODE_GO_BASE_URL,
|
|
216
217
|
OPENCODE_GO_PROVIDER,
|
|
@@ -361,6 +362,7 @@ import {
|
|
|
361
362
|
shouldRefreshPullRequests,
|
|
362
363
|
skillNamesFromCommand,
|
|
363
364
|
spawnSubagentRequestSchema,
|
|
365
|
+
splitMultitaskInstructions,
|
|
364
366
|
stripAgentDiagnosticErrors,
|
|
365
367
|
toClaudeCodeModel,
|
|
366
368
|
updateChatDisplayNameRequestSchema,
|
|
@@ -371,7 +373,7 @@ import {
|
|
|
371
373
|
workspaceTokenRequestSchema,
|
|
372
374
|
workspaceTokenResponseSchema,
|
|
373
375
|
wrapInTag
|
|
374
|
-
} from "./chunk-
|
|
376
|
+
} from "./chunk-PBIQJJGB.js";
|
|
375
377
|
import {
|
|
376
378
|
cloneMcpConfig,
|
|
377
379
|
ensureCompatibilityImports,
|
|
@@ -12601,6 +12603,7 @@ var MAX_MIDTURN_CONTINUE_RETRIES = 2;
|
|
|
12601
12603
|
var TRANSIENT_RETRY_DELAYS_MS = [1e3, 2500];
|
|
12602
12604
|
var CLAUDE_TRANSIENT_HTTP_STATUSES = [408, 500, 502, 503, 504, 529];
|
|
12603
12605
|
var CLAUDE_MIDTURN_CONTINUE_PROMPT = "Your previous turn was interrupted by a transient network error before it could finish. Continue from exactly where you left off. Do not repeat any tool calls, commits, messages, or other actions you have already completed \u2014 first check what is already done, then do only the remaining work.";
|
|
12606
|
+
var CLAUDE_RETRY_PROMPT = "Your previous attempt to respond to the message above failed before producing a response. Respond to it now.";
|
|
12604
12607
|
var TOOL_TARGET = /^\s*\{\s*"(\w+)"\s*:\s*(?:"((?:[^"\\]|\\.)*)(")?)?/;
|
|
12605
12608
|
var JSON_FIRST_LINE = /^(?:[^\\]|\\[^n])*?(?=\\n)/;
|
|
12606
12609
|
function toSlashCommands(command) {
|
|
@@ -12627,6 +12630,8 @@ var ClaudeManager = class _ClaudeManager extends CodingAgentManager {
|
|
|
12627
12630
|
sessionActivity = createClaudeSessionActivity();
|
|
12628
12631
|
backgroundContinuationTimer = null;
|
|
12629
12632
|
pendingInterrupt = false;
|
|
12633
|
+
// Claude Code writes a started prompt to the session transcript even when the turn then fails, so a retry must not resend it.
|
|
12634
|
+
turnPromptRecorded = false;
|
|
12630
12635
|
backgroundTasks = new ClaudeBackgroundTasks();
|
|
12631
12636
|
backgroundRecoveryAttempted = false;
|
|
12632
12637
|
// Ultracode workflow child agents never reach the SDK stream (forwardSubagentText
|
|
@@ -12976,6 +12981,9 @@ var ClaudeManager = class _ClaudeManager extends CodingAgentManager {
|
|
|
12976
12981
|
return;
|
|
12977
12982
|
} catch (error) {
|
|
12978
12983
|
lastError = error;
|
|
12984
|
+
if (this.turnPromptRecorded) {
|
|
12985
|
+
currentRequest = { ...currentRequest, message: CLAUDE_RETRY_PROMPT, images: [], goalMode: false };
|
|
12986
|
+
}
|
|
12979
12987
|
const quotaKind = _ClaudeManager.quotaLimitKind(error);
|
|
12980
12988
|
if (quotaKind) {
|
|
12981
12989
|
const detail = error instanceof ClaudeQuotaError ? error.message : extractErrorText(error);
|
|
@@ -13198,6 +13206,7 @@ var ClaudeManager = class _ClaudeManager extends CodingAgentManager {
|
|
|
13198
13206
|
this.pendingInterrupt = false;
|
|
13199
13207
|
return;
|
|
13200
13208
|
}
|
|
13209
|
+
this.turnPromptRecorded = false;
|
|
13201
13210
|
await new Promise((resolve7, reject) => {
|
|
13202
13211
|
const steers = options.steers ?? /* @__PURE__ */ new Map();
|
|
13203
13212
|
this.pendingTurn = {
|
|
@@ -13430,6 +13439,7 @@ var ClaudeManager = class _ClaudeManager extends CodingAgentManager {
|
|
|
13430
13439
|
this.setAuthRetrying(false);
|
|
13431
13440
|
const lifecycle2 = msg;
|
|
13432
13441
|
if (isRecord(lifecycle2) && lifecycle2.type === "command_lifecycle" && lifecycle2.state === "started" && typeof lifecycle2.command_uuid === "string") {
|
|
13442
|
+
if (this.pendingTurn?.userMessageUuids.has(lifecycle2.command_uuid)) this.turnPromptRecorded = true;
|
|
13433
13443
|
await this.recordSteerRead(lifecycle2.command_uuid);
|
|
13434
13444
|
}
|
|
13435
13445
|
if (this.pendingTurn && _ClaudeManager.isTurnActivity(msg)) {
|
|
@@ -14394,14 +14404,14 @@ var CodexAspManager = class extends CodingAgentManager {
|
|
|
14394
14404
|
}
|
|
14395
14405
|
async prepareGoalCommand(request, recordUserMessage) {
|
|
14396
14406
|
const host = await getCodexAspHost();
|
|
14397
|
-
const developerInstructions = this.buildCombinedInstructions(request.customInstructions, true);
|
|
14407
|
+
const developerInstructions = this.buildCombinedInstructions(splitMultitaskInstructions(request.customInstructions).customInstructions, true);
|
|
14398
14408
|
recordUserMessage({ command: "goal" });
|
|
14399
14409
|
const threadId = await this.ensureThread(host, request, developerInstructions);
|
|
14400
14410
|
return { host, threadId };
|
|
14401
14411
|
}
|
|
14402
14412
|
async executeAspTurn(request, recordUserMessage, signal, options = {}) {
|
|
14403
14413
|
const host = await getCodexAspHost();
|
|
14404
|
-
const developerInstructions = this.buildCombinedInstructions(request.customInstructions, true);
|
|
14414
|
+
const developerInstructions = this.buildCombinedInstructions(splitMultitaskInstructions(request.customInstructions).customInstructions, true);
|
|
14405
14415
|
recordUserMessage(options.userMessagePayload);
|
|
14406
14416
|
const threadId = await this.ensureThread(host, request, developerInstructions);
|
|
14407
14417
|
const serviceTier = await this.resolveRequestedServiceTier(host, request);
|
|
@@ -14547,7 +14557,14 @@ ${text.slice(-24e3)}`
|
|
|
14547
14557
|
});
|
|
14548
14558
|
}
|
|
14549
14559
|
async runGoalTurn(host, threadId, request, objective, signal) {
|
|
14560
|
+
const { multitaskInstructions } = splitMultitaskInstructions(request.customInstructions);
|
|
14550
14561
|
return this.observeTurn(host, threadId, request, signal, async () => {
|
|
14562
|
+
if (multitaskInstructions) {
|
|
14563
|
+
await host.client.request(THREAD_INJECT_ITEMS_METHOD, {
|
|
14564
|
+
threadId,
|
|
14565
|
+
items: [{ type: "message", role: "developer", content: [{ type: "input_text", text: wrapInTag(multitaskInstructions, MULTITASK_INSTRUCTIONS_TAG) }] }]
|
|
14566
|
+
});
|
|
14567
|
+
}
|
|
14551
14568
|
const response = await host.client.request(
|
|
14552
14569
|
THREAD_GOAL_SET_METHOD,
|
|
14553
14570
|
{ threadId, objective, status: "active" }
|
|
@@ -57342,6 +57359,7 @@ var PiManager = class extends CodingAgentManager {
|
|
|
57342
57359
|
unsubscribe = null;
|
|
57343
57360
|
activeSessionFile = null;
|
|
57344
57361
|
sessionSubagentMcpParentChatId;
|
|
57362
|
+
sessionInstructions;
|
|
57345
57363
|
historyFilePath;
|
|
57346
57364
|
historyFile;
|
|
57347
57365
|
providerId = "openrouter";
|
|
@@ -57391,8 +57409,9 @@ var PiManager = class extends CodingAgentManager {
|
|
|
57391
57409
|
}
|
|
57392
57410
|
async ensureSession(request) {
|
|
57393
57411
|
const subagentMcpParentChatId = this.subagentMcpParentChatId();
|
|
57412
|
+
const instructions = this.buildCombinedInstructions(request.customInstructions) ?? "";
|
|
57394
57413
|
let retainedModel;
|
|
57395
|
-
if (this.session && this.sessionSubagentMcpParentChatId !== subagentMcpParentChatId) {
|
|
57414
|
+
if (this.session && (this.sessionSubagentMcpParentChatId !== subagentMcpParentChatId || this.sessionInstructions !== instructions)) {
|
|
57396
57415
|
retainedModel = this.session.model?.id;
|
|
57397
57416
|
await this.dispose();
|
|
57398
57417
|
}
|
|
@@ -57509,7 +57528,7 @@ var PiManager = class extends CodingAgentManager {
|
|
|
57509
57528
|
cwd: this.workingDirectory,
|
|
57510
57529
|
agentDir: join22(ENGINE_ENV.HOME_DIR, ".pi", "agent"),
|
|
57511
57530
|
extensionFactories,
|
|
57512
|
-
appendSystemPrompt: [
|
|
57531
|
+
appendSystemPrompt: [instructions]
|
|
57513
57532
|
});
|
|
57514
57533
|
await resourceLoader.reload();
|
|
57515
57534
|
const result = await createAgentSession({
|
|
@@ -57521,6 +57540,7 @@ var PiManager = class extends CodingAgentManager {
|
|
|
57521
57540
|
});
|
|
57522
57541
|
this.session = result.session;
|
|
57523
57542
|
this.sessionSubagentMcpParentChatId = subagentMcpParentChatId;
|
|
57543
|
+
this.sessionInstructions = instructions;
|
|
57524
57544
|
if (request.thinkingLevel) {
|
|
57525
57545
|
this.session.setThinkingLevel(piThinkingLevel(request.thinkingLevel));
|
|
57526
57546
|
}
|
|
@@ -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-VN3EAKA5.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-PBIQJJGB.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