replicas-engine 0.1.803 → 0.1.804

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.
@@ -5,11 +5,11 @@ import {
5
5
  getCodexAspHost,
6
6
  restartCodexAspHost,
7
7
  restartCodexAspHostIfRunning
8
- } from "./chunk-W6XLA2JR.js";
9
- import "./chunk-QBLEGBFV.js";
10
- import "./chunk-2LUYBPAX.js";
8
+ } from "./chunk-NFHLOVTM.js";
9
+ import "./chunk-HVVAIQOZ.js";
10
+ import "./chunk-7ZLO77GJ.js";
11
11
  import "./chunk-UZSNFLDQ.js";
12
- import "./chunk-QU3TVTVW.js";
12
+ import "./chunk-6MFMPKRG.js";
13
13
  import "./chunk-VEQXQN22.js";
14
14
  export {
15
15
  getCodexAspHost,
@@ -108,6 +108,76 @@ var ASTER_MODEL_LABELS = {
108
108
  "gpt-oss-120b": "GPT-OSS 120B"
109
109
  };
110
110
 
111
+ // ../shared/src/models-dev.ts
112
+ import { z } from "zod";
113
+ var MODELS_DEV_API_URL = "https://models.dev/api.json";
114
+ var MODELS_DEV_CACHE_MS = 5 * 6e4;
115
+ var modelsDevCatalogSchema = z.record(z.string(), z.object({
116
+ models: z.record(z.string(), z.object({
117
+ id: z.string().optional(),
118
+ name: z.string(),
119
+ description: z.string().optional(),
120
+ status: z.enum(["alpha", "beta", "deprecated"]).optional(),
121
+ provider: z.object({ npm: z.string().optional() }).optional(),
122
+ cost: z.object({
123
+ input: z.number().finite().nonnegative().optional(),
124
+ output: z.number().finite().nonnegative().optional(),
125
+ cache_read: z.number().finite().nonnegative().optional(),
126
+ cache_write: z.number().finite().nonnegative().optional()
127
+ }).optional()
128
+ }))
129
+ }));
130
+ var catalogCache;
131
+ var catalogRequest;
132
+ async function fetchModelsDevCatalog() {
133
+ if (catalogCache && catalogCache.expiresAt > Date.now()) return catalogCache.catalog;
134
+ catalogRequest ??= (async () => {
135
+ const response = await fetch(MODELS_DEV_API_URL, { signal: AbortSignal.timeout(5e3) });
136
+ if (!response.ok) throw new Error(`Failed to load models.dev catalog (${response.status})`);
137
+ return modelsDevCatalogSchema.parse(await response.json());
138
+ })();
139
+ try {
140
+ const catalog = await catalogRequest;
141
+ catalogCache = { catalog, expiresAt: Date.now() + MODELS_DEV_CACHE_MS };
142
+ return catalog;
143
+ } catch (error) {
144
+ if (catalogCache) return catalogCache.catalog;
145
+ throw error;
146
+ } finally {
147
+ catalogRequest = void 0;
148
+ }
149
+ }
150
+
151
+ // ../shared/src/credentials/opencode-go.ts
152
+ var OPENCODE_GO_PROVIDER = "opencode-go";
153
+ var OPENCODE_GO_BASE_URL = "https://opencode.ai/zen/go/v1";
154
+ var DEFAULT_OPENCODE_GO_MODEL = "glm-5.3";
155
+ async function fetchOpenCodeGoCatalog(fallbackModelIds = [DEFAULT_OPENCODE_GO_MODEL]) {
156
+ try {
157
+ const provider = (await fetchModelsDevCatalog())[OPENCODE_GO_PROVIDER];
158
+ if (!provider) throw new Error("OpenCode Go model catalog is unavailable");
159
+ const models = Object.fromEntries(
160
+ Object.entries(provider.models).filter(([, definition]) => definition.status !== "deprecated" && definition.status !== "alpha").map(([id, definition]) => [id, {
161
+ id: definition.id ?? id,
162
+ name: definition.name,
163
+ api: definition.provider?.npm === "@ai-sdk/anthropic" ? "anthropic-messages" : definition.provider?.npm === "@ai-sdk/openai" ? "openai-responses" : void 0,
164
+ ...definition.description ? { description: definition.description } : {},
165
+ ...definition.status ? { status: definition.status } : {}
166
+ }])
167
+ );
168
+ if (Object.keys(models).length === 0) throw new Error("OpenCode Go model catalog is unavailable");
169
+ return { models, authoritative: true };
170
+ } catch {
171
+ return {
172
+ authoritative: false,
173
+ models: Object.fromEntries(fallbackModelIds.map((id) => [id, {
174
+ id,
175
+ name: id === DEFAULT_OPENCODE_GO_MODEL ? "GLM 5.3" : id
176
+ }]))
177
+ };
178
+ }
179
+ }
180
+
111
181
  // ../shared/src/type-guards.ts
112
182
  function isRecord(value) {
113
183
  return typeof value === "object" && value !== null && !Array.isArray(value);
@@ -462,7 +532,7 @@ function paginateEngineLogContent(input) {
462
532
  }
463
533
 
464
534
  // ../shared/src/analytics/types.ts
465
- import { z } from "zod";
535
+ import { z as z2 } from "zod";
466
536
 
467
537
  // ../shared/src/credentials/types.ts
468
538
  var CREDENTIAL_SCOPE = {
@@ -595,10 +665,10 @@ function hasAgentChatActivityFields(value) {
595
665
  function isAgentChatActivityRecord(value) {
596
666
  return hasAgentChatActivityFields(value) && typeof value.provider === "string" && isValidAgentProvider(value.provider);
597
667
  }
598
- var agentCredentialSnapshotSchema = z.object({
599
- method: z.enum(CREDENTIAL_METHOD),
600
- scope: z.enum(CREDENTIAL_SCOPE),
601
- revision: z.string().optional()
668
+ var agentCredentialSnapshotSchema = z2.object({
669
+ method: z2.enum(CREDENTIAL_METHOD),
670
+ scope: z2.enum(CREDENTIAL_SCOPE),
671
+ revision: z2.string().optional()
602
672
  });
603
673
  function isAuthMethod(value) {
604
674
  return typeof value === "string" && Object.values(CREDENTIAL_METHOD).some((method) => method === value);
@@ -725,7 +795,7 @@ function coerceChatGoalPayload(payload) {
725
795
  var CONTEXT_USAGE_EVENT_TYPE = "context-usage";
726
796
 
727
797
  // ../shared/src/engine/v1.ts
728
- import { z as z2 } from "zod";
798
+ import { z as z3 } from "zod";
729
799
  var MERGED_MESSAGE_SEPARATOR = "\n\n<!-- replicas:merged -->\n\n";
730
800
  var ENGINE_HEALTH_WAIT_HEADER = "X-Replicas-Health-Wait";
731
801
  var ENGINE_HEALTH_WAIT_QUERY_PARAM = "wait_ms";
@@ -733,70 +803,70 @@ var ENGINE_HEALTH_MAX_WAIT_MS = 2e3;
733
803
  function getChatExecutionProvider(chat) {
734
804
  return chat.provider === "relay" ? chat.relayBaseProvider ?? DEFAULT_RELAY_BASE_PROVIDER : chat.provider;
735
805
  }
736
- var createChatRequestSchema = z2.object({
737
- id: z2.string().uuid().optional(),
738
- createdAt: z2.string().datetime().optional(),
739
- provider: z2.enum(VALID_AGENT_PROVIDERS),
740
- relayBaseProvider: z2.enum(VALID_CODING_AGENT_PROVIDERS).optional(),
741
- title: z2.string().min(1).optional(),
742
- parentChatId: z2.string().uuid().optional(),
743
- clientRequestId: z2.string().min(1).max(128).optional()
806
+ var createChatRequestSchema = z3.object({
807
+ id: z3.string().uuid().optional(),
808
+ createdAt: z3.string().datetime().optional(),
809
+ provider: z3.enum(VALID_AGENT_PROVIDERS),
810
+ relayBaseProvider: z3.enum(VALID_CODING_AGENT_PROVIDERS).optional(),
811
+ title: z3.string().min(1).optional(),
812
+ parentChatId: z3.string().uuid().optional(),
813
+ clientRequestId: z3.string().min(1).max(128).optional()
744
814
  }).refine((request) => request.provider === "relay" || request.relayBaseProvider === void 0, {
745
815
  message: "relayBaseProvider is only valid for Relay chats"
746
816
  });
747
- var spawnRelaySubagentRequestSchema = z2.object({
748
- provider: z2.enum(VALID_AGENT_PROVIDERS),
749
- prompt: z2.string().min(1),
750
- model: z2.string().min(1).optional(),
751
- thinkingLevel: z2.enum(VALID_THINKING_LEVELS).optional(),
752
- title: z2.string().min(1).optional(),
753
- timeoutMinutes: z2.number().positive().max(1440).optional()
817
+ var spawnRelaySubagentRequestSchema = z3.object({
818
+ provider: z3.enum(VALID_AGENT_PROVIDERS),
819
+ prompt: z3.string().min(1),
820
+ model: z3.string().min(1).optional(),
821
+ thinkingLevel: z3.enum(VALID_THINKING_LEVELS).optional(),
822
+ title: z3.string().min(1).optional(),
823
+ timeoutMinutes: z3.number().positive().max(1440).optional()
754
824
  });
755
- var messageRelaySubagentRequestSchema = z2.object({
756
- message: z2.string().min(1),
757
- model: z2.string().min(1).optional(),
758
- thinkingLevel: z2.enum(VALID_THINKING_LEVELS).optional(),
759
- timeoutMinutes: z2.number().positive().max(1440).optional()
825
+ var messageRelaySubagentRequestSchema = z3.object({
826
+ message: z3.string().min(1),
827
+ model: z3.string().min(1).optional(),
828
+ thinkingLevel: z3.enum(VALID_THINKING_LEVELS).optional(),
829
+ timeoutMinutes: z3.number().positive().max(1440).optional()
760
830
  });
761
- var sendChatMessageRequestSchema = z2.object({
762
- messageId: z2.string().min(1).optional(),
763
- submittedAt: z2.string().datetime().optional(),
764
- message: z2.string().min(1),
765
- model: z2.string().optional(),
766
- customInstructions: z2.string().optional(),
767
- planMode: z2.boolean().optional(),
768
- images: z2.array(z2.object({
769
- type: z2.literal("image"),
770
- source: z2.discriminatedUnion("type", [
771
- z2.object({ type: z2.literal("base64"), media_type: z2.enum(IMAGE_MEDIA_TYPES), data: z2.string().min(1) }),
772
- z2.object({ type: z2.literal("url"), url: z2.string().url() })
831
+ var sendChatMessageRequestSchema = z3.object({
832
+ messageId: z3.string().min(1).optional(),
833
+ submittedAt: z3.string().datetime().optional(),
834
+ message: z3.string().min(1),
835
+ model: z3.string().optional(),
836
+ customInstructions: z3.string().optional(),
837
+ planMode: z3.boolean().optional(),
838
+ images: z3.array(z3.object({
839
+ type: z3.literal("image"),
840
+ source: z3.discriminatedUnion("type", [
841
+ z3.object({ type: z3.literal("base64"), media_type: z3.enum(IMAGE_MEDIA_TYPES), data: z3.string().min(1) }),
842
+ z3.object({ type: z3.literal("url"), url: z3.string().url() })
773
843
  ])
774
844
  })).optional(),
775
- canvasUploadIds: z2.array(z2.string().min(1)).optional(),
776
- thinkingLevel: z2.enum(VALID_THINKING_LEVELS).optional(),
777
- goalMode: z2.boolean().optional(),
778
- fastMode: z2.boolean().optional(),
779
- enableInteractiveTools: z2.boolean().optional(),
780
- type: z2.string().min(1).optional(),
781
- merge: z2.boolean().optional(),
782
- idempotencyKey: z2.string().min(1).max(128).optional(),
783
- automationId: z2.string().optional(),
784
- environmentId: z2.string().min(1).optional(),
785
- senderUserId: z2.string().optional(),
786
- senderEmail: z2.string().optional(),
787
- senderDisplayName: z2.string().optional(),
788
- senderAvatarUrl: z2.string().optional(),
789
- errorNotificationTarget: z2.discriminatedUnion("type", [
790
- z2.object({ type: z2.literal("slack") }),
791
- z2.object({ type: z2.literal("linear"), sessionId: z2.string().min(1) }),
792
- z2.object({
793
- type: z2.literal("code_host"),
794
- provider: z2.enum(["github", "gitlab"]),
795
- resource: z2.enum(["issue", "pull_request"]),
796
- repositoryId: z2.string().min(1),
797
- resourceNumber: z2.number().int().positive()
845
+ canvasUploadIds: z3.array(z3.string().min(1)).optional(),
846
+ thinkingLevel: z3.enum(VALID_THINKING_LEVELS).optional(),
847
+ goalMode: z3.boolean().optional(),
848
+ fastMode: z3.boolean().optional(),
849
+ enableInteractiveTools: z3.boolean().optional(),
850
+ type: z3.string().min(1).optional(),
851
+ merge: z3.boolean().optional(),
852
+ idempotencyKey: z3.string().min(1).max(128).optional(),
853
+ automationId: z3.string().optional(),
854
+ environmentId: z3.string().min(1).optional(),
855
+ senderUserId: z3.string().optional(),
856
+ senderEmail: z3.string().optional(),
857
+ senderDisplayName: z3.string().optional(),
858
+ senderAvatarUrl: z3.string().optional(),
859
+ errorNotificationTarget: z3.discriminatedUnion("type", [
860
+ z3.object({ type: z3.literal("slack") }),
861
+ z3.object({ type: z3.literal("linear"), sessionId: z3.string().min(1) }),
862
+ z3.object({
863
+ type: z3.literal("code_host"),
864
+ provider: z3.enum(["github", "gitlab"]),
865
+ resource: z3.enum(["issue", "pull_request"]),
866
+ repositoryId: z3.string().min(1),
867
+ resourceNumber: z3.number().int().positive()
798
868
  }),
799
- z2.object({ type: z2.literal("automation"), executionId: z2.string().min(1) })
869
+ z3.object({ type: z3.literal("automation"), executionId: z3.string().min(1) })
800
870
  ]).optional()
801
871
  }).passthrough();
802
872
  function isChatMessageSender(value) {
@@ -1264,45 +1334,45 @@ function gitIdentityConfigCommands(identity, scope = "global") {
1264
1334
  }
1265
1335
 
1266
1336
  // ../shared/src/headless-agent.ts
1267
- import { z as z3 } from "zod";
1268
- var headlessAgentRequestBaseSchema = z3.object({
1269
- agent: z3.custom(
1337
+ import { z as z4 } from "zod";
1338
+ var headlessAgentRequestBaseSchema = z4.object({
1339
+ agent: z4.custom(
1270
1340
  (value) => typeof value === "string" && isValidCodingAgentProvider(value)
1271
1341
  ),
1272
- model: z3.string().min(1),
1273
- prompt: z3.string(),
1274
- workingDirectory: z3.string().min(1),
1275
- timeoutSeconds: z3.number().int().min(1).max(1800).default(300),
1276
- codexOauthTokens: z3.object({ accessToken: z3.string(), accountId: z3.string() }).optional()
1342
+ model: z4.string().min(1),
1343
+ prompt: z4.string(),
1344
+ workingDirectory: z4.string().min(1),
1345
+ timeoutSeconds: z4.number().int().min(1).max(1800).default(300),
1346
+ codexOauthTokens: z4.object({ accessToken: z4.string(), accountId: z4.string() }).optional()
1277
1347
  });
1278
- var headlessAgentInputFileSchema = z3.object({
1279
- path: z3.string().min(1),
1280
- downloadUrl: z3.url()
1348
+ var headlessAgentInputFileSchema = z4.object({
1349
+ path: z4.string().min(1),
1350
+ downloadUrl: z4.url()
1281
1351
  });
1282
- var headlessAgentOutputFileSchema = z3.object({
1283
- path: z3.string().min(1),
1284
- uploadUrl: z3.url(),
1285
- contentType: z3.string().min(1),
1286
- minChars: z3.number().int().positive().optional(),
1287
- maxChars: z3.number().int().positive().optional()
1352
+ var headlessAgentOutputFileSchema = z4.object({
1353
+ path: z4.string().min(1),
1354
+ uploadUrl: z4.url(),
1355
+ contentType: z4.string().min(1),
1356
+ minChars: z4.number().int().positive().optional(),
1357
+ maxChars: z4.number().int().positive().optional()
1288
1358
  });
1289
- var headlessAgentRequestSchema = z3.discriminatedUnion("mode", [
1359
+ var headlessAgentRequestSchema = z4.discriminatedUnion("mode", [
1290
1360
  headlessAgentRequestBaseSchema.extend({
1291
- mode: z3.literal("structured"),
1292
- outputSchema: z3.record(z3.string(), z3.json())
1361
+ mode: z4.literal("structured"),
1362
+ outputSchema: z4.record(z4.string(), z4.json())
1293
1363
  }),
1294
1364
  headlessAgentRequestBaseSchema.extend({
1295
- mode: z3.literal("filesystem"),
1296
- inputFiles: z3.array(headlessAgentInputFileSchema),
1297
- outputFiles: z3.array(headlessAgentOutputFileSchema),
1298
- sensitiveValues: z3.array(z3.string())
1365
+ mode: z4.literal("filesystem"),
1366
+ inputFiles: z4.array(headlessAgentInputFileSchema),
1367
+ outputFiles: z4.array(headlessAgentOutputFileSchema),
1368
+ sensitiveValues: z4.array(z4.string())
1299
1369
  })
1300
1370
  ]);
1301
- var headlessFilesystemAgentResultSchema = z3.object({
1302
- message: z3.string(),
1303
- files: z3.record(z3.string(), z3.object({
1304
- sha256: z3.string().regex(/^[a-f0-9]{64}$/),
1305
- sizeBytes: z3.number().int().nonnegative()
1371
+ var headlessFilesystemAgentResultSchema = z4.object({
1372
+ message: z4.string(),
1373
+ files: z4.record(z4.string(), z4.object({
1374
+ sha256: z4.string().regex(/^[a-f0-9]{64}$/),
1375
+ sizeBytes: z4.number().int().nonnegative()
1306
1376
  }))
1307
1377
  });
1308
1378
 
@@ -1378,55 +1448,55 @@ function describeAuthFallback(payload) {
1378
1448
  }
1379
1449
 
1380
1450
  // ../shared/src/chat-fork.ts
1381
- import { z as z5 } from "zod";
1451
+ import { z as z6 } from "zod";
1382
1452
 
1383
1453
  // ../shared/src/fallback-chains.ts
1384
- import { z as z4 } from "zod";
1385
- var fallbackHarnessStepSchema = z4.object({
1386
- kind: z4.literal("harness"),
1387
- provider: z4.enum(VALID_AGENT_PROVIDERS),
1388
- model: z4.string().min(1),
1389
- thinkingLevel: z4.enum(VALID_THINKING_LEVELS).optional()
1454
+ import { z as z5 } from "zod";
1455
+ var fallbackHarnessStepSchema = z5.object({
1456
+ kind: z5.literal("harness"),
1457
+ provider: z5.enum(VALID_AGENT_PROVIDERS),
1458
+ model: z5.string().min(1),
1459
+ thinkingLevel: z5.enum(VALID_THINKING_LEVELS).optional()
1390
1460
  });
1391
- var fallbackPlanStepSchema = z4.discriminatedUnion("kind", [
1392
- z4.object({ kind: z4.literal("credentials"), methods: z4.array(z4.custom(isAuthMethod)).min(1) }),
1461
+ var fallbackPlanStepSchema = z5.discriminatedUnion("kind", [
1462
+ z5.object({ kind: z5.literal("credentials"), methods: z5.array(z5.custom(isAuthMethod)).min(1) }),
1393
1463
  fallbackHarnessStepSchema
1394
1464
  ]);
1395
- var fallbackPlanResponseSchema = z4.object({ steps: z4.array(fallbackPlanStepSchema) });
1465
+ var fallbackPlanResponseSchema = z5.object({ steps: z5.array(fallbackPlanStepSchema) });
1396
1466
 
1397
1467
  // ../shared/src/chat-fork.ts
1398
- var quotaLimitKindSchema = z5.enum(["rate_limit", "out_of_credits"]);
1399
- var chatForkInfoSchema = z5.object({
1400
- source: z5.object({
1401
- chatId: z5.string().min(1),
1402
- provider: z5.enum(VALID_AGENT_PROVIDERS),
1403
- title: z5.string()
1468
+ var quotaLimitKindSchema = z6.enum(["rate_limit", "out_of_credits"]);
1469
+ var chatForkInfoSchema = z6.object({
1470
+ source: z6.object({
1471
+ chatId: z6.string().min(1),
1472
+ provider: z6.enum(VALID_AGENT_PROVIDERS),
1473
+ title: z6.string()
1404
1474
  }),
1405
- trigger: z5.enum(["manual", "auto"]),
1475
+ trigger: z6.enum(["manual", "auto"]),
1406
1476
  reason: quotaLimitKindSchema.optional(),
1407
- state: z5.enum(["preparing", "ready", "failed"]),
1408
- error: z5.string().optional(),
1409
- startedAt: z5.string(),
1410
- completedAt: z5.string().optional()
1477
+ state: z6.enum(["preparing", "ready", "failed"]),
1478
+ error: z6.string().optional(),
1479
+ startedAt: z6.string(),
1480
+ completedAt: z6.string().optional()
1411
1481
  });
1412
1482
  function coerceChatForkInfo(value) {
1413
1483
  const parsed = chatForkInfoSchema.safeParse(value);
1414
1484
  return parsed.success ? parsed.data : null;
1415
1485
  }
1416
- var forkChatRequestSchema = z5.object({
1417
- provider: z5.enum(VALID_AGENT_PROVIDERS),
1418
- model: z5.string().min(1).optional(),
1419
- thinkingLevel: z5.enum(VALID_THINKING_LEVELS).optional(),
1420
- title: z5.string().min(1).max(200).optional(),
1421
- message: z5.string().trim().optional(),
1422
- id: z5.string().uuid().optional(),
1423
- clientRequestId: z5.string().min(1).max(128).optional(),
1424
- enableInteractiveTools: z5.boolean().optional(),
1486
+ var forkChatRequestSchema = z6.object({
1487
+ provider: z6.enum(VALID_AGENT_PROVIDERS),
1488
+ model: z6.string().min(1).optional(),
1489
+ thinkingLevel: z6.enum(VALID_THINKING_LEVELS).optional(),
1490
+ title: z6.string().min(1).max(200).optional(),
1491
+ message: z6.string().trim().optional(),
1492
+ id: z6.string().uuid().optional(),
1493
+ clientRequestId: z6.string().min(1).max(128).optional(),
1494
+ enableInteractiveTools: z6.boolean().optional(),
1425
1495
  // Server-injected by the monolith from the authenticated request; never trusted from clients.
1426
- senderUserId: z5.string().optional(),
1427
- senderEmail: z5.string().optional(),
1428
- senderDisplayName: z5.string().optional(),
1429
- senderAvatarUrl: z5.string().optional()
1496
+ senderUserId: z6.string().optional(),
1497
+ senderEmail: z6.string().optional(),
1498
+ senderDisplayName: z6.string().optional(),
1499
+ senderAvatarUrl: z6.string().optional()
1430
1500
  });
1431
1501
  function describeQuotaLimit(reason) {
1432
1502
  return reason === "out_of_credits" ? "ran out of credits" : "hit its usage limit";
@@ -1435,10 +1505,10 @@ function describeChatForkReason(reason, provider) {
1435
1505
  return reason ? `${getProviderDisplayName(provider)} ${describeQuotaLimit(reason)}` : null;
1436
1506
  }
1437
1507
  var AGENT_QUOTA_EXHAUSTED_EVENT_TYPE = "agent-quota-exhausted";
1438
- var agentQuotaExhaustedPayloadSchema = z5.object({
1439
- provider: z5.enum(VALID_CODING_AGENT_PROVIDERS),
1508
+ var agentQuotaExhaustedPayloadSchema = z6.object({
1509
+ provider: z6.enum(VALID_CODING_AGENT_PROVIDERS),
1440
1510
  reason: quotaLimitKindSchema,
1441
- detail: z5.string().optional(),
1511
+ detail: z6.string().optional(),
1442
1512
  forkTo: fallbackHarnessStepSchema.optional()
1443
1513
  });
1444
1514
  function defaultForkChatTitle(source, provider) {
@@ -3458,6 +3528,7 @@ var DEFAULT_USER_PREFERENCES = {
3458
3528
  codex_hidden_models: null,
3459
3529
  cursor_hidden_models: null,
3460
3530
  openrouter_models: null,
3531
+ opencode_go_models: null,
3461
3532
  close_workspace_on_pr_close: true,
3462
3533
  close_workspace_on_pr_merge: true,
3463
3534
  default_environment_id: null,
@@ -6262,46 +6333,6 @@ var PLANS = {
6262
6333
  var TEAM_PLAN = PLANS.team;
6263
6334
  var ENTERPRISE_PLAN = PLANS.enterprise;
6264
6335
 
6265
- // ../shared/src/models-dev.ts
6266
- import { z as z6 } from "zod";
6267
- var MODELS_DEV_API_URL = "https://models.dev/api.json";
6268
- var MODELS_DEV_CACHE_MS = 5 * 6e4;
6269
- var modelsDevCatalogSchema = z6.record(z6.string(), z6.object({
6270
- models: z6.record(z6.string(), z6.object({
6271
- id: z6.string().optional(),
6272
- name: z6.string(),
6273
- description: z6.string().optional(),
6274
- status: z6.enum(["alpha", "beta", "deprecated"]).optional(),
6275
- provider: z6.object({ npm: z6.string().optional() }).optional(),
6276
- cost: z6.object({
6277
- input: z6.number().finite().nonnegative().optional(),
6278
- output: z6.number().finite().nonnegative().optional(),
6279
- cache_read: z6.number().finite().nonnegative().optional(),
6280
- cache_write: z6.number().finite().nonnegative().optional()
6281
- }).optional()
6282
- }))
6283
- }));
6284
- var catalogCache;
6285
- var catalogRequest;
6286
- async function fetchModelsDevCatalog() {
6287
- if (catalogCache && catalogCache.expiresAt > Date.now()) return catalogCache.catalog;
6288
- catalogRequest ??= (async () => {
6289
- const response = await fetch(MODELS_DEV_API_URL, { signal: AbortSignal.timeout(5e3) });
6290
- if (!response.ok) throw new Error(`Failed to load models.dev catalog (${response.status})`);
6291
- return modelsDevCatalogSchema.parse(await response.json());
6292
- })();
6293
- try {
6294
- const catalog = await catalogRequest;
6295
- catalogCache = { catalog, expiresAt: Date.now() + MODELS_DEV_CACHE_MS };
6296
- return catalog;
6297
- } catch (error) {
6298
- if (catalogCache) return catalogCache.catalog;
6299
- throw error;
6300
- } finally {
6301
- catalogRequest = void 0;
6302
- }
6303
- }
6304
-
6305
6336
  // ../shared/src/egress.ts
6306
6337
  var EGRESS_CIPHER = "2022-blake3-aes-256-gcm";
6307
6338
  var EGRESS_KEY_BYTES = 32;
@@ -7628,6 +7659,10 @@ export {
7628
7659
  ASTER_MODELS,
7629
7660
  DEFAULT_ASTER_MODEL,
7630
7661
  ASTER_MODEL_LABELS,
7662
+ OPENCODE_GO_PROVIDER,
7663
+ OPENCODE_GO_BASE_URL,
7664
+ DEFAULT_OPENCODE_GO_MODEL,
7665
+ fetchOpenCodeGoCatalog,
7631
7666
  DEFAULT_CHAT_TITLES,
7632
7667
  isDefaultChat,
7633
7668
  CLAUDE_FABLE_5_1_MODEL,
@@ -7746,7 +7781,6 @@ export {
7746
7781
  clampTokensToWindow,
7747
7782
  buildCodexTokenUsageContextUsagePayload,
7748
7783
  extractLatestContextUsage,
7749
- fetchModelsDevCatalog,
7750
7784
  SANDBOX_PATHS,
7751
7785
  REPLICAS_RUNTIME_ENV_ALIASES,
7752
7786
  readReplicasRuntimeEnv,
@@ -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-QU3TVTVW.js";
7
+ } from "./chunk-6MFMPKRG.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.803";
244
+ var ENGINE_PACKAGE_VERSION = "0.1.804";
245
245
  var INITIALIZE_METHOD = "initialize";
246
246
  var INITIALIZED_NOTIFICATION = "initialized";
247
247
  var ACCOUNT_LOGIN_START_METHOD = "account/login/start";
@@ -15,7 +15,7 @@ import {
15
15
  isValidRelayBaseProvider,
16
16
  parsePosixEnvFile,
17
17
  readReplicasRuntimeEnv
18
- } from "./chunk-QU3TVTVW.js";
18
+ } from "./chunk-6MFMPKRG.js";
19
19
 
20
20
  // src/engine-env.ts
21
21
  import { readFileSync as readFileSync2 } from "fs";
@@ -4,7 +4,7 @@ const require = __createRequire(import.meta.url);
4
4
  import {
5
5
  findCodeHostPullRequestUrls,
6
6
  mayCreatePullRequest
7
- } from "./chunk-QU3TVTVW.js";
7
+ } from "./chunk-6MFMPKRG.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-QBLEGBFV.js";
8
+ } from "./chunk-HVVAIQOZ.js";
9
9
  import {
10
10
  AppServerProcess,
11
11
  buildCodexAgentEnv
12
- } from "./chunk-2LUYBPAX.js";
12
+ } from "./chunk-7ZLO77GJ.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-QU3TVTVW.js";
19
+ } from "./chunk-6MFMPKRG.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-XJZVAUPU.js");
235
+ const { restartCodexAspHostIfRunning: restartCodexAspHostIfRunning2 } = await import("./asp-host-HYG3E6NG.js");
236
236
  await restartCodexAspHostIfRunning2();
237
237
  }
238
238
  if (data.scope) {
@@ -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-QBLEGBFV.js";
6
+ } from "./chunk-HVVAIQOZ.js";
7
7
  import {
8
8
  extractCommandProtectionCommandText,
9
9
  findGitCommitSignals,
10
10
  findPrMergeSignals
11
- } from "./chunk-QU3TVTVW.js";
11
+ } from "./chunk-6MFMPKRG.js";
12
12
 
13
13
  // src/services/command-protection-service.ts
14
14
  var DEFAULT_COMMAND_PROTECTION_BLOCK_MESSAGE = "Blocked by Replicas command protection.";
@@ -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-CN7WBEPB.js";
7
- import "./chunk-QBLEGBFV.js";
6
+ } from "./chunk-XPZB23KL.js";
7
+ import "./chunk-HVVAIQOZ.js";
8
8
  import {
9
9
  isRecord
10
10
  } from "./chunk-UZSNFLDQ.js";
11
- import "./chunk-QU3TVTVW.js";
11
+ import "./chunk-6MFMPKRG.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-CN7WBEPB.js";
6
+ } from "./chunk-XPZB23KL.js";
7
7
  import {
8
8
  notifyPostToolUse
9
- } from "./chunk-T5ENS6BG.js";
10
- import "./chunk-QBLEGBFV.js";
9
+ } from "./chunk-K3XGH4NJ.js";
10
+ import "./chunk-HVVAIQOZ.js";
11
11
  import "./chunk-UZSNFLDQ.js";
12
- import "./chunk-QU3TVTVW.js";
12
+ import "./chunk-6MFMPKRG.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-2LUYBPAX.js";
11
+ } from "./chunk-7ZLO77GJ.js";
12
12
  import {
13
13
  AGENT,
14
14
  getMemoryOutputSafetyViolation,
15
15
  headlessAgentRequestSchema
16
- } from "./chunk-QU3TVTVW.js";
16
+ } from "./chunk-6MFMPKRG.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-CN7WBEPB.js";
94
+ } from "./chunk-XPZB23KL.js";
95
95
  import {
96
96
  ACCOUNT_RATE_LIMITS_UPDATED_METHOD,
97
97
  AGENT_MESSAGE_DELTA_METHOD,
@@ -124,20 +124,20 @@ import {
124
124
  recordCredentialFallback,
125
125
  recordExhaustedCredential,
126
126
  restartCodexAspHost
127
- } from "./chunk-W6XLA2JR.js";
127
+ } from "./chunk-NFHLOVTM.js";
128
128
  import {
129
129
  ENGINE_ENV,
130
130
  IS_WARMING_MODE,
131
131
  monolithRequest,
132
132
  monolithService,
133
133
  setAgentCredentialSnapshot
134
- } from "./chunk-QBLEGBFV.js";
134
+ } from "./chunk-HVVAIQOZ.js";
135
135
  import {
136
136
  AspClient,
137
137
  SUBPROCESS_MAX_BUFFER,
138
138
  execAsync,
139
139
  execFileAsync
140
- } from "./chunk-2LUYBPAX.js";
140
+ } from "./chunk-7ZLO77GJ.js";
141
141
  import {
142
142
  isRecord as isRecord2
143
143
  } from "./chunk-UZSNFLDQ.js";
@@ -187,6 +187,7 @@ import {
187
187
  DEFAULT_HOOK_OUTPUT_PREVIEW_CHARS,
188
188
  DEFAULT_KIMI_MODEL,
189
189
  DEFAULT_MUSE_MODEL,
190
+ DEFAULT_OPENCODE_GO_MODEL,
190
191
  DEFAULT_OPENCODE_MODEL,
191
192
  DEFAULT_PI_MODEL,
192
193
  DEFAULT_RELAY_BASE_PROVIDER,
@@ -208,6 +209,8 @@ import {
208
209
  MEMORY_INDEX_FILENAME,
209
210
  MEMORY_ROOT,
210
211
  MERGED_MESSAGE_SEPARATOR,
212
+ OPENCODE_GO_BASE_URL,
213
+ OPENCODE_GO_PROVIDER,
211
214
  QUEUED_MESSAGE_REMOVED_EVENT_TYPE,
212
215
  REMOVED_MESSAGE_IDS_PAYLOAD_KEY,
213
216
  REPLICAS_CONFIG_FILENAMES,
@@ -256,7 +259,7 @@ import {
256
259
  extractLatestContextUsage,
257
260
  extractToolResultText,
258
261
  fetchAiGatewayModels,
259
- fetchModelsDevCatalog,
262
+ fetchOpenCodeGoCatalog,
260
263
  findCodeHostPullRequestUrls,
261
264
  forkChatRequestSchema,
262
265
  formatChatForkHandoffMessage,
@@ -338,7 +341,7 @@ import {
338
341
  spawnRelaySubagentRequestSchema,
339
342
  stripAgentDiagnosticErrors,
340
343
  withTimeout
341
- } from "./chunk-QU3TVTVW.js";
344
+ } from "./chunk-6MFMPKRG.js";
342
345
  import {
343
346
  __commonJS,
344
347
  __export,
@@ -18335,38 +18338,6 @@ import { randomBytes as randomBytes3 } from "crypto";
18335
18338
  import { fileURLToPath as fileURLToPath4 } from "url";
18336
18339
  import { Agent } from "undici";
18337
18340
  import { z as z3 } from "zod";
18338
-
18339
- // ../shared/src/credentials/opencode-go.ts
18340
- var OPENCODE_GO_PROVIDER = "opencode-go";
18341
- var OPENCODE_GO_BASE_URL = "https://opencode.ai/zen/go/v1";
18342
- var DEFAULT_OPENCODE_GO_MODEL = "glm-5.2";
18343
- async function fetchOpenCodeGoCatalog(fallbackModelIds = [DEFAULT_OPENCODE_GO_MODEL]) {
18344
- try {
18345
- const provider = (await fetchModelsDevCatalog())[OPENCODE_GO_PROVIDER];
18346
- if (!provider) throw new Error("OpenCode Go model catalog is unavailable");
18347
- const models = Object.fromEntries(
18348
- Object.entries(provider.models).filter(([, definition]) => definition.status !== "deprecated" && definition.status !== "alpha").map(([id, definition]) => [id, {
18349
- id: definition.id ?? id,
18350
- name: definition.name,
18351
- api: definition.provider?.npm === "@ai-sdk/anthropic" ? "anthropic-messages" : definition.provider?.npm === "@ai-sdk/openai" ? "openai-responses" : void 0,
18352
- ...definition.description ? { description: definition.description } : {},
18353
- ...definition.status ? { status: definition.status } : {}
18354
- }])
18355
- );
18356
- if (Object.keys(models).length === 0) throw new Error("OpenCode Go model catalog is unavailable");
18357
- return { models, authoritative: true };
18358
- } catch {
18359
- return {
18360
- authoritative: false,
18361
- models: Object.fromEntries(fallbackModelIds.map((id) => [id, {
18362
- id,
18363
- name: id === DEFAULT_OPENCODE_GO_MODEL ? "GLM 5.2" : id
18364
- }]))
18365
- };
18366
- }
18367
- }
18368
-
18369
- // src/managers/opencode-manager.ts
18370
18341
  import {
18371
18342
  createOpencodeClient,
18372
18343
  createOpencodeServer
@@ -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-T5ENS6BG.js";
6
+ } from "./chunk-K3XGH4NJ.js";
7
7
  import {
8
8
  isRecord
9
9
  } from "./chunk-UZSNFLDQ.js";
10
- import "./chunk-QU3TVTVW.js";
10
+ import "./chunk-6MFMPKRG.js";
11
11
  import "./chunk-VEQXQN22.js";
12
12
 
13
13
  // src/post-tool-pr-hook.ts
@@ -4,7 +4,7 @@ const require = __createRequire(import.meta.url);
4
4
  import {
5
5
  messageRelaySubagentRequestSchema,
6
6
  spawnRelaySubagentRequestSchema
7
- } from "./chunk-QU3TVTVW.js";
7
+ } from "./chunk-6MFMPKRG.js";
8
8
  import "./chunk-VEQXQN22.js";
9
9
 
10
10
  // src/relay-mcp.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "replicas-engine",
3
- "version": "0.1.803",
3
+ "version": "0.1.804",
4
4
  "description": "Lightweight API server for Replicas workspaces",
5
5
  "type": "module",
6
6
  "main": "dist/src/index.js",