replicas-engine 0.1.853 → 0.1.856

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-HR5EZRDO.js";
9
- import "./chunk-TEPS7E4F.js";
10
- import "./chunk-YUJLKOSC.js";
8
+ } from "./chunk-JI4KYWFU.js";
9
+ import "./chunk-MXCUMUZM.js";
10
+ import "./chunk-RZ624RCY.js";
11
11
  import "./chunk-UZSNFLDQ.js";
12
- import "./chunk-AQ2GIHVZ.js";
12
+ import "./chunk-NNZ66E66.js";
13
13
  import "./chunk-VEQXQN22.js";
14
14
  export {
15
15
  getCodexAspHost,
@@ -5,13 +5,13 @@ import {
5
5
  ENGINE_ENV,
6
6
  monolithRequest,
7
7
  setAgentCredentialSnapshot
8
- } from "./chunk-TEPS7E4F.js";
8
+ } from "./chunk-MXCUMUZM.js";
9
9
  import {
10
10
  AppServerProcess,
11
11
  SUBPROCESS_MAX_BUFFER,
12
12
  buildCodexAgentEnv,
13
13
  execFileAsync
14
- } from "./chunk-YUJLKOSC.js";
14
+ } from "./chunk-RZ624RCY.js";
15
15
  import {
16
16
  isRecord
17
17
  } from "./chunk-UZSNFLDQ.js";
@@ -23,7 +23,7 @@ import {
23
23
  createSuccessResult,
24
24
  listOpenAICompatibleModels,
25
25
  resolveOpenAICompatibleModelsUrl
26
- } from "./chunk-AQ2GIHVZ.js";
26
+ } from "./chunk-NNZ66E66.js";
27
27
 
28
28
  // src/managers/codex-token-manager.ts
29
29
  import { promises as fs } from "fs";
@@ -244,7 +244,7 @@ var CodexTokenManager = class extends BaseRefreshManager {
244
244
  await this.applyCredentialUpdate(++this.credentialGeneration, async () => {
245
245
  await this.applyCredentialsResponse(data);
246
246
  if (data.scope) setAgentCredentialSnapshot("codex", { method: data.type, scope: data.scope, revision: data.revision });
247
- const { restartCodexAspHostIfRunning: restartCodexAspHostIfRunning2 } = await import("./asp-host-YGGXWXFL.js");
247
+ const { restartCodexAspHostIfRunning: restartCodexAspHostIfRunning2 } = await import("./asp-host-AUIMJUCY.js");
248
248
  await restartCodexAspHostIfRunning2();
249
249
  });
250
250
  await this.start(true);
@@ -264,7 +264,7 @@ var CodexTokenManager = class extends BaseRefreshManager {
264
264
  await this.applyCredentialUpdate(generation, async () => {
265
265
  await this.applyCredentialsResponse(data);
266
266
  if (restartOnChange && CODEX_AUTH_ENV_KEYS.some((key, index) => process.env[key] !== previousEnv[index])) {
267
- const { restartCodexAspHostIfRunning: restartCodexAspHostIfRunning2 } = await import("./asp-host-YGGXWXFL.js");
267
+ const { restartCodexAspHostIfRunning: restartCodexAspHostIfRunning2 } = await import("./asp-host-AUIMJUCY.js");
268
268
  await restartCodexAspHostIfRunning2();
269
269
  }
270
270
  if (data.scope) {
@@ -3,7 +3,7 @@ import { createRequire as __createRequire } from 'node:module';
3
3
  const require = __createRequire(import.meta.url);
4
4
  import {
5
5
  shouldRefreshPullRequests
6
- } from "./chunk-AQ2GIHVZ.js";
6
+ } from "./chunk-NNZ66E66.js";
7
7
 
8
8
  // src/services/post-tool-pr-notifier.ts
9
9
  async function notifyPostToolUse(toolName, toolInput) {
@@ -15,7 +15,7 @@ import {
15
15
  isValidRelayBaseProvider,
16
16
  parsePosixEnvFile,
17
17
  readReplicasRuntimeEnv
18
- } from "./chunk-AQ2GIHVZ.js";
18
+ } from "./chunk-NNZ66E66.js";
19
19
 
20
20
  // src/engine-env.ts
21
21
  import { readFileSync as readFileSync2 } from "fs";
@@ -798,9 +798,94 @@ function resolveOpenAICompatibleModelsUrl(values) {
798
798
  return values.modelsUrl || `${values.baseUrl}/models`;
799
799
  }
800
800
 
801
+ // ../shared/src/pricing.ts
802
+ var WORKSPACE_SOURCES = ["api", "dashboard", "slack", "linear", "github", "gitlab", "automation", "mothership"];
803
+ var CLIENT_MESSAGE_SOURCES = ["web", "desktop", "mobile", "tui"];
804
+ var MESSAGE_SOURCES = [...CLIENT_MESSAGE_SOURCES, ...WORKSPACE_SOURCES];
805
+ function isMessageSource(value) {
806
+ return typeof value === "string" && MESSAGE_SOURCES.some((source) => source === value);
807
+ }
808
+ var AUTOMATED_SOURCES = ["api", "automation"];
809
+ var AUTOMATED_SOURCES_SQL = AUTOMATED_SOURCES.map((s) => `'${s}'`).join(", ");
810
+ var DEVELOPER_SEAT_MINUTES = 150 * 60;
811
+ var DEVELOPER_SEAT_HOURS = DEVELOPER_SEAT_MINUTES / 60;
812
+ var PLANS = {
813
+ trial: {
814
+ id: "trial",
815
+ name: "Free Trial",
816
+ monthlyPrice: 0,
817
+ seatPriceCents: 0,
818
+ features: [
819
+ "14 days free, no credit card required",
820
+ "Unlimited manual workspace minutes",
821
+ "15,000 automated workspace minutes",
822
+ "Unlimited repositories and environments",
823
+ "Unlimited automations",
824
+ "Warm pools and warm hooks",
825
+ "API access"
826
+ ]
827
+ },
828
+ developer: {
829
+ id: "developer",
830
+ name: "Developer",
831
+ monthlyPrice: 50,
832
+ seatPriceCents: 5e3,
833
+ features: [
834
+ `${DEVELOPER_SEAT_HOURS} hours per seat per month`,
835
+ "API and automations billed by usage",
836
+ "Unlimited repositories",
837
+ "Unlimited environments",
838
+ "Unlimited automations",
839
+ "Warm pools and warm hooks",
840
+ "API access",
841
+ "Mobile app"
842
+ ]
843
+ },
844
+ team: {
845
+ id: "team",
846
+ name: "Team",
847
+ monthlyPrice: 200,
848
+ seatPriceCents: 2e4,
849
+ features: [
850
+ "Unlimited manual workspace minutes",
851
+ "API and automations billed by usage",
852
+ "Unlimited repositories",
853
+ "Unlimited automations",
854
+ "Warm pools and warm hooks",
855
+ "Higher API rate limits",
856
+ "Mobile app",
857
+ "Access to a static egress IP",
858
+ "Auto-upgraded sandbox resources (4 vCPU, 32 GB disk, 16 GB memory)",
859
+ "Shared Slack support channel"
860
+ ]
861
+ },
862
+ enterprise: {
863
+ id: "enterprise",
864
+ name: "Enterprise",
865
+ monthlyPrice: 0,
866
+ seatPriceCents: 0,
867
+ features: [
868
+ "Unlimited manual workspace minutes",
869
+ "Unlimited automated workspace minutes",
870
+ "Unlimited automations",
871
+ "Custom warm hooks and pools",
872
+ "Custom API rates",
873
+ "Mobile app",
874
+ "Custom rate limits",
875
+ "Shared Slack support channel",
876
+ "SOC 2",
877
+ "Data Processing Agreement (DPA)",
878
+ "SCIM user provisioning",
879
+ "Custom security and privacy settings"
880
+ ]
881
+ }
882
+ };
883
+ var TEAM_PLAN = PLANS.team;
884
+ var ENTERPRISE_PLAN = PLANS.enterprise;
885
+
801
886
  // ../shared/src/analytics/types.ts
802
887
  function hasAgentChatActivityFields(value) {
803
- return isRecord(value) && typeof value.chatId === "string" && typeof value.model === "string" && (value.credentialMethod === void 0 || isAuthMethod(value.credentialMethod)) && (value.credentialScope === void 0 || isCredentialScope(value.credentialScope)) && value.credentialMethod === void 0 === (value.credentialScope === void 0) && (value.senderUserId === void 0 || typeof value.senderUserId === "string") && typeof value.occurredAt === "string";
888
+ return isRecord(value) && typeof value.chatId === "string" && typeof value.model === "string" && (value.credentialMethod === void 0 || isAuthMethod(value.credentialMethod)) && (value.credentialScope === void 0 || isCredentialScope(value.credentialScope)) && value.credentialMethod === void 0 === (value.credentialScope === void 0) && (value.senderUserId === void 0 || typeof value.senderUserId === "string") && (value.source === void 0 || isMessageSource(value.source)) && typeof value.occurredAt === "string";
804
889
  }
805
890
  function isAgentChatActivityRecord(value) {
806
891
  return hasAgentChatActivityFields(value) && typeof value.provider === "string" && isValidAgentProvider(value.provider);
@@ -1026,6 +1111,7 @@ var sendChatMessageRequestSchema = z3.object({
1026
1111
  thinkingLevel: z3.enum(VALID_THINKING_LEVELS).optional(),
1027
1112
  goalMode: z3.boolean().optional(),
1028
1113
  fastMode: z3.boolean().optional(),
1114
+ source: z3.enum(MESSAGE_SOURCES).optional(),
1029
1115
  enableInteractiveTools: z3.boolean().optional(),
1030
1116
  type: z3.string().min(1).optional(),
1031
1117
  merge: z3.boolean().optional(),
@@ -6498,85 +6584,6 @@ function extractLatestContextUsage(events, provider) {
6498
6584
  return latest;
6499
6585
  }
6500
6586
 
6501
- // ../shared/src/pricing.ts
6502
- var AUTOMATED_SOURCES = ["api", "automation"];
6503
- var AUTOMATED_SOURCES_SQL = AUTOMATED_SOURCES.map((s) => `'${s}'`).join(", ");
6504
- var DEVELOPER_SEAT_MINUTES = 150 * 60;
6505
- var DEVELOPER_SEAT_HOURS = DEVELOPER_SEAT_MINUTES / 60;
6506
- var PLANS = {
6507
- trial: {
6508
- id: "trial",
6509
- name: "Free Trial",
6510
- monthlyPrice: 0,
6511
- seatPriceCents: 0,
6512
- features: [
6513
- "14 days free, no credit card required",
6514
- "Unlimited manual workspace minutes",
6515
- "15,000 automated workspace minutes",
6516
- "Unlimited repositories and environments",
6517
- "Unlimited automations",
6518
- "Warm pools and warm hooks",
6519
- "API access"
6520
- ]
6521
- },
6522
- developer: {
6523
- id: "developer",
6524
- name: "Developer",
6525
- monthlyPrice: 50,
6526
- seatPriceCents: 5e3,
6527
- features: [
6528
- `${DEVELOPER_SEAT_HOURS} hours per seat per month`,
6529
- "API and automations billed by usage",
6530
- "Unlimited repositories",
6531
- "Unlimited environments",
6532
- "Unlimited automations",
6533
- "Warm pools and warm hooks",
6534
- "API access",
6535
- "Mobile app"
6536
- ]
6537
- },
6538
- team: {
6539
- id: "team",
6540
- name: "Team",
6541
- monthlyPrice: 200,
6542
- seatPriceCents: 2e4,
6543
- features: [
6544
- "Unlimited manual workspace minutes",
6545
- "API and automations billed by usage",
6546
- "Unlimited repositories",
6547
- "Unlimited automations",
6548
- "Warm pools and warm hooks",
6549
- "Higher API rate limits",
6550
- "Mobile app",
6551
- "Access to a static egress IP",
6552
- "Auto-upgraded sandbox resources (4 vCPU, 32 GB disk, 16 GB memory)",
6553
- "Shared Slack support channel"
6554
- ]
6555
- },
6556
- enterprise: {
6557
- id: "enterprise",
6558
- name: "Enterprise",
6559
- monthlyPrice: 0,
6560
- seatPriceCents: 0,
6561
- features: [
6562
- "Unlimited manual workspace minutes",
6563
- "Unlimited automated workspace minutes",
6564
- "Unlimited automations",
6565
- "Custom warm hooks and pools",
6566
- "Custom API rates",
6567
- "Mobile app",
6568
- "Custom rate limits",
6569
- "Shared Slack support channel",
6570
- "SOC 2",
6571
- "Data Processing Agreement (DPA)",
6572
- "SCIM user provisioning",
6573
- "Custom security and privacy settings"
6574
- ]
6575
- }
6576
- };
6577
- var TEAM_PLAN = PLANS.team;
6578
- var ENTERPRISE_PLAN = PLANS.enterprise;
6579
-
6580
6587
  // ../shared/src/egress.ts
6581
6588
  var EGRESS_CIPHER = "2022-blake3-aes-256-gcm";
6582
6589
  var EGRESS_KEY_BYTES = 32;
@@ -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-AQ2GIHVZ.js";
7
+ } from "./chunk-NNZ66E66.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.853";
244
+ var ENGINE_PACKAGE_VERSION = "0.1.856";
245
245
  var INITIALIZE_METHOD = "initialize";
246
246
  var INITIALIZED_NOTIFICATION = "initialized";
247
247
  var ACCOUNT_LOGIN_START_METHOD = "account/login/start";
@@ -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-TEPS7E4F.js";
6
+ } from "./chunk-MXCUMUZM.js";
7
7
  import {
8
8
  extractCommandProtectionCommandText,
9
9
  findGitCommitSignals,
10
10
  findPrMergeSignals
11
- } from "./chunk-AQ2GIHVZ.js";
11
+ } from "./chunk-NNZ66E66.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-ZK7QXKBP.js";
7
- import "./chunk-TEPS7E4F.js";
6
+ } from "./chunk-XUBRDOMD.js";
7
+ import "./chunk-MXCUMUZM.js";
8
8
  import {
9
9
  isRecord
10
10
  } from "./chunk-UZSNFLDQ.js";
11
- import "./chunk-AQ2GIHVZ.js";
11
+ import "./chunk-NNZ66E66.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-ZK7QXKBP.js";
6
+ } from "./chunk-XUBRDOMD.js";
7
7
  import {
8
8
  notifyPostToolUse
9
- } from "./chunk-3KOIRE7F.js";
10
- import "./chunk-TEPS7E4F.js";
9
+ } from "./chunk-MI3FGOJ5.js";
10
+ import "./chunk-MXCUMUZM.js";
11
11
  import "./chunk-UZSNFLDQ.js";
12
- import "./chunk-AQ2GIHVZ.js";
12
+ import "./chunk-NNZ66E66.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-YUJLKOSC.js";
11
+ } from "./chunk-RZ624RCY.js";
12
12
  import {
13
13
  AGENT,
14
14
  getMemoryOutputSafetyViolation,
15
15
  headlessAgentRequestSchema
16
- } from "./chunk-AQ2GIHVZ.js";
16
+ } from "./chunk-NNZ66E66.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-ZK7QXKBP.js";
94
+ } from "./chunk-XUBRDOMD.js";
95
95
  import {
96
96
  ACCOUNT_RATE_LIMITS_UPDATED_METHOD,
97
97
  AGENT_MESSAGE_DELTA_METHOD,
@@ -132,20 +132,20 @@ import {
132
132
  recordCredentialFallback,
133
133
  recordExhaustedCredential,
134
134
  restartCodexAspHost
135
- } from "./chunk-HR5EZRDO.js";
135
+ } from "./chunk-JI4KYWFU.js";
136
136
  import {
137
137
  ENGINE_ENV,
138
138
  IS_WARMING_MODE,
139
139
  monolithRequest,
140
140
  monolithService,
141
141
  setAgentCredentialSnapshot
142
- } from "./chunk-TEPS7E4F.js";
142
+ } from "./chunk-MXCUMUZM.js";
143
143
  import {
144
144
  AspClient,
145
145
  SUBPROCESS_MAX_BUFFER,
146
146
  execAsync,
147
147
  execFileAsync
148
- } from "./chunk-YUJLKOSC.js";
148
+ } from "./chunk-RZ624RCY.js";
149
149
  import {
150
150
  isRecord as isRecord2
151
151
  } from "./chunk-UZSNFLDQ.js";
@@ -359,7 +359,7 @@ import {
359
359
  waitRelaySubagentRequestSchema,
360
360
  withTimeout,
361
361
  workspaceCredentialProviderSchema
362
- } from "./chunk-AQ2GIHVZ.js";
362
+ } from "./chunk-NNZ66E66.js";
363
363
  import {
364
364
  __commonJS,
365
365
  __export,
@@ -60191,7 +60191,8 @@ var AgentChatTurnActivityTracker = class {
60191
60191
  model: request.model,
60192
60192
  senderUserId: request.senderUserId,
60193
60193
  automationId: request.automationId,
60194
- environmentId: request.environmentId
60194
+ environmentId: request.environmentId,
60195
+ source: request.source
60195
60196
  });
60196
60197
  for (const key of this.pendingMessages.keys()) {
60197
60198
  if (this.pendingMessages.size <= MAX_TRACKED_MESSAGES) break;
@@ -60210,6 +60211,7 @@ var AgentChatTurnActivityTracker = class {
60210
60211
  senderUserId: attributes.senderUserId,
60211
60212
  automationId: attributes.automationId,
60212
60213
  environmentId: attributes.environmentId,
60214
+ source: attributes.source,
60213
60215
  credentialMethod: credential?.method,
60214
60216
  credentialScope: credential?.scope
60215
60217
  };
@@ -60236,6 +60238,7 @@ var AgentChatTurnActivityTracker = class {
60236
60238
  provider: turn.provider,
60237
60239
  model: turn.model,
60238
60240
  senderUserId: turn.senderUserId,
60241
+ source: turn.source,
60239
60242
  credentialMethod: turn.credentialMethod,
60240
60243
  credentialScope: turn.credentialScope,
60241
60244
  occurredAt: (/* @__PURE__ */ new Date()).toISOString(),
@@ -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-3KOIRE7F.js";
6
+ } from "./chunk-MI3FGOJ5.js";
7
7
  import {
8
8
  isRecord
9
9
  } from "./chunk-UZSNFLDQ.js";
10
- import "./chunk-AQ2GIHVZ.js";
10
+ import "./chunk-NNZ66E66.js";
11
11
  import "./chunk-VEQXQN22.js";
12
12
 
13
13
  // src/post-tool-pr-hook.ts
@@ -11,7 +11,7 @@ import {
11
11
  relaySubagentResponseSchema,
12
12
  spawnRelaySubagentRequestSchema,
13
13
  waitRelaySubagentRequestSchema
14
- } from "./chunk-AQ2GIHVZ.js";
14
+ } from "./chunk-NNZ66E66.js";
15
15
  import "./chunk-VEQXQN22.js";
16
16
 
17
17
  // src/relay-mcp.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "replicas-engine",
3
- "version": "0.1.853",
3
+ "version": "0.1.856",
4
4
  "description": "Lightweight API server for Replicas workspaces",
5
5
  "type": "module",
6
6
  "main": "dist/src/index.js",