replicas-engine 0.1.976 → 0.1.980
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-KBYF3XHV.js → asp-host-B2JCJN3Z.js} +5 -5
- package/dist/src/{chunk-OXFR4PCR.js → chunk-46LSTB3K.js} +3 -3
- package/dist/src/{chunk-TCG5OMQH.js → chunk-B3O2TRKY.js} +1 -1
- package/dist/src/{chunk-2HTVMGEW.js → chunk-KY6CIXSR.js} +3 -3
- package/dist/src/{chunk-ZOYKIW5D.js → chunk-MH7ZFBXK.js} +6 -6
- package/dist/src/{chunk-NTM575B4.js → chunk-NY2TNHT2.js} +36 -9
- package/dist/src/{chunk-DTKUVZ6U.js → chunk-OPPLXGDJ.js} +1 -1
- package/dist/src/{chunk-X5MYHFWW.js → chunk-UYGRW6IC.js} +1 -1
- package/dist/src/command-protection-hook.js +4 -4
- package/dist/src/headless-agent.js +3 -3
- package/dist/src/index.js +32 -26
- package/dist/src/post-tool-pr-hook.js +2 -2
- package/dist/src/subagent-mcp.js +1 -1
- package/package.json +1 -1
|
@@ -5,12 +5,12 @@ import {
|
|
|
5
5
|
getCodexAspHost,
|
|
6
6
|
restartCodexAspHost,
|
|
7
7
|
restartCodexAspHostIfRunning
|
|
8
|
-
} from "./chunk-
|
|
9
|
-
import "./chunk-
|
|
10
|
-
import "./chunk-
|
|
11
|
-
import "./chunk-
|
|
8
|
+
} from "./chunk-MH7ZFBXK.js";
|
|
9
|
+
import "./chunk-B3O2TRKY.js";
|
|
10
|
+
import "./chunk-KY6CIXSR.js";
|
|
11
|
+
import "./chunk-UYGRW6IC.js";
|
|
12
12
|
import "./chunk-UZSNFLDQ.js";
|
|
13
|
-
import "./chunk-
|
|
13
|
+
import "./chunk-NY2TNHT2.js";
|
|
14
14
|
import "./chunk-VEQXQN22.js";
|
|
15
15
|
export {
|
|
16
16
|
getCodexAspHost,
|
|
@@ -3,18 +3,18 @@ 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-B3O2TRKY.js";
|
|
7
7
|
import {
|
|
8
8
|
SUBPROCESS_MAX_BUFFER,
|
|
9
9
|
execFileAsync
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-UYGRW6IC.js";
|
|
11
11
|
import {
|
|
12
12
|
extractCommandProtectionCommandText,
|
|
13
13
|
findCommandProtectionGitLookups,
|
|
14
14
|
findGitCommitSignals,
|
|
15
15
|
findPrMergeSignals,
|
|
16
16
|
parseCommandProtectionRequest
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-NY2TNHT2.js";
|
|
18
18
|
|
|
19
19
|
// src/services/command-protection-service.ts
|
|
20
20
|
import { readFile, stat } from "fs/promises";
|
|
@@ -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-UYGRW6IC.js";
|
|
7
7
|
import {
|
|
8
8
|
isVersionBelow
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-NY2TNHT2.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.980";
|
|
244
244
|
var INITIALIZE_METHOD = "initialize";
|
|
245
245
|
var INITIALIZED_NOTIFICATION = "initialized";
|
|
246
246
|
var ACCOUNT_LOGIN_START_METHOD = "account/login/start";
|
|
@@ -5,15 +5,15 @@ import {
|
|
|
5
5
|
ENGINE_ENV,
|
|
6
6
|
monolithRequest,
|
|
7
7
|
setAgentCredentialSnapshot
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-B3O2TRKY.js";
|
|
9
9
|
import {
|
|
10
10
|
AppServerProcess,
|
|
11
11
|
buildCodexAgentEnv
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-KY6CIXSR.js";
|
|
13
13
|
import {
|
|
14
14
|
SUBPROCESS_MAX_BUFFER,
|
|
15
15
|
execFileAsync
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-UYGRW6IC.js";
|
|
17
17
|
import {
|
|
18
18
|
isRecord
|
|
19
19
|
} from "./chunk-UZSNFLDQ.js";
|
|
@@ -27,7 +27,7 @@ import {
|
|
|
27
27
|
listOpenAICompatibleModels,
|
|
28
28
|
readOllamaAuthEnv,
|
|
29
29
|
resolveOpenAICompatibleModelsUrl
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-NY2TNHT2.js";
|
|
31
31
|
|
|
32
32
|
// src/managers/codex-token-manager.ts
|
|
33
33
|
import { promises as fs } from "fs";
|
|
@@ -260,7 +260,7 @@ var CodexTokenManager = class extends BaseRefreshManager {
|
|
|
260
260
|
await this.applyCredentialUpdate(++this.credentialGeneration, async () => {
|
|
261
261
|
await this.applyCredentialsResponse(data);
|
|
262
262
|
setAgentCredentialSnapshot("codex", data);
|
|
263
|
-
const { restartCodexAspHostIfRunning: restartCodexAspHostIfRunning2 } = await import("./asp-host-
|
|
263
|
+
const { restartCodexAspHostIfRunning: restartCodexAspHostIfRunning2 } = await import("./asp-host-B2JCJN3Z.js");
|
|
264
264
|
await restartCodexAspHostIfRunning2();
|
|
265
265
|
});
|
|
266
266
|
await this.start(true);
|
|
@@ -280,7 +280,7 @@ var CodexTokenManager = class extends BaseRefreshManager {
|
|
|
280
280
|
await this.applyCredentialUpdate(generation, async () => {
|
|
281
281
|
await this.applyCredentialsResponse(data);
|
|
282
282
|
if (restartOnChange && CODEX_AUTH_ENV_KEYS.some((key, index) => process.env[key] !== previousEnv[index])) {
|
|
283
|
-
const { restartCodexAspHostIfRunning: restartCodexAspHostIfRunning2 } = await import("./asp-host-
|
|
283
|
+
const { restartCodexAspHostIfRunning: restartCodexAspHostIfRunning2 } = await import("./asp-host-B2JCJN3Z.js");
|
|
284
284
|
await restartCodexAspHostIfRunning2();
|
|
285
285
|
}
|
|
286
286
|
setAgentCredentialSnapshot("codex", data);
|
|
@@ -823,6 +823,19 @@ var CREDENTIAL_TYPE = {
|
|
|
823
823
|
MUSE_OAUTH: "muse_oauth",
|
|
824
824
|
MUSE_API_KEY: "muse_api_key"
|
|
825
825
|
};
|
|
826
|
+
var ENVIRONMENT_AUTH_REQUIRED_KEYS = {
|
|
827
|
+
[AGENT.CLAUDE]: [
|
|
828
|
+
[CREDENTIAL_METHOD.BEDROCK, ["CLAUDE_CODE_USE_BEDROCK", "AWS_ACCESS_KEY_ID", "AWS_SECRET_ACCESS_KEY"]],
|
|
829
|
+
[CREDENTIAL_METHOD.API_KEY, ["ANTHROPIC_API_KEY"]]
|
|
830
|
+
],
|
|
831
|
+
[AGENT.CODEX]: [[CREDENTIAL_METHOD.API_KEY, ["OPENAI_API_KEY"]]]
|
|
832
|
+
};
|
|
833
|
+
function isEnvironmentKeySet(env, key) {
|
|
834
|
+
return !!env[key]?.trim();
|
|
835
|
+
}
|
|
836
|
+
function detectEnvironmentAuthMethod(agent, env) {
|
|
837
|
+
return ENVIRONMENT_AUTH_REQUIRED_KEYS[agent].find(([, keys]) => keys.every((key) => isEnvironmentKeySet(env, key)))?.[0];
|
|
838
|
+
}
|
|
826
839
|
var INFERENCE_PROVIDER_LABELS = {
|
|
827
840
|
[CREDENTIAL_METHOD.OLLAMA]: "Ollama",
|
|
828
841
|
[CREDENTIAL_METHOD.OPENCODE_GO]: "OpenCode Go",
|
|
@@ -2669,14 +2682,17 @@ var automationTriggerSchema = z9.discriminatedUnion("type", [
|
|
|
2669
2682
|
]);
|
|
2670
2683
|
|
|
2671
2684
|
// ../shared/src/replicas-mcp.ts
|
|
2672
|
-
var REPLICAS_MCP_SERVER_NAME = "replicas-mcp";
|
|
2673
2685
|
var REPLICAS_MCP_TOOLS = {
|
|
2674
2686
|
listEnvironments: "list_environments",
|
|
2675
2687
|
createAutomation: "create_automation",
|
|
2676
2688
|
spawn: "spawn_workspace",
|
|
2677
2689
|
relay: "relay_to_workspace",
|
|
2678
2690
|
linearStart: "start_linear_session",
|
|
2679
|
-
linearSessionIntent: "register_linear_session_intent"
|
|
2691
|
+
linearSessionIntent: "register_linear_session_intent",
|
|
2692
|
+
spawnSubagent: "spawn_subagent",
|
|
2693
|
+
messageSubagent: "message_subagent",
|
|
2694
|
+
listSubagents: "list_subagents",
|
|
2695
|
+
readSubagent: "read_subagent"
|
|
2680
2696
|
};
|
|
2681
2697
|
var automationToolInputSchema = z10.object({
|
|
2682
2698
|
name: z10.string().describe("Short automation name."),
|
|
@@ -4868,13 +4884,6 @@ function removeTag(text2, tag) {
|
|
|
4868
4884
|
function removeReplicasInstructions(text2) {
|
|
4869
4885
|
return removeTag(text2, REPLICAS_INSTRUCTIONS_TAG);
|
|
4870
4886
|
}
|
|
4871
|
-
var mothershipMcpActions = `These are tools of the \`${REPLICAS_MCP_SERVER_NAME}\` MCP server; their argument names match the envelope fields. Call them directly as tools, never through a shell or the Replicas CLI.
|
|
4872
|
-
- **Spawn** a dedicated workspace for the thread and hand off: \`${REPLICAS_MCP_TOOLS.spawn}\`, with \`environment_id\` when you chose one.
|
|
4873
|
-
- **Relay** a follow-up that is clearly meant for you into the workspace already bound to the thread (pass the envelope's \`user_id\` so it's attributed to its author): \`${REPLICAS_MCP_TOOLS.relay}\`, with \`queue: true\` to queue it.
|
|
4874
|
-
- **List environments**: \`${REPLICAS_MCP_TOOLS.listEnvironments}\`.
|
|
4875
|
-
- **Create an automation**: \`${REPLICAS_MCP_TOOLS.createAutomation}\`, filling its \`confirmation_*\` arguments from the accepting message's envelope.
|
|
4876
|
-
- **Register a Linear session intent**: \`${REPLICAS_MCP_TOOLS.linearSessionIntent}\` with \`comment_id\` and \`action\`.
|
|
4877
|
-
- **Start a Linear session**: \`${REPLICAS_MCP_TOOLS.linearStart}\` with \`issue_id\`, \`agent_session_id\`, and \`prompt\`.`;
|
|
4878
4887
|
|
|
4879
4888
|
// ../shared/src/user-message-attachments.ts
|
|
4880
4889
|
var ATTACHMENT_PLACEHOLDER_REGEX = /^\[\d+ (?:(?:images?|files?)(?: and \d+ files?)? attached|(?:image )?attachments?)\]$/;
|
|
@@ -6857,6 +6866,12 @@ function attachSendersToMessages(messages, senders) {
|
|
|
6857
6866
|
return next;
|
|
6858
6867
|
}
|
|
6859
6868
|
|
|
6869
|
+
// ../shared/src/display-message/final-response.ts
|
|
6870
|
+
function extractFinalResponse(history, provider) {
|
|
6871
|
+
const message = parseAgentEvents(history.events ?? [], provider).findLast((candidate) => candidate.type === "agent");
|
|
6872
|
+
return message?.type === "agent" && message.content ? message.content : null;
|
|
6873
|
+
}
|
|
6874
|
+
|
|
6860
6875
|
// ../shared/src/agent-event-utils.ts
|
|
6861
6876
|
function getUserMessage(event) {
|
|
6862
6877
|
return event.type === "event_msg" && event.payload.type === "user_message" && typeof event.payload.message === "string" ? event.payload.message : null;
|
|
@@ -7466,6 +7481,12 @@ var SLASH_COMMANDS = [
|
|
|
7466
7481
|
providers: [...VALID_AGENT_PROVIDERS]
|
|
7467
7482
|
}))
|
|
7468
7483
|
];
|
|
7484
|
+
var MULTITASK_SLASH_COMMAND = {
|
|
7485
|
+
command: "/multitask",
|
|
7486
|
+
description: "Hand work to parallel subagent workspaces that report back here.",
|
|
7487
|
+
argumentHint: "[prompt]",
|
|
7488
|
+
providers: [...VALID_AGENT_PROVIDERS]
|
|
7489
|
+
};
|
|
7469
7490
|
function mergeSlashCommands(...commandGroups) {
|
|
7470
7491
|
const seen = /* @__PURE__ */ new Set();
|
|
7471
7492
|
const commands = [];
|
|
@@ -8866,6 +8887,7 @@ function normalizeChatTranscriptMetadata(value) {
|
|
|
8866
8887
|
relayBaseProvider,
|
|
8867
8888
|
credential,
|
|
8868
8889
|
credentialSource,
|
|
8890
|
+
environmentAuthMethod,
|
|
8869
8891
|
model,
|
|
8870
8892
|
title,
|
|
8871
8893
|
displayName,
|
|
@@ -8886,6 +8908,8 @@ function normalizeChatTranscriptMetadata(value) {
|
|
|
8886
8908
|
const parsedCredential = agentCredentialSnapshotSchema.safeParse(credential);
|
|
8887
8909
|
if (parsedCredential.success) metadata.credential = parsedCredential.data;
|
|
8888
8910
|
if (credentialSource === "stored" || credentialSource === "environment") metadata.credentialSource = credentialSource;
|
|
8911
|
+
const authMethod = Object.values(CREDENTIAL_METHOD).find((method) => method === environmentAuthMethod);
|
|
8912
|
+
if (authMethod) metadata.environmentAuthMethod = authMethod;
|
|
8889
8913
|
if (typeof model === "string") metadata.model = model;
|
|
8890
8914
|
if (typeof title === "string") metadata.title = title;
|
|
8891
8915
|
if (typeof displayName === "string") metadata.displayName = displayName;
|
|
@@ -8975,6 +8999,7 @@ export {
|
|
|
8975
8999
|
getDefaultOllamaModel,
|
|
8976
9000
|
listOllamaModels,
|
|
8977
9001
|
CREDENTIAL_METHOD,
|
|
9002
|
+
detectEnvironmentAuthMethod,
|
|
8978
9003
|
AGENT_CREDENTIAL_METHODS_IN_ORDER,
|
|
8979
9004
|
describeCredential,
|
|
8980
9005
|
agentCredentialSnapshotSchema,
|
|
@@ -9094,6 +9119,7 @@ export {
|
|
|
9094
9119
|
isClaudeResultError,
|
|
9095
9120
|
parseAgentEvents,
|
|
9096
9121
|
parseDisplayMessages,
|
|
9122
|
+
extractFinalResponse,
|
|
9097
9123
|
getUserMessage,
|
|
9098
9124
|
getUserMessageId,
|
|
9099
9125
|
getRemovedMessageIds,
|
|
@@ -9172,6 +9198,7 @@ export {
|
|
|
9172
9198
|
formatChatForkHandoffMessage,
|
|
9173
9199
|
formatSideChatUpdateMessage,
|
|
9174
9200
|
readJsonlPage,
|
|
9201
|
+
normalizeChatTranscriptMetadata,
|
|
9175
9202
|
parseChatTranscriptArtifact,
|
|
9176
9203
|
readSseStream,
|
|
9177
9204
|
parseFrontmatter,
|
|
@@ -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-NY2TNHT2.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-46LSTB3K.js";
|
|
7
|
+
import "./chunk-B3O2TRKY.js";
|
|
8
|
+
import "./chunk-UYGRW6IC.js";
|
|
9
9
|
import {
|
|
10
10
|
isRecord
|
|
11
11
|
} from "./chunk-UZSNFLDQ.js";
|
|
12
|
-
import "./chunk-
|
|
12
|
+
import "./chunk-NY2TNHT2.js";
|
|
13
13
|
import "./chunk-VEQXQN22.js";
|
|
14
14
|
|
|
15
15
|
// src/command-protection-hook.ts
|
|
@@ -7,12 +7,12 @@ import {
|
|
|
7
7
|
import {
|
|
8
8
|
AppServerProcess,
|
|
9
9
|
buildCodexAgentEnv
|
|
10
|
-
} from "./chunk-
|
|
11
|
-
import "./chunk-
|
|
10
|
+
} from "./chunk-KY6CIXSR.js";
|
|
11
|
+
import "./chunk-UYGRW6IC.js";
|
|
12
12
|
import {
|
|
13
13
|
AGENT,
|
|
14
14
|
headlessAgentRequestSchema
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-NY2TNHT2.js";
|
|
16
16
|
import "./chunk-VEQXQN22.js";
|
|
17
17
|
|
|
18
18
|
// src/headless-agent.ts
|
package/dist/src/index.js
CHANGED
|
@@ -32,7 +32,7 @@ import {
|
|
|
32
32
|
reportCommandProtectionBlock,
|
|
33
33
|
resolveDiffBase,
|
|
34
34
|
runGitCommand
|
|
35
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-46LSTB3K.js";
|
|
36
36
|
import {
|
|
37
37
|
ACCOUNT_RATE_LIMITS_UPDATED_METHOD,
|
|
38
38
|
AGENT_MESSAGE_DELTA_METHOD,
|
|
@@ -57,7 +57,7 @@ import {
|
|
|
57
57
|
} from "./chunk-P73LGPQO.js";
|
|
58
58
|
import {
|
|
59
59
|
publishedPullRequestUrls
|
|
60
|
-
} from "./chunk-
|
|
60
|
+
} from "./chunk-OPPLXGDJ.js";
|
|
61
61
|
import {
|
|
62
62
|
BaseRefreshManager,
|
|
63
63
|
CodexAspAuthMethodChangedError,
|
|
@@ -72,7 +72,7 @@ import {
|
|
|
72
72
|
refreshDelayMs,
|
|
73
73
|
restartCodexAspHost,
|
|
74
74
|
routineRefreshExclusions
|
|
75
|
-
} from "./chunk-
|
|
75
|
+
} from "./chunk-MH7ZFBXK.js";
|
|
76
76
|
import {
|
|
77
77
|
ENGINE_ENV,
|
|
78
78
|
monolithRequest,
|
|
@@ -80,16 +80,16 @@ import {
|
|
|
80
80
|
readRuntimeEnvFile,
|
|
81
81
|
reloadEngineEnv,
|
|
82
82
|
setAgentCredentialSnapshot
|
|
83
|
-
} from "./chunk-
|
|
83
|
+
} from "./chunk-B3O2TRKY.js";
|
|
84
84
|
import {
|
|
85
85
|
AspClient,
|
|
86
86
|
getCodexModelProvider
|
|
87
|
-
} from "./chunk-
|
|
87
|
+
} from "./chunk-KY6CIXSR.js";
|
|
88
88
|
import {
|
|
89
89
|
SUBPROCESS_MAX_BUFFER,
|
|
90
90
|
execAsync,
|
|
91
91
|
execFileAsync
|
|
92
|
-
} from "./chunk-
|
|
92
|
+
} from "./chunk-UYGRW6IC.js";
|
|
93
93
|
import {
|
|
94
94
|
isRecord as isRecord2
|
|
95
95
|
} from "./chunk-UZSNFLDQ.js";
|
|
@@ -215,9 +215,11 @@ import {
|
|
|
215
215
|
describeCredential,
|
|
216
216
|
describeQuotaLimit,
|
|
217
217
|
detectAgentQuotaLimit,
|
|
218
|
+
detectEnvironmentAuthMethod,
|
|
218
219
|
detectLanguageByPath,
|
|
219
220
|
excludeQueuedAcceptedEvents,
|
|
220
221
|
extractErrorText,
|
|
222
|
+
extractFinalResponse,
|
|
221
223
|
extractLatestContextUsage,
|
|
222
224
|
extractToolResultText,
|
|
223
225
|
fetchOpenCodeGoCatalog,
|
|
@@ -271,6 +273,7 @@ import {
|
|
|
271
273
|
mergeSlashCommands,
|
|
272
274
|
messageSubagentRequestSchema,
|
|
273
275
|
normalizeAutoCompactThreshold,
|
|
276
|
+
normalizeChatTranscriptMetadata,
|
|
274
277
|
normalizeClaudeModel,
|
|
275
278
|
normalizeCodexAspTranscriptStatus,
|
|
276
279
|
normalizeContentBlocks,
|
|
@@ -310,7 +313,7 @@ import {
|
|
|
310
313
|
workspaceCredentialProviderSchema,
|
|
311
314
|
workspaceTokenRequestSchema,
|
|
312
315
|
workspaceTokenResponseSchema
|
|
313
|
-
} from "./chunk-
|
|
316
|
+
} from "./chunk-NY2TNHT2.js";
|
|
314
317
|
import {
|
|
315
318
|
cloneMcpConfig,
|
|
316
319
|
ensureCompatibilityImports,
|
|
@@ -10004,7 +10007,7 @@ var MUSE_AUTH_PATH = join5(homedir3(), ".config", "muse", "auth.json");
|
|
|
10004
10007
|
|
|
10005
10008
|
// src/managers/codex-auth.ts
|
|
10006
10009
|
function detectCodexAuthMethod() {
|
|
10007
|
-
return ENGINE_ENV.REPLICAS_CODEX_AUTH_METHOD ?? (
|
|
10010
|
+
return ENGINE_ENV.REPLICAS_CODEX_AUTH_METHOD ?? detectEnvironmentAuthMethod(AGENT.CODEX, process.env) ?? "none";
|
|
10008
10011
|
}
|
|
10009
10012
|
|
|
10010
10013
|
// src/managers/agent-auth-detection.ts
|
|
@@ -10017,13 +10020,7 @@ function detectClaudeAuthMethod() {
|
|
|
10017
10020
|
if (ENGINE_ENV.REPLICAS_CLAUDE_AUTH_METHOD === "foundry") {
|
|
10018
10021
|
return "foundry";
|
|
10019
10022
|
}
|
|
10020
|
-
|
|
10021
|
-
return "bedrock";
|
|
10022
|
-
}
|
|
10023
|
-
if (ENGINE_ENV.ANTHROPIC_API_KEY) {
|
|
10024
|
-
return "api_key";
|
|
10025
|
-
}
|
|
10026
|
-
return "none";
|
|
10023
|
+
return detectEnvironmentAuthMethod(AGENT.CLAUDE, process.env) ?? "none";
|
|
10027
10024
|
}
|
|
10028
10025
|
function detectAgentAuthMethod(provider) {
|
|
10029
10026
|
if (OLLAMA_AGENTS.some((agent) => agent === provider && readOllamaAuthEnv(agent, process.env))) return "ollama";
|
|
@@ -58910,12 +58907,6 @@ var PiManager = class extends CodingAgentManager {
|
|
|
58910
58907
|
}
|
|
58911
58908
|
};
|
|
58912
58909
|
|
|
58913
|
-
// src/managers/subagent-tools.ts
|
|
58914
|
-
function extractFinalResponse(history, provider) {
|
|
58915
|
-
const message = parseAgentEvents(history.events ?? [], provider).findLast((candidate) => candidate.type === "agent");
|
|
58916
|
-
return message?.type === "agent" && message.content ? message.content : null;
|
|
58917
|
-
}
|
|
58918
|
-
|
|
58919
58910
|
// src/analytics/agent/activity/agent-chat-activity-tracker-service.ts
|
|
58920
58911
|
import { randomUUID as randomUUID10 } from "crypto";
|
|
58921
58912
|
|
|
@@ -60211,6 +60202,17 @@ var ALWAYS_UPLOAD_HISTORY_DIRS = /* @__PURE__ */ new Set([
|
|
|
60211
60202
|
HISTORY_DIR_BY_PROVIDER.claude,
|
|
60212
60203
|
HISTORY_DIR_BY_PROVIDER.codex
|
|
60213
60204
|
]);
|
|
60205
|
+
function currentTranscriptAuth(provider) {
|
|
60206
|
+
const credential = ENGINE_ENV.REPLICAS_AGENT_CREDENTIALS[provider];
|
|
60207
|
+
if (credential) return { credential, credentialSource: "stored" };
|
|
60208
|
+
const method = detectAgentAuthMethod(provider);
|
|
60209
|
+
return method === "none" ? {} : { credentialSource: "environment", environmentAuthMethod: method };
|
|
60210
|
+
}
|
|
60211
|
+
function normalizeTranscriptAuth(value) {
|
|
60212
|
+
if (!isRecord(value)) return void 0;
|
|
60213
|
+
const { credential, credentialSource, environmentAuthMethod } = normalizeChatTranscriptMetadata(value);
|
|
60214
|
+
return { credential, credentialSource, environmentAuthMethod };
|
|
60215
|
+
}
|
|
60214
60216
|
function shouldFlushChatTranscript(historyDir, chat, chatsById) {
|
|
60215
60217
|
return ALWAYS_UPLOAD_HISTORY_DIRS.has(historyDir) || Boolean(chat?.parentChatId && chatsById.has(chat.parentChatId));
|
|
60216
60218
|
}
|
|
@@ -60259,12 +60261,10 @@ function uploadChatTranscript(chatId, filePath, chat, capture) {
|
|
|
60259
60261
|
async function uploadChatTranscriptNow(chatId, filePath, chat, capture) {
|
|
60260
60262
|
const { size } = await stat5(filePath);
|
|
60261
60263
|
if (size === 0) return null;
|
|
60262
|
-
const credential = chat && ENGINE_ENV.REPLICAS_AGENT_CREDENTIALS[chat.provider];
|
|
60263
60264
|
const metadata = chat ? {
|
|
60264
60265
|
provider: chat.provider,
|
|
60265
|
-
|
|
60266
|
-
|
|
60267
|
-
credentialSource: credential ? "stored" : detectAgentAuthMethod(chat.provider) === "none" ? void 0 : "environment",
|
|
60266
|
+
// Chats with no turn since this engine version fall back to the auth live at upload.
|
|
60267
|
+
...chat.transcriptAuth ?? currentTranscriptAuth(chat.provider),
|
|
60268
60268
|
model: chat.model,
|
|
60269
60269
|
title: chat.title,
|
|
60270
60270
|
displayName: chat.displayName,
|
|
@@ -60627,6 +60627,7 @@ function normalizePersistedChat(chat) {
|
|
|
60627
60627
|
fork: coerceChatForkInfo(chat.fork),
|
|
60628
60628
|
pendingForkHandoff: chat.pendingForkHandoff === true,
|
|
60629
60629
|
...chat.chatCredential === "workspace" || agentCredentialSnapshotSchema.safeParse(chat.chatCredential).success ? { chatCredential: chat.chatCredential } : {},
|
|
60630
|
+
transcriptAuth: normalizeTranscriptAuth(chat.transcriptAuth),
|
|
60630
60631
|
removedMessageIds: Array.isArray(chat.removedMessageIds) ? chat.removedMessageIds.filter((id) => typeof id === "string").slice(-MAX_REMOVED_MESSAGE_IDS) : [],
|
|
60631
60632
|
acceptedSendResponses: isRecord2(chat.acceptedSendResponses) ? Object.fromEntries(Object.entries(chat.acceptedSendResponses).filter((entry) => {
|
|
60632
60633
|
const response = entry[1];
|
|
@@ -61471,7 +61472,7 @@ var ChatService = class {
|
|
|
61471
61472
|
return count;
|
|
61472
61473
|
}
|
|
61473
61474
|
toTranscriptSource(chat) {
|
|
61474
|
-
return { ...this.toSummary(chat), removedMessageIds: chat.persisted.removedMessageIds };
|
|
61475
|
+
return { ...this.toSummary(chat), removedMessageIds: chat.persisted.removedMessageIds, transcriptAuth: chat.persisted.transcriptAuth };
|
|
61475
61476
|
}
|
|
61476
61477
|
uploadChatTranscript(chat) {
|
|
61477
61478
|
const chatId = chat.persisted.id;
|
|
@@ -61703,6 +61704,11 @@ var ChatService = class {
|
|
|
61703
61704
|
);
|
|
61704
61705
|
chat.acceptedUserEvents.set(message.id, acceptedEvent);
|
|
61705
61706
|
this.activateTurn(chat, message.id);
|
|
61707
|
+
const transcriptAuth = currentTranscriptAuth(chat.persisted.provider);
|
|
61708
|
+
if (JSON.stringify(chat.persisted.transcriptAuth) !== JSON.stringify(transcriptAuth)) {
|
|
61709
|
+
chat.persisted.transcriptAuth = transcriptAuth;
|
|
61710
|
+
await this.persistAllChats();
|
|
61711
|
+
}
|
|
61706
61712
|
await this.publish({
|
|
61707
61713
|
type: "chat.turn.started",
|
|
61708
61714
|
payload: {
|
|
@@ -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-OPPLXGDJ.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-NY2TNHT2.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