replicas-engine 0.1.221 → 0.1.222
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/index.js +60 -51
- package/package.json +1 -1
package/dist/src/index.js
CHANGED
|
@@ -710,8 +710,8 @@ gh pr review 123 --request-changes --body "Changes needed"
|
|
|
710
710
|
GitHub does NOT have a public API for uploading images to PRs/issues. When you need to include images:
|
|
711
711
|
- Do NOT use placeholder image URLs
|
|
712
712
|
- Do NOT commit screenshots as files to the repository
|
|
713
|
-
-
|
|
714
|
-
- If you were triggered from Slack, also upload the
|
|
713
|
+
- Use the \`replicas-agent\` skill to share the image
|
|
714
|
+
- If you were triggered from Slack, also upload the image to the Slack thread so the user can see it directly
|
|
715
715
|
`;
|
|
716
716
|
var GITHUB_ABILITY = {
|
|
717
717
|
label: "GitHub",
|
|
@@ -1159,10 +1159,9 @@ After (or alongside) the embeds, include a \`[View in Replicas](<deep-link>)\` h
|
|
|
1159
1159
|
|
|
1160
1160
|
### On external platforms (Slack, Linear, GitHub, etc.)
|
|
1161
1161
|
|
|
1162
|
-
|
|
1162
|
+
Always include a \`[View in Replicas](<deep-link>)\` hyperlink \u2014 use the per-file deep link the CLI printed for that file (\`...?mode=media&media=<media-id>\`), so the recipient lands directly on that specific item.
|
|
1163
1163
|
|
|
1164
|
-
|
|
1165
|
-
2. Include a \`[View in Replicas](<deep-link>)\` hyperlink \u2014 use the per-file deep link the CLI printed for that file (\`...?mode=media&media=<media-id>\`), so the recipient lands directly on that specific item.
|
|
1164
|
+
For platforms that support native uploads (Slack \`files.upload\`, Linear attachments, etc.), upload the raw bytes there too so the recipient sees the media inline in addition to the Replicas link. GitHub PRs/issues do not have a public upload API, so the \`View in Replicas\` link is the canonical way to share media there \u2014 do not commit screenshots to the repo and do not use placeholder URLs.
|
|
1166
1165
|
|
|
1167
1166
|
Do **not** include the \`\` markdown embed in external messages. It will render as a broken image / 401 for the recipient.
|
|
1168
1167
|
|
|
@@ -1208,7 +1207,7 @@ replicas media upload chart-a.svg chart-b.svg --kind image
|
|
|
1208
1207
|
var MEDIA_ABILITY = {
|
|
1209
1208
|
label: "Media",
|
|
1210
1209
|
description: "Share screenshots, recordings, generated images, and audio clips.",
|
|
1211
|
-
bullet: "-
|
|
1210
|
+
bullet: "- Producing or showing the user any media \u2014 screenshots, screen recordings, generated images or diagrams, audio clips \u2014 including in your Replicas chat reply, PR descriptions/comments, and other external platforms",
|
|
1212
1211
|
section: SECTION6,
|
|
1213
1212
|
referenceFile: { name: "MEDIA.md", content: REFERENCE6 }
|
|
1214
1213
|
};
|
|
@@ -1764,7 +1763,7 @@ function parseReplicasConfigString(content, filename) {
|
|
|
1764
1763
|
}
|
|
1765
1764
|
|
|
1766
1765
|
// ../shared/src/engine/environment.ts
|
|
1767
|
-
var DAYTONA_SNAPSHOT_ID = "27-05-2026-royal-york-
|
|
1766
|
+
var DAYTONA_SNAPSHOT_ID = "27-05-2026-royal-york-v6";
|
|
1768
1767
|
|
|
1769
1768
|
// ../shared/src/engine/types.ts
|
|
1770
1769
|
var DEFAULT_CHAT_TITLES = {
|
|
@@ -1817,6 +1816,12 @@ function codexAuthEnvFromResponse(response) {
|
|
|
1817
1816
|
return { OPENAI_API_KEY: response.apiKey, REPLICAS_CODEX_AUTH_METHOD: "api_key" };
|
|
1818
1817
|
}
|
|
1819
1818
|
}
|
|
1819
|
+
var CODEX_AUTH_ENV_KEYS_BY_METHOD = {
|
|
1820
|
+
none: [],
|
|
1821
|
+
oauth: ["REPLICAS_CODEX_AUTH_METHOD"],
|
|
1822
|
+
api_key: ["OPENAI_API_KEY", "REPLICAS_CODEX_AUTH_METHOD"],
|
|
1823
|
+
bedrock: []
|
|
1824
|
+
};
|
|
1820
1825
|
|
|
1821
1826
|
// ../shared/src/routes/claude.ts
|
|
1822
1827
|
var CLAUDE_AUTH_ENV_KEYS = [
|
|
@@ -1843,6 +1848,18 @@ function claudeAuthEnvFromResponse(response) {
|
|
|
1843
1848
|
};
|
|
1844
1849
|
}
|
|
1845
1850
|
}
|
|
1851
|
+
var CLAUDE_AUTH_ENV_KEYS_BY_METHOD = {
|
|
1852
|
+
none: [],
|
|
1853
|
+
oauth: ["REPLICAS_CLAUDE_AUTH_METHOD"],
|
|
1854
|
+
api_key: ["ANTHROPIC_API_KEY", "REPLICAS_CLAUDE_AUTH_METHOD"],
|
|
1855
|
+
bedrock: [
|
|
1856
|
+
"CLAUDE_CODE_USE_BEDROCK",
|
|
1857
|
+
"AWS_ACCESS_KEY_ID",
|
|
1858
|
+
"AWS_SECRET_ACCESS_KEY",
|
|
1859
|
+
"AWS_REGION",
|
|
1860
|
+
"REPLICAS_CLAUDE_AUTH_METHOD"
|
|
1861
|
+
]
|
|
1862
|
+
};
|
|
1846
1863
|
|
|
1847
1864
|
// ../shared/src/routes/workspaces.ts
|
|
1848
1865
|
var WORKSPACE_FILE_UPLOAD_MAX_SIZE_BYTES = 20 * 1024 * 1024;
|
|
@@ -2155,6 +2172,26 @@ var githubTokenManager = new GitHubTokenManager();
|
|
|
2155
2172
|
// src/managers/claude-token-manager.ts
|
|
2156
2173
|
import { promises as fs2 } from "fs";
|
|
2157
2174
|
import path2 from "path";
|
|
2175
|
+
|
|
2176
|
+
// src/managers/auth-env-transition.ts
|
|
2177
|
+
function applyAuthEnvTransition(params) {
|
|
2178
|
+
const newOwned = new Set(params.authKeysByMethod[params.newMethod]);
|
|
2179
|
+
const prevOwned = new Set(params.authKeysByMethod[params.prevMethod]);
|
|
2180
|
+
for (const key of params.authKeys) {
|
|
2181
|
+
const value = params.newEnvVars[key];
|
|
2182
|
+
if (value !== void 0) {
|
|
2183
|
+
for (const env of params.envs) {
|
|
2184
|
+
env[key] = value;
|
|
2185
|
+
}
|
|
2186
|
+
} else if (prevOwned.has(key) && !newOwned.has(key)) {
|
|
2187
|
+
for (const env of params.envs) {
|
|
2188
|
+
delete env[key];
|
|
2189
|
+
}
|
|
2190
|
+
}
|
|
2191
|
+
}
|
|
2192
|
+
}
|
|
2193
|
+
|
|
2194
|
+
// src/managers/claude-token-manager.ts
|
|
2158
2195
|
var ClaudeTokenManager = class extends BaseRefreshManager {
|
|
2159
2196
|
constructor() {
|
|
2160
2197
|
super("ClaudeTokenManager");
|
|
@@ -2222,34 +2259,14 @@ var ClaudeTokenManager = class extends BaseRefreshManager {
|
|
|
2222
2259
|
await this.removeOauthCredentialsFile();
|
|
2223
2260
|
}
|
|
2224
2261
|
const envVars = claudeAuthEnvFromResponse(response);
|
|
2225
|
-
|
|
2226
|
-
|
|
2227
|
-
|
|
2228
|
-
|
|
2229
|
-
|
|
2230
|
-
|
|
2231
|
-
|
|
2232
|
-
|
|
2233
|
-
case "CLAUDE_CODE_USE_BEDROCK":
|
|
2234
|
-
ENGINE_ENV.CLAUDE_CODE_USE_BEDROCK = envVars.CLAUDE_CODE_USE_BEDROCK;
|
|
2235
|
-
break;
|
|
2236
|
-
case "AWS_ACCESS_KEY_ID":
|
|
2237
|
-
ENGINE_ENV.AWS_ACCESS_KEY_ID = envVars.AWS_ACCESS_KEY_ID;
|
|
2238
|
-
break;
|
|
2239
|
-
case "AWS_SECRET_ACCESS_KEY":
|
|
2240
|
-
ENGINE_ENV.AWS_SECRET_ACCESS_KEY = envVars.AWS_SECRET_ACCESS_KEY;
|
|
2241
|
-
break;
|
|
2242
|
-
case "AWS_REGION":
|
|
2243
|
-
ENGINE_ENV.AWS_REGION = envVars.AWS_REGION;
|
|
2244
|
-
break;
|
|
2245
|
-
}
|
|
2246
|
-
const value = envVars[key];
|
|
2247
|
-
if (value !== void 0) {
|
|
2248
|
-
process.env[key] = value;
|
|
2249
|
-
} else {
|
|
2250
|
-
delete process.env[key];
|
|
2251
|
-
}
|
|
2252
|
-
}
|
|
2262
|
+
applyAuthEnvTransition({
|
|
2263
|
+
prevMethod: ENGINE_ENV.REPLICAS_CLAUDE_AUTH_METHOD ?? "none",
|
|
2264
|
+
newMethod: envVars.REPLICAS_CLAUDE_AUTH_METHOD ?? "none",
|
|
2265
|
+
authKeys: CLAUDE_AUTH_ENV_KEYS,
|
|
2266
|
+
authKeysByMethod: CLAUDE_AUTH_ENV_KEYS_BY_METHOD,
|
|
2267
|
+
newEnvVars: envVars,
|
|
2268
|
+
envs: [ENGINE_ENV, process.env]
|
|
2269
|
+
});
|
|
2253
2270
|
}
|
|
2254
2271
|
async writeOauthCredentialsFile(credentials) {
|
|
2255
2272
|
const workspaceHome = ENGINE_ENV.HOME_DIR;
|
|
@@ -2348,22 +2365,14 @@ var CodexTokenManager = class extends BaseRefreshManager {
|
|
|
2348
2365
|
await this.removeOauthCredentialsFile();
|
|
2349
2366
|
}
|
|
2350
2367
|
const envVars = codexAuthEnvFromResponse(response);
|
|
2351
|
-
|
|
2352
|
-
|
|
2353
|
-
|
|
2354
|
-
|
|
2355
|
-
|
|
2356
|
-
|
|
2357
|
-
|
|
2358
|
-
|
|
2359
|
-
}
|
|
2360
|
-
const value = envVars[key];
|
|
2361
|
-
if (value !== void 0) {
|
|
2362
|
-
process.env[key] = value;
|
|
2363
|
-
} else {
|
|
2364
|
-
delete process.env[key];
|
|
2365
|
-
}
|
|
2366
|
-
}
|
|
2368
|
+
applyAuthEnvTransition({
|
|
2369
|
+
prevMethod: ENGINE_ENV.REPLICAS_CODEX_AUTH_METHOD ?? "none",
|
|
2370
|
+
newMethod: envVars.REPLICAS_CODEX_AUTH_METHOD ?? "none",
|
|
2371
|
+
authKeys: CODEX_AUTH_ENV_KEYS,
|
|
2372
|
+
authKeysByMethod: CODEX_AUTH_ENV_KEYS_BY_METHOD,
|
|
2373
|
+
newEnvVars: envVars,
|
|
2374
|
+
envs: [ENGINE_ENV, process.env]
|
|
2375
|
+
});
|
|
2367
2376
|
}
|
|
2368
2377
|
async writeOauthCredentialsFile(credentials) {
|
|
2369
2378
|
const workspaceHome = ENGINE_ENV.HOME_DIR;
|